oppo
Version:
A lisp for javascript
44 lines (42 loc) • 41.9 kB
JavaScript
/*!
* =============================================================
* Ender: open module JavaScript framework (https://ender.no.de)
* Build: ender build underscore bean bonzo domready qwery jeesh kizzy
* =============================================================
*/
/*!
* Ender: open module JavaScript framework (client-lib)
* copyright Dustin Diaz & Jacob Thornton 2011 (@ded @fat)
* http://ender.no.de
* License MIT
*/
!function(a){function d(a){var c=b[a]||window[a];if(!c)throw new Error("Requested module '"+a+"' has not been defined.");return c}function e(a,c){return b[a]=c}function f(a,b){for(var c in b)c!="noConflict"&&c!="_VERSION"&&(a[c]=b[c]);return a}function g(a,b,c){return typeof a=="string"||a.nodeName||a.length&&"item"in a||a==window?(c=h._select(a,b),c.selector=a):c=isFinite(a.length)?a:[a],f(c,g)}function h(a,b){return g(a,b)}a.global=a;var b={},c=a.$;a.provide=e,a.require=d,f(h,{_VERSION:"0.3.6",fn:g,ender:function(a,b){f(b?g:h,a)},_select:function(a,b){return(b||document).querySelectorAll(a)}}),f(g,{forEach:function(a,b,c){for(c=0,l=this.length;c<l;++c)c in this&&a.call(b||this[c],this[c],c,this);return this},$:h}),h.noConflict=function(){return a.$=c,this},typeof module!="undefined"&&module.exports&&(module.exports=h),a.ender=a.$=a.ender||h}(this),!function(){var a={exports:{}},b=a.exports;((function(){function D(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual&&z.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&z.isFunction(b.isEqual))return b.isEqual(a);var d=l.call(a);if(d!=l.call(b))return!1;switch(d){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;var e=c.length;while(e--)if(c[e]==a)return!0;c.push(a);var f=0,g=!0;if(d=="[object Array]"){f=a.length,g=f==b.length;if(g)while(f--)if(!(g=f in a==f in b&&D(a[f],b[f],c)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var h in a)if(m.call(a,h)){f++;if(!(g=m.call(b,h)&&D(a[h],b[h],c)))break}if(g){for(h in b)if(m.call(b,h)&&!(f--))break;g=!f}}return c.pop(),g}var c=this,d=c._,e={},f=Array.prototype,g=Object.prototype,h=Function.prototype,i=f.slice,j=f.concat,k=f.unshift,l=g.toString,m=g.hasOwnProperty,n=f.forEach,o=f.map,p=f.reduce,q=f.reduceRight,r=f.filter,s=f.every,t=f.some,u=f.indexOf,v=f.lastIndexOf,w=Array.isArray,x=Object.keys,y=h.bind,z=function(a){return new F(a)};typeof b!="undefined"?(typeof a!="undefined"&&a.exports&&(b=a.exports=z),b._=z):typeof define=="function"&&define.amd?define("underscore",function(){return z}):c._=z,z.VERSION="1.2.3";var A=z.each=z.forEach=function(a,b,c){if(a==null)return;if(n&&a.forEach===n)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,f=a.length;d<f;d++)if(d in a&&b.call(c,a[d],d,a)===e)return}else for(var g in a)if(m.call(a,g)&&b.call(c,a[g],g,a)===e)return};z.map=function(a,b,c){var d=[];return a==null?d:o&&a.map===o?a.map(b,c):(A(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),d)},z.reduce=z.foldl=z.inject=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(p&&a.reduce===p)return d&&(b=z.bind(b,d)),e?a.reduce(b,c):a.reduce(b);A(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c},z.reduceRight=z.foldr=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(q&&a.reduceRight===q)return d&&(b=z.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=z.toArray(a).reverse();return d&&!e&&(b=z.bind(b,d)),e?z.reduce(f,b,c,d):z.reduce(f,b)},z.find=z.detect=function(a,b,c){var d;return B(a,function(a,e,f){if(b.call(c,a,e,f))return d=a,!0}),d},z.filter=z.select=function(a,b,c){var d=[];return a==null?d:r&&a.filter===r?a.filter(b,c):(A(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},z.reject=function(a,b,c){var d=[];return a==null?d:(A(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)}),d)},z.every=z.all=function(a,b,c){var d=!0;return a==null?d:s&&a.every===s?a.every(b,c):(A(a,function(a,f,g){if(!(d=d&&b.call(c,a,f,g)))return e}),d)};var B=z.some=z.any=function(a,b,c){b||(b=z.identity);var d=!1;return a==null?d:t&&a.some===t?a.some(b,c):(A(a,function(a,f,g){if(d||(d=b.call(c,a,f,g)))return e}),!!d)};z.include=z.contains=function(a,b){var c=!1;return a==null?c:u&&a.indexOf===u?a.indexOf(b)!=-1:(c=B(a,function(a){return a===b}),c)},z.invoke=function(a,b){var c=i.call(arguments,2);return z.map(a,function(a){return(b.call?b||a:a[b]).apply(a,c)})},z.pluck=function(a,b){return z.map(a,function(a){return a[b]})},z.max=function(a,b,c){if(!b&&z.isArray(a))return Math.max.apply(Math,a);if(!b&&z.isEmpty(a))return-Infinity;var d={computed:-Infinity};return A(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},z.min=function(a,b,c){if(!b&&z.isArray(a))return Math.min.apply(Math,a);if(!b&&z.isEmpty(a))return Infinity;var d={computed:Infinity};return A(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})}),d.value},z.shuffle=function(a){var b=[],c;return A(a,function(a,d,e){d==0?b[0]=a:(c=Math.floor(Math.random()*(d+1)),b[d]=b[c],b[c]=a)}),b},z.sortBy=function(a,b,c){return z.pluck(z.map(a,function(a,d,e){return{value:a,criteria:b.call(c,a,d,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")},z.groupBy=function(a,b){var c={},d=z.isFunction(b)?b:function(a){return a[b]};return A(a,function(a,b){var e=d(a,b);(c[e]||(c[e]=[])).push(a)}),c},z.sortedIndex=function(a,b,c){c||(c=z.identity);var d=0,e=a.length;while(d<e){var f=d+e>>1;c(a[f])<c(b)?d=f+1:e=f}return d},z.toArray=function(a){return a?a.toArray?a.toArray():z.isArray(a)?i.call(a):z.isArguments(a)?i.call(a):z.values(a):[]},z.size=function(a){return z.toArray(a).length},z.first=z.head=function(a,b,c){return b!=null&&!c?i.call(a,0,b):a[0]},z.initial=function(a,b,c){return i.call(a,0,a.length-(b==null||c?1:b))},z.last=function(a,b,c){return b!=null&&!c?i.call(a,Math.max(a.length-b,0)):a[a.length-1]},z.rest=z.tail=function(a,b,c){return i.call(a,b==null||c?1:b)},z.compact=function(a){return z.filter(a,function(a){return!!a})},z.flatten=function(a,b){return z.reduce(a,function(a,c){return z.isArray(c)?a.concat(b?c:z.flatten(c)):(a[a.length]=c,a)},[])},z.without=function(a){return z.difference(a,i.call(arguments,1))},z.uniq=z.unique=function(a,b,c){var d=c?z.map(a,c):a,e=[];return z.reduce(d,function(c,d,f){if(0==f||(b===!0?z.last(c)!=d:!z.include(c,d)))c[c.length]=d,e[e.length]=a[f];return c},[]),e},z.union=function(){return z.uniq(z.flatten(arguments,!0))},z.intersection=z.intersect=function(a){var b=i.call(arguments,1);return z.filter(z.uniq(a),function(a){return z.every(b,function(b){return z.indexOf(b,a)>=0})})},z.difference=function(a){var b=z.flatten(i.call(arguments,1));return z.filter(a,function(a){return!z.include(b,a)})},z.zip=function(){var a=i.call(arguments),b=z.max(z.pluck(a,"length")),c=new Array(b);for(var d=0;d<b;d++)c[d]=z.pluck(a,""+d);return c},z.indexOf=function(a,b,c){if(a==null)return-1;var d,e;if(c)return d=z.sortedIndex(a,b),a[d]===b?d:-1;if(u&&a.indexOf===u)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===b)return d;return-1},z.lastIndexOf=function(a,b){if(a==null)return-1;if(v&&a.lastIndexOf===v)return a.lastIndexOf(b);var c=a.length;while(c--)if(c in a&&a[c]===b)return c;return-1},z.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);while(e<d)f[e++]=a,a+=c;return f};var C=function(){};z.bind=function(b,c){var d,e;if(b.bind===y&&y)return y.apply(b,i.call(arguments,1));if(!z.isFunction(b))throw new TypeError;return e=i.call(arguments,2),d=function(){if(this instanceof d){C.prototype=b.prototype;var a=new C,f=b.apply(a,e.concat(i.call(arguments)));return Object(f)===f?f:a}return b.apply(c,e.concat(i.call(arguments)))}},z.bindAll=function(a){var b=i.call(arguments,1);return b.length==0&&(b=z.functions(a)),A(b,function(b){a[b]=z.bind(a[b],a)}),a},z.memoize=function(a,b){var c={};return b||(b=z.identity),function(){var d=b.apply(this,arguments);return m.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},z.delay=function(a,b){var c=i.call(arguments,2);return setTimeout(function(){return a.apply(a,c)},b)},z.defer=function(a){return z.delay.apply(z,[a,1].concat(i.call(arguments,1)))},z.throttle=function(a,b){var c,d,e,f,g,h=z.debounce(function(){g=f=!1},b);return function(){c=this,d=arguments;var i=function(){e=null,g&&a.apply(c,d),h()};e||(e=setTimeout(i,b)),f?g=!0:a.apply(c,d),h(),f=!0}},z.debounce=function(a,b){var c;return function(){var d=this,e=arguments,f=function(){c=null,a.apply(d,e)};clearTimeout(c),c=setTimeout(f,b)}},z.once=function(a){var b=!1,c;return function(){return b?c:(b=!0,c=a.apply(this,arguments))}},z.wrap=function(a,b){return function(){var c=j.apply([a],arguments);return b.apply(this,c)}},z.compose=function(){var a=arguments;return function(){var b=arguments;for(var c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},z.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}},z.keys=x||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)m.call(a,c)&&(b[b.length]=c);return b},z.values=function(a){return z.map(a,z.identity)},z.functions=z.methods=function(a){var b=[];for(var c in a)z.isFunction(a[c])&&b.push(c);return b.sort()},z.extend=function(a){return A(i.call(arguments,1),function(b){for(var c in b)b[c]!==void 0&&(a[c]=b[c])}),a},z.defaults=function(a){return A(i.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])}),a},z.clone=function(a){return z.isObject(a)?z.isArray(a)?a.slice():z.extend({},a):a},z.tap=function(a,b){return b(a),a},z.isEqual=function(a,b){return D(a,b,[])},z.isEmpty=function(a){if(z.isArray(a)||z.isString(a))return a.length===0;for(var b in a)if(m.call(a,b))return!1;return!0},z.isElement=function(a){return!!a&&a.nodeType==1},z.isArray=w||function(a){return l.call(a)=="[object Array]"},z.isObject=function(a){return a===Object(a)},z.isArguments=function(a){return l.call(a)=="[object Arguments]"},z.isArguments(arguments)||(z.isArguments=function(a){return!!a&&!!m.call(a,"callee")}),z.isFunction=function(a){return l.call(a)=="[object Function]"},z.isString=function(a){return l.call(a)=="[object String]"},z.isNumber=function(a){return l.call(a)=="[object Number]"},z.isNaN=function(a){return a!==a},z.isBoolean=function(a){return a===!0||a===!1||l.call(a)=="[object Boolean]"},z.isDate=function(a){return l.call(a)=="[object Date]"},z.isRegExp=function(a){return l.call(a)=="[object RegExp]"},z.isNull=function(a){return a===null},z.isUndefined=function(a){return a===void 0},z.noConflict=function(){return c._=d,this},z.identity=function(a){return a},z.times=function(a,b,c){for(var d=0;d<a;d++)b.call(c,d)},z.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},z.mixin=function(a){A(z.functions(a),function(b){H(b,z[b]=a[b])})};var E=0;z.uniqueId=function(a){var b=E++;return a?a+b:b},z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},z.template=function(a,b){var c=z.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.escape,function(a,b){return"',_.escape("+b.replace(/\\'/g,"'")+"),'"}).replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return b?e(b,z):function(a){return e.call(this,a,z)}};var F=function(a){this._wrapped=a};z.prototype=F.prototype;var G=function(a,b){return b?z(a).chain():a},H=function(a,b){F.prototype[a]=function(){var a=i.call(arguments);return k.call(a,this._wrapped),G(b.apply(z,a),this._chain)}};z.mixin(z),A(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];F.prototype[a]=function(){return b.apply(this._wrapped,arguments),G(this._wrapped,this._chain)}}),A(["concat","join","slice"],function(a){var b=f[a];F.prototype[a]=function(){return G(b.apply(this._wrapped,arguments),this._chain)}}),F.prototype.chain=function(){return this._chain=!0,this},F.prototype.value=function(){return this._wrapped}})).call(this),provide("underscore",a.exports),$.ender(a.exports)}(),!function(){var a={exports:{}},b=a.exports;
/*! Kizzy - a cross-browser LocalStorage API
* Copyright: Dustin Diaz 2011
* https://github.com/ded/kizzy
* License: MIT
*/
!function(b,c,d,e){function f(){}function s(){return+(new Date)}function t(a,b){a._[b]&&a._[b].e&&a._[b].e<s()&&a.remove(b)}function u(a){return typeof a=="number"&&isFinite(a)}function v(a){return d[a]}function w(a,b){return d[a]=b,b}function x(a){delete d[a]}function y(){d.clear()}function z(a){var b=m.childNodes,c,d=null;for(var e=0,f=b.length;e<f;e++){c=b.item(e);if(c.getAttribute("key")==a){d=c;break}}return d}function A(a){var b=z(a),c=null;return b&&(c=b.getAttribute("value")),c}function B(a,b){var c=z(a);return c?c.setAttribute("value",b):(c=l.createNode(1,"item",""),c.setAttribute("key",a),c.setAttribute("value",b),m.appendChild(c)),k.save(e),b}function C(a){z(a)&&m.removeChild(node),k.save(e)}function D(){while(m.firstChild)m.removeChild(m.firstChild);k.save(e)}function E(){this._={}}function F(a){this.ns=a,this._=JSON.parse(p(a)||"{}")}function G(a){return new F(a)}var g,h=0,i=function(){return 1};try{g=!!d||!!globalStorage,d=d||globalStorage[e],h=1}catch(j){h=0;try{if(c.documentElement.addBehavior){h=0,g=1;var k=c.documentElement;k.addBehavior("#default#userData"),k.load(e);var l=k.xmlDocument,m=l.documentElement}}catch(n){g=!1}}var o=f,p=f,q=f,r=f;g&&(o=h?w:B,p=h?v:A,q=h?x:C,r=h?y:D,i=function(a){try{return o(a.ns,JSON.stringify(a._)),1}catch(b){return 0}}),E.prototype={set:function(a,b,c){return this._[a]={value:b,e:u(c)?s()+c:0},i(this)||this.remove(a),b},get:function(a){return t(this,a),this._[a]?this._[a].value:undefined},remove:function(a){delete this._[a],i(this)},clear:function(){this._={},i(this)}},F.prototype=E.prototype,G.remove=q,G.clear=r,b.kizzy=G,typeof a!="undefined"&&a.exports&&(a.exports.cache=G)}(this,document,localStorage,document.domain),provide("kizzy",a.exports),$.ender(a.exports)}(),!function(){var a={exports:{}},b=a.exports;
/*!
* bean.js - copyright Jacob Thornton 2011
* https://github.com/fat/bean
* MIT License
* special thanks to:
* dean edwards: http://dean.edwards.name/
* dperini: https://github.com/dperini/nwevents
* the entire mootools team: github.com/mootools/mootools-core
*/
!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&typeof define.amd=="object"?define(c):this[b]=c()}("bean",function(){function F(a){var b=a.relatedTarget;return b?b!=this&&b.prefix!="xul"&&!/document/.test(this.toString())&&!p(this,b):b===null}var a=window,b=1,c={},d={},e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=function(a,b){var c=b.parentNode;while(c!==null){if(c==a)return!0;c=c.parentNode}},q=function(a,c){return a.__uid=c&&c+"::"+b++||a.__uid||b++},r=function(a){var b=q(a);return c[b]=c[b]||{}},s=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},t=function(b,c,d){return function(e){return e=D(e||((this.ownerDocument||this.document||this).parentWindow||a).event),c.apply(b,[e].concat(d))}},u=function(b,c,d,e,f){return function(g){if(e?e.apply(this,arguments):n?!0:g&&g.propertyName=="_on"+d||!g)g=g?D(g||((this.ownerDocument||this.document||this).parentWindow||a).event):null,c.apply(b,Array.prototype.slice.call(arguments,g?0:1).concat(f))}},v=function(a,b,c,e){var h=b.replace(g,""),i=r(a),j=i[h]||(i[h]={}),k=c,l=q(c,b.replace(f,""));if(j[l])return a;var m=G[h];m&&(c=m.condition?u(a,c,h,m.condition):c,h=m.base||h);var p=E[h];c=p?t(a,c,e):u(a,c,h,!1,e),p=n||p;if(h=="unload"){var v=c;c=function(){w(a,h,c)&&v()}}return a[o]&&s(a,p?h:"propertychange",c,!0,!p&&h),j[l]=c,c.__uid=l,c.__originalFn=k,h=="unload"?a:d[q(a)]=a},w=function(a,b,c){function l(b){c=j[k][b];if(!c)return;delete j[k][b];if(a[o]){k=G[k]?G[k].base:k;var d=n||E[k];s(a,d?k:"propertychange",c,!1,!d&&k)}}var d,e,h,i,j=r(a),k=b.replace(g,"");if(!j||!j[k])return a;e=b.replace(f,""),h=e?e.split("."):[c.__uid],l(e);for(i=h.length;i--;l(h[i]));return a},x=function(a,b,c){return function(d){var e=typeof a=="string"?c(a,this):a;for(var f=d.target;f&&f!=this;f=f.parentNode)for(var g=e.length;g--;)if(e[g]==f)return b.apply(f,arguments)}},y=function(a,b,c,d,e){if(typeof b=="object"&&!c)for(var f in b)b.hasOwnProperty(f)&&y(a,f,b[f]);else{var g=typeof c=="string",h=(g?c:b).split(" ");c=g?x(b,d,e):c;for(var i=h.length;i--;)v(a,h[i],c,Array.prototype.slice.call(arguments,g?4:3))}return a},z=function(a,b,c){var d,e,h,i,j,k=typeof b=="string",l=k&&b.replace(f,""),m=w,n=r(a);l=l&&l.split(".");if(k&&/\s/.test(b)){b=b.split(" "),j=b.length-1;while(z(a,b[j])&&j--);return a}i=k?b.replace(g,""):b;if(!n||l||k&&!n[i]){for(d in n)if(n.hasOwnProperty(d))for(j in n[d])for(e=l.length;e--;)n[d].hasOwnProperty(j)&&(new RegExp("^"+l[e]+"::\\d*(\\..*)?$")).test(j)&&m(a,[d,j].join("."));return a}if(typeof c=="function")m(a,i,c);else if(l)m(a,b);else{m=i?m:z,h=k&&i,i=i?c||n[i]||i:n;for(d in i)i.hasOwnProperty(d)&&(m(a,h||d,i[d]),delete i[d])}return a},A=function(a,b,c){var d,e,h,i,j=b.split(" ");for(h=j.length;h--;){b=j[h].replace(g,"");var k=E[b],l=j[h].replace(f,""),m=r(a)[b];if(l){l=l.split(".");for(e=l.length;e--;)for(i in m)m.hasOwnProperty(i)&&(new RegExp("^"+l[e]+"::\\d*(\\..*)?$")).test(i)&&m[i].apply(a,[!1].concat(c))}else if(!c&&a[o])B(k,b,a);else for(e in m)m.hasOwnProperty(e)&&m[e].apply(a,[!1].concat(c))}return a},B=n?function(b,c,d){evt=document.createEvent(b?"HTMLEvents":"UIEvents"),evt[b?"initEvent":"initUIEvent"](c,!0,!0,a,1),d.dispatchEvent(evt)}:function(a,b,c){a?c.fireEvent("on"+b,document.createEventObject()):c["_on"+b]++},C=function(a,b,c){var d=r(b),e,f,g=q(a);e=c?d[c]:d;for(f in e)e.hasOwnProperty(f)&&(c?y:C)(a,c||b,c?e[f].__originalFn:f);return a},D=function(a){var b={};if(!a)return b;var c=a.type,d=a.target||a.srcElement;b.preventDefault=D.preventDefault(a),b.stopPropagation=D.stopPropagation(a),b.target=d&&d.nodeType==3?d.parentNode:d;if(~c.indexOf("key"))b.keyCode=a.which||a.keyCode;else if(/click|mouse|menu/i.test(c)){b.rightClick=a.which==3||a.button==2,b.pos={x:0,y:0};if(a.pageX||a.pageY)b.clientX=a.pageX,b.clientY=a.pageY;else if(a.clientX||a.clientY)b.clientX=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,b.clientY=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;e.test(c)&&(b.relatedTarget=a.relatedTarget||a[(c=="mouseover"?"from":"to")+"Element"])}for(var f in a)f in b||(b[f]=a[f]);return b};D.preventDefault=function(a){return function(){a.preventDefault?a.preventDefault():a.returnValue=!1}},D.stopPropagation=function(a){return function(){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}};var E={click:1,dblclick:1,mouseup:1,mousedown:1,contextmenu:1,mousewheel:1,DOMMouseScroll:1,mouseover:1,mouseout:1,mousemove:1,selectstart:1,selectend:1,keydown:1,keypress:1,keyup:1,orientationchange:1,touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,focus:1,blur:1,change:1,reset:1,select:1,submit:1,load:1,unload:1,beforeunload:1,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1},G={mouseenter:{base:"mouseover",condition:F},mouseleave:{base:"mouseout",condition:F},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}},H={add:y,remove:z,clone:C,fire:A},I=function(a){var b=z(a).__uid;b&&(delete d[b],delete c[b])};return a[i]&&y(a,"unload",function(){for(var b in d)d.hasOwnProperty(b)&&I(d[b]);a.CollectGarbage&&CollectGarbage()}),H.noConflict=function(){return context.bean=old,this},H}),provide("bean",a.exports),!function(a){var b=require("bean"),c=function(c,d,e){var f=d?[d]:[];return function(){for(var e,g=0,h=this.length;g<h;g++)e=[this[g]].concat(f,Array.prototype.slice.call(arguments,0)),e.length==4&&e.push(a),!arguments.length&&c=="add"&&d&&(c="fire"),b[c].apply(this,e);return this}},d=c("add"),e=c("remove"),f=c("fire"),g={on:d,addListener:d,bind:d,listen:d,delegate:d,unbind:e,unlisten:e,removeListener:e,undelegate:e,emit:f,trigger:f,cloneEvents:c("clone"),hover:function(a,c,d){for(d=this.length;d--;)b.add.call(this,this[d],"mouseenter",a),b.add.call(this,this[d],"mouseleave",c);return this}},h,i=["blur","change","click","dblclick","error","focus","focusin","focusout","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mouseout","mouseover","mouseup","mousemove","resize","scroll","select","submit","unload"];for(h=i.length;h--;)g[i[h]]=c("add",i[h]);a.ender(g,!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;
/*!
* Bonzo: DOM Utility (c) Dustin Diaz 2011
* https://github.com/ded/bonzo
* License MIT
*/
!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&define.amd?define(b,c):this[b]=c()}("bonzo",function(){function C(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function D(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function E(a,b,c){for(var d=0,e=a.length;d<e;d++)K(a[d])&&(E(a[d].childNodes,b,c),b.call(c||a[d],a[d],d,a));return a}function F(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function G(a){return a?a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():a}function H(a){return a[w]("data-node-uid")||a[v]("data-node-uid",++r),uid=a[w]("data-node-uid"),q[uid]||(q[uid]={})}function I(a){uid=a[w]("data-node-uid"),uid&&delete q[uid]}function J(a){try{return a==="true"?!0:a==="false"?!1:a==="null"?null:isNaN(a)?a:parseFloat(a)}catch(b){}return undefined}function K(a){return a&&a.nodeName&&a.nodeType==1}function L(a,b,c,d){for(d=0,j=a.length;d<j;++d)if(b.call(c,a[d],d,a))return!0;return!1}function M(a){return a=="transform"&&(a=y.transform)||/^transform-?[Oo]rigin$/.test(a)&&(a=y.transform+"Origin")||a=="float"&&(a=y.cssFloat),a?F(a):null}function O(a,b,c){var d=0,e=b||this,h=[],i=g&&typeof a=="string"&&a.charAt(0)!="<"?g(a):a;return D(V(i),function(a){D(e,function(b){var g=!b[f]||b[f]&&!b[f][f]?function(){var a=b.cloneNode(!0);return e.$&&e.cloneEvents&&e.$(a).cloneEvents(b),a}():b;c(a,g),h[d]=g,d++})},this),D(h,function(a,b){e[b]=a}),e.length=d,e}function P(a,b,c){var d=Z(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!=null&&(a.style.left=b-f.left+i[0]+u),c!=null&&(a.style.top=c-f.top+i[1]+u)}function Q(a,b){return C(b).test(a.className)}function R(a,b){a.className=B(a.className+" "+b)}function S(a,b){a.className=B(a.className.replace(C(b)," "))}function T(a,b){return typeof b=="function"?b(a):b}function U(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function V(a){return typeof a=="string"?Z.create(a):K(a)?[a]:a}function W(a,b,d){var e=this[0];return a==null&&b==null?(X(e)?Y():{x:e.scrollLeft,y:e.scrollTop})[d]:(X(e)?c.scrollTo(a,b):(a!=null&&(e.scrollLeft=a),b!=null&&(e.scrollTop=b)),this)}function X(a){return a===c||/^(?:body|html)$/i.test(a.tagName)}function Y(){return{x:c.pageXOffset||e.scrollLeft,y:c.pageYOffset||e.scrollTop}}function Z(a,b){return new U(a,b)}var a=this,b=a.bonzo,c=window,d=c.document,e=d.documentElement,f="parentNode",g=null,h=/^checked|value|selected$/,i=/select|fieldset|table|tbody|tfoot|td|tr|colgroup/i,k=["<table>","</table>",1],l=["<table><tbody><tr>","</tr></tbody></table>",3],m=["<select>","</select>",1],n={thead:k,tbody:k,tfoot:k,colgroup:k,caption:k,tr:["<table><tbody>","</tbody></table>",2],th:l,td:l,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:m,optgroup:m},o=/^checked|selected$/,p=/msie/i.test(navigator.userAgent),q={},r=0,s=/^-?[\d\.]+$/,t=/^data-(.+)$/,u="px",v="setAttribute",w="getAttribute",x="getElementsByTagName",y=function(){var a=d.createElement("p");return a.innerHTML='<a href="#x">x</a><table style="float:left;"></table>',{hrefExtended:a[x]("a")[0][w]("href")!="#x",autoTbody:a[x]("tbody").length!==0,computedStyle:d.defaultView&&d.defaultView.getComputedStyle,cssFloat:a[x]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var b=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],c;for(c=0;c<b.length;c++)if(b[c]in a.style)return b[c]}()}}(),z=/(^\s*|\s*$)/g,A={lineHeight:1,zoom:1,zIndex:1,opacity:1},B=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(z,"")},N=y.computedStyle?function(a,b){var c=null,e=d.defaultView.getComputedStyle(a,"");return e&&(c=e[b]),a.style[b]||c}:p&&e.currentStyle?function(a,b){if(b=="opacity"){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[b]};return U.prototype={get:function(a){return this[a]},each:function(a,b){return D(this,a,b)},deepEach:function(a,b){return E(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e],e),b?b(d)&&c.push(d):c.push(d);return c},first:function(){return Z(this.length?this[0]:[])},last:function(){return Z(this.length?this[this.length-1]:[])},html:function(a,b){function f(b){D(V(a),function(a){b.appendChild(a)})}var c=b?e.textContent===undefined?"innerText":"textContent":"innerHTML",d;return typeof a!="undefined"?this.empty().each(function(e){!b&&(d=e.tagName.match(i))?f(e,d[0]):e[c]=a}):this[0]?this[0][c]:""},text:function(a){return this.html(a,1)},addClass:function(a){return this.each(function(b){Q(b,T(b,a))||R(b,T(b,a))})},removeClass:function(a){return this.each(function(b){Q(b,T(b,a))&&S(b,T(b,a))})},hasClass:function(a){return L(this,function(b){return Q(b,a)})},toggleClass:function(a,b){return this.each(function(c){typeof b!="undefined"?b?R(c,a):S(c,a):Q(c,a)?S(c,a):R(c,a)})},show:function(a){return this.each(function(b){b.style.display=a||""})},hide:function(){return this.each(function(a){a.style.display="none"})},append:function(a){return this.each(function(b){D(V(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;D(V(a),function(a){b.insertBefore(a,c)})})},appendTo:function(a,b){return O.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return O.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},before:function(a){return this.each(function(b){D(Z.create(a),function(a){b[f].insertBefore(a,b)})})},after:function(a){return this.each(function(b){D(Z.create(a),function(a){b[f].insertBefore(a,b.nextSibling)})})},insertBefore:function(a,b){return O.call(this,a,b,function(a,b){a[f].insertBefore(b,a)})},insertAfter:function(a,b){return O.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[f].insertBefore(b,c):a[f].appendChild(b)})},replaceWith:function(a){return this.deepEach(I),this.each(function(b){b.parentNode.replaceChild(Z.create(a)[0],b)})},css:function(a,b,e){function g(a,b,c){for(var d in f)f.hasOwnProperty(d)&&(c=f[d],(b=M(d))&&s.test(c)&&!(b in A)&&(c+=u),a.style[b]=T(a,c))}if(b===undefined&&typeof a=="string")return b=this[0],b?b===d||b===c?(e=b===d?Z.doc():Z.viewport(),a=="width"?e.width:a=="height"?e.height:""):(a=M(a))?N(b,a):null:null;var f=a;return typeof a=="string"&&(f={},f[a]=b),p&&f.opacity&&(f.filter="alpha(opacity="+f.opacity*100+")",f.zoom=a.zoom||1,delete f.opacity),this.each(g)},offset:function(a,b){if(typeof a=="number"||typeof b=="number")return this.each(function(c){P(c,a,b)});if(!this[0])return{top:0,left:0,height:0,width:0};var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,g=c.offsetLeft;while(c=c.offsetParent)f+=c.offsetTop,g+=c.offsetLeft;return{top:f,left:g,height:e,width:d}},dim:function(){var a=this[0],b=!a.offsetWidth&&!a.offsetHeight?function(b,c){return c={position:a.style.position||"",visibility:a.style.visibility||"",display:a.style.display||""},b.first().css({position:"absolute",visibility:"hidden",display:"block"}),c}(this):null,c=a.offsetWidth,d=a.offsetHeight;return b&&this.first().css(b),{height:d,width:c}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?h.test(a)?o.test(a)&&typeof c[a]=="string"?!0:c[a]:a!="href"&&a!="src"||!y.hrefExtended?c[w](a):c[w](a,2):this.each(function(c){h.test(a)?c[a]=T(c,b):c[v](a,T(c,b))});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},val:function(a){return typeof a=="string"?this.attr("value",a):this[0].value},removeAttr:function(a){return this.each(function(b){o.test(a)?b[a]=!1:b.removeAttribute(a)})},data:function(a,b){var c=this[0],d,e,f;return typeof b=="undefined"?(e=H(c),typeof a=="undefined"?(D(c.attributes,function(a){(f=(""+a.name).match(t))&&(e[F(f[1])]=J(a.value))}),e):typeof e[a]=="undefined"?e[a]=J(this.attr("data-"+G(a))):e[a]):this.each(function(c){H(c)[a]=b})},remove:function(){return this.deepEach(I),this.each(function(a){a[f]&&a[f].removeChild(a)})},empty:function(){return this.each(function(a){E(a.childNodes,I);while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a[f].removeChild(a)})},scrollTop:function(a){return W.call(this,null,a,"y")},scrollLeft:function(a){return W.call(this,a,null,"x")},toggle:function(a,b){return this.each(function(a){a.style.display=a.offsetWidth||a.offsetHeight?"none":b||""}),a&&a(),this}},Z.setQueryEngine=function(a){g=a,delete Z.setQueryEngine},Z.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||U.prototype)[c]=a[c])},Z.create=function(a){return typeof a=="string"&&a!==""?function(){var b=/^\s*<([^\s>]+)/.exec(a),c=d.createElement("div"),e=[],g=b?n[b[1].toLowerCase()]:null,h=g?g[2]+1:1,i=f,j=y.autoTbody&&g&&g[0]=="<table>"&&!/<tbody/i.test(a);c.innerHTML=g?g[0]+a+g[1]:a;while(h--)c=c.firstChild;do(!b||c.nodeType==1)&&(!j||c.tagName.toLowerCase()!="tbody")&&e.push(c);while(c=c.nextSibling);return D(e,function(a){a[i]&&a[i].removeChild(a)}),e}():K(a)?[a.cloneNode(!0)]:[]},Z.doc=function(){var a=Z.viewport();return{width:Math.max(d.body.scrollWidth,e.scrollWidth,a.width),height:Math.max(d.body.scrollHeight,e.scrollHeight,a.height)}},Z.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e},Z.viewport=function(){return{width:p?e.clientWidth:self.innerWidth,height:p?e.clientHeight:self.innerHeight}},Z.isAncestor="compareDocumentPosition"in e?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in e?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[f])if(b===a)return!0;return!1},Z.noConflict=function(){return a.bonzo=b,this},Z}),provide("bonzo",a.exports),!function(a){function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function d(a){var b=[],c=0,d=0,e,f,g;for(;f=a[c];++c){g=!1;for(e=0;e<b.length;++e)if(b[e]===f){g=!0;break}g||(b[d++]=f)}return b}function e(a,b,c){return a?b.css(c,a):function(a){return b[0]?(a=parseInt(b.css(c),10),isNaN(a)?b[0]["offset"+c.replace(/^\w/,function(a){return a.toUpperCase()})]:a):0}()}var b=require("bonzo");b.setQueryEngine(a),a.ender(b),a.ender(b(),!0),a.ender({create:function(c){return a(b.create(c))}}),a.id=function(b){return a([document.getElementById(b)])},a.ender({parents:function(b,e){var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(~c(f,i)){j.push(i);if(e)break}}return a(d(j))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this.length?this[0]:this)},last:function(){return a(this.length?this[this.length-1]:[])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f=[];for(c=0,l=this.length;c<l;c++){if(!(e=b.firstChild(this[c])))continue;f.push(e);while(e=e.nextSibling)e.nodeType==1&&f.push(e)}return a(d(f))},height:function(a){return e(a,this,"height")},width:function(a){return e(a,this,"width")}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=this.domReady=c()}("domready",function(a){function l(a){k=1;while(a=b.shift())a()}var b=[],c,d=!1,e=document,f=e.documentElement,g=f.doScroll,h="DOMContentLoaded",i="addEventListener",j="onreadystatechange",k=/^loade|c/.test(e.readyState);return e[i]&&e[i](h,c=function(){e.removeEventListener(h,c,d),l()},d),g&&e.attachEvent(j,c=function(){/^c/.test(e.readyState)&&(e.detachEvent(j,c),l())}),a=g?function(c){self!=top?k?c():b.push(c):function(){try{f.doScroll("left")}catch(b){return setTimeout(function(){a(c)},50)}c()}()}:function(a){k?a():b.push(a)}}),provide("domready",a.exports),!function(a){var b=require("domready");a.ender({domReady:b}),a.ender({ready:function(a){return b(a),this}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;
/*!
* Qwery - A Blazing Fast query selector engine
* https://github.com/ded/qwery
* copyright Dustin Diaz & Jacob Thornton 2011
* MIT License
*/
!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&typeof define.amd=="object"?define(c):this[b]=c()}("qwery",function(){function B(){this.c={}}function G(a){return C.g(a)||C.s(a,new RegExp("(^|\\s+)"+a+"(\\s+|$)"))}function H(a,b){var c=0,d=a.length;for(;c<d;c++)b.call(null,a[c])}function I(a){for(var b=[],c=0,d=a.length;c<d;++c)U(a[c])?b=b.concat(a[c]):b[b.length]=a[c];return b}function J(a){var b=0,c=a.length,d=[];for(;b<c;b++)d[b]=a[b];return d}function K(a){while(a=a.previousSibling)if(a.nodeType==1)break;return a}function L(a){return a.match(y)}function M(a,b,c,d,e,f,g,j,k,l,m){var n,o,p,q,r;if(this.nodeType!==1)return!1;if(b&&b!=="*"&&this.tagName&&this.tagName.toLowerCase()!==b)return!1;if(c&&(o=c.match(h))&&o[1]!==this.id)return!1;if(c&&(r=c.match(i)))for(n=r.length;n--;)if(!G(r[n].slice(1)).test(this.className))return!1;if(k&&X.pseudos[k]&&!X.pseudos[k](this,m))return!1;if(d&&!g){q=this.attributes;for(p in q)if(Object.prototype.hasOwnProperty.call(q,p)&&(q[p].name||p)==e)return this}return d&&!O(f,$(this,e)||"",g)?!1:this}function N(a){return D.g(a)||D.s(a,a.replace(s,"\\$1"))}function O(a,b,c){switch(a){case"=":return b==c;case"^=":return b.match(E.g("^="+c)||E.s("^="+c,new RegExp("^"+N(c))));case"$=":return b.match(E.g("$="+c)||E.s("$="+c,new RegExp(N(c)+"$")));case"*=":return b.match(E.g(c)||E.s(c,new RegExp(N(c))));case"~=":return b.match(E.g("~="+c)||E.s("~="+c,new RegExp("(?:^|\\s+)"+N(c)+"(?:\\s+|$)")));case"|=":return b.match(E.g("|="+c)||E.s("|="+c,new RegExp("^"+N(c)+"(-|$)")))}return 0}function P(a,b){var c=[],d=[],e,g,h,i,k,l,m,n,o=b,p=F.g(a)||F.s(a,a.split(x)),q=a.match(w);if(!p.length)return c;i=(p=p.slice(0)).pop(),p.length&&(h=p[p.length-1].match(j))&&(o=W(b,h[1]));if(!o)return c;m=L(i),l=o!==b&&o.nodeType!==9&&q&&/^[+~]$/.test(q[q.length-1])?function(a){while(o=o.nextSibling)o.nodeType==1&&(m[1]?m[1]==o.tagName.toLowerCase():1)&&(a[a.length]=o);return a}([]):o[f](m[1]||"*");for(e=0,g=l.length;e<g;e++)if(n=M.apply(l[e],m))c[c.length]=n;return p.length?(H(c,function(a){R(a,p,q)&&(d[d.length]=a)}),d):c}function Q(a,b,c){if(S(b))return a==b;if(U(b))return!!~I(b).indexOf(a);var d=b.split(","),e,f;while(b=d.pop()){e=F.g(b)||F.s(b,b.split(x)),f=b.match(w),e=e.slice(0);if(M.apply(a,L(e.pop()))&&(!e.length||R(a,e,f,c)))return!0}return!1}function R(a,b,c,d){function f(a,d,g){while(g=A[c[d]](g,a))if(S(g)&&(found=M.apply(g,L(b[d])))){if(!d)return g;if(e=f(g,d-1,g))return e}}var e;return(e=f(a,b.length-1,a))&&(!d||Z(e,d))}function S(a,b){return a&&typeof a=="object"&&(b=a.nodeType)&&(b==1||b==9)}function T(a){var b=[],c,d;a:for(c=0;c<b.length;++c){for(d=0;d<b.length;++d)if(b[d]==b[c])continue a;b[b.length]=b[c]}return b}function U(a){return typeof a=="object"&&isFinite(a.length)}function V(a){return a?typeof a=="string"?X(a)[0]:!a.nodeType&&U(a)?a[0]:a:b}function W(a,b,c){return a.nodeType===9?a.getElementById(b):a.ownerDocument&&((c=a.ownerDocument.getElementById(b))&&Z(c,a)&&c||!Z(a,a.ownerDocument)&&bd('[id="'+b+'"]',a)[0])}function X(a,b){var c,d,g=V(b);if(!g||!a)return[];if(a===window||S(a))return!b||a!==window&&S(g)&&Z(a,g)?[a]:[];if(a&&U(a))return I(a);if(c=a.match(n)){if(c[1])return(d=W(g,c[1]))?[d]:[];if(c[2])return J(g[f](c[2]));if(_&&c[3])return J(g[e](c[3]))}return bd(a,g)}function Y(a,b){return function(c){var d,e;if(o.test(c)){a.nodeType!==9&&((e=d=a.getAttribute("id"))||a.setAttribute("id",e="__qwerymeupscotty"),c='[id="'+e+'"]'+c,b(a.parentNode||a,c,!0),d||a.removeAttribute("id"));return}c.length&&b(a,c,!1)}}var a=this,b=document,c=a.qwery,d=b.documentElement,e="getElementsByClassName",f="getElementsByTagName",g="querySelectorAll",h=/#([\w\-]+)/,i=/\.[\w\-]+/g,j=/^#([\w\-]+)$/,k=/^\.([\w\-]+)$/,l=/^([\w\-]+)$/,m=/^([\w]+)?\.([\w\-]+)$/,n=new RegExp(j.source+"|"+l.source+"|"+k.source),o=/(^|,)\s*[>~+]/,p=/^\s+|\s*([,\s\+\~>]|$)\s*/g,q=/[\s\>\+\~]/,r=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,s=/([.*+?\^=!:${}()|\[\]\/\\])/g,t=/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,u=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,v=/:([\w\-]+)(\(['"]?([\s\w\+\-]+)['"]?\))?/,w=new RegExp("("+q.source+")"+r.source,"g"),x=new RegExp(q.source+r.source),y=new RegExp(t.source+"("+u.source+")?"+"("+v.source+")?"),z=/^(([\w\-]*[#\.]?[\w\-]+|\*)?(\[[\w\-]+([\~\|]?=['"][ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+["'])?\])?(\:(link|visited|active|hover))?([\s>+~\.,]|(?:$)))+$/,A={" ":function(a){return a&&a!==d&&a.parentNode},">":function(a,b){return a&&a.parentNode==b.parentNode&&a.parentNode},"~":function(a){return a&&a.previousSibling},"+":function(a,b,c,d){return a?(c=K(a))&&(d=K(b))&&c==d&&c:!1}};B.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b){return this.c[a]=b}};var C=new B,D=new B,E=new B,F=new B,Z="compareDocumentPosition"in d?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in d?function(a,b){return b=b.nodeType===9||b==window?d:b,b!==a&&b.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},$=function(){var a=b.createElement("p");return(a.innerHTML='<a href="#x">x</a>')&&a.firstChild.getAttribute("href")!="#x"?function(a,b){return b==="class"?a.className:b==="href"||b==="src"?a.getAttribute(b,2):a.getAttribute(b)}:function(a,b){return a.getAttribute(b)}}(),_=function(){if(b[e]&&b.querySelector&&b[g])try{var a=b.createElement("p");return a.innerHTML="<a/>",a[g](":nth-of-type(1)").length}catch(c){}return!1}(),ba=function(a,b){var c=[],d,e;try{return b.nodeType===9||!o.test(a)?J(b[g](a)):(H(d=a.split(","),Y(b,function(a,b){e=a[g](b),e.length==1?c[c.length]=e.item(0):e.length&&(c=c.concat(J(e)))})),d.length>1&&c.length>1?T(c):c)}catch(f){}return bc(a,b)},bb=function(a,b){var c,d,e,f,h=[];return a=a.replace(p,"$1"),!o.test(a)&&z.test(a)?J(b[g](a)):(H(f=a.split(","),Y(b,function(a,f,i){d=z.test(f)?a[g](f):P(f,a);for(c=0,e=d.length;c<e;c++)if(a.nodeType===9||i||Z(d[c],b))h[h.length]=d[c]})),f.length>1&&h.length>1?T(h):h)},bc=function(a,b){var c=[],d,e,g,h,i,j;a=a.replace(p,"$1");if(e=a.match(m)){i=G(e[2]),d=b[f](e[1]||"*");for(g=0,h=d.length;g<h;g++)i.test(d[g].className)&&(c[c.length]=d[g]);return c}return H(j=a.split(","),Y(b,function(a,d,e){i=P(d,a);for(g=0,h=i.length;g<h;g++)if(a.nodeType===9||e||Z(i[g],b))c[c.length]=i[g]})),j.length>1&&c.length>1?T(c):c},bd=_?ba:b[g]?bb:bc;return X.uniq=T,X.is=Q,X.pseudos={},X.noConflict=function(){return a.qwery=c,this},X}),provide("qwery",a.exports),!function(a,b){var c=require("qwery");b.pseudos=c.pseudos,b._select=function(a,d){return(b._select=function(a){try{return a=require("bonzo"),function(b,d){return/^\s*</.test(b)?a.create(b,d):c(b,d)}}catch(b){}return c}())(a,d)},b.ender({find:function(a){var d=[],e,f,g,h,i;for(e=0,f=this.length;e<f;e++){i=c(a,this[e]);for(g=0,h=i.length;g<h;g++)d.push(i[g])}return b(c.uniq(d))},and:function(a){var c=b(a);for(var d=this.length,e=0,f=this.length+c.length;d<f;d++,e++)this[d]=c[e];return this},is:function(a,b){var d,e;for(d=0,e=this.length;d<e;d++)if(c.is(this[d],a,b))return!0;return!1}},!0)}(document,ender)}()