diff --git a/bower.json b/bower.json index c643296..9fb9c2d 100644 --- a/bower.json +++ b/bower.json @@ -26,6 +26,6 @@ ], "dependencies": { "jQuery": "~2.0.3", - "lodash": "~2.4.1" + "lodash": "~2.2.1" } } diff --git a/dist/behave.js b/dist/behave.js index 418fced..cbdea2e 100644 --- a/dist/behave.js +++ b/dist/behave.js @@ -1,59 +1,57 @@ /** * @license - * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE + * Lo-Dash 2.2.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE * Build: `lodash modern -o ./dist/lodash.js` */ -;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++ea||typeof i=="undefined")return 1;if(ie?0:e);++r=b&&i===n,l=[];if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++ui(r,p)&&l.push(p);return f&&c(r),l}function ut(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r=b&&f===n,h=u||v?a():s; -for(v&&(h=o(h),f=t);++if(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(l(h.k),c(h)):u&&l(h),s}function lt(n){return function(t,e,r){var u={};e=J.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++re?Ie(0,o+e):e)||0,Te(n)?i=-1o&&(o=a)}}else t=null==t&&kt(n)?r:J.createCallback(t,e,3),St(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=J.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;return t=J.createCallback(t,r,4),Et(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Tt(n){var t=-1,e=n?n.length:0,r=Xt(typeof e=="number"?e:0);return St(n,function(n){var e=at(0,++t);r[t]=r[e],r[e]=n}),r}function Ft(n,t,e){var r;t=J.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++er?Ie(0,u+r):r||0}else if(r)return r=zt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=J.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=v; -m?(i&&(i=ve(i)),s=f,a=n.apply(l,o)):i||(i=_e(r,v))}return m&&c?c=ve(c):c||t===h||(c=_e(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Ut(n){return n}function Gt(n,t,e){var r=true,u=t&&bt(t);t&&(e||u.length)||(null==e&&(e=t),o=Q,t=n,n=J,u=bt(t)),false===e?r=false:wt(e)&&"chain"in e&&(r=e.chain);var o=n,i=dt(o);St(u,function(e){var u=n[e]=t[e];i&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,i=[e];if(be.apply(i,arguments),i=u.apply(n,i),r||t){if(e===i&&wt(i))return this; -i=new o(i),i.__chain__=t}return i})})}function Ht(){}function Jt(n){return function(t){return t[n]}}function Qt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,A)):G;var Xt=e.Array,Yt=e.Boolean,Zt=e.Date,ne=e.Function,te=e.Math,ee=e.Number,re=e.Object,ue=e.RegExp,oe=e.String,ie=e.TypeError,ae=[],fe=re.prototype,le=e._,ce=fe.toString,pe=ue("^"+oe(ce).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),se=te.ceil,ve=e.clearTimeout,he=te.floor,ge=ne.prototype.toString,ye=vt(ye=re.getPrototypeOf)&&ye,me=fe.hasOwnProperty,be=ae.push,_e=e.setTimeout,de=ae.splice,we=ae.unshift,je=function(){try{var n={},t=vt(t=re.defineProperty)&&t,e=t(n,n,n)&&t -}catch(r){}return e}(),ke=vt(ke=re.create)&&ke,xe=vt(xe=Xt.isArray)&&xe,Ce=e.isFinite,Oe=e.isNaN,Ne=vt(Ne=re.keys)&&Ne,Ie=te.max,Se=te.min,Ee=e.parseInt,Re=te.random,Ae={};Ae[$]=Xt,Ae[T]=Yt,Ae[F]=Zt,Ae[B]=ne,Ae[q]=re,Ae[W]=ee,Ae[z]=ue,Ae[P]=oe,Q.prototype=J.prototype;var De=J.support={};De.funcDecomp=!vt(e.a)&&E.test(s),De.funcNames=typeof ne.name=="string",J.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:J}},ke||(nt=function(){function n(){}return function(t){if(wt(t)){n.prototype=t; -var r=new n;n.prototype=null}return r||e.Object()}}());var $e=je?function(n,t){M.value=t,je(n,"__bindData__",M)}:Ht,Te=xe||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ce.call(n)==$||false},Fe=Ne?function(n){return wt(n)?Ne(n):[]}:H,Be={"&":"&","<":"<",">":">",'"':""","'":"'"},We=_t(Be),qe=ue("("+Fe(We).join("|")+")","g"),ze=ue("["+Fe(Be).join("")+"]","g"),Pe=ye?function(n){if(!n||ce.call(n)!=q)return false;var t=n.valueOf,e=vt(t)&&(e=ye(t))&&ye(e);return e?n==e||ye(n)==e:ht(n) -}:ht,Ke=lt(function(n,t,e){me.call(n,e)?n[e]++:n[e]=1}),Le=lt(function(n,t,e){(me.call(n,e)?n[e]:n[e]=[]).push(t)}),Me=lt(function(n,t,e){n[e]=t}),Ve=Rt,Ue=vt(Ue=Zt.now)&&Ue||function(){return(new Zt).getTime()},Ge=8==Ee(d+"08")?Ee:function(n,t){return Ee(kt(n)?n.replace(I,""):n,t||0)};return J.after=function(n,t){if(!dt(t))throw new ie;return function(){return 1>--n?t.apply(this,arguments):void 0}},J.assign=U,J.at=function(n){for(var t=arguments,e=-1,r=ut(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Xt(t);++e=b&&o(r?e[r]:s)))}var p=e[0],h=-1,g=p?p.length:0,y=[];n:for(;++h(m?t(m,v):f(s,v))){for(r=u,(m||s).push(v);--r;)if(m=i[r],0>(m?t(m,v):f(e[r],v)))continue n;y.push(v)}}for(;u--;)(m=i[u])&&c(m);return l(i),l(s),y},J.invert=_t,J.invoke=function(n,t){var e=p(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=Xt(typeof o=="number"?o:0);return St(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},J.keys=Fe,J.map=Rt,J.mapValues=function(n,t,e){var r={}; -return t=J.createCallback(t,e,3),h(n,function(n,e,u){r[e]=t(n,e,u)}),r},J.max=At,J.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):m+arguments[0];return me.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!dt(n))throw new ie;return e.cache={},e},J.merge=function(n){var t=arguments,e=2;if(!wt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3e?Ie(0,r+e):Se(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},J.mixin=Gt,J.noConflict=function(){return e._=le,this},J.noop=Ht,J.now=Ue,J.parseInt=Ge,J.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Re(),Se(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):at(n,t) -},J.reduce=Dt,J.reduceRight=$t,J.result=function(n,t){if(n){var e=n[t];return dt(e)?n[t]():e}},J.runInContext=s,J.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Fe(n).length},J.some=Ft,J.sortedIndex=zt,J.template=function(n,t,e){var r=J.templateSettings;n=oe(n||""),e=_({},e,r);var u,o=_({},e.imports,r.imports),r=Fe(o),o=xt(o),a=0,f=e.interpolate||S,l="__p+='",f=ue((e.escape||S).source+"|"+f.source+"|"+(f===N?x:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(R,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t -}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=ne(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},J.unescape=function(n){return null==n?"":oe(n).replace(qe,gt)},J.uniqueId=function(n){var t=++y;return oe(null==n?"":n)+t -},J.all=Ot,J.any=Ft,J.detect=It,J.findWhere=It,J.foldl=Dt,J.foldr=$t,J.include=Ct,J.inject=Dt,Gt(function(){var n={};return h(J,function(t,e){J.prototype[e]||(n[e]=t)}),n}(),false),J.first=Bt,J.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=J.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,Ie(0,u-r))},J.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=xt(n)),null==t||e?n?n[at(0,n.length-1)]:v:(n=Tt(n),n.length=Se(Ie(0,t),n.length),n) -},J.take=Bt,J.head=Bt,h(J,function(n,t){var e="sample"!==t;J.prototype[t]||(J.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new Q(o,u):o})}),J.VERSION="2.4.1",J.prototype.chain=function(){return this.__chain__=true,this},J.prototype.toString=function(){return oe(this.__wrapped__)},J.prototype.value=Qt,J.prototype.valueOf=Qt,St(["join","pop","shift"],function(n){var t=ae[n];J.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); -return n?new Q(e,n):e}}),St(["push","reverse","sort","unshift"],function(n){var t=ae[n];J.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),St(["concat","slice","splice"],function(n){var t=ae[n];J.prototype[n]=function(){return new Q(t.apply(this.__wrapped__,arguments),this.__chain__)}}),J}var v,h=[],g=[],y=0,m=+new Date+"",b=75,_=40,d=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,I=RegExp("^["+d+"]*0+(?=.$)"),S=/($^)/,E=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,A="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),D="[object Arguments]",$="[object Array]",T="[object Boolean]",F="[object Date]",B="[object Function]",W="[object Number]",q="[object Object]",z="[object RegExp]",P="[object String]",K={}; -K[B]=false,K[D]=K[$]=K[T]=K[F]=K[W]=K[q]=K[z]=K[P]=true;var L={leading:false,maxWait:0,trailing:false},M={configurable:false,enumerable:false,value:null,writable:false},V={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},U={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},G=V[typeof window]&&window||this,H=V[typeof exports]&&exports&&!exports.nodeType&&exports,J=V[typeof module]&&module&&!module.nodeType&&module,Q=J&&J.exports===H&&H,X=V[typeof global]&&global;!X||X.global!==X&&X.window!==X||(G=X); -var Y=s();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(G._=Y, define(function(){return Y})):H&&J?Q?(J.exports=Y)._=Y:H._=Y:G._=Y}).call(this); +;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++er||typeof e=="undefined")return 1;if(ee?0:e);++r=b&&f===n,h=u||v?i():s;if(v){var g=o(h);g?(f=t,h=g):(v=!1,h=u?h:(c(h),s))}for(;++af(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(c(h.k),p(h)):u&&c(h),s}function it(n){return function(t,e,r){var u={};e=Y.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++re?Re(0,o+e):e)||0,Pe(n)?a=-1o&&(o=i)}}else t=!t&&wt(n)?r:Y.createCallback(t,e,3),It(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Rt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Xt(r);++earguments.length;t=et(t,r,4);var o=-1,a=n.length;if(typeof a=="number")for(u&&(e=n[++o]);++oarguments.length;return t=et(t,r,4),Nt(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Bt(n){var t=-1,e=n?n.length:0,r=Xt(typeof e=="number"?e:0);return It(n,function(n){var e=Jt(++t);r[t]=r[e],r[e]=n}),r}function $t(n,t,e){var r;t=Y.createCallback(t,e,3),e=-1; +var u=n?n.length:0;if(typeof u=="number")for(;++e=b&&u===n;if(l){var c=o(i);c?(u=t,i=c):l=!1}for(;++ru(i,c)&&f.push(c);return l&&p(i),f}function Tt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=Y.createCallback(t,e,3);++or?Re(0,u+r):r||0}else if(r)return r=zt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=Y.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Y}},Oe||(lt=function(n){if(bt(n)){l.prototype=n;var t=new l;l.prototype=null}return t||{}});var ze=xe?function(n,t){U.value=t,xe(n,"__bindData__",U)}:l,Pe=Ie||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&je.call(n)==$||!1},Ke=Se?function(n){return bt(n)?Se(n):[] +}:Q,Le={"&":"&","<":"<",">":">",'"':""","'":"'"},Me=mt(Le),Ue=ue("("+Ke(Me).join("|")+")","g"),Ve=ue("["+Ke(Le).join("")+"]","g"),Ge=it(function(n,t,e){ye.call(n,e)?n[e]++:n[e]=1}),He=it(function(n,t,e){(ye.call(n,e)?n[e]:n[e]=[]).push(t)}),Je=it(function(n,t,e){n[e]=t});Te&&X&&typeof be=="function"&&(Vt=function(n){if(!_t(n))throw new ae;return be.apply(e,arguments)});var Qe=8==De(w+"08")?De:function(n,t){return De(wt(n)?n.replace(E,""):n,t||0)};return Y.after=function(n,t){if(!_t(t))throw new ae; +return function(){return 1>--n?t.apply(this,arguments):void 0}},Y.assign=J,Y.at=function(n){for(var t=arguments,e=-1,r=rt(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Xt(t);++e=b&&o(a?r[a]:g) +}n:for(;++l(m?t(m,y):s(g,y))){for(a=u,(m||g).push(y);--a;)if(m=f[a],0>(m?t(m,y):s(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=f[u])&&p(m);return c(f),c(g),h},Y.invert=mt,Y.invoke=function(n,t){var e=$e.call(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Xt(typeof o=="number"?o:0);return It(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},Y.keys=Ke,Y.map=Et,Y.max=St,Y.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):_+arguments[0];return ye.call(r,u)?r[u]:r[u]=n.apply(this,arguments) +}if(!_t(n))throw new ae;return e.cache={},e},Y.merge=function(n){var t=arguments,e=2;if(!bt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3r(a,e))&&(o[e]=n)}),o},Y.once=function(n){var t,e;if(!_t(n))throw new ae;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},Y.pairs=function(n){for(var t=-1,e=Ke(n),r=e.length,u=Xt(r);++te?Re(0,r+e):Ae(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Y.mixin=Ht,Y.noConflict=function(){return e._=le,this},Y.parseInt=Qe,Y.random=Jt,Y.reduce=At,Y.reduceRight=Dt,Y.result=function(n,t){if(n){var e=n[t];return _t(e)?n[t]():e}},Y.runInContext=v,Y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Ke(n).length},Y.some=$t,Y.sortedIndex=zt,Y.template=function(n,t,e){var r=Y.templateSettings; +n||(n=""),e=G({},e,r);var u,o=G({},e.imports,r.imports),r=Ke(o),o=jt(o),i=0,f=e.interpolate||S,l="__p+='",f=ue((e.escape||S).source+"|"+f.source+"|"+(f===N?C:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(i,c).replace(A,a),e&&(l+="'+__e("+e+")+'"),f&&(u=!0,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(j,""):l).replace(k,"$1").replace(x,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}"; +try{var c=ne(r,"return "+l).apply(h,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Y.unescape=function(n){return null==n?"":oe(n).replace(Ue,vt)},Y.uniqueId=function(n){var t=++m;return oe(null==n?"":n)+t},Y.all=xt,Y.any=$t,Y.detect=Ot,Y.findWhere=Ot,Y.foldl=At,Y.foldr=Dt,Y.include=kt,Y.inject=At,y(Y,function(n,t){Y.prototype[t]||(Y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return _e.apply(t,arguments),t=n.apply(Y,t),e?new nt(t,e):t})}),Y.first=Tt,Y.last=function(n,t,e){var r=0,u=n?n.length:0; +if(typeof t!="number"&&null!=t){var o=u;for(t=Y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Re(0,u-r))},Y.sample=function(n,t,e){var r=n?n.length:0;return typeof r!="number"&&(n=jt(n)),null==t||e?n?n[Jt(r-1)]:h:(n=Bt(n),n.length=Ae(Re(0,t),n.length),n)},Y.take=Tt,Y.head=Tt,y(Y,function(n,t){var e="sample"!==t;Y.prototype[t]||(Y.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new nt(o,u):o +})}),Y.VERSION="2.2.1",Y.prototype.chain=function(){return this.__chain__=!0,this},Y.prototype.toString=function(){return oe(this.__wrapped__)},Y.prototype.value=Qt,Y.prototype.valueOf=Qt,It(["join","pop","shift"],function(n){var t=ie[n];Y.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new nt(e,n):e}}),It(["push","reverse","sort","unshift"],function(n){var t=ie[n];Y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),It(["concat","slice","splice"],function(n){var t=ie[n]; +Y.prototype[n]=function(){return new nt(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Y}var h,g=[],y=[],m=0,_=+new Date+"",b=75,d=40,w=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",j=/\b__p\+='';/g,k=/\b(__p\+=)''\+/g,x=/(__e\(.*?\)|\b__t\))\+'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O=/\w*$/,I=/^function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,E=RegExp("^["+w+"]*0+(?=.$)"),S=/($^)/,R=/\bthis\b/,A=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),B="[object Arguments]",$="[object Array]",F="[object Boolean]",T="[object Date]",W="[object Function]",q="[object Number]",z="[object Object]",P="[object RegExp]",K="[object String]",L={}; +L[W]=!1,L[B]=L[$]=L[F]=L[T]=L[q]=L[z]=L[P]=L[K]=!0;var M={leading:!1,maxWait:0,trailing:!1},U={configurable:!1,enumerable:!1,value:null,writable:!1},V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},G={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},H=V[typeof window]&&window||this,J=V[typeof exports]&&exports&&!exports.nodeType&&exports,Q=V[typeof module]&&module&&!module.nodeType&&module,X=Q&&Q.exports===J&&J,Y=V[typeof global]&&global;!Y||Y.global!==Y&&Y.window!==Y||(H=Y); +var Z=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(H._=Z, define(function(){return Z})):J&&Q?X?(Q.exports=Z)._=Z:J._=Z:H._=Z}).call(this); window.Behave = {}; Behave.view = $(document.body); diff --git a/dist/behave.min.js b/dist/behave.min.js index 236c3f0..43726b8 100644 --- a/dist/behave.min.js +++ b/dist/behave.min.js @@ -1 +1 @@ -(function(){function n(n,e,t){t=(t||0)-1;for(var r=n?n.length:0;++ta||"undefined"==typeof i)return 1;if(a>i||"undefined"==typeof a)return-1}}return n.n-e.n}function o(n){var e=-1,r=n.length,u=n[0],o=n[r/2|0],i=n[r-1];if(u&&"object"==typeof u&&o&&"object"==typeof o&&i&&"object"==typeof i)return!1;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=!1,o=f(),o.k=n,o.l=u,o.push=t;++et?0:t);++r3&&"function"==typeof i[f-2])var l=ee(i[--f-1],i[f--],2);else f>2&&"function"==typeof i[f-1]&&(l=i[--f]);for(;++a=d&&i===n,l=[];if(f){var p=o(r);p?(i=e,r=p):f=!1}for(;++ui(r,p)&&l.push(p);return f&&c(r),l}function ue(n,e,t,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r=d&&f===n,v=u||h?a():s;for(h&&(v=o(v),f=e);++if(v,y))&&((u||h)&&v.push(y),s.push(g))}return h?(l(v.k),c(v)):u&&l(v),s}function le(n){return function(e,t,r){var u={};t=H.createCallback(t,r,3),r=-1;var o=e?e.length:0;if("number"==typeof o)for(;++rt?At(0,o+t):t)||0,$t(n)?i=-1o&&(o=a)}}else e=null==e&&ke(n)?r:H.createCallback(e,t,3),Ee(n,function(n,t,r){t=e(n,t,r),t>u&&(u=t,o=n)});return o}function Se(n,e,t,r){if(!n)return t;var u=3>arguments.length;e=H.createCallback(e,r,4);var o=-1,i=n.length;if("number"==typeof i)for(u&&(t=n[++o]);++oarguments.length;return e=H.createCallback(e,r,4),Te(n,function(n,r,o){t=u?(u=!1,n):e(t,n,r,o)}),t}function $e(n){var e=-1,t=n?n.length:0,r=Xe("number"==typeof t?t:0);return Ee(n,function(n){var t=ae(0,++e);r[e]=r[t],r[t]=n}),r}function De(n,e,t){var r;e=H.createCallback(e,t,3),t=-1;var u=n?n.length:0;if("number"==typeof u)for(;++tr?At(0,u+r):r||0}else if(r)return r=Ve(e,t),e[r]===t?r:-1;return n(e,t,r)}function ze(n,e,t){if("number"!=typeof e&&null!=e){var r=0,u=-1,o=n?n.length:0;for(e=H.createCallback(e,t,3);++uu;)r=u+o>>>1,t(n[r])t?0:t);++e0?c=bt(u,t):(i&&ht(i),t=p,i=c=p=h,t&&(s=Ut(),a=n.apply(l,o),c||i||(o=l=null)))}var o,i,a,f,l,c,p,s=0,v=!1,g=!0;if(!_e(n))throw new it;if(e=At(0,e)||0,!0===t)var y=!0,g=!1;else we(t)&&(y=t.leading,v="maxWait"in t&&(At(e,t.maxWait)||0),g="trailing"in t?t.trailing:g);return function(){if(o=arguments,f=Ut(),l=this,p=g&&(c||!y),!1===v)var t=y&&!c;else{i||y||(s=f);var h=v-(f-s),m=0>=h;m?(i&&(i=ht(i)),s=f,a=n.apply(l,o)):i||(i=bt(r,h))}return m&&c?c=ht(c):c||e===v||(c=bt(u,e)),t&&(m=!0,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Ue(n){return n}function Qe(n,e,t){var r=!0,u=e&&de(e);e&&(t||u.length)||(null==t&&(t=e),o=J,e=n,n=H,u=de(e)),!1===t?r=!1:we(t)&&"chain"in t&&(r=t.chain);var o=n,i=_e(o);Ee(u,function(t){var u=n[t]=e[t];i&&(o.prototype[t]=function(){var e=this.__chain__,t=this.__wrapped__,i=[t];if(dt.apply(i,arguments),i=u.apply(n,i),r||e){if(t===i&&we(i))return this;i=new o(i),i.__chain__=e}return i})})}function Ge(){}function He(n){return function(e){return e[n]}}function Je(){return this.__wrapped__}t=t?Y.defaults(Q.Object(),t,Y.pick(Q,N)):Q;var Xe=t.Array,Ye=t.Boolean,Ze=t.Date,nt=t.Function,et=t.Math,tt=t.Number,rt=t.Object,ut=t.RegExp,ot=t.String,it=t.TypeError,at=[],ft=rt.prototype,lt=t._,ct=ft.toString,pt=ut("^"+ot(ct).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),st=et.ceil,ht=t.clearTimeout,vt=et.floor,gt=nt.prototype.toString,yt=he(yt=rt.getPrototypeOf)&&yt,mt=ft.hasOwnProperty,dt=at.push,bt=t.setTimeout,_t=at.splice,wt=at.unshift,jt=function(){try{var n={},e=he(e=rt.defineProperty)&&e,t=e(n,n,n)&&e}catch(r){}return t}(),kt=he(kt=rt.create)&&kt,xt=he(xt=Xe.isArray)&&xt,Ct=t.isFinite,Bt=t.isNaN,Ot=he(Ot=rt.keys)&&Ot,At=et.max,Et=et.min,Tt=t.parseInt,It=et.random,Nt={};Nt[R]=Xe,Nt[$]=Ye,Nt[D]=Ze,Nt[F]=nt,Nt[z]=rt,Nt[q]=tt,Nt[V]=ut,Nt[W]=ot,J.prototype=H.prototype;var St=H.support={};St.funcDecomp=!he(t.a)&&T.test(s),St.funcNames="string"==typeof nt.name,H.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:O,variable:"",imports:{_:H}},kt||(ne=function(){function n(){}return function(e){if(we(e)){n.prototype=e;var r=new n;n.prototype=null}return r||t.Object()}}());var Rt=jt?function(n,e){L.value=e,jt(n,"__bindData__",L)}:Ge,$t=xt||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&ct.call(n)==R||!1},Dt=Ot?function(n){return we(n)?Ot(n):[]}:G,Ft={"&":"&","<":"<",">":">",'"':""","'":"'"},qt=be(Ft),zt=ut("("+Dt(qt).join("|")+")","g"),Vt=ut("["+Dt(Ft).join("")+"]","g"),Wt=yt?function(n){if(!n||ct.call(n)!=z)return!1;var e=n.valueOf,t=he(e)&&(t=yt(e))&&yt(t);return t?n==t||yt(n)==t:ve(n)}:ve,Pt=le(function(n,e,t){mt.call(n,t)?n[t]++:n[t]=1}),Kt=le(function(n,e,t){(mt.call(n,t)?n[t]:n[t]=[]).push(e)}),Lt=le(function(n,e,t){n[t]=e}),Mt=Ie,Ut=he(Ut=Ze.now)&&Ut||function(){return(new Ze).getTime()},Qt=8==Tt(_+"08")?Tt:function(n,e){return Tt(ke(n)?n.replace(A,""):n,e||0)};return H.after=function(n,e){if(!_e(e))throw new it;return function(){return 1>--n?e.apply(this,arguments):void 0}},H.assign=U,H.at=function(n){for(var e=arguments,t=-1,r=ue(e,!0,!1,1),e=e[2]&&e[2][e[1]]===n?1:r.length,u=Xe(e);++t=d&&o(r?t[r]:s)))}var p=t[0],v=-1,g=p?p.length:0,y=[];n:for(;++v(m?e(m,h):f(s,h))){for(r=u,(m||s).push(h);--r;)if(m=i[r],0>(m?e(m,h):f(t[r],h)))continue n;y.push(h)}}for(;u--;)(m=i[u])&&c(m);return l(i),l(s),y},H.invert=be,H.invoke=function(n,e){var t=p(arguments,2),r=-1,u="function"==typeof e,o=n?n.length:0,i=Xe("number"==typeof o?o:0);return Ee(n,function(n){i[++r]=(u?e:n[e]).apply(n,t)}),i},H.keys=Dt,H.map=Ie,H.mapValues=function(n,e,t){var r={};return e=H.createCallback(e,t,3),v(n,function(n,t,u){r[t]=e(n,t,u)}),r},H.max=Ne,H.memoize=function(n,e){function t(){var r=t.cache,u=e?e.apply(this,arguments):m+arguments[0];return mt.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!_e(n))throw new it;return t.cache={},t},H.merge=function(n){var e=arguments,t=2;if(!we(n))return n;if("number"!=typeof e[2]&&(t=e.length),t>3&&"function"==typeof e[t-2])var r=ee(e[--t-1],e[t--],2);else t>2&&"function"==typeof e[t-1]&&(r=e[--t]);for(var e=p(arguments,1,t),u=-1,o=a(),i=a();++ua&&(o=a)}}else e=null==e&&ke(n)?r:H.createCallback(e,t,3),Ee(n,function(n,t,r){t=e(n,t,r),u>t&&(u=t,o=n)});return o},H.omit=function(n,e,t){var r={};if("function"!=typeof e){var u=[];g(n,function(n,e){u.push(e)});for(var u=re(u,ue(arguments,!0,!1,1)),o=-1,i=u.length;++ot?At(0,r+t):Et(t,r-1))+1);r--;)if(n[r]===e)return r;return-1},H.mixin=Qe,H.noConflict=function(){return t._=lt,this},H.noop=Ge,H.now=Ut,H.parseInt=Qt,H.random=function(n,e,t){var r=null==n,u=null==e;return null==t&&("boolean"==typeof n&&u?(t=n,n=1):u||"boolean"!=typeof e||(t=e,u=!0)),r&&u&&(e=1),n=+n||0,u?(e=n,n=0):e=+e||0,t||n%1||e%1?(t=It(),Et(n+t*(e-n+parseFloat("1e-"+((t+"").length-1))),e)):ae(n,e)},H.reduce=Se,H.reduceRight=Re,H.result=function(n,e){if(n){var t=n[e];return _e(t)?n[e]():t}},H.runInContext=s,H.size=function(n){var e=n?n.length:0;return"number"==typeof e?e:Dt(n).length},H.some=De,H.sortedIndex=Ve,H.template=function(n,e,t){var r=H.templateSettings;n=ot(n||""),t=b({},t,r);var u,o=b({},t.imports,r.imports),r=Dt(o),o=xe(o),a=0,f=t.interpolate||E,l="__p+='",f=ut((t.escape||E).source+"|"+f.source+"|"+(f===O?x:E).source+"|"+(t.evaluate||E).source+"|$","g");n.replace(f,function(e,t,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(I,i),t&&(l+="'+__e("+t+")+'"),f&&(u=!0,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+e.length,e}),l+="';",f=t=t.variable,f||(t="obj",l="with("+t+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+t+"){"+(f?"":t+"||("+t+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=nt(r,"return "+l).apply(h,o)}catch(p){throw p.source=l,p}return e?c(e):(c.source=l,c)},H.unescape=function(n){return null==n?"":ot(n).replace(zt,ge)},H.uniqueId=function(n){var e=++y;return ot(null==n?"":n)+e},H.all=Be,H.any=De,H.detect=Ae,H.findWhere=Ae,H.foldl=Se,H.foldr=Re,H.include=Ce,H.inject=Se,Qe(function(){var n={};return v(H,function(e,t){H.prototype[t]||(n[t]=e)}),n}(),!1),H.first=Fe,H.last=function(n,e,t){var r=0,u=n?n.length:0;if("number"!=typeof e&&null!=e){var o=u;for(e=H.createCallback(e,t,3);o--&&e(n[o],o,n);)r++}else if(r=e,null==r||t)return n?n[u-1]:h;return p(n,At(0,u-r))},H.sample=function(n,e,t){return n&&"number"!=typeof n.length&&(n=xe(n)),null==e||t?n?n[ae(0,n.length-1)]:h:(n=$e(n),n.length=Et(At(0,e),n.length),n)},H.take=Fe,H.head=Fe,v(H,function(n,e){var t="sample"!==e;H.prototype[e]||(H.prototype[e]=function(e,r){var u=this.__chain__,o=n(this.__wrapped__,e,r);return u||null!=e&&(!r||t&&"function"==typeof e)?new J(o,u):o})}),H.VERSION="2.4.1",H.prototype.chain=function(){return this.__chain__=!0,this},H.prototype.toString=function(){return ot(this.__wrapped__)},H.prototype.value=Je,H.prototype.valueOf=Je,Ee(["join","pop","shift"],function(n){var e=at[n];H.prototype[n]=function(){var n=this.__chain__,t=e.apply(this.__wrapped__,arguments);return n?new J(t,n):t}}),Ee(["push","reverse","sort","unshift"],function(n){var e=at[n];H.prototype[n]=function(){return e.apply(this.__wrapped__,arguments),this}}),Ee(["concat","slice","splice"],function(n){var e=at[n];H.prototype[n]=function(){return new J(e.apply(this.__wrapped__,arguments),this.__chain__)}}),H}var h,v=[],g=[],y=0,m=+new Date+"",d=75,b=40,_=" \f \n\r\u2028\u2029 ᠎              ",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,B=/^\s*function[ \n\r\t]+\w/,O=/<%=([\s\S]+?)%>/g,A=RegExp("^["+_+"]*0+(?=.$)"),E=/($^)/,T=/\bthis\b/,I=/['\n\r\t\u2028\u2029\\]/g,N="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),S="[object Arguments]",R="[object Array]",$="[object Boolean]",D="[object Date]",F="[object Function]",q="[object Number]",z="[object Object]",V="[object RegExp]",W="[object String]",P={};P[F]=!1,P[S]=P[R]=P[$]=P[D]=P[q]=P[z]=P[V]=P[W]=!0;var K={leading:!1,maxWait:0,trailing:!1},L={configurable:!1,enumerable:!1,value:null,writable:!1},M={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},U={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},Q=M[typeof window]&&window||this,G=M[typeof exports]&&exports&&!exports.nodeType&&exports,H=M[typeof module]&&module&&!module.nodeType&&module,J=H&&H.exports===G&&G,X=M[typeof global]&&global;!X||X.global!==X&&X.window!==X||(Q=X);var Y=s();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Q._=Y,define(function(){return Y})):G&&H?J?(H.exports=Y)._=Y:G._=Y:Q._=Y}).call(this),window.Behave={},Behave.view=$(document.body),Behave.domTypes={field:{elementTypes:["input","select","option","label","textarea","form"],attrOptions:["name","for","placeholder","contains","type","test-me"]},clickable:{elementTypes:["button","a"],attrOptions:["contains","href","test-me"]},icon:{elementTypes:["icon","div","span"],attrOptions:["type","class","test-me"]},display:{elementTypes:[""],attrOptions:["test-me","contains"]}},Behave.getAllElsAttrOptions=["name","for","placeholder","type","test-me"],Behave.find=function(n,e){var t="",r=e?{specificOption:Behave.domTypes[e]}:Behave.domTypes;return _.each(r,function(e){_.each(e.elementTypes,function(r){return t.length?!1:void _.each(e.attrOptions,function(e){switch(e){case"contains":var u=":contains("+n+")";t=Behave.view.find(r+u);break;case"class":t=findByClass(n,r,"glyphicon-");break;default:var u="["+e+"='"+n+"']";t=Behave.view.find(r+u)}return t.length?!1:void 0})})}),t&&t.is("label")&&(t=getClosestInput(t)),t.length||(t=Behave.view.find(n)),t},Behave.fill=function(n){var e=n instanceof jQuery?n:Behave.find(n,"field"),t=function(n){if(e.is("form")||"form"===e.attr("type")){if(!_.isObject(n))throw new Error("Must pass in a hash with signature of {element: value} when filling a whole form");return void _.each(n,function(n,e){Behave.fill(e).with(n)})}return"checkbox"===e.attr("type")?e.prop("checked",n):void e.val(n).trigger("input")},r={"with":t};return r},Behave.getAllEls=function(n,e){n=n||Behave.view,e=e||{};var t=n.children;t.length&&n.children().each(function(){e=Behave.getAllEls($(this),e)}),_.each(Behave.getAllElsAttrOptions,function(t){var r=cleanVal(n.attr(t));r&&(n.reload=function(){return Behave.find(r)}),r&&(e[r]=n)});var r=n.text();return r&&(e[cleanVal(r)]=n),e};var getClosestInput=function(n){var e=n.next();if(e.is("input"))return e;var t=e.find("input");return t.length?t:n},findByClass=function(n,e,t){return t=t||"",e=e||"",Behave.view.find(e+"."+t+n).first()},cleanVal=function(n){if(n){if(n=n.replace(" ",""),-1!==n.indexOf("-")){var e=n.split("-");e[1]=e[1][0].toUpperCase()+e[1].substring(1),e[2]&&(e[2]=e[2][0].toUpperCase()+e[2].substring(1)),n=e.join("")}return n}};window.find=Behave.find,window.fill=Behave.fill; \ No newline at end of file +(function(){function n(n,e,t){t=(t||0)-1;for(var r=n?n.length:0;++tr||"undefined"==typeof t)return 1;if(r>t||"undefined"==typeof r)return-1}return n.n-e.n}function o(n){var e=-1,r=n.length,u=n[0],o=n[0|r/2],i=n[r-1];if(u&&"object"==typeof u&&o&&"object"==typeof o&&i&&"object"==typeof i)return!1;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=!1,o=f(),o.k=n,o.l=u,o.push=t;++et?0:t);++r3&&"function"==typeof i[f-2])var l=te(i[--f-1],i[f--],2);else f>2&&"function"==typeof i[f-1]&&(l=i[--f]);for(;++a=_&&f===n,v=u||h?a():s;if(h){var g=o(v);g?(f=e,v=g):(h=!1,v=u?v:(c(v),s))}for(;++if(v,y))&&((u||h)&&v.push(y),s.push(g))}return h?(c(v.k),p(v)):u&&c(v),s}function ae(n){return function(e,t,r){var u={};t=Y.createCallback(t,r,3),r=-1;var o=e?e.length:0;if("number"==typeof o)for(;++rt?Nt(0,o+t):t)||0,Pt(n)?i=-1o&&(o=a)}}else e=!e&&we(n)?r:Y.createCallback(e,t,3),Oe(n,function(n,t,r){t=e(n,t,r),t>u&&(u=t,o=n)});return o}function Ne(n,e){var t=-1,r=n?n.length:0;if("number"==typeof r)for(var u=Xe(r);++targuments.length;e=te(e,r,4);var o=-1,i=n.length;if("number"==typeof i)for(u&&(t=n[++o]);++oarguments.length;return e=te(e,r,4),Ee(n,function(n,r,o){t=u?(u=!1,n):e(t,n,r,o)}),t}function $e(n){var e=-1,t=n?n.length:0,r=Xe("number"==typeof t?t:0);return Oe(n,function(n){var t=He(++e);r[e]=r[t],r[t]=n}),r}function De(n,e,t){var r;e=Y.createCallback(e,t,3),t=-1;var u=n?n.length:0;if("number"==typeof u)for(;++t=_&&u===n;if(l){var c=o(a);c?(u=e,a=c):l=!1}for(;++ru(a,c)&&f.push(c);return l&&p(a),f}function Fe(n,e,t){var r=0,u=n?n.length:0;if("number"!=typeof e&&null!=e){var o=-1;for(e=Y.createCallback(e,t,3);++or?Nt(0,u+r):r||0}else if(r)return r=We(e,t),e[r]===t?r:-1;return n(e,t,r)}function ze(n,e,t){if("number"!=typeof e&&null!=e){var r=0,u=-1,o=n?n.length:0;for(e=Y.createCallback(e,t,3);++uu;)r=u+o>>>1,t(n[r])t?0:t);++e0?c=bt(u,t):(i&&st(i),t=p,i=c=p=v,t&&(s=dt(),a=n.apply(l,o)))}var o,i,a,f,l,c,p,s=0,h=!1,g=!0;if(!me(n))throw new it;if(e=Nt(0,e)||0,!0===t)var y=!0,g=!1;else _e(t)&&(y=t.leading,h="maxWait"in t&&(Nt(e,t.maxWait)||0),g="trailing"in t?t.trailing:g);return function(){if(o=arguments,f=dt(),l=this,p=g&&(c||!y),!1===h)var t=y&&!c;else{i||y||(s=f);var v=h-(f-s);v>0?i||(i=bt(r,v)):(i&&(i=st(i)),s=f,a=n.apply(l,o))}return c||e===h||(c=bt(u,e)),t&&(a=n.apply(l,o)),a}}function Ue(n){if(!me(n))throw new it;var e=Dt.call(arguments,1);return bt(function(){n.apply(v,e)},1)}function Qe(n){return n}function Ge(n,e){var t=n,r=!e||me(t);e||(t=ne,e=n,n=Y),Oe(ye(e),function(u){var o=n[u]=e[u];r&&(t.prototype[u]=function(){var e=this.__wrapped__,r=[e];return mt.apply(r,arguments),r=o.apply(n,r),e&&"object"==typeof e&&e===r?this:(r=new t(r),r.__chain__=this.__chain__,r)})})}function He(n,e,t){var r=null==n,u=null==e;return null==t&&("boolean"==typeof n&&u?(t=n,n=1):u||"boolean"!=typeof e||(t=e,u=!0)),r&&u&&(e=1),n=+n||0,u?(e=n,n=0):e=+e||0,r=$t(),t||n%1||e%1?Tt(n+r*(e-n+parseFloat("1e-"+((r+"").length-1))),e):n+ht(r*(e-n+1))}function Je(){return this.__wrapped__}t=t?Z.defaults(G.Object(),t,Z.pick(G,S)):G;var Xe=t.Array,Ye=t.Boolean,Ze=t.Date,nt=t.Function,et=t.Math,tt=t.Number,rt=t.Object,ut=t.RegExp,ot=t.String,it=t.TypeError,at=[],ft=rt.prototype,lt=t._,ct=ut("^"+ot(ft.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),pt=et.ceil,st=t.clearTimeout,ht=et.floor,vt=nt.prototype.toString,gt=ct.test(gt=rt.getPrototypeOf)&>,yt=ft.hasOwnProperty,dt=ct.test(dt=Ze.now)&&dt||function(){return+new Ze},mt=at.push,_t=t.setImmediate,bt=t.setTimeout,wt=at.splice,jt=ft.toString,kt=at.unshift,xt=function(){try{var n={},e=ct.test(e=rt.defineProperty)&&e,t=e(n,n,n)&&e}catch(r){}return t}(),Ct=ct.test(Ct=jt.bind)&&Ct,Bt=ct.test(Bt=rt.create)&&Bt,Ot=ct.test(Ot=Xe.isArray)&&Ot,Et=t.isFinite,At=t.isNaN,It=ct.test(It=rt.keys)&&It,Nt=et.max,Tt=et.min,St=t.parseInt,$t=et.random,Dt=at.slice,Rt=ct.test(t.attachEvent),Ft=Ct&&!/\n|true/.test(Ct+Rt),qt={};qt[D]=Xe,qt[R]=Ye,qt[F]=Ze,qt[q]=nt,qt[W]=rt,qt[z]=tt,qt[P]=ut,qt[V]=ot,ne.prototype=Y.prototype;var zt=Y.support={};zt.fastBind=Ct&&!Ft,zt.funcDecomp=!ct.test(t.a)&&N.test(h),zt.funcNames="string"==typeof nt.name,Y.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:E,variable:"",imports:{_:Y}},Bt||(le=function(n){if(_e(n)){l.prototype=n;var e=new l;l.prototype=null}return e||{}});var Wt=xt?function(n,e){M.value=e,xt(n,"__bindData__",M)}:l,Pt=Ot||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&jt.call(n)==D||!1},Vt=It?function(n){return _e(n)?It(n):[]}:J,Kt={"&":"&","<":"<",">":">",'"':""","'":"'"},Lt=de(Kt),Mt=ut("("+Vt(Lt).join("|")+")","g"),Ut=ut("["+Vt(Kt).join("")+"]","g"),Qt=ae(function(n,e,t){yt.call(n,t)?n[t]++:n[t]=1}),Gt=ae(function(n,e,t){(yt.call(n,t)?n[t]:n[t]=[]).push(e)}),Ht=ae(function(n,e,t){n[t]=e});Ft&&X&&"function"==typeof _t&&(Ue=function(n){if(!me(n))throw new it;return _t.apply(t,arguments)});var Jt=8==St(w+"08")?St:function(n,e){return St(we(n)?n.replace(A,""):n,e||0)};return Y.after=function(n,e){if(!me(e))throw new it;return function(){return 1>--n?e.apply(this,arguments):void 0}},Y.assign=H,Y.at=function(n){for(var e=arguments,t=-1,r=re(e,!0,!1,1),e=e[2]&&e[2][e[1]]===n?1:r.length,u=Xe(e);++t=_&&o(i?r[i]:g)}n:for(;++l(d?e(d,y):s(g,y))){for(i=u,(d||g).push(y);--i;)if(d=f[i],0>(d?e(d,y):s(r[i],y)))continue n;v.push(y)}}for(;u--;)(d=f[u])&&p(d);return c(f),c(g),v},Y.invert=de,Y.invoke=function(n,e){var t=Dt.call(arguments,2),r=-1,u="function"==typeof e,o=n?n.length:0,i=Xe("number"==typeof o?o:0);return Oe(n,function(n){i[++r]=(u?e:n[e]).apply(n,t)}),i},Y.keys=Vt,Y.map=Ae,Y.max=Ie,Y.memoize=function(n,e){function t(){var r=t.cache,u=e?e.apply(this,arguments):m+arguments[0];return yt.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!me(n))throw new it;return t.cache={},t},Y.merge=function(n){var e=arguments,t=2;if(!_e(n))return n;if("number"!=typeof e[2]&&(t=e.length),t>3&&"function"==typeof e[t-2])var r=te(e[--t-1],e[t--],2);else t>2&&"function"==typeof e[t-1]&&(r=e[--t]);for(var e=Dt.call(arguments,1,t),u=-1,o=a(),i=a();++ua&&(o=a)}}else e=!e&&we(n)?r:Y.createCallback(e,t,3),Oe(n,function(n,t,r){t=e(n,t,r),u>t&&(u=t,o=n)});return o},Y.omit=function(n,e,t){var r=pe(),u="function"==typeof e,o={};if(u)e=Y.createCallback(e,t,3);else var i=re(arguments,!0,!1,1);return b(n,function(n,t,a){(u?!e(n,t,a):0>r(i,t))&&(o[t]=n)}),o},Y.once=function(n){var e,t;if(!me(n))throw new it;return function(){return e?t:(e=!0,t=n.apply(this,arguments),n=null,t)}},Y.pairs=function(n){for(var e=-1,t=Vt(n),r=t.length,u=Xe(r);++et?Nt(0,r+t):Tt(t,r-1))+1);r--;)if(n[r]===e)return r;return-1},Y.mixin=Ge,Y.noConflict=function(){return t._=lt,this},Y.parseInt=Jt,Y.random=He,Y.reduce=Te,Y.reduceRight=Se,Y.result=function(n,e){if(n){var t=n[e];return me(t)?n[e]():t}},Y.runInContext=h,Y.size=function(n){var e=n?n.length:0;return"number"==typeof e?e:Vt(n).length},Y.some=De,Y.sortedIndex=We,Y.template=function(n,e,t){var r=Y.templateSettings;n||(n=""),t=Q({},t,r);var u,o=Q({},t.imports,r.imports),r=Vt(o),o=je(o),a=0,f=t.interpolate||I,l="__p+='",f=ut((t.escape||I).source+"|"+f.source+"|"+(f===E?C:I).source+"|"+(t.evaluate||I).source+"|$","g");n.replace(f,function(e,t,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(T,i),t&&(l+="'+__e("+t+")+'"),f&&(u=!0,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+e.length,e}),l+="';\n",f=t=t.variable,f||(t="obj",l="with("+t+"){"+l+"}"),l=(u?l.replace(j,""):l).replace(k,"$1").replace(x,"$1;"),l="function("+t+"){"+(f?"":t+"||("+t+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=nt(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return e?c(e):(c.source=l,c)},Y.unescape=function(n){return null==n?"":ot(n).replace(Mt,he)},Y.uniqueId=function(n){var e=++d;return ot(null==n?"":n)+e},Y.all=xe,Y.any=De,Y.detect=Be,Y.findWhere=Be,Y.foldl=Te,Y.foldr=Se,Y.include=ke,Y.inject=Te,y(Y,function(n,e){Y.prototype[e]||(Y.prototype[e]=function(){var e=[this.__wrapped__],t=this.__chain__;return mt.apply(e,arguments),e=n.apply(Y,e),t?new ne(e,t):e})}),Y.first=Fe,Y.last=function(n,e,t){var r=0,u=n?n.length:0;if("number"!=typeof e&&null!=e){var o=u;for(e=Y.createCallback(e,t,3);o--&&e(n[o],o,n);)r++}else if(r=e,null==r||t)return n?n[u-1]:v;return s(n,Nt(0,u-r))},Y.sample=function(n,e,t){var r=n?n.length:0;return"number"!=typeof r&&(n=je(n)),null==e||t?n?n[He(r-1)]:v:(n=$e(n),n.length=Tt(Nt(0,e),n.length),n)},Y.take=Fe,Y.head=Fe,y(Y,function(n,e){var t="sample"!==e;Y.prototype[e]||(Y.prototype[e]=function(e,r){var u=this.__chain__,o=n(this.__wrapped__,e,r);return u||null!=e&&(!r||t&&"function"==typeof e)?new ne(o,u):o})}),Y.VERSION="2.2.1",Y.prototype.chain=function(){return this.__chain__=!0,this},Y.prototype.toString=function(){return ot(this.__wrapped__)},Y.prototype.value=Je,Y.prototype.valueOf=Je,Oe(["join","pop","shift"],function(n){var e=at[n];Y.prototype[n]=function(){var n=this.__chain__,t=e.apply(this.__wrapped__,arguments);return n?new ne(t,n):t}}),Oe(["push","reverse","sort","unshift"],function(n){var e=at[n];Y.prototype[n]=function(){return e.apply(this.__wrapped__,arguments),this}}),Oe(["concat","slice","splice"],function(n){var e=at[n];Y.prototype[n]=function(){return new ne(e.apply(this.__wrapped__,arguments),this.__chain__)}}),Y}var v,g=[],y=[],d=0,m=+new Date+"",_=75,b=40,w=" \f \n\r\u2028\u2029 ᠎              ",j=/\b__p\+='';/g,k=/\b(__p\+=)''\+/g,x=/(__e\(.*?\)|\b__t\))\+'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,B=/\w*$/,O=/^function[ \n\r\t]+\w/,E=/<%=([\s\S]+?)%>/g,A=RegExp("^["+w+"]*0+(?=.$)"),I=/($^)/,N=/\bthis\b/,T=/['\n\r\t\u2028\u2029\\]/g,S="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),$="[object Arguments]",D="[object Array]",R="[object Boolean]",F="[object Date]",q="[object Function]",z="[object Number]",W="[object Object]",P="[object RegExp]",V="[object String]",K={};K[q]=!1,K[$]=K[D]=K[R]=K[F]=K[z]=K[W]=K[P]=K[V]=!0;var L={leading:!1,maxWait:0,trailing:!1},M={configurable:!1,enumerable:!1,value:null,writable:!1},U={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Q={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},G=U[typeof window]&&window||this,H=U[typeof exports]&&exports&&!exports.nodeType&&exports,J=U[typeof module]&&module&&!module.nodeType&&module,X=J&&J.exports===H&&H,Y=U[typeof global]&&global;!Y||Y.global!==Y&&Y.window!==Y||(G=Y);var Z=h();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(G._=Z,define(function(){return Z})):H&&J?X?(J.exports=Z)._=Z:H._=Z:G._=Z}).call(this),window.Behave={},Behave.view=$(document.body),Behave.domTypes={field:{elementTypes:["input","select","option","label","textarea","form"],attrOptions:["name","for","placeholder","contains","type","test-me"]},clickable:{elementTypes:["button","a"],attrOptions:["contains","href","test-me"]},icon:{elementTypes:["icon","div","span"],attrOptions:["type","class","test-me"]},display:{elementTypes:[""],attrOptions:["test-me","contains"]}},Behave.getAllElsAttrOptions=["name","for","placeholder","type","test-me"],Behave.find=function(n,e){var t="",r=e?{specificOption:Behave.domTypes[e]}:Behave.domTypes;return _.each(r,function(e){_.each(e.elementTypes,function(r){return t.length?!1:void _.each(e.attrOptions,function(e){switch(e){case"contains":var u=":contains("+n+")";t=Behave.view.find(r+u);break;case"class":t=findByClass(n,r,"glyphicon-");break;default:var u="["+e+"='"+n+"']";t=Behave.view.find(r+u)}return t.length?!1:void 0})})}),t&&t.is("label")&&(t=getClosestInput(t)),t.length||(t=Behave.view.find(n)),t},Behave.fill=function(n){var e=n instanceof jQuery?n:Behave.find(n,"field"),t=function(n){if(e.is("form")||"form"===e.attr("type")){if(!_.isObject(n))throw new Error("Must pass in a hash with signature of {element: value} when filling a whole form");return void _.each(n,function(n,e){Behave.fill(e).with(n)})}return"checkbox"===e.attr("type")?e.prop("checked",n):void e.val(n).trigger("input")},r={"with":t};return r},Behave.getAllEls=function(n,e){n=n||Behave.view,e=e||{};var t=n.children;t.length&&n.children().each(function(){e=Behave.getAllEls($(this),e)}),_.each(Behave.getAllElsAttrOptions,function(t){var r=cleanVal(n.attr(t));r&&(n.reload=function(){return Behave.find(r)}),r&&(e[r]=n)});var r=n.text();return r&&(e[cleanVal(r)]=n),e};var getClosestInput=function(n){var e=n.next();if(e.is("input"))return e;var t=e.find("input");return t.length?t:n},findByClass=function(n,e,t){return t=t||"",e=e||"",Behave.view.find(e+"."+t+n).first()},cleanVal=function(n){if(n){if(n=n.replace(" ",""),-1!==n.indexOf("-")){var e=n.split("-");e[1]=e[1][0].toUpperCase()+e[1].substring(1),e[2]&&(e[2]=e[2][0].toUpperCase()+e[2].substring(1)),n=e.join("")}return n}};window.find=Behave.find,window.fill=Behave.fill; \ No newline at end of file