Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Compressed for production with UglifyJS - now using GSet 1.0.1

  • Loading branch information...
commit 3df30950c696a3f89e049e096f80b8017506eefd 1 parent 161691c
@bemson authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 flow-min.js
View
7 flow-min.js
@@ -1,12 +1,11 @@
/*
- * Flow v0.2.0
+ * Flow v0.2.1
* http://github.com/bemson/Flow/
*
- * GSet v1.0.0
+ * GSet v1.0.1
* http://github.com/bemson/GSet/
*
* Copyright 2011, Bemi Faison
* Both released under the MIT License
*/
-(function(){var a={gvsCall:function(g,f,d,c,b){return(function e(){return g.apply(f,d)}).apply(c,b)},gsetCall:function(b,c){return function(){return b._gset.apply(b,[c].concat(arguments.length?[].slice.call(arguments):[]))}},customCall:function(e,c,d,b,g){var f=[b,d,"custom"];return function(){var h=arguments;if(!g(h,f)){return !1}return a.gvsCall(c[d],e,h,b,f)}},typeMap:{string:"s","[object Array]":"a","function":"f","[object Function]":"f"},rxp:{rtnFnc:/\breturn\b/,fsType:/[fs]/,afsType:/[afs]/},getType:function(c){var b=a.typeMap[typeof c]||a.typeMap[Object.prototype.toString.call(c)];return b&&(b!=="s"||b.length)?b:0},testValueTypes:function(f,b){var e=0,c=b.length,h,k=f.length,d,g=1;for(;e<c;e++){d=typeof b[e];g=0;for(h=0;h<k;h++){if(f[h]===d){g=1;break}}if(!g){break}}return g}};GSet=function(b,c){var f=this,k=arguments,i,g,o=a.rxp.rtnFnc,h=a.getType,m={},n=function(q,s){var r=s[1],p=!m[r];if(p&&h){m[r]=1;if(a.gvsCall(h,b,q,f,s)===!1){p=0}m[r]=0}return p},e,d,l,j;if(!(f.hasOwnProperty&&f instanceof GSet)){throw new Error("GSet: missing new operator")}if(b==null){throw new Error("GSet: invalid source")}if(k.length>2){if(k.length>3){h=[typeof k[2],typeof k[3],"function"];if((h[0]===h[2])===(h[1]===h[2])){throw new Error("GSet: too many or too few gate functions")}o=k[h[0]===h[2]?3:2];h=k[h[0]===h[2]?2:3]}else{if(typeof k[2]==="function"){h=k[2]}else{o=k[2]}}}if(c instanceof GSet){c=c._gset(a);i=c[0];g=c[1];if(o===a.rxp.rtnFnc){o=c[2]}if(h===a.getType){h=c[3]}c=c[4];for(l in g){if(g.hasOwnProperty(l)){m[l]=0;if(g[l]===2){f[l]=a.customCall(b,c,l,f,n)}else{f[l]=a.gsetCall(f,l)}}}}else{i={};g={};for(l in c){if(!c.hasOwnProperty(l)){continue}m[l]=0;e=c[l];d=a.getType(e);if(d==="f"){f[l]=a.customCall(b,c,l,f,n);g[l]=2}else{j={get:0,set:0};if(d!=="a"||(e.length===1&&(d=a.getType(e[0]))==="a")){if(d==="a"){c[l]=e[0];j.isAry=1}j.get=1;j.fixed=1;j.fixedValue=c[l]}else{if(!e.length){e=c[l]=[l,1]}d=[a.getType(e[0]),a.getType(e[1]),a.getType(e[2])];if((d[0]==="f"&&!a.rxp.rtnFnc.test(e[0]+""))||(d[1]==="f"&&!a.rxp.rtnFnc.test(e[1]+""))){continue}if(e[0]){j.get=1;j[d[0]==="f"?"getter":"getProperty"]=a.rxp.fsType.test(d[0])?e[0]:l}if(e[2]){j.set=1;j.validAny=1;if(a.rxp.fsType.test(d[2])){j[d[2]==="f"?"setter":"setProperty"]=e[2]}else{if(j.get){j[j.getter?"setter":"setProperty"]=j.getter||j.getProperty}}}else{if(e.length>2){j.set=0}}if(e[1]&&(e.length<3||j.set)){j.set=1;j.validAny=!a.rxp.afsType.test(d[1]);if(!j.validAny){j[d[1]==="f"?"validator":"types"]=d[1]==="s"?[e[1]]:e[1]}}}if(j.get||j.set){g[l]=j.get-j.set;i[l]=j;f[l]=a.gsetCall(f,l)}}}}if(h===a.getType){h=0}f._gset=function(t){var s=arguments,q=[].slice.call(arguments,1),u=q.length,v=u?"set":"get",w=[f,t,u?"vet":v],p=i.hasOwnProperty(t)&&i[t],r;if(!s.length){r=function(){};r.prototype=g;return new r()}if(t===o){return b}if(t===a){return[i,g,o,h,c]}if(p){if(p[v]){if(!n(q,w)){return !1}if(p.fixed){return p.isAry?p.fixedValue.concat():p.fixedValue}if(u){if(p.validAny||(p.validator&&a.gvsCall(p.validator,b,q,f,w))||(p.types&&a.testValueTypes(p.types,q))){if((p.setter||(!p.setProperty&&p.getter))&&w.splice(2,1,"set")){v=a.gvsCall(p.setter||p.getter,b,q,f,w);return(v===undefined)?!0:(u?!!v:v)}b[(v=p.setProperty||t)]=q[0];return b[v]===q[0]}}else{if(p.getter){return a.gvsCall(p.getter,b,q,f,w)}return b[p.getProperty||t]}}else{throw new Error('GSet: "'+t+'" has no '+v+"ter")}}else{throw new Error('GSet: "'+t+'" is unmapped')}return !1}};GSet.getContext=function(c){var b={gset:!1,alias:!1,action:!1},d=function(f,e){return typeof f===(e?"object":"function")};if(d(c,1)&&d((c=c.callee))&&d((c=c.caller))&&d((c=c.arguments),1)&&c.length===3){b.gset=c[0];b.alias=c[1];b.action=c[2]}return b}})();
-(function(a){var b={fkey:{},tick:new Date()*1,rxp:{oneAlpha:/\w/,absPath:/^\/\//,typeObjFnc:/^(?:object|function)$/,nodeNameBad:/^toString$|[\/\|]|^[_@\[]/,relativePathFlags:/^(?:(?:\.{1,2}|[@\[][^\/]+)\/?)+/,gateOkAction:/^[cg]/,gateBadAlias:/^args|go|target|wait$/,gateOkAlias:/^destroy|type$/},typeOf:function(d){var c=typeof d;return c==="object"&&Object.prototype.toString.call(d)==="[object Array]"?"array":c},isValidFlowId:function(c){return typeof c==="string"&&b.rxp.oneAlpha.test(c)},isFnc:function(c){return typeof c==="function"},superId:"..//",flows:{},activeFlows:[],objects:{},proxies:{},meta:{fncs:{main:"main","in":"in",out:"out",over:"over"},keys:{vars:"vars",root:"root",pendable:"pendable"},prefix:"_"},getFlow:function(c){var e=0,d=b.objects.Flow;switch(typeof c){case"object":if(c instanceof GSet&&c._gset().type===1&&c.type()==="Flow"){e=c._gset(b.fkey)}if(c instanceof d){e=c}break;case"function":if(c.hasOwnProperty("toString")&&b.rxp.absPath.test(c.toString())&&(e=c(b.fkey)) instanceof d){return e}break;case"string":if(b.flows.hasOwnProperty(c)&&b.isValidFlowId(c)){e=b.flows[c]}break}return e}};b.proxies.Flow=new GSet(0,{type:"Flow",id:["id",function(c){return !b.flows.hasOwnProperty(c)&&b.isValidFlowId(c)},function(d){var c=this;if(c.exec&&(!c.childFlows.length||(!c.parentFlows.length&&c.delay.active))){delete b.flows[c.id];c.id=d;b.flows[c.id]=c;return 1}return 0}],map:[function(){var c=this,d=function(e,g){var f=function(h){return c.dead?!1:(h===b.fkey?c:((c.exec||!c.locked)?c.target(e,[].slice.call(arguments)):!1))};f.toString=function(){return e.id};if(g){g[e.name]=f}else{g=f}if(e.nextIdx){d(c.nodes[e.nextIdx],g)}if(e.children.length){d(c.nodes[e.children[0].idx],e.name?f:g)}return g};return d(c.nodes[1])}],status:[function(){var e=this,d=e.cache.proxy,c=e.nodes,l=e.nodes[e.currentIdx],g=function(){},k,h,f;if(!d.status){d.status={}}if(!d.status.simple){d.status.simple={internal:!!e.exec,depth:l.depth.length-1,phase:e.phase,location:l.id,index:l.idx,state:l.name,pendable:!!l.pendable}}g.prototype=d.status.simple;k=e.getPending();for(h=0;k[h];h++){k[h]=k[h].id}g.prototype.pending=k;if(!d.status.traversal){d.status.traversal={paused:!!e.delay.active,loops:((","+e.nodestack.join()).match(new RegExp(",("+l.idx+")\\b","g"))||[]).length};k=[];f=e.nodestack.length;for(h=0;h<f;h++){k.push(c[e.nodestack[h]].id)}d.status.traversal.history=k;k=e.getRoute();for(h=0;k[h];h++){k[h]=k[h].id}d.status.traversal.targets=k}for(h in d.status.traversal){if(d.status.traversal.hasOwnProperty(h)){g.prototype[h]=d.status.traversal[h]}}return new g()}],lock:["locked",0,function(d){var c=this;if(c.exec){c.locked=!d;return 1}return 0}],query:function(){var d=this,e=arguments,f=0,g,c=[];for(;g=d.findNode(e[f]);f++){c.push(g.id)}return(c.length&&c.length===e.length)?(c.length>1?c:c[0]):!1},args:function(){var e=this,g=arguments,d=g[0],c=g[1],f=d>-1&&Math.ceil(d)===d,h=e.args;switch(g.length){case 0:return h.concat();break;case 1:switch(b.typeOf(d)){case"array":e.args=d.concat();return !0;break;case"number":if(f){return h[d]}break}break;default:if(f){if(c===undefined&&d===h.length-1){h.splice(-1,1)}else{h[d]=c}return !0}break}return !1},vars:function(){var f=this,g=arguments,d=g[0],c=g[1],e=typeof d==="string"&&b.rxp.oneAlpha.test(d)&&f.resolveVar(d),h,j=!1;switch(g.length){case 0:j=[];for(h in f.vars){if(f.vars.hasOwnProperty(h)){j.push(h)}}break;case 1:if(e){j=e.values[0]}break;default:if(e){e.values[0]=c;j=!0}break}return j},destroy:function(){var c=this;if(!c.dead){delete b.flows[c.id];c.dead=1;c.clearDelay();c.informParentFlows()}return !!c.dead},wait:function(){var d=this,k=arguments,c=d.cache.proxy,n=k.length,j=Math,g=n>1?k[0]:0,f,m=!g||typeof g==="function"||(f=d.findNode(g)),e=j.ceil(j.abs(k[n-1])),l=!isNaN(e),h=1;if(d.targets.length&&(!n||(l&&m&&f!==!1))){if(c.status){delete c.status.traversal}d.clearDelay();if(f){g=function(){d.target(f)}}d.delay.active=n?a.setTimeout(function(){d.delay.callback=g;d.delay.active=0;d.traverse()},e):1;h=0}return !h},target:function(f){var d=this,c=d.cache.proxy,e=d.findNode(f);if(e){if(c.status){delete c.status.traversal}return d.target(e,[].slice.call(arguments,1))}return !1},go:function(){var e=this,d=e.cache.proxy,f=arguments,c=f.length,k=e.targets.length,j,h=[],g=0;for(;j=e.findNode(f[g]);g++){h.push(j)}if(!c||c===h.length){if(d.status){delete d.status.traversal}e.clearDelay();if(k||h.length){e.stage.waypoints=h;e.traverse();return c?!0:!e.childFlows.length}}return !1}},function(){var d=this,c=GSet.getContext(arguments);return b.rxp.gateOkAlias.test(c.alias)||(!d.dead&&(d.exec||!d.locked||b.rxp.gateOkAction.test(c.action)&&!b.rxp.gateBadAlias.test(c.alias)))},b.fkey);b.objects.Flow=function(e,c){var d=this;d.id=e;d.tree=c;d.currentIdx=0;d.targetIdx=null;d.targets=[];d.dead=!1;d.locked=!1;d.exec=0;d.delay={};d.phase="";d.nodestack=[];d.vars={};d.args=[];d.cache={findNode:{},proxy:{}};d.childFlows={indice:{},length:0};d.parentFlows=[];d.stage={waypoints:[]};b.flows[d.id]=d;d.nodes=[];d.nodeIds={};new b.objects.Node(d,new b.objects.Node(d),c);d.recursionLimit=d.nodes.length*5};b.objects.Flow.prototype={target:function(d,e){var c=this;c.clearDelay();c.targets=[];c.args=e;c.stage.waypoints=[d];return c.traverse()},traverse:function(){var d=this,g,c,e,h,f=0;if(d.exec||d.childFlows.length){return !d.childFlows.length}if(d.delay.callback){c=d.delay.callback;d.delay.callback=0;d.execute(c);return d.delay.active?0:d.traverse()}if(d.cache.proxy.status){delete d.cache.proxy.status}d.commitStage();while(d.recursionLimit>f++&&!d.dead&&!d.delay.active&&!d.childFlows.length&&d.targets.length){d.phase=0;h=0;d.targetIdx=d.targets[0].idx;g=d.nodes[d.currentIdx];e=d.getNextMove(g,d.nodes[d.targetIdx]);if(!e.none){if(e.right||e.left){if(g.inContext){d.phase=b.meta.fncs.out}else{if(e.right){d.phase=b.meta.fncs.over}}g.inContext=0;d.stage.currentIdx=e.right?g.nextIdx:g.previousIdx}if(e.up){d.phase=b.meta.fncs.out;g.inContext=0;d.stage.currentIdx=g.parentIdx}if(e.down){if(!g.inContext){d.phase=b.meta.fncs["in"]}g.inContext=1;d.stage.currentIdx=g.firstChildIdx}}else{d.phase=b.meta.fncs[g.inContext?"main":"in"];d.stage.hitTarget=g.inContext;g.inContext=1}if(d.phase){if(d.outNode){d.outNode.descopeVars()}d.outNode=0;if(d.phase===b.meta.fncs["in"]){g.scopeVars()}if(h=g.fncs.hasOwnProperty(d.phase)){if(d.phase===b.meta.fncs.out){d.outNode=g}d.result=d.execute(g.fncs[d.phase],(d.targets.length===1&&d.phase===b.meta.fncs.main)?d.args:[])}else{if(d.phase===b.meta.fncs.out){g.descopeVars()}}}if(!d.dead&&!d.delay.active&&!d.childFlows.length){d.commitStage()}}if(f>d.recursionLimit){c=(","+d.nodestack.join()).match(/(,\d+\b)+\1$/);if(c){c=c[1].substr(1).split(",");for(i=0;i<c.length;i++){c[i]=d.nodes[c[i]].name}throw new Error("Flow: bad redirects [ "+c.join(" > ")+" ]")}else{throw new Error("Flow: too much recursion")}}d.nodestack=[];if(!d.dead&&!d.targets.length){d.informParentFlows()}return !d.targets.length&&!d.dead?(h&&d.result!==undefined?d.result:!0):!1},execute:function(g,e){var d=this,f=d.nodes[d.currentIdx],c;d.cache.proxy={};d.exec=1;if(f.pendable){if(b.activeFlows.length){d.parentFlows.push(b.activeFlows[0].id);b.activeFlows[0].addChildFlow(d.id)}b.activeFlows.unshift(d)}c=g.apply(d.getGSet(),e||[]);if(f.pendable){b.activeFlows.shift()}d.exec=0;d.cache.proxy={};return c},commitStage:function(d){var c=this,m,f=0,e,g=c.stage,j,k=c.phase,l=b.meta.fncs,h;c.targets=c.getRoute();j=c.targets;if(j.length){h=j[j.length-1].idx;if(!c.nodestack.length||(k&&c.currentIdx!==c.nodestack[c.nodestack.length-1]&&(k===l.over||k===l.out||(k===l["in"]&&(c.currentIdx!==h))))){c.nodestack.push(c.currentIdx)}}if(g.valid){if(g.currentIdx!=null){c.currentIdx=g.currentIdx}if(g.hitTarget){j.shift();if(!j.length){c.args=[];c.targetIdx=null;c.phase=""}}}c.stage={fnc:0,valid:1,currentIdx:null,hitTarget:0,waypoints:[]}},getNextMove:function(f,g){var d=this,e=g.idx-f.idx,c={};if(e){if(f.parentIdx===g.parentIdx){c[e>0?"right":"left"]=1}else{if(f.depth.length===g.depth.length){c.up=1}else{if(g.path.indexOf(f.path)===0){c.down=1}else{if(e>0){if(g.path.indexOf(d.nodes[f.parentIdx].path)===0){c.right=1}else{c.up=1}}else{if(g.idx!==f.parentIdx&&g.path.indexOf(d.nodes[f.parentIdx].path)===0){c.left=1}else{c.up=1}}}}}}else{c.none=1}return c},getRoute:function(){var c=this,f=c.phase===b.meta.fncs.main,e=c.stage.waypoints.concat(),h=e.length,g=c.targets,d=g.concat();if(h){if(!g.length){d=e}else{if(e[h-1]===d[f?1:0]){e.pop()}if(f){d=[].concat(d[0],e,d.slice(1))}else{d=e.concat(d)}}}c.stage.valid=d[0]===g[0];return d},getPending:function(k,h,l){var d=this,g=k||[],m=h||{},c=l||{},f,e=d.childFlows,j;c[d.id]=1;if(e.length){for(f in e.indice){if(e.indice.hasOwnProperty(f)&&e.indice[f]>0&&(j=b.flows[f])){if(j.delay.active&&!m.hasOwnProperty(j.id)){m[j.id]=g.push(j)}if(!c.hasOwnProperty(j.id)){j.getPending(g,m,c)}}}}return g},addChildFlow:function(e){var c=this,d=c.childFlows;if(!d.indice.hasOwnProperty(e)){d.indice[e]=0}d.indice[e]++;d.length++},removeChildFlow:function(e){var c=this,d=c.childFlows;if(d.length&&d.indice.hasOwnProperty(e)&&d.indice[e]>0){d.indice[e]--;d.length--;if(!d.length&&!c.delay.active){c.traverse()}}},informParentFlows:function(){var c=this,e=0,d=c.parentFlows,f,g;if(d.length){g=d.concat();d.length=0;for(;g[e];e++){if(f=b.flows[g[e]]){f.removeChildFlow(c.id)}}}},resolveVar:function(d){var c=this;return c.vars.hasOwnProperty(d)?c.vars[d]:new b.objects.Var(c,d)},getGSet:function(){return new GSet(this,b.proxies.Flow,b.fkey)},findNode:function(h){var d=this,j=d.nodes[d.currentIdx],g=!1,f,c,e="/";switch(typeof h){case"number":g=d.nodes[+h];break;case"object":if(h instanceof GSet&&h._gset().type===1&&h.type()==="Node"){g=h._gset(b.fkey)}if(h instanceof b.objects.Node){g=h}break;case"string":case"function":f=h=h.toString();if(h===b.superId){g=d.nodes[0]}else{if(h.length&&(h.length<3||!/\/{2,3}$/.test(h))){if(h.substr(0,2)==="//"){if(h.charAt(h.length-1)!==e){h+=e}g=d.nodes[d.nodeIds[h]]}else{f=(h.charAt(0)===e?j.rootIdx:j.idx)+f;if(!d.cache.findNode.hasOwnProperty(f)){c=h.match(b.rxp.relativePathFlags);if(c){h=h.substr(c[0].length);c=c[0].replace(/\/$/,"").split(e)}else{c=[]}d.cache.findNode[f]=j.getRelatedNode(c,h)}g=d.cache.findNode[f]}}}break}return g},clearDelay:function(){var c=this,e=1;if(c.delay.active!==null){c.delay.callback=0;a.clearTimeout(c.delay.active);c.delay.active=e=null}return !e}};b.objects.Var=function(d,e){var c=this;c.flow=d;c.key=e;c.values=[undefined];d.vars[e]=c};b.objects.Var.prototype={descope:function(){var c=this;c.values.shift();if(!c.values.length){delete c.flow.vars[c.key]}return 1},scope:function(){var c=this;c.values.unshift(c.values[0]);return 1}};b.objects.Node=function(d,j,e,c){var f=this,g,h,m=b.meta,k=m.fncs,l=m.keys;if(!j){e={};c="_flow"}f.flow=d;f.idx=d.nodes.push(f)-1;f.children=[];f.childrenNames={};f.fncs={};f.vars={};f.pendable=!j?1:j.pendable;f.name=c||"_root";f.isRoot=!c||!j;f.rootIdx=f.isRoot?f.idx:j.rootIdx;f.depth=j?j.depth.concat(c?c:""):[""];f.path=f.depth.join("/")+"/";f.pathPrefix=f.idx>1?f.path:"//";f.id=j?f.path:b.superId;d.nodeIds[f.id]=f.idx;if(j){f.parentIdx=j.idx;f.localChildIdx=j.children.push(f)-1;j.lastChildIdx=f.idx;j.childrenNames[f.name]=f.idx;if(f.localChildIdx){f.previousIdx=j.children[f.localChildIdx-1].idx;j.children[f.localChildIdx-1].nextIdx=f.idx}else{j.firstChildIdx=f.idx}}if(b.isFnc(e)){f.fncs[k.main]=e}else{for(g in e){if(e.hasOwnProperty(g)){if(g.charAt(0)===m.prefix){h=g.substring(1);if(k[h]&&b.isFnc(e[g])){f.fncs[h]=e[g]}else{if(l[h]&&!b.isFnc(e[g])){switch(l[h]){case l.vars:f.sanitizeAddVarDef(e[g]);break;case l.root:if(f.isRoot=!!e[g]){f.rootIdx=f.idx}break;case l.pendable:f.pendable=!!e[g];break}}else{}}}else{if(b.rxp.typeObjFnc.test(typeof e[g])&&!b.rxp.nodeNameBad.test(g)){new b.objects.Node(d,f,e[g],g)}}}}}f.localPath=j?f.id.substr(Math.max(d.nodes[f.rootIdx].id.length-1,1)):"/"};b.objects.Node.prototype={addVarDef:function(c){var f=this,e=0,d;if(typeof c==="object"){for(d in c){if(c.hasOwnProperty(d)){f.vars[d]={name:d,value:c[d],useValue:1};e++}}}else{if(b.rxp.oneAlpha.test(c)){f.vars[c]={name:c,useValue:0};e++}}return e},sanitizeAddVarDef:function(){var g=this,d=[].slice.call(arguments),f=0,c=d.length,e=0;for(;f<c;f++){switch(b.typeOf(d[f])){case"array":e+=g.sanitizeAddVarDef.apply(g,d[f]);break;case"string":case"object":e+=g.addVarDef(d[f]);break;default:}}return e},scopeVars:function(){var e=this,c=e.flow,d;for(d in e.vars){if(e.vars.hasOwnProperty(d)){if(c.vars.hasOwnProperty(d)){c.vars[d].scope()}else{c.resolveVar(d)}if(e.vars[d].useValue){c.vars[d].values[0]=e.vars[d].value}}}},descopeVars:function(){var e=this,c=e.flow,d;for(d in e.vars){if(e.vars.hasOwnProperty(d)&&c.vars.hasOwnProperty(d)){c.vars[d].descope()}}},getRelatedNode:function(d,m){var e=this,c=e.flow,j=c.nodes[e.parentIdx],f,g,h=0,k,l="/";if(d.length){k=d.shift();k=(/^\[.+\]$/.test(k))?k.slice(1,-1).split("|"):[k];g=k.length;while(f==null&&h<g){if(/^@|^\.+$/.test(k[h])){if(k[h].charAt(0)==="@"){k[h]=k[h].substr(1)}switch(k[h]){case"child":f=e.firstChildIdx;break;case"next":f=e.nextIdx;break;case"oldest":if(j){f=j.lastChildIdx}break;case"parent":case"..":f=e.parentIdx;break;case"previous":f=e.previousIdx;break;case"root":f=e.rootIdx;break;case"program":f=1;break;case"flow":f=0;break;case"youngest":if(j){f=j.firstChildIdx}break;case"self":case".":f=e.idx;break}}else{f=e.childrenNames[k[h]]}h++}e=c.nodes[f];return e?e.getRelatedNode(d,m):!1}else{if(m.length){if(m.charAt(0)!==l){m=e.pathPrefix+m}else{if(m.charAt(1)!==l){m=(e.rootIdx>1?c.nodes[e.rootIdx].path.slice(0,-1):l)+m}}if(m.charAt(m.length-1)!==l){m+=l}return c.nodeIds.hasOwnProperty(m)&&c.nodes[c.nodeIds[m]]}else{return e}}}};a.Flow=function(){var f=this,g=arguments,e=g.length,k=g[0],j=typeof k==="string",h,d,c;if(!(f.hasOwnProperty&&f instanceof arguments.callee)){if(!e){k=[];for(h in b.flows){if(b.flows.hasOwnProperty(h)){k.push(h)}}return k}return(f=b.getFlow(k))?f.getGSet():!1}if(!e){throw new Error("Flow: missing tree")}if(e>2){c=g[1];d=g[2]}else{if(e>1){if(!j){k=0;d=g[1]}c=g[j?1:0]}else{k=0;c=g[0]}}if(typeof c!=="object"){throw new Error("Flow: invalid tree")}f=(new b.objects.Flow((k&&!b.flows.hasOwnProperty(k)&&b.isValidFlowId(k))?k:(b.tick++).toString(20),c)).getGSet();return d?f:f.map()}})(this);
+(function(a){var b={gvsCall:function(h,g,e,d,c){return(function f(){return h.apply(g,e)}).apply(d,c)},gsetCall:function(c,d){return function(){return c._gset.apply(c,[d].concat(arguments.length?[].slice.call(arguments):[]))}},customCall:function(f,d,e,c,h){var g=[c,e,"custom"];return function(){var i=arguments;if(!h(i,g)){return !1}return b.gvsCall(d[e],f,i,c,g)}},typeMap:{string:"s","[object Array]":"a","function":"f","[object Function]":"f"},rxp:{rtnFnc:/\breturn\b/,fsType:/[fs]/,afsType:/[afs]/},getType:function(d){var c=b.typeMap[typeof d]||b.typeMap[Object.prototype.toString.call(d)];return c&&(c!=="s"||c.length)?c:0},testValueTypes:function(g,c){var f=0,d=c.length,k,l=g.length,e,h=1;for(;f<d;f++){e=typeof c[f];h=0;for(k=0;k<l;k++){if(g[k]===e){h=1;break}}if(!h){break}}return h}};a.GSet=a.GSet||function(c,d){var g=this,l=arguments,j,h,p=b.rxp.rtnFnc,i=b.getType,n={},o=function(r,t){var s=t[1],q=!n[s];if(q&&i){n[s]=1;if(b.gvsCall(i,c,r,g,t)===!1){q=0}n[s]=0}return q},f,e,m,k;if(!(g.hasOwnProperty&&g instanceof GSet)){throw new Error("GSet: missing new operator")}if(c==null){throw new Error("GSet: invalid source")}if(l.length>2){if(l.length>3){i=[typeof l[2],typeof l[3],"function"];if((i[0]===i[2])===(i[1]===i[2])){throw new Error("GSet: too many or too few gate functions")}p=l[i[0]===i[2]?3:2];i=l[i[0]===i[2]?2:3]}else{if(typeof l[2]==="function"){i=l[2]}else{p=l[2]}}}if(d instanceof GSet){d=d._gset(b);j=d[0];h=d[1];if(p===b.rxp.rtnFnc){p=d[2]}if(i===b.getType){i=d[3]}d=d[4];for(m in h){if(h.hasOwnProperty(m)){n[m]=0;if(h[m]===2){g[m]=b.customCall(c,d,m,g,o)}else{g[m]=b.gsetCall(g,m)}}}}else{j={};h={};for(m in d){if(!d.hasOwnProperty(m)){continue}n[m]=0;f=d[m];e=b.getType(f);if(e==="f"){g[m]=b.customCall(c,d,m,g,o);h[m]=2}else{k={get:0,set:0};if(e!=="a"||(f.length===1&&(e=b.getType(f[0]))==="a")){if(e==="a"){d[m]=f[0];k.isAry=1}k.get=1;k.fixed=1;k.fixedValue=d[m]}else{if(!f.length){f=d[m]=[m,1]}e=[b.getType(f[0]),b.getType(f[1]),b.getType(f[2])];if((e[0]==="f"&&!b.rxp.rtnFnc.test(f[0]+""))||(e[1]==="f"&&!b.rxp.rtnFnc.test(f[1]+""))){continue}if(f[0]){k.get=1;k[e[0]==="f"?"getter":"getProperty"]=b.rxp.fsType.test(e[0])?f[0]:m}if(f[2]){k.set=1;k.validAny=1;if(b.rxp.fsType.test(e[2])){k[e[2]==="f"?"setter":"setProperty"]=f[2]}else{if(k.get){k[k.getter?"setter":"setProperty"]=k.getter||k.getProperty}}}else{if(f.length>2){k.set=0}}if(f[1]&&(f.length<3||k.set)){k.set=1;k.validAny=!b.rxp.afsType.test(e[1]);if(!k.validAny){k[e[1]==="f"?"validator":"types"]=e[1]==="s"?[f[1]]:f[1]}}}if(k.get||k.set){h[m]=k.get-k.set;j[m]=k;g[m]=b.gsetCall(g,m)}}}}if(i===b.getType){i=0}g._gset=function(u){var t=arguments,r=[].slice.call(arguments,1),v=r.length,w=v?"set":"get",x=[g,u,v?"vet":w],q=j.hasOwnProperty(u)&&j[u],s;if(!t.length){s=function(){};s.prototype=h;return new s()}if(u===p){return c}if(u===b){return[j,h,p,i,d]}if(q){if(q[w]){if(!o(r,x)){return !1}if(q.fixed){return q.isAry?q.fixedValue.concat():q.fixedValue}if(v){if(q.validAny||(q.validator&&b.gvsCall(q.validator,c,r,g,x))||(q.types&&b.testValueTypes(q.types,r))){if((q.setter||(!q.setProperty&&q.getter))&&x.splice(2,1,"set")){w=b.gvsCall(q.setter||q.getter,c,r,g,x);return(w===undefined)?!0:(v?!!w:w)}c[(w=q.setProperty||u)]=r[0];return c[w]===r[0]}}else{if(q.getter){return b.gvsCall(q.getter,c,r,g,x)}return c[q.getProperty||u]}}else{throw new Error('GSet: "'+u+'" has no '+w+"ter")}}else{throw new Error('GSet: "'+u+'" is unmapped')}return !1}};a.GSet.getContext=function(d){var c={gset:!1,alias:!1,action:!1},e=function(g,f){return typeof g===(f?"object":"function")};if(e(d,1)&&e((d=d.callee))&&e((d=d.caller))&&e((d=d.arguments),1)&&d.length===3){c.gset=d[0];c.alias=d[1];c.action=d[2]}return c}})(this);(function(a){var b={fkey:{},tick:new Date*1,rxp:{oneAlpha:/\w/,absPath:/^\/\//,typeObjFnc:/^(?:object|function)$/,nodeNameBad:/^toString$|[\/\|]|^[_@\[]/,relativePathFlags:/^(?:(?:\.{1,2}|[@\[][^\/]+)\/?)+/,gateOkAction:/^[cg]/,gateBadAlias:/^args|go|target|wait$/,gateOkAlias:/^destroy|type$/},typeOf:function(a){var b=typeof a;return b==="object"&&Object.prototype.toString.call(a)==="[object Array]"?"array":b},isValidFlowId:function(a){return typeof a=="string"&&b.rxp.oneAlpha.test(a)},isFnc:function(a){return typeof a=="function"},superId:"..//",flows:{},activeFlows:[],objects:{},proxies:{},meta:{fncs:{main:"main","in":"in",out:"out",over:"over"},keys:{vars:"vars",root:"root",pendable:"pendable",restrict:"restrict"},prefix:"_"},getFlow:function(a){var c=0,d=b.objects.Flow;switch(typeof a){case"object":a instanceof GSet&&a._gset().type===1&&a.type()==="Flow"&&(c=a._gset(b.fkey)),a instanceof d&&(c=a);break;case"function":if(a.hasOwnProperty("toString")&&b.rxp.absPath.test(a.toString())&&(c=a(b.fkey))instanceof d)return c;break;case"string":b.flows.hasOwnProperty(a)&&b.isValidFlowId(a)&&(c=b.flows[a])}return c}};b.proxies.Flow=new GSet(0,{type:"Flow",id:["id",function(a){return!b.flows.hasOwnProperty(a)&&b.isValidFlowId(a)},function(a){var c=this;if(c.exec&&(!c.childFlows.length||!c.parentFlows.length&&c.delay.active)){delete b.flows[c.id],c.id=a,b.flows[c.id]=c;return 1}return 0}],map:[function(){var a=this,c=function(d,e){var f=function(c){return a.dead?!1:c===b.fkey?a:a.exec||!a.locked?a.target(d,[].slice.call(arguments)):!1};f.toString=function(){return d.id},e?e[d.name]=f:e=f,d.nextIdx&&c(a.nodes[d.nextIdx],e),d.children.length&&c(a.nodes[d.children[0].idx],d.name?f:e);return e};return c(a.nodes[1])}],status:[function(){var a=this,b=a.cache.proxy,c=a.nodes,d=a.nodes[a.currentIdx],e=function(){},f,g,h;b.status||(b.status={}),b.status.simple||(b.status.simple={internal:!!a.exec,depth:d.depth.length-1,phase:a.phase,location:d.id,index:d.idx,state:d.name,pendable:!!d.pendable}),e.prototype=b.status.simple,f=a.getPending();for(g=0;f[g];g++)f[g]=f[g].id;e.prototype.pending=f;if(!b.status.traversal){b.status.traversal={paused:!!a.delay.active,loops:((","+a.nodestack.join()).match(new RegExp(",("+d.idx+")\\b","g"))||[]).length},f=[],h=a.nodestack.length;for(g=0;g<h;g++)f.push(c[a.nodestack[g]].id);b.status.traversal.history=f,f=a.getRoute();for(g=0;f[g];g++)f[g]=f[g].id;b.status.traversal.targets=f}for(g in b.status.traversal)b.status.traversal.hasOwnProperty(g)&&(e.prototype[g]=b.status.traversal[g]);return new e}],lock:["locked",0,function(a){var b=this;if(b.exec){b.locked=!a;return 1}return 0}],query:function(){var a=this,b=arguments,c=0,d,e=[];for(;d=a.findNode(b[c]);c++)e.push(d.id);return e.length&&e.length===b.length?e.length>1?e:e[0]:!1},args:function(){var a=this,c=arguments,d=c[0],e=c[1],f=d>-1&&Math.ceil(d)===d,g=a.args;switch(c.length){case 0:return g.concat();case 1:switch(b.typeOf(d)){case"array":a.args=d.concat();return!0;case"number":if(f)return g[d]}break;default:if(f){e===undefined&&d===g.length-1?g.splice(-1,1):g[d]=e;return!0}}return!1},vars:function(){var a=this,c=arguments,d=c[0],e=c[1],f=typeof d=="string"&&b.rxp.oneAlpha.test(d)&&a.resolveVar(d),g,h=!1;switch(c.length){case 0:h=[];for(g in a.vars)a.vars.hasOwnProperty(g)&&h.push(g);break;case 1:f&&(h=f.values[0]);break;default:f&&(f.values[0]=e,h=!0)}return h},destroy:function(){var a=this;a.dead||(delete b.flows[a.id],a.dead=1,a.clearDelay(),a.informParentFlows());return!!a.dead},wait:function(){var b=this,c=arguments,d=b.nodes[b.currentIdx],e=b.cache.proxy,f=c.length,g=Math,h=f>1?c[0]:0,i,j=!h||typeof h=="function"||(i=b.findNode(h))&&d.allowTgt(i),k=g.ceil(g.abs(c[f-1])),l=!isNaN(k),m=1;b.targets.length&&(!f||l&&j&&i!==!1)&&(e.status&&delete e.status.traversal,b.clearDelay(),i&&(h=function(){b.target(i)}),b.delay.active=f?a.setTimeout(function(){b.delay.callback=h,b.delay.active=0,b.traverse()},k):1,m=0);return!m},target:function(a){var b=this,c=b.cache.proxy,d=b.findNode(a);if(d&&b.nodes[b.currentIdx].allowTgt(d)){c.status&&delete c.status.traversal;return b.target(d,[].slice.call(arguments,1))}return!1},go:function(){var a=this,b=a.cache.proxy,c=a.nodes[a.currentIdx],d=arguments,e=d.length,f=a.targets.length,g,h=[],i=0;for(;(g=a.findNode(d[i]))&&c.allowTgt(g);i++)h.push(g);if(!e||e===h.length){b.status&&delete b.status.traversal,a.clearDelay();if(f||h.length){a.stage.waypoints=h,a.traverse();return e?!0:!a.childFlows.length}}return!1}},function(){var a=this,c=GSet.getContext(arguments);return b.rxp.gateOkAlias.test(c.alias)||!a.dead&&(a.exec||!a.locked||b.rxp.gateOkAction.test(c.action)&&!b.rxp.gateBadAlias.test(c.alias))},b.fkey),b.objects.Flow=function(a,c){var d=this;d.id=a,d.tree=c,d.currentIdx=0,d.targetIdx=null,d.targets=[],d.dead=!1,d.locked=!1,d.exec=0,d.delay={},d.phase="",d.nodestack=[],d.vars={},d.args=[],d.cache={findNode:{},proxy:{}},d.childFlows={indice:{},length:0},d.parentFlows=[],d.stage={waypoints:[]},b.flows[d.id]=d,d.nodes=[],d.nodeIds={},new b.objects.Node(d,new b.objects.Node(d),c),d.recursionLimit=d.nodes.length*5},b.objects.Flow.prototype={target:function(a,b){var c=this;c.clearDelay(),c.targets=[],c.args=b,c.stage.waypoints=[a];return c.traverse()},traverse:function(){var a=this,c,d,e,f,g=0;if(a.exec||a.childFlows.length)return!a.childFlows.length;if(a.delay.callback){d=a.delay.callback,a.delay.callback=0,a.execute(d);return a.delay.active?0:a.traverse()}a.cache.proxy.status&&delete a.cache.proxy.status,a.commitStage();while(a.recursionLimit>g++&&!a.dead&&!a.delay.active&&!a.childFlows.length&&a.targets.length){a.phase=0,f=0,a.targetIdx=a.targets[0].idx,c=a.nodes[a.currentIdx],e=a.getNextMove(c,a.nodes[a.targetIdx]);if(!e.none){if(e.right||e.left)c.inContext?a.phase=b.meta.fncs.out:e.right&&(a.phase=b.meta.fncs.over),c.inContext=0,a.stage.currentIdx=e.right?c.nextIdx:c.previousIdx;e.up&&(a.phase=b.meta.fncs.out,c.inContext=0,a.stage.currentIdx=c.parentIdx),e.down&&(c.inContext||(a.phase=b.meta.fncs["in"]),c.inContext=1,a.stage.currentIdx=c.firstChildIdx)}else a.phase=b.meta.fncs[c.inContext?"main":"in"],a.stage.hitTarget=c.inContext,c.inContext=1;a.phase&&(a.outNode&&a.outNode.descopeVars(),a.outNode=0,a.phase===b.meta.fncs["in"]&&c.scopeVars(),(f=c.fncs.hasOwnProperty(a.phase))?(a.phase===b.meta.fncs.out&&(a.outNode=c),a.result=a.execute(c.fncs[a.phase],a.targets.length===1&&a.phase===b.meta.fncs.main?a.args:[])):a.phase===b.meta.fncs.out&&c.descopeVars()),!a.dead&&!a.delay.active&&!a.childFlows.length&&a.commitStage()}if(g>a.recursionLimit){d=(","+a.nodestack.join()).match(/(,\d+\b)+\1$/);if(d){d=d[1].substr(1).split(",");for(i=0;i<d.length;i++)d[i]=a.nodes[d[i]].name;throw new Error("Flow: bad redirects [ "+d.join(" > ")+" ]")}throw new Error("Flow: too much recursion")}a.nodestack=[],!a.dead&&!a.targets.length&&a.informParentFlows();return!a.targets.length&&!a.dead?f&&a.result!==undefined?a.result:!0:!1},execute:function(a,c){var d=this,e=d.nodes[d.currentIdx],f;d.cache.proxy={},d.exec=1,e.pendable&&(b.activeFlows.length&&(d.parentFlows.push(b.activeFlows[0].id),b.activeFlows[0].addChildFlow(d.id)),b.activeFlows.unshift(d)),f=a.apply(d.getGSet(),c||[]),e.pendable&&b.activeFlows.shift(),d.exec=0,d.cache.proxy={};return f},commitStage:function(a){var c=this,d,e=0,f,g=c.stage,h,i=c.phase,j=b.meta.fncs,k;c.targets=c.getRoute(),h=c.targets,h.length&&(k=h[h.length-1].idx,(!c.nodestack.length||i&&c.currentIdx!==c.nodestack[c.nodestack.length-1]&&(i===j.over||i===j.out||i===j["in"]&&c.currentIdx!==k))&&c.nodestack.push(c.currentIdx)),g.valid&&(g.currentIdx!=null&&(c.currentIdx=g.currentIdx),g.hitTarget&&(h.shift(),h.length||(c.args=[],c.targetIdx=null,c.phase=""))),c.stage={fnc:0,valid:1,currentIdx:null,hitTarget:0,waypoints:[]}},getNextMove:function(a,b){var c=this,d=b.idx-a.idx,e={};d?a.parentIdx===b.parentIdx?e[d>0?"right":"left"]=1:a.depth.length===b.depth.length?e.up=1:b.path.indexOf(a.path)===0?e.down=1:d>0?b.path.indexOf(c.nodes[a.parentIdx].path)===0?e.right=1:e.up=1:b.idx!==a.parentIdx&&b.path.indexOf(c.nodes[a.parentIdx].path)===0?e.left=1:e.up=1:e.none=1;return e},getRoute:function(){var a=this,c=a.phase===b.meta.fncs.main,d=a.stage.waypoints.concat(),e=d.length,f=a.targets,g=f.concat();e&&(f.length?(d[e-1]===g[c?1:0]&&d.pop(),c?g=[].concat(g[0],d,g.slice(1)):g=d.concat(g)):g=d),a.stage.valid=g[0]===f[0];return g},getPending:function(a,c,d){var e=this,f=a||[],g=c||{},h=d||{},i,j=e.childFlows,k;h[e.id]=1;if(j.length)for(i in j.indice)j.indice.hasOwnProperty(i)&&j.indice[i]>0&&(k=b.flows[i])&&(k.delay.active&&!g.hasOwnProperty(k.id)&&(g[k.id]=f.push(k)),h.hasOwnProperty(k.id)||k.getPending(f,g,h));return f},addChildFlow:function(a){var b=this,c=b.childFlows;c.indice.hasOwnProperty(a)||(c.indice[a]=0),c.indice[a]++,c.length++},removeChildFlow:function(a){var b=this,c=b.childFlows;c.length&&c.indice.hasOwnProperty(a)&&c.indice[a]>0&&(c.indice[a]--,c.length--,!c.length&&!b.delay.active&&b.traverse())},informParentFlows:function(){var a=this,c=0,d=a.parentFlows,e,f;if(d.length){f=d.concat(),d.length=0;for(;f[c];c++)(e=b.flows[f[c]])&&e.removeChildFlow(a.id)}},resolveVar:function(a){var c=this;return c.vars.hasOwnProperty(a)?c.vars[a]:new b.objects.Var(c,a)},getGSet:function(){return new GSet(this,b.proxies.Flow,b.fkey)},findNode:function(a){var c=this,d=c.nodes[c.currentIdx],e=!1,f,g,h="/";switch(typeof a){case"number":e=c.nodes[+a];break;case"object":a instanceof GSet&&a._gset().type===1&&a.type()==="Node"&&(e=a._gset(b.fkey)),a instanceof b.objects.Node&&(e=a);break;case"string":case"function":f=a=a.toString(),a===b.superId?e=c.nodes[0]:a.length&&(a.length<3||!/\/{2,3}$/.test(a))&&(a.substr(0,2)==="//"?(a.charAt(a.length-1)!==h&&(a+=h),e=c.nodes[c.nodeIds[a]]):(f=(a.charAt(0)===h?d.rootIdx:d.idx)+f,c.cache.findNode.hasOwnProperty(f)||(g=a.match(b.rxp.relativePathFlags),g?(a=a.substr(g[0].length),g=g[0].replace(/\/$/,"").split(h)):g=[],c.cache.findNode[f]=d.getRelatedNode(g,a)),e=c.cache.findNode[f]))}return e},clearDelay:function(){var b=this,c=1;b.delay.active!==null&&(b.delay.callback=0,a.clearTimeout(b.delay.active),b.delay.active=c=null);return!c}},b.objects.Var=function(a,b){var c=this;c.flow=a,c.key=b,c.values=[undefined],a.vars[b]=c},b.objects.Var.prototype={descope:function(){var a=this;a.values.shift(),a.values.length||delete a.flow.vars[a.key];return 1},scope:function(){var a=this;a.values.unshift(a.values[0]);return 1}},b.objects.Node=function(a,c,d,e){var f=this,g,h,i=b.meta,j=i.fncs,k=i.keys;c||(d={},e="_flow"),f.flow=a,f.idx=a.nodes.push(f)-1,f.children=[],f.childrenNames={},f.fncs={},f.vars={},f.pendable=c?c.pendable:1,f.name=e||"_root",f.isRoot=!e||!c,f.restrict=c?c.restrict:0,f.rootIdx=f.isRoot?f.idx:c.rootIdx,f.depth=c?c.depth.concat(e?e:""):[""],f.path=f.depth.join("/")+"/",f.pathPrefix=f.idx>1?f.path:"//",f.id=c?f.path:b.superId,a.nodeIds[f.id]=f.idx,c&&(f.parentIdx=c.idx,f.localChildIdx=c.children.push(f)-1,c.lastChildIdx=f.idx,c.childrenNames[f.name]=f.idx,f.localChildIdx?(f.previousIdx=c.children[f.localChildIdx-1].idx,c.children[f.localChildIdx-1].nextIdx=f.idx):c.firstChildIdx=f.idx);if(b.isFnc(d))f.fncs[j.main]=d;else for(g in d)if(d.hasOwnProperty(g))if(g.charAt(0)===i.prefix){h=g.substring(1);if(j[h]&&b.isFnc(d[g]))f.fncs[h]=d[g];else if(k[h]&&!b.isFnc(d[g]))switch(k[h]){case k.vars:f.sanitizeAddVarDef(d[g]);break;case k.root:if(f.isRoot=!!d[g])f.rootIdx=f.idx;break;case k.pendable:f.pendable=!!d[g];break;case k.restrict:d[g]&&(f.restrict=f.path)}}else b.rxp.typeObjFnc.test(typeof d[g])&&!b.rxp.nodeNameBad.test(g)&&new b.objects.Node(a,f,d[g],g);f.localPath=c?f.id.substr(Math.max(a.nodes[f.rootIdx].id.length-1,1)):"/"},b.objects.Node.prototype={allowTgt:function(a){var b=this;return b.flow.exec||!b.restrict||!a.path.indexOf(b.restrict)},addVarDef:function(a){var c=this,d=0,e;if(typeof a=="object")for(e in a)a.hasOwnProperty(e)&&(c.vars[e]={name:e,value:a[e],useValue:1},d++);else b.rxp.oneAlpha.test(a)&&(c.vars[a]={name:a,useValue:0},d++);return d},sanitizeAddVarDef:function(){var a=this,c=[].slice.call(arguments),d=0,e=c.length,f=0;for(;d<e;d++)switch(b.typeOf(c[d])){case"array":f+=a.sanitizeAddVarDef.apply(a,c[d]);break;case"string":case"object":f+=a.addVarDef(c[d]);break;default:}return f},scopeVars:function(){var a=this,b=a.flow,c;for(c in a.vars)a.vars.hasOwnProperty(c)&&(b.vars.hasOwnProperty(c)?b.vars[c].scope():b.resolveVar(c),a.vars[c].useValue&&(b.vars[c].values[0]=a.vars[c].value))},descopeVars:function(){var a=this,b=a.flow,c;for(c in a.vars)a.vars.hasOwnProperty(c)&&b.vars.hasOwnProperty(c)&&b.vars[c].descope()},getRelatedNode:function(a,b){var c=this,d=c.flow,e=d.nodes[c.parentIdx],f,g,h=0,i,j="/";if(a.length){i=a.shift(),i=/^\[.+\]$/.test(i)?i.slice(1,-1).split("|"):[i],g=i.length;while(f==null&&h<g){if(/^@|^\.+$/.test(i[h])){i[h].charAt(0)==="@"&&(i[h]=i[h].substr(1));switch(i[h]){case"child":f=c.firstChildIdx;break;case"next":f=c.nextIdx;break;case"oldest":e&&(f=e.lastChildIdx);break;case"parent":case"..":f=c.parentIdx;break;case"previous":f=c.previousIdx;break;case"root":f=c.rootIdx;break;case"program":f=1;break;case"flow":f=0;break;case"youngest":e&&(f=e.firstChildIdx);break;case"self":case".":f=c.idx}}else f=c.childrenNames[i[h]];h++}c=d.nodes[f];return c?c.getRelatedNode(a,b):!1}if(b.length){b.charAt(0)!==j?b=c.pathPrefix+b:b.charAt(1)!==j&&(b=(c.rootIdx>1?d.nodes[c.rootIdx].path.slice(0,-1):j)+b),b.charAt(b.length-1)!==j&&(b+=j);return d.nodeIds.hasOwnProperty(b)&&d.nodes[d.nodeIds[b]]}return c}},a.Flow=function(){var a=this,c=arguments,d=c.length,e=c[0],f=typeof e=="string",g,h,i;if(!(a.hasOwnProperty&&a instanceof arguments.callee)){if(!d){e=[];for(g in b.flows)b.flows.hasOwnProperty(g)&&e.push(g);return e}return(a=b.getFlow(e))?a.getGSet():!1}if(!d)throw new Error("Flow: missing tree");d>2?(i=c[1],h=c[2]):d>1?(f||(e=0,h=c[1]),i=c[f?1:0]):(e=0,i=c[0]);if(typeof i!="object")throw new Error("Flow: invalid tree");a=(new b.objects.Flow(e&&!b.flows.hasOwnProperty(e)&&b.isValidFlowId(e)?e:(b.tick++).toString(20),i)).getGSet();return h?a:a.map()}})(this);

0 comments on commit 3df3095

Please sign in to comment.
Something went wrong with that request. Please try again.