text: function FastClick(a){"use strict";var b,c=this;if(this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=10,this.layer=a,!a||!a.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)},this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)},this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,arguments)},this.onTouchMove=function(){return FastClick.prototype.onTouchMove.apply(c,arguments)},this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)},this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)},FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchmove",this.onTouchMove,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;"click"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;"click"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),"function"==typeof a.onclick&&(b=a.onclick,a.addEventListener("click",function(a){b(a)},!1),a.onclick=null))}!function(a,b){function c(a){var b=a.length,c=fb.type(a);return fb.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||"function"!==c&&(0===b||"number"==typeof b&&b>0&&b-1 in a)}function d(a){var b=ob[a]={};return fb.each(a.match(hb)||[],function(a,c){b[c]=!0}),b}function e(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=fb.expando+Math.random()}function f(a,c,d){var e;if(d===b&&1===a.nodeType)if(e="data-"+c.replace(sb,"-$1").toLowerCase(),d=a.getAttribute(e),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:+d+""===d?+d:rb.test(d)?JSON.parse(d):d}catch(f){}pb.set(a,c,d)}else d=b;return d}function g(){return!0}function h(){return!1}function i(){try{return T.activeElement}catch(a){}}function j(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function k(a,b,c){if(fb.isFunction(b))return fb.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return fb.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(Cb.test(b))return fb.filter(b,a,c);b=fb.filter(b,a)}return fb.grep(a,function(a){return bb.call(b,a)>=0!==c})}function l(a,b){return fb.nodeName(a,"table")&&fb.nodeName(1===b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function m(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function n(a){var b=Nb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function o(a,b){for(var c=a.length,d=0;c>d;d++)qb.set(a[d],"globalEval",!b||qb.get(b[d],"globalEval"))}function p(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(qb.hasData(a)&&(f=qb.access(a),g=qb.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)fb.event.add(b,e,j[e][c])}pb.hasData(a)&&(h=pb.access(a),i=fb.extend({},h),pb.set(b,i))}}function q(a,c){var d=a.getElementsByTagName?a.getElementsByTagName(c||"*"):a.querySelectorAll?a.querySelectorAll(c||"*"):[];return c===b||c&&fb.nodeName(a,c)?fb.merge([a],d):d}function r(a,b){var c=b.nodeName.toLowerCase();"input"===c&&Kb.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function s(a,b){if(b in a)return b;for(var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=_b.length;e--;)if(b=_b[e]+c,b in a)return b;return d}function t(a,b){return a=b||a,"none"===fb.css(a,"display")||!fb.contains(a.ownerDocument,a)}function u(b){return a.getComputedStyle(b,null)}function v(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=qb.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&t(d)&&(f[g]=qb.access(d,"olddisplay",z(d.nodeName)))):f[g]||(e=t(d),(c&&"none"!==c||!e)&&qb.set(d,"olddisplay",e?c:fb.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function w(a,b,c){var d=Ub.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function x(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=fb.css(a,c+$b[f],!0,e)),d?("content"===c&&(g-=fb.css(a,"padding"+$b[f],!0,e)),"margin"!==c&&(g-=fb.css(a,"border"+$b[f]+"Width",!0,e))):(g+=fb.css(a,"padding"+$b[f],!0,e),"padding"!==c&&(g+=fb.css(a,"border"+$b[f]+"Width",!0,e)));return g}function y(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=u(a),g=fb.support.boxSizing&&"border-box"===fb.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Qb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Vb.test(e))return e;d=g&&(fb.support.boxSizingReliable||e===a.style[b]),e=parseFloat(e)||0}return e+x(a,b,c||(g?"border":"content"),d,f)+"px"}function z(a){var b=T,c=Xb[a];return c||(c=A(a,b),"none"!==c&&c||(Rb=(Rb||fb("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(b.documentElement),b=(Rb[0].contentWindow||Rb[0].contentDocument).document,b.write("<!doctype html><html><body>"),b.close(),c=A(a,b),Rb.detach()),Xb[a]=c),c}function A(a,b){var c=fb(b.createElement(a)).appendTo(b.body),d=fb.css(c[0],"display");return c.remove(),d}function B(a,b,c,d){var e;if(fb.isArray(b))fb.each(b,function(b,e){c||bc.test(a)?d(a,e):B(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==fb.type(b))d(a,b);else for(e in b)B(a+"["+e+"]",b[e],c,d)}function C(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(hb)||[];if(fb.isFunction(c))for(;d=f[e++];)"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function D(a,b,c,d){function e(h){var i;return f[h]=!0,fb.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||g||f[j]?g?!(i=j):void 0:(b.dataTypes.unshift(j),e(j),!1)}),i}var f={},g=a===sc;return e(b.dataTypes[0])||!f["*"]&&e("*")}function E(a,c){var d,e,f=fb.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);return e&&fb.extend(!0,a,e),a}function F(a,c,d){for(var e,f,g,h,i=a.contents,j=a.dataTypes;"*"===j[0];)j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("Content-Type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}return g?(g!==j[0]&&j.unshift(g),d[g]):void 0}function G(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];for(f=k.shift();f;)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}function H(){return setTimeout(function(){Bc=b}),Bc=fb.now()}function I(a,b,c){for(var d,e=(Hc[b]||[]).concat(Hc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function J(a,b,c){var d,e,f=0,g=Gc.length,h=fb.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Bc||H(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:fb.extend({},b),opts:fb.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Bc||H(),duration:c.duration,tweens:[],createTween:function(b,c){var d=fb.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(K(k,j.opts.specialEasing);g>f;f++)if(d=Gc[f].call(j,a,k,j.opts))return d;return fb.map(k,I,j),fb.isFunction(j.opts.start)&&j.opts.start.call(a,j),fb.fx.timer(fb.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function K(a,b){var c,d,e,f,g;for(c in a)if(d=fb.camelCase(c),e=b[d],f=a[c],fb.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=fb.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function L(a,c,d){var e,f,g,h,i,j,k=this,l={},m=a.style,n=a.nodeType&&t(a),o=qb.get(a,"fxshow");d.queue||(i=fb._queueHooks(a,"fx"),null==i.unqueued&&(i.unqueued=0,j=i.empty.fire,i.empty.fire=function(){i.unqueued||j()}),i.unqueued++,k.always(function(){k.always(function(){i.unqueued--,fb.queue(a,"fx").length||i.empty.fire()})})),1===a.nodeType&&("height"in c||"width"in c)&&(d.overflow=[m.overflow,m.overflowX,m.overflowY],"inline"===fb.css(a,"display")&&"none"===fb.css(a,"float")&&(m.display="inline-block")),d.overflow&&(m.overflow="hidden",k.always(function(){m.overflow=d.overflow[0],m.overflowX=d.overflow[1],m.overflowY=d.overflow[2]}));for(e in c)if(f=c[e],Dc.exec(f)){if(delete c[e],g=g||"toggle"===f,f===(n?"hide":"show")){if("show"!==f||!o||o[e]===b)continue;n=!0}l[e]=o&&o[e]||fb.style(a,e)}if(!fb.isEmptyObject(l)){o?"hidden"in o&&(n=o.hidden):o=qb.access(a,"fxshow",{}),g&&(o.hidden=!n),n?fb(a).show():k.done(function(){fb(a).hide()}),k.done(function(){var b;qb.remove(a,"fxshow");for(b in l)fb.style(a,b,l[b])});for(e in l)h=I(n?o[e]:0,e,k),e in o||(o[e]=h.start,n&&(h.end=h.start,h.start="width"===e||"height"===e?1:0))}}function M(a,b,c,d,e){return new M.prototype.init(a,b,c,d,e)}function N(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=$b[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function O(a){return fb.isWindow(a)?a:9===a.nodeType&&a.defaultView}var P,Q,R=typeof b,S=a.location,T=a.document,U=T.documentElement,V=a.jQuery,W=a.$,X={},Y=[],Z="2.0.3",$=Y.concat,_=Y.push,ab=Y.slice,bb=Y.indexOf,cb=X.toString,db=X.hasOwnProperty,eb=Z.trim,fb=function(a,b){return new fb.fn.init(a,b,P)},gb=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,hb=/\S+/g,ib=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,jb=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,kb=/^-ms-/,lb=/-([\da-z])/gi,mb=function(a,b){return b.toUpperCase()},nb=function(){T.removeEventListener("DOMContentLoaded",nb,!1),a.removeEventListener("load",nb,!1),fb.ready()};fb.fn=fb.prototype={jquery:Z,constructor:fb,init:function(a,c,d){var e,f;if(!a)return this;if("string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:ib.exec(a),!e||!e[1]&&c)return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a);if(e[1]){if(c=c instanceof fb?c[0]:c,fb.merge(this,fb.parseHTML(e[1],c&&c.nodeType?c.ownerDocument||c:T,!0)),jb.test(e[1])&&fb.isPlainObject(c))for(e in c)fb.isFunction(this[e])?this[e](c[e]):this.attr(e,c[e]);return this}return f=T.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=T,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):fb.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),fb.makeArray(a,this))},selector:"",length:0,toArray:function(){return ab.call(this)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a){var b=fb.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return fb.each(this,a,b)},ready:function(a){return fb.ready.promise().done(a),this},slice:function(){return this.pushStack(ab.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},map:function(a){return this.pushStack(fb.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:_,sort:[].sort,splice:[].splice},fb.fn.init.prototype=fb.fn,fb.extend=fb.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),"object"==typeof h||fb.isFunction(h)||(h={}),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&(fb.isPlainObject(e)||(f=fb.isArray(e)))?(f?(f=!1,g=d&&fb.isArray(d)?d:[]):g=d&&fb.isPlainObject(d)?d:{},h[c]=fb.extend(k,g,e)):e!==b&&(h[c]=e));return h},fb.extend({expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noConflict:function(b){return a.$===fb&&(a.$=W),b&&a.jQuery===fb&&(a.jQuery=V),fb},isReady:!1,readyWait:1,holdReady:function(a){a?fb.readyWait++:fb.ready(!0)},ready:function(a){(a===!0?--fb.readyWait:fb.isReady)||(fb.isReady=!0,a!==!0&&--fb.readyWait>0||(Q.resolveWith(T,[fb]),fb.fn.trigger&&fb(T).trigger("ready").off("ready")))},isFunction:function(a){return"function"===fb.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):"object"==typeof a||"function"==typeof a?X[cb.call(a)]||"object":typeof a},isPlainObject:function(a){if("object"!==fb.type(a)||a.nodeType||fb.isWindow(a))return!1;try{if(a.constructor&&!db.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||T;var d=jb.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=fb.buildFragment([a],b,e),e&&fb(e).remove(),fb.merge([],d.childNodes))},parseJSON:JSON.parse,parseXML:function(a){var c,d;if(!a||"string"!=typeof a)return null;try{d=new DOMParser,c=d.parseFromString(a,"text/xml")}catch(e){c=b}return(!c||c.getElementsByTagName("parsererror").length)&&fb.error("Invalid XML: "+a),c},noop:function(){},globalEval:function(a){var b,c=eval;a=fb.trim(a),a&&(1===a.indexOf("use strict")?(b=T.createElement("script"),b.text=a,T.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(kb,"ms-").replace(lb,mb)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,d){var e,f=0,g=a.length,h=c(a);if(d){if(h)for(;g>f&&(e=b.apply(a[f],d),e!==!1);f++);else for(f in a)if(e=b.apply(a[f],d),e===!1)break}else if(h)for(;g>f&&(e=b.call(a[f],f,a[f]),e!==!1);f++);else for(f in a)if(e=b.call(a[f],f,a[f]),e===!1)break;return a},trim:function(a){return null==a?"":eb.call(a)},makeArray:function(a,b){var d=b||[];return null!=a&&(c(Object(a))?fb.merge(d,"string"==typeof a?[a]:a):_.call(d,a)),d},inArray:function(a,b,c){return null==b?-1:bb.call(b,a,c)},merge:function(a,c){var d=c.length,e=a.length,f=0;if("number"==typeof d)for(;d>f;f++)a[e++]=c[f];else for(;c[f]!==b;)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;for(c=!!c;g>f;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,b,d){var e,f=0,g=a.length,h=c(a),i=[];if(h)for(;g>f;f++)e=b(a[f],f,d),null!=e&&(i[i.length]=e);else for(f in a)e=b(a[f],f,d),null!=e&&(i[i.length]=e);return $.apply([],i)},guid:1,proxy:function(a,c){var d,e,f;return"string"==typeof c&&(d=a[c],c=a,a=d),fb.isFunction(a)?(e=ab.call(arguments,2),f=function(){return a.apply(c||this,e.concat(ab.call(arguments)))},f.guid=a.guid=a.guid||fb.guid++,f):b},access:function(a,c,d,e,f,g,h){var i=0,j=a.length,k=null==d;if("object"===fb.type(d)){f=!0;for(i in d)fb.access(a,c,i,d[i],!0,g,h)}else if(e!==b&&(f=!0,fb.isFunction(e)||(h=!0),k&&(h?(c.call(a,e),c=null):(k=c,c=function(a,b,c){return k.call(fb(a),c)})),c))for(;j>i;i++)c(a[i],d,h?e:e.call(a[i],i,c(a[i],d)));return f?a:k?c.call(a):j?c(a[0],d):g},now:Date.now,swap:function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e}}),fb.ready.promise=function(b){return Q||(Q=fb.Deferred(),"complete"===T.readyState?setTimeout(fb.ready):(T.addEventListener("DOMContentLoaded",nb,!1),a.addEventListener("load",nb,!1))),Q.promise(b)},fb.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){X["[object "+b+"]"]=b.toLowerCase()}),P=fb(T),function(a,b){function c(a,b,c,d){var e,f,g,h,i,j,k,l,o,p;if((b?b.ownerDocument||b:O)!==G&&F(b),b=b||G,c=c||[],!a||"string"!=typeof a)return c;if(1!==(h=b.nodeType)&&9!==h)return[];if(I&&!d){if(e=tb.exec(a))if(g=e[1]){if(9===h){if(f=b.getElementById(g),!f||!f.parentNode)return c;if(f.id===g)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(g))&&M(b,f)&&f.id===g)return c.push(f),c}else{if(e[2])return ab.apply(c,b.getElementsByTagName(a)),c;if((g=e[3])&&x.getElementsByClassName&&b.getElementsByClassName)return ab.apply(c,b.getElementsByClassName(g)),c}if(x.qsa&&(!J||!J.test(a))){if(l=k=N,o=b,p=9===h&&a,1===h&&"object"!==b.nodeName.toLowerCase()){for(j=m(a),(k=b.getAttribute("id"))?l=k.replace(wb,"\\$&"):b.setAttribute("id",l),l="[id='"+l+"'] ",i=j.length;i--;)j[i]=l+n(j[i]);o=nb.test(a)&&b.parentNode||b,p=j.join(",")}if(p)try{return ab.apply(c,o.querySelectorAll(p)),c}catch(q){}finally{k||b.removeAttribute("id")}}}return v(a.replace(kb,"$1"),b,c,d)}function d(){function a(c,d){return b.push(c+=" ")>z.cacheLength&&delete a[b.shift()],a[c]=d}var b=[];return a}function e(a){return a[N]=!0,a}function f(a){var b=G.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function g(a,b){for(var c=a.split("|"),d=a.length;d--;)z.attrHandle[c[d]]=b}function h(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||X)-(~a.sourceIndex||X);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function i(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function j(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function k(a){return e(function(b){return b=+b,e(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function l(){}function m(a,b){var d,e,f,g,h,i,j,k=S[a+" "];if(k)return b?0:k.slice(0);for(h=a,i=[],j=z.preFilter;h;){(!d||(e=lb.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),d=!1,(e=mb.exec(h))&&(d=e.shift(),f.push({value:d,type:e[0].replace(kb," ")}),h=h.slice(d.length));for(g in z.filter)!(e=rb[g].exec(h))||j[g]&&!(e=j[g](e))||(d=e.shift(),f.push({value:d,type:g,matches:e}),h=h.slice(d.length));if(!d)break}return b?h.length:h?c.error(a):S(a,i).slice(0)}function n(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function o(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=Q++;return b.first?function(b,c,f){for(;b=b[d];)if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=P+" "+f;if(g){for(;b=b[d];)if((1===b.nodeType||e)&&a(b,c,g))return!0}else for(;b=b[d];)if(1===b.nodeType||e)if(j=b[N]||(b[N]={}),(i=j[d])&&i[0]===k){if((h=i[1])===!0||h===y)return h===!0}else if(i=j[d]=[k],i[1]=a(b,c,g)||y,i[1]===!0)return!0}}function p(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function q(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function r(a,b,c,d,f,g){return d&&!d[N]&&(d=r(d)),f&&!f[N]&&(f=r(f,g)),e(function(e,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=e||u(b||"*",h.nodeType?[h]:h,[]),r=!a||!e&&b?p:q(p,m,a,h,i),s=c?f||(e?a:o||d)?[]:g:r;if(c&&c(r,s,h,i),d)for(j=q(s,n),d(j,[],h,i),k=j.length;k--;)(l=j[k])&&(s[n[k]]=!(r[n[k]]=l));if(e){if(f||a){if(f){for(j=[],k=s.length;k--;)(l=s[k])&&j.push(r[k]=l);f(null,s=[],j,i)}for(k=s.length;k--;)(l=s[k])&&(j=f?cb.call(e,l):m[k])>-1&&(e[j]=!(g[j]=l))}}else s=q(s===g?s.splice(o,s.length):s),f?f(null,g,s,i):ab.apply(g,s)})}function s(a){for(var b,c,d,e=a.length,f=z.relative[a[0].type],g=f||z.relative[" "],h=f?1:0,i=o(function(a){return a===b},g,!0),j=o(function(a){return cb.call(b,a)>-1},g,!0),k=[function(a,c,d){return!f&&(d||c!==D)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];e>h;h++)if(c=z.relative[a[h].type])k=[o(p(k),c)];else{if(c=z.filter[a[h].type].apply(null,a[h].matches),c[N]){for(d=++h;e>d&&!z.relative[a[d].type];d++);return r(h>1&&p(k),h>1&&n(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(kb,"$1"),c,d>h&&s(a.slice(h,d)),e>d&&s(a=a.slice(d)),e>d&&n(a))}k.push(c)}return p(k)}function t(a,b){var d=0,f=b.length>0,g=a.length>0,h=function(e,h,i,j,k){var l,m,n,o=[],p=0,r="0",s=e&&[],t=null!=k,u=D,v=e||g&&z.find.TAG("*",k&&h.parentNode||h),w=P+=null==u?1:Math.random()||.1;for(t&&(D=h!==G&&h,y=d);null!=(l=v[r]);r++){if(g&&l){for(m=0;n=a[m++];)if(n(l,h,i)){j.push(l);break}t&&(P=w,y=++d)}f&&((l=!n&&l)&&p--,e&&s.push(l))}if(p+=r,f&&r!==p){for(m=0;n=b[m++];)n(s,o,h,i);if(e){if(p>0)for(;r--;)s[r]||o[r]||(o[r]=$.call(j));o=q(o)}ab.apply(j,o),t&&!e&&o.length>0&&p+b.length>1&&c.uniqueSort(j)}return t&&(P=w,D=u),s};return f?e(h):h}function u(a,b,d){for(var e=0,f=b.length;f>e;e++)c(a,b[e],d);return d}function v(a,b,c,d){var e,f,g,h,i,j=m(a);if(!d&&1===j.length){if(f=j[0]=j[0].slice(0),f.length>2&&"ID"===(g=f[0]).type&&x.getById&&9===b.nodeType&&I&&z.relative[f[1].type]){if(b=(z.find.ID(g.matches[0].replace(xb,yb),b)||[])[0],!b)return c;a=a.slice(f.shift().value.length)}for(e=rb.needsContext.test(a)?0:f.length;e--&&(g=f[e],!z.relative[h=g.type]);)if((i=z.find[h])&&(d=i(g.matches[0].replace(xb,yb),nb.test(f[0].type)&&b.parentNode||b))){if(f.splice(e,1),a=d.length&&n(f),!a)return ab.apply(c,d),c;break}}return C(a,j)(d,b,!I,c,nb.test(a)),c}var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N="sizzle"+-new Date,O=a.document,P=0,Q=0,R=d(),S=d(),T=d(),U=!1,V=function(a,b){return a===b?(U=!0,0):0},W=typeof b,X=1<<31,Y={}.hasOwnProperty,Z=[],$=Z.pop,_=Z.push,ab=Z.push,bb=Z.slice,cb=Z.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},db="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",eb="[\\x20\\t\\r\\n\\f]",gb="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",hb=gb.replace("w","w#"),ib="\\["+eb+"*("+gb+")"+eb+"*(?:([*^$|!~]?=)"+eb+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+hb+")|)|)"+eb+"*\\]",jb=":("+gb+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+ib.replace(3,8)+")*)|.*)\\)|)",kb=new RegExp("^"+eb+"+|((?:^|[^\\\\])(?:\\\\.)*)"+eb+"+$","g"),lb=new RegExp("^"+eb+"*,"+eb+"*"),mb=new RegExp("^"+eb+"*([>+~]|"+eb+")"+eb+"*"),nb=new RegExp(eb+"*[+~]"),ob=new RegExp("="+eb+"*([^\\]'\"]*)"+eb+"*\\]","g"),pb=new RegExp(jb),qb=new RegExp("^"+hb+"$"),rb={ID:new RegExp("^#("+gb+")"),CLASS:new RegExp("^\\.("+gb+")"),TAG:new RegExp("^("+gb.replace("w","w*")+")"),ATTR:new RegExp("^"+ib),PSEUDO:new RegExp("^"+jb),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+eb+"*(even|odd|(([+-]|)(\\d*)n|)"+eb+"*(?:([+-]|)"+eb+"*(\\d+)|))"+eb+"*\\)|)","i"),bool:new RegExp("^(?:"+db+")$","i"),needsContext:new RegExp("^"+eb+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+eb+"*((?:-\\d)?\\d*)"+eb+"*\\)|)(?=[^-]|$)","i")},sb=/^[^{]+\{\s*\[native \w/,tb=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ub=/^(?:input|select|textarea|button)$/i,vb=/^h\d$/i,wb=/'|\\/g,xb=new RegExp("\\\\([\\da-f]{1,6}"+eb+"?|("+eb+")|.)","ig"),yb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{ab.apply(Z=bb.call(O.childNodes),O.childNodes),Z[O.childNodes.length].nodeType}catch(zb){ab={apply:Z.length?function(a,b){_.apply(a,bb.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}B=c.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},x=c.support={},F=c.setDocument=function(a){var b=a?a.ownerDocument||a:O,c=b.defaultView;return b!==G&&9===b.nodeType&&b.documentElement?(G=b,H=b.documentElement,I=!B(b),c&&c.attachEvent&&c!==c.top&&c.attachEvent("onbeforeunload",function(){F()}),x.attributes=f(function(a){return a.className="i",!a.getAttribute("className")}),x.getElementsByTagName=f(function(a){return a.appendChild(b.createComment("")),!a.getElementsByTagName("*").length}),x.getElementsByClassName=f(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),x.getById=f(function(a){return H.appendChild(a).id=N,!b.getElementsByName||!b.getElementsByName(N).length}),x.getById?(z.find.ID=function(a,b){if(typeof b.getElementById!==W&&I){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},z.filter.ID=function(a){var b=a.replace(xb,yb);return function(a){return a.getAttribute("id")===b}}):(delete z.find.ID,z.filter.ID=function(a){var b=a.replace(xb,yb);return function(a){var c=typeof a.getAttributeNode!==W&&a.getAttributeNode("id");return c&&c.value===b}}),z.find.TAG=x.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==W?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},z.find.CLASS=x.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==W&&I?b.getElementsByClassName(a):void 0},K=[],J=[],(x.qsa=sb.test(b.querySelectorAll))&&(f(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||J.push("\\["+eb+"*(?:value|"+db+")"),a.querySelectorAll(":checked").length||J.push(":checked")}),f(function(a){var c=b.createElement("input");c.setAttribute("type","hidden"),a.appendChild(c).setAttribute("t",""),a.querySelectorAll("[t^='']").length&&J.push("[*^$]="+eb+"*(?:''|\"\")"),a.querySelectorAll(":enabled").length||J.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),J.push(",.*:")})),(x.matchesSelector=sb.test(L=H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&f(function(a){x.disconnectedMatch=L.call(a,"div"),L.call(a,"[s!='']:x"),K.push("!=",jb)}),J=J.length&&new RegExp(J.join("|")),K=K.length&&new RegExp(K.join("|")),M=sb.test(H.contains)||H.compareDocumentPosition?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},V=H.compareDocumentPosition?function(a,c){if(a===c)return U=!0,0;var d=c.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(c);return d?1&d||!x.sortDetached&&c.compareDocumentPosition(a)===d?a===b||M(O,a)?-1:c===b||M(O,c)?1:E?cb.call(E,a)-cb.call(E,c):0:4&d?-1:1:a.compareDocumentPosition?-1:1}:function(a,c){var d,e=0,f=a.parentNode,g=c.parentNode,i=[a],j=[c];if(a===c)return U=!0,0;if(!f||!g)return a===b?-1:c===b?1:f?-1:g?1:E?cb.call(E,a)-cb.call(E,c):0;if(f===g)return h(a,c);for(d=a;d=d.parentNode;)i.unshift(d);for(d=c;d=d.parentNode;)j.unshift(d);for(;i[e]===j[e];)e++;return e?h(i[e],j[e]):i[e]===O?-1:j[e]===O?1:0},b):G},c.matches=function(a,b){return c(a,null,null,b)},c.matchesSelector=function(a,b){if((a.ownerDocument||a)!==G&&F(a),b=b.replace(ob,"='$1']"),!(!x.matchesSelector||!I||K&&K.test(b)||J&&J.test(b)))try{var d=L.call(a,b);if(d||x.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return c(b,G,null,[a]).length>0},c.contains=function(a,b){return(a.ownerDocument||a)!==G&&F(a),M(a,b)},c.attr=function(a,c){(a.ownerDocument||a)!==G&&F(a);var d=z.attrHandle[c.toLowerCase()],e=d&&Y.call(z.attrHandle,c.toLowerCase())?d(a,c,!I):b;return e===b?x.attributes||!I?a.getAttribute(c):(e=a.getAttributeNode(c))&&e.specified?e.value:null:e},c.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},c.uniqueSort=function(a){var b,c=[],d=0,e=0;if(U=!x.detectDuplicates,E=!x.sortStable&&a.slice(0),a.sort(V),U){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return a},A=c.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=A(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d];d++)c+=A(b);return c},z=c.selectors={cacheLength:50,createPseudo:e,match:rb,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(xb,yb),a[3]=(a[4]||a[5]||"").replace(xb,yb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||c.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&c.error(a[0]),a},PSEUDO:function(a){var c,d=!a[5]&&a[2];return rb.CHILD.test(a[0])?null:(a[3]&&a[4]!==b?a[2]=a[4]:d&&pb.test(d)&&(c=m(d,!0))&&(c=d.indexOf(")",d.length-c)-d.length)&&(a[0]=a[0].slice(0,c),a[2]=d.slice(0,c)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(xb,yb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=R[a+" "];return b||(b=new RegExp("(^|"+eb+")"+a+"("+eb+"|$)"))&&R(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==W&&a.getAttribute("class")||"")})},ATTR:function(a,b,d){return function(e){var f=c.attr(e,a);return null==f?"!="===b:b?(f+="","="===b?f===d:"!="===b?f!==d:"^="===b?d&&0===f.indexOf(d):"*="===b?d&&f.indexOf(d)>-1:"$="===b?d&&f.slice(-d.length)===d:"~="===b?(" "+f+" ").indexOf(d)>-1:"|="===b?f===d||f.slice(0,d.length+1)===d+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[N]||(q[N]={}),j=k[a]||[],n=j[0]===P&&j[1],m=j[0]===P&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[P,n,m];break}}else if(s&&(j=(b[N]||(b[N]={}))[a])&&j[0]===P)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[N]||(l[N]={}))[a]=[P,m]),l!==b)););return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var d,f=z.pseudos[a]||z.setFilters[a.toLowerCase()]||c.error("unsupported pseudo: "+a);return f[N]?f(b):f.length>1?(d=[a,a,"",b],z.setFilters.hasOwnProperty(a.toLowerCase())?e(function(a,c){for(var d,e=f(a,b),g=e.length;g--;)d=cb.call(a,e[g]),a[d]=!(c[d]=e[g])}):function(a){return f(a,0,d)}):f}},pseudos:{not:e(function(a){var b=[],c=[],d=C(a.replace(kb,"$1"));return d[N]?e(function(a,b,c,e){for(var f,g=d(a,null,e,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:e(function(a){return function(b){return c(a,b).length>0}}),contains:e(function(a){return function(b){return(b.textContent||b.innerText||A(b)).indexOf(a)>-1}}),lang:e(function(a){return qb.test(a||"")||c.error("unsupported lang: "+a),a=a.replace(xb,yb).toLowerCase(),function(b){var c;
  do if(c=I?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===H},focus:function(a){return a===G.activeElement&&(!G.hasFocus||G.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeName>"@"||3===a.nodeType||4===a.nodeType)return!1;return!0},parent:function(a){return!z.pseudos.empty(a)},header:function(a){return vb.test(a.nodeName)},input:function(a){return ub.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||b.toLowerCase()===a.type)},first:k(function(){return[0]}),last:k(function(a,b){return[b-1]}),eq:k(function(a,b,c){return[0>c?c+b:c]}),even:k(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:k(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:k(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:k(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},z.pseudos.nth=z.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})z.pseudos[w]=i(w);for(w in{submit:!0,reset:!0})z.pseudos[w]=j(w);l.prototype=z.filters=z.pseudos,z.setFilters=new l,C=c.compile=function(a,b){var c,d=[],e=[],f=T[a+" "];if(!f){for(b||(b=m(a)),c=b.length;c--;)f=s(b[c]),f[N]?d.push(f):e.push(f);f=T(a,t(e,d))}return f},x.sortStable=N.split("").sort(V).join("")===N,x.detectDuplicates=U,F(),x.sortDetached=f(function(a){return 1&a.compareDocumentPosition(G.createElement("div"))}),f(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||g("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),x.attributes&&f(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||g("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),f(function(a){return null==a.getAttribute("disabled")})||g(db,function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&d.specified?d.value:a[b]===!0?b.toLowerCase():null}),fb.find=c,fb.expr=c.selectors,fb.expr[":"]=fb.expr.pseudos,fb.unique=c.uniqueSort,fb.text=c.getText,fb.isXMLDoc=c.isXML,fb.contains=c.contains}(a);var ob={};fb.Callbacks=function(a){a="string"==typeof a?ob[a]||d(a):fb.extend({},a);var c,e,f,g,h,i,j=[],k=!a.once&&[],l=function(b){for(c=a.memory&&b,e=!0,i=g||0,g=0,h=j.length,f=!0;j&&h>i;i++)if(j[i].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}f=!1,j&&(k?k.length&&l(k.shift()):c?j=[]:m.disable())},m={add:function(){if(j){var b=j.length;!function d(b){fb.each(b,function(b,c){var e=fb.type(c);"function"===e?a.unique&&m.has(c)||j.push(c):c&&c.length&&"string"!==e&&d(c)})}(arguments),f?h=j.length:c&&(g=b,l(c))}return this},remove:function(){return j&&fb.each(arguments,function(a,b){for(var c;(c=fb.inArray(b,j,c))>-1;)j.splice(c,1),f&&(h>=c&&h--,i>=c&&i--)}),this},has:function(a){return a?fb.inArray(a,j)>-1:!(!j||!j.length)},empty:function(){return j=[],h=0,this},disable:function(){return j=k=c=b,this},disabled:function(){return!j},lock:function(){return k=b,c||m.disable(),this},locked:function(){return!k},fireWith:function(a,b){return!j||e&&!k||(b=b||[],b=[a,b.slice?b.slice():b],f?k.push(b):l(b)),this},fire:function(){return m.fireWith(this,arguments),this},fired:function(){return!!e}};return m},fb.extend({Deferred:function(a){var b=[["resolve","done",fb.Callbacks("once memory"),"resolved"],["reject","fail",fb.Callbacks("once memory"),"rejected"],["notify","progress",fb.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return fb.Deferred(function(c){fb.each(b,function(b,f){var g=f[0],h=fb.isFunction(a[b])&&a[b];e[f[1]](function(){var a=h&&h.apply(this,arguments);a&&fb.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[g+"With"](this===d?c.promise():this,h?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?fb.extend(a,d):d}},e={};return d.pipe=d.then,fb.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=ab.call(arguments),g=f.length,h=1!==g||a&&fb.isFunction(a.promise)?g:0,i=1===h?a:fb.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?ab.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);g>e;e++)f[e]&&fb.isFunction(f[e].promise)?f[e].promise().done(j(e,d,f)).fail(i.reject).progress(j(e,c,b)):--h;return h||i.resolveWith(d,f),i.promise()}}),fb.support=function(b){var c=T.createElement("input"),d=T.createDocumentFragment(),e=T.createElement("div"),f=T.createElement("select"),g=f.appendChild(T.createElement("option"));return c.type?(c.type="checkbox",b.checkOn=""!==c.value,b.optSelected=g.selected,b.reliableMarginRight=!0,b.boxSizingReliable=!0,b.pixelPosition=!1,c.checked=!0,b.noCloneChecked=c.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled,c=T.createElement("input"),c.value="t",c.type="radio",b.radioValue="t"===c.value,c.setAttribute("checked","t"),c.setAttribute("name","t"),d.appendChild(c),b.checkClone=d.cloneNode(!0).cloneNode(!0).lastChild.checked,b.focusinBubbles="onfocusin"in a,e.style.backgroundClip="content-box",e.cloneNode(!0).style.backgroundClip="",b.clearCloneStyle="content-box"===e.style.backgroundClip,fb(function(){var c,d,f="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",g=T.getElementsByTagName("body")[0];g&&(c=T.createElement("div"),c.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",g.appendChild(c).appendChild(e),e.innerHTML="",e.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",fb.swap(g,null!=g.style.zoom?{zoom:1}:{},function(){b.boxSizing=4===e.offsetWidth}),a.getComputedStyle&&(b.pixelPosition="1%"!==(a.getComputedStyle(e,null)||{}).top,b.boxSizingReliable="4px"===(a.getComputedStyle(e,null)||{width:"4px"}).width,d=e.appendChild(T.createElement("div")),d.style.cssText=e.style.cssText=f,d.style.marginRight=d.style.width="0",e.style.width="1px",b.reliableMarginRight=!parseFloat((a.getComputedStyle(d,null)||{}).marginRight)),g.removeChild(c))}),b):b}({});var pb,qb,rb=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,sb=/([A-Z])/g;e.uid=1,e.accepts=function(a){return a.nodeType?1===a.nodeType||9===a.nodeType:!0},e.prototype={key:function(a){if(!e.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=e.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,fb.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(fb.isEmptyObject(f))fb.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,c){var d=this.cache[this.key(a)];return c===b?d:d[c]},access:function(a,c,d){var e;return c===b||c&&"string"==typeof c&&d===b?(e=this.get(a,c),e!==b?e:this.get(a,fb.camelCase(c))):(this.set(a,c,d),d!==b?d:c)},remove:function(a,c){var d,e,f,g=this.key(a),h=this.cache[g];if(c===b)this.cache[g]={};else{fb.isArray(c)?e=c.concat(c.map(fb.camelCase)):(f=fb.camelCase(c),c in h?e=[c,f]:(e=f,e=e in h?[e]:e.match(hb)||[])),d=e.length;for(;d--;)delete h[e[d]]}},hasData:function(a){return!fb.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}},pb=new e,qb=new e,fb.extend({acceptData:e.accepts,hasData:function(a){return pb.hasData(a)||qb.hasData(a)},data:function(a,b,c){return pb.access(a,b,c)},removeData:function(a,b){pb.remove(a,b)},_data:function(a,b,c){return qb.access(a,b,c)},_removeData:function(a,b){qb.remove(a,b)}}),fb.fn.extend({data:function(a,c){var d,e,g=this[0],h=0,i=null;if(a===b){if(this.length&&(i=pb.get(g),1===g.nodeType&&!qb.get(g,"hasDataAttrs"))){for(d=g.attributes;h<d.length;h++)e=d[h].name,0===e.indexOf("data-")&&(e=fb.camelCase(e.slice(5)),f(g,e,i[e]));qb.set(g,"hasDataAttrs",!0)}return i}return"object"==typeof a?this.each(function(){pb.set(this,a)}):fb.access(this,function(c){var d,e=fb.camelCase(a);if(g&&c===b){if(d=pb.get(g,a),d!==b)return d;if(d=pb.get(g,e),d!==b)return d;if(d=f(g,e,b),d!==b)return d}else this.each(function(){var d=pb.get(this,e);pb.set(this,e,c),-1!==a.indexOf("-")&&d!==b&&pb.set(this,a,c)})},null,c,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){pb.remove(this,a)})}}),fb.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=qb.get(a,b),c&&(!d||fb.isArray(c)?d=qb.access(a,b,fb.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=fb.queue(a,b),d=c.length,e=c.shift(),f=fb._queueHooks(a,b),g=function(){fb.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return qb.get(a,c)||qb.access(a,c,{empty:fb.Callbacks("once memory").add(function(){qb.remove(a,[b+"queue",c])})})}}),fb.fn.extend({queue:function(a,c){var d=2;return"string"!=typeof a&&(c=a,a="fx",d--),arguments.length<d?fb.queue(this[0],a):c===b?this:this.each(function(){var b=fb.queue(this,a,c);fb._queueHooks(this,a),"fx"===a&&"inprogress"!==b[0]&&fb.dequeue(this,a)})},dequeue:function(a){return this.each(function(){fb.dequeue(this,a)})},delay:function(a,b){return a=fb.fx?fb.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=fb.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};for("string"!=typeof a&&(c=a,a=b),a=a||"fx";h--;)d=qb.get(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var tb,ub,vb=/[\t\r\n\f]/g,wb=/\r/g,xb=/^(?:input|select|textarea|button)$/i;fb.fn.extend({attr:function(a,b){return fb.access(this,fb.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){fb.removeAttr(this,a)})},prop:function(a,b){return fb.access(this,fb.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[fb.propFix[a]||a]})},addClass:function(a){var b,c,d,e,f,g=0,h=this.length,i="string"==typeof a&&a;if(fb.isFunction(a))return this.each(function(b){fb(this).addClass(a.call(this,b,this.className))});if(i)for(b=(a||"").match(hb)||[];h>g;g++)if(c=this[g],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vb," "):" ")){for(f=0;e=b[f++];)d.indexOf(" "+e+" ")<0&&(d+=e+" ");c.className=fb.trim(d)}return this},removeClass:function(a){var b,c,d,e,f,g=0,h=this.length,i=0===arguments.length||"string"==typeof a&&a;if(fb.isFunction(a))return this.each(function(b){fb(this).removeClass(a.call(this,b,this.className))});if(i)for(b=(a||"").match(hb)||[];h>g;g++)if(c=this[g],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vb," "):"")){for(f=0;e=b[f++];)for(;d.indexOf(" "+e+" ")>=0;)d=d.replace(" "+e+" "," ");c.className=a?fb.trim(d):""}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(fb.isFunction(a)?function(c){fb(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c)for(var b,d=0,e=fb(this),f=a.match(hb)||[];b=f[d++];)e.hasClass(b)?e.removeClass(b):e.addClass(b);else(c===R||"boolean"===c)&&(this.className&&qb.set(this,"__className__",this.className),this.className=this.className||a===!1?"":qb.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vb," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];{if(arguments.length)return e=fb.isFunction(a),this.each(function(d){var f;1===this.nodeType&&(f=e?a.call(this,d,fb(this).val()):a,null==f?f="":"number"==typeof f?f+="":fb.isArray(f)&&(f=fb.map(f,function(a){return null==a?"":a+""})),c=fb.valHooks[this.type]||fb.valHooks[this.nodeName.toLowerCase()],c&&"set"in c&&c.set(this,f,"value")!==b||(this.value=f))});if(f)return c=fb.valHooks[f.type]||fb.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,"string"==typeof d?d.replace(wb,""):null==d?"":d)}}}),fb.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(fb.support.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&fb.nodeName(c.parentNode,"optgroup"))){if(b=fb(c).val(),f)return b;g.push(b)}return g},set:function(a,b){for(var c,d,e=a.options,f=fb.makeArray(b),g=e.length;g--;)d=e[g],(d.selected=fb.inArray(fb(d).val(),f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}},attr:function(a,c,d){var e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return typeof a.getAttribute===R?fb.prop(a,c,d):(1===g&&fb.isXMLDoc(a)||(c=c.toLowerCase(),e=fb.attrHooks[c]||(fb.expr.match.bool.test(c)?ub:tb)),d===b?e&&"get"in e&&null!==(f=e.get(a,c))?f:(f=fb.find.attr(a,c),null==f?b:f):null!==d?e&&"set"in e&&(f=e.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d):void fb.removeAttr(a,c))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(hb);if(f&&1===a.nodeType)for(;c=f[e++];)d=fb.propFix[c]||c,fb.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!fb.support.radioValue&&"radio"===b&&fb.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(a&&3!==h&&8!==h&&2!==h)return g=1!==h||!fb.isXMLDoc(a),g&&(c=fb.propFix[c]||c,f=fb.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&null!==(e=f.get(a,c))?e:a[c]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||xb.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),ub={set:function(a,b,c){return b===!1?fb.removeAttr(a,c):a.setAttribute(c,c),c}},fb.each(fb.expr.match.bool.source.match(/\w+/g),function(a,c){var d=fb.expr.attrHandle[c]||fb.find.attr;fb.expr.attrHandle[c]=function(a,c,e){var f=fb.expr.attrHandle[c],g=e?b:(fb.expr.attrHandle[c]=b)!=d(a,c,e)?c.toLowerCase():null;return fb.expr.attrHandle[c]=f,g}}),fb.support.optSelected||(fb.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),fb.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){fb.propFix[this.toLowerCase()]=this}),fb.each(["radio","checkbox"],function(){fb.valHooks[this]={set:function(a,b){return fb.isArray(b)?a.checked=fb.inArray(fb(a).val(),b)>=0:void 0}},fb.support.checkOn||(fb.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var yb=/^key/,zb=/^(?:mouse|contextmenu)|click/,Ab=/^(?:focusinfocus|focusoutblur)$/,Bb=/^([^.]*)(?:\.(.+)|)$/;fb.event={global:{},add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q,r=qb.get(a);if(r){for(d.handler&&(g=d,d=g.handler,f=g.selector),d.guid||(d.guid=fb.guid++),(j=r.events)||(j=r.events={}),(h=r.handle)||(h=r.handle=function(a){return typeof fb===R||a&&fb.event.triggered===a.type?b:fb.event.dispatch.apply(h.elem,arguments)},h.elem=a),c=(c||"").match(hb)||[""],k=c.length;k--;)i=Bb.exec(c[k])||[],o=q=i[1],p=(i[2]||"").split(".").sort(),o&&(m=fb.event.special[o]||{},o=(f?m.delegateType:m.bindType)||o,m=fb.event.special[o]||{},l=fb.extend({type:o,origType:q,data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&fb.expr.match.needsContext.test(f),namespace:p.join(".")},g),(n=j[o])||(n=j[o]=[],n.delegateCount=0,m.setup&&m.setup.call(a,e,p,h)!==!1||a.addEventListener&&a.addEventListener(o,h,!1)),m.add&&(m.add.call(a,l),l.handler.guid||(l.handler.guid=d.guid)),f?n.splice(n.delegateCount++,0,l):n.push(l),fb.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=qb.hasData(a)&&qb.get(a);if(q&&(i=q.events)){for(b=(b||"").match(hb)||[""],j=b.length;j--;)if(h=Bb.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){for(l=fb.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;f--;)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||fb.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)fb.event.remove(a,n+b[j],c,d,!0);fb.isEmptyObject(i)&&(delete q.handle,qb.remove(a,"events"))}},trigger:function(c,d,e,f){var g,h,i,j,k,l,m,n=[e||T],o=db.call(c,"type")?c.type:c,p=db.call(c,"namespace")?c.namespace.split("."):[];if(h=i=e=e||T,3!==e.nodeType&&8!==e.nodeType&&!Ab.test(o+fb.event.triggered)&&(o.indexOf(".")>=0&&(p=o.split("."),o=p.shift(),p.sort()),k=o.indexOf(":")<0&&"on"+o,c=c[fb.expando]?c:new fb.Event(o,"object"==typeof c&&c),c.isTrigger=f?2:3,c.namespace=p.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c.result=b,c.target||(c.target=e),d=null==d?[c]:fb.makeArray(d,[c]),m=fb.event.special[o]||{},f||!m.trigger||m.trigger.apply(e,d)!==!1)){if(!f&&!m.noBubble&&!fb.isWindow(e)){for(j=m.delegateType||o,Ab.test(j+o)||(h=h.parentNode);h;h=h.parentNode)n.push(h),i=h;i===(e.ownerDocument||T)&&n.push(i.defaultView||i.parentWindow||a)}for(g=0;(h=n[g++])&&!c.isPropagationStopped();)c.type=g>1?j:m.bindType||o,l=(qb.get(h,"events")||{})[c.type]&&qb.get(h,"handle"),l&&l.apply(h,d),l=k&&h[k],l&&fb.acceptData(h)&&l.apply&&l.apply(h,d)===!1&&c.preventDefault();return c.type=o,f||c.isDefaultPrevented()||m._default&&m._default.apply(n.pop(),d)!==!1||!fb.acceptData(e)||k&&fb.isFunction(e[o])&&!fb.isWindow(e)&&(i=e[k],i&&(e[k]=null),fb.event.triggered=o,e[o](),fb.event.triggered=b,i&&(e[k]=i)),c.result}},dispatch:function(a){a=fb.event.fix(a);var c,d,e,f,g,h=[],i=ab.call(arguments),j=(qb.get(this,"events")||{})[a.type]||[],k=fb.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){for(h=fb.event.handlers.call(this,a,j),c=0;(f=h[c++])&&!a.isPropagationStopped();)for(a.currentTarget=f.elem,d=0;(g=f.handlers[d++])&&!a.isImmediatePropagationStopped();)(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((fb.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),e!==b&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()));return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,c){var d,e,f,g,h=[],i=c.delegateCount,j=a.target;if(i&&j.nodeType&&(!a.button||"click"!==a.type))for(;j!==this;j=j.parentNode||this)if(j.disabled!==!0||"click"!==a.type){for(e=[],d=0;i>d;d++)g=c[d],f=g.selector+" ",e[f]===b&&(e[f]=g.needsContext?fb(f,this).index(j)>=0:fb.find(f,this,null,[j]).length),e[f]&&e.push(g);e.length&&h.push({elem:j,handlers:e})}return i<c.length&&h.push({elem:this,handlers:c.slice(i)}),h},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,e,f,g=c.button;return null==a.pageX&&null!=c.clientX&&(d=a.target.ownerDocument||T,e=d.documentElement,f=d.body,a.pageX=c.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=c.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||g===b||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[fb.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];for(g||(this.fixHooks[e]=g=zb.test(e)?this.mouseHooks:yb.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new fb.Event(f),b=d.length;b--;)c=d[b],a[c]=f[c];return a.target||(a.target=T),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==i()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===i()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&fb.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return fb.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){a.result!==b&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=fb.extend(new fb.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?fb.event.trigger(e,null,b):fb.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},fb.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},fb.Event=function(a,b){return this instanceof fb.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.getPreventDefault&&a.getPreventDefault()?g:h):this.type=a,b&&fb.extend(this,b),this.timeStamp=a&&a.timeStamp||fb.now(),void(this[fb.expando]=!0)):new fb.Event(a,b)},fb.Event.prototype={isDefaultPrevented:h,isPropagationStopped:h,isImmediatePropagationStopped:h,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=g,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=g,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=g,this.stopPropagation()}},fb.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){fb.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!fb.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),fb.support.focusinBubbles||fb.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){fb.event.simulate(b,a.target,fb.event.fix(a),!0)};fb.event.special[b]={setup:function(){0===c++&&T.addEventListener(a,d,!0)},teardown:function(){0===--c&&T.removeEventListener(a,d,!0)}}}),fb.fn.extend({on:function(a,c,d,e,f){var g,i;if("object"==typeof a){"string"!=typeof c&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],f);return this}if(null==d&&null==e?(e=c,d=c=b):null==e&&("string"==typeof c?(e=d,d=b):(e=d,d=c,c=b)),e===!1)e=h;else if(!e)return this;return 1===f&&(g=e,e=function(a){return fb().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=fb.guid++)),this.each(function(){fb.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,fb(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if("object"==typeof a){for(f in a)this.off(f,c,a[f]);return this}return(c===!1||"function"==typeof c)&&(d=c,c=b),d===!1&&(d=h),this.each(function(){fb.event.remove(this,a,d,c)})},trigger:function(a,b){return this.each(function(){fb.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?fb.event.trigger(a,b,c,!0):void 0}});var Cb=/^.[^:#\[\.,]*$/,Db=/^(?:parents|prev(?:Until|All))/,Eb=fb.expr.match.needsContext,Fb={children:!0,contents:!0,next:!0,prev:!0};fb.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(fb(a).filter(function(){for(b=0;e>b;b++)if(fb.contains(d[b],this))return!0}));for(b=0;e>b;b++)fb.find(a,d[b],c);return c=this.pushStack(e>1?fb.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},has:function(a){var b=fb(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(fb.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(k(this,a||[],!0))},filter:function(a){return this.pushStack(k(this,a||[],!1))},is:function(a){return!!k(this,"string"==typeof a&&Eb.test(a)?fb(a):a||[],!1).length},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=Eb.test(a)||"string"!=typeof a?fb(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&fb.find.matchesSelector(c,a))){c=f.push(c);break}return this.pushStack(f.length>1?fb.unique(f):f)},index:function(a){return a?"string"==typeof a?bb.call(fb(a),this[0]):bb.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){var c="string"==typeof a?fb(a,b):fb.makeArray(a&&a.nodeType?[a]:a),d=fb.merge(this.get(),c);return this.pushStack(fb.unique(d))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),fb.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return fb.dir(a,"parentNode")},parentsUntil:function(a,b,c){return fb.dir(a,"parentNode",c)},next:function(a){return j(a,"nextSibling")},prev:function(a){return j(a,"previousSibling")},nextAll:function(a){return fb.dir(a,"nextSibling")},prevAll:function(a){return fb.dir(a,"previousSibling")},nextUntil:function(a,b,c){return fb.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return fb.dir(a,"previousSibling",c)},siblings:function(a){return fb.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return fb.sibling(a.firstChild)},contents:function(a){return a.contentDocument||fb.merge([],a.childNodes)}},function(a,b){fb.fn[a]=function(c,d){var e=fb.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=fb.filter(d,e)),this.length>1&&(Fb[a]||fb.unique(e),Db.test(a)&&e.reverse()),this.pushStack(e)}}),fb.extend({filter:function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?fb.find.matchesSelector(d,a)?[d]:[]:fb.find.matches(a,fb.grep(b,function(a){return 1===a.nodeType}))},dir:function(a,c,d){for(var e=[],f=d!==b;(a=a[c])&&9!==a.nodeType;)if(1===a.nodeType){if(f&&fb(a).is(d))break;e.push(a)}return e},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var Gb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Hb=/<([\w:]+)/,Ib=/<|&#?\w+;/,Jb=/<(?:script|style|link)/i,Kb=/^(?:checkbox|radio)$/i,Lb=/checked\s*(?:[^=]|=\s*.checked.)/i,Mb=/^$|\/(?:java|ecma)script/i,Nb=/^true\/(.*)/,Ob=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Pb={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Pb.optgroup=Pb.option,Pb.tbody=Pb.tfoot=Pb.colgroup=Pb.caption=Pb.thead,Pb.th=Pb.td,fb.fn.extend({text:function(a){return fb.access(this,function(a){return a===b?fb.text(this):this.empty().append((this[0]&&this[0].ownerDocument||T).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=l(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=l(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?fb.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||fb.cleanData(q(c)),c.parentNode&&(b&&fb.contains(c.ownerDocument,c)&&o(q(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(fb.cleanData(q(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return fb.clone(this,a,b)})},html:function(a){return fb.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b&&1===c.nodeType)return c.innerHTML;if("string"==typeof a&&!Jb.test(a)&&!Pb[(Hb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Gb,"<$1></$2>");try{for(;e>d;d++)c=this[d]||{},1===c.nodeType&&(fb.cleanData(q(c,!1)),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=fb.map(this,function(a){return[a.nextSibling,a.parentNode]}),b=0;return this.domManip(arguments,function(c){var d=a[b++],e=a[b++];e&&(d&&d.parentNode!==e&&(d=this.nextSibling),fb(this).remove(),e.insertBefore(c,d))},!0),b?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b,c){a=$.apply([],a);var d,e,f,g,h,i,j=0,k=this.length,l=this,o=k-1,p=a[0],r=fb.isFunction(p);if(r||!(1>=k||"string"!=typeof p||fb.support.checkClone)&&Lb.test(p))return this.each(function(d){var e=l.eq(d);r&&(a[0]=p.call(this,d,e.html())),e.domManip(a,b,c)});if(k&&(d=fb.buildFragment(a,this[0].ownerDocument,!1,!c&&this),e=d.firstChild,1===d.childNodes.length&&(d=e),e)){for(f=fb.map(q(d,"script"),m),g=f.length;k>j;j++)h=d,j!==o&&(h=fb.clone(h,!0,!0),g&&fb.merge(f,q(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,fb.map(f,n),j=0;g>j;j++)h=f[j],Mb.test(h.type||"")&&!qb.access(h,"globalEval")&&fb.contains(i,h)&&(h.src?fb._evalUrl(h.src):fb.globalEval(h.textContent.replace(Ob,"")))}return this}}),fb.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){fb.fn[a]=function(a){for(var c,d=[],e=fb(a),f=e.length-1,g=0;f>=g;g++)c=g===f?this:this.clone(!0),fb(e[g])[b](c),_.apply(d,c.get());return this.pushStack(d)}}),fb.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=fb.contains(a.ownerDocument,a);if(!(fb.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||fb.isXMLDoc(a)))for(g=q(h),f=q(a),d=0,e=f.length;e>d;d++)r(f[d],g[d]);if(b)if(c)for(f=f||q(a),g=g||q(h),d=0,e=f.length;e>d;d++)p(f[d],g[d]);else p(a,h);return g=q(h,"script"),g.length>0&&o(g,!i&&q(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=0,l=a.length,m=b.createDocumentFragment(),n=[];l>k;k++)if(e=a[k],e||0===e)if("object"===fb.type(e))fb.merge(n,e.nodeType?[e]:e);else if(Ib.test(e)){for(f=f||m.appendChild(b.createElement("div")),g=(Hb.exec(e)||["",""])[1].toLowerCase(),h=Pb[g]||Pb._default,f.innerHTML=h[1]+e.replace(Gb,"<$1></$2>")+h[2],j=h[0];j--;)f=f.lastChild;fb.merge(n,f.childNodes),f=m.firstChild,f.textContent=""}else n.push(b.createTextNode(e));for(m.textContent="",k=0;e=n[k++];)if((!d||-1===fb.inArray(e,d))&&(i=fb.contains(e.ownerDocument,e),f=q(m.appendChild(e),"script"),i&&o(f),c))for(j=0;e=f[j++];)Mb.test(e.type||"")&&c.push(e);
  return m},cleanData:function(a){for(var c,d,f,g,h,i,j=fb.event.special,k=0;(d=a[k])!==b;k++){if(e.accepts(d)&&(h=d[qb.expando],h&&(c=qb.cache[h]))){if(f=Object.keys(c.events||{}),f.length)for(i=0;(g=f[i])!==b;i++)j[g]?fb.event.remove(d,g):fb.removeEvent(d,g,c.handle);qb.cache[h]&&delete qb.cache[h]}delete pb.cache[d[pb.expando]]}},_evalUrl:function(a){return fb.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),fb.fn.extend({wrapAll:function(a){var b;return fb.isFunction(a)?this.each(function(b){fb(this).wrapAll(a.call(this,b))}):(this[0]&&(b=fb(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstElementChild;)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(fb.isFunction(a)?function(b){fb(this).wrapInner(a.call(this,b))}:function(){var b=fb(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=fb.isFunction(a);return this.each(function(c){fb(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){fb.nodeName(this,"body")||fb(this).replaceWith(this.childNodes)}).end()}});var Qb,Rb,Sb=/^(none|table(?!-c[ea]).+)/,Tb=/^margin/,Ub=new RegExp("^("+gb+")(.*)$","i"),Vb=new RegExp("^("+gb+")(?!px)[a-z%]+$","i"),Wb=new RegExp("^([+-])=("+gb+")","i"),Xb={BODY:"block"},Yb={position:"absolute",visibility:"hidden",display:"block"},Zb={letterSpacing:0,fontWeight:400},$b=["Top","Right","Bottom","Left"],_b=["Webkit","O","Moz","ms"];fb.fn.extend({css:function(a,c){return fb.access(this,function(a,c,d){var e,f,g={},h=0;if(fb.isArray(c)){for(e=u(a),f=c.length;f>h;h++)g[c[h]]=fb.css(a,c[h],!1,e);return g}return d!==b?fb.style(a,c,d):fb.css(a,c)},a,c,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){t(this)?fb(this).show():fb(this).hide()})}}),fb.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Qb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h,i=fb.camelCase(c),j=a.style;return c=fb.cssProps[i]||(fb.cssProps[i]=s(j,i)),h=fb.cssHooks[c]||fb.cssHooks[i],d===b?h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c]:(g=typeof d,"string"===g&&(f=Wb.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(fb.css(a,c)),g="number"),null==d||"number"===g&&isNaN(d)||("number"!==g||fb.cssNumber[i]||(d+="px"),fb.support.clearCloneStyle||""!==d||0!==c.indexOf("background")||(j[c]="inherit"),h&&"set"in h&&(d=h.set(a,d,e))===b||(j[c]=d)),void 0)}},css:function(a,c,d,e){var f,g,h,i=fb.camelCase(c);return c=fb.cssProps[i]||(fb.cssProps[i]=s(a.style,i)),h=fb.cssHooks[c]||fb.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,d)),f===b&&(f=Qb(a,c,e)),"normal"===f&&c in Zb&&(f=Zb[c]),""===d||d?(g=parseFloat(f),d===!0||fb.isNumeric(g)?g||0:f):f}}),Qb=function(a,c,d){var e,f,g,h=d||u(a),i=h?h.getPropertyValue(c)||h[c]:b,j=a.style;return h&&(""!==i||fb.contains(a.ownerDocument,a)||(i=fb.style(a,c)),Vb.test(i)&&Tb.test(c)&&(e=j.width,f=j.minWidth,g=j.maxWidth,j.minWidth=j.maxWidth=j.width=i,i=h.width,j.width=e,j.minWidth=f,j.maxWidth=g)),i},fb.each(["height","width"],function(a,b){fb.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Sb.test(fb.css(a,"display"))?fb.swap(a,Yb,function(){return y(a,b,d)}):y(a,b,d):void 0},set:function(a,c,d){var e=d&&u(a);return w(a,c,d?x(a,b,d,fb.support.boxSizing&&"border-box"===fb.css(a,"boxSizing",!1,e),e):0)}}}),fb(function(){fb.support.reliableMarginRight||(fb.cssHooks.marginRight={get:function(a,b){return b?fb.swap(a,{display:"inline-block"},Qb,[a,"marginRight"]):void 0}}),!fb.support.pixelPosition&&fb.fn.position&&fb.each(["top","left"],function(a,b){fb.cssHooks[b]={get:function(a,c){return c?(c=Qb(a,b),Vb.test(c)?fb(a).position()[b]+"px":c):void 0}}})}),fb.expr&&fb.expr.filters&&(fb.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},fb.expr.filters.visible=function(a){return!fb.expr.filters.hidden(a)}),fb.each({margin:"",padding:"",border:"Width"},function(a,b){fb.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+$b[d]+b]=f[d]||f[d-2]||f[0];return e}},Tb.test(a)||(fb.cssHooks[a+b].set=w)});var ac=/%20/g,bc=/\[\]$/,cc=/\r?\n/g,dc=/^(?:submit|button|image|reset|file)$/i,ec=/^(?:input|select|textarea|keygen)/i;fb.fn.extend({serialize:function(){return fb.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=fb.prop(this,"elements");return a?fb.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!fb(this).is(":disabled")&&ec.test(this.nodeName)&&!dc.test(a)&&(this.checked||!Kb.test(a))}).map(function(a,b){var c=fb(this).val();return null==c?null:fb.isArray(c)?fb.map(c,function(a){return{name:b.name,value:a.replace(cc,"\r\n")}}):{name:b.name,value:c.replace(cc,"\r\n")}}).get()}}),fb.param=function(a,c){var d,e=[],f=function(a,b){b=fb.isFunction(b)?b():null==b?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=fb.ajaxSettings&&fb.ajaxSettings.traditional),fb.isArray(a)||a.jquery&&!fb.isPlainObject(a))fb.each(a,function(){f(this.name,this.value)});else for(d in a)B(d,a[d],c,f);return e.join("&").replace(ac,"+")},fb.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){fb.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),fb.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var fc,gc,hc=fb.now(),ic=/\?/,jc=/#.*$/,kc=/([?&])_=[^&]*/,lc=/^(.*?):[ \t]*([^\r\n]*)$/gm,mc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,nc=/^(?:GET|HEAD)$/,oc=/^\/\//,pc=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,qc=fb.fn.load,rc={},sc={},tc="*/".concat("*");try{gc=S.href}catch(uc){gc=T.createElement("a"),gc.href="",gc=gc.href}fc=pc.exec(gc.toLowerCase())||[],fb.fn.load=function(a,c,d){if("string"!=typeof a&&qc)return qc.apply(this,arguments);var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i),a=a.slice(0,i)),fb.isFunction(c)?(d=c,c=b):c&&"object"==typeof c&&(f="POST"),h.length>0&&fb.ajax({url:a,type:f,dataType:"html",data:c}).done(function(a){g=arguments,h.html(e?fb("<div>").append(fb.parseHTML(a)).find(e):a)}).complete(d&&function(a,b){h.each(d,g||[a.responseText,b,a])}),this},fb.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){fb.fn[b]=function(a){return this.on(b,a)}}),fb.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gc,type:"GET",isLocal:mc.test(fc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":fb.parseJSON,"text xml":fb.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?E(E(a,fb.ajaxSettings),b):E(fb.ajaxSettings,a)},ajaxPrefilter:C(rc),ajaxTransport:C(sc),ajax:function(a,c){function d(a,c,d,h){var j,l,s,t,v,x=c;2!==u&&(u=2,i&&clearTimeout(i),e=b,g=h||"",w.readyState=a>0?4:0,j=a>=200&&300>a||304===a,d&&(t=F(m,w,d)),t=G(m,t,w,j),j?(m.ifModified&&(v=w.getResponseHeader("Last-Modified"),v&&(fb.lastModified[f]=v),v=w.getResponseHeader("etag"),v&&(fb.etag[f]=v)),204===a||"HEAD"===m.type?x="nocontent":304===a?x="notmodified":(x=t.state,l=t.data,s=t.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),w.status=a,w.statusText=(c||x)+"",j?p.resolveWith(n,[l,x,w]):p.rejectWith(n,[w,x,s]),w.statusCode(r),r=b,k&&o.trigger(j?"ajaxSuccess":"ajaxError",[w,m,j?l:s]),q.fireWith(n,[w,x]),k&&(o.trigger("ajaxComplete",[w,m]),--fb.active||fb.event.trigger("ajaxStop")))}"object"==typeof a&&(c=a,a=b),c=c||{};var e,f,g,h,i,j,k,l,m=fb.ajaxSetup({},c),n=m.context||m,o=m.context&&(n.nodeType||n.jquery)?fb(n):fb.event,p=fb.Deferred(),q=fb.Callbacks("once memory"),r=m.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!h)for(h={};b=lc.exec(g);)h[b[1].toLowerCase()]=b[2];b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return e&&e.abort(b),d(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,m.url=((a||m.url||gc)+"").replace(jc,"").replace(oc,fc[1]+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=fb.trim(m.dataType||"*").toLowerCase().match(hb)||[""],null==m.crossDomain&&(j=pc.exec(m.url.toLowerCase()),m.crossDomain=!(!j||j[1]===fc[1]&&j[2]===fc[2]&&(j[3]||("http:"===j[1]?"80":"443"))===(fc[3]||("http:"===fc[1]?"80":"443")))),m.data&&m.processData&&"string"!=typeof m.data&&(m.data=fb.param(m.data,m.traditional)),D(rc,m,c,w),2===u)return w;k=m.global,k&&0===fb.active++&&fb.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!nc.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(ic.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=kc.test(f)?f.replace(kc,"$1_="+hc++):f+(ic.test(f)?"&":"?")+"_="+hc++)),m.ifModified&&(fb.lastModified[f]&&w.setRequestHeader("If-Modified-Since",fb.lastModified[f]),fb.etag[f]&&w.setRequestHeader("If-None-Match",fb.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",m.contentType),w.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+tc+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)w.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(n,w,m)===!1||2===u))return w.abort();v="abort";for(l in{success:1,error:1,complete:1})w[l](m[l]);if(e=D(sc,m,c,w)){w.readyState=1,k&&o.trigger("ajaxSend",[w,m]),m.async&&m.timeout>0&&(i=setTimeout(function(){w.abort("timeout")},m.timeout));try{u=1,e.send(s,d)}catch(x){if(!(2>u))throw x;d(-1,x)}}else d(-1,"No Transport");return w},getJSON:function(a,b,c){return fb.get(a,b,c,"json")},getScript:function(a,c){return fb.get(a,b,c,"script")}}),fb.each(["get","post"],function(a,c){fb[c]=function(a,d,e,f){return fb.isFunction(d)&&(f=f||e,e=d,d=b),fb.ajax({url:a,type:c,dataType:f,data:d,success:e})}}),fb.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return fb.globalEval(a),a}}}),fb.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),fb.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=fb("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),T.head.appendChild(b[0])},abort:function(){c&&c()}}}});var vc=[],wc=/(=)\?(?=&|$)|\?\?/;fb.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=vc.pop()||fb.expando+"_"+hc++;return this[a]=!0,a}}),fb.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.jsonp!==!1&&(wc.test(c.url)?"url":"string"==typeof c.data&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&wc.test(c.data)&&"data");return i||"jsonp"===c.dataTypes[0]?(f=c.jsonpCallback=fb.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,i?c[i]=c[i].replace(wc,"$1"+f):c.jsonp!==!1&&(c.url+=(ic.test(c.url)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||fb.error(f+" was not called"),h[0]},c.dataTypes[0]="json",g=a[f],a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,vc.push(f)),h&&fb.isFunction(g)&&g(h[0]),h=g=b}),"script"):void 0}),fb.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var xc=fb.ajaxSettings.xhr(),yc={0:200,1223:204},zc=0,Ac={};a.ActiveXObject&&fb(a).on("unload",function(){for(var a in Ac)Ac[a]();Ac=b}),fb.support.cors=!!xc&&"withCredentials"in xc,fb.support.ajax=xc=!!xc,fb.ajaxTransport(function(a){var c;return fb.support.cors||xc&&!a.crossDomain?{send:function(d,e){var f,g,h=a.xhr();if(h.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(f in a.xhrFields)h[f]=a.xhrFields[f];a.mimeType&&h.overrideMimeType&&h.overrideMimeType(a.mimeType),a.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)h.setRequestHeader(f,d[f]);c=function(a){return function(){c&&(delete Ac[g],c=h.onload=h.onerror=null,"abort"===a?h.abort():"error"===a?e(h.status||404,h.statusText):e(yc[h.status]||h.status,h.statusText,"string"==typeof h.responseText?{text:h.responseText}:b,h.getAllResponseHeaders()))}},h.onload=c(),h.onerror=c("error"),c=Ac[g=zc++]=c("abort"),h.send(a.hasContent&&a.data||null)},abort:function(){c&&c()}}:void 0});var Bc,Cc,Dc=/^(?:toggle|show|hide)$/,Ec=new RegExp("^(?:([+-])=|)("+gb+")([a-z%]*)$","i"),Fc=/queueHooks$/,Gc=[L],Hc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ec.exec(b),f=e&&e[3]||(fb.cssNumber[a]?"":"px"),g=(fb.cssNumber[a]||"px"!==f&&+d)&&Ec.exec(fb.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,fb.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};fb.Animation=fb.extend(J,{tweener:function(a,b){fb.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Hc[c]=Hc[c]||[],Hc[c].unshift(b)},prefilter:function(a,b){b?Gc.unshift(a):Gc.push(a)}}),fb.Tween=M,M.prototype={constructor:M,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(fb.cssNumber[c]?"":"px")},cur:function(){var a=M.propHooks[this.prop];return a&&a.get?a.get(this):M.propHooks._default.get(this)},run:function(a){var b,c=M.propHooks[this.prop];return this.pos=b=this.options.duration?fb.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):M.propHooks._default.set(this),this}},M.prototype.init.prototype=M.prototype,M.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=fb.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){fb.fx.step[a.prop]?fb.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[fb.cssProps[a.prop]]||fb.cssHooks[a.prop])?fb.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},M.propHooks.scrollTop=M.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},fb.each(["toggle","show","hide"],function(a,b){var c=fb.fn[b];fb.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(N(b,!0),a,d,e)}}),fb.fn.extend({fadeTo:function(a,b,c,d){return this.filter(t).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=fb.isEmptyObject(a),f=fb.speed(b,c,d),g=function(){var b=J(this,fb.extend({},a),f);(e||qb.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return"string"!=typeof a&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=null!=a&&a+"queueHooks",f=fb.timers,g=qb.get(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&Fc.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem!==this||null!=a&&f[c].queue!==a||(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&fb.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=qb.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=fb.timers,g=d?d.length:0;for(c.finish=!0,fb.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),fb.each({slideDown:N("show"),slideUp:N("hide"),slideToggle:N("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){fb.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),fb.speed=function(a,b,c){var d=a&&"object"==typeof a?fb.extend({},a):{complete:c||!c&&b||fb.isFunction(a)&&a,duration:a,easing:c&&b||b&&!fb.isFunction(b)&&b};return d.duration=fb.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in fb.fx.speeds?fb.fx.speeds[d.duration]:fb.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){fb.isFunction(d.old)&&d.old.call(this),d.queue&&fb.dequeue(this,d.queue)},d},fb.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},fb.timers=[],fb.fx=M.prototype.init,fb.fx.tick=function(){var a,c=fb.timers,d=0;for(Bc=fb.now();d<c.length;d++)a=c[d],a()||c[d]!==a||c.splice(d--,1);c.length||fb.fx.stop(),Bc=b},fb.fx.timer=function(a){a()&&fb.timers.push(a)&&fb.fx.start()},fb.fx.interval=13,fb.fx.start=function(){Cc||(Cc=setInterval(fb.fx.tick,fb.fx.interval))},fb.fx.stop=function(){clearInterval(Cc),Cc=null},fb.fx.speeds={slow:600,fast:200,_default:400},fb.fx.step={},fb.expr&&fb.expr.filters&&(fb.expr.filters.animated=function(a){return fb.grep(fb.timers,function(b){return a===b.elem}).length}),fb.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){fb.offset.setOffset(this,a,b)});var c,d,e=this[0],f={top:0,left:0},g=e&&e.ownerDocument;if(g)return c=g.documentElement,fb.contains(c,e)?(typeof e.getBoundingClientRect!==R&&(f=e.getBoundingClientRect()),d=O(g),{top:f.top+d.pageYOffset-c.clientTop,left:f.left+d.pageXOffset-c.clientLeft}):f},fb.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=fb.css(a,"position"),l=fb(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=fb.css(a,"top"),i=fb.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),fb.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},fb.fn.extend({position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===fb.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),fb.nodeName(a[0],"html")||(d=a.offset()),d.top+=fb.css(a[0],"borderTopWidth",!0),d.left+=fb.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-fb.css(c,"marginTop",!0),left:b.left-d.left-fb.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||U;a&&!fb.nodeName(a,"html")&&"static"===fb.css(a,"position");)a=a.offsetParent;return a||U})}}),fb.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(c,d){var e="pageYOffset"===d;fb.fn[c]=function(f){return fb.access(this,function(c,f,g){var h=O(c);return g===b?h?h[d]:c[f]:void(h?h.scrollTo(e?a.pageXOffset:g,e?g:a.pageYOffset):c[f]=g)},c,f,arguments.length,null)}}),fb.each({Height:"height",Width:"width"},function(a,c){fb.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){fb.fn[e]=function(e,f){var g=arguments.length&&(d||"boolean"!=typeof e),h=d||(e===!0||f===!0?"margin":"border");return fb.access(this,function(c,d,e){var f;return fb.isWindow(c)?c.document.documentElement["client"+a]:9===c.nodeType?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?fb.css(c,d,h):fb.style(c,d,e,h)},c,g?e:b,g,null)}})}),fb.fn.size=function(){return this.length},fb.fn.andSelf=fb.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=fb:"function"==typeof define&&define.amd&&define("jquery",[],function(){return fb}),"object"==typeof a&&"object"==typeof a.document&&(a.jQuery=a.$=fb)}(window),function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.push,h=d.slice,i=d.concat,j=e.toString,k=e.hasOwnProperty,l=d.forEach,m=d.map,n=d.reduce,o=d.reduceRight,p=d.filter,q=d.every,r=d.some,s=d.indexOf,t=d.lastIndexOf,u=Array.isArray,v=Object.keys,w=f.bind,x=function(a){return a instanceof x?a:this instanceof x?void(this._wrapped=a):new x(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=x),exports._=x):a._=x,x.VERSION="1.5.2";var y=x.each=x.forEach=function(a,b,d){if(null!=a)if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(b.call(d,a[e],e,a)===c)return}else for(var g=x.keys(a),e=0,f=g.length;f>e;e++)if(b.call(d,a[g[e]],g[e],a)===c)return};x.map=x.collect=function(a,b,c){var d=[];return null==a?d:m&&a.map===m?a.map(b,c):(y(a,function(a,e,f){d.push(b.call(c,a,e,f))}),d)};var z="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),n&&a.reduce===n)return d&&(b=x.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(y(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(z);return c},x.reduceRight=x.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),o&&a.reduceRight===o)return d&&(b=x.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=x.keys(a);f=g.length}if(y(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(z);return c},x.find=x.detect=function(a,b,c){var d;return A(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},x.filter=x.select=function(a,b,c){var d=[];return null==a?d:p&&a.filter===p?a.filter(b,c):(y(a,function(a,e,f){b.call(c,a,e,f)&&d.push(a)}),d)},x.reject=function(a,b,c){return x.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},x.every=x.all=function(a,b,d){b||(b=x.identity);var e=!0;return null==a?e:q&&a.every===q?a.every(b,d):(y(a,function(a,f,g){return(e=e&&b.call(d,a,f,g))?void 0:c}),!!e)};var A=x.some=x.any=function(a,b,d){b||(b=x.identity);var e=!1;return null==a?e:r&&a.some===r?a.some(b,d):(y(a,function(a,f,g){return e||(e=b.call(d,a,f,g))?c:void 0}),!!e)};x.contains=x.include=function(a,b){return null==a?!1:s&&a.indexOf===s?-1!=a.indexOf(b):A(a,function(a){return a===b})},x.invoke=function(a,b){var c=h.call(arguments,2),d=x.isFunction(b);return x.map(a,function(a){return(d?b:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,function(a){return a[b]})},x.where=function(a,b,c){return x.isEmpty(b)?c?void 0:[]:x[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},x.findWhere=function(a,b){return x.where(a,b,!0)},x.max=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.max.apply(Math,a);if(!b&&x.isEmpty(a))return-1/0;var d={computed:-1/0,value:-1/0};return y(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},x.min=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!b&&x.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return y(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},x.shuffle=function(a){var b,c=0,d=[];return y(a,function(a){b=x.random(c++),d[c-1]=d[b],d[b]=a}),d},x.sample=function(a,b,c){return arguments.length<2||c?a[x.random(a.length-1)]:x.shuffle(a).slice(0,Math.max(0,b))};var B=function(a){return x.isFunction(a)?a:function(b){return b[a]}};x.sortBy=function(a,b,c){var d=B(b);return x.pluck(x.map(a,function(a,b,e){return{value:a,index:b,criteria:d.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var C=function(a){return function(b,c,d){var e={},f=null==c?x.identity:B(c);return y(b,function(c,g){var h=f.call(d,c,g,b);a(e,h,c)}),e}};x.groupBy=C(function(a,b,c){(x.has(a,b)?a[b]:a[b]=[]).push(c)}),x.indexBy=C(function(a,b,c){a[b]=c}),x.countBy=C(function(a,b){x.has(a,b)?a[b]++:a[b]=1}),x.sortedIndex=function(a,b,c,d){c=null==c?x.identity:B(c);for(var e=c.call(d,b),f=0,g=a.length;g>f;){var h=f+g>>>1;c.call(d,a[h])<e?f=h+1:g=h}return f},x.toArray=function(a){return a?x.isArray(a)?h.call(a):a.length===+a.length?x.map(a,x.identity):x.values(a):[]},x.size=function(a){return null==a?0:a.length===+a.length?a.length:x.keys(a).length},x.first=x.head=x.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:h.call(a,0,b)},x.initial=function(a,b,c){return h.call(a,0,a.length-(null==b||c?1:b))},x.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:h.call(a,Math.max(a.length-b,0))},x.rest=x.tail=x.drop=function(a,b,c){return h.call(a,null==b||c?1:b)},x.compact=function(a){return x.filter(a,x.identity)};var D=function(a,b,c){return b&&x.every(a,x.isArray)?i.apply(c,a):(y(a,function(a){x.isArray(a)||x.isArguments(a)?b?g.apply(c,a):D(a,b,c):c.push(a)}),c)};x.flatten=function(a,b){return D(a,b,[])},x.without=function(a){return x.difference(a,h.call(arguments,1))},x.uniq=x.unique=function(a,b,c,d){x.isFunction(b)&&(d=c,c=b,b=!1);var e=c?x.map(a,c,d):a,f=[],g=[];return y(e,function(c,d){(b?d&&g[g.length-1]===c:x.contains(g,c))||(g.push(c),f.push(a[d]))}),f},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=function(a){var b=h.call(arguments,1);return x.filter(x.uniq(a),function(a){return x.every(b,function(b){return x.indexOf(b,a)>=0})})},x.difference=function(a){var b=i.apply(d,h.call(arguments,1));return x.filter(a,function(a){return!x.contains(b,a)})},x.zip=function(){for(var a=x.max(x.pluck(arguments,"length").concat(0)),b=new Array(a),c=0;a>c;c++)b[c]=x.pluck(arguments,""+c);return b},x.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},x.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=x.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(s&&a.indexOf===s)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},x.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(t&&a.lastIndexOf===t)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},x.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f};var E=function(){};x.bind=function(a,b){var c,d;if(w&&a.bind===w)return w.apply(a,h.call(arguments,1));if(!x.isFunction(a))throw new TypeError;return c=h.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(h.call(arguments)));E.prototype=a.prototype;var e=new E;E.prototype=null;var f=a.apply(e,c.concat(h.call(arguments)));return Object(f)===f?f:e}},x.partial=function(a){var b=h.call(arguments,1);return function(){return a.apply(this,b.concat(h.call(arguments)))}},x.bindAll=function(a){var b=h.call(arguments,1);if(0===b.length)throw new Error("bindAll must be passed function names");return y(b,function(b){a[b]=x.bind(a[b],a)}),a},x.memoize=function(a,b){var c={};return b||(b=x.identity),function(){var d=b.apply(this,arguments);return x.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},x.delay=function(a,b){var c=h.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},x.defer=function(a){return x.delay.apply(x,[a,1].concat(h.call(arguments,1)))},x.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:new Date,g=null,f=a.apply(d,e)};return function(){var j=new Date;h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k?(clearTimeout(g),g=null,h=j,f=a.apply(d,e)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},x.debounce=function(a,b,c){var d,e,f,g,h;return function(){f=this,e=arguments,g=new Date;var i=function(){var j=new Date-g;b>j?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e)))},j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e)),h}},x.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},x.wrap=function(a,b){return function(){var c=[a];return g.apply(c,arguments),b.apply(this,c)}},x.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},x.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)x.has(a,c)&&b.push(c);return b},x.values=function(a){for(var b=x.keys(a),c=b.length,d=new Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},x.pairs=function(a){for(var b=x.keys(a),c=b.length,d=new Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},x.invert=function(a){for(var b={},c=x.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},x.functions=x.methods=function(a){var b=[];for(var c in a)x.isFunction(a[c])&&b.push(c);return b.sort()},x.extend=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},x.pick=function(a){var b={},c=i.apply(d,h.call(arguments,1));return y(c,function(c){c in a&&(b[c]=a[c])}),b},x.omit=function(a){var b={},c=i.apply(d,h.call(arguments,1));for(var e in a)x.contains(c,e)||(b[e]=a[e]);return b},x.defaults=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)void 0===a[c]&&(a[c]=b[c])}),a},x.clone=function(a){return x.isObject(a)?x.isArray(a)?a.slice():x.extend({},a):a},x.tap=function(a,b){return b(a),a};var F=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof x&&(a=a._wrapped),b instanceof x&&(b=b._wrapped);var e=j.call(a);if(e!=j.call(b))return!1;switch(e){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:0==a?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("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;var g=a.constructor,h=b.constructor;if(g!==h&&!(x.isFunction(g)&&g instanceof g&&x.isFunction(h)&&h instanceof h))return!1;c.push(a),d.push(b);var i=0,k=!0;if("[object Array]"==e){if(i=a.length,k=i==b.length)for(;i--&&(k=F(a[i],b[i],c,d)););}else{for(var l in a)if(x.has(a,l)&&(i++,!(k=x.has(b,l)&&F(a[l],b[l],c,d))))break;if(k){for(l in b)if(x.has(b,l)&&!i--)break;k=!i}}return c.pop(),d.pop(),k};x.isEqual=function(a,b){return F(a,b,[],[])},x.isEmpty=function(a){if(null==a)return!0;if(x.isArray(a)||x.isString(a))return 0===a.length;for(var b in a)if(x.has(a,b))return!1;return!0},x.isElement=function(a){return!(!a||1!==a.nodeType)},x.isArray=u||function(a){return"[object Array]"==j.call(a)},x.isObject=function(a){return a===Object(a)},y(["Arguments","Function","String","Number","Date","RegExp"],function(a){x["is"+a]=function(b){return j.call(b)=="[object "+a+"]"}}),x.isArguments(arguments)||(x.isArguments=function(a){return!(!a||!x.has(a,"callee"))
  }),"function"!=typeof/./&&(x.isFunction=function(a){return"function"==typeof a}),x.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},x.isNaN=function(a){return x.isNumber(a)&&a!=+a},x.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==j.call(a)},x.isNull=function(a){return null===a},x.isUndefined=function(a){return void 0===a},x.has=function(a,b){return k.call(a,b)},x.noConflict=function(){return a._=b,this},x.identity=function(a){return a},x.times=function(a,b,c){for(var d=Array(Math.max(0,a)),e=0;a>e;e++)d[e]=b.call(c,e);return d},x.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var G={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};G.unescape=x.invert(G.escape);var H={escape:new RegExp("["+x.keys(G.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(G.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(a){x[a]=function(b){return null==b?"":(""+b).replace(H[a],function(b){return G[a][b]})}}),x.result=function(a,b){if(null==a)return void 0;var c=a[b];return x.isFunction(c)?c.call(a):c},x.mixin=function(a){y(x.functions(a),function(b){var c=x[b]=a[b];x.prototype[b]=function(){var a=[this._wrapped];return g.apply(a,arguments),M.call(this,c.apply(x,a))}})};var I=0;x.uniqueId=function(a){var b=++I+"";return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var J=/(.)^/,K={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(a,b,c){var d;c=x.defaults({},c,x.templateSettings);var e=new RegExp([(c.escape||J).source,(c.interpolate||J).source,(c.evaluate||J).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(L,function(a){return"\\"+K[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=new Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,x);var i=function(a){return d.call(this,a,x)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},x.chain=function(a){return x(a).chain()};var M=function(a){return this._chain?x(a).chain():a};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];x.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],M.call(this,c)}}),y(["concat","join","slice"],function(a){var b=d[a];x.prototype[a]=function(){return M.call(this,b.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),function(a,b){if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(c,d,e){a.Backbone=b(a,e,c,d)});else if("undefined"!=typeof exports){var c=require("underscore");b(a,exports,c)}else a.Backbone=b(a,{},a._,a.jQuery||a.Zepto||a.ender||a.$)}(this,function(a,b,c,d){{var e=a.Backbone,f=[],g=(f.push,f.slice);f.splice}b.VERSION="1.1.2",b.$=d,b.noConflict=function(){return a.Backbone=e,this},b.emulateHTTP=!1,b.emulateJSON=!1;var h=b.Events={on:function(a,b,c){if(!j(this,"on",a,[b,c])||!b)return this;this._events||(this._events={});var d=this._events[a]||(this._events[a]=[]);return d.push({callback:b,context:c,ctx:c||this}),this},once:function(a,b,d){if(!j(this,"once",a,[b,d])||!b)return this;var e=this,f=c.once(function(){e.off(a,f),b.apply(this,arguments)});return f._callback=b,this.on(a,f,d)},off:function(a,b,d){var e,f,g,h,i,k,l,m;if(!this._events||!j(this,"off",a,[b,d]))return this;if(!a&&!b&&!d)return this._events=void 0,this;for(h=a?[a]:c.keys(this._events),i=0,k=h.length;k>i;i++)if(a=h[i],g=this._events[a]){if(this._events[a]=e=[],b||d)for(l=0,m=g.length;m>l;l++)f=g[l],(b&&b!==f.callback&&b!==f.callback._callback||d&&d!==f.context)&&e.push(f);e.length||delete this._events[a]}return this},trigger:function(a){if(!this._events)return this;var b=g.call(arguments,1);if(!j(this,"trigger",a,b))return this;var c=this._events[a],d=this._events.all;return c&&k(c,b),d&&k(d,arguments),this},stopListening:function(a,b,d){var e=this._listeningTo;if(!e)return this;var f=!b&&!d;d||"object"!=typeof b||(d=this),a&&((e={})[a._listenId]=a);for(var g in e)a=e[g],a.off(b,d,this),(f||c.isEmpty(a._events))&&delete this._listeningTo[g];return this}},i=/\s+/,j=function(a,b,c,d){if(!c)return!0;if("object"==typeof c){for(var e in c)a[b].apply(a,[e,c[e]].concat(d));return!1}if(i.test(c)){for(var f=c.split(i),g=0,h=f.length;h>g;g++)a[b].apply(a,[f[g]].concat(d));return!1}return!0},k=function(a,b){var c,d=-1,e=a.length,f=b[0],g=b[1],h=b[2];switch(b.length){case 0:for(;++d<e;)(c=a[d]).callback.call(c.ctx);return;case 1:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f);return;case 2:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f,g);return;case 3:for(;++d<e;)(c=a[d]).callback.call(c.ctx,f,g,h);return;default:for(;++d<e;)(c=a[d]).callback.apply(c.ctx,b);return}},l={listenTo:"on",listenToOnce:"once"};c.each(l,function(a,b){h[b]=function(b,d,e){var f=this._listeningTo||(this._listeningTo={}),g=b._listenId||(b._listenId=c.uniqueId("l"));return f[g]=b,e||"object"!=typeof d||(e=this),b[a](d,e,this),this}}),h.bind=h.on,h.unbind=h.off,c.extend(b,h);var m=b.Model=function(a,b){var d=a||{};b||(b={}),this.cid=c.uniqueId("c"),this.attributes={},b.collection&&(this.collection=b.collection),b.parse&&(d=this.parse(d,b)||{}),d=c.defaults({},d,c.result(this,"defaults")),this.set(d,b),this.changed={},this.initialize.apply(this,arguments)};c.extend(m.prototype,h,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return c.clone(this.attributes)},sync:function(){return b.sync.apply(this,arguments)},get:function(a){return this.attributes[a]},escape:function(a){return c.escape(this.get(a))},has:function(a){return null!=this.get(a)},set:function(a,b,d){var e,f,g,h,i,j,k,l;if(null==a)return this;if("object"==typeof a?(f=a,d=b):(f={})[a]=b,d||(d={}),!this._validate(f,d))return!1;g=d.unset,i=d.silent,h=[],j=this._changing,this._changing=!0,j||(this._previousAttributes=c.clone(this.attributes),this.changed={}),l=this.attributes,k=this._previousAttributes,this.idAttribute in f&&(this.id=f[this.idAttribute]);for(e in f)b=f[e],c.isEqual(l[e],b)||h.push(e),c.isEqual(k[e],b)?delete this.changed[e]:this.changed[e]=b,g?delete l[e]:l[e]=b;if(!i){h.length&&(this._pending=d);for(var m=0,n=h.length;n>m;m++)this.trigger("change:"+h[m],this,l[h[m]],d)}if(j)return this;if(!i)for(;this._pending;)d=this._pending,this._pending=!1,this.trigger("change",this,d);return this._pending=!1,this._changing=!1,this},unset:function(a,b){return this.set(a,void 0,c.extend({},b,{unset:!0}))},clear:function(a){var b={};for(var d in this.attributes)b[d]=void 0;return this.set(b,c.extend({},a,{unset:!0}))},hasChanged:function(a){return null==a?!c.isEmpty(this.changed):c.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?c.clone(this.changed):!1;var b,d=!1,e=this._changing?this._previousAttributes:this.attributes;for(var f in a)c.isEqual(e[f],b=a[f])||((d||(d={}))[f]=b);return d},previous:function(a){return null!=a&&this._previousAttributes?this._previousAttributes[a]:null},previousAttributes:function(){return c.clone(this._previousAttributes)},fetch:function(a){a=a?c.clone(a):{},void 0===a.parse&&(a.parse=!0);var b=this,d=a.success;return a.success=function(c){return b.set(b.parse(c,a),a)?(d&&d(b,c,a),void b.trigger("sync",b,c,a)):!1},L(this,a),this.sync("read",this,a)},save:function(a,b,d){var e,f,g,h=this.attributes;if(null==a||"object"==typeof a?(e=a,d=b):(e={})[a]=b,d=c.extend({validate:!0},d),e&&!d.wait){if(!this.set(e,d))return!1}else if(!this._validate(e,d))return!1;e&&d.wait&&(this.attributes=c.extend({},h,e)),void 0===d.parse&&(d.parse=!0);var i=this,j=d.success;return d.success=function(a){i.attributes=h;var b=i.parse(a,d);return d.wait&&(b=c.extend(e||{},b)),c.isObject(b)&&!i.set(b,d)?!1:(j&&j(i,a,d),void i.trigger("sync",i,a,d))},L(this,d),f=this.isNew()?"create":d.patch?"patch":"update","patch"===f&&(d.attrs=e),g=this.sync(f,this,d),e&&d.wait&&(this.attributes=h),g},destroy:function(a){a=a?c.clone(a):{};var b=this,d=a.success,e=function(){b.trigger("destroy",b,b.collection,a)};if(a.success=function(c){(a.wait||b.isNew())&&e(),d&&d(b,c,a),b.isNew()||b.trigger("sync",b,c,a)},this.isNew())return a.success(),!1;L(this,a);var f=this.sync("delete",this,a);return a.wait||e(),f},url:function(){var a=c.result(this,"urlRoot")||c.result(this.collection,"url")||K();return this.isNew()?a:a.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(a){return this._validate({},c.extend(a||{},{validate:!0}))},_validate:function(a,b){if(!b.validate||!this.validate)return!0;a=c.extend({},this.attributes,a);var d=this.validationError=this.validate(a,b)||null;return d?(this.trigger("invalid",this,d,c.extend(b,{validationError:d})),!1):!0}});var n=["keys","values","pairs","invert","pick","omit"];c.each(n,function(a){m.prototype[a]=function(){var b=g.call(arguments);return b.unshift(this.attributes),c[a].apply(c,b)}});var o=b.Collection=function(a,b){b||(b={}),b.model&&(this.model=b.model),void 0!==b.comparator&&(this.comparator=b.comparator),this._reset(),this.initialize.apply(this,arguments),a&&this.reset(a,c.extend({silent:!0},b))},p={add:!0,remove:!0,merge:!0},q={add:!0,remove:!1};c.extend(o.prototype,h,{model:m,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},sync:function(){return b.sync.apply(this,arguments)},add:function(a,b){return this.set(a,c.extend({merge:!1},b,q))},remove:function(a,b){var d=!c.isArray(a);a=d?[a]:c.clone(a),b||(b={});var e,f,g,h;for(e=0,f=a.length;f>e;e++)h=a[e]=this.get(a[e]),h&&(delete this._byId[h.id],delete this._byId[h.cid],g=this.indexOf(h),this.models.splice(g,1),this.length--,b.silent||(b.index=g,h.trigger("remove",h,this,b)),this._removeReference(h,b));return d?a[0]:a},set:function(a,b){b=c.defaults({},b,p),b.parse&&(a=this.parse(a,b));var d=!c.isArray(a);a=d?a?[a]:[]:c.clone(a);var e,f,g,h,i,j,k,l=b.at,n=this.model,o=this.comparator&&null==l&&b.sort!==!1,q=c.isString(this.comparator)?this.comparator:null,r=[],s=[],t={},u=b.add,v=b.merge,w=b.remove,x=!o&&u&&w?[]:!1;for(e=0,f=a.length;f>e;e++){if(i=a[e]||{},g=i instanceof m?h=i:i[n.prototype.idAttribute||"id"],j=this.get(g))w&&(t[j.cid]=!0),v&&(i=i===h?h.attributes:i,b.parse&&(i=j.parse(i,b)),j.set(i,b),o&&!k&&j.hasChanged(q)&&(k=!0)),a[e]=j;else if(u){if(h=a[e]=this._prepareModel(i,b),!h)continue;r.push(h),this._addReference(h,b)}h=j||h,!x||!h.isNew()&&t[h.id]||x.push(h),t[h.id]=!0}if(w){for(e=0,f=this.length;f>e;++e)t[(h=this.models[e]).cid]||s.push(h);s.length&&this.remove(s,b)}if(r.length||x&&x.length)if(o&&(k=!0),this.length+=r.length,null!=l)for(e=0,f=r.length;f>e;e++)this.models.splice(l+e,0,r[e]);else{x&&(this.models.length=0);var y=x||r;for(e=0,f=y.length;f>e;e++)this.models.push(y[e])}if(k&&this.sort({silent:!0}),!b.silent){for(e=0,f=r.length;f>e;e++)(h=r[e]).trigger("add",h,this,b);(k||x&&x.length)&&this.trigger("sort",this,b)}return d?a[0]:a},reset:function(a,b){b||(b={});for(var d=0,e=this.models.length;e>d;d++)this._removeReference(this.models[d],b);return b.previousModels=this.models,this._reset(),a=this.add(a,c.extend({silent:!0},b)),b.silent||this.trigger("reset",this,b),a},push:function(a,b){return this.add(a,c.extend({at:this.length},b))},pop:function(a){var b=this.at(this.length-1);return this.remove(b,a),b},unshift:function(a,b){return this.add(a,c.extend({at:0},b))},shift:function(a){var b=this.at(0);return this.remove(b,a),b},slice:function(){return g.apply(this.models,arguments)},get:function(a){return null==a?void 0:this._byId[a]||this._byId[a.id]||this._byId[a.cid]},at:function(a){return this.models[a]},where:function(a,b){return c.isEmpty(a)?b?void 0:[]:this[b?"find":"filter"](function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},findWhere:function(a){return this.where(a,!0)},sort:function(a){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return a||(a={}),c.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(c.bind(this.comparator,this)),a.silent||this.trigger("sort",this,a),this},pluck:function(a){return c.invoke(this.models,"get",a)},fetch:function(a){a=a?c.clone(a):{},void 0===a.parse&&(a.parse=!0);var b=a.success,d=this;return a.success=function(c){var e=a.reset?"reset":"set";d[e](c,a),b&&b(d,c,a),d.trigger("sync",d,c,a)},L(this,a),this.sync("read",this,a)},create:function(a,b){if(b=b?c.clone(b):{},!(a=this._prepareModel(a,b)))return!1;b.wait||this.add(a,b);var d=this,e=b.success;return b.success=function(a,c){b.wait&&d.add(a,b),e&&e(a,c,b)},a.save(null,b),a},parse:function(a){return a},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(a,b){if(a instanceof m)return a;b=b?c.clone(b):{},b.collection=this;var d=new this.model(a,b);return d.validationError?(this.trigger("invalid",this,d.validationError,b),!1):d},_addReference:function(a){this._byId[a.cid]=a,null!=a.id&&(this._byId[a.id]=a),a.collection||(a.collection=this),a.on("all",this._onModelEvent,this)},_removeReference:function(a){this===a.collection&&delete a.collection,a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"!==a&&"remove"!==a||c===this)&&("destroy"===a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],null!=b.id&&(this._byId[b.id]=b)),this.trigger.apply(this,arguments))}});var r=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];c.each(r,function(a){o.prototype[a]=function(){var b=g.call(arguments);return b.unshift(this.models),c[a].apply(c,b)}});var s=["groupBy","countBy","sortBy","indexBy"];c.each(s,function(a){o.prototype[a]=function(b,d){var e=c.isFunction(b)?b:function(a){return a.get(b)};return c[a](this.models,e,d)}});var t=b.View=function(a){this.cid=c.uniqueId("view"),a||(a={}),c.extend(this,c.pick(a,v)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},u=/^(\S+)\s*(.*)$/,v=["model","collection","el","id","attributes","className","tagName","events"];c.extend(t.prototype,h,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(a,c){return this.$el&&this.undelegateEvents(),this.$el=a instanceof b.$?a:b.$(a),this.el=this.$el[0],c!==!1&&this.delegateEvents(),this},delegateEvents:function(a){if(!a&&!(a=c.result(this,"events")))return this;this.undelegateEvents();for(var b in a){var d=a[b];if(c.isFunction(d)||(d=this[a[b]]),d){var e=b.match(u),f=e[1],g=e[2];d=c.bind(d,this),f+=".delegateEvents"+this.cid,""===g?this.$el.on(f,d):this.$el.on(f,g,d)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(c.result(this,"el"),!1);else{var a=c.extend({},c.result(this,"attributes"));this.id&&(a.id=c.result(this,"id")),this.className&&(a["class"]=c.result(this,"className"));var d=b.$("<"+c.result(this,"tagName")+">").attr(a);this.setElement(d,!1)}}}),b.sync=function(a,d,e){var f=x[a];c.defaults(e||(e={}),{emulateHTTP:b.emulateHTTP,emulateJSON:b.emulateJSON});var g={type:f,dataType:"json"};if(e.url||(g.url=c.result(d,"url")||K()),null!=e.data||!d||"create"!==a&&"update"!==a&&"patch"!==a||(g.contentType="application/json",g.data=JSON.stringify(e.attrs||d.toJSON(e))),e.emulateJSON&&(g.contentType="application/x-www-form-urlencoded",g.data=g.data?{model:g.data}:{}),e.emulateHTTP&&("PUT"===f||"DELETE"===f||"PATCH"===f)){g.type="POST",e.emulateJSON&&(g.data._method=f);var h=e.beforeSend;e.beforeSend=function(a){return a.setRequestHeader("X-HTTP-Method-Override",f),h?h.apply(this,arguments):void 0}}"GET"===g.type||e.emulateJSON||(g.processData=!1),"PATCH"===g.type&&w&&(g.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var i=e.xhr=b.ajax(c.extend(g,e));return d.trigger("request",d,i,e),i};var w=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),x={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};b.ajax=function(){return b.$.ajax.apply(b.$,arguments)};var y=b.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},z=/\((.*?)\)/g,A=/(\(\?)?:\w+/g,B=/\*\w+/g,C=/[\-{}\[\]+?.,\\\^$|#\s]/g;c.extend(y.prototype,h,{initialize:function(){},route:function(a,d,e){c.isRegExp(a)||(a=this._routeToRegExp(a)),c.isFunction(d)&&(e=d,d=""),e||(e=this[d]);var f=this;return b.history.route(a,function(c){var g=f._extractParameters(a,c);f.execute(e,g),f.trigger.apply(f,["route:"+d].concat(g)),f.trigger("route",d,g),b.history.trigger("route",f,d,g)}),this},execute:function(a,b){a&&a.apply(this,b)},navigate:function(a,c){return b.history.navigate(a,c),this},_bindRoutes:function(){if(this.routes){this.routes=c.result(this,"routes");for(var a,b=c.keys(this.routes);null!=(a=b.pop());)this.route(a,this.routes[a])}},_routeToRegExp:function(a){return a=a.replace(C,"\\$&").replace(z,"(?:$1)?").replace(A,function(a,b){return b?a:"([^/?]+)"}).replace(B,"([^?]*?)"),new RegExp("^"+a+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(a,b){var d=a.exec(b).slice(1);return c.map(d,function(a,b){return b===d.length-1?a||null:a?decodeURIComponent(a):null})}});var D=b.History=function(){this.handlers=[],c.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},E=/^[#\/]|\s+$/g,F=/^\/+|\/+$/g,G=/msie [\w.]+/,H=/\/$/,I=/#.*$/;D.started=!1,c.extend(D.prototype,h,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(a){var b=(a||this).location.href.match(/#(.*)$/);return b?b[1]:""},getFragment:function(a,b){if(null==a)if(this._hasPushState||!this._wantsHashChange||b){a=decodeURI(this.location.pathname+this.location.search);var c=this.root.replace(H,"");a.indexOf(c)||(a=a.slice(c.length))}else a=this.getHash();return a.replace(E,"")},start:function(a){if(D.started)throw new Error("Backbone.history has already been started");D.started=!0,this.options=c.extend({root:"/"},this.options,a),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var d=this.getFragment(),e=document.documentMode,f=G.exec(navigator.userAgent.toLowerCase())&&(!e||7>=e);if(this.root=("/"+this.root+"/").replace(F,"/"),f&&this._wantsHashChange){var g=b.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=g.hide().appendTo("body")[0].contentWindow,this.navigate(d)}this._hasPushState?b.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!f?b.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=d;var h=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;this._hasPushState&&this.atRoot()&&h.hash&&(this.fragment=this.getHash().replace(E,""),this.history.replaceState({},document.title,this.root+this.fragment))}return this.options.silent?void 0:this.loadUrl()},stop:function(){b.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),D.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();return a===this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe))),a===this.fragment?!1:(this.iframe&&this.navigate(a),void this.loadUrl())},loadUrl:function(a){return a=this.fragment=this.getFragment(a),c.any(this.handlers,function(b){return b.route.test(a)?(b.callback(a),!0):void 0})},navigate:function(a,b){if(!D.started)return!1;b&&b!==!0||(b={trigger:!!b});var c=this.root+(a=this.getFragment(a||""));if(a=a.replace(I,""),this.fragment!==a){if(this.fragment=a,""===a&&"/"!==c&&(c=c.slice(0,-1)),this._hasPushState)this.history[b.replace?"replaceState":"pushState"]({},document.title,c);else{if(!this._wantsHashChange)return this.location.assign(c);this._updateHash(this.location,a,b.replace),this.iframe&&a!==this.getFragment(this.getHash(this.iframe))&&(b.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,a,b.replace))}return b.trigger?this.loadUrl(a):void 0}},_updateHash:function(a,b,c){if(c){var d=a.href.replace(/(javascript:|#).*$/,"");a.replace(d+"#"+b)}else a.hash="#"+b}}),b.history=new D;var J=function(a,b){var d,e=this;d=a&&c.has(a,"constructor")?a.constructor:function(){return e.apply(this,arguments)},c.extend(d,e,b);var f=function(){this.constructor=d};return f.prototype=e.prototype,d.prototype=new f,a&&c.extend(d.prototype,a),d.__super__=e.prototype,d};m.extend=o.extend=y.extend=t.extend=D.extend=J;var K=function(){throw new Error('A "url" property or function must be specified')},L=function(a,b){var c=b.error;b.error=function(d){c&&c(a,d,b),a.trigger("error",a,d,b)}};return b}),function(a){Backbone.Stickit={_handlers:[],addHandler:function(a){a=_.map(_.flatten([a]),function(a){return _.extend({updateModel:!0,updateView:!0,updateMethod:"text"},a)}),this._handlers=this._handlers.concat(a)}},_.extend(Backbone.View.prototype,{_modelBindings:null,unstickit:function(a){_.each(this._modelBindings,_.bind(function(b,c){return a&&b.model!==a?!1:(b.model.off(b.event,b.fn),void delete this._modelBindings[c])},this)),this._modelBindings=_.compact(this._modelBindings),this.$el.off(".stickit"+(a?"."+a.cid:""))},stickit:function(a,b){var d=this,m=a||this.model,n=".stickit."+m.cid,o=b||this.bindings||{};this._modelBindings||(this._modelBindings=[]),this.unstickit(m),_.each(_.keys(o),function(a){var b,p,q,r,s=o[a]||{},t=_.uniqueId();":el"!=a?b=d.$(a):(b=d.$el,a=""),b.length&&(_.isString(s)&&(s={observe:s}),r=i(b,s),q=r.observe,p=_.extend({bindKey:t},r.setOptions||{}),j(d,b,r,m,q),k(d,b,r,m,q),q&&(_.each(r.events||[],function(c){var f=c+n,h=function(a){var c=r.getVal.call(d,b,a,r);e(d,r.updateModel,c,r)&&g(m,q,c,p,d,r)};""===a?d.$el.on(f,h):d.$el.on(f,a,h)}),_.each(_.flatten([q]),function(a){f(m,d,"change:"+a,function(a,c,e){(null==e||e.bindKey!=t)&&l(d,b,r,h(a,q,r,d),a)})}),l(d,b,r,h(m,q,r,d),m,!0)),c(d,r.initialize,b,m,r))}),this.remove=_.wrap(this.remove,function(a){d.unstickit(),a&&a.call(d)})}});var b=function(a,b){var c=(b||"").split("."),d=_.reduce(c,function(a,b){return a[b]},a);return null==d?a:d},c=function(a,b){return b?(_.isString(b)?a[b]:b).apply(a,_.toArray(arguments).slice(2)):void 0},d=function(a){return a.find("option").not(function(){return!this.selected})},e=function(a,b){return _.isBoolean(b)?b:_.isFunction(b)||_.isString(b)?c.apply(this,_.toArray(arguments)):!1},f=function(a,b,c,d){a.on(c,d,b),b._modelBindings.push({model:a,event:c,fn:d})},g=function(a,b,d,e,f,g){g.onSet&&(d=c(f,g.onSet,d,g)),a.set(b,d,e)},h=function(a,b,d,e){var f,g=function(b){var c=d.escape?a.escape(b):a.get(b);return _.isUndefined(c)?"":c};return f=_.isArray(b)?_.map(b,g):g(b),d.onGet?c(e,d.onGet,f,d):f},i=function(a,b){var c=[{updateModel:!1,updateView:!0,updateMethod:"text",update:function(a,b,c,d){a[d.updateMethod](b)},getVal:function(a,b,c){return a[c.updateMethod]()}}];_.each(Backbone.Stickit._handlers,function(b){a.is(b.selector)&&c.push(b)}),c.push(b);var d=_.extend.apply(_,c);return delete d.selector,d},j=function(a,b,c,d,e){var g=["autofocus","autoplay","async","checked","controls","defer","disabled","hidden","loop","multiple","open","readonly","required","scoped","selected"];_.each(c.attributes||[],function(c){var i="",j=c.observe||(c.observe=e),k=function(){var e=_.indexOf(g,c.name,!0)>-1?"prop":"attr",f=h(d,j,c,a);"class"==c.name?(b.removeClass(i).addClass(f),i=f):b[e](c.name,f)};_.each(_.flatten([j]),function(b){f(d,a,"change:"+b,k)}),k()})},k=function(a,b,d,e,g){if(null!=d.visible){var i=function(){var f=d.visible,i=d.visibleFn,j=h(e,g,d,a),k=!!j;(_.isFunction(f)||_.isString(f))&&(k=c(a,f,j,d)),i?c(a,i,b,k,d):k?b.show():b.hide()};_.each(_.flatten([g]),function(b){f(e,a,"change:"+b,i)}),i()}},l=function(a,b,d,f,g,h){e(a,d.updateView,f,d)&&(d.update.call(a,b,f,g,d),h||c(a,d.afterUpdate,b,f,d))};Backbone.Stickit.addHandler([{selector:'[contenteditable="true"]',updateMethod:"html",events:["keyup","change","paste","cut"]},{selector:"input",events:["keyup","change","paste","cut"],update:function(a,b){a.val(b)},getVal:function(a){var b=a.val();return a.is('[type="number"]')?null==b?b:Number(b):b}},{selector:"textarea",events:["keyup","change","paste","cut"],update:function(a,b){a.val(b)},getVal:function(a){return a.val()}},{selector:'input[type="radio"]',events:["change"],update:function(a,b){a.filter('[value="'+b+'"]').prop("checked",!0)},getVal:function(a){return a.filter(":checked").val()}},{selector:'input[type="checkbox"]',events:["change"],update:function(b,c){b.length>1?(c||(c=[]),_.each(b,function(b){_.indexOf(c,a(b).val())>-1?a(b).prop("checked",!0):a(b).prop("checked",!1)})):_.isBoolean(c)?b.prop("checked",c):b.prop("checked",c==b.val())},getVal:function(b){var c;if(b.length>1)c=_.reduce(b,function(b,c){return a(c).prop("checked")&&b.push(a(c).val()),b},[]);else{c=b.prop("checked");var d=b.val();"on"!=d&&null!=d&&(c=c?b.val():null)}return c}},{selector:"select",events:["change"],update:function(d,e,f,g){var h,i=g.selectOptions,j=i&&i.collection||void 0,k=d.prop("multiple");if(!i){i={};var l=function(a){return a.find("option").map(function(){return{value:this.value,label:this.text}}).get()};d.find("optgroup").length?(j={opt_labels:[]},_.each(d.find("optgroup"),function(b){var c=a(b).attr("label");j.opt_labels.push(c),j[c]=l(a(b))})):j=l(d)}i.valuePath=i.valuePath||"value",i.labelPath=i.labelPath||"label";var m=function(c,d,e){i.defaultOption&&(c=_.clone(c),c.unshift("__default__")),_.each(c,function(c){var f=a("<option/>"),g=c,h=function(a,b){f.text(a),g=b,f.data("stickit_bind_val",g),_.isArray(g)||_.isObject(g)||f.val(g)};"__default__"===c?h(i.defaultOption.label,i.defaultOption.value):h(b(c,i.labelPath),b(c,i.valuePath)),!k&&null!=g&&null!=e&&g==e||_.isObject(e)&&_.isEqual(g,e)?f.prop("selected",!0):k&&_.isArray(e)&&_.each(e,function(a){_.isObject(a)&&(a=b(a,i.valuePath)),(a==g||_.isObject(a)&&_.isEqual(g,a))&&f.prop("selected",!0)}),d.append(f)})};d.html("");var n=function(a,c){var d=window;return 0===c.indexOf("this.")&&(d=a),c=c.replace(/^[a-z]*\.(.+)$/,"$1"),b(d,c)};h=_.isString(j)?n(this,j):_.isFunction(j)?c(this,j,d,g):j,h instanceof Backbone.Collection&&(h=h.toJSON()),_.isArray(h)?m(h,d,e):_.each(h.opt_labels,function(b){var c=a("<optgroup/>").attr("label",b);m(h[b],c,e),d.append(c)})},getVal:function(b){var c;return c=b.prop("multiple")?a(d(b).map(function(){return a(this).data("stickit_bind_val")})).get():d(b).data("stickit_bind_val")}}])}(window.jQuery||window.Zepto),function(a){function b(a,b,d){var e,f=/\\|'|\r|\n|\t|\u2028|\u2029/g;c.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var g=/(.)^/,h={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"};d=c.defaults({},d,c.templateSettings);var i=new RegExp([(d.escape||g).source,(d.interpolate||g).source,(d.evaluate||g).source].join("|")+"|$","g"),j=0,k=[];k.push("__p+='");var l=d.stickitAttribute||"data-binding";"undefined"==typeof d.useStickitAttribute&&(d.useStickitAttribute=!0),a.replace(i,function(b,c,e,g,i){var m=a.slice(j,i),n="";if(d.useStickitAttribute&&e&&(n=l+'="'+e.trim()+'"'),e&&">"===m.slice(-1)){var o=m.slice(0,-1);d.useStickitAttribute&&(n=" "+n),m=o+n+">",k.push(m.replace(f,function(a){return"\\"+h[a]}))}else if(e&&'value="'===m.slice(-7)){var o=m.slice(0,-7);n&&(n+=" "),m=o+n+'value="',k.push(m.replace(f,function(a){return"\\"+h[a]}))}else k.push(m.replace(f,function(a){return"\\"+h[a]}));return c&&k.push("'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),e&&k.push("'+\n((__t=(typeof "+e+"!== 'undefined' ? "+e+" : ''))==null?'':__t)+\n'"),g&&k.push("';\n"+g+"\n__p+='"),j=i+b.length,b}),k.push("';\n"),k=k.join(""),d.variable||(k="with(obj||{}){\n"+k+"}\n"),k="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+k+"return __p;\n";try{e=new Function(d.variable||"obj","_",k)}catch(m){throw m.source=k,m}if(b)return e(b,c);var n=function(a){return e.call(this,a,c)};return n.source="function("+(d.variable||"obj")+"){\n"+k+"}",n}var c=a||require("lodash");c&&c.mixin?c.mixin({tmpl:b}):exports.tmpl=b}("undefined"!=typeof _?_:null),function(a,b){"use strict";function c(){d.READY||(d.event.determineEventTypes(),d.utils.each(d.gestures,function(a){d.detection.register(a)}),d.event.onTouch(d.DOCUMENT,d.EVENT_MOVE,d.detection.detect),d.event.onTouch(d.DOCUMENT,d.EVENT_END,d.detection.detect),d.READY=!0)}var d=function(a,b){return new d.Instance(a,b||{})};d.defaults={stop_browser_behavior:{userSelect:"none",touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},d.HAS_POINTEREVENTS=a.navigator.pointerEnabled||a.navigator.msPointerEnabled,d.HAS_TOUCHEVENTS="ontouchstart"in a,d.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android|silk/i,d.NO_MOUSEEVENTS=d.HAS_TOUCHEVENTS&&a.navigator.userAgent.match(d.MOBILE_REGEX),d.EVENT_TYPES={},d.DIRECTION_DOWN="down",d.DIRECTION_LEFT="left",d.DIRECTION_UP="up",d.DIRECTION_RIGHT="right",d.POINTER_MOUSE="mouse",d.POINTER_TOUCH="touch",d.POINTER_PEN="pen",d.EVENT_START="start",d.EVENT_MOVE="move",d.EVENT_END="end",d.DOCUMENT=a.document,d.plugins=d.plugins||{},d.gestures=d.gestures||{},d.READY=!1,d.utils={extend:function(a,c,d){for(var e in c)a[e]!==b&&d||(a[e]=c[e]);return a},each:function(a,c,d){var e,f;if("forEach"in a)a.forEach(c,d);else if(a.length!==b){for(e=0,f=a.length;f>e;e++)if(c.call(d,a[e],e,a)===!1)return}else for(e in a)if(a.hasOwnProperty(e)&&c.call(d,a[e],e,a)===!1)return},hasParent:function(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1},getCenter:function(a){var b=[],c=[];return d.utils.each(a,function(a){b.push("undefined"!=typeof a.clientX?a.clientX:a.pageX),c.push("undefined"!=typeof a.clientY?a.clientY:a.pageY)}),{pageX:(Math.min.apply(Math,b)+Math.max.apply(Math,b))/2,pageY:(Math.min.apply(Math,c)+Math.max.apply(Math,c))/2}},getVelocity:function(a,b,c){return{x:Math.abs(b/a)||0,y:Math.abs(c/a)||0}},getAngle:function(a,b){var c=b.pageY-a.pageY,d=b.pageX-a.pageX;return 180*Math.atan2(c,d)/Math.PI},getDirection:function(a,b){var c=Math.abs(a.pageX-b.pageX),e=Math.abs(a.pageY-b.pageY);return c>=e?a.pageX-b.pageX>0?d.DIRECTION_LEFT:d.DIRECTION_RIGHT:a.pageY-b.pageY>0?d.DIRECTION_UP:d.DIRECTION_DOWN},getDistance:function(a,b){var c=b.pageX-a.pageX,d=b.pageY-a.pageY;return Math.sqrt(c*c+d*d)},getScale:function(a,b){return a.length>=2&&b.length>=2?this.getDistance(b[0],b[1])/this.getDistance(a[0],a[1]):1
  },getRotation:function(a,b){return a.length>=2&&b.length>=2?this.getAngle(b[1],b[0])-this.getAngle(a[1],a[0]):0},isVertical:function(a){return a==d.DIRECTION_UP||a==d.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(a,b){b&&a&&a.style&&(d.utils.each(["webkit","khtml","moz","Moz","ms","o",""],function(c){d.utils.each(b,function(b){c&&(b=c+b.substring(0,1).toUpperCase()+b.substring(1)),b in a.style&&(a.style[b]=b)})}),"none"==b.userSelect&&(a.onselectstart=function(){return!1}),"none"==b.userDrag&&(a.ondragstart=function(){return!1}))}},d.Instance=function(a,b){var e=this;return c(),this.element=a,this.enabled=!0,this.options=d.utils.extend(d.utils.extend({},d.defaults),b||{}),this.options.stop_browser_behavior&&d.utils.stopDefaultBrowserBehavior(this.element,this.options.stop_browser_behavior),d.event.onTouch(a,d.EVENT_START,function(a){e.enabled&&d.detection.startDetect(e,a)}),this},d.Instance.prototype={on:function(a,b){var c=a.split(" ");return d.utils.each(c,function(a){this.element.addEventListener(a,b,!1)},this),this},off:function(a,b){var c=a.split(" ");return d.utils.each(c,function(a){this.element.removeEventListener(a,b,!1)},this),this},trigger:function(a,b){b||(b={});var c=d.DOCUMENT.createEvent("Event");c.initEvent(a,!0,!0),c.gesture=b;var e=this.element;return d.utils.hasParent(b.target,e)&&(e=b.target),e.dispatchEvent(c),this},enable:function(a){return this.enabled=a,this}};var e=null,f=!1,g=!1;d.event={bindDom:function(a,b,c){var e=b.split(" ");d.utils.each(e,function(b){a.addEventListener(b,c,!1)})},onTouch:function(a,b,c){var h=this;this.bindDom(a,d.EVENT_TYPES[b],function(i){var j=i.type.toLowerCase();if(!j.match(/mouse/)||!g){j.match(/touch/)||j.match(/pointerdown/)||j.match(/mouse/)&&1===i.which?f=!0:j.match(/mouse/)&&!i.which&&(f=!1),j.match(/touch|pointer/)&&(g=!0);var k=0;f&&(d.HAS_POINTEREVENTS&&b!=d.EVENT_END?k=d.PointerEvent.updatePointer(b,i):j.match(/touch/)?k=i.touches.length:g||(k=j.match(/up/)?0:1),k>0&&b==d.EVENT_END?b=d.EVENT_MOVE:k||(b=d.EVENT_END),(k||null===e)&&(e=i),c.call(d.detection,h.collectEventData(a,b,h.getTouchList(e,b),i)),d.HAS_POINTEREVENTS&&b==d.EVENT_END&&(k=d.PointerEvent.updatePointer(b,i))),k||(e=null,f=!1,g=!1,d.PointerEvent.reset())}})},determineEventTypes:function(){var a;a=d.HAS_POINTEREVENTS?d.PointerEvent.getEvents():d.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],d.EVENT_TYPES[d.EVENT_START]=a[0],d.EVENT_TYPES[d.EVENT_MOVE]=a[1],d.EVENT_TYPES[d.EVENT_END]=a[2]},getTouchList:function(a){return d.HAS_POINTEREVENTS?d.PointerEvent.getTouchList():a.touches?a.touches:(a.identifier=1,[a])},collectEventData:function(a,b,c,e){var f=d.POINTER_TOUCH;return(e.type.match(/mouse/)||d.PointerEvent.matchType(d.POINTER_MOUSE,e))&&(f=d.POINTER_MOUSE),{center:d.utils.getCenter(c),timeStamp:(new Date).getTime(),target:e.target,touches:c,eventType:b,pointerType:f,srcEvent:e,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation(),this.srcEvent.preventDefault&&this.srcEvent.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return d.detection.stopDetect()}}}},d.PointerEvent={pointers:{},getTouchList:function(){var a=this,b=[];return d.utils.each(a.pointers,function(a){b.push(a)}),b},updatePointer:function(a,b){return a==d.EVENT_END?this.pointers={}:(b.identifier=b.pointerId,this.pointers[b.pointerId]=b),Object.keys(this.pointers).length},matchType:function(a,b){if(!b.pointerType)return!1;var c=b.pointerType,e={};return e[d.POINTER_MOUSE]=c===b.MSPOINTER_TYPE_MOUSE||c===d.POINTER_MOUSE,e[d.POINTER_TOUCH]=c===b.MSPOINTER_TYPE_TOUCH||c===d.POINTER_TOUCH,e[d.POINTER_PEN]=c===b.MSPOINTER_TYPE_PEN||c===d.POINTER_PEN,e[a]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}},d.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(a,b){this.current||(this.stopped=!1,this.current={inst:a,startEvent:d.utils.extend({},b),lastEvent:!1,name:""},this.detect(b))},detect:function(a){if(this.current&&!this.stopped){a=this.extendEventData(a);var b=this.current.inst.options;return d.utils.each(this.gestures,function(c){return this.stopped||b[c.name]===!1||c.handler.call(c,a,this.current.inst)!==!1?void 0:(this.stopDetect(),!1)},this),this.current&&(this.current.lastEvent=a),a.eventType==d.EVENT_END&&!a.touches.length-1&&this.stopDetect(),a}},stopDetect:function(){this.previous=d.utils.extend({},this.current),this.current=null,this.stopped=!0},extendEventData:function(a){var b=this.current.startEvent;!b||a.touches.length==b.touches.length&&a.touches!==b.touches||(b.touches=[],d.utils.each(a.touches,function(a){b.touches.push(d.utils.extend({},a))}));var c,e,f=a.timeStamp-b.timeStamp,g=a.center.pageX-b.center.pageX,h=a.center.pageY-b.center.pageY,i=d.utils.getVelocity(f,g,h);return"end"===a.eventType?(c=this.current.lastEvent&&this.current.lastEvent.interimAngle,e=this.current.lastEvent&&this.current.lastEvent.interimDirection):(c=this.current.lastEvent&&d.utils.getAngle(this.current.lastEvent.center,a.center),e=this.current.lastEvent&&d.utils.getDirection(this.current.lastEvent.center,a.center)),d.utils.extend(a,{deltaTime:f,deltaX:g,deltaY:h,velocityX:i.x,velocityY:i.y,distance:d.utils.getDistance(b.center,a.center),angle:d.utils.getAngle(b.center,a.center),interimAngle:c,direction:d.utils.getDirection(b.center,a.center),interimDirection:e,scale:d.utils.getScale(b.touches,a.touches),rotation:d.utils.getRotation(b.touches,a.touches),startEvent:b}),a},register:function(a){var c=a.defaults||{};return c[a.name]===b&&(c[a.name]=!0),d.utils.extend(d.defaults,c,!0),a.index=a.index||1e3,this.gestures.push(a),this.gestures.sort(function(a,b){return a.index<b.index?-1:a.index>b.index?1:0}),this.gestures}},d.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,correct_for_drag_min_distance:!0,drag_max_touches:1,drag_block_horizontal:!1,drag_block_vertical:!1,drag_lock_to_axis:!1,drag_lock_min_distance:25},triggered:!1,handler:function(a,b){if(d.detection.current.name!=this.name&&this.triggered)return b.trigger(this.name+"end",a),void(this.triggered=!1);if(!(b.options.drag_max_touches>0&&a.touches.length>b.options.drag_max_touches))switch(a.eventType){case d.EVENT_START:this.triggered=!1;break;case d.EVENT_MOVE:if(a.distance<b.options.drag_min_distance&&d.detection.current.name!=this.name)return;if(d.detection.current.name!=this.name&&(d.detection.current.name=this.name,b.options.correct_for_drag_min_distance&&a.distance>0)){var c=Math.abs(b.options.drag_min_distance/a.distance);d.detection.current.startEvent.center.pageX+=a.deltaX*c,d.detection.current.startEvent.center.pageY+=a.deltaY*c,a=d.detection.extendEventData(a)}(d.detection.current.lastEvent.drag_locked_to_axis||b.options.drag_lock_to_axis&&b.options.drag_lock_min_distance<=a.distance)&&(a.drag_locked_to_axis=!0);var e=d.detection.current.lastEvent.direction;a.drag_locked_to_axis&&e!==a.direction&&(a.direction=d.utils.isVertical(e)?a.deltaY<0?d.DIRECTION_UP:d.DIRECTION_DOWN:a.deltaX<0?d.DIRECTION_LEFT:d.DIRECTION_RIGHT),this.triggered||(b.trigger(this.name+"start",a),this.triggered=!0),b.trigger(this.name,a),b.trigger(this.name+a.direction,a),(b.options.drag_block_vertical&&d.utils.isVertical(a.direction)||b.options.drag_block_horizontal&&!d.utils.isVertical(a.direction))&&a.preventDefault();break;case d.EVENT_END:this.triggered&&b.trigger(this.name+"end",a),this.triggered=!1}}},d.gestures.Hold={name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(a,b){switch(a.eventType){case d.EVENT_START:clearTimeout(this.timer),d.detection.current.name=this.name,this.timer=setTimeout(function(){"hold"==d.detection.current.name&&b.trigger("hold",a)},b.options.hold_timeout);break;case d.EVENT_MOVE:a.distance>b.options.hold_threshold&&clearTimeout(this.timer);break;case d.EVENT_END:clearTimeout(this.timer)}}},d.gestures.Release={name:"release",index:1/0,handler:function(a,b){a.eventType==d.EVENT_END&&b.trigger(this.name,a)}},d.gestures.Swipe={name:"swipe",index:40,defaults:{swipe_min_touches:1,swipe_max_touches:1,swipe_velocity:.7},handler:function(a,b){if(a.eventType==d.EVENT_END){if(b.options.swipe_max_touches>0&&a.touches.length<b.options.swipe_min_touches&&a.touches.length>b.options.swipe_max_touches)return;(a.velocityX>b.options.swipe_velocity||a.velocityY>b.options.swipe_velocity)&&(b.trigger(this.name,a),b.trigger(this.name+a.direction,a))}}},d.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(a,b){if(a.eventType==d.EVENT_END&&"touchcancel"!=a.srcEvent.type){var c=d.detection.previous,e=!1;if(a.deltaTime>b.options.tap_max_touchtime||a.distance>b.options.tap_max_distance)return;c&&"tap"==c.name&&a.timeStamp-c.lastEvent.timeStamp<b.options.doubletap_interval&&a.distance<b.options.doubletap_distance&&(b.trigger("doubletap",a),e=!0),(!e||b.options.tap_always)&&(d.detection.current.name="tap",b.trigger(d.detection.current.name,a))}}},d.gestures.Touch={name:"touch",index:-1/0,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(a,b){return b.options.prevent_mouseevents&&a.pointerType==d.POINTER_MOUSE?void a.stopDetect():(b.options.prevent_default&&a.preventDefault(),void(a.eventType==d.EVENT_START&&b.trigger(this.name,a)))}},d.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(a,b){if(d.detection.current.name!=this.name&&this.triggered)return b.trigger(this.name+"end",a),void(this.triggered=!1);if(!(a.touches.length<2))switch(b.options.transform_always_block&&a.preventDefault(),a.eventType){case d.EVENT_START:this.triggered=!1;break;case d.EVENT_MOVE:var c=Math.abs(1-a.scale),e=Math.abs(a.rotation);if(c<b.options.transform_min_scale&&e<b.options.transform_min_rotation)return;d.detection.current.name=this.name,this.triggered||(b.trigger(this.name+"start",a),this.triggered=!0),b.trigger(this.name,a),e>b.options.transform_min_rotation&&b.trigger("rotate",a),c>b.options.transform_min_scale&&(b.trigger("pinch",a),b.trigger("pinch"+(a.scale<1?"in":"out"),a));break;case d.EVENT_END:this.triggered&&b.trigger(this.name+"end",a),this.triggered=!1}}},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return d}):"object"==typeof module&&"object"==typeof module.exports?module.exports=d:a.Hammer=d}(this),FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),FastClick.prototype.needsClick=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(a.disabled)return!0;break;case"input":if(this.deviceIsIOS&&"file"===a.type||a.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(a.className)},FastClick.prototype.needsFocus=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!this.deviceIsAndroid;case"input":switch(a.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}},FastClick.prototype.sendClick=function(a,b){"use strict";var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur(),d=b.changedTouches[0],c=document.createEvent("MouseEvents"),c.initMouseEvent(this.determineEventType(a),!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),c.forwardedTouchEvent=!0,a.dispatchEvent(c)},FastClick.prototype.determineEventType=function(a){"use strict";return this.deviceIsAndroid&&"select"===a.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(a){"use strict";var b;this.deviceIsIOS&&a.setSelectionRange&&0!==a.type.indexOf("date")&&"time"!==a.type?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()},FastClick.prototype.updateScrollParent=function(a){"use strict";var b,c;if(b=a.fastClickScrollParent,!b||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c,a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(a){"use strict";return a.nodeType===Node.TEXT_NODE?a.parentNode:a},FastClick.prototype.onTouchStart=function(a){"use strict";var b,c,d;if(a.targetTouches.length>1)return!0;if(b=this.getTargetElementFromEventTarget(a.target),c=a.targetTouches[0],this.deviceIsIOS){if(d=window.getSelection(),d.rangeCount&&!d.isCollapsed)return!0;if(!this.deviceIsIOS4){if(c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier,this.updateScrollParent(b)}}return this.trackingClick=!0,this.trackingClickStart=a.timeStamp,this.targetElement=b,this.touchStartX=c.pageX,this.touchStartY=c.pageY,a.timeStamp-this.lastClickTime<200&&a.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(a){"use strict";var b=a.changedTouches[0],c=this.touchBoundary;return Math.abs(b.pageX-this.touchStartX)>c||Math.abs(b.pageY-this.touchStartY)>c?!0:!1},FastClick.prototype.onTouchMove=function(a){"use strict";return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(a.target)||this.touchHasMoved(a))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},FastClick.prototype.findControl=function(a){"use strict";return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(a){"use strict";var b,c,d,e,f,g=this.targetElement;if(!this.trackingClick)return!0;if(a.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=a.timeStamp,c=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,this.deviceIsIOSWithBadTarget&&(f=a.changedTouches[0],g=document.elementFromPoint(f.pageX-window.pageXOffset,f.pageY-window.pageYOffset)||g,g.fastClickScrollParent=this.targetElement.fastClickScrollParent),d=g.tagName.toLowerCase(),"label"===d){if(b=this.findControl(g)){if(this.focus(g),this.deviceIsAndroid)return!1;g=b}}else if(this.needsFocus(g))return a.timeStamp-c>100||this.deviceIsIOS&&window.top!==window&&"input"===d?(this.targetElement=null,!1):(this.focus(g),this.sendClick(g,a),this.deviceIsIOS4&&"select"===d||(this.targetElement=null,a.preventDefault()),!1);return this.deviceIsIOS&&!this.deviceIsIOS4&&(e=g.fastClickScrollParent,e&&e.fastClickLastScrollTop!==e.scrollTop)?!0:(this.needsClick(g)||(a.preventDefault(),this.sendClick(g,a)),!1)},FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(a){"use strict";return this.targetElement?a.forwardedTouchEvent?!0:a.cancelable?!this.needsClick(this.targetElement)||this.cancelNextClick?(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0:!0:!0},FastClick.prototype.onClick=function(a){"use strict";var b;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===a.target.type&&0===a.detail?!0:(b=this.onMouse(a),b||(this.targetElement=null),b)},FastClick.prototype.destroy=function(){"use strict";var a=this.layer;this.deviceIsAndroid&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0)),a.removeEventListener("click",this.onClick,!0),a.removeEventListener("touchstart",this.onTouchStart,!1),a.removeEventListener("touchmove",this.onTouchMove,!1),a.removeEventListener("touchend",this.onTouchEnd,!1),a.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(a){"use strict";var b,c;if("undefined"==typeof window.ontouchstart)return!0;if(c=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!FastClick.prototype.deviceIsAndroid)return!0;if(b=document.querySelector("meta[name=viewport]")){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(c>31&&window.innerWidth<=window.screen.width)return!0}}return"none"===a.style.msTouchAction?!0:!1},FastClick.attach=function(a){"use strict";return new FastClick(a)},"undefined"!=typeof define&&define.amd?define(function(){"use strict";return FastClick}):"undefined"!=typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick,function(a,b,c,d){var e=null;e="undefined"!=typeof exports?exports:a.M={},e.Version=e.version="2.0.0-beta3",e.f=function(){},e.create=function(a){return new this(a)},e.design=function(a){var b=this.extend(a||{});return new b},e.extend=b.Model.extend,e.isCollection=function(a){return b.Collection.prototype.isPrototypeOf(a)},e.isModel=function(a){return b.Model.prototype.isPrototypeOf(a)},e.isEntity=function(a){return e.Entity.prototype.isPrototypeOf(a)},e.isI18NItem=function(a){return a&&a._type&&"M.I18NItem"===a._type?!0:!1},e.isController=function(a){return e.Controller.prototype.isPrototypeOf(a)},e.isView=function(a){return e.View.prototype.isPrototypeOf(a)},e.implements=function(a){return this.prototype._implementedInterfaces=a,this},YES=!0,NO=!1,e.CONST={LOGGER:{TAG_FRAMEWORK_CORE:"framework-core",TAG_FRAMEWORK_DATA:"framework-data",TAG_FRAMEWORK_UI:"framework-ui",TAG_FRAMEWORK_UTILITY:"framework-utility",TAG_ALL:""},I18N:{LOCALE_CHANGED:"locale-changed"},TYPE:{INTEGER:"integer",STRING:"string",TEXT:"text",DATE:"date",BOOLEAN:"boolean",FLOAT:"float",OBJECT:"object",ARRAY:"array",BINARY:"binary",OBJECTID:"objectid",NULL:"null"},ORDER:{ASC:"ASC",DESC:"DESC"},ERROR:{UNDEFINED:0,CONNECTION:1,VALIDATION_PRESENCE:100,VALIDATION_URL:101,VALIDATION_PHONE:102,VALIDATION_NUMBER:103,VALIDATION_NOTMINUS:104,VALIDATION_EMAIL:105,VALIDATION_DATE:106,MODEL_PROVIDER_NOT_SET:120,WEBSQL_UNKNOWN:200,WEBSQL_DATABASE:201,WEBSQL_VERSION:202,WEBSQL_TOO_LARGE:203,WEBSQL_QUOTA:204,WEBSQL_SYNTAX:205,WEBSQL_CONSTRAINT:206,WEBSQL_TIMEOUT:207,WEBSQL_NO_DBHANDLER:208,WEBSQL_NOT_SUPPORTED:209,WEBSQL_BULK_NO_RECORDS:210,COUCHDB_CONFLICT:300,COUCHDB_DBNOTFOUND:301,COUCHDB_DBEXISTS:302,COUCHDB_DOCNOTFOUND:303},INPUT:{TEXT:"text",PASSWORD:"password",NUMBER:"number",TELEPHONE:"tel",URL:"url",EMAIL:"email",TIME:"time",DATE:"date",DATETIME:"datetime",MONTH:"month",WEEK:"week"},GRID:{COLUMNS:12}},e.Object={_type:"M.Object",_implementedInterfaces:null,_create:function(a){var b=function(){};return b.prototype=a,new b},include:function(a){for(var b in a){if(this.hasOwnProperty(b))throw e.Exception.RESERVED_WORD.getException();this[b]=a[b]}return this},design:function(a){var b=this._create(this);return b.include(this._normalize(a)),b._init(),c.each(b._implementedInterfaces,function(a){b.bindToCaller(b,a._init)()},b),b},implement:function(a){if(a&&a.isMInterface){var b=a.getInterface(this);c.each(b,function(a,c){this[c]&&(b[c]=null,delete b[c])},this),this.include(b),this._implementedInterfaces=this._implementedInterfaces||[]}return this},hasInterfaceImplementation:function(a){var b=NO;return c.each(this._implementedInterfaces,function(c){a===c&&(b=YES)},this),b},bindToCaller:function(a,b,c){return function(){if("function"!=typeof b||"object"!=typeof a)throw e.Exception.INVALID_INPUT_PARAMETER.getException();return Array.isArray(c)?b.apply(a,c):b.call(a,c)}},_init:function(){},_normalize:function(a){return a=a&&"object"==typeof a?a:{}},handleCallback:function(a){var b=Array.prototype.slice.call(arguments,1);if(a){var c="object"==typeof a.target?a.target:this,d=a;if("function"==typeof a.action?d=a.action:"string"==typeof a.action&&(d=c[a.action]),"function"==typeof d)return this.bindToCaller(c,d,b)()}},getObjectType:function(){return this._type},_addInterfaces:function(){c.each(this._implementedInterfaces,function(a){this.implement(a)},this)},deepCopy:function(a){return JSON.parse(JSON.stringify(a))}},e.Config=function(a){this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},e.Config.extend=e.extend,e.Config.create=e.create,e.Config.design=e.design,c.extend(e.Config.prototype,{_type:"M.Config",get:function(a){return this[a]}}),e.Logger=e.Object.design({filter:[],_type:"M.Logger",_OUTPUT_LOG:0,_OUTPUT_DEBUG:1,_OUTPUT_WARN:2,_OUTPUT_ERROR:3,_LEVEL_TIME_END:4,_times:[],_counts:[],_appRunsInNotDebugMode:NO,_init:function(){c.isUndefined(console)&&(window.console={},console.log=console.debug=console.warn=console.error=function(){}),this._appRunsInNotDebugMode=NO},log:function(){this._print(this._OUTPUT_LOG,arguments)},warn:function(){this._print(this._OUTPUT_WARN,arguments)},error:function(a,b){this._print(this._OUTPUT_ERROR,b,a)},time:function(a){return this._appRunsInNotDebugMode?void 0:c.isUndefined(console.time2)?void this._time(a):void console.time(a)},timeEnd:function(a){return this._appRunsInNotDebugMode?void 0:c.isUndefined(console.timeEnd2)?void this._timeEnd(a):void console.timeEnd(a)},count:function(a){return this._appRunsInNotDebugMode?void 0:c.isUndefined(console.count2)?void this._count(a):void console.count(a)},_print:function(a,b){if(!this._appRunsInNotDebugMode){a=a||this._OUTPUT_LOG,b=Array.prototype.slice.call(b),1===b.length&&b.splice(0,0,e.CONST.LOGGER.TAG_ALL);var d=b[0];if(!this._preventOutputByTag(d)){var f="";if(a<this._OUTPUT_ERROR)if(c.isArray(d)&&this.filter.length>0){var g=c.without(this.filter,d);f="["+g+"]"}else d.length>0&&(f="["+d+"]");switch(b.length>1&&(f===e.CONST.LOGGER.TAG_ALL?b.splice(0,1):b[0]=f),a){case this._OUTPUT_LOG:console.log.apply(console,b);break;case this._OUTPUT_WARN:b.splice(0,0,"WARNING:"),console.warn.apply(console,b);break;case this._OUTPUT_ERROR:b.splice(0,0,"ERROR:"),console.error.apply(console,b);break;case this._OUTPUT_DEBUG:console.debug.apply(console,b);break;default:console.log.apply(console,b)}}}},_time:function(a){var b=c.find(this._times,function(b){return b.label===a});b||this._times.push({label:a,time:(new Date).getTime()})},_timeEnd:function(a){var b=c.find(this._times,function(b){return b.label===a});if(b){var d=(new Date).getTime(),e=(d-b.time)/1e3,f=this._times.indexOf(b);this._print(this._OUTPUT_DEBUG,[b.label+": "+e+"ms"]),this._times.splice(f,1)}},_count:function(a){var b=c.find(this._counts,function(b){return b.label===a});void 0===b?(this._counts.push({label:a,count:1}),b=c.last(this._counts)):b.count++,this._print(this._OUTPUT_DEBUG,[b.label+": "+b.count])},_preventOutputByTag:function(a){if(this.filter.length>0&&-1===this.filter.indexOf(e.CONST.TAG_ALL))if(c.isString(a)){if(-1===this.filter.indexOf(a))return YES}else if(c.isArray(a)&&c.difference(a,this.filter).length===a.length)return YES;return NO}}),e.Controller=function(a){this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},e.Controller.extend=e.extend,e.Controller.create=e.create,e.Controller.design=e.design,c.extend(e.Controller.prototype,b.Events,{_type:"M.Controller",initialize:function(){return this},applicationStart:function(){},show:function(){},set:function(a,b){this[a]=b,this.trigger(a,b)},get:function(a){return this[a]},applicationReady:function(){},apply:function(b,c){var d=a[e.APPLICATION_NAME];d.isInitialLoad?(this.applicationStart.apply(this,c),d.isInitialLoad=!1,d._initReady()):this.show.apply(this,c)}}),e.Application=e.Controller.extend({_type:"M.Application",Models:null,Collections:null,Views:null,Controllers:null,Routers:null,_isReady:NO,_debugView:null,isInitialLoad:!0,_layout:null,_config:null,initialize:function(a){return this.Models={},this.Collections={},this.Views={},this.Controllers={},this.Routers={},e.APPLICATION_NAME=a.name,this._config=e.Config.design(a),this},start:function(a){return this.router=e.Router.design(a.routing),this._initLocale(a).then(function(){b.history.start()}),this},setLayout:function(a){this._layout&&(this._layout.destroy(),this._layout=null),this._layout=a,this._layout.render(),d("#main").html(this._layout.$el)},getLayout:function(){return this._layout},navigate:function(a){if(this._layout&&this._layout.isAnimating&&this._layout.isAnimating())return!1;var d=a.route,e="";a.params&&(e=c.isArray(a.params)?a.params.join("/"):a.params,d+="/"),this._layout&&this._layout.setTransition(a.transition);var f=a.options||!0;b.history.navigate(d+e,f)},_initLocale:function(){var a=d.Deferred();return e.I18N.on(e.CONST.I18N.LOCALE_CHANGED,function(){a.resolve()}),this._config&&this.getConfig("locales")?(e.I18N.setLocales(this.getConfig("locales")),e.I18N.setLocale(moment.lang())):a.resolve(),a.promise()},_initReady:function(){this._isReady||(this._initDebugView(),FastClick.attach(document.body),c.each(Object.getPrototypeOf(this.router),function(a){e.isController(a)&&a.applicationReady()},this),this._isReady=YES)},_initDebugView:function(){this.getConfig("debugView")&&(this._debugView=e.DebugView.create())},getConfig:function(a){return this._config.get(a)}}),e.Router=b.Router.extend(),e.Router.create=e.create,e.Router.design=e.design,c.extend(e.Router.prototype,e.Object,{_type:"M.Router"}),e.ViewManager=e.Object.design({_allViews:null,registerView:function(a){return c.isObject(this._allViews)||(this._allViews={}),a.cid?void(this._allViews[a.cid]?console.warn("view already registered"):this._allViews[a.cid]=a):void console.warn("view has no cid")},getView:function(a,b){var d=[];return a?this._allViews[a]?(d.push(this._allViews[a]),d):a.DOCUMENT_NODE?(d.push(this._getViewByDom(a)),d):"string"==typeof a?e.isView(b)?(this._getViewInScope(a,b,d),d):("string"==typeof a&&c.each(this._allViews,function(c){c.childViews&&c.childViews.hasOwnProperty(a)&&("string"==typeof b?c.childViews[a]&&c.childViews[a]._type===b&&d.push(c.childViews[a]):d.push(c.childViews[a]))},this),d):d:d},_getViewByDom:function(a){return c.find(this._allViews,function(b){return b.el===a})},_getViewInScope:function(a,b,c){if(b.childViews!=={}){b.childViews.hasOwnProperty(a)&&c.push(b.childViews[a]);for(var d in b.childViews)this._getViewInScope(a,b.childViews[d],c)}}}),Modernizr.Detectizr.detect({detectScreen:!1}),e.Environment=Modernizr.Detectizr,e.Environment.isLowerThanAndroid4="android"===Modernizr.Detectizr.device.model&&parseInt(Modernizr.Detectizr.device.osVersion,10)<4,e.Environment.isLowerThaniPhone4S="ios"===Modernizr.Detectizr.device.os&&(document.width<=320||document.width<=480),e.I18NItem=e.Object.design({_type:"M.I18NItem",key:null,placeholder:null,create:function(a,b){return a?(this.key=a,b&&(this.placeholder=b),c.extend({},this)):null}}),e.I18N=c.extend(b.Events,e.Object.design({_type:"M.I18N",_availableLocales:[],_activeLocale:null,_dictionary:[],setLocales:function(a){return a&&c.isArray(a)&&a.length>0?(this._availableLocales=a,!0):(console.log("No locales given!"),!1)},getLocales:function(){return this._availableLocales},setLocale:function(a){this._activeLocale=a,this.loadFileForLocale()},getLocale:function(){return this._activeLocale},get:function(a,b){return e.I18NItem.create(a,b)},l:function(a,b){if(void 0===this._dictionary[this._activeLocale]||void 0===a||""===a||null===a)return"";var d=this._dictionary[this._activeLocale];return d=d[a],d?b&&c.each(b,function(a,b){d=d.replace("{{"+b+"}}",a)}):(d="MISSING TRANSLATION "+this._activeLocale+": "+a,console.log(d)),d},loadFileForLocale:function(){var a="i18n/"+this._activeLocale+".js";moment.lang(this._activeLocale.substr(0,2));var b=this;void 0===this._dictionary[b._activeLocale]?d.getJSON(a).success(function(a){b._setDictionary(a)}).error(function(b,c,d){console.log("parsererror"===c?"It's seem that the i18n file "+a+" is corrupt! "+d.message:arguments)}):this._triggerLocaleChangedEvent()},_setDictionary:function(a){var b=this._parseObject(a);this._dictionary[this._activeLocale]=b,this._triggerLocaleChangedEvent()},_triggerLocaleChangedEvent:function(){this.trigger(e.CONST.I18N.LOCALE_CHANGED,this._activeLocale)},_parseObject:function(a){var b={};for(var d in a)if(a.hasOwnProperty(d))if(c.isObject(a[d])){var e=this._parseObject(a[d]);for(var f in e)e.hasOwnProperty(f)&&(b[d+"."+f]=e[f])}else b[d]=a[d];return b}})),e.ObjectID=function(a){e.ObjectID.counter=e.ObjectID.counter||parseInt(Math.random()*Math.pow(16,6)),e.ObjectID.machineId=e.ObjectID.machineId||parseInt(Math.random()*Math.pow(16,6)),e.ObjectID.processId=e.ObjectID.processId||parseInt(Math.random()*Math.pow(16,4)),this._ObjectID(a)},e.ObjectID._looksLikeObjectID=function(a){return 24===a.length&&a.match(/^[0-9a-f]*$/)},c.extend(e.ObjectID.prototype,{_str:"",_ObjectID:function(a){if(a){if(a=a.toLowerCase(),!e.ObjectID._looksLikeObjectID(a))throw new Error("Invalid hexadecimal string for creating an ObjectID");this._str=a}else this._str=this._hexString(8,(new Date).getTime()/1e3)+this._hexString(6,e.ObjectID.machineId)+this._hexString(4,e.ObjectID.processId)+this._hexString(6,e.ObjectID.counter++);return this._str},_hexString:function(a,b){b=b||parseInt(Math.random()*Math.pow(16,a));for(var c=b.toString(16);c.length<a;)c="0"+c;return c.substr(0,a)},toString:function(){return"ObjectID('"+this._str+"')"},equals:function(a){return a instanceof this._ObjectID&&this.valueOf()===a.valueOf()},clone:function(){return new e.ObjectID(this._str)},typeName:function(){return"oid"},getTimestamp:function(){return 1e3*parseInt(this._str.substr(0,8),16)},getMachineId:function(){return parseInt(this._str.substr(8,6),16)},getProcessId:function(){return parseInt(this._str.substr(14,4),16)},getCounter:function(){return parseInt(this._str.substr(18,6),16)},valueOf:function(){return this._str},toJSON:function(){return this._str},toHexString:function(){return this._str},_selectorIsId:function(a){return"string"==typeof a||"number"==typeof a||a instanceof e.ObjectId},_selectorIsIdPerhapsAsObject:function(a){return this._selectorIsId(a)||a&&"object"==typeof a&&a._id&&this._selectorIsId(a._id)&&1===c.size(a)},_idsMatchedBySelector:function(a){if(this._selectorIsId(a))return[a];if(!a)return null;if(c.has(a,"_id"))return this._selectorIsId(a._id)?[a._id]:a._id&&a._id.$in&&c.isArray(a._id.$in)&&!c.isEmpty(a._id.$in)&&c.all(a._id.$in,this._selectorIsId)?a._id.$in:null;if(a.$and&&c.isArray(a.$and))for(var b=0;b<a.$and.length;++b){var d=this._idsMatchedBySelector(a.$and[b]);if(d)return d}return null}}),e.UniqueId=e.Object.design({uuid:function(a,b){var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),d=[];b=b||c.length;var e;if(a)for(e=0;a>e;e++)d[e]=c[0|Math.random()*b];else{var f;for(d[8]=d[13]=d[18]=d[23]="-",d[14]="4",e=0;36>e;e++)d[e]||(f=0|16*Math.random(),d[e]=c[19===e?3&f|8:f])}return d.join("")}}),e.Base64=e.Object.design({type:"M.Base64",_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(a){for(var b,c="",d=new Array(4),e=0,f=0;e<a.length;){b=new Array(3);for(var g=0;g<b.length;g++)b[g]=e<a.length?255&a.charCodeAt(e++):0;switch(d[0]=b[0]>>2,d[1]=(3&b[0])<<4|b[1]>>4,d[2]=(15&b[1])<<2|b[2]>>6,d[3]=63&b[2],f=e-(a.length-1)){case 2:d[3]=64,d[2]=64;break;case 1:d[3]=64}for(g=0;g<d.length;g++)c+=this._keyStr.charAt(d[g])}return c},encode:function(a){var b,c,d,f,g,h,i,j="",k=0;for(a=e.Cypher.utf8Encode(a);k<a.length;)b=a.charCodeAt(k++),c=a.charCodeAt(k++),d=a.charCodeAt(k++),f=b>>2,g=(3&b)<<4|c>>4,h=(15&c)<<2|d>>6,i=63&d,isNaN(c)?h=i=64:isNaN(d)&&(i=64),j+=this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h)+this._keyStr.charAt(i);return j},binaryEncode:function(a){for(var b,c,d,e,f,g,h,i="",j=0;j<a.length;)b=a.charCodeAt(j++),c=a.charCodeAt(j++),d=a.charCodeAt(j++),e=b>>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i+=this._keyStr.charAt(e)+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h);
  return i},decode:function(a){var b,c,d,f,g,h,i,j="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)f=this._keyStr.indexOf(a.charAt(k++)),g=this._keyStr.indexOf(a.charAt(k++)),h=this._keyStr.indexOf(a.charAt(k++)),i=this._keyStr.indexOf(a.charAt(k++)),b=f<<2|g>>4,c=(15&g)<<4|h>>2,d=(3&h)<<6|i,j+=String.fromCharCode(b),64!==h&&(j+=String.fromCharCode(c)),64!==i&&(j+=String.fromCharCode(d));return e.Cypher.utf8Decode(j)}}),e.SHA256=e.Object.design({type:"M.SHA256",chrsz:8,hexcase:0,hash:function(a){return a=e.Cypher.utf8Encode(a),this.binb2hex(this.coreSha256(this.str2binb(a),a.length*this.chrsz))},safeAdd:function(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c},S:function(a,b){return a>>>b|a<<32-b},R:function(a,b){return a>>>b},Ch:function(a,b,c){return a&b^~a&c},Maj:function(a,b,c){return a&b^a&c^b&c},Sigma0256:function(a){return this.S(a,2)^this.S(a,13)^this.S(a,22)},Sigma1256:function(a){return this.S(a,6)^this.S(a,11)^this.S(a,25)},Gamma0256:function(a){return this.S(a,7)^this.S(a,18)^this.R(a,3)},Gamma1256:function(a){return this.S(a,17)^this.S(a,19)^this.R(a,10)},coreSha256:function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),p=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),q=new Array(64);for(a[b>>5]|=128<<24-b%32,a[(b+64>>9<<4)+15]=b,k=0;k<a.length;k+=16){for(c=p[0],d=p[1],e=p[2],f=p[3],g=p[4],h=p[5],i=p[6],j=p[7],l=0;64>l;l++)q[l]=16>l?a[l+k]:this.safeAdd(this.safeAdd(this.safeAdd(this.Gamma1256(q[l-2]),q[l-7]),this.Gamma0256(q[l-15])),q[l-16]),m=this.safeAdd(this.safeAdd(this.safeAdd(this.safeAdd(j,this.Sigma1256(g)),this.Ch(g,h,i)),o[l]),q[l]),n=this.safeAdd(this.Sigma0256(c),this.Maj(c,d,e)),j=i,i=h,h=g,g=this.safeAdd(f,m),f=e,e=d,d=c,c=this.safeAdd(m,n);p[0]=this.safeAdd(c,p[0]),p[1]=this.safeAdd(d,p[1]),p[2]=this.safeAdd(e,p[2]),p[3]=this.safeAdd(f,p[3]),p[4]=this.safeAdd(g,p[4]),p[5]=this.safeAdd(h,p[5]),p[6]=this.safeAdd(i,p[6]),p[7]=this.safeAdd(j,p[7])}return p},str2binb:function(a){for(var b=[],c=(1<<this.chrsz)-1,d=0;d<a.length*this.chrsz;d+=this.chrsz)b[d>>5]|=(a.charCodeAt(d/this.chrsz)&c)<<24-d%32;return b},binb2hex:function(a){for(var b=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",c="",d=0;d<4*a.length;d++)c+=b.charAt(a[d>>2]>>8*(3-d%4)+4&15)+b.charAt(a[d>>2]>>8*(3-d%4)&15);return c}}),e.Cypher=e.Object.design({type:"M.Cypher",defaultDecoder:e.Base64,defaultEncoder:e.Base64,defaultHasher:e.SHA256,decode:function(a,b){return b&&b.decode?b.decode(a):this.defaultDecoder.decode(a)},encode:function(a,b){return b&&b.encode?b.encode(a):this.defaultEncoder.encode(a)},hash:function(a,b){return b&&b.hash?b.hash(a):this.defaultHasher.hash(a)},utf8Encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},utf8Decode:function(a){var b,c,d,e,f,g="";for(b=c=d=e=0;b<a.length;)c=a.charCodeAt(b),128>c?(g+=String.fromCharCode(c),b++):c>191&&224>c?(e=a.charCodeAt(b+1),g+=String.fromCharCode((31&c)<<6|63&e),b+=2):(e=a.charCodeAt(b+1),f=a.charCodeAt(b+2),g+=String.fromCharCode((15&c)<<12|(63&e)<<6|63&f),b+=3);return g}}),e.Date={create:function(){var a=moment.apply(this,arguments);return c.extend(a,this)}},e.Request=e.Object.design({_type:"M.Request",_id:null,_request:null,method:null,url:null,timeout:null,data:null,init:function(a){return this.design(a)},_normalize:function(a){return a=a&&"object"==typeof a?a:{},a.callbacks=a.callbacks||{},a},_init:function(){if(Object.getPrototypeOf(this)===e.Request&&!this.url)throw e.Exception.NO_REQUEST_URL_SPECIFIED.getException();this._id=e.UniqueId.uuid(),this.method=this.method||"GET",this.data=this.data||"",("number"!=typeof this.timeout||this.timeout<0)&&delete this.timeout},getId:function(){return this._id},send:function(){this._request=d.ajax({type:this.method,url:this.url,timeout:this.timeout,data:this.data,context:this,beforeSend:this._handleBeforeSend,success:this._handleSuccess,error:this._handleError})},cancel:function(){this._request&&this._request.abort(),this._request=null},_handleBeforeSend:function(a){this.handleCallback(this.callbacks.beforeSend,{id:this.getId(),xhr:a})},_handleSuccess:function(a,b,c){this.handleCallback(this.callbacks.success,{id:this.getId(),data:a,status:b,xhr:c}),this.cancel()},_handleError:function(a,b,c){this.handleCallback(this.callbacks.error,{id:this.getId(),xhr:a,status:b,error:c}),this.cancel()},getLocation:function(a){var b=document.createElement("a");return b.href=a||this.url,""===b.host&&(b.href=b.href),b}}),e.RequestManager=e.Object.design({_type:"M.RequestManager",baseUrl:null,method:null,timeout:null,_requests:null,init:function(a){return this.design(a)},_normalize:function(a){return a=a&&"object"==typeof a?a:{},a.callbacks=a.callbacks||{},a.baseUrl=a.baseUrl||a.url,a},_init:function(){if(Object.getPrototypeOf(this)===e.RequestManager&&!this.baseUrl)throw e.Exception.NO_REQUEST_MANAGER_BASE_URL_SPECIFIED.getException();this._requests={},this.baseUrl&&this.baseUrl.lastIndexOf("/")===this.baseUrl.length-1&&(this.baseUrl=this.baseUrl.substr(0,this.baseUrl.length-1)),this.url&&delete this.url,this.method=this.method||"GET",("number"!=typeof this.timeout||this.timeout<0)&&delete this.timeout},doRequest:function(a){a=a&&"object"==typeof a?a:{};var b=e.Request.init({url:this.getUrl(a),timeout:isNaN(a.timeout)?this.timeout:a.timeout,method:a.method?a.method:this.method,data:a.data?a.data:"",callbacks:{beforeSend:{target:this,action:"_handleBeforeSend"},success:{target:this,action:"_handleSuccess"},error:{target:this,action:"_handleError"}}});return this._requests[b.getId()]=b,b.send(),b},getUrl:function(a){return a.path&&"/"!==a.path[0]&&(a.path="/"+a.path),this.baseUrl+(a.path?a.path:"")},_handleBeforeSend:function(a){this.handleCallback(this.callbacks.beforeSend,a)},_handleSuccess:function(a){this.handleCallback(this.callbacks.success,a),this.requestFinished(a.id)},_handleError:function(a){this.handleCallback(this.callbacks.error,a),this.requestFinished(a.id)},requestFinished:function(a){this._requests&&this._requests[a]&&(this._requests[a]=null,delete this._requests[a])},cancelRequest:function(a){this._requests&&this._requests[a]&&(this._requests[a].cancel(),this.requestFinished(a))},cancelAllRequest:function(){c.each(this._requests,function(a,b){this.cancelRequest(b)},this)}}),e.Field=function(a){this.merge(a),this.initialize.apply(this,arguments)},e.Field.extend=e.extend,e.Field.create=e.create,e.Field.design=e.design,c.extend(e.Field.prototype,e.Object,{_type:"M.Field",name:null,type:null,index:null,defaultValue:void 0,length:null,required:NO,persistent:YES,initialize:function(){},merge:function(a){a=c.isString(a)?{type:a}:a||{},this.name=c.isUndefined(a.name)?this.name:a.name,this.type=c.isUndefined(a.type)?this.type:a.type,this.index=c.isUndefined(a.index)?this.index:a.index,this.defaultValue=c.isUndefined(a.defaultValue)?this.defaultValue:a.defaultValue,this.length=c.isUndefined(a.length)?this.length:a.length,this.required=c.isUndefined(a.required)?this.required:a.required,this.persistent=c.isUndefined(a.persistent)?this.persistent:a.persistent},transform:function(a,b){b=b||this.type;try{if(c.isUndefined(a))return this.defaultValue;if(b===e.CONST.TYPE.STRING||b===e.CONST.TYPE.TEXT)return c.isObject(a)?JSON.stringify(a):c.isNull(a)?"null":a.toString();if(b===e.CONST.TYPE.INTEGER)return parseInt(a);if(b===e.CONST.TYPE.BOOLEAN)return a===!0||"true"===a;if(b===e.CONST.TYPE.FLOAT)return parseFloat(a);if(b===e.CONST.TYPE.OBJECT||b===e.CONST.TYPE.ARRAY){if(!c.isObject(a))return c.isString(a)?JSON.parse(a):null}else if(b===e.CONST.TYPE.DATE){if(!e.Date.isPrototypeOf(a)){var d=a?e.Date.create(a):null;return d&&d.isValid()?d:null}}else if(b===e.CONST.TYPE.OBJECTID&&!e.ObjectID.prototype.isPrototypeOf(a))return c.isString(a)?new e.ObjectID(a):null;return a}catch(f){e.Logger.error(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,"Failed converting value! "+f.message)}},equals:function(a,b){var d=this.transform(a),e=this.transform(b);return this._equals(d,e,c.isArray(d))},isBinary:function(a){return"undefined"!=typeof Uint8Array&&a instanceof Uint8Array||a&&a.$Uint8ArrayPolyfill},detectType:function(a){return c.isNumber(a)?e.CONST.TYPE.FLOAT:c.isString(a)?e.CONST.TYPE.STRING:c.isBoolean(a)?e.CONST.TYPE.BOOLEAN:c.isArray(a)?e.CONST.TYPE.ARRAY:c.isNull(a)?e.CONST.TYPE.NULL:c.isDate(a)||e.Date.isPrototypeOf(a)?e.CONST.TYPE.DATE:e.ObjectID.prototype.isPrototypeOf(a)?e.CONST.TYPE.OBJECTID:this.isBinary(a)?e.CONST.TYPE.BINARY:e.CONST.TYPE.OBJECT},typeOrder:function(a){switch(a){case e.CONST.TYPE.NULL:return 0;case e.CONST.TYPE.FLOAT:return 1;case e.CONST.TYPE.STRING:return 2;case e.CONST.TYPE.OBJECT:return 3;case e.CONST.TYPE.ARRAY:return 4;case e.CONST.TYPE.BINARY:return 5;case e.CONST.TYPE.DATE:return 6}return-1},_equals:function(a,b,d){var e,f=this;if(a===b)return!0;if(!a||!b)return!1;if(!c.isObject(a)||!c.isObject(b))return!1;if(a instanceof Date&&b instanceof Date)return a.valueOf()===b.valueOf();if(this.isBinary(a)&&this.isBinary(b)){if(a.length!==b.length)return!1;for(e=0;e<a.length;e++)if(a[e]!==b[e])return!1;return!0}if(c.isFunction(a.equals))return a.equals(b);if(c.isArray(a)){if(!c.isArray(b))return!1;if(a.length!==b.length)return!1;for(e=0;e<a.length;e++)if(!f.equals(a[e],b[e],d))return!1;return!0}var g;if(d){var h=[];return c.each(b,function(a,b){h.push(b)}),e=0,g=c.all(a,function(a,c){return e>=h.length?!1:c!==h[e]?!1:f.equals(a,b[h[e]],d)?(e++,!0):!1}),g&&e===h.length}return e=0,g=c.all(a,function(a,g){return c.has(b,g)?f.equals(a,b[g],d)?(e++,!0):!1:!1}),g&&c.size(b)===e},_cmp:function(a,b){if(void 0===a)return void 0===b?0:-1;if(void 0===b)return 1;var c=0,d=this.detectType(a),f=this.detectType(b),g=this.typeOrder(d),h=this.typeOrder(f);if(g!==h)return h>g?-1:1;if(d!==f)throw new Error("Missing type coercion logic in _cmp");if(7===d&&(d=f=2,a=a.toHexString(),b=b.toHexString()),d===e.CONST.TYPE.DATE&&(d=f=1,a=a.getTime(),b=b.getTime()),d===e.CONST.TYPE.FLOAT)return a-b;if(f===e.CONST.TYPE.STRING)return b>a?-1:a===b?0:1;if(d===e.CONST.TYPE.OBJECT){var i=function(a){var b=[];for(var c in a)b.push(c),b.push(a[c]);return b};return this._cmp(i(a),i(b))}if(d===e.CONST.TYPE.ARRAY)for(c=0;;c++){if(c===a.length)return c===b.length?0:-1;if(c===b.length)return 1;var j=this._cmp(a[c],b[c]);if(0!==j)return j}if(d===e.CONST.TYPE.BINARY){if(a.length!==b.length)return a.length-b.length;for(c=0;c<a.length;c++){if(a[c]<b[c])return-1;if(a[c]>b[c])return 1}return 0}if(d===e.CONST.TYPE.BOOLEAN)return a?b?0:1:b?-1:0;if(d===e.CONST.TYPE.NULL)return 0;throw new Error("Unknown type to sort")}}),e.Entity=function(a){var b=this.fields;this.fields={},this._mergeFields(b),a=a||{},a.fields&&this._mergeFields(a.fields),this.typeMapping=a.typeMapping||this.typeMapping;var c=a.collection,d=a.model||(c?c.prototype.model:null);this.idAttribute=a.idAttribute||this.idAttribute||(d?d.prototype.idAttribute:""),this._updateFields(this.typeMapping),this.initialize.apply(this,arguments)},e.Entity.from=function(a,b){if(e.Entity.prototype.isPrototypeOf(a))b&&b.typeMapping&&a._updateFields(b.typeMapping);else if(c.isFunction(a)&&e.Entity.prototype.isPrototypeOf(a.prototype)){var d=a;a=new d(b)}else{"string"==typeof a&&(a={name:a});var f=e.Entity.extend(a);a=new f(b)}return a},e.Entity.extend=e.extend,e.Entity.create=e.create,e.Entity.design=e.design,c.extend(e.Entity.prototype,e.Object,{_type:"M.Entity",name:"",idAttribute:"",fields:{},initialize:function(){},getFields:function(){return this.fields},getField:function(a){return this.fields[a]},getFieldName:function(a){var b=this.getField(a);return b&&b.name?b.name:a},getKey:function(){return this.idAttribute||e.Model.idAttribute},getKeys:function(){return this.splitKey(this.getKey())},splitKey:function(a){var b=[];return c.isString(a)&&c.each(a.split(","),function(a){var c=a.trim();c&&b.push(c)}),b},_mergeFields:function(a){c.isObject(this.fields)||(this.fields={});var b=this;c.isObject(a)&&c.each(a,function(a,c){b.fields[c]?b.fields[c].merge(a):b.fields[c]=new e.Field(a)})},_updateFields:function(a){var b=this;c.each(this.fields,function(c,d){c.persistent===NO?delete b.fields[d]:(c.name||(c.name=d),a&&a[c.type]&&(c.type=a[c.type]))})},toAttributes:function(a,b,d){if(d=d||this.fields,a&&!c.isEmpty(d)){var e,f={};return c.each(d,function(b,d){e=c.isFunction(a.get)?a.get(b.name):a[b.name],f[d]=e}),f}return a},fromAttributes:function(a,b){if(b=b||this.fields,a&&!c.isEmpty(b)){var d={};return c.each(b,function(b,e){var f=c.isFunction(a.get)?a.get(e):a[e];f=b.transform(f),c.isUndefined(f)||(d[b.name]=f)}),d}return a},setId:function(a,b){if(a&&b){var d=this.getKey()||a.idAttribute;d&&(c.isFunction(a.set)?a.set(d,b):a[d]=b)}return a},getId:function(a){if(a){var b=this.getKey()||a.idAttribute;if(b)return c.isFunction(a.get)?a.get(b):a[b]}}}),e.Security=e.Object.design({logon:function(a,b){var c=a?a.credentials:null;if(c)switch(c.type){case"basic":return this.logonBasicAuth(a,b)}this.handleCallback(b)},logonBasicAuth:function(a,b){var c=a.credentials;a.beforeSend=function(a){e.Security.setBasicAuth(a,c)},this.handleCallback(b)},setBasicAuth:function(a,b){if(b&&b.username&&a&&e.Base64){var c=e.Base64.encode(encodeURIComponent(b.username+":"+(b.password||"")));a.setRequestHeader("Authorization","Basic "+c)}}}),e.Model=b.Model.extend({constructor:function(a,c){this.init(a,c),b.Model.apply(this,arguments)}}),e.Model.create=e.create,e.Model.design=e.design,c.extend(e.Model.prototype,e.Object,{_type:"M.Model",isModel:YES,entity:null,defaults:{},changedSinceSync:{},logon:e.Security.logon,init:function(a,b){b=b||{},this.collection=b.collection||this.collection,this.idAttribute=b.idAttribute||this.idAttribute,this.store=this.store||(this.collection?this.collection.store:null)||b.store,this.store&&c.isFunction(this.store.initModel)&&this.store.initModel(this,b),this.entity=this.entity||(this.collection?this.collection.entity:null)||b.entity,this.entity&&(this.entity=e.Entity.from(this.entity,{model:this.constructor,typeMapping:b.typeMapping}),this.idAttribute=this.entity.idAttribute||this.idAttribute),this.credentials=this.credentials||(this.collection?this.collection.credentials:null)||b.credentials,this.on("change",this.onChange,this),this.on("sync",this.onSync,this)},sync:function(a,d,e){e=e||{},e.credentials=e.credentials||this.credentials;var f=(e.store?e.store:null)||this.store,g=this,h=arguments;this.logon(e,function(){return f&&c.isFunction(f.sync)?f.sync.apply(g,h):b.sync.apply(g,h)})},onChange:function(a){var b=a.changedAttributes();if(c.isObject(b))for(var d in b)this.changedSinceSync[d]=b[d]},onSync:function(){this.changedSinceSync={}},getUrlRoot:function(){if(this.urlRoot)return c.isFunction(this.urlRoot)?this.urlRoot():this.urlRoot;if(this.collection)return this.collection.getUrlRoot();if(this.url){var a=c.isFunction(this.url)?this.url():this.url;return a&&this.id&&a.indexOf(this.id)>0?a.substr(0,a.indexOf(this.id)):a}},toJSON:function(a){a=a||{};var b=a.entity||this.entity;return e.isEntity(b)?b.fromAttributes(a.attrs||this.attributes):a.attrs||c.clone(this.attributes)},parse:function(a,b){b=b||{};var c=b.entity||this.entity;return e.isEntity(c)?c.toAttributes(a):a}}),e.Collection=b.Collection.extend({constructor:function(a){this.init(a),b.Collection.apply(this,arguments)}}),e.Collection.create=e.create,e.Collection.design=e.design,c.extend(e.Collection.prototype,e.Object,{_type:"M.Collection",isCollection:YES,model:e.Model,entity:null,options:null,logon:e.Security.logon,init:function(a){a=a||{},this.store=a.store||this.store||(this.model?this.model.prototype.store:null),this.entity=a.entity||this.entity||(this.model?this.model.prototype.entity:null),this.options=a.options||this.options;var b=this.entity||this.entityFromUrl(this.url);b&&(this.entity=e.Entity.from(b,{model:this.model,typeMapping:a.typeMapping})),this._updateUrl(),this.store&&c.isFunction(this.store.initCollection)&&this.store.initCollection(this,a)},entityFromUrl:function(a){if(a){var b=e.Request.getLocation(this.url).pathname.match(/([^\/]+)\/?$/);if(b&&b.length>1)return b[1]}},sort:function(a){c.isObject(a&&a.sort)&&(this.comparator=e.DataSelector.compileSort(a.sort)),b.Collection.prototype.sort.apply(this,arguments)},select:function(a){var b=a&&a.query?e.DataSelector.create(a.query):null,c=e.Collection.create(null,{model:this.model});return a&&a.sort&&(c.comparator=e.DataSelector.compileSort(a.sort)),this.each(function(a){(!b||b.matches(a.attributes))&&c.add(a)}),c},destroy:function(a){a=a||{};var b=a.success;if(this.length>0){a.success=function(){0===this.length&&b&&b()};for(var c;c=this.first();)this.sync("delete",c,a),this.remove(c)}else b&&b()},sync:function(a,d,e){e=e||{},e.credentials=e.credentials||this.credentials;var f=(e.store?e.store:null)||this.store,g=this,h=arguments;this.logon(e,function(){return f&&c.isFunction(f.sync)?f.sync.apply(g,h):b.sync.apply(g,h)})},save:function(){this.each(function(a){a.save()})},getUrlParams:function(a){a=a||this.getUrl();var b=a.match(/\?([^#]*)/),d={};return b&&b.length>1&&c.each(b[1].split("&"),function(a){var b=a.split("=");d[b[0]]=b[1]}),d},getUrl:function(){return(c.isFunction(this.url)?this.url():this.url)||""},getUrlRoot:function(){var a=this.getUrl();return a?a.indexOf("?")>=0?a.substr(0,a.indexOf("?")):a:""},applyFilter:function(a){this.trigger("filter",this.filter(a))},_updateUrl:function(){var a=this.getUrlParams();if(this.options&&(this.url=this.getUrlRoot(),this.options.query&&(a.query=encodeURIComponent(JSON.stringify(this.options.query))),this.options.fields&&(a.fields=encodeURIComponent(JSON.stringify(this.options.fields))),this.options.sort&&(a.sort=encodeURIComponent(JSON.stringify(this.options.sort))),!c.isEmpty(a))){this.url+="?";var b=[];for(var d in a)b.push(d+(a[d]?"="+a[d]:""));this.url+=b.join("&")}}}),e.DataSelector=e.Object.design({_type:"M.DataSelector",_selector:null,create:function(a){var b=this.design({_selector:null});return b.init(a),b},init:function(a){this._selector=this.compileSelector(a)},matches:function(a){return c.isFunction(this._selector)?this._selector(a):!1},hasOperators:function(a){var b;for(var c in a){var d="$"===c.substr(0,1);if(void 0===b)b=d;else if(b!==d)throw new Error("Inconsistent selector: "+a)}return!!b},compileSelector:function(a){if(c.isFunction(a))return function(b){return a.call(b)};if(this._selectorIsId(a))return function(b){var d=c.isFunction(b.getId)?b.getId():b._id||b.id;return e.Field.prototype.equals(d,a)};if(!a||"_id"in a&&!a._id)return function(){return!1};if(c.isBoolean(a)||c.isArray(a)||e.Field.prototype.isBinary(a))throw new Error("Invalid selector: "+a);return this.compileDocSelector(a)},compileDocSelector:function(a){var b=e.DataSelector,d=[];return c.each(a,function(a,e){if("$"===e.substr(0,1)){if(!c.has(b.LOGICAL_OPERATORS,e))throw new Error("Unrecognized logical operator: "+e);d.push(b.LOGICAL_OPERATORS[e](a))}else{var f=b._makeLookupFunction(e),g=b.compileValueSelector(a);d.push(function(a){var b=f(a);return c.any(b,g)})}}),function(a){var b=c.isFunction(a.getData)?a.getData():a;return c.all(d,function(a){return a(b)})}},compileValueSelector:function(a){var b=e.DataSelector;if(null===a)return function(a){return b._anyIfArray(a,function(a){return null===a})};if(!c.isObject(a))return function(c){return b._anyIfArray(c,function(b){return b===a})};if(c.isRegExp(a))return function(d){return c.isUndefined(d)?!1:b._anyIfArray(d,function(b){return a.test(b)})};if(c.isArray(a))return function(d){return c.isArray(d)?b._anyIfArrayPlus(d,function(c){return b._equal(a,c)}):!1};if(this.hasOperators(a)){var d=[];return c.each(a,function(e,f){if(!c.has(b.VALUE_OPERATORS,f))throw new Error("Unrecognized operator: "+f);d.push(b.VALUE_OPERATORS[f](e,a.$options))}),function(a){return c.all(d,function(b){return b(a)})}}return function(c){return b._anyIfArray(c,function(c){return b._equal(a,c)})}},_makeLookupFunction:function(a){var b,d,e,f=a.indexOf(".");if(-1===f)b=a;else{b=a.substr(0,f);var g=a.substr(f+1);d=this._makeLookupFunction(g),e=/^\d+(\.|$)/.test(g)}return function(a){if(null===a)return[void 0];var f=a[b];return d?c.isArray(f)&&0===f.length?[void 0]:((!c.isArray(f)||e)&&(f=[f]),Array.prototype.concat.apply([],c.map(f,d))):[f]}},_anyIfArray:function(a,b){return c.isArray(a)?c.any(a,b):b(a)},_anyIfArrayPlus:function(a,b){return b(a)?!0:c.isArray(a)&&c.any(a,b)},_selectorIsId:function(a){return c.isString(a)||c.isNumber(a)},_equal:function(a,b){return e.Field.prototype._equals(a,b,!0)},_cmp:function(a,b){return e.Field.prototype._cmp(a,b)},LOGICAL_OPERATORS:{$and:function(a){if(!c.isArray(a)||c.isEmpty(a))throw new Error("$and/$or/$nor must be nonempty array");var b=c.map(a,e.DataSelector.compileDocSelector);return function(a){return c.all(b,function(b){return b(a)})}},$or:function(a){if(!c.isArray(a)||c.isEmpty(a))throw new Error("$and/$or/$nor must be nonempty array");var b=c.map(a,e.DataSelector.compileDocSelector);return function(a){return c.any(b,function(b){return b(a)})}},$nor:function(a){if(!c.isArray(a)||c.isEmpty(a))throw new Error("$and/$or/$nor must be nonempty array");var b=c.map(a,e.DataSelector.compileDocSelector);return function(a){return c.all(b,function(b){return!b(a)})}},$where:function(a){if(!c.isFunction(a)){var b=a;a=function(){return b}}return function(b){return a.call(b)}}},VALUE_OPERATORS:{$in:function(a){if(!c.isArray(a))throw new Error("Argument to $in must be array");return function(b){return e.DataSelector._anyIfArrayPlus(b,function(b){return c.any(a,function(a){return e.DataSelector._equal(a,b)})})}},$all:function(a){if(!c.isArray(a))throw new Error("Argument to $all must be array");return function(b){return c.isArray(b)?c.all(a,function(a){return c.any(b,function(b){return e.DataSelector._equal(a,b)})}):!1}},$lt:function(a){return function(b){return e.DataSelector._anyIfArray(b,function(b){return e.DataSelector._cmp(b,a)<0})}},$lte:function(a){return function(b){return e.DataSelector._anyIfArray(b,function(b){return e.DataSelector._cmp(b,a)<=0})}},$gt:function(a){return function(b){return e.DataSelector._anyIfArray(b,function(b){return e.DataSelector._cmp(b,a)>0})}},$gte:function(a){return function(b){return e.DataSelector._anyIfArray(b,function(b){return e.DataSelector._cmp(b,a)>=0})}},$ne:function(a){return function(b){return!e.DataSelector._anyIfArrayPlus(b,function(b){return e.DataSelector._equal(b,a)})}},$nin:function(a){if(!c.isArray(a))throw new Error("Argument to $nin must be array");var b=this.VALUE_OPERATORS.$in(a);return function(a){return void 0===a?!0:!b(a)}},$exists:function(a){return function(b){return a===(void 0!==b)}},$mod:function(a){var b=a[0],c=a[1];return function(a){return e.DataSelector._anyIfArray(a,function(a){return a%b===c})}},$size:function(a){return function(b){return c.isArray(b)&&a===b.length}},$type:function(a){return function(b){return c.isUndefined(b)?!1:e.DataSelector._anyIfArray(b,function(b){return e.Field.prototype.detectType(b)===a})}},$regex:function(a,b){if(c.isUndefined(b)){if(/[^gim]/.test(b))throw new Error("Only the i, m, and g regexp options are supported");var d=c.isRegExp(a)?a.source:a;a=new RegExp(d,b)}else c.isRegExp(a)||(a=new RegExp(a));return function(b){return c.isUndefined(b)?!1:e.DataSelector._anyIfArray(b,function(b){return a.test(b)})}},$options:function(){return function(){return!0}},$elemMatch:function(a){var b=e.DataSelector.compileDocSelector(a);return function(a){return c.isArray(a)?c.any(a,function(a){return b(a)}):!1}},$not:function(a){var b=e.DataSelector.compileDocSelector(a);return function(a){return!b(a)}}},compileSort:function(a){var b=[];if(c.isArray(a))for(var d=0;d<a.length;d++)b.push("string"==typeof a[d]?{lookup:this._makeLookupFunction(a[d]),ascending:!0}:{lookup:this._makeLookupFunction(a[d][0]),ascending:"desc"!==a[d][1]});else{if("object"!=typeof a)throw new Error("Bad sort specification: ",JSON.stringify(a));for(var f in a)b.push({lookup:this._makeLookupFunction(f),ascending:a[f]>=0})}if(0===b.length)return function(){return 0};var g=function(a,b){var d,f=!0;return c.each(a,function(a){c.isArray(a)||(a=[a]),c.isArray(a)&&0===a.length&&(a=[void 0]),c.each(a,function(a){if(f)d=a,f=!1;else{var c=e.DataSelector._cmp(d,a);(b&&c>0||!b&&0>c)&&(d=a)}})}),d};return function(a,c){a=a.attributes?a.attributes:a,c=c.attributes?c.attributes:c;for(var d=0;d<b.length;++d){var f=b[d],h=g(f.lookup(a),f.ascending),i=g(f.lookup(c),f.ascending),j=e.DataSelector._cmp(h,i);if(0!==j)return f.ascending?j:-j}return 0}}}),e.SqlSelector=e.DataSelector.design({_type:"M.SqlSelector",_selector:null,_query:null,_entity:null,create:function(a,b){var c=this.extend({_entity:b,_selector:null,_query:null});return c.init(a),c},init:function(a){this._selector=this.compileSelector(a),this._query=this.buildSqlQuery(a)},buildStatement:function(){return this._query},buildSqlQuery:function(a){if(a instanceof Function)return"";if(c.isString(a))return a;if(!a||"_id"in a&&!a._id)return"1=2";if(c.isBoolean(a)||c.isArray(a)||e.DataField.isBinary(a))throw new Error("Invalid selector: "+a);return this.buildSqlWhere(a)()},buildSqlWhere:function(a){var b=this,d=[];return c.each(a,function(a,e){if("$"===e.substr(0,1))d.push(b.buildLogicalOperator(e,a));else{var f=b.buildLookup(e),g=b.buildValueSelector(a);c.isFunction(g)&&d.push(function(){return g(f)})}}),function(){var a="";return c.each(d,function(d){c.isFunction(d)&&(a+=d.call(b))}),a}},buildValueSelector:function(a){var b=this;if(null===a)return function(a){return a+" IS NULL"};if(!c.isObject(a))return function(c){return c+" = "+b.buildValue(a)};if(c.isRegExp(a)){var d=a.toString(),e=d.match(/\/[\^]?([^^.*$'+()]*)[\$]?\//);if(e&&e.length>1){var f=d.indexOf("/^")<0?"%":"",g=d.indexOf("$/")<0?"%":"";return function(a){return a+' LIKE "'+f+e[1]+g+'"'}}return null}if(c.isArray(a))return null;if(this.hasOperators(a)){var h=[];return c.each(a,function(a,d){if(!c.has(b.VALUE_OPERATORS,d))throw new Error("Unrecognized operator: "+d);h.push(b.VALUE_OPERATORS[d](a,b))}),function(a){return b.LOGICAL_OPERATORS.$and(h,a)}}return function(c){return c+" = "+b.buildValue(a)}},buildLookup:function(a){var b=this._entity?this._entity.getField(a):null;return a=b&&b.name?b.name:a,'"'+a+'"'},buildValue:function(a){return c.isString(a)?'"'+a.replace(/"/g,'""')+'"':a},buildLogicalOperator:function(a,b){if(c.has(this.LOGICAL_OPERATORS,a)){if(!c.isArray(b)||c.isEmpty(b))throw new Error("$and/$or/$nor must be nonempty array");var d=c.map(b,this.buildSqlWhere,this),e=this;return function(b){return e.LOGICAL_OPERATORS[a](d,b)}}throw new Error("Unrecognized logical operator: "+a)},LOGICAL_OPERATORS:{$and:function(a,b){var d="",e=0;return c.each(a,function(a){var c=null!==a?a(b):"";c&&(e++,d+=d?" AND "+c:c)}),e>1?"( "+d+" )":d},$or:function(a,b){var d="",e=!1;return c.each(a,function(a){var c=null!==a?a(b):"";e|=!c,d+=d&&c?" OR "+c:c}),e?"":"( "+d+" )"},$nor:function(a,b){var d="",e=!1;return c.each(a,function(a){var c=null!==a?a(b):"";e|=!c,d+=d&&c?" OR "+c:c}),e?"":"NOT ( "+d+" )"}},VALUE_OPERATORS:{$in:function(){return null},$all:function(){return null},$lt:function(a,b){return function(c){return c+" < "+b.buildValue(a)}},$lte:function(a,b){return function(c){return c+" <= "+b.buildValue(a)}},$gt:function(a,b){return function(c){return c+" > "+b.buildValue(a)}},$gte:function(a,b){return function(c){return c+"">""+b.buildValue(a)}},$ne:function(a,b){return function(c){return c+" <> "+b.buildValue(a)}},$nin:function(){return null},$exists:function(){return function(a){return a+" IS NOT NULL"}},$mod:function(){return null},$size:function(){return null},$type:function(){return null},$regex:function(){return null},$options:function(){return null},$elemMatch:function(){return null},$not:function(a,b){var c=b.buildSqlWhere(a);return function(a){return"NOT ("+c(a)+")"}}}}),e.Store=function(){this.initialize.apply(this,arguments)},e.Store.extend=e.extend,e.Store.create=e.create,e.Store.design=e.design,c.extend(e.Store.prototype,b.Events,e.Object,{_type:"M.Store",entities:null,options:null,name:"",typeMapping:function(){var a={};return a[e.CONST.TYPE.OBJECTID]=e.CONST.TYPE.STRING,a[e.CONST.TYPE.DATE]=e.CONST.TYPE.STRING,a[e.CONST.TYPE.BINARY]=e.CONST.TYPE.TEXT,a}(),initialize:function(a){a=a||{},this.options=this.options||{},this.options.name=this.name,this.options.typeMapping=this.typeMapping,this.options.entities=this.entities,c.extend(this.options,a||{}),this._setEntities(a.entities||{})},_setEntities:function(a){this.entities={};for(var b in a){var c=e.Entity.from(a[b],{store:this,typeMapping:this.options.typeMapping});c.name=c.name||b;var d=c.collection||e.Collection.extend({model:e.Model.extend({})}),f=d.prototype.model;d.prototype.entity=f.prototype.entity=b,d.prototype.store=f.prototype.store=this,c.idAttribute=c.idAttribute||f.prototype.idAttribute,this.entities[b]=c}},getEntity:function(a){if(a){var b=a.entity||a,d=c.isString(b)?b:b.name;if(d)return this.entities[d]||(b&&b.name?b:{name:d})}},getCollection:function(a){return c.isString(a)&&(a=this.entities[a]),a&&a.collection?e.Collection.prototype.isPrototypeOf(a.collection)?a.collection:new a.collection:void 0},createModel:function(a,b){if(c.isString(a)&&(a=this.entities[a]),a&&a.collection){var d=a.collection.model||a.collection.prototype.model;if(d)return new d(b)}},getArray:function(a){return c.isArray(a)?a:e.isCollection(a)?a.models:c.isObject(a)?[a]:[]},getDataArray:function(a){var d=[];if(c.isArray(a)||b.Collection.prototype.isPrototypeOf(a))c.each(a,function(a){var b=this.getAttributes(a);b&&d.push(b)});else{var e=this.getAttributes(a);e&&d.push(this.getAttributes(e))}return d},getAttributes:function(a){return b.Model.prototype.isPrototypeOf(a)?a.attributes:c.isObject(a)?a:null},initModel:function(){},initCollection:function(){},initEntity:function(){},sync:function(){},fetch:function(a,b){if(!a||a.models||a.attributes||b||(b=a),a&&(a.models||a.attributes)||!b||!b.entity||(a=this.getCollection(b.entity)),a&&a.fetch){var d=c.extend({},b||{},{store:this});a.fetch(d)}},create:function(a,b,d){if(!a||a.models||d||(b=a,d=b),a&&a.models||!d||!d.entity||(a=this.getCollection(d.entity)),a&&a.create){var e=c.extend({},d||{},{store:this});a.create(b,e)}},save:function(a,b,d){if(!a||a.attributes||d||(b=a,d=b),a&&a.attributes||!d||!d.entity||(a=this.createModel(d.entity)),a&&a.save){var e=c.extend({},d||{},{store:this});a.save(b,e)}},destroy:function(a,b){if(a&&a.destroy){var d=c.extend({},b||{},{store:this});a.destroy(d)}},_checkEntity:function(a,b){if(!e.isEntity(b)){var c="No valid entity passed.";return e.Logger.error(e.CONST.ERROR.VALIDATION_PRESENCE,c),this.handleCallback(a.error,c),this.handleCallback(a.finish,c),!1}return!0},_checkData:function(a,b){if(!(c.isArray(b)&&0!==b.length||c.isObject(b))){var d="No data passed.";return e.Logger.error(e.CONST.ERROR.VALIDATION_PRESENCE,d),this.handleCallback(a.error,d),this.handleCallback(a.finish,d),!1}return!0},handleSuccess:function(a){var b=Array.prototype.slice.call(arguments,1);a.success&&this.handleCallback.apply(this,[a.success].concat(b)),a.finish&&this.handleCallback.apply(this,[a.finish].concat(b))},handleError:function(a){var b=Array.prototype.slice.call(arguments,1);
  a.error&&this.handleCallback.apply(this,[a.error].concat(b)),a.finish&&this.handleCallback.apply(this,[a.finish].concat(b))},CONST:{ERROR_NO_ENTITY:"No valid entity specified",ERROR_LOAD_DATA:"Error while loading data from store",ERROR_SAVE_DATA:"Error while saving data to the store",ERROR_LOAD_IDS:"Error while loading ids from store",ERROR_SAVE_IDS:"Error while saving ids to the store"}}),e.LocalStorageStore=e.Store.extend({_type:"M.LocalStorageStore",ids:{},sync:function(a,b,d){d=d||{};var f,g=d.store||this.store,h=g.getEntity(b.entity||d.entity||this.entity);if(g&&h&&b){var i=b.id||("create"===a?(new e.ObjectID).toHexString():null);switch(f=d.attrs||b.toJSON(d),a){case"patch":case"update":case"create":"create"!==a&&(f=c.extend(g._getItem(h,i)||{},f)),b.id!==i&&b.idAttribute&&(f[b.idAttribute]=i),g._setItem(h,i,f);break;case"delete":g._removeItem(h,i);break;case"read":if(i)f=g._getItem(h,i);else{f=[];var j=g._getItemIds(h);for(i in j){var k=g._getItem(h,i);k&&f.push(k)}}break;default:return}}f?g.handleSuccess(d,f):g.handleError(d,e.Store.CONST.ERROR_NO_ENTITY)},drop:function(a){var b=this.getEntity(a);if(b&&b.name){for(var c=this._findAllKeys(b),d=0;d<c.length;d++)localStorage.removeItem(c[d]);localStorage.removeItem("__ids__"+b.name),this.handleSuccess(a)}else this.handleError(a,e.Store.CONST.ERROR_NO_ENTITY)},_getKey:function(a,b){return"_"+a.name+"_"+b},_getItem:function(a,b){var c;if(a&&b)try{c=JSON.parse(localStorage.getItem(this._getKey(a,b))),c?a.setId(c,b):this._delItemId(b)}catch(d){e.Logger.error(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,e.Store.CONST.ERROR_LOAD_DATA,d)}return c},_setItem:function(a,b,c){if(a&&b&&c)try{localStorage.setItem(this._getKey(a,b),JSON.stringify(c)),this._addItemId(a,b)}catch(d){e.Logger.error(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,e.Store.CONST.ERROR_SAVE_DATA,d)}},_removeItem:function(a,b){a&&b&&(localStorage.removeItem(this._getKey(a,b)),this._delItemId(a,b))},_addItemId:function(a,b){var c=this._getItemIds(a);b in c||(c[b]="",this._saveItemIds(a,c))},_delItemId:function(a,b){var c=this._getItemIds(a);b in c&&(delete c[b],this._saveItemIds(a,c))},_findAllKeys:function(a){var b=[],c=this._getKey(a,"");if(c)for(var d,e=localStorage.length,f=0;e>f;f++)d=localStorage.key(f),d&&d===c&&b.push(d);return b},_getItemIds:function(a){try{var b="__ids__"+a.name;return this.ids[a.name]||(this.ids[a.name]=JSON.parse(localStorage.getItem(b))||{}),this.ids[a.name]}catch(c){e.Logger.error(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,e.Store.CONST.ERROR_LOAD_IDS,c)}},_saveItemIds:function(a,b){try{var c="__ids__"+a.name;localStorage.setItem(c,JSON.stringify(b))}catch(d){e.Logger.error(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,e.Store.CONST.ERROR_SAVE_IDS,d)}}}),e.WebSqlStore=e.Store.extend({_type:"M.WebSqlStore",_selector:null,options:null,name:"themproject",size:1048576,version:"1.0",db:null,dataField:{name:"data",type:"text",required:!0},idField:{name:"id",type:"string",required:!0},typeMapping:function(){var a={};return a[e.CONST.TYPE.OBJECTID]=e.CONST.TYPE.STRING,a[e.CONST.TYPE.DATE]=e.CONST.TYPE.STRING,a[e.CONST.TYPE.OBJECT]=e.CONST.TYPE.TEXT,a[e.CONST.TYPE.ARRAY]=e.CONST.TYPE.TEXT,a[e.CONST.TYPE.BINARY]=e.CONST.TYPE.TEXT,a}(),sqlTypeMapping:function(){var a={};return a[e.CONST.TYPE.STRING]="varchar(255)",a[e.CONST.TYPE.TEXT]="text",a[e.CONST.TYPE.OBJECT]="text",a[e.CONST.TYPE.ARRAY]="text",a[e.CONST.TYPE.FLOAT]="float",a[e.CONST.TYPE.INTEGER]="integer",a[e.CONST.TYPE.DATE]="varchar(255)",a[e.CONST.TYPE.BOOLEAN]="boolean",a}(),initialize:function(a){e.Store.prototype.initialize.apply(this,arguments),this.options=this.options||{},this.options.name=this.name,this.options.size=this.size,this.options.version=this.version,this.options.typeMapping=this.typeMapping,this.options.sqlTypeMapping=this.sqlTypeMapping,c.extend(this.options,a||{}),this._openDb({error:function(a){e.Logger.error(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,a)}})},sync:function(a,b,c){var d=c.store||this.store,f=e.isCollection(b)?b.models:[b];switch(c.entity=c.entity||this.entity,a){case"create":d._checkTable(c,function(){d._insertOrReplace(f,c)});break;case"update":case"patch":d._checkTable(c,function(){d._insertOrReplace(f,c)});break;case"delete":d._delete(f,c);break;case"read":d._select(this,c)}},select:function(a){this._select(null,a)},drop:function(a){this._dropTable(a)},createTable:function(a){this._createTable(a)},execute:function(a){this._executeSql(a)},_openDb:function(a){var b,c;if(!this.db)try{if(window.openDatabase){if(this.db=window.openDatabase(this.options.name,"","",this.options.size),this.entities)for(var d in this.entities)this._createTable({entity:this.entities[d]})}else b="Your browser does not support WebSQL databases."}catch(e){c=e}this.db?this.options.version&&this.db.version!==this.options.version?this._updateDb(a):this.handleSuccess(a,this.db):2===c||"2"===c?this._updateDb(a):(!b&&c&&(b=c),this.handleSuccess(a,b))},_updateDb:function(a){var b,d,f=this;try{var g=window.openDatabase(this.options.name,"","",this.options.size);try{var h=this._sqlUpdateDatabase(g.version,this.options.version);g.changeVersion(g.version,this.options.version,function(a){c.each(h,function(b){e.Logger.log(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,"SQL-Statement: "+b),d=b,a.executeSql(b)})},function(b){f.handleError(a,b,d)},function(){f.handleSuccess(a)})}catch(i){b=i.message,e.Logger.error(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,"changeversion failed, DB-Version: "+g.version)}}catch(i){b=i.message}b&&this.handleError(a,b)},_sqlUpdateDatabase:function(){var a=[];if(this.entities)for(var b in this.entities){var c=this.entities[b];a.push(this._sqlDropTable(c.name)),a.push(this._sqlCreateTable(c))}return a},_sqlDropTable:function(a){return"DROP TABLE IF EXISTS '"+a+"'"},_isAutoincrementKey:function(a,b){if(a&&b){var c=this.getField(a,b);return c&&c.type===e.CONST.TYPE.INTEGER}},_sqlPrimaryKey:function(a,b){return b&&1===b.length?this._isAutoincrementKey(a,b[0])?b[0]+" INTEGER PRIMARY KEY ASC AUTOINCREMENT UNIQUE":b[0]+" PRIMARY KEY ASC UNIQUE":""},_sqlConstraint:function(a,b){return b&&b.length>1?"PRIMARY KEY ("+b.join(",")+") ON CONFLICT REPLACE":""},_sqlCreateTable:function(a){var b=this,d=a.getKeys(),e=1===d.length?this._sqlPrimaryKey(a,d):"",f=d.length>1?this._sqlConstraint(a,d):a.constraint||"",g="",h=this.getFields(a);c.each(h,function(a){if(!e||a.name!==d[0]){var c=b._dbAttribute(a);c&&(g+=(g?", ":"")+c)}}),g||(g=this._dbAttribute(this.dataField));var i="CREATE TABLE IF NOT EXISTS '"+a.name+"' (";return i+=e?e+", ":"",i+=g,i+=f?", "+f:"",i+=");"},_sqlDelete:function(a,b){var c="DELETE FROM '"+b.name+"'",d=this._sqlWhere(a,b)||this._sqlWhereFromData(a,b);return d&&(c+=" WHERE "+d),c+=a.and?" AND "+a.and:""},_sqlWhere:function(a,b){this._selector=null;var d="";return c.isString(a.where)?d=a.where:c.isObject(a.where)&&(this._selector=e.SqlSelector.create(a.where,b),d=this._selector.buildStatement()),d},_sqlWhereFromData:function(a,b){var d=this,e=[];if(a&&a.models&&b&&b.idAttribute){var f,g=b.idAttribute,h=this.getField(b,g);if(c.each(a.models,function(a){f=a.id,c.isUndefined(f)||e.push(d._sqlValue(f,h))}),e.length>0)return g+" IN ("+e.join(",")+")"}return""},_sqlSelect:function(a,b){var c="SELECT ";a.fields?a.fields.length>1?c+=a.fields.join(", "):1===a.fields.length&&(c+=a.fields[0]):c+="*",c+=" FROM '"+b.name+"'",a.join&&(c+=" JOIN "+a.join),a.leftJoin&&(c+=" LEFT JOIN "+a.leftJoin);var d=this._sqlWhere(a,b)||this._sqlWhereFromData(a,b);return d&&(c+=" WHERE "+d),a.order&&(c+=" ORDER BY "+a.order),a.limit&&(c+=" LIMIT "+a.limit),a.offset&&(c+=" OFFSET "+a.offset),c},_sqlValue:function(a,b){var c=b&&b.type?b.type:e.Field.prototype.detectType(a);return c===e.CONST.TYPE.INTEGER||c===e.CONST.TYPE.FLOAT?a:c===e.CONST.TYPE.BOOLEAN?a?"1":"0":c===e.CONST.TYPE.NULL?"NULL":(a=e.Field.prototype.transform(a,e.CONST.TYPE.STRING),a=a.replace(/"/g,'""'),'"'+a+'"')},_dbAttribute:function(a){if(a&&a.name){var b=this.options.sqlTypeMapping[a.type],c=a.required?" NOT NULL":"";if(b)return a.name+" "+b.toUpperCase()+c}},_dropTable:function(a){var b=this.getEntity(a);if(b.db=null,this._checkDb(a)&&b){var c=this._sqlDropTable(b.name);this._executeTransaction(a,[c])}},_createTable:function(a){var b=this.getEntity(a);if(b.db=this.db,this._checkDb(a)&&this._checkEntity(a,b)){var c=this._sqlCreateTable(b);this._executeTransaction(a,[c])}},_checkTable:function(a,b){var c=this.getEntity(a);c&&!c.db?this._createTable({success:function(){b()},error:function(b){this.handleError(a,b)},entity:c}):b()},_insertOrReplace:function(a,b){var d=this.getEntity(b);if(this._checkDb(b)&&this._checkEntity(b,d)&&this._checkData(b,a)){for(var f=this._isAutoincrementKey(d,d.getKey()),g=[],h="INSERT OR REPLACE INTO '"+d.name+"' (",i=0;i<a.length;i++){var j=a[i],k="";f||j.id||!j.idAttribute||j.set(j.idAttribute,(new e.ObjectID).toHexString());var l,m,n=b.attrs||j.toJSON();if(c.isEmpty(d.fields)?(l=[j.id,JSON.stringify(n)],m=["id","data"]):(l=c.values(n),m=c.keys(n)),l.length>0){var o=new Array(l.length).join("?,")+"?",p="'"+m.join("','")+"'";k+=h+p+") VALUES ("+o+");",g.push({statement:k,arguments:l})}}this._executeTransaction(b,g)}},_select:function(a,b){var d=this.getEntity(b);if(this._checkDb(b)&&this._checkEntity(b,d)){var f,g=e.isCollection(a);g?a=[]:b.models=[a];var h=this._sqlSelect(b,d),i=this;this.db.readTransaction(function(b){var j=h.statement||h,k=h.arguments;f=j,e.Logger.log(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,"SQL-Statement: "+j),k&&e.Logger.log(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,"    Arguments: "+JSON.stringify(k)),b.executeSql(j,k,function(b,e){for(var f=e.rows.length,h=0;f>h;h++){var j,k=e.rows.item(h);if(c.isEmpty(d.fields)&&i._hasDefaultFields(k))try{j=JSON.parse(k.data)}catch(l){}else j=k;if(j&&(!i._selector||i._selector.matches(j))){if(!g){a=j;break}a.push(j)}}},function(){})},function(a){e.Logger.error(e.CONST.ERROR.WEBSQL_SYNTAX,"WebSql Syntax Error: "+a.message),i.handleError(b,a.message,f)},function(){i.handleSuccess(b,a)})}},_delete:function(a,b){var c=this.getEntity(b);if(this._checkDb(b)&&this._checkEntity(b,c)){b.models=a;var d=this._sqlDelete(b,c);this._executeTransaction(b,[d])}},_executeSql:function(a){a.sql&&this._executeTransaction(a,[a.sql])},_executeTransaction:function(a,b){var d,f;if(this._checkDb(a)){var g=this;try{this.db.transaction(function(a){c.each(b,function(b){var c=b.statement||b,d=b.arguments;f=c,e.Logger.log(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,"SQL-Statement: "+c),d&&e.Logger.log(e.CONST.LOGGER.TAG_FRAMEWORK_DATA,"    Arguments: "+JSON.stringify(d)),a.executeSql(c,d)})},function(b){e.Logger.error(e.CONST.ERROR.WEBSQL_SYNTAX,b.message),g.handleError(a,b.message,f)},function(){g.handleSuccess(a)})}catch(h){e.Logger.error(e.CONST.ERROR.WEBSQL_UNKNOWN,h.message)}}d&&this.handleCallback(a.error,d,f)},_hasDefaultFields:function(a){return c.every(c.keys(a),function(a){return a===this.idField.name||a===this.dataField.name},this)},_checkDb:function(a){if(!this.db){var b="db handler not initialized.";return e.Logger.error(e.CONST.ERROR.WEBSQL_NO_DBHANDLER,b),this.handleError(a,b),!1}return!0},getFields:function(a){if(c.isEmpty(a.fields)){var b={};b.data=this.dataField;var d=a.idAttribute||"id";return b[d]=this.idField,b}return a.fields},getField:function(a,b){return this.getFields(a)[b]}}),e.BikiniStore=e.Store.extend({_type:"M.BikiniStore",_selector:null,endpoints:{},options:null,localStore:e.WebSqlStore,useLocalStore:YES,useSocketNotify:YES,useOfflineChanges:YES,isConnected:NO,typeMapping:{binary:"text",date:"string"},initialize:function(a){e.Store.prototype.initialize.apply(this,arguments),this.options=this.options||{},this.options.useLocalStore=this.useLocalStore,this.options.useSocketNotify=this.useSocketNotify,this.options.useOfflineChanges=this.useOfflineChanges,this.options.socketPath=this.socketPath,this.options.localStore=this.localStore,this.options.typeMapping=this.typeMapping,this.options.useSocketNotify&&"object"!=typeof io&&(console.log("Socket.IO not present !!"),this.options.useSocketNotify=NO),c.extend(this.options,a||{})},initModel:function(){},initCollection:function(a){var b=a.getUrlRoot(),c=this.getEntity(a.entity);if(b&&c){var d=c.name,f=this._hashCode(b),g=c.credentials||a.credentials,h=g&&g.username?g.username:"",i=d+h+f;a.channel=i;var j=this,k=this.endpoints[f];if(!k){var l=e.Request.getLocation(b);k={},k.baseUrl=b,k.readUrl=a.getUrl(),k.host=l.protocol+"//"+l.host,k.path=l.pathname,k.entity=c,k.channel=i,k.credentials=g,k.socketPath=this.options.socketPath,k.localStore=this.createLocalStore(k),k.messages=this.createMsgCollection(k),k.socket=this.createSocket(k),k.info=this.fetchServerInfo(k),j.endpoints[f]=k}a.endpoint=k,a.listenTo(this,k.channel,this.onMessage,a)}},getEndpoint:function(a){if(a){var b=this._hashCode(a);return this.endpoints[b]}},createLocalStore:function(a,b){if(this.options.useLocalStore&&a){var c={};return c[a.entity.name]={name:a.channel,idAttribute:b},this.options.localStore.create({entities:c})}},createMsgCollection:function(a){if(this.options.useOfflineChanges&&a){var b=e.Collection.design({url:a.url,entity:"msg-"+a.channel,store:this.options.localStore.create()}),c=this;return b.fetch({success:function(){c.sendMessages(a)}}),b}},createSocket:function(a,b){if(this.options.useSocketNotify&&a.socketPath&&a){var c=this,d=a.host,e=a.path;e=a.socketPath||e+("/"===e.charAt(e.length-1)?"":"/")+"live";var f=e&&0===e.indexOf("/")?e.substr(1):e;return a.socket=io.connect(d,{resource:f}),a.socket.on("connect",function(){c._bindChannel(a,b),c.onConnect(a)}),a.socket.on("disconnect",function(){console.log("socket.io: disconnect"),c.onDisconnect(a)}),a.socket}},_bindChannel:function(a,b){var c=this;if(a&&a.socket){var d=a.channel,e=a.socket,f=this.getLastMessageTime(d);b=b||a.entity.name,e.on(d,function(a){a&&(c.trigger(d,a),c.options.useLocalStore&&c.setLastMessageTime(d,a.time))}),e.emit("bind",{entity:b,channel:d,time:f})}},getLastMessageTime:function(a){return localStorage.getItem("__"+a+"last_msg_time")||0},setLastMessageTime:function(a,b){b&&localStorage.setItem("__"+a+"last_msg_time",b)},_hashCode:function(a){var b,c=0;if(0===a.length)return c;for(var d=0,e=a.length;e>d;d++)b=a.charCodeAt(d),c=(c<<5)-c+b,c|=0;return c},onConnect:function(a){this.isConnected=YES,this.fetchChanges(a),this.sendMessages(a)},onDisconnect:function(a){this.isConnected=NO,a.socket&&a.socket.socket&&a.socket.socket.onDisconnect()},onMessage:function(a){if(a&&a.method){var b=this.endpoint?this.endpoint.localStore:null,c={store:b,entity:this.entity,merge:YES,fromMessage:YES,parse:YES},d=a.data;switch(a.method){case"patch":case"update":case"create":c.patch="patch"===a.method;var e=a.id?this.get(a.id):null;e?e.save(d,c):this.create(d,c);break;case"delete":if(a.id)if("all"===a.id){for(;e=this.first();)b&&b.sync.apply(this,["delete",e,{store:b,fromMessage:YES}]),this.remove(e);this.store.setLastMessageTime(this.endpoint.channel,"")}else{var f=this.get(a.id);f&&f.destroy(c)}}}},sync:function(a,b,c){var d=c.store||this.store;if(c.fromMessage)return d.handleCallback(c.success);var f=d.getEndpoint(this.getUrlRoot());if(d&&f){var g=this.channel;e.isModel(b)&&!b.id&&b.set(b.idAttribute,(new e.ObjectID).toHexString());var h=d.getLastMessageTime(g);"read"===a&&f.localStore&&h?"read"===a&&d.fetchChanges(f):d.addMessage(a,b,f.localStore?{}:c,f),f.localStore&&(c.store=f.localStore,f.localStore.sync.apply(this,arguments))}},addMessage:function(a,b,d,e){var f=this;if(a&&b){var g=b.changedSinceSync,h=null,i=YES;switch(a){case"update":case"create":h=d.attrs||b.toJSON();break;case"patch":if(c.isEmpty(g))return;h=b.toJSON({attrs:g});break;case"delete":break;default:i=NO}var j={_id:b.id,id:b.id,method:a,data:h},k=function(a,c){f.emitMessage(a,c,d,b)};i?this.storeMessage(e,j,k):k(e,j)}},emitMessage:function(a,b,d,f){var g=a.channel,h=this,i=e.isModel(f)||"read"!==b.method?a.baseUrl:a.readUrl;b.id&&"create"!==b.method&&(i+="/"+b.id),f.sync.apply(f,[b.method,f,{url:i,error:function(c,e){!c.responseText&&h.options.useOfflineChanges?(h.onDisconnect(a),h.handleCallback(d.success,b.data)):h.removeMessage(a,b,function(){h.handleCallback(d.error,e)})},success:function(e){h.isConnected||h.onConnect(a),h.removeMessage(a,b,function(a,b){if(d.success){var f=e;h.handleCallback(d.success,f)}else if("read"===b.method)for(var i=c.isArray(e)?e:[e],j=0;j<i.length;j++)e=i[j],e&&h.trigger(g,{id:e._id,method:"update",data:e});else h.trigger(g,b)})},store:{}}])},fetchChanges:function(a){var b=this,c=a?a.channel:"",d=b.getLastMessageTime(c);if(a&&a.baseUrl&&c&&d){var f=new e.Collection({});f.fetch({url:a.baseUrl+"/changes/"+d,success:function(){f.each(function(a){a.time&&a.method&&(b.options.useLocalStore&&b.setLastMessageTime(c,a.time),b.trigger(c,a))})},credentials:a.credentials})}},fetchServerInfo:function(a){var b=this;if(a&&a.baseUrl){var c=new e.Model,d=b.getLastMessageTime(a.channel);c.fetch({url:a.baseUrl+"/info",success:function(){if(!d&&c.get("time")&&b.setLastMessageTime(a.channel,c.get("time")),!a.socketPath&&c.get("socketPath")){a.socketPath=c.get("socketPath");var e=c.get("entity")||a.entity.name;b.options.useSocketNotify&&b.createSocket(a,e)}},credentials:a.credentials})}},sendMessages:function(a){if(a&&a.messages){var b=this;a.messages.each(function(c){var d;try{d=JSON.parse(c.get("msg"))}catch(e){}var f=c.get("channel");if(d&&f){var g=b.createModel({collection:a.messages},d.data);b.emitMessage(a,d,{},g)}else c.destroy()})}},mergeMessages:function(a){return a},storeMessage:function(a,b,d){if(a&&a.messages&&b){var e=a.channel,f=a.messages.get(b._id);if(f){var g=JSON.parse(f.get("msg"));f.save({msg:JSON.stringify(c.extend(g,b))})}else a.messages.create({_id:b._id,id:b.id,msg:JSON.stringify(b),channel:e})}d(a,b)},removeMessage:function(a,b,c){if(a&&a.messages){var d=a.messages.get(b._id);d&&d.destroy()}c(a,b)},clear:function(a){if(a){var b=this.getEndpoint(a.getUrlRoot());b&&(b.localStore&&b.localStore.destroy(),b.messages&&b.messages.destroy(),a.reset(),this.setLastMessageTime(b.channel,""))}}}),e.Interface=e.Object.design({_type:"M.Interface",isMInterface:YES,getInterface:function(){return void 0}}),e.ViewEnableState=e.Interface.design({_type:"M.ViewEnableState",_isEnabled:YES,disable:function(){return this._isEnabled=NO,this.$el.addClass("disabled").removeClass("enabled"),this._disableEvents(),this},enable:function(){return this._isEnabled=YES,this.$el.addClass("enabled").removeClass("disabled"),this._enableEvents(),this},getInterface:function(){return{disable:this.disable,enable:this.enable}}}),e.ActiveState=e.Interface.design({_type:"M.ActiveState",_registerActiveState:function(a){if(!a._isInButtonGroup){var b=a._internalEvents||{};b.touchstart=b.touchstart||[],b.touchend=b.touchend||[],b.touchcancel=b.touchcancel||[],b.mousedown=b.touchstart||[],b.mouseup=b.touchend||[],b.touchmove=b.touchmove||[],b.touchleave=b.touchleave||[],b.touchstart=c.isArray(b.touchstart)?b.touchstart:[b.touchstart],b.touchend=c.isArray(b.touchend)?b.touchend:[b.touchend],b.touchcancel=c.isArray(b.touchcancel)?b.touchcancel:[b.touchcancel],b.mousedown=c.isArray(b.mousedown)?b.mousedown:[b.mousedown],b.mouseup=c.isArray(b.mouseup)?b.mouseup:[b.mouseup],b.touchmove=c.isArray(b.touchmove)?b.touchmove:[b.touchmove],b.touchleave=c.isArray(b.touchleave)?b.touchleave:[b.touchleave];var d=function(a,b){b._hammertime.enabled!==NO&&b.$el.addClass("active")},e=function(a,b){b.$el.removeClass("active")},f=function(a,b){b.$el.removeClass("active")};b.touchstart.push(d),b.touchend.push(e),b.touchcancel.push(f),b.mousedown.push(d),b.mouseup.push(e),b.touchmove.push(e),b.touchleave.push(e),a._internalEvents=b}},getInterface:function(a){return{registerActiveState:this._registerActiveState(a)}}}),e.AddCssClass=e.Interface.design({_type:"M.AddCssClass",_addCssClass:function(a){a.classes&&(a._internalCssClasses+=" "+a.classes)},getInterface:function(a){return{registerAddCssClassInterface:this._addCssClass(a)}}}),e.Templates={"default":{"accordion.ejs":"<ul><%= value %></ul>","accordionitem.ejs":"<ul><%= value %></ul>","button.ejs":'<div class="button"><% if(icon) { %> <i class="fa <%= icon %>"></i> <% } %> <div data-binding="value"<% if(value) {  } %>><%= value %></div></div>',"buttongroup.ejs":'<div class="clearfix" data-childviews="buttons"></div>',"checkboxlist.ejs":'<div><%= label %><div data-childviews="checkbox-options"></div></div>',"checkboxoption.ejs":'<label><input type="checkbox" name="<%= name %>" value="<%= value %>"><i class="needsclick fa"></i> <%= label %></label>',"debug.ejs":'<div><div data-childviews="debug-menu"></div><div data-childviews="debug-grid"></div></div>',"dialog.ejs":"<div></div>","image.ejs":'<img src="<%= value %>" alt="<%= alt %>"/>',"label.ejs":'<div contenteditable="true"><%= value %></div>',"list.ejs":'<ul data-childviews="list"></ul>',"listitem.ejs":"<li><%= value %></li>","listitemlinked.ejs":'<li><span><%= value %></span><i class="fa <%= icon %>"></i></li>',"loader.ejs":'<div class="m-view m-overlayview m-loaderview m-loaderview-show" style="display: block;"> <div class="m-view m-overlayview-inner m-loaderview-inner"> <div class="m-view m-labelview m-loaderview-inner-message"></div> <div class="m-view m-loaderview-inner-icon m-loaderview-inner-icon-only"> <div class="m-view m-loaderview-inner-icon-1"></div> <div class="m-view m-loaderview-inner-icon-2"></div> <div class="m-view m-loaderview-inner-icon-3"></div> <div class="m-view m-loaderview-inner-icon-4"></div> <div class="m-view m-loaderview-inner-icon-5"></div> <div class="m-view m-loaderview-inner-icon-6"></div> <div class="m-view m-loaderview-inner-icon-7"></div> <div class="m-view m-loaderview-inner-icon-8"></div> </div> </div> </div>',"menu.ejs":'<div class="movable-backdrop fade"></div><div class="movable-container"><span><%= value %></span><div class="menu-content" data-childviews="menu-content"></div></div>',"modal.ejs":'<div data-childviews="content"><div>',"model.ejs":"<ul><%= value %></ul>","movable.ejs":'<div class="movable-element"><%= value %></div>',"radiolist.ejs":'<div><%= label %><div data-childviews="radio-options"></div></div>',"radiooption.ejs":'<label><input type="radio" name="<%= name %>" value="<%= value %>"><i class="needsclick fa"></i><%= label %></label>',"searchfield.ejs":'<div contenteditable="true"><%= value %></div>',"select.ejs":'<div class="selection-list<% if(isMultiple){ %> multiple<% } %>"><select<% if(isMultiple){ %> multiple<% } %>><%= value %></select></div>',"slider.ejs":'<input type="range">',"tabbarbuttongroup.ejs":"<div></div>","text.ejs":'<div><% if(label) {  %><div class="label"><%= label %></div><% } %><div><% if(icon) {  %><div class="input-icon-addon"><i class="fa <%= icon %> fa-fw"></i><% } %><%= value %></div>',"textarea.ejs":"<div><% if(label) {  %><label><%= label %><% } %><textarea><%= value %></textarea><% if(label) {  %></label><% } %></div>","textfield.ejs":'<div><% if(label) {  %><label><%= label %><% } %><div class="<% if(icon) {  %> input-icon-addon<% } %>"><% if(icon) {  %><i class="fa <%= icon %> fa-fw"></i><% } %><input type="<%= type %>" <% if(placeholder) { %> placeholder="<%= placeholder %>"<% } %> value="<%= value %>"></div><% if(label) {  %></label><% } %></div>',"toast.ejs":'<div class="toast"><div id="<%= id %>"><%= text %></div></div>',"toggle.ejs":'<div><div data-childviews="first"></div><div data-childviews="second"></div></div>',"toggleswitch.ejs":'<div>\n    <div class="toggleswitch-value-listener" contenteditable="true"><%= value %></div>\n\n    <% if(label){%>\n        <div class="label-descr"> <%= label %></div>\n    <% }%>\n    <div class="movable-grid">\n        <div class="movable-container">\n              <% if(onLabel){%>\n                  <div class="on-value"><%= onLabel %></div>\n              <% }%>\n\n              <% if(onLabel){%>\n                  <div class="off-value"><%= offLabel %></div>\n              <% }%>\n\n              <% if(onLabel){%>\n                  <div class="movable-element"></div>\n              <% }%>\n        </div>\n    </div>\n</div>\n\n',"toolbar.ejs":'<div><div data-childviews="first"></div> <div class="center" data-binding="value"><%= value %></div> <div data-childviews="second"></div></div>',"view.ejs":"<div><%= value %></div>"}},e.Animation=e.Object.design({animationSupport:function(){return e.Environment.isLowerThanAndroid4?!1:(e.Environment.isLowerThaniPhone4S,Modernizr.cssanimations)}(),transitionSupport:function(){return Modernizr.csstransitions}(),animationEndEventName:function(){var a={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd",animation:"animationend"};return a[Modernizr.prefixed("animation")]}(),transitionEndEventName:function(){var a={WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"};return a[Modernizr.prefixed("transition")]}()}),e.ThemeVars={_vars:{"default":{blue:"#1092d3",lightblue:"#58b3e0",darkblue:"#0e7cb4",purple:"#6c64ff",lightpurple:"#9893ff",darkpurple:"#5c55d9",green:"#2dcca2",lightgreen:"#6cdbbe",darkgreen:"#26ae8a",red:"#ed253d",lightred:"#f26778",darkred:"#ca1f34",orange:"#f45b42",lightorange:"#f78d7b",darkorange:"#d04d38",yellow:"#eab13a",lightyellow:"#f0c975",darkyellow:"#d99731",grey:"#c3c3c3",lightgrey:"#d5d5d5",darkgrey:"#a6a6a6",black:"#000000",white:"#FFFFFF",darkwhite:"#F2F2F2","debug-1":"#02ccb9","debug-2":"#00cc09","debug-3":"#cc3500","debug-4":"#cc008d","debug-5":"#9f00cc","debug-6":"#4f00cc","debug-7":"#003fcc","debug-8":"#0073cc","grid-columns":"12","grid-gutter-width":"30px",lightenPercentage:"15%",lightenPercentageLight:"5%","m-button-icon-only-width":"50px","m-button-border-width":"1px","m-button-border-color":"#1092d3","m-button-text-color":"#1092d3","m-button-border-radius":"4px","m-button-border-style":"solid","m-button-padding-bottom":"10px","m-button-padding-top":"10px","m-button-padding-left-right":"10px","m-button-padding":"10px 10px 10px 10px","m-button-primary-border-color":"#6c64ff","m-button-primary-text-color":"#6c64ff","m-button-primary-background-color":"#FFFFFF","m-button-success-border-color":"#2dcca2","m-button-success-text-color":"#2dcca2","m-button-success-background-color":"#FFFFFF","m-button-error-border-color":"#ed253d","m-button-error-text-color":"#ed253d","m-button-error-background-color":"#FFFFFF","m-button-warning-border-color":"#f45b42","m-button-warning-text-color":"#f45b42","m-button-warning-background-color":"#FFFFFF","m-button-info-border-color":"#eab13a","m-button-info-text-color":"#eab13a","m-button-info-background-color":"#FFFFFF","m-button-fuzzy-border-color":"#c3c3c3","m-button-fuzzy-text-color":"#c3c3c3","m-button-fuzzy-background-color":"#FFFFFF",strong:"bold",normal:"normal",weak:"lighter","form-border-width":"1px","form-border-color":"#1092d3","form-border-style":"solid","form-element-border":"1px solid #1092d3","textfield-icon-padding":"30px","textfield-icon-x-position":"4px","textfield-icon-y-position":"14px","textfield-icon-font-size":"2.2rem","textfield-padding":"6px","m-primary-color":"#1092d3","m-primary-text-color":"#000000","m-primary-border-color":"#58b3e0","m-primary-active-color":"#0e7cb4","m-primary-active-text-color":"#FFFFFF","tablayout-menu-height":"50px","tablayout-menu-button-padding":"13px 0 0 0","tablayout-menu-scroll-button-width":"200px","switch-header-content-padding":"4px 0 0 0","header-top":"4px","m-header-icon-only-font-size":"2.4rem","m-primary-font-family":'"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif',"m-primary-font-weight":"300","m-primary-font-size":"1.6rem","m-primary-calc-font-size":"16px","m-primary-line-height":"2.2rem","m-primary-font-color":"#000000","m-primary-margin-top":"10px","m-primary-margin-bottom":"20px","modal-backdrop-background-color":"#000000","content-padding":"15px","m-primary-disabled-color":"#d5d5d5","m-primary-disabled-text-color":"#c3c3c3","selection-color":"#c3c3c3","selection-checked-color":"#1092d3","m-list-item-color":"#2dcca2","m-stencil-text-shadow":"rgba(255, 255, 255, 0.5) 0px 3px 3px","m-menu-view-width":"200px","m-menu-view-device-swipe-listener-width":"20px","m-menu-view-transition-width":"200px - 20px","m-menu-transition":"500ms"},android_dark:{"m-primary-color":"#669900","m-primary-border-color":"#669900","m-primary-active-color":"#99CC00"},android_light:{"m-primary-color":"#669900","m-primary-border-color":"#669900","m-primary-active-color":"#99CC00"},ios:{blue:"#59C8FA",lightblue:"#46b8da",darkblue:"#007AFF",green:"#4BD964",red:"#FF3B30",lightred:"#FF2D55",grey:"#8E8E93","m-primary-font-family":'-apple-system-font, "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif',lightenPercentage:"25%","textfield-icon-y-position":"13px","m-primary-active-color":"$lightgrey","m-primary-active-text-color":"#007AFF","tablayout-menu-height":"50px","tablayout-menu-scroll-button-width":"140px","selection-checked-color":"#59C8FA","m-button-padding-bottom":"10px","m-button-padding":"$m-button-padding-top $m-button-padding-left-right 10px $m-button-padding-left-right-top $m-button-padding-top $m-button-padding-left-right 10px $m-button-padding-left-right-left-right 10px $m-button-padding-top $m-button-padding-left-right 10px $m-button-padding-left-right-left-right"}},get:function(a,b){var b=b||e.Environment.device.os,c=this._vars[b]?this._vars[b][a]:!1;return c||b==e.ThemeVars.CONST.DEFAULT||(c=this._vars[e.ThemeVars.CONST.DEFAULT][a]),c||console.log('Can not find varibale "'+a+'".'),c}},e.ThemeVars.CONST={IOS:"ios",ANDROID_DARK:"android_dark",ANDROID_LIGHT:"android_light",ANDROID:"android_dark",DEFAULT:"default"},e.TemplateManager=e.Object.design({_currentUI:"default",get:function(a,b){b=b||e.TemplateManager._currentUI;var c=e.Templates[b][a];return c?c:"default"!==b?this.get(a,"default"):null}}),e.Transitions=e.Object.design({_transition:"",_main:null,_iterate:null,_pages:null,_pagesCount:0,_current:0,_isAnimating:!1,_endCurrPage:!1,_endNextPage:!1,reset:function(){this._transition="",this._main=null,this._iterate=null,this._pages=null,this._pagesCount=0,this._current=0,this._isAnimating=!1,this._endCurrPage=!1,this._endNextPage=!1},init:function(a){return this._main=a?a:d("#m-main"),this._pages=this._main.find("div.m-page"),this._pagesCount=this._pages.length,this._pages.each(function(){var a=d(this);a.data("originalClassList",a.attr("class"))}),this._pages.eq(this._current).addClass("m-page-current"),this},startTransition:function(){if(this._isAnimating||a[e.APPLICATION_NAME]&&a[e.APPLICATION_NAME].isInitialLoad)return!1;this._isAnimating=!0;var b=this._pages.eq(this._current);this._current<this._pagesCount-1?this._current+=1:this._current=0,this._transition||(this._transition=this.getDefaultTransition());var c=this._pages.eq(this._current).addClass("m-page-current");if(!e.Animation.animationSupport||this._transition===e.PageTransitions.CONST.NONE)return void this._onEndAnimation(b,c);var f=this._transition.split("|"),g=f[0],h=f[1],i=this,j=e.Animation.animationEndEventName;d(b[0]).on(j,function(){b.off(j),i._endCurrPage=!0,i._endNextPage&&i._onEndAnimation(b,c)}),d(c[0]).on(j,function(){c.off(j),i._endNextPage=!0,i._endCurrPage&&i._onEndAnimation(b,c)}),setTimeout(function(){c.addClass(h),b.addClass(g)},0)},setTransition:function(a){this._transition=a},getDefaultTransition:function(){return e.PageTransitions.CONST.MOVE_TO_LEFT_FROM_RIGHT},isAnimating:function(){return this._isAnimating},_onEndAnimation:function(a,b){this._endCurrPage=!1,this._endNextPage=!1,this._resetPage(a,b),this._isAnimating=!1},_resetPage:function(a,b){a.attr("class",a.data("originalClassList")),b.attr("class",b.data("originalClassList")+" m-page-current")}}),e.Transitions.CONST={NONE:"none",MOVE_TO_LEFT_FROM_RIGHT:"m-page-moveToLeft|m-page-moveFromRight",MOVE_TO_RIGHT_FROM_LEFT:"m-page-moveToRight|m-page-moveFromLeft",MOVE_TO_TOP_FROM_BOTTOM:"m-page-moveToTop|m-page-moveFromBottom",MOVE_TO_BOTTOM_FROM_TOP:"m-page-moveToBottom|m-page-moveFromTop",FADE_FROM_RIGHT:"m-page-fade|m-page-moveFromRight m-page-ontop",FADE_FROM_LEFT:"m-page-fade|m-page-moveFromLeft m-page-ontop",FADE_FROM_BOTTOM:"m-page-fade|m-page-moveFromBottom m-page-ontop",FADE_FROM_TOP:"m-page-fade|m-page-moveFromTop m-page-ontop",FADE_LEFT_FADE_RIGHT:"m-page-moveToLeftFade|m-page-moveFromRightFade",FADE_RIGHT_FADE_LEFT:"m-page-moveToRightFade|m-page-moveFromLeftFade",FADE_TOP_FADE_BOTTOM:"m-page-moveToTopFade|m-page-moveFromBottomFade",FADE_BOTTOM_FADE_TOP:"m-page-moveToBottomFade|m-page-moveFromTopFade",DIFFERENT_EASING_FROM_RIGHT:"m-page-moveToLeftEasing m-page-ontop|m-page-moveFromRight",DIFFERENT_EASING_FROM_LEFT:"m-page-moveToRightEasing m-page-ontop|m-page-moveFromLeft",DIFFERENT_EASING_FROM_BOTTOM:"m-page-moveToTopEasing m-page-ontop|m-page-moveFromBottom",DIFFERENT_EASING_FROM_TOP:"m-page-moveToBottomEasing m-page-ontop|m-page-moveFromTop",SCALE_DOWN_FROM_RIGHT:"m-page-scaleDown|m-page-moveFromRight m-page-ontop",SCALE_DOWN_FROM_LEFT:"m-page-scaleDown|m-page-moveFromLeft m-page-ontop",SCALE_DOWN_FROM_BOTTOM:"m-page-scaleDown|m-page-moveFromBottom m-page-ontop",SCALE_DOWN_FROM_TOP:"m-page-scaleDown|m-page-moveFromTop m-page-ontop",SCALE_DOWN_SCALE_DOWN:"m-page-scaleDown|m-page-scaleUpDown m-page-delay300",SCALE_UP_SCALE_UP:"m-page-scaleDownUp|m-page-scaleUp m-page-delay300",MOVE_TO_LEFT_SCALE_UP:"m-page-moveToLeft m-page-ontop|m-page-scaleUp",MOVE_TO_RIGHT_SCALE_UP:"m-page-moveToRight m-page-ontop|m-page-scaleUp",MOVE_TO_TOP_SCALE_UP:"m-page-moveToTop m-page-ontop|m-page-scaleUp",MOVE_TO_BOTTOM_SCALE_UP:"m-page-moveToBottom m-page-ontop|m-page-scaleUp",SCALE_DOWN_SCALE_UP:"m-page-scaleDownCenter|m-page-scaleUpCenter m-page-delay400",GLUE_LEFT_FROM_RIGHT:"m-page-rotateRightSideFirst|m-page-moveFromRight m-page-delay200 m-page-ontop",GLUE_RIGHT_FROM_LEFT:"m-page-rotateLeftSideFirst|m-page-moveFromLeft m-page-delay200 m-page-ontop",GLUE_BOTTOM_FROM_TOP:"m-page-rotateTopSideFirst|m-page-moveFromTop m-page-delay200 m-page-ontop",GLUE_TOP_FROM_BOTTOM:"m-page-rotateBottomSideFirst|m-page-moveFromBottom m-page-delay200 m-page-ontop",FLIP_RIGHT:"m-page-flipOutRight|m-page-flipInLeft m-page-delay500",FLIP_LEFT:"m-page-flipOutLeft|m-page-flipInRight m-page-delay500",FLIP_TOP:"m-page-flipOutTop|m-page-flipInBottom m-page-delay500",FLIP_BOTTOM:"m-page-flipOutBottom|m-page-flipInTop m-page-delay500",FALL:"m-page-rotateFall m-page-ontop|m-page-scaleUp",NEWSPAPER:"m-page-rotateOutNewspaper|m-page-rotateInNewspaper m-page-delay500",PUSH_LEFT_FROM_RIGHT:"m-page-rotatePushLeft|m-page-moveFromRight",PUSH_RIGHT_FROM_LEFT:"m-page-rotatePushRight|m-page-moveFromLeft",PUSH_TOP_FROM_BOTTOM:"m-page-rotatePushTop|m-page-moveFromBottom",PUSH_BOTTOM_FROM_TOP:"m-page-rotatePushBottom|m-page-moveFromTop",PUSH_LEFT_PULL_RIGHT:"m-page-rotatePushLeft|m-page-rotatePullRight m-page-delay180",PUSH_RIGHT_PULL_LEFT:"m-page-rotatePushRight|m-page-rotatePullLeft m-page-delay180",PUSH_TOP_PULL_BOTTOM:"m-page-rotatePushTop|m-page-rotatePullBottom m-page-delay180",PUSH_BOTTOM_PULL_TOP:"m-page-rotatePushBottom|m-page-rotatePullTop m-page-delay180",FOLD_LEFT_FROM_RIGHT:"m-page-rotateFoldLeft|m-page-moveFromRightFade",FOLD_RIGHT_FROM_LEFT:"m-page-rotateFoldRight|m-page-moveFromLeftFade",FOLD_TOP_FROM_BOTTOM:"m-page-rotateFoldTop|m-page-moveFromBottomFade",FOLD_BOTTOM_FROM_TOP:"m-page-rotateFoldBottom|m-page-moveFromTopFade",MOVE_TO_RIGHT_UNFOLD_LEFT:"m-page-moveToRightFade|m-page-rotateUnfoldLeft",MOVE_TO_LEFT_UNFOLD_RIGHT:"m-page-moveToLeftFade|m-page-rotateUnfoldRight",MOVE_TO_BOTTOM_UNFOLD_TOP:"m-page-moveToBottomFade|m-page-rotateUnfoldTop",MOVE_TO_TOP_UNFOLD_BOTTOM:"m-page-moveToTopFade|m-page-rotateUnfoldBottom",ROOM_TO_LEFT:"m-page-rotateRoomLeftOut m-page-ontop|m-page-rotateRoomLeftIn",ROOM_TO_RIGHT:"m-page-rotateRoomRightOut m-page-ontop|m-page-rotateRoomRightIn",ROOM_TO_TOP:"m-page-rotateRoomTopOut m-page-ontop|m-page-rotateRoomTopIn",ROOM_TO_BOTTOM:"m-page-rotateRoomBottomOut m-page-ontop|m-page-rotateRoomBottomIn",CUBE_TO_LEFT:"m-page-rotateCubeLeftOut m-page-ontop|m-page-rotateCubeLeftIn",CUBE_TO_RIGHT:"m-page-rotateCubeRightOut m-page-ontop|m-page-rotateCubeRightIn",CUBE_TO_TOP:"m-page-rotateCubeTopOut m-page-ontop|m-page-rotateCubeTopIn",CUBE_TO_BOTTOM:"m-page-rotateCubeBottomOut m-page-ontop|m-page-rotateCubeBottomIn",CAROUSEL_TO_LEFT:"m-page-rotateCarouselLeftOut m-page-ontop|m-page-rotateCarouselLeftIn",CAROUSEL_TO_RIGHT:"m-page-rotateCarouselRightOut m-page-ontop|m-page-rotateCarouselRightIn",CAROUSEL_TO_TOP:"m-page-rotateCarouselTopOut m-page-ontop|m-page-rotateCarouselTopIn",CAROUSEL_TO_BOTTOM:"m-page-rotateCarouselBottomOut m-page-ontop|m-page-rotateCarouselBottomIn",SIDES:"m-page-rotateSidesOut|m-page-rotateSidesIn m-page-delay200",SLIDE:"m-page-rotateSlideOut|m-page-rotateSlideIn"},e.PageTransitions=e.Transitions.design(),function(){e.View=b.View.extend({constructor:function(a){this.cid=c.uniqueId("view"),a=a||{};
  var b=["scope","model","collection","el","id","attributes","className","tagName","events","scopeKey","binding","computedValue","onSet","onGet","enabled"];c.extend(this,c.pick(a,b)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()}}),e.View.create=e.create,e.View.design=function(a,b,c){return this.extend().create(a,b,c)},e.View.implements=e.implements,c.extend(e.View.prototype,e.Object,{_type:"M.View",template:null,_template:null,_templateString:e.TemplateManager.get("view.ejs"),_templateValues:null,extendTemplate:null,_firstRender:YES,useElement:NO,_hasI18NListener:NO,onSet:null,onGet:null,cssClass:null,_internalCssClasses:"",grid:null,events:null,_events:null,_internalEvents:null,_value:null,_hammertime:null,_parentView:null,scopeKey:null,binding:null,_originalEvents:null,useParentValue:NO,_setModel:function(a){return this.model=a,this},_setCollection:function(a){return this.collection=a,this},_getModel:function(){return this.model},getValue:function(){return this.model?this._value.hasOwnProperty("attribute")&&this._value.hasOwnProperty("model")?this._value.model.get(this._value.attribute):this._getModel().attributes:this._value},_getValue:function(){return this._value},_setValue:function(a){this._value=a},_setChildViewValue:function(a){c.each(this.childViews,function(b){b.useParentValue&&(b._setValue(a),e.isModel(a)&&b._setModel(a))},this)},getPropertyValue:function(a,b){var d=b;return c.each(a.split("."),function(a){d=d[a]?d[a]:e.isModel(d)||e.isCollection(d)?{model:d,attribute:a}:null}),d},initialize:function(a){return this.scopeKey=this.scopeKey||this.binding,this._registerView(),this._addInterfaces(),this._assignValue(a),this._assignTemplateValues(),this._mapEventsToScope(this.scope),this._addInternalEvents(),this._addCustomEvents(this.scope),this.useElement||this._registerEvents(),this._assignContentBinding(),this},_registerView:function(){e.ViewManager.registerView(this)},_assignValue:function(a){this.value||"undefined"!=typeof this.value&&null!==this.value?this._setValue(this.value):this.scopeKey?this._setValue(this.getPropertyValue(this.scopeKey,this.scope)):a&&a.value&&this._setValue(a.value);var b=this._getValue();return b&&(e.isModel(b.model)?this._setModel(b.model):e.isModel(b)?this._setModel(b):e.isCollection(b)&&(this.collection=b)),this._reactOnLocaleChanged()&&(e.I18N.on(e.CONST.I18N.LOCALE_CHANGED,function(){this.render()},this),this._hasI18NListener=YES),this},_reactOnLocaleChanged:function(){return e.isI18NItem(this.value)||e.isI18NItem(this.label)},_assignContentBinding:function(){var a=this,b=this._getValue();return this.scopeKey&&e.isModel(b)?this.listenTo(this.scope,this.scopeKey,function(b){a._setModel(b),a.render()}):this.scopeKey&&e.isCollection(b)?this.listenTo(this.scope,this.scopeKey,function(b){a._setCollection(b),a.render()}):this.scopeKey&&b&&e.isModel(b.model)&&b.attribute&&this.listenTo(this.scope,this.scopeKey.split(".")[0],function(b){a._setModel(b),a.render()}),this},_mapEventsToScope:function(a){var b={};return this.events&&(c.each(this.events,function(d,e){var f=d;"string"==typeof d&&a&&"function"==typeof a[d]&&(f=a[d]),b[e]=c.isArray(f)?f:[f]},this),this._originalEvents=this.events,this.events=null),this._events=b,this},_addInternalEvents:function(){this._internalEvents&&this._addEvents(this._internalEvents)},_addEvents:function(a){c.each(a,function(a,b){this._addEvent(a,b)},this)},_addEvent:function(a,b){var d=c.isArray(a)?a:[a];this._events[b]=c.isArray(this._events[b])?this._events[b]:[],this._events[b]=this._events[b].concat(d)},_addCustomEvents:function(){if(this._events){var a=this,b={enter:{origin:"keyup",callback:function(b){13===b.keyCode&&a._events.enter[0].apply(a.scope,arguments)}}};for(var c in this._events)b.hasOwnProperty(c)&&this._addEvent(b[c].callback,b[c].origin)}},_getEventOptions:function(){var a=!1,b=!0,c=!1;return{prevent_default:a,no_mouseevents:b,stop_browser_behavior:c}},_registerEvents:function(){if(this._events){var a=this;this._eventCallback={},Object.keys(this._events).forEach(function(b){this._hammertime=new Hammer(a.el,a._getEventOptions()),this._eventCallback[b]=function(b){if(a._hammertime.enabled!==NO){var d=Array.prototype.slice.call(arguments);d.push(a),c.each(a._events[b.type],function(b){b.apply(a.scope,d)},a)}},this._hammertime.on(b,this._eventCallback[b])},this)}},_disableEvents:function(){this._hammertime&&this._hammertime.enable(NO)},_enableEvents:function(){this._hammertime&&this._hammertime.enable(YES)},isEnabled:function(){return this._hammertime.enabled},render:function(){return this._preRender(),this._render(),this._renderChildViews(),this._postRender(),this},_preRender:function(){return this._assignTemplate(),this._assignTemplateValues(),this._extendTemplate(),this.preRender(),this},_assignTemplate:function(a){return a=a||this.template,"undefined"!=typeof a&&null!==a?"function"==typeof a?this._template=a:c.isString(a)?this._template=c.tmpl(a):c.isObject(a)&&(this._template=c.tmpl(e.TemplateManager.get.apply(this,["template"]))):this._templateString&&(this._template=this._useStickit()?c.tmpl(this._templateString):c.tmpl(this._templateString,null,{useStickitAttribute:NO}),this.template=this._template),this},_assignTemplateValues:function(){this._templateValues={};var a=this._getValue();this.model?e.isModel(a)?this._templateValues=e.Object.deepCopy(this.model.attributes):this._templateValues._value=this.model.get(a.attribute):e.isI18NItem(a)?this._templateValues._value=e.I18N.l(a.key,a.placeholder):"string"==typeof a||"number"==typeof a?this._templateValues._value=a:null!==a&&"object"==typeof a&&this._hasI18NListener===NO?this._templateValues=e.Object.deepCopy(a):this._hasI18NListener&&c.each(a,function(a,b){this._templateValues[b]=e.I18N.l(a.key,a.placeholder)},this),"undefined"!=typeof this._templateValues._value&&"undefined"==typeof this._templateValues.value&&(this._templateValues.value=this._templateValues._value),c.extend(this._templateValues,this.assignTemplateValues())},assignTemplateValues:function(){return null},_extendTemplate:function(){if(this.extendTemplate){var a=c.template(this._templateString);this._templateValues.value=this.extendTemplate,this._template=c.tmpl(a(this._templateValues))}},preRender:function(){},_render:function(){var a=this._template(this._templateValues);return this.useElement?this.setElement(a):this.$el.html(this._attachToDom()?a:""),this},_attachToDom:function(){return null!==this.getValue()},_renderChildViews:function(){return this.childViews?(c.each(this.childViews,function(a,b){var d=this._getChildViewRenderDom(b);"function"==typeof a.render?this._renderChildView(d,a):c.isArray(a)&&c.each(a,function(a){this._renderChildView(d,a)},this)},this),this):void 0},_getChildViewRenderDom:function(a){var b=this.$el;return this.$el.find('[data-childviews="'+a+'"]').length&&(b=this.$el.find('[data-childviews="'+a+'"]'),b.addClass(a)),b},_renderChildView:function(a,b){this._renderChildViewToDom(a,b),b.delegateEvents()},_renderChildViewToDom:function(a,b){this._appendToDom(a,b.render().$el)},_appendToDom:function(a,b){a.append(b)},_postRender:function(){return this.useElement&&this._registerEvents(),this._addClassNames(),this._useStickit()&&(this._assignBinding(),this.stickit()),this.model&&this.useElement,this.postRender(),this._firstRender=NO,this},_addClassNames:function(){var a=this._getViewCssClassName();this.$el.addClass(a),this.cssClass&&this.$el.addClass(this.cssClass),this._internalCssClasses&&this.$el.addClass(this._internalCssClasses),this.grid&&this.$el.addClass(this.grid)},_useStickit:function(){return this.model?YES:NO},_getViewCssClassName:function(){var a=null;return a=0===this._type.toString().indexOf("M.")?this._type.split("M.")[1].toLowerCase():this._type.toString(),a.indexOf(" ")>=0&&(console.warn("The View type contains whitespaces: "+this._type+". The _type property gets added to the css classes. Since there are whitespaces inside the name the view has multiple classes. To set a class overwrite _getViewCssClassName method of the view"),a=""),a.indexOf(".")>=0&&(console.warn("The View type contains dots: "+this._type+". The _type property gets added to the css classes. Since there are dots inside the name we skiped this. To enable this featuer overwrite the _getViewCssClassName method"),a=""),a},_assignBinding:function(){var a={},b=this._getValue(),d="";return this.model&&!e.isModel(b)?(d='[data-binding="value"]',a[d]={observe:""+b.attribute}):this.collection?(d='[data-binding="value"]',a[d]={observe:"value"}):this.model&&e.isModel(b)?c.each(this.model.attributes,function(b,c){var d='[data-binding="'+c+'"]';a[d]={observe:""+c}},this):null===this.extendTemplate&&this.scopeKey?(d='[data-binding="value"]',a[d]={observe:""+this.scopeKey}):c.each(this._templateValues,function(b,c){d='[data-binding="'+c+'"]',a[d]={observe:""+c}},this),c.each(a,function(b,c){"function"==typeof this.onGet&&(a[c].onGet=function(a){var b=this.onGet(a);return b}),"function"==typeof this.onSet&&(a[c].onSet=function(a){var b=this.onSet(a);return b})},this),this.bindings=a,this},postRender:function(){},updateTemplate:function(){var a=this.template||e.TemplateManager.get(this._type);return this._assignTemplate(a),this._updateChildViewsTemplate(),this},_updateChildViewsTemplate:function(){return this.childViews?(c.each(this.childViews,function(a){"function"==typeof a.updateTemplate?a.updateTemplate():c.isArray(a)&&c.each(a,function(a){a.updateTemplate()})},this),this):void 0},setChildView:function(a,b){this.childViews[a]?this.childViews[a]=b:this.addChildView(a,b)},getChildView:function(a){return this.childViews[a]?this.childViews[a]:null},addChildView:function(a,b){return c.isObject(a)?(c.each(a,function(a,b){this._mergeChildView(b,a)},this),this):this._mergeChildView(a,b)},_mergeChildView:function(a,b){if(!c.isString(a)||!e.isView(b))return void 0;var d=this.childViews[a];if(c.isArray(d))d.push(b);else if(c.isObject(d)){var f=[];f.push(d),f.push(b),this.childViews[a]=f,f=null}else this.childViews[a]=b;return this},_unbindEvent:function(a){this._hammertime.off(a,this._eventCallback[a])},_getChildView:function(a){var b=parseInt(a,10);c.isNaN(b)||(a=b);var d=c.isNumber(a)?Object.keys(this.childViews)[a]:a;return this.childViews[d]},_getInternationalizedTemplateValue:function(a){return e.isI18NItem(a)?e.I18N.l(a.key,a.placeholder):a?a:""},_getsVisible:function(){this._childViewsGetsVisible(),this.getsVisible()},getsVisible:function(){},_childViewsGetsVisible:function(){c.each(this.childViews,function(a){a._getsVisible()},this)},getParent:function(){return this._parentView}}),e.View.extend=function(a,c){return a=a||{},c&&(a._childViews=c),a.childViews&&(a._childViews=a.childViews),b.View.extend.apply(this,[a])},e.View.create=function(a,b,d){var f=d||e.isController(a)?{scope:a}:a,g=new this(f);return g.childViews={},g._childViews&&c.each(g._childViews,function(b,c){var d=a;g.useAsScope===YES&&(d=g),g.childViews[c]=b.create(d||g,null,!0),g.childViews[c]._parentView=g}),b&&(g.childViews=g.childViews||{},c.each(b,function(a,b){g.childViews[b]=a,g.childViews[b]._parentView=g})),g._setChildViewValue(g._getValue()),g}}(this),e.Layout=e.View.extend({_type:"M.Layout",isMLayout:YES,template:"<div></div>",childViews:{},applyViews:function(){this._getsVisible()},_attachToDom:function(){return YES},setTransition:function(a){e.PageTransitions.setTransition(a)},startTransition:function(){e.PageTransitions.startTransition(),this._getsVisible()},isAnimating:function(){return e.PageTransitions.isAnimating()},destroy:function(){this.$el.remove(),this.$el=null,this.childViews=null,e.PageTransitions.reset()}}),e.Themes=e.Object.design({DEFAULT_THEME:"basic",basic:{},_currentThemeName:"basic",_themes:{},registerTemplateForTheme:function(a,b,c,d){d=d||!1;var e=this._getThemeByName(a);e||this._createThemeWithName(a);var f=""!==this._getTemplateByNameForTheme(a,b);return!f||d?(this._themes[a][b]=c,!0):(console.warn('Template "'+b+'" already defined for theme "'+a+'"'),!1)},getTemplateByName:function(a){var b=this.getTemplateByNameForTheme(this._currentThemeName,a);return""===b&&this._currentThemeName!==this.DEFAULT_THEME&&(console.log('Template "'+a+'" not defined for theme "'+this._currentThemeName+'", switched to default theme "'+this.DEFAULT_THEME+'"'),b=this.getTemplateByNameForTheme(this.DEFAULT_THEME,a)),b},getTemplateByNameForTheme:function(a,b){var c=this._getTemplateByNameForTheme(a,b);return c?c:(console.warn('Template "'+b+'" not defined for theme "'+a+'"'),"")},_getTemplateByNameForTheme:function(a,b){var c=this._getThemeByName(a);return c&&c[b]?c[b]:""},_createThemeWithName:function(a){this._themes[a]={}},_getThemeByName:function(a){return this._themes[a]?this._themes[a]:null}}),e.TextfieldView=e.View.extend({_type:"M.TextfieldView",label:null,type:"search",placeholder:null,icon:null,_template:null,_templateString:e.TemplateManager.get("textfield.ejs"),_useCustomClear:NO,useCustomClear:NO,initialize:function(a){return("clear"===this.type||"clear"===a.type||this.useCustomClear)&&(this.type=this.type||"text",this._useCustomClear=YES),e.View.prototype.initialize.apply(this,arguments),this._useCustomClear&&this._addClearButton(),this},_addClearButton:function(){var a=this._getValue();if(!e.isModel(a)){var b=a;b||(b=""),a=e.Model.create({value:b})}this._setModel(a),this._setValue(a);var c=this;return this.icon=this.icon||"fa-times-circle",this.cssClass=this.cssClass||"right",""===this.getValue().value&&(this.cssClass+=" hidden-icon"),this.onSet=function(a){return a?c.$el.removeClass("hidden-icon"):c.$el.addClass("hidden-icon"),a},this},_assignTemplateValues:function(){return e.View.prototype._assignTemplateValues.apply(this),this._addLabelToTemplateValues(),this._addTypeToTemplateValues(),this._addPlaceholderToTemplateValues(),this._addIconToTemplateValues(),this},_addLabelToTemplateValues:function(){return this._templateValues.label=this._getInternationalizedTemplateValue(this.label),this},_addPlaceholderToTemplateValues:function(){return this._templateValues.placeholder=this._getInternationalizedTemplateValue(this.placeholder),this},_addTypeToTemplateValues:function(){return this._templateValues.type=this.type,this},_addIconToTemplateValues:function(){this._templateValues.icon=this.icon||""},_attachToDom:function(){return YES},_postRender:function(){if(e.View.prototype._postRender.apply(this,arguments),this._useCustomClear){var a=this;this.$el.find("i").on("click",function(){a.value.set("value",""),a.$el.addClass("hidden-icon")})}return this},_extendTemplate:function(){this.extendTemplate&&console.warn("Extend the Template of a M.TextFieldView is possible but be aware that the value attribute of the input is set with this string. Otherwise overwrite _templateString."),e.View.prototype._extendTemplate.apply(this,arguments)},getValue:function(){var a=e.View.prototype.getValue.apply(this,arguments);return a&&this.model||(a=this.$el.find("input").val()),a}}),e.SearchfieldView=e.TextfieldView.extend({_type:"M.SearchfieldView",placeholder:"Search",_templateString:e.TemplateManager.get("searchfield.ejs"),initialize:function(){e.View.prototype.initialize.apply(this)},_assignTemplateValues:function(){e.TextfieldView.prototype._assignTemplateValues.apply(this),this._templateValues.placeholder=this.placeholder||""}}),e.TextareaView=e.TextfieldView.extend({_type:"M.TextareaView",_templateString:e.TemplateManager.get("textarea.ejs"),_attachToDom:function(){return YES}}),e.ListItemView=e.View.extend({_type:"M.ListItemView",_templateString:e.TemplateManager.get("listitem.ejs"),type:"basic",icon:"fa-angle-right",initialize:function(){e.View.prototype.initialize.apply(this,arguments),this._applyBehaviour()},getIcon:function(){return this.model?this.model.get("icon"):this.icon},_applyBehaviour:function(){this.type===e.ListItemView.CONST.ICON&&(this.enabled=NO),(this.type===e.ListItemView.CONST.LINKED||this.type===e.ListItemView.CONST.ICON)&&(this.template=c.tmpl(e.TemplateManager.get("listitemlinked.ejs")))},_assignTemplateValues:function(){e.View.prototype._assignTemplateValues.apply(this,arguments),(this.type===e.ListItemView.CONST.LINKED||this.type===e.ListItemView.CONST.ICON)&&(this._templateValues.icon=this.getIcon())},_postRender:function(){e.View.prototype._postRender.apply(this,arguments),this.enabled===NO&&this.disable&&this.disable()},_renderChildViewToDom:function(a,b){this._appendToDom(a.find("li"),b.render().$el)}}).implements([e.ActiveState,e.ViewEnableState]),e.ListItemView.CONST={LINKED:1,BASIC:2,ICON:3},e.ButtonView=e.View.extend({_type:"M.ButtonView",_templateString:e.TemplateManager.get("button.ejs"),_isActive:YES,enabled:YES,initialize:function(){this.value=this.value||"",e.View.prototype.initialize.apply(this,arguments)},_assignTemplateValues:function(){e.View.prototype._assignTemplateValues.apply(this,arguments),this._templateValues.icon=this.icon?this.icon:""},_addClassNames:function(){e.View.prototype._addClassNames.apply(this,arguments);var a=this._getValue();""!==a&&this.icon&&""!==this.icon?this.$el.addClass("has-icon"):""===a&&this.icon&&""!==this.icon&&this.$el.addClass("is-icon-only")},isActive:function(){return this._isActive()},activate:function(){this._isAcitve=YES,this.$el.addClass("active")},deactivate:function(){this._isAcitve=NO,this.$el.removeClass("active")},_postRender:function(){e.View.prototype._postRender.apply(this,arguments),this.enabled===NO&&this.disable&&this.disable()}}).implements([e.ActiveState,e.ViewEnableState]),e.ListView=e.View.extend({_type:"M.ListView",_viewModelMapping:null,_template:null,_templateString:e.TemplateManager.get("list.ejs"),listItemView:null,_renderChildViews:function(){return this.useRenderUpdateFilter||(this._filterValue=!0),this.collection?this._renderItems(this.collection.filter(this.filterBy,this)):c.isArray(this.getValue())&&this._renderItems(this.getValue()),this},initialize:function(){return e.View.prototype.initialize.apply(this,arguments),this.collection&&this._applyListener(),this._viewModelMapping={},this},_applyListener:function(){return this.listenTo(this.collection,"add",function(a){this._renderEntry(a)}),this.listenTo(this.collection,"fetch",function(){}),this.listenTo(this.collection,"change",function(){}),this.listenTo(this.collection,"remove",function(a){var b=this._viewModelMapping[a.cid];b&&b.$el&&b.$el.remove()}),this.listenTo(this.collection,"sort",function(){this.render()}),this},_renderItems:function(a){return c.each(a,function(a,b){this._renderEntry(a,b)},this),this},_renderEntry:function(a,b){var c={header:this._getListItemHeader(a,b),item:this._getListItem(a,b),footer:this._getListItemFooter(a,b)};return c=this._renderListItemRow(c),this._cacheListItemRow(c,a.cid),this},_renderListItemRow:function(a){var b={};return c.each(a,function(a,c){b[c]=this._renderItem(a)},this),b},_cacheListItemRow:function(a,b){this._viewModelMapping[b]=a},_renderItem:function(a){return a?(e.View.prototype.isPrototypeOf(a.prototype)&&c.isFunction(a)&&(a=a.create()),a.render(),this.$el.find('[data-childviews="list"]').append(a.$el),a.delegateEvents(),a):void 0},_getListItem:function(a,b){return c.isFunction(this.getListItem)?this.getListItem(a,b).create({scope:this.scope,value:a}):this.listItemView?this.listItemView.create({scope:this.scope,value:a}):e.ListItemView.create({scope:this.scope,value:a,enable:NO})},getListItem:null,_getListItemHeader:function(a,b){return c.isFunction(this.getListItemHeader)?this.getListItemHeader(a,b):this.getListItemHeader},getListItemHeader:null,_getListItemFooter:function(a,b){return c.isFunction(this.getListItemFooter)?this.getListItemFooter(a,b):this.getListItemFooter},getListItemFooter:null,useRenderUpdateFilter:NO,filterBy:function(){return this.getFilterValue()},_renderUpdateFilter:function(){return this.$el.find('[data-childviews="list"]').empty(),this._renderChildViews(),this},_showHideFilter:function(){this.$el.find('[data-childviews="list"] .listitemview').hide();var a=this.collection.filter(this.filterBy,this);c.each(a,function(a,b){if(this.listItemView)this._showFilterElement(a.cid);else{var d=this._viewModelMapping[a.cid];c.isFunction(this.getListItemHeader)&&(this.getListItemHeader(a,b,d.header),this._showFilterElement(a.cid,"header")),c.isFunction(this.getListItem)&&(this.getListItem(a,b,d.item),this._showFilterElement(a.cid,"item")),c.isFunction(this.getListItemFooter)&&(this.getListItemFooter(a,b,d.footer),this._showFilterElement(a.cid,"footer"))}},this)},_showFilterElement:function(a,b){if(b){var c=this._viewModelMapping[a];c[b]&&c[b].$el&&c[b].$el.show()}else this._viewModelMapping[a].item.$el.show()},filter:function(a){return"undefined"!=typeof a&&this.setFilterValue(a),this.useRenderUpdateFilter?this._renderUpdateFilter():this._showHideFilter(),this},_filterValue:!0,setFilterValue:function(a){var b="undefined"==typeof a?YES:a;return this._filterValue=b,this},getFilterValue:function(){return this._filterValue}}),e.SliderView=e.View.extend({_type:"M.SliderView",_templateString:e.TemplateManager.get("slider.ejs"),_getEventOptions:function(){return{prevent_default:!1,no_mouseevents:!0}}}),e.DialogView=e.View.extend({_type:"M.DialogView",_templateString:e.TemplateManager.get("dialog.ejs")}),e.ToggleView=e.View.extend({_type:"M.ToggleView",_templateString:e.TemplateManager.get("toggle.ejs"),initialize:function(){e.View.prototype.initialize.apply(this,arguments)},render:function(a){return this._preRender(a),this._render(a),this._renderChildViews(a),this._postRender(a),this}}),e.ImageView=e.View.extend({_type:"M.ImageView",_templateString:e.TemplateManager.get("image.ejs"),alt:null,initialize:function(){return e.View.prototype.initialize.apply(this,arguments),this.alt=this.alt||"",this},_assignTemplateValues:function(){e.View.prototype._assignTemplateValues.apply(this,arguments);var a=this._getValue();return this.model?e.isModel(a)||(this._templateValues.alt=this.model.get(this.alt.attribute)):(a||"string"==typeof a)&&(this._templateValues.alt=this.alt),this}}),e.Toast=e.View.extend({_type:"M.ToastView",_templateString:e.TemplateManager.get("toast.ejs"),id:null,initialize:function(a){var b=this;b.id=c.uniqueId(),b.text=a.text||e.Toast.CONST.TEXT,d("body").append(b.render().$el),b.timeoutId=setTimeout(function(){b.remove()},a.timeout||e.Toast.CONST.MEDIUM)},_assignTemplateValues:function(){this._templateValues={id:this.id,text:this.text}},remove:function(){e.View.prototype.remove.apply(this,arguments),this.timeoutId&&clearTimeout(this.timeoutId),e.Toast._run()},_attachToDom:function(){return YES}}),e.Toast._stack=[],e.Toast._isSequencing=!1,e.Toast._currentToast=null,e.Toast.show=function(a,b){"string"==typeof a&&(a={text:a,timeout:b}),this._stack.push(a),this._isSequencing||(this._isSequencing=!0,this._run())},e.Toast.removeAll=function(){this._stack=[],this._currentToast&&(this._currentToast.remove(),this._currentToast=null)},e.Toast._run=function(){if(0===this._stack.length)return void(this._isSequencing=!1);var a=this._stack.shift();this._currentToast=e.Toast.create(a)},e.Toast.CONST={RAW:500,MEDIUM:2e3,CRISPY:4e3,TEXT:""},e.ToolbarView=e.View.extend({_type:"M.ToolbarView",_templateString:e.TemplateManager.get("toolbar.ejs")}),e.SelectView=e.View.extend({_type:"M.SelectView",isMultiple:NO,_templateString:e.TemplateManager.get("select.ejs"),_assignBinding:function(){return e.View.prototype._assignBinding.apply(this,arguments),this.selectOptions&&c.each(this.bindings,function(a){a.selectOptions=this.selectOptions},this),this},_assignTemplateValues:function(){e.View.prototype._assignTemplateValues.apply(this),this._templateValues.isMultiple=this.isMultiple}}),e.ButtonGroupView=e.View.extend({_type:"M.ButtonGroupView",_templateString:e.TemplateManager.get("buttongroup.ejs"),_internalCssClasses:"clearfix",setActive:function(a){var b=e.isView(a)?a:this._getChildView(a);c.each(this.childViews,function(a){a.deactivate()},this),b.activate()},getActive:function(){return c.find(this._childViews,function(a){return a.isActive()},this)},initialize:function(){e.View.prototype.initialize.apply(this,arguments);var a=this;this._childViews&&c.each(this._childViews,function(b,c){this._childViews[c]=b.extend({_isInButtonGroup:YES,_internalEvents:{touchstart:[function(b,c){a.setActive(c)}],mousedown:[function(b,c){a.setActive(c)}]}})},this)},_preRender:function(){e.View.prototype._preRender.apply(this,arguments),c.each(this.childViews,function(a){a.selected&&this.setActive(a)},this)},_addClassNames:function(){e.View.prototype._addClassNames.apply(this,arguments)}}),e.TabbarButtonGroupView=e.ButtonGroupView.extend({_type:"M.TabbarButtonGroupView",initialize:function(){e.View.prototype.initialize.apply(this,arguments);var a=this;if(this._childViews){var b=e.CONST.GRID.COLUMNS/Object.keys(this._childViews).length;c.each(this._childViews,function(c,d){this._childViews[d]=c.extend({grid:"col-xs-"+b,_internalEvents:{tap:[function(b,c){a.setActive(c)}]}})},this)}}}),e.TabView=e.View.extend({_type:"M.TabView",cssClass:"m-page m-tab"}),e.SelectionlistView=e.View.extend({_type:"M.SelectionlistView",_template:null,_templateString:null,_optionTemplate:null,_optionsContainer:"",_render:function(){return e.View.prototype._render.apply(this,arguments),this._renderOptions(),this},_renderOptions:function(){if(this.selectOptions&&this.selectOptions.collection){var a="";c.each(this.selectOptions.collection,function(b){a+=this._optionTemplate({name:this.cid+"-option",value:b[this.selectOptions.valuePath||"value"],label:b[this.selectOptions.labelPath||"label"]})},this),this.$el.children("div").children('[data-childviews="'+this._optionsContainer+'-options"]').append(a)}return this}}).implements([e.ActiveState]),e.RadiolistView=e.SelectionlistView.extend({_type:"M.RadiolistView",_templateString:e.TemplateManager.get("radiolist.ejs"),_optionTemplate:c.tmpl(e.TemplateManager.get("radiooption.ejs")),_optionsContainer:"radio"}).implements([e.ActiveState]),e.CheckboxlistView=e.SelectionlistView.extend({_type:"M.CheckboxlistView",_templateString:e.TemplateManager.get("checkboxlist.ejs"),_optionTemplate:c.tmpl(e.TemplateManager.get("checkboxoption.ejs")),_optionsContainer:"checkbox"}),e.ModalView=e.View.extend({_type:"M.ModalView",cssClass:"modalview",hideOnOverlayClick:YES,_templateString:e.TemplateManager.get("modal.ejs"),_isShown:NO,_shownCounter:0,_$backdrop:null,_backdropWillAppear:NO,_internalEvents:{tap:function(a,b){b._closeHandler(a,b)}},show:function(){return this._shownCounter+=1,this._shownCounter>0&&(this._showBackdrop(),d("body").append(this.$el),this._isShown=YES),this},hide:function(a){return this._shownCounter-=1,(a===YES||this._shownCounter<=0)&&(this.$el.remove(),this._isShown=NO,this._shownCounter=0,this._hideBackdrop()),this},isShown:function(){return this._isShown},toggle:function(a){this.isShown(a)?this.hide(!0):this.show(a)},_attachToDom:function(){return YES},_showBackdrop:function(){var a=this;a._$backdrop||(a._$backdrop=d('<div class="modal-backdrop fade"><div>'),a._$backdrop.appendTo("body"),e.Animation.transitionSupport&&(a._backdropWillAppear=YES,a._$backdrop.on(e.Animation.transitionEndEventName,function(){a._backdropWillAppear=NO}),setTimeout(function(){a._$backdrop&&a._$backdrop.addClass("in")},0)))},_hideBackdrop:function(){var a=this,b=function(){a._$backdrop&&(a._$backdrop.remove(),a._$backdrop=null,a._backdropWillAppear=NO)};a._$backdrop&&(e.Animation.transitionSupport&&a._backdropWillAppear===NO?(a._$backdrop.on(e.Animation.transitionEndEventName,b),setTimeout(function(){a._$backdrop&&a._$backdrop.removeClass("in")},0)):b())},_closeHandler:function(a,b){this.hideOnOverlayClick&&a.target===b.el&&b.hide()}}),e.LoaderView=e.ModalView.extend({_type:"M.LoaderView",hideOnOverlayClick:NO,show:function(a){return a=a||"",e.ModalView.prototype.show.apply(this,arguments),this.$el.find(".m-loaderview-inner-message").html(a),this}},{content:e.View.extend({_templateString:e.TemplateManager.get("loader.ejs"),_attachToDom:function(){return YES}})}),e.Loader=e.LoaderView.create().render(),e.TextView=e.View.extend({_type:"M.TextView",label:null,icon:null,_templateString:e.TemplateManager.get("text.ejs"),_assignTemplateValues:function(){return e.View.prototype._assignTemplateValues.apply(this),this._addLabelToTemplateValues(),this._addIconToTemplateValues(),this},_addLabelToTemplateValues:function(){return this._templateValues.label=this._getInternationalizedTemplateValue(this.label),this},_addIconToTemplateValues:function(){this._templateValues.icon=this.icon||""},_attachToDom:function(){return YES}}),e.DebugView=e.View.extend({_type:"M.DebugView",_templateString:e.TemplateManager.get("debug.ejs"),_debugViewIsHidden:YES,cssClass:"bg",useAsScope:YES,initialize:function(){e.View.prototype.initialize.apply(this,arguments),this._addShakeEvent()},hide:function(){this._debugViewIsHidden=YES,this.$el.hide()},show:function(){this._firstRender&&d("body").append(this.render().$el),this._debugViewIsHidden=NO,this.$el.show()},toggle:function(){this._debugViewIsHidden?this.show():this.hide()},toggleGrid:function(){this.$el.toggleClass("bg"),this.childViews["debug-grid"].$el.toggle()},androidLightTheme:function(){this.resetTheme(),d("html").addClass("android-light")},iosTheme:function(){this.resetTheme(),d("html").addClass("ios")},resetTheme:function(){d("html").removeClass("android").removeClass("android-light").removeClass("android-dark").removeClass("ios")},_addShakeEvent:function(){var a=this;window.addEventListener("shake",function(){a.toggle()},!1)}},{"debug-menu":e.ButtonGroupView.extend({cssClass:"debug-menu"},{toggleGrid:e.ButtonView.extend({value:"Toggle grid",events:{tap:"toggleGrid"}}),androidLight:e.ButtonView.extend({value:"android-light theme",events:{tap:"androidLightTheme"}}),ios:e.ButtonView.extend({value:"ios theme",events:{tap:"iosTheme"}}),reset:e.ButtonView.extend({value:"reset theme",events:{tap:"resetTheme"}})}),"debug-grid":e.View.extend({useElement:YES,template:function(){for(var a='<div class="debug-container"><div class="debug-grid col-xs-12"><div class="row">',b=0;12>b;b++)a+='<div class="col-xs-1"><div class="inner"></div></div>';return a+="</div></div></div>"}()})}),e.MovableView=e.View.extend({_type:"M.MovableView",_templateString:e.TemplateManager.get("movable.ejs"),leftEdge:0,duration:1e3,rightEdge:null,_rightEdge:null,_lastPos:{x:0,y:0,deltaX:0,deltaY:0,direction:""},_currentPos:{x:0,y:0,deltaX:0,deltaY:0,direction:""},_movableWidth:null,_containerWidth:null,_$movableContent:null,_isAnimating:NO,initialize:function(){e.View.prototype.initialize.apply(this,arguments),this.leftEdge=this.leftEdge||0},_postRender:function(){e.View.prototype._postRender.apply(this,arguments),this._$movableContent=this._getMovableContent()},_getsVisible:function(){e.View.prototype._getsVisible.apply(this,arguments),this.toLeft(),this.setDimensions()},_internalEvents:{dragright:function(a,b){b._drag(a,b)},dragleft:function(a,b){b._drag(a,b)},touchend:function(a,b){b._touchEnd(a,b)},mouseup:function(a,b){b._touchEnd(a,b)}},_drag:function(a){var b={};b.x=this._lastPos.x+a.gesture.deltaX,b.deltaX=a.gesture.deltaX,b.direction=this._currentPos.deltaX>a.gesture.deltaX?Hammer.DIRECTION_LEFT:Hammer.DIRECTION_RIGHT,this._move(b)},_touchEnd:function(a){(a.target===this._$movableContent[0]||this.$el.hasClass("on-move"))&&(this._currentPos.x<this.leftEdge?this._currentPos.x=this.leftEdge:this._containerWidth<this._currentPos.x+this._movableWidth&&(this._currentPos.x=this._containerWidth-this._movableWidth),this._lastPos=this._currentPos,this.onRelease())},onRelease:function(){this._currentPos.direction===Hammer.DIRECTION_LEFT?this.toLeft():this.toRight()},_getEventOptions:function(){return{prevent_default:!0,no_mouseevents:!0,stop_browser_behavior:{userSelect:"none",touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none"}}},setDimensions:function(){this._movableWidth=this._$movableContent.outerWidth(),this._containerWidth=this.$el.outerWidth(),this._rightEdge=this.rightEdge||this._containerWidth-this._movableWidth
  },_getMovableContent:function(){return this.$el.find(".movable-element")},_move:function(a){var b=parseInt(a.x,10);b>this._rightEdge||b<this.leftEdge||(this._removeCssClasses(),this.$el.addClass("on-move"),this._setCss(a),a&&(this._currentPos=a))},toLeft:function(){this.$el.removeClass("on-right"),this.$el.addClass("on-left"),this._resetInlineCss(),this._lastPos.x=this.leftEdge,this._setCss({x:this._lastPos.x})},toRight:function(){this.$el.addClass("on-right"),this.$el.removeClass("on-left"),this.$el.removeClass("on-move"),this._resetInlineCss(),this._lastPos.x=this._rightEdge,this._setCss({x:this._lastPos.x})},toggle:function(){return this.$el.hasClass("on-left")?this.toRight():this.toLeft(),this},_setCss:function(a){if(a&&a.x&&"undefined"!=typeof a.x){var b=parseInt(a.x,10);if(!isNaN(b))return this._$movableContent.css("-webkit-transform","translate3d("+b+"px, 0, 0)"),this._$movableContent.css("-moz-transform","translate3d("+b+"px, 0, 0)"),this._$movableContent.css("transform","translate3d("+b+"px, 0, 0)"),this}return void 0},_removeCssClasses:function(){this.$el.removeClass("to-left"),this.$el.removeClass("to-right"),this.$el.removeClass("on-move")},_resetInlineCss:function(){this._$movableContent.attr("style","")},_attachToDom:function(){return YES}}),e.ToggleSwitchView=e.MovableView.extend({_type:"M.ToggleSwitchView",_templateString:e.TemplateManager.get("toggleswitch.ejs"),onValue:YES,offValue:NO,onLabel:e.TOGGLE_SWITCH_ON,offLabel:e.TOGGLE_SWITCH_OFF,rightEdge:35,selectOptions:null,_assignTemplateValues:function(){e.View.prototype._assignTemplateValues.apply(this,arguments),this._addLabelToTemplateValues(),this._addOnLabelToTemplateValues(),this._addOffLabelToTemplateValues()},initialize:function(){this._setSelectOptions();var a=this;this._internalEvents.tap=function(){a.toggle()},e.View.prototype.initialize.apply(this,arguments),null===this.getValue()&&this._setValue(this.offValue)},_setSelectOptions:function(){this.selectOptions={collection:[]}},onGet:function(a){return a===this.onValue||a===this.onLabel?(e.MovableView.prototype.toLeft.apply(this,arguments),this.onValue):(e.MovableView.prototype.toRight.apply(this,arguments),this.offValue)},onSet:function(){return this.$el.hasClass("on-left")?this.onValue:this.$el.hasClass("on-right")?this.offValue:void 0},toLeft:function(){e.MovableView.prototype.toLeft.apply(this,arguments),this._$valueContainer.trigger("change")},toRight:function(){e.MovableView.prototype.toRight.apply(this,arguments),this._$valueContainer.trigger("change")},_$valueContainer:null,_postRender:function(){e.MovableView.prototype._postRender.apply(this,arguments),this._$valueContainer=this.$el.find('[contenteditable="true"]')},_addLabelToTemplateValues:function(){this._templateValues.label=this._getInternationalizedTemplateValue(this.label)},_addOnLabelToTemplateValues:function(){this._templateValues.onLabel=this.onLabel||e.TOGGLE_SWITCH_ON},_addOffLabelToTemplateValues:function(){this._templateValues.offLabel=this.offLabel||e.TOGGLE_SWITCH_OFF}}),e.ToggleSwitchView.CONST={TOGGLE_SWITCH_ON:1,TOGGLE_SWITCH_OFF:2},e.MenuView=e.MovableView.extend({_type:"M.MenuView",_templateString:e.TemplateManager.get("menu.ejs"),leftEdge:0,rightEdge:null,_$backdrop:null,_deviceSwipeListenerWidth:0,_transitionTimeout:null,_internalCssClasses:"on-left",initialize:function(){this._deviceSwipeListenerWidth=parseInt(e.ThemeVars.get("m-menu-view-device-swipe-listener-width"),10),this.leftEdge=this.leftEdge||0,this._rightEdge=this.rightEdge||parseInt(e.ThemeVars.get("m-menu-view-width"),10)-this._deviceSwipeListenerWidth,e.MovableView.prototype.initialize.apply(this,arguments)},setDimensions:function(){e.MovableView.prototype.setDimensions.apply(this,arguments),this._rightEdge=this.rightEdge||parseInt(e.ThemeVars.get("m-menu-view-width"),10)-this._deviceSwipeListenerWidth},_postRender:function(){this._$backdrop=this.$el.find(".movable-backdrop"),e.MovableView.prototype._postRender.apply(this,arguments)},toLeft:function(){this.$el.removeClass("on-right"),this.$el.addClass("on-left"),this._resetInlineCss(),this._lastPos.x=0,this._$backdrop.removeClass("in"),this._$backdrop.css("opacity","0");var a=this;window.clearTimeout(this._transitionTimeout);var b=parseInt(e.ThemeVars.get("m-menu-transition"),10);this._transitionTimeout=setTimeout(function(){a.$el.removeClass("on-move")},b),this._onClose()},toRight:function(){e.MovableView.prototype.toRight.apply(this,arguments),this._$backdrop.addClass("in"),this._$backdrop.css("opacity","0.8"),this._onOpen()},_setCss:function(a){if(a&&a.x&&"undefined"!=typeof a.x){var b=parseInt(a.x,10);if(!isNaN(b))return this._setOpacity(this._getOpacityByPosition(a.x)),e.MovableView.prototype._setCss.apply(this,arguments)}return void 0},_getOpacityByPosition:function(a){var b=0===a?a:parseInt(10-this._rightEdge/a,10)/10;return 0>b&&(b=0),b>1&&(b=1),isNaN(b)?void 0:b},_setOpacity:function(a){this._$backdrop.css("opacity",a)},_getMovableContent:function(){return this.$el.find(".movable-container")},_drag:function(){e.MovableView.prototype._drag.apply(this,arguments),window.clearTimeout(this._transitionTimeout)},_onClose:function(){this.onClose()},_onOpen:function(){this.onOpen()},onClose:function(){},onOpen:function(){}}),e.Themes.registerTemplateForTheme(e.Themes.DEFAULT_THEME,"header-layout",'<div data-childviews="header" class="header"></div>'),e.HeaderLayout=e.Layout.extend({_type:"header-layout",template:e.Themes.getTemplateByName("header-layout"),applyViews:function(a){var b="header";return!this.childViews[b]&&a.header&&this.addChildView(b,a.header),a.header&&!this._firstRender&&(this.$el.find('[data-childviews="'+b+'"]').html(""),this.$el.find('[data-childviews="'+b+'"]').html(a.header.render().$el)),this}}),e.Themes.registerTemplateForTheme(e.Themes.DEFAULT_THEME,"bottom-bar-layout",'<div class="bottom-bar"></div>'),e.BottomBarLayout=e.Layout.extend({_type:"bottom-bar-layout",template:e.Themes.getTemplateByName("bottom-bar-layout")}),e.Themes.registerTemplateForTheme(e.Themes.DEFAULT_THEME,"switch-layout",'<div id="m-main" class="m-perspective"><div class="m-page m-page-1"><div data-childviews="content_page1" class="content-wrapper"></div></div><div class="m-page m-page-2"><div data-childviews="content_page2" class="content-wrapper"></div></div></div>'),e.SwitchLayout=e.Layout.extend({_type:"M.SwitchLayout",template:e.Themes.getTemplateByName("switch-layout"),_currentPage:null,applyViews:function(a){return null===this._currentPage||void 0===this._currentPage||"content_page2"===this._currentPage?this._currentPage="content_page1":"content_page1"===this._currentPage&&(this._currentPage="content_page2"),this.childViews[this._currentPage]?this.childViews[this._currentPage]!==a.content&&a.content&&this.setChildView(this._currentPage,a.content):a.content&&this.setChildView(this._currentPage,a.content),this._firstRender||(this.$el.find('[data-childviews="'+this._currentPage+'"]').html(""),this.$el.find('[data-childviews="'+this._currentPage+'"]').html(a.content.render().$el)),e.Layout.prototype.applyViews.apply(this,arguments),this},_postRender:function(){this._firstRender&&e.PageTransitions.init(this.$el.find("#m-main")),e.Layout.prototype._postRender.apply(this,arguments)}});var f=d('<div class="wrap"> <div class="left-panel firstLeft"> <div class="action-menu-close"></div> <div class="content"></div> </div> <div class="right-panel"> <div class="content"></div> </div> </div>');f.find(".right-panel").before(e.SwitchLayout.prototype.template),e.Themes.registerTemplateForTheme(e.Themes.DEFAULT_THEME,"swipe-layout",f),e.SwipeLayout=e.SwitchLayout.extend({_type:"M.SwipeLayout",template:e.Themes.getTemplateByName("swipe-layout"),leftPanelIsOpen:null,rightThreshold:null,initialize:function(){e.SwitchLayout.prototype.initialize.call(this);var a=d(window).width();this.rightThreshold=a/100*80},toggleRightPanel:function(){this.closeLeftPanel(),d(".right-panel").toggleClass("show")},closeRightPanel:function(){d(".right-panel").removeClass("show")},toggleLeftPanel:function(){this.closeRightPanel(),this.leftPanelIsOpen?this.closeLeftPanel():this.openLeftPanel()},startMoveLeftPanel:function(a){if(a&&a.originalEvent){a.stopPropagation(),a.preventDefault();var b=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0];this.moveStart=this.leftPanelIsOpen?0:b.pageX}},stopMoveLeftPanel:function(a){a.stopPropagation(),a.preventDefault(),d("#m-main").addClass("easing"),this.leftPanelIsOpen?this.closeLeftPanel():this.openLeftPanel(),setTimeout(function(){d("#m-main").removeClass("easing")},500)},moveLeftPanel:function(a){var b=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0],c=b.pageX-this.moveStart;0>=c?c=0:c>=this.rightThreshold?c=this.rightThreshold:d("#m-main").css("-webkit-transform","translate3d("+c+"px, 0, 0)")},closeLeftPanel:function(){d("#m-main").css("-webkit-transform","translate3d(0px, 0, 0)"),this.leftPanelIsOpen=!1},openLeftPanel:function(){d("#m-main").css("-webkit-transform","translate3d("+this.rightThreshold+"px, 0, 0)"),this.leftPanelIsOpen=!0}}),e.TabLayout=e.Layout.extend({_tabMenu:null,_type:"M.TabLayout",scrolling:NO,smoothScrollAnimation:YES,template:'<div id="m-main" class="m-perspective"><div data-childviews="tab-menu"></div><div data-childviews="tab-content"></div></div>',switchToTabCallback:null,initialize:function(){this._tabMenu=e.TabbarButtonGroupView.extend({},{}).create(this,null,YES)},_render:function(){e.Layout.prototype._render.apply(this,arguments)},_postRender:function(){if(e.Layout.prototype._postRender.apply(this,arguments),this.$el.addClass(this.scrolling?"scrolling":""),this.$scrollContainer=this.$el.find("[data-childviews=tab-menu]"),this.scrolling){var a=parseInt(e.ThemeVars.get("tablayout-menu-scroll-button-width"),10)*Object.keys(this._tabMenu.childViews).length;this.$scrollContainer.children(".tabbarbuttongroupview").css("width",a+"px")}},switchToTab:function(a){0>a||a>=Object.keys(this._tabMenu.childViews).length||(this._scrollToTab(a),this._tabMenu.setActive(a),this.$el.find(".m-tab.m-page-current").removeClass("m-page-current"),this.childViews["tab-content"][a].$el.addClass("m-page-current"),this.switchToTabCallback&&"function"==typeof this.switchToTabCallback&&this.switchToTabCallback(a))},_scrollToTab:function(a){if(this.$scrollContainer){var b=parseInt(e.ThemeVars.get("tablayout-menu-scroll-button-width"),10),c=a*b-50;this.smoothScrollAnimation?this.$scrollContainer.stop().animate({scrollLeft:c},200):this.$scrollContainer.scrollLeft(c)}},applyViews:function(a){var b=[],c="col-xs-"+Math.floor(12/a.length);this.scrolling&&(c="");for(var d=0;d<a.length;d++){var e=this._createButton({index:d,grid:c,headline:a[d].headline,icon:a[d].icon});this._tabMenu.addChildView("button"+d,e),b.push(this._extendContent({index:d,content:a[d].content}))}this.addChildView("tab-menu",this._tabMenu),this.addChildView("tab-content",b)},_createButton:function(a){var b=this;return e.ButtonView.extend({value:a.headline,index:a.index,grid:a.grid,icon:a.icon,events:{tap:function(a,c){b.switchToTab(c.index)}}}).create()},_extendContent:function(a){var b=this;return a.content.extend({events:{dragleft:function(){b.switchToTab(a.index+1)},dragright:function(){b.switchToTab(a.index-1)}}}).create()},_mergeChildView:function(a,b){return this.childViews[a]=b,this}}),function(){var a=e.SwitchLayout.prototype.template,b=e.HeaderLayout.prototype.template,c=a.replace(/m-page-1">/gi,'m-page-1">'+b.replace(/data-childviews="header"/gi,'data-childviews="content_page1_header"'));c=c.replace(/m-page-2">/gi,'m-page-2">'+b.replace(/data-childviews="header"/gi,'data-childviews="content_page2_header"')),e.SwitchHeaderContentLayout=e.SwitchLayout.extend({_type:"M.SwitchHeaderContentLayout",template:c,cssClass:"switch-header-content-layout",applyViews:function(a){return e.SwitchLayout.prototype.applyViews.apply(this,[a]),!this.childViews[this._currentPage+"_header"]&&a.header&&this.setChildView(this._currentPage+"_header",a.header),a.header&&!this._firstRender&&(this.$el.find('[data-childviews="'+this._currentPage+'_header"]').html(""),this.$el.find('[data-childviews="'+this._currentPage+'_header"]').html(a.header.render().$el)),this}})}(this),function(){var a=e.SwitchLayout.prototype.template,b=e.HeaderLayout.prototype.template,c=a.replace(/m-page-1">/gi,'m-page-1">'+b.replace(/data-childviews="header"/gi,'data-childviews="content_page1_header"'));c=c.replace(/m-page-2">/gi,'m-page-2">'+b.replace(/data-childviews="header"/gi,'data-childviews="content_page2_header"')),e.SwitchMenuHeaderContentLayout=e.SwitchHeaderContentLayout.extend({_type:"M.SwitchHeaderContentLayout",template:c,cssClass:"switch-menu-header-content-layout",menu:null,applyViews:function(a){this.menu||(a.menuContent&&e.MenuView.prototype.isPrototypeOf(a.menuContent)?(this.menu=a.menuContent,this.setChildView("menu",a.menuContent),this.menu.render(),this.$el.append(this.menu.$el)):(this.menu=e.MenuView.extend().create(),this.setChildView("menu",this.menu),this.menu.setChildView("menu-content",a.menuContent),this.menu.render(),this.$el.append(this.menu.$el)));return e.SwitchHeaderContentLayout.prototype.applyViews.apply(this,[a]),this}})}(this),function(){var a=e.SwitchLayout.prototype.template,b=e.HeaderLayout.prototype.template,c=a.replace(/m-page-1">/gi,'m-page-1">'+b.replace(/data-childviews="header"/gi,'data-childviews="content_page1_header"'));c=c.replace(/m-page-2">/gi,'m-page-2">'+b.replace(/data-childviews="header"/gi,'data-childviews="content_page2_header"')),e.SwitchHeaderContentLayout=e.SwitchLayout.extend({_type:"M.SwitchHeaderContentLayout",template:c,cssClass:"switch-header-content-layout",applyViews:function(a){return e.SwitchLayout.prototype.applyViews.apply(this,[a]),!this.childViews[this._currentPage+"_header"]&&a.header&&this.setChildView(this._currentPage+"_header",a.header),a.header&&!this._firstRender&&(this.$el.find('[data-childviews="'+this._currentPage+'_header"]').html(""),this.$el.find('[data-childviews="'+this._currentPage+'_header"]').html(a.header.render().$el)),this}})}(this),e.SplitLayout=e.SwitchLayout.extend({_type:"M.SplitLayout",gridLeft:"col-xs-4",gridRight:"col-xs-8",template:'<div id="m-main" class="m-perspective"><div id="leftContainer"><div class="m-page m-page-1"><div data-childviews="left_page1"></div></div><div class="m-page m-page-2"><div data-childviews="left_page2"></div></div></div><div id="rightContainer"><div class="m-page m-page-1"><div data-childviews="content_page1" class="content-wrapper"></div></div><div class="m-page m-page-2"><div data-childviews="content_page2" class="content-wrapper"></div></div></div></div>',_currentPage:null,initialize:function(){e.View.prototype.initialize.apply(this,arguments)},applyViews:function(a){var b=this._mapViews(this._currentContent,"content",a.content),c=this._mapViews(this._currentLeft,"left",a.left);return this._startTransition(a.left,a.content),this._currentContent=b,this._currentLeft=c,this},_startTransition:function(a,b){var c=this.getChildView(this._currentContent),d=this.getChildView(this._currentLeft);c&&c!==b&&this.rightTransition.startTransition(),d&&d!==a&&this.leftTransition.startTransition()},_mapViews:function(a,b,c){var d=b+"_page1",f=b+"_page2";return this.getChildView(a)!==c&&c?(null===a||void 0===a||a===f?a=d:a===d&&(a=f),c&&!this.childViews[a]?this.setChildView(a,c):c&&this.childViews[a]!==c&&this.setChildView(a,c),!this._firstRender&&c&&(this.$el.find('[data-childviews="'+a+'"]').html(""),this.$el.find('[data-childviews="'+a+'"]').html(c.render().$el)),e.Layout.prototype.applyViews.apply(this,arguments),a):(c||(this.$el.find('[data-childviews="'+d+'"]').html(""),this.$el.find('[data-childviews="'+f+'"]').html("")),a)},_postRender:function(){return this._getLeftContainer().addClass(this.gridLeft),this._getRightContainer().addClass(this.gridRight),this._firstRender&&(this.rightTransition=e.PageTransitions.design().init(this._getRightContainer()),this.leftTransition=e.PageTransitions.design().init(this._getLeftContainer()),setTimeout(c.bind(this._initRequire,this),0)),e.Layout.prototype._postRender.apply(this,arguments),this},_initRequire:function(){return"mobile"===Modernizr.Detectizr.device.type?void this._onPortrait():(enquire.register("screen and (orientation: landscape)",{match:c.bind(this._onLandscape,this),unmatch:c.bind(this._onPortrait,this)}),void(window.innerWidth<window.innerHeight?this._onPortrait():this._onLandscape()))},_onLandscape:function(){this.$el.addClass("full").removeClass("single"),this._getLeftContainer().attr("class",""),this._getLeftContainer().addClass(this.gridLeft),this._getRightContainer().addClass(this.gridRight),this.onLandscape()},_onPortrait:function(){this.$el.addClass("single").removeClass("full"),this._getLeftContainer().attr("class",""),this.closeLeftContainer(),this._getRightContainer().addClass(this.gridRight).addClass("col-xs-12"),this.onPortrait()},onLandscape:function(){},onPortrait:function(){},_getLeftContainer:function(){return this.$el.find("#leftContainer")},_getRightContainer:function(){return this.$el.find("#rightContainer")},isAnimating:function(){return this.rightTransition.isAnimating()||this.leftTransition.isAnimating()},toggleLeftContainer:function(){this._getLeftContainer().toggleClass("close")},openLeftContainer:function(){this._getLeftContainer().removeClass("close")},closeLeftContainer:function(){this.$el.hasClass("single")&&this._getLeftContainer().addClass("close")}}),function(){"ios"===Modernizr.Detectizr.device.os&&document.addEventListener("DOMContentLoaded",function(){var a=document.createElement("div");a.id="ios7-matchMedia-fix",document.body.appendChild(a);var b,c=function(){a.style.width=window.innerWidth/2+"px"},d=function(){clearTimeout(b),b=setTimeout(c,100)};window.addEventListener("resize",d,!1)})}()}(this,Backbone,_,$);