1234567 |
- function gup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),o=n.exec(window.location.href);return null===o?"":o[1]}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t="length"in e&&e.length,n=J.type(e);return"function"===n||J.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function o(e,t,n){if(J.isFunction(t))return J.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)return J.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(re.test(t))return J.filter(t,e,n);t=J.filter(t,e)}return J.grep(e,function(e){return z.call(t,e)>=0!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t=fe[e]={};return J.each(e.match(he)||[],function(e,n){t[n]=!0}),t}function s(){Z.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1),J.ready()}function r(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=J.expando+r.uid++}function l(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o="data-"+t.replace(we,"-$1").toLowerCase(),n=e.getAttribute(o),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:ye.test(n)?J.parseJSON(n):n}catch(i){}ve.set(e,t,n)}else n=void 0;return n}function u(){return!0}function c(){return!1}function d(){try{return Z.activeElement}catch(e){}}function p(e,t){return J.nodeName(e,"table")&&J.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function h(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function f(e){var t=Le.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n=0,o=e.length;o>n;n++)ge.set(e[n],"globalEval",!t||ge.get(t[n],"globalEval"))}function b(e,t){var n,o,i,a,s,r,l,u;if(1===t.nodeType){if(ge.hasData(e)&&(a=ge.access(e),s=ge.set(t,a),u=a.events)){delete s.handle,s.events={};for(i in u)for(n=0,o=u[i].length;o>n;n++)J.event.add(t,i,u[i][n])}ve.hasData(e)&&(r=ve.access(e),l=J.extend({},r),ve.set(t,l))}}function g(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&J.nodeName(e,t)?J.merge([e],n):n}function v(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Te.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function y(t,n){var o,i=J(n.createElement(t)).appendTo(n.body),a=e.getDefaultComputedStyle&&(o=e.getDefaultComputedStyle(i[0]))?o.display:J.css(i[0],"display");return i.detach(),a}function w(e){var t=Z,n=Re[e];return n||(n=y(e,t),"none"!==n&&n||(He=(He||J("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=He[0].contentDocument,t.write(),t.close(),n=y(e,t),He.detach()),Re[e]=n),n}function x(e,t,n){var o,i,a,s,r=e.style;return n=n||Be(e),n&&(s=n.getPropertyValue(t)||n[t]),n&&(""!==s||J.contains(e.ownerDocument,e)||(s=J.style(e,t)),Ue.test(s)&&Oe.test(t)&&(o=r.width,i=r.minWidth,a=r.maxWidth,r.minWidth=r.maxWidth=r.width=s,s=n.width,r.width=o,r.minWidth=i,r.maxWidth=a)),void 0!==s?s+"":s}function M(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function j(e,t){if(t in e)return t;for(var n=t[0].toUpperCase()+t.slice(1),o=t,i=Ve.length;i--;)if(t=Ve[i]+n,t in e)return t;return o}function T(e,t,n){var o=Xe.exec(t);return o?Math.max(0,o[1]-(n||0))+(o[2]||"px"):t}function k(e,t,n,o,i){for(var a=n===(o?"border":"content")?4:"width"===t?1:0,s=0;4>a;a+=2)"margin"===n&&(s+=J.css(e,n+Me[a],!0,i)),o?("content"===n&&(s-=J.css(e,"padding"+Me[a],!0,i)),"margin"!==n&&(s-=J.css(e,"border"+Me[a]+"Width",!0,i))):(s+=J.css(e,"padding"+Me[a],!0,i),"padding"!==n&&(s+=J.css(e,"border"+Me[a]+"Width",!0,i)));return s}function C(e,t,n){var o=!0,i="width"===t?e.offsetWidth:e.offsetHeight,a=Be(e),s="border-box"===J.css(e,"boxSizing",!1,a);if(0>=i||null==i){if(i=x(e,t,a),(0>i||null==i)&&(i=e.style[t]),Ue.test(i))return i;o=s&&(G.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(s?"border":"content"),o,a)+"px"}function D(e,t){for(var n,o,i,a=[],s=0,r=e.length;r>s;s++)o=e[s],o.style&&(a[s]=ge.get(o,"olddisplay"),n=o.style.display,t?(a[s]||"none"!==n||(o.style.display=""),""===o.style.display&&je(o)&&(a[s]=ge.access(o,"olddisplay",w(o.nodeName)))):(i=je(o),"none"===n&&i||ge.set(o,"olddisplay",i?n:J.css(o,"display"))));for(s=0;r>s;s++)o=e[s],o.style&&(t&&"none"!==o.style.display&&""!==o.style.display||(o.style.display=t?a[s]||"":"none"));return e}function _(e,t,n,o,i){return new _.prototype.init(e,t,n,o,i)}function $(){return setTimeout(function(){Ge=void 0}),Ge=J.now()}function S(e,t){var n,o=0,i={height:e};for(t=t?1:0;4>o;o+=2-t)n=Me[o],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function A(e,t,n){for(var o,i=(nt[t]||[]).concat(nt["*"]),a=0,s=i.length;s>a;a++)if(o=i[a].call(n,t,e))return o}function E(e,t,n){var o,i,a,s,r,l,u,c,d=this,p={},h=e.style,f=e.nodeType&&je(e),m=ge.get(e,"fxshow");n.queue||(r=J._queueHooks(e,"fx"),null==r.unqueued&&(r.unqueued=0,l=r.empty.fire,r.empty.fire=function(){r.unqueued||l()}),r.unqueued++,d.always(function(){d.always(function(){r.unqueued--,J.queue(e,"fx").length||r.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],u=J.css(e,"display"),c="none"===u?ge.get(e,"olddisplay")||w(e.nodeName):u,"inline"===c&&"none"===J.css(e,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(o in t)if(i=t[o],Qe.exec(i)){if(delete t[o],a=a||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!m||void 0===m[o])continue;f=!0}p[o]=m&&m[o]||J.style(e,o)}else u=void 0;if(J.isEmptyObject(p))"inline"===("none"===u?w(e.nodeName):u)&&(h.display=u);else{m?"hidden"in m&&(f=m.hidden):m=ge.access(e,"fxshow",{}),a&&(m.hidden=!f),f?J(e).show():d.done(function(){J(e).hide()}),d.done(function(){var t;ge.remove(e,"fxshow");for(t in p)J.style(e,t,p[t])});for(o in p)s=A(f?m[o]:0,o,d),o in m||(m[o]=s.start,f&&(s.end=s.start,s.start="width"===o||"height"===o?1:0))}}function N(e,t){var n,o,i,a,s;for(n in e)if(o=J.camelCase(n),i=t[o],a=e[n],J.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==o&&(e[o]=a,delete e[n]),s=J.cssHooks[o],s&&"expand"in s){a=s.expand(a),delete e[o];for(n in a)n in e||(e[n]=a[n],t[n]=i)}else t[o]=i}function I(e,t,n){var o,i,a=0,s=tt.length,r=J.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=Ge||$(),n=Math.max(0,u.startTime+u.duration-t),o=n/u.duration||0,a=1-o,s=0,l=u.tweens.length;l>s;s++)u.tweens[s].run(a);return r.notifyWith(e,[u,a,n]),1>a&&l?n:(r.resolveWith(e,[u]),!1)},u=r.promise({elem:e,props:J.extend({},t),opts:J.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Ge||$(),duration:n.duration,tweens:[],createTween:function(t,n){var o=J.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(o),o},stop:function(t){var n=0,o=t?u.tweens.length:0;if(i)return this;for(i=!0;o>n;n++)u.tweens[n].run(1);return t?r.resolveWith(e,[u,t]):r.rejectWith(e,[u,t]),this}}),c=u.props;for(N(c,u.opts.specialEasing);s>a;a++)if(o=tt[a].call(u,e,c,u.opts))return o;return J.map(c,A,u),J.isFunction(u.opts.start)&&u.opts.start.call(e,u),J.fx.timer(J.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function P(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var o,i=0,a=t.toLowerCase().match(he)||[];if(J.isFunction(n))for(;o=a[i++];)"+"===o[0]?(o=o.slice(1)||"*",(e[o]=e[o]||[]).unshift(n)):(e[o]=e[o]||[]).push(n)}}function L(e,t,n,o){function i(r){var l;return a[r]=!0,J.each(e[r]||[],function(e,r){var u=r(t,n,o);return"string"!=typeof u||s||a[u]?s?!(l=u):void 0:(t.dataTypes.unshift(u),i(u),!1)}),l}var a={},s=e===yt;return i(t.dataTypes[0])||!a["*"]&&i("*")}function q(e,t){var n,o,i=J.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:o||(o={}))[n]=t[n]);return o&&J.extend(!0,e,o),e}function F(e,t,n){for(var o,i,a,s,r=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader("Content-Type"));if(o)for(i in r)if(r[i]&&r[i].test(o)){l.unshift(i);break}if(l[0]in n)a=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){a=i;break}s||(s=i)}a=a||s}return a?(a!==l[0]&&l.unshift(a),n[a]):void 0}function H(e,t,n,o){var i,a,s,r,l,u={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)u[s.toLowerCase()]=e.converters[s];for(a=c.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!l&&o&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=c.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(s=u[l+" "+a]||u["* "+a],!s)for(i in u)if(r=i.split(" "),r[1]===a&&(s=u[l+" "+r[0]]||u["* "+r[0]])){s===!0?s=u[i]:u[i]!==!0&&(a=r[0],c.unshift(r[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(d){return{state:"parsererror",error:s?d:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}function R(e,t,n,o){var i;if(J.isArray(t))J.each(t,function(t,i){n||Tt.test(e)?o(e,i):R(e+"["+("object"==typeof i?t:"")+"]",i,n,o)});else if(n||"object"!==J.type(t))o(e,t);else for(i in t)R(e+"["+i+"]",t[i],n,o)}function O(e){return J.isWindow(e)?e:9===e.nodeType&&e.defaultView}var U=[],B=U.slice,W=U.concat,X=U.push,z=U.indexOf,Y={},K=Y.toString,V=Y.hasOwnProperty,G={},Z=e.document,Q="2.1.4",J=function(e,t){return new J.fn.init(e,t)},ee=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,te=/^-ms-/,ne=/-([\da-z])/gi,oe=function(e,t){return t.toUpperCase()};J.fn=J.prototype={jquery:Q,constructor:J,selector:"",length:0,toArray:function(){return B.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:B.call(this)},pushStack:function(e){var t=J.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return J.each(this,e,t)},map:function(e){return this.pushStack(J.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(B.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:X,sort:U.sort,splice:U.splice},J.extend=J.fn.extend=function(){var e,t,n,o,i,a,s=arguments[0]||{},r=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[r]||{},r++),"object"==typeof s||J.isFunction(s)||(s={}),r===l&&(s=this,r--);l>r;r++)if(null!=(e=arguments[r]))for(t in e)n=s[t],o=e[t],s!==o&&(u&&o&&(J.isPlainObject(o)||(i=J.isArray(o)))?(i?(i=!1,a=n&&J.isArray(n)?n:[]):a=n&&J.isPlainObject(n)?n:{},s[t]=J.extend(u,a,o)):void 0!==o&&(s[t]=o));return s},J.extend({expando:"jQuery"+(Q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===J.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!J.isArray(e)&&e-parseFloat(e)+1>=0},isPlainObject:function(e){return"object"!==J.type(e)||e.nodeType||J.isWindow(e)?!1:e.constructor&&!V.call(e.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Y[K.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;e=J.trim(e),e&&(1===e.indexOf("use strict")?(t=Z.createElement("script"),t.text=e,Z.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(te,"ms-").replace(ne,oe)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,o){var i,a=0,s=e.length,r=n(e);if(o){if(r)for(;s>a&&(i=t.apply(e[a],o),i!==!1);a++);else for(a in e)if(i=t.apply(e[a],o),i===!1)break}else if(r)for(;s>a&&(i=t.call(e[a],a,e[a]),i!==!1);a++);else for(a in e)if(i=t.call(e[a],a,e[a]),i===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(ee,"")},makeArray:function(e,t){var o=t||[];return null!=e&&(n(Object(e))?J.merge(o,"string"==typeof e?[e]:e):X.call(o,e)),o},inArray:function(e,t,n){return null==t?-1:z.call(t,e,n)},merge:function(e,t){for(var n=+t.length,o=0,i=e.length;n>o;o++)e[i++]=t[o];return e.length=i,e},grep:function(e,t,n){for(var o,i=[],a=0,s=e.length,r=!n;s>a;a++)o=!t(e[a],a),o!==r&&i.push(e[a]);return i},map:function(e,t,o){var i,a=0,s=e.length,r=n(e),l=[];if(r)for(;s>a;a++)i=t(e[a],a,o),null!=i&&l.push(i);else for(a in e)i=t(e[a],a,o),null!=i&&l.push(i);return W.apply([],l)},guid:1,proxy:function(e,t){var n,o,i;return"string"==typeof t&&(n=e[t],t=e,e=n),J.isFunction(e)?(o=B.call(arguments,2),i=function(){return e.apply(t||this,o.concat(B.call(arguments)))},i.guid=e.guid=e.guid||J.guid++,i):void 0},now:Date.now,support:G}),J.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Y["[object "+t+"]"]=t.toLowerCase()});var ie=function(e){function t(e,t,n,o){var i,a,s,r,l,u,d,h,f,m;if((t?t.ownerDocument||t:R)!==E&&A(t),t=t||E,n=n||[],r=t.nodeType,"string"!=typeof e||!e||1!==r&&9!==r&&11!==r)return n;if(!o&&I){if(11!==r&&(i=ve.exec(e)))if(s=i[1]){if(9===r){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&F(t,a)&&a.id===s)return n.push(a),n}else{if(i[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((s=i[3])&&x.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(s)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=H,f=t,m=1!==r&&e,1===r&&"object"!==t.nodeName.toLowerCase()){for(u=k(e),(d=t.getAttribute("id"))?h=d.replace(we,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=u.length;l--;)u[l]=h+p(u[l]);f=ye.test(e)&&c(t.parentNode)||t,m=u.join(",")}if(m)try{return Q.apply(n,f.querySelectorAll(m)),n}catch(b){}finally{d||t.removeAttribute("id")}}}return D(e.replace(le,"$1"),t,n,o)}function n(){function e(n,o){return t.push(n+" ")>M.cacheLength&&delete e[t.shift()],e[n+" "]=o}var t=[];return e}function o(e){return e[H]=!0,e}function i(e){var t=E.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function a(e,t){for(var n=e.split("|"),o=e.length;o--;)M.attrHandle[n[o]]=t}function s(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function r(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return o(function(t){return t=+t,o(function(n,o){for(var i,a=e([],n.length,t),s=a.length;s--;)n[i=a[s]]&&(n[i]=!(o[i]=n[i]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,o="";n>t;t++)o+=e[t].value;return o}function h(e,t,n){var o=t.dir,i=n&&"parentNode"===o,a=U++;return t.first?function(t,n,a){for(;t=t[o];)if(1===t.nodeType||i)return e(t,n,a)}:function(t,n,s){var r,l,u=[O,a];if(s){for(;t=t[o];)if((1===t.nodeType||i)&&e(t,n,s))return!0}else for(;t=t[o];)if(1===t.nodeType||i){if(l=t[H]||(t[H]={}),(r=l[o])&&r[0]===O&&r[1]===a)return u[2]=r[2];if(l[o]=u,u[2]=e(t,n,s))return!0}}}function f(e){return e.length>1?function(t,n,o){for(var i=e.length;i--;)if(!e[i](t,n,o))return!1;return!0}:e[0]}function m(e,n,o){for(var i=0,a=n.length;a>i;i++)t(e,n[i],o);return o}function b(e,t,n,o,i){for(var a,s=[],r=0,l=e.length,u=null!=t;l>r;r++)(a=e[r])&&(!n||n(a,o,i))&&(s.push(a),u&&t.push(r));return s}function g(e,t,n,i,a,s){return i&&!i[H]&&(i=g(i)),a&&!a[H]&&(a=g(a,s)),o(function(o,s,r,l){var u,c,d,p=[],h=[],f=s.length,g=o||m(t||"*",r.nodeType?[r]:r,[]),v=!e||!o&&t?g:b(g,p,e,r,l),y=n?a||(o?e:f||i)?[]:s:v;if(n&&n(v,y,r,l),i)for(u=b(y,h),i(u,[],r,l),c=u.length;c--;)(d=u[c])&&(y[h[c]]=!(v[h[c]]=d));if(o){if(a||e){if(a){for(u=[],c=y.length;c--;)(d=y[c])&&u.push(v[c]=d);a(null,y=[],u,l)}for(c=y.length;c--;)(d=y[c])&&(u=a?ee(o,d):p[c])>-1&&(o[u]=!(s[u]=d))}}else y=b(y===s?y.splice(f,y.length):y),a?a(null,s,y,l):Q.apply(s,y)})}function v(e){for(var t,n,o,i=e.length,a=M.relative[e[0].type],s=a||M.relative[" "],r=a?1:0,l=h(function(e){return e===t},s,!0),u=h(function(e){return ee(t,e)>-1},s,!0),c=[function(e,n,o){var i=!a&&(o||n!==_)||((t=n).nodeType?l(e,n,o):u(e,n,o));return t=null,i}];i>r;r++)if(n=M.relative[e[r].type])c=[h(f(c),n)];else{if(n=M.filter[e[r].type].apply(null,e[r].matches),n[H]){for(o=++r;i>o&&!M.relative[e[o].type];o++);return g(r>1&&f(c),r>1&&p(e.slice(0,r-1).concat({value:" "===e[r-2].type?"*":""})).replace(le,"$1"),n,o>r&&v(e.slice(r,o)),i>o&&v(e=e.slice(o)),i>o&&p(e))}c.push(n)}return f(c)}function y(e,n){var i=n.length>0,a=e.length>0,s=function(o,s,r,l,u){var c,d,p,h=0,f="0",m=o&&[],g=[],v=_,y=o||a&&M.find.TAG("*",u),w=O+=null==v?1:Math.random()||.1,x=y.length;for(u&&(_=s!==E&&s);f!==x&&null!=(c=y[f]);f++){if(a&&c){for(d=0;p=e[d++];)if(p(c,s,r)){l.push(c);break}u&&(O=w)}i&&((c=!p&&c)&&h--,o&&m.push(c))}if(h+=f,i&&f!==h){for(d=0;p=n[d++];)p(m,g,s,r);if(o){if(h>0)for(;f--;)m[f]||g[f]||(g[f]=G.call(l));g=b(g)}Q.apply(l,g),u&&!o&&g.length>0&&h+n.length>1&&t.uniqueSort(l)}return u&&(O=w,_=v),m};return i?o(s):s}var w,x,M,j,T,k,C,D,_,$,S,A,E,N,I,P,L,q,F,H="sizzle"+1*new Date,R=e.document,O=0,U=0,B=n(),W=n(),X=n(),z=function(e,t){return e===t&&(S=!0),0},Y=1<<31,K={}.hasOwnProperty,V=[],G=V.pop,Z=V.push,Q=V.push,J=V.slice,ee=function(e,t){for(var n=0,o=e.length;o>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",oe="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=oe.replace("w","w#"),ae="\\["+ne+"*("+oe+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",se=":("+oe+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ae+")*)|.*)\\)|)",re=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),de=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),pe=new RegExp(se),he=new RegExp("^"+ie+"$"),fe={ID:new RegExp("^#("+oe+")"),CLASS:new RegExp("^\\.("+oe+")"),TAG:new RegExp("^("+oe.replace("w","w*")+")"),ATTR:new RegExp("^"+ae),PSEUDO:new RegExp("^"+se),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,be=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,we=/'|\\/g,xe=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),Me=function(e,t,n){var o="0x"+t-65536;return o!==o||n?t:0>o?String.fromCharCode(o+65536):String.fromCharCode(o>>10|55296,1023&o|56320)},je=function(){A()};try{Q.apply(V=J.call(R.childNodes),R.childNodes),V[R.childNodes.length].nodeType}catch(Te){Q={apply:V.length?function(e,t){Z.apply(e,J.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}x=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},A=t.setDocument=function(e){var t,n,o=e?e.ownerDocument||e:R;return o!==E&&9===o.nodeType&&o.documentElement?(E=o,N=o.documentElement,n=o.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",je,!1):n.attachEvent&&n.attachEvent("onunload",je)),I=!T(o),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(o.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(o.getElementsByClassName),x.getById=i(function(e){return N.appendChild(e).id=H,!o.getElementsByName||!o.getElementsByName(H).length}),x.getById?(M.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&I){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},M.filter.ID=function(e){var t=e.replace(xe,Me);return function(e){return e.getAttribute("id")===t}}):(delete M.find.ID,M.filter.ID=function(e){var t=e.replace(xe,Me);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),M.find.TAG=x.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):x.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,o=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[i++];)1===n.nodeType&&o.push(n);return o}return a},M.find.CLASS=x.getElementsByClassName&&function(e,t){return I?t.getElementsByClassName(e):void 0},L=[],P=[],(x.qsa=ge.test(o.querySelectorAll))&&(i(function(e){N.appendChild(e).innerHTML="<a id='"+H+"'></a><select id='"+H+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+H+"-]").length||P.push("~="),e.querySelectorAll(":checked").length||P.push(":checked"),e.querySelectorAll("a#"+H+"+*").length||P.push(".#.+[+~]")}),i(function(e){var t=o.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(q=N.matches||N.webkitMatchesSelector||N.mozMatchesSelector||N.oMatchesSelector||N.msMatchesSelector))&&i(function(e){x.disconnectedMatch=q.call(e,"div"),q.call(e,"[s!='']:x"),L.push("!=",se)}),P=P.length&&new RegExp(P.join("|")),L=L.length&&new RegExp(L.join("|")),t=ge.test(N.compareDocumentPosition),F=t||ge.test(N.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,o=t&&t.parentNode;return e===o||!(!o||1!==o.nodeType||!(n.contains?n.contains(o):e.compareDocumentPosition&&16&e.compareDocumentPosition(o)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},z=t?function(e,t){if(e===t)return S=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===o||e.ownerDocument===R&&F(R,e)?-1:t===o||t.ownerDocument===R&&F(R,t)?1:$?ee($,e)-ee($,t):0:4&n?-1:1)}:function(e,t){if(e===t)return S=!0,0;var n,i=0,a=e.parentNode,r=t.parentNode,l=[e],u=[t];if(!a||!r)return e===o?-1:t===o?1:a?-1:r?1:$?ee($,e)-ee($,t):0;if(a===r)return s(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;l[i]===u[i];)i++;return i?s(l[i],u[i]):l[i]===R?-1:u[i]===R?1:0},o):E},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==E&&A(e),n=n.replace(de,"='$1']"),!(!x.matchesSelector||!I||L&&L.test(n)||P&&P.test(n)))try{var o=q.call(e,n);if(o||x.disconnectedMatch||e.document&&11!==e.document.nodeType)return o}catch(i){}return t(n,E,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==E&&A(e),F(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==E&&A(e);var n=M.attrHandle[t.toLowerCase()],o=n&&K.call(M.attrHandle,t.toLowerCase())?n(e,t,!I):void 0;return void 0!==o?o:x.attributes||!I?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],o=0,i=0;if(S=!x.detectDuplicates,$=!x.sortStable&&e.slice(0),e.sort(z),S){for(;t=e[i++];)t===e[i]&&(o=n.push(i));for(;o--;)e.splice(n[o],1)}return $=null,e},j=t.getText=function(e){var t,n="",o=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=j(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[o++];)n+=j(t);return n},M=t.selectors={cacheLength:50,createPseudo:o,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xe,Me),e[3]=(e[3]||e[4]||e[5]||"").replace(xe,Me),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pe.test(n)&&(t=k(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(xe,Me).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=B[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&B(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,o){return function(i){var a=t.attr(i,e);return null==a?"!="===n:n?(a+="","="===n?a===o:"!="===n?a!==o:"^="===n?o&&0===a.indexOf(o):"*="===n?o&&a.indexOf(o)>-1:"$="===n?o&&a.slice(-o.length)===o:"~="===n?(" "+a.replace(re," ")+" ").indexOf(o)>-1:"|="===n?a===o||a.slice(0,o.length+1)===o+"-":!1):!0}},CHILD:function(e,t,n,o,i){var a="nth"!==e.slice(0,3),s="last"!==e.slice(-4),r="of-type"===t;return 1===o&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,p,h,f,m=a!==s?"nextSibling":"previousSibling",b=t.parentNode,g=r&&t.nodeName.toLowerCase(),v=!l&&!r;if(b){if(a){for(;m;){for(d=t;d=d[m];)if(r?d.nodeName.toLowerCase()===g:1===d.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[s?b.firstChild:b.lastChild],s&&v){for(c=b[H]||(b[H]={}),u=c[e]||[],h=u[0]===O&&u[1],p=u[0]===O&&u[2],d=h&&b.childNodes[h];d=++h&&d&&d[m]||(p=h=0)||f.pop();)if(1===d.nodeType&&++p&&d===t){c[e]=[O,h,p];break}}else if(v&&(u=(t[H]||(t[H]={}))[e])&&u[0]===O)p=u[1];else for(;(d=++h&&d&&d[m]||(p=h=0)||f.pop())&&((r?d.nodeName.toLowerCase()!==g:1!==d.nodeType)||!++p||(v&&((d[H]||(d[H]={}))[e]=[O,p]),d!==t)););return p-=i,p===o||p%o===0&&p/o>=0}}},PSEUDO:function(e,n){var i,a=M.pseudos[e]||M.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return a[H]?a(n):a.length>1?(i=[e,e,"",n],M.setFilters.hasOwnProperty(e.toLowerCase())?o(function(e,t){for(var o,i=a(e,n),s=i.length;s--;)o=ee(e,i[s]),e[o]=!(t[o]=i[s])}):function(e){return a(e,0,i)}):a}},pseudos:{not:o(function(e){var t=[],n=[],i=C(e.replace(le,"$1"));return i[H]?o(function(e,t,n,o){for(var a,s=i(e,null,o,[]),r=e.length;r--;)(a=s[r])&&(e[r]=!(t[r]=a))}):function(e,o,a){return t[0]=e,i(t,null,a,n),t[0]=null,!n.pop()}}),has:o(function(e){return function(n){return t(e,n).length>0}}),contains:o(function(e){return e=e.replace(xe,Me),function(t){return(t.textContent||t.innerText||j(t)).indexOf(e)>-1}}),lang:o(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(xe,Me).toLowerCase(),function(t){var n;do if(n=I?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===N},focus:function(e){return e===E.activeElement&&(!E.hasFocus||E.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!M.pseudos.empty(e)},header:function(e){return be.test(e.nodeName)},input:function(e){return me.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[0>n?n+t:n]}),even:u(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var o=0>n?n+t:n;--o>=0;)e.push(o);return e}),gt:u(function(e,t,n){for(var o=0>n?n+t:n;++o<t;)e.push(o);return e})}},M.pseudos.nth=M.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})M.pseudos[w]=r(w);for(w in{submit:!0,reset:!0})M.pseudos[w]=l(w);return d.prototype=M.filters=M.pseudos,M.setFilters=new d,k=t.tokenize=function(e,n){var o,i,a,s,r,l,u,c=W[e+" "];if(c)return n?0:c.slice(0);for(r=e,l=[],u=M.preFilter;r;){(!o||(i=ue.exec(r)))&&(i&&(r=r.slice(i[0].length)||r),l.push(a=[])),o=!1,(i=ce.exec(r))&&(o=i.shift(),a.push({value:o,type:i[0].replace(le," ")}),r=r.slice(o.length));for(s in M.filter)!(i=fe[s].exec(r))||u[s]&&!(i=u[s](i))||(o=i.shift(),a.push({value:o,type:s,matches:i}),r=r.slice(o.length));if(!o)break}return n?r.length:r?t.error(e):W(e,l).slice(0)},C=t.compile=function(e,t){var n,o=[],i=[],a=X[e+" "];if(!a){for(t||(t=k(e)),n=t.length;n--;)a=v(t[n]),a[H]?o.push(a):i.push(a);a=X(e,y(i,o)),a.selector=e}return a},D=t.select=function(e,t,n,o){var i,a,s,r,l,u="function"==typeof e&&e,d=!o&&k(e=u.selector||e);if(n=n||[],1===d.length){if(a=d[0]=d[0].slice(0),a.length>2&&"ID"===(s=a[0]).type&&x.getById&&9===t.nodeType&&I&&M.relative[a[1].type]){if(t=(M.find.ID(s.matches[0].replace(xe,Me),t)||[])[0],!t)return n;u&&(t=t.parentNode),e=e.slice(a.shift().value.length)}for(i=fe.needsContext.test(e)?0:a.length;i--&&(s=a[i],!M.relative[r=s.type]);)if((l=M.find[r])&&(o=l(s.matches[0].replace(xe,Me),ye.test(a[0].type)&&c(t.parentNode)||t))){if(a.splice(i,1),e=o.length&&p(a),!e)return Q.apply(n,o),n;break}}return(u||C(e,d))(o,t,!I,n,ye.test(e)&&c(t.parentNode)||t),n},x.sortStable=H.split("").sort(z).join("")===H,x.detectDuplicates=!!S,A(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(E.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||a("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||a("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||a(te,function(e,t,n){var o;return n?void 0:e[t]===!0?t.toLowerCase():(o=e.getAttributeNode(t))&&o.specified?o.value:null}),t}(e);J.find=ie,J.expr=ie.selectors,J.expr[":"]=J.expr.pseudos,J.unique=ie.uniqueSort,J.text=ie.getText,J.isXMLDoc=ie.isXML,J.contains=ie.contains;var ae=J.expr.match.needsContext,se=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,re=/^.[^:#\[\.,]*$/;J.filter=function(e,t,n){var o=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===o.nodeType?J.find.matchesSelector(o,e)?[o]:[]:J.find.matches(e,J.grep(t,function(e){
- return 1===e.nodeType}))},J.fn.extend({find:function(e){var t,n=this.length,o=[],i=this;if("string"!=typeof e)return this.pushStack(J(e).filter(function(){for(t=0;n>t;t++)if(J.contains(i[t],this))return!0}));for(t=0;n>t;t++)J.find(e,i[t],o);return o=this.pushStack(n>1?J.unique(o):o),o.selector=this.selector?this.selector+" "+e:e,o},filter:function(e){return this.pushStack(o(this,e||[],!1))},not:function(e){return this.pushStack(o(this,e||[],!0))},is:function(e){return!!o(this,"string"==typeof e&&ae.test(e)?J(e):e||[],!1).length}});var le,ue=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ce=J.fn.init=function(e,t){var n,o;if(!e)return this;if("string"==typeof e){if(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:ue.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||le).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof J?t[0]:t,J.merge(this,J.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:Z,!0)),se.test(n[1])&&J.isPlainObject(t))for(n in t)J.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return o=Z.getElementById(n[2]),o&&o.parentNode&&(this.length=1,this[0]=o),this.context=Z,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):J.isFunction(e)?"undefined"!=typeof le.ready?le.ready(e):e(J):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),J.makeArray(e,this))};ce.prototype=J.fn,le=J(Z);var de=/^(?:parents|prev(?:Until|All))/,pe={children:!0,contents:!0,next:!0,prev:!0};J.extend({dir:function(e,t,n){for(var o=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&J(e).is(n))break;o.push(e)}return o},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),J.fn.extend({has:function(e){var t=J(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(J.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,o=0,i=this.length,a=[],s=ae.test(e)||"string"!=typeof e?J(e,t||this.context):0;i>o;o++)for(n=this[o];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&J.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?J.unique(a):a)},index:function(e){return e?"string"==typeof e?z.call(J(e),this[0]):z.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(J.unique(J.merge(this.get(),J(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),J.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return J.dir(e,"parentNode")},parentsUntil:function(e,t,n){return J.dir(e,"parentNode",n)},next:function(e){return i(e,"nextSibling")},prev:function(e){return i(e,"previousSibling")},nextAll:function(e){return J.dir(e,"nextSibling")},prevAll:function(e){return J.dir(e,"previousSibling")},nextUntil:function(e,t,n){return J.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return J.dir(e,"previousSibling",n)},siblings:function(e){return J.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return J.sibling(e.firstChild)},contents:function(e){return e.contentDocument||J.merge([],e.childNodes)}},function(e,t){J.fn[e]=function(n,o){var i=J.map(this,t,n);return"Until"!==e.slice(-5)&&(o=n),o&&"string"==typeof o&&(i=J.filter(o,i)),this.length>1&&(pe[e]||J.unique(i),de.test(e)&&i.reverse()),this.pushStack(i)}});var he=/\S+/g,fe={};J.Callbacks=function(e){e="string"==typeof e?fe[e]||a(e):J.extend({},e);var t,n,o,i,s,r,l=[],u=!e.once&&[],c=function(a){for(t=e.memory&&a,n=!0,r=i||0,i=0,s=l.length,o=!0;l&&s>r;r++)if(l[r].apply(a[0],a[1])===!1&&e.stopOnFalse){t=!1;break}o=!1,l&&(u?u.length&&c(u.shift()):t?l=[]:d.disable())},d={add:function(){if(l){var n=l.length;!function a(t){J.each(t,function(t,n){var o=J.type(n);"function"===o?e.unique&&d.has(n)||l.push(n):n&&n.length&&"string"!==o&&a(n)})}(arguments),o?s=l.length:t&&(i=n,c(t))}return this},remove:function(){return l&&J.each(arguments,function(e,t){for(var n;(n=J.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,r>=n&&r--)}),this},has:function(e){return e?J.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],s=0,this},disable:function(){return l=u=t=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,t||d.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||n&&!u||(t=t||[],t=[e,t.slice?t.slice():t],o?u.push(t):c(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},J.extend({Deferred:function(e){var t=[["resolve","done",J.Callbacks("once memory"),"resolved"],["reject","fail",J.Callbacks("once memory"),"rejected"],["notify","progress",J.Callbacks("memory")]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return J.Deferred(function(n){J.each(t,function(t,a){var s=J.isFunction(e[t])&&e[t];i[a[1]](function(){var e=s&&s.apply(this,arguments);e&&J.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a[0]+"With"](this===o?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?J.extend(e,o):o}},i={};return o.pipe=o.then,J.each(t,function(e,a){var s=a[2],r=a[3];o[a[1]]=s.add,r&&s.add(function(){n=r},t[1^e][2].disable,t[2][2].lock),i[a[0]]=function(){return i[a[0]+"With"](this===i?o:this,arguments),this},i[a[0]+"With"]=s.fireWith}),o.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,o,i=0,a=B.call(arguments),s=a.length,r=1!==s||e&&J.isFunction(e.promise)?s:0,l=1===r?e:J.Deferred(),u=function(e,n,o){return function(i){n[e]=this,o[e]=arguments.length>1?B.call(arguments):i,o===t?l.notifyWith(n,o):--r||l.resolveWith(n,o)}};if(s>1)for(t=new Array(s),n=new Array(s),o=new Array(s);s>i;i++)a[i]&&J.isFunction(a[i].promise)?a[i].promise().done(u(i,o,a)).fail(l.reject).progress(u(i,n,t)):--r;return r||l.resolveWith(o,a),l.promise()}});var me;J.fn.ready=function(e){return J.ready.promise().done(e),this},J.extend({isReady:!1,readyWait:1,holdReady:function(e){e?J.readyWait++:J.ready(!0)},ready:function(e){(e===!0?--J.readyWait:J.isReady)||(J.isReady=!0,e!==!0&&--J.readyWait>0||(me.resolveWith(Z,[J]),J.fn.triggerHandler&&(J(Z).triggerHandler("ready"),J(Z).off("ready"))))}}),J.ready.promise=function(t){return me||(me=J.Deferred(),"complete"===Z.readyState?setTimeout(J.ready):(Z.addEventListener("DOMContentLoaded",s,!1),e.addEventListener("load",s,!1))),me.promise(t)},J.ready.promise();var be=J.access=function(e,t,n,o,i,a,s){var r=0,l=e.length,u=null==n;if("object"===J.type(n)){i=!0;for(r in n)J.access(e,t,r,n[r],!0,a,s)}else if(void 0!==o&&(i=!0,J.isFunction(o)||(s=!0),u&&(s?(t.call(e,o),t=null):(u=t,t=function(e,t,n){return u.call(J(e),n)})),t))for(;l>r;r++)t(e[r],n,s?o:o.call(e[r],r,t(e[r],n)));return i?e:u?t.call(e):l?t(e[0],n):a};J.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},r.uid=1,r.accepts=J.acceptData,r.prototype={key:function(e){if(!r.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=r.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(o){t[this.expando]=n,J.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var o,i=this.key(e),a=this.cache[i];if("string"==typeof t)a[t]=n;else if(J.isEmptyObject(a))J.extend(this.cache[i],t);else for(o in t)a[o]=t[o];return a},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var o;return void 0===t||t&&"string"==typeof t&&void 0===n?(o=this.get(e,t),void 0!==o?o:this.get(e,J.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,o,i,a=this.key(e),s=this.cache[a];if(void 0===t)this.cache[a]={};else{J.isArray(t)?o=t.concat(t.map(J.camelCase)):(i=J.camelCase(t),t in s?o=[t,i]:(o=i,o=o in s?[o]:o.match(he)||[])),n=o.length;for(;n--;)delete s[o[n]]}},hasData:function(e){return!J.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var ge=new r,ve=new r,ye=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,we=/([A-Z])/g;J.extend({hasData:function(e){return ve.hasData(e)||ge.hasData(e)},data:function(e,t,n){return ve.access(e,t,n)},removeData:function(e,t){ve.remove(e,t)},_data:function(e,t,n){return ge.access(e,t,n)},_removeData:function(e,t){ge.remove(e,t)}}),J.fn.extend({data:function(e,t){var n,o,i,a=this[0],s=a&&a.attributes;if(void 0===e){if(this.length&&(i=ve.get(a),1===a.nodeType&&!ge.get(a,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&(o=s[n].name,0===o.indexOf("data-")&&(o=J.camelCase(o.slice(5)),l(a,o,i[o])));ge.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){ve.set(this,e)}):be(this,function(t){var n,o=J.camelCase(e);if(a&&void 0===t){if(n=ve.get(a,e),void 0!==n)return n;if(n=ve.get(a,o),void 0!==n)return n;if(n=l(a,o,void 0),void 0!==n)return n}else this.each(function(){var n=ve.get(this,o);ve.set(this,o,t),-1!==e.indexOf("-")&&void 0!==n&&ve.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){ve.remove(this,e)})}}),J.extend({queue:function(e,t,n){var o;return e?(t=(t||"fx")+"queue",o=ge.get(e,t),n&&(!o||J.isArray(n)?o=ge.access(e,t,J.makeArray(n)):o.push(n)),o||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=J.queue(e,t),o=n.length,i=n.shift(),a=J._queueHooks(e,t),s=function(){J.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),o--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,s,a)),!o&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ge.get(e,n)||ge.access(e,n,{empty:J.Callbacks("once memory").add(function(){ge.remove(e,[t+"queue",n])})})}}),J.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?J.queue(this[0],e):void 0===t?this:this.each(function(){var n=J.queue(this,e,t);J._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&J.dequeue(this,e)})},dequeue:function(e){return this.each(function(){J.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,o=1,i=J.Deferred(),a=this,s=this.length,r=function(){--o||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)n=ge.get(a[s],e+"queueHooks"),n&&n.empty&&(o++,n.empty.add(r));return r(),i.promise(t)}});var xe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Me=["Top","Right","Bottom","Left"],je=function(e,t){return e=t||e,"none"===J.css(e,"display")||!J.contains(e.ownerDocument,e)},Te=/^(?:checkbox|radio)$/i;!function(){var e=Z.createDocumentFragment(),t=e.appendChild(Z.createElement("div")),n=Z.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),G.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",G.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var ke="undefined";G.focusinBubbles="onfocusin"in e;var Ce=/^key/,De=/^(?:mouse|pointer|contextmenu)|click/,_e=/^(?:focusinfocus|focusoutblur)$/,$e=/^([^.]*)(?:\.(.+)|)$/;J.event={global:{},add:function(e,t,n,o,i){var a,s,r,l,u,c,d,p,h,f,m,b=ge.get(e);if(b)for(n.handler&&(a=n,n=a.handler,i=a.selector),n.guid||(n.guid=J.guid++),(l=b.events)||(l=b.events={}),(s=b.handle)||(s=b.handle=function(t){return typeof J!==ke&&J.event.triggered!==t.type?J.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(he)||[""],u=t.length;u--;)r=$e.exec(t[u])||[],h=m=r[1],f=(r[2]||"").split(".").sort(),h&&(d=J.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=J.event.special[h]||{},c=J.extend({type:h,origType:m,data:o,handler:n,guid:n.guid,selector:i,needsContext:i&&J.expr.match.needsContext.test(i),namespace:f.join(".")},a),(p=l[h])||(p=l[h]=[],p.delegateCount=0,d.setup&&d.setup.call(e,o,f,s)!==!1||e.addEventListener&&e.addEventListener(h,s,!1)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),J.event.global[h]=!0)},remove:function(e,t,n,o,i){var a,s,r,l,u,c,d,p,h,f,m,b=ge.hasData(e)&&ge.get(e);if(b&&(l=b.events)){for(t=(t||"").match(he)||[""],u=t.length;u--;)if(r=$e.exec(t[u])||[],h=m=r[1],f=(r[2]||"").split(".").sort(),h){for(d=J.event.special[h]||{},h=(o?d.delegateType:d.bindType)||h,p=l[h]||[],r=r[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=a=p.length;a--;)c=p[a],!i&&m!==c.origType||n&&n.guid!==c.guid||r&&!r.test(c.namespace)||o&&o!==c.selector&&("**"!==o||!c.selector)||(p.splice(a,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));s&&!p.length&&(d.teardown&&d.teardown.call(e,f,b.handle)!==!1||J.removeEvent(e,h,b.handle),delete l[h])}else for(h in l)J.event.remove(e,h+t[u],n,o,!0);J.isEmptyObject(l)&&(delete b.handle,ge.remove(e,"events"))}},trigger:function(t,n,o,i){var a,s,r,l,u,c,d,p=[o||Z],h=V.call(t,"type")?t.type:t,f=V.call(t,"namespace")?t.namespace.split("."):[];if(s=r=o=o||Z,3!==o.nodeType&&8!==o.nodeType&&!_e.test(h+J.event.triggered)&&(h.indexOf(".")>=0&&(f=h.split("."),h=f.shift(),f.sort()),u=h.indexOf(":")<0&&"on"+h,t=t[J.expando]?t:new J.Event(h,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=f.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=o),n=null==n?[t]:J.makeArray(n,[t]),d=J.event.special[h]||{},i||!d.trigger||d.trigger.apply(o,n)!==!1)){if(!i&&!d.noBubble&&!J.isWindow(o)){for(l=d.delegateType||h,_e.test(l+h)||(s=s.parentNode);s;s=s.parentNode)p.push(s),r=s;r===(o.ownerDocument||Z)&&p.push(r.defaultView||r.parentWindow||e)}for(a=0;(s=p[a++])&&!t.isPropagationStopped();)t.type=a>1?l:d.bindType||h,c=(ge.get(s,"events")||{})[t.type]&&ge.get(s,"handle"),c&&c.apply(s,n),c=u&&s[u],c&&c.apply&&J.acceptData(s)&&(t.result=c.apply(s,n),t.result===!1&&t.preventDefault());return t.type=h,i||t.isDefaultPrevented()||d._default&&d._default.apply(p.pop(),n)!==!1||!J.acceptData(o)||u&&J.isFunction(o[h])&&!J.isWindow(o)&&(r=o[u],r&&(o[u]=null),J.event.triggered=h,o[h](),J.event.triggered=void 0,r&&(o[u]=r)),t.result}},dispatch:function(e){e=J.event.fix(e);var t,n,o,i,a,s=[],r=B.call(arguments),l=(ge.get(this,"events")||{})[e.type]||[],u=J.event.special[e.type]||{};if(r[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(s=J.event.handlers.call(this,e,l),t=0;(i=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,o=((J.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,r),void 0!==o&&(e.result=o)===!1&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,o,i,a,s=[],r=t.delegateCount,l=e.target;if(r&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(o=[],n=0;r>n;n++)a=t[n],i=a.selector+" ",void 0===o[i]&&(o[i]=a.needsContext?J(i,this).index(l)>=0:J.find(i,this,null,[l]).length),o[i]&&o.push(a);o.length&&s.push({elem:l,handlers:o})}return r<t.length&&s.push({elem:this,handlers:t.slice(r)}),s},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(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,o,i,a=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||Z,o=n.documentElement,i=n.body,e.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)),e.which||void 0===a||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[J.expando])return e;var t,n,o,i=e.type,a=e,s=this.fixHooks[i];for(s||(this.fixHooks[i]=s=De.test(i)?this.mouseHooks:Ce.test(i)?this.keyHooks:{}),o=s.props?this.props.concat(s.props):this.props,e=new J.Event(a),t=o.length;t--;)n=o[t],e[n]=a[n];return e.target||(e.target=Z),3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,a):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==d()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===d()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&J.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return J.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,o){var i=J.extend(new J.Event,n,{type:e,isSimulated:!0,originalEvent:{}});o?J.event.trigger(i,null,t):J.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},J.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},J.Event=function(e,t){return this instanceof J.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?u:c):this.type=e,t&&J.extend(this,t),this.timeStamp=e&&e.timeStamp||J.now(),void(this[J.expando]=!0)):new J.Event(e,t)},J.Event.prototype={isDefaultPrevented:c,isPropagationStopped:c,isImmediatePropagationStopped:c,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=u,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},J.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){J.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,o=this,i=e.relatedTarget,a=e.handleObj;return(!i||i!==o&&!J.contains(o,i))&&(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}}),G.focusinBubbles||J.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){J.event.simulate(t,e.target,J.event.fix(e),!0)};J.event.special[t]={setup:function(){var o=this.ownerDocument||this,i=ge.access(o,t);i||o.addEventListener(e,n,!0),ge.access(o,t,(i||0)+1)},teardown:function(){var o=this.ownerDocument||this,i=ge.access(o,t)-1;i?ge.access(o,t,i):(o.removeEventListener(e,n,!0),ge.remove(o,t))}}}),J.fn.extend({on:function(e,t,n,o,i){var a,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==o?(o=t,n=t=void 0):null==o&&("string"==typeof t?(o=n,n=void 0):(o=n,n=t,t=void 0)),o===!1)o=c;else if(!o)return this;return 1===i&&(a=o,o=function(e){return J().off(e),a.apply(this,arguments)},o.guid=a.guid||(a.guid=J.guid++)),this.each(function(){J.event.add(this,e,o,n,t)})},one:function(e,t,n,o){return this.on(e,t,n,o,1)},off:function(e,t,n){var o,i;if(e&&e.preventDefault&&e.handleObj)return o=e.handleObj,J(e.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=c),this.each(function(){J.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){J.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?J.event.trigger(e,t,n,!0):void 0}});var Se=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ae=/<([\w:]+)/,Ee=/<|&#?\w+;/,Ne=/<(?:script|style|link)/i,Ie=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^$|\/(?:java|ecma)script/i,Le=/^true\/(.*)/,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Fe={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,"",""]};Fe.optgroup=Fe.option,Fe.tbody=Fe.tfoot=Fe.colgroup=Fe.caption=Fe.thead,Fe.th=Fe.td,J.extend({clone:function(e,t,n){var o,i,a,s,r=e.cloneNode(!0),l=J.contains(e.ownerDocument,e);if(!(G.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||J.isXMLDoc(e)))for(s=g(r),a=g(e),o=0,i=a.length;i>o;o++)v(a[o],s[o]);if(t)if(n)for(a=a||g(e),s=s||g(r),o=0,i=a.length;i>o;o++)b(a[o],s[o]);else b(e,r);return s=g(r,"script"),s.length>0&&m(s,!l&&g(e,"script")),r},buildFragment:function(e,t,n,o){for(var i,a,s,r,l,u,c=t.createDocumentFragment(),d=[],p=0,h=e.length;h>p;p++)if(i=e[p],i||0===i)if("object"===J.type(i))J.merge(d,i.nodeType?[i]:i);else if(Ee.test(i)){for(a=a||c.appendChild(t.createElement("div")),s=(Ae.exec(i)||["",""])[1].toLowerCase(),r=Fe[s]||Fe._default,a.innerHTML=r[1]+i.replace(Se,"<$1></$2>")+r[2],u=r[0];u--;)a=a.lastChild;J.merge(d,a.childNodes),a=c.firstChild,a.textContent=""}else d.push(t.createTextNode(i));for(c.textContent="",p=0;i=d[p++];)if((!o||-1===J.inArray(i,o))&&(l=J.contains(i.ownerDocument,i),a=g(c.appendChild(i),"script"),l&&m(a),n))for(u=0;i=a[u++];)Pe.test(i.type||"")&&n.push(i);return c},cleanData:function(e){for(var t,n,o,i,a=J.event.special,s=0;void 0!==(n=e[s]);s++){if(J.acceptData(n)&&(i=n[ge.expando],i&&(t=ge.cache[i]))){if(t.events)for(o in t.events)a[o]?J.event.remove(n,o):J.removeEvent(n,o,t.handle);ge.cache[i]&&delete ge.cache[i]}delete ve.cache[n[ve.expando]]}}}),J.fn.extend({text:function(e){return be(this,function(e){return void 0===e?J.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=p(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=p(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,o=e?J.filter(e,this):this,i=0;null!=(n=o[i]);i++)t||1!==n.nodeType||J.cleanData(g(n)),n.parentNode&&(t&&J.contains(n.ownerDocument,n)&&m(g(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(J.cleanData(g(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return J.clone(this,e,t)})},html:function(e){return be(this,function(e){var t=this[0]||{},n=0,o=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!Fe[(Ae.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Se,"<$1></$2>");try{for(;o>n;n++)t=this[n]||{},1===t.nodeType&&(J.cleanData(g(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,J.cleanData(g(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=W.apply([],e);var n,o,i,a,s,r,l=0,u=this.length,c=this,d=u-1,p=e[0],m=J.isFunction(p);if(m||u>1&&"string"==typeof p&&!G.checkClone&&Ie.test(p))return this.each(function(n){var o=c.eq(n);m&&(e[0]=p.call(this,n,o.html())),o.domManip(e,t)});if(u&&(n=J.buildFragment(e,this[0].ownerDocument,!1,this),o=n.firstChild,1===n.childNodes.length&&(n=o),o)){for(i=J.map(g(n,"script"),h),a=i.length;u>l;l++)s=n,l!==d&&(s=J.clone(s,!0,!0),a&&J.merge(i,g(s,"script"))),t.call(this[l],s,l);if(a)for(r=i[i.length-1].ownerDocument,J.map(i,f),l=0;a>l;l++)s=i[l],Pe.test(s.type||"")&&!ge.access(s,"globalEval")&&J.contains(r,s)&&(s.src?J._evalUrl&&J._evalUrl(s.src):J.globalEval(s.textContent.replace(qe,"")))}return this}}),J.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){J.fn[e]=function(e){for(var n,o=[],i=J(e),a=i.length-1,s=0;a>=s;s++)n=s===a?this:this.clone(!0),J(i[s])[t](n),X.apply(o,n.get());return this.pushStack(o)}});var He,Re={},Oe=/^margin/,Ue=new RegExp("^("+xe+")(?!px)[a-z%]+$","i"),Be=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)};!function(){function t(){s.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",s.innerHTML="",i.appendChild(a);var t=e.getComputedStyle(s,null);n="1%"!==t.top,o="4px"===t.width,i.removeChild(a)}var n,o,i=Z.documentElement,a=Z.createElement("div"),s=Z.createElement("div");s.style&&(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",G.clearCloneStyle="content-box"===s.style.backgroundClip,a.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",a.appendChild(s),e.getComputedStyle&&J.extend(G,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return null==o&&t(),o},reliableMarginRight:function(){var t,n=s.appendChild(Z.createElement("div"));return n.style.cssText=s.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",s.style.width="1px",i.appendChild(a),t=!parseFloat(e.getComputedStyle(n,null).marginRight),i.removeChild(a),s.removeChild(n),t}}))}(),J.swap=function(e,t,n,o){var i,a,s={};for(a in t)s[a]=e.style[a],e.style[a]=t[a];i=n.apply(e,o||[]);for(a in t)e.style[a]=s[a];return i};var We=/^(none|table(?!-c[ea]).+)/,Xe=new RegExp("^("+xe+")(.*)$","i"),ze=new RegExp("^([+-])=("+xe+")","i"),Ye={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"},Ve=["Webkit","O","Moz","ms"];J.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=x(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,s,r=J.camelCase(t),l=e.style;return t=J.cssProps[r]||(J.cssProps[r]=j(l,r)),s=J.cssHooks[t]||J.cssHooks[r],void 0===n?s&&"get"in s&&void 0!==(i=s.get(e,!1,o))?i:l[t]:(a=typeof n,"string"===a&&(i=ze.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(J.css(e,t)),a="number"),void(null!=n&&n===n&&("number"!==a||J.cssNumber[r]||(n+="px"),G.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,o))||(l[t]=n))))}},css:function(e,t,n,o){var i,a,s,r=J.camelCase(t);return t=J.cssProps[r]||(J.cssProps[r]=j(e.style,r)),s=J.cssHooks[t]||J.cssHooks[r],s&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=x(e,t,o)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(a=parseFloat(i),n===!0||J.isNumeric(a)?a||0:i):i}}),J.each(["height","width"],function(e,t){J.cssHooks[t]={get:function(e,n,o){return n?We.test(J.css(e,"display"))&&0===e.offsetWidth?J.swap(e,Ye,function(){return C(e,t,o)}):C(e,t,o):void 0},set:function(e,n,o){var i=o&&Be(e);return T(e,n,o?k(e,t,o,"border-box"===J.css(e,"boxSizing",!1,i),i):0)}}}),J.cssHooks.marginRight=M(G.reliableMarginRight,function(e,t){return t?J.swap(e,{display:"inline-block"},x,[e,"marginRight"]):void 0}),J.each({margin:"",padding:"",border:"Width"},function(e,t){J.cssHooks[e+t]={expand:function(n){for(var o=0,i={},a="string"==typeof n?n.split(" "):[n];4>o;o++)i[e+Me[o]+t]=a[o]||a[o-2]||a[0];return i}},Oe.test(e)||(J.cssHooks[e+t].set=T)}),J.fn.extend({css:function(e,t){return be(this,function(e,t,n){var o,i,a={},s=0;if(J.isArray(t)){for(o=Be(e),i=t.length;i>s;s++)a[t[s]]=J.css(e,t[s],!1,o);return a}return void 0!==n?J.style(e,t,n):J.css(e,t)},e,t,arguments.length>1)},show:function(){return D(this,!0)},hide:function(){return D(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){je(this)?J(this).show():J(this).hide()})}}),J.Tween=_,_.prototype={constructor:_,init:function(e,t,n,o,i,a){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=o,this.unit=a||(J.cssNumber[n]?"":"px")},cur:function(){var e=_.propHooks[this.prop];return e&&e.get?e.get(this):_.propHooks._default.get(this)},run:function(e){var t,n=_.propHooks[this.prop];return this.pos=t=this.options.duration?J.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):_.propHooks._default.set(this),this}},_.prototype.init.prototype=_.prototype,_.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=J.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){J.fx.step[e.prop]?J.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[J.cssProps[e.prop]]||J.cssHooks[e.prop])?J.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},_.propHooks.scrollTop=_.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},J.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},J.fx=_.prototype.init,J.fx.step={};var Ge,Ze,Qe=/^(?:toggle|show|hide)$/,Je=new RegExp("^(?:([+-])=|)("+xe+")([a-z%]*)$","i"),et=/queueHooks$/,tt=[E],nt={"*":[function(e,t){var n=this.createTween(e,t),o=n.cur(),i=Je.exec(t),a=i&&i[3]||(J.cssNumber[e]?"":"px"),s=(J.cssNumber[e]||"px"!==a&&+o)&&Je.exec(J.css(n.elem,e)),r=1,l=20;if(s&&s[3]!==a){a=a||s[3],i=i||[],s=+o||1;do r=r||".5",s/=r,J.style(n.elem,e,s+a);while(r!==(r=n.cur()/o)&&1!==r&&--l)}return i&&(s=n.start=+s||+o||0,n.unit=a,n.end=i[1]?s+(i[1]+1)*i[2]:+i[2]),n}]};J.Animation=J.extend(I,{tweener:function(e,t){J.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,o=0,i=e.length;i>o;o++)n=e[o],nt[n]=nt[n]||[],nt[n].unshift(t)},prefilter:function(e,t){t?tt.unshift(e):tt.push(e)}}),J.speed=function(e,t,n){var o=e&&"object"==typeof e?J.extend({},e):{complete:n||!n&&t||J.isFunction(e)&&e,duration:e,easing:n&&t||t&&!J.isFunction(t)&&t};return o.duration=J.fx.off?0:"number"==typeof o.duration?o.duration:o.duration in J.fx.speeds?J.fx.speeds[o.duration]:J.fx.speeds._default,(null==o.queue||o.queue===!0)&&(o.queue="fx"),o.old=o.complete,o.complete=function(){J.isFunction(o.old)&&o.old.call(this),o.queue&&J.dequeue(this,o.queue)},o},J.fn.extend({fadeTo:function(e,t,n,o){return this.filter(je).css("opacity",0).show().end().animate({opacity:t},e,n,o)},animate:function(e,t,n,o){var i=J.isEmptyObject(e),a=J.speed(t,n,o),s=function(){var t=I(this,J.extend({},e),a);(i||ge.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||a.queue===!1?this.each(s):this.queue(a.queue,s)},stop:function(e,t,n){var o=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",a=J.timers,s=ge.get(this);if(i)s[i]&&s[i].stop&&o(s[i]);else for(i in s)s[i]&&s[i].stop&&et.test(i)&&o(s[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));(t||!n)&&J.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=ge.get(this),o=n[e+"queue"],i=n[e+"queueHooks"],a=J.timers,s=o?o.length:0;
- for(n.finish=!0,J.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;s>t;t++)o[t]&&o[t].finish&&o[t].finish.call(this);delete n.finish})}}),J.each(["toggle","show","hide"],function(e,t){var n=J.fn[t];J.fn[t]=function(e,o,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(S(t,!0),e,o,i)}}),J.each({slideDown:S("show"),slideUp:S("hide"),slideToggle:S("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){J.fn[e]=function(e,n,o){return this.animate(t,e,n,o)}}),J.timers=[],J.fx.tick=function(){var e,t=0,n=J.timers;for(Ge=J.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||J.fx.stop(),Ge=void 0},J.fx.timer=function(e){J.timers.push(e),e()?J.fx.start():J.timers.pop()},J.fx.interval=13,J.fx.start=function(){Ze||(Ze=setInterval(J.fx.tick,J.fx.interval))},J.fx.stop=function(){clearInterval(Ze),Ze=null},J.fx.speeds={slow:600,fast:200,_default:400},J.fn.delay=function(e,t){return e=J.fx?J.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var o=setTimeout(t,e);n.stop=function(){clearTimeout(o)}})},function(){var e=Z.createElement("input"),t=Z.createElement("select"),n=t.appendChild(Z.createElement("option"));e.type="checkbox",G.checkOn=""!==e.value,G.optSelected=n.selected,t.disabled=!0,G.optDisabled=!n.disabled,e=Z.createElement("input"),e.value="t",e.type="radio",G.radioValue="t"===e.value}();var ot,it,at=J.expr.attrHandle;J.fn.extend({attr:function(e,t){return be(this,J.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){J.removeAttr(this,e)})}}),J.extend({attr:function(e,t,n){var o,i,a=e.nodeType;return e&&3!==a&&8!==a&&2!==a?typeof e.getAttribute===ke?J.prop(e,t,n):(1===a&&J.isXMLDoc(e)||(t=t.toLowerCase(),o=J.attrHooks[t]||(J.expr.match.bool.test(t)?it:ot)),void 0===n?o&&"get"in o&&null!==(i=o.get(e,t))?i:(i=J.find.attr(e,t),null==i?void 0:i):null!==n?o&&"set"in o&&void 0!==(i=o.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void J.removeAttr(e,t)):void 0},removeAttr:function(e,t){var n,o,i=0,a=t&&t.match(he);if(a&&1===e.nodeType)for(;n=a[i++];)o=J.propFix[n]||n,J.expr.match.bool.test(n)&&(e[o]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!G.radioValue&&"radio"===t&&J.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),it={set:function(e,t,n){return t===!1?J.removeAttr(e,n):e.setAttribute(n,n),n}},J.each(J.expr.match.bool.source.match(/\w+/g),function(e,t){var n=at[t]||J.find.attr;at[t]=function(e,t,o){var i,a;return o||(a=at[t],at[t]=i,i=null!=n(e,t,o)?t.toLowerCase():null,at[t]=a),i}});var st=/^(?:input|select|textarea|button)$/i;J.fn.extend({prop:function(e,t){return be(this,J.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[J.propFix[e]||e]})}}),J.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var o,i,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?(a=1!==s||!J.isXMLDoc(e),a&&(t=J.propFix[t]||t,i=J.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:e[t]=n:i&&"get"in i&&null!==(o=i.get(e,t))?o:e[t]):void 0},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||st.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),G.optSelected||(J.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),J.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){J.propFix[this.toLowerCase()]=this});var rt=/[\t\r\n\f]/g;J.fn.extend({addClass:function(e){var t,n,o,i,a,s,r="string"==typeof e&&e,l=0,u=this.length;if(J.isFunction(e))return this.each(function(t){J(this).addClass(e.call(this,t,this.className))});if(r)for(t=(e||"").match(he)||[];u>l;l++)if(n=this[l],o=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(rt," "):" ")){for(a=0;i=t[a++];)o.indexOf(" "+i+" ")<0&&(o+=i+" ");s=J.trim(o),n.className!==s&&(n.className=s)}return this},removeClass:function(e){var t,n,o,i,a,s,r=0===arguments.length||"string"==typeof e&&e,l=0,u=this.length;if(J.isFunction(e))return this.each(function(t){J(this).removeClass(e.call(this,t,this.className))});if(r)for(t=(e||"").match(he)||[];u>l;l++)if(n=this[l],o=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(rt," "):"")){for(a=0;i=t[a++];)for(;o.indexOf(" "+i+" ")>=0;)o=o.replace(" "+i+" "," ");s=e?J.trim(o):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):this.each(J.isFunction(e)?function(n){J(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,o=0,i=J(this),a=e.match(he)||[];t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===ke||"boolean"===n)&&(this.className&&ge.set(this,"__className__",this.className),this.className=this.className||e===!1?"":ge.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,o=this.length;o>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(rt," ").indexOf(t)>=0)return!0;return!1}});var lt=/\r/g;J.fn.extend({val:function(e){var t,n,o,i=this[0];return arguments.length?(o=J.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=o?e.call(this,n,J(this).val()):e,null==i?i="":"number"==typeof i?i+="":J.isArray(i)&&(i=J.map(i,function(e){return null==e?"":e+""})),t=J.valHooks[this.type]||J.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=J.valHooks[i.type]||J.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(lt,""):null==n?"":n)):void 0}}),J.extend({valHooks:{option:{get:function(e){var t=J.find.attr(e,"value");return null!=t?t:J.trim(J.text(e))}},select:{get:function(e){for(var t,n,o=e.options,i=e.selectedIndex,a="select-one"===e.type||0>i,s=a?null:[],r=a?i+1:o.length,l=0>i?r:a?i:0;r>l;l++)if(n=o[l],!(!n.selected&&l!==i||(G.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&J.nodeName(n.parentNode,"optgroup"))){if(t=J(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,o,i=e.options,a=J.makeArray(t),s=i.length;s--;)o=i[s],(o.selected=J.inArray(o.value,a)>=0)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),J.each(["radio","checkbox"],function(){J.valHooks[this]={set:function(e,t){return J.isArray(t)?e.checked=J.inArray(J(e).val(),t)>=0:void 0}},G.checkOn||(J.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),J.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(e,t){J.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),J.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,o){return this.on(t,e,n,o)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var ut=J.now(),ct=/\?/;J.parseJSON=function(e){return JSON.parse(e+"")},J.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(o){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&J.error("Invalid XML: "+e),t};var dt=/#.*$/,pt=/([?&])_=[^&]*/,ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,ft=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,mt=/^(?:GET|HEAD)$/,bt=/^\/\//,gt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,vt={},yt={},wt="*/".concat("*"),xt=e.location.href,Mt=gt.exec(xt.toLowerCase())||[];J.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt,type:"GET",isLocal:ft.test(Mt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wt,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":J.parseJSON,"text xml":J.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?q(q(e,J.ajaxSettings),t):q(J.ajaxSettings,e)},ajaxPrefilter:P(vt),ajaxTransport:P(yt),ajax:function(e,t){function n(e,t,n,s){var l,c,g,v,w,M=t;2!==y&&(y=2,r&&clearTimeout(r),o=void 0,a=s||"",x.readyState=e>0?4:0,l=e>=200&&300>e||304===e,n&&(v=F(d,x,n)),v=H(d,v,x,l),l?(d.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(J.lastModified[i]=w),w=x.getResponseHeader("etag"),w&&(J.etag[i]=w)),204===e||"HEAD"===d.type?M="nocontent":304===e?M="notmodified":(M=v.state,c=v.data,g=v.error,l=!g)):(g=M,(e||!M)&&(M="error",0>e&&(e=0))),x.status=e,x.statusText=(t||M)+"",l?f.resolveWith(p,[c,M,x]):f.rejectWith(p,[x,M,g]),x.statusCode(b),b=void 0,u&&h.trigger(l?"ajaxSuccess":"ajaxError",[x,d,l?c:g]),m.fireWith(p,[x,M]),u&&(h.trigger("ajaxComplete",[x,d]),--J.active||J.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var o,i,a,s,r,l,u,c,d=J.ajaxSetup({},t),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?J(p):J.event,f=J.Deferred(),m=J.Callbacks("once memory"),b=d.statusCode||{},g={},v={},y=0,w="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(2===y){if(!s)for(s={};t=ht.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===y?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return y||(e=v[n]=v[n]||e,g[e]=t),this},overrideMimeType:function(e){return y||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>y)for(t in e)b[t]=[b[t],e[t]];else x.always(e[x.status]);return this},abort:function(e){var t=e||w;return o&&o.abort(t),n(0,t),this}};if(f.promise(x).complete=m.add,x.success=x.done,x.error=x.fail,d.url=((e||d.url||xt)+"").replace(dt,"").replace(bt,Mt[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=J.trim(d.dataType||"*").toLowerCase().match(he)||[""],null==d.crossDomain&&(l=gt.exec(d.url.toLowerCase()),d.crossDomain=!(!l||l[1]===Mt[1]&&l[2]===Mt[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(Mt[3]||("http:"===Mt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=J.param(d.data,d.traditional)),L(vt,d,t,x),2===y)return x;u=J.event&&d.global,u&&0===J.active++&&J.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!mt.test(d.type),i=d.url,d.hasContent||(d.data&&(i=d.url+=(ct.test(i)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=pt.test(i)?i.replace(pt,"$1_="+ut++):i+(ct.test(i)?"&":"?")+"_="+ut++)),d.ifModified&&(J.lastModified[i]&&x.setRequestHeader("If-Modified-Since",J.lastModified[i]),J.etag[i]&&x.setRequestHeader("If-None-Match",J.etag[i])),(d.data&&d.hasContent&&d.contentType!==!1||t.contentType)&&x.setRequestHeader("Content-Type",d.contentType),x.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+wt+"; q=0.01":""):d.accepts["*"]);for(c in d.headers)x.setRequestHeader(c,d.headers[c]);if(d.beforeSend&&(d.beforeSend.call(p,x,d)===!1||2===y))return x.abort();w="abort";for(c in{success:1,error:1,complete:1})x[c](d[c]);if(o=L(yt,d,t,x)){x.readyState=1,u&&h.trigger("ajaxSend",[x,d]),d.async&&d.timeout>0&&(r=setTimeout(function(){x.abort("timeout")},d.timeout));try{y=1,o.send(g,n)}catch(M){if(!(2>y))throw M;n(-1,M)}}else n(-1,"No Transport");return x},getJSON:function(e,t,n){return J.get(e,t,n,"json")},getScript:function(e,t){return J.get(e,void 0,t,"script")}}),J.each(["get","post"],function(e,t){J[t]=function(e,n,o,i){return J.isFunction(n)&&(i=i||o,o=n,n=void 0),J.ajax({url:e,type:t,dataType:i,data:n,success:o})}}),J._evalUrl=function(e){return J.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},J.fn.extend({wrapAll:function(e){var t;return J.isFunction(e)?this.each(function(t){J(this).wrapAll(e.call(this,t))}):(this[0]&&(t=J(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return this.each(J.isFunction(e)?function(t){J(this).wrapInner(e.call(this,t))}:function(){var t=J(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=J.isFunction(e);return this.each(function(n){J(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){J.nodeName(this,"body")||J(this).replaceWith(this.childNodes)}).end()}}),J.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},J.expr.filters.visible=function(e){return!J.expr.filters.hidden(e)};var jt=/%20/g,Tt=/\[\]$/,kt=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,Dt=/^(?:input|select|textarea|keygen)/i;J.param=function(e,t){var n,o=[],i=function(e,t){t=J.isFunction(t)?t():null==t?"":t,o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=J.ajaxSettings&&J.ajaxSettings.traditional),J.isArray(e)||e.jquery&&!J.isPlainObject(e))J.each(e,function(){i(this.name,this.value)});else for(n in e)R(n,e[n],t,i);return o.join("&").replace(jt,"+")},J.fn.extend({serialize:function(){return J.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=J.prop(this,"elements");return e?J.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!J(this).is(":disabled")&&Dt.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!Te.test(e))}).map(function(e,t){var n=J(this).val();return null==n?null:J.isArray(n)?J.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}}),J.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var _t=0,$t={},St={0:200,1223:204},At=J.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in $t)$t[e]()}),G.cors=!!At&&"withCredentials"in At,G.ajax=At=!!At,J.ajaxTransport(function(e){var t;return G.cors||At&&!e.crossDomain?{send:function(n,o){var i,a=e.xhr(),s=++_t;if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)a[i]=e.xhrFields[i];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)a.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete $t[s],t=a.onload=a.onerror=null,"abort"===e?a.abort():"error"===e?o(a.status,a.statusText):o(St[a.status]||a.status,a.statusText,"string"==typeof a.responseText?{text:a.responseText}:void 0,a.getAllResponseHeaders()))}},a.onload=t(),a.onerror=t("error"),t=$t[s]=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(r){if(t)throw r}},abort:function(){t&&t()}}:void 0}),J.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return J.globalEval(e),e}}}),J.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),J.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(o,i){t=J("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),Z.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Et=[],Nt=/(=)\?(?=&|$)|\?\?/;J.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Et.pop()||J.expando+"_"+ut++;return this[e]=!0,e}}),J.ajaxPrefilter("json jsonp",function(t,n,o){var i,a,s,r=t.jsonp!==!1&&(Nt.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Nt.test(t.data)&&"data");return r||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=J.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,r?t[r]=t[r].replace(Nt,"$1"+i):t.jsonp!==!1&&(t.url+=(ct.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||J.error(i+" was not called"),s[0]},t.dataTypes[0]="json",a=e[i],e[i]=function(){s=arguments},o.always(function(){e[i]=a,t[i]&&(t.jsonpCallback=n.jsonpCallback,Et.push(i)),s&&J.isFunction(a)&&a(s[0]),s=a=void 0}),"script"):void 0}),J.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||Z;var o=se.exec(e),i=!n&&[];return o?[t.createElement(o[1])]:(o=J.buildFragment([e],t,i),i&&i.length&&J(i).remove(),J.merge([],o.childNodes))};var It=J.fn.load;J.fn.load=function(e,t,n){if("string"!=typeof e&&It)return It.apply(this,arguments);var o,i,a,s=this,r=e.indexOf(" ");return r>=0&&(o=J.trim(e.slice(r)),e=e.slice(0,r)),J.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&J.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){a=arguments,s.html(o?J("<div>").append(J.parseHTML(e)).find(o):e)}).complete(n&&function(e,t){s.each(n,a||[e.responseText,t,e])}),this},J.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){J.fn[t]=function(e){return this.on(t,e)}}),J.expr.filters.animated=function(e){return J.grep(J.timers,function(t){return e===t.elem}).length};var Pt=e.document.documentElement;J.offset={setOffset:function(e,t,n){var o,i,a,s,r,l,u,c=J.css(e,"position"),d=J(e),p={};"static"===c&&(e.style.position="relative"),r=d.offset(),a=J.css(e,"top"),l=J.css(e,"left"),u=("absolute"===c||"fixed"===c)&&(a+l).indexOf("auto")>-1,u?(o=d.position(),s=o.top,i=o.left):(s=parseFloat(a)||0,i=parseFloat(l)||0),J.isFunction(t)&&(t=t.call(e,n,r)),null!=t.top&&(p.top=t.top-r.top+s),null!=t.left&&(p.left=t.left-r.left+i),"using"in t?t.using.call(e,p):d.css(p)}},J.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){J.offset.setOffset(this,e,t)});var t,n,o=this[0],i={top:0,left:0},a=o&&o.ownerDocument;return a?(t=a.documentElement,J.contains(t,o)?(typeof o.getBoundingClientRect!==ke&&(i=o.getBoundingClientRect()),n=O(a),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i):void 0},position:function(){if(this[0]){var e,t,n=this[0],o={top:0,left:0};return"fixed"===J.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),J.nodeName(e[0],"html")||(o=e.offset()),o.top+=J.css(e[0],"borderTopWidth",!0),o.left+=J.css(e[0],"borderLeftWidth",!0)),{top:t.top-o.top-J.css(n,"marginTop",!0),left:t.left-o.left-J.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||Pt;e&&!J.nodeName(e,"html")&&"static"===J.css(e,"position");)e=e.offsetParent;return e||Pt})}}),J.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var o="pageYOffset"===n;J.fn[t]=function(i){return be(this,function(t,i,a){var s=O(t);return void 0===a?s?s[n]:t[i]:void(s?s.scrollTo(o?e.pageXOffset:a,o?a:e.pageYOffset):t[i]=a)},t,i,arguments.length,null)}}),J.each(["top","left"],function(e,t){J.cssHooks[t]=M(G.pixelPosition,function(e,n){return n?(n=x(e,t),Ue.test(n)?J(e).position()[t]+"px":n):void 0})}),J.each({Height:"height",Width:"width"},function(e,t){J.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,o){J.fn[o]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),s=n||(o===!0||i===!0?"margin":"border");return be(this,function(t,n,o){var i;return J.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===o?J.css(t,n,s):J.style(t,n,o,s)},t,a?o:void 0,a,null)}})}),J.fn.size=function(){return this.length},J.fn.andSelf=J.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return J});var Lt=e.jQuery,qt=e.$;return J.noConflict=function(t){return e.$===J&&(e.$=qt),t&&e.jQuery===J&&(e.jQuery=Lt),J},typeof t===ke&&(e.jQuery=e.$=J),J}),function(e,t,n){function o(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function i(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return d[e.which]?d[e.which]:p[e.which]?p[e.which]:String.fromCharCode(e.which).toLowerCase()}function a(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}function s(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function r(e,t){var n,o,i,a=[];for(n=e,"+"===n?n=["+"]:(n=n.replace(/\+{2}/g,"+plus"),n=n.split("+")),i=0;i<n.length;++i)o=n[i],f[o]&&(o=f[o]),t&&"keypress"!=t&&h[o]&&(o=h[o],a.push("shift")),s(o)&&a.push(o);if(n=o,i=t,!i){if(!c){c={};for(var r in d)r>95&&112>r||d.hasOwnProperty(r)&&(c[d[r]]=r)}i=c[n]?"keydown":"keypress"}return"keypress"==i&&a.length&&(i="keydown"),{key:o,modifiers:a,action:i}}function l(e,n){return e===t?!1:e===n?!0:l(e.parentNode,n)}function u(e){function n(e){e=e||{};var t,n=!1;for(t in b)e[t]?n=!0:b[t]=0;n||(y=!1)}function l(e,t,n,o,i,a){var r,l,u=[],c=n.type;if(!f._callbacks[e])return[];for("keyup"==c&&s(e)&&(t=[e]),r=0;r<f._callbacks[e].length;++r)if(l=f._callbacks[e][r],(o||!l.seq||b[l.seq]==l.level)&&c==l.action){var d;(d="keypress"==c&&!n.metaKey&&!n.ctrlKey)||(d=l.modifiers,d=t.sort().join(",")===d.sort().join(",")),d&&(d=o&&l.seq==o&&l.level==a,(!o&&l.combo==i||d)&&f._callbacks[e].splice(r,1),u.push(l))}return u}function c(e,t,n,o){f.stopCallback(t,t.target||t.srcElement,n,o)||!1!==e(t,n)||(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)}function d(e){"number"!=typeof e.which&&(e.which=e.keyCode);var t=i(e);t&&("keyup"==e.type&&g===t?g=!1:f.handleKey(t,a(e),e))}function p(e,t,o,a){function s(t){return function(){y=t,++b[e],clearTimeout(m),m=setTimeout(n,1e3)}}function l(t){c(o,t,e),"keyup"!==a&&(g=i(t)),setTimeout(n,10)}for(var u=b[e]=0;u<t.length;++u){var d=u+1===t.length?l:s(a||r(t[u+1]).action);h(t[u],d,a,e,u)}}function h(e,t,n,o,i){f._directMap[e+":"+n]=t,e=e.replace(/\s+/g," ");var a=e.split(" ");1<a.length?p(e,a,t,n):(n=r(e,n),f._callbacks[n.key]=f._callbacks[n.key]||[],l(n.key,n.modifiers,{type:n.action},o,e,i),f._callbacks[n.key][o?"unshift":"push"]({callback:t,modifiers:n.modifiers,action:n.action,seq:o,level:i,combo:e}))}var f=this;if(e=e||t,!(f instanceof u))return new u(e);f.target=e,f._callbacks={},f._directMap={};var m,b={},g=!1,v=!1,y=!1;f._handleKey=function(e,t,o){var i,a=l(e,t,o);t={};var r=0,u=!1;for(i=0;i<a.length;++i)a[i].seq&&(r=Math.max(r,a[i].level));for(i=0;i<a.length;++i)a[i].seq?a[i].level==r&&(u=!0,t[a[i].seq]=1,c(a[i].callback,o,a[i].combo,a[i].seq)):u||c(a[i].callback,o,a[i].combo);a="keypress"==o.type&&v,o.type!=y||s(e)||a||n(t),v=u&&"keydown"==o.type},f._bindMultiple=function(e,t,n){for(var o=0;o<e.length;++o)h(e[o],t,n)},o(e,"keypress",d),o(e,"keydown",d),o(e,"keyup",d)}var c,d={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},p={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},h={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},f={option:"alt",command:"meta","return":"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"};for(n=1;20>n;++n)d[111+n]="f"+n;for(n=0;9>=n;++n)d[n+96]=n;u.prototype.bind=function(e,t,n){return e=e instanceof Array?e:[e],this._bindMultiple.call(this,e,t,n),this},u.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},u.prototype.trigger=function(e,t){return this._directMap[e+":"+t]&&this._directMap[e+":"+t]({},e),this},u.prototype.reset=function(){return this._callbacks={},this._directMap={},this},u.prototype.stopCallback=function(e,t){return-1<(" "+t.className+" ").indexOf(" mousetrap ")||l(t,this.target)?!1:"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},u.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},u.init=function(){var e,n=u(t);for(e in n)"_"!==e.charAt(0)&&(u[e]=function(e){return function(){return n[e].apply(n,arguments)}}(e))},u.init(),e.Mousetrap=u,"undefined"!=typeof module&&module.exports&&(module.exports=u),"function"==typeof define&&define.amd&&define(function(){return u})}(window,document),function(e){var t={},n=e.prototype.stopCallback;e.prototype.stopCallback=function(e,o,i,a){return this.paused?!0:t[i]||t[a]?!1:n.call(this,e,o,i)},e.prototype.bindGlobal=function(e,n,o){if(this.bind(e,n,o),e instanceof Array)for(n=0;n<e.length;n++)t[e[n]]=!0;else t[e]=!0},e.init()}(Mousetrap),this.basicContext={_overflow:null,_dom:function(e){return null==e?$(".basicContext"):$(".basicContext").find(""+e)},_valid:function(e){return null!=e?(null==e["class"]&&(e["class"]=""),null==e.type&&(e.type="item"),null==e.icon&&(e.icon=""),null==e.title&&(e.title="Undefined"),null==e.fn&&"separator"!==e.type?(console.warn("Missing fn for item '"+e.title+"'"),!1):!0):!1},_build:function(e){var t,n,o;return n=0,t=function(e){var t;if(!basicContext._valid(e))return"";switch(e.num=n++,t="<span class='"+e.icon+"'></span>",""===e.icon&&(t=""),e.type){case"item":return"<tr class='"+e["class"]+"'><td data-num='"+e.num+"'>"+t+e.title+"</td></tr>";case"separator":return"<tr class='separator'></tr>"}},"<div class='basicContextContainer'>\n <div class='basicContext'>\n <table>\n <tbody>\n "+function(){var n,i,a;for(a=[],n=0,i=e.length;i>n;n++)o=e[n],a.push(t(o));return a}().join("")+"\n </tbody>\n </table>\n </div>\n</div>"},_normalizeEvent:function(e){var t;return null!=e&&"touchend"===e.type&&null==e.pageX&&null==e.pageY&&(t=e.originalEvent.changedTouches,t.length>0&&(e.pageX=t[0].pageX,e.pageY=t[0].pageY)),e},_getPosition:function(e){var t,n,o,i;return e=basicContext._normalizeEvent(e),o=e.pageX,i=e.pageY-$(document).scrollTop(),t={width:$(window).width(),height:$(window).height()},(null==o||0>o)&&(o=0),(null==i||0>i)&&(i=0),o>t.width&&(o=t.width),i>t.height&&(i=t.height),n={width:basicContext._dom().outerWidth(!0),height:basicContext._dom().outerHeight(!0)},o+n.width>t.width&&(o-=n.width),i+n.height>t.height&&(i-=i+n.height-t.height),n.height>t.height&&(i=0,basicContext._dom().addClass("basicContext--scrollable")),{x:o,y:i}},_bind:function(e){return basicContext._dom("td[data-num='"+e.num+"']").click(e.fn)},show:function(e,t,n,o){var i,a,s,r;for($("body").append(basicContext._build(e)),null==basicContext._overflow&&(basicContext._overflow=$("body").css("overflow"),$("body").css("overflow","hidden")),s=basicContext._getPosition(t),basicContext._dom().css({top:s.y+"px",left:s.x+"px",opacity:1}),null==n&&(n=basicContext.close),basicContext._dom().parent().click(n),i=0,a=e.length;a>i;i++)r=e[i],basicContext._bind(r);return t.preventDefault(),null!=o&&o(),!0},visible:function(){return 0===basicContext._dom().length?!1:!0},close:function(){return basicContext._dom().parent().remove(),null!=basicContext._overflow&&($("body").css("overflow",basicContext._overflow),basicContext._overflow=null),!0}},this.basicModal={_lastFocus:null,_dom:function(e){return null==e?$(".basicModal"):$(".basicModal").find(""+e)},_valid:function(e){var t,n,o;return null!=e?(null==e.body&&(e.body=""),null==e["class"]&&(e["class"]=""),null==e.closable&&(e.closable=!0),null!=(null!=(t=e.buttons)?t.action:void 0)&&(null==e.buttons.action["class"]&&(e.buttons.action["class"]=""),null==e.buttons.action.title&&(e.buttons.action.title="OK")),null!=(null!=(n=e.buttons)?n.cancel:void 0)?null==e.buttons.cancel.title&&(e.buttons.cancel.title="Cancel"):null!=(null!=(o=e.buttons)?o.action:void 0)&&(e.buttons.action["class"]+=" basicModal__button--full"),!0):!1},_build:function(e){var t,n,o,i;return n='<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M405 136.798l-29.798-29.798-119.202 119.202-119.202-119.202-29.798 29.798 119.202 119.202-119.202 119.202 29.798 29.798 119.202-119.202 119.202 119.202 29.798-29.798-119.202-119.202z"/></svg>',t="<div class='basicModalContainer basicModalContainer--fadeIn' data-closable='"+e.closable+"'>\n <div class='basicModal basicModal--fadeIn "+e["class"]+'\' role="dialog">\n '+e.body,null!=(null!=(o=e.buttons)?o.cancel:void 0)&&(t+=-1===e["class"].indexOf("login")?"<a id='basicModal__cancel' class='basicModal__button'>"+e.buttons.cancel.title+"</a>":"<div id='basicModal__cancel' class='basicModal__button' aria-label='close'>"+n+"</div>"),null!=(null!=(i=e.buttons)?i.action:void 0)&&(t+="<a id='basicModal__action' class='basicModal__button "+e.buttons.action["class"]+"'>"+e.buttons.action.title+"</a>"),t+=" </div>\n</div>"},_getValues:function(){var e;return e=null,(0!==basicModal._dom("input").length||0!==basicModal._dom(".basicModal__dropdown").length)&&(e={},basicModal._dom("input").each(function(){var t,n;return t=$(this).attr("data-name"),n=$(this).val(),e[t]=n}),basicModal._dom(".basicModal__dropdown").each(function(){var t,n;return t=$(this).attr("data-name"),n=$(this).attr("data-value"),e[t]=n})),e},_bind:function(e){var t,n,o,i,a;return null!=(null!=(n=e.buttons)&&null!=(o=n.cancel)?o.fn:void 0)&&basicModal._dom("#basicModal__cancel").click(function(){return $(this).hasClass("basicModal__button--active")?!1:($(this).addClass("basicModal__button--active"),e.buttons.cancel.fn())}),null!=(null!=(i=e.buttons)&&null!=(a=i.action)?a.fn:void 0)&&basicModal._dom("#basicModal__action").click(function(){return $(this).hasClass("basicModal__button--active")?!1:($(this).addClass("basicModal__button--active"),e.buttons.action.fn(basicModal._getValues()))}),basicModal._dom("input").keydown(function(){return $(this).removeClass("error")}),t=null,basicModal._dom(".basicModal__dropdown .front").click(function(){var e;return e=$(this).parent(),clearTimeout(t),e.find(".back").show(),e.addClass("flip")}),basicModal._dom('.basicModal__dropdown .back ul li[class!="separator"]').click(function(){var e,n;return e=$(this).parent().parent().parent(),n=$(this).clone(),n.find("span").remove(),n=n.html().trim(),e.find(".front span").html(n),e.attr("data-value",$(this).data("value")),e.removeClass("flip"),t=setTimeout(function(){return e.find(".back").hide()},3e3)})},show:function(e){return basicModal._valid(e)?(basicModal._lastFocus=document.activeElement,0!==basicModal._dom().parent().length?(basicModal.close(!0),setTimeout(function(){return basicModal.show(e)},301),!1):($("body").append(basicModal._build(e)),basicModal._bind(e),0!==basicModal._dom("input").length&&basicModal._dom("input")[0].select(),null!=e.callback&&e.callback(),!0)):!1},error:function(e){return basicModal.reset(),basicModal._dom("input[data-name='"+e+"'], .basicModal__dropdown[data-name='"+e+"']").addClass("error").focus().select(),basicModal._dom().removeClass("basicModal--fadeIn basicModal--shake"),setTimeout(function(){return basicModal._dom().addClass("basicModal--shake")},1)},visible:function(){return 0===basicModal._dom().parent().length?!1:!0},action:function(){return 0!==basicModal._dom("#basicModal__action").length?(basicModal._dom("#basicModal__action").click(),!0):!1},cancel:function(){return 0!==basicModal._dom("#basicModal__cancel").length?(basicModal._dom("#basicModal__cancel").click(),!0):!1},reset:function(){return basicModal._dom(".basicModal__button").removeClass("basicModal__button--active"),basicModal._dom(".input, .basicModal__dropdown").removeClass("error"),!0},close:function(e){var t;return t=basicModal._dom().parent(),
- null==e||e===!0?"true"!==t.attr("data-closable")&&e!==!0?!1:(t.removeClass("basicModalContainer--fadeIn").addClass("basicModalContainer--fadeOut"),setTimeout(function(){return t.remove()},300),null!=basicModal._lastFocus&&(basicModal._lastFocus.focus(),basicModal._lastFocus=null),!0):!1}},function(e){var t=function(t){var n=this;this.el=e(t),this.pos={start:{x:0,y:0},end:{x:0,y:0}},this.startTime,t.on("touchstart",function(e){n.touchStart(e)}),t.on("touchmove",function(e){n.touchMove(e)}),t.on("touchend",function(e){n.swipeEnd()}),t.on("mousedown",function(e){n.mouseDown(e)})};t.prototype={touchStart:function(e){var t=e.originalEvent.touches[0];this.swipeStart(e,t.pageX,t.pageY)},touchMove:function(e){var t=e.originalEvent.touches[0];this.swipeMove(e,t.pageX,t.pageY)},mouseDown:function(e){var t=this;this.swipeStart(e,e.pageX,e.pageY),this.el.on("mousemove",function(e){t.mouseMove(e)}),this.el.on("mouseup",function(){t.mouseUp()})},mouseMove:function(e){this.swipeMove(e,e.pageX,e.pageY)},mouseUp:function(e){this.swipeEnd(e),this.el.off("mousemove"),this.el.off("mouseup")},swipeStart:function(e,t,n){this.pos.start.x=t,this.pos.start.y=n,this.pos.end.x=t,this.pos.end.y=n,this.startTime=(new Date).getTime(),this.trigger("swipeStart",e)},swipeMove:function(e,t,n){this.pos.end.x=t,this.pos.end.y=n,this.trigger("swipeMove",e)},swipeEnd:function(e){this.trigger("swipeEnd",e)},trigger:function(t,n){var o=this,i=e.Event(t),a=o.pos.start.x-o.pos.end.x,s=o.pos.end.y-o.pos.start.y,r=Math.atan2(s,a),l="up",u=Math.round(Math.sqrt(Math.pow(a,2)+Math.pow(s,2))),c=Math.round(180*r/Math.PI),d=Math.round(u/((new Date).getTime()-o.startTime)*1e3);0>c&&(c=360-Math.abs(c)),45>=c&&c>=0||360>=c&&c>=315?l="left":c>=135&&225>=c?l="right":c>45&&135>c&&(l="down"),i.originalEvent=n,i.swipe={x:a,y:s,direction:l,distance:u,angle:c,speed:d},e(o.el).trigger(i)}},e.fn.swipe=function(){new t(this);return this}}(jQuery),album={json:null},album.getID=function(){var e=null,t=function(e){return"0"===e||"f"===e||"s"===e||"r"===e?!0:$.isNumeric(e)};return photo.json?e=photo.json.album:album.json&&(e=album.json.id),t(e)===!1&&(e=$(".album:hover, .album.active").attr("data-id")),t(e)===!1&&(e=$(".photo:hover, .photo.active").attr("data-album-id")),t(e)===!0?e:!1},album.load=function(e,t){var n,o,i,a;password.get(e,function(){t||lychee.animate("#content","contentZoomOut"),n=(new Date).getTime(),o={albumID:e,password:password.value},api.post("Album::get",o,function(o){return"Warning: Album private!"===o?(void 0!=document.location.hash.replace("#","").split("/")[1]?lychee.setMode("view"):(lychee.content.show(),lychee["goto"]("")),!1):"Warning: Wrong password!"===o?(album.load(e,t),!1):(album.json=o,i=(new Date).getTime()-n,a=i>300?0:300-i,t===!0&&(a=0),visible.albums()||visible.photo()||visible.album()||(a=0),void setTimeout(function(){view.album.init(),t||(lychee.animate("#content","contentZoomIn"),header.setMode("album"))},a))})})},album.parse=function(){album.json.title||(album.json.title="Untitled")},album.add=function(){var e;e=function(e){var t,n=e.title;basicModal.close(),t=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},0===n.length&&(n="Untitled"),api.post("Album::add",{title:n},function(e){e===!0&&(e=1),e!==!1&&t(e)?(albums.refresh(),lychee["goto"](e)):lychee.error(null,params,e)})},basicModal.show({body:"<p>Enter a title for the new album: <input class='text' data-name='title' type='text' maxlength='50' placeholder='Title' value='Untitled'></p>",buttons:{action:{title:"Create Album",fn:e},cancel:{title:"Cancel",fn:basicModal.close}}})},album["delete"]=function(e){var t={},n={},o="",i="";return e?(e instanceof Array==!1&&(e=[e]),t.fn=function(){var t;basicModal.close(),t={albumIDs:e.join()},api.post("Album::delete",t,function(n){visible.albums()?e.forEach(function(e){albums.json.num--,view.albums.content["delete"](e),delete albums.json.albums[e]}):(albums.refresh(),lychee["goto"]("")),n!==!0&&lychee.error(null,t,n)})},"0"===e.toString()?(t.title="Clear Unsorted",n.title="Keep Unsorted",o="<p>Are you sure you want to delete all photos from 'Unsorted'?<br>This action can't be undone!</p>"):1===e.length?(t.title="Delete Album and Photos",n.title="Keep Album",album.json?i=album.json.title:albums.json&&(i=albums.json.albums[e].title),o="<p>Are you sure you want to delete the album '"+i+"' and all of the photos it contains? This action can't be undone!</p>"):(t.title="Delete Albums and Photos",n.title="Keep Albums",o="<p>Are you sure you want to delete all "+e.length+" selected albums and all of the photos they contain? This action can't be undone!</p>"),void basicModal.show({body:o,buttons:{action:{title:t.title,fn:t.fn,"class":"red"},cancel:{title:n.title,fn:basicModal.close}}})):!1},album.setTitle=function(e){var t,n="",o="",i="";return e?(e instanceof Array==!1&&(e=[e]),1===e.length&&(album.json?n=album.json.title:albums.json&&(n=albums.json.albums[e].title),n||(n=""),n=n.replace(/'/g,"'")),t=function(t){var n,o=t.title;if(basicModal.close(),o=lychee.removeHTML(o),o=""===o?"Untitled":o,visible.album()){if(album.json.title=o,view.album.title(),albums.json){var i=e[0];albums.json.albums[i].title=o}}else visible.albums()&&e.forEach(function(e){albums.json.albums[e].title=o,view.albums.content.title(e)});n={albumIDs:e.join(),title:o},api.post("Album::setTitle",n,function(e){e!==!0&&lychee.error(null,n,e)})},o="<input class='text' data-name='title' type='text' maxlength='50' placeholder='Title' value='"+n+"'>",i=1===e.length?"<p>Enter a new title for this album: "+o+"</p>":"<p>Enter a title for all "+e.length+" selected albums: "+o+"</p>",void basicModal.show({body:i,buttons:{action:{title:"Set Title",fn:t},cancel:{title:"Cancel",fn:basicModal.close}}})):!1},album.setDescription=function(e){var t,n=album.json.description.replace(/'/g,"'");t=function(t){var n,o=t.description;basicModal.close(),o=lychee.removeHTML(o),visible.album()&&(album.json.description=o,view.album.description()),n={albumID:e,description:o},api.post("Album::setDescription",n,function(e){e!==!0&&lychee.error(null,n,e)})},basicModal.show({body:"<p>Please enter a description for this album: <input class='text' data-name='description' type='text' maxlength='800' placeholder='Description' value='"+n+"'></p>",buttons:{action:{title:"Set Description",fn:t},cancel:{title:"Cancel",fn:basicModal.close}}})},album.setPublic=function(e,t,n){var o,i="";if(albums.refresh(),t===!0){var a="",s="",r={};return r.fn=function(){album.setPublic(album.getID(),!1,n)},"1"===album.json["public"]?(r.title="Edit Sharing",s="The sharing-properties of this album will be changed to the following:"):(r.title="Share Album",s="This album will be shared with the following properties:"),a="\n <p class='less'>"+s+"</p>\n <form>\n <div class='choice'>\n <label>\n <input type='checkbox' name='visible'>\n <span class='checkbox'>"+build.iconic("check")+"</span>\n <span class='label'>Visible</span>\n </label>\n <p>Listed to visitors of your Lychee.</p>\n </div>\n <div class='choice'>\n <label>\n <input type='checkbox' name='downloadable'>\n <span class='checkbox'>"+build.iconic("check")+"</span>\n <span class='label'>Downloadable</span>\n </label>\n <p>Visitors of your Lychee can download this album.</p>\n </div>\n <div class='choice'>\n <label>\n <input type='checkbox' name='password'>\n <span class='checkbox'>"+build.iconic("check")+"</span>\n <span class='label'>Password protected</span>\n </label>\n <p>Only accessible with a valid password.</p>\n <input class='text' data-name='password' type='password' placeholder='password' value=''>\n </div>\n </form>\n ",basicModal.show({body:a,buttons:{action:{title:r.title,fn:r.fn},cancel:{title:"Cancel",fn:basicModal.close}}}),("1"===album.json["public"]&&"1"===album.json.visible||"0"===album.json["public"])&&$('.basicModal .choice input[name="visible"]').click(),"1"===album.json.downloadable&&$('.basicModal .choice input[name="downloadable"]').click(),$('.basicModal .choice input[name="password"]').on("change",function(){$(this).prop("checked")===!0?$('.basicModal .choice input[data-name="password"]').show().focus():$('.basicModal .choice input[data-name="password"]').hide()}),!0}basicModal.visible()?(album.json["public"]="1",album.json.visible=1===$('.basicModal .choice input[name="visible"]:checked').length?"1":"0",album.json.downloadable=1===$('.basicModal .choice input[name="downloadable"]:checked').length?"1":"0",1===$('.basicModal .choice input[name="password"]:checked').length?(i=$('.basicModal .choice input[data-name="password"]').val(),album.json.password="1"):(i="",album.json.password="0"),basicModal.close()):album.json["public"]="0",visible.album()&&(album.json.visible="0"===album.json["public"]?"0":album.json.visible,album.json.downloadable="0"===album.json["public"]?"0":album.json.downloadable,album.json.password="0"===album.json["public"]?"0":album.json.password,view.album["public"](),view.album.visible(),view.album.downloadable(),view.album.password(),"1"===album.json["public"]&&contextMenu.shareAlbum(e,n)),o={albumID:e,"public":album.json["public"],password:i,visible:album.json.visible,downloadable:album.json.downloadable},api.post("Album::setPublic",o,function(e){e!==!0&&lychee.error(null,o,e)})},album.share=function(e){var t="",n=location.href;switch(e){case 0:t="https://twitter.com/share?url="+encodeURI(n);break;case 1:t="http://www.facebook.com/sharer.php?u="+encodeURI(n)+"&t="+encodeURI(album.json.title);break;case 2:t="mailto:?subject="+encodeURI(album.json.title)+"&body="+encodeURI(n);break;default:t=""}t.length>5&&(location.href=t)},album.getArchive=function(e){var t,n=api.path+"?function=Album::getArchive&albumID="+e;t=location.href.indexOf("index.html")>0?location.href.replace(location.hash,"").replace("index.html",n):location.href.replace(location.hash,"")+n,lychee.publicMode===!0&&(t+="&password="+password.value),location.href=t},album.merge=function(e){var t,n="",o="",i="";return e?(e instanceof Array==!1&&(e=[e]),albums.json&&(n=albums.json.albums[e[0]].title),n||(n=""),n=n.replace(/'/g,"'"),2===e.length?(albums.json&&(o=albums.json.albums[e[1]].title),o||(o=""),o=o.replace(/'/g,"'"),i="<p>Are you sure you want to merge the album '"+o+"' into the album '"+n+"'?</p>"):i="<p>Are you sure you want to merge all selected albums into the album '"+n+"'?</p>",t=function(){var t;basicModal.close(),t={albumIDs:e.join()},api.post("Album::merge",t,function(e){e!==!0?lychee.error(null,t,e):(albums.refresh(),albums.load())})},void basicModal.show({body:i,buttons:{action:{title:"Merge Albums",fn:t,"class":"red"},cancel:{title:"Don't Merge",fn:basicModal.close}}})):!1},albums={json:null},albums.load=function(){var e,t,n;lychee.animate("#content","contentZoomOut"),e=(new Date).getTime(),null===albums.json?api.post("Album::getAll",{},function(o){lychee.publicMode===!1&&albums._createSmartAlbums(o.smartalbums),albums.json=o,t=(new Date).getTime()-e,n=t>300?0:300-t,visible.albums()||visible.photo()||visible.album()||(n=0),visible.album()&&""===lychee.content.html()&&(n=0),setTimeout(function(){header.setMode("albums"),view.albums.init(),lychee.animate("#content","contentZoomIn")},n)}):setTimeout(function(){header.setMode("albums"),view.albums.init(),lychee.animate("#content","contentZoomIn")},300)},albums.parse=function(e){"1"===e.password&&lychee.publicMode===!0?(e.thumbs[0]="src/images/password.svg",e.thumbs[1]="src/images/password.svg",e.thumbs[2]="src/images/password.svg"):(e.thumbs[0]||(e.thumbs[0]="src/images/no_images.svg"),e.thumbs[1]||(e.thumbs[1]="src/images/no_images.svg"),e.thumbs[2]||(e.thumbs[2]="src/images/no_images.svg"))},albums._createSmartAlbums=function(e){e.unsorted={id:0,title:"Unsorted",sysdate:e.unsorted.num+" photos",unsorted:"1",thumbs:e.unsorted.thumbs},e.starred={id:"f",title:"Starred",sysdate:e.starred.num+" photos",star:"1",thumbs:e.starred.thumbs},e["public"]={id:"s",title:"Public",sysdate:e["public"].num+" photos","public":"1",thumbs:e["public"].thumbs},e.recent={id:"r",title:"Recent",sysdate:e.recent.num+" photos",recent:"1",thumbs:e.recent.thumbs}},albums.refresh=function(){albums.json=null},api={path:"php/api.php",onError:null},api.post=function(e,t,n){var o,i;loadingBar.show(),t=$.extend({"function":e},t),o=function(e){return setTimeout(function(){loadingBar.hide()},100),"string"==typeof e&&"Error: "===e.substring(0,7)?(api.onError(e.substring(7,e.length),t,e),!1):("1"===e?e=!0:""===e&&(e=!1),"string"==typeof e&&"{"===e.substring(0,1)&&"}"===e.substring(e.length-1,e.length)&&(e=$.parseJSON(e)),lychee.debugMode&&console.log(e),void n(e))},i=function(e,n,o){api.onError("Server error or API not found.",t,o)},$.ajax({type:"POST",url:api.path,data:t,dataType:"text",success:o,error:i})},window.build={},build.iconic=function(e,t){var n="";return t=t||"",n="\n <svg class='iconic "+t+"'>\n <use xlink:href='#"+e+"' />\n </svg>\n "},build.divider=function(e){var t="";return t="\n <div class='divider'>\n <h1>"+e+"</h1>\n </div>\n "},build.editIcon=function(e){var t="";return t="<div id='"+e+"' class='edit'>"+build.iconic("pencil")+"</div>"},build.multiselect=function(e,t){var n="";return n="<div id='multiselect' style='top: "+e+"px; left: "+t+"px;'></div>"},build.album=function(e){if(null===e||void 0===e)return"";var t="",n=lychee.retinize(e.thumbs[0]),o=n.path,i=n.hasRetina;return t="\n <div class='album' data-id='"+e.id+"'>\n <img src='"+e.thumbs[2]+"' width='200' height='200' alt='thumb' data-retina='false'>\n <img src='"+e.thumbs[1]+"' width='200' height='200' alt='thumb' data-retina='false'>\n <img src='"+o+"' width='200' height='200' alt='thumb' data-retina='"+i+"'>\n <div class='overlay'>\n <h1 title='"+e.title+"'>"+e.title+"</h1>\n <a>"+e.sysdate+"</a>\n </div>\n ",lychee.publicMode===!1&&("1"===e.star&&(t+="<a class='badge icn-star'>"+build.iconic("star")+"</a>"),"1"===e["public"]&&(t+="<a class='badge icn-share'>"+build.iconic("eye")+"</a>"),"1"===e.unsorted&&(t+="<a class='badge'>"+build.iconic("list")+"</a>"),"1"===e.recent&&(t+="<a class='badge'>"+build.iconic("clock")+"</a>"),"1"===e.password&&(t+="<a class='badge'>"+build.iconic("lock-locked")+"</a>")),t+="</div>"},build.photo=function(e){if(null===e||void 0===e)return"";{var t="",n=lychee.retinize(e.thumbUrl),o=n.path;n.hasRetina}return t="\n <div class='photo' data-album-id='"+e.album+"' data-id='"+e.id+"'>\n <img src='"+o+"' width='200' height='200' alt='thumb'>\n <div class='overlay'>\n <h1 title='"+e.title+"'>"+e.title+"</h1>\n ",t+="1"===e.cameraDate?"<a><span title='Camera Date'>"+build.iconic("camera-slr")+"</span>"+e.sysdate+"</a>":"<a>"+e.sysdate+"</a>",t+="</div>",lychee.publicMode===!1&&("1"===e.star&&(t+="<a class='badge iconic-star'>"+build.iconic("star")+"</a>"),"1"===e["public"]&&"1"!==album.json["public"]&&(t+="<a class='badge iconic-share'>"+build.iconic("eye")+"</a>")),t+="</div>"},build.imageview=function(e,t,n){if(null===e||void 0===e)return"";var o="";return o="\n <div class='arrow_wrapper arrow_wrapper--previous'><a id='previous'>"+build.iconic("caret-left")+"</a></div>\n <div class='arrow_wrapper arrow_wrapper--next'><a id='next'>"+build.iconic("caret-right")+"</a></div>\n ","big"===t?o+=n===!0?"<div id='image' style='background-image: url("+e.url+")'></div>":"<div id='image' style='background-image: url("+e.url+");' class='full'></div>":"medium"===t?o+=n===!0?"<div id='image' style='background-image: url("+e.medium+")'></div>":"<div id='image' style='background-image: url("+e.medium+");' class='full'></div>":"small"===t&&(o+=n===!0?"<div id='image' class='small' style='background-image: url("+e.url+"); width: "+e.width+"px; height: "+e.height+"px; margin-top: -"+parseInt(e.height/2-20)+"px; margin-left: -"+e.width/2+"px;'></div>":"<div id='image' class='small' style='background-image: url("+e.url+"); width: "+e.width+"px; height: "+e.height+"px; margin-top: -"+parseInt(e.height/2)+"px; margin-left: -"+e.width/2+"px;'></div>"),o},build.no_content=function(e){var t;switch(t="\n <div class='no_content fadeIn'>\n "+build.iconic(e)+"\n ",e){case"magnifying-glass":t+="<p>No results</p>";break;case"eye":t+="<p>No public albums</p>";break;case"cog":t+="<p>No configuration</p>";break;case"question-mark":t+="<p>Photo not found</p>"}return t+="</div>"},build.uploadModal=function(e,t){var n="",o=0,i=null;for(n="\n <h1>"+e+"</h1>\n <div class='rows'>\n ";o<t.length;)i=t[o],i.name.length>40&&(i.name=i.name.substr(0,17)+"..."+i.name.substr(i.name.length-20,20)),n+="\n <div class='row'>\n <a class='name'>"+lychee.escapeHTML(i.name)+"</a>\n ",n+=i.supported===!0?"<a class='status'></a>":"<a class='status error'>Not supported</a>",n+="\n <p class='notice'></p>\n </div>\n ",o++;return n+="</div>"},build.tags=function(e){var t="";return""!==e?(e=e.split(","),e.forEach(function(e,n,o){t+="<a class='tag'>"+e+"<span data-index='"+n+"'>"+build.iconic("x")+"</span></a>"})):t="<div class='empty'>No Tags</div>",t},contextMenu={},contextMenu.add=function(e){var t=[{type:"item",title:build.iconic("image")+"Upload Photo",fn:function(){$("#upload_files").click()}},{type:"separator"},{type:"item",title:build.iconic("link-intact")+"Import from Link",fn:upload.start.url},{type:"item",title:build.iconic("dropbox","ionicons")+"Import from Dropbox",fn:upload.start.dropbox},{type:"item",title:build.iconic("terminal")+"Import from Server",fn:upload.start.server},{type:"separator"},{type:"item",title:build.iconic("folder")+"New Album",fn:album.add}];basicContext.show(t,e),upload.notify()},contextMenu.settings=function(e){var t=[{type:"item",title:build.iconic("person")+"Change Login",fn:settings.setLogin},{type:"item",title:build.iconic("sort-ascending")+"Change Sorting",fn:settings.setSorting},{type:"item",title:build.iconic("dropbox","ionicons")+"Set Dropbox",fn:settings.setDropboxKey},{type:"separator"},{type:"item",title:build.iconic("info")+"About Lychee",fn:function(){window.open(lychee.website)}},{type:"item",title:build.iconic("wrench")+"Diagnostics",fn:function(){window.open("plugins/check/")}},{type:"item",title:build.iconic("align-left")+"Show Log",fn:function(){window.open("plugins/displaylog/")}},{type:"separator"},{type:"item",title:build.iconic("account-logout")+"Sign Out",fn:lychee.logout}];basicContext.show(t,e)},contextMenu.album=function(e,t){if("0"===e||"f"===e||"s"===e||"r"===e)return!1;var n=[{type:"item",title:build.iconic("pencil")+"Rename",fn:function(){album.setTitle([e])}},{type:"item",title:build.iconic("collapse-left")+"Merge",fn:function(){basicContext.close(),contextMenu.mergeAlbum(e,t)}},{type:"item",title:build.iconic("trash")+"Delete",fn:function(){album["delete"]([e])}}];albums.json&&albums.json.albums&&Object.keys(albums.json.albums).length<=1&&n.splice(1,1),$('.album[data-id="'+e+'"]').addClass("active"),basicContext.show(n,t,contextMenu.close)},contextMenu.albumMulti=function(e,t){multiselect.stopResize();var n=[{type:"item",title:build.iconic("pencil")+"Rename All",fn:function(){album.setTitle(e)}},{type:"item",title:build.iconic("collapse-left")+"Merge All",fn:function(){album.merge(e)}},{type:"item",title:build.iconic("trash")+"Delete All",fn:function(){album["delete"](e)}}];basicContext.show(n,t,contextMenu.close)},contextMenu.albumTitle=function(e,t){var n=[];api.post("Album::getAll",{},function(o){o.num>1&&($.each(o.albums,function(t){var o=this,i="";o.thumbs[0]||(o.thumbs[0]="src/images/no_cover.svg"),i="<img class='cover' width='16' height='16' src='"+o.thumbs[0]+"'><div class='title'>"+o.title+"</div>",o.id!=e&&n.unshift({type:"item",title:i,fn:function(){lychee["goto"](o.id)}})}),n.unshift({type:"separator"})),n.unshift({type:"item",title:build.iconic("pencil")+"Rename",fn:function(){album.setTitle([e])}}),basicContext.show(n,t,contextMenu.close)})},contextMenu.mergeAlbum=function(e,t){var n=[];api.post("Album::getAll",{},function(o){return $.each(o.albums,function(){var t=this;t.thumbs[0]||(t.thumbs[0]="src/images/no_cover.svg"),t.contextTitle="<img class='cover' width='16' height='16' src='"+t.thumbs[0]+"'><div class='title'>"+t.title+"</div>",t.id!=album.getID()&&n.unshift({type:"item",title:t.contextTitle,fn:function(){album.merge([e,t.id])}})}),0===n.length?!1:void basicContext.show(n,t,contextMenu.close)})},contextMenu.photo=function(e,t){var n=[{type:"item",title:build.iconic("star")+"Star",fn:function(){photo.setStar([e])}},{type:"item",title:build.iconic("tag")+"Tags",fn:function(){photo.editTags([e])}},{type:"separator"},{type:"item",title:build.iconic("pencil")+"Rename",fn:function(){photo.setTitle([e])}},{type:"item",title:build.iconic("layers")+"Duplicate",fn:function(){photo.duplicate([e])}},{type:"item",title:build.iconic("folder")+"Move",fn:function(){basicContext.close(),contextMenu.move([e],t)}},{type:"item",title:build.iconic("trash")+"Delete",fn:function(){photo["delete"]([e])}}];$('.photo[data-id="'+e+'"]').addClass("active"),basicContext.show(n,t,contextMenu.close)},contextMenu.photoMulti=function(e,t){multiselect.stopResize();var n=[{type:"item",title:build.iconic("star")+"Star All",fn:function(){photo.setStar(e)}},{type:"item",title:build.iconic("tag")+"Tag All",fn:function(){photo.editTags(e)}},{type:"separator"},{type:"item",title:build.iconic("pencil")+"Rename All",fn:function(){photo.setTitle(e)}},{type:"item",title:build.iconic("layers")+"Duplicate All",fn:function(){photo.duplicate(e)}},{type:"item",title:build.iconic("folder")+"Move All",fn:function(){basicContext.close(),contextMenu.move(e,t)}},{type:"item",title:build.iconic("trash")+"Delete All",fn:function(){photo["delete"](e)}}];basicContext.show(n,t,contextMenu.close)},contextMenu.photoTitle=function(e,t,n){var o=[{type:"item",title:build.iconic("pencil")+"Rename",fn:function(){photo.setTitle([t])}}],i=album.json;i.num>1&&(o.push({type:"separator"}),$.each(i.content,function(n){var i=this,a="";a="<img class='cover' width='16' height='16' src='"+i.thumbUrl+"'><div class='title'>"+i.title+"</div>",i.id!=t&&o.push({type:"item",title:a,fn:function(){lychee["goto"](e+"/"+i.id)}})})),basicContext.show(o,n,contextMenu.close)},contextMenu.photoMore=function(e,t){var n=[{type:"item",title:build.iconic("fullscreen-enter")+"Full Photo",fn:function(){window.open(photo.getDirectLink())}},{type:"item",title:build.iconic("cloud-download")+"Download",fn:function(){photo.getArchive(e)}}];album.json&&album.json.downloadable&&"1"===album.json.downloadable||lychee.publicMode!==!0||n.splice(1,1),basicContext.show(n,t)},contextMenu.move=function(e,t){var n=[];api.post("Album::getAll",{},function(o){0===o.num?n=[{type:"item",title:"New Album",fn:album.add}]:($.each(o.albums,function(t){var o=this;o.thumbs[0]||(o.thumbs[0]="src/images/no_cover.svg"),o.title="<img class='cover' width='16' height='16' src='"+o.thumbs[0]+"'><div class='title'>"+o.title+"</div>",o.id!=album.getID()&&n.unshift({type:"item",title:o.title,fn:function(){photo.setAlbum(e,o.id)}})}),"0"!==album.getID()&&(n.unshift({type:"separator"}),n.unshift({type:"item",title:"Unsorted",fn:function(){photo.setAlbum(e,0)}}))),basicContext.show(n,t,contextMenu.close)})},contextMenu.sharePhoto=function(e,t){var n=photo.getViewLink(e),o="ionicons";"2"===photo.json["public"]&&(n=location.href);var i=[{type:"item",title:'<input readonly id="link" value="'+n+'">',fn:function(){},"class":"noHover"},{type:"separator"},{type:"item",title:build.iconic("twitter",o)+"Twitter",fn:function(){photo.share(e,0)}},{type:"item",title:build.iconic("facebook",o)+"Facebook",fn:function(){photo.share(e,1)}},{type:"item",title:build.iconic("envelope-closed")+"Mail",fn:function(){photo.share(e,2)}},{type:"item",title:build.iconic("dropbox",o)+"Dropbox",fn:function(){photo.share(e,3)}},{type:"item",title:build.iconic("link-intact")+"Direct Link",fn:function(){window.open(photo.getDirectLink())}},{type:"separator"},{type:"item",title:build.iconic("ban")+"Make Private",fn:function(){photo.setPublic(e)}}];basicContext.show(i,t),$(".basicContext input#link").focus().select()},contextMenu.shareAlbum=function(e,t){var n="ionicons",o=[{type:"item",title:'<input readonly id="link" value="'+location.href+'">',fn:function(){},"class":"noHover"},{type:"separator"},{type:"item",title:build.iconic("twitter",n)+"Twitter",fn:function(){album.share(0)}},{type:"item",title:build.iconic("facebook",n)+"Facebook",fn:function(){album.share(1)}},{type:"item",title:build.iconic("envelope-closed")+"Mail",fn:function(){album.share(2)}},{type:"separator"},{type:"item",title:build.iconic("pencil")+"Edit Sharing",fn:function(){album.setPublic(e,!0,t)}},{type:"item",title:build.iconic("ban")+"Make Private",fn:function(){album.setPublic(e,!1)}}];basicContext.show(o,t),$(".basicContext input#link").focus().select()},contextMenu.close=function(){return visible.contextMenu()?(basicContext.close(),$(".photo.active, .album.active").removeClass("active"),void(visible.multiselect()&&multiselect.close())):!1},header={_dom:$("header")},header.dom=function(e){return void 0===e||null===e||""===e?header._dom:header._dom.find(e)},header.bind=function(){var e="ontouchend"in document.documentElement?"touchend":"click";return header.dom("#title").on(e,function(e){return $(this).hasClass("editable")?void(visible.photo()?contextMenu.photoTitle(album.getID(),photo.getID(),e):contextMenu.albumTitle(album.getID(),e)):!1}),header.dom("#button_share").on(e,function(e){"1"===photo.json["public"]||"2"===photo.json["public"]?contextMenu.sharePhoto(photo.getID(),e):photo.setPublic(photo.getID(),e)}),header.dom("#button_share_album").on(e,function(e){"1"===album.json["public"]?contextMenu.shareAlbum(album.getID(),e):album.setPublic(album.getID(),!0,e)}),header.dom("#button_signin").on(e,lychee.loginDialog),header.dom("#button_settings").on(e,contextMenu.settings),header.dom("#button_info_album").on(e,sidebar.toggle),header.dom("#button_info").on(e,sidebar.toggle),header.dom(".button_add").on(e,contextMenu.add),header.dom("#button_more").on(e,function(e){contextMenu.photoMore(photo.getID(),e)}),header.dom("#button_move").on(e,function(e){contextMenu.move([photo.getID()],e)}),header.dom("#hostedwith").on(e,function(){window.open(lychee.website)}),header.dom("#button_trash_album").on(e,function(){album["delete"]([album.getID()])}),header.dom("#button_trash").on(e,function(){photo["delete"]([photo.getID()])}),header.dom("#button_archive").on(e,function(){album.getArchive(album.getID())}),header.dom("#button_star").on(e,function(){photo.setStar([photo.getID()])}),header.dom("#button_back_home").on(e,function(){lychee["goto"]("")}),header.dom("#button_back").on(e,function(){lychee["goto"](album.getID())}),header.dom("#search").on("keyup click",function(){search.find($(this).val())}),header.dom("#clearSearch").on(e,function(){header.dom("#search").focus(),search.reset()}),!0},header.show=function(){var e=-1*($("#imageview #image").height()/2)+20;return clearTimeout($(window).data("timeout")),lychee.imageview.removeClass("full"),header.dom().removeClass("hidden"),$("#imageview #image.small").length>0?$("#imageview #image").css("margin-top",e):$("#imageview #image").removeClass("full"),!0},header.hide=function(e){var t=void 0===arguments[1]?500:arguments[1];if(visible.photo()&&!visible.sidebar()&&!visible.contextMenu()&&!visible.message()){var n=-1*($("#imageview #image").height()/2);return clearTimeout($(window).data("timeout")),$(window).data("timeout",setTimeout(function(){lychee.imageview.addClass("full"),header.dom().addClass("hidden"),$("#imageview #image.small").length>0?$("#imageview #image").css("margin-top",n):$("#imageview #image").addClass("full")},t)),!0}return!1},header.setTitle=function(){var e=void 0===arguments[0]?"Untitled":arguments[0],t=header.dom("#title");return t.html(e+build.iconic("caret-bottom")),!0},header.setMode=function(e){var t=album.getID();switch(e){case"albums":return header.dom().removeClass("view"),$("#tools_album, #tools_photo").hide(),$("#tools_albums").show(),!0;case"album":return header.dom().removeClass("view"),$("#tools_albums, #tools_photo").hide(),$("#tools_album").show(),album.json.content===!1?$("#button_archive").hide():$("#button_archive").show(),lychee.publicMode===!0&&"0"===album.json.downloadable&&$("#button_archive").hide(),"s"===t||"f"===t||"r"===t?$("#button_info_album, #button_trash_album, #button_share_album").hide():"0"===t?($("#button_info_album, #button_share_album").hide(),$("#button_trash_album").show()):$("#button_info_album, #button_trash_album, #button_share_album").show(),!0;case"photo":return header.dom().addClass("view"),$("#tools_albums, #tools_album").hide(),$("#tools_photo").show(),!0}return!1},header.setEditable=function(e){var t=header.dom("#title");return lychee.publicMode===!0&&(e=!1),e?t.addClass("editable"):t.removeClass("editable"),!0},$(document).ready(function(){var e="ontouchend"in document.documentElement?"touchend":"click";api.onError=lychee.error,multiselect.bind(),header.bind(),lychee.imageview.on(e,".arrow_wrapper--previous",photo.previous).on(e,".arrow_wrapper--next",photo.next),Mousetrap.bind("left",function(){visible.photo()&&$("#imageview a#previous").click()}).bind("right",function(){visible.photo()&&$("#imageview a#next").click()}).bind("u",function(){$("#upload_files").click()}).bind(["s","f"],function(e){return visible.photo()?header.dom("#button_star").click():visible.albums()&&header.dom("#search").focus(),!1}).bind("r",function(e){e.preventDefault(),visible.album()?album.setTitle(album.getID()):visible.photo()&&photo.setTitle([photo.getID()])}).bind("d",function(e){e.preventDefault(),visible.photo()?photo.setDescription(photo.getID()):visible.album()&&album.setDescription(album.getID())}).bind("t",function(e){visible.photo()&&(e.preventDefault(),photo.editTags([photo.getID()]))}).bind("i",function(){return visible.multiselect()?!1:void sidebar.toggle()}).bind(["command+backspace","ctrl+backspace"],function(){visible.photo()&&!visible.message()?photo["delete"]([photo.getID()]):visible.album()&&!visible.message()&&album["delete"]([album.getID()])}).bind(["command+a","ctrl+a"],function(){visible.album()&&!visible.message()?multiselect.selectAll():visible.albums()&&!visible.message()&&multiselect.selectAll()}),Mousetrap.bindGlobal("enter",function(){basicModal.visible()===!0&&basicModal.action()}),Mousetrap.bindGlobal(["esc","command+up"],function(e){e.preventDefault(),basicModal.visible()===!0?basicModal.cancel():visible.contextMenu()?contextMenu.close():visible.photo()?lychee["goto"](album.getID()):visible.album()?lychee["goto"](""):visible.albums()&&0!==$("#search").val().length&&search.reset()}),"ontouchend"in document.documentElement&&$(document).on("touchend","#image",function(e){(null===swipe.obj||swipe.offset>=-5&&swipe.offset<=5)&&(visible.header()?header.hide(e,0):header.show())}).swipe().on("swipeStart",function(){visible.photo()&&swipe.start($("#image"))}).swipe().on("swipeMove",function(e){visible.photo()&&swipe.move(e.swipe)}).swipe().on("swipeEnd",function(e){visible.photo()&&swipe.stop(e.swipe,photo.previous,photo.next)}),$(document).on("keyup","#password",function(){$(this).val().length>0&&$(this).removeClass("error")}).on("click",".album",function(){lychee["goto"]($(this).attr("data-id"))}).on("click",".photo",function(){lychee["goto"](album.getID()+"/"+$(this).attr("data-id"))}).on("contextmenu",".photo",function(e){contextMenu.photo(photo.getID(),e)}).on("contextmenu",".album",function(e){contextMenu.album(album.getID(),e)}).on("change","#upload_files",function(){basicModal.close(),upload.start.local(this.files)}).on("dragover",function(e){e.preventDefault()},!1).on("drop",function(e){return e.stopPropagation(),e.preventDefault(),visible.photo()&&lychee["goto"](album.getID()),visible.contextMenu()&&contextMenu.close(),e.originalEvent.dataTransfer.files.length>0?upload.start.local(e.originalEvent.dataTransfer.files):e.originalEvent.dataTransfer.getData("Text").length>3&&upload.start.url(e.originalEvent.dataTransfer.getData("Text")),
- !0}),lychee.init()}),loadingBar={status:null,_dom:$("#loading")},loadingBar.dom=function(e){return void 0===e||null===e||""===e?loadingBar._dom:loadingBar._dom.find(e)},loadingBar.show=function(e,t){return"error"===e?(loadingBar.status="error",t&&(t=t.replace("<br>","")),t||(t="Whoops, it looks like something went wrong. Please reload the site and try again!"),visible.header()&&header.dom().addClass("error"),loadingBar.dom().removeClass("loading uploading error").html("<h1>Error: <span>"+t+"</span></h1>").addClass(e).show(),clearTimeout(loadingBar._timeout),loadingBar._timeout=setTimeout(function(){loadingBar.hide(!0)},3e3),!0):null===loadingBar.status?(loadingBar.status="loading",clearTimeout(loadingBar._timeout),loadingBar._timeout=setTimeout(function(){visible.header()&&header.dom().addClass("loading"),loadingBar.dom().removeClass("loading uploading error").html("").addClass("loading").show()},1e3),!0):void 0},loadingBar.hide=function(e){("error"!==loadingBar.status&&null!==loadingBar.status||e)&&(loadingBar.status=null,visible.header()&&header.dom().removeClass("error loading"),clearTimeout(loadingBar._timeout),setTimeout(function(){loadingBar.dom().hide()},300))},lychee={title:document.title,version:"3.0.1",version_code:"030001",update_path:"http://lychee.electerious.com/version/index.php",updateURL:"https://github.com/electerious/Lychee",website:"http://lychee.electerious.com",publicMode:!1,viewMode:!1,debugMode:!1,checkForUpdates:"1",sorting:"",location:"",dropbox:!1,dropboxKey:"",content:$("#content"),imageview:$("#imageview")},lychee.init=function(){var e;e={version:lychee.version_code},api.post("Session::init",e,function(e){if(2===e.status)lychee.sorting=e.config.sorting||"",lychee.dropboxKey=e.config.dropboxKey||"",lychee.location=e.config.location||"",lychee.checkForUpdates=e.config.checkForUpdates||"1",e.config.login===!1&&settings.createLogin();else if(1===e.status)lychee.checkForUpdates=e.config.checkForUpdates||"1",lychee.setMode("public");else if(0===e.status)return lychee.setMode("public"),header.dom().hide(),lychee.content.hide(),$("body").append(build.no_content("cog")),settings.createConfig(),!0;$(window).bind("popstate",lychee.load),lychee.load()})},lychee.login=function(e){var t,n=e.username,o=e.password;t={user:n,password:o},api.post("Session::login",t,function(e){if(e===!0){try{localStorage.setItem("lychee_username",n)}catch(t){}window.location.reload()}else basicModal.error("password")})},lychee.loginDialog=function(){var e,t="";t="\n <p class='signIn'>\n <input class='text' data-name='username' type='text' value='' placeholder='username' autocapitalize='off' autocorrect='off'>\n <input class='text' data-name='password' type='password' value='' placeholder='password'>\n </p>\n <p class='version'>Lychee "+lychee.version+"<span> – <a target='_blank' href='"+lychee.updateURL+"'>Update available!</a><span></p>\n ",basicModal.show({body:t,buttons:{action:{title:"Sign In",fn:lychee.login},cancel:{title:"Cancel",fn:basicModal.close}}}),localStorage&&(e=localStorage.getItem("lychee_username"),null!==e&&(e.length>0&&$('.basicModal input[data-name="username"]').val(e),$('.basicModal input[data-name="password"]').focus())),"1"===lychee.checkForUpdates&&lychee.getUpdate()},lychee.logout=function(){api.post("Session::logout",{},function(){window.location.reload()})},lychee["goto"]=function(e){e=void 0===e?"#":"#"+e,history.pushState(null,null,e),lychee.load()},lychee.load=function(){var e="",t="",n=document.location.hash.replace("#","").split("/");$(".no_content").remove(),contextMenu.close(),multiselect.close(),void 0!==n[0]&&(e=n[0]),void 0!==n[1]&&(t=n[1]),e&&t?(photo.json=null,(""===lychee.content.html()||$("#search").length&&0!==$("#search").val().length)&&(lychee.content.hide(),album.load(e,!0)),photo.load(t,e)):e?(photo.json=null,visible.sidebar()&&sidebar.toggle(),visible.photo()&&view.photo.hide(),album.json&&e==album.json.id?view.album.title():album.load(e)):(null!==search.hash&&(albums.json=null,search.hash=null),album.json=null,photo.json=null,visible.sidebar()&&sidebar.toggle(),visible.photo()&&view.photo.hide(),albums.load())},lychee.getUpdate=function(){$.ajax({url:lychee.update_path,success:function(e){parseInt(e)>parseInt(lychee.version_code)&&$(".version span").show()}})},lychee.setTitle=function(e,t){document.title=lychee.title+" - "+e,header.setEditable(t),header.setTitle(e)},lychee.setMode=function(e){$("#button_settings, #button_settings, #button_search, #search, #button_trash_album, #button_share_album, .button_add, .button_divider").remove(),$("#button_trash, #button_move, #button_share, #button_star").remove(),$(document).off("click","#title.editable").off("touchend","#title.editable").off("contextmenu",".photo").off("contextmenu",".album").off("drop"),Mousetrap.unbind("u").unbind("s").unbind("f").unbind("r").unbind("d").unbind("t").unbind(["command+backspace","ctrl+backspace"]).unbind(["command+a","ctrl+a"]),"public"===e?(header.dom("#button_signin, #hostedwith").show(),lychee.publicMode=!0):"view"===e&&(Mousetrap.unbind(["esc","command+up"]),$("#button_back, a#next, a#previous").remove(),$(".no_content").remove(),lychee.publicMode=!0,lychee.viewMode=!0)},lychee.animate=function(e,t){var n=[["fadeIn","fadeOut"],["contentZoomIn","contentZoomOut"]];e.jQuery||(e=$(e));for(var o=0;o<n.length;o++)for(var i=0;i<n[o].length;i++)if(n[o][i]==t)return e.removeClass(n[o][0]+" "+n[o][1]).addClass(t),!0;return!1},lychee.escapeHTML=function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")},lychee.retinize=function(){var e=void 0===arguments[0]?"":arguments[0],t=window.devicePixelRatio,n=e.split(".").pop(),o="svg"!==n;return void 0!==t&&t>1&&o===!0&&(e=e.replace(/\.[^/.]+$/,""),e=e+"@2x."+n),{path:e,hasRetina:o}},lychee.loadDropbox=function(e){if(!lychee.dropbox&&lychee.dropboxKey){loadingBar.show();var t=document.createElement("script"),n=document.getElementsByTagName("script")[0];t.src="https://www.dropbox.com/static/api/1/dropins.js",t.id="dropboxjs",t.type="text/javascript",t.async="true",t.setAttribute("data-app-key",lychee.dropboxKey),t.onload=t.onreadystatechange=function(){var t=this.readyState;t&&"complete"!==t&&"loaded"!==t||(lychee.dropbox=!0,loadingBar.hide(),e())},n.parentNode.insertBefore(t,n)}else lychee.dropbox&&lychee.dropboxKey?e():settings.setDropboxKey(e)},lychee.removeHTML=function(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText},lychee.error=function(e,t,n){console.error({description:e,params:t,response:n}),loadingBar.show("error",e)},multiselect={},multiselect.position={top:null,right:null,bottom:null,left:null},multiselect.bind=function(){return $("#content").on("mousedown",function(e){1===e.which&&multiselect.show(e)}),$(document).on("mouseup",function(e){1===e.which&&multiselect.getSelection(e)}),!0},multiselect.show=function(e){return lychee.publicMode?!1:visible.search()?!1:visible.albums()||visible.album?0!==$(".album:hover, .photo:hover").length?!1:(visible.multiselect()&&$("#multiselect").remove(),sidebar.setSelectable(!1),multiselect.position.top=e.pageY,multiselect.position.right=-1*(e.pageX-$(document).width()),multiselect.position.bottom=-1*(multiselect.position.top-$(window).height()),multiselect.position.left=e.pageX,$("body").append(build.multiselect(multiselect.position.top,multiselect.position.left)),void $(document).on("mousemove",multiselect.resize)):!1},multiselect.selectAll=function(){var e,t,n;return lychee.publicMode?!1:visible.search()?!1:visible.albums()||visible.album?(visible.multiselect()&&$("#multiselect").remove(),sidebar.setSelectable(!1),multiselect.position.top=70,multiselect.position.right=40,multiselect.position.bottom=90,multiselect.position.left=20,$("body").append(build.multiselect(multiselect.position.top,multiselect.position.left)),t=$(document).width()-multiselect.position.right+2,n=$(document).height()-multiselect.position.bottom,$("#multiselect").css({width:t,height:n}),e={pageX:$(document).width()-multiselect.position.right/2,pageY:$(document).height()-multiselect.position.bottom},void multiselect.getSelection(e)):!1},multiselect.resize=function(e){var t,n,o=e.pageX,i=e.pageY;return null===multiselect.position.top||null===multiselect.position.right||null===multiselect.position.bottom||null===multiselect.position.left?!1:(i>=multiselect.position.top?(t=i-multiselect.position.top,multiselect.position.top+t>=$(document).height()&&(t-=multiselect.position.top+t-$(document).height()+2),$("#multiselect").css({top:multiselect.position.top,bottom:"inherit",height:t})):$("#multiselect").css({top:"inherit",bottom:multiselect.position.bottom,height:multiselect.position.top-e.pageY}),void(o>=multiselect.position.left?(n=o-multiselect.position.left,multiselect.position.left+n>=$(document).width()&&(n-=multiselect.position.left+n-$(document).width()+2),$("#multiselect").css({right:"inherit",left:multiselect.position.left,width:n})):$("#multiselect").css({right:multiselect.position.right,left:"inherit",width:multiselect.position.left-e.pageX})))},multiselect.stopResize=function(){$(document).off("mousemove")},multiselect.getSize=function(){return visible.multiselect()?{top:$("#multiselect").offset().top,left:$("#multiselect").offset().left,width:parseInt($("#multiselect").css("width").replace("px","")),height:parseInt($("#multiselect").css("height").replace("px",""))}:!1},multiselect.getSelection=function(e){var t,n,o=150,i=[],a=multiselect.getSize();return visible.contextMenu()?!1:visible.multiselect()?($(".photo, .album").each(function(){n=$(this).offset(),n.top>=a.top-o&&n.left>=a.left-o&&n.top+206<=a.top+a.height+o&&n.left+206<=a.left+a.width+o&&(t=$(this).data("id"),"0"!==t&&0!==t&&"f"!==t&&"s"!==t&&"r"!==t&&null!==t&&void 0!==t&&(i.push(t),$(this).addClass("active")))}),void(0!==i.length&&visible.album()?contextMenu.photoMulti(i,e):0!==i.length&&visible.albums()?contextMenu.albumMulti(i,e):multiselect.close())):!1},multiselect.close=function(){sidebar.setSelectable(!0),multiselect.stopResize(),multiselect.position.top=null,multiselect.position.right=null,multiselect.position.bottom=null,multiselect.position.left=null,lychee.animate("#multiselect","fadeOut"),setTimeout(function(){$("#multiselect").remove()},300)},password={value:""},password.get=function(e,t){var n,o=$(".basicModal input.text").val();lychee.publicMode===!1?t():album.json&&"0"===album.json.password?t():albums.json&&"0"===albums.json.albums[e].password?t():albums.json||album.json?void 0==o?password.getDialog(e,t):(n={albumID:e,password:o},api.post("Album::getPublic",n,function(e){e===!0?(basicModal.close(),password.value=o,t()):basicModal.error("password")})):(album.json={password:!0},t(""))},password.getDialog=function(e,t){var n,o,i="";n=function(){password.get(e,t)},o=function(){basicModal.close(),visible.albums()===!1&&lychee["goto"]()},i="\n <p>\n This album is protected by a password. Enter the password below to view the photos of this album:\n <input data-name='password' class='text' type='password' placeholder='password' value=''>\n </p>\n ",basicModal.show({body:i,buttons:{action:{title:"Enter",fn:n},cancel:{title:"Cancel",fn:o}}})},photo={json:null,cache:null},photo.getID=function(){var e=null;return e=photo.json?photo.json.id:$(".photo:hover, .photo.active").attr("data-id"),$.isNumeric(e)===!0?e:!1},photo.load=function(e,t){var n,o;n={photoID:e,albumID:t,password:password.value},api.post("Photo::get",n,function(n){return"Warning: Photo private!"===n?(lychee.content.show(),lychee["goto"](""),!1):"Warning: Wrong password!"===n?(o=function(){""!==password.value?photo.load(e,t):setTimeout(o,250)},o(),!1):(photo.json=n,visible.photo()||view.photo.show(),view.photo.init(),lychee.imageview.show(),void setTimeout(function(){lychee.content.show()},300))})},photo.preloadNext=function(e){var t,n;album.json&&album.json.content&&album.json.content[e]&&""!=album.json.content[e].nextPhoto&&(t=album.json.content[e].nextPhoto,n=album.json.content[t].url,photo.cache=new Image,photo.cache.src=n,photo.cache.onload=function(){photo.cache=null})},photo.parse=function(){photo.json.title||(photo.json.title="Untitled")},photo.previous=function(e){var t=0;photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].previousPhoto&&(e===!0&&(t=200,$("#image").css({WebkitTransform:"translateX(100%)",MozTransform:"translateX(100%)",transform:"translateX(100%)",opacity:0})),setTimeout(function(){return photo.getID()===!1?!1:void lychee["goto"](album.getID()+"/"+album.json.content[photo.getID()].previousPhoto)},t))},photo.next=function(e){var t=0;photo.getID()!==!1&&album.json&&album.json.content[photo.getID()]&&""!==album.json.content[photo.getID()].nextPhoto&&(e===!0&&(t=200,$("#image").css({WebkitTransform:"translateX(-100%)",MozTransform:"translateX(-100%)",transform:"translateX(-100%)",opacity:0})),setTimeout(function(){return photo.getID()===!1?!1:void lychee["goto"](album.getID()+"/"+album.json.content[photo.getID()].nextPhoto)},t))},photo.duplicate=function(e){var t;return e?(e instanceof Array==!1&&(e=[e]),albums.refresh(),t={photoIDs:e.join()},void api.post("Photo::duplicate",t,function(e){e!==!0?lychee.error(null,t,e):album.load(album.getID())})):!1},photo["delete"]=function(e){var t={},n={},o="",i="";return e?(e instanceof Array==!1&&(e=[e]),1===e.length&&(i=visible.photo()?photo.json.title:album.json.content[e].title,""===i&&(i="Untitled")),t.fn=function(){var t="",n="",o="";basicModal.close(),e.forEach(function(e,t,i){(""!==album.json.content[e].nextPhoto||""!==album.json.content[e].previousPhoto)&&(n=album.json.content[e].nextPhoto,o=album.json.content[e].previousPhoto,album.json.content[o].nextPhoto=n,album.json.content[n].previousPhoto=o),album.json.content[e]=null,view.album.content["delete"](e)}),albums.refresh(),visible.photo()&&""!==n&&n!==photo.getID()?lychee["goto"](album.getID()+"/"+n):visible.albums()||lychee["goto"](album.getID()),t={photoIDs:e.join()},api.post("Photo::delete",t,function(e){e!==!0&&lychee.error(null,t,e)})},1===e.length?(t.title="Delete Photo",n.title="Keep Photo",o="<p>Are you sure you want to delete the photo '"+i+"'? This action can't be undone!</p>"):(t.title="Delete Photo",n.title="Keep Photo",o="<p>Are you sure you want to delete all "+e.length+" selected photo? This action can't be undone!</p>"),void basicModal.show({body:o,buttons:{action:{title:t.title,fn:t.fn,"class":"red"},cancel:{title:n.title,fn:basicModal.close}}})):!1},photo.setTitle=function(e){var t,n="",o="",i="";return e?(e instanceof Array==!1&&(e=[e]),1===e.length&&(photo.json?n=photo.json.title:album.json&&(n=album.json.content[e].title),n=n.replace(/'/g,"'")),t=function(t){var n,o=t.title;basicModal.close(),o=lychee.removeHTML(o),visible.photo()&&(photo.json.title=""===o?"Untitled":o,view.photo.title()),e.forEach(function(e,t,n){album.json.content[e].title=o,view.album.content.title(e)}),n={photoIDs:e.join(),title:o},api.post("Photo::setTitle",n,function(e){e!==!0&&lychee.error(null,n,e)})},o="<input class='text' data-name='title' type='text' maxlength='50' placeholder='Title' value='"+n+"'>",i=1===e.length?"<p>Enter a new title for this photo: "+o+"</p>":"<p>Enter a title for all "+e.length+" selected photos: "+o+"</p>",void basicModal.show({body:i,buttons:{action:{title:"Set title",fn:t},cancel:{title:"Cancel",fn:basicModal.close}}})):!1},photo.setAlbum=function(e,t){var n,o,i;return e?(visible.photo&&lychee["goto"](album.getID()),e instanceof Array==!1&&(e=[e]),e.forEach(function(e,t,n){(""!==album.json.content[e].nextPhoto||""!==album.json.content[e].previousPhoto)&&(o=album.json.content[e].nextPhoto,i=album.json.content[e].previousPhoto,album.json.content[i].nextPhoto=o,album.json.content[o].previousPhoto=i),album.json.content[e]=null,view.album.content["delete"](e)}),albums.refresh(),n={photoIDs:e.join(),albumID:t},void api.post("Photo::setAlbum",n,function(e){e!==!0&&lychee.error(null,n,e)})):!1},photo.setStar=function(e){var t;return e?(visible.photo()&&(photo.json.star="0"===photo.json.star?"1":"0",view.photo.star()),e.forEach(function(e,t,n){album.json.content[e].star="0"===album.json.content[e].star?"1":"0",view.album.content.star(e)}),albums.refresh(),t={photoIDs:e.join()},void api.post("Photo::setStar",t,function(e){e!==!0&&lychee.error(null,t,e)})):!1},photo.setPublic=function(e,t){if("2"===photo.json["public"]){var n;return n=function(){basicModal.close(),lychee["goto"](photo.json.original_album)},basicModal.show({body:"<p>This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.</p>",buttons:{action:{title:"Show Album",fn:n},cancel:{title:"Cancel",fn:basicModal.close}}}),!1}visible.photo()&&(photo.json["public"]="0"===photo.json["public"]?"1":"0",view.photo["public"](),"1"===photo.json["public"]&&contextMenu.sharePhoto(e,t)),album.json.content[e]["public"]="0"===album.json.content[e]["public"]?"1":"0",view.album.content["public"](e),albums.refresh(),api.post("Photo::setPublic",{photoID:e},function(e){e!==!0&&lychee.error(null,params,e)})},photo.setDescription=function(e){var t,n=photo.json.description.replace(/'/g,"'");t=function(t){var n,o=t.description;basicModal.close(),o=lychee.removeHTML(o),visible.photo()&&(photo.json.description=o,view.photo.description()),n={photoID:e,description:o},api.post("Photo::setDescription",n,function(e){e!==!0&&lychee.error(null,n,e)})},basicModal.show({body:"<p>Enter a description for this photo: <input class='text' data-name='description' type='text' maxlength='800' placeholder='Description' value='"+n+"'></p>",buttons:{action:{title:"Set Description",fn:t},cancel:{title:"Cancel",fn:basicModal.close}}})},photo.editTags=function(e){var t="",n="",o="";return e?(e instanceof Array==!1&&(e=[e]),visible.photo()&&(t=photo.json.tags),visible.album()&&1===e.length&&(t=album.json.content[e].tags),visible.search()&&1===e.length&&(t=album.json.content[e].tags),visible.album()&&e.length>1&&!function(){var n=!0;e.forEach(function(t,o,i){n=album.json.content[t].tags===album.json.content[e[0]].tags&&n===!0?!0:!1}),n&&(t=album.json.content[e[0]].tags)}(),t=t.replace(/,/g,", "),action=function(t){basicModal.close(),photo.setTags(e,t.tags)},o="<input class='text' data-name='tags' type='text' maxlength='800' placeholder='Tags' value='"+t+"'>",n=1===e.length?"<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: "+o+"</p>":"<p>Enter your tags for all "+e.length+" selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: "+o+"</p>",void basicModal.show({body:n,buttons:{action:{title:"Set Tags",fn:action},cancel:{title:"Cancel",fn:basicModal.close}}})):!1},photo.setTags=function(e,t){var n;return e?(e instanceof Array==!1&&(e=[e]),t=t.replace(/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/g,","),t=t.replace(/,$|^,|(\ ){0,}$/g,""),t=lychee.removeHTML(t),visible.photo()&&(photo.json.tags=t,view.photo.tags()),e.forEach(function(e,n,o){album.json.content[e].tags=t}),n={photoIDs:e.join(),tags:t},void api.post("Photo::setTags",n,function(e){e!==!0&&lychee.error(null,n,e)})):!1},photo.deleteTag=function(e,t){var n;n=photo.json.tags.split(","),n.splice(t,1),photo.json.tags=n.toString(),photo.setTags([e],photo.json.tags)},photo.share=function(e,t){var n="",o=photo.getViewLink(e),i="unknown";switch(t){case 0:n="https://twitter.com/share?url="+encodeURI(o);break;case 1:n="http://www.facebook.com/sharer.php?u="+encodeURI(o)+"&t="+encodeURI(photo.json.title);break;case 2:n="mailto:?subject="+encodeURI(photo.json.title)+"&body="+encodeURI(o);break;case 3:lychee.loadDropbox(function(){i=photo.json.title+"."+photo.getDirectLink().split(".").pop(),Dropbox.save(photo.getDirectLink(),i)});break;default:n=""}n.length>5&&(location.href=n)},photo.getSize=function(){var e="big",t=!1,n=""!==photo.json.medium,o=window.devicePixelRatio,i={width:$(window).width()-60,height:$(window).height()-100};return(photo.json.width>i.width||photo.json.height>i.height)&&(t=!0),void 0!==o&&o>1&&(i.width=i.width*o,i.height=i.height*o),n===!0&&1920>i.width&&1080>i.height&&(e="medium"),t===!1&&photo.json.width<i.width&&photo.json.width<i.height&&(e="small"),e},photo.getArchive=function(e){var t,n=api.path+"?function=Photo::getArchive&photoID="+e;t=location.href.indexOf("index.html")>0?location.href.replace(location.hash,"").replace("index.html",n):location.href.replace(location.hash,"")+n,lychee.publicMode===!0&&(t+="&password="+password.value),location.href=t},photo.getDirectLink=function(){var e="";return photo.json&&photo.json.url&&""!==photo.json.url&&(e=photo.json.url),e},photo.getViewLink=function(e){var t="view.php?p="+e;return location.href.indexOf("index.html")>0?location.href.replace("index.html"+location.hash,t):location.href.replace(location.hash,t)},search={hash:null},search.find=function(e){var t="",n="",o="";clearTimeout($(window).data("timeout")),$(window).data("timeout",setTimeout(function(){0!==$("#search").val().length?api.post("search",{term:e},function(e){e&&e.albums&&(albums.json={albums:e.albums},$.each(albums.json.albums,function(){albums.parse(this),t+=build.album(this)})),e&&e.photos&&(album.json={content:e.photos},$.each(album.json.content,function(){n+=build.photo(this)})),o=""===t&&""===n?"error":""===t?build.divider("Photos")+n:""===n?build.divider("Albums")+t:build.divider("Photos")+n+build.divider("Albums")+t,search.hash!==e.hash&&($(".no_content").remove(),lychee.animate("#content","contentZoomOut"),search.hash=e.hash,setTimeout(function(){"error"===o?(lychee.content.html(""),$("body").append(build.no_content("magnifying-glass"))):(lychee.content.html(o),lychee.animate("#content","contentZoomIn"))},300))}):search.reset()},250))},search.reset=function(){$("#search").val(""),$(".no_content").remove(),null!==search.hash&&(albums.json=null,album.json=null,photo.json=null,search.hash=null,lychee.animate(".divider","fadeOut"),albums.load())},settings={},settings.createConfig=function(){var e,t="";e=function(e){var t,n=e.dbName||"",o=e.dbUser||"",i=e.dbPassword||"",a=e.dbHost||"",s=e.dbTablePrefix||"";return o.length<1?(basicModal.error("dbUser"),!1):(a.length<1&&(a="localhost"),n.length<1&&(n="lychee"),t={dbName:n,dbUser:o,dbPassword:i,dbHost:a,dbTablePrefix:s},void api.post("Database::createConfig",t,function(e){return e!==!0?-1!==e.indexOf("Warning: Connection failed!")?(basicModal.show({body:"<p>Unable to connect to host database because access was denied. Double-check your host, username and password and ensure that access from your current location is permitted.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):-1!==e.indexOf("Warning: Creation failed!")?(basicModal.show({body:"<p>Unable to create the database. Double-check your host, username and password and ensure that the specified user has the rights to modify and add content to the database.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):-1!==e.indexOf("Warning: Could not create file!")?(basicModal.show({body:"<p>Unable to save this configuration. Permission denied in <b>'data/'</b>. Please set the read, write and execute rights for others in <b>'data/'</b> and <b>'uploads/'</b>. Take a look at the readme for more information.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):(basicModal.show({body:"<p>Something unexpected happened. Please try again and check your installation and server. Take a look at the readme for more information.</p>",buttons:{action:{title:"Retry",fn:settings.createConfig}}}),!1):void window.location.reload()}))},t="\n <p>\n Enter your database connection details below:\n <input data-name='dbHost' class='text' type='text' placeholder='Database Host (optional)' value=''>\n <input data-name='dbUser' class='text' type='text' placeholder='Database Username' value=''>\n <input data-name='dbPassword' class='text' type='password' placeholder='Database Password' value=''>\n </p>\n <p>\n Lychee will create its own database. If required, you can enter the name of an existing database instead:\n <input data-name='dbName' class='text' type='text' placeholder='Database Name (optional)' value=''>\n <input data-name='dbTablePrefix' class='text' type='text' placeholder='Table prefix (optional)' value=''>\n </p>\n ",basicModal.show({body:t,buttons:{action:{title:"Connect",fn:e}}})},settings.createLogin=function(){var e,t="";e=function(e){var t,n=e.username,o=e.password;return n.length<1?(basicModal.error("username"),!1):o.length<1?(basicModal.error("password"),!1):(basicModal.close(),t={username:n,password:o},void api.post("Settings::setLogin",t,function(e){e!==!0&&basicModal.show({body:"<p>Unable to save login. Please try again with another username and password!</p>",buttons:{action:{title:"Retry",fn:settings.createLogin}}})}))},t="\n <p>\n Enter a username and password for your installation:\n <input data-name='username' class='text' type='text' placeholder='New Username' value=''>\n <input data-name='password' class='text' type='password' placeholder='New Password' value=''>\n </p>\n ",basicModal.show({body:t,buttons:{action:{title:"Create Login",fn:e}}})},settings.setLogin=function(){var e,t="";e=function(e){var t,n=e.oldPassword||"",o=e.username||"",i=e.password||"";return n.length<1?(basicModal.error("oldPassword"),!1):o.length<1?(basicModal.error("username"),!1):i.length<1?(basicModal.error("password"),!1):(basicModal.close(),t={oldPassword:n,username:o,password:i},void api.post("Settings::setLogin",t,function(e){e!==!0&&lychee.error(null,t,e)}))},t="\n <p>\n Enter your current password:\n <input data-name='oldPassword' class='text' type='password' placeholder='Current Password' value=''>\n </p>\n <p>\n Your username and password will be changed to the following:\n <input data-name='username' class='text' type='text' placeholder='New Username' value=''>\n <input data-name='password' class='text' type='password' placeholder='New Password' value=''>\n </p>\n ",basicModal.show({body:t,buttons:{action:{title:"Change Login",fn:e},cancel:{title:"Cancel",fn:basicModal.close}}})},settings.setSorting=function(){var e,t=[],n="";e=function(){var e;t[0]=$(".basicModal select#settings_type").val(),t[1]=$(".basicModal select#settings_order").val(),basicModal.close(),albums.refresh(),e={type:t[0],order:t[1]},api.post("Settings::setSorting",e,function(n){n===!0?(lychee.sorting="ORDER BY "+t[0]+" "+t[1],lychee.load()):lychee.error(null,e,n)})},n="\n <p>\n Sort photos by\n <select id='settings_type'>\n <option value='id'>Upload Time</option>\n <option value='takestamp'>Take Date</option>\n <option value='title'>Title</option>\n <option value='description'>Description</option>\n <option value='public'>Public</option>\n <option value='star'>Star</option>\n <option value='type'>Photo Format</option>\n </select>\n in an\n <select id='settings_order'>\n <option value='ASC'>Ascending</option>\n <option value='DESC'>Descending</option>\n </select>\n order.\n </p>\n ",basicModal.show({body:n,buttons:{action:{title:"Change Sorting",fn:e},cancel:{title:"Cancel",fn:basicModal.close}}}),""!==lychee.sorting&&(t=lychee.sorting.replace("ORDER BY ","").split(" "),$(".basicModal select#settings_type").val(t[0]),$(".basicModal select#settings_order").val(t[1]))},settings.setDropboxKey=function(e){var t,n="";t=function(t){var n=t.key;return t.key.length<1?(basicModal.error("key"),!1):(basicModal.close(),void api.post("Settings::setDropboxKey",{key:n},function(t){t===!0?(lychee.dropboxKey=n,e&&lychee.loadDropbox(e)):lychee.error(null,params,t)}))},n="\n <p>\n In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below:\n <input class='text' data-name='key' type='text' placeholder='Dropbox API Key' value='"+lychee.dropboxKey+"'>\n </p>\n ",basicModal.show({body:n,buttons:{action:{title:"Set Dropbox Key",fn:t},cancel:{title:"Cancel",fn:basicModal.close}}})},sidebar={_dom:$("#sidebar"),types:{DEFAULT:0,TAGS:1},createStructure:{}},sidebar.dom=function(e){return void 0===e||null===e||""===e?sidebar._dom:sidebar._dom.find(e)},sidebar.bind=function(){var e="ontouchend"in document.documentElement?"touchend":"click";return sidebar.dom("#edit_title").off(e).on(e,function(){visible.photo()?photo.setTitle([photo.getID()]):visible.album()&&album.setTitle([album.getID()])}),sidebar.dom("#edit_description").off(e).on(e,function(){visible.photo()?photo.setDescription(photo.getID()):visible.album()&&album.setDescription(album.getID())}),sidebar.dom("#edit_tags").off(e).on(e,function(){photo.editTags([photo.getID()])}),sidebar.dom("#tags .tag span").off(e).on(e,function(){photo.deleteTag(photo.getID(),$(this).data("index"))}),!0},sidebar.toggle=function(){return visible.sidebar()||visible.sidebarbutton()?(header.dom(".button--info").toggleClass("active"),lychee.content.toggleClass("sidebar"),sidebar.dom().toggleClass("active"),!0):!1},sidebar.setSelectable=function(){var e=void 0===arguments[0]?!0:arguments[0];e===!0?sidebar.dom().removeClass("notSelectable"):sidebar.dom().addClass("notSelectable")},sidebar.changeAttr=function(e){var t=void 0===arguments[1]?"-":arguments[1];return void 0===e||null===e||""===e?!1:((""===t||null===t)&&(t="-"),sidebar.dom(".attr_"+e).html(t),!0)},sidebar.createStructure.photo=function(e){if(void 0===e||null===e||""===e)return!1;var t=!1,n=e.takestamp+e.make+e.model+e.shutter+e.aperture+e.focal+e.iso,o={},i="";switch(lychee.publicMode===!1&&(t=!0),e["public"]){case"0":i="No";break;case"1":i="Yes";break;case"2":i="Yes (Album)";break;default:i="-"}return o.basics={title:"Basics",type:sidebar.types.DEFAULT,rows:[{title:"Title",value:e.title,editable:t},{title:"Uploaded",value:e.sysdate},{title:"Description",value:e.description,editable:t}]},o.image={title:"Image",type:sidebar.types.DEFAULT,rows:[{title:"Size",value:e.size},{title:"Format",value:e.type},{title:"Resolution",value:e.width+" x "+e.height}]},o.tags=lychee.publicMode===!1?{title:"Tags",type:sidebar.types.TAGS,value:build.tags(e.tags),editable:t}:{},o.exif="0"!==n?{title:"Camera",type:sidebar.types.DEFAULT,rows:[{title:"Captured",value:e.takedate},{title:"Make",value:e.make},{title:"Type/Model",value:e.model},{title:"Shutter Speed",value:e.shutter},{title:"Aperture",value:e.aperture},{title:"Focal Length",value:e.focal},{title:"ISO",value:e.iso}]}:{},o.sharing={title:"Sharing",type:sidebar.types.DEFAULT,rows:[{title:"Public",value:i}]},o=[o.basics,o.image,o.tags,o.exif,o.sharing]},sidebar.createStructure.album=function(e){if(void 0===e||null===e||""===e)return!1;var t=!1,n={},o="",i="",a="",s="";switch(lychee.publicMode===!1&&(t=!0),e["public"]){case"0":o="No";break;case"1":o="Yes";break;default:o="-"}switch(e.visible){case"0":i="No";break;case"1":i="Yes";break;default:i="-"}switch(e.downloadable){case"0":a="No";break;case"1":a="Yes";break;default:a="-"}switch(e.password){case"0":s="No";break;case"1":s="Yes";break;default:s="-"}return n.basics={title:"Basics",type:sidebar.types.DEFAULT,rows:[{title:"Title",value:e.title,editable:t},{title:"Description",value:e.description,editable:t}]},n.album={title:"Album",type:sidebar.types.DEFAULT,rows:[{title:"Created",value:e.sysdate},{title:"Images",value:e.num}]},n.share={title:"Share",type:sidebar.types.DEFAULT,rows:[{title:"Public",value:o},{title:"Visible",value:i},{title:"Downloadable",value:a},{title:"Password",value:s}]},n=[n.basics,n.album,n.share]},sidebar.render=function(e){if(void 0===e||null===e||""===e)return!1;var t="",n=function(e){var t="";return t+="\n <div class='divider'>\n <h1>"+e.title+"</h1>\n </div>\n <table>\n ",e.rows.forEach(function(e){var n=e.value;(""===n||null===n||void 0===n)&&(n="-"),
- n="<span class='attr_"+e.title.toLowerCase()+"'>"+n+"</span>",e.editable===!0&&(n+=" "+build.editIcon("edit_"+e.title.toLowerCase())),t+="\n <tr>\n <td>"+e.title+"</td>\n <td>"+n+"</td>\n </tr>\n "}),t+="\n </table>\n "},o=function(e){var t="";return t+="\n <div class='divider'>\n <h1>"+e.title+"</h1>\n </div>\n <div id='tags'>\n <div class='attr_"+e.title.toLowerCase()+"'>"+e.value+"</div>\n ",e.editable===!0&&(t+=build.editIcon("edit_tags")),t+="\n </div>\n "};return e.forEach(function(e){e.type===sidebar.types.DEFAULT?t+=n(e):e.type===sidebar.types.TAGS&&(t+=o(e))}),t},swipe={obj:null,tolerance:150,offset:0},swipe.start=function(e,t){return e&&(swipe.obj=e),t&&(swipe.tolerance=t),!0},swipe.move=function(e){return null===swipe.obj?!1:(swipe.offset=-1*e.x,void swipe.obj.css({WebkitTransform:"translateX("+swipe.offset+"px)",MozTransform:"translateX("+swipe.offset+"px)",transform:"translateX("+swipe.offset+"px)"}))},swipe.stop=function(e,t,n){e.x<=-swipe.tolerance?t(!0):e.x>=swipe.tolerance?n(!0):null!==swipe.obj&&swipe.obj.css({WebkitTransform:"translateX(0px)",MozTransform:"translateX(0px)",transform:"translateX(0px)"}),swipe.obj=null,swipe.offset=0},upload={},upload.show=function(e,t,n){basicModal.show({body:build.uploadModal(e,t),buttons:{action:{title:"Close","class":"hidden",fn:basicModal.close}},callback:n})},upload.notify=function(e,t){var n;return t&&""!==t||(t="You can now manage your new photo(s)."),window.webkitNotifications?(0!==window.webkitNotifications.checkPermission()&&window.webkitNotifications.requestPermission(),void(0===window.webkitNotifications.checkPermission()&&e&&(n=window.webkitNotifications.createNotification("",e,t),n.show()))):!1},upload.start={local:function(e){var t=album.getID(),n=!1,o=function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,i){var a=new FormData,s=new XMLHttpRequest,r=0,l=0,u=function(){window.onbeforeunload=null,$("#upload_files").val(""),n===!1?(basicModal.close(),upload.notify("Upload complete")):($(".basicModal #basicModal__action.hidden").show(),upload.notify("Upload complete","Failed to upload one or more photos.")),albums.refresh(),album.getID()===!1?lychee["goto"]("0"):album.load(t)};if(i.supported===!1){if(null!==i.next)o(e,i.next);else{for(var c=!1,d=0;d<e.length;d++)if(e[d].supported===!0){c=!0;break}c===!1&&setTimeout(u,2e3)}return!1}a.append("function","Photo::add"),a.append("albumID",t),a.append("tags",""),a.append(0,i),s.open("POST",api.path),s.onload=function(){var t=!1,o="";i.ready=!0,200===s.status&&"1"===s.responseText?$(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html("Finished").addClass("success"):($(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html("Error").addClass("error"),o="Error:"===s.responseText.substr(0,6)?s.responseText.substr(6)+" Please take a look at the console of your browser for further details.":"Server returned an unknown response. Please take a look at the console of your browser for further details.",$(".basicModal .rows .row:nth-child("+(i.num+1)+") p.notice").html(o).show(),n=!0,lychee.error("Upload failed. Server returned the status code "+s.status+"!",s,s.responseText));for(var a=0;a<e.length;a++)if(e[a].ready===!1){t=!0;break}t===!1&&u()},s.upload.onprogress=function(t){if(t.lengthComputable&&(l=t.loaded/t.total*100|0,l>r&&($(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html(l+"%"),r=l),l>=100)){var n=0;i.num+1>4&&(n=40*(i.num+1-4)),$(".basicModal .rows").scrollTop(n),$(".basicModal .rows .row:nth-child("+(i.num+1)+") .status").html("Processing"),null!==i.next&&o(e,i.next)}},s.send(a)});if(e.length<=0)return!1;(t===!1||visible.albums()===!0)&&(t=0);for(var i=0;i<e.length;i++)e[i].num=i,e[i].ready=!1,e[i].supported=!0,e[i].next=i<e.length-1?e[i+1]:null,"image/jpeg"!==e[i].type&&"image/jpg"!==e[i].type&&"image/png"!==e[i].type&&"image/gif"!==e[i].type&&(e[i].ready=!0,e[i].supported=!1);window.onbeforeunload=function(){return"Lychee is currently uploading!"},upload.show("Uploading",e,function(){o(e,e[0])})},url:function e(){var t,e=void 0===arguments[0]?"":arguments[0],n=album.getID(),e="string"==typeof e?e:"";n===!1&&(n=0),t=function(e){var t,o=[];if(e.link&&e.link.length>3){if(basicModal.close(),t=e.link.split(".").pop(),"jpeg"!==t&&"jpg"!==t&&"png"!==t&&"gif"!==t&&"webp"!==t)return loadingBar.show("error","The file format of this link is not supported."),!1;o[0]={name:e.link,supported:!0},upload.show("Importing URL",o,function(){var t;$(".basicModal .rows .row .status").html("Importing"),t={url:e.link,albumID:n},api.post("Import::url",t,function(e){basicModal.close(),upload.notify("Import complete"),albums.refresh(),album.getID()===!1?lychee["goto"]("0"):album.load(n),e!==!0&&lychee.error(null,t,e)})})}else basicModal.error("link")},basicModal.show({body:"<p>Please enter the direct link to a photo to import it: <input class='text' data-name='link' type='text' placeholder='http://' value='"+e+"'></p>",buttons:{action:{title:"Import",fn:t},cancel:{title:"Cancel",fn:basicModal.close}}})},server:function(){var e,t=album.getID();t===!1&&(t=0),e=function(e){var n=[];n[0]={name:e.path,supported:!0},upload.show("Importing from server",n,function(){var n;$(".basicModal .rows .row .status").html("Importing"),n={albumID:t,path:e.path},api.post("Import::server",n,function(e){return basicModal.close(),upload.notify("Import complete"),albums.refresh(),"Notice: Import only contains albums!"===e?visible.albums()?lychee.load():lychee["goto"](""):album.getID()===!1?lychee["goto"]("0"):album.load(t),"Notice: Import only contains albums!"===e?!0:void("Warning: Folder empty!"===e?lychee.error("Folder empty. No photos imported!",n,e):e!==!0&&lychee.error(null,n,e))})})},basicModal.show({body:"<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' data-name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='"+lychee.location+"uploads/import/'></p>",buttons:{action:{title:"Import",fn:e},cancel:{title:"Cancel",fn:basicModal.close}}})},dropbox:function(){var e,t=album.getID(),n="";t===!1&&(t=0),e=function(e){for(var o=0;o<e.length;o++)n+=e[o].link+",",e[o]={name:e[o].link,supported:!0};n=n.substr(0,n.length-1),upload.show("Importing from Dropbox",e,function(){var e;$(".basicModal .rows .row .status").html("Importing"),e={url:n,albumID:t},api.post("Import::url",e,function(n){basicModal.close(),upload.notify("Import complete"),albums.refresh(),album.getID()===!1?lychee["goto"]("0"):album.load(t),n!==!0&&lychee.error(null,e,n)})})},lychee.loadDropbox(function(){Dropbox.choose({linkType:"direct",multiselect:!0,success:e})})}},view={},view.albums={init:function(){view.albums.title(),view.albums.content.init()},title:function(){lychee.setTitle("Albums",!1)},content:{scrollPosition:0,init:function(){var e="",t="";lychee.publicMode===!1&&(albums.parse(albums.json.smartalbums.unsorted),albums.parse(albums.json.smartalbums["public"]),albums.parse(albums.json.smartalbums.starred),albums.parse(albums.json.smartalbums.recent),e=build.divider("Smart Albums")+build.album(albums.json.smartalbums.unsorted)+build.album(albums.json.smartalbums["public"])+build.album(albums.json.smartalbums.starred)+build.album(albums.json.smartalbums.recent)),albums.json.albums&&0!==albums.json.num&&($.each(albums.json.albums,function(){albums.parse(this),t=build.album(this)+t}),lychee.publicMode===!1&&(t=build.divider("Albums")+t)),""===e&&""===t?(lychee.content.html(""),$("body").append(build.no_content("eye"))):lychee.content.html(e+t),null!==view.albums.content.scrollPosition&&0!==view.albums.content.scrollPosition&&$(document).scrollTop(view.albums.content.scrollPosition)},title:function t(e){var n="",t=albums.json.albums[e].title;null!==t&&t.length>18&&(n=t,t=t.substr(0,18)+"..."),$('.album[data-id="'+e+'"] .overlay h1').html(t).attr("title",n)},"delete":function(e){$('.album[data-id="'+e+'"]').css("opacity",0).animate({width:0,marginLeft:0},300,function(){$(this).remove(),albums.json.num<=0&&lychee.animate("#content .divider:last-of-type","fadeOut")})}}},view.album={init:function(){album.parse(),view.album.sidebar(),view.album.title(),view.album["public"](),view.album.content.init(),album.json.init=1},title:function(){if((visible.album()||!album.json.init)&&!visible.photo())switch(album.getID()){case"f":lychee.setTitle("Starred",!1);break;case"s":lychee.setTitle("Public",!1);break;case"r":lychee.setTitle("Recent",!1);break;case"0":lychee.setTitle("Unsorted",!1);break;default:album.json.init&&sidebar.changeAttr("title",album.json.title),lychee.setTitle(album.json.title,!0)}},content:{init:function(){var e="";view.albums.content.scrollPosition=$(document).scrollTop(),$("html, body").scrollTop(0),$.each(album.json.content,function(){e+=build.photo(this)}),lychee.content.html(e)},title:function n(e){var t="",n=album.json.content[e].title;null!==n&&n.length>18&&(t=n,n=n.substr(0,18)+"..."),$('.photo[data-id="'+e+'"] .overlay h1').html(n).attr("title",t)},star:function(e){$('.photo[data-id="'+e+'"] .iconic-star').remove(),"1"===album.json.content[e].star&&$('.photo[data-id="'+e+'"]').append("<a class='badge iconic-star'>"+build.iconic("star")+"</a>")},"public":function(e){$('.photo[data-id="'+e+'"] .iconic-share').remove(),"1"===album.json.content[e]["public"]&&$('.photo[data-id="'+e+'"]').append("<a class='badge iconic-share'>"+build.iconic("eye")+"</a>")},"delete":function(e){$('.photo[data-id="'+e+'"]').css("opacity",0).animate({width:0,marginLeft:0},300,function(){$(this).remove(),visible.albums()||(album.json.num--,view.album.num(),view.album.title())})}},description:function(){sidebar.changeAttr("description",album.json.description)},num:function(){sidebar.changeAttr("images",album.json.num)},"public":function(){"1"===album.json["public"]?($("#button_share_album").addClass("active").attr("title","Share Album"),$(".photo .iconic-share").remove(),album.json.init&&sidebar.changeAttr("public","Yes")):($("#button_share_album").removeClass("active").attr("title","Make Public"),album.json.init&&sidebar.changeAttr("public","No"))},visible:function(){"1"===album.json.visible?sidebar.changeAttr("visible","Yes"):sidebar.changeAttr("visible","No")},downloadable:function(){"1"===album.json.downloadable?sidebar.changeAttr("downloadable","Yes"):sidebar.changeAttr("downloadable","No")},password:function(){"1"===album.json.password?sidebar.changeAttr("password","Yes"):sidebar.changeAttr("password","No")},sidebar:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){if((visible.album()||!album.json.init)&&!visible.photo()){var e=sidebar.createStructure.album(album.json),t=sidebar.render(e);sidebar.dom(".wrapper").html(t),sidebar.bind()}})},view.photo={init:function(){photo.parse(),view.photo.sidebar(),view.photo.title(),view.photo.star(),view.photo["public"](),view.photo.photo(),photo.json.init=1},show:function(){lychee.content.addClass("view"),header.setMode("photo"),$("body").css("overflow","hidden"),$(document).bind("mouseenter",header.show).bind("mouseleave",header.hide),lychee.animate(lychee.imageview,"fadeIn")},hide:function(){header.show(),lychee.content.removeClass("view"),header.setMode("album"),$("body").css("overflow","auto"),$(document).unbind("mouseenter").unbind("mouseleave"),lychee.animate(lychee.imageview,"fadeOut"),setTimeout(function(){lychee.imageview.hide(),view.album.sidebar()},300)},title:function(){photo.json.init&&sidebar.changeAttr("title",photo.json.title),lychee.setTitle(photo.json.title,!0)},description:function(){photo.json.init&&sidebar.changeAttr("description",photo.json.description)},star:function(){1==photo.json.star?$("#button_star").addClass("active").attr("title","Unstar Photo"):($("#button_star").removeClass("active"),$("#button_star").attr("title","Star Photo"))},"public":function(){"1"===photo.json["public"]||"2"===photo.json["public"]?($("#button_share").addClass("active").attr("title","Share Photo"),photo.json.init&&sidebar.changeAttr("public","Yes")):($("#button_share").removeClass("active").attr("title","Make Public"),photo.json.init&&sidebar.changeAttr("public","No"))},tags:function(){sidebar.changeAttr("tags",build.tags(photo.json.tags)),sidebar.bind()},photo:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){lychee.imageview.html(build.imageview(photo.json,photo.getSize(),visible.header()));var e=lychee.imageview.find("a#next"),t=lychee.imageview.find("a#previous"),n=album.json&&album.json.content&&album.json.content[photo.getID()]&&""===album.json.content[photo.getID()].nextPhoto,o=album.json&&album.json.content&&album.json.content[photo.getID()]&&""===album.json.content[photo.getID()].previousPhoto;if(n||lychee.viewMode)e.hide();else{var i=album.json.content[photo.getID()].nextPhoto,a=album.json.content[i];e.css("background-image",'linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("'+a.thumbUrl+'")')}if(o||lychee.viewMode)t.hide();else{var s=album.json.content[photo.getID()].previousPhoto,r=album.json.content[s];t.css("background-image",'linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("'+r.thumbUrl+'")')}}),sidebar:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){var e=sidebar.createStructure.photo(photo.json),t=sidebar.render(e);sidebar.dom(".wrapper").html(t),sidebar.bind()})},visible={},visible.albums=function(){return"block"===$("#tools_albums").css("display")?!0:!1},visible.album=function(){return"block"===$("#tools_album").css("display")?!0:!1},visible.photo=function(){return $("#imageview.fadeIn").length>0?!0:!1},visible.search=function(){return null!==search.hash?!0:!1},visible.sidebar=function(){return sidebar.dom().hasClass("active")===!0?!0:!1},visible.sidebarbutton=function(){return visible.albums()?!1:visible.photo()?!0:visible.album()&&$("#button_info_album:visible").length>0?!0:!1},visible.header=function(){return header.dom().hasClass("hidden")===!0?!1:!0},visible.message=function(){return $(".message").length>0?!0:!1},visible.signin=function(){return $(".message .sign_in").length>0?!0:!1},visible.contextMenu=function(){return basicContext.visible()},visible.multiselect=function(){return $("#multiselect").length>0?!0:!1};
|