/* Minification failed. Returning unminified contents.
(5620,90-97): run-time error JS1019: Can't have 'break' outside of loop: break a
(5620,42-49): run-time error JS1019: Can't have 'break' outside of loop: break a
(5171,353-360): run-time error JS1019: Can't have 'break' outside of loop: break a
(5132,31-38): run-time error JS1019: Can't have 'break' outside of loop: break a
 */
/*! jQuery v2.2.0 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!k.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c}catch(e){}O.set(a,b,c);
}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={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,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return this;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,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(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b];
},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){return n.trim(a.value)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var hb=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!hb.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,hb.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var ib=a.location,jb=n.now(),kb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return(!c||c.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+b),c};var lb=/#.*$/,mb=/([?&])_=[^&]*/,nb=/^(.*?):[ \t]*([^\r\n]*)$/gm,ob=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,pb=/^(?:GET|HEAD)$/,qb=/^\/\//,rb={},sb={},tb="*/".concat("*"),ub=d.createElement("a");ub.href=ib.href;function vb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function wb(a,b,c,d){var e={},f=a===sb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function xb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function yb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function zb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ib.href,type:"GET",isLocal:ob.test(ib.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?xb(xb(a,n.ajaxSettings),b):xb(n.ajaxSettings,a)},ajaxPrefilter:vb(rb),ajaxTransport:vb(sb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=nb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||ib.href)+"").replace(lb,"").replace(qb,ib.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=ub.protocol+"//"+ub.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),wb(rb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!pb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(kb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=mb.test(f)?f.replace(mb,"$1_="+jb++):f+(kb.test(f)?"&":"?")+"_="+jb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+tb+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=wb(sb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=yb(m,x,d)),u=zb(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Ab=/%20/g,Bb=/\[\]$/,Cb=/\r?\n/g,Db=/^(?:submit|button|image|reset|file)$/i,Eb=/^(?:input|select|textarea|keygen)/i;function Fb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Bb.test(a)?d(a,e):Fb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Fb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Fb(c,a[c],b,e);return d.join("&").replace(Ab,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Eb.test(this.nodeName)&&!Db.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Cb,"\r\n")}}):{name:b.name,value:c.replace(Cb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Gb={0:200,1223:204},Hb=n.ajaxSettings.xhr();l.cors=!!Hb&&"withCredentials"in Hb,l.ajax=Hb=!!Hb,n.ajaxTransport(function(b){var c,d;return l.cors||Hb&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Gb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Ib=[],Jb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Ib.pop()||n.expando+"_"+jb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Jb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Jb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Jb,"$1"+e):b.jsonp!==!1&&(b.url+=(kb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Ib.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Kb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Kb)return Kb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Lb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Lb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0)-a.scrollTop(),d.left+=n.css(a[0],"borderLeftWidth",!0)-a.scrollLeft()),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Lb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Mb=a.jQuery,Nb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Nb),b&&a.jQuery===n&&(a.jQuery=Mb),n},b||(a.jQuery=a.$=n),n});
;
/* NUGET: BEGIN LICENSE TEXT
 *
 * Microsoft grants you the right to use these script files for the sole
 * purpose of either: (i) interacting through your browser with the Microsoft
 * website or online service, subject to the applicable licensing or use
 * terms; or (ii) using the files as included with a Microsoft product subject
 * to that product's license terms. Microsoft reserves all other rights to the
 * files not expressly granted by Microsoft, whether by implication, estoppel
 * or otherwise. Insofar as a script file is dual licensed under GPL,
 * Microsoft neither took the code under GPL nor distributes it thereunder but
 * under the terms set out in this paragraph. All notices and licenses
 * below are for informational purposes only.
 *
 * NUGET: END LICENSE TEXT */
/*!
** Unobtrusive Ajax support library for jQuery
** Copyright (C) Microsoft Corporation. All rights reserved.
*/

/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global window: false, jQuery: false */

(function ($) {
    var data_click = "unobtrusiveAjaxClick",
        data_target = "unobtrusiveAjaxClickTarget",
        data_validation = "unobtrusiveValidation";

    function getFunction(code, argNames) {
        var fn = window, parts = (code || "").split(".");
        while (fn && parts.length) {
            fn = fn[parts.shift()];
        }
        if (typeof (fn) === "function") {
            return fn;
        }
        argNames.push(code);
        return Function.constructor.apply(null, argNames);
    }

    function isMethodProxySafe(method) {
        return method === "GET" || method === "POST";
    }

    function asyncOnBeforeSend(xhr, method) {
        if (!isMethodProxySafe(method)) {
            xhr.setRequestHeader("X-HTTP-Method-Override", method);
        }
    }

    function asyncOnSuccess(element, data, contentType) {
        var mode;

        if (contentType.indexOf("application/x-javascript") !== -1) {  // jQuery already executes JavaScript for us
            return;
        }

        mode = (element.getAttribute("data-ajax-mode") || "").toUpperCase();
        $(element.getAttribute("data-ajax-update")).each(function (i, update) {
            var top;

            switch (mode) {
            case "BEFORE":
                top = update.firstChild;
                $("<div />").html(data).contents().each(function () {
                    update.insertBefore(this, top);
                });
                break;
            case "AFTER":
                $("<div />").html(data).contents().each(function () {
                    update.appendChild(this);
                });
                break;
            case "REPLACE-WITH":
                $(update).replaceWith(data);
                break;
            default:
                $(update).html(data);
                break;
            }
        });
    }

    function asyncRequest(element, options) {
        var confirm, loading, method, duration;

        confirm = element.getAttribute("data-ajax-confirm");
        if (confirm && !window.confirm(confirm)) {
            return;
        }

        loading = $(element.getAttribute("data-ajax-loading"));
        duration = parseInt(element.getAttribute("data-ajax-loading-duration"), 10) || 0;

        $.extend(options, {
            type: element.getAttribute("data-ajax-method") || undefined,
            url: element.getAttribute("data-ajax-url") || undefined,
            cache: !!element.getAttribute("data-ajax-cache"),
            beforeSend: function (xhr) {
                var result;
                asyncOnBeforeSend(xhr, method);
                result = getFunction(element.getAttribute("data-ajax-begin"), ["xhr"]).apply(element, arguments);
                if (result !== false) {
                    loading.show(duration);
                }
                return result;
            },
            complete: function () {
                loading.hide(duration);
                getFunction(element.getAttribute("data-ajax-complete"), ["xhr", "status"]).apply(element, arguments);
            },
            success: function (data, status, xhr) {
                asyncOnSuccess(element, data, xhr.getResponseHeader("Content-Type") || "text/html");
                getFunction(element.getAttribute("data-ajax-success"), ["data", "status", "xhr"]).apply(element, arguments);
            },
            error: function () {
                getFunction(element.getAttribute("data-ajax-failure"), ["xhr", "status", "error"]).apply(element, arguments);
            }
        });

        options.data.push({ name: "X-Requested-With", value: "XMLHttpRequest" });

        method = options.type.toUpperCase();
        if (!isMethodProxySafe(method)) {
            options.type = "POST";
            options.data.push({ name: "X-HTTP-Method-Override", value: method });
        }

        $.ajax(options);
    }

    function validate(form) {
        var validationInfo = $(form).data(data_validation);
        return !validationInfo || !validationInfo.validate || validationInfo.validate();
    }

    $(document).on("click", "a[data-ajax=true]", function (evt) {
        evt.preventDefault();
        asyncRequest(this, {
            url: this.href,
            type: "GET",
            data: []
        });
    });

    $(document).on("click", "form[data-ajax=true] input[type=image]", function (evt) {
        var name = evt.target.name,
            target = $(evt.target),
            form = $(target.parents("form")[0]),
            offset = target.offset();

        form.data(data_click, [
            { name: name + ".x", value: Math.round(evt.pageX - offset.left) },
            { name: name + ".y", value: Math.round(evt.pageY - offset.top) }
        ]);

        setTimeout(function () {
            form.removeData(data_click);
        }, 0);
    });

    $(document).on("click", "form[data-ajax=true] :submit", function (evt) {
        var name = evt.currentTarget.name,
            target = $(evt.target),
            form = $(target.parents("form")[0]);

        form.data(data_click, name ? [{ name: name, value: evt.currentTarget.value }] : []);
        form.data(data_target, target);

        setTimeout(function () {
            form.removeData(data_click);
            form.removeData(data_target);
        }, 0);
    });

    $(document).on("submit", "form[data-ajax=true]", function (evt) {
        var clickInfo = $(this).data(data_click) || [],
            clickTarget = $(this).data(data_target),
            isCancel = clickTarget && clickTarget.hasClass("cancel");
        evt.preventDefault();
        if (!isCancel && !validate(this)) {
            return;
        }
        asyncRequest(this, {
            url: this.action,
            type: this.method || "GET",
            data: clickInfo.concat($(this).serializeArray())
        });
    });
}(jQuery));;
/*!
 * Modernizr v2.8.3
 * www.modernizr.com
 *
 * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
 * Available under the BSD and MIT licenses: www.modernizr.com/license/
 */

/*
 * Modernizr tests which native CSS3 and HTML5 features are available in
 * the current UA and makes the results available to you in two ways:
 * as properties on a global Modernizr object, and as classes on the
 * <html> element. This information allows you to progressively enhance
 * your pages with a granular level of control over the experience.
 *
 * Modernizr has an optional (not included) conditional resource loader
 * called Modernizr.load(), based on Yepnope.js (yepnopejs.com).
 * To get a build that includes Modernizr.load(), as well as choosing
 * which tests to include, go to www.modernizr.com/download/
 *
 * Authors        Faruk Ates, Paul Irish, Alex Sexton
 * Contributors   Ryan Seddon, Ben Alman
 */

window.Modernizr = (function( window, document, undefined ) {

    var version = '2.8.3',

    Modernizr = {},

    /*>>cssclasses*/
    // option for enabling the HTML classes to be added
    enableClasses = true,
    /*>>cssclasses*/

    docElement = document.documentElement,

    /**
     * Create our "modernizr" element that we do most feature tests on.
     */
    mod = 'modernizr',
    modElem = document.createElement(mod),
    mStyle = modElem.style,

    /**
     * Create the input element for various Web Forms feature tests.
     */
    inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ ,

    /*>>smile*/
    smile = ':)',
    /*>>smile*/

    toString = {}.toString,

    // TODO :: make the prefixes more granular
    /*>>prefixes*/
    // List of property values to set for css tests. See ticket #21
    prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
    /*>>prefixes*/

    /*>>domprefixes*/
    // Following spec is to expose vendor-specific style properties as:
    //   elem.style.WebkitBorderRadius
    // and the following would be incorrect:
    //   elem.style.webkitBorderRadius

    // Webkit ghosts their properties in lowercase but Opera & Moz do not.
    // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+
    //   erik.eae.net/archives/2008/03/10/21.48.10/

    // More here: github.com/Modernizr/Modernizr/issues/issue/21
    omPrefixes = 'Webkit Moz O ms',

    cssomPrefixes = omPrefixes.split(' '),

    domPrefixes = omPrefixes.toLowerCase().split(' '),
    /*>>domprefixes*/

    /*>>ns*/
    ns = {'svg': 'http://www.w3.org/2000/svg'},
    /*>>ns*/

    tests = {},
    inputs = {},
    attrs = {},

    classes = [],

    slice = classes.slice,

    featureName, // used in testing loop


    /*>>teststyles*/
    // Inject element with style element and some CSS rules
    injectElementWithStyles = function( rule, callback, nodes, testnames ) {

      var style, ret, node, docOverflow,
          div = document.createElement('div'),
          // After page load injecting a fake body doesn't work so check if body exists
          body = document.body,
          // IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it.
          fakeBody = body || document.createElement('body');

      if ( parseInt(nodes, 10) ) {
          // In order not to give false positives we create a node for each test
          // This also allows the method to scale for unspecified uses
          while ( nodes-- ) {
              node = document.createElement('div');
              node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
              div.appendChild(node);
          }
      }

      // <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed
      // when injected with innerHTML. To get around this you need to prepend the 'NoScope' element
      // with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements.
      // msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx
      // Documents served as xml will throw if using &shy; so use xml friendly encoded version. See issue #277
      style = ['&#173;','<style id="s', mod, '">', rule, '</style>'].join('');
      div.id = mod;
      // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody.
      // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270
      (body ? div : fakeBody).innerHTML += style;
      fakeBody.appendChild(div);
      if ( !body ) {
          //avoid crashing IE8, if background image is used
          fakeBody.style.background = '';
          //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible
          fakeBody.style.overflow = 'hidden';
          docOverflow = docElement.style.overflow;
          docElement.style.overflow = 'hidden';
          docElement.appendChild(fakeBody);
      }

      ret = callback(div, rule);
      // If this is done after page load we don't want to remove the body so check if body exists
      if ( !body ) {
          fakeBody.parentNode.removeChild(fakeBody);
          docElement.style.overflow = docOverflow;
      } else {
          div.parentNode.removeChild(div);
      }

      return !!ret;

    },
    /*>>teststyles*/

    /*>>mq*/
    // adapted from matchMedia polyfill
    // by Scott Jehl and Paul Irish
    // gist.github.com/786768
    testMediaQuery = function( mq ) {

      var matchMedia = window.matchMedia || window.msMatchMedia;
      if ( matchMedia ) {
        return matchMedia(mq) && matchMedia(mq).matches || false;
      }

      var bool;

      injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
        bool = (window.getComputedStyle ?
                  getComputedStyle(node, null) :
                  node.currentStyle)['position'] == 'absolute';
      });

      return bool;

     },
     /*>>mq*/


    /*>>hasevent*/
    //
    // isEventSupported determines if a given element supports the given event
    // kangax.github.com/iseventsupported/
    //
    // The following results are known incorrects:
    //   Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative
    //   Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333
    //   ...
    isEventSupported = (function() {

      var TAGNAMES = {
        'select': 'input', 'change': 'input',
        'submit': 'form', 'reset': 'form',
        'error': 'img', 'load': 'img', 'abort': 'img'
      };

      function isEventSupported( eventName, element ) {

        element = element || document.createElement(TAGNAMES[eventName] || 'div');
        eventName = 'on' + eventName;

        // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those
        var isSupported = eventName in element;

        if ( !isSupported ) {
          // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element
          if ( !element.setAttribute ) {
            element = document.createElement('div');
          }
          if ( element.setAttribute && element.removeAttribute ) {
            element.setAttribute(eventName, '');
            isSupported = is(element[eventName], 'function');

            // If property was created, "remove it" (by setting value to `undefined`)
            if ( !is(element[eventName], 'undefined') ) {
              element[eventName] = undefined;
            }
            element.removeAttribute(eventName);
          }
        }

        element = null;
        return isSupported;
      }
      return isEventSupported;
    })(),
    /*>>hasevent*/

    // TODO :: Add flag for hasownprop ? didn't last time

    // hasOwnProperty shim by kangax needed for Safari 2.0 support
    _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;

    if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
      hasOwnProp = function (object, property) {
        return _hasOwnProperty.call(object, property);
      };
    }
    else {
      hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
        return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
      };
    }

    // Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js
    // es5.github.com/#x15.3.4.5

    if (!Function.prototype.bind) {
      Function.prototype.bind = function bind(that) {

        var target = this;

        if (typeof target != "function") {
            throw new TypeError();
        }

        var args = slice.call(arguments, 1),
            bound = function () {

            if (this instanceof bound) {

              var F = function(){};
              F.prototype = target.prototype;
              var self = new F();

              var result = target.apply(
                  self,
                  args.concat(slice.call(arguments))
              );
              if (Object(result) === result) {
                  return result;
              }
              return self;

            } else {

              return target.apply(
                  that,
                  args.concat(slice.call(arguments))
              );

            }

        };

        return bound;
      };
    }

    /**
     * setCss applies given styles to the Modernizr DOM node.
     */
    function setCss( str ) {
        mStyle.cssText = str;
    }

    /**
     * setCssAll extrapolates all vendor-specific css strings.
     */
    function setCssAll( str1, str2 ) {
        return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
    }

    /**
     * is returns a boolean for if typeof obj is exactly type.
     */
    function is( obj, type ) {
        return typeof obj === type;
    }

    /**
     * contains returns a boolean for if substr is found within str.
     */
    function contains( str, substr ) {
        return !!~('' + str).indexOf(substr);
    }

    /*>>testprop*/

    // testProps is a generic CSS / DOM property test.

    // In testing support for a given CSS property, it's legit to test:
    //    `elem.style[styleName] !== undefined`
    // If the property is supported it will return an empty string,
    // if unsupported it will return undefined.

    // We'll take advantage of this quick test and skip setting a style
    // on our modernizr element, but instead just testing undefined vs
    // empty string.

    // Because the testing of the CSS property names (with "-", as
    // opposed to the camelCase DOM properties) is non-portable and
    // non-standard but works in WebKit and IE (but not Gecko or Opera),
    // we explicitly reject properties with dashes so that authors
    // developing in WebKit or IE first don't end up with
    // browser-specific content by accident.

    function testProps( props, prefixed ) {
        for ( var i in props ) {
            var prop = props[i];
            if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
                return prefixed == 'pfx' ? prop : true;
            }
        }
        return false;
    }
    /*>>testprop*/

    // TODO :: add testDOMProps
    /**
     * testDOMProps is a generic DOM property test; if a browser supports
     *   a certain property, it won't return undefined for it.
     */
    function testDOMProps( props, obj, elem ) {
        for ( var i in props ) {
            var item = obj[props[i]];
            if ( item !== undefined) {

                // return the property name as a string
                if (elem === false) return props[i];

                // let's bind a function
                if (is(item, 'function')){
                  // default to autobind unless override
                  return item.bind(elem || obj);
                }

                // return the unbound function or obj or value
                return item;
            }
        }
        return false;
    }

    /*>>testallprops*/
    /**
     * testPropsAll tests a list of DOM properties we want to check against.
     *   We specify literally ALL possible (known and/or likely) properties on
     *   the element including the non-vendor prefixed one, for forward-
     *   compatibility.
     */
    function testPropsAll( prop, prefixed, elem ) {

        var ucProp  = prop.charAt(0).toUpperCase() + prop.slice(1),
            props   = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');

        // did they call .prefixed('boxSizing') or are we just testing a prop?
        if(is(prefixed, "string") || is(prefixed, "undefined")) {
          return testProps(props, prefixed);

        // otherwise, they called .prefixed('requestAnimationFrame', window[, elem])
        } else {
          props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
          return testDOMProps(props, prefixed, elem);
        }
    }
    /*>>testallprops*/


    /**
     * Tests
     * -----
     */

    // The *new* flexbox
    // dev.w3.org/csswg/css3-flexbox

    tests['flexbox'] = function() {
      return testPropsAll('flexWrap');
    };

    // The *old* flexbox
    // www.w3.org/TR/2009/WD-css3-flexbox-20090723/

    tests['flexboxlegacy'] = function() {
        return testPropsAll('boxDirection');
    };

    // On the S60 and BB Storm, getContext exists, but always returns undefined
    // so we actually have to call getContext() to verify
    // github.com/Modernizr/Modernizr/issues/issue/97/

    tests['canvas'] = function() {
        var elem = document.createElement('canvas');
        return !!(elem.getContext && elem.getContext('2d'));
    };

    tests['canvastext'] = function() {
        return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
    };

    // webk.it/70117 is tracking a legit WebGL feature detect proposal

    // We do a soft detect which may false positive in order to avoid
    // an expensive context creation: bugzil.la/732441

    tests['webgl'] = function() {
        return !!window.WebGLRenderingContext;
    };

    /*
     * The Modernizr.touch test only indicates if the browser supports
     *    touch events, which does not necessarily reflect a touchscreen
     *    device, as evidenced by tablets running Windows 7 or, alas,
     *    the Palm Pre / WebOS (touch) phones.
     *
     * Additionally, Chrome (desktop) used to lie about its support on this,
     *    but that has since been rectified: crbug.com/36415
     *
     * We also test for Firefox 4 Multitouch Support.
     *
     * For more info, see: modernizr.github.com/Modernizr/touch.html
     */

    tests['touch'] = function() {
        var bool;

        if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
          bool = true;
        } else {
          injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
            bool = node.offsetTop === 9;
          });
        }

        return bool;
    };


    // geolocation is often considered a trivial feature detect...
    // Turns out, it's quite tricky to get right:
    //
    // Using !!navigator.geolocation does two things we don't want. It:
    //   1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513
    //   2. Disables page caching in WebKit: webk.it/43956
    //
    // Meanwhile, in Firefox < 8, an about:config setting could expose
    // a false positive that would throw an exception: bugzil.la/688158

    tests['geolocation'] = function() {
        return 'geolocation' in navigator;
    };


    tests['postmessage'] = function() {
      return !!window.postMessage;
    };


    // Chrome incognito mode used to throw an exception when using openDatabase
    // It doesn't anymore.
    tests['websqldatabase'] = function() {
      return !!window.openDatabase;
    };

    // Vendors had inconsistent prefixing with the experimental Indexed DB:
    // - Webkit's implementation is accessible through webkitIndexedDB
    // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
    // For speed, we don't test the legacy (and beta-only) indexedDB
    tests['indexedDB'] = function() {
      return !!testPropsAll("indexedDB", window);
    };

    // documentMode logic from YUI to filter out IE8 Compat Mode
    //   which false positives.
    tests['hashchange'] = function() {
      return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
    };

    // Per 1.6:
    // This used to be Modernizr.historymanagement but the longer
    // name has been deprecated in favor of a shorter and property-matching one.
    // The old API is still available in 1.6, but as of 2.0 will throw a warning,
    // and in the first release thereafter disappear entirely.
    tests['history'] = function() {
      return !!(window.history && history.pushState);
    };

    tests['draganddrop'] = function() {
        var div = document.createElement('div');
        return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
    };

    // FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10
    // will be supported until FF19 (2/12/13), at which time, ESR becomes FF17.
    // FF10 still uses prefixes, so check for it until then.
    // for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/
    tests['websockets'] = function() {
        return 'WebSocket' in window || 'MozWebSocket' in window;
    };


    // css-tricks.com/rgba-browser-support/
    tests['rgba'] = function() {
        // Set an rgba() color and check the returned value

        setCss('background-color:rgba(150,255,150,.5)');

        return contains(mStyle.backgroundColor, 'rgba');
    };

    tests['hsla'] = function() {
        // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally,
        //   except IE9 who retains it as hsla

        setCss('background-color:hsla(120,40%,100%,.5)');

        return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
    };

    tests['multiplebgs'] = function() {
        // Setting multiple images AND a color on the background shorthand property
        //  and then querying the style.background property value for the number of
        //  occurrences of "url(" is a reliable method for detecting ACTUAL support for this!

        setCss('background:url(https://),url(https://),red url(https://)');

        // If the UA supports multiple backgrounds, there should be three occurrences
        //   of the string "url(" in the return value for elemStyle.background

        return (/(url\s*\(.*?){3}/).test(mStyle.background);
    };



    // this will false positive in Opera Mini
    //   github.com/Modernizr/Modernizr/issues/396

    tests['backgroundsize'] = function() {
        return testPropsAll('backgroundSize');
    };

    tests['borderimage'] = function() {
        return testPropsAll('borderImage');
    };


    // Super comprehensive table about all the unique implementations of
    // border-radius: muddledramblings.com/table-of-css3-border-radius-compliance

    tests['borderradius'] = function() {
        return testPropsAll('borderRadius');
    };

    // WebOS unfortunately false positives on this test.
    tests['boxshadow'] = function() {
        return testPropsAll('boxShadow');
    };

    // FF3.0 will false positive on this test
    tests['textshadow'] = function() {
        return document.createElement('div').style.textShadow === '';
    };


    tests['opacity'] = function() {
        // Browsers that actually have CSS Opacity implemented have done so
        //  according to spec, which means their return values are within the
        //  range of [0.0,1.0] - including the leading zero.

        setCssAll('opacity:.55');

        // The non-literal . in this regex is intentional:
        //   German Chrome returns this value as 0,55
        // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632
        return (/^0.55$/).test(mStyle.opacity);
    };


    // Note, Android < 4 will pass this test, but can only animate
    //   a single property at a time
    //   goo.gl/v3V4Gp
    tests['cssanimations'] = function() {
        return testPropsAll('animationName');
    };


    tests['csscolumns'] = function() {
        return testPropsAll('columnCount');
    };


    tests['cssgradients'] = function() {
        /**
         * For CSS Gradients syntax, please see:
         * webkit.org/blog/175/introducing-css-gradients/
         * developer.mozilla.org/en/CSS/-moz-linear-gradient
         * developer.mozilla.org/en/CSS/-moz-radial-gradient
         * dev.w3.org/csswg/css3-images/#gradients-
         */

        var str1 = 'background-image:',
            str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
            str3 = 'linear-gradient(left top,#9f9, white);';

        setCss(
             // legacy webkit syntax (FIXME: remove when syntax not in use anymore)
              (str1 + '-webkit- '.split(' ').join(str2 + str1) +
             // standard syntax             // trailing 'background-image:'
              prefixes.join(str3 + str1)).slice(0, -str1.length)
        );

        return contains(mStyle.backgroundImage, 'gradient');
    };


    tests['cssreflections'] = function() {
        return testPropsAll('boxReflect');
    };


    tests['csstransforms'] = function() {
        return !!testPropsAll('transform');
    };


    tests['csstransforms3d'] = function() {

        var ret = !!testPropsAll('perspective');

        // Webkit's 3D transforms are passed off to the browser's own graphics renderer.
        //   It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
        //   some conditions. As a result, Webkit typically recognizes the syntax but
        //   will sometimes throw a false positive, thus we must do a more thorough check:
        if ( ret && 'webkitPerspective' in docElement.style ) {

          // Webkit allows this media query to succeed only if the feature is enabled.
          // `@media (transform-3d),(-webkit-transform-3d){ ... }`
          injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
            ret = node.offsetLeft === 9 && node.offsetHeight === 3;
          });
        }
        return ret;
    };


    tests['csstransitions'] = function() {
        return testPropsAll('transition');
    };


    /*>>fontface*/
    // @font-face detection routine by Diego Perini
    // javascript.nwbox.com/CSSSupport/

    // false positives:
    //   WebOS github.com/Modernizr/Modernizr/issues/342
    //   WP7   github.com/Modernizr/Modernizr/issues/538
    tests['fontface'] = function() {
        var bool;

        injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
          var style = document.getElementById('smodernizr'),
              sheet = style.sheet || style.styleSheet,
              cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';

          bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
        });

        return bool;
    };
    /*>>fontface*/

    // CSS generated content detection
    tests['generatedcontent'] = function() {
        var bool;

        injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
          bool = node.offsetHeight >= 3;
        });

        return bool;
    };



    // These tests evaluate support of the video/audio elements, as well as
    // testing what types of content they support.
    //
    // We're using the Boolean constructor here, so that we can extend the value
    // e.g.  Modernizr.video     // true
    //       Modernizr.video.ogg // 'probably'
    //
    // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
    //                     thx to NielsLeenheer and zcorpan

    // Note: in some older browsers, "no" was a return value instead of empty string.
    //   It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2
    //   It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5

    tests['video'] = function() {
        var elem = document.createElement('video'),
            bool = false;

        // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
        try {
            if ( bool = !!elem.canPlayType ) {
                bool      = new Boolean(bool);
                bool.ogg  = elem.canPlayType('video/ogg; codecs="theora"')      .replace(/^no$/,'');

                // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546
                bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');

                bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
            }

        } catch(e) { }

        return bool;
    };

    tests['audio'] = function() {
        var elem = document.createElement('audio'),
            bool = false;

        try {
            if ( bool = !!elem.canPlayType ) {
                bool      = new Boolean(bool);
                bool.ogg  = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
                bool.mp3  = elem.canPlayType('audio/mpeg;')               .replace(/^no$/,'');

                // Mimetypes accepted:
                //   developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
                //   bit.ly/iphoneoscodecs
                bool.wav  = elem.canPlayType('audio/wav; codecs="1"')     .replace(/^no$/,'');
                bool.m4a  = ( elem.canPlayType('audio/x-m4a;')            ||
                              elem.canPlayType('audio/aac;'))             .replace(/^no$/,'');
            }
        } catch(e) { }

        return bool;
    };


    // In FF4, if disabled, window.localStorage should === null.

    // Normally, we could not test that directly and need to do a
    //   `('localStorage' in window) && ` test first because otherwise Firefox will
    //   throw bugzil.la/365772 if cookies are disabled

    // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem
    // will throw the exception:
    //   QUOTA_EXCEEDED_ERRROR DOM Exception 22.
    // Peculiarly, getItem and removeItem calls do not throw.

    // Because we are forced to try/catch this, we'll go aggressive.

    // Just FWIW: IE8 Compat mode supports these features completely:
    //   www.quirksmode.org/dom/html5.html
    // But IE8 doesn't support either with local files

    tests['localstorage'] = function() {
        try {
            localStorage.setItem(mod, mod);
            localStorage.removeItem(mod);
            return true;
        } catch(e) {
            return false;
        }
    };

    tests['sessionstorage'] = function() {
        try {
            sessionStorage.setItem(mod, mod);
            sessionStorage.removeItem(mod);
            return true;
        } catch(e) {
            return false;
        }
    };


    tests['webworkers'] = function() {
        return !!window.Worker;
    };


    tests['applicationcache'] = function() {
        return !!window.applicationCache;
    };


    // Thanks to Erik Dahlstrom
    tests['svg'] = function() {
        return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
    };

    // specifically for SVG inline in HTML, not within XHTML
    // test page: paulirish.com/demo/inline-svg
    tests['inlinesvg'] = function() {
      var div = document.createElement('div');
      div.innerHTML = '<svg/>';
      return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
    };

    // SVG SMIL animation
    tests['smil'] = function() {
        return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
    };

    // This test is only for clip paths in SVG proper, not clip paths on HTML content
    // demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg

    // However read the comments to dig into applying SVG clippaths to HTML content here:
    //   github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491
    tests['svgclippaths'] = function() {
        return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
    };

    /*>>webforms*/
    // input features and input types go directly onto the ret object, bypassing the tests loop.
    // Hold this guy to execute in a moment.
    function webforms() {
        /*>>input*/
        // Run through HTML5's new input attributes to see if the UA understands any.
        // We're using f which is the <input> element created early on
        // Mike Taylr has created a comprehensive resource for testing these attributes
        //   when applied to all input types:
        //   miketaylr.com/code/input-type-attr.html
        // spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary

        // Only input placeholder is tested while textarea's placeholder is not.
        // Currently Safari 4 and Opera 11 have support only for the input placeholder
        // Both tests are available in feature-detects/forms-placeholder.js
        Modernizr['input'] = (function( props ) {
            for ( var i = 0, len = props.length; i < len; i++ ) {
                attrs[ props[i] ] = !!(props[i] in inputElem);
            }
            if (attrs.list){
              // safari false positive's on datalist: webk.it/74252
              // see also github.com/Modernizr/Modernizr/issues/146
              attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
            }
            return attrs;
        })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
        /*>>input*/

        /*>>inputtypes*/
        // Run through HTML5's new input types to see if the UA understands any.
        //   This is put behind the tests runloop because it doesn't return a
        //   true/false like all the other tests; instead, it returns an object
        //   containing each input type with its corresponding true/false value

        // Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/
        Modernizr['inputtypes'] = (function(props) {

            for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {

                inputElem.setAttribute('type', inputElemType = props[i]);
                bool = inputElem.type !== 'text';

                // We first check to see if the type we give it sticks..
                // If the type does, we feed it a textual value, which shouldn't be valid.
                // If the value doesn't stick, we know there's input sanitization which infers a custom UI
                if ( bool ) {

                    inputElem.value         = smile;
                    inputElem.style.cssText = 'position:absolute;visibility:hidden;';

                    if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {

                      docElement.appendChild(inputElem);
                      defaultView = document.defaultView;

                      // Safari 2-4 allows the smiley as a value, despite making a slider
                      bool =  defaultView.getComputedStyle &&
                              defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
                              // Mobile android web browser has false positive, so must
                              // check the height to see if the widget is actually there.
                              (inputElem.offsetHeight !== 0);

                      docElement.removeChild(inputElem);

                    } else if ( /^(search|tel)$/.test(inputElemType) ){
                      // Spec doesn't define any special parsing or detectable UI
                      //   behaviors so we pass these through as true

                      // Interestingly, opera fails the earlier test, so it doesn't
                      //  even make it here.

                    } else if ( /^(url|email)$/.test(inputElemType) ) {
                      // Real url and email support comes with prebaked validation.
                      bool = inputElem.checkValidity && inputElem.checkValidity() === false;

                    } else {
                      // If the upgraded input compontent rejects the :) text, we got a winner
                      bool = inputElem.value != smile;
                    }
                }

                inputs[ props[i] ] = !!bool;
            }
            return inputs;
        })('search tel url email datetime date month week time datetime-local number range color'.split(' '));
        /*>>inputtypes*/
    }
    /*>>webforms*/


    // End of test definitions
    // -----------------------



    // Run through all tests and detect their support in the current UA.
    // todo: hypothetically we could be doing an array of tests and use a basic loop here.
    for ( var feature in tests ) {
        if ( hasOwnProp(tests, feature) ) {
            // run the test, throw the return value into the Modernizr,
            //   then based on that boolean, define an appropriate className
            //   and push it into an array of classes we'll join later.
            featureName  = feature.toLowerCase();
            Modernizr[featureName] = tests[feature]();

            classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
        }
    }

    /*>>webforms*/
    // input tests need to run.
    Modernizr.input || webforms();
    /*>>webforms*/


    /**
     * addTest allows the user to define their own feature tests
     * the result will be added onto the Modernizr object,
     * as well as an appropriate className set on the html element
     *
     * @param feature - String naming the feature
     * @param test - Function returning true if feature is supported, false if not
     */
     Modernizr.addTest = function ( feature, test ) {
       if ( typeof feature == 'object' ) {
         for ( var key in feature ) {
           if ( hasOwnProp( feature, key ) ) {
             Modernizr.addTest( key, feature[ key ] );
           }
         }
       } else {

         feature = feature.toLowerCase();

         if ( Modernizr[feature] !== undefined ) {
           // we're going to quit if you're trying to overwrite an existing test
           // if we were to allow it, we'd do this:
           //   var re = new RegExp("\\b(no-)?" + feature + "\\b");
           //   docElement.className = docElement.className.replace( re, '' );
           // but, no rly, stuff 'em.
           return Modernizr;
         }

         test = typeof test == 'function' ? test() : test;

         if (typeof enableClasses !== "undefined" && enableClasses) {
           docElement.className += ' ' + (test ? '' : 'no-') + feature;
         }
         Modernizr[feature] = test;

       }

       return Modernizr; // allow chaining.
     };


    // Reset modElem.cssText to nothing to reduce memory footprint.
    setCss('');
    modElem = inputElem = null;

    /*>>shiv*/
    /**
     * @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
     */
    ;(function(window, document) {
        /*jshint evil:true */
        /** version */
        var version = '3.7.0';

        /** Preset options */
        var options = window.html5 || {};

        /** Used to skip problem elements */
        var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;

        /** Not all elements can be cloned in IE **/
        var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;

        /** Detect whether the browser supports default html5 styles */
        var supportsHtml5Styles;

        /** Name of the expando, to work with multiple documents or to re-shiv one document */
        var expando = '_html5shiv';

        /** The id for the the documents expando */
        var expanID = 0;

        /** Cached data for each document */
        var expandoData = {};

        /** Detect whether the browser supports unknown elements */
        var supportsUnknownElements;

        (function() {
          try {
            var a = document.createElement('a');
            a.innerHTML = '<xyz></xyz>';
            //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
            supportsHtml5Styles = ('hidden' in a);

            supportsUnknownElements = a.childNodes.length == 1 || (function() {
              // assign a false positive if unable to shiv
              (document.createElement)('a');
              var frag = document.createDocumentFragment();
              return (
                typeof frag.cloneNode == 'undefined' ||
                typeof frag.createDocumentFragment == 'undefined' ||
                typeof frag.createElement == 'undefined'
              );
            }());
          } catch(e) {
            // assign a false positive if detection fails => unable to shiv
            supportsHtml5Styles = true;
            supportsUnknownElements = true;
          }

        }());

        /*--------------------------------------------------------------------------*/

        /**
         * Creates a style sheet with the given CSS text and adds it to the document.
         * @private
         * @param {Document} ownerDocument The document.
         * @param {String} cssText The CSS text.
         * @returns {StyleSheet} The style element.
         */
        function addStyleSheet(ownerDocument, cssText) {
          var p = ownerDocument.createElement('p'),
          parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;

          p.innerHTML = 'x<style>' + cssText + '</style>';
          return parent.insertBefore(p.lastChild, parent.firstChild);
        }

        /**
         * Returns the value of `html5.elements` as an array.
         * @private
         * @returns {Array} An array of shived element node names.
         */
        function getElements() {
          var elements = html5.elements;
          return typeof elements == 'string' ? elements.split(' ') : elements;
        }

        /**
         * Returns the data associated to the given document
         * @private
         * @param {Document} ownerDocument The document.
         * @returns {Object} An object of data.
         */
        function getExpandoData(ownerDocument) {
          var data = expandoData[ownerDocument[expando]];
          if (!data) {
            data = {};
            expanID++;
            ownerDocument[expando] = expanID;
            expandoData[expanID] = data;
          }
          return data;
        }

        /**
         * returns a shived element for the given nodeName and document
         * @memberOf html5
         * @param {String} nodeName name of the element
         * @param {Document} ownerDocument The context document.
         * @returns {Object} The shived element.
         */
        function createElement(nodeName, ownerDocument, data){
          if (!ownerDocument) {
            ownerDocument = document;
          }
          if(supportsUnknownElements){
            return ownerDocument.createElement(nodeName);
          }
          if (!data) {
            data = getExpandoData(ownerDocument);
          }
          var node;

          if (data.cache[nodeName]) {
            node = data.cache[nodeName].cloneNode();
          } else if (saveClones.test(nodeName)) {
            node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
          } else {
            node = data.createElem(nodeName);
          }

          // Avoid adding some elements to fragments in IE < 9 because
          // * Attributes like `name` or `type` cannot be set/changed once an element
          //   is inserted into a document/fragment
          // * Link elements with `src` attributes that are inaccessible, as with
          //   a 403 response, will cause the tab/window to crash
          // * Script elements appended to fragments will execute when their `src`
          //   or `text` property is set
          return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
        }

        /**
         * returns a shived DocumentFragment for the given document
         * @memberOf html5
         * @param {Document} ownerDocument The context document.
         * @returns {Object} The shived DocumentFragment.
         */
        function createDocumentFragment(ownerDocument, data){
          if (!ownerDocument) {
            ownerDocument = document;
          }
          if(supportsUnknownElements){
            return ownerDocument.createDocumentFragment();
          }
          data = data || getExpandoData(ownerDocument);
          var clone = data.frag.cloneNode(),
          i = 0,
          elems = getElements(),
          l = elems.length;
          for(;i<l;i++){
            clone.createElement(elems[i]);
          }
          return clone;
        }

        /**
         * Shivs the `createElement` and `createDocumentFragment` methods of the document.
         * @private
         * @param {Document|DocumentFragment} ownerDocument The document.
         * @param {Object} data of the document.
         */
        function shivMethods(ownerDocument, data) {
          if (!data.cache) {
            data.cache = {};
            data.createElem = ownerDocument.createElement;
            data.createFrag = ownerDocument.createDocumentFragment;
            data.frag = data.createFrag();
          }


          ownerDocument.createElement = function(nodeName) {
            //abort shiv
            if (!html5.shivMethods) {
              return data.createElem(nodeName);
            }
            return createElement(nodeName, ownerDocument, data);
          };

          ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
                                                          'var n=f.cloneNode(),c=n.createElement;' +
                                                          'h.shivMethods&&(' +
                                                          // unroll the `createElement` calls
                                                          getElements().join().replace(/[\w\-]+/g, function(nodeName) {
            data.createElem(nodeName);
            data.frag.createElement(nodeName);
            return 'c("' + nodeName + '")';
          }) +
            ');return n}'
                                                         )(html5, data.frag);
        }

        /*--------------------------------------------------------------------------*/

        /**
         * Shivs the given document.
         * @memberOf html5
         * @param {Document} ownerDocument The document to shiv.
         * @returns {Document} The shived document.
         */
        function shivDocument(ownerDocument) {
          if (!ownerDocument) {
            ownerDocument = document;
          }
          var data = getExpandoData(ownerDocument);

          if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
            data.hasCSS = !!addStyleSheet(ownerDocument,
                                          // corrects block display not defined in IE6/7/8/9
                                          'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
                                            // adds styling not present in IE6/7/8/9
                                            'mark{background:#FF0;color:#000}' +
                                            // hides non-rendered elements
                                            'template{display:none}'
                                         );
          }
          if (!supportsUnknownElements) {
            shivMethods(ownerDocument, data);
          }
          return ownerDocument;
        }

        /*--------------------------------------------------------------------------*/

        /**
         * The `html5` object is exposed so that more elements can be shived and
         * existing shiving can be detected on iframes.
         * @type Object
         * @example
         *
         * // options can be changed before the script is included
         * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
         */
        var html5 = {

          /**
           * An array or space separated string of node names of the elements to shiv.
           * @memberOf html5
           * @type Array|String
           */
          'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',

          /**
           * current version of html5shiv
           */
          'version': version,

          /**
           * A flag to indicate that the HTML5 style sheet should be inserted.
           * @memberOf html5
           * @type Boolean
           */
          'shivCSS': (options.shivCSS !== false),

          /**
           * Is equal to true if a browser supports creating unknown/HTML5 elements
           * @memberOf html5
           * @type boolean
           */
          'supportsUnknownElements': supportsUnknownElements,

          /**
           * A flag to indicate that the document's `createElement` and `createDocumentFragment`
           * methods should be overwritten.
           * @memberOf html5
           * @type Boolean
           */
          'shivMethods': (options.shivMethods !== false),

          /**
           * A string to describe the type of `html5` object ("default" or "default print").
           * @memberOf html5
           * @type String
           */
          'type': 'default',

          // shivs the document according to the specified `html5` object options
          'shivDocument': shivDocument,

          //creates a shived element
          createElement: createElement,

          //creates a shived documentFragment
          createDocumentFragment: createDocumentFragment
        };

        /*--------------------------------------------------------------------------*/

        // expose html5
        window.html5 = html5;

        // shiv the document
        shivDocument(document);

    }(this, document));
    /*>>shiv*/

    // Assign private properties to the return object with prefix
    Modernizr._version      = version;

    // expose these for the plugin API. Look in the source for how to join() them against your input
    /*>>prefixes*/
    Modernizr._prefixes     = prefixes;
    /*>>prefixes*/
    /*>>domprefixes*/
    Modernizr._domPrefixes  = domPrefixes;
    Modernizr._cssomPrefixes  = cssomPrefixes;
    /*>>domprefixes*/

    /*>>mq*/
    // Modernizr.mq tests a given media query, live against the current state of the window
    // A few important notes:
    //   * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false
    //   * A max-width or orientation query will be evaluated against the current state, which may change later.
    //   * You must specify values. Eg. If you are testing support for the min-width media query use:
    //       Modernizr.mq('(min-width:0)')
    // usage:
    // Modernizr.mq('only screen and (max-width:768)')
    Modernizr.mq            = testMediaQuery;
    /*>>mq*/

    /*>>hasevent*/
    // Modernizr.hasEvent() detects support for a given event, with an optional element to test on
    // Modernizr.hasEvent('gesturestart', elem)
    Modernizr.hasEvent      = isEventSupported;
    /*>>hasevent*/

    /*>>testprop*/
    // Modernizr.testProp() investigates whether a given style property is recognized
    // Note that the property names must be provided in the camelCase variant.
    // Modernizr.testProp('pointerEvents')
    Modernizr.testProp      = function(prop){
        return testProps([prop]);
    };
    /*>>testprop*/

    /*>>testallprops*/
    // Modernizr.testAllProps() investigates whether a given style property,
    //   or any of its vendor-prefixed variants, is recognized
    // Note that the property names must be provided in the camelCase variant.
    // Modernizr.testAllProps('boxSizing')
    Modernizr.testAllProps  = testPropsAll;
    /*>>testallprops*/


    /*>>teststyles*/
    // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards
    // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... })
    Modernizr.testStyles    = injectElementWithStyles;
    /*>>teststyles*/


    /*>>prefixed*/
    // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input
    // Modernizr.prefixed('boxSizing') // 'MozBoxSizing'

    // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style.
    // Return values will also be the camelCase variant, if you need to translate that to hypenated style use:
    //
    //     str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');

    // If you're trying to ascertain which transition end event to bind to, you might do something like...
    //
    //     var transEndEventNames = {
    //       'WebkitTransition' : 'webkitTransitionEnd',
    //       'MozTransition'    : 'transitionend',
    //       'OTransition'      : 'oTransitionEnd',
    //       'msTransition'     : 'MSTransitionEnd',
    //       'transition'       : 'transitionend'
    //     },
    //     transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];

    Modernizr.prefixed      = function(prop, obj, elem){
      if(!obj) {
        return testPropsAll(prop, 'pfx');
      } else {
        // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame'
        return testPropsAll(prop, obj, elem);
      }
    };
    /*>>prefixed*/


    /*>>cssclasses*/
    // Remove "no-js" class from <html> element, if it exists:
    docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +

                            // Add the new classes to the <html> element.
                            (enableClasses ? ' js ' + classes.join(' ') : '');
    /*>>cssclasses*/

    return Modernizr;

})(this, this.document);
;
/*!
 * Bootstrap v3.3.6 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under the MIT license
 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");
d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);;
/* ========================================================================
 * Bootstrap: affix.js v3.3.6
 * http://getbootstrap.com/javascript/#affix
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // AFFIX CLASS DEFINITION
  // ======================

  var Affix = function (element, options) {
    this.options = $.extend({}, Affix.DEFAULTS, options)

    this.$target = $(this.options.target)
      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))

    this.$element     = $(element)
    this.affixed      = null
    this.unpin        = null
    this.pinnedOffset = null

    this.checkPosition()
  }

  Affix.VERSION  = '3.3.6'

  Affix.RESET    = 'affix affix-top affix-bottom'

  Affix.DEFAULTS = {
    offset: 0,
    target: window
  }

  Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
    var scrollTop    = this.$target.scrollTop()
    var position     = this.$element.offset()
    var targetHeight = this.$target.height()

    if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false

    if (this.affixed == 'bottom') {
      if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
      return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
    }

    var initializing   = this.affixed == null
    var colliderTop    = initializing ? scrollTop : position.top
    var colliderHeight = initializing ? targetHeight : height

    if (offsetTop != null && scrollTop <= offsetTop) return 'top'
    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'

    return false
  }

  Affix.prototype.getPinnedOffset = function () {
    if (this.pinnedOffset) return this.pinnedOffset
    this.$element.removeClass(Affix.RESET).addClass('affix')
    var scrollTop = this.$target.scrollTop()
    var position  = this.$element.offset()
    return (this.pinnedOffset = position.top - scrollTop)
  }

  Affix.prototype.checkPositionWithEventLoop = function () {
    setTimeout($.proxy(this.checkPosition, this), 1)
  }

  Affix.prototype.checkPosition = function () {
    if (!this.$element.is(':visible')) return

    var height       = this.$element.height()
    var offset       = this.options.offset
    var offsetTop    = offset.top
    var offsetBottom = offset.bottom
    var scrollHeight = Math.max($(document).height(), $(document.body).height())

    if (typeof offset != 'object')         offsetBottom = offsetTop = offset
    if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)

    var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)

    if (this.affixed != affix) {
      if (this.unpin != null) this.$element.css('top', '')

      var affixType = 'affix' + (affix ? '-' + affix : '')
      var e         = $.Event(affixType + '.bs.affix')

      this.$element.trigger(e)

      if (e.isDefaultPrevented()) return

      this.affixed = affix
      this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null

      this.$element
        .removeClass(Affix.RESET)
        .addClass(affixType)
        .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
    }

    if (affix == 'bottom') {
      this.$element.offset({
        top: scrollHeight - height - offsetBottom
      })
    }
  }


  // AFFIX PLUGIN DEFINITION
  // =======================

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.affix')
      var options = typeof option == 'object' && option

      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  var old = $.fn.affix

  $.fn.affix             = Plugin
  $.fn.affix.Constructor = Affix


  // AFFIX NO CONFLICT
  // =================

  $.fn.affix.noConflict = function () {
    $.fn.affix = old
    return this
  }


  // AFFIX DATA-API
  // ==============

  $(window).on('load', function () {
    $('[data-spy="affix"]').each(function () {
      var $spy = $(this)
      var data = $spy.data()

      data.offset = data.offset || {}

      if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
      if (data.offsetTop    != null) data.offset.top    = data.offsetTop

      Plugin.call($spy, data)
    })
  })

}(jQuery);
;
/*!
 * JavaScript Cookie v2.1.0
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
(function (factory) {
  if (typeof define === 'function' && define.amd) {
    define(factory);
  } else if (typeof exports === 'object') {
    module.exports = factory();
  } else {
    var _OldCookies = window.Cookies;
    var api = window.Cookies = factory();
    api.noConflict = function () {
      window.Cookies = _OldCookies;
      return api;
    };
  }
}(function () {
  function extend() {
    var i = 0;
    var result = {};
    for (; i < arguments.length; i++) {
      var attributes = arguments[i];
      for (var key in attributes) {
        result[key] = attributes[key];
      }
    }
    return result;
  }

  function init(converter) {
    function api(key, value, attributes) {
      var result;

      // Write

      if (arguments.length > 1) {
        attributes = extend({
          path: '/'
        }, api.defaults, attributes);

        if (typeof attributes.expires === 'number') {
          var expires = new Date();
          expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
          attributes.expires = expires;
        }

        try {
          result = JSON.stringify(value);
          if (/^[\{\[]/.test(result)) {
            value = result;
          }
        } catch (e) { }

        if (!converter.write) {
          value = encodeURIComponent(String(value))
						.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
        } else {
          value = converter.write(value, key);
        }

        key = encodeURIComponent(String(key));
        key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
        key = key.replace(/[\(\)]/g, escape);

        return (document.cookie = [
					key, '=', value,
					attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE
					attributes.path && '; path=' + attributes.path,
					attributes.domain && '; domain=' + attributes.domain,
					attributes.secure ? '; secure' : ''
        ].join(''));
      }

      // Read

      if (!key) {
        result = {};
      }

      // To prevent the for loop in the first place assign an empty array
      // in case there are no cookies at all. Also prevents odd result when
      // calling "get()"
      var cookies = document.cookie ? document.cookie.split('; ') : [];
      var rdecode = /(%[0-9A-Z]{2})+/g;
      var i = 0;

      for (; i < cookies.length; i++) {
        var parts = cookies[i].split('=');
        var name = parts[0].replace(rdecode, decodeURIComponent);
        var cookie = parts.slice(1).join('=');

        if (cookie.charAt(0) === '"') {
          cookie = cookie.slice(1, -1);
        }

        try {
          cookie = converter.read ?
						converter.read(cookie, name) : converter(cookie, name) ||
						cookie.replace(rdecode, decodeURIComponent);

          if (this.json) {
            try {
              cookie = JSON.parse(cookie);
            } catch (e) { }
          }

          if (key === name) {
            result = cookie;
            break;
          }

          if (!key) {
            result[name] = cookie;
          }
        } catch (e) { }
      }

      return result;
    }

    api.get = api.set = api;
    api.getJSON = function () {
      return api.apply({
        json: true
      }, [].slice.call(arguments));
    };
    api.defaults = {};

    api.remove = function (key, attributes) {
      api(key, '', extend(attributes, {
        expires: -1
      }));
    };

    api.withConverter = init;

    return api;
  }

  return init(function () { });
}));;
/// <reference path="../jquery/jquery-2.2.0.js" />
/// <reference path="../jquery/js.cookie.js" />


/**
* Gestisce la cookie-bar per l'informativa sui cookie traccianti.
*/
jQuery.fn.CookieBar = function(domain_, func_callback) {
  if(domain_ == null)
    domain_ = location.hostname.split('.').slice(1).join('.');

  /** Il contenitore html della cookiebar */
  var coockiebar = $(this[0]);

  /** True se l'utente ha accettato, false altrimenti */
  function is_cookie_accepted() {
    return Cookies.get("cookie_policy_accepted") == "true";
  }

  /** Setta il cookie cookie_policy_accepted con scadenza 360. */
  function cookie_accepted() {
    Cookies.set("cookie_policy_accepted", "true", { expires: 360, path: "/", domain: domain_ });
    if (func_callback != null) func_callback();
  }

  /** Mostra la cookiebar con animazione */
  function show_cookiebar() {
    coockiebar.slideDown();
  }

  /** Nasconde la cookiebar con animazione */
  function hide_cookiebar() {
    coockiebar.slideUp();
  }

  /** Setta il cookie di accettazione della policy e nasconde la cookiebar */
  function acceptCookie() {
    cookie_accepted();
    hide_cookiebar();
  }

  if (is_cookie_accepted()) {
    coockiebar.hide();
    if (func_callback != null) func_callback();
  }
  else {
    show_cookiebar();
  }


  /********** EVENTS ************************************/

  coockiebar.find('[data-cookieaccept="true"]').click(function () {
    acceptCookie();
  });

  
  $(window).on("scroll", function (event) {
    if (!is_cookie_accepted()) {
      scrollPosition = $(this).scrollTop();
      if (scrollPosition >= 50) {
        //console.log("SCROLL");
        acceptCookie();
        $(this).unbind();
      }
    }
  });

  $(window).one("click", function (event) {
    if (!is_cookie_accepted()) {
      //console.log("CLICK");
      acceptCookie();
      //$(this).unbind();
    }
  });
  /******** /EVENTS **************************************/

}
;
/*
     _ _      _       _
 ___| (_) ___| | __  (_)___
/ __| | |/ __| |/ /  | / __|
\__ \ | | (__|   < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
                   |__/

 Version: 1.5.9
  Author: Ken Wheeler
 Website: http://kenwheeler.github.io
    Docs: http://kenwheeler.github.io/slick
    Repo: http://github.com/kenwheeler/slick
  Issues: http://github.com/kenwheeler/slick/issues

 */
/* global window, document, define, jQuery, setInterval, clearInterval */
(function(factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else if (typeof exports !== 'undefined') {
        module.exports = factory(require('jquery'));
    } else {
        factory(jQuery);
    }

}(function($) {
    'use strict';
    var Slick = window.Slick || {};

    Slick = (function() {

        var instanceUid = 0;

        function Slick(element, settings) {

            var _ = this, dataSettings;

            _.defaults = {
                accessibility: true,
                adaptiveHeight: false,
                appendArrows: $(element),
                appendDots: $(element),
                arrows: true,
                asNavFor: null,
                prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',
                nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',
                autoplay: false,
                autoplaySpeed: 3000,
                centerMode: false,
                centerPadding: '50px',
                cssEase: 'ease',
                customPaging: function(slider, i) {
                    return '<button type="button" data-role="none" role="button" aria-required="false" tabindex="0">' + (i + 1) + '</button>';
                },
                dots: false,
                dotsClass: 'slick-dots',
                draggable: true,
                easing: 'linear',
                edgeFriction: 0.35,
                fade: false,
                focusOnSelect: false,
                infinite: true,
                initialSlide: 0,
                lazyLoad: 'ondemand',
                mobileFirst: false,
                pauseOnHover: true,
                pauseOnDotsHover: false,
                respondTo: 'window',
                responsive: null,
                rows: 1,
                rtl: false,
                slide: '',
                slidesPerRow: 1,
                slidesToShow: 1,
                slidesToScroll: 1,
                speed: 500,
                swipe: true,
                swipeToSlide: false,
                touchMove: true,
                touchThreshold: 5,
                useCSS: true,
                useTransform: false,
                variableWidth: false,
                vertical: false,
                verticalSwiping: false,
                waitForAnimate: true,
                zIndex: 1000
            };

            _.initials = {
                animating: false,
                dragging: false,
                autoPlayTimer: null,
                currentDirection: 0,
                currentLeft: null,
                currentSlide: 0,
                direction: 1,
                $dots: null,
                listWidth: null,
                listHeight: null,
                loadIndex: 0,
                $nextArrow: null,
                $prevArrow: null,
                slideCount: null,
                slideWidth: null,
                $slideTrack: null,
                $slides: null,
                sliding: false,
                slideOffset: 0,
                swipeLeft: null,
                $list: null,
                touchObject: {},
                transformsEnabled: false,
                unslicked: false
            };

            $.extend(_, _.initials);

            _.activeBreakpoint = null;
            _.animType = null;
            _.animProp = null;
            _.breakpoints = [];
            _.breakpointSettings = [];
            _.cssTransitions = false;
            _.hidden = 'hidden';
            _.paused = false;
            _.positionProp = null;
            _.respondTo = null;
            _.rowCount = 1;
            _.shouldClick = true;
            _.$slider = $(element);
            _.$slidesCache = null;
            _.transformType = null;
            _.transitionType = null;
            _.visibilityChange = 'visibilitychange';
            _.windowWidth = 0;
            _.windowTimer = null;

            dataSettings = $(element).data('slick') || {};

            _.options = $.extend({}, _.defaults, dataSettings, settings);

            _.currentSlide = _.options.initialSlide;

            _.originalSettings = _.options;

            if (typeof document.mozHidden !== 'undefined') {
                _.hidden = 'mozHidden';
                _.visibilityChange = 'mozvisibilitychange';
            } else if (typeof document.webkitHidden !== 'undefined') {
                _.hidden = 'webkitHidden';
                _.visibilityChange = 'webkitvisibilitychange';
            }

            _.autoPlay = $.proxy(_.autoPlay, _);
            _.autoPlayClear = $.proxy(_.autoPlayClear, _);
            _.changeSlide = $.proxy(_.changeSlide, _);
            _.clickHandler = $.proxy(_.clickHandler, _);
            _.selectHandler = $.proxy(_.selectHandler, _);
            _.setPosition = $.proxy(_.setPosition, _);
            _.swipeHandler = $.proxy(_.swipeHandler, _);
            _.dragHandler = $.proxy(_.dragHandler, _);
            _.keyHandler = $.proxy(_.keyHandler, _);
            _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);

            _.instanceUid = instanceUid++;

            // A simple way to check for HTML strings
            // Strict HTML recognition (must start with <)
            // Extracted from jQuery v1.11 source
            _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;


            _.registerBreakpoints();
            _.init(true);
            _.checkResponsive(true);

        }

        return Slick;

    }());

    Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {

        var _ = this;

        if (typeof(index) === 'boolean') {
            addBefore = index;
            index = null;
        } else if (index < 0 || (index >= _.slideCount)) {
            return false;
        }

        _.unload();

        if (typeof(index) === 'number') {
            if (index === 0 && _.$slides.length === 0) {
                $(markup).appendTo(_.$slideTrack);
            } else if (addBefore) {
                $(markup).insertBefore(_.$slides.eq(index));
            } else {
                $(markup).insertAfter(_.$slides.eq(index));
            }
        } else {
            if (addBefore === true) {
                $(markup).prependTo(_.$slideTrack);
            } else {
                $(markup).appendTo(_.$slideTrack);
            }
        }

        _.$slides = _.$slideTrack.children(this.options.slide);

        _.$slideTrack.children(this.options.slide).detach();

        _.$slideTrack.append(_.$slides);

        _.$slides.each(function(index, element) {
            $(element).attr('data-slick-index', index);
        });

        _.$slidesCache = _.$slides;

        _.reinit();

    };

    Slick.prototype.animateHeight = function() {
        var _ = this;
        if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
            var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
            _.$list.animate({
                height: targetHeight
            }, _.options.speed);
        }
    };

    Slick.prototype.animateSlide = function(targetLeft, callback) {

        var animProps = {},
            _ = this;

        _.animateHeight();

        if (_.options.rtl === true && _.options.vertical === false) {
            targetLeft = -targetLeft;
        }
        if (_.transformsEnabled === false) {
            if (_.options.vertical === false) {
                _.$slideTrack.animate({
                    left: targetLeft
                }, _.options.speed, _.options.easing, callback);
            } else {
                _.$slideTrack.animate({
                    top: targetLeft
                }, _.options.speed, _.options.easing, callback);
            }

        } else {

            if (_.cssTransitions === false) {
                if (_.options.rtl === true) {
                    _.currentLeft = -(_.currentLeft);
                }
                $({
                    animStart: _.currentLeft
                }).animate({
                    animStart: targetLeft
                }, {
                    duration: _.options.speed,
                    easing: _.options.easing,
                    step: function(now) {
                        now = Math.ceil(now);
                        if (_.options.vertical === false) {
                            animProps[_.animType] = 'translate(' +
                                now + 'px, 0px)';
                            _.$slideTrack.css(animProps);
                        } else {
                            animProps[_.animType] = 'translate(0px,' +
                                now + 'px)';
                            _.$slideTrack.css(animProps);
                        }
                    },
                    complete: function() {
                        if (callback) {
                            callback.call();
                        }
                    }
                });

            } else {

                _.applyTransition();
                targetLeft = Math.ceil(targetLeft);

                if (_.options.vertical === false) {
                    animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
                } else {
                    animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
                }
                _.$slideTrack.css(animProps);

                if (callback) {
                    setTimeout(function() {

                        _.disableTransition();

                        callback.call();
                    }, _.options.speed);
                }

            }

        }

    };

    Slick.prototype.asNavFor = function(index) {

        var _ = this,
            asNavFor = _.options.asNavFor;

        if ( asNavFor && asNavFor !== null ) {
            asNavFor = $(asNavFor).not(_.$slider);
        }

        if ( asNavFor !== null && typeof asNavFor === 'object' ) {
            asNavFor.each(function() {
                var target = $(this).slick('getSlick');
                if(!target.unslicked) {
                    target.slideHandler(index, true);
                }
            });
        }

    };

    Slick.prototype.applyTransition = function(slide) {

        var _ = this,
            transition = {};

        if (_.options.fade === false) {
            transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
        } else {
            transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
        }

        if (_.options.fade === false) {
            _.$slideTrack.css(transition);
        } else {
            _.$slides.eq(slide).css(transition);
        }

    };

    Slick.prototype.autoPlay = function() {

        var _ = this;

        if (_.autoPlayTimer) {
            clearInterval(_.autoPlayTimer);
        }

        if (_.slideCount > _.options.slidesToShow && _.paused !== true) {
            _.autoPlayTimer = setInterval(_.autoPlayIterator,
                _.options.autoplaySpeed);
        }

    };

    Slick.prototype.autoPlayClear = function() {

        var _ = this;
        if (_.autoPlayTimer) {
            clearInterval(_.autoPlayTimer);
        }

    };

    Slick.prototype.autoPlayIterator = function() {

        var _ = this;

        if (_.options.infinite === false) {

            if (_.direction === 1) {

                if ((_.currentSlide + 1) === _.slideCount -
                    1) {
                    _.direction = 0;
                }

                _.slideHandler(_.currentSlide + _.options.slidesToScroll);

            } else {

                if ((_.currentSlide - 1 === 0)) {

                    _.direction = 1;

                }

                _.slideHandler(_.currentSlide - _.options.slidesToScroll);

            }

        } else {

            _.slideHandler(_.currentSlide + _.options.slidesToScroll);

        }

    };

    Slick.prototype.buildArrows = function() {

        var _ = this;

        if (_.options.arrows === true ) {

            _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
            _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');

            if( _.slideCount > _.options.slidesToShow ) {

                _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
                _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');

                if (_.htmlExpr.test(_.options.prevArrow)) {
                    _.$prevArrow.prependTo(_.options.appendArrows);
                }

                if (_.htmlExpr.test(_.options.nextArrow)) {
                    _.$nextArrow.appendTo(_.options.appendArrows);
                }

                if (_.options.infinite !== true) {
                    _.$prevArrow
                        .addClass('slick-disabled')
                        .attr('aria-disabled', 'true');
                }

            } else {

                _.$prevArrow.add( _.$nextArrow )

                    .addClass('slick-hidden')
                    .attr({
                        'aria-disabled': 'true',
                        'tabindex': '-1'
                    });

            }

        }

    };

    Slick.prototype.buildDots = function() {

        var _ = this,
            i, dotString;

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {

            dotString = '<ul class="' + _.options.dotsClass + '">';

            for (i = 0; i <= _.getDotCount(); i += 1) {
                dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>';
            }

            dotString += '</ul>';

            _.$dots = $(dotString).appendTo(
                _.options.appendDots);

            _.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false');

        }

    };

    Slick.prototype.buildOut = function() {

        var _ = this;

        _.$slides =
            _.$slider
                .children( _.options.slide + ':not(.slick-cloned)')
                .addClass('slick-slide');

        _.slideCount = _.$slides.length;

        _.$slides.each(function(index, element) {
            $(element)
                .attr('data-slick-index', index)
                .data('originalStyling', $(element).attr('style') || '');
        });

        _.$slider.addClass('slick-slider');

        _.$slideTrack = (_.slideCount === 0) ?
            $('<div class="slick-track"/>').appendTo(_.$slider) :
            _.$slides.wrapAll('<div class="slick-track"/>').parent();

        _.$list = _.$slideTrack.wrap(
            '<div aria-live="polite" class="slick-list"/>').parent();
        _.$slideTrack.css('opacity', 0);

        if (_.options.centerMode === true || _.options.swipeToSlide === true) {
            _.options.slidesToScroll = 1;
        }

        $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');

        _.setupInfinite();

        _.buildArrows();

        _.buildDots();

        _.updateDots();


        _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);

        if (_.options.draggable === true) {
            _.$list.addClass('draggable');
        }

    };

    Slick.prototype.buildRows = function() {

        var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;

        newSlides = document.createDocumentFragment();
        originalSlides = _.$slider.children();

        if(_.options.rows > 1) {

            slidesPerSection = _.options.slidesPerRow * _.options.rows;
            numOfSlides = Math.ceil(
                originalSlides.length / slidesPerSection
            );

            for(a = 0; a < numOfSlides; a++){
                var slide = document.createElement('div');
                for(b = 0; b < _.options.rows; b++) {
                    var row = document.createElement('div');
                    for(c = 0; c < _.options.slidesPerRow; c++) {
                        var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
                        if (originalSlides.get(target)) {
                            row.appendChild(originalSlides.get(target));
                        }
                    }
                    slide.appendChild(row);
                }
                newSlides.appendChild(slide);
            }

            _.$slider.html(newSlides);
            _.$slider.children().children().children()
                .css({
                    'width':(100 / _.options.slidesPerRow) + '%',
                    'display': 'inline-block'
                });

        }

    };

    Slick.prototype.checkResponsive = function(initial, forceUpdate) {

        var _ = this,
            breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
        var sliderWidth = _.$slider.width();
        var windowWidth = window.innerWidth || $(window).width();

        if (_.respondTo === 'window') {
            respondToWidth = windowWidth;
        } else if (_.respondTo === 'slider') {
            respondToWidth = sliderWidth;
        } else if (_.respondTo === 'min') {
            respondToWidth = Math.min(windowWidth, sliderWidth);
        }

        if ( _.options.responsive &&
            _.options.responsive.length &&
            _.options.responsive !== null) {

            targetBreakpoint = null;

            for (breakpoint in _.breakpoints) {
                if (_.breakpoints.hasOwnProperty(breakpoint)) {
                    if (_.originalSettings.mobileFirst === false) {
                        if (respondToWidth < _.breakpoints[breakpoint]) {
                            targetBreakpoint = _.breakpoints[breakpoint];
                        }
                    } else {
                        if (respondToWidth > _.breakpoints[breakpoint]) {
                            targetBreakpoint = _.breakpoints[breakpoint];
                        }
                    }
                }
            }

            if (targetBreakpoint !== null) {
                if (_.activeBreakpoint !== null) {
                    if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
                        _.activeBreakpoint =
                            targetBreakpoint;
                        if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
                            _.unslick(targetBreakpoint);
                        } else {
                            _.options = $.extend({}, _.originalSettings,
                                _.breakpointSettings[
                                    targetBreakpoint]);
                            if (initial === true) {
                                _.currentSlide = _.options.initialSlide;
                            }
                            _.refresh(initial);
                        }
                        triggerBreakpoint = targetBreakpoint;
                    }
                } else {
                    _.activeBreakpoint = targetBreakpoint;
                    if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
                        _.unslick(targetBreakpoint);
                    } else {
                        _.options = $.extend({}, _.originalSettings,
                            _.breakpointSettings[
                                targetBreakpoint]);
                        if (initial === true) {
                            _.currentSlide = _.options.initialSlide;
                        }
                        _.refresh(initial);
                    }
                    triggerBreakpoint = targetBreakpoint;
                }
            } else {
                if (_.activeBreakpoint !== null) {
                    _.activeBreakpoint = null;
                    _.options = _.originalSettings;
                    if (initial === true) {
                        _.currentSlide = _.options.initialSlide;
                    }
                    _.refresh(initial);
                    triggerBreakpoint = targetBreakpoint;
                }
            }

            // only trigger breakpoints during an actual break. not on initialize.
            if( !initial && triggerBreakpoint !== false ) {
                _.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
            }
        }

    };

    Slick.prototype.changeSlide = function(event, dontAnimate) {

        var _ = this,
            $target = $(event.target),
            indexOffset, slideOffset, unevenOffset;

        // If target is a link, prevent default action.
        if($target.is('a')) {
            event.preventDefault();
        }

        // If target is not the <li> element (ie: a child), find the <li>.
        if(!$target.is('li')) {
            $target = $target.closest('li');
        }

        unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
        indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;

        switch (event.data.message) {

            case 'previous':
                slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
                if (_.slideCount > _.options.slidesToShow) {
                    _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
                }
                break;

            case 'next':
                slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
                if (_.slideCount > _.options.slidesToShow) {
                    _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
                }
                break;

            case 'index':
                var index = event.data.index === 0 ? 0 :
                    event.data.index || $target.index() * _.options.slidesToScroll;

                _.slideHandler(_.checkNavigable(index), false, dontAnimate);
                $target.children().trigger('focus');
                break;

            default:
                return;
        }

    };

    Slick.prototype.checkNavigable = function(index) {

        var _ = this,
            navigables, prevNavigable;

        navigables = _.getNavigableIndexes();
        prevNavigable = 0;
        if (index > navigables[navigables.length - 1]) {
            index = navigables[navigables.length - 1];
        } else {
            for (var n in navigables) {
                if (index < navigables[n]) {
                    index = prevNavigable;
                    break;
                }
                prevNavigable = navigables[n];
            }
        }

        return index;
    };

    Slick.prototype.cleanUpEvents = function() {

        var _ = this;

        if (_.options.dots && _.$dots !== null) {

            $('li', _.$dots).off('click.slick', _.changeSlide);

            if (_.options.pauseOnDotsHover === true && _.options.autoplay === true) {

                $('li', _.$dots)
                    .off('mouseenter.slick', $.proxy(_.setPaused, _, true))
                    .off('mouseleave.slick', $.proxy(_.setPaused, _, false));

            }

        }

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
            _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
            _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
        }

        _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
        _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
        _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
        _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);

        _.$list.off('click.slick', _.clickHandler);

        $(document).off(_.visibilityChange, _.visibility);

        _.$list.off('mouseenter.slick', $.proxy(_.setPaused, _, true));
        _.$list.off('mouseleave.slick', $.proxy(_.setPaused, _, false));

        if (_.options.accessibility === true) {
            _.$list.off('keydown.slick', _.keyHandler);
        }

        if (_.options.focusOnSelect === true) {
            $(_.$slideTrack).children().off('click.slick', _.selectHandler);
        }

        $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);

        $(window).off('resize.slick.slick-' + _.instanceUid, _.resize);

        $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);

        $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
        $(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition);
    };

    Slick.prototype.cleanUpRows = function() {

        var _ = this, originalSlides;

        if(_.options.rows > 1) {
            originalSlides = _.$slides.children().children();
            originalSlides.removeAttr('style');
            _.$slider.html(originalSlides);
        }

    };

    Slick.prototype.clickHandler = function(event) {

        var _ = this;

        if (_.shouldClick === false) {
            event.stopImmediatePropagation();
            event.stopPropagation();
            event.preventDefault();
        }

    };

    Slick.prototype.destroy = function(refresh) {

        var _ = this;

        _.autoPlayClear();

        _.touchObject = {};

        _.cleanUpEvents();

        $('.slick-cloned', _.$slider).detach();

        if (_.$dots) {
            _.$dots.remove();
        }


        if ( _.$prevArrow && _.$prevArrow.length ) {

            _.$prevArrow
                .removeClass('slick-disabled slick-arrow slick-hidden')
                .removeAttr('aria-hidden aria-disabled tabindex')
                .css("display","");

            if ( _.htmlExpr.test( _.options.prevArrow )) {
                _.$prevArrow.remove();
            }
        }

        if ( _.$nextArrow && _.$nextArrow.length ) {

            _.$nextArrow
                .removeClass('slick-disabled slick-arrow slick-hidden')
                .removeAttr('aria-hidden aria-disabled tabindex')
                .css("display","");

            if ( _.htmlExpr.test( _.options.nextArrow )) {
                _.$nextArrow.remove();
            }

        }


        if (_.$slides) {

            _.$slides
                .removeClass('slick-slide slick-active slick-center slick-visible slick-current')
                .removeAttr('aria-hidden')
                .removeAttr('data-slick-index')
                .each(function(){
                    $(this).attr('style', $(this).data('originalStyling'));
                });

            _.$slideTrack.children(this.options.slide).detach();

            _.$slideTrack.detach();

            _.$list.detach();

            _.$slider.append(_.$slides);
        }

        _.cleanUpRows();

        _.$slider.removeClass('slick-slider');
        _.$slider.removeClass('slick-initialized');

        _.unslicked = true;

        if(!refresh) {
            _.$slider.trigger('destroy', [_]);
        }

    };

    Slick.prototype.disableTransition = function(slide) {

        var _ = this,
            transition = {};

        transition[_.transitionType] = '';

        if (_.options.fade === false) {
            _.$slideTrack.css(transition);
        } else {
            _.$slides.eq(slide).css(transition);
        }

    };

    Slick.prototype.fadeSlide = function(slideIndex, callback) {

        var _ = this;

        if (_.cssTransitions === false) {

            _.$slides.eq(slideIndex).css({
                zIndex: _.options.zIndex
            });

            _.$slides.eq(slideIndex).animate({
                opacity: 1
            }, _.options.speed, _.options.easing, callback);

        } else {

            _.applyTransition(slideIndex);

            _.$slides.eq(slideIndex).css({
                opacity: 1,
                zIndex: _.options.zIndex
            });

            if (callback) {
                setTimeout(function() {

                    _.disableTransition(slideIndex);

                    callback.call();
                }, _.options.speed);
            }

        }

    };

    Slick.prototype.fadeSlideOut = function(slideIndex) {

        var _ = this;

        if (_.cssTransitions === false) {

            _.$slides.eq(slideIndex).animate({
                opacity: 0,
                zIndex: _.options.zIndex - 2
            }, _.options.speed, _.options.easing);

        } else {

            _.applyTransition(slideIndex);

            _.$slides.eq(slideIndex).css({
                opacity: 0,
                zIndex: _.options.zIndex - 2
            });

        }

    };

    Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {

        var _ = this;

        if (filter !== null) {

            _.$slidesCache = _.$slides;

            _.unload();

            _.$slideTrack.children(this.options.slide).detach();

            _.$slidesCache.filter(filter).appendTo(_.$slideTrack);

            _.reinit();

        }

    };

    Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {

        var _ = this;
        return _.currentSlide;

    };

    Slick.prototype.getDotCount = function() {

        var _ = this;

        var breakPoint = 0;
        var counter = 0;
        var pagerQty = 0;

        if (_.options.infinite === true) {
            while (breakPoint < _.slideCount) {
                ++pagerQty;
                breakPoint = counter + _.options.slidesToScroll;
                counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
            }
        } else if (_.options.centerMode === true) {
            pagerQty = _.slideCount;
        } else {
            while (breakPoint < _.slideCount) {
                ++pagerQty;
                breakPoint = counter + _.options.slidesToScroll;
                counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
            }
        }

        return pagerQty - 1;

    };

    Slick.prototype.getLeft = function(slideIndex) {

        var _ = this,
            targetLeft,
            verticalHeight,
            verticalOffset = 0,
            targetSlide;

        _.slideOffset = 0;
        verticalHeight = _.$slides.first().outerHeight(true);

        if (_.options.infinite === true) {
            if (_.slideCount > _.options.slidesToShow) {
                _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
                verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
            }
            if (_.slideCount % _.options.slidesToScroll !== 0) {
                if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
                    if (slideIndex > _.slideCount) {
                        _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
                        verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
                    } else {
                        _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
                        verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
                    }
                }
            }
        } else {
            if (slideIndex + _.options.slidesToShow > _.slideCount) {
                _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
                verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
            }
        }

        if (_.slideCount <= _.options.slidesToShow) {
            _.slideOffset = 0;
            verticalOffset = 0;
        }

        if (_.options.centerMode === true && _.options.infinite === true) {
            _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
        } else if (_.options.centerMode === true) {
            _.slideOffset = 0;
            _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
        }

        if (_.options.vertical === false) {
            targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
        } else {
            targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
        }

        if (_.options.variableWidth === true) {

            if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
                targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
            } else {
                targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
            }

            if (_.options.rtl === true) {
                if (targetSlide[0]) {
                    targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
                } else {
                    targetLeft =  0;
                }
            } else {
                targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
            }

            if (_.options.centerMode === true) {
                if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
                    targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
                } else {
                    targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
                }

                if (_.options.rtl === true) {
                    if (targetSlide[0]) {
                        targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
                    } else {
                        targetLeft =  0;
                    }
                } else {
                    targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
                }

                targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
            }
        }

        return targetLeft;

    };

    Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {

        var _ = this;

        return _.options[option];

    };

    Slick.prototype.getNavigableIndexes = function() {

        var _ = this,
            breakPoint = 0,
            counter = 0,
            indexes = [],
            max;

        if (_.options.infinite === false) {
            max = _.slideCount;
        } else {
            breakPoint = _.options.slidesToScroll * -1;
            counter = _.options.slidesToScroll * -1;
            max = _.slideCount * 2;
        }

        while (breakPoint < max) {
            indexes.push(breakPoint);
            breakPoint = counter + _.options.slidesToScroll;
            counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
        }

        return indexes;

    };

    Slick.prototype.getSlick = function() {

        return this;

    };

    Slick.prototype.getSlideCount = function() {

        var _ = this,
            slidesTraversed, swipedSlide, centerOffset;

        centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;

        if (_.options.swipeToSlide === true) {
            _.$slideTrack.find('.slick-slide').each(function(index, slide) {
                if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
                    swipedSlide = slide;
                    return false;
                }
            });

            slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;

            return slidesTraversed;

        } else {
            return _.options.slidesToScroll;
        }

    };

    Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {

        var _ = this;

        _.changeSlide({
            data: {
                message: 'index',
                index: parseInt(slide)
            }
        }, dontAnimate);

    };

    Slick.prototype.init = function(creation) {

        var _ = this;

        if (!$(_.$slider).hasClass('slick-initialized')) {

            $(_.$slider).addClass('slick-initialized');

            _.buildRows();
            _.buildOut();
            _.setProps();
            _.startLoad();
            _.loadSlider();
            _.initializeEvents();
            _.updateArrows();
            _.updateDots();

        }

        if (creation) {
            _.$slider.trigger('init', [_]);
        }

        if (_.options.accessibility === true) {
            _.initADA();
        }

    };

    Slick.prototype.initArrowEvents = function() {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
            _.$prevArrow.on('click.slick', {
                message: 'previous'
            }, _.changeSlide);
            _.$nextArrow.on('click.slick', {
                message: 'next'
            }, _.changeSlide);
        }

    };

    Slick.prototype.initDotEvents = function() {

        var _ = this;

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
            $('li', _.$dots).on('click.slick', {
                message: 'index'
            }, _.changeSlide);
        }

        if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) {
            $('li', _.$dots)
                .on('mouseenter.slick', $.proxy(_.setPaused, _, true))
                .on('mouseleave.slick', $.proxy(_.setPaused, _, false));
        }

    };

    Slick.prototype.initializeEvents = function() {

        var _ = this;

        _.initArrowEvents();

        _.initDotEvents();

        _.$list.on('touchstart.slick mousedown.slick', {
            action: 'start'
        }, _.swipeHandler);
        _.$list.on('touchmove.slick mousemove.slick', {
            action: 'move'
        }, _.swipeHandler);
        _.$list.on('touchend.slick mouseup.slick', {
            action: 'end'
        }, _.swipeHandler);
        _.$list.on('touchcancel.slick mouseleave.slick', {
            action: 'end'
        }, _.swipeHandler);

        _.$list.on('click.slick', _.clickHandler);

        $(document).on(_.visibilityChange, $.proxy(_.visibility, _));

        _.$list.on('mouseenter.slick', $.proxy(_.setPaused, _, true));
        _.$list.on('mouseleave.slick', $.proxy(_.setPaused, _, false));

        if (_.options.accessibility === true) {
            _.$list.on('keydown.slick', _.keyHandler);
        }

        if (_.options.focusOnSelect === true) {
            $(_.$slideTrack).children().on('click.slick', _.selectHandler);
        }

        $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));

        $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));

        $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);

        $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
        $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);

    };

    Slick.prototype.initUI = function() {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {

            _.$prevArrow.show();
            _.$nextArrow.show();

        }

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {

            _.$dots.show();

        }

        if (_.options.autoplay === true) {

            _.autoPlay();

        }

    };

    Slick.prototype.keyHandler = function(event) {

        var _ = this;
         //Dont slide if the cursor is inside the form fields and arrow keys are pressed
        if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
            if (event.keyCode === 37 && _.options.accessibility === true) {
                _.changeSlide({
                    data: {
                        message: 'previous'
                    }
                });
            } else if (event.keyCode === 39 && _.options.accessibility === true) {
                _.changeSlide({
                    data: {
                        message: 'next'
                    }
                });
            }
        }

    };

    Slick.prototype.lazyLoad = function() {

        var _ = this,
            loadRange, cloneRange, rangeStart, rangeEnd;

        function loadImages(imagesScope) {
            $('img[data-lazy]', imagesScope).each(function() {

                var image = $(this),
                    imageSource = $(this).attr('data-lazy'),
                    imageToLoad = document.createElement('img');

                imageToLoad.onload = function() {
                    image
                        .animate({ opacity: 0 }, 100, function() {
                            image
                                .attr('src', imageSource)
                                .animate({ opacity: 1 }, 200, function() {
                                    image
                                        .removeAttr('data-lazy')
                                        .removeClass('slick-loading');
                                });
                        });
                };

                imageToLoad.src = imageSource;

            });
        }

        if (_.options.centerMode === true) {
            if (_.options.infinite === true) {
                rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
                rangeEnd = rangeStart + _.options.slidesToShow + 2;
            } else {
                rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
                rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
            }
        } else {
            rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
            rangeEnd = rangeStart + _.options.slidesToShow;
            if (_.options.fade === true) {
                if (rangeStart > 0) rangeStart--;
                if (rangeEnd <= _.slideCount) rangeEnd++;
            }
        }

        loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
        loadImages(loadRange);

        if (_.slideCount <= _.options.slidesToShow) {
            cloneRange = _.$slider.find('.slick-slide');
            loadImages(cloneRange);
        } else
        if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
            cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
            loadImages(cloneRange);
        } else if (_.currentSlide === 0) {
            cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
            loadImages(cloneRange);
        }

    };

    Slick.prototype.loadSlider = function() {

        var _ = this;

        _.setPosition();

        _.$slideTrack.css({
            opacity: 1
        });

        _.$slider.removeClass('slick-loading');

        _.initUI();

        if (_.options.lazyLoad === 'progressive') {
            _.progressiveLazyLoad();
        }

    };

    Slick.prototype.next = Slick.prototype.slickNext = function() {

        var _ = this;

        _.changeSlide({
            data: {
                message: 'next'
            }
        });

    };

    Slick.prototype.orientationChange = function() {

        var _ = this;

        _.checkResponsive();
        _.setPosition();

    };

    Slick.prototype.pause = Slick.prototype.slickPause = function() {

        var _ = this;

        _.autoPlayClear();
        _.paused = true;

    };

    Slick.prototype.play = Slick.prototype.slickPlay = function() {

        var _ = this;

        _.paused = false;
        _.autoPlay();

    };

    Slick.prototype.postSlide = function(index) {

        var _ = this;

        _.$slider.trigger('afterChange', [_, index]);

        _.animating = false;

        _.setPosition();

        _.swipeLeft = null;

        if (_.options.autoplay === true && _.paused === false) {
            _.autoPlay();
        }
        if (_.options.accessibility === true) {
            _.initADA();
        }

    };

    Slick.prototype.prev = Slick.prototype.slickPrev = function() {

        var _ = this;

        _.changeSlide({
            data: {
                message: 'previous'
            }
        });

    };

    Slick.prototype.preventDefault = function(event) {
        event.preventDefault();
    };

    Slick.prototype.progressiveLazyLoad = function() {

        var _ = this,
            imgCount, targetImage;

        imgCount = $('img[data-lazy]', _.$slider).length;

        if (imgCount > 0) {
            targetImage = $('img[data-lazy]', _.$slider).first();
            targetImage.attr('src', null);
            targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function() {
                    targetImage.removeAttr('data-lazy');
                    _.progressiveLazyLoad();

                    if (_.options.adaptiveHeight === true) {
                        _.setPosition();
                    }
                })
                .error(function() {
                    targetImage.removeAttr('data-lazy');
                    _.progressiveLazyLoad();
                });
        }

    };

    Slick.prototype.refresh = function( initializing ) {

        var _ = this, currentSlide, firstVisible;

        firstVisible = _.slideCount - _.options.slidesToShow;

        // check that the new breakpoint can actually accept the
        // "current slide" as the current slide, otherwise we need
        // to set it to the closest possible value.
        if ( !_.options.infinite ) {
            if ( _.slideCount <= _.options.slidesToShow ) {
                _.currentSlide = 0;
            } else if ( _.currentSlide > firstVisible ) {
                _.currentSlide = firstVisible;
            }
        }

         currentSlide = _.currentSlide;

        _.destroy(true);

        $.extend(_, _.initials, { currentSlide: currentSlide });

        _.init();

        if( !initializing ) {

            _.changeSlide({
                data: {
                    message: 'index',
                    index: currentSlide
                }
            }, false);

        }

    };

    Slick.prototype.registerBreakpoints = function() {

        var _ = this, breakpoint, currentBreakpoint, l,
            responsiveSettings = _.options.responsive || null;

        if ( $.type(responsiveSettings) === "array" && responsiveSettings.length ) {

            _.respondTo = _.options.respondTo || 'window';

            for ( breakpoint in responsiveSettings ) {

                l = _.breakpoints.length-1;
                currentBreakpoint = responsiveSettings[breakpoint].breakpoint;

                if (responsiveSettings.hasOwnProperty(breakpoint)) {

                    // loop through the breakpoints and cut out any existing
                    // ones with the same breakpoint number, we don't want dupes.
                    while( l >= 0 ) {
                        if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
                            _.breakpoints.splice(l,1);
                        }
                        l--;
                    }

                    _.breakpoints.push(currentBreakpoint);
                    _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;

                }

            }

            _.breakpoints.sort(function(a, b) {
                return ( _.options.mobileFirst ) ? a-b : b-a;
            });

        }

    };

    Slick.prototype.reinit = function() {

        var _ = this;

        _.$slides =
            _.$slideTrack
                .children(_.options.slide)
                .addClass('slick-slide');

        _.slideCount = _.$slides.length;

        if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
            _.currentSlide = _.currentSlide - _.options.slidesToScroll;
        }

        if (_.slideCount <= _.options.slidesToShow) {
            _.currentSlide = 0;
        }

        _.registerBreakpoints();

        _.setProps();
        _.setupInfinite();
        _.buildArrows();
        _.updateArrows();
        _.initArrowEvents();
        _.buildDots();
        _.updateDots();
        _.initDotEvents();

        _.checkResponsive(false, true);

        if (_.options.focusOnSelect === true) {
            $(_.$slideTrack).children().on('click.slick', _.selectHandler);
        }

        _.setSlideClasses(0);

        _.setPosition();

        _.$slider.trigger('reInit', [_]);

        if (_.options.autoplay === true) {
            _.focusHandler();
        }

    };

    Slick.prototype.resize = function() {

        var _ = this;

        if ($(window).width() !== _.windowWidth) {
            clearTimeout(_.windowDelay);
            _.windowDelay = window.setTimeout(function() {
                _.windowWidth = $(window).width();
                _.checkResponsive();
                if( !_.unslicked ) { _.setPosition(); }
            }, 50);
        }
    };

    Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {

        var _ = this;

        if (typeof(index) === 'boolean') {
            removeBefore = index;
            index = removeBefore === true ? 0 : _.slideCount - 1;
        } else {
            index = removeBefore === true ? --index : index;
        }

        if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
            return false;
        }

        _.unload();

        if (removeAll === true) {
            _.$slideTrack.children().remove();
        } else {
            _.$slideTrack.children(this.options.slide).eq(index).remove();
        }

        _.$slides = _.$slideTrack.children(this.options.slide);

        _.$slideTrack.children(this.options.slide).detach();

        _.$slideTrack.append(_.$slides);

        _.$slidesCache = _.$slides;

        _.reinit();

    };

    Slick.prototype.setCSS = function(position) {

        var _ = this,
            positionProps = {},
            x, y;

        if (_.options.rtl === true) {
            position = -position;
        }
        x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
        y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';

        positionProps[_.positionProp] = position;

        if (_.transformsEnabled === false) {
            _.$slideTrack.css(positionProps);
        } else {
            positionProps = {};
            if (_.cssTransitions === false) {
                positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
                _.$slideTrack.css(positionProps);
            } else {
                positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
                _.$slideTrack.css(positionProps);
            }
        }

    };

    Slick.prototype.setDimensions = function() {

        var _ = this;

        if (_.options.vertical === false) {
            if (_.options.centerMode === true) {
                _.$list.css({
                    padding: ('0px ' + _.options.centerPadding)
                });
            }
        } else {
            _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
            if (_.options.centerMode === true) {
                _.$list.css({
                    padding: (_.options.centerPadding + ' 0px')
                });
            }
        }

        _.listWidth = _.$list.width();
        _.listHeight = _.$list.height();


        if (_.options.vertical === false && _.options.variableWidth === false) {
            _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
            _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));

        } else if (_.options.variableWidth === true) {
            _.$slideTrack.width(5000 * _.slideCount);
        } else {
            _.slideWidth = Math.ceil(_.listWidth);
            _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
        }

        var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
        if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);

    };

    Slick.prototype.setFade = function() {

        var _ = this,
            targetLeft;

        _.$slides.each(function(index, element) {
            targetLeft = (_.slideWidth * index) * -1;
            if (_.options.rtl === true) {
                $(element).css({
                    position: 'relative',
                    right: targetLeft,
                    top: 0,
                    zIndex: _.options.zIndex - 2,
                    opacity: 0
                });
            } else {
                $(element).css({
                    position: 'relative',
                    left: targetLeft,
                    top: 0,
                    zIndex: _.options.zIndex - 2,
                    opacity: 0
                });
            }
        });

        _.$slides.eq(_.currentSlide).css({
            zIndex: _.options.zIndex - 1,
            opacity: 1
        });

    };

    Slick.prototype.setHeight = function() {

        var _ = this;

        if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
            var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
            _.$list.css('height', targetHeight);
        }

    };

    Slick.prototype.setOption = Slick.prototype.slickSetOption = function(option, value, refresh) {

        var _ = this, l, item;

        if( option === "responsive" && $.type(value) === "array" ) {
            for ( item in value ) {
                if( $.type( _.options.responsive ) !== "array" ) {
                    _.options.responsive = [ value[item] ];
                } else {
                    l = _.options.responsive.length-1;
                    // loop through the responsive object and splice out duplicates.
                    while( l >= 0 ) {
                        if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
                            _.options.responsive.splice(l,1);
                        }
                        l--;
                    }
                    _.options.responsive.push( value[item] );
                }
            }
        } else {
            _.options[option] = value;
        }

        if (refresh === true) {
            _.unload();
            _.reinit();
        }

    };

    Slick.prototype.setPosition = function() {

        var _ = this;

        _.setDimensions();

        _.setHeight();

        if (_.options.fade === false) {
            _.setCSS(_.getLeft(_.currentSlide));
        } else {
            _.setFade();
        }

        _.$slider.trigger('setPosition', [_]);

    };

    Slick.prototype.setProps = function() {

        var _ = this,
            bodyStyle = document.body.style;

        _.positionProp = _.options.vertical === true ? 'top' : 'left';

        if (_.positionProp === 'top') {
            _.$slider.addClass('slick-vertical');
        } else {
            _.$slider.removeClass('slick-vertical');
        }

        if (bodyStyle.WebkitTransition !== undefined ||
            bodyStyle.MozTransition !== undefined ||
            bodyStyle.msTransition !== undefined) {
            if (_.options.useCSS === true) {
                _.cssTransitions = true;
            }
        }

        if ( _.options.fade ) {
            if ( typeof _.options.zIndex === 'number' ) {
                if( _.options.zIndex < 3 ) {
                    _.options.zIndex = 3;
                }
            } else {
                _.options.zIndex = _.defaults.zIndex;
            }
        }

        if (bodyStyle.OTransform !== undefined) {
            _.animType = 'OTransform';
            _.transformType = '-o-transform';
            _.transitionType = 'OTransition';
            if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
        }
        if (bodyStyle.MozTransform !== undefined) {
            _.animType = 'MozTransform';
            _.transformType = '-moz-transform';
            _.transitionType = 'MozTransition';
            if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
        }
        if (bodyStyle.webkitTransform !== undefined) {
            _.animType = 'webkitTransform';
            _.transformType = '-webkit-transform';
            _.transitionType = 'webkitTransition';
            if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
        }
        if (bodyStyle.msTransform !== undefined) {
            _.animType = 'msTransform';
            _.transformType = '-ms-transform';
            _.transitionType = 'msTransition';
            if (bodyStyle.msTransform === undefined) _.animType = false;
        }
        if (bodyStyle.transform !== undefined && _.animType !== false) {
            _.animType = 'transform';
            _.transformType = 'transform';
            _.transitionType = 'transition';
        }
        _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
    };


    Slick.prototype.setSlideClasses = function(index) {

        var _ = this,
            centerOffset, allSlides, indexOffset, remainder;

        allSlides = _.$slider
            .find('.slick-slide')
            .removeClass('slick-active slick-center slick-current')
            .attr('aria-hidden', 'true');

        _.$slides
            .eq(index)
            .addClass('slick-current');

        if (_.options.centerMode === true) {

            centerOffset = Math.floor(_.options.slidesToShow / 2);

            if (_.options.infinite === true) {

                if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {

                    _.$slides
                        .slice(index - centerOffset, index + centerOffset + 1)
                        .addClass('slick-active')
                        .attr('aria-hidden', 'false');

                } else {

                    indexOffset = _.options.slidesToShow + index;
                    allSlides
                        .slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2)
                        .addClass('slick-active')
                        .attr('aria-hidden', 'false');

                }

                if (index === 0) {

                    allSlides
                        .eq(allSlides.length - 1 - _.options.slidesToShow)
                        .addClass('slick-center');

                } else if (index === _.slideCount - 1) {

                    allSlides
                        .eq(_.options.slidesToShow)
                        .addClass('slick-center');

                }

            }

            _.$slides
                .eq(index)
                .addClass('slick-center');

        } else {

            if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {

                _.$slides
                    .slice(index, index + _.options.slidesToShow)
                    .addClass('slick-active')
                    .attr('aria-hidden', 'false');

            } else if (allSlides.length <= _.options.slidesToShow) {

                allSlides
                    .addClass('slick-active')
                    .attr('aria-hidden', 'false');

            } else {

                remainder = _.slideCount % _.options.slidesToShow;
                indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;

                if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {

                    allSlides
                        .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
                        .addClass('slick-active')
                        .attr('aria-hidden', 'false');

                } else {

                    allSlides
                        .slice(indexOffset, indexOffset + _.options.slidesToShow)
                        .addClass('slick-active')
                        .attr('aria-hidden', 'false');

                }

            }

        }

        if (_.options.lazyLoad === 'ondemand') {
            _.lazyLoad();
        }

    };

    Slick.prototype.setupInfinite = function() {

        var _ = this,
            i, slideIndex, infiniteCount;

        if (_.options.fade === true) {
            _.options.centerMode = false;
        }

        if (_.options.infinite === true && _.options.fade === false) {

            slideIndex = null;

            if (_.slideCount > _.options.slidesToShow) {

                if (_.options.centerMode === true) {
                    infiniteCount = _.options.slidesToShow + 1;
                } else {
                    infiniteCount = _.options.slidesToShow;
                }

                for (i = _.slideCount; i > (_.slideCount -
                        infiniteCount); i -= 1) {
                    slideIndex = i - 1;
                    $(_.$slides[slideIndex]).clone(true).attr('id', '')
                        .attr('data-slick-index', slideIndex - _.slideCount)
                        .prependTo(_.$slideTrack).addClass('slick-cloned');
                }
                for (i = 0; i < infiniteCount; i += 1) {
                    slideIndex = i;
                    $(_.$slides[slideIndex]).clone(true).attr('id', '')
                        .attr('data-slick-index', slideIndex + _.slideCount)
                        .appendTo(_.$slideTrack).addClass('slick-cloned');
                }
                _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
                    $(this).attr('id', '');
                });

            }

        }

    };

    Slick.prototype.setPaused = function(paused) {

        var _ = this;

        if (_.options.autoplay === true && _.options.pauseOnHover === true) {
            _.paused = paused;
            if (!paused) {
                _.autoPlay();
            } else {
                _.autoPlayClear();
            }
        }
    };

    Slick.prototype.selectHandler = function(event) {

        var _ = this;

        var targetElement =
            $(event.target).is('.slick-slide') ?
                $(event.target) :
                $(event.target).parents('.slick-slide');

        var index = parseInt(targetElement.attr('data-slick-index'));

        if (!index) index = 0;

        if (_.slideCount <= _.options.slidesToShow) {

            _.setSlideClasses(index);
            _.asNavFor(index);
            return;

        }

        _.slideHandler(index);

    };

    Slick.prototype.slideHandler = function(index, sync, dontAnimate) {

        var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
            _ = this;

        sync = sync || false;

        if (_.animating === true && _.options.waitForAnimate === true) {
            return;
        }

        if (_.options.fade === true && _.currentSlide === index) {
            return;
        }

        if (_.slideCount <= _.options.slidesToShow) {
            return;
        }

        if (sync === false) {
            _.asNavFor(index);
        }

        targetSlide = index;
        targetLeft = _.getLeft(targetSlide);
        slideLeft = _.getLeft(_.currentSlide);

        _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;

        if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
            if (_.options.fade === false) {
                targetSlide = _.currentSlide;
                if (dontAnimate !== true) {
                    _.animateSlide(slideLeft, function() {
                        _.postSlide(targetSlide);
                    });
                } else {
                    _.postSlide(targetSlide);
                }
            }
            return;
        } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
            if (_.options.fade === false) {
                targetSlide = _.currentSlide;
                if (dontAnimate !== true) {
                    _.animateSlide(slideLeft, function() {
                        _.postSlide(targetSlide);
                    });
                } else {
                    _.postSlide(targetSlide);
                }
            }
            return;
        }

        if (_.options.autoplay === true) {
            clearInterval(_.autoPlayTimer);
        }

        if (targetSlide < 0) {
            if (_.slideCount % _.options.slidesToScroll !== 0) {
                animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
            } else {
                animSlide = _.slideCount + targetSlide;
            }
        } else if (targetSlide >= _.slideCount) {
            if (_.slideCount % _.options.slidesToScroll !== 0) {
                animSlide = 0;
            } else {
                animSlide = targetSlide - _.slideCount;
            }
        } else {
            animSlide = targetSlide;
        }

        _.animating = true;

        _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);

        oldSlide = _.currentSlide;
        _.currentSlide = animSlide;

        _.setSlideClasses(_.currentSlide);

        _.updateDots();
        _.updateArrows();

        if (_.options.fade === true) {
            if (dontAnimate !== true) {

                _.fadeSlideOut(oldSlide);

                _.fadeSlide(animSlide, function() {
                    _.postSlide(animSlide);
                });

            } else {
                _.postSlide(animSlide);
            }
            _.animateHeight();
            return;
        }

        if (dontAnimate !== true) {
            _.animateSlide(targetLeft, function() {
                _.postSlide(animSlide);
            });
        } else {
            _.postSlide(animSlide);
        }

    };

    Slick.prototype.startLoad = function() {

        var _ = this;

        if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {

            _.$prevArrow.hide();
            _.$nextArrow.hide();

        }

        if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {

            _.$dots.hide();

        }

        _.$slider.addClass('slick-loading');

    };

    Slick.prototype.swipeDirection = function() {

        var xDist, yDist, r, swipeAngle, _ = this;

        xDist = _.touchObject.startX - _.touchObject.curX;
        yDist = _.touchObject.startY - _.touchObject.curY;
        r = Math.atan2(yDist, xDist);

        swipeAngle = Math.round(r * 180 / Math.PI);
        if (swipeAngle < 0) {
            swipeAngle = 360 - Math.abs(swipeAngle);
        }

        if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
            return (_.options.rtl === false ? 'left' : 'right');
        }
        if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
            return (_.options.rtl === false ? 'left' : 'right');
        }
        if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
            return (_.options.rtl === false ? 'right' : 'left');
        }
        if (_.options.verticalSwiping === true) {
            if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
                return 'left';
            } else {
                return 'right';
            }
        }

        return 'vertical';

    };

    Slick.prototype.swipeEnd = function(event) {

        var _ = this,
            slideCount;

        _.dragging = false;

        _.shouldClick = (_.touchObject.swipeLength > 10) ? false : true;

        if (_.touchObject.curX === undefined) {
            return false;
        }

        if (_.touchObject.edgeHit === true) {
            _.$slider.trigger('edge', [_, _.swipeDirection()]);
        }

        if (_.touchObject.swipeLength >= _.touchObject.minSwipe) {

            switch (_.swipeDirection()) {
                case 'left':
                    slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide + _.getSlideCount()) : _.currentSlide + _.getSlideCount();
                    _.slideHandler(slideCount);
                    _.currentDirection = 0;
                    _.touchObject = {};
                    _.$slider.trigger('swipe', [_, 'left']);
                    break;

                case 'right':
                    slideCount = _.options.swipeToSlide ? _.checkNavigable(_.currentSlide - _.getSlideCount()) : _.currentSlide - _.getSlideCount();
                    _.slideHandler(slideCount);
                    _.currentDirection = 1;
                    _.touchObject = {};
                    _.$slider.trigger('swipe', [_, 'right']);
                    break;
            }
        } else {
            if (_.touchObject.startX !== _.touchObject.curX) {
                _.slideHandler(_.currentSlide);
                _.touchObject = {};
            }
        }

    };

    Slick.prototype.swipeHandler = function(event) {

        var _ = this;

        if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
            return;
        } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
            return;
        }

        _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
            event.originalEvent.touches.length : 1;

        _.touchObject.minSwipe = _.listWidth / _.options
            .touchThreshold;

        if (_.options.verticalSwiping === true) {
            _.touchObject.minSwipe = _.listHeight / _.options
                .touchThreshold;
        }

        switch (event.data.action) {

            case 'start':
                _.swipeStart(event);
                break;

            case 'move':
                _.swipeMove(event);
                break;

            case 'end':
                _.swipeEnd(event);
                break;

        }

    };

    Slick.prototype.swipeMove = function(event) {

        var _ = this,
            edgeWasHit = false,
            curLeft, swipeDirection, swipeLength, positionOffset, touches;

        touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;

        if (!_.dragging || touches && touches.length !== 1) {
            return false;
        }

        curLeft = _.getLeft(_.currentSlide);

        _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
        _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;

        _.touchObject.swipeLength = Math.round(Math.sqrt(
            Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));

        if (_.options.verticalSwiping === true) {
            _.touchObject.swipeLength = Math.round(Math.sqrt(
                Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
        }

        swipeDirection = _.swipeDirection();

        if (swipeDirection === 'vertical') {
            return;
        }

        if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
            event.preventDefault();
        }

        positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
        if (_.options.verticalSwiping === true) {
            positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
        }


        swipeLength = _.touchObject.swipeLength;

        _.touchObject.edgeHit = false;

        if (_.options.infinite === false) {
            if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
                swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
                _.touchObject.edgeHit = true;
            }
        }

        if (_.options.vertical === false) {
            _.swipeLeft = curLeft + swipeLength * positionOffset;
        } else {
            _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
        }
        if (_.options.verticalSwiping === true) {
            _.swipeLeft = curLeft + swipeLength * positionOffset;
        }

        if (_.options.fade === true || _.options.touchMove === false) {
            return false;
        }

        if (_.animating === true) {
            _.swipeLeft = null;
            return false;
        }

        _.setCSS(_.swipeLeft);

    };

    Slick.prototype.swipeStart = function(event) {

        var _ = this,
            touches;

        if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
            _.touchObject = {};
            return false;
        }

        if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
            touches = event.originalEvent.touches[0];
        }

        _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
        _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;

        _.dragging = true;

    };

    Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {

        var _ = this;

        if (_.$slidesCache !== null) {

            _.unload();

            _.$slideTrack.children(this.options.slide).detach();

            _.$slidesCache.appendTo(_.$slideTrack);

            _.reinit();

        }

    };

    Slick.prototype.unload = function() {

        var _ = this;

        $('.slick-cloned', _.$slider).remove();

        if (_.$dots) {
            _.$dots.remove();
        }

        if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
            _.$prevArrow.remove();
        }

        if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
            _.$nextArrow.remove();
        }

        _.$slides
            .removeClass('slick-slide slick-active slick-visible slick-current')
            .attr('aria-hidden', 'true')
            .css('width', '');

    };

    Slick.prototype.unslick = function(fromBreakpoint) {

        var _ = this;
        _.$slider.trigger('unslick', [_, fromBreakpoint]);
        _.destroy();

    };

    Slick.prototype.updateArrows = function() {

        var _ = this,
            centerOffset;

        centerOffset = Math.floor(_.options.slidesToShow / 2);

        if ( _.options.arrows === true &&
            _.slideCount > _.options.slidesToShow &&
            !_.options.infinite ) {

            _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
            _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');

            if (_.currentSlide === 0) {

                _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
                _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');

            } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {

                _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
                _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');

            } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {

                _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
                _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');

            }

        }

    };

    Slick.prototype.updateDots = function() {

        var _ = this;

        if (_.$dots !== null) {

            _.$dots
                .find('li')
                .removeClass('slick-active')
                .attr('aria-hidden', 'true');

            _.$dots
                .find('li')
                .eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
                .addClass('slick-active')
                .attr('aria-hidden', 'false');

        }

    };

    Slick.prototype.visibility = function() {

        var _ = this;

        if (document[_.hidden]) {
            _.paused = true;
            _.autoPlayClear();
        } else {
            if (_.options.autoplay === true) {
                _.paused = false;
                _.autoPlay();
            }
        }

    };
    Slick.prototype.initADA = function() {
        var _ = this;
        _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
            'aria-hidden': 'true',
            'tabindex': '-1'
        }).find('a, input, button, select').attr({
            'tabindex': '-1'
        });

        _.$slideTrack.attr('role', 'listbox');

        _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
            $(this).attr({
                'role': 'option',
                'aria-describedby': 'slick-slide' + _.instanceUid + i + ''
            });
        });

        if (_.$dots !== null) {
            _.$dots.attr('role', 'tablist').find('li').each(function(i) {
                $(this).attr({
                    'role': 'presentation',
                    'aria-selected': 'false',
                    'aria-controls': 'navigation' + _.instanceUid + i + '',
                    'id': 'slick-slide' + _.instanceUid + i + ''
                });
            })
                .first().attr('aria-selected', 'true').end()
                .find('button').attr('role', 'button').end()
                .closest('div').attr('role', 'toolbar');
        }
        _.activateADA();

    };

    Slick.prototype.activateADA = function() {
        var _ = this;

        _.$slideTrack.find('.slick-active').attr({
            'aria-hidden': 'false'
        }).find('a, input, button, select').attr({
            'tabindex': '0'
        });

    };

    Slick.prototype.focusHandler = function() {
        var _ = this;
        _.$slider.on('focus.slick blur.slick', '*', function(event) {
            event.stopImmediatePropagation();
            var sf = $(this);
            setTimeout(function() {
                if (_.isPlay) {
                    if (sf.is(':focus')) {
                        _.autoPlayClear();
                        _.paused = true;
                    } else {
                        _.paused = false;
                        _.autoPlay();
                    }
                }
            }, 0);
        });
    };

    $.fn.slick = function() {
        var _ = this,
            opt = arguments[0],
            args = Array.prototype.slice.call(arguments, 1),
            l = _.length,
            i,
            ret;
        for (i = 0; i < l; i++) {
            if (typeof opt == 'object' || typeof opt == 'undefined')
                _[i].slick = new Slick(_[i], opt);
            else
                ret = _[i].slick[opt].apply(_[i].slick, args);
            if (typeof ret != 'undefined') return ret;
        }
        return _;
    };

}));
;
/*! lightslider - v1.1.3 - 2015-07-18
* https://github.com/sachinchoolur/lightslider
* Copyright (c) 2015 Sachin N; Licensed MIT */
!function (a, b) { "use strict"; var c = { item: 3, autoWidth: !1, slideMove: 1, slideMargin: 10, addClass: "", mode: "slide", useCSS: !0, cssEasing: "ease", easing: "linear", speed: 400, auto: !1, loop: !1, slideEndAnimation: !0, pause: 2e3, keyPress: !1, controls: !0, prevHtml: "", nextHtml: "", rtl: !1, adaptiveHeight: !1, vertical: !1, verticalHeight: 500, vThumbWidth: 100, thumbItem: 10, pager: !0, gallery: !1, galleryMargin: 5, thumbMargin: 5, currentPagerPosition: "middle", enableTouch: !0, enableDrag: !0, freeMove: !0, swipeThreshold: 40, responsive: [], onBeforeStart: function (a) { }, onSliderLoad: function (a) { }, onBeforeSlide: function (a, b) { }, onAfterSlide: function (a, b) { }, onBeforeNextSlide: function (a, b) { }, onBeforePrevSlide: function (a, b) { } }; a.fn.lightSlider = function (b) { if (0 === this.length) return this; if (this.length > 1) return this.each(function () { a(this).lightSlider(b) }), this; var d = {}, e = a.extend(!0, {}, c, b), f = {}, g = this; d.$el = this, "fade" === e.mode && (e.vertical = !1); var h = g.children(), i = a(window).width(), j = null, k = null, l = 0, m = 0, n = !1, o = 0, p = "", q = 0, r = e.vertical === !0 ? "height" : "width", s = e.vertical === !0 ? "margin-bottom" : "margin-right", t = 0, u = 0, v = 0, w = 0, x = null, y = "ontouchstart" in document.documentElement, z = {}; return z.chbreakpoint = function () { if (i = a(window).width(), e.responsive.length) { var b; if (e.autoWidth === !1 && (b = e.item), i < e.responsive[0].breakpoint) for (var c = 0; c < e.responsive.length; c++)i < e.responsive[c].breakpoint && (j = e.responsive[c].breakpoint, k = e.responsive[c]); if ("undefined" != typeof k && null !== k) for (var d in k.settings) k.settings.hasOwnProperty(d) && (("undefined" == typeof f[d] || null === f[d]) && (f[d] = e[d]), e[d] = k.settings[d]); if (!a.isEmptyObject(f) && i > e.responsive[0].breakpoint) for (var g in f) f.hasOwnProperty(g) && (e[g] = f[g]); e.autoWidth === !1 && t > 0 && v > 0 && b !== e.item && (q = Math.round(t / ((v + e.slideMargin) * e.slideMove))) } }, z.calSW = function () { e.autoWidth === !1 && (v = (o - (e.item * e.slideMargin - e.slideMargin)) / e.item) }, z.calWidth = function (a) { var b = a === !0 ? p.find(".lslide").length : h.length; if (e.autoWidth === !1) m = b * (v + e.slideMargin); else { m = 0; for (var c = 0; b > c; c++)m += parseInt(h.eq(c).width()) + e.slideMargin } return m }, d = { doCss: function () { var a = function () { for (var a = ["transition", "MozTransition", "WebkitTransition", "OTransition", "msTransition", "KhtmlTransition"], b = document.documentElement, c = 0; c < a.length; c++)if (a[c] in b.style) return !0 }; return e.useCSS && a() ? !0 : !1 }, keyPress: function () { e.keyPress && a(document).on("keyup.lightslider", function (b) { a(":focus").is("input, textarea") || (b.preventDefault ? b.preventDefault() : b.returnValue = !1, 37 === b.keyCode ? (g.goToPrevSlide(), clearInterval(x)) : 39 === b.keyCode && (g.goToNextSlide(), clearInterval(x))) }) }, controls: function () { e.controls && (g.after('<div class="lSAction"><a class="lSPrev">' + e.prevHtml + '</a><a class="lSNext">' + e.nextHtml + "</a></div>"), e.autoWidth ? z.calWidth(!1) < o && p.find(".lSAction").hide() : l <= e.item && p.find(".lSAction").hide(), p.find(".lSAction a").on("click", function (b) { return b.preventDefault ? b.preventDefault() : b.returnValue = !1, "lSPrev" === a(this).attr("class") ? g.goToPrevSlide() : g.goToNextSlide(), clearInterval(x), !1 })) }, initialStyle: function () { var a = this; "fade" === e.mode && (e.autoWidth = !1, e.slideEndAnimation = !1), e.auto && (e.slideEndAnimation = !1), e.autoWidth && (e.slideMove = 1, e.item = 1), e.loop && (e.slideMove = 1, e.freeMove = !1), e.onBeforeStart.call(this, g), z.chbreakpoint(), g.addClass("lightSlider").wrap('<div class="lSSlideOuter ' + e.addClass + '"><div class="lSSlideWrapper"></div></div>'), p = g.parent(".lSSlideWrapper"), e.rtl === !0 && p.parent().addClass("lSrtl"), e.vertical ? (p.parent().addClass("vertical"), o = e.verticalHeight, p.css("height", o + "px")) : o = g.outerWidth(), h.addClass("lslide"), e.loop === !0 && "slide" === e.mode && (z.calSW(), z.clone = function () { if (z.calWidth(!0) > o) { for (var b = 0, c = 0, d = 0; d < h.length && (b += parseInt(g.find(".lslide").eq(d).width()) + e.slideMargin, c++ , !(b >= o + e.slideMargin)); d++); var f = e.autoWidth === !0 ? c : e.item; if (f < g.find(".clone.left").length) for (var i = 0; i < g.find(".clone.left").length - f; i++)h.eq(i).remove(); if (f < g.find(".clone.right").length) for (var j = h.length - 1; j > h.length - 1 - g.find(".clone.right").length; j--)q-- , h.eq(j).remove(); for (var k = g.find(".clone.right").length; f > k; k++)g.find(".lslide").eq(k).clone().removeClass("lslide").addClass("clone right").appendTo(g), q++; for (var l = g.find(".lslide").length - g.find(".clone.left").length; l > g.find(".lslide").length - f; l--)g.find(".lslide").eq(l - 1).clone().removeClass("lslide").addClass("clone left").prependTo(g); h = g.children() } else h.hasClass("clone") && (g.find(".clone").remove(), a.move(g, 0)) }, z.clone()), z.sSW = function () { l = h.length, e.rtl === !0 && e.vertical === !1 && (s = "margin-left"), e.autoWidth === !1 && h.css(r, v + "px"), h.css(s, e.slideMargin + "px"), m = z.calWidth(!1), g.css(r, m + "px"), e.loop === !0 && "slide" === e.mode && n === !1 && (q = g.find(".clone.left").length) }, z.calL = function () { h = g.children(), l = h.length }, this.doCss() && p.addClass("usingCss"), z.calL(), "slide" === e.mode ? (z.calSW(), z.sSW(), e.loop === !0 && (t = a.slideValue(), this.move(g, t)), e.vertical === !1 && this.setHeight(g, !1)) : (this.setHeight(g, !0), g.addClass("lSFade"), this.doCss() || (h.fadeOut(0), h.eq(q).fadeIn(0))), e.loop === !0 && "slide" === e.mode ? h.eq(q).addClass("active") : h.first().addClass("active") }, pager: function () { var a = this; if (z.createPager = function () { w = (o - (e.thumbItem * e.thumbMargin - e.thumbMargin)) / e.thumbItem; var b = p.find(".lslide"), c = p.find(".lslide").length, d = 0, f = "", h = 0; for (d = 0; c > d; d++) { "slide" === e.mode && (e.autoWidth ? h += (parseInt(b.eq(d).width()) + e.slideMargin) * e.slideMove : h = d * (v + e.slideMargin) * e.slideMove); var i = b.eq(d * e.slideMove).attr("data-thumb"); if (f += e.gallery === !0 ? '<li style="width:100%;' + r + ":" + w + "px;" + s + ":" + e.thumbMargin + 'px"><a href="#"><img src="' + i + '" /></a></li>' : '<li><a href="#">' + (d + 1) + "</a></li>", "slide" === e.mode && h >= m - o - e.slideMargin) { d += 1; var j = 2; e.autoWidth && (f += '<li><a href="#">' + (d + 1) + "</a></li>", j = 1), j > d ? (f = null, p.parent().addClass("noPager")) : p.parent().removeClass("noPager"); break } } var k = p.parent(); k.find(".lSPager").html(f), e.gallery === !0 && (e.vertical === !0 && k.find(".lSPager").css("width", e.vThumbWidth + "px"), u = d * (e.thumbMargin + w) + .5, k.find(".lSPager").css({ property: u + "px", "transition-duration": e.speed + "ms" }), e.vertical === !0 && p.parent().css("padding-right", e.vThumbWidth + e.galleryMargin + "px"), k.find(".lSPager").css(r, u + "px")); var l = k.find(".lSPager").find("li"); l.first().addClass("active"), l.on("click", function () { return e.loop === !0 && "slide" === e.mode ? q += l.index(this) - k.find(".lSPager").find("li.active").index() : q = l.index(this), g.mode(!1), e.gallery === !0 && a.slideThumb(), clearInterval(x), !1 }) }, e.pager) { var b = "lSpg"; e.gallery && (b = "lSGallery"), p.after('<ul class="lSPager ' + b + '"></ul>'); var c = e.vertical ? "margin-left" : "margin-top"; p.parent().find(".lSPager").css(c, e.galleryMargin + "px"), z.createPager() } setTimeout(function () { z.init() }, 0) }, setHeight: function (a, b) { var c = null, d = this; c = e.loop ? a.children(".lslide ").first() : a.children().first(); var f = function () { var d = c.outerHeight(), e = 0, f = d; b && (d = 0, e = 100 * f / o), a.css({ height: d + "px", "padding-bottom": e + "%" }) }; f(), c.find("img").length ? c.find("img")[0].complete ? (f(), x || d.auto()) : c.find("img").load(function () { setTimeout(function () { f(), x || d.auto() }, 100) }) : x || d.auto() }, active: function (a, b) { this.doCss() && "fade" === e.mode && p.addClass("on"); var c = 0; if (q * e.slideMove < l) { a.removeClass("active"), this.doCss() || "fade" !== e.mode || b !== !1 || a.fadeOut(e.speed), c = b === !0 ? q : q * e.slideMove; var d, f; b === !0 && (d = a.length, f = d - 1, c + 1 >= d && (c = f)), e.loop === !0 && "slide" === e.mode && (c = b === !0 ? q - g.find(".clone.left").length : q * e.slideMove, b === !0 && (d = a.length, f = d - 1, c + 1 === d ? c = f : c + 1 > d && (c = 0))), this.doCss() || "fade" !== e.mode || b !== !1 || a.eq(c).fadeIn(e.speed), a.eq(c).addClass("active") } else a.removeClass("active"), a.eq(a.length - 1).addClass("active"), this.doCss() || "fade" !== e.mode || b !== !1 || (a.fadeOut(e.speed), a.eq(c).fadeIn(e.speed)) }, move: function (a, b) { e.rtl === !0 && (b = -b), this.doCss() ? a.css(e.vertical === !0 ? { transform: "translate3d(0px, " + -b + "px, 0px)", "-webkit-transform": "translate3d(0px, " + -b + "px, 0px)" } : { transform: "translate3d(" + -b + "px, 0px, 0px)", "-webkit-transform": "translate3d(" + -b + "px, 0px, 0px)" }) : e.vertical === !0 ? a.css("position", "relative").animate({ top: -b + "px" }, e.speed, e.easing) : a.css("position", "relative").animate({ left: -b + "px" }, e.speed, e.easing); var c = p.parent().find(".lSPager").find("li"); this.active(c, !0) }, fade: function () { this.active(h, !1); var a = p.parent().find(".lSPager").find("li"); this.active(a, !0) }, slide: function () { var a = this; z.calSlide = function () { m > o && (t = a.slideValue(), a.active(h, !1), t > m - o - e.slideMargin ? t = m - o - e.slideMargin : 0 > t && (t = 0), a.move(g, t), e.loop === !0 && "slide" === e.mode && (q >= l - g.find(".clone.left").length / e.slideMove && a.resetSlide(g.find(".clone.left").length), 0 === q && a.resetSlide(p.find(".lslide").length))) }, z.calSlide() }, resetSlide: function (a) { var b = this; p.find(".lSAction a").addClass("disabled"), setTimeout(function () { q = a, p.css("transition-duration", "0ms"), t = b.slideValue(), b.active(h, !1), d.move(g, t), setTimeout(function () { p.css("transition-duration", e.speed + "ms"), p.find(".lSAction a").removeClass("disabled") }, 50) }, e.speed + 100) }, slideValue: function () { var a = 0; if (e.autoWidth === !1) a = q * (v + e.slideMargin) * e.slideMove; else { a = 0; for (var b = 0; q > b; b++)a += parseInt(h.eq(b).width()) + e.slideMargin } return a }, slideThumb: function () { var a; switch (e.currentPagerPosition) { case "left": a = 0; break; case "middle": a = o / 2 - w / 2; break; case "right": a = o - w }var b = q - g.find(".clone.left").length, c = p.parent().find(".lSPager"); "slide" === e.mode && e.loop === !0 && (b >= c.children().length ? b = 0 : 0 > b && (b = c.children().length)); var d = b * (w + e.thumbMargin) - a; d + o > u && (d = u - o - e.thumbMargin), 0 > d && (d = 0), this.move(c, d) }, auto: function () { e.auto && (x = setInterval(function () { g.goToNextSlide() }, e.pause)) }, touchMove: function (a, b) { if (p.css("transition-duration", "0ms"), "slide" === e.mode) { var c = a - b, d = t - c; if (d >= m - o - e.slideMargin) if (e.freeMove === !1) d = m - o - e.slideMargin; else { var f = m - o - e.slideMargin; d = f + (d - f) / 5 } else 0 > d && (e.freeMove === !1 ? d = 0 : d /= 5); this.move(g, d) } }, touchEnd: function (a) { if (p.css("transition-duration", e.speed + "ms"), clearInterval(x), "slide" === e.mode) { var b = !1, c = !0; t -= a, t > m - o - e.slideMargin ? (t = m - o - e.slideMargin, e.autoWidth === !1 && (b = !0)) : 0 > t && (t = 0); var d = function (a) { var c = 0; if (b || a && (c = 1), e.autoWidth) for (var d = 0, f = 0; f < h.length && (d += parseInt(h.eq(f).width()) + e.slideMargin, q = f + c, !(d >= t)); f++); else { var g = t / ((v + e.slideMargin) * e.slideMove); q = parseInt(g) + c, t >= m - o - e.slideMargin && g % 1 !== 0 && q++ } }; a >= e.swipeThreshold ? (d(!1), c = !1) : a <= -e.swipeThreshold && (d(!0), c = !1), g.mode(c), this.slideThumb() } else a >= e.swipeThreshold ? g.goToPrevSlide() : a <= -e.swipeThreshold && g.goToNextSlide() }, enableDrag: function () { var b = this; if (!y) { var c = 0, d = 0, f = !1; p.find(".lightSlider").addClass("lsGrab"), p.on("mousedown", function (b) { return o > m && 0 !== m ? !1 : void ("lSPrev" !== a(b.target).attr("class") && "lSNext" !== a(b.target).attr("class") && (c = e.vertical === !0 ? b.pageY : b.pageX, f = !0, b.preventDefault ? b.preventDefault() : b.returnValue = !1, p.scrollLeft += 1, p.scrollLeft -= 1, p.find(".lightSlider").removeClass("lsGrab").addClass("lsGrabbing"), clearInterval(x))) }), a(window).on("mousemove", function (a) { f && (d = e.vertical === !0 ? a.pageY : a.pageX, b.touchMove(d, c)) }), a(window).on("mouseup", function (g) { if (f) { p.find(".lightSlider").removeClass("lsGrabbing").addClass("lsGrab"), f = !1, d = e.vertical === !0 ? g.pageY : g.pageX; var h = d - c; Math.abs(h) >= e.swipeThreshold && a(window).on("click.ls", function (b) { b.preventDefault ? b.preventDefault() : b.returnValue = !1, b.stopImmediatePropagation(), b.stopPropagation(), a(window).off("click.ls") }), b.touchEnd(h) } }) } }, enableTouch: function () { var a = this; if (y) { var b = {}, c = {}; p.on("touchstart", function (a) { c = a.originalEvent.targetTouches[0], b.pageX = a.originalEvent.targetTouches[0].pageX, b.pageY = a.originalEvent.targetTouches[0].pageY, clearInterval(x) }), p.on("touchmove", function (d) { if (o > m && 0 !== m) return !1; var f = d.originalEvent; c = f.targetTouches[0]; var g = Math.abs(c.pageX - b.pageX), h = Math.abs(c.pageY - b.pageY); e.vertical === !0 ? (3 * h > g && d.preventDefault(), a.touchMove(c.pageY, b.pageY)) : (3 * g > h && d.preventDefault(), a.touchMove(c.pageX, b.pageX)) }), p.on("touchend", function () { if (o > m && 0 !== m) return !1; var d; d = e.vertical === !0 ? c.pageY - b.pageY : c.pageX - b.pageX, a.touchEnd(d) }) } }, build: function () { var a = this; a.initialStyle(), this.doCss() && (e.enableTouch === !0 && a.enableTouch(), e.enableDrag === !0 && a.enableDrag()), a.pager(), a.controls(), a.keyPress() } }, d.build(), z.init = function () { z.chbreakpoint(), e.vertical === !0 ? (o = e.item > 1 ? e.verticalHeight : h.outerHeight(), p.css("height", o + "px")) : o = p.outerWidth(), e.loop === !0 && "slide" === e.mode && z.clone(), z.calL(), "slide" === e.mode && g.removeClass("lSSlide"), "slide" === e.mode && (z.calSW(), z.sSW()), setTimeout(function () { "slide" === e.mode && g.addClass("lSSlide") }, 1e3), e.pager && z.createPager(), e.adaptiveHeight === !0 && e.vertical === !1 && g.css("height", h.eq(q).outerHeight(!0)), e.adaptiveHeight === !1 && ("slide" === e.mode ? e.vertical === !1 ? d.setHeight(g, !1) : d.auto() : d.setHeight(g, !0)), e.gallery === !0 && d.slideThumb(), "slide" === e.mode && d.slide(), e.autoWidth === !1 ? h.length <= e.item ? p.find(".lSAction").hide() : p.find(".lSAction").show() : z.calWidth(!1) < o && 0 !== m ? p.find(".lSAction").hide() : p.find(".lSAction").show() }, g.goToPrevSlide = function () { if (q > 0) e.onBeforePrevSlide.call(this, g, q), q-- , g.mode(!1), e.gallery === !0 && d.slideThumb(); else if (e.loop === !0) { if (e.onBeforePrevSlide.call(this, g, q), "fade" === e.mode) { var a = l - 1; q = parseInt(a / e.slideMove) } g.mode(!1), e.gallery === !0 && d.slideThumb() } else e.slideEndAnimation === !0 && (g.addClass("leftEnd"), setTimeout(function () { g.removeClass("leftEnd") }, 400)) }, g.goToNextSlide = function () { var a = !0; if ("slide" === e.mode) { var b = d.slideValue(); a = b < m - o - e.slideMargin } q * e.slideMove < l - e.slideMove && a ? (e.onBeforeNextSlide.call(this, g, q), q++ , g.mode(!1), e.gallery === !0 && d.slideThumb()) : e.loop === !0 ? (e.onBeforeNextSlide.call(this, g, q), q = 0, g.mode(!1), e.gallery === !0 && d.slideThumb()) : e.slideEndAnimation === !0 && (g.addClass("rightEnd"), setTimeout(function () { g.removeClass("rightEnd") }, 400)) }, g.mode = function (a) { e.adaptiveHeight === !0 && e.vertical === !1 && g.css("height", h.eq(q).outerHeight(!0)), n === !1 && ("slide" === e.mode ? d.doCss() && (g.addClass("lSSlide"), "" !== e.speed && p.css("transition-duration", e.speed + "ms"), "" !== e.cssEasing && p.css("transition-timing-function", e.cssEasing)) : d.doCss() && ("" !== e.speed && g.css("transition-duration", e.speed + "ms"), "" !== e.cssEasing && g.css("transition-timing-function", e.cssEasing))), a || e.onBeforeSlide.call(this, g, q), "slide" === e.mode ? d.slide() : d.fade(), setTimeout(function () { a || e.onAfterSlide.call(this, g, q) }, e.speed), n = !0 }, g.play = function () { clearInterval(x), g.goToNextSlide(), x = setInterval(function () { g.goToNextSlide() }, e.pause) }, g.pause = function () { clearInterval(x) }, g.refresh = function () { z.init() }, g.getCurrentSlideCount = function () { var a = q; if (e.loop) { var b = p.find(".lslide").length, c = g.find(".clone.left").length; a = c - 1 >= q ? b + (q - c) : q >= b + c ? q - b - c : q - c } return a + 1 }, g.getTotalSlideCount = function () { return p.find(".lslide").length }, g.goToSlide = function (a) { q = e.loop ? a + g.find(".clone.left").length - 1 : a, g.mode(!1), e.gallery === !0 && d.slideThumb() }, setTimeout(function () { e.onSliderLoad.call(this, g) }, 10), a(window).on("resize orientationchange", function (a) { setTimeout(function () { a.preventDefault ? a.preventDefault() : a.returnValue = !1, z.init() }, 200) }), this } }(jQuery);
// Sticky Plugin v1.0.0 for jQuery
// =============
// Author: Anthony Garand
// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
// Improvements by Leonardo C. Daronco (daronco)
// Created: 2/14/2011
// Date: 2/12/2012
// Website: http://labs.anthonygarand.com/sticky
// Description: Makes an element on the page stick on the screen as you scroll
//       It will only set the 'top' and 'position' of your element, you
//       might need to adjust the width in some cases.
/// <reference path="../jquery/js.cookie.js" />
(function ($) {
  var defaults = {
    topSpacing: 0,
    bottomSpacing: 0,
    className: 'is-sticky',
    wrapperClassName: 'sticky-wrapper',
    center: false,
    getWidthFrom: '',
    responsiveWidth: false
  },
    $window = $(window),
    $document = $(document),
    sticked = [],
    windowHeight = $window.height(),
    scroller = function () {
      var scrollTop = $window.scrollTop(),
        documentHeight = $document.height(),
        dwh = documentHeight - windowHeight,
        extra = (scrollTop > dwh) ? dwh - scrollTop : 0;

      for (var i = 0; i < sticked.length; i++) {
        var s = sticked[i],
          elementTop = s.stickyWrapper.offset().top,
          etse = elementTop - s.topSpacing - extra;

        if (scrollTop <= etse) {
          if (s.currentTop !== null) {
            s.stickyElement
              .css('width', '')
              .css('position', '')
              .css('top', '');
            s.stickyElement.trigger('sticky-end', [s]).parent().removeClass(s.className);
            s.currentTop = null;
          }
        }
        else {
          var newTop = documentHeight - s.stickyElement.outerHeight()
            - s.topSpacing - s.bottomSpacing - scrollTop - extra;
          if (newTop < 0) {
            newTop = newTop + s.topSpacing;
          } else {
            newTop = s.topSpacing;
          }
          if (s.currentTop != newTop) {
            s.stickyElement
              .css('width', s.stickyElement.width())
              .css('position', 'fixed')
              .css('top', newTop);

            if (typeof s.getWidthFrom !== 'undefined') {
              s.stickyElement.css('width', $(s.getWidthFrom).width());
            }

            s.stickyElement.trigger('sticky-start', [s]).parent().addClass(s.className);
            s.currentTop = newTop;
          }
        }
      }
    },
    resizer = function () {
      windowHeight = $window.height();

      for (var i = 0; i < sticked.length; i++) {
        var s = sticked[i];
        if (typeof s.getWidthFrom !== 'undefined' && s.responsiveWidth === true) {
          s.stickyElement.css('width', $(s.getWidthFrom).width());
        }
      }
    },
    methods = {
      init: function (options) {
        var o = $.extend({}, defaults, options);
        return this.each(function () {
          var stickyElement = $(this);

          var stickyId = stickyElement.attr('id');
          var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName
          var wrapper = $('<div></div>')
            .attr('id', stickyId + '-sticky-wrapper')
            .addClass(o.wrapperClassName);
          stickyElement.wrapAll(wrapper);

          if (o.center) {
            stickyElement.parent().css({ width: stickyElement.outerWidth(), marginLeft: "auto", marginRight: "auto" });
          }

          if (stickyElement.css("float") == "right") {
            stickyElement.css({ "float": "none" }).parent().css({ "float": "right" });
          }

          var stickyWrapper = stickyElement.parent();
          stickyWrapper.css('height', stickyElement.outerHeight());
          sticked.push({
            topSpacing: o.topSpacing,
            bottomSpacing: o.bottomSpacing,
            stickyElement: stickyElement,
            currentTop: null,
            stickyWrapper: stickyWrapper,
            className: o.className,
            getWidthFrom: o.getWidthFrom,
            responsiveWidth: o.responsiveWidth
          });
        });
      },
      update: scroller,
      unstick: function (options) {
        return this.each(function () {
          var unstickyElement = $(this);

          var removeIdx = -1;
          for (var i = 0; i < sticked.length; i++) {
            if (sticked[i].stickyElement.get(0) == unstickyElement.get(0)) {
              removeIdx = i;
            }
          }
          if (removeIdx != -1) {
            sticked.splice(removeIdx, 1);
            unstickyElement.unwrap();
            unstickyElement.removeAttr('style');
          }
        });
      }
    };

  // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
  if (window.addEventListener) {
    window.addEventListener('scroll', scroller, false);
    window.addEventListener('resize', resizer, false);
  } else if (window.attachEvent) {
    window.attachEvent('onscroll', scroller);
    window.attachEvent('onresize', resizer);
  }

  $.fn.sticky = function (method) {
    if (methods[method]) {
      return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
    } else if (typeof method === 'object' || !method) {
      return methods.init.apply(this, arguments);
    } else {
      $.error('Method ' + method + ' does not exist on jQuery.sticky');
    }
  };

  $.fn.unstick = function (method) {
    if (methods[method]) {
      return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
    } else if (typeof method === 'object' || !method) {
      return methods.unstick.apply(this, arguments);
    } else {
      $.error('Method ' + method + ' does not exist on jQuery.sticky');
    }

  };
  $(function () {
    setTimeout(scroller, 0);
  });
})(jQuery);


$(document).ready(function () {

  //start: CHIUSURA MEGAMENU scroll

  var ClassMegaMenu = $("#megaMenu").attr('class');

  $(document).scroll(function (e) {

    checkChangeMenuposition(ClassMegaMenu);
    ClassMegaMenu = $("#megaMenu").attr('class');
  });


  function checkChangeMenuposition(oldPosition) {

    var newposition = $("#megaMenu").attr('class');

    if (oldPosition !== newposition) {
      if ($("#megaMenuProdotti").hasClass("open")) {
        $("#megaMenuProdotti").removeClass("open");
        $('#prodsSubMenu').hide();
      }

      if ($("#megaMenuNegozi").hasClass("open")) {
        $("#megaMenuNegozi").removeClass("open");
        $('#shopsSubMenu').hide();
      }

      if ($("#megaMenuOutlet").hasClass("open")) {
        $("#megaMenuOutlet").removeClass("open");
        $('#outletSubMenu').hide();
      }
    }

  }

  //start: CHIUSURA MEGAMENU Outside Click

  $(document).click(function (e) {

    if (!$(e.target).is('a')) {

      console.log(e.target.title);
      // CHIUSURA outside click megaMenuProdotti
      if (e.target.title !== "ElencoProdotti") {
        if ($("#megaMenuProdotti").hasClass("open")) {
          $("#megaMenuProdotti").removeClass("open");
          $('#prodsSubMenu').hide();
        }
      }

      // CHIUSURA outside click megaMenuNegozi
      if (e.target.title !== "negozi") {
        if ($("#megaMenuNegozi").hasClass("open")) {
          $("#megaMenuNegozi").removeClass("open");
          $('#shopsSubMenu').hide();
        }
      }

      // CHIUSURA outside click megaMenuOutlet
      if (e.target.title !== "header_outlet") {
        if ($("#megaMenuOutlet").hasClass("open")) {
          $("#megaMenuOutlet").removeClass("open");
          $('#outletSubMenu').hide();
        }
      }

    }
  });
  //end: CHIUSURA MEGAMENU Outside Click
});



/*
     _ _      _       _
 ___| (_) ___| | __  (_)___
/ __| | |/ __| |/ /  | / __|
\__ \ | | (__|   < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
                   |__/

 Version: 1.5.8
  Author: Ken Wheeler
 Website: http://kenwheeler.github.io
    Docs: http://kenwheeler.github.io/slick
    Repo: http://github.com/kenwheeler/slick
  Issues: http://github.com/kenwheeler/slick/issues

 */
//!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(a,b){return'<button type="button" data-role="none" role="button" aria-required="false" tabindex="0">'+(b+1)+"</button>"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.hidden="hidden",e.paused=!1,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,f,d),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0),e.checkResponsive(!0)}var b=0;return c}(),b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),d[e.animType]=e.options.vertical===!1?"translate3d("+b+"px, 0px, 0px)":"translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.asNavFor=function(b){var c=this,d=c.options.asNavFor;d&&null!==d&&(d=a(d).not(c.$slider)),null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};c[b.transitionType]=b.options.fade===!1?b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:"opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.slideCount>a.options.slidesToShow&&a.paused!==!0&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(0===a.currentSlide-1&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='<ul class="'+b.options.dotsClass+'">',c=0;c<=b.getDotCount();c+=1)d+="<li>"+b.options.customPaging.call(this,b,c)+"</li>";d+="</ul>",b.$dots=a(d).appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slidesCache=b.$slides,b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('<div class="slick-track"/>').appendTo(b.$slider):b.$slides.wrapAll('<div class="slick-track"/>').parent(),b.$list=b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;c<a.options.rows;c++){var j=document.createElement("div");for(d=0;d<a.options.slidesPerRow;d++){var k=b*h+(c*a.options.slidesPerRow+d);g.get(k)&&j.appendChild(g.get(k))}i.appendChild(j)}e.appendChild(i)}a.$slider.html(e),a.$slider.children().children().children().css({width:100/a.options.slidesPerRow+"%",display:"inline-block"})}},b.prototype.checkResponsive=function(b,c){var e,f,g,d=this,h=!1,i=d.$slider.width(),j=window.innerWidth||a(window).width();if("window"===d.respondTo?g=j:"slider"===d.respondTo?g=i:"min"===d.respondTo&&(g=Math.min(j,i)),d.options.responsive&&d.options.responsive.length&&null!==d.options.responsive){f=null;for(e in d.breakpoints)d.breakpoints.hasOwnProperty(e)&&(d.originalSettings.mobileFirst===!1?g<d.breakpoints[e]&&(f=d.breakpoints[e]):g>d.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.target);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=0!==d.slideCount%d.options.slidesToScroll,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(a<c[e]){a=d;break}d=c[e]}return a},b.prototype.cleanUpEvents=function(){var b=this;b.options.dots&&null!==b.$dots&&(a("li",b.$dots).off("click.slick",b.changeSlide),b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).off("mouseenter.slick",a.proxy(b.setPaused,b,!0)).off("mouseleave.slick",a.proxy(b.setPaused,b,!1))),b.options.arrows===!0&&b.slideCount>b.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.$list.off("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.html(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.$prevArrow&&c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow&&c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove()),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;b<a.slideCount;)++d,b=c+a.options.slidesToShow,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;else if(a.options.centerMode===!0)d=a.slideCount;else for(;b<a.slideCount;)++d,b=c+a.options.slidesToShow,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d-1},b.prototype.getLeft=function(a){var c,d,f,b=this,e=0;return b.slideOffset=0,d=b.$slides.first().outerHeight(!0),b.options.infinite===!0?(b.slideCount>b.options.slidesToShow&&(b.slideOffset=-1*b.slideWidth*b.options.slidesToShow,e=-1*d*b.options.slidesToShow),0!==b.slideCount%b.options.slidesToScroll&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=-1*(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth,e=-1*(b.options.slidesToShow-(a-b.slideCount))*d):(b.slideOffset=-1*b.slideCount%b.options.slidesToScroll*b.slideWidth,e=-1*b.slideCount%b.options.slidesToScroll*d))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?-1*a*b.slideWidth+b.slideOffset:-1*a*d+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.setPaused,b,!0)).on("mouseleave.slick",a.proxy(b.setPaused,b,!1))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.$list.on("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.on("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:"next"}}))},b.prototype.lazyLoad=function(){function g(b){a("img[data-lazy]",b).each(function(){var b=a(this),c=a(this).attr("data-lazy"),d=document.createElement("img");d.onload=function(){b.animate({opacity:0},100,function(){b.attr("src",c).animate({opacity:1},200,function(){b.removeAttr("data-lazy").removeClass("slick-loading")})})},d.src=c})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=e+b.options.slidesToShow,b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.paused=!1,a.autoPlay()},b.prototype.postSlide=function(a){var b=this;b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay===!0&&b.paused===!1&&b.autoPlay(),b.options.accessibility===!0&&b.initADA()},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(){var c,d,b=this;c=a("img[data-lazy]",b.$slider).length,c>0&&(d=a("img[data-lazy]",b.$slider).first(),d.attr("src",d.attr("data-lazy")).removeClass("slick-loading").load(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad(),b.options.adaptiveHeight===!0&&b.setPosition()}).error(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad()}))},b.prototype.refresh=function(b){var c=this,d=c.currentSlide;c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses(0),b.setPosition(),b.$slider.trigger("reInit",[b]),b.options.autoplay===!0&&b.focusHandler()},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,d.reinit(),void 0)},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=-1*b.slideWidth*d,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(b,c,d){var f,g,e=this;if("responsive"===b&&"array"===a.type(c))for(g in c)if("array"!==a.type(e.options.responsive))e.options.responsive=[c[g]];else{for(f=e.options.responsive.length-1;f>=0;)e.options.responsive[f].breakpoint===c[g].breakpoint&&e.options.responsive.splice(f,1),f--;e.options.responsive.push(c[g])}else e.options[b]=c;d===!0&&(e.unload(),e.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-a<b.options.slidesToShow?d.slice(e-(b.options.slidesToShow-f),e+f).addClass("slick-active").attr("aria-hidden","false"):d.slice(e,e+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===b.options.lazyLoad&&b.lazyLoad()},b.prototype.setupInfinite=function(){var c,d,e,b=this;if(b.options.fade===!0&&(b.options.centerMode=!1),b.options.infinite===!0&&b.options.fade===!1&&(d=null,b.slideCount>b.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.setPaused=function(a){var b=this;b.options.autoplay===!0&&b.options.pauseOnHover===!0&&(b.paused=a,a?b.autoPlayClear():b.autoPlay())},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),c.asNavFor(e),void 0):(c.slideHandler(e),void 0)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d)),void 0):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d)),void 0):(i.options.autoplay===!0&&clearInterval(i.autoPlayTimer),e=0>d?0!==i.slideCount%i.options.slidesToScroll?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?0!==i.slideCount%i.options.slidesToScroll?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e)
//})):i.postSlide(e),i.animateHeight(),void 0):(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e),void 0)))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"left":"right":"vertical"},b.prototype.swipeEnd=function(){var c,b=this;if(b.dragging=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.slideHandler(c),b.currentDirection=0,b.touchObject={},b.$slider.trigger("swipe",[b,"left"]);break;case"right":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.slideHandler(c),b.currentDirection=1,b.touchObject={},b.$slider.trigger("swipe",[b,"right"])}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.swipeLeft=b.options.vertical===!1?d+f*g:d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):(b.setCSS(b.swipeLeft),void 0)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return 1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,b.dragging=!0,void 0)},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;document[a.hidden]?(a.paused=!0,a.autoPlayClear()):a.options.autoplay===!0&&(a.paused=!1,a.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.activateADA=function(){var a=this,b=a.$slider.find("*").is(":focus");a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false",tabindex:"0"}).find("a, input, button, select").attr({tabindex:"0"}),b&&a.$slideTrack.find(".slick-active").focus()},b.prototype.focusHandler=function(){var b=this;b.$slider.on("focus.slick blur.slick","*",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.isPlay&&(d.is(":focus")?(b.autoPlayClear(),b.paused=!0):(b.paused=!1,b.autoPlay()))},0)})},a.fn.slick=function(){var g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length,f=0;for(f;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}});
/*!
 * Bootstrap-select v1.7.5 (http://silviomoreto.github.io/bootstrap-select)
 *
 * Copyright 2013-2015 bootstrap-select
 * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
 */
!function (a, b) { "function" == typeof define && define.amd ? define(["jquery"], function (a) { return b(a) }) : "object" == typeof exports ? module.exports = b(require("jquery")) : b(jQuery) }(this, function (a) { !function (a) { "use strict"; function b(b) { var c = [{ re: /[\xC0-\xC6]/g, ch: "A" }, { re: /[\xE0-\xE6]/g, ch: "a" }, { re: /[\xC8-\xCB]/g, ch: "E" }, { re: /[\xE8-\xEB]/g, ch: "e" }, { re: /[\xCC-\xCF]/g, ch: "I" }, { re: /[\xEC-\xEF]/g, ch: "i" }, { re: /[\xD2-\xD6]/g, ch: "O" }, { re: /[\xF2-\xF6]/g, ch: "o" }, { re: /[\xD9-\xDC]/g, ch: "U" }, { re: /[\xF9-\xFC]/g, ch: "u" }, { re: /[\xC7-\xE7]/g, ch: "c" }, { re: /[\xD1]/g, ch: "N" }, { re: /[\xF1]/g, ch: "n" }]; return a.each(c, function () { b = b.replace(this.re, this.ch) }), b } function c(a) { var b = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#x27;", "`": "&#x60;" }, c = "(?:" + Object.keys(b).join("|") + ")", d = new RegExp(c), e = new RegExp(c, "g"), f = null == a ? "" : "" + a; return d.test(f) ? f.replace(e, function (a) { return b[a] }) : f } function d(b, c) { var d = arguments, f = b, g = c;[].shift.apply(d); var h, i = this.each(function () { var b = a(this); if (b.is("select")) { var c = b.data("selectpicker"), i = "object" == typeof f && f; if (c) { if (i) for (var j in i) i.hasOwnProperty(j) && (c.options[j] = i[j]) } else { var k = a.extend({}, e.DEFAULTS, a.fn.selectpicker.defaults || {}, b.data(), i); k.template = a.extend({}, e.DEFAULTS.template, a.fn.selectpicker.defaults ? a.fn.selectpicker.defaults.template : {}, b.data().template, i.template), b.data("selectpicker", c = new e(this, k, g)) } "string" == typeof f && (h = c[f] instanceof Function ? c[f].apply(c, d) : c.options[f]) } }); return "undefined" != typeof h ? h : i } String.prototype.includes || !function () { var a = {}.toString, b = function () { try { var a = {}, b = Object.defineProperty, c = b(a, a, a) && b } catch (d) { } return c }(), c = "".indexOf, d = function (b) { if (null == this) throw new TypeError; var d = String(this); if (b && "[object RegExp]" == a.call(b)) throw new TypeError; var e = d.length, f = String(b), g = f.length, h = arguments.length > 1 ? arguments[1] : void 0, i = h ? Number(h) : 0; i != i && (i = 0); var j = Math.min(Math.max(i, 0), e); return g + j > e ? !1 : -1 != c.call(d, f, i) }; b ? b(String.prototype, "includes", { value: d, configurable: !0, writable: !0 }) : String.prototype.includes = d }(), String.prototype.startsWith || !function () { var a = function () { try { var a = {}, b = Object.defineProperty, c = b(a, a, a) && b } catch (d) { } return c }(), b = {}.toString, c = function (a) { if (null == this) throw new TypeError; var c = String(this); if (a && "[object RegExp]" == b.call(a)) throw new TypeError; var d = c.length, e = String(a), f = e.length, g = arguments.length > 1 ? arguments[1] : void 0, h = g ? Number(g) : 0; h != h && (h = 0); var i = Math.min(Math.max(h, 0), d); if (f + i > d) return !1; for (var j = -1; ++j < f;)if (c.charCodeAt(i + j) != e.charCodeAt(j)) return !1; return !0 }; a ? a(String.prototype, "startsWith", { value: c, configurable: !0, writable: !0 }) : String.prototype.startsWith = c }(), Object.keys || (Object.keys = function (a, b, c) { c = []; for (b in a) c.hasOwnProperty.call(a, b) && c.push(b); return c }), a.fn.triggerNative = function (a) { var b, c = this[0]; c.dispatchEvent ? ("function" == typeof Event ? b = new Event(a, { bubbles: !0 }) : (b = document.createEvent("Event"), b.initEvent(a, !0, !1)), c.dispatchEvent(b)) : (c.fireEvent && (b = document.createEventObject(), b.eventType = a, c.fireEvent("on" + a, b)), this.trigger(a)) }, a.expr[":"].icontains = function (b, c, d) { var e = a(b), f = (e.data("tokens") || e.text()).toUpperCase(); return f.includes(d[3].toUpperCase()) }, a.expr[":"].ibegins = function (b, c, d) { var e = a(b), f = (e.data("tokens") || e.text()).toUpperCase(); return f.startsWith(d[3].toUpperCase()) }, a.expr[":"].aicontains = function (b, c, d) { var e = a(b), f = (e.data("tokens") || e.data("normalizedText") || e.text()).toUpperCase(); return f.includes(d[3].toUpperCase()) }, a.expr[":"].aibegins = function (b, c, d) { var e = a(b), f = (e.data("tokens") || e.data("normalizedText") || e.text()).toUpperCase(); return f.startsWith(d[3].toUpperCase()) }; var e = function (b, c, d) { d && (d.stopPropagation(), d.preventDefault()), this.$element = a(b), this.$newElement = null, this.$button = null, this.$menu = null, this.$lis = null, this.options = c, null === this.options.title && (this.options.title = this.$element.attr("title")), this.val = e.prototype.val, this.render = e.prototype.render, this.refresh = e.prototype.refresh, this.setStyle = e.prototype.setStyle, this.selectAll = e.prototype.selectAll, this.deselectAll = e.prototype.deselectAll, this.destroy = e.prototype.remove, this.remove = e.prototype.remove, this.show = e.prototype.show, this.hide = e.prototype.hide, this.init() }; e.VERSION = "1.7.5", e.DEFAULTS = { noneSelectedText: "Nothing selected", noneResultsText: "No results matched {0}", countSelectedText: function (a, b) { return 1 == a ? "{0} item selected" : "{0} items selected" }, maxOptionsText: function (a, b) { return [1 == a ? "Limit reached ({n} item max)" : "Limit reached ({n} items max)", 1 == b ? "Group limit reached ({n} item max)" : "Group limit reached ({n} items max)"] }, selectAllText: "Select All", deselectAllText: "Deselect All", doneButton: !1, doneButtonText: "Close", multipleSeparator: ", ", styleBase: "btn", style: "btn-default", size: "auto", title: null, selectedTextFormat: "values", width: !1, container: !1, hideDisabled: !1, showSubtext: !1, showIcon: !0, showContent: !0, dropupAuto: !0, header: !1, liveSearch: !1, liveSearchPlaceholder: null, liveSearchNormalize: !1, liveSearchStyle: "contains", actionsBox: !1, iconBase: "glyphicon", tickIcon: "glyphicon-ok", template: { caret: '<span class="caret"></span>' }, maxOptions: !1, mobile: !1, selectOnTab: !1, dropdownAlignRight: !1 }, e.prototype = { constructor: e, init: function () { var b = this, c = this.$element.attr("id"); this.$element.addClass("bs-select-hidden"), this.liObj = {}, this.multiple = this.$element.prop("multiple"), this.autofocus = this.$element.prop("autofocus"), this.$newElement = this.createView(), this.$element.after(this.$newElement), this.$button = this.$newElement.children("button"), this.$menu = this.$newElement.children(".dropdown-menu"), this.$menuInner = this.$menu.children(".inner"), this.$searchbox = this.$menu.find("input"), this.options.dropdownAlignRight && this.$menu.addClass("dropdown-menu-right"), "undefined" != typeof c && (this.$button.attr("data-id", c), a('label[for="' + c + '"]').click(function (a) { a.preventDefault(), b.$button.focus() })), this.checkDisabled(), this.clickListener(), this.options.liveSearch && this.liveSearchListener(), this.render(), this.setStyle(), this.setWidth(), this.options.container && this.selectPosition(), this.$menu.data("this", this), this.$newElement.data("this", this), this.options.mobile && this.mobile(), this.$newElement.on({ "hide.bs.dropdown": function (a) { b.$element.trigger("hide.bs.select", a) }, "hidden.bs.dropdown": function (a) { b.$element.trigger("hidden.bs.select", a) }, "show.bs.dropdown": function (a) { b.$element.trigger("show.bs.select", a) }, "shown.bs.dropdown": function (a) { b.$element.trigger("shown.bs.select", a) } }), setTimeout(function () { b.$element.trigger("loaded.bs.select") }) }, createDropdown: function () { var b = this.multiple ? " show-tick" : "", d = this.$element.parent().hasClass("input-group") ? " input-group-btn" : "", e = this.autofocus ? " autofocus" : "", f = this.options.header ? '<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;</button>' + this.options.header + "</div>" : "", g = this.options.liveSearch ? '<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"' + (null === this.options.liveSearchPlaceholder ? "" : ' placeholder="' + c(this.options.liveSearchPlaceholder) + '"') + "></div>" : "", h = this.multiple && this.options.actionsBox ? '<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn btn-default">' + this.options.selectAllText + '</button><button type="button" class="actions-btn bs-deselect-all btn btn-default">' + this.options.deselectAllText + "</button></div></div>" : "", i = this.multiple && this.options.doneButton ? '<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm btn-default">' + this.options.doneButtonText + "</button></div></div>" : "", j = '<div class="btn-group bootstrap-select' + b + d + '"><button type="button" class="' + this.options.styleBase + ' dropdown-toggle" data-toggle="dropdown"' + e + '><span class="filter-option pull-left"></span>&nbsp;<span class="bs-caret">' + this.options.template.caret + '</span></button><div class="dropdown-menu open">' + f + g + h + '<ul class="dropdown-menu inner" role="menu"></ul>' + i + "</div></div>"; return a(j) }, createView: function () { var a = this.createDropdown(), b = this.createLi(); return a.find("ul")[0].innerHTML = b, a }, reloadLi: function () { this.destroyLi(); var a = this.createLi(); this.$menuInner[0].innerHTML = a }, destroyLi: function () { this.$menu.find("li").remove() }, createLi: function () { var d = this, e = [], f = 0, g = document.createElement("option"), h = -1, i = function (a, b, c, d) { return "<li" + ("undefined" != typeof c & "" !== c ? ' class="' + c + '"' : "") + ("undefined" != typeof b & null !== b ? ' data-original-index="' + b + '"' : "") + ("undefined" != typeof d & null !== d ? 'data-optgroup="' + d + '"' : "") + ">" + a + "</li>" }, j = function (a, e, f, g) { return '<a tabindex="0"' + ("undefined" != typeof e ? ' class="' + e + '"' : "") + ("undefined" != typeof f ? ' style="' + f + '"' : "") + (d.options.liveSearchNormalize ? ' data-normalized-text="' + b(c(a)) + '"' : "") + ("undefined" != typeof g || null !== g ? ' data-tokens="' + g + '"' : "") + ">" + a + '<span class="' + d.options.iconBase + " " + d.options.tickIcon + ' check-mark"></span></a>' }; if (this.options.title && !this.multiple && (h-- , !this.$element.find(".bs-title-option").length)) { var k = this.$element[0]; g.className = "bs-title-option", g.appendChild(document.createTextNode(this.options.title)), g.value = "", k.insertBefore(g, k.firstChild), void 0 === a(k.options[k.selectedIndex]).attr("selected") && (g.selected = !0) } return this.$element.find("option").each(function (b) { var c = a(this); if (h++ , !c.hasClass("bs-title-option")) { var g = this.className || "", k = this.style.cssText, l = c.data("content") ? c.data("content") : c.html(), m = c.data("tokens") ? c.data("tokens") : null, n = "undefined" != typeof c.data("subtext") ? '<small class="text-muted">' + c.data("subtext") + "</small>" : "", o = "undefined" != typeof c.data("icon") ? '<span class="' + d.options.iconBase + " " + c.data("icon") + '"></span> ' : "", p = this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled; if ("" !== o && p && (o = "<span>" + o + "</span>"), d.options.hideDisabled && p) return void h--; if (c.data("content") || (l = o + '<span class="text">' + l + n + "</span>"), "OPTGROUP" === this.parentNode.tagName && c.data("divider") !== !0) { var q = " " + this.parentNode.className || ""; if (0 === c.index()) { f += 1; var r = this.parentNode.label, s = "undefined" != typeof c.parent().data("subtext") ? '<small class="text-muted">' + c.parent().data("subtext") + "</small>" : "", t = c.parent().data("icon") ? '<span class="' + d.options.iconBase + " " + c.parent().data("icon") + '"></span> ' : ""; r = t + '<span class="text">' + r + s + "</span>", 0 !== b && e.length > 0 && (h++ , e.push(i("", null, "divider", f + "div"))), h++ , e.push(i(r, null, "dropdown-header" + q, f)) } e.push(i(j(l, "opt " + g + q, k, m), b, "", f)) } else c.data("divider") === !0 ? e.push(i("", b, "divider")) : c.data("hidden") === !0 ? e.push(i(j(l, g, k, m), b, "hidden is-hidden")) : (this.previousElementSibling && "OPTGROUP" === this.previousElementSibling.tagName && (h++ , e.push(i("", null, "divider", f + "div"))), e.push(i(j(l, g, k, m), b))); d.liObj[b] = h } }), this.multiple || 0 !== this.$element.find("option:selected").length || this.options.title || this.$element.find("option").eq(0).prop("selected", !0).attr("selected", "selected"), e.join("") }, findLis: function () { return null == this.$lis && (this.$lis = this.$menu.find("li")), this.$lis }, render: function (b) { var c, d = this; b !== !1 && this.$element.find("option").each(function (a) { var b = d.findLis().eq(d.liObj[a]); d.setDisabled(a, this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled, b), d.setSelected(a, this.selected, b) }), this.tabIndex(); var e = this.$element.find("option").map(function () { if (this.selected) { if (d.options.hideDisabled && (this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled)) return; var b, c = a(this), e = c.data("icon") && d.options.showIcon ? '<i class="' + d.options.iconBase + " " + c.data("icon") + '"></i> ' : ""; return b = d.options.showSubtext && c.data("subtext") && !d.multiple ? ' <small class="text-muted">' + c.data("subtext") + "</small>" : "", "undefined" != typeof c.attr("title") ? c.attr("title") : c.data("content") && d.options.showContent ? c.data("content") : e + c.html() + b } }).toArray(), f = this.multiple ? e.join(this.options.multipleSeparator) : e[0]; if (this.multiple && this.options.selectedTextFormat.indexOf("count") > -1) { var g = this.options.selectedTextFormat.split(">"); if (g.length > 1 && e.length > g[1] || 1 == g.length && e.length >= 2) { c = this.options.hideDisabled ? ", [disabled]" : ""; var h = this.$element.find("option").not('[data-divider="true"], [data-hidden="true"]' + c).length, i = "function" == typeof this.options.countSelectedText ? this.options.countSelectedText(e.length, h) : this.options.countSelectedText; f = i.replace("{0}", e.length.toString()).replace("{1}", h.toString()) } } void 0 == this.options.title && (this.options.title = this.$element.attr("title")), "static" == this.options.selectedTextFormat && (f = this.options.title), f || (f = "undefined" != typeof this.options.title ? this.options.title : this.options.noneSelectedText), this.$button.attr("title", a.trim(f.replace(/<[^>]*>?/g, ""))), this.$button.children(".filter-option").html(f), this.$element.trigger("rendered.bs.select") }, setStyle: function (a, b) { this.$element.attr("class") && this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, "")); var c = a ? a : this.options.style; "add" == b ? this.$button.addClass(c) : "remove" == b ? this.$button.removeClass(c) : (this.$button.removeClass(this.options.style), this.$button.addClass(c)) }, liHeight: function (b) { if (b || this.options.size !== !1 && !this.sizeInfo) { var c = document.createElement("div"), d = document.createElement("div"), e = document.createElement("ul"), f = document.createElement("li"), g = document.createElement("li"), h = document.createElement("a"), i = document.createElement("span"), j = this.options.header ? this.$menu.find(".popover-title")[0].cloneNode(!0) : null, k = this.options.liveSearch ? document.createElement("div") : null, l = this.options.actionsBox && this.multiple ? this.$menu.find(".bs-actionsbox")[0].cloneNode(!0) : null, m = this.options.doneButton && this.multiple ? this.$menu.find(".bs-donebutton")[0].cloneNode(!0) : null; if (i.className = "text", c.className = this.$menu[0].parentNode.className + " open", d.className = "dropdown-menu open", e.className = "dropdown-menu inner", f.className = "divider", i.appendChild(document.createTextNode("Inner text")), h.appendChild(i), g.appendChild(h), e.appendChild(g), e.appendChild(f), j && d.appendChild(j), k) { var n = document.createElement("span"); k.className = "bs-searchbox", n.className = "form-control", k.appendChild(n), d.appendChild(k) } l && d.appendChild(l), d.appendChild(e), m && d.appendChild(m), c.appendChild(d), document.body.appendChild(c); var o = h.offsetHeight, p = j ? j.offsetHeight : 0, q = k ? k.offsetHeight : 0, r = l ? l.offsetHeight : 0, s = m ? m.offsetHeight : 0, t = a(f).outerHeight(!0), u = "function" == typeof getComputedStyle ? getComputedStyle(d) : !1, v = u ? null : a(d), w = parseInt(u ? u.paddingTop : v.css("paddingTop")) + parseInt(u ? u.paddingBottom : v.css("paddingBottom")) + parseInt(u ? u.borderTopWidth : v.css("borderTopWidth")) + parseInt(u ? u.borderBottomWidth : v.css("borderBottomWidth")), x = w + parseInt(u ? u.marginTop : v.css("marginTop")) + parseInt(u ? u.marginBottom : v.css("marginBottom")) + 2; document.body.removeChild(c), this.sizeInfo = { liHeight: o, headerHeight: p, searchHeight: q, actionsHeight: r, doneButtonHeight: s, dividerHeight: t, menuPadding: w, menuExtras: x } } }, setSize: function () { if (this.findLis(), this.liHeight(), this.options.header && this.$menu.css("padding-top", 0), this.options.size !== !1) { var b, c, d, e, f = this, g = this.$menu, h = this.$menuInner, i = a(window), j = this.$newElement[0].offsetHeight, k = this.sizeInfo.liHeight, l = this.sizeInfo.headerHeight, m = this.sizeInfo.searchHeight, n = this.sizeInfo.actionsHeight, o = this.sizeInfo.doneButtonHeight, p = this.sizeInfo.dividerHeight, q = this.sizeInfo.menuPadding, r = this.sizeInfo.menuExtras, s = this.options.hideDisabled ? ".disabled" : "", t = function () { d = f.$newElement.offset().top - i.scrollTop(), e = i.height() - d - j }; if (t(), "auto" === this.options.size) { var u = function () { var i, j = function (b, c) { return function (d) { return c ? d.classList ? d.classList.contains(b) : a(d).hasClass(b) : !(d.classList ? d.classList.contains(b) : a(d).hasClass(b)) } }, p = f.$menuInner[0].getElementsByTagName("li"), s = Array.prototype.filter ? Array.prototype.filter.call(p, j("hidden", !1)) : f.$lis.not(".hidden"), u = Array.prototype.filter ? Array.prototype.filter.call(s, j("dropdown-header", !0)) : s.filter(".dropdown-header"); t(), b = e - r, f.options.container ? (g.data("height") || g.data("height", g.height()), c = g.data("height")) : c = g.height(), f.options.dropupAuto && f.$newElement.toggleClass("dropup", d > e && c > b - r), f.$newElement.hasClass("dropup") && (b = d - r), i = s.length + u.length > 3 ? 3 * k + r - 2 : 0, g.css({ "max-height": b + "px", overflow: "hidden", "min-height": i + l + m + n + o + "px" }), h.css({ "max-height": b - l - m - n - o - q + "px", "overflow-y": "auto", "min-height": Math.max(i - q, 0) + "px" }) }; u(), this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize", u), i.off("resize.getSize scroll.getSize").on("resize.getSize scroll.getSize", u) } else if (this.options.size && "auto" != this.options.size && this.$lis.not(s).length > this.options.size) { var v = this.$lis.not(".divider").not(s).children().slice(0, this.options.size).last().parent().index(), w = this.$lis.slice(0, v + 1).filter(".divider").length; b = k * this.options.size + w * p + q, f.options.container ? (g.data("height") || g.data("height", g.height()), c = g.data("height")) : c = g.height(), f.options.dropupAuto && this.$newElement.toggleClass("dropup", d > e && c > b - r), g.css({ "max-height": b + l + m + n + o + "px", overflow: "hidden", "min-height": "" }), h.css({ "max-height": b - q + "px", "overflow-y": "auto", "min-height": "" }) } } }, setWidth: function () { if ("auto" === this.options.width) { this.$menu.css("min-width", "0"); var a = this.$menu.parent().clone().appendTo("body"), b = this.options.container ? this.$newElement.clone().appendTo("body") : a, c = a.children(".dropdown-menu").outerWidth(), d = b.css("width", "auto").children("button").outerWidth(); a.remove(), b.remove(), this.$newElement.css("width", Math.max(c, d) + "px") } else "fit" === this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", "").addClass("fit-width")) : this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", this.options.width)) : (this.$menu.css("min-width", ""), this.$newElement.css("width", "")); this.$newElement.hasClass("fit-width") && "fit" !== this.options.width && this.$newElement.removeClass("fit-width") }, selectPosition: function () { var b, c, d = this, e = a('<div class="bs-container" />'), f = function (a) { e.addClass(a.attr("class").replace(/form-control|fit-width/gi, "")).toggleClass("dropup", a.hasClass("dropup")), b = a.offset(), c = a.hasClass("dropup") ? 0 : a[0].offsetHeight, e.css({ top: b.top + c, left: b.left, width: a[0].offsetWidth }) }; this.$newElement.on("click", function () { d.isDisabled() || (f(a(this)), e.appendTo(d.options.container), e.toggleClass("open", !a(this).hasClass("open")), e.append(d.$menu)) }), a(window).on("resize scroll", function () { f(d.$newElement) }), this.$element.on("hide.bs.select", function () { d.$menu.data("height", d.$menu.height()), e.detach() }) }, setSelected: function (a, b, c) { c || (c = this.findLis().eq(this.liObj[a])), c.toggleClass("selected", b) }, setDisabled: function (a, b, c) { c || (c = this.findLis().eq(this.liObj[a])), b ? c.addClass("disabled").children("a").attr("href", "#").attr("tabindex", -1) : c.removeClass("disabled").children("a").removeAttr("href").attr("tabindex", 0) }, isDisabled: function () { return this.$element[0].disabled }, checkDisabled: function () { var a = this; this.isDisabled() ? (this.$newElement.addClass("disabled"), this.$button.addClass("disabled").attr("tabindex", -1)) : (this.$button.hasClass("disabled") && (this.$newElement.removeClass("disabled"), this.$button.removeClass("disabled")), -1 != this.$button.attr("tabindex") || this.$element.data("tabindex") || this.$button.removeAttr("tabindex")), this.$button.click(function () { return !a.isDisabled() }) }, tabIndex: function () { this.$element.is("[tabindex]") && (this.$element.data("tabindex", this.$element.attr("tabindex")), this.$button.attr("tabindex", this.$element.data("tabindex"))) }, clickListener: function () { var b = this, c = a(document); this.$newElement.on("touchstart.dropdown", ".dropdown-menu", function (a) { a.stopPropagation() }), c.data("spaceSelect", !1), this.$button.on("keyup", function (a) { /(32)/.test(a.keyCode.toString(10)) && c.data("spaceSelect") && (a.preventDefault(), c.data("spaceSelect", !1)) }), this.$newElement.on("click", function () { b.setSize(), b.$element.on("shown.bs.select", function () { if (b.options.liveSearch || b.multiple) { if (!b.multiple) { var a = b.liObj[b.$element[0].selectedIndex]; if ("number" != typeof a || b.options.size === !1) return; var c = b.$lis.eq(a)[0].offsetTop - b.$menuInner[0].offsetTop; c = c - b.$menuInner[0].offsetHeight / 2 + b.sizeInfo.liHeight / 2, b.$menuInner[0].scrollTop = c } } else b.$menuInner.find(".selected a").focus() }) }), this.$menuInner.on("click", "li a", function (c) { var d = a(this), e = d.parent().data("originalIndex"), f = b.$element.val(), g = b.$element.prop("selectedIndex"); if (b.multiple && c.stopPropagation(), c.preventDefault(), !b.isDisabled() && !d.parent().hasClass("disabled")) { var h = b.$element.find("option"), i = h.eq(e), j = i.prop("selected"), k = i.parent("optgroup"), l = b.options.maxOptions, m = k.data("maxOptions") || !1; if (b.multiple) { if (i.prop("selected", !j), b.setSelected(e, !j), d.blur(), l !== !1 || m !== !1) { var n = l < h.filter(":selected").length, o = m < k.find("option:selected").length; if (l && n || m && o) if (l && 1 == l) h.prop("selected", !1), i.prop("selected", !0), b.$menuInner.find(".selected").removeClass("selected"), b.setSelected(e, !0); else if (m && 1 == m) { k.find("option:selected").prop("selected", !1), i.prop("selected", !0); var p = d.parent().data("optgroup"); b.$menuInner.find('[data-optgroup="' + p + '"]').removeClass("selected"), b.setSelected(e, !0) } else { var q = "function" == typeof b.options.maxOptionsText ? b.options.maxOptionsText(l, m) : b.options.maxOptionsText, r = q[0].replace("{n}", l), s = q[1].replace("{n}", m), t = a('<div class="notify"></div>'); q[2] && (r = r.replace("{var}", q[2][l > 1 ? 0 : 1]), s = s.replace("{var}", q[2][m > 1 ? 0 : 1])), i.prop("selected", !1), b.$menu.append(t), l && n && (t.append(a("<div>" + r + "</div>")), b.$element.trigger("maxReached.bs.select")), m && o && (t.append(a("<div>" + s + "</div>")), b.$element.trigger("maxReachedGrp.bs.select")), setTimeout(function () { b.setSelected(e, !1) }, 10), t.delay(750).fadeOut(300, function () { a(this).remove() }) } } } else h.prop("selected", !1), i.prop("selected", !0), b.$menuInner.find(".selected").removeClass("selected"), b.setSelected(e, !0); b.multiple ? b.options.liveSearch && b.$searchbox.focus() : b.$button.focus(), (f != b.$element.val() && b.multiple || g != b.$element.prop("selectedIndex") && !b.multiple) && (b.$element.triggerNative("change"), b.$element.trigger("changed.bs.select", [e, i.prop("selected"), j])) } }), this.$menu.on("click", "li.disabled a, .popover-title, .popover-title :not(.close)", function (c) { c.currentTarget == this && (c.preventDefault(), c.stopPropagation(), b.options.liveSearch && !a(c.target).hasClass("close") ? b.$searchbox.focus() : b.$button.focus()) }), this.$menuInner.on("click", ".divider, .dropdown-header", function (a) { a.preventDefault(), a.stopPropagation(), b.options.liveSearch ? b.$searchbox.focus() : b.$button.focus() }), this.$menu.on("click", ".popover-title .close", function () { b.$button.click() }), this.$searchbox.on("click", function (a) { a.stopPropagation() }), this.$menu.on("click", ".actions-btn", function (c) { b.options.liveSearch ? b.$searchbox.focus() : b.$button.focus(), c.preventDefault(), c.stopPropagation(), a(this).hasClass("bs-select-all") ? b.selectAll() : b.deselectAll(), b.$element.triggerNative("change") }), this.$element.change(function () { b.render(!1) }) }, liveSearchListener: function () { var d = this, e = a('<li class="no-results"></li>'); this.$newElement.on("click.dropdown.data-api touchstart.dropdown.data-api", function () { d.$menuInner.find(".active").removeClass("active"), d.$searchbox.val() && (d.$searchbox.val(""), d.$lis.not(".is-hidden").removeClass("hidden"), e.parent().length && e.remove()), d.multiple || d.$menuInner.find(".selected").addClass("active"), setTimeout(function () { d.$searchbox.focus() }, 10) }), this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api", function (a) { a.stopPropagation() }), this.$searchbox.on("input propertychange", function () { if (d.$searchbox.val()) { var f = d.$lis.not(".is-hidden").removeClass("hidden").children("a"); f = d.options.liveSearchNormalize ? f.not(":a" + d._searchStyle() + '("' + b(d.$searchbox.val()) + '")') : f.not(":" + d._searchStyle() + '("' + d.$searchbox.val() + '")'), f.parent().addClass("hidden"), d.$lis.filter(".dropdown-header").each(function () { var b = a(this), c = b.data("optgroup"); 0 === d.$lis.filter("[data-optgroup=" + c + "]").not(b).not(".hidden").length && (b.addClass("hidden"), d.$lis.filter("[data-optgroup=" + c + "div]").addClass("hidden")) }); var g = d.$lis.not(".hidden"); g.each(function (b) { var c = a(this); c.hasClass("divider") && (c.index() === g.first().index() || c.index() === g.last().index() || g.eq(b + 1).hasClass("divider")) && c.addClass("hidden") }), d.$lis.not(".hidden, .no-results").length ? e.parent().length && e.remove() : (e.parent().length && e.remove(), e.html(d.options.noneResultsText.replace("{0}", '"' + c(d.$searchbox.val()) + '"')).show(), d.$menuInner.append(e)) } else d.$lis.not(".is-hidden").removeClass("hidden"), e.parent().length && e.remove(); d.$lis.filter(".active").removeClass("active"), d.$searchbox.val() && d.$lis.not(".hidden, .divider, .dropdown-header").eq(0).addClass("active").children("a").focus(), a(this).focus() }) }, _searchStyle: function () { var a = { begins: "ibegins", startsWith: "ibegins" }; return a[this.options.liveSearchStyle] || "icontains" }, val: function (a) { return "undefined" != typeof a ? (this.$element.val(a), this.render(), this.$element) : this.$element.val() }, changeAll: function (b) { "undefined" == typeof b && (b = !0), this.findLis(); for (var c = this.$element.find("option"), d = this.$lis.not(".divider, .dropdown-header, .disabled, .hidden").toggleClass("selected", b), e = d.length, f = [], g = 0; e > g; g++) { var h = d[g].getAttribute("data-original-index"); f[f.length] = c.eq(h)[0] } a(f).prop("selected", b), this.render(!1) }, selectAll: function () { return this.changeAll(!0) }, deselectAll: function () { return this.changeAll(!1) }, keydown: function (c) { var d, e, f, g, h, i, j, k, l, m = a(this), n = m.is("input") ? m.parent().parent() : m.parent(), o = n.data("this"), p = ":not(.disabled, .hidden, .dropdown-header, .divider)", q = { 32: " ", 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 59: ";", 65: "a", 66: "b", 67: "c", 68: "d", 69: "e", 70: "f", 71: "g", 72: "h", 73: "i", 74: "j", 75: "k", 76: "l", 77: "m", 78: "n", 79: "o", 80: "p", 81: "q", 82: "r", 83: "s", 84: "t", 85: "u", 86: "v", 87: "w", 88: "x", 89: "y", 90: "z", 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 104: "8", 105: "9" }; if (o.options.liveSearch && (n = m.parent().parent()), o.options.container && (n = o.$menu), d = a("[role=menu] li", n), l = o.$menu.parent().hasClass("open"), !l && (c.keyCode >= 48 && c.keyCode <= 57 || c.keyCode >= 96 && c.keyCode <= 105 || c.keyCode >= 65 && c.keyCode <= 90) && (o.options.container ? o.$newElement.trigger("click") : (o.setSize(), o.$menu.parent().addClass("open"), l = !0), o.$searchbox.focus()), o.options.liveSearch && (/(^9$|27)/.test(c.keyCode.toString(10)) && l && 0 === o.$menu.find(".active").length && (c.preventDefault(), o.$menu.parent().removeClass("open"), o.options.container && o.$newElement.removeClass("open"), o.$button.focus()), d = a("[role=menu] li" + p, n), m.val() || /(38|40)/.test(c.keyCode.toString(10)) || 0 === d.filter(".active").length && (d = o.$menuInner.find("li"), d = o.options.liveSearchNormalize ? d.filter(":a" + o._searchStyle() + "(" + b(q[c.keyCode]) + ")") : d.filter(":" + o._searchStyle() + "(" + q[c.keyCode] + ")"))), d.length) { if (/(38|40)/.test(c.keyCode.toString(10))) e = d.index(d.find("a").filter(":focus").parent()), g = d.filter(p).first().index(), h = d.filter(p).last().index(), f = d.eq(e).nextAll(p).eq(0).index(), i = d.eq(e).prevAll(p).eq(0).index(), j = d.eq(f).prevAll(p).eq(0).index(), o.options.liveSearch && (d.each(function (b) { a(this).hasClass("disabled") || a(this).data("index", b) }), e = d.index(d.filter(".active")), g = d.first().data("index"), h = d.last().data("index"), f = d.eq(e).nextAll().eq(0).data("index"), i = d.eq(e).prevAll().eq(0).data("index"), j = d.eq(f).prevAll().eq(0).data("index")), k = m.data("prevIndex"), 38 == c.keyCode ? (o.options.liveSearch && e-- , e != j && e > i && (e = i), g > e && (e = g), e == k && (e = h)) : 40 == c.keyCode && (o.options.liveSearch && e++ , -1 == e && (e = 0), e != j && f > e && (e = f), e > h && (e = h), e == k && (e = g)), m.data("prevIndex", e), o.options.liveSearch ? (c.preventDefault(), m.hasClass("dropdown-toggle") || (d.removeClass("active").eq(e).addClass("active").children("a").focus(), m.focus())) : d.eq(e).children("a").focus(); else if (!m.is("input")) { var r, s, t = []; d.each(function () { a(this).hasClass("disabled") || a.trim(a(this).children("a").text().toLowerCase()).substring(0, 1) == q[c.keyCode] && t.push(a(this).index()) }), r = a(document).data("keycount"), r++ , a(document).data("keycount", r), s = a.trim(a(":focus").text().toLowerCase()).substring(0, 1), s != q[c.keyCode] ? (r = 1, a(document).data("keycount", r)) : r >= t.length && (a(document).data("keycount", 0), r > t.length && (r = 1)), d.eq(t[r - 1]).children("a").focus() } if ((/(13|32)/.test(c.keyCode.toString(10)) || /(^9$)/.test(c.keyCode.toString(10)) && o.options.selectOnTab) && l) { if (/(32)/.test(c.keyCode.toString(10)) || c.preventDefault(), o.options.liveSearch) /(32)/.test(c.keyCode.toString(10)) || (o.$menuInner.find(".active a").click(), m.focus()); else { var u = a(":focus"); u.click(), u.focus(), c.preventDefault(), a(document).data("spaceSelect", !0) } a(document).data("keycount", 0) } (/(^9$|27)/.test(c.keyCode.toString(10)) && l && (o.multiple || o.options.liveSearch) || /(27)/.test(c.keyCode.toString(10)) && !l) && (o.$menu.parent().removeClass("open"), o.options.container && o.$newElement.removeClass("open"), o.$button.focus()) } }, mobile: function () { this.$element.addClass("mobile-device").appendTo(this.$newElement), this.options.container && this.$menu.hide() }, refresh: function () { this.$lis = null, this.liObj = {}, this.reloadLi(), this.render(), this.checkDisabled(), this.liHeight(!0), this.setStyle(), this.setWidth(), this.$lis && this.$searchbox.trigger("propertychange"), this.$element.trigger("refreshed.bs.select") }, hide: function () { this.$newElement.hide() }, show: function () { this.$newElement.show() }, remove: function () { this.$newElement.remove(), this.$element.remove() } }; var f = a.fn.selectpicker; a.fn.selectpicker = d, a.fn.selectpicker.Constructor = e, a.fn.selectpicker.noConflict = function () { return a.fn.selectpicker = f, this }, a(document).data("keycount", 0).on("keydown", '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input', e.prototype.keydown).on("focusin.modal", '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input', function (a) { a.stopPropagation() }), a(window).on("load.bs.select.data-api", function () { a(".selectpicker").each(function () { var b = a(this); d.call(b, b.data()) }) }) }(a) });
//# sourceMappingURL=bootstrap-select.js.map
/*!
 * Masonry PACKAGED v3.3.2
 * Cascading grid layout library
 * http://masonry.desandro.com
 * MIT License
 * by David DeSandro
 */

!function (a) { function b() { } function c(a) { function c(b) { b.prototype.option || (b.prototype.option = function (b) { a.isPlainObject(b) && (this.options = a.extend(!0, this.options, b)) }) } function e(b, c) { a.fn[b] = function (e) { if ("string" == typeof e) { for (var g = d.call(arguments, 1), h = 0, i = this.length; i > h; h++) { var j = this[h], k = a.data(j, b); if (k) if (a.isFunction(k[e]) && "_" !== e.charAt(0)) { var l = k[e].apply(k, g); if (void 0 !== l) return l } else f("no such method '" + e + "' for " + b + " instance"); else f("cannot call methods on " + b + " prior to initialization; attempted to call '" + e + "'") } return this } return this.each(function () { var d = a.data(this, b); d ? (d.option(e), d._init()) : (d = new c(this, e), a.data(this, b, d)) }) } } if (a) { var f = "undefined" == typeof console ? b : function (a) { console.error(a) }; return a.bridget = function (a, b) { c(b), e(a, b) }, a.bridget } } var d = Array.prototype.slice; "function" == typeof define && define.amd ? define("jquery-bridget/jquery.bridget", ["jquery"], c) : c("object" == typeof exports ? require("jquery") : a.jQuery) }(window), function (a) { function b(b) { var c = a.event; return c.target = c.target || c.srcElement || b, c } var c = document.documentElement, d = function () { }; c.addEventListener ? d = function (a, b, c) { a.addEventListener(b, c, !1) } : c.attachEvent && (d = function (a, c, d) { a[c + d] = d.handleEvent ? function () { var c = b(a); d.handleEvent.call(d, c) } : function () { var c = b(a); d.call(a, c) }, a.attachEvent("on" + c, a[c + d]) }); var e = function () { }; c.removeEventListener ? e = function (a, b, c) { a.removeEventListener(b, c, !1) } : c.detachEvent && (e = function (a, b, c) { a.detachEvent("on" + b, a[b + c]); try { delete a[b + c] } catch (d) { a[b + c] = void 0 } }); var f = { bind: d, unbind: e }; "function" == typeof define && define.amd ? define("eventie/eventie", f) : "object" == typeof exports ? module.exports = f : a.eventie = f }(window), function () { function a() { } function b(a, b) { for (var c = a.length; c--;)if (a[c].listener === b) return c; return -1 } function c(a) { return function () { return this[a].apply(this, arguments) } } var d = a.prototype, e = this, f = e.EventEmitter; d.getListeners = function (a) { var b, c, d = this._getEvents(); if (a instanceof RegExp) { b = {}; for (c in d) d.hasOwnProperty(c) && a.test(c) && (b[c] = d[c]) } else b = d[a] || (d[a] = []); return b }, d.flattenListeners = function (a) { var b, c = []; for (b = 0; b < a.length; b += 1)c.push(a[b].listener); return c }, d.getListenersAsObject = function (a) { var b, c = this.getListeners(a); return c instanceof Array && (b = {}, b[a] = c), b || c }, d.addListener = function (a, c) { var d, e = this.getListenersAsObject(a), f = "object" == typeof c; for (d in e) e.hasOwnProperty(d) && -1 === b(e[d], c) && e[d].push(f ? c : { listener: c, once: !1 }); return this }, d.on = c("addListener"), d.addOnceListener = function (a, b) { return this.addListener(a, { listener: b, once: !0 }) }, d.once = c("addOnceListener"), d.defineEvent = function (a) { return this.getListeners(a), this }, d.defineEvents = function (a) { for (var b = 0; b < a.length; b += 1)this.defineEvent(a[b]); return this }, d.removeListener = function (a, c) { var d, e, f = this.getListenersAsObject(a); for (e in f) f.hasOwnProperty(e) && (d = b(f[e], c), -1 !== d && f[e].splice(d, 1)); return this }, d.off = c("removeListener"), d.addListeners = function (a, b) { return this.manipulateListeners(!1, a, b) }, d.removeListeners = function (a, b) { return this.manipulateListeners(!0, a, b) }, d.manipulateListeners = function (a, b, c) { var d, e, f = a ? this.removeListener : this.addListener, g = a ? this.removeListeners : this.addListeners; if ("object" != typeof b || b instanceof RegExp) for (d = c.length; d--;)f.call(this, b, c[d]); else for (d in b) b.hasOwnProperty(d) && (e = b[d]) && ("function" == typeof e ? f.call(this, d, e) : g.call(this, d, e)); return this }, d.removeEvent = function (a) { var b, c = typeof a, d = this._getEvents(); if ("string" === c) delete d[a]; else if (a instanceof RegExp) for (b in d) d.hasOwnProperty(b) && a.test(b) && delete d[b]; else delete this._events; return this }, d.removeAllListeners = c("removeEvent"), d.emitEvent = function (a, b) { var c, d, e, f, g = this.getListenersAsObject(a); for (e in g) if (g.hasOwnProperty(e)) for (d = g[e].length; d--;)c = g[e][d], c.once === !0 && this.removeListener(a, c.listener), f = c.listener.apply(this, b || []), f === this._getOnceReturnValue() && this.removeListener(a, c.listener); return this }, d.trigger = c("emitEvent"), d.emit = function (a) { var b = Array.prototype.slice.call(arguments, 1); return this.emitEvent(a, b) }, d.setOnceReturnValue = function (a) { return this._onceReturnValue = a, this }, d._getOnceReturnValue = function () { return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0 }, d._getEvents = function () { return this._events || (this._events = {}) }, a.noConflict = function () { return e.EventEmitter = f, a }, "function" == typeof define && define.amd ? define("eventEmitter/EventEmitter", [], function () { return a }) : "object" == typeof module && module.exports ? module.exports = a : e.EventEmitter = a }.call(this), function (a) { function b(a) { if (a) { if ("string" == typeof d[a]) return a; a = a.charAt(0).toUpperCase() + a.slice(1); for (var b, e = 0, f = c.length; f > e; e++)if (b = c[e] + a, "string" == typeof d[b]) return b } } var c = "Webkit Moz ms Ms O".split(" "), d = document.documentElement.style; "function" == typeof define && define.amd ? define("get-style-property/get-style-property", [], function () { return b }) : "object" == typeof exports ? module.exports = b : a.getStyleProperty = b }(window), function (a) { function b(a) { var b = parseFloat(a), c = -1 === a.indexOf("%") && !isNaN(b); return c && b } function c() { } function d() { for (var a = { width: 0, height: 0, innerWidth: 0, innerHeight: 0, outerWidth: 0, outerHeight: 0 }, b = 0, c = g.length; c > b; b++) { var d = g[b]; a[d] = 0 } return a } function e(c) { function e() { if (!m) { m = !0; var d = a.getComputedStyle; if (j = function () { var a = d ? function (a) { return d(a, null) } : function (a) { return a.currentStyle }; return function (b) { var c = a(b); return c || f("Style returned " + c + ". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"), c } }(), k = c("boxSizing")) { var e = document.createElement("div"); e.style.width = "200px", e.style.padding = "1px 2px 3px 4px", e.style.borderStyle = "solid", e.style.borderWidth = "1px 2px 3px 4px", e.style[k] = "border-box"; var g = document.body || document.documentElement; g.appendChild(e); var h = j(e); l = 200 === b(h.width), g.removeChild(e) } } } function h(a) { if (e(), "string" == typeof a && (a = document.querySelector(a)), a && "object" == typeof a && a.nodeType) { var c = j(a); if ("none" === c.display) return d(); var f = {}; f.width = a.offsetWidth, f.height = a.offsetHeight; for (var h = f.isBorderBox = !(!k || !c[k] || "border-box" !== c[k]), m = 0, n = g.length; n > m; m++) { var o = g[m], p = c[o]; p = i(a, p); var q = parseFloat(p); f[o] = isNaN(q) ? 0 : q } var r = f.paddingLeft + f.paddingRight, s = f.paddingTop + f.paddingBottom, t = f.marginLeft + f.marginRight, u = f.marginTop + f.marginBottom, v = f.borderLeftWidth + f.borderRightWidth, w = f.borderTopWidth + f.borderBottomWidth, x = h && l, y = b(c.width); y !== !1 && (f.width = y + (x ? 0 : r + v)); var z = b(c.height); return z !== !1 && (f.height = z + (x ? 0 : s + w)), f.innerWidth = f.width - (r + v), f.innerHeight = f.height - (s + w), f.outerWidth = f.width + t, f.outerHeight = f.height + u, f } } function i(b, c) { if (a.getComputedStyle || -1 === c.indexOf("%")) return c; var d = b.style, e = d.left, f = b.runtimeStyle, g = f && f.left; return g && (f.left = b.currentStyle.left), d.left = c, c = d.pixelLeft, d.left = e, g && (f.left = g), c } var j, k, l, m = !1; return h } var f = "undefined" == typeof console ? c : function (a) { console.error(a) }, g = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"]; "function" == typeof define && define.amd ? define("get-size/get-size", ["get-style-property/get-style-property"], e) : "object" == typeof exports ? module.exports = e(require("desandro-get-style-property")) : a.getSize = e(a.getStyleProperty) }(window), function (a) { function b(a) { "function" == typeof a && (b.isReady ? a() : g.push(a)) } function c(a) { var c = "readystatechange" === a.type && "complete" !== f.readyState; b.isReady || c || d() } function d() { b.isReady = !0; for (var a = 0, c = g.length; c > a; a++) { var d = g[a]; d() } } function e(e) { return "complete" === f.readyState ? d() : (e.bind(f, "DOMContentLoaded", c), e.bind(f, "readystatechange", c), e.bind(a, "load", c)), b } var f = a.document, g = []; b.isReady = !1, "function" == typeof define && define.amd ? define("doc-ready/doc-ready", ["eventie/eventie"], e) : "object" == typeof exports ? module.exports = e(require("eventie")) : a.docReady = e(a.eventie) }(window), function (a) { function b(a, b) { return a[g](b) } function c(a) { if (!a.parentNode) { var b = document.createDocumentFragment(); b.appendChild(a) } } function d(a, b) { c(a); for (var d = a.parentNode.querySelectorAll(b), e = 0, f = d.length; f > e; e++)if (d[e] === a) return !0; return !1 } function e(a, d) { return c(a), b(a, d) } var f, g = function () { if (a.matches) return "matches"; if (a.matchesSelector) return "matchesSelector"; for (var b = ["webkit", "moz", "ms", "o"], c = 0, d = b.length; d > c; c++) { var e = b[c], f = e + "MatchesSelector"; if (a[f]) return f } }(); if (g) { var h = document.createElement("div"), i = b(h, "div"); f = i ? b : e } else f = d; "function" == typeof define && define.amd ? define("matches-selector/matches-selector", [], function () { return f }) : "object" == typeof exports ? module.exports = f : window.matchesSelector = f }(Element.prototype), function (a, b) { "function" == typeof define && define.amd ? define("fizzy-ui-utils/utils", ["doc-ready/doc-ready", "matches-selector/matches-selector"], function (c, d) { return b(a, c, d) }) : "object" == typeof exports ? module.exports = b(a, require("doc-ready"), require("desandro-matches-selector")) : a.fizzyUIUtils = b(a, a.docReady, a.matchesSelector) }(window, function (a, b, c) { var d = {}; d.extend = function (a, b) { for (var c in b) a[c] = b[c]; return a }, d.modulo = function (a, b) { return (a % b + b) % b }; var e = Object.prototype.toString; d.isArray = function (a) { return "[object Array]" == e.call(a) }, d.makeArray = function (a) { var b = []; if (d.isArray(a)) b = a; else if (a && "number" == typeof a.length) for (var c = 0, e = a.length; e > c; c++)b.push(a[c]); else b.push(a); return b }, d.indexOf = Array.prototype.indexOf ? function (a, b) { return a.indexOf(b) } : function (a, b) { for (var c = 0, d = a.length; d > c; c++)if (a[c] === b) return c; return -1 }, d.removeFrom = function (a, b) { var c = d.indexOf(a, b); -1 != c && a.splice(c, 1) }, d.isElement = "function" == typeof HTMLElement || "object" == typeof HTMLElement ? function (a) { return a instanceof HTMLElement } : function (a) { return a && "object" == typeof a && 1 == a.nodeType && "string" == typeof a.nodeName }, d.setText = function () { function a(a, c) { b = b || (void 0 !== document.documentElement.textContent ? "textContent" : "innerText"), a[b] = c } var b; return a }(), d.getParent = function (a, b) { for (; a != document.body;)if (a = a.parentNode, c(a, b)) return a }, d.getQueryElement = function (a) { return "string" == typeof a ? document.querySelector(a) : a }, d.handleEvent = function (a) { var b = "on" + a.type; this[b] && this[b](a) }, d.filterFindElements = function (a, b) { a = d.makeArray(a); for (var e = [], f = 0, g = a.length; g > f; f++) { var h = a[f]; if (d.isElement(h)) if (b) { c(h, b) && e.push(h); for (var i = h.querySelectorAll(b), j = 0, k = i.length; k > j; j++)e.push(i[j]) } else e.push(h) } return e }, d.debounceMethod = function (a, b, c) { var d = a.prototype[b], e = b + "Timeout"; a.prototype[b] = function () { var a = this[e]; a && clearTimeout(a); var b = arguments, f = this; this[e] = setTimeout(function () { d.apply(f, b), delete f[e] }, c || 100) } }, d.toDashed = function (a) { return a.replace(/(.)([A-Z])/g, function (a, b, c) { return b + "-" + c }).toLowerCase() }; var f = a.console; return d.htmlInit = function (c, e) { b(function () { for (var b = d.toDashed(e), g = document.querySelectorAll(".js-" + b), h = "data-" + b + "-options", i = 0, j = g.length; j > i; i++) { var k, l = g[i], m = l.getAttribute(h); try { k = m && JSON.parse(m) } catch (n) { f && f.error("Error parsing " + h + " on " + l.nodeName.toLowerCase() + (l.id ? "#" + l.id : "") + ": " + n); continue } var o = new c(l, k), p = a.jQuery; p && p.data(l, e, o) } }) }, d }), function (a, b) { "function" == typeof define && define.amd ? define("outlayer/item", ["eventEmitter/EventEmitter", "get-size/get-size", "get-style-property/get-style-property", "fizzy-ui-utils/utils"], function (c, d, e, f) { return b(a, c, d, e, f) }) : "object" == typeof exports ? module.exports = b(a, require("wolfy87-eventemitter"), require("get-size"), require("desandro-get-style-property"), require("fizzy-ui-utils")) : (a.Outlayer = {}, a.Outlayer.Item = b(a, a.EventEmitter, a.getSize, a.getStyleProperty, a.fizzyUIUtils)) }(window, function (a, b, c, d, e) { function f(a) { for (var b in a) return !1; return b = null, !0 } function g(a, b) { a && (this.element = a, this.layout = b, this.position = { x: 0, y: 0 }, this._create()) } function h(a) { return a.replace(/([A-Z])/g, function (a) { return "-" + a.toLowerCase() }) } var i = a.getComputedStyle, j = i ? function (a) { return i(a, null) } : function (a) { return a.currentStyle }, k = d("transition"), l = d("transform"), m = k && l, n = !!d("perspective"), o = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "otransitionend", transition: "transitionend" }[k], p = ["transform", "transition", "transitionDuration", "transitionProperty"], q = function () { for (var a = {}, b = 0, c = p.length; c > b; b++) { var e = p[b], f = d(e); f && f !== e && (a[e] = f) } return a }(); e.extend(g.prototype, b.prototype), g.prototype._create = function () { this._transn = { ingProperties: {}, clean: {}, onEnd: {} }, this.css({ position: "absolute" }) }, g.prototype.handleEvent = function (a) { var b = "on" + a.type; this[b] && this[b](a) }, g.prototype.getSize = function () { this.size = c(this.element) }, g.prototype.css = function (a) { var b = this.element.style; for (var c in a) { var d = q[c] || c; b[d] = a[c] } }, g.prototype.getPosition = function () { var a = j(this.element), b = this.layout.options, c = b.isOriginLeft, d = b.isOriginTop, e = a[c ? "left" : "right"], f = a[d ? "top" : "bottom"], g = this.layout.size, h = -1 != e.indexOf("%") ? parseFloat(e) / 100 * g.width : parseInt(e, 10), i = -1 != f.indexOf("%") ? parseFloat(f) / 100 * g.height : parseInt(f, 10); h = isNaN(h) ? 0 : h, i = isNaN(i) ? 0 : i, h -= c ? g.paddingLeft : g.paddingRight, i -= d ? g.paddingTop : g.paddingBottom, this.position.x = h, this.position.y = i }, g.prototype.layoutPosition = function () { var a = this.layout.size, b = this.layout.options, c = {}, d = b.isOriginLeft ? "paddingLeft" : "paddingRight", e = b.isOriginLeft ? "left" : "right", f = b.isOriginLeft ? "right" : "left", g = this.position.x + a[d]; c[e] = this.getXValue(g), c[f] = ""; var h = b.isOriginTop ? "paddingTop" : "paddingBottom", i = b.isOriginTop ? "top" : "bottom", j = b.isOriginTop ? "bottom" : "top", k = this.position.y + a[h]; c[i] = this.getYValue(k), c[j] = "", this.css(c), this.emitEvent("layout", [this]) }, g.prototype.getXValue = function (a) { var b = this.layout.options; return b.percentPosition && !b.isHorizontal ? a / this.layout.size.width * 100 + "%" : a + "px" }, g.prototype.getYValue = function (a) { var b = this.layout.options; return b.percentPosition && b.isHorizontal ? a / this.layout.size.height * 100 + "%" : a + "px" }, g.prototype._transitionTo = function (a, b) { this.getPosition(); var c = this.position.x, d = this.position.y, e = parseInt(a, 10), f = parseInt(b, 10), g = e === this.position.x && f === this.position.y; if (this.setPosition(a, b), g && !this.isTransitioning) return void this.layoutPosition(); var h = a - c, i = b - d, j = {}; j.transform = this.getTranslate(h, i), this.transition({ to: j, onTransitionEnd: { transform: this.layoutPosition }, isCleaning: !0 }) }, g.prototype.getTranslate = function (a, b) { var c = this.layout.options; return a = c.isOriginLeft ? a : -a, b = c.isOriginTop ? b : -b, n ? "translate3d(" + a + "px, " + b + "px, 0)" : "translate(" + a + "px, " + b + "px)" }, g.prototype.goTo = function (a, b) { this.setPosition(a, b), this.layoutPosition() }, g.prototype.moveTo = m ? g.prototype._transitionTo : g.prototype.goTo, g.prototype.setPosition = function (a, b) { this.position.x = parseInt(a, 10), this.position.y = parseInt(b, 10) }, g.prototype._nonTransition = function (a) { this.css(a.to), a.isCleaning && this._removeStyles(a.to); for (var b in a.onTransitionEnd) a.onTransitionEnd[b].call(this) }, g.prototype._transition = function (a) { if (!parseFloat(this.layout.options.transitionDuration)) return void this._nonTransition(a); var b = this._transn; for (var c in a.onTransitionEnd) b.onEnd[c] = a.onTransitionEnd[c]; for (c in a.to) b.ingProperties[c] = !0, a.isCleaning && (b.clean[c] = !0); if (a.from) { this.css(a.from); var d = this.element.offsetHeight; d = null } this.enableTransition(a.to), this.css(a.to), this.isTransitioning = !0 }; var r = "opacity," + h(q.transform || "transform"); g.prototype.enableTransition = function () { this.isTransitioning || (this.css({ transitionProperty: r, transitionDuration: this.layout.options.transitionDuration }), this.element.addEventListener(o, this, !1)) }, g.prototype.transition = g.prototype[k ? "_transition" : "_nonTransition"], g.prototype.onwebkitTransitionEnd = function (a) { this.ontransitionend(a) }, g.prototype.onotransitionend = function (a) { this.ontransitionend(a) }; var s = { "-webkit-transform": "transform", "-moz-transform": "transform", "-o-transform": "transform" }; g.prototype.ontransitionend = function (a) { if (a.target === this.element) { var b = this._transn, c = s[a.propertyName] || a.propertyName; if (delete b.ingProperties[c], f(b.ingProperties) && this.disableTransition(), c in b.clean && (this.element.style[a.propertyName] = "", delete b.clean[c]), c in b.onEnd) { var d = b.onEnd[c]; d.call(this), delete b.onEnd[c] } this.emitEvent("transitionEnd", [this]) } }, g.prototype.disableTransition = function () { this.removeTransitionStyles(), this.element.removeEventListener(o, this, !1), this.isTransitioning = !1 }, g.prototype._removeStyles = function (a) { var b = {}; for (var c in a) b[c] = ""; this.css(b) }; var t = { transitionProperty: "", transitionDuration: "" }; return g.prototype.removeTransitionStyles = function () { this.css(t) }, g.prototype.removeElem = function () { this.element.parentNode.removeChild(this.element), this.css({ display: "" }), this.emitEvent("remove", [this]) }, g.prototype.remove = function () { if (!k || !parseFloat(this.layout.options.transitionDuration)) return void this.removeElem(); var a = this; this.once("transitionEnd", function () { a.removeElem() }), this.hide() }, g.prototype.reveal = function () { delete this.isHidden, this.css({ display: "" }); var a = this.layout.options, b = {}, c = this.getHideRevealTransitionEndProperty("visibleStyle"); b[c] = this.onRevealTransitionEnd, this.transition({ from: a.hiddenStyle, to: a.visibleStyle, isCleaning: !0, onTransitionEnd: b }) }, g.prototype.onRevealTransitionEnd = function () { this.isHidden || this.emitEvent("reveal") }, g.prototype.getHideRevealTransitionEndProperty = function (a) { var b = this.layout.options[a]; if (b.opacity) return "opacity"; for (var c in b) return c }, g.prototype.hide = function () { this.isHidden = !0, this.css({ display: "" }); var a = this.layout.options, b = {}, c = this.getHideRevealTransitionEndProperty("hiddenStyle"); b[c] = this.onHideTransitionEnd, this.transition({ from: a.visibleStyle, to: a.hiddenStyle, isCleaning: !0, onTransitionEnd: b }) }, g.prototype.onHideTransitionEnd = function () { this.isHidden && (this.css({ display: "none" }), this.emitEvent("hide")) }, g.prototype.destroy = function () { this.css({ position: "", left: "", right: "", top: "", bottom: "", transition: "", transform: "" }) }, g }), function (a, b) { "function" == typeof define && define.amd ? define("outlayer/outlayer", ["eventie/eventie", "eventEmitter/EventEmitter", "get-size/get-size", "fizzy-ui-utils/utils", "./item"], function (c, d, e, f, g) { return b(a, c, d, e, f, g) }) : "object" == typeof exports ? module.exports = b(a, require("eventie"), require("wolfy87-eventemitter"), require("get-size"), require("fizzy-ui-utils"), require("./item")) : a.Outlayer = b(a, a.eventie, a.EventEmitter, a.getSize, a.fizzyUIUtils, a.Outlayer.Item) }(window, function (a, b, c, d, e, f) { function g(a, b) { var c = e.getQueryElement(a); if (!c) return void (h && h.error("Bad element for " + this.constructor.namespace + ": " + (c || a))); this.element = c, i && (this.$element = i(this.element)), this.options = e.extend({}, this.constructor.defaults), this.option(b); var d = ++k; this.element.outlayerGUID = d, l[d] = this, this._create(), this.options.isInitLayout && this.layout() } var h = a.console, i = a.jQuery, j = function () { }, k = 0, l = {}; return g.namespace = "outlayer", g.Item = f, g.defaults = { containerStyle: { position: "relative" }, isInitLayout: !0, isOriginLeft: !0, isOriginTop: !0, isResizeBound: !0, isResizingContainer: !0, transitionDuration: "0.4s", hiddenStyle: { opacity: 0, transform: "scale(0.001)" }, visibleStyle: { opacity: 1, transform: "scale(1)" } }, e.extend(g.prototype, c.prototype), g.prototype.option = function (a) { e.extend(this.options, a) }, g.prototype._create = function () { this.reloadItems(), this.stamps = [], this.stamp(this.options.stamp), e.extend(this.element.style, this.options.containerStyle), this.options.isResizeBound && this.bindResize() }, g.prototype.reloadItems = function () { this.items = this._itemize(this.element.children) }, g.prototype._itemize = function (a) { for (var b = this._filterFindItemElements(a), c = this.constructor.Item, d = [], e = 0, f = b.length; f > e; e++) { var g = b[e], h = new c(g, this); d.push(h) } return d }, g.prototype._filterFindItemElements = function (a) { return e.filterFindElements(a, this.options.itemSelector) }, g.prototype.getItemElements = function () { for (var a = [], b = 0, c = this.items.length; c > b; b++)a.push(this.items[b].element); return a }, g.prototype.layout = function () { this._resetLayout(), this._manageStamps(); var a = void 0 !== this.options.isLayoutInstant ? this.options.isLayoutInstant : !this._isLayoutInited; this.layoutItems(this.items, a), this._isLayoutInited = !0 }, g.prototype._init = g.prototype.layout, g.prototype._resetLayout = function () { this.getSize() }, g.prototype.getSize = function () { this.size = d(this.element) }, g.prototype._getMeasurement = function (a, b) { var c, f = this.options[a]; f ? ("string" == typeof f ? c = this.element.querySelector(f) : e.isElement(f) && (c = f), this[a] = c ? d(c)[b] : f) : this[a] = 0 }, g.prototype.layoutItems = function (a, b) { a = this._getItemsForLayout(a), this._layoutItems(a, b), this._postLayout() }, g.prototype._getItemsForLayout = function (a) { for (var b = [], c = 0, d = a.length; d > c; c++) { var e = a[c]; e.isIgnored || b.push(e) } return b }, g.prototype._layoutItems = function (a, b) { if (this._emitCompleteOnItems("layout", a), a && a.length) { for (var c = [], d = 0, e = a.length; e > d; d++) { var f = a[d], g = this._getItemLayoutPosition(f); g.item = f, g.isInstant = b || f.isLayoutInstant, c.push(g) } this._processLayoutQueue(c) } }, g.prototype._getItemLayoutPosition = function () { return { x: 0, y: 0 } }, g.prototype._processLayoutQueue = function (a) { for (var b = 0, c = a.length; c > b; b++) { var d = a[b]; this._positionItem(d.item, d.x, d.y, d.isInstant) } }, g.prototype._positionItem = function (a, b, c, d) { d ? a.goTo(b, c) : a.moveTo(b, c) }, g.prototype._postLayout = function () { this.resizeContainer() }, g.prototype.resizeContainer = function () { if (this.options.isResizingContainer) { var a = this._getContainerSize(); a && (this._setContainerMeasure(a.width, !0), this._setContainerMeasure(a.height, !1)) } }, g.prototype._getContainerSize = j, g.prototype._setContainerMeasure = function (a, b) { if (void 0 !== a) { var c = this.size; c.isBorderBox && (a += b ? c.paddingLeft + c.paddingRight + c.borderLeftWidth + c.borderRightWidth : c.paddingBottom + c.paddingTop + c.borderTopWidth + c.borderBottomWidth), a = Math.max(a, 0), this.element.style[b ? "width" : "height"] = a + "px" } }, g.prototype._emitCompleteOnItems = function (a, b) { function c() { e.dispatchEvent(a + "Complete", null, [b]) } function d() { g++ , g === f && c() } var e = this, f = b.length; if (!b || !f) return void c(); for (var g = 0, h = 0, i = b.length; i > h; h++) { var j = b[h]; j.once(a, d) } }, g.prototype.dispatchEvent = function (a, b, c) { var d = b ? [b].concat(c) : c; if (this.emitEvent(a, d), i) if (this.$element = this.$element || i(this.element), b) { var e = i.Event(b); e.type = a, this.$element.trigger(e, c) } else this.$element.trigger(a, c) }, g.prototype.ignore = function (a) { var b = this.getItem(a); b && (b.isIgnored = !0) }, g.prototype.unignore = function (a) { var b = this.getItem(a); b && delete b.isIgnored }, g.prototype.stamp = function (a) { if (a = this._find(a)) { this.stamps = this.stamps.concat(a); for (var b = 0, c = a.length; c > b; b++) { var d = a[b]; this.ignore(d) } } }, g.prototype.unstamp = function (a) { if (a = this._find(a)) for (var b = 0, c = a.length; c > b; b++) { var d = a[b]; e.removeFrom(this.stamps, d), this.unignore(d) } }, g.prototype._find = function (a) { return a ? ("string" == typeof a && (a = this.element.querySelectorAll(a)), a = e.makeArray(a)) : void 0 }, g.prototype._manageStamps = function () { if (this.stamps && this.stamps.length) { this._getBoundingRect(); for (var a = 0, b = this.stamps.length; b > a; a++) { var c = this.stamps[a]; this._manageStamp(c) } } }, g.prototype._getBoundingRect = function () { var a = this.element.getBoundingClientRect(), b = this.size; this._boundingRect = { left: a.left + b.paddingLeft + b.borderLeftWidth, top: a.top + b.paddingTop + b.borderTopWidth, right: a.right - (b.paddingRight + b.borderRightWidth), bottom: a.bottom - (b.paddingBottom + b.borderBottomWidth) } }, g.prototype._manageStamp = j, g.prototype._getElementOffset = function (a) { var b = a.getBoundingClientRect(), c = this._boundingRect, e = d(a), f = { left: b.left - c.left - e.marginLeft, top: b.top - c.top - e.marginTop, right: c.right - b.right - e.marginRight, bottom: c.bottom - b.bottom - e.marginBottom }; return f }, g.prototype.handleEvent = function (a) { var b = "on" + a.type; this[b] && this[b](a) }, g.prototype.bindResize = function () { this.isResizeBound || (b.bind(a, "resize", this), this.isResizeBound = !0) }, g.prototype.unbindResize = function () { this.isResizeBound && b.unbind(a, "resize", this), this.isResizeBound = !1 }, g.prototype.onresize = function () { function a() { b.resize(), delete b.resizeTimeout } this.resizeTimeout && clearTimeout(this.resizeTimeout); var b = this; this.resizeTimeout = setTimeout(a, 100) }, g.prototype.resize = function () { this.isResizeBound && this.needsResizeLayout() && this.layout() }, g.prototype.needsResizeLayout = function () { var a = d(this.element), b = this.size && a; return b && a.innerWidth !== this.size.innerWidth }, g.prototype.addItems = function (a) { var b = this._itemize(a); return b.length && (this.items = this.items.concat(b)), b }, g.prototype.appended = function (a) { var b = this.addItems(a); b.length && (this.layoutItems(b, !0), this.reveal(b)) }, g.prototype.prepended = function (a) { var b = this._itemize(a); if (b.length) { var c = this.items.slice(0); this.items = b.concat(c), this._resetLayout(), this._manageStamps(), this.layoutItems(b, !0), this.reveal(b), this.layoutItems(c) } }, g.prototype.reveal = function (a) { this._emitCompleteOnItems("reveal", a); for (var b = a && a.length, c = 0; b && b > c; c++) { var d = a[c]; d.reveal() } }, g.prototype.hide = function (a) { this._emitCompleteOnItems("hide", a); for (var b = a && a.length, c = 0; b && b > c; c++) { var d = a[c]; d.hide() } }, g.prototype.revealItemElements = function (a) { var b = this.getItems(a); this.reveal(b) }, g.prototype.hideItemElements = function (a) { var b = this.getItems(a); this.hide(b) }, g.prototype.getItem = function (a) { for (var b = 0, c = this.items.length; c > b; b++) { var d = this.items[b]; if (d.element === a) return d } }, g.prototype.getItems = function (a) { a = e.makeArray(a); for (var b = [], c = 0, d = a.length; d > c; c++) { var f = a[c], g = this.getItem(f); g && b.push(g) } return b }, g.prototype.remove = function (a) { var b = this.getItems(a); if (this._emitCompleteOnItems("remove", b), b && b.length) for (var c = 0, d = b.length; d > c; c++) { var f = b[c]; f.remove(), e.removeFrom(this.items, f) } }, g.prototype.destroy = function () { var a = this.element.style; a.height = "", a.position = "", a.width = ""; for (var b = 0, c = this.items.length; c > b; b++) { var d = this.items[b]; d.destroy() } this.unbindResize(); var e = this.element.outlayerGUID; delete l[e], delete this.element.outlayerGUID, i && i.removeData(this.element, this.constructor.namespace) }, g.data = function (a) { a = e.getQueryElement(a); var b = a && a.outlayerGUID; return b && l[b] }, g.create = function (a, b) { function c() { g.apply(this, arguments) } return Object.create ? c.prototype = Object.create(g.prototype) : e.extend(c.prototype, g.prototype), c.prototype.constructor = c, c.defaults = e.extend({}, g.defaults), e.extend(c.defaults, b), c.prototype.settings = {}, c.namespace = a, c.data = g.data, c.Item = function () { f.apply(this, arguments) }, c.Item.prototype = new f, e.htmlInit(c, a), i && i.bridget && i.bridget(a, c), c }, g.Item = f, g }), function (a, b) { "function" == typeof define && define.amd ? define(["outlayer/outlayer", "get-size/get-size", "fizzy-ui-utils/utils"], b) : "object" == typeof exports ? module.exports = b(require("outlayer"), require("get-size"), require("fizzy-ui-utils")) : a.Masonry = b(a.Outlayer, a.getSize, a.fizzyUIUtils) }(window, function (a, b, c) { var d = a.create("masonry"); return d.prototype._resetLayout = function () { this.getSize(), this._getMeasurement("columnWidth", "outerWidth"), this._getMeasurement("gutter", "outerWidth"), this.measureColumns(); var a = this.cols; for (this.colYs = []; a--;)this.colYs.push(0); this.maxY = 0 }, d.prototype.measureColumns = function () { if (this.getContainerWidth(), !this.columnWidth) { var a = this.items[0], c = a && a.element; this.columnWidth = c && b(c).outerWidth || this.containerWidth } var d = this.columnWidth += this.gutter, e = this.containerWidth + this.gutter, f = e / d, g = d - e % d, h = g && 1 > g ? "round" : "floor"; f = Math[h](f), this.cols = Math.max(f, 1) }, d.prototype.getContainerWidth = function () { var a = this.options.isFitWidth ? this.element.parentNode : this.element, c = b(a); this.containerWidth = c && c.innerWidth }, d.prototype._getItemLayoutPosition = function (a) { a.getSize(); var b = a.size.outerWidth % this.columnWidth, d = b && 1 > b ? "round" : "ceil", e = Math[d](a.size.outerWidth / this.columnWidth); e = Math.min(e, this.cols); for (var f = this._getColGroup(e), g = Math.min.apply(Math, f), h = c.indexOf(f, g), i = { x: this.columnWidth * h, y: g }, j = g + a.size.outerHeight, k = this.cols + 1 - f.length, l = 0; k > l; l++)this.colYs[h + l] = j; return i }, d.prototype._getColGroup = function (a) { if (2 > a) return this.colYs; for (var b = [], c = this.cols + 1 - a, d = 0; c > d; d++) { var e = this.colYs.slice(d, d + a); b[d] = Math.max.apply(Math, e) } return b }, d.prototype._manageStamp = function (a) { var c = b(a), d = this._getElementOffset(a), e = this.options.isOriginLeft ? d.left : d.right, f = e + c.outerWidth, g = Math.floor(e / this.columnWidth); g = Math.max(0, g); var h = Math.floor(f / this.columnWidth); h -= f % this.columnWidth ? 0 : 1, h = Math.min(this.cols - 1, h); for (var i = (this.options.isOriginTop ? d.top : d.bottom) + c.outerHeight, j = g; h >= j; j++)this.colYs[j] = Math.max(i, this.colYs[j]) }, d.prototype._getContainerSize = function () { this.maxY = Math.max.apply(Math, this.colYs); var a = { height: this.maxY }; return this.options.isFitWidth && (a.width = this._getContainerFitWidth()), a }, d.prototype._getContainerFitWidth = function () { for (var a = 0, b = this.cols; --b && 0 === this.colYs[b];)a++; return (this.cols - a) * this.columnWidth - this.gutter }, d.prototype.needsResizeLayout = function () { var a = this.containerWidth; return this.getContainerWidth(), a !== this.containerWidth }, d });
/*
 AngularJS v1.4.8
 (c) 2010-2015 Google, Inc. http://angularjs.org
 License: MIT
*/
(function (S, X, u) {
  'use strict'; function G(a) { return function () { var b = arguments[0], d; d = "[" + (a ? a + ":" : "") + b + "] http://errors.angularjs.org/1.4.8/" + (a ? a + "/" : "") + b; for (b = 1; b < arguments.length; b++) { d = d + (1 == b ? "?" : "&") + "p" + (b - 1) + "="; var c = encodeURIComponent, e; e = arguments[b]; e = "function" == typeof e ? e.toString().replace(/ \{[\s\S]*$/, "") : "undefined" == typeof e ? "undefined" : "string" != typeof e ? JSON.stringify(e) : e; d += c(e) } return Error(d) } } function za(a) {
    if (null == a || Xa(a)) return !1; if (I(a) || E(a) || B && a instanceof B) return !0;
    var b = "length" in Object(a) && a.length; return Q(b) && (0 <= b && b - 1 in a || "function" == typeof a.item)
  } function n(a, b, d) {
    var c, e; if (a) if (z(a)) for (c in a) "prototype" == c || "length" == c || "name" == c || a.hasOwnProperty && !a.hasOwnProperty(c) || b.call(d, a[c], c, a); else if (I(a) || za(a)) { var f = "object" !== typeof a; c = 0; for (e = a.length; c < e; c++)(f || c in a) && b.call(d, a[c], c, a) } else if (a.forEach && a.forEach !== n) a.forEach(b, d, a); else if (nc(a)) for (c in a) b.call(d, a[c], c, a); else if ("function" === typeof a.hasOwnProperty) for (c in a) a.hasOwnProperty(c) &&
      b.call(d, a[c], c, a); else for (c in a) qa.call(a, c) && b.call(d, a[c], c, a); return a
  } function oc(a, b, d) { for (var c = Object.keys(a).sort(), e = 0; e < c.length; e++)b.call(d, a[c[e]], c[e]); return c } function pc(a) { return function (b, d) { a(d, b) } } function Td() { return ++nb } function Mb(a, b, d) {
    for (var c = a.$$hashKey, e = 0, f = b.length; e < f; ++e) {
      var g = b[e]; if (H(g) || z(g)) for (var h = Object.keys(g), k = 0, l = h.length; k < l; k++) {
        var m = h[k], r = g[m]; d && H(r) ? da(r) ? a[m] = new Date(r.valueOf()) : Ma(r) ? a[m] = new RegExp(r) : r.nodeName ? a[m] = r.cloneNode(!0) :
          Nb(r) ? a[m] = r.clone() : (H(a[m]) || (a[m] = I(r) ? [] : {}), Mb(a[m], [r], !0)) : a[m] = r
      }
    } c ? a.$$hashKey = c : delete a.$$hashKey; return a
  } function M(a) { return Mb(a, ra.call(arguments, 1), !1) } function Ud(a) { return Mb(a, ra.call(arguments, 1), !0) } function ea(a) { return parseInt(a, 10) } function Ob(a, b) { return M(Object.create(a), b) } function x() { } function Ya(a) { return a } function na(a) { return function () { return a } } function qc(a) { return z(a.toString) && a.toString !== sa } function q(a) { return "undefined" === typeof a } function y(a) {
    return "undefined" !==
      typeof a
  } function H(a) { return null !== a && "object" === typeof a } function nc(a) { return null !== a && "object" === typeof a && !rc(a) } function E(a) { return "string" === typeof a } function Q(a) { return "number" === typeof a } function da(a) { return "[object Date]" === sa.call(a) } function z(a) { return "function" === typeof a } function Ma(a) { return "[object RegExp]" === sa.call(a) } function Xa(a) { return a && a.window === a } function Za(a) { return a && a.$evalAsync && a.$watch } function $a(a) { return "boolean" === typeof a } function sc(a) {
    return a && Q(a.length) &&
      Vd.test(sa.call(a))
  } function Nb(a) { return !(!a || !(a.nodeName || a.prop && a.attr && a.find)) } function Wd(a) { var b = {}; a = a.split(","); var d; for (d = 0; d < a.length; d++)b[a[d]] = !0; return b } function ta(a) { return F(a.nodeName || a[0] && a[0].nodeName) } function ab(a, b) { var d = a.indexOf(b); 0 <= d && a.splice(d, 1); return d } function bb(a, b) {
    function d(a, b) {
      var d = b.$$hashKey, e; if (I(a)) { e = 0; for (var f = a.length; e < f; e++)b.push(c(a[e])) } else if (nc(a)) for (e in a) b[e] = c(a[e]); else if (a && "function" === typeof a.hasOwnProperty) for (e in a) a.hasOwnProperty(e) &&
        (b[e] = c(a[e])); else for (e in a) qa.call(a, e) && (b[e] = c(a[e])); d ? b.$$hashKey = d : delete b.$$hashKey; return b
    } function c(a) { if (!H(a)) return a; var b = e.indexOf(a); if (-1 !== b) return f[b]; if (Xa(a) || Za(a)) throw Aa("cpws"); var b = !1, c; I(a) ? (c = [], b = !0) : sc(a) ? c = new a.constructor(a) : da(a) ? c = new Date(a.getTime()) : Ma(a) ? (c = new RegExp(a.source, a.toString().match(/[^\/]*$/)[0]), c.lastIndex = a.lastIndex) : z(a.cloneNode) ? c = a.cloneNode(!0) : (c = Object.create(rc(a)), b = !0); e.push(a); f.push(c); return b ? d(a, c) : c } var e = [], f = []; if (b) {
      if (sc(b)) throw Aa("cpta");
      if (a === b) throw Aa("cpi"); I(b) ? b.length = 0 : n(b, function (a, c) { "$$hashKey" !== c && delete b[c] }); e.push(a); f.push(b); return d(a, b)
    } return c(a)
  } function ia(a, b) { if (I(a)) { b = b || []; for (var d = 0, c = a.length; d < c; d++)b[d] = a[d] } else if (H(a)) for (d in b = b || {}, a) if ("$" !== d.charAt(0) || "$" !== d.charAt(1)) b[d] = a[d]; return b || a } function ma(a, b) {
    if (a === b) return !0; if (null === a || null === b) return !1; if (a !== a && b !== b) return !0; var d = typeof a, c; if (d == typeof b && "object" == d) if (I(a)) {
      if (!I(b)) return !1; if ((d = a.length) == b.length) {
        for (c =
          0; c < d; c++)if (!ma(a[c], b[c])) return !1; return !0
      }
    } else { if (da(a)) return da(b) ? ma(a.getTime(), b.getTime()) : !1; if (Ma(a)) return Ma(b) ? a.toString() == b.toString() : !1; if (Za(a) || Za(b) || Xa(a) || Xa(b) || I(b) || da(b) || Ma(b)) return !1; d = $(); for (c in a) if ("$" !== c.charAt(0) && !z(a[c])) { if (!ma(a[c], b[c])) return !1; d[c] = !0 } for (c in b) if (!(c in d) && "$" !== c.charAt(0) && y(b[c]) && !z(b[c])) return !1; return !0 } return !1
  } function cb(a, b, d) { return a.concat(ra.call(b, d)) } function tc(a, b) {
    var d = 2 < arguments.length ? ra.call(arguments, 2) :
      []; return !z(b) || b instanceof RegExp ? b : d.length ? function () { return arguments.length ? b.apply(a, cb(d, arguments, 0)) : b.apply(a, d) } : function () { return arguments.length ? b.apply(a, arguments) : b.call(a) }
  } function Xd(a, b) { var d = b; "string" === typeof a && "$" === a.charAt(0) && "$" === a.charAt(1) ? d = u : Xa(b) ? d = "$WINDOW" : b && X === b ? d = "$DOCUMENT" : Za(b) && (d = "$SCOPE"); return d } function db(a, b) { if ("undefined" === typeof a) return u; Q(b) || (b = b ? 2 : null); return JSON.stringify(a, Xd, b) } function uc(a) { return E(a) ? JSON.parse(a) : a } function vc(a,
    b) { var d = Date.parse("Jan 01, 1970 00:00:00 " + a) / 6E4; return isNaN(d) ? b : d } function Pb(a, b, d) { d = d ? -1 : 1; var c = vc(b, a.getTimezoneOffset()); b = a; a = d * (c - a.getTimezoneOffset()); b = new Date(b.getTime()); b.setMinutes(b.getMinutes() + a); return b } function ua(a) { a = B(a).clone(); try { a.empty() } catch (b) { } var d = B("<div>").append(a).html(); try { return a[0].nodeType === Na ? F(d) : d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, function (a, b) { return "<" + F(b) }) } catch (c) { return F(d) } } function wc(a) { try { return decodeURIComponent(a) } catch (b) { } }
  function xc(a) { var b = {}; n((a || "").split("&"), function (a) { var c, e, f; a && (e = a = a.replace(/\+/g, "%20"), c = a.indexOf("="), -1 !== c && (e = a.substring(0, c), f = a.substring(c + 1)), e = wc(e), y(e) && (f = y(f) ? wc(f) : !0, qa.call(b, e) ? I(b[e]) ? b[e].push(f) : b[e] = [b[e], f] : b[e] = f)) }); return b } function Qb(a) { var b = []; n(a, function (a, c) { I(a) ? n(a, function (a) { b.push(ja(c, !0) + (!0 === a ? "" : "=" + ja(a, !0))) }) : b.push(ja(c, !0) + (!0 === a ? "" : "=" + ja(a, !0))) }); return b.length ? b.join("&") : "" } function ob(a) {
    return ja(a, !0).replace(/%26/gi, "&").replace(/%3D/gi,
      "=").replace(/%2B/gi, "+")
  } function ja(a, b) { return encodeURIComponent(a).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%3B/gi, ";").replace(/%20/g, b ? "%20" : "+") } function Yd(a, b) { var d, c, e = Oa.length; for (c = 0; c < e; ++c)if (d = Oa[c] + b, E(d = a.getAttribute(d))) return d; return null } function Zd(a, b) {
    var d, c, e = {}; n(Oa, function (b) { b += "app"; !d && a.hasAttribute && a.hasAttribute(b) && (d = a, c = a.getAttribute(b)) }); n(Oa, function (b) {
      b += "app"; var e; !d && (e = a.querySelector("[" + b.replace(":",
        "\\:") + "]")) && (d = e, c = e.getAttribute(b))
    }); d && (e.strictDi = null !== Yd(d, "strict-di"), b(d, c ? [c] : [], e))
  } function yc(a, b, d) {
    H(d) || (d = {}); d = M({ strictDi: !1 }, d); var c = function () {
      a = B(a); if (a.injector()) { var c = a[0] === X ? "document" : ua(a); throw Aa("btstrpd", c.replace(/</, "&lt;").replace(/>/, "&gt;")); } b = b || []; b.unshift(["$provide", function (b) { b.value("$rootElement", a) }]); d.debugInfoEnabled && b.push(["$compileProvider", function (a) { a.debugInfoEnabled(!0) }]); b.unshift("ng"); c = eb(b, d.strictDi); c.invoke(["$rootScope",
        "$rootElement", "$compile", "$injector", function (a, b, c, d) { a.$apply(function () { b.data("$injector", d); c(b)(a) }) }]); return c
    }, e = /^NG_ENABLE_DEBUG_INFO!/, f = /^NG_DEFER_BOOTSTRAP!/; S && e.test(S.name) && (d.debugInfoEnabled = !0, S.name = S.name.replace(e, "")); if (S && !f.test(S.name)) return c(); S.name = S.name.replace(f, ""); fa.resumeBootstrap = function (a) { n(a, function (a) { b.push(a) }); return c() }; z(fa.resumeDeferredBootstrap) && fa.resumeDeferredBootstrap()
  } function $d() { S.name = "NG_ENABLE_DEBUG_INFO!" + S.name; S.location.reload() }
  function ae(a) { a = fa.element(a).injector(); if (!a) throw Aa("test"); return a.get("$$testability") } function zc(a, b) { b = b || "_"; return a.replace(be, function (a, c) { return (c ? b : "") + a.toLowerCase() }) } function ce() {
    var a; if (!Ac) {
      var b = pb(); (oa = q(b) ? S.jQuery : b ? S[b] : u) && oa.fn.on ? (B = oa, M(oa.fn, { scope: Pa.scope, isolateScope: Pa.isolateScope, controller: Pa.controller, injector: Pa.injector, inheritedData: Pa.inheritedData }), a = oa.cleanData, oa.cleanData = function (b) {
        var c; if (Rb) Rb = !1; else for (var e = 0, f; null != (f = b[e]); e++)(c =
          oa._data(f, "events")) && c.$destroy && oa(f).triggerHandler("$destroy"); a(b)
      }) : B = N; fa.element = B; Ac = !0
    }
  } function qb(a, b, d) { if (!a) throw Aa("areq", b || "?", d || "required"); return a } function Qa(a, b, d) { d && I(a) && (a = a[a.length - 1]); qb(z(a), b, "not a function, got " + (a && "object" === typeof a ? a.constructor.name || "Object" : typeof a)); return a } function Ra(a, b) { if ("hasOwnProperty" === a) throw Aa("badname", b); } function Bc(a, b, d) {
    if (!b) return a; b = b.split("."); for (var c, e = a, f = b.length, g = 0; g < f; g++)c = b[g], a && (a = (e = a)[c]); return !d &&
      z(a) ? tc(e, a) : a
  } function rb(a) { for (var b = a[0], d = a[a.length - 1], c, e = 1; b !== d && (b = b.nextSibling); e++)if (c || a[e] !== b) c || (c = B(ra.call(a, 0, e))), c.push(b); return c || a } function $() { return Object.create(null) } function de(a) {
    function b(a, b, c) { return a[b] || (a[b] = c()) } var d = G("$injector"), c = G("ng"); a = b(a, "angular", Object); a.$$minErr = a.$$minErr || G; return b(a, "module", function () {
      var a = {}; return function (f, g, h) {
        if ("hasOwnProperty" === f) throw c("badname", "module"); g && a.hasOwnProperty(f) && (a[f] = null); return b(a, f, function () {
          function a(b,
            d, e, f) { f || (f = c); return function () { f[e || "push"]([b, d, arguments]); return v } } function b(a, d) { return function (b, e) { e && z(e) && (e.$$moduleName = f); c.push([a, d, arguments]); return v } } if (!g) throw d("nomod", f); var c = [], e = [], t = [], A = a("$injector", "invoke", "push", e), v = {
              _invokeQueue: c, _configBlocks: e, _runBlocks: t, requires: g, name: f, provider: b("$provide", "provider"), factory: b("$provide", "factory"), service: b("$provide", "service"), value: a("$provide", "value"), constant: a("$provide", "constant", "unshift"), decorator: b("$provide",
                "decorator"), animation: b("$animateProvider", "register"), filter: b("$filterProvider", "register"), controller: b("$controllerProvider", "register"), directive: b("$compileProvider", "directive"), config: A, run: function (a) { t.push(a); return this }
            }; h && A(h); return v
        })
      }
    })
  } function ee(a) {
    M(a, {
      bootstrap: yc, copy: bb, extend: M, merge: Ud, equals: ma, element: B, forEach: n, injector: eb, noop: x, bind: tc, toJson: db, fromJson: uc, identity: Ya, isUndefined: q, isDefined: y, isString: E, isFunction: z, isObject: H, isNumber: Q, isElement: Nb, isArray: I,
      version: fe, isDate: da, lowercase: F, uppercase: sb, callbacks: { counter: 0 }, getTestability: ae, $$minErr: G, $$csp: Ba, reloadWithDebugInfo: $d
    }); Sb = de(S); Sb("ng", ["ngLocale"], ["$provide", function (a) {
      a.provider({ $$sanitizeUri: ge }); a.provider("$compile", Cc).directive({
        a: he, input: Dc, textarea: Dc, form: ie, script: je, select: ke, style: le, option: me, ngBind: ne, ngBindHtml: oe, ngBindTemplate: pe, ngClass: qe, ngClassEven: re, ngClassOdd: se, ngCloak: te, ngController: ue, ngForm: ve, ngHide: we, ngIf: xe, ngInclude: ye, ngInit: ze, ngNonBindable: Ae,
        ngPluralize: Be, ngRepeat: Ce, ngShow: De, ngStyle: Ee, ngSwitch: Fe, ngSwitchWhen: Ge, ngSwitchDefault: He, ngOptions: Ie, ngTransclude: Je, ngModel: Ke, ngList: Le, ngChange: Me, pattern: Ec, ngPattern: Ec, required: Fc, ngRequired: Fc, minlength: Gc, ngMinlength: Gc, maxlength: Hc, ngMaxlength: Hc, ngValue: Ne, ngModelOptions: Oe
      }).directive({ ngInclude: Pe }).directive(tb).directive(Ic); a.provider({
        $anchorScroll: Qe, $animate: Re, $animateCss: Se, $$animateQueue: Te, $$AnimateRunner: Ue, $browser: Ve, $cacheFactory: We, $controller: Xe, $document: Ye, $exceptionHandler: Ze,
        $filter: Jc, $$forceReflow: $e, $interpolate: af, $interval: bf, $http: cf, $httpParamSerializer: df, $httpParamSerializerJQLike: ef, $httpBackend: ff, $xhrFactory: gf, $location: hf, $log: jf, $parse: kf, $rootScope: lf, $q: mf, $$q: nf, $sce: of, $sceDelegate: pf, $sniffer: qf, $templateCache: rf, $templateRequest: sf, $$testability: tf, $timeout: uf, $window: vf, $$rAF: wf, $$jqLite: xf, $$HashMap: yf, $$cookieReader: zf
      })
    }])
  } function fb(a) { return a.replace(Af, function (a, d, c, e) { return e ? c.toUpperCase() : c }).replace(Bf, "Moz$1") } function Kc(a) {
    a = a.nodeType;
    return 1 === a || !a || 9 === a
  } function Lc(a, b) { var d, c, e = b.createDocumentFragment(), f = []; if (Tb.test(a)) { d = d || e.appendChild(b.createElement("div")); c = (Cf.exec(a) || ["", ""])[1].toLowerCase(); c = ka[c] || ka._default; d.innerHTML = c[1] + a.replace(Df, "<$1></$2>") + c[2]; for (c = c[0]; c--;)d = d.lastChild; f = cb(f, d.childNodes); d = e.firstChild; d.textContent = "" } else f.push(b.createTextNode(a)); e.textContent = ""; e.innerHTML = ""; n(f, function (a) { e.appendChild(a) }); return e } function N(a) {
    if (a instanceof N) return a; var b; E(a) && (a = U(a),
      b = !0); if (!(this instanceof N)) { if (b && "<" != a.charAt(0)) throw Ub("nosel"); return new N(a) } if (b) { b = X; var d; a = (d = Ef.exec(a)) ? [b.createElement(d[1])] : (d = Lc(a, b)) ? d.childNodes : [] } Mc(this, a)
  } function Vb(a) { return a.cloneNode(!0) } function ub(a, b) { b || vb(a); if (a.querySelectorAll) for (var d = a.querySelectorAll("*"), c = 0, e = d.length; c < e; c++)vb(d[c]) } function Nc(a, b, d, c) {
    if (y(c)) throw Ub("offargs"); var e = (c = wb(a)) && c.events, f = c && c.handle; if (f) if (b) {
      var g = function (b) {
        var c = e[b]; y(d) && ab(c || [], d); y(d) && c && 0 < c.length ||
          (a.removeEventListener(b, f, !1), delete e[b])
      }; n(b.split(" "), function (a) { g(a); xb[a] && g(xb[a]) })
    } else for (b in e) "$destroy" !== b && a.removeEventListener(b, f, !1), delete e[b]
  } function vb(a, b) { var d = a.ng339, c = d && gb[d]; c && (b ? delete c.data[b] : (c.handle && (c.events.$destroy && c.handle({}, "$destroy"), Nc(a)), delete gb[d], a.ng339 = u)) } function wb(a, b) { var d = a.ng339, d = d && gb[d]; b && !d && (a.ng339 = d = ++Ff, d = gb[d] = { events: {}, data: {}, handle: u }); return d } function Wb(a, b, d) {
    if (Kc(a)) {
      var c = y(d), e = !c && b && !H(b), f = !b; a = (a = wb(a,
        !e)) && a.data; if (c) a[b] = d; else { if (f) return a; if (e) return a && a[b]; M(a, b) }
    }
  } function yb(a, b) { return a.getAttribute ? -1 < (" " + (a.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ").indexOf(" " + b + " ") : !1 } function zb(a, b) { b && a.setAttribute && n(b.split(" "), function (b) { a.setAttribute("class", U((" " + (a.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " ").replace(" " + U(b) + " ", " "))) }) } function Ab(a, b) {
    if (b && a.setAttribute) {
      var d = (" " + (a.getAttribute("class") || "") + " ").replace(/[\n\t]/g, " "); n(b.split(" "),
        function (a) { a = U(a); -1 === d.indexOf(" " + a + " ") && (d += a + " ") }); a.setAttribute("class", U(d))
    }
  } function Mc(a, b) { if (b) if (b.nodeType) a[a.length++] = b; else { var d = b.length; if ("number" === typeof d && b.window !== b) { if (d) for (var c = 0; c < d; c++)a[a.length++] = b[c] } else a[a.length++] = b } } function Oc(a, b) { return Bb(a, "$" + (b || "ngController") + "Controller") } function Bb(a, b, d) {
    9 == a.nodeType && (a = a.documentElement); for (b = I(b) ? b : [b]; a;) {
      for (var c = 0, e = b.length; c < e; c++)if (y(d = B.data(a, b[c]))) return d; a = a.parentNode || 11 === a.nodeType &&
        a.host
    }
  } function Pc(a) { for (ub(a, !0); a.firstChild;)a.removeChild(a.firstChild) } function Xb(a, b) { b || ub(a); var d = a.parentNode; d && d.removeChild(a) } function Gf(a, b) { b = b || S; if ("complete" === b.document.readyState) b.setTimeout(a); else B(b).on("load", a) } function Qc(a, b) { var d = Cb[b.toLowerCase()]; return d && Rc[ta(a)] && d } function Hf(a, b) {
    var d = function (c, d) {
      c.isDefaultPrevented = function () { return c.defaultPrevented }; var f = b[d || c.type], g = f ? f.length : 0; if (g) {
        if (q(c.immediatePropagationStopped)) {
          var h = c.stopImmediatePropagation;
          c.stopImmediatePropagation = function () { c.immediatePropagationStopped = !0; c.stopPropagation && c.stopPropagation(); h && h.call(c) }
        } c.isImmediatePropagationStopped = function () { return !0 === c.immediatePropagationStopped }; var k = f.specialHandlerWrapper || If; 1 < g && (f = ia(f)); for (var l = 0; l < g; l++)c.isImmediatePropagationStopped() || k(a, c, f[l])
      }
    }; d.elem = a; return d
  } function If(a, b, d) { d.call(a, b) } function Jf(a, b, d) { var c = b.relatedTarget; c && (c === a || Kf.call(a, c)) || d.call(a, b) } function xf() {
    this.$get = function () {
      return M(N,
        { hasClass: function (a, b) { a.attr && (a = a[0]); return yb(a, b) }, addClass: function (a, b) { a.attr && (a = a[0]); return Ab(a, b) }, removeClass: function (a, b) { a.attr && (a = a[0]); return zb(a, b) } })
    }
  } function Ca(a, b) { var d = a && a.$$hashKey; if (d) return "function" === typeof d && (d = a.$$hashKey()), d; d = typeof a; return d = "function" == d || "object" == d && null !== a ? a.$$hashKey = d + ":" + (b || Td)() : d + ":" + a } function Sa(a, b) { if (b) { var d = 0; this.nextUid = function () { return ++d } } n(a, this.put, this) } function Lf(a) {
    return (a = a.toString().replace(Sc, "").match(Tc)) ?
      "function(" + (a[1] || "").replace(/[\s\r\n]+/, " ") + ")" : "fn"
  } function eb(a, b) {
    function d(a) { return function (b, c) { if (H(b)) n(b, pc(a)); else return a(b, c) } } function c(a, b) { Ra(a, "service"); if (z(b) || I(b)) b = t.instantiate(b); if (!b.$get) throw Da("pget", a); return r[a + "Provider"] = b } function e(a, b) { return function () { var c = v.invoke(b, this); if (q(c)) throw Da("undef", a); return c } } function f(a, b, d) { return c(a, { $get: !1 !== d ? e(a, b) : b }) } function g(a) {
      qb(q(a) || I(a), "modulesToLoad", "not an array"); var b = [], c; n(a, function (a) {
        function d(a) {
          var b,
            c; b = 0; for (c = a.length; b < c; b++) { var e = a[b], f = t.get(e[0]); f[e[1]].apply(f, e[2]) }
        } if (!m.get(a)) { m.put(a, !0); try { E(a) ? (c = Sb(a), b = b.concat(g(c.requires)).concat(c._runBlocks), d(c._invokeQueue), d(c._configBlocks)) : z(a) ? b.push(t.invoke(a)) : I(a) ? b.push(t.invoke(a)) : Qa(a, "module") } catch (e) { throw I(a) && (a = a[a.length - 1]), e.message && e.stack && -1 == e.stack.indexOf(e.message) && (e = e.message + "\n" + e.stack), Da("modulerr", a, e.stack || e.message || e); } }
      }); return b
    } function h(a, c) {
      function d(b, e) {
        if (a.hasOwnProperty(b)) {
          if (a[b] ===
            k) throw Da("cdep", b + " <- " + l.join(" <- ")); return a[b]
        } try { return l.unshift(b), a[b] = k, a[b] = c(b, e) } catch (f) { throw a[b] === k && delete a[b], f; } finally { l.shift() }
      } function e(a, c, f, g) { "string" === typeof f && (g = f, f = null); var h = [], k = eb.$$annotate(a, b, g), l, m, t; m = 0; for (l = k.length; m < l; m++) { t = k[m]; if ("string" !== typeof t) throw Da("itkn", t); h.push(f && f.hasOwnProperty(t) ? f[t] : d(t, g)) } I(a) && (a = a[l]); return a.apply(c, h) } return {
        invoke: e, instantiate: function (a, b, c) {
          var d = Object.create((I(a) ? a[a.length - 1] : a).prototype ||
            null); a = e(a, d, b, c); return H(a) || z(a) ? a : d
        }, get: d, annotate: eb.$$annotate, has: function (b) { return r.hasOwnProperty(b + "Provider") || a.hasOwnProperty(b) }
      }
    } b = !0 === b; var k = {}, l = [], m = new Sa([], !0), r = {
      $provide: {
        provider: d(c), factory: d(f), service: d(function (a, b) { return f(a, ["$injector", function (a) { return a.instantiate(b) }]) }), value: d(function (a, b) { return f(a, na(b), !1) }), constant: d(function (a, b) { Ra(a, "constant"); r[a] = b; A[a] = b }), decorator: function (a, b) {
          var c = t.get(a + "Provider"), d = c.$get; c.$get = function () {
            var a =
              v.invoke(d, c); return v.invoke(b, null, { $delegate: a })
          }
        }
      }
    }, t = r.$injector = h(r, function (a, b) { fa.isString(b) && l.push(b); throw Da("unpr", l.join(" <- ")); }), A = {}, v = A.$injector = h(A, function (a, b) { var c = t.get(a + "Provider", b); return v.invoke(c.$get, c, u, a) }); n(g(a), function (a) { a && v.invoke(a) }); return v
  } function Qe() {
    var a = !0; this.disableAutoScrolling = function () { a = !1 }; this.$get = ["$window", "$location", "$rootScope", function (b, d, c) {
      function e(a) {
        var b = null; Array.prototype.some.call(a, function (a) {
          if ("a" === ta(a)) return b =
            a, !0
        }); return b
      } function f(a) { if (a) { a.scrollIntoView(); var c; c = g.yOffset; z(c) ? c = c() : Nb(c) ? (c = c[0], c = "fixed" !== b.getComputedStyle(c).position ? 0 : c.getBoundingClientRect().bottom) : Q(c) || (c = 0); c && (a = a.getBoundingClientRect().top, b.scrollBy(0, a - c)) } else b.scrollTo(0, 0) } function g(a) { a = E(a) ? a : d.hash(); var b; a ? (b = h.getElementById(a)) ? f(b) : (b = e(h.getElementsByName(a))) ? f(b) : "top" === a && f(null) : f(null) } var h = b.document; a && c.$watch(function () { return d.hash() }, function (a, b) { a === b && "" === a || Gf(function () { c.$evalAsync(g) }) });
      return g
    }]
  } function hb(a, b) { if (!a && !b) return ""; if (!a) return b; if (!b) return a; I(a) && (a = a.join(" ")); I(b) && (b = b.join(" ")); return a + " " + b } function Mf(a) { E(a) && (a = a.split(" ")); var b = $(); n(a, function (a) { a.length && (b[a] = !0) }); return b } function Ea(a) { return H(a) ? a : {} } function Nf(a, b, d, c) {
    function e(a) { try { a.apply(null, ra.call(arguments, 1)) } finally { if (v-- , 0 === v) for (; T.length;)try { T.pop()() } catch (b) { d.error(b) } } } function f() { L = null; g(); h() } function g() {
      a: { try { p = m.state; break a } catch (a) { } p = void 0 } p = q(p) ?
        null : p; ma(p, J) && (p = J); J = p
    } function h() { if (w !== k.url() || C !== p) w = k.url(), C = p, n(aa, function (a) { a(k.url(), p) }) } var k = this, l = a.location, m = a.history, r = a.setTimeout, t = a.clearTimeout, A = {}; k.isMock = !1; var v = 0, T = []; k.$$completeOutstandingRequest = e; k.$$incOutstandingRequestCount = function () { v++ }; k.notifyWhenNoOutstandingRequests = function (a) { 0 === v ? a() : T.push(a) }; var p, C, w = l.href, ga = b.find("base"), L = null; g(); C = p; k.url = function (b, d, e) {
      q(e) && (e = null); l !== a.location && (l = a.location); m !== a.history && (m = a.history); if (b) {
        var f =
          C === e; if (w === b && (!c.history || f)) return k; var h = w && Fa(w) === Fa(b); w = b; C = e; if (!c.history || h && f) { if (!h || L) L = b; d ? l.replace(b) : h ? (d = l, e = b.indexOf("#"), e = -1 === e ? "" : b.substr(e), d.hash = e) : l.href = b; l.href !== b && (L = b) } else m[d ? "replaceState" : "pushState"](e, "", b), g(), C = p; return k
      } return L || l.href.replace(/%27/g, "'")
    }; k.state = function () { return p }; var aa = [], D = !1, J = null; k.onUrlChange = function (b) { if (!D) { if (c.history) B(a).on("popstate", f); B(a).on("hashchange", f); D = !0 } aa.push(b); return b }; k.$$applicationDestroyed = function () {
      B(a).off("hashchange popstate",
        f)
    }; k.$$checkUrlChange = h; k.baseHref = function () { var a = ga.attr("href"); return a ? a.replace(/^(https?\:)?\/\/[^\/]*/, "") : "" }; k.defer = function (a, b) { var c; v++; c = r(function () { delete A[c]; e(a) }, b || 0); A[c] = !0; return c }; k.defer.cancel = function (a) { return A[a] ? (delete A[a], t(a), e(x), !0) : !1 }
  } function Ve() { this.$get = ["$window", "$log", "$sniffer", "$document", function (a, b, d, c) { return new Nf(a, c, b, d) }] } function We() {
    this.$get = function () {
      function a(a, c) {
        function e(a) {
          a != r && (t ? t == a && (t = a.n) : t = a, f(a.n, a.p), f(a, r), r = a,
            r.n = null)
        } function f(a, b) { a != b && (a && (a.p = b), b && (b.n = a)) } if (a in b) throw G("$cacheFactory")("iid", a); var g = 0, h = M({}, c, { id: a }), k = $(), l = c && c.capacity || Number.MAX_VALUE, m = $(), r = null, t = null; return b[a] = {
          put: function (a, b) { if (!q(b)) { if (l < Number.MAX_VALUE) { var c = m[a] || (m[a] = { key: a }); e(c) } a in k || g++; k[a] = b; g > l && this.remove(t.key); return b } }, get: function (a) { if (l < Number.MAX_VALUE) { var b = m[a]; if (!b) return; e(b) } return k[a] }, remove: function (a) {
            if (l < Number.MAX_VALUE) {
              var b = m[a]; if (!b) return; b == r && (r = b.p); b == t &&
                (t = b.n); f(b.n, b.p); delete m[a]
            } a in k && (delete k[a], g--)
          }, removeAll: function () { k = $(); g = 0; m = $(); r = t = null }, destroy: function () { m = h = k = null; delete b[a] }, info: function () { return M({}, h, { size: g }) }
        }
      } var b = {}; a.info = function () { var a = {}; n(b, function (b, e) { a[e] = b.info() }); return a }; a.get = function (a) { return b[a] }; return a
    }
  } function rf() { this.$get = ["$cacheFactory", function (a) { return a("templates") }] } function Cc(a, b) {
    function d(a, b, c) {
      var d = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/, e = {}; n(a, function (a, f) {
        var g = a.match(d);
        if (!g) throw ha("iscp", b, f, a, c ? "controller bindings definition" : "isolate scope definition"); e[f] = { mode: g[1][0], collection: "*" === g[2], optional: "?" === g[3], attrName: g[4] || f }
      }); return e
    } function c(a) { var b = a.charAt(0); if (!b || b !== F(b)) throw ha("baddir", a); if (a !== a.trim()) throw ha("baddir", a); } var e = {}, f = /^\s*directive\:\s*([\w\-]+)\s+(.*)$/, g = /(([\w\-]+)(?:\:([^;]+))?;?)/, h = Wd("ngSrc,ngSrcset,src,srcset"), k = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/, l = /^(on[a-z]+|formaction)$/; this.directive = function t(b, f) {
      Ra(b, "directive");
      E(b) ? (c(b), qb(f, "directiveFactory"), e.hasOwnProperty(b) || (e[b] = [], a.factory(b + "Directive", ["$injector", "$exceptionHandler", function (a, c) {
        var f = []; n(e[b], function (e, g) {
          try {
            var h = a.invoke(e); z(h) ? h = { compile: na(h) } : !h.compile && h.link && (h.compile = na(h.link)); h.priority = h.priority || 0; h.index = g; h.name = h.name || b; h.require = h.require || h.controller && h.name; h.restrict = h.restrict || "EA"; var k = h, l = h, m = h.name, t = { isolateScope: null, bindToController: null }; H(l.scope) && (!0 === l.bindToController ? (t.bindToController = d(l.scope,
              m, !0), t.isolateScope = {}) : t.isolateScope = d(l.scope, m, !1)); H(l.bindToController) && (t.bindToController = d(l.bindToController, m, !0)); if (H(t.bindToController)) { var v = l.controller, R = l.controllerAs; if (!v) throw ha("noctrl", m); var V; a: if (R && E(R)) V = R; else { if (E(v)) { var n = Uc.exec(v); if (n) { V = n[3]; break a } } V = void 0 } if (!V) throw ha("noident", m); } var s = k.$$bindings = t; H(s.isolateScope) && (h.$$isolateBindings = s.isolateScope); h.$$moduleName = e.$$moduleName; f.push(h)
          } catch (u) { c(u) }
        }); return f
      }])), e[b].push(f)) : n(b, pc(t));
      return this
    }; this.aHrefSanitizationWhitelist = function (a) { return y(a) ? (b.aHrefSanitizationWhitelist(a), this) : b.aHrefSanitizationWhitelist() }; this.imgSrcSanitizationWhitelist = function (a) { return y(a) ? (b.imgSrcSanitizationWhitelist(a), this) : b.imgSrcSanitizationWhitelist() }; var m = !0; this.debugInfoEnabled = function (a) { return y(a) ? (m = a, this) : m }; this.$get = ["$injector", "$interpolate", "$exceptionHandler", "$templateRequest", "$parse", "$controller", "$rootScope", "$document", "$sce", "$animate", "$$sanitizeUri", function (a,
      b, c, d, p, C, w, ga, L, aa, D) {
      function J(a, b) { try { a.addClass(b) } catch (c) { } } function K(a, b, c, d, e) {
        a instanceof B || (a = B(a)); n(a, function (b, c) { b.nodeType == Na && b.nodeValue.match(/\S+/) && (a[c] = B(b).wrap("<span></span>").parent()[0]) }); var f = O(a, b, a, c, d, e); K.$$addScopeClass(a); var g = null; return function (b, c, d) {
          qb(b, "scope"); e && e.needsNewScope && (b = b.$parent.$new()); d = d || {}; var h = d.parentBoundTranscludeFn, k = d.transcludeControllers; d = d.futureParentElement; h && h.$$boundTransclude && (h = h.$$boundTransclude); g || (g = (d =
            d && d[0]) ? "foreignobject" !== ta(d) && d.toString().match(/SVG/) ? "svg" : "html" : "html"); d = "html" !== g ? B(Yb(g, B("<div>").append(a).html())) : c ? Pa.clone.call(a) : a; if (k) for (var l in k) d.data("$" + l + "Controller", k[l].instance); K.$$addScopeInfo(d, b); c && c(d, b); f && f(b, d, d, h); return d
        }
      } function O(a, b, c, d, e, f) {
        function g(a, c, d, e) {
          var f, k, l, m, t, w, D; if (p) for (D = Array(c.length), m = 0; m < h.length; m += 3)f = h[m], D[f] = c[f]; else D = c; m = 0; for (t = h.length; m < t;)k = D[h[m++]], c = h[m++], f = h[m++], c ? (c.scope ? (l = a.$new(), K.$$addScopeInfo(B(k),
            l)) : l = a, w = c.transcludeOnThisElement ? R(a, c.transclude, e) : !c.templateOnThisElement && e ? e : !e && b ? R(a, b) : null, c(f, l, k, d, w)) : f && f(a, k.childNodes, u, e)
        } for (var h = [], k, l, m, t, p, w = 0; w < a.length; w++) { k = new fa; l = V(a[w], [], k, 0 === w ? d : u, e); (f = l.length ? Z(l, a[w], k, b, c, null, [], [], f) : null) && f.scope && K.$$addScopeClass(k.$$element); k = f && f.terminal || !(m = a[w].childNodes) || !m.length ? null : O(m, f ? (f.transcludeOnThisElement || !f.templateOnThisElement) && f.transclude : b); if (f || k) h.push(w, f, k), t = !0, p = p || f; f = null } return t ? g : null
      } function R(a,
        b, c) { return function (d, e, f, g, h) { d || (d = a.$new(!1, h), d.$$transcluded = !0); return b(d, e, { parentBoundTranscludeFn: c, transcludeControllers: f, futureParentElement: g }) } } function V(a, b, c, d, e) {
          var h = c.$attr, k; switch (a.nodeType) {
            case 1: P(b, va(ta(a)), "E", d, e); for (var l, m, t, p = a.attributes, w = 0, D = p && p.length; w < D; w++) {
              var K = !1, A = !1; l = p[w]; k = l.name; m = U(l.value); l = va(k); if (t = ka.test(l)) k = k.replace(Vc, "").substr(8).replace(/_(.)/g, function (a, b) { return b.toUpperCase() }); (l = l.match(la)) && G(l[1]) && (K = k, A = k.substr(0, k.length -
                5) + "end", k = k.substr(0, k.length - 6)); l = va(k.toLowerCase()); h[l] = k; if (t || !c.hasOwnProperty(l)) c[l] = m, Qc(a, l) && (c[l] = !0); W(a, b, m, l, t); P(b, l, "A", d, e, K, A)
            } a = a.className; H(a) && (a = a.animVal); if (E(a) && "" !== a) for (; k = g.exec(a);)l = va(k[2]), P(b, l, "C", d, e) && (c[l] = U(k[3])), a = a.substr(k.index + k[0].length); break; case Na: if (11 === Ha) for (; a.parentNode && a.nextSibling && a.nextSibling.nodeType === Na;)a.nodeValue += a.nextSibling.nodeValue, a.parentNode.removeChild(a.nextSibling); N(b, a.nodeValue); break; case 8: try {
              if (k = f.exec(a.nodeValue)) l =
                va(k[1]), P(b, l, "M", d, e) && (c[l] = U(k[2]))
            } catch (R) { }
          }b.sort(Ia); return b
        } function Ta(a, b, c) { var d = [], e = 0; if (b && a.hasAttribute && a.hasAttribute(b)) { do { if (!a) throw ha("uterdir", b, c); 1 == a.nodeType && (a.hasAttribute(b) && e++ , a.hasAttribute(c) && e--); d.push(a); a = a.nextSibling } while (0 < e) } else d.push(a); return B(d) } function s(a, b, c) { return function (d, e, f, g, h) { e = Ta(e[0], b, c); return a(d, e, f, g, h) } } function Z(a, b, d, e, f, g, h, l, m) {
          function t(a, b, c, d) {
            if (a) {
              c && (a = s(a, c, d)); a.require = q.require; a.directiveName = x; if (O ===
                q || q.$$isolateScope) a = ca(a, { isolateScope: !0 }); h.push(a)
            } if (b) { c && (b = s(b, c, d)); b.require = q.require; b.directiveName = x; if (O === q || q.$$isolateScope) b = ca(b, { isolateScope: !0 }); l.push(b) }
          } function p(a, b, c, d) {
            var e; if (E(b)) { var f = b.match(k); b = b.substring(f[0].length); var g = f[1] || f[3], f = "?" === f[2]; "^^" === g ? c = c.parent() : e = (e = d && d[b]) && e.instance; e || (d = "$" + b + "Controller", e = g ? c.inheritedData(d) : c.data(d)); if (!e && !f) throw ha("ctreq", b, a); } else if (I(b)) for (e = [], g = 0, f = b.length; g < f; g++)e[g] = p(a, b[g], c, d); return e ||
              null
          } function w(a, b, c, d, e, f) { var g = $(), h; for (h in d) { var k = d[h], l = { $scope: k === O || k.$$isolateScope ? e : f, $element: a, $attrs: b, $transclude: c }, m = k.controller; "@" == m && (m = b[k.name]); l = C(m, l, !0, k.controllerAs); g[k.name] = l; aa || a.data("$" + k.name + "Controller", l.instance) } return g } function D(a, c, e, f, g) {
            function k(a, b, c) { var d; Za(a) || (c = b, b = a, a = u); aa && (d = v); c || (c = aa ? V.parent() : V); return g(a, b, d, c, Ta) } var m, t, A, v, C, V, Ga; b === e ? (f = d, V = d.$$element) : (V = B(e), f = new fa(V, d)); A = c; O ? t = c.$new(!0) : R && (A = c.$parent); g && (C = k,
              C.$$boundTransclude = g); T && (v = w(V, f, C, T, t, c)); O && (K.$$addScopeInfo(V, t, !0, !(J && (J === O || J === O.$$originalDirective))), K.$$addScopeClass(V, !0), t.$$isolateBindings = O.$$isolateBindings, (Ga = ba(c, f, t, t.$$isolateBindings, O)) && t.$on("$destroy", Ga)); for (var n in v) { Ga = T[n]; var ga = v[n], L = Ga.$$bindings.bindToController; ga.identifier && L && (m = ba(A, f, ga.instance, L, Ga)); var q = ga(); q !== ga.instance && (ga.instance = q, V.data("$" + Ga.name + "Controller", q), m && m(), m = ba(A, f, ga.instance, L, Ga)) } F = 0; for (M = h.length; F < M; F++)m = h[F],
                ea(m, m.isolateScope ? t : c, V, f, m.require && p(m.directiveName, m.require, V, v), C); var Ta = c; O && (O.template || null === O.templateUrl) && (Ta = t); a && a(Ta, e.childNodes, u, g); for (F = l.length - 1; 0 <= F; F--)m = l[F], ea(m, m.isolateScope ? t : c, V, f, m.require && p(m.directiveName, m.require, V, v), C)
          } m = m || {}; for (var A = -Number.MAX_VALUE, R = m.newScopeDirective, T = m.controllerDirectives, O = m.newIsolateScopeDirective, J = m.templateDirective, n = m.nonTlbTranscludeDirective, ga = !1, L = !1, aa = m.hasElementTranscludeDirective, Z = d.$$element = B(b), q, x, P, Ia =
            e, G, F = 0, M = a.length; F < M; F++) {
            q = a[F]; var N = q.$$start, Q = q.$$end; N && (Z = Ta(b, N, Q)); P = u; if (A > q.priority) break; if (P = q.scope) q.templateUrl || (H(P) ? (Ua("new/isolated scope", O || R, q, Z), O = q) : Ua("new/isolated scope", O, q, Z)), R = R || q; x = q.name; !q.templateUrl && q.controller && (P = q.controller, T = T || $(), Ua("'" + x + "' controller", T[x], q, Z), T[x] = q); if (P = q.transclude) ga = !0, q.$$tlb || (Ua("transclusion", n, q, Z), n = q), "element" == P ? (aa = !0, A = q.priority, P = Z, Z = d.$$element = B(X.createComment(" " + x + ": " + d[x] + " ")), b = Z[0], Y(f, ra.call(P, 0),
              b), Ia = K(P, e, A, g && g.name, { nonTlbTranscludeDirective: n })) : (P = B(Vb(b)).contents(), Z.empty(), Ia = K(P, e, u, u, { needsNewScope: q.$$isolateScope || q.$$newScope })); if (q.template) if (L = !0, Ua("template", J, q, Z), J = q, P = z(q.template) ? q.template(Z, d) : q.template, P = ja(P), q.replace) { g = q; P = Tb.test(P) ? Xc(Yb(q.templateNamespace, U(P))) : []; b = P[0]; if (1 != P.length || 1 !== b.nodeType) throw ha("tplrt", x, ""); Y(f, Z, b); P = { $attr: {} }; var Wc = V(b, [], P), W = a.splice(F + 1, a.length - (F + 1)); (O || R) && y(Wc, O, R); a = a.concat(Wc).concat(W); S(d, P); M = a.length } else Z.html(P);
            if (q.templateUrl) L = !0, Ua("template", J, q, Z), J = q, q.replace && (g = q), D = Of(a.splice(F, a.length - F), Z, d, f, ga && Ia, h, l, { controllerDirectives: T, newScopeDirective: R !== q && R, newIsolateScopeDirective: O, templateDirective: J, nonTlbTranscludeDirective: n }), M = a.length; else if (q.compile) try { G = q.compile(Z, d, Ia), z(G) ? t(null, G, N, Q) : G && t(G.pre, G.post, N, Q) } catch (da) { c(da, ua(Z)) } q.terminal && (D.terminal = !0, A = Math.max(A, q.priority))
          } D.scope = R && !0 === R.scope; D.transcludeOnThisElement = ga; D.templateOnThisElement = L; D.transclude = Ia;
          m.hasElementTranscludeDirective = aa; return D
        } function y(a, b, c) { for (var d = 0, e = a.length; d < e; d++)a[d] = Ob(a[d], { $$isolateScope: b, $$newScope: c }) } function P(b, d, f, g, h, k, l) { if (d === h) return null; h = null; if (e.hasOwnProperty(d)) { var m; d = a.get(d + "Directive"); for (var p = 0, w = d.length; p < w; p++)try { m = d[p], (q(g) || g > m.priority) && -1 != m.restrict.indexOf(f) && (k && (m = Ob(m, { $$start: k, $$end: l })), b.push(m), h = m) } catch (D) { c(D) } } return h } function G(b) {
          if (e.hasOwnProperty(b)) for (var c = a.get(b + "Directive"), d = 0, f = c.length; d < f; d++)if (b =
            c[d], b.multiElement) return !0; return !1
        } function S(a, b) { var c = b.$attr, d = a.$attr, e = a.$$element; n(a, function (d, e) { "$" != e.charAt(0) && (b[e] && b[e] !== d && (d += ("style" === e ? ";" : " ") + b[e]), a.$set(e, d, !0, c[e])) }); n(b, function (b, f) { "class" == f ? (J(e, b), a["class"] = (a["class"] ? a["class"] + " " : "") + b) : "style" == f ? (e.attr("style", e.attr("style") + ";" + b), a.style = (a.style ? a.style + ";" : "") + b) : "$" == f.charAt(0) || a.hasOwnProperty(f) || (a[f] = b, d[f] = c[f]) }) } function Of(a, b, c, e, f, g, h, k) {
          var l = [], m, t, p = b[0], w = a.shift(), D = Ob(w, {
            templateUrl: null,
            transclude: null, replace: null, $$originalDirective: w
          }), A = z(w.templateUrl) ? w.templateUrl(b, c) : w.templateUrl, K = w.templateNamespace; b.empty(); d(A).then(function (d) {
            var T, v; d = ja(d); if (w.replace) { d = Tb.test(d) ? Xc(Yb(K, U(d))) : []; T = d[0]; if (1 != d.length || 1 !== T.nodeType) throw ha("tplrt", w.name, A); d = { $attr: {} }; Y(e, b, T); var C = V(T, [], d); H(w.scope) && y(C, !0); a = C.concat(a); S(c, d) } else T = p, b.html(d); a.unshift(D); m = Z(a, T, c, f, b, w, g, h, k); n(e, function (a, c) { a == T && (e[c] = b[0]) }); for (t = O(b[0].childNodes, f); l.length;) {
              d = l.shift();
              v = l.shift(); var ga = l.shift(), L = l.shift(), C = b[0]; if (!d.$$destroyed) { if (v !== p) { var q = v.className; k.hasElementTranscludeDirective && w.replace || (C = Vb(T)); Y(ga, B(v), C); J(B(C), q) } v = m.transcludeOnThisElement ? R(d, m.transclude, L) : L; m(t, d, C, e, v) }
            } l = null
          }); return function (a, b, c, d, e) { a = e; b.$$destroyed || (l ? l.push(b, c, d, a) : (m.transcludeOnThisElement && (a = R(b, m.transclude, e)), m(t, b, c, d, a))) }
        } function Ia(a, b) { var c = b.priority - a.priority; return 0 !== c ? c : a.name !== b.name ? a.name < b.name ? -1 : 1 : a.index - b.index } function Ua(a,
          b, c, d) { function e(a) { return a ? " (module: " + a + ")" : "" } if (b) throw ha("multidir", b.name, e(b.$$moduleName), c.name, e(c.$$moduleName), a, ua(d)); } function N(a, c) { var d = b(c, !0); d && a.push({ priority: 0, compile: function (a) { a = a.parent(); var b = !!a.length; b && K.$$addBindingClass(a); return function (a, c) { var e = c.parent(); b || K.$$addBindingClass(e); K.$$addBindingInfo(e, d.expressions); a.$watch(d, function (a) { c[0].nodeValue = a }) } } }) } function Yb(a, b) {
            a = F(a || "html"); switch (a) {
              case "svg": case "math": var c = X.createElement("div");
                c.innerHTML = "<" + a + ">" + b + "</" + a + ">"; return c.childNodes[0].childNodes; default: return b
            }
          } function Q(a, b) { if ("srcdoc" == b) return L.HTML; var c = ta(a); if ("xlinkHref" == b || "form" == c && "action" == b || "img" != c && ("src" == b || "ngSrc" == b)) return L.RESOURCE_URL } function W(a, c, d, e, f) {
            var g = Q(a, e); f = h[e] || f; var k = b(d, !0, g, f); if (k) {
              if ("multiple" === e && "select" === ta(a)) throw ha("selmulti", ua(a)); c.push({
                priority: 100, compile: function () {
                  return {
                    pre: function (a, c, h) {
                      c = h.$$observers || (h.$$observers = $()); if (l.test(e)) throw ha("nodomevents");
                      var m = h[e]; m !== d && (k = m && b(m, !0, g, f), d = m); k && (h[e] = k(a), (c[e] || (c[e] = [])).$$inter = !0, (h.$$observers && h.$$observers[e].$$scope || a).$watch(k, function (a, b) { "class" === e && a != b ? h.$updateClass(a, b) : h.$set(e, a) }))
                    }
                  }
                }
              })
            }
          } function Y(a, b, c) {
            var d = b[0], e = b.length, f = d.parentNode, g, h; if (a) for (g = 0, h = a.length; g < h; g++)if (a[g] == d) { a[g++] = c; h = g + e - 1; for (var k = a.length; g < k; g++ , h++)h < k ? a[g] = a[h] : delete a[g]; a.length -= e - 1; a.context === d && (a.context = c); break } f && f.replaceChild(c, d); a = X.createDocumentFragment(); a.appendChild(d);
            B.hasData(d) && (B.data(c, B.data(d)), oa ? (Rb = !0, oa.cleanData([d])) : delete B.cache[d[B.expando]]); d = 1; for (e = b.length; d < e; d++)f = b[d], B(f).remove(), a.appendChild(f), delete b[d]; b[0] = c; b.length = 1
          } function ca(a, b) { return M(function () { return a.apply(null, arguments) }, a, b) } function ea(a, b, d, e, f, g) { try { a(b, d, e, f, g) } catch (h) { c(h, ua(d)) } } function ba(a, c, d, e, f) {
            var g = []; n(e, function (e, h) {
              var k = e.attrName, l = e.optional, m, t, w, D; switch (e.mode) {
                case "@": l || qa.call(c, k) || (d[h] = c[k] = void 0); c.$observe(k, function (a) {
                  E(a) &&
                    (d[h] = a)
                }); c.$$observers[k].$$scope = a; E(c[k]) && (d[h] = b(c[k])(a)); break; case "=": if (!qa.call(c, k)) { if (l) break; c[k] = void 0 } if (l && !c[k]) break; t = p(c[k]); D = t.literal ? ma : function (a, b) { return a === b || a !== a && b !== b }; w = t.assign || function () { m = d[h] = t(a); throw ha("nonassign", c[k], f.name); }; m = d[h] = t(a); l = function (b) { D(b, d[h]) || (D(b, m) ? w(a, b = d[h]) : d[h] = b); return m = b }; l.$stateful = !0; l = e.collection ? a.$watchCollection(c[k], l) : a.$watch(p(c[k], l), null, t.literal); g.push(l); break; case "&": t = c.hasOwnProperty(k) ? p(c[k]) :
                  x; if (t === x && l) break; d[h] = function (b) { return t(a, b) }
              }
            }); return g.length && function () { for (var a = 0, b = g.length; a < b; ++a)g[a]() }
          } var fa = function (a, b) { if (b) { var c = Object.keys(b), d, e, f; d = 0; for (e = c.length; d < e; d++)f = c[d], this[f] = b[f] } else this.$attr = {}; this.$$element = a }; fa.prototype = {
            $normalize: va, $addClass: function (a) { a && 0 < a.length && aa.addClass(this.$$element, a) }, $removeClass: function (a) { a && 0 < a.length && aa.removeClass(this.$$element, a) }, $updateClass: function (a, b) {
              var c = Yc(a, b); c && c.length && aa.addClass(this.$$element,
                c); (c = Yc(b, a)) && c.length && aa.removeClass(this.$$element, c)
            }, $set: function (a, b, d, e) {
              var f = Qc(this.$$element[0], a), g = Zc[a], h = a; f ? (this.$$element.prop(a, b), e = f) : g && (this[g] = b, h = g); this[a] = b; e ? this.$attr[a] = e : (e = this.$attr[a]) || (this.$attr[a] = e = zc(a, "-")); f = ta(this.$$element); if ("a" === f && "href" === a || "img" === f && "src" === a) this[a] = b = D(b, "src" === a); else if ("img" === f && "srcset" === a) {
                for (var f = "", g = U(b), k = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/, k = /\s/.test(g) ? k : /(,)/, g = g.split(k), k = Math.floor(g.length / 2), l = 0; l <
                  k; l++)var m = 2 * l, f = f + D(U(g[m]), !0), f = f + (" " + U(g[m + 1])); g = U(g[2 * l]).split(/\s/); f += D(U(g[0]), !0); 2 === g.length && (f += " " + U(g[1])); this[a] = b = f
              } !1 !== d && (null === b || q(b) ? this.$$element.removeAttr(e) : this.$$element.attr(e, b)); (a = this.$$observers) && n(a[h], function (a) { try { a(b) } catch (d) { c(d) } })
            }, $observe: function (a, b) { var c = this, d = c.$$observers || (c.$$observers = $()), e = d[a] || (d[a] = []); e.push(b); w.$evalAsync(function () { e.$$inter || !c.hasOwnProperty(a) || q(c[a]) || b(c[a]) }); return function () { ab(e, b) } }
          }; var da = b.startSymbol(),
            ia = b.endSymbol(), ja = "{{" == da || "}}" == ia ? Ya : function (a) { return a.replace(/\{\{/g, da).replace(/}}/g, ia) }, ka = /^ngAttr[A-Z]/, la = /^(.+)Start$/; K.$$addBindingInfo = m ? function (a, b) { var c = a.data("$binding") || []; I(b) ? c = c.concat(b) : c.push(b); a.data("$binding", c) } : x; K.$$addBindingClass = m ? function (a) { J(a, "ng-binding") } : x; K.$$addScopeInfo = m ? function (a, b, c, d) { a.data(c ? d ? "$isolateScopeNoTemplate" : "$isolateScope" : "$scope", b) } : x; K.$$addScopeClass = m ? function (a, b) { J(a, b ? "ng-isolate-scope" : "ng-scope") } : x; return K
    }]
  } function va(a) {
    return fb(a.replace(Vc,
      ""))
  } function Yc(a, b) { var d = "", c = a.split(/\s+/), e = b.split(/\s+/), f = 0; a: for (; f < c.length; f++) { for (var g = c[f], h = 0; h < e.length; h++)if (g == e[h]) continue a; d += (0 < d.length ? " " : "") + g } return d } function Xc(a) { a = B(a); var b = a.length; if (1 >= b) return a; for (; b--;)8 === a[b].nodeType && Pf.call(a, b, 1); return a } function Xe() {
    var a = {}, b = !1; this.register = function (b, c) { Ra(b, "controller"); H(b) ? M(a, b) : a[b] = c }; this.allowGlobals = function () { b = !0 }; this.$get = ["$injector", "$window", function (d, c) {
      function e(a, b, c, d) {
        if (!a || !H(a.$scope)) throw G("$controller")("noscp",
          d, b); a.$scope[b] = c
      } return function (f, g, h, k) { var l, m, r; h = !0 === h; k && E(k) && (r = k); if (E(f)) { k = f.match(Uc); if (!k) throw Qf("ctrlfmt", f); m = k[1]; r = r || k[3]; f = a.hasOwnProperty(m) ? a[m] : Bc(g.$scope, m, !0) || (b ? Bc(c, m, !0) : u); Qa(f, m, !0) } if (h) return h = (I(f) ? f[f.length - 1] : f).prototype, l = Object.create(h || null), r && e(g, r, l, m || f.name), M(function () { var a = d.invoke(f, l, g, m); a !== l && (H(a) || z(a)) && (l = a, r && e(g, r, l, m || f.name)); return l }, { instance: l, identifier: r }); l = d.instantiate(f, g, m); r && e(g, r, l, m || f.name); return l }
    }]
  } function Ye() {
    this.$get =
      ["$window", function (a) { return B(a.document) }]
  } function Ze() { this.$get = ["$log", function (a) { return function (b, d) { a.error.apply(a, arguments) } }] } function Zb(a) { return H(a) ? da(a) ? a.toISOString() : db(a) : a } function df() { this.$get = function () { return function (a) { if (!a) return ""; var b = []; oc(a, function (a, c) { null === a || q(a) || (I(a) ? n(a, function (a, d) { b.push(ja(c) + "=" + ja(Zb(a))) }) : b.push(ja(c) + "=" + ja(Zb(a)))) }); return b.join("&") } } } function ef() {
    this.$get = function () {
      return function (a) {
        function b(a, e, f) {
          null === a || q(a) ||
            (I(a) ? n(a, function (a, c) { b(a, e + "[" + (H(a) ? c : "") + "]") }) : H(a) && !da(a) ? oc(a, function (a, c) { b(a, e + (f ? "" : "[") + c + (f ? "" : "]")) }) : d.push(ja(e) + "=" + ja(Zb(a))))
        } if (!a) return ""; var d = []; b(a, "", !0); return d.join("&")
      }
    }
  } function $b(a, b) { if (E(a)) { var d = a.replace(Rf, "").trim(); if (d) { var c = b("Content-Type"); (c = c && 0 === c.indexOf($c)) || (c = (c = d.match(Sf)) && Tf[c[0]].test(d)); c && (a = uc(d)) } } return a } function ad(a) {
    var b = $(), d; E(a) ? n(a.split("\n"), function (a) {
      d = a.indexOf(":"); var e = F(U(a.substr(0, d))); a = U(a.substr(d + 1)); e &&
        (b[e] = b[e] ? b[e] + ", " + a : a)
    }) : H(a) && n(a, function (a, d) { var f = F(d), g = U(a); f && (b[f] = b[f] ? b[f] + ", " + g : g) }); return b
  } function bd(a) { var b; return function (d) { b || (b = ad(a)); return d ? (d = b[F(d)], void 0 === d && (d = null), d) : b } } function cd(a, b, d, c) { if (z(c)) return c(a, b, d); n(c, function (c) { a = c(a, b, d) }); return a } function cf() {
    var a = this.defaults = {
      transformResponse: [$b], transformRequest: [function (a) { return H(a) && "[object File]" !== sa.call(a) && "[object Blob]" !== sa.call(a) && "[object FormData]" !== sa.call(a) ? db(a) : a }], headers: {
        common: { Accept: "application/json, text/plain, */*" },
        post: ia(ac), put: ia(ac), patch: ia(ac)
      }, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", paramSerializer: "$httpParamSerializer"
    }, b = !1; this.useApplyAsync = function (a) { return y(a) ? (b = !!a, this) : b }; var d = !0; this.useLegacyPromiseExtensions = function (a) { return y(a) ? (d = !!a, this) : d }; var c = this.interceptors = []; this.$get = ["$httpBackend", "$$cookieReader", "$cacheFactory", "$rootScope", "$q", "$injector", function (e, f, g, h, k, l) {
      function m(b) {
        function c(a) {
          var b = M({}, a); b.data = cd(a.data, a.headers, a.status, f.transformResponse);
          a = a.status; return 200 <= a && 300 > a ? b : k.reject(b)
        } function e(a, b) { var c, d = {}; n(a, function (a, e) { z(a) ? (c = a(b), null != c && (d[e] = c)) : d[e] = a }); return d } if (!fa.isObject(b)) throw G("$http")("badreq", b); var f = M({ method: "get", transformRequest: a.transformRequest, transformResponse: a.transformResponse, paramSerializer: a.paramSerializer }, b); f.headers = function (b) { var c = a.headers, d = M({}, b.headers), f, g, h, c = M({}, c.common, c[F(b.method)]); a: for (f in c) { g = F(f); for (h in d) if (F(h) === g) continue a; d[f] = c[f] } return e(d, ia(b)) }(b);
        f.method = sb(f.method); f.paramSerializer = E(f.paramSerializer) ? l.get(f.paramSerializer) : f.paramSerializer; var g = [function (b) { var d = b.headers, e = cd(b.data, bd(d), u, b.transformRequest); q(e) && n(d, function (a, b) { "content-type" === F(b) && delete d[b] }); q(b.withCredentials) && !q(a.withCredentials) && (b.withCredentials = a.withCredentials); return r(b, e).then(c, c) }, u], h = k.when(f); for (n(v, function (a) { (a.request || a.requestError) && g.unshift(a.request, a.requestError); (a.response || a.responseError) && g.push(a.response, a.responseError) }); g.length;) {
          b =
            g.shift(); var m = g.shift(), h = h.then(b, m)
        } d ? (h.success = function (a) { Qa(a, "fn"); h.then(function (b) { a(b.data, b.status, b.headers, f) }); return h }, h.error = function (a) { Qa(a, "fn"); h.then(null, function (b) { a(b.data, b.status, b.headers, f) }); return h }) : (h.success = dd("success"), h.error = dd("error")); return h
      } function r(c, d) {
        function g(a, c, d, e) { function f() { l(c, a, d, e) } J && (200 <= a && 300 > a ? J.put(R, [a, c, ad(d), e]) : J.remove(R)); b ? h.$applyAsync(f) : (f(), h.$$phase || h.$apply()) } function l(a, b, d, e) {
          b = -1 <= b ? b : 0; (200 <= b && 300 > b ? n.resolve :
            n.reject)({ data: a, status: b, headers: bd(d), config: c, statusText: e })
        } function r(a) { l(a.data, a.status, ia(a.headers()), a.statusText) } function v() { var a = m.pendingRequests.indexOf(c); -1 !== a && m.pendingRequests.splice(a, 1) } var n = k.defer(), D = n.promise, J, K, O = c.headers, R = t(c.url, c.paramSerializer(c.params)); m.pendingRequests.push(c); D.then(v, v); !c.cache && !a.cache || !1 === c.cache || "GET" !== c.method && "JSONP" !== c.method || (J = H(c.cache) ? c.cache : H(a.cache) ? a.cache : A); J && (K = J.get(R), y(K) ? K && z(K.then) ? K.then(r, r) : I(K) ? l(K[1],
          K[0], ia(K[2]), K[3]) : l(K, 200, {}, "OK") : J.put(R, D)); q(K) && ((K = ed(c.url) ? f()[c.xsrfCookieName || a.xsrfCookieName] : u) && (O[c.xsrfHeaderName || a.xsrfHeaderName] = K), e(c.method, R, d, g, O, c.timeout, c.withCredentials, c.responseType)); return D
      } function t(a, b) { 0 < b.length && (a += (-1 == a.indexOf("?") ? "?" : "&") + b); return a } var A = g("$http"); a.paramSerializer = E(a.paramSerializer) ? l.get(a.paramSerializer) : a.paramSerializer; var v = []; n(c, function (a) { v.unshift(E(a) ? l.get(a) : l.invoke(a)) }); m.pendingRequests = []; (function (a) {
        n(arguments,
          function (a) { m[a] = function (b, c) { return m(M({}, c || {}, { method: a, url: b })) } })
      })("get", "delete", "head", "jsonp"); (function (a) { n(arguments, function (a) { m[a] = function (b, c, d) { return m(M({}, d || {}, { method: a, url: b, data: c })) } }) })("post", "put", "patch"); m.defaults = a; return m
    }]
  } function gf() { this.$get = function () { return function () { return new S.XMLHttpRequest } } } function ff() { this.$get = ["$browser", "$window", "$document", "$xhrFactory", function (a, b, d, c) { return Uf(a, c, a.defer, b.angular.callbacks, d[0]) }] } function Uf(a, b, d,
    c, e) {
    function f(a, b, d) { var f = e.createElement("script"), m = null; f.type = "text/javascript"; f.src = a; f.async = !0; m = function (a) { f.removeEventListener("load", m, !1); f.removeEventListener("error", m, !1); e.body.removeChild(f); f = null; var g = -1, A = "unknown"; a && ("load" !== a.type || c[b].called || (a = { type: "error" }), A = a.type, g = "error" === a.type ? 404 : 200); d && d(g, A) }; f.addEventListener("load", m, !1); f.addEventListener("error", m, !1); e.body.appendChild(f); return m } return function (e, h, k, l, m, r, t, A) {
      function v() { C && C(); w && w.abort() }
      function T(b, c, e, f, g) { y(L) && d.cancel(L); C = w = null; b(c, e, f, g); a.$$completeOutstandingRequest(x) } a.$$incOutstandingRequestCount(); h = h || a.url(); if ("jsonp" == F(e)) { var p = "_" + (c.counter++).toString(36); c[p] = function (a) { c[p].data = a; c[p].called = !0 }; var C = f(h.replace("JSON_CALLBACK", "angular.callbacks." + p), p, function (a, b) { T(l, a, c[p].data, "", b); c[p] = x }) } else {
        var w = b(e, h); w.open(e, h, !0); n(m, function (a, b) { y(a) && w.setRequestHeader(b, a) }); w.onload = function () {
          var a = w.statusText || "", b = "response" in w ? w.response : w.responseText,
            c = 1223 === w.status ? 204 : w.status; 0 === c && (c = b ? 200 : "file" == wa(h).protocol ? 404 : 0); T(l, c, b, w.getAllResponseHeaders(), a)
        }; e = function () { T(l, -1, null, null, "") }; w.onerror = e; w.onabort = e; t && (w.withCredentials = !0); if (A) try { w.responseType = A } catch (ga) { if ("json" !== A) throw ga; } w.send(q(k) ? null : k)
      } if (0 < r) var L = d(v, r); else r && z(r.then) && r.then(v)
    }
  } function af() {
    var a = "{{", b = "}}"; this.startSymbol = function (b) { return b ? (a = b, this) : a }; this.endSymbol = function (a) { return a ? (b = a, this) : b }; this.$get = ["$parse", "$exceptionHandler",
      "$sce", function (d, c, e) {
        function f(a) { return "\\\\\\" + a } function g(c) { return c.replace(m, a).replace(r, b) } function h(f, h, m, r) {
          function p(a) { try { var b = a; a = m ? e.getTrusted(m, b) : e.valueOf(b); var d; if (r && !y(a)) d = a; else if (null == a) d = ""; else { switch (typeof a) { case "string": break; case "number": a = "" + a; break; default: a = db(a) }d = a } return d } catch (g) { c(Ja.interr(f, g)) } } r = !!r; for (var C, w, n = 0, L = [], s = [], D = f.length, J = [], K = []; n < D;)if (-1 != (C = f.indexOf(a, n)) && -1 != (w = f.indexOf(b, C + k))) n !== C && J.push(g(f.substring(n, C))), n = f.substring(C +
            k, w), L.push(n), s.push(d(n, p)), n = w + l, K.push(J.length), J.push(""); else { n !== D && J.push(g(f.substring(n))); break } m && 1 < J.length && Ja.throwNoconcat(f); if (!h || L.length) {
              var O = function (a) { for (var b = 0, c = L.length; b < c; b++) { if (r && q(a[b])) return; J[K[b]] = a[b] } return J.join("") }; return M(function (a) { var b = 0, d = L.length, e = Array(d); try { for (; b < d; b++)e[b] = s[b](a); return O(e) } catch (g) { c(Ja.interr(f, g)) } }, {
                exp: f, expressions: L, $$watchDelegate: function (a, b) {
                  var c; return a.$watchGroup(s, function (d, e) {
                    var f = O(d); z(b) && b.call(this,
                      f, d !== e ? c : f, a); c = f
                  })
                }
              })
            }
        } var k = a.length, l = b.length, m = new RegExp(a.replace(/./g, f), "g"), r = new RegExp(b.replace(/./g, f), "g"); h.startSymbol = function () { return a }; h.endSymbol = function () { return b }; return h
      }]
  } function bf() {
    this.$get = ["$rootScope", "$window", "$q", "$$q", function (a, b, d, c) {
      function e(e, h, k, l) {
        var m = 4 < arguments.length, r = m ? ra.call(arguments, 4) : [], t = b.setInterval, A = b.clearInterval, v = 0, n = y(l) && !l, p = (n ? c : d).defer(), C = p.promise; k = y(k) ? k : 0; C.then(null, null, m ? function () { e.apply(null, r) } : e); C.$$intervalId =
          t(function () { p.notify(v++); 0 < k && v >= k && (p.resolve(v), A(C.$$intervalId), delete f[C.$$intervalId]); n || a.$apply() }, h); f[C.$$intervalId] = p; return C
      } var f = {}; e.cancel = function (a) { return a && a.$$intervalId in f ? (f[a.$$intervalId].reject("canceled"), b.clearInterval(a.$$intervalId), delete f[a.$$intervalId], !0) : !1 }; return e
    }]
  } function bc(a) { a = a.split("/"); for (var b = a.length; b--;)a[b] = ob(a[b]); return a.join("/") } function fd(a, b) {
    var d = wa(a); b.$$protocol = d.protocol; b.$$host = d.hostname; b.$$port = ea(d.port) || Vf[d.protocol] ||
      null
  } function gd(a, b) { var d = "/" !== a.charAt(0); d && (a = "/" + a); var c = wa(a); b.$$path = decodeURIComponent(d && "/" === c.pathname.charAt(0) ? c.pathname.substring(1) : c.pathname); b.$$search = xc(c.search); b.$$hash = decodeURIComponent(c.hash); b.$$path && "/" != b.$$path.charAt(0) && (b.$$path = "/" + b.$$path) } function pa(a, b) { if (0 === b.indexOf(a)) return b.substr(a.length) } function Fa(a) { var b = a.indexOf("#"); return -1 == b ? a : a.substr(0, b) } function ib(a) { return a.replace(/(#.+)|#$/, "$1") } function cc(a, b, d) {
    this.$$html5 = !0; d = d || "";
    fd(a, this); this.$$parse = function (a) { var d = pa(b, a); if (!E(d)) throw Db("ipthprfx", a, b); gd(d, this); this.$$path || (this.$$path = "/"); this.$$compose() }; this.$$compose = function () { var a = Qb(this.$$search), d = this.$$hash ? "#" + ob(this.$$hash) : ""; this.$$url = bc(this.$$path) + (a ? "?" + a : "") + d; this.$$absUrl = b + this.$$url.substr(1) }; this.$$parseLinkUrl = function (c, e) {
      if (e && "#" === e[0]) return this.hash(e.slice(1)), !0; var f, g; y(f = pa(a, c)) ? (g = f, g = y(f = pa(d, f)) ? b + (pa("/", f) || f) : a + g) : y(f = pa(b, c)) ? g = b + f : b == c + "/" && (g = b); g && this.$$parse(g);
      return !!g
    }
  } function dc(a, b, d) {
    fd(a, this); this.$$parse = function (c) { var e = pa(a, c) || pa(b, c), f; q(e) || "#" !== e.charAt(0) ? this.$$html5 ? f = e : (f = "", q(e) && (a = c, this.replace())) : (f = pa(d, e), q(f) && (f = e)); gd(f, this); c = this.$$path; var e = a, g = /^\/[A-Z]:(\/.*)/; 0 === f.indexOf(e) && (f = f.replace(e, "")); g.exec(f) || (c = (f = g.exec(c)) ? f[1] : c); this.$$path = c; this.$$compose() }; this.$$compose = function () {
      var b = Qb(this.$$search), e = this.$$hash ? "#" + ob(this.$$hash) : ""; this.$$url = bc(this.$$path) + (b ? "?" + b : "") + e; this.$$absUrl = a + (this.$$url ?
        d + this.$$url : "")
    }; this.$$parseLinkUrl = function (b, d) { return Fa(a) == Fa(b) ? (this.$$parse(b), !0) : !1 }
  } function hd(a, b, d) { this.$$html5 = !0; dc.apply(this, arguments); this.$$parseLinkUrl = function (c, e) { if (e && "#" === e[0]) return this.hash(e.slice(1)), !0; var f, g; a == Fa(c) ? f = c : (g = pa(b, c)) ? f = a + d + g : b === c + "/" && (f = b); f && this.$$parse(f); return !!f }; this.$$compose = function () { var b = Qb(this.$$search), e = this.$$hash ? "#" + ob(this.$$hash) : ""; this.$$url = bc(this.$$path) + (b ? "?" + b : "") + e; this.$$absUrl = a + d + this.$$url } } function Eb(a) { return function () { return this[a] } }
  function id(a, b) { return function (d) { if (q(d)) return this[a]; this[a] = b(d); this.$$compose(); return this } } function hf() {
    var a = "", b = { enabled: !1, requireBase: !0, rewriteLinks: !0 }; this.hashPrefix = function (b) { return y(b) ? (a = b, this) : a }; this.html5Mode = function (a) { return $a(a) ? (b.enabled = a, this) : H(a) ? ($a(a.enabled) && (b.enabled = a.enabled), $a(a.requireBase) && (b.requireBase = a.requireBase), $a(a.rewriteLinks) && (b.rewriteLinks = a.rewriteLinks), this) : b }; this.$get = ["$rootScope", "$browser", "$sniffer", "$rootElement", "$window",
      function (d, c, e, f, g) {
        function h(a, b, d) { var e = l.url(), f = l.$$state; try { c.url(a, b, d), l.$$state = c.state() } catch (g) { throw l.url(e), l.$$state = f, g; } } function k(a, b) { d.$broadcast("$locationChangeSuccess", l.absUrl(), a, l.$$state, b) } var l, m; m = c.baseHref(); var r = c.url(), t; if (b.enabled) { if (!m && b.requireBase) throw Db("nobase"); t = r.substring(0, r.indexOf("/", r.indexOf("//") + 2)) + (m || "/"); m = e.history ? cc : hd } else t = Fa(r), m = dc; var A = t.substr(0, Fa(t).lastIndexOf("/") + 1); l = new m(t, A, "#" + a); l.$$parseLinkUrl(r, r); l.$$state =
          c.state(); var v = /^\s*(javascript|mailto):/i; f.on("click", function (a) {
            if (b.rewriteLinks && !a.ctrlKey && !a.metaKey && !a.shiftKey && 2 != a.which && 2 != a.button) {
              for (var e = B(a.target); "a" !== ta(e[0]);)if (e[0] === f[0] || !(e = e.parent())[0]) return; var h = e.prop("href"), k = e.attr("href") || e.attr("xlink:href"); H(h) && "[object SVGAnimatedString]" === h.toString() && (h = wa(h.animVal).href); v.test(h) || !h || e.attr("target") || a.isDefaultPrevented() || !l.$$parseLinkUrl(h, k) || (a.preventDefault(), l.absUrl() != c.url() && (d.$apply(), g.angular["ff-684208-preventDefault"] =
                !0))
            }
          }); ib(l.absUrl()) != ib(r) && c.url(l.absUrl(), !0); var n = !0; c.onUrlChange(function (a, b) { q(pa(A, a)) ? g.location.href = a : (d.$evalAsync(function () { var c = l.absUrl(), e = l.$$state, f; a = ib(a); l.$$parse(a); l.$$state = b; f = d.$broadcast("$locationChangeStart", a, c, b, e).defaultPrevented; l.absUrl() === a && (f ? (l.$$parse(c), l.$$state = e, h(c, !1, e)) : (n = !1, k(c, e))) }), d.$$phase || d.$digest()) }); d.$watch(function () {
            var a = ib(c.url()), b = ib(l.absUrl()), f = c.state(), g = l.$$replace, m = a !== b || l.$$html5 && e.history && f !== l.$$state; if (n ||
              m) n = !1, d.$evalAsync(function () { var b = l.absUrl(), c = d.$broadcast("$locationChangeStart", b, a, l.$$state, f).defaultPrevented; l.absUrl() === b && (c ? (l.$$parse(a), l.$$state = f) : (m && h(b, g, f === l.$$state ? null : l.$$state), k(a, f))) }); l.$$replace = !1
          }); return l
      }]
  } function jf() {
    var a = !0, b = this; this.debugEnabled = function (b) { return y(b) ? (a = b, this) : a }; this.$get = ["$window", function (d) {
      function c(a) {
        a instanceof Error && (a.stack ? a = a.message && -1 === a.stack.indexOf(a.message) ? "Error: " + a.message + "\n" + a.stack : a.stack : a.sourceURL &&
          (a = a.message + "\n" + a.sourceURL + ":" + a.line)); return a
      } function e(a) { var b = d.console || {}, e = b[a] || b.log || x; a = !1; try { a = !!e.apply } catch (k) { } return a ? function () { var a = []; n(arguments, function (b) { a.push(c(b)) }); return e.apply(b, a) } : function (a, b) { e(a, null == b ? "" : b) } } return { log: e("log"), info: e("info"), warn: e("warn"), error: e("error"), debug: function () { var c = e("debug"); return function () { a && c.apply(b, arguments) } }() }
    }]
  } function Va(a, b) {
    if ("__defineGetter__" === a || "__defineSetter__" === a || "__lookupGetter__" === a || "__lookupSetter__" ===
      a || "__proto__" === a) throw ba("isecfld", b); return a
  } function jd(a, b) { a += ""; if (!E(a)) throw ba("iseccst", b); return a } function xa(a, b) { if (a) { if (a.constructor === a) throw ba("isecfn", b); if (a.window === a) throw ba("isecwindow", b); if (a.children && (a.nodeName || a.prop && a.attr && a.find)) throw ba("isecdom", b); if (a === Object) throw ba("isecobj", b); } return a } function kd(a, b) { if (a) { if (a.constructor === a) throw ba("isecfn", b); if (a === Wf || a === Xf || a === Yf) throw ba("isecff", b); } } function ld(a, b) {
    if (a && (a === (0).constructor || a ===
      (!1).constructor || a === "".constructor || a === {}.constructor || a === [].constructor || a === Function.constructor)) throw ba("isecaf", b);
  } function Zf(a, b) { return "undefined" !== typeof a ? a : b } function md(a, b) { return "undefined" === typeof a ? b : "undefined" === typeof b ? a : a + b } function W(a, b) {
    var d, c; switch (a.type) {
      case s.Program: d = !0; n(a.body, function (a) { W(a.expression, b); d = d && a.expression.constant }); a.constant = d; break; case s.Literal: a.constant = !0; a.toWatch = []; break; case s.UnaryExpression: W(a.argument, b); a.constant = a.argument.constant;
        a.toWatch = a.argument.toWatch; break; case s.BinaryExpression: W(a.left, b); W(a.right, b); a.constant = a.left.constant && a.right.constant; a.toWatch = a.left.toWatch.concat(a.right.toWatch); break; case s.LogicalExpression: W(a.left, b); W(a.right, b); a.constant = a.left.constant && a.right.constant; a.toWatch = a.constant ? [] : [a]; break; case s.ConditionalExpression: W(a.test, b); W(a.alternate, b); W(a.consequent, b); a.constant = a.test.constant && a.alternate.constant && a.consequent.constant; a.toWatch = a.constant ? [] : [a]; break; case s.Identifier: a.constant =
          !1; a.toWatch = [a]; break; case s.MemberExpression: W(a.object, b); a.computed && W(a.property, b); a.constant = a.object.constant && (!a.computed || a.property.constant); a.toWatch = [a]; break; case s.CallExpression: d = a.filter ? !b(a.callee.name).$stateful : !1; c = []; n(a.arguments, function (a) { W(a, b); d = d && a.constant; a.constant || c.push.apply(c, a.toWatch) }); a.constant = d; a.toWatch = a.filter && !b(a.callee.name).$stateful ? c : [a]; break; case s.AssignmentExpression: W(a.left, b); W(a.right, b); a.constant = a.left.constant && a.right.constant;
        a.toWatch = [a]; break; case s.ArrayExpression: d = !0; c = []; n(a.elements, function (a) { W(a, b); d = d && a.constant; a.constant || c.push.apply(c, a.toWatch) }); a.constant = d; a.toWatch = c; break; case s.ObjectExpression: d = !0; c = []; n(a.properties, function (a) { W(a.value, b); d = d && a.value.constant; a.value.constant || c.push.apply(c, a.value.toWatch) }); a.constant = d; a.toWatch = c; break; case s.ThisExpression: a.constant = !1, a.toWatch = []
    }
  } function nd(a) { if (1 == a.length) { a = a[0].expression; var b = a.toWatch; return 1 !== b.length ? b : b[0] !== a ? b : u } }
  function od(a) { return a.type === s.Identifier || a.type === s.MemberExpression } function pd(a) { if (1 === a.body.length && od(a.body[0].expression)) return { type: s.AssignmentExpression, left: a.body[0].expression, right: { type: s.NGValueParameter }, operator: "=" } } function qd(a) { return 0 === a.body.length || 1 === a.body.length && (a.body[0].expression.type === s.Literal || a.body[0].expression.type === s.ArrayExpression || a.body[0].expression.type === s.ObjectExpression) } function rd(a, b) { this.astBuilder = a; this.$filter = b } function sd(a,
    b) { this.astBuilder = a; this.$filter = b } function Fb(a) { return "constructor" == a } function ec(a) { return z(a.valueOf) ? a.valueOf() : $f.call(a) } function kf() {
      var a = $(), b = $(); this.$get = ["$filter", function (d) {
        function c(a, b) { return null == a || null == b ? a === b : "object" === typeof a && (a = ec(a), "object" === typeof a) ? !1 : a === b || a !== a && b !== b } function e(a, b, d, e, f) {
          var g = e.inputs, h; if (1 === g.length) { var k = c, g = g[0]; return a.$watch(function (a) { var b = g(a); c(b, k) || (h = e(a, u, u, [b]), k = b && ec(b)); return h }, b, d, f) } for (var l = [], m = [], r = 0, n =
            g.length; r < n; r++)l[r] = c, m[r] = null; return a.$watch(function (a) { for (var b = !1, d = 0, f = g.length; d < f; d++) { var k = g[d](a); if (b || (b = !c(k, l[d]))) m[d] = k, l[d] = k && ec(k) } b && (h = e(a, u, u, m)); return h }, b, d, f)
        } function f(a, b, c, d) { var e, f; return e = a.$watch(function (a) { return d(a) }, function (a, c, d) { f = a; z(b) && b.apply(this, arguments); y(a) && d.$$postDigest(function () { y(f) && e() }) }, c) } function g(a, b, c, d) {
          function e(a) { var b = !0; n(a, function (a) { y(a) || (b = !1) }); return b } var f, g; return f = a.$watch(function (a) { return d(a) }, function (a,
            c, d) { g = a; z(b) && b.call(this, a, c, d); e(a) && d.$$postDigest(function () { e(g) && f() }) }, c)
        } function h(a, b, c, d) { var e; return e = a.$watch(function (a) { return d(a) }, function (a, c, d) { z(b) && b.apply(this, arguments); e() }, c) } function k(a, b) {
          if (!b) return a; var c = a.$$watchDelegate, d = !1, c = c !== g && c !== f ? function (c, e, f, g) { f = d && g ? g[0] : a(c, e, f, g); return b(f, c, e) } : function (c, d, e, f) { e = a(c, d, e, f); c = b(e, c, d); return y(e) ? c : e }; a.$$watchDelegate && a.$$watchDelegate !== e ? c.$$watchDelegate = a.$$watchDelegate : b.$stateful || (c.$$watchDelegate =
            e, d = !a.inputs, c.inputs = a.inputs ? a.inputs : [a]); return c
        } var l = Ba().noUnsafeEval, m = { csp: l, expensiveChecks: !1 }, r = { csp: l, expensiveChecks: !0 }; return function (c, l, v) { var n, p, q; switch (typeof c) { case "string": q = c = c.trim(); var w = v ? b : a; n = w[q]; n || (":" === c.charAt(0) && ":" === c.charAt(1) && (p = !0, c = c.substring(2)), v = v ? r : m, n = new fc(v), n = (new gc(n, d, v)).parse(c), n.constant ? n.$$watchDelegate = h : p ? n.$$watchDelegate = n.literal ? g : f : n.inputs && (n.$$watchDelegate = e), w[q] = n); return k(n, l); case "function": return k(c, l); default: return x } }
      }]
    }
  function mf() { this.$get = ["$rootScope", "$exceptionHandler", function (a, b) { return td(function (b) { a.$evalAsync(b) }, b) }] } function nf() { this.$get = ["$browser", "$exceptionHandler", function (a, b) { return td(function (b) { a.defer(b) }, b) }] } function td(a, b) {
    function d(a, b, c) { function d(b) { return function (c) { e || (e = !0, b.call(a, c)) } } var e = !1; return [d(b), d(c)] } function c() { this.$$state = { status: 0 } } function e(a, b) { return function (c) { b.call(a, c) } } function f(c) {
      !c.processScheduled && c.pending && (c.processScheduled = !0, a(function () {
        var a,
          d, e; e = c.pending; c.processScheduled = !1; c.pending = u; for (var f = 0, g = e.length; f < g; ++f) { d = e[f][0]; a = e[f][c.status]; try { z(a) ? d.resolve(a(c.value)) : 1 === c.status ? d.resolve(c.value) : d.reject(c.value) } catch (h) { d.reject(h), b(h) } }
      }))
    } function g() { this.promise = new c; this.resolve = e(this, this.resolve); this.reject = e(this, this.reject); this.notify = e(this, this.notify) } var h = G("$q", TypeError); M(c.prototype, {
      then: function (a, b, c) {
        if (q(a) && q(b) && q(c)) return this; var d = new g; this.$$state.pending = this.$$state.pending || [];
        this.$$state.pending.push([d, a, b, c]); 0 < this.$$state.status && f(this.$$state); return d.promise
      }, "catch": function (a) { return this.then(null, a) }, "finally": function (a, b) { return this.then(function (b) { return l(b, !0, a) }, function (b) { return l(b, !1, a) }, b) }
    }); M(g.prototype, {
      resolve: function (a) { this.promise.$$state.status || (a === this.promise ? this.$$reject(h("qcycle", a)) : this.$$resolve(a)) }, $$resolve: function (a) {
        var c, e; e = d(this, this.$$resolve, this.$$reject); try {
          if (H(a) || z(a)) c = a && a.then; z(c) ? (this.promise.$$state.status =
            -1, c.call(a, e[0], e[1], this.notify)) : (this.promise.$$state.value = a, this.promise.$$state.status = 1, f(this.promise.$$state))
        } catch (g) { e[1](g), b(g) }
      }, reject: function (a) { this.promise.$$state.status || this.$$reject(a) }, $$reject: function (a) { this.promise.$$state.value = a; this.promise.$$state.status = 2; f(this.promise.$$state) }, notify: function (c) {
        var d = this.promise.$$state.pending; 0 >= this.promise.$$state.status && d && d.length && a(function () {
          for (var a, e, f = 0, g = d.length; f < g; f++) {
            e = d[f][0]; a = d[f][3]; try {
              e.notify(z(a) ?
                a(c) : c)
            } catch (h) { b(h) }
          }
        })
      }
    }); var k = function (a, b) { var c = new g; b ? c.resolve(a) : c.reject(a); return c.promise }, l = function (a, b, c) { var d = null; try { z(c) && (d = c()) } catch (e) { return k(e, !1) } return d && z(d.then) ? d.then(function () { return k(a, b) }, function (a) { return k(a, !1) }) : k(a, b) }, m = function (a, b, c, d) { var e = new g; e.resolve(a); return e.promise.then(b, c, d) }, r = function A(a) { if (!z(a)) throw h("norslvr", a); if (!(this instanceof A)) return new A(a); var b = new g; a(function (a) { b.resolve(a) }, function (a) { b.reject(a) }); return b.promise };
    r.defer = function () { return new g }; r.reject = function (a) { var b = new g; b.reject(a); return b.promise }; r.when = m; r.resolve = m; r.all = function (a) { var b = new g, c = 0, d = I(a) ? [] : {}; n(a, function (a, e) { c++; m(a).then(function (a) { d.hasOwnProperty(e) || (d[e] = a, --c || b.resolve(d)) }, function (a) { d.hasOwnProperty(e) || b.reject(a) }) }); 0 === c && b.resolve(d); return b.promise }; return r
  } function wf() {
    this.$get = ["$window", "$timeout", function (a, b) {
      var d = a.requestAnimationFrame || a.webkitRequestAnimationFrame, c = a.cancelAnimationFrame || a.webkitCancelAnimationFrame ||
        a.webkitCancelRequestAnimationFrame, e = !!d, f = e ? function (a) { var b = d(a); return function () { c(b) } } : function (a) { var c = b(a, 16.66, !1); return function () { b.cancel(c) } }; f.supported = e; return f
    }]
  } function lf() {
    function a(a) { function b() { this.$$watchers = this.$$nextSibling = this.$$childHead = this.$$childTail = null; this.$$listeners = {}; this.$$listenerCount = {}; this.$$watchersCount = 0; this.$id = ++nb; this.$$ChildScope = null } b.prototype = a; return b } var b = 10, d = G("$rootScope"), c = null, e = null; this.digestTtl = function (a) {
      arguments.length &&
        (b = a); return b
    }; this.$get = ["$injector", "$exceptionHandler", "$parse", "$browser", function (f, g, h, k) {
      function l(a) { a.currentScope.$$destroyed = !0 } function m(a) { 9 === Ha && (a.$$childHead && m(a.$$childHead), a.$$nextSibling && m(a.$$nextSibling)); a.$parent = a.$$nextSibling = a.$$prevSibling = a.$$childHead = a.$$childTail = a.$root = a.$$watchers = null } function r() {
        this.$id = ++nb; this.$$phase = this.$parent = this.$$watchers = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null; this.$root = this; this.$$destroyed =
          !1; this.$$listeners = {}; this.$$listenerCount = {}; this.$$watchersCount = 0; this.$$isolateBindings = null
      } function t(a) { if (w.$$phase) throw d("inprog", w.$$phase); w.$$phase = a } function A(a, b) { do a.$$watchersCount += b; while (a = a.$parent) } function v(a, b, c) { do a.$$listenerCount[c] -= b, 0 === a.$$listenerCount[c] && delete a.$$listenerCount[c]; while (a = a.$parent) } function s() { } function p() { for (; aa.length;)try { aa.shift()() } catch (a) { g(a) } e = null } function C() { null === e && (e = k.defer(function () { w.$apply(p) })) } r.prototype = {
        constructor: r,
        $new: function (b, c) { var d; c = c || this; b ? (d = new r, d.$root = this.$root) : (this.$$ChildScope || (this.$$ChildScope = a(this)), d = new this.$$ChildScope); d.$parent = c; d.$$prevSibling = c.$$childTail; c.$$childHead ? (c.$$childTail.$$nextSibling = d, c.$$childTail = d) : c.$$childHead = c.$$childTail = d; (b || c != this) && d.$on("$destroy", l); return d }, $watch: function (a, b, d, e) {
          var f = h(a); if (f.$$watchDelegate) return f.$$watchDelegate(this, b, d, f, a); var g = this, k = g.$$watchers, l = { fn: b, last: s, get: f, exp: e || a, eq: !!d }; c = null; z(b) || (l.fn = x); k ||
            (k = g.$$watchers = []); k.unshift(l); A(this, 1); return function () { 0 <= ab(k, l) && A(g, -1); c = null }
        }, $watchGroup: function (a, b) { function c() { h = !1; k ? (k = !1, b(e, e, g)) : b(e, d, g) } var d = Array(a.length), e = Array(a.length), f = [], g = this, h = !1, k = !0; if (!a.length) { var l = !0; g.$evalAsync(function () { l && b(e, e, g) }); return function () { l = !1 } } if (1 === a.length) return this.$watch(a[0], function (a, c, f) { e[0] = a; d[0] = c; b(e, a === c ? e : d, f) }); n(a, function (a, b) { var k = g.$watch(a, function (a, f) { e[b] = a; d[b] = f; h || (h = !0, g.$evalAsync(c)) }); f.push(k) }); return function () { for (; f.length;)f.shift()() } },
        $watchCollection: function (a, b) {
          function c(a) { e = a; var b, d, g, h; if (!q(e)) { if (H(e)) if (za(e)) for (f !== r && (f = r, n = f.length = 0, l++), a = e.length, n !== a && (l++ , f.length = n = a), b = 0; b < a; b++)h = f[b], g = e[b], d = h !== h && g !== g, d || h === g || (l++ , f[b] = g); else { f !== t && (f = t = {}, n = 0, l++); a = 0; for (b in e) qa.call(e, b) && (a++ , g = e[b], h = f[b], b in f ? (d = h !== h && g !== g, d || h === g || (l++ , f[b] = g)) : (n++ , f[b] = g, l++)); if (n > a) for (b in l++ , f) qa.call(e, b) || (n-- , delete f[b]) } else f !== e && (f = e, l++); return l } } c.$stateful = !0; var d = this, e, f, g, k = 1 < b.length, l = 0, m =
            h(a, c), r = [], t = {}, p = !0, n = 0; return this.$watch(m, function () { p ? (p = !1, b(e, e, d)) : b(e, g, d); if (k) if (H(e)) if (za(e)) { g = Array(e.length); for (var a = 0; a < e.length; a++)g[a] = e[a] } else for (a in g = {}, e) qa.call(e, a) && (g[a] = e[a]); else g = e })
        }, $digest: function () {
          var a, f, h, l, m, r, n = b, A, q = [], v, C; t("$digest"); k.$$checkUrlChange(); this === w && null !== e && (k.defer.cancel(e), p()); c = null; do {
            r = !1; for (A = this; u.length;) { try { C = u.shift(), C.scope.$eval(C.expression, C.locals) } catch (aa) { g(aa) } c = null } a: do {
              if (l = A.$$watchers) for (m = l.length; m--;)try {
                if (a =
                  l[m]) if ((f = a.get(A)) !== (h = a.last) && !(a.eq ? ma(f, h) : "number" === typeof f && "number" === typeof h && isNaN(f) && isNaN(h))) r = !0, c = a, a.last = a.eq ? bb(f, null) : f, a.fn(f, h === s ? f : h, A), 5 > n && (v = 4 - n, q[v] || (q[v] = []), q[v].push({ msg: z(a.exp) ? "fn: " + (a.exp.name || a.exp.toString()) : a.exp, newVal: f, oldVal: h })); else if (a === c) { r = !1; break a }
              } catch (y) { g(y) } if (!(l = A.$$watchersCount && A.$$childHead || A !== this && A.$$nextSibling)) for (; A !== this && !(l = A.$$nextSibling);)A = A.$parent
            } while (A = l); if ((r || u.length) && !n--) throw w.$$phase = null, d("infdig",
              b, q);
          } while (r || u.length); for (w.$$phase = null; L.length;)try { L.shift()() } catch (x) { g(x) }
        }, $destroy: function () {
          if (!this.$$destroyed) {
            var a = this.$parent; this.$broadcast("$destroy"); this.$$destroyed = !0; this === w && k.$$applicationDestroyed(); A(this, -this.$$watchersCount); for (var b in this.$$listenerCount) v(this, this.$$listenerCount[b], b); a && a.$$childHead == this && (a.$$childHead = this.$$nextSibling); a && a.$$childTail == this && (a.$$childTail = this.$$prevSibling); this.$$prevSibling && (this.$$prevSibling.$$nextSibling =
              this.$$nextSibling); this.$$nextSibling && (this.$$nextSibling.$$prevSibling = this.$$prevSibling); this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = x; this.$on = this.$watch = this.$watchGroup = function () { return x }; this.$$listeners = {}; this.$$nextSibling = null; m(this)
          }
        }, $eval: function (a, b) { return h(a)(this, b) }, $evalAsync: function (a, b) { w.$$phase || u.length || k.defer(function () { u.length && w.$digest() }); u.push({ scope: this, expression: a, locals: b }) }, $$postDigest: function (a) { L.push(a) }, $apply: function (a) {
          try {
            t("$apply");
            try { return this.$eval(a) } finally { w.$$phase = null }
          } catch (b) { g(b) } finally { try { w.$digest() } catch (c) { throw g(c), c; } }
        }, $applyAsync: function (a) { function b() { c.$eval(a) } var c = this; a && aa.push(b); C() }, $on: function (a, b) { var c = this.$$listeners[a]; c || (this.$$listeners[a] = c = []); c.push(b); var d = this; do d.$$listenerCount[a] || (d.$$listenerCount[a] = 0), d.$$listenerCount[a]++; while (d = d.$parent); var e = this; return function () { var d = c.indexOf(b); -1 !== d && (c[d] = null, v(e, 1, a)) } }, $emit: function (a, b) {
          var c = [], d, e = this, f = !1, h =
            { name: a, targetScope: e, stopPropagation: function () { f = !0 }, preventDefault: function () { h.defaultPrevented = !0 }, defaultPrevented: !1 }, k = cb([h], arguments, 1), l, m; do { d = e.$$listeners[a] || c; h.currentScope = e; l = 0; for (m = d.length; l < m; l++)if (d[l]) try { d[l].apply(null, k) } catch (r) { g(r) } else d.splice(l, 1), l-- , m--; if (f) return h.currentScope = null, h; e = e.$parent } while (e); h.currentScope = null; return h
        }, $broadcast: function (a, b) {
          var c = this, d = this, e = { name: a, targetScope: this, preventDefault: function () { e.defaultPrevented = !0 }, defaultPrevented: !1 };
          if (!this.$$listenerCount[a]) return e; for (var f = cb([e], arguments, 1), h, k; c = d;) { e.currentScope = c; d = c.$$listeners[a] || []; h = 0; for (k = d.length; h < k; h++)if (d[h]) try { d[h].apply(null, f) } catch (l) { g(l) } else d.splice(h, 1), h-- , k--; if (!(d = c.$$listenerCount[a] && c.$$childHead || c !== this && c.$$nextSibling)) for (; c !== this && !(d = c.$$nextSibling);)c = c.$parent } e.currentScope = null; return e
        }
      }; var w = new r, u = w.$$asyncQueue = [], L = w.$$postDigestQueue = [], aa = w.$$applyAsyncQueue = []; return w
    }]
  } function ge() {
    var a = /^\s*(https?|ftp|mailto|tel|file):/,
      b = /^\s*((https?|ftp|file|blob):|data:image\/)/; this.aHrefSanitizationWhitelist = function (b) { return y(b) ? (a = b, this) : a }; this.imgSrcSanitizationWhitelist = function (a) { return y(a) ? (b = a, this) : b }; this.$get = function () { return function (d, c) { var e = c ? b : a, f; f = wa(d).href; return "" === f || f.match(e) ? d : "unsafe:" + f } }
  } function ag(a) {
    if ("self" === a) return a; if (E(a)) { if (-1 < a.indexOf("***")) throw ya("iwcard", a); a = ud(a).replace("\\*\\*", ".*").replace("\\*", "[^:/.?&;]*"); return new RegExp("^" + a + "$") } if (Ma(a)) return new RegExp("^" +
      a.source + "$"); throw ya("imatcher");
  } function vd(a) { var b = []; y(a) && n(a, function (a) { b.push(ag(a)) }); return b } function pf() {
    this.SCE_CONTEXTS = la; var a = ["self"], b = []; this.resourceUrlWhitelist = function (b) { arguments.length && (a = vd(b)); return a }; this.resourceUrlBlacklist = function (a) { arguments.length && (b = vd(a)); return b }; this.$get = ["$injector", function (d) {
      function c(a, b) { return "self" === a ? ed(b) : !!a.exec(b.href) } function e(a) {
        var b = function (a) { this.$$unwrapTrustedValue = function () { return a } }; a && (b.prototype =
          new a); b.prototype.valueOf = function () { return this.$$unwrapTrustedValue() }; b.prototype.toString = function () { return this.$$unwrapTrustedValue().toString() }; return b
      } var f = function (a) { throw ya("unsafe"); }; d.has("$sanitize") && (f = d.get("$sanitize")); var g = e(), h = {}; h[la.HTML] = e(g); h[la.CSS] = e(g); h[la.URL] = e(g); h[la.JS] = e(g); h[la.RESOURCE_URL] = e(h[la.URL]); return {
        trustAs: function (a, b) {
          var c = h.hasOwnProperty(a) ? h[a] : null; if (!c) throw ya("icontext", a, b); if (null === b || q(b) || "" === b) return b; if ("string" !== typeof b) throw ya("itype",
            a); return new c(b)
        }, getTrusted: function (d, e) { if (null === e || q(e) || "" === e) return e; var g = h.hasOwnProperty(d) ? h[d] : null; if (g && e instanceof g) return e.$$unwrapTrustedValue(); if (d === la.RESOURCE_URL) { var g = wa(e.toString()), r, t, n = !1; r = 0; for (t = a.length; r < t; r++)if (c(a[r], g)) { n = !0; break } if (n) for (r = 0, t = b.length; r < t; r++)if (c(b[r], g)) { n = !1; break } if (n) return e; throw ya("insecurl", e.toString()); } if (d === la.HTML) return f(e); throw ya("unsafe"); }, valueOf: function (a) { return a instanceof g ? a.$$unwrapTrustedValue() : a }
      }
    }]
  }
  function of() {
    var a = !0; this.enabled = function (b) { arguments.length && (a = !!b); return a }; this.$get = ["$parse", "$sceDelegate", function (b, d) {
      if (a && 8 > Ha) throw ya("iequirks"); var c = ia(la); c.isEnabled = function () { return a }; c.trustAs = d.trustAs; c.getTrusted = d.getTrusted; c.valueOf = d.valueOf; a || (c.trustAs = c.getTrusted = function (a, b) { return b }, c.valueOf = Ya); c.parseAs = function (a, d) { var e = b(d); return e.literal && e.constant ? e : b(d, function (b) { return c.getTrusted(a, b) }) }; var e = c.parseAs, f = c.getTrusted, g = c.trustAs; n(la, function (a,
        b) { var d = F(b); c[fb("parse_as_" + d)] = function (b) { return e(a, b) }; c[fb("get_trusted_" + d)] = function (b) { return f(a, b) }; c[fb("trust_as_" + d)] = function (b) { return g(a, b) } }); return c
    }]
  } function qf() {
    this.$get = ["$window", "$document", function (a, b) {
      var d = {}, c = ea((/android (\d+)/.exec(F((a.navigator || {}).userAgent)) || [])[1]), e = /Boxee/i.test((a.navigator || {}).userAgent), f = b[0] || {}, g, h = /^(Moz|webkit|ms)(?=[A-Z])/, k = f.body && f.body.style, l = !1, m = !1; if (k) {
        for (var r in k) if (l = h.exec(r)) {
          g = l[0]; g = g.substr(0, 1).toUpperCase() +
            g.substr(1); break
        } g || (g = "WebkitOpacity" in k && "webkit"); l = !!("transition" in k || g + "Transition" in k); m = !!("animation" in k || g + "Animation" in k); !c || l && m || (l = E(k.webkitTransition), m = E(k.webkitAnimation))
      } return { history: !(!a.history || !a.history.pushState || 4 > c || e), hasEvent: function (a) { if ("input" === a && 11 >= Ha) return !1; if (q(d[a])) { var b = f.createElement("div"); d[a] = "on" + a in b } return d[a] }, csp: Ba(), vendorPrefix: g, transitions: l, animations: m, android: c }
    }]
  } function sf() {
    this.$get = ["$templateCache", "$http", "$q", "$sce",
      function (a, b, d, c) { function e(f, g) { e.totalPendingRequests++; E(f) && a.get(f) || (f = c.getTrustedResourceUrl(f)); var h = b.defaults && b.defaults.transformResponse; I(h) ? h = h.filter(function (a) { return a !== $b }) : h === $b && (h = null); return b.get(f, { cache: a, transformResponse: h })["finally"](function () { e.totalPendingRequests-- }).then(function (b) { a.put(f, b.data); return b.data }, function (a) { if (!g) throw ha("tpload", f, a.status, a.statusText); return d.reject(a) }) } e.totalPendingRequests = 0; return e }]
  } function tf() {
    this.$get = ["$rootScope",
      "$browser", "$location", function (a, b, d) {
        return {
          findBindings: function (a, b, d) { a = a.getElementsByClassName("ng-binding"); var g = []; n(a, function (a) { var c = fa.element(a).data("$binding"); c && n(c, function (c) { d ? (new RegExp("(^|\\s)" + ud(b) + "(\\s|\\||$)")).test(c) && g.push(a) : -1 != c.indexOf(b) && g.push(a) }) }); return g }, findModels: function (a, b, d) { for (var g = ["ng-", "data-ng-", "ng\\:"], h = 0; h < g.length; ++h) { var k = a.querySelectorAll("[" + g[h] + "model" + (d ? "=" : "*=") + '"' + b + '"]'); if (k.length) return k } }, getLocation: function () { return d.url() },
          setLocation: function (b) { b !== d.url() && (d.url(b), a.$digest()) }, whenStable: function (a) { b.notifyWhenNoOutstandingRequests(a) }
        }
      }]
  } function uf() {
    this.$get = ["$rootScope", "$browser", "$q", "$$q", "$exceptionHandler", function (a, b, d, c, e) {
      function f(f, k, l) { z(f) || (l = k, k = f, f = x); var m = ra.call(arguments, 3), r = y(l) && !l, t = (r ? c : d).defer(), n = t.promise, q; q = b.defer(function () { try { t.resolve(f.apply(null, m)) } catch (b) { t.reject(b), e(b) } finally { delete g[n.$$timeoutId] } r || a.$apply() }, k); n.$$timeoutId = q; g[q] = t; return n } var g = {};
      f.cancel = function (a) { return a && a.$$timeoutId in g ? (g[a.$$timeoutId].reject("canceled"), delete g[a.$$timeoutId], b.defer.cancel(a.$$timeoutId)) : !1 }; return f
    }]
  } function wa(a) { Ha && (Y.setAttribute("href", a), a = Y.href); Y.setAttribute("href", a); return { href: Y.href, protocol: Y.protocol ? Y.protocol.replace(/:$/, "") : "", host: Y.host, search: Y.search ? Y.search.replace(/^\?/, "") : "", hash: Y.hash ? Y.hash.replace(/^#/, "") : "", hostname: Y.hostname, port: Y.port, pathname: "/" === Y.pathname.charAt(0) ? Y.pathname : "/" + Y.pathname } } function ed(a) {
    a =
      E(a) ? wa(a) : a; return a.protocol === wd.protocol && a.host === wd.host
  } function vf() { this.$get = na(S) } function xd(a) { function b(a) { try { return decodeURIComponent(a) } catch (b) { return a } } var d = a[0] || {}, c = {}, e = ""; return function () { var a, g, h, k, l; a = d.cookie || ""; if (a !== e) for (e = a, a = e.split("; "), c = {}, h = 0; h < a.length; h++)g = a[h], k = g.indexOf("="), 0 < k && (l = b(g.substring(0, k)), q(c[l]) && (c[l] = b(g.substring(k + 1)))); return c } } function zf() { this.$get = xd } function Jc(a) {
    function b(d, c) {
      if (H(d)) {
        var e = {}; n(d, function (a, c) {
          e[c] =
            b(c, a)
        }); return e
      } return a.factory(d + "Filter", c)
    } this.register = b; this.$get = ["$injector", function (a) { return function (b) { return a.get(b + "Filter") } }]; b("currency", yd); b("date", zd); b("filter", bg); b("json", cg); b("limitTo", dg); b("lowercase", eg); b("number", Ad); b("orderBy", Bd); b("uppercase", fg)
  } function bg() {
    return function (a, b, d) {
      if (!za(a)) { if (null == a) return a; throw G("filter")("notarray", a); } var c; switch (hc(b)) {
        case "function": break; case "boolean": case "null": case "number": case "string": c = !0; case "object": b =
          gg(b, d, c); break; default: return a
      }return Array.prototype.filter.call(a, b)
    }
  } function gg(a, b, d) { var c = H(a) && "$" in a; !0 === b ? b = ma : z(b) || (b = function (a, b) { if (q(a)) return !1; if (null === a || null === b) return a === b; if (H(b) || H(a) && !qc(a)) return !1; a = F("" + a); b = F("" + b); return -1 !== a.indexOf(b) }); return function (e) { return c && !H(e) ? Ka(e, a.$, b, !1) : Ka(e, a, b, d) } } function Ka(a, b, d, c, e) {
    var f = hc(a), g = hc(b); if ("string" === g && "!" === b.charAt(0)) return !Ka(a, b.substring(1), d, c); if (I(a)) return a.some(function (a) { return Ka(a, b, d, c) });
    switch (f) { case "object": var h; if (c) { for (h in a) if ("$" !== h.charAt(0) && Ka(a[h], b, d, !0)) return !0; return e ? !1 : Ka(a, b, d, !1) } if ("object" === g) { for (h in b) if (e = b[h], !z(e) && !q(e) && (f = "$" === h, !Ka(f ? a : a[h], e, d, f, f))) return !1; return !0 } return d(a, b); case "function": return !1; default: return d(a, b) }
  } function hc(a) { return null === a ? "null" : typeof a } function yd(a) {
    var b = a.NUMBER_FORMATS; return function (a, c, e) {
      q(c) && (c = b.CURRENCY_SYM); q(e) && (e = b.PATTERNS[1].maxFrac); return null == a ? a : Cd(a, b.PATTERNS[1], b.GROUP_SEP, b.DECIMAL_SEP,
        e).replace(/\u00A4/g, c)
    }
  } function Ad(a) { var b = a.NUMBER_FORMATS; return function (a, c) { return null == a ? a : Cd(a, b.PATTERNS[0], b.GROUP_SEP, b.DECIMAL_SEP, c) } } function Cd(a, b, d, c, e) {
    if (H(a)) return ""; var f = 0 > a; a = Math.abs(a); var g = Infinity === a; if (!g && !isFinite(a)) return ""; var h = a + "", k = "", l = !1, m = []; g && (k = "\u221e"); if (!g && -1 !== h.indexOf("e")) { var r = h.match(/([\d\.]+)e(-?)(\d+)/); r && "-" == r[2] && r[3] > e + 1 ? a = 0 : (k = h, l = !0) } if (g || l) 0 < e && 1 > a && (k = a.toFixed(e), a = parseFloat(k), k = k.replace(ic, c)); else {
      g = (h.split(ic)[1] || "").length;
      q(e) && (e = Math.min(Math.max(b.minFrac, g), b.maxFrac)); a = +(Math.round(+(a.toString() + "e" + e)).toString() + "e" + -e); var g = ("" + a).split(ic), h = g[0], g = g[1] || "", r = 0, t = b.lgSize, n = b.gSize; if (h.length >= t + n) for (r = h.length - t, l = 0; l < r; l++)0 === (r - l) % n && 0 !== l && (k += d), k += h.charAt(l); for (l = r; l < h.length; l++)0 === (h.length - l) % t && 0 !== l && (k += d), k += h.charAt(l); for (; g.length < e;)g += "0"; e && "0" !== e && (k += c + g.substr(0, e))
    } 0 === a && (f = !1); m.push(f ? b.negPre : b.posPre, k, f ? b.negSuf : b.posSuf); return m.join("")
  } function Gb(a, b, d) {
    var c = "";
    0 > a && (c = "-", a = -a); for (a = "" + a; a.length < b;)a = "0" + a; d && (a = a.substr(a.length - b)); return c + a
  } function ca(a, b, d, c) { d = d || 0; return function (e) { e = e["get" + a](); if (0 < d || e > -d) e += d; 0 === e && -12 == d && (e = 12); return Gb(e, b, c) } } function Hb(a, b) { return function (d, c) { var e = d["get" + a](), f = sb(b ? "SHORT" + a : a); return c[f][e] } } function Dd(a) { var b = (new Date(a, 0, 1)).getDay(); return new Date(a, 0, (4 >= b ? 5 : 12) - b) } function Ed(a) {
    return function (b) {
      var d = Dd(b.getFullYear()); b = +new Date(b.getFullYear(), b.getMonth(), b.getDate() + (4 - b.getDay())) -
        +d; b = 1 + Math.round(b / 6048E5); return Gb(b, a)
    }
  } function jc(a, b) { return 0 >= a.getFullYear() ? b.ERAS[0] : b.ERAS[1] } function zd(a) {
    function b(a) { var b; if (b = a.match(d)) { a = new Date(0); var f = 0, g = 0, h = b[8] ? a.setUTCFullYear : a.setFullYear, k = b[8] ? a.setUTCHours : a.setHours; b[9] && (f = ea(b[9] + b[10]), g = ea(b[9] + b[11])); h.call(a, ea(b[1]), ea(b[2]) - 1, ea(b[3])); f = ea(b[4] || 0) - f; g = ea(b[5] || 0) - g; h = ea(b[6] || 0); b = Math.round(1E3 * parseFloat("0." + (b[7] || 0))); k.call(a, f, g, h, b) } return a } var d = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
    return function (c, d, f) { var g = "", h = [], k, l; d = d || "mediumDate"; d = a.DATETIME_FORMATS[d] || d; E(c) && (c = hg.test(c) ? ea(c) : b(c)); Q(c) && (c = new Date(c)); if (!da(c) || !isFinite(c.getTime())) return c; for (; d;)(l = ig.exec(d)) ? (h = cb(h, l, 1), d = h.pop()) : (h.push(d), d = null); var m = c.getTimezoneOffset(); f && (m = vc(f, c.getTimezoneOffset()), c = Pb(c, f, !0)); n(h, function (b) { k = jg[b]; g += k ? k(c, a.DATETIME_FORMATS, m) : b.replace(/(^'|'$)/g, "").replace(/''/g, "'") }); return g }
  } function cg() { return function (a, b) { q(b) && (b = 2); return db(a, b) } } function dg() {
    return function (a,
      b, d) { b = Infinity === Math.abs(Number(b)) ? Number(b) : ea(b); if (isNaN(b)) return a; Q(a) && (a = a.toString()); if (!I(a) && !E(a)) return a; d = !d || isNaN(d) ? 0 : ea(d); d = 0 > d ? Math.max(0, a.length + d) : d; return 0 <= b ? a.slice(d, d + b) : 0 === d ? a.slice(b, a.length) : a.slice(Math.max(0, d + b), d) }
  } function Bd(a) {
    function b(b, d) {
      d = d ? -1 : 1; return b.map(function (b) {
        var c = 1, h = Ya; if (z(b)) h = b; else if (E(b)) { if ("+" == b.charAt(0) || "-" == b.charAt(0)) c = "-" == b.charAt(0) ? -1 : 1, b = b.substring(1); if ("" !== b && (h = a(b), h.constant)) var k = h(), h = function (a) { return a[k] } } return {
          get: h,
          descending: c * d
        }
      })
    } function d(a) { switch (typeof a) { case "number": case "boolean": case "string": return !0; default: return !1 } } return function (a, e, f) {
      if (!za(a)) return a; I(e) || (e = [e]); 0 === e.length && (e = ["+"]); var g = b(e, f); g.push({ get: function () { return {} }, descending: f ? -1 : 1 }); a = Array.prototype.map.call(a, function (a, b) {
        return {
          value: a, predicateValues: g.map(function (c) {
            var e = c.get(a); c = typeof e; if (null === e) c = "string", e = "null"; else if ("string" === c) e = e.toLowerCase(); else if ("object" === c) a: {
              if ("function" === typeof e.valueOf &&
                (e = e.valueOf(), d(e))) break a; if (qc(e) && (e = e.toString(), d(e))) break a; e = b
            } return { value: e, type: c }
          })
        }
      }); a.sort(function (a, b) { for (var c = 0, d = 0, e = g.length; d < e; ++d) { var c = a.predicateValues[d], f = b.predicateValues[d], n = 0; c.type === f.type ? c.value !== f.value && (n = c.value < f.value ? -1 : 1) : n = c.type < f.type ? -1 : 1; if (c = n * g[d].descending) break } return c }); return a = a.map(function (a) { return a.value })
    }
  } function La(a) { z(a) && (a = { link: a }); a.restrict = a.restrict || "AC"; return na(a) } function Fd(a, b, d, c, e) {
    var f = this, g = []; f.$error =
      {}; f.$$success = {}; f.$pending = u; f.$name = e(b.name || b.ngForm || "")(d); f.$dirty = !1; f.$pristine = !0; f.$valid = !0; f.$invalid = !1; f.$submitted = !1; f.$$parentForm = Ib; f.$rollbackViewValue = function () { n(g, function (a) { a.$rollbackViewValue() }) }; f.$commitViewValue = function () { n(g, function (a) { a.$commitViewValue() }) }; f.$addControl = function (a) { Ra(a.$name, "input"); g.push(a); a.$name && (f[a.$name] = a); a.$$parentForm = f }; f.$$renameControl = function (a, b) { var c = a.$name; f[c] === a && delete f[c]; f[b] = a; a.$name = b }; f.$removeControl = function (a) {
        a.$name &&
          f[a.$name] === a && delete f[a.$name]; n(f.$pending, function (b, c) { f.$setValidity(c, null, a) }); n(f.$error, function (b, c) { f.$setValidity(c, null, a) }); n(f.$$success, function (b, c) { f.$setValidity(c, null, a) }); ab(g, a); a.$$parentForm = Ib
      }; Gd({ ctrl: this, $element: a, set: function (a, b, c) { var d = a[b]; d ? -1 === d.indexOf(c) && d.push(c) : a[b] = [c] }, unset: function (a, b, c) { var d = a[b]; d && (ab(d, c), 0 === d.length && delete a[b]) }, $animate: c }); f.$setDirty = function () { c.removeClass(a, Wa); c.addClass(a, Jb); f.$dirty = !0; f.$pristine = !1; f.$$parentForm.$setDirty() };
    f.$setPristine = function () { c.setClass(a, Wa, Jb + " ng-submitted"); f.$dirty = !1; f.$pristine = !0; f.$submitted = !1; n(g, function (a) { a.$setPristine() }) }; f.$setUntouched = function () { n(g, function (a) { a.$setUntouched() }) }; f.$setSubmitted = function () { c.addClass(a, "ng-submitted"); f.$submitted = !0; f.$$parentForm.$setSubmitted() }
  } function kc(a) { a.$formatters.push(function (b) { return a.$isEmpty(b) ? b : b.toString() }) } function jb(a, b, d, c, e, f) {
    var g = F(b[0].type); if (!e.android) {
      var h = !1; b.on("compositionstart", function (a) { h = !0 });
      b.on("compositionend", function () { h = !1; k() })
    } var k = function (a) { l && (f.defer.cancel(l), l = null); if (!h) { var e = b.val(); a = a && a.type; "password" === g || d.ngTrim && "false" === d.ngTrim || (e = U(e)); (c.$viewValue !== e || "" === e && c.$$hasNativeValidators) && c.$setViewValue(e, a) } }; if (e.hasEvent("input")) b.on("input", k); else {
      var l, m = function (a, b, c) { l || (l = f.defer(function () { l = null; b && b.value === c || k(a) })) }; b.on("keydown", function (a) { var b = a.keyCode; 91 === b || 15 < b && 19 > b || 37 <= b && 40 >= b || m(a, this, this.value) }); if (e.hasEvent("paste")) b.on("paste cut",
        m)
    } b.on("change", k); c.$render = function () { var a = c.$isEmpty(c.$viewValue) ? "" : c.$viewValue; b.val() !== a && b.val(a) }
  } function Kb(a, b) {
    return function (d, c) {
      var e, f; if (da(d)) return d; if (E(d)) {
        '"' == d.charAt(0) && '"' == d.charAt(d.length - 1) && (d = d.substring(1, d.length - 1)); if (kg.test(d)) return new Date(d); a.lastIndex = 0; if (e = a.exec(d)) return e.shift(), f = c ? { yyyy: c.getFullYear(), MM: c.getMonth() + 1, dd: c.getDate(), HH: c.getHours(), mm: c.getMinutes(), ss: c.getSeconds(), sss: c.getMilliseconds() / 1E3 } : {
          yyyy: 1970, MM: 1, dd: 1, HH: 0,
          mm: 0, ss: 0, sss: 0
        }, n(e, function (a, c) { c < b.length && (f[b[c]] = +a) }), new Date(f.yyyy, f.MM - 1, f.dd, f.HH, f.mm, f.ss || 0, 1E3 * f.sss || 0)
      } return NaN
    }
  } function kb(a, b, d, c) {
    return function (e, f, g, h, k, l, m) {
      function r(a) { return a && !(a.getTime && a.getTime() !== a.getTime()) } function n(a) { return y(a) && !da(a) ? d(a) || u : a } Hd(e, f, g, h); jb(e, f, g, h, k, l); var A = h && h.$options && h.$options.timezone, v; h.$$parserName = a; h.$parsers.push(function (a) { return h.$isEmpty(a) ? null : b.test(a) ? (a = d(a, v), A && (a = Pb(a, A)), a) : u }); h.$formatters.push(function (a) {
        if (a &&
          !da(a)) throw lb("datefmt", a); if (r(a)) return (v = a) && A && (v = Pb(v, A, !0)), m("date")(a, c, A); v = null; return ""
      }); if (y(g.min) || g.ngMin) { var s; h.$validators.min = function (a) { return !r(a) || q(s) || d(a) >= s }; g.$observe("min", function (a) { s = n(a); h.$validate() }) } if (y(g.max) || g.ngMax) { var p; h.$validators.max = function (a) { return !r(a) || q(p) || d(a) <= p }; g.$observe("max", function (a) { p = n(a); h.$validate() }) }
    }
  } function Hd(a, b, d, c) {
    (c.$$hasNativeValidators = H(b[0].validity)) && c.$parsers.push(function (a) {
      var c = b.prop("validity") || {};
      return c.badInput && !c.typeMismatch ? u : a
    })
  } function Id(a, b, d, c, e) { if (y(c)) { a = a(c); if (!a.constant) throw lb("constexpr", d, c); return a(b) } return e } function lc(a, b) {
    a = "ngClass" + a; return ["$animate", function (d) {
      function c(a, b) { var c = [], d = 0; a: for (; d < a.length; d++) { for (var e = a[d], m = 0; m < b.length; m++)if (e == b[m]) continue a; c.push(e) } return c } function e(a) { var b = []; return I(a) ? (n(a, function (a) { b = b.concat(e(a)) }), b) : E(a) ? a.split(" ") : H(a) ? (n(a, function (a, c) { a && (b = b.concat(c.split(" "))) }), b) : a } return {
        restrict: "AC",
        link: function (f, g, h) {
          function k(a, b) { var c = g.data("$classCounts") || $(), d = []; n(a, function (a) { if (0 < b || c[a]) c[a] = (c[a] || 0) + b, c[a] === +(0 < b) && d.push(a) }); g.data("$classCounts", c); return d.join(" ") } function l(a) { if (!0 === b || f.$index % 2 === b) { var l = e(a || []); if (!m) { var n = k(l, 1); h.$addClass(n) } else if (!ma(a, m)) { var q = e(m), n = c(l, q), l = c(q, l), n = k(n, 1), l = k(l, -1); n && n.length && d.addClass(g, n); l && l.length && d.removeClass(g, l) } } m = ia(a) } var m; f.$watch(h[a], l, !0); h.$observe("class", function (b) { l(f.$eval(h[a])) }); "ngClass" !==
            a && f.$watch("$index", function (c, d) { var g = c & 1; if (g !== (d & 1)) { var l = e(f.$eval(h[a])); g === b ? (g = k(l, 1), h.$addClass(g)) : (g = k(l, -1), h.$removeClass(g)) } })
        }
      }
    }]
  } function Gd(a) {
    function b(a, b) { b && !f[a] ? (k.addClass(e, a), f[a] = !0) : !b && f[a] && (k.removeClass(e, a), f[a] = !1) } function d(a, c) { a = a ? "-" + zc(a, "-") : ""; b(mb + a, !0 === c); b(Jd + a, !1 === c) } var c = a.ctrl, e = a.$element, f = {}, g = a.set, h = a.unset, k = a.$animate; f[Jd] = !(f[mb] = e.hasClass(mb)); c.$setValidity = function (a, e, f) {
      q(e) ? (c.$pending || (c.$pending = {}), g(c.$pending, a, f)) : (c.$pending &&
        h(c.$pending, a, f), Kd(c.$pending) && (c.$pending = u)); $a(e) ? e ? (h(c.$error, a, f), g(c.$$success, a, f)) : (g(c.$error, a, f), h(c.$$success, a, f)) : (h(c.$error, a, f), h(c.$$success, a, f)); c.$pending ? (b(Ld, !0), c.$valid = c.$invalid = u, d("", null)) : (b(Ld, !1), c.$valid = Kd(c.$error), c.$invalid = !c.$valid, d("", c.$valid)); e = c.$pending && c.$pending[a] ? u : c.$error[a] ? !1 : c.$$success[a] ? !0 : null; d(a, e); c.$$parentForm.$setValidity(a, e, c)
    }
  } function Kd(a) { if (a) for (var b in a) if (a.hasOwnProperty(b)) return !1; return !0 } var lg = /^\/(.+)\/([a-z]*)$/,
    F = function (a) { return E(a) ? a.toLowerCase() : a }, qa = Object.prototype.hasOwnProperty, sb = function (a) { return E(a) ? a.toUpperCase() : a }, Ha, B, oa, ra = [].slice, Pf = [].splice, mg = [].push, sa = Object.prototype.toString, rc = Object.getPrototypeOf, Aa = G("ng"), fa = S.angular || (S.angular = {}), Sb, nb = 0; Ha = X.documentMode; x.$inject = []; Ya.$inject = []; var I = Array.isArray, Vd = /^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/, U = function (a) { return E(a) ? a.trim() : a }, ud = function (a) {
      return a.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,
        "\\$1").replace(/\x08/g, "\\x08")
    }, Ba = function () { if (!y(Ba.rules)) { var a = X.querySelector("[ng-csp]") || X.querySelector("[data-ng-csp]"); if (a) { var b = a.getAttribute("ng-csp") || a.getAttribute("data-ng-csp"); Ba.rules = { noUnsafeEval: !b || -1 !== b.indexOf("no-unsafe-eval"), noInlineStyle: !b || -1 !== b.indexOf("no-inline-style") } } else { a = Ba; try { new Function(""), b = !1 } catch (d) { b = !0 } a.rules = { noUnsafeEval: b, noInlineStyle: !1 } } } return Ba.rules }, pb = function () {
      if (y(pb.name_)) return pb.name_; var a, b, d = Oa.length, c, e; for (b = 0; b <
        d; ++b)if (c = Oa[b], a = X.querySelector("[" + c.replace(":", "\\:") + "jq]")) { e = a.getAttribute(c + "jq"); break } return pb.name_ = e
    }, Oa = ["ng-", "data-ng-", "ng:", "x-ng-"], be = /[A-Z]/g, Ac = !1, Rb, Na = 3, fe = { full: "1.4.8", major: 1, minor: 4, dot: 8, codeName: "ice-manipulation" }; N.expando = "ng339"; var gb = N.cache = {}, Ff = 1; N._data = function (a) { return this.cache[a[this.expando]] || {} }; var Af = /([\:\-\_]+(.))/g, Bf = /^moz([A-Z])/, xb = { mouseleave: "mouseout", mouseenter: "mouseover" }, Ub = G("jqLite"), Ef = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/, Tb = /<|&#?\w+;/,
      Cf = /<([\w:-]+)/, Df = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, ka = { 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, "", ""] }; ka.optgroup = ka.option; ka.tbody = ka.tfoot = ka.colgroup = ka.caption = ka.thead; ka.th = ka.td; var Kf = Node.prototype.contains || function (a) {
        return !!(this.compareDocumentPosition(a) &
          16)
      }, Pa = N.prototype = { ready: function (a) { function b() { d || (d = !0, a()) } var d = !1; "complete" === X.readyState ? setTimeout(b) : (this.on("DOMContentLoaded", b), N(S).on("load", b)) }, toString: function () { var a = []; n(this, function (b) { a.push("" + b) }); return "[" + a.join(", ") + "]" }, eq: function (a) { return 0 <= a ? B(this[a]) : B(this[this.length + a]) }, length: 0, push: mg, sort: [].sort, splice: [].splice }, Cb = {}; n("multiple selected checked disabled readOnly required open".split(" "), function (a) { Cb[F(a)] = a }); var Rc = {}; n("input select option textarea button form details".split(" "),
        function (a) { Rc[a] = !0 }); var Zc = { ngMinlength: "minlength", ngMaxlength: "maxlength", ngMin: "min", ngMax: "max", ngPattern: "pattern" }; n({ data: Wb, removeData: vb, hasData: function (a) { for (var b in gb[a.ng339]) return !0; return !1 } }, function (a, b) { N[b] = a }); n({
          data: Wb, inheritedData: Bb, scope: function (a) { return B.data(a, "$scope") || Bb(a.parentNode || a, ["$isolateScope", "$scope"]) }, isolateScope: function (a) { return B.data(a, "$isolateScope") || B.data(a, "$isolateScopeNoTemplate") }, controller: Oc, injector: function (a) {
            return Bb(a,
              "$injector")
          }, removeAttr: function (a, b) { a.removeAttribute(b) }, hasClass: yb, css: function (a, b, d) { b = fb(b); if (y(d)) a.style[b] = d; else return a.style[b] }, attr: function (a, b, d) { var c = a.nodeType; if (c !== Na && 2 !== c && 8 !== c) if (c = F(b), Cb[c]) if (y(d)) d ? (a[b] = !0, a.setAttribute(b, c)) : (a[b] = !1, a.removeAttribute(c)); else return a[b] || (a.attributes.getNamedItem(b) || x).specified ? c : u; else if (y(d)) a.setAttribute(b, d); else if (a.getAttribute) return a = a.getAttribute(b, 2), null === a ? u : a }, prop: function (a, b, d) { if (y(d)) a[b] = d; else return a[b] },
          text: function () { function a(a, d) { if (q(d)) { var c = a.nodeType; return 1 === c || c === Na ? a.textContent : "" } a.textContent = d } a.$dv = ""; return a }(), val: function (a, b) { if (q(b)) { if (a.multiple && "select" === ta(a)) { var d = []; n(a.options, function (a) { a.selected && d.push(a.value || a.text) }); return 0 === d.length ? null : d } return a.value } a.value = b }, html: function (a, b) { if (q(b)) return a.innerHTML; ub(a, !0); a.innerHTML = b }, empty: Pc
        }, function (a, b) {
          N.prototype[b] = function (b, c) {
            var e, f, g = this.length; if (a !== Pc && q(2 == a.length && a !== yb && a !== Oc ?
              b : c)) { if (H(b)) { for (e = 0; e < g; e++)if (a === Wb) a(this[e], b); else for (f in b) a(this[e], f, b[f]); return this } e = a.$dv; g = q(e) ? Math.min(g, 1) : g; for (f = 0; f < g; f++) { var h = a(this[f], b, c); e = e ? e + h : h } return e } for (e = 0; e < g; e++)a(this[e], b, c); return this
          }
        }); n({
          removeData: vb, on: function (a, b, d, c) {
            if (y(c)) throw Ub("onargs"); if (Kc(a)) {
              c = wb(a, !0); var e = c.events, f = c.handle; f || (f = c.handle = Hf(a, e)); c = 0 <= b.indexOf(" ") ? b.split(" ") : [b]; for (var g = c.length, h = function (b, c, g) {
                var h = e[b]; h || (h = e[b] = [], h.specialHandlerWrapper = c, "$destroy" ===
                  b || g || a.addEventListener(b, f, !1)); h.push(d)
              }; g--;)b = c[g], xb[b] ? (h(xb[b], Jf), h(b, u, !0)) : h(b)
            }
          }, off: Nc, one: function (a, b, d) { a = B(a); a.on(b, function e() { a.off(b, d); a.off(b, e) }); a.on(b, d) }, replaceWith: function (a, b) { var d, c = a.parentNode; ub(a); n(new N(b), function (b) { d ? c.insertBefore(b, d.nextSibling) : c.replaceChild(b, a); d = b }) }, children: function (a) { var b = []; n(a.childNodes, function (a) { 1 === a.nodeType && b.push(a) }); return b }, contents: function (a) { return a.contentDocument || a.childNodes || [] }, append: function (a, b) {
            var d =
              a.nodeType; if (1 === d || 11 === d) { b = new N(b); for (var d = 0, c = b.length; d < c; d++)a.appendChild(b[d]) }
          }, prepend: function (a, b) { if (1 === a.nodeType) { var d = a.firstChild; n(new N(b), function (b) { a.insertBefore(b, d) }) } }, wrap: function (a, b) { b = B(b).eq(0).clone()[0]; var d = a.parentNode; d && d.replaceChild(b, a); b.appendChild(a) }, remove: Xb, detach: function (a) { Xb(a, !0) }, after: function (a, b) { var d = a, c = a.parentNode; b = new N(b); for (var e = 0, f = b.length; e < f; e++) { var g = b[e]; c.insertBefore(g, d.nextSibling); d = g } }, addClass: Ab, removeClass: zb,
          toggleClass: function (a, b, d) { b && n(b.split(" "), function (b) { var e = d; q(e) && (e = !yb(a, b)); (e ? Ab : zb)(a, b) }) }, parent: function (a) { return (a = a.parentNode) && 11 !== a.nodeType ? a : null }, next: function (a) { return a.nextElementSibling }, find: function (a, b) { return a.getElementsByTagName ? a.getElementsByTagName(b) : [] }, clone: Vb, triggerHandler: function (a, b, d) {
            var c, e, f = b.type || b, g = wb(a); if (g = (g = g && g.events) && g[f]) c = {
              preventDefault: function () { this.defaultPrevented = !0 }, isDefaultPrevented: function () { return !0 === this.defaultPrevented },
              stopImmediatePropagation: function () { this.immediatePropagationStopped = !0 }, isImmediatePropagationStopped: function () { return !0 === this.immediatePropagationStopped }, stopPropagation: x, type: f, target: a
            }, b.type && (c = M(c, b)), b = ia(g), e = d ? [c].concat(d) : [c], n(b, function (b) { c.isImmediatePropagationStopped() || b.apply(a, e) })
          }
        }, function (a, b) {
          N.prototype[b] = function (b, c, e) { for (var f, g = 0, h = this.length; g < h; g++)q(f) ? (f = a(this[g], b, c, e), y(f) && (f = B(f))) : Mc(f, a(this[g], b, c, e)); return y(f) ? f : this }; N.prototype.bind = N.prototype.on;
          N.prototype.unbind = N.prototype.off
        }); Sa.prototype = { put: function (a, b) { this[Ca(a, this.nextUid)] = b }, get: function (a) { return this[Ca(a, this.nextUid)] }, remove: function (a) { var b = this[a = Ca(a, this.nextUid)]; delete this[a]; return b } }; var yf = [function () { this.$get = [function () { return Sa }] }], Tc = /^[^\(]*\(\s*([^\)]*)\)/m, ng = /,/, og = /^\s*(_?)(\S+?)\1\s*$/, Sc = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg, Da = G("$injector"); eb.$$annotate = function (a, b, d) {
          var c; if ("function" === typeof a) {
            if (!(c = a.$inject)) {
              c = []; if (a.length) {
                if (b) throw E(d) &&
                  d || (d = a.name || Lf(a)), Da("strictdi", d); b = a.toString().replace(Sc, ""); b = b.match(Tc); n(b[1].split(ng), function (a) { a.replace(og, function (a, b, d) { c.push(d) }) })
              } a.$inject = c
            }
          } else I(a) ? (b = a.length - 1, Qa(a[b], "fn"), c = a.slice(0, b)) : Qa(a, "fn", !0); return c
        }; var Md = G("$animate"), Ue = function () { this.$get = ["$q", "$$rAF", function (a, b) { function d() { } d.all = x; d.chain = x; d.prototype = { end: x, cancel: x, resume: x, pause: x, complete: x, then: function (c, d) { return a(function (a) { b(function () { a() }) }).then(c, d) } }; return d }] }, Te = function () {
          var a =
            new Sa, b = []; this.$get = ["$$AnimateRunner", "$rootScope", function (d, c) {
              function e(a, b, c) { var d = !1; b && (b = E(b) ? b.split(" ") : I(b) ? b : [], n(b, function (b) { b && (d = !0, a[b] = c) })); return d } function f() { n(b, function (b) { var c = a.get(b); if (c) { var d = Mf(b.attr("class")), e = "", f = ""; n(c, function (a, b) { a !== !!d[b] && (a ? e += (e.length ? " " : "") + b : f += (f.length ? " " : "") + b) }); n(b, function (a) { e && Ab(a, e); f && zb(a, f) }); a.remove(b) } }); b.length = 0 } return {
                enabled: x, on: x, off: x, pin: x, push: function (g, h, k, l) {
                  l && l(); k = k || {}; k.from && g.css(k.from);
                  k.to && g.css(k.to); if (k.addClass || k.removeClass) if (h = k.addClass, l = k.removeClass, k = a.get(g) || {}, h = e(k, h, !0), l = e(k, l, !1), h || l) a.put(g, k), b.push(g), 1 === b.length && c.$$postDigest(f); return new d
                }
              }
            }]
        }, Re = ["$provide", function (a) {
          var b = this; this.$$registeredAnimations = Object.create(null); this.register = function (d, c) { if (d && "." !== d.charAt(0)) throw Md("notcsel", d); var e = d + "-animation"; b.$$registeredAnimations[d.substr(1)] = e; a.factory(e, c) }; this.classNameFilter = function (a) {
            if (1 === arguments.length && (this.$$classNameFilter =
              a instanceof RegExp ? a : null) && /(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString())) throw Md("nongcls", "ng-animate"); return this.$$classNameFilter
          }; this.$get = ["$$animateQueue", function (a) {
            function b(a, c, d) { if (d) { var h; a: { for (h = 0; h < d.length; h++) { var k = d[h]; if (1 === k.nodeType) { h = k; break a } } h = void 0 } !h || h.parentNode || h.previousElementSibling || (d = null) } d ? d.after(a) : c.prepend(a) } return {
              on: a.on, off: a.off, pin: a.pin, enabled: a.enabled, cancel: function (a) { a.end && a.end() }, enter: function (e, f, g, h) {
                f =
                  f && B(f); g = g && B(g); f = f || g.parent(); b(e, f, g); return a.push(e, "enter", Ea(h))
              }, move: function (e, f, g, h) { f = f && B(f); g = g && B(g); f = f || g.parent(); b(e, f, g); return a.push(e, "move", Ea(h)) }, leave: function (b, c) { return a.push(b, "leave", Ea(c), function () { b.remove() }) }, addClass: function (b, c, g) { g = Ea(g); g.addClass = hb(g.addclass, c); return a.push(b, "addClass", g) }, removeClass: function (b, c, g) { g = Ea(g); g.removeClass = hb(g.removeClass, c); return a.push(b, "removeClass", g) }, setClass: function (b, c, g, h) {
                h = Ea(h); h.addClass = hb(h.addClass,
                  c); h.removeClass = hb(h.removeClass, g); return a.push(b, "setClass", h)
              }, animate: function (b, c, g, h, k) { k = Ea(k); k.from = k.from ? M(k.from, c) : c; k.to = k.to ? M(k.to, g) : g; k.tempClasses = hb(k.tempClasses, h || "ng-inline-animate"); return a.push(b, "animate", k) }
            }
          }]
        }], Se = function () {
          this.$get = ["$$rAF", "$q", function (a, b) {
            var d = function () { }; d.prototype = {
              done: function (a) { this.defer && this.defer[!0 === a ? "reject" : "resolve"]() }, end: function () { this.done() }, cancel: function () { this.done(!0) }, getPromise: function () {
                this.defer || (this.defer =
                  b.defer()); return this.defer.promise
              }, then: function (a, b) { return this.getPromise().then(a, b) }, "catch": function (a) { return this.getPromise()["catch"](a) }, "finally": function (a) { return this.getPromise()["finally"](a) }
            }; return function (b, e) {
              function f() { a(function () { e.addClass && (b.addClass(e.addClass), e.addClass = null); e.removeClass && (b.removeClass(e.removeClass), e.removeClass = null); e.to && (b.css(e.to), e.to = null); g || h.done(); g = !0 }); return h } e.cleanupStyles && (e.from = e.to = null); e.from && (b.css(e.from), e.from =
                null); var g, h = new d; return { start: f, end: f }
            }
          }]
        }, ha = G("$compile"); Cc.$inject = ["$provide", "$$sanitizeUriProvider"]; var Vc = /^((?:x|data)[\:\-_])/i, Qf = G("$controller"), Uc = /^(\S+)(\s+as\s+(\w+))?$/, $e = function () { this.$get = ["$document", function (a) { return function (b) { b ? !b.nodeType && b instanceof B && (b = b[0]) : b = a[0].body; return b.offsetWidth + 1 } }] }, $c = "application/json", ac = { "Content-Type": $c + ";charset=utf-8" }, Sf = /^\[|^\{(?!\{)/, Tf = { "[": /]$/, "{": /}$/ }, Rf = /^\)\]\}',?\n/, pg = G("$http"), dd = function (a) {
          return function () {
            throw pg("legacy",
              a);
          }
        }, Ja = fa.$interpolateMinErr = G("$interpolate"); Ja.throwNoconcat = function (a) { throw Ja("noconcat", a); }; Ja.interr = function (a, b) { return Ja("interr", a, b.toString()) }; var qg = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/, Vf = { http: 80, https: 443, ftp: 21 }, Db = G("$location"), rg = {
          $$html5: !1, $$replace: !1, absUrl: Eb("$$absUrl"), url: function (a) { if (q(a)) return this.$$url; var b = qg.exec(a); (b[1] || "" === a) && this.path(decodeURIComponent(b[1])); (b[2] || b[1] || "" === a) && this.search(b[3] || ""); this.hash(b[5] || ""); return this }, protocol: Eb("$$protocol"),
          host: Eb("$$host"), port: Eb("$$port"), path: id("$$path", function (a) { a = null !== a ? a.toString() : ""; return "/" == a.charAt(0) ? a : "/" + a }), search: function (a, b) { switch (arguments.length) { case 0: return this.$$search; case 1: if (E(a) || Q(a)) a = a.toString(), this.$$search = xc(a); else if (H(a)) a = bb(a, {}), n(a, function (b, c) { null == b && delete a[c] }), this.$$search = a; else throw Db("isrcharg"); break; default: q(b) || null === b ? delete this.$$search[a] : this.$$search[a] = b }this.$$compose(); return this }, hash: id("$$hash", function (a) {
            return null !==
              a ? a.toString() : ""
          }), replace: function () { this.$$replace = !0; return this }
        }; n([hd, dc, cc], function (a) { a.prototype = Object.create(rg); a.prototype.state = function (b) { if (!arguments.length) return this.$$state; if (a !== cc || !this.$$html5) throw Db("nostate"); this.$$state = q(b) ? null : b; return this } }); var ba = G("$parse"), Wf = Function.prototype.call, Xf = Function.prototype.apply, Yf = Function.prototype.bind, Lb = $(); n("+ - * / % === !== == != < > <= >= && || ! = |".split(" "), function (a) { Lb[a] = !0 }); var sg = {
          n: "\n", f: "\f", r: "\r",
          t: "\t", v: "\v", "'": "'", '"': '"'
        }, fc = function (a) { this.options = a }; fc.prototype = {
          constructor: fc, lex: function (a) {
            this.text = a; this.index = 0; for (this.tokens = []; this.index < this.text.length;)if (a = this.text.charAt(this.index), '"' === a || "'" === a) this.readString(a); else if (this.isNumber(a) || "." === a && this.isNumber(this.peek())) this.readNumber(); else if (this.isIdent(a)) this.readIdent(); else if (this.is(a, "(){}[].,;:?")) this.tokens.push({ index: this.index, text: a }), this.index++; else if (this.isWhitespace(a)) this.index++;
            else { var b = a + this.peek(), d = b + this.peek(2), c = Lb[b], e = Lb[d]; Lb[a] || c || e ? (a = e ? d : c ? b : a, this.tokens.push({ index: this.index, text: a, operator: !0 }), this.index += a.length) : this.throwError("Unexpected next character ", this.index, this.index + 1) } return this.tokens
          }, is: function (a, b) { return -1 !== b.indexOf(a) }, peek: function (a) { a = a || 1; return this.index + a < this.text.length ? this.text.charAt(this.index + a) : !1 }, isNumber: function (a) { return "0" <= a && "9" >= a && "string" === typeof a }, isWhitespace: function (a) {
            return " " === a || "\r" === a ||
              "\t" === a || "\n" === a || "\v" === a || "\u00a0" === a
          }, isIdent: function (a) { return "a" <= a && "z" >= a || "A" <= a && "Z" >= a || "_" === a || "$" === a }, isExpOperator: function (a) { return "-" === a || "+" === a || this.isNumber(a) }, throwError: function (a, b, d) { d = d || this.index; b = y(b) ? "s " + b + "-" + this.index + " [" + this.text.substring(b, d) + "]" : " " + d; throw ba("lexerr", a, b, this.text); }, readNumber: function () {
            for (var a = "", b = this.index; this.index < this.text.length;) {
              var d = F(this.text.charAt(this.index)); if ("." == d || this.isNumber(d)) a += d; else {
                var c = this.peek();
                if ("e" == d && this.isExpOperator(c)) a += d; else if (this.isExpOperator(d) && c && this.isNumber(c) && "e" == a.charAt(a.length - 1)) a += d; else if (!this.isExpOperator(d) || c && this.isNumber(c) || "e" != a.charAt(a.length - 1)) break; else this.throwError("Invalid exponent")
              } this.index++
            } this.tokens.push({ index: b, text: a, constant: !0, value: Number(a) })
          }, readIdent: function () {
            for (var a = this.index; this.index < this.text.length;) { var b = this.text.charAt(this.index); if (!this.isIdent(b) && !this.isNumber(b)) break; this.index++ } this.tokens.push({
              index: a,
              text: this.text.slice(a, this.index), identifier: !0
            })
          }, readString: function (a) {
            var b = this.index; this.index++; for (var d = "", c = a, e = !1; this.index < this.text.length;) {
              var f = this.text.charAt(this.index), c = c + f; if (e) "u" === f ? (e = this.text.substring(this.index + 1, this.index + 5), e.match(/[\da-f]{4}/i) || this.throwError("Invalid unicode escape [\\u" + e + "]"), this.index += 4, d += String.fromCharCode(parseInt(e, 16))) : d += sg[f] || f, e = !1; else if ("\\" === f) e = !0; else {
                if (f === a) {
                  this.index++; this.tokens.push({
                    index: b, text: c, constant: !0,
                    value: d
                  }); return
                } d += f
              } this.index++
            } this.throwError("Unterminated quote", b)
          }
        }; var s = function (a, b) { this.lexer = a; this.options = b }; s.Program = "Program"; s.ExpressionStatement = "ExpressionStatement"; s.AssignmentExpression = "AssignmentExpression"; s.ConditionalExpression = "ConditionalExpression"; s.LogicalExpression = "LogicalExpression"; s.BinaryExpression = "BinaryExpression"; s.UnaryExpression = "UnaryExpression"; s.CallExpression = "CallExpression"; s.MemberExpression = "MemberExpression"; s.Identifier = "Identifier"; s.Literal =
          "Literal"; s.ArrayExpression = "ArrayExpression"; s.Property = "Property"; s.ObjectExpression = "ObjectExpression"; s.ThisExpression = "ThisExpression"; s.NGValueParameter = "NGValueParameter"; s.prototype = {
            ast: function (a) { this.text = a; this.tokens = this.lexer.lex(a); a = this.program(); 0 !== this.tokens.length && this.throwError("is an unexpected token", this.tokens[0]); return a }, program: function () {
              for (var a = []; ;)if (0 < this.tokens.length && !this.peek("}", ")", ";", "]") && a.push(this.expressionStatement()), !this.expect(";")) return {
                type: s.Program,
                body: a
              }
            }, expressionStatement: function () { return { type: s.ExpressionStatement, expression: this.filterChain() } }, filterChain: function () { for (var a = this.expression(); this.expect("|");)a = this.filter(a); return a }, expression: function () { return this.assignment() }, assignment: function () { var a = this.ternary(); this.expect("=") && (a = { type: s.AssignmentExpression, left: a, right: this.assignment(), operator: "=" }); return a }, ternary: function () {
              var a = this.logicalOR(), b, d; return this.expect("?") && (b = this.expression(), this.consume(":")) ?
                (d = this.expression(), { type: s.ConditionalExpression, test: a, alternate: b, consequent: d }) : a
            }, logicalOR: function () { for (var a = this.logicalAND(); this.expect("||");)a = { type: s.LogicalExpression, operator: "||", left: a, right: this.logicalAND() }; return a }, logicalAND: function () { for (var a = this.equality(); this.expect("&&");)a = { type: s.LogicalExpression, operator: "&&", left: a, right: this.equality() }; return a }, equality: function () {
              for (var a = this.relational(), b; b = this.expect("==", "!=", "===", "!==");)a = {
                type: s.BinaryExpression,
                operator: b.text, left: a, right: this.relational()
              }; return a
            }, relational: function () { for (var a = this.additive(), b; b = this.expect("<", ">", "<=", ">=");)a = { type: s.BinaryExpression, operator: b.text, left: a, right: this.additive() }; return a }, additive: function () { for (var a = this.multiplicative(), b; b = this.expect("+", "-");)a = { type: s.BinaryExpression, operator: b.text, left: a, right: this.multiplicative() }; return a }, multiplicative: function () {
              for (var a = this.unary(), b; b = this.expect("*", "/", "%");)a = {
                type: s.BinaryExpression, operator: b.text,
                left: a, right: this.unary()
              }; return a
            }, unary: function () { var a; return (a = this.expect("+", "-", "!")) ? { type: s.UnaryExpression, operator: a.text, prefix: !0, argument: this.unary() } : this.primary() }, primary: function () {
              var a; this.expect("(") ? (a = this.filterChain(), this.consume(")")) : this.expect("[") ? a = this.arrayDeclaration() : this.expect("{") ? a = this.object() : this.constants.hasOwnProperty(this.peek().text) ? a = bb(this.constants[this.consume().text]) : this.peek().identifier ? a = this.identifier() : this.peek().constant ? a = this.constant() :
                this.throwError("not a primary expression", this.peek()); for (var b; b = this.expect("(", "[", ".");)"(" === b.text ? (a = { type: s.CallExpression, callee: a, arguments: this.parseArguments() }, this.consume(")")) : "[" === b.text ? (a = { type: s.MemberExpression, object: a, property: this.expression(), computed: !0 }, this.consume("]")) : "." === b.text ? a = { type: s.MemberExpression, object: a, property: this.identifier(), computed: !1 } : this.throwError("IMPOSSIBLE"); return a
            }, filter: function (a) {
              a = [a]; for (var b = {
                type: s.CallExpression, callee: this.identifier(),
                arguments: a, filter: !0
              }; this.expect(":");)a.push(this.expression()); return b
            }, parseArguments: function () { var a = []; if (")" !== this.peekToken().text) { do a.push(this.expression()); while (this.expect(",")) } return a }, identifier: function () { var a = this.consume(); a.identifier || this.throwError("is not a valid identifier", a); return { type: s.Identifier, name: a.text } }, constant: function () { return { type: s.Literal, value: this.consume().value } }, arrayDeclaration: function () {
              var a = []; if ("]" !== this.peekToken().text) {
                do {
                  if (this.peek("]")) break;
                  a.push(this.expression())
                } while (this.expect(","))
              } this.consume("]"); return { type: s.ArrayExpression, elements: a }
            }, object: function () { var a = [], b; if ("}" !== this.peekToken().text) { do { if (this.peek("}")) break; b = { type: s.Property, kind: "init" }; this.peek().constant ? b.key = this.constant() : this.peek().identifier ? b.key = this.identifier() : this.throwError("invalid key", this.peek()); this.consume(":"); b.value = this.expression(); a.push(b) } while (this.expect(",")) } this.consume("}"); return { type: s.ObjectExpression, properties: a } },
            throwError: function (a, b) { throw ba("syntax", b.text, a, b.index + 1, this.text, this.text.substring(b.index)); }, consume: function (a) { if (0 === this.tokens.length) throw ba("ueoe", this.text); var b = this.expect(a); b || this.throwError("is unexpected, expecting [" + a + "]", this.peek()); return b }, peekToken: function () { if (0 === this.tokens.length) throw ba("ueoe", this.text); return this.tokens[0] }, peek: function (a, b, d, c) { return this.peekAhead(0, a, b, d, c) }, peekAhead: function (a, b, d, c, e) {
              if (this.tokens.length > a) {
                a = this.tokens[a];
                var f = a.text; if (f === b || f === d || f === c || f === e || !(b || d || c || e)) return a
              } return !1
            }, expect: function (a, b, d, c) { return (a = this.peek(a, b, d, c)) ? (this.tokens.shift(), a) : !1 }, constants: { "true": { type: s.Literal, value: !0 }, "false": { type: s.Literal, value: !1 }, "null": { type: s.Literal, value: null }, undefined: { type: s.Literal, value: u }, "this": { type: s.ThisExpression } }
          }; rd.prototype = {
            compile: function (a, b) {
              var d = this, c = this.astBuilder.ast(a); this.state = {
                nextId: 0, filters: {}, expensiveChecks: b, fn: { vars: [], body: [], own: {} }, assign: {
                  vars: [],
                  body: [], own: {}
                }, inputs: []
              }; W(c, d.$filter); var e = "", f; this.stage = "assign"; if (f = pd(c)) this.state.computing = "assign", e = this.nextId(), this.recurse(f, e), this.return_(e), e = "fn.assign=" + this.generateFunction("assign", "s,v,l"); f = nd(c.body); d.stage = "inputs"; n(f, function (a, b) { var c = "fn" + b; d.state[c] = { vars: [], body: [], own: {} }; d.state.computing = c; var e = d.nextId(); d.recurse(a, e); d.return_(e); d.state.inputs.push(c); a.watchId = b }); this.state.computing = "fn"; this.stage = "main"; this.recurse(c); e = '"' + this.USE + " " + this.STRICT +
                '";\n' + this.filterPrefix() + "var fn=" + this.generateFunction("fn", "s,l,a,i") + e + this.watchFns() + "return fn;"; e = (new Function("$filter", "ensureSafeMemberName", "ensureSafeObject", "ensureSafeFunction", "getStringValue", "ensureSafeAssignContext", "ifDefined", "plus", "text", e))(this.$filter, Va, xa, kd, jd, ld, Zf, md, a); this.state = this.stage = u; e.literal = qd(c); e.constant = c.constant; return e
            }, USE: "use", STRICT: "strict", watchFns: function () {
              var a = [], b = this.state.inputs, d = this; n(b, function (b) {
                a.push("var " + b + "=" + d.generateFunction(b,
                  "s"))
              }); b.length && a.push("fn.inputs=[" + b.join(",") + "];"); return a.join("")
            }, generateFunction: function (a, b) { return "function(" + b + "){" + this.varsPrefix(a) + this.body(a) + "};" }, filterPrefix: function () { var a = [], b = this; n(this.state.filters, function (d, c) { a.push(d + "=$filter(" + b.escape(c) + ")") }); return a.length ? "var " + a.join(",") + ";" : "" }, varsPrefix: function (a) { return this.state[a].vars.length ? "var " + this.state[a].vars.join(",") + ";" : "" }, body: function (a) { return this.state[a].body.join("") }, recurse: function (a, b,
              d, c, e, f) {
              var g, h, k = this, l, m; c = c || x; if (!f && y(a.watchId)) b = b || this.nextId(), this.if_("i", this.lazyAssign(b, this.computedMember("i", a.watchId)), this.lazyRecurse(a, b, d, c, e, !0)); else switch (a.type) {
                case s.Program: n(a.body, function (b, c) { k.recurse(b.expression, u, u, function (a) { h = a }); c !== a.body.length - 1 ? k.current().body.push(h, ";") : k.return_(h) }); break; case s.Literal: m = this.escape(a.value); this.assign(b, m); c(m); break; case s.UnaryExpression: this.recurse(a.argument, u, u, function (a) { h = a }); m = a.operator + "(" + this.ifDefined(h,
                  0) + ")"; this.assign(b, m); c(m); break; case s.BinaryExpression: this.recurse(a.left, u, u, function (a) { g = a }); this.recurse(a.right, u, u, function (a) { h = a }); m = "+" === a.operator ? this.plus(g, h) : "-" === a.operator ? this.ifDefined(g, 0) + a.operator + this.ifDefined(h, 0) : "(" + g + ")" + a.operator + "(" + h + ")"; this.assign(b, m); c(m); break; case s.LogicalExpression: b = b || this.nextId(); k.recurse(a.left, b); k.if_("&&" === a.operator ? b : k.not(b), k.lazyRecurse(a.right, b)); c(b); break; case s.ConditionalExpression: b = b || this.nextId(); k.recurse(a.test,
                    b); k.if_(b, k.lazyRecurse(a.alternate, b), k.lazyRecurse(a.consequent, b)); c(b); break; case s.Identifier: b = b || this.nextId(); d && (d.context = "inputs" === k.stage ? "s" : this.assign(this.nextId(), this.getHasOwnProperty("l", a.name) + "?l:s"), d.computed = !1, d.name = a.name); Va(a.name); k.if_("inputs" === k.stage || k.not(k.getHasOwnProperty("l", a.name)), function () {
                      k.if_("inputs" === k.stage || "s", function () {
                        e && 1 !== e && k.if_(k.not(k.nonComputedMember("s", a.name)), k.lazyAssign(k.nonComputedMember("s", a.name), "{}")); k.assign(b, k.nonComputedMember("s",
                          a.name))
                      })
                    }, b && k.lazyAssign(b, k.nonComputedMember("l", a.name))); (k.state.expensiveChecks || Fb(a.name)) && k.addEnsureSafeObject(b); c(b); break; case s.MemberExpression: g = d && (d.context = this.nextId()) || this.nextId(); b = b || this.nextId(); k.recurse(a.object, g, u, function () {
                      k.if_(k.notNull(g), function () {
                        if (a.computed) h = k.nextId(), k.recurse(a.property, h), k.getStringValue(h), k.addEnsureSafeMemberName(h), e && 1 !== e && k.if_(k.not(k.computedMember(g, h)), k.lazyAssign(k.computedMember(g, h), "{}")), m = k.ensureSafeObject(k.computedMember(g,
                          h)), k.assign(b, m), d && (d.computed = !0, d.name = h); else { Va(a.property.name); e && 1 !== e && k.if_(k.not(k.nonComputedMember(g, a.property.name)), k.lazyAssign(k.nonComputedMember(g, a.property.name), "{}")); m = k.nonComputedMember(g, a.property.name); if (k.state.expensiveChecks || Fb(a.property.name)) m = k.ensureSafeObject(m); k.assign(b, m); d && (d.computed = !1, d.name = a.property.name) }
                      }, function () { k.assign(b, "undefined") }); c(b)
                    }, !!e); break; case s.CallExpression: b = b || this.nextId(); a.filter ? (h = k.filter(a.callee.name), l = [], n(a.arguments,
                      function (a) { var b = k.nextId(); k.recurse(a, b); l.push(b) }), m = h + "(" + l.join(",") + ")", k.assign(b, m), c(b)) : (h = k.nextId(), g = {}, l = [], k.recurse(a.callee, h, g, function () {
                        k.if_(k.notNull(h), function () { k.addEnsureSafeFunction(h); n(a.arguments, function (a) { k.recurse(a, k.nextId(), u, function (a) { l.push(k.ensureSafeObject(a)) }) }); g.name ? (k.state.expensiveChecks || k.addEnsureSafeObject(g.context), m = k.member(g.context, g.name, g.computed) + "(" + l.join(",") + ")") : m = h + "(" + l.join(",") + ")"; m = k.ensureSafeObject(m); k.assign(b, m) },
                          function () { k.assign(b, "undefined") }); c(b)
                      })); break; case s.AssignmentExpression: h = this.nextId(); g = {}; if (!od(a.left)) throw ba("lval"); this.recurse(a.left, u, g, function () { k.if_(k.notNull(g.context), function () { k.recurse(a.right, h); k.addEnsureSafeObject(k.member(g.context, g.name, g.computed)); k.addEnsureSafeAssignContext(g.context); m = k.member(g.context, g.name, g.computed) + a.operator + h; k.assign(b, m); c(b || m) }) }, 1); break; case s.ArrayExpression: l = []; n(a.elements, function (a) { k.recurse(a, k.nextId(), u, function (a) { l.push(a) }) });
                  m = "[" + l.join(",") + "]"; this.assign(b, m); c(m); break; case s.ObjectExpression: l = []; n(a.properties, function (a) { k.recurse(a.value, k.nextId(), u, function (b) { l.push(k.escape(a.key.type === s.Identifier ? a.key.name : "" + a.key.value) + ":" + b) }) }); m = "{" + l.join(",") + "}"; this.assign(b, m); c(m); break; case s.ThisExpression: this.assign(b, "s"); c("s"); break; case s.NGValueParameter: this.assign(b, "v"), c("v")
              }
            }, getHasOwnProperty: function (a, b) {
              var d = a + "." + b, c = this.current().own; c.hasOwnProperty(d) || (c[d] = this.nextId(!1, a + "&&(" +
                this.escape(b) + " in " + a + ")")); return c[d]
            }, assign: function (a, b) { if (a) return this.current().body.push(a, "=", b, ";"), a }, filter: function (a) { this.state.filters.hasOwnProperty(a) || (this.state.filters[a] = this.nextId(!0)); return this.state.filters[a] }, ifDefined: function (a, b) { return "ifDefined(" + a + "," + this.escape(b) + ")" }, plus: function (a, b) { return "plus(" + a + "," + b + ")" }, return_: function (a) { this.current().body.push("return ", a, ";") }, if_: function (a, b, d) {
              if (!0 === a) b(); else {
                var c = this.current().body; c.push("if(", a,
                  "){"); b(); c.push("}"); d && (c.push("else{"), d(), c.push("}"))
              }
            }, not: function (a) { return "!(" + a + ")" }, notNull: function (a) { return a + "!=null" }, nonComputedMember: function (a, b) { return a + "." + b }, computedMember: function (a, b) { return a + "[" + b + "]" }, member: function (a, b, d) { return d ? this.computedMember(a, b) : this.nonComputedMember(a, b) }, addEnsureSafeObject: function (a) { this.current().body.push(this.ensureSafeObject(a), ";") }, addEnsureSafeMemberName: function (a) { this.current().body.push(this.ensureSafeMemberName(a), ";") },
            addEnsureSafeFunction: function (a) { this.current().body.push(this.ensureSafeFunction(a), ";") }, addEnsureSafeAssignContext: function (a) { this.current().body.push(this.ensureSafeAssignContext(a), ";") }, ensureSafeObject: function (a) { return "ensureSafeObject(" + a + ",text)" }, ensureSafeMemberName: function (a) { return "ensureSafeMemberName(" + a + ",text)" }, ensureSafeFunction: function (a) { return "ensureSafeFunction(" + a + ",text)" }, getStringValue: function (a) { this.assign(a, "getStringValue(" + a + ",text)") }, ensureSafeAssignContext: function (a) {
              return "ensureSafeAssignContext(" +
                a + ",text)"
            }, lazyRecurse: function (a, b, d, c, e, f) { var g = this; return function () { g.recurse(a, b, d, c, e, f) } }, lazyAssign: function (a, b) { var d = this; return function () { d.assign(a, b) } }, stringEscapeRegex: /[^ a-zA-Z0-9]/g, stringEscapeFn: function (a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }, escape: function (a) {
              if (E(a)) return "'" + a.replace(this.stringEscapeRegex, this.stringEscapeFn) + "'"; if (Q(a)) return a.toString(); if (!0 === a) return "true"; if (!1 === a) return "false"; if (null === a) return "null"; if ("undefined" ===
                typeof a) return "undefined"; throw ba("esc");
            }, nextId: function (a, b) { var d = "v" + this.state.nextId++; a || this.current().vars.push(d + (b ? "=" + b : "")); return d }, current: function () { return this.state[this.state.computing] }
          }; sd.prototype = {
            compile: function (a, b) {
              var d = this, c = this.astBuilder.ast(a); this.expression = a; this.expensiveChecks = b; W(c, d.$filter); var e, f; if (e = pd(c)) f = this.recurse(e); e = nd(c.body); var g; e && (g = [], n(e, function (a, b) { var c = d.recurse(a); a.input = c; g.push(c); a.watchId = b })); var h = []; n(c.body, function (a) { h.push(d.recurse(a.expression)) });
              e = 0 === c.body.length ? function () { } : 1 === c.body.length ? h[0] : function (a, b) { var c; n(h, function (d) { c = d(a, b) }); return c }; f && (e.assign = function (a, b, c) { return f(a, c, b) }); g && (e.inputs = g); e.literal = qd(c); e.constant = c.constant; return e
            }, recurse: function (a, b, d) {
              var c, e, f = this, g; if (a.input) return this.inputs(a.input, a.watchId); switch (a.type) {
                case s.Literal: return this.value(a.value, b); case s.UnaryExpression: return e = this.recurse(a.argument), this["unary" + a.operator](e, b); case s.BinaryExpression: return c = this.recurse(a.left),
                  e = this.recurse(a.right), this["binary" + a.operator](c, e, b); case s.LogicalExpression: return c = this.recurse(a.left), e = this.recurse(a.right), this["binary" + a.operator](c, e, b); case s.ConditionalExpression: return this["ternary?:"](this.recurse(a.test), this.recurse(a.alternate), this.recurse(a.consequent), b); case s.Identifier: return Va(a.name, f.expression), f.identifier(a.name, f.expensiveChecks || Fb(a.name), b, d, f.expression); case s.MemberExpression: return c = this.recurse(a.object, !1, !!d), a.computed || (Va(a.property.name,
                    f.expression), e = a.property.name), a.computed && (e = this.recurse(a.property)), a.computed ? this.computedMember(c, e, b, d, f.expression) : this.nonComputedMember(c, e, f.expensiveChecks, b, d, f.expression); case s.CallExpression: return g = [], n(a.arguments, function (a) { g.push(f.recurse(a)) }), a.filter && (e = this.$filter(a.callee.name)), a.filter || (e = this.recurse(a.callee, !0)), a.filter ? function (a, c, d, f) { for (var r = [], n = 0; n < g.length; ++n)r.push(g[n](a, c, d, f)); a = e.apply(u, r, f); return b ? { context: u, name: u, value: a } : a } : function (a,
                      c, d, m) { var r = e(a, c, d, m), n; if (null != r.value) { xa(r.context, f.expression); kd(r.value, f.expression); n = []; for (var q = 0; q < g.length; ++q)n.push(xa(g[q](a, c, d, m), f.expression)); n = xa(r.value.apply(r.context, n), f.expression) } return b ? { value: n } : n }; case s.AssignmentExpression: return c = this.recurse(a.left, !0, 1), e = this.recurse(a.right), function (a, d, g, m) { var n = c(a, d, g, m); a = e(a, d, g, m); xa(n.value, f.expression); ld(n.context); n.context[n.name] = a; return b ? { value: a } : a }; case s.ArrayExpression: return g = [], n(a.elements, function (a) { g.push(f.recurse(a)) }),
                        function (a, c, d, e) { for (var f = [], n = 0; n < g.length; ++n)f.push(g[n](a, c, d, e)); return b ? { value: f } : f }; case s.ObjectExpression: return g = [], n(a.properties, function (a) { g.push({ key: a.key.type === s.Identifier ? a.key.name : "" + a.key.value, value: f.recurse(a.value) }) }), function (a, c, d, e) { for (var f = {}, n = 0; n < g.length; ++n)f[g[n].key] = g[n].value(a, c, d, e); return b ? { value: f } : f }; case s.ThisExpression: return function (a) { return b ? { value: a } : a }; case s.NGValueParameter: return function (a, c, d, e) { return b ? { value: d } : d }
              }
            }, "unary+": function (a,
              b) { return function (d, c, e, f) { d = a(d, c, e, f); d = y(d) ? +d : 0; return b ? { value: d } : d } }, "unary-": function (a, b) { return function (d, c, e, f) { d = a(d, c, e, f); d = y(d) ? -d : 0; return b ? { value: d } : d } }, "unary!": function (a, b) { return function (d, c, e, f) { d = !a(d, c, e, f); return b ? { value: d } : d } }, "binary+": function (a, b, d) { return function (c, e, f, g) { var h = a(c, e, f, g); c = b(c, e, f, g); h = md(h, c); return d ? { value: h } : h } }, "binary-": function (a, b, d) { return function (c, e, f, g) { var h = a(c, e, f, g); c = b(c, e, f, g); h = (y(h) ? h : 0) - (y(c) ? c : 0); return d ? { value: h } : h } }, "binary*": function (a,
                b, d) { return function (c, e, f, g) { c = a(c, e, f, g) * b(c, e, f, g); return d ? { value: c } : c } }, "binary/": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) / b(c, e, f, g); return d ? { value: c } : c } }, "binary%": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) % b(c, e, f, g); return d ? { value: c } : c } }, "binary===": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) === b(c, e, f, g); return d ? { value: c } : c } }, "binary!==": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) !== b(c, e, f, g); return d ? { value: c } : c } }, "binary==": function (a, b,
                  d) { return function (c, e, f, g) { c = a(c, e, f, g) == b(c, e, f, g); return d ? { value: c } : c } }, "binary!=": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) != b(c, e, f, g); return d ? { value: c } : c } }, "binary<": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) < b(c, e, f, g); return d ? { value: c } : c } }, "binary>": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) > b(c, e, f, g); return d ? { value: c } : c } }, "binary<=": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) <= b(c, e, f, g); return d ? { value: c } : c } }, "binary>=": function (a, b, d) {
                    return function (c,
                      e, f, g) { c = a(c, e, f, g) >= b(c, e, f, g); return d ? { value: c } : c }
                  }, "binary&&": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) && b(c, e, f, g); return d ? { value: c } : c } }, "binary||": function (a, b, d) { return function (c, e, f, g) { c = a(c, e, f, g) || b(c, e, f, g); return d ? { value: c } : c } }, "ternary?:": function (a, b, d, c) { return function (e, f, g, h) { e = a(e, f, g, h) ? b(e, f, g, h) : d(e, f, g, h); return c ? { value: e } : e } }, value: function (a, b) { return function () { return b ? { context: u, name: u, value: a } : a } }, identifier: function (a, b, d, c, e) {
                    return function (f, g, h, k) {
                      f =
                        g && a in g ? g : f; c && 1 !== c && f && !f[a] && (f[a] = {}); g = f ? f[a] : u; b && xa(g, e); return d ? { context: f, name: a, value: g } : g
                    }
                  }, computedMember: function (a, b, d, c, e) { return function (f, g, h, k) { var l = a(f, g, h, k), m, n; null != l && (m = b(f, g, h, k), m = jd(m), Va(m, e), c && 1 !== c && l && !l[m] && (l[m] = {}), n = l[m], xa(n, e)); return d ? { context: l, name: m, value: n } : n } }, nonComputedMember: function (a, b, d, c, e, f) { return function (g, h, k, l) { g = a(g, h, k, l); e && 1 !== e && g && !g[b] && (g[b] = {}); h = null != g ? g[b] : u; (d || Fb(b)) && xa(h, f); return c ? { context: g, name: b, value: h } : h } }, inputs: function (a,
                    b) { return function (d, c, e, f) { return f ? f[b] : a(d, c, e) } }
          }; var gc = function (a, b, d) { this.lexer = a; this.$filter = b; this.options = d; this.ast = new s(this.lexer); this.astCompiler = d.csp ? new sd(this.ast, b) : new rd(this.ast, b) }; gc.prototype = { constructor: gc, parse: function (a) { return this.astCompiler.compile(a, this.options.expensiveChecks) } }; $(); $(); var $f = Object.prototype.valueOf, ya = G("$sce"), la = { HTML: "html", CSS: "css", URL: "url", RESOURCE_URL: "resourceUrl", JS: "js" }, ha = G("$compile"), Y = X.createElement("a"), wd = wa(S.location.href);
  xd.$inject = ["$document"]; Jc.$inject = ["$provide"]; yd.$inject = ["$locale"]; Ad.$inject = ["$locale"]; var ic = ".", jg = {
    yyyy: ca("FullYear", 4), yy: ca("FullYear", 2, 0, !0), y: ca("FullYear", 1), MMMM: Hb("Month"), MMM: Hb("Month", !0), MM: ca("Month", 2, 1), M: ca("Month", 1, 1), dd: ca("Date", 2), d: ca("Date", 1), HH: ca("Hours", 2), H: ca("Hours", 1), hh: ca("Hours", 2, -12), h: ca("Hours", 1, -12), mm: ca("Minutes", 2), m: ca("Minutes", 1), ss: ca("Seconds", 2), s: ca("Seconds", 1), sss: ca("Milliseconds", 3), EEEE: Hb("Day"), EEE: Hb("Day", !0), a: function (a, b) {
      return 12 >
        a.getHours() ? b.AMPMS[0] : b.AMPMS[1]
    }, Z: function (a, b, d) { a = -1 * d; return a = (0 <= a ? "+" : "") + (Gb(Math[0 < a ? "floor" : "ceil"](a / 60), 2) + Gb(Math.abs(a % 60), 2)) }, ww: Ed(2), w: Ed(1), G: jc, GG: jc, GGG: jc, GGGG: function (a, b) { return 0 >= a.getFullYear() ? b.ERANAMES[0] : b.ERANAMES[1] }
  }, ig = /((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/, hg = /^\-?\d+$/; zd.$inject = ["$locale"]; var eg = na(F), fg = na(sb); Bd.$inject = ["$parse"]; var he = na({
    restrict: "E", compile: function (a, b) {
      if (!b.href && !b.xlinkHref) return function (a,
        b) { if ("a" === b[0].nodeName.toLowerCase()) { var e = "[object SVGAnimatedString]" === sa.call(b.prop("href")) ? "xlink:href" : "href"; b.on("click", function (a) { b.attr(e) || a.preventDefault() }) } }
    }
  }), tb = {}; n(Cb, function (a, b) { function d(a, d, e) { a.$watch(e[c], function (a) { e.$set(b, !!a) }) } if ("multiple" != a) { var c = va("ng-" + b), e = d; "checked" === a && (e = function (a, b, e) { e.ngModel !== e[c] && d(a, b, e) }); tb[c] = function () { return { restrict: "A", priority: 100, link: e } } } }); n(Zc, function (a, b) {
    tb[b] = function () {
      return {
        priority: 100, link: function (a,
          c, e) { if ("ngPattern" === b && "/" == e.ngPattern.charAt(0) && (c = e.ngPattern.match(lg))) { e.$set("ngPattern", new RegExp(c[1], c[2])); return } a.$watch(e[b], function (a) { e.$set(b, a) }) }
      }
    }
  }); n(["src", "srcset", "href"], function (a) { var b = va("ng-" + a); tb[b] = function () { return { priority: 99, link: function (d, c, e) { var f = a, g = a; "href" === a && "[object SVGAnimatedString]" === sa.call(c.prop("href")) && (g = "xlinkHref", e.$attr[g] = "xlink:href", f = null); e.$observe(b, function (b) { b ? (e.$set(g, b), Ha && f && c.prop(f, e[g])) : "href" === a && e.$set(g, null) }) } } } });
  var Ib = { $addControl: x, $$renameControl: function (a, b) { a.$name = b }, $removeControl: x, $setValidity: x, $setDirty: x, $setPristine: x, $setSubmitted: x }; Fd.$inject = ["$element", "$attrs", "$scope", "$animate", "$interpolate"]; var Nd = function (a) {
    return ["$timeout", "$parse", function (b, d) {
      function c(a) { return "" === a ? d('this[""]').assign : d(a).assign || x } return {
        name: "form", restrict: a ? "EAC" : "E", require: ["form", "^^?form"], controller: Fd, compile: function (d, f) {
          d.addClass(Wa).addClass(mb); var g = f.name ? "name" : a && f.ngForm ? "ngForm" :
            !1; return {
              pre: function (a, d, e, f) {
                var n = f[0]; if (!("action" in e)) { var q = function (b) { a.$apply(function () { n.$commitViewValue(); n.$setSubmitted() }); b.preventDefault() }; d[0].addEventListener("submit", q, !1); d.on("$destroy", function () { b(function () { d[0].removeEventListener("submit", q, !1) }, 0, !1) }) } (f[1] || n.$$parentForm).$addControl(n); var s = g ? c(n.$name) : x; g && (s(a, n), e.$observe(g, function (b) { n.$name !== b && (s(a, u), n.$$parentForm.$$renameControl(n, b), s = c(n.$name), s(a, n)) })); d.on("$destroy", function () {
                  n.$$parentForm.$removeControl(n);
                  s(a, u); M(n, Ib)
                })
              }
            }
        }
      }
    }]
  }, ie = Nd(), ve = Nd(!0), kg = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/, tg = /^[A-Za-z][A-Za-z\d.+-]*:\/*(?:\w+(?::\w+)?@)?[^\s/]+(?::\d+)?(?:\/[\w#!:.?+=&%@\-/]*)?$/, ug = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i, vg = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/, Od = /^(\d{4})-(\d{2})-(\d{2})$/, Pd = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/, mc = /^(\d{4})-W(\d\d)$/, Qd = /^(\d{4})-(\d\d)$/,
    Rd = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/, Sd = {
      text: function (a, b, d, c, e, f) { jb(a, b, d, c, e, f); kc(c) }, date: kb("date", Od, Kb(Od, ["yyyy", "MM", "dd"]), "yyyy-MM-dd"), "datetime-local": kb("datetimelocal", Pd, Kb(Pd, "yyyy MM dd HH mm ss sss".split(" ")), "yyyy-MM-ddTHH:mm:ss.sss"), time: kb("time", Rd, Kb(Rd, ["HH", "mm", "ss", "sss"]), "HH:mm:ss.sss"), week: kb("week", mc, function (a, b) {
        if (da(a)) return a; if (E(a)) {
          mc.lastIndex = 0; var d = mc.exec(a); if (d) {
            var c = +d[1], e = +d[2], f = d = 0, g = 0, h = 0, k = Dd(c), e = 7 * (e - 1); b && (d = b.getHours(), f =
              b.getMinutes(), g = b.getSeconds(), h = b.getMilliseconds()); return new Date(c, 0, k.getDate() + e, d, f, g, h)
          }
        } return NaN
      }, "yyyy-Www"), month: kb("month", Qd, Kb(Qd, ["yyyy", "MM"]), "yyyy-MM"), number: function (a, b, d, c, e, f) {
        Hd(a, b, d, c); jb(a, b, d, c, e, f); c.$$parserName = "number"; c.$parsers.push(function (a) { return c.$isEmpty(a) ? null : vg.test(a) ? parseFloat(a) : u }); c.$formatters.push(function (a) { if (!c.$isEmpty(a)) { if (!Q(a)) throw lb("numfmt", a); a = a.toString() } return a }); if (y(d.min) || d.ngMin) {
          var g; c.$validators.min = function (a) {
            return c.$isEmpty(a) ||
              q(g) || a >= g
          }; d.$observe("min", function (a) { y(a) && !Q(a) && (a = parseFloat(a, 10)); g = Q(a) && !isNaN(a) ? a : u; c.$validate() })
        } if (y(d.max) || d.ngMax) { var h; c.$validators.max = function (a) { return c.$isEmpty(a) || q(h) || a <= h }; d.$observe("max", function (a) { y(a) && !Q(a) && (a = parseFloat(a, 10)); h = Q(a) && !isNaN(a) ? a : u; c.$validate() }) }
      }, url: function (a, b, d, c, e, f) { jb(a, b, d, c, e, f); kc(c); c.$$parserName = "url"; c.$validators.url = function (a, b) { var d = a || b; return c.$isEmpty(d) || tg.test(d) } }, email: function (a, b, d, c, e, f) {
        jb(a, b, d, c, e, f); kc(c);
        c.$$parserName = "email"; c.$validators.email = function (a, b) { var d = a || b; return c.$isEmpty(d) || ug.test(d) }
      }, radio: function (a, b, d, c) { q(d.name) && b.attr("name", ++nb); b.on("click", function (a) { b[0].checked && c.$setViewValue(d.value, a && a.type) }); c.$render = function () { b[0].checked = d.value == c.$viewValue }; d.$observe("value", c.$render) }, checkbox: function (a, b, d, c, e, f, g, h) {
        var k = Id(h, a, "ngTrueValue", d.ngTrueValue, !0), l = Id(h, a, "ngFalseValue", d.ngFalseValue, !1); b.on("click", function (a) {
          c.$setViewValue(b[0].checked, a &&
            a.type)
        }); c.$render = function () { b[0].checked = c.$viewValue }; c.$isEmpty = function (a) { return !1 === a }; c.$formatters.push(function (a) { return ma(a, k) }); c.$parsers.push(function (a) { return a ? k : l })
      }, hidden: x, button: x, submit: x, reset: x, file: x
    }, Dc = ["$browser", "$sniffer", "$filter", "$parse", function (a, b, d, c) { return { restrict: "E", require: ["?ngModel"], link: { pre: function (e, f, g, h) { h[0] && (Sd[F(g.type)] || Sd.text)(e, f, g, h[0], b, a, d, c) } } } }], wg = /^(true|false|\d+)$/, Ne = function () {
      return {
        restrict: "A", priority: 100, compile: function (a,
          b) { return wg.test(b.ngValue) ? function (a, b, e) { e.$set("value", a.$eval(e.ngValue)) } : function (a, b, e) { a.$watch(e.ngValue, function (a) { e.$set("value", a) }) } }
      }
    }, ne = ["$compile", function (a) { return { restrict: "AC", compile: function (b) { a.$$addBindingClass(b); return function (b, c, e) { a.$$addBindingInfo(c, e.ngBind); c = c[0]; b.$watch(e.ngBind, function (a) { c.textContent = q(a) ? "" : a }) } } } }], pe = ["$interpolate", "$compile", function (a, b) {
      return {
        compile: function (d) {
          b.$$addBindingClass(d); return function (c, d, f) {
            c = a(d.attr(f.$attr.ngBindTemplate));
            b.$$addBindingInfo(d, c.expressions); d = d[0]; f.$observe("ngBindTemplate", function (a) { d.textContent = q(a) ? "" : a })
          }
        }
      }
    }], oe = ["$sce", "$parse", "$compile", function (a, b, d) { return { restrict: "A", compile: function (c, e) { var f = b(e.ngBindHtml), g = b(e.ngBindHtml, function (a) { return (a || "").toString() }); d.$$addBindingClass(c); return function (b, c, e) { d.$$addBindingInfo(c, e.ngBindHtml); b.$watch(g, function () { c.html(a.getTrustedHtml(f(b)) || "") }) } } } }], Me = na({ restrict: "A", require: "ngModel", link: function (a, b, d, c) { c.$viewChangeListeners.push(function () { a.$eval(d.ngChange) }) } }),
    qe = lc("", !0), se = lc("Odd", 0), re = lc("Even", 1), te = La({ compile: function (a, b) { b.$set("ngCloak", u); a.removeClass("ng-cloak") } }), ue = [function () { return { restrict: "A", scope: !0, controller: "@", priority: 500 } }], Ic = {}, xg = { blur: !0, focus: !0 }; n("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "), function (a) {
      var b = va("ng-" + a); Ic[b] = ["$parse", "$rootScope", function (d, c) {
        return {
          restrict: "A", compile: function (e, f) {
            var g =
              d(f[b], null, !0); return function (b, d) { d.on(a, function (d) { var e = function () { g(b, { $event: d }) }; xg[a] && c.$$phase ? b.$evalAsync(e) : b.$apply(e) }) }
          }
        }
      }]
    }); var xe = ["$animate", function (a) {
      return {
        multiElement: !0, transclude: "element", priority: 600, terminal: !0, restrict: "A", $$tlb: !0, link: function (b, d, c, e, f) {
          var g, h, k; b.$watch(c.ngIf, function (b) {
            b ? h || f(function (b, e) { h = e; b[b.length++] = X.createComment(" end ngIf: " + c.ngIf + " "); g = { clone: b }; a.enter(b, d.parent(), d) }) : (k && (k.remove(), k = null), h && (h.$destroy(), h = null), g && (k =
              rb(g.clone), a.leave(k).then(function () { k = null }), g = null))
          })
        }
      }
    }], ye = ["$templateRequest", "$anchorScroll", "$animate", function (a, b, d) {
      return {
        restrict: "ECA", priority: 400, terminal: !0, transclude: "element", controller: fa.noop, compile: function (c, e) {
          var f = e.ngInclude || e.src, g = e.onload || "", h = e.autoscroll; return function (c, e, m, n, q) {
            var s = 0, v, u, p, C = function () { u && (u.remove(), u = null); v && (v.$destroy(), v = null); p && (d.leave(p).then(function () { u = null }), u = p, p = null) }; c.$watch(f, function (f) {
              var m = function () {
                !y(h) || h && !c.$eval(h) ||
                  b()
              }, u = ++s; f ? (a(f, !0).then(function (a) { if (u === s) { var b = c.$new(); n.template = a; a = q(b, function (a) { C(); d.enter(a, null, e).then(m) }); v = b; p = a; v.$emit("$includeContentLoaded", f); c.$eval(g) } }, function () { u === s && (C(), c.$emit("$includeContentError", f)) }), c.$emit("$includeContentRequested", f)) : (C(), n.template = null)
            })
          }
        }
      }
    }], Pe = ["$compile", function (a) {
      return {
        restrict: "ECA", priority: -400, require: "ngInclude", link: function (b, d, c, e) {
          /SVG/.test(d[0].toString()) ? (d.empty(), a(Lc(e.template, X).childNodes)(b, function (a) { d.append(a) },
            { futureParentElement: d })) : (d.html(e.template), a(d.contents())(b))
        }
      }
    }], ze = La({ priority: 450, compile: function () { return { pre: function (a, b, d) { a.$eval(d.ngInit) } } } }), Le = function () {
      return {
        restrict: "A", priority: 100, require: "ngModel", link: function (a, b, d, c) {
          var e = b.attr(d.$attr.ngList) || ", ", f = "false" !== d.ngTrim, g = f ? U(e) : e; c.$parsers.push(function (a) { if (!q(a)) { var b = []; a && n(a.split(g), function (a) { a && b.push(f ? U(a) : a) }); return b } }); c.$formatters.push(function (a) { return I(a) ? a.join(e) : u }); c.$isEmpty = function (a) {
            return !a ||
              !a.length
          }
        }
      }
    }, mb = "ng-valid", Jd = "ng-invalid", Wa = "ng-pristine", Jb = "ng-dirty", Ld = "ng-pending", lb = G("ngModel"), yg = ["$scope", "$exceptionHandler", "$attrs", "$element", "$parse", "$animate", "$timeout", "$rootScope", "$q", "$interpolate", function (a, b, d, c, e, f, g, h, k, l) {
      this.$modelValue = this.$viewValue = Number.NaN; this.$$rawModelValue = u; this.$validators = {}; this.$asyncValidators = {}; this.$parsers = []; this.$formatters = []; this.$viewChangeListeners = []; this.$untouched = !0; this.$touched = !1; this.$pristine = !0; this.$dirty = !1;
      this.$valid = !0; this.$invalid = !1; this.$error = {}; this.$$success = {}; this.$pending = u; this.$name = l(d.name || "", !1)(a); this.$$parentForm = Ib; var m = e(d.ngModel), r = m.assign, t = m, s = r, v = null, B, p = this; this.$$setOptions = function (a) { if ((p.$options = a) && a.getterSetter) { var b = e(d.ngModel + "()"), f = e(d.ngModel + "($$$p)"); t = function (a) { var c = m(a); z(c) && (c = b(a)); return c }; s = function (a, b) { z(m(a)) ? f(a, { $$$p: p.$modelValue }) : r(a, p.$modelValue) } } else if (!m.assign) throw lb("nonassign", d.ngModel, ua(c)); }; this.$render = x; this.$isEmpty =
        function (a) { return q(a) || "" === a || null === a || a !== a }; var C = 0; Gd({ ctrl: this, $element: c, set: function (a, b) { a[b] = !0 }, unset: function (a, b) { delete a[b] }, $animate: f }); this.$setPristine = function () { p.$dirty = !1; p.$pristine = !0; f.removeClass(c, Jb); f.addClass(c, Wa) }; this.$setDirty = function () { p.$dirty = !0; p.$pristine = !1; f.removeClass(c, Wa); f.addClass(c, Jb); p.$$parentForm.$setDirty() }; this.$setUntouched = function () { p.$touched = !1; p.$untouched = !0; f.setClass(c, "ng-untouched", "ng-touched") }; this.$setTouched = function () {
          p.$touched =
            !0; p.$untouched = !1; f.setClass(c, "ng-touched", "ng-untouched")
        }; this.$rollbackViewValue = function () { g.cancel(v); p.$viewValue = p.$$lastCommittedViewValue; p.$render() }; this.$validate = function () { if (!Q(p.$modelValue) || !isNaN(p.$modelValue)) { var a = p.$$rawModelValue, b = p.$valid, c = p.$modelValue, d = p.$options && p.$options.allowInvalid; p.$$runValidators(a, p.$$lastCommittedViewValue, function (e) { d || b === e || (p.$modelValue = e ? a : u, p.$modelValue !== c && p.$$writeModelToScope()) }) } }; this.$$runValidators = function (a, b, c) {
          function d() {
            var c =
              !0; n(p.$validators, function (d, e) { var g = d(a, b); c = c && g; f(e, g) }); return c ? !0 : (n(p.$asyncValidators, function (a, b) { f(b, null) }), !1)
          } function e() { var c = [], d = !0; n(p.$asyncValidators, function (e, g) { var h = e(a, b); if (!h || !z(h.then)) throw lb("$asyncValidators", h); f(g, u); c.push(h.then(function () { f(g, !0) }, function (a) { d = !1; f(g, !1) })) }); c.length ? k.all(c).then(function () { g(d) }, x) : g(!0) } function f(a, b) { h === C && p.$setValidity(a, b) } function g(a) { h === C && c(a) } C++; var h = C; (function () {
            var a = p.$$parserName || "parse"; if (q(B)) f(a,
              null); else return B || (n(p.$validators, function (a, b) { f(b, null) }), n(p.$asyncValidators, function (a, b) { f(b, null) })), f(a, B), B; return !0
          })() ? d() ? e() : g(!1) : g(!1)
        }; this.$commitViewValue = function () { var a = p.$viewValue; g.cancel(v); if (p.$$lastCommittedViewValue !== a || "" === a && p.$$hasNativeValidators) p.$$lastCommittedViewValue = a, p.$pristine && this.$setDirty(), this.$$parseAndValidate() }; this.$$parseAndValidate = function () {
          var b = p.$$lastCommittedViewValue; if (B = q(b) ? u : !0) for (var c = 0; c < p.$parsers.length; c++)if (b = p.$parsers[c](b),
            q(b)) { B = !1; break } Q(p.$modelValue) && isNaN(p.$modelValue) && (p.$modelValue = t(a)); var d = p.$modelValue, e = p.$options && p.$options.allowInvalid; p.$$rawModelValue = b; e && (p.$modelValue = b, p.$modelValue !== d && p.$$writeModelToScope()); p.$$runValidators(b, p.$$lastCommittedViewValue, function (a) { e || (p.$modelValue = a ? b : u, p.$modelValue !== d && p.$$writeModelToScope()) })
        }; this.$$writeModelToScope = function () { s(a, p.$modelValue); n(p.$viewChangeListeners, function (a) { try { a() } catch (c) { b(c) } }) }; this.$setViewValue = function (a, b) {
          p.$viewValue =
            a; p.$options && !p.$options.updateOnDefault || p.$$debounceViewValueCommit(b)
        }; this.$$debounceViewValueCommit = function (b) { var c = 0, d = p.$options; d && y(d.debounce) && (d = d.debounce, Q(d) ? c = d : Q(d[b]) ? c = d[b] : Q(d["default"]) && (c = d["default"])); g.cancel(v); c ? v = g(function () { p.$commitViewValue() }, c) : h.$$phase ? p.$commitViewValue() : a.$apply(function () { p.$commitViewValue() }) }; a.$watch(function () {
          var b = t(a); if (b !== p.$modelValue && (p.$modelValue === p.$modelValue || b === b)) {
            p.$modelValue = p.$$rawModelValue = b; B = u; for (var c = p.$formatters,
              d = c.length, e = b; d--;)e = c[d](e); p.$viewValue !== e && (p.$viewValue = p.$$lastCommittedViewValue = e, p.$render(), p.$$runValidators(b, e, x))
          } return b
        })
    }], Ke = ["$rootScope", function (a) {
      return {
        restrict: "A", require: ["ngModel", "^?form", "^?ngModelOptions"], controller: yg, priority: 1, compile: function (b) {
          b.addClass(Wa).addClass("ng-untouched").addClass(mb); return {
            pre: function (a, b, e, f) {
              var g = f[0]; b = f[1] || g.$$parentForm; g.$$setOptions(f[2] && f[2].$options); b.$addControl(g); e.$observe("name", function (a) {
                g.$name !== a && g.$$parentForm.$$renameControl(g,
                  a)
              }); a.$on("$destroy", function () { g.$$parentForm.$removeControl(g) })
            }, post: function (b, c, e, f) { var g = f[0]; if (g.$options && g.$options.updateOn) c.on(g.$options.updateOn, function (a) { g.$$debounceViewValueCommit(a && a.type) }); c.on("blur", function (c) { g.$touched || (a.$$phase ? b.$evalAsync(g.$setTouched) : b.$apply(g.$setTouched)) }) }
          }
        }
      }
    }], zg = /(\s+|^)default(\s+|$)/, Oe = function () {
      return {
        restrict: "A", controller: ["$scope", "$attrs", function (a, b) {
          var d = this; this.$options = bb(a.$eval(b.ngModelOptions)); y(this.$options.updateOn) ?
            (this.$options.updateOnDefault = !1, this.$options.updateOn = U(this.$options.updateOn.replace(zg, function () { d.$options.updateOnDefault = !0; return " " }))) : this.$options.updateOnDefault = !0
        }]
      }
    }, Ae = La({ terminal: !0, priority: 1E3 }), Ag = G("ngOptions"), Bg = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/, Ie = ["$compile", "$parse", function (a,
      b) {
      function d(a, c, d) {
        function e(a, b, c, d, f) { this.selectValue = a; this.viewValue = b; this.label = c; this.group = d; this.disabled = f } function l(a) { var b; if (!q && za(a)) b = a; else { b = []; for (var c in a) a.hasOwnProperty(c) && "$" !== c.charAt(0) && b.push(c) } return b } var m = a.match(Bg); if (!m) throw Ag("iexp", a, ua(c)); var n = m[5] || m[7], q = m[6]; a = / as /.test(m[0]) && m[1]; var s = m[9]; c = b(m[2] ? m[1] : n); var v = a && b(a) || c, u = s && b(s), p = s ? function (a, b) { return u(d, b) } : function (a) { return Ca(a) }, C = function (a, b) { return p(a, z(a, b)) }, w = b(m[2] ||
          m[1]), y = b(m[3] || ""), B = b(m[4] || ""), x = b(m[8]), D = {}, z = q ? function (a, b) { D[q] = b; D[n] = a; return D } : function (a) { D[n] = a; return D }; return {
            trackBy: s, getTrackByValue: C, getWatchables: b(x, function (a) { var b = []; a = a || []; for (var c = l(a), e = c.length, f = 0; f < e; f++) { var g = a === c ? f : c[f], k = z(a[g], g), g = p(a[g], k); b.push(g); if (m[2] || m[1]) g = w(d, k), b.push(g); m[4] && (k = B(d, k), b.push(k)) } return b }), getOptions: function () {
              for (var a = [], b = {}, c = x(d) || [], f = l(c), g = f.length, m = 0; m < g; m++) {
                var n = c === f ? m : f[m], r = z(c[n], n), q = v(d, r), n = p(q, r), t = w(d,
                  r), u = y(d, r), r = B(d, r), q = new e(n, q, t, u, r); a.push(q); b[n] = q
              } return { items: a, selectValueMap: b, getOptionFromViewValue: function (a) { return b[C(a)] }, getViewValueFromOption: function (a) { return s ? fa.copy(a.viewValue) : a.viewValue } }
            }
          }
      } var c = X.createElement("option"), e = X.createElement("optgroup"); return {
        restrict: "A", terminal: !0, require: ["select", "?ngModel"], link: {
          pre: function (a, b, c, d) { d[0].registerOption = x }, post: function (b, g, h, k) {
            function l(a, b) {
              a.element = b; b.disabled = a.disabled; a.label !== b.label && (b.label = a.label,
                b.textContent = a.label); a.value !== b.value && (b.value = a.selectValue)
            } function m(a, b, c, d) { b && F(b.nodeName) === c ? c = b : (c = d.cloneNode(!1), b ? a.insertBefore(c, b) : a.appendChild(c)); return c } function r(a) { for (var b; a;)b = a.nextSibling, Xb(a), a = b } function q(a) { var b = p && p[0], c = z && z[0]; if (b || c) for (; a && (a === b || a === c || 8 === a.nodeType || "" === a.value);)a = a.nextSibling; return a } function s() {
              var a = D && u.readValue(); D = E.getOptions(); var b = {}, d = g[0].firstChild; x && g.prepend(p); d = q(d); D.items.forEach(function (a) {
                var f, h; a.group ?
                  (f = b[a.group], f || (f = m(g[0], d, "optgroup", e), d = f.nextSibling, f.label = a.group, f = b[a.group] = { groupElement: f, currentOptionElement: f.firstChild }), h = m(f.groupElement, f.currentOptionElement, "option", c), l(a, h), f.currentOptionElement = h.nextSibling) : (h = m(g[0], d, "option", c), l(a, h), d = h.nextSibling)
              }); Object.keys(b).forEach(function (a) { r(b[a].currentOptionElement) }); r(d); v.$render(); if (!v.$isEmpty(a)) { var f = u.readValue(); (E.trackBy ? ma(a, f) : a === f) || (v.$setViewValue(f), v.$render()) }
            } var v = k[1]; if (v) {
              var u = k[0]; k =
                h.multiple; for (var p, C = 0, w = g.children(), y = w.length; C < y; C++)if ("" === w[C].value) { p = w.eq(C); break } var x = !!p, z = B(c.cloneNode(!1)); z.val("?"); var D, E = d(h.ngOptions, g, b); k ? (v.$isEmpty = function (a) { return !a || 0 === a.length }, u.writeValue = function (a) { D.items.forEach(function (a) { a.element.selected = !1 }); a && a.forEach(function (a) { (a = D.getOptionFromViewValue(a)) && !a.disabled && (a.element.selected = !0) }) }, u.readValue = function () {
                  var a = g.val() || [], b = []; n(a, function (a) { (a = D.selectValueMap[a]) && !a.disabled && b.push(D.getViewValueFromOption(a)) });
                  return b
                }, E.trackBy && b.$watchCollection(function () { if (I(v.$viewValue)) return v.$viewValue.map(function (a) { return E.getTrackByValue(a) }) }, function () { v.$render() })) : (u.writeValue = function (a) {
                  var b = D.getOptionFromViewValue(a); b && !b.disabled ? g[0].value !== b.selectValue && (z.remove(), x || p.remove(), g[0].value = b.selectValue, b.element.selected = !0, b.element.setAttribute("selected", "selected")) : null === a || x ? (z.remove(), x || g.prepend(p), g.val(""), p.prop("selected", !0), p.attr("selected", !0)) : (x || p.remove(), g.prepend(z),
                    g.val("?"), z.prop("selected", !0), z.attr("selected", !0))
                }, u.readValue = function () { var a = D.selectValueMap[g.val()]; return a && !a.disabled ? (x || p.remove(), z.remove(), D.getViewValueFromOption(a)) : null }, E.trackBy && b.$watch(function () { return E.getTrackByValue(v.$viewValue) }, function () { v.$render() })); x ? (p.remove(), a(p)(b), p.removeClass("ng-scope")) : p = B(c.cloneNode(!1)); s(); b.$watchCollection(E.getWatchables, s)
            }
          }
        }
      }
    }], Be = ["$locale", "$interpolate", "$log", function (a, b, d) {
      var c = /{}/g, e = /^when(Minus)?(.+)$/; return {
        link: function (f,
          g, h) {
          function k(a) { g.text(a || "") } var l = h.count, m = h.$attr.when && g.attr(h.$attr.when), r = h.offset || 0, s = f.$eval(m) || {}, u = {}, v = b.startSymbol(), y = b.endSymbol(), p = v + l + "-" + r + y, C = fa.noop, w; n(h, function (a, b) { var c = e.exec(b); c && (c = (c[1] ? "-" : "") + F(c[2]), s[c] = g.attr(h.$attr[b])) }); n(s, function (a, d) { u[d] = b(a.replace(c, p)) }); f.$watch(l, function (b) {
            var c = parseFloat(b), e = isNaN(c); e || c in s || (c = a.pluralCat(c - r)); c === w || e && Q(w) && isNaN(w) || (C(), e = u[c], q(e) ? (null != b && d.debug("ngPluralize: no rule defined for '" + c + "' in " +
              m), C = x, k()) : C = f.$watch(e, k), w = c)
          })
        }
      }
    }], Ce = ["$parse", "$animate", function (a, b) {
      var d = G("ngRepeat"), c = function (a, b, c, d, k, l, m) { a[c] = d; k && (a[k] = l); a.$index = b; a.$first = 0 === b; a.$last = b === m - 1; a.$middle = !(a.$first || a.$last); a.$odd = !(a.$even = 0 === (b & 1)) }; return {
        restrict: "A", multiElement: !0, transclude: "element", priority: 1E3, terminal: !0, $$tlb: !0, compile: function (e, f) {
          var g = f.ngRepeat, h = X.createComment(" end ngRepeat: " + g + " "), k = g.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
          if (!k) throw d("iexp", g); var l = k[1], m = k[2], r = k[3], q = k[4], k = l.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/); if (!k) throw d("iidexp", l); var s = k[3] || k[1], v = k[2]; if (r && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(r) || /^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(r))) throw d("badident", r); var x, p, y, w, z = { $id: Ca }; q ? x = a(q) : (y = function (a, b) { return Ca(b) }, w = function (a) { return a }); return function (a, e, f, k, l) {
            x && (p = function (b, c, d) {
              v && (z[v] = b); z[s] = c; z.$index =
                d; return x(a, z)
            }); var q = $(); a.$watchCollection(m, function (f) {
              var k, m, t = e[0], x, z = $(), D, E, H, F, I, G, J; r && (a[r] = f); if (za(f)) I = f, m = p || y; else for (J in m = p || w, I = [], f) qa.call(f, J) && "$" !== J.charAt(0) && I.push(J); D = I.length; J = Array(D); for (k = 0; k < D; k++)if (E = f === I ? k : I[k], H = f[E], F = m(E, H, k), q[F]) G = q[F], delete q[F], z[F] = G, J[k] = G; else { if (z[F]) throw n(J, function (a) { a && a.scope && (q[a.id] = a) }), d("dupes", g, F, H); J[k] = { id: F, scope: u, clone: u }; z[F] = !0 } for (x in q) {
                G = q[x]; F = rb(G.clone); b.leave(F); if (F[0].parentNode) for (k = 0, m = F.length; k <
                  m; k++)F[k].$$NG_REMOVED = !0; G.scope.$destroy()
              } for (k = 0; k < D; k++)if (E = f === I ? k : I[k], H = f[E], G = J[k], G.scope) { x = t; do x = x.nextSibling; while (x && x.$$NG_REMOVED); G.clone[0] != x && b.move(rb(G.clone), null, B(t)); t = G.clone[G.clone.length - 1]; c(G.scope, k, s, H, v, E, D) } else l(function (a, d) { G.scope = d; var e = h.cloneNode(!1); a[a.length++] = e; b.enter(a, null, B(t)); t = e; G.clone = a; z[G.id] = G; c(G.scope, k, s, H, v, E, D) }); q = z
            })
          }
        }
      }
    }], De = ["$animate", function (a) {
      return {
        restrict: "A", multiElement: !0, link: function (b, d, c) {
          b.$watch(c.ngShow, function (b) {
            a[b ?
              "removeClass" : "addClass"](d, "ng-hide", { tempClasses: "ng-hide-animate" })
          })
        }
      }
    }], we = ["$animate", function (a) { return { restrict: "A", multiElement: !0, link: function (b, d, c) { b.$watch(c.ngHide, function (b) { a[b ? "addClass" : "removeClass"](d, "ng-hide", { tempClasses: "ng-hide-animate" }) }) } } }], Ee = La(function (a, b, d) { a.$watch(d.ngStyle, function (a, d) { d && a !== d && n(d, function (a, c) { b.css(c, "") }); a && b.css(a) }, !0) }), Fe = ["$animate", function (a) {
      return {
        require: "ngSwitch", controller: ["$scope", function () { this.cases = {} }], link: function (b,
          d, c, e) { var f = [], g = [], h = [], k = [], l = function (a, b) { return function () { a.splice(b, 1) } }; b.$watch(c.ngSwitch || c.on, function (b) { var c, d; c = 0; for (d = h.length; c < d; ++c)a.cancel(h[c]); c = h.length = 0; for (d = k.length; c < d; ++c) { var q = rb(g[c].clone); k[c].$destroy(); (h[c] = a.leave(q)).then(l(h, c)) } g.length = 0; k.length = 0; (f = e.cases["!" + b] || e.cases["?"]) && n(f, function (b) { b.transclude(function (c, d) { k.push(d); var e = b.element; c[c.length++] = X.createComment(" end ngSwitchWhen: "); g.push({ clone: c }); a.enter(c, e.parent(), e) }) }) }) }
      }
    }],
      Ge = La({ transclude: "element", priority: 1200, require: "^ngSwitch", multiElement: !0, link: function (a, b, d, c, e) { c.cases["!" + d.ngSwitchWhen] = c.cases["!" + d.ngSwitchWhen] || []; c.cases["!" + d.ngSwitchWhen].push({ transclude: e, element: b }) } }), He = La({ transclude: "element", priority: 1200, require: "^ngSwitch", multiElement: !0, link: function (a, b, d, c, e) { c.cases["?"] = c.cases["?"] || []; c.cases["?"].push({ transclude: e, element: b }) } }), Je = La({
        restrict: "EAC", link: function (a, b, d, c, e) {
          if (!e) throw G("ngTransclude")("orphan", ua(b)); e(function (a) {
            b.empty();
            b.append(a)
          })
        }
      }), je = ["$templateCache", function (a) { return { restrict: "E", terminal: !0, compile: function (b, d) { "text/ng-template" == d.type && a.put(d.id, b[0].text) } } }], Cg = { $setViewValue: x, $render: x }, Dg = ["$element", "$scope", "$attrs", function (a, b, d) {
        var c = this, e = new Sa; c.ngModelCtrl = Cg; c.unknownOption = B(X.createElement("option")); c.renderUnknownOption = function (b) { b = "? " + Ca(b) + " ?"; c.unknownOption.val(b); a.prepend(c.unknownOption); a.val(b) }; b.$on("$destroy", function () { c.renderUnknownOption = x }); c.removeUnknownOption =
          function () { c.unknownOption.parent() && c.unknownOption.remove() }; c.readValue = function () { c.removeUnknownOption(); return a.val() }; c.writeValue = function (b) { c.hasOption(b) ? (c.removeUnknownOption(), a.val(b), "" === b && c.emptyOption.prop("selected", !0)) : null == b && c.emptyOption ? (c.removeUnknownOption(), a.val("")) : c.renderUnknownOption(b) }; c.addOption = function (a, b) {
            Ra(a, '"option value"'); "" === a && (c.emptyOption = b); var d = e.get(a) || 0; e.put(a, d + 1); c.ngModelCtrl.$render(); b[0].hasAttribute("selected") && (b[0].selected =
              !0)
          }; c.removeOption = function (a) { var b = e.get(a); b && (1 === b ? (e.remove(a), "" === a && (c.emptyOption = u)) : e.put(a, b - 1)) }; c.hasOption = function (a) { return !!e.get(a) }; c.registerOption = function (a, b, d, e, l) { if (e) { var m; d.$observe("value", function (a) { y(m) && c.removeOption(m); m = a; c.addOption(a, b) }) } else l ? a.$watch(l, function (a, e) { d.$set("value", a); e !== a && c.removeOption(e); c.addOption(a, b) }) : c.addOption(d.value, b); b.on("$destroy", function () { c.removeOption(d.value); c.ngModelCtrl.$render() }) }
      }], ke = function () {
        return {
          restrict: "E",
          require: ["select", "?ngModel"], controller: Dg, priority: 1, link: {
            pre: function (a, b, d, c) {
              var e = c[1]; if (e) {
                var f = c[0]; f.ngModelCtrl = e; e.$render = function () { f.writeValue(e.$viewValue) }; b.on("change", function () { a.$apply(function () { e.$setViewValue(f.readValue()) }) }); if (d.multiple) {
                  f.readValue = function () { var a = []; n(b.find("option"), function (b) { b.selected && a.push(b.value) }); return a }; f.writeValue = function (a) { var c = new Sa(a); n(b.find("option"), function (a) { a.selected = y(c.get(a.value)) }) }; var g, h = NaN; a.$watch(function () {
                    h !==
                      e.$viewValue || ma(g, e.$viewValue) || (g = ia(e.$viewValue), e.$render()); h = e.$viewValue
                  }); e.$isEmpty = function (a) { return !a || 0 === a.length }
                }
              }
            }
          }
        }
      }, me = ["$interpolate", function (a) { return { restrict: "E", priority: 100, compile: function (b, d) { if (y(d.value)) var c = a(d.value, !0); else { var e = a(b.text(), !0); e || d.$set("value", b.text()) } return function (a, b, d) { var k = b.parent(); (k = k.data("$selectController") || k.parent().data("$selectController")) && k.registerOption(a, b, d, c, e) } } } }], le = na({ restrict: "E", terminal: !1 }), Fc = function () {
        return {
          restrict: "A",
          require: "?ngModel", link: function (a, b, d, c) { c && (d.required = !0, c.$validators.required = function (a, b) { return !d.required || !c.$isEmpty(b) }, d.$observe("required", function () { c.$validate() })) }
        }
      }, Ec = function () {
        return {
          restrict: "A", require: "?ngModel", link: function (a, b, d, c) {
            if (c) {
              var e, f = d.ngPattern || d.pattern; d.$observe("pattern", function (a) { E(a) && 0 < a.length && (a = new RegExp("^" + a + "$")); if (a && !a.test) throw G("ngPattern")("noregexp", f, a, ua(b)); e = a || u; c.$validate() }); c.$validators.pattern = function (a, b) {
                return c.$isEmpty(b) ||
                  q(e) || e.test(b)
              }
            }
          }
        }
      }, Hc = function () { return { restrict: "A", require: "?ngModel", link: function (a, b, d, c) { if (c) { var e = -1; d.$observe("maxlength", function (a) { a = ea(a); e = isNaN(a) ? -1 : a; c.$validate() }); c.$validators.maxlength = function (a, b) { return 0 > e || c.$isEmpty(b) || b.length <= e } } } } }, Gc = function () { return { restrict: "A", require: "?ngModel", link: function (a, b, d, c) { if (c) { var e = 0; d.$observe("minlength", function (a) { e = ea(a) || 0; c.$validate() }); c.$validators.minlength = function (a, b) { return c.$isEmpty(b) || b.length >= e } } } } }; S.angular.bootstrap ?
        console.log("WARNING: Tried to load angular more than once.") : (ce(), ee(fa), fa.module("ngLocale", [], ["$provide", function (a) {
          function b(a) { a += ""; var b = a.indexOf("."); return -1 == b ? 0 : a.length - b - 1 } a.value("$locale", {
            DATETIME_FORMATS: {
              AMPMS: ["AM", "PM"], DAY: "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), ERANAMES: ["Before Christ", "Anno Domini"], ERAS: ["BC", "AD"], FIRSTDAYOFWEEK: 6, MONTH: "January February March April May June July August September October November December".split(" "), SHORTDAY: "Sun Mon Tue Wed Thu Fri Sat".split(" "),
              SHORTMONTH: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), WEEKENDRANGE: [5, 6], fullDate: "EEEE, MMMM d, y", longDate: "MMMM d, y", medium: "MMM d, y h:mm:ss a", mediumDate: "MMM d, y", mediumTime: "h:mm:ss a", "short": "M/d/yy h:mm a", shortDate: "M/d/yy", shortTime: "h:mm a"
            }, NUMBER_FORMATS: {
              CURRENCY_SYM: "$", DECIMAL_SEP: ".", GROUP_SEP: ",", PATTERNS: [{ gSize: 3, lgSize: 3, maxFrac: 3, minFrac: 0, minInt: 1, negPre: "-", negSuf: "", posPre: "", posSuf: "" }, {
                gSize: 3, lgSize: 3, maxFrac: 2, minFrac: 2, minInt: 1, negPre: "-\u00a4",
                negSuf: "", posPre: "\u00a4", posSuf: ""
              }]
            }, id: "en-us", pluralCat: function (a, c) { var e = a | 0, f = c; u === f && (f = Math.min(b(a), 3)); Math.pow(10, f); return 1 == e && 0 == f ? "one" : "other" }
          })
        }]), B(X).ready(function () { Zd(X, yc) }))
})(window, document); !window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
//# sourceMappingURL=angular.min.js.map

(function (a) { if (typeof define === "function" && define.amd && define.amd.jQuery) { define(["jquery"], a) } else { a(jQuery) } }(function (f) { var y = "1.6.12", p = "left", o = "right", e = "up", x = "down", c = "in", A = "out", m = "none", s = "auto", l = "swipe", t = "pinch", B = "tap", j = "doubletap", b = "longtap", z = "hold", E = "horizontal", u = "vertical", i = "all", r = 10, g = "start", k = "move", h = "end", q = "cancel", a = "ontouchstart" in window, v = window.navigator.msPointerEnabled && !window.navigator.pointerEnabled, d = window.navigator.pointerEnabled || window.navigator.msPointerEnabled, C = "TouchSwipe"; var n = { fingers: 1, threshold: 75, cancelThreshold: null, pinchThreshold: 20, maxTimeThreshold: null, fingerReleaseThreshold: 250, longTapThreshold: 500, doubleTapThreshold: 200, swipe: null, swipeLeft: null, swipeRight: null, swipeUp: null, swipeDown: null, swipeStatus: null, pinchIn: null, pinchOut: null, pinchStatus: null, click: null, tap: null, doubleTap: null, longTap: null, hold: null, triggerOnTouchEnd: true, triggerOnTouchLeave: false, allowPageScroll: "auto", fallbackToMouseEvents: true, excludedElements: "label, button, input, select, textarea, a, .noSwipe", preventDefaultEvents: true }; f.fn.swipe = function (H) { var G = f(this), F = G.data(C); if (F && typeof H === "string") { if (F[H]) { return F[H].apply(this, Array.prototype.slice.call(arguments, 1)) } else { f.error("Method " + H + " does not exist on jQuery.swipe") } } else { if (F && typeof H === "object") { F.option.apply(this, arguments) } else { if (!F && (typeof H === "object" || !H)) { return w.apply(this, arguments) } } } return G }; f.fn.swipe.version = y; f.fn.swipe.defaults = n; f.fn.swipe.phases = { PHASE_START: g, PHASE_MOVE: k, PHASE_END: h, PHASE_CANCEL: q }; f.fn.swipe.directions = { LEFT: p, RIGHT: o, UP: e, DOWN: x, IN: c, OUT: A }; f.fn.swipe.pageScroll = { NONE: m, HORIZONTAL: E, VERTICAL: u, AUTO: s }; f.fn.swipe.fingers = { ONE: 1, TWO: 2, THREE: 3, FOUR: 4, FIVE: 5, ALL: i }; function w(F) { if (F && (F.allowPageScroll === undefined && (F.swipe !== undefined || F.swipeStatus !== undefined))) { F.allowPageScroll = m } if (F.click !== undefined && F.tap === undefined) { F.tap = F.click } if (!F) { F = {} } F = f.extend({}, f.fn.swipe.defaults, F); return this.each(function () { var H = f(this); var G = H.data(C); if (!G) { G = new D(this, F); H.data(C, G) } }) } function D(a4, au) { var au = f.extend({}, au); var az = (a || d || !au.fallbackToMouseEvents), K = az ? (d ? (v ? "MSPointerDown" : "pointerdown") : "touchstart") : "mousedown", ax = az ? (d ? (v ? "MSPointerMove" : "pointermove") : "touchmove") : "mousemove", V = az ? (d ? (v ? "MSPointerUp" : "pointerup") : "touchend") : "mouseup", T = az ? null : "mouseleave", aD = (d ? (v ? "MSPointerCancel" : "pointercancel") : "touchcancel"); var ag = 0, aP = null, ac = 0, a1 = 0, aZ = 0, H = 1, ap = 0, aJ = 0, N = null; var aR = f(a4); var aa = "start"; var X = 0; var aQ = {}; var U = 0, a2 = 0, a5 = 0, ay = 0, O = 0; var aW = null, af = null; try { aR.bind(K, aN); aR.bind(aD, a9) } catch (aj) { f.error("events not supported " + K + "," + aD + " on jQuery.swipe") } this.enable = function () { aR.bind(K, aN); aR.bind(aD, a9); return aR }; this.disable = function () { aK(); return aR }; this.destroy = function () { aK(); aR.data(C, null); aR = null }; this.option = function (bc, bb) { if (typeof bc === "object") { au = f.extend(au, bc) } else { if (au[bc] !== undefined) { if (bb === undefined) { return au[bc] } else { au[bc] = bb } } else { if (!bc) { return au } else { f.error("Option " + bc + " does not exist on jQuery.swipe.options") } } } return null }; function aN(bd) { if (aB()) { return } if (f(bd.target).closest(au.excludedElements, aR).length > 0) { return } var be = bd.originalEvent ? bd.originalEvent : bd; var bc, bf = be.touches, bb = bf ? bf[0] : be; aa = g; if (bf) { X = bf.length } else { if (au.preventDefaultEvents !== false) { bd.preventDefault() } } ag = 0; aP = null; aJ = null; ac = 0; a1 = 0; aZ = 0; H = 1; ap = 0; N = ab(); S(); ai(0, bb); if (!bf || (X === au.fingers || au.fingers === i) || aX()) { U = ar(); if (X == 2) { ai(1, bf[1]); a1 = aZ = at(aQ[0].start, aQ[1].start) } if (au.swipeStatus || au.pinchStatus) { bc = P(be, aa) } } else { bc = false } if (bc === false) { aa = q; P(be, aa); return bc } else { if (au.hold) { af = setTimeout(f.proxy(function () { aR.trigger("hold", [be.target]); if (au.hold) { bc = au.hold.call(aR, be, be.target) } }, this), au.longTapThreshold) } an(true) } return null } function a3(be) { var bh = be.originalEvent ? be.originalEvent : be; if (aa === h || aa === q || al()) { return } var bd, bi = bh.touches, bc = bi ? bi[0] : bh; var bf = aH(bc); a2 = ar(); if (bi) { X = bi.length } if (au.hold) { clearTimeout(af) } aa = k; if (X == 2) { if (a1 == 0) { ai(1, bi[1]); a1 = aZ = at(aQ[0].start, aQ[1].start) } else { aH(bi[1]); aZ = at(aQ[0].end, aQ[1].end); aJ = aq(aQ[0].end, aQ[1].end) } H = a7(a1, aZ); ap = Math.abs(a1 - aZ) } if ((X === au.fingers || au.fingers === i) || !bi || aX()) { aP = aL(bf.start, bf.end); ak(be, aP); ag = aS(bf.start, bf.end); ac = aM(); aI(aP, ag); if (au.swipeStatus || au.pinchStatus) { bd = P(bh, aa) } if (!au.triggerOnTouchEnd || au.triggerOnTouchLeave) { var bb = true; if (au.triggerOnTouchLeave) { var bg = aY(this); bb = F(bf.end, bg) } if (!au.triggerOnTouchEnd && bb) { aa = aC(k) } else { if (au.triggerOnTouchLeave && !bb) { aa = aC(h) } } if (aa == q || aa == h) { P(bh, aa) } } } else { aa = q; P(bh, aa) } if (bd === false) { aa = q; P(bh, aa) } } function M(bb) { var bc = bb.originalEvent ? bb.originalEvent : bb, bd = bc.touches; if (bd) { if (bd.length && !al()) { G(); return true } else { if (bd.length && al()) { return true } } } if (al()) { X = ay } a2 = ar(); ac = aM(); if (ba() || !am()) { aa = q; P(bc, aa) } else { if (au.triggerOnTouchEnd || (au.triggerOnTouchEnd == false && aa === k)) { if (au.preventDefaultEvents !== false) { bb.preventDefault() } aa = h; P(bc, aa) } else { if (!au.triggerOnTouchEnd && a6()) { aa = h; aF(bc, aa, B) } else { if (aa === k) { aa = q; P(bc, aa) } } } } an(false); return null } function a9() { X = 0; a2 = 0; U = 0; a1 = 0; aZ = 0; H = 1; S(); an(false) } function L(bb) { var bc = bb.originalEvent ? bb.originalEvent : bb; if (au.triggerOnTouchLeave) { aa = aC(h); P(bc, aa) } } function aK() { aR.unbind(K, aN); aR.unbind(aD, a9); aR.unbind(ax, a3); aR.unbind(V, M); if (T) { aR.unbind(T, L) } an(false) } function aC(bf) { var be = bf; var bd = aA(); var bc = am(); var bb = ba(); if (!bd || bb) { be = q } else { if (bc && bf == k && (!au.triggerOnTouchEnd || au.triggerOnTouchLeave)) { be = h } else { if (!bc && bf == h && au.triggerOnTouchLeave) { be = q } } } return be } function P(bd, bb) { var bc, be = bd.touches; if ((J() && W()) || (Q() && aX())) { if (J() && W()) { bc = aF(bd, bb, l) } if ((Q() && aX()) && bc !== false) { bc = aF(bd, bb, t) } } else { if (aG() && bc !== false) { bc = aF(bd, bb, j) } else { if (ao() && bc !== false) { bc = aF(bd, bb, b) } else { if (ah() && bc !== false) { bc = aF(bd, bb, B) } } } } if (bb === q) { if (W()) { bc = aF(bd, bb, l) } if (aX()) { bc = aF(bd, bb, t) } a9(bd) } if (bb === h) { if (be) { if (!be.length) { a9(bd) } } else { a9(bd) } } return bc } function aF(be, bb, bd) { var bc; if (bd == l) { aR.trigger("swipeStatus", [bb, aP || null, ag || 0, ac || 0, X, aQ]); if (au.swipeStatus) { bc = au.swipeStatus.call(aR, be, bb, aP || null, ag || 0, ac || 0, X, aQ); if (bc === false) { return false } } if (bb == h && aV()) { aR.trigger("swipe", [aP, ag, ac, X, aQ]); if (au.swipe) { bc = au.swipe.call(aR, be, aP, ag, ac, X, aQ); if (bc === false) { return false } } switch (aP) { case p: aR.trigger("swipeLeft", [aP, ag, ac, X, aQ]); if (au.swipeLeft) { bc = au.swipeLeft.call(aR, be, aP, ag, ac, X, aQ) } break; case o: aR.trigger("swipeRight", [aP, ag, ac, X, aQ]); if (au.swipeRight) { bc = au.swipeRight.call(aR, be, aP, ag, ac, X, aQ) } break; case e: aR.trigger("swipeUp", [aP, ag, ac, X, aQ]); if (au.swipeUp) { bc = au.swipeUp.call(aR, be, aP, ag, ac, X, aQ) } break; case x: aR.trigger("swipeDown", [aP, ag, ac, X, aQ]); if (au.swipeDown) { bc = au.swipeDown.call(aR, be, aP, ag, ac, X, aQ) } break } } } if (bd == t) { aR.trigger("pinchStatus", [bb, aJ || null, ap || 0, ac || 0, X, H, aQ]); if (au.pinchStatus) { bc = au.pinchStatus.call(aR, be, bb, aJ || null, ap || 0, ac || 0, X, H, aQ); if (bc === false) { return false } } if (bb == h && a8()) { switch (aJ) { case c: aR.trigger("pinchIn", [aJ || null, ap || 0, ac || 0, X, H, aQ]); if (au.pinchIn) { bc = au.pinchIn.call(aR, be, aJ || null, ap || 0, ac || 0, X, H, aQ) } break; case A: aR.trigger("pinchOut", [aJ || null, ap || 0, ac || 0, X, H, aQ]); if (au.pinchOut) { bc = au.pinchOut.call(aR, be, aJ || null, ap || 0, ac || 0, X, H, aQ) } break } } } if (bd == B) { if (bb === q || bb === h) { clearTimeout(aW); clearTimeout(af); if (Z() && !I()) { O = ar(); aW = setTimeout(f.proxy(function () { O = null; aR.trigger("tap", [be.target]); if (au.tap) { bc = au.tap.call(aR, be, be.target) } }, this), au.doubleTapThreshold) } else { O = null; aR.trigger("tap", [be.target]); if (au.tap) { bc = au.tap.call(aR, be, be.target) } } } } else { if (bd == j) { if (bb === q || bb === h) { clearTimeout(aW); O = null; aR.trigger("doubletap", [be.target]); if (au.doubleTap) { bc = au.doubleTap.call(aR, be, be.target) } } } else { if (bd == b) { if (bb === q || bb === h) { clearTimeout(aW); O = null; aR.trigger("longtap", [be.target]); if (au.longTap) { bc = au.longTap.call(aR, be, be.target) } } } } } return bc } function am() { var bb = true; if (au.threshold !== null) { bb = ag >= au.threshold } return bb } function ba() { var bb = false; if (au.cancelThreshold !== null && aP !== null) { bb = (aT(aP) - ag) >= au.cancelThreshold } return bb } function ae() { if (au.pinchThreshold !== null) { return ap >= au.pinchThreshold } return true } function aA() { var bb; if (au.maxTimeThreshold) { if (ac >= au.maxTimeThreshold) { bb = false } else { bb = true } } else { bb = true } return bb } function ak(bb, bc) { if (au.preventDefaultEvents === false) { return } if (au.allowPageScroll === m) { bb.preventDefault() } else { var bd = au.allowPageScroll === s; switch (bc) { case p: if ((au.swipeLeft && bd) || (!bd && au.allowPageScroll != E)) { bb.preventDefault() } break; case o: if ((au.swipeRight && bd) || (!bd && au.allowPageScroll != E)) { bb.preventDefault() } break; case e: if ((au.swipeUp && bd) || (!bd && au.allowPageScroll != u)) { bb.preventDefault() } break; case x: if ((au.swipeDown && bd) || (!bd && au.allowPageScroll != u)) { bb.preventDefault() } break } } } function a8() { var bc = aO(); var bb = Y(); var bd = ae(); return bc && bb && bd } function aX() { return !!(au.pinchStatus || au.pinchIn || au.pinchOut) } function Q() { return !!(a8() && aX()) } function aV() { var be = aA(); var bg = am(); var bd = aO(); var bb = Y(); var bc = ba(); var bf = !bc && bb && bd && bg && be; return bf } function W() { return !!(au.swipe || au.swipeStatus || au.swipeLeft || au.swipeRight || au.swipeUp || au.swipeDown) } function J() { return !!(aV() && W()) } function aO() { return ((X === au.fingers || au.fingers === i) || !a) } function Y() { return aQ[0].end.x !== 0 } function a6() { return !!(au.tap) } function Z() { return !!(au.doubleTap) } function aU() { return !!(au.longTap) } function R() { if (O == null) { return false } var bb = ar(); return (Z() && ((bb - O) <= au.doubleTapThreshold)) } function I() { return R() } function aw() { return ((X === 1 || !a) && (isNaN(ag) || ag < au.threshold)) } function a0() { return ((ac > au.longTapThreshold) && (ag < r)) } function ah() { return !!(aw() && a6()) } function aG() { return !!(R() && Z()) } function ao() { return !!(a0() && aU()) } function G() { a5 = ar(); ay = event.touches.length + 1 } function S() { a5 = 0; ay = 0 } function al() { var bb = false; if (a5) { var bc = ar() - a5; if (bc <= au.fingerReleaseThreshold) { bb = true } } return bb } function aB() { return !!(aR.data(C + "_intouch") === true) } function an(bb) { if (bb === true) { aR.bind(ax, a3); aR.bind(V, M); if (T) { aR.bind(T, L) } } else { aR.unbind(ax, a3, false); aR.unbind(V, M, false); if (T) { aR.unbind(T, L, false) } } aR.data(C + "_intouch", bb === true) } function ai(bd, bb) { var bc = { start: { x: 0, y: 0 }, end: { x: 0, y: 0 } }; bc.start.x = bc.end.x = bb.pageX || bb.clientX; bc.start.y = bc.end.y = bb.pageY || bb.clientY; aQ[bd] = bc; return bc } function aH(bb) { var bd = bb.identifier !== undefined ? bb.identifier : 0; var bc = ad(bd); if (bc === null) { bc = ai(bd, bb) } bc.end.x = bb.pageX || bb.clientX; bc.end.y = bb.pageY || bb.clientY; return bc } function ad(bb) { return aQ[bb] || null } function aI(bb, bc) { bc = Math.max(bc, aT(bb)); N[bb].distance = bc } function aT(bb) { if (N[bb]) { return N[bb].distance } return undefined } function ab() { var bb = {}; bb[p] = av(p); bb[o] = av(o); bb[e] = av(e); bb[x] = av(x); return bb } function av(bb) { return { direction: bb, distance: 0 } } function aM() { return a2 - U } function at(be, bd) { var bc = Math.abs(be.x - bd.x); var bb = Math.abs(be.y - bd.y); return Math.round(Math.sqrt(bc * bc + bb * bb)) } function a7(bb, bc) { var bd = (bc / bb) * 1; return bd.toFixed(2) } function aq() { if (H < 1) { return A } else { return c } } function aS(bc, bb) { return Math.round(Math.sqrt(Math.pow(bb.x - bc.x, 2) + Math.pow(bb.y - bc.y, 2))) } function aE(be, bc) { var bb = be.x - bc.x; var bg = bc.y - be.y; var bd = Math.atan2(bg, bb); var bf = Math.round(bd * 180 / Math.PI); if (bf < 0) { bf = 360 - Math.abs(bf) } return bf } function aL(bc, bb) { var bd = aE(bc, bb); if ((bd <= 45) && (bd >= 0)) { return p } else { if ((bd <= 360) && (bd >= 315)) { return p } else { if ((bd >= 135) && (bd <= 225)) { return o } else { if ((bd > 45) && (bd < 135)) { return x } else { return e } } } } } function ar() { var bb = new Date(); return bb.getTime() } function aY(bb) { bb = f(bb); var bd = bb.offset(); var bc = { left: bd.left, right: bd.left + bb.outerWidth(), top: bd.top, bottom: bd.top + bb.outerHeight() }; return bc } function F(bb, bc) { return (bb.x > bc.left && bb.x < bc.right && bb.y > bc.top && bb.y < bc.bottom) } } }));
/**
* Created by andrea on 23/03/15.
*/

$(document).ready(function () {
  $('.link-open-tab').on('click', function () {
    var targetClick = $(this).attr('data-target');
    $('a[href="' + targetClick + '"]').click();
    $("html, body").animate({ scrollTop: $('a[href="' + targetClick + '"]').offset().top - 150 }, 1000);
  });
});
/*
 Hotspot 1.1
 Author: Nikolay Dyankov & Webmobili Edited
 */

(function ($) {

  function Hotspot(root, options) {
    this.options = options;
    this.root = root;
  }
  Hotspot.prototype.init = function () {
    var thethis = this;
    if (this.root.hasClass('hs-loaded')) return;

    var html = '', spotClass = '', tooltip_width = 'auto', visibilityClass = '', positionClass = '', x, y;

    var img_width = null;
    var img_height = null;

    var image_completed = $.Deferred();
    var obj_img = this.root.find('img');
    {

      $("<img/>") // Make in memory copy of image to avoid css issues
        .attr("src", obj_img.attr('src'))
        .load(function () {
          img_width = this.width;   // Note: $(this).width() will not
          img_height = this.height; // work for in memory images.
          image_completed.resolve(true); // libero la promise
        });

			/*
			 var img = new Image();
			 img.src = obj_img.attr('src');
			 img.onload = function () {
			 img_width = this.width; // dimensioni dell'immagine originaria
			 img_height = this.height; // obj_img.height();
			 image_completed.resolve(true); // libero la promise
			 }*/
    }


    $.when(image_completed).done(function () {
      html += '<img src="' + obj_img.first().attr('src') + '" class="hsmap-image">';
      thethis.root.find('.hs-spot-object').each(function (spot_i) {

        var x = (parseInt($(this).data('x')) / img_width) * 100;
        var y = (parseInt($(this).data('y')) / img_height) * 100;
        var width = (parseInt($(this).data('width')) / img_width) * 100;
        var height = (parseInt($(this).data('height')) / img_height) * 100;
        var margin_left = 0;
        var margin_top = 0;
        var tint_color = $(this).data('tint-color');
        var shape_color = '';
        var shape_inner_color = '';

        if ($(this).data('type') == 'rect') {
          spotClass = 'hs-rect';

          width = width + '%';
          height = height + '%';

          shape_color = 'border-color: ' + tint_color;
        } else {
          spotClass = 'hs-spot';

          margin_left = -width / 2;
          margin_top = -height / 2;
          width = width + 'px';
          height = height + 'px';

          shape_inner_color = 'background: ' + tint_color;
        }

        if ($(this).data('visible') == 'visible') {
          visibilityClass = 'visible';
        } else {
          visibilityClass = '';
        }

        if ($(this).data('tooltip-auto-width') == false) {
          tooltip_width = $(this).data('tooltip-width') + 'px';
        } else {
          tooltip_width = 'auto';
        }

        positionClass = $(this).data('popup-position');

        html += '<div class="' + spotClass + ' ' + visibilityClass + ' ' + positionClass + ' hs-spot-object" style="left: ' + x + '%; top: ' + y + '%; width: ' + width + '; height: ' + height + '; margin-left: ' + margin_left + 'px; margin-top: ' + margin_top + 'px;z-index:' + spot_i + ';">';
        if ($(this).data('type') == 'rect') {
          html += '<a target="_blank" class="rect-link" href="' + $(this).data("url") + '">';
        }
        html += '	<div class="hs-spot-shape" style="' + shape_color + '"></div><div class="hs-spot-shape-inner" style="' + shape_inner_color + '"></div><div class="hs-spot-shape-inner-two"></div>';
        html += '	<div class="hs-spot-tooltip-outer">';
        html += '		<div class="hs-tooltip-buffer"></div>';
        html += '		<div class="hs-tooltip-wrap" style="width: ' + tooltip_width + ';">';
        html += '			<div class="hs-tooltip">';
        html += $(this).html();
        html += '			</div>';
        html += '		</div>';
        html += '	</div>';
        if ($(this).data('type') == 'rect') {
          html += '</a>';
        }
        html += '</div>';
      });

      thethis.root.html(html);

      thethis.root.removeClass('hs-loading');

      thethis.root.addClass(thethis.options['show_on']);
      thethis.root.addClass(thethis.options['color_scheme']);

      if (thethis.options['transparent_spots']) {
        thethis.root.addClass('transparent-spots');
      }

      if (thethis.options.responsive) {
        thethis.root.addClass('responsive');
      } else {
        if (img_width != 0) {
          thethis.root.css({
            width: img_width
          });
        }
      }

      // Add events

      if (thethis.options['show_on'] == 'click') {
        $('.hs-spot-object').on('click', function () {
          $(this).toggleClass('visible-tooltip');
        });
      }
      if (thethis.options['show_on'] == 'mouseover') {
        $('.hs-spot-object').on('mouseover', function () {
          $(this).addClass('visible-tooltip');
        });
        $('.hs-spot-object').on('mouseleave', function (e) {
          $(this).removeClass('visible-tooltip');
        });
      }

      thethis.root.addClass('hs-loaded');
    });
  }

  $.fn.hotspot = function (options) {
    var D = {
      'show_on': 'mouseover',
      'transparent_spots': true,
      'color_scheme': 'red'
    };

    O = $.extend(true, D, options);

    return this.each(function () {
      var hotspot = new Hotspot($(this), O);
      hotspot.init();
    });
  }
})(jQuery);

/**
 * Created by andrea on 23/03/15.
 */

$(document).ready(function () {


  var lastmenu = false;
  //$(".menu-principale > li a").click(function() {

  //    var filtro = $(this).data("target");

  //    if (lastmenu) {
  //        $("#" + lastmenu.data("target")).removeClass('active');
  //        $(lastmenu).removeClass('active');
  //    }
  //    if (lastmenu && lastmenu.data("target") == filtro) {
  //        $("#" + lastmenu.data("target")).removeClass('active');
  //        $(lastmenu).removeClass('active');
  //        lastmenu = false;
  //    }
  //    else {
  //        $(this).addClass('active');
  //        $("#" + filtro).addClass('active');
  //        lastmenu = $(this);
  //    }
  //});

  $(".search-container .search").click(function () {
    $(this).parent().toggleClass('expanded');
  });

  $('.info-tooltip').click(function () {
    $(this).toggleClass('show-tooltip');
  });
  $(".info-tooltip span").click(function (e) {
    e.stopPropagation();
  });
  $('.toggleFirstLevel').click(function () {
    $('#mobileFl').toggleClass('menu-mobile-opened');
  });
  $('.toggleSecondLevel').click(function () {
    $('.menu-mobile-second-level').removeClass('active-sl');
  });
  $('.toggleThirdLevel').click(function () {
    $('.menu-mobile-third-level').removeClass('active-tl');
  });
  $('.toggleFourthLevel').click(function () {
    $('.menu-mobile-fourth-level').removeClass('active-ftl');
  });
  $('.sharelink').click(function () {
    $(this).parent().toggleClass('show-shares');
    $(this).closest('.shares-head').toggleClass('opened-shares');
  });

  /* script menu mobile */
  var mobmenu = false;
  $("#mobileFl > ul > li a").click(function () {

    var filtro = $(this).data("target");
    if (mobmenu) {
      $("#" + mobmenu.data("target")).removeClass('active-sl');
      $(mobmenu).removeClass('active');
    }
    if (mobmenu && mobmenu.data("target") == filtro) {
      $("#" + mobmenu.data("target")).removeClass('active-sl');
      $(mobmenu).removeClass('active-sl');
      mobmenu = false;
    }
    else {
      $("#" + filtro).addClass('active-sl');
      mobmenu = $(this);
    }
  });
  /* script menu mobile */
  carosello = $('.hoverCarousel').offset();
  shopsWidth = $('#shopsSubMenu').outerWidth();
  prodsWidth = $('#prodsSubMenu').outerWidth();
  windowWidth = $(window).width();
  $(".submenu-project-special-toggle").click(function () {
    $('#prodsSubMenu').toggle();
    //$('#prodsSubMenu').offset({ left: windowWidth/4 });
    $('#prodsSubMenu').css('left', '50px');
    $(".submenu-project-special-toggle").toggleClass('open');
    if ($('#shopsSubMenu').is(":visible")) {
      $('#shopsSubMenu').toggle();
      $(".submenu-project-shops-toggle").toggleClass('open');
    }
    if ($('#outletSubMenu').is(":visible")) {
      $('#outletSubMenu').toggle();
      $(".submenu-project-outlet-toggle").toggleClass('open');
    }
  });
  $(".exitmenu").click(function () {
    $('#prodsSubMenu').hide();
    $(".submenu-project-special-toggle").removeClass('open');
  });
  $(".submenu-project-shops-toggle").click(function () {
    $('#shopsSubMenu').toggle();
    //$('#shopsSubMenu').offset({ left: windowWidth / 3 });        
    $(".submenu-project-shops-toggle").toggleClass('open');
    if ($('#prodsSubMenu').is(":visible")) {
      $('#prodsSubMenu').toggle();
      $(".submenu-project-special-toggle").toggleClass('open');
    }
    if ($('#outletSubMenu').is(":visible")) {
      $('#outletSubMenu').toggle();
      $(".submenu-project-outlet-toggle").toggleClass('open');
    }
  });
  $(".exitmenu.shops").click(function () {
    $('#shopsSubMenu').hide();
    $(".submenu-project-shops-toggle").removeClass('open');
  });

  //start: X Nuovo MENU OUTLET
  $(".submenu-project-outlet-toggle").click(function () {
    $("#outletSubMenu").toggle();
    $(".submenu-project-outlet-toggle").toggleClass('open');
    if ($('#shopsSubMenu').is(":visible")) {
      $('#shopsSubMenu').toggle();
      $(".submenu-project-shops-toggle").toggleClass('open');
    }
    if ($('#prodsSubMenu').is(":visible")) {
      $('#prodsSubMenu').toggle();
      $(".submenu-project-special-toggle").toggleClass('open');
    }
  });
  $(".exitmenu.outlet").click(function () {
    $('#outletSubMenu').hide();
    $(".submenu-project-outlet-toggle").removeClass('open');
  });
  $(".sub-menu-topBar").click(function () {
    var id = $(this).attr('id');
    $('.submenu-project.top-bar#' + id + '_topNavSubMenu').toggle();
    $('.submenu-project.top-bar').css("right", "0");
    $(this).toggleClass('open');
  });

  $(".exitmenu.topBar").click(function () {
    $('.submenu-project.top-bar').hide();
    $(".submenu-project.top-bar").siblings().find(".sub-menu-topBar").removeClass('open');
  });
  //end: X Nuovo MENU OUTLET

  //  $(".submenu-project-special-toggle").click(function () {
  //  $('#prodsSubMenu').slideToggle(function () {
  //    $(".submenu-project-shops-toggle").removeClass("active");
  //  });
  //  if ($('#shopsSubMenu').is(":visible")) {
  //    $('#shopsSubMenu').toggle();
  //  }
  //});
  //$(".exitmenu").click(function() {
  //  $('#prodsSubMenu').slideUp();
  //  $(".submenu-project-special-toggle").removeClass("active");
  //});
  //$(".submenu-project-shops-toggle").click(function () {
  //  $('#shopsSubMenu').slideToggle(function () {
  //    $(".submenu-project-special-toggle").removeClass("active");
  //  });
  //  if ($('#prodsSubMenu').is(":visible")) {
  //    $('#prodsSubMenu').toggle();
  //  }

  //});
  //$(".exitmenu.shops").click(function () {
  //  $('#shopsSubMenu').slideUp();
  //  $(".submenu-project-shops-toggle").removeClass("active");
  //});


});
/**
* Created by andrea on 23/03/15.
*/

$(document).ready(function () {


  /* script menu mobile */

  var mobmenu = false;
  $("#mobileFl > ul > li a").click(function () {

    var filtro = $(this).data("target");
    if (mobmenu) {
      $("#" + mobmenu.data("target")).removeClass('active-sl');
      $(mobmenu).removeClass('active');
    }
    if (mobmenu && mobmenu.data("target") == filtro) {
      $("#" + mobmenu.data("target")).removeClass('active-sl');
      $(mobmenu).removeClass('active-sl');
      mobmenu = false;
    } else {
      $("#" + filtro).addClass('active-sl');
      mobmenu = $(this);
    }
  });
  $(".menu-mobile-second-level > ul > li a").click(function () {

    var filtro = $(this).data("target");
    if (mobmenu) {
      $("#" + mobmenu.data("target")).removeClass('active-tl');
      $(mobmenu).removeClass('active');
    }
    if (mobmenu && mobmenu.data("target") == filtro) {
      $("#" + mobmenu.data("target")).removeClass('active-tl');
      $(mobmenu).removeClass('active-tl');
      mobmenu = false;
    } else {
      $("#" + filtro).addClass('active-tl');
      mobmenu = $(this);
    }
  });
  $(".menu-mobile-third-level > ul > li a").click(function () {

    var filtro = $(this).data("target");
    if (mobmenu) {
      $("#" + mobmenu.data("target")).removeClass('active-ftl');
      $(mobmenu).removeClass('active');
    }
    if (mobmenu && mobmenu.data("target") == filtro) {
      $("#" + mobmenu.data("target")).removeClass('active-ftl');
      $(mobmenu).removeClass('active-ftl');
      mobmenu = false;
    } else {
      $("#" + filtro).addClass('active-ftl');
      mobmenu = $(this);
    }
  });
  /* script menu mobile */
});
/**
* Created by andrea on 23/03/15.
*/
$(window).load(function () {
  $('.outlet-bigslider .slick-list').addClass('container prl');
});
$(document).ready(function () {

  /* contenitore superiore brand */
  var widthbrand = $('.brand-page').width();
  var wiewWidth = $(window).width();

  if (wiewWidth > 990) {
    $('.bigslider-brand .relative-container').css("width", widthbrand + 30);
  }

  $('.controller-multiple-arrows').each(function () {
    var its = $(this).find('.item').length;
    if (its < 2) {
      $(this).find('a.carousel-control').hide();
    }
  });

  /* nuovi shares nascosti */
  $('.hidden-to-click-shares .sharelink').click(function () {
    $(this).closest('.hidden-to-click-shares').toggleClass('shows');
  });
  /* nuovi shares modulo share */
  $('body').on('click', '.modshare .sharelink', function () {
    $(this).closest('.visible-shares').toggleClass('show-sh');
  });
  /* aggiungo width container outlet allo slider per evitare overflows */
  var lunghezzaContainer = $('.bigslider-outlet .container.bigclaimcont').width();

  $('.slider-out .slick-list').css("max-width", lunghezzaContainer + 15);

  /* aggiungo width container outlet allo slider per evitare overflows */
  //$('.ic_overlay').click(function(){

  //            var index = $('.bigslider-product .slick-slide.slick-current').attr('data-index');
  //    $('.slider-lightbox').slick('slickGoTo', index );

  //   $('.bigphoto-overlay-outlet').fadeIn("fast");
  ////   var src = $('.bigslider-outlet .slick-slide.slick-active .imagebox img').attr("src");
  ////   $('.foto-overlay img').attr("src",src);
  ////   var txt = $('.bigslider-outlet .slick-slide.slick-active .imagebox .ever-hidden-description').text();
  ////   $('.foto-description').text(txt);
  //});

  $('.close-ic_overlay.boclose').click(function () {

    $('.bigphoto-overlay-outlet').fadeOut("fast");
    //   $('.foto-overlay img').attr("src",""); 
    //   $('.foto-description').text("");
  });

  $('.close-ic_overlay.bpclose').click(function () {

    $('.bigphoto-overlay-outlet').fadeOut("fast");
    //   $('.foto-overlay img').attr("src",""); 
    //   $('.foto-description').text("");
  });

  /*overlayfoto dinamico*/
  /* overlayfoto prodotto dinamico*/



  //$('.overlay-cta').click(function(){

  //    var index = $('.bigslider-product .slick-slide.slick-current').attr('data-index');
  //    $('.slider-lightbox').slick('slickGoTo', index );
  //    $('.bigphoto-overlay-product').fadeIn("fast");
  ////    $('.bigphoto-overlay-product').fadeIn("fast", function () {
  ////      $(".foto-overlay img").css("max-height", $(window).height() - 60)
  ////    });
  //////   var src = $('.bigslider-product .slick-slide.slick-current img').attr("src");
  //////   $('.foto-overlay img').attr("src",src);
  //////   var txt = $('.bigslider-product .slick-slide.slick-current .ever-hidden-description').text();
  //////   $('.foto-description').text(txt);
  //});

  $('.overlay-cta-brand').click(function () {

    var index = $('.bigslider-brand .slick-slide.slick-current').attr('data-index');
    $('.slider-lightbox').slick('slickGoTo', index);

    $('.bigphoto-overlay-brand').fadeIn("fast");
    //   var src = $('.bigslider-brand .slick-slide.slick-current img').attr("src");
    //   $('.foto-overlay img').attr("src",src);
    //   var txt = $('.bigslider-brand .slick-slide.slick-current .ever-hidden-description').text();
    //   $('.foto-description').text(txt);
  });

  $('.close-ic_overlay').click(function () {
    $('.bigphoto-overlay-product').fadeOut("fast");
    //   $('.foto-overlay img').attr("src",""); 
    //   $('.foto-description').text("");
  });
  $('.close-ic_overlay.bclose').click(function () {
    //$('.bigphoto-overlay-brand').fadeOut("fast");
    //   $('.foto-overlay img').attr("src",""); 
    //   $('.foto-description').text("");
  });
  /*overlayfoto prodotto dinamico*/
  /* nasconde foto che passa sotto claim */

  /* nasconde foto che passa sotto claim */
  function resizeSearch() {
    var lunghezzaModSearch = $('.desk_modsearch').width();

    //if(lunghezzaModSearch>0){
    // $('.desk_modsearch .searchboh input[type="text"]').css("width",lunghezzaModSearch-485); 
    //}



  }
  /* affix recalculate header */

  $('.menu-container').on('affix.bs.affix', function (e) {
    //alert();
    var lunghezzaModSearch = $('.desktopmenu-cont').width();
    if (lunghezzaModSearch > 0) {
      $('.desk_modsearch.opened .searchboh input[type="text"]').css("width", "50%");
    }
  });

  /* overlayfoto dinamico*/
  /* show-hide-shares-post */
  $('.shares-togglable .sharelink').on('click', function () {
    $(this).closest('.shares-togglable').toggleClass('show-mob-shares');
  });
  /* show-hide-shares-post */
  /* tabs collapse */
  $('.toggle-tabs-mobile').click(function () {
    $(this).closest('.container-tabspros').toggleClass('showmobiletabs');
  });
  $('.toggle-tabs-mobile').click(function () {
    $(this).closest('.container-tabsproduct').toggleClass('showmobiletabs');
  });
  $('.toggle-tabs-mobile').click(function () {
    $(this).closest('.container-tabsproject').toggleClass('showmobiletabs');
  });
  $('.toggle-tabs-mobile').click(function () {
    $(this).closest('.container-media').toggleClass('showmobiletabs');
  });

  /* tabs collapse */
  $('.toggleMobileFilters').on('click', function () {
    $(this).siblings('.filter-hide-mob').toggleClass('hidden-xs');
    $(this).siblings('.filter-sub-cont').toggleClass('hidden-xs');
    $(this).find('.mf').toggle();
    $(this).find('.nf').toggle();
  });
  $('.toggleMobileFilters').on('click', function () {
    $(this).closest('.brand-product-filter').find('.filter-hide-mob').toggleClass('hidden-xs');
    $(this).closest('.filtercont').find('.filter-sub-cont').toggleClass('hidden-xs');
  });
  var altezzaBox = $('.bigslider-outlet .abs-box').height();
  $('.bigslider-outlet').css("min-height", altezzaBox + 100);
  $('a[href="#projects"]').on('shown.bs.tab', function (e) {

    $('#masonry-container23').masonry('reloadItems');
    $('#masonry-container23').masonry({
      // options
      itemSelector: '.grid-item'
    });


  });


  $('a[href="#offers"]').on('shown.bs.tab', function (e) {


    $('#masonry-container-lout').masonry('reloadItems');
    $('#masonry-container-lout').masonry({
      // options
      itemSelector: '.grid-item'
    });


  });

  $('#call-masonry').on('shown.bs.tab', function (e) {
    $('#masonry-container').masonry({
      // options
      itemSelector: '.grid-item'
    });
  });


  $('.mobile-readmore').click(function () {
    $(this).closest('.turkey-bg').toggleClass('showmobiletext');
  });
  $('.read-more-link').click(function () {
    $(this).closest('.tab-pane').find('.tab-onlytext').toggleClass('showdescr');
  });
  $('.read-more-link').click(function () {
    $(this).closest('.panel-body').find('.tab-onlytext').toggleClass('showdescr');
  });
  $('body').on('click', '.toggleboxlogos', function () {
    $(this).closest('.pros-block-nobuy').toggleClass('expanded');
    $(this).closest('.pros-block-nobuy').find('.hiddencontent').slideToggle("slow");
  });
  $('.toggle-letter').click(function () {
    $(this).closest('.selector-letter').toggleClass('active');
  });
  $('.filtercont .content-fc a').click(function () {
    $(this).closest('.selector-letter').removeClass('active');
  });
  $('.abs-actions a').click(function () {
    $(this).toggleClass('active');
  });

  $('#scrolldown').click(function () {
    $("html, body").animate({ scrollTop: $('#scrolldown').offset().top - 150 }, 1000);

  });
  $('.selectpicker').selectpicker();
  /* active click wishlist */
  $('body').on('click', '.ic_wishlist', function () {
    $(this).toggleClass('active');
  });
  /* end active click wishlist */
  // stLight.options({publisher: "9615136d-9d26-43a1-bb0d-0369a3d8f606", doNotHash: false, doNotCopy: false, shorten: false, hashAddressBar: false});

  var hwin = $(window).height();
  var wwin = $(window).width();
  var h = hwin - 340;
  var hHome = hwin - 110;
  var hwInt = hwin - 275;
  var hwInt2 = hwin - 290;

  $('.bigslider-outlet .abs-box').css("min-height", altezzaBox + 140);
  if (hwin < 700) {
    $('.bigslider-outlet').css("min-height", altezzaBox + 100);
  }
  if (wwin < 1024) {

    $('.searchboh input[type="text"]').css('width', wwin - 310);
    $('.bigslider-outlet').css("min-height", altezzaBox + 100);
  }
  $('#carousel-home .item').css("height", hHome);
  $('.bigslider-project img').css("max-height", hwInt2 - 60);
  $('.bigslider-project .hs-wrap').css("height", hwInt2 - 45);
  $('.outlet-bigslider .hs-wrap ').css("height", hwInt2);
  //$('.bigslider-pros img').css("height",hwInt2);

  $('.outlet-bigslider').css("min-height", hwInt2 - 30);
  // $('.outlet-bigslider img').css("max-height",hwInt2-130);


  $(window).resize(function () {

    /* aggiungo width container outlet allo slider per evitare overflows */
    var lunghezzaContainer = $('.bigslider-outlet .container.bigclaimcont').width();

    $('.slider-out > div:first-child').css("width", lunghezzaContainer + 15);
    /* aggiungo width container outlet allo slider per evitare overflows */

    var lunghezzaModSearch = $('.desk_modsearch').width();
    if (lunghezzaModSearch > 0) {
      resizeSearch();
    }


    var hHome = hwin - 180;
    $('#carousel-home .item').css("height", hHome);
    var altezzaBox = $('.bigslider-outlet .abs-box').height();
    //$('.bigslider-outlet').css("min-height",altezzaBox+100);
    //$('.bigslider-outlet .abs-box').css("min-height",altezzaBox+100);
    var hwin = $(window).height();
    var wwin = $(window).width();
    var hwInt = hwin - 275;
    $('.bigslider-product img').css("height", hwInt);
    if (wwin < 1024) {
      $('.searchboh input[type="text"]').css('width', wwin - 205);
    }
    if (wwin < 640) {
      $('.searchboh input[type="text"]').css('width', wwin - 205);
    }
    if ($(window).width() < 1023) {
      $(".slidercontainer").unstick();
    }
    if ($(window).width() < 1023) {
      //  $(".stickySldProd").unstick();
    }


  });
  $('.desktop-search').click(function () {
    $('.desk_modsearch').toggleClass('opened');
    $('.menu-principaleSearch,.desktop-search').toggle();
    setTimeout(function () {
      resizeSearch();
    }, 0)
  });
  $('.hidebox-search').click(function () {
    $('.desk_modsearch').toggleClass('opened');
    $('.desk_modsearch').removeClass('overflowauto');
    $('.menu-principaleSearch,.desktop-search').toggle();
  });
  $('.selector-finder li a').click(function () {
    $('.selector-finder li a').addClass('active');
  });

  $('.togglelist').click(function () {
    $('.list-retailers ul').toggleClass('explosed');
  });



  $('#masonry-container').masonry({
    // options
    itemSelector: '.grid-item'
  });
  $('#masonry-container-mobile').masonry({
    // options
    itemSelector: '.grid-item'
  });
  $('#masonry-container2').masonry({
    // options
    itemSelector: '.grid-item'
  });
  $('#masonry-container-project').masonry({
    // options
    itemSelector: '.grid-item',
    gutter: 10,
    columnWidth: 60,
    fitWidth: true
  });

});

$(window).load(function () {
  $('#masonry-container').masonry({
    // options
    itemSelector: '.grid-item',
    gutter: 20
  });
  $('#masonry-container2').masonry({
    // options
    itemSelector: '.grid-item',
    gutter: 20
  });

  $('#masonry-container-project').masonry({
    // options
    itemSelector: '.grid-item',
    columnWidth: 80,
    fitWidth: true
  });

  var hwin = $(window).height();
  var wwin = $(window).width();
  var h = hwin - 340;
  var hwInt2 = hwin - 275;
  $('.bigslider-product img.hsmap-image').css("height", hwInt2);
  if ($(window).width() > 1008) {

    // $(".stickySldProd").sticky({topSpacing:0});

  }
  if ($(window).width() > 1023) {
    var c = 0;
    $(window).scroll(function () {
      if (c === 0) {
        $(".carousel-home-container").sticky({ topSpacing: 0 });
        c++;
      }
      $('.carousel-home-container').css("opacity", 1 - ($(window).scrollTop() / 500));
      // $('.stickySldProd').css("opacity", 1 - ($(window).scrollTop() / 500));
    });
  }
  //if ($(window).width() > 1023) {
  //    $(window).scroll(function() {
  //        var topPos = $('.container-top-adv').offset().top-63;
  //        var scrollPos = $(window).scrollTop();
  //        if($('.container-top-adv').hasClass('fixed-adv')){
  //            topPos = 60;
  //        }
  //        var diff = scrollPos-topPos-60;


  //        var windowHeight = $(window).height()/2;

  //        if(diff>=0){
  //            $('.container-top-adv').addClass('fixed-adv');
  //            $('.adv-cellspace').removeClass('hiddenblock');
  //        }

  //        else{
  //           $('.container-top-adv').removeClass('fixed-adv');
  //            $('.adv-cellspace').addClass('hiddenblock'); 
  //        }
  //        if(scrollPos>=windowHeight){
  //            $('.container-top-adv').removeClass('fixed-adv');
  //            $('.adv-cellspace').addClass('hiddenblock'); 
  //        }

  //    });
  //}

});


$(window).resize(function () {
  /* contenitore superiore brand */
  var widthbrand = $('.brand-page').width();
  var wiewWidth = $(window).width();
  if (wiewWidth > 990) {
    $('.bigslider-brand .relative-container').css("width", widthbrand + 30);
  }
});
/**
 * Created by andrea on 23/03/15.
 */

$('document').ready(function () {

});
/**
 * Created by andrea on 23/03/15.
 */




$(document).ready(function () {
  /* sticky spalla */
  if ($(window).width() > 1023) {
    var top = 50;
    if ($('header>.container-full').hasClass('sandwiched')) {
      top = 0;
    }
    $(".internal-cont #sidebarSticky").sticky({
      topSpacing: top,
      bottomSpacing: 800,
      getWidthFrom: '.col-sm-4'
    });
  }
  $(window).resize(function () {
    if ($(window).width() < 1023) {
      $("#sidebarSticky").unstick();
    }
  });
});

/**
 * Created by andrea on 23/03/15.
 */

$(document).ready(function () {

  $('.sliderbrands').slick({
    infinite: false,
    speed: 300,
    slidesToShow: 6,
    slidesToScroll: 1,
    arrows: true,
    responsive: [{
      breakpoint: 1900,
      settings: {
        slidesToShow: 5,
        slidesToScroll: 1,
        infinite: true,

      }
    }, {
      breakpoint: 1440,
      settings: {
        slidesToShow: 5,
        slidesToScroll: 1,
        infinite: true,

      }
    }, {
      breakpoint: 1280,
      settings: {
        slidesToShow: 4,
        slidesToScroll: 1,
        infinite: true,

      }
    }, {
      breakpoint: 1024,
      settings: {
        slidesToShow: 4,
        slidesToScroll: 2
      }
    }, {
      breakpoint: 768,
      settings: {
        slidesToShow: 3,
        slidesToScroll: 2
      }
    }, {
      breakpoint: 480,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1
      }
    }
      // You can unslick at a given breakpoint now by adding:
      // settings: "unslick"
      // instead of a settings object
    ]
  });

});

//$('.bigslider-outlet .slider-out').slick({
//  dots: true,
//  slidesToShow: 1,
//  slidesToScroll: 1,
//  arrows: false,
//  centerMode: true,
//  fade: false,
//  swipe: true,
//  variableWidth: true
//});

/**
 * Created by andrea on 23/03/15.
 */

$(document).ready(function () {
  $('.projslide').slick({
    dots: false,
    arrows: true,
  });
});
/**
 * Created by andrea on 23/03/15.
 */

$(document).ready(function () {
  $('.bigslider-pros .slider-pros').slick({
    dots: true,
    slidesToShow: 3,
    slidesToScroll: 1,
    arrows: true,
    centerMode: true,
    fade: false,
    infinite: false,
    variableWidth: true,
    responsive: [
      {
        breakpoint: 768,
        settings: {
          slidesToShow: 1,
          slidesToScroll: 1,
          infinite: false,
          dots: true
        }
      },
    ]
  });
});
/*
 Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net
*/

(function () {
  var b, f; b = this.jQuery || window.jQuery; f = b(window); b.fn.stick_in_parent = function (d) {
    var A, w, J, n, B, K, p, q, k, E, t; null == d && (d = {}); t = d.sticky_class; B = d.inner_scrolling; E = d.recalc_every; k = d.parent; q = d.offset_top; p = d.spacer; w = d.bottoming; null == q && (q = 0); null == k && (k = void 0); null == B && (B = !0); null == t && (t = "is_stuck"); A = b(document); null == w && (w = !0); J = function (a, d, n, C, F, u, r, G) {
      var v, H, m, D, I, c, g, x, y, z, h, l; if (!a.data("sticky_kit")) {
        a.data("sticky_kit", !0); I = A.height(); g = a.parent(); null != k && (g = g.closest(k));
        if (!g.length) throw "failed to find stick parent"; v = m = !1; (h = null != p ? p && a.closest(p) : b("<div />")) && h.css("position", a.css("position")); x = function () {
          var c, f, e; if (!G && (I = A.height(), c = parseInt(g.css("border-top-width"), 10), f = parseInt(g.css("padding-top"), 10), d = parseInt(g.css("padding-bottom"), 10), n = g.offset().top + c + f, C = g.height(), m && (v = m = !1, null == p && (a.insertAfter(h), h.detach()), a.css({ position: "", top: "", width: "", bottom: "" }).removeClass(t), e = !0), F = a.offset().top - (parseInt(a.css("margin-top"), 10) || 0) - q,
            u = a.outerHeight(!0), r = a.css("float"), h && h.css({ width: a.outerWidth(!0), height: u, display: a.css("display"), "vertical-align": a.css("vertical-align"), "float": r }), e)) return l()
        }; x(); if (u !== C) return D = void 0, c = q, z = E, l = function () {
          var b, l, e, k; if (!G && (e = !1, null != z && (--z, 0 >= z && (z = E, x(), e = !0)), e || A.height() === I || x(), e = f.scrollTop(), null != D && (l = e - D), D = e, m ? (w && (k = e + u + c > C + n, v && !k && (v = !1, a.css({ position: "fixed", bottom: "", top: c }).trigger("sticky_kit:unbottom"))), e < F && (m = !1, c = q, null == p && ("left" !== r && "right" !== r || a.insertAfter(h),
            h.detach()), b = { position: "", width: "", top: "" }, a.css(b).removeClass(t).trigger("sticky_kit:unstick")), B && (b = f.height(), u + q > b && !v && (c -= l, c = Math.max(b - u, c), c = Math.min(q, c), m && a.css({ top: c + "px" })))) : e > F && (m = !0, b = { position: "fixed", top: c }, b.width = "border-box" === a.css("box-sizing") ? a.outerWidth() + "px" : a.width() + "px", a.css(b).addClass(t), null == p && (a.after(h), "left" !== r && "right" !== r || h.append(a)), a.trigger("sticky_kit:stick")), m && w && (null == k && (k = e + u + c > C + n), !v && k))) return v = !0, "static" === g.css("position") && g.css({ position: "relative" }),
              a.css({ position: "absolute", bottom: d, top: "auto" }).trigger("sticky_kit:bottom")
        }, y = function () { x(); return l() }, H = function () { G = !0; f.off("touchmove", l); f.off("scroll", l); f.off("resize", y); b(document.body).off("sticky_kit:recalc", y); a.off("sticky_kit:detach", H); a.removeData("sticky_kit"); a.css({ position: "", bottom: "", top: "", width: "" }); g.position("position", ""); if (m) return null == p && ("left" !== r && "right" !== r || a.insertAfter(h), h.remove()), a.removeClass(t) }, f.on("touchmove", l), f.on("scroll", l), f.on("resize",
          y), b(document.body).on("sticky_kit:recalc", y), a.on("sticky_kit:detach", H), setTimeout(l, 0)
      }
    }; n = 0; for (K = this.length; n < K; n++)d = this[n], J(b(d)); return this
  }
}).call(this);
/**
* Created by andrea on 23/03/15.
*/

$(document).ready(function () {
  $("#hotspot-84").hotspot({ "show_on": "mouseover", "responsive": true });
  $("#hotspot-85").hotspot({ "show_on": "mouseover", "responsive": true });
  $("#hotspot-90").hotspot({ "show_on": "mouseover", "responsive": true });
  $("#hotspot-109").hotspot({ "show_on": "mouseover", "responsive": true });
});
/**
 * Created by andrea on 23/03/15.
 */

$(document).ready(function () {
  $('#videoscnt .carousel-control').click(function () {
    $('#videoscnt iframe').attr('src', $('iframe').attr('src'));
  });
});
(function () {
  'use strict';

  angular
    .module('app', ['bw.paging'])

})();
(function () {
  'use strict';

  angular
    .module('app')
    .controller('filterController', filterController);

  filterController.$inject = ['$timeout', '$http'];

  function filterController($timeout, $http) {


    var vm = this;
    vm.filterActived = [];

    vm.categorie = {};
    vm.tipi = {};
    vm.ambienti = {};

    vm.selected = {};

    vm.selected.ambiente = false;
    vm.selectAmbiente = function (item) {
      vm.selected.ambiente = item;
    }

    vm.selected.categoria = false;
    vm.selectCategoria = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'categoria') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.categoria = item;
    }

    vm.selected.tipo = false;
    vm.selectTipo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'tipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.tipo = item;
    }

    vm.selected.stile = false;
    vm.selectStile = function (item) {
      vm.selected.stile = item;
    }

    vm.selected.materiale = false;
    vm.selectMateriale = function (item) {
      vm.selected.materiale = item;
    }

    vm.selected.prezzo = false;
    vm.selectPrezzo = function (item) {
      vm.selected.prezzo = item;
    }

    vm.selected.brand = false;
    vm.selectBrand = function (item) {
      vm.selected.brand = item;
    }

    vm.selected.designer = false;
    vm.selectDesigner = function (item) {
      vm.selected.designer = item;
    }

    vm.stili = {};
    vm.materiali = {};
    vm.prezzi = {};
    vm.brands = {};
    vm.designers = {};

    vm.showCategorie = false;
    vm.showTipi = false;

    vm.initProdotti = function () {

      vm.getAmbienti();
      vm.getStili();
      vm.getMateriali();
      vm.getPrezzi();
      vm.getBrands();
      vm.getDesigners();
      vm.getProdotti(1);

    };

    vm.addFilter = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if (element.tipologia === item.tipologia) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      vm.filterActived.push(item);
    }


    vm.getAmbienti = function () {
      /** Sostituire url */
      $http.get('../mock/ambienti.json').then(function (response) {
        vm.ambienti = response.data;
      });
    };

    vm.getCategorie = function () {
      //vm.selected.ambiente = JSON.parse( vm.selected.ambiente );
      // console.log( vm.ambiente );
      if (vm.selected.ambiente) {

        /** Sostituire url */
        //*** sostituire i $ con ? 
        $http.get('../mock/categorie$ambiente=' + vm.selected.ambiente.id + '.json').then(function (response) {
          vm.categorie = response.data;
          vm.showCategorie = true;
        });
      }
    };

    vm.getTipi = function () {
      //vm.selected.categoria = JSON.parse(vm.selected.categoria);
      if (vm.selected.categoria && vm.selected.ambiente) {

        /** Sostituire url */
        //*** sostituire i $ con ? (il primo) e & (il secondo)  
        $http.get('../mock/tipi$ambiente=' + vm.selected.ambiente.id + '$categoria=' + vm.selected.categoria.id + '.json').then(function (response) {
          vm.tipi = response.data;
          vm.showTipi = true;
        });
      }
    };

    vm.getStili = function () {
      /** Sostituire url */
      $http.get('../mock/stili.json').then(function (response) {
        vm.stili = response.data;
      });
    };

    vm.getMateriali = function () {
      /** Sostituire url */
      $http.get('../mock/materiali.json').then(function (response) {
        vm.materiali = response.data;
      });
    };

    vm.getPrezzi = function () {
      /** Sostituire url */
      $http.get('../mock/prezzi.json').then(function (response) {
        vm.prezzi = response.data;
      });
    };
    vm.getBrands = function () {
      /** Sostituire url */
      $http.get('../mock/brands.json').then(function (response) {
        vm.brands = response.data;
      });
    };

    vm.getDesigners = function () {
      /** Sostituire url */
      $http.get('../mock/designers.json').then(function (response) {
        vm.designers = response.data;
      });
    };

    vm.removeSelected = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if ((element.id === item.id && element.tipologia === item.tipologia)) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      if (item.tipologia === 'tipo') {
        vm.showTipi = false;
        vm.selectTipo(false);
      }
      if (item.tipologia === 'categoria') {
        vm.showTipi = false;
        vm.showCategorie = false;
        vm.selectTipo(false);
        vm.selectCategoria(false);
      }
      if (item.tipologia === 'ambiente') {
        vm.showTipi = false;
        vm.showCategorie = false;
        vm.selectTipo(false);
        vm.selectCategoria(false);
        vm.selectAmbiente(false);
      }
      if (item.tipologia === 'stile') {
        vm.selectStile(false);
      }
      if (item.tipologia === 'materiale') {
        vm.selectMateriale(false);
      }
      if (item.tipologia === 'prezzo') {
        vm.selectPrezzo(false);
      }
      if (item.tipologia === 'brand') {
        vm.selectBrand(false);
      }
      if (item.tipologia === 'designer') {
        vm.selectDesigner(false);
      }

    }

    vm.clearAll = function () {
      vm.selected = {};
      vm.filterActived = [];
      vm.showTipi = false;
      vm.showCategorie = false;
      vm.selectTipo(false);
      vm.selectCategoria(false);
      vm.selectAmbiente(false);
    }


    vm.getProdotti = function (page) {


      vm.current_page = page;

      /** Sostituire url */
      var url = '../mock/progetti.json';
      $http.get(url).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });

          if (window.stButtons) { stButtons.locateElements(); }
        });

      });

    }

    vm.submitFiltri = function (page) {

      var query = '';
      var i = 0;

      if (vm.filterActived.length == 0) {
        vm.getProdotti(page);
      }

      vm.filterActived.forEach(function (element, index, array) {
        if (i === 0) {
          query += '?page=' + page + '&' + element.tipologia + '=' + element.id;
        } else {
          query += '&' + element.tipologia + '=' + element.id;
        }
        i++;
      });

      /** Sostituire url */
      var url = '../mock/progetti.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/progetti.' + r + '.json';
      /** a qui **/

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });

          if (window.stButtons) { stButtons.locateElements(); }
        });

      });

    }


    // vm.init();

  }

})();
(function () {
  'use strict';

  angular
    .module('app')
    .controller('filterBrandController', filterBrandController);

  filterBrandController.$inject = ['$timeout', '$http'];

  function filterBrandController($timeout, $http) {

    var vm = this;
    vm.filterActived = [];

    vm.alfabeto = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split("");

    vm.aree = {};
    vm.tipi = {};
    vm.ambienti = {};

    vm.paesi = {};

    vm.selected = {};

    vm.selected.ambiente = false;
    vm.selectAmbiente = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'ambiente') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selectTipo(false);
      vm.selected.ambiente = item;
      vm.selected.tipo = false;
      vm.getTipi();
    }

    vm.selected.tipo = false;
    vm.selectTipo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'tipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.tipo = item;
    }

    vm.selected.categoria = false;
    vm.selectCategoria = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'categoria') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.categoria = item;
    }

    vm.selected.designer = false;
    vm.selectDesigner = function (item) {
      vm.selected.designer = item;
    }

    vm.stili = {};
    vm.brands = {};


    vm.showTipi = false;

    vm.init = function () {

      vm.getAmbienti();
      vm.getCategorie();
      vm.getTipi();
      vm.getDesigners();
      // vm.getAree();
      // vm.getPaesi();
      vm.getProdotti(1);

      $('#collapseTwo').on('shown.bs.collapse', function (e) {

        $('#masonry-container-proj2').masonry({
          // options
          itemSelector: '.grid-item'
        });

      });

    };


    vm.addFilter = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if (element.tipologia === item.tipologia) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      vm.filterActived.push(item);
    }


    vm.getAmbienti = function () {
      /** Sostituire url */
      $http.get('../mock/ambienti.json').then(function (response) {
        vm.showAmbiente = true;
        vm.ambienti = response.data;
      });

    };

    vm.getCategorie = function () {

      /** Sostituire url */
      //*** sostituire i $ con ? 
      $http.get('../mock/categorie.json').then(function (response) {
        vm.categorie = response.data;
        vm.showCategorie = true;
      });
    };

    vm.getDesigners = function () {
      /** Sostituire url */
      $http.get('../mock/designers.json').then(function (response) {
        vm.designers = response.data;
      });
    };


    vm.getTipi = function () {
      //vm.selected.categoria = JSON.parse(vm.selected.categoria);

      /** Sostituire url */
      //*** sostituire i $ con ? (il primo) e & (il secondo)  
      $http.get('../mock/tipi-brand.json').then(function (response) {
        vm.tipi = response.data;
        vm.showTipi = true;
      });

    };


    vm.removeSelected = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if ((element.id === item.id && element.tipologia === item.tipologia)) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      if (item.tipologia === 'tipo') {
        vm.selectTipo(false);
      }
      if (item.tipologia === 'designer') {
        vm.selectDesigner(false);
      }
      if (item.tipologia === 'ambiente') {
        vm.selectAmbiente(false);
      }
      if (item.tipologia === 'categoria') {
        vm.selectCategoria(false);
      }


    }

    vm.clearAll = function () {
      vm.selected = {};
      vm.filterActived = [];
      vm.selectTipo(false);
      vm.selectDesigner(false);
      vm.selectAmbiente(false);
      vm.selectCategoria(false);
    }


    vm.getProdotti = function (page) {

      vm.current_page = page;

      /** Sostituire url */
      var url = '../mock/progetti.json';
      $http.get(url).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container-proj').masonry('reloadItems');
          $('#masonry-container-proj').masonry({
            // options
            itemSelector: '.grid-item'
          });

          $('#masonry-container-proj2').masonry('reloadItems');
          $('#masonry-container-proj2').masonry({
            // options
            itemSelector: '.grid-item'
          });


        });

      });

    }

    vm.submitFiltri = function (page) {

      var query = '';
      var i = 0;

      if (vm.filterActived.length == 0) {
        vm.getProdotti(page);
      }

      vm.filterActived.forEach(function (element, index, array) {
        if (i === 0) {
          query += '?page=' + page + '&' + element.tipologia + '=' + element.id;
        } else {
          query += '&' + element.tipologia + '=' + element.id;
        }
        i++;
      });

      /** Sostituire url */
      var url = '../mock/progetti.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/progetti.' + r + '.json';
      /** a qui **/

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container-proj').masonry('reloadItems');
          $('#masonry-container-proj').masonry({
            // options
            itemSelector: '.grid-item'
          });

          $('#masonry-container-proj2').masonry('reloadItems');
          $('#masonry-container-proj2').masonry({
            // options
            itemSelector: '.grid-item'
          });

        });

      });

    }





    vm.init();

  }

})();
(function () {
  'use strict';

  angular
    .module('app')
    .controller('filterBrandNSController', filterBrandNSController);

  filterBrandNSController.$inject = ['$timeout', '$http'];

  function filterBrandNSController($timeout, $http) {

    var vm = this;
    vm.filterActived = [];

    vm.alfabeto = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split("");

    vm.aree = {};
    vm.tipi = {};
    vm.ambienti = {};

    vm.paesi = {};

    vm.selected = {};

    vm.selected.ambiente = false;
    vm.selectAmbiente = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'ambiente') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selectTipo(false);
      vm.selected.ambiente = item;
      vm.selected.tipo = false;
      vm.getTipi();
    }

    vm.selected.tipo = false;
    vm.selectTipo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'tipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.tipo = item;
    }

    vm.selected.categoria = false;
    vm.selectCategoria = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'categoria') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.categoria = item;
    }

    vm.selected.designer = false;
    vm.selectDesigner = function (item) {
      vm.selected.designer = item;
    }

    vm.stili = {};
    vm.brands = {};


    vm.showTipi = false;

    vm.init = function () {

      vm.getAmbienti();
      vm.getCategorie();
      vm.getTipi();
      vm.getDesigners();
      // vm.getAree();
      // vm.getPaesi();
      vm.getProdotti(1);

    };

    vm.addFilter = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if (element.tipologia === item.tipologia) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      vm.filterActived.push(item);
    }


    vm.getAmbienti = function () {
      /** Sostituire url */
      $http.get('../mock/ambienti.json').then(function (response) {
        vm.showAmbiente = true;
        vm.ambienti = response.data;
      });

    };

    vm.getCategorie = function () {

      /** Sostituire url */
      //*** sostituire i $ con ? 
      $http.get('../mock/categorie.json').then(function (response) {
        vm.categorie = response.data;
        vm.showCategorie = true;
      });
    };

    vm.getDesigners = function () {
      /** Sostituire url */
      $http.get('../mock/designers.json').then(function (response) {
        vm.designers = response.data;
      });
    };


    vm.getTipi = function () {
      //vm.selected.categoria = JSON.parse(vm.selected.categoria);

      /** Sostituire url */
      //*** sostituire i $ con ? (il primo) e & (il secondo)  
      $http.get('../mock/tipi-brand.json').then(function (response) {
        vm.tipi = response.data;
        vm.showTipi = true;
      });

    };


    vm.removeSelected = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if ((element.id === item.id && element.tipologia === item.tipologia)) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      if (item.tipologia === 'tipo') {
        vm.selectTipo(false);
      }
      if (item.tipologia === 'designer') {
        vm.selectDesigner(false);
      }
      if (item.tipologia === 'ambiente') {
        vm.selectAmbiente(false);
      }
      if (item.tipologia === 'categoria') {
        vm.selectCategoria(false);
      }


    }

    vm.clearAll = function () {
      vm.selected = {};
      vm.filterActived = [];
      vm.selectTipo(false);
      vm.selectDesigner(false);
      vm.selectAmbiente(false);
      vm.selectCategoria(false);
    }


    vm.getProdotti = function (page) {

      vm.current_page = page;

      /** Sostituire url */
      var url = '../mock/progetti.json';
      $http.get(url).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container-brands').masonry('reloadItems');
          $('#masonry-container-brands').masonry({
            // options
            itemSelector: '.grid-item'
          });
        }, 400);

      });

    }

    vm.submitFiltri = function (page) {

      var query = '';
      var i = 0;

      if (vm.filterActived.length == 0) {
        vm.getProdotti(page);
      }

      vm.filterActived.forEach(function (element, index, array) {
        if (i === 0) {
          query += '?page=' + page + '&' + element.tipologia + '=' + element.id;
        } else {
          query += '&' + element.tipologia + '=' + element.id;
        }
        i++;
      });

      /** Sostituire url */
      var url = '../mock/progetti.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/progetti.' + r + '.json';
      /** a qui **/

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container-brands').masonry('reloadItems');
          $('#masonry-container-brands').masonry({
            // options
            itemSelector: '.grid-item'
          });
        });

      });

    }





    vm.init();

  }

})();
(function () {
  'use strict';

  angular
    .module('app')
    .controller('filterBrandsController', filterBrandsController);

  filterBrandsController.$inject = ['$timeout', '$http'];

  function filterBrandsController($timeout, $http) {

    var vm = this;
    vm.filterActived = [];

    vm.alfabeto = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split("");

    vm.aree = {};
    vm.tipi = {};
    vm.ambienti = {};

    vm.paesi = {};

    vm.selected = {};

    vm.selected.ambiente = false;
    vm.selectAmbiente = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'ambiente') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selectTipo(false);
      vm.selected.ambiente = item;
      vm.selected.tipo = false;
      vm.getTipi();
    }

    vm.selected.paese = false;
    vm.selectPaese = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'paese') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.paese = item;
    }

    vm.selected.area = false;
    vm.selectArea = function (item) {
      // console.log( item );
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'area') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selectAmbiente(false);
      vm.selected.ambiente = false;
      vm.selected.area = item;
      vm.getAmbienti();
    }

    vm.selected.tipo = false;
    vm.selectTipo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'tipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.tipo = item;
    }


    vm.selected.brand = false;
    vm.selectBrand = function (item) {
      vm.selected.brand = item;
    }

    vm.stili = {};
    vm.brands = {};


    vm.showTipi = false;

    vm.init = function () {

      vm.getAree();
      vm.getPaesi();
      vm.getProdotti(1);

    };

    vm.addFilter = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if (element.tipologia === item.tipologia) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      vm.filterActived.push(item);
    }

    vm.addFilterBrand = function (id, nome) {
      var item = { id: id, nome: nome, tipologia: 'brandselector' };
      vm.selected.brandselector = item;
      vm.addFilter(item);
    }


    vm.getAmbienti = function () {
      /** Sostituire url */
      if (vm.selected.area) {
        $http.get('../mock/ambienti$area=' + vm.selected.area.id + '.json').then(function (response) {
          vm.showAmbiente = true;
          vm.ambienti = response.data;
        });
      }
    };

    vm.getAree = function () {
      /** Sostituire url */
      $http.get('../mock/aree.json').then(function (response) {
        vm.aree = response.data;
      });
    };

    vm.getPaesi = function () {
      /** Sostituire url */
      $http.get('../mock/paesi.json').then(function (response) {
        vm.paesi = response.data;
      });
    };


    vm.getTipi = function () {
      //vm.selected.categoria = JSON.parse(vm.selected.categoria);
      if (vm.selected.area && vm.selected.ambiente) {

        /** Sostituire url */
        //*** sostituire i $ con ? (il primo) e & (il secondo)  
        $http.get('../mock/tipi-brand$area=' + vm.selected.area.id + '$ambiente=' + vm.selected.ambiente.id + '.json').then(function (response) {
          vm.tipi = response.data;
          vm.showTipi = true;
        });
      }
    };

    vm.getBrands = function () {
      /** Sostituire url */
      $http.get('../mock/brands.json').then(function (response) {
        vm.brands = response.data;
      });
    };

    vm.removeSelected = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if ((element.id === item.id && element.tipologia === item.tipologia)) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      if (item.tipologia === 'tipo') {
        vm.showTipi = false;
        vm.selectTipo(false);
      }
      if (item.tipologia === 'area') {
        vm.showTipi = false;
        vm.showAmbiente = false;
        vm.selectTipo(false);
        vm.selectArea(false);
        vm.selectAmbiente(false);
      }
      if (item.tipologia === 'ambiente') {
        vm.showTipi = false;
        vm.showAmbiente = false;
        vm.selectAmbiente(false);
        vm.selectTipo(false);
      }
      if (item.tipologia === 'brandselector') {
        vm.selected.brandselector = false;
      }


    }

    vm.clearAll = function () {
      vm.selected = {};
      vm.filterActived = [];
      vm.showTipi = false;
      vm.showAmbiente = false;

      // vm.showCategorie = false;
      vm.selectTipo(false);
      vm.selectAmbiente(false);
      vm.selectArea(false);
    }


    vm.getProdotti = function (page) {

      vm.current_page = page;

      /** Sostituire url */
      var url = '../mock/brandlist.json';
      $http.get(url).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });
        });

      });

    }

    vm.submitFiltri = function (page) {

      var query = '';
      var i = 0;

      if (vm.filterActived.length == 0) {
        vm.getProdotti(page);
      }

      vm.filterActived.forEach(function (element, index, array) {
        if (i === 0) {
          query += '?page=' + page + '&' + element.tipologia + '=' + element.id;
        } else {
          query += '&' + element.tipologia + '=' + element.id;
        }
        i++;
      });

      /** Sostituire url */
      var url = '../mock/brandlist.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/brandlist.' + r + '.json';
      /** a qui **/

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });
        });

      });

    }


    // vm.init();

  }

})();
(function () {
  'use strict';

  angular
    .module('app')
    .controller('filterOutletController', filterOutletController);

  filterOutletController.$inject = ['$timeout', '$http'];

  function filterOutletController($timeout, $http) {


    var vm = this;
    vm.filterActived = [];

    vm.categorie = {};
    vm.tipi = {};
    vm.ambienti = {};

    vm.selected = {};

    vm.selected.ambiente = false;
    vm.selectAmbiente = function (item) {
      vm.selected.ambiente = item;
    }

    vm.selected.categoria = false;
    vm.selectCategoria = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'categoria') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.categoria = item;
    }

    vm.selected.tipo = false;
    vm.selectTipo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'tipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.tipo = item;
    }

    vm.selected.stile = false;
    vm.selectStile = function (item) {
      vm.selected.stile = item;
    }

    vm.selected.materiale = false;
    vm.selectMateriale = function (item) {
      vm.selected.materiale = item;
    }

    vm.selected.prezzo = false;
    vm.selectPrezzo = function (item) {
      vm.selected.prezzo = item;
    }

    vm.selected.brand = false;
    vm.selectBrand = function (item) {
      vm.selected.brand = item;
    }

    vm.selected.designer = false;
    vm.selectDesigner = function (item) {
      vm.selected.designer = item;
    }

    vm.selected.geo = false;
    vm.selectGeo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'geo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.geo = item;
    }

    vm.selected.latest = false;
    vm.selectLatest = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'latest') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.latest = item;
    }
    vm.getLatest = function () {
      /** Sostituire url */
      $http.get('../mock/latest.json').then(function (response) {
        vm.latest = response.data;
      });
    };

    vm.selected.visti = false;
    vm.selectMostViewed = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'viewed') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.visti = item;
    }
    vm.getMostViewed = function () {
      /** Sostituire url */
      $http.get('../mock/mviewed.json').then(function (response) {
        vm.visti = response.data;
      });
    };


    vm.selected.onsale = false;
    vm.selectOnSale = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'onsale') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.onsale = item;
    }
    vm.getOnSale = function () {
      /** Sostituire url */
      $http.get('../mock/onsale.json').then(function (response) {
        vm.onsale = response.data;
      });
    };


    vm.stili = {};
    vm.materiali = {};
    vm.prezzi = {};
    vm.brands = {};
    vm.designers = {};

    vm.showCategorie = false;
    vm.showTipi = false;

    vm.init = function () {

      vm.getAmbienti();
      vm.getStili();
      vm.getMateriali();
      vm.getPrezzi();
      vm.getBrands();
      vm.getDesigners();

      vm.getLatest();
      vm.getMostViewed();
      vm.getOnSale();
      vm.getGeo();

      vm.getProdotti(1);

    };


    vm.addFilter = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if (element.tipologia === item.tipologia) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      vm.filterActived.push(item);
    }


    vm.getAmbienti = function () {
      /** Sostituire url */
      $http.get('../mock/ambienti.json').then(function (response) {
        vm.ambienti = response.data;
      });
    };

    vm.getCategorie = function () {
      //vm.selected.ambiente = JSON.parse( vm.selected.ambiente );
      // console.log( vm.ambiente );
      if (vm.selected.ambiente) {

        /** Sostituire url */
        //*** sostituire i $ con ? 
        $http.get('../mock/categorie$ambiente=' + vm.selected.ambiente.id + '.json').then(function (response) {
          vm.categorie = response.data;
          vm.showCategorie = true;
        });
      }
    };

    vm.getGeo = function () {
      /** Sostituire url */
      $http.get('../mock/geo.json').then(function (response) {
        vm.geos = response.data;
      });
    };


    vm.getTipi = function () {
      //vm.selected.categoria = JSON.parse(vm.selected.categoria);
      if (vm.selected.categoria && vm.selected.ambiente) {

        /** Sostituire url */
        //*** sostituire i $ con ? (il primo) e & (il secondo)  
        $http.get('../mock/tipi$ambiente=' + vm.selected.ambiente.id + '$categoria=' + vm.selected.categoria.id + '.json').then(function (response) {
          vm.tipi = response.data;
          vm.showTipi = true;
        });
      }
    };

    vm.getStili = function () {
      /** Sostituire url */
      $http.get('../mock/stili.json').then(function (response) {
        vm.stili = response.data;
      });
    };

    vm.getMateriali = function () {
      /** Sostituire url */
      $http.get('../mock/materiali.json').then(function (response) {
        vm.materiali = response.data;
      });
    };

    vm.getPrezzi = function () {
      /** Sostituire url */
      $http.get('../mock/prezzi.json').then(function (response) {
        vm.prezzi = response.data;
      });
    };
    vm.getBrands = function () {
      /** Sostituire url */
      $http.get('../mock/brands.json').then(function (response) {
        vm.brands = response.data;
      });
    };

    vm.getDesigners = function () {
      /** Sostituire url */
      $http.get('../mock/designers.json').then(function (response) {
        vm.designers = response.data;
      });
    };

    vm.removeSelected = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if ((element.id === item.id && element.tipologia === item.tipologia)) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      if (item.tipologia === 'tipo') {
        vm.showTipi = false;
        vm.selectTipo(false);
      }
      if (item.tipologia === 'categoria') {
        vm.showTipi = false;
        vm.showCategorie = false;
        vm.selectTipo(false);
        vm.selectCategoria(false);
      }
      if (item.tipologia === 'ambiente') {
        vm.showTipi = false;
        vm.showCategorie = false;
        vm.selectTipo(false);
        vm.selectCategoria(false);
        vm.selectAmbiente(false);
      }
      if (item.tipologia === 'stile') {
        vm.selectStile(false);
      }
      if (item.tipologia === 'materiale') {
        vm.selectMateriale(false);
      }
      if (item.tipologia === 'prezzo') {
        vm.selectPrezzo(false);
      }
      if (item.tipologia === 'brand') {
        vm.selectBrand(false);
      }
      if (item.tipologia === 'designer') {
        vm.selectDesigner(false);
      }
      if (item.tipologia === 'geo') {
        vm.selectGeo(false);
      }

    }

    vm.clearAll = function () {
      vm.selected = {};
      vm.filterActived = [];
      vm.showTipi = false;
      vm.showCategorie = false;
      vm.selectTipo(false);
      vm.selectCategoria(false);
      vm.selectAmbiente(false);
    }


    vm.getProdotti = function (page) {


      vm.current_page = page;

      /** Sostituire url */
      var url = '../mock/outlet.json';
      $http.get(url).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });
          if (window.stButtons) { stButtons.locateElements(); }
        });

      });

    }

    vm.submitFiltri = function (page) {

      var query = '';
      var i = 0;

      if (vm.filterActived.length == 0) {
        vm.getProdotti(page);
      }

      vm.filterActived.forEach(function (element, index, array) {
        if (i === 0) {
          query += '?page=' + page + '&' + element.tipologia + '=' + element.id;
        } else {
          query += '&' + element.tipologia + '=' + element.id;
        }
        i++;
      });

      /** Sostituire url */
      var url = '../mock/outlet.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/outlet.' + r + '.json';
      /** a qui **/

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {

          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });

          if (window.stButtons) { stButtons.locateElements(); }
        });

      });

    }


    vm.init();

  }

})();
(function () {
  'use strict';

  angular
    .module('app')
    .controller('filterProjectsController', filterProjectsController);

  filterProjectsController.$inject = ['$timeout', '$http'];

  function filterProjectsController($timeout, $http) {

    var vm = this;
    vm.filterActived = [];

    vm.aree = {};
    vm.tipi = {};
    vm.ambienti = {};

    vm.paesi = {};
    vm.selected = {};

    vm.showContract = false;
    vm.showArea = false;

    vm.selected.casa = false;
    vm.selectCasa = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'casa') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selectContract(false);
      vm.selected.contract = false;
      vm.selected.casa = item;
      vm.getContracts();
    }

    vm.selected.contract = false;
    vm.selectContract = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'contract') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selectArea(false);
      vm.selected.area = true;
      vm.selected.contract = item;
      vm.getAree();
    }

    vm.selected.area = false;
    vm.selectArea = function (item) {
      // console.log( item );
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'area') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.area = item;
      // vm.getAmbienti();
    }

    vm.selected.tipo = false;
    vm.selectTipo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'tipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.tipo = item;
    }

    vm.selected.geo = false;
    vm.selectGeo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'geo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.geo = item;
    }

    vm.selected.stile = false;
    vm.selectStile = function (item) {
      vm.selected.stile = item;
    }


    vm.showTipi = false;
    vm.init = function () {

      vm.getCase();
      vm.getAree();
      vm.getTipi();
      vm.getStili();
      // vm.getContracts();
      vm.getGeo();

      vm.getProdotti(1);

    };

    vm.getStili = function () {
      /** Sostituire url */
      $http.get('../mock/stili.json').then(function (response) {
        vm.stili = response.data;
      });
    };

    vm.addFilter = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if (element.tipologia === item.tipologia) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });
      vm.filterActived.push(item);
    }

    vm.addFilterBrand = function (id, nome) {
      vm.addFilter({ id: id, nome: nome, tipologia: 'brandselector' })
    }

    vm.getGeo = function () {
      /** Sostituire url */
      $http.get('../mock/geo.json').then(function (response) {
        vm.geos = response.data;
      });
    };

    vm.getCase = function () {
      /** Sostituire url */
      $http.get('../mock/case.json').then(function (response) {
        vm.case = response.data;
      });
    };

    vm.getTipi = function () {
      //vm.selected.categoria = JSON.parse(vm.selected.categoria);
      // if( vm.selected.area && vm.selected.ambiente ){

      /** Sostituire url */
      //*** sostituire i $ con ? (il primo) e & (il secondo)  
      $http.get('../mock/tipi.json').then(function (response) {
        vm.tipi = response.data;
        vm.showTipi = true;
      });
      // }
    };

    vm.getContracts = function () {
      /** Sostituire url */
      //*** sostituire i $ con ? (il primo) e & (il secondo)  
      if (vm.selected.casa) {

        /** Sostituire url */
        //*** sostituire i $ con ? 
        $http.get('../mock/contracts$casa=' + vm.selected.casa.id + '.json').then(function (response) {
          vm.contracts = response.data;
          vm.showContract = true;
        });
      }
    };

    vm.getAree = function () {
      /** Sostituire url */
      if (vm.selected.casa && vm.selected.contract) {

        /** Sostituire url */
        //*** sostituire i $ con ? (il primo) e & (il secondo)  
        $http.get('../mock/aree$casa=' + vm.selected.casa.id + '$contract=' + vm.selected.contract.id + '.json').then(function (response) {
          vm.aree = response.data;
          vm.showArea = true;
        });
      }

    };

    vm.removeSelected = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if ((element.id === item.id && element.tipologia === item.tipologia)) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      if (item.tipologia === 'tipo') {
        vm.selectTipo(false);
      }
      if (item.tipologia === 'area') {
        vm.selectArea(false);
        vm.showArea = false;
      }
      if (item.tipologia === 'casa') {
        vm.selectCasa(false);
        vm.selectContract(false);
        vm.selectArea(false);
        vm.showContract = false;
        vm.showArea = false;
      }
      if (item.tipologia === 'geo') {
        vm.selectGeo(false);
      }
      if (item.tipologia === 'contract') {
        vm.selectContract(false);
        vm.selectArea(false);
        vm.showContract = false;
        vm.showArea = false;
      }
      if (item.tipologia === 'stile') {
        vm.selectStile(false);
      }
      if (item.tipologia === 'latest') {
        vm.selectStile(false);
      }

    }

    vm.clearAll = function () {
      vm.selected = {};
      vm.filterActived = [];
      vm.showTipi = false;
      vm.showAmbiente = false;

      // vm.showCategorie = false;
      vm.selectTipo(false);
      vm.selectContract(false);
      vm.selectArea(false);
      vm.selectCasa(false);
      vm.selectGeo(false);
    }


    vm.getProdotti = function (page) {

      vm.current_page = page;

      /** Sostituire url */
      var url = '../mock/projects.json';
      $http.get(url).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });
        });

      });

    }

    vm.submitFiltri = function (page) {

      var query = '';
      var i = 0;

      if (vm.filterActived.length == 0) {
        vm.getProdotti(page);
      }

      vm.filterActived.forEach(function (element, index, array) {
        if (i === 0) {
          query += '?page=' + page + '&' + element.tipologia + '=' + element.id;
        } else {
          query += '&' + element.tipologia + '=' + element.id;
        }
        i++;
      });

      /** Sostituire url */
      var url = '../mock/projects.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/projects.' + r + '.json';
      /** a qui **/

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });
        });

      });

    }


    vm.init();

  }

})();
(function () {
  'use strict';

  angular
    .module('app')
    .controller('filterProsController', filterBrandsController);

  filterBrandsController.$inject = ['$timeout', '$http'];

  function filterBrandsController($timeout, $http) {

    var vm = this;
    vm.filterActived = [];

    vm.alfabeto = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split("");

    vm.aree = {};
    vm.tipi = {};
    vm.ambienti = {};

    vm.paesi = {};
    vm.sottotipi = {};
    vm.selected = {};

    vm.selected.ambiente = false;
    vm.selectAmbiente = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'ambiente') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.ambiente = item;
    }

    vm.selected.paese = false;
    vm.selectPaese = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'paese') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.paese = item;
    }

    vm.selected.area = false;
    vm.selectArea = function (item) {
      // console.log( item );
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'area') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selectAmbiente(false);
      vm.selected.ambiente = false;
      vm.selected.area = item;
      vm.getAmbienti();
    }

    vm.selected.tipo = false;
    vm.selectTipo = function (item) {
      // console.log( item );
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'tipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.sottotipo = false;
      vm.selected.tipo = item;
    }

    vm.selected.sottotipo = false;
    vm.selectSottoTipo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'sottotipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.ambiente = false;
      // vm.selectAmbiente(false);
      vm.selected.sottotipo = item;
    }


    vm.selected.brand = false;
    vm.selectBrand = function (item) {
      vm.selected.brand = item;
    }

    vm.selected.servizio = false;
    vm.selectServizio = function (item) {
      vm.selected.servizio = item;
    }

    vm.selected.servizioSpeciale = false;
    vm.selectServizioSpeciale = function (item) {
      vm.selected.servizioSpeciale = item;
    }

    vm.stili = {};
    vm.brands = {};


    vm.showTipi = false;

    vm.init = function () {

      vm.getTipi();
      vm.getBrands();
      vm.getServizi();
      vm.getServiziSpeciali();

      vm.getProdotti(1);

    };

    vm.addFilter = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if (element.tipologia === item.tipologia) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      vm.filterActived.push(item);
    }

    vm.addFilterBrand = function (id, nome) {
      var item = { id: id, nome: nome, tipologia: 'brandselector' };
      vm.selected.brandselector = item;
      vm.addFilter(item);
    }


    vm.getAmbienti = function () {
      /** Sostituire url */
      if (vm.selected.tipo && vm.selected.sottotipo) {
        $http.get('../mock/ambienti$tipo=' + vm.selected.tipo.id + '$sottotipo=' + vm.selected.sottotipo.id + '.json').then(function (response) {
          vm.showAmbiente = true;
          vm.ambienti = response.data;
        });
      }
    };

    vm.getAree = function () {
      /** Sostituire url */
      $http.get('../mock/aree.json').then(function (response) {
        vm.aree = response.data;
      });
    };

    vm.getPaesi = function () {
      /** Sostituire url */
      $http.get('../mock/paesi.json').then(function (response) {
        vm.paesi = response.data;
      });
    };


    vm.getTipi = function () {
      // if( vm.selected.area && vm.selected.ambiente ){
      /** Sostituire url */
      //*** sostituire i $ con ? (il primo) e & (il secondo)  
      $http.get('../mock/tipi.json').then(function (response) {
        vm.tipi = response.data;
      });
      // }
    };

    vm.getSottoTipi = function () {
      if (vm.selected.tipo) {
        /** Sostituire url */
        //*** sostituire i $ con ? (il primo) e & (il secondo)  
        $http.get('../mock/sottotipi$tipo=' + vm.selected.tipo.id + '.json').then(function (response) {
          vm.sottotipi = response.data;
          vm.showSottoTipi = true;
        });
      }
    };

    vm.getBrands = function () {
      /** Sostituire url */
      $http.get('../mock/brands.json').then(function (response) {
        vm.brands = response.data;
      });
    };

    vm.getServizi = function () {
      /** Sostituire url */
      $http.get('../mock/servizi.json').then(function (response) {
        vm.servizi = response.data;
      });
    };

    vm.getServiziSpeciali = function () {
      /** Sostituire url */
      $http.get('../mock/servizispeciali.json').then(function (response) {
        vm.serviziSpeciali = response.data;
      });
    };

    vm.removeSelected = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if ((element.id === item.id && element.tipologia === item.tipologia)) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      if (item.tipologia === 'tipo') {
        vm.showTipi = false;
        vm.selectTipo(false);
        vm.selectSottoTipo(false);
        vm.showSottoTipi = false;
        vm.showAmbiente = false;
      }
      if (item.tipologia === 'sottotipo') {
        vm.selectSottoTipo(false);
        vm.showSottoTipi = false;
        vm.selectAmbiente(false);
        vm.showAmbiente = false;
      }
      if (item.tipologia === 'ambiente') {
        vm.showAmbiente = false;
        vm.selectAmbiente(false);
      }
      if (item.tipologia === 'brandselector') {
        vm.selected.brandselector = false;
      }


    }

    vm.clearAll = function () {
      vm.selected = {};
      vm.filterActived = [];
      vm.showTipi = false;
      vm.showAmbiente = false;
      vm.showSottoTipi = false;

      // vm.showCategorie = false;
      vm.selectTipo(false);
      vm.selectAmbiente(false);
      vm.selectSottoTipo(false);
    }


    vm.getProdotti = function (page) {

      vm.current_page = page;

      /** Sostituire url */
      var url = '../mock/pros.json';
      $http.get(url).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });
        });

      });

    }

    vm.submitFiltri = function (page) {

      var query = '';
      var i = 0;

      if (vm.filterActived.length == 0) {
        vm.getProdotti(page);
      }

      var first = true;

      vm.filterActived.forEach(function (element, index, array) {
        if (i === 0) {
          first = false;
          query += '?page=' + page + '&' + element.tipologia + '=' + element.id;
        } else {
          query += '&' + element.tipologia + '=' + element.id;
        }
        i++;
      });

      var e = '';
      if (vm.location) {
        if (vm.location.txt) {
          if (first) {
            first = false;
            e = '?';
          }
          else {
            e = '&';
          }
          query += e + 'location=' + vm.location.txt;
        }
        if (vm.location.km) {
          if (first) {
            e = '?';
            first = false;
          }
          else {
            e = '&';
          }
          query += e + 'km=' + vm.location.km;
        }
      }



      /** Sostituire url */
      var url = '../mock/pros.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/pros.' + r + '.json';
      /** a qui **/

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container').masonry('reloadItems');
          $('#masonry-container').masonry({
            // options
            itemSelector: '.grid-item'
          });
        });

      });

    }


  }

})();
/*!
* Angular-Paging v2.0.0 by Brant Wills - MIT licensed
* https://github.com/brantwills/Angular-Paging.git
*/
angular.module("bw.paging", []).directive("paging", function () { function a(a, b, c) { a.$watchCollection("[page,pageSize,total]", function () { j(a, c) }) } function b(a, b) { a.List = [], a.Hide = !1, a.dots = a.dots || "...", a.page = parseInt(a.page) || 1, a.total = parseInt(a.total) || 0, a.ulClass = a.ulClass || "pagination", a.adjacent = parseInt(a.adjacent) || 2, a.activeClass = a.activeClass || "active", a.disabledClass = a.disabledClass || "disabled", a.scrollTop = a.$eval(b.scrollTop), a.hideIfEmpty = a.$eval(b.hideIfEmpty), a.showPrevNext = a.$eval(b.showPrevNext) } function c(a, b) { a.page > b && (a.page = b), a.page <= 0 && (a.page = 1), a.adjacent <= 0 && (a.adjacent = 2), 1 >= b && (a.Hide = a.hideIfEmpty) } function d(a, b) { a.page != b && (a.page = b, a.pagingAction({ page: a.page, pageSize: a.pageSize, total: a.total }), a.scrollTop && scrollTo(0, 0)) } function e(a, b, c) { if (a.showPrevNext && !(1 > b)) { var e, f, g; if ("prev" === c) { e = a.page - 1 <= 0; var h = a.page - 1 <= 0 ? 1 : a.page - 1; f = { value: "<<", title: "First Page", page: 1 }, g = { value: "<", title: "Previous Page", page: h } } else { e = a.page + 1 > b; var i = a.page + 1 >= b ? b : a.page + 1; f = { value: ">", title: "Next Page", page: i }, g = { value: ">>", title: "Last Page", page: b } } var j = function (b, c) { a.List.push({ value: b.value, title: b.title, liClass: c ? a.disabledClass : "", action: function () { c || d(a, b.page) } }) }; j(f, e), j(g, e) } } function f(a, b, c) { var e = 0; for (e = a; b >= e; e++) { var f = { value: e, title: "Page " + e, liClass: c.page == e ? c.activeClass : "", action: function () { d(c, this.value) } }; c.List.push(f) } } function g(a) { a.List.push({ value: a.dots }) } function h(a, b) { f(1, 2, a), 3 != b && g(a) } function i(a, b, c) { c != a - 2 && g(b), f(a - 1, a, b) } function j(a, d) { (!a.pageSize || a.pageSize <= 0) && (a.pageSize = 1); var g = Math.ceil(a.total / a.pageSize); b(a, d), c(a, g); var j, k, l = 2 * a.adjacent + 2; e(a, g, "prev"), l + 2 >= g ? (j = 1, f(j, g, a)) : a.page - a.adjacent <= 2 ? (j = 1, k = 1 + l, f(j, k, a), i(g, a, k)) : a.page < g - (a.adjacent + 2) ? (j = a.page - a.adjacent, k = a.page + a.adjacent, h(a, j), f(j, k, a), i(g, a, k)) : (j = g - l, k = g, h(a, j), f(j, k, a)), e(a, g, "next") } return { restrict: "EA", link: a, scope: { page: "=", pageSize: "=", total: "=", dots: "@", hideIfEmpty: "@", ulClass: "@", activeClass: "@", disabledClass: "@", adjacent: "@", scrollTop: "@", showPrevNext: "@", pagingAction: "&" }, template: '<ul ng-hide="Hide" ng-class="ulClass"> <li title="{{Item.title}}" ng-class="Item.liClass" ng-click="Item.action()" ng-repeat="Item in List"> <span ng-bind="Item.value"></span> </li></ul>' } });
(function () {
  'use strict';

  angular
    .module('app')
    .controller('productSlider', productSlider);

  productSlider.$inject = ['$timeout', '$http'];

  function productSlider($timeout, $http) {
    var vm = this;
    vm.prodotti = [];

    vm.getProdotti = function (projectId) {

      /** Sostituire url */
      var url = '../mock/prodotti.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/prodotti.' + r + '.json';
      /** a qui **/

      var query = '?project=' + projectId;

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;
      });

    }

    vm.init = function () {

      $timeout(function () {

        // first initialization
        var $slide = $('.bigslider-project .slick-active');
        var projectId = $slide.attr('data-project');
        vm.getProdotti(projectId);


        $('.bigslider-project.page-proj-slider').on('beforeChange', function (event, slick, currentSlide, nextSlide) {
          var $slide = $('.bigslider-project .slick-active');
          var projectId = $slide.attr('data-project');
          vm.getProdotti(projectId);

        });

      });

    }

    vm.init();

  }

})();
(function () {
  'use strict';

  angular
    .module('app')
    .controller('prosTabsControllers', prosTabsControllers);

  prosTabsControllers.$inject = ['$timeout', '$http'];

  function prosTabsControllers($timeout, $http) {

    var vm = this;
    vm.filterActived = [];

    vm.alfabeto = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split("");

    vm.aree = {};
    vm.tipi = {};
    vm.ambienti = {};

    vm.paesi = {};

    vm.selected = {};

    vm.selected.ambiente = false;
    vm.selectAmbiente = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'ambiente') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selectTipo(false);
      vm.selected.ambiente = item;
      vm.selected.tipo = false;
      vm.getTipi();
    }

    vm.selected.tipo = false;
    vm.selectTipo = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'tipo') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.tipo = item;
    }

    vm.selected.categoria = false;
    vm.selectCategoria = function (item) {
      if (!item) {
        vm.filterActived.forEach(function (element, index, array) {
          if (element.tipologia === 'categoria') {
            // delete vm.filterActived[ index ];
            array.splice(index, 1);
          }
        });
      }
      vm.selected.categoria = item;
    }

    vm.selected.designer = false;
    vm.selectDesigner = function (item) {
      vm.selected.designer = item;
    }

    vm.stili = {};
    vm.brands = {};


    vm.showTipi = false;

    vm.init = function () {

      vm.getAmbienti();
      vm.getCategorie();
      vm.getTipi();
      vm.getDesigners();
      // vm.getAree();
      // vm.getPaesi();
      vm.getProdotti(1);


      $('#collapseTwo').on('shown.bs.collapse', function (e) {
        $('#masonry-container-proj2').masonry({
          // options
          itemSelector: '.grid-item'
        });
      });

      $('#collapseThree').on('shown.bs.collapse', function (e) {
        $('#masonry-container-proj-cata2').masonry({
          // options
          itemSelector: '.grid-item'
        });
      });

      $('a[href="#offers"]').on('shown.bs.tab', function (e) {

        $('#masonry-container-proj').masonry('reloadItems');
        $('#masonry-container-proj').masonry({
          // options
          itemSelector: '.grid-item'
        });


      });
      $('a[href="#catalogs"]').on('shown.bs.tab', function (e) {

        $('#masonry-container-proj-cata').masonry('reloadItems');
        $('#masonry-container-proj-cata').masonry({
          // options
          itemSelector: '.grid-item'
        });

      });


    };


    vm.addFilter = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if (element.tipologia === item.tipologia) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      vm.filterActived.push(item);
    }


    vm.getAmbienti = function () {
      /** Sostituire url */
      $http.get('../mock/ambienti.json').then(function (response) {
        vm.showAmbiente = true;
        vm.ambienti = response.data;
      });

    };

    vm.getCategorie = function () {

      /** Sostituire url */
      //*** sostituire i $ con ? 
      $http.get('../mock/categorie.json').then(function (response) {
        vm.categorie = response.data;
        vm.showCategorie = true;
      });
    };

    vm.getDesigners = function () {
      /** Sostituire url */
      $http.get('../mock/designers.json').then(function (response) {
        vm.designers = response.data;
      });
    };


    vm.getTipi = function () {
      //vm.selected.categoria = JSON.parse(vm.selected.categoria);

      /** Sostituire url */
      //*** sostituire i $ con ? (il primo) e & (il secondo)  
      $http.get('../mock/tipi-brand.json').then(function (response) {
        vm.tipi = response.data;
        vm.showTipi = true;
      });

    };


    vm.removeSelected = function (item) {

      vm.filterActived.forEach(function (element, index, array) {
        if ((element.id === item.id && element.tipologia === item.tipologia)) {
          // delete vm.filterActived[ index ];
          array.splice(index, 1);
        }
      });

      if (item.tipologia === 'tipo') {
        vm.selectTipo(false);
      }
      if (item.tipologia === 'designer') {
        vm.selectDesigner(false);
      }
      if (item.tipologia === 'ambiente') {
        vm.selectAmbiente(false);
      }
      if (item.tipologia === 'categoria') {
        vm.selectCategoria(false);
      }


    }

    vm.clearAll = function () {
      vm.selected = {};
      vm.filterActived = [];
      vm.selectTipo(false);
      vm.selectDesigner(false);
      vm.selectAmbiente(false);
      vm.selectCategoria(false);
    }


    vm.getProdotti = function (page) {

      vm.current_page = page;

      /** Sostituire url */
      var url = '../mock/outlet.json';
      $http.get(url).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container-proj').masonry('reloadItems');
          $('#masonry-container-proj').masonry({
            // options
            itemSelector: '.grid-item'
          });


          $('#masonry-container-proj-cata').masonry('reloadItems');
          $('#masonry-container-proj-cata').masonry({
            // options
            itemSelector: '.grid-item'
          });

          $('#masonry-container-proj-cata2').masonry('reloadItems');
          $('#masonry-container-proj-cata2').masonry({
            // options
            itemSelector: '.grid-item'
          });


          $('#masonry-container-proj2').masonry('reloadItems');
          $('#masonry-container-proj2').masonry({
            // options
            itemSelector: '.grid-item'
          });


        });

      });

    }

    vm.submitFiltri = function (page) {

      var query = '';
      var i = 0;

      if (vm.filterActived.length == 0) {
        vm.getProdotti(page);
      }

      vm.filterActived.forEach(function (element, index, array) {
        if (i === 0) {
          query += '?page=' + page + '&' + element.tipologia + '=' + element.id;
        } else {
          query += '&' + element.tipologia + '=' + element.id;
        }
        i++;
      });

      /** Sostituire url */
      var url = '../mock/outlet.json';

      /** Eliminare - da qui **/
      var r = Math.floor((Math.random() * 4) + 1);
      var url = '../mock/outlet.' + r + '.json';
      /** a qui **/

      $http.get(url + query).then(function (response) {
        vm.prodotti = response.data;

        $timeout(function () {
          $('#masonry-container-proj').masonry('reloadItems');
          $('#masonry-container-proj').masonry({
            // options
            itemSelector: '.grid-item'
          });

          $('#masonry-container-proj-cata').masonry('reloadItems');
          $('#masonry-container-proj-cata').masonry({
            // options
            itemSelector: '.grid-item'
          });
          $('#masonry-container-proj-cata2').masonry('reloadItems');
          $('#masonry-container-proj-cata2').masonry({
            // options
            itemSelector: '.grid-item'
          });


          $('#masonry-container-proj2').masonry('reloadItems');
          $('#masonry-container-proj2').masonry({
            // options
            itemSelector: '.grid-item'
          });

        });

      });

    }





    vm.init();

  }

})();;
$(document).ready(function () {
   $('.slider-out').slick({
    dots: false,
    slidesToShow: 1,
    slidesToScroll: 1,
    arrows: true,
    fade: false,
    swipe: true,
    centerMode: true,
    adaptiveHeight: true,
    variableWidth: true,
    responsive: [
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1,
        infinite: false,
        dots: false
      }
    }
    ]
   }, function () {
     $('.slider-for').slick("unslick");
   });

  $('.slider-for').slick({
    dots: false,
    slidesToShow: 1,
    slidesToScroll: 1,
    arrows: true,
    centerMode: true,
    variableWidth: true,
    infinite: false,
    responsive: [
    {
      breakpoint: 768,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1,
        infinite: false,
        dots: false
      }
    }
    ]
  });

  $('.sliderbrands').slick("unslick");

  $('.sliderbrands').slick({
    dots: false,
    slidesToShow: 5,
    slidesToScroll: 1,
    arrows: true,
    centerMode: false,
    infinite: false,
    variableWidth: true,
    responsive: [
    {
      breakpoint: 768,
      settings: {
        variableWidth: true,
        slidesToShow: 1,
        slidesToScroll: 1,
        infinite: false,
        dots: false,
        arrows: true
      }
    }
    ]
  });

  $('.slider-lightbox').slick({
    variableWidth: false,
    adaptiveHeight: true,
      responsive: [
      {
        breakpoint: 768,
        settings: {
          variableWidth: false,
          slidesToShow: 1,
          slidesToScroll: 1,
          infinite: true
        }
      }
      ]
    });

  $('.overlay-cta, .product-zoom').click(function (e) {
    e.preventDefault();
    var index = $('.slider-for .slick-slide.slick-current').attr('data-index');
    $('.slider-lightbox').slick('slickGoTo', index);
    $('.bigphoto-overlay-product').fadeIn("fast", function () {
      //$('.pd-box').height(window.innerHeight);
    });
  });

  $('.ic_overlay').click(function () {

    var index = $('.slider-out .slick-slide.slick-current').attr('data-index');
    $('.slider-lightbox').slick('slickGoTo', index);
    $('.bigphoto-overlay-product').fadeIn("fast");
  });

});
//$('.slider-lightbox').slick({
//  variableWidth: false,
//  responsive: [
//  {
//    breakpoint: 768,
//    settings: {
//      variableWidth: false,
//      slidesToShow: 1,
//      slidesToScroll: 1,
//      infinite: true
//    }
//  }
//  ]
//});
//$('.slider-lightbox').slick('slickGoTo', index);
;
var tab1;
var tab2;
var tab3;
var excludeGEOad = "";
var settedCookie = Cookies.get("cookie_policy_accepted") ? 0 : 1;
// Inclusione delle librerie google doubleclick
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function () {
  var gads = document.createElement('script');
  gads.async = true;
  gads.type = 'text/javascript';
  var useSSL = 'https:' == document.location.protocol;
  gads.src = (useSSL ? 'https:' : 'http:') +
  '//www.googletagservices.com/tag/js/gpt.js';
  var node = document.getElementsByTagName('script')[0];
  node.parentNode.insertBefore(gads, node);
})();

var isProdottoDaNegozio = function (string) {
  return window.location.pathname.split('/').length == 10 && window.location.pathname.indexOf("/"+string+"/") != -1;
}

var isRPN = function () {
  return window.location.pathname.split('/').length > 6 && window.location.pathname.indexOf("/pro/showroom/") != -1;
}

var setSkin = false;
if (!setSkin) {
  $('body > div,.container,footer,.full-container').addClass('skinned');
}

var manageSkin = function (mapSizes, width) {
  //SKIN
  googletag.defineSlot('/6412672/skin-and-companion', [[1920, 1080], [970, 250], [320,50]], 'skin-companion').defineSizeMapping(mapSizes).addService(
    googletag.pubads()
  );
  googletag.pubads().addEventListener('slotRenderEnded', function (event) {
    if (event.slot.getSlotElementId() == 'skin-companion') {
      if (event.size != null) {
      if (event.size[0] == 970) {
        winMast = true;
        $('#skin-companion').addClass('masthead');
        //$('#skin-companion').removeClass('masthead');
        //winMast = false;
      } else {
        $('#skin-companion').removeClass('masthead');
        winMast = false;
        //winMast = true;
        //$('#skin-companion').addClass('masthead');
        }
        //winMast = true;
      console.log("size skin = " + event.size[0] + " winmast = " + winMast);
      if (event.isEmpty) {
        $('#main-container,.container,footer,.full-container').removeClass('skinned');
      }
    }
    }
  });
  googletag.pubads().addEventListener('impressionViewable', function (eventCr) {
    if (eventCr.slot.getName() == '/6412672/skin-and-companion') {
      setSkin = true;
      $('#main-container,.container,footer,.full-container').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend',
        function (e) {
          $('#carousel-home .item').css("height", $(window).height() - 350);
        });
      if (!winMast) {
        if (width <= 1024 && width >= 720) {
          $('#skin-companion').css('position', 'relative');
        } else {
          if(width > 1024){
            $('#main-container,.container,footer,.full-container').addClass('skinned');
          }
          $('#skin-companion').css('position', 'fixed');
        }
        $('#masonry-container').masonry();
        $('.slider-out').slick('setPosition');
        $('.slider-for').slick('setPosition');
      } else {
        $('#main-container,.container,footer,.full-container').removeClass('skinned');
        if (width >= 720) {
          $('#skin-companion').css('position', 'relative');
        }
        $('#masonry-container').masonry();
      }
    }
    if (!setSkin) {
      $('body > div,.container,footer,.full-container').removeClass('skinned');
    }
  });
  //FINE SKIN
};


// attivazione banner
googletag.cmd.push(function () {
  googletag.pubads().setCookieOptions(settedCookie);
  var winMast = false;
  var mapping = googletag.sizeMapping().addSize([0, 0], [320, 50]).addSize([994, 620], [970, 250]).build();
  var mappinSkin = googletag.sizeMapping().addSize([0, 0], [[320, 100], [320, 50]]).addSize([720, 0], [[1080, 240], [970, 250]]).addSize([1025, 0], [[1440, 800], [970, 250]]).addSize([1441, 0], [[1920, 1080], [970, 250]]).build();
  googletag.defineSlot('/6412672/pixel-counter', [1, 1], 'div-gpt-ad-1511796705983-0').addService(googletag.pubads());
  if (window.location.pathname.indexOf("/it/") != -1 || window.location.pathname == '/it') {
    //SKIN
    var larg = $(window).width();
    manageSkin(mappinSkin, larg);
    //MASTHEAD


    ///*nuovi extrabacino*/googletag.defineSlot('/6412672/WM_IC_TR_allsite_header', [970, 250], 'div-gpt-ad-1400158794018-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    //googletag.defineSlot('/6412672/WM_allsite_header', [970, 250], 'div-gpt-ad-1371035099815-0').setCollapseEmptyDiv(true, true).defineSizeMapping(mapping).addService(googletag.pubads());

    //FINE MASTHEAD

    //Forchetta per annunci targhettizati
    if (isProdottoDaNegozio('catalogo') || isRPN()) {
      console.log(isProdottoDaNegozio('catalogo') + '\N' + isRPN());
      googletag.defineSlot('/6412672/WM_allsite_top', [300, 250], 'div-gpt-ad-1371035099815-1').setCollapseEmptyDiv(true, true).setCategoryExclusion('GEO').addService(googletag.pubads());
    } else {
      googletag.defineSlot('/6412672/WM_allsite_top', [300, 250], 'div-gpt-ad-1371035099815-1').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    }
    /*nuovi extrabacino TOP*/ googletag.defineSlot('/6412672/WM_IC_TR_allsite_top', [300, 250], 'div-gpt-ad-1412090086452-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());

    googletag.defineSlot('/6412672/Mobile_Leaderboard', [320, 50], 'div-gpt-ad-1418742216608-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/HomeOutlet_header', [[970, 250], [320, 50]], 'div-gpt-ad-1461233723064-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/HomeOutlet_rectangle', [300, 250], 'div-gpt-ad-1464102685529-0').addService(googletag.pubads());
    googletag.pubads().setTargeting("zona", ['1'], "refresh");

  } else if (window.location.pathname.indexOf("/en/") != -1 || window.location.pathname == '/en') {
    //SKIN
    var larg = $(window).width();
    manageSkin(mappinSkin, larg);
    //FINE SKIN

    //googletag.defineSlot('/6412672/DB-EN_allsite_header', [970, 250], 'div-gpt-ad-1398890472288-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    ///*nuovi extrabacino*/googletag.defineSlot('/6412672/DB-En_extra_header', [970, 250], 'div-gpt-ad-1412088217390-1').setCollapseEmptyDiv(true, true).addService(googletag.pubads());

    if (isProdottoDaNegozio('catalog') || isRPN()) {
      console.log(isProdottoDaNegozio('catalog') + '\N' + isRPN());
      googletag.defineSlot('/6412672/DB-EN_allsite_top', [300, 250], 'div-gpt-ad-1398890523958-0').setCollapseEmptyDiv(true, true).setCategoryExclusion('GEO').addService(googletag.pubads());
    }
    else {
      googletag.defineSlot('/6412672/DB-EN_allsite_top', [300, 250], 'div-gpt-ad-1398890523958-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    }
    /*nuovi extrabacino TOP*/googletag.defineSlot('/6412672/DB-En_extra_top', [300, 250], 'div-gpt-ad-1412150089221-1').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/Mobile_Leaderboard', [320, 50], 'div-gpt-ad-1418742216608-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());

    googletag.pubads().setTargeting("zona", ['1000']);
  }
  else if (window.location.pathname.indexOf("/de/") != -1 || window.location.pathname == '/de') {
    //SKIN
    var larg = $(window).width();
    manageSkin(mappinSkin, larg);
    //FINE SKIN

    //googletag.defineSlot('/6412672/DB-DE_allsite_header', [970, 250], 'div-gpt-ad-1398890192418-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    ///*nuovi extrabacino*/googletag.defineSlot('/6412672/DB-De_extra_header', [970, 250], 'div-gpt-ad-1412088217390-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());


    if (isProdottoDaNegozio('katalog') || isRPN()) {
      console.log(isProdottoDaNegozio('katalog') + '\N' + isRPN());
      googletag.defineSlot('/6412672/DB-DE_allsite_top', [300, 250], 'div-gpt-ad-1398890323748-0').setCollapseEmptyDiv(true, true).setCategoryExclusion('GEO').addService(googletag.pubads());
    } else {
      googletag.defineSlot('/6412672/DB-DE_allsite_top', [300, 250], 'div-gpt-ad-1398890323748-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    }
    /*nuovi extrabacino TOP*/googletag.defineSlot('/6412672/DB-De_extra_top', [300, 250], 'div-gpt-ad-1412150089221-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/Mobile_Leaderboard', [320, 50], 'div-gpt-ad-1418742216608-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());

    googletag.pubads().setTargeting("zona", ['10']);
  }
  else if (window.location.pathname.indexOf("/fr/") != -1 || window.location.pathname == '/fr') {
    //SKIN
    var larg = $(window).width();
    manageSkin(mappinSkin, larg);
    //FINE SKIN

    //googletag.defineSlot('/6412672/DB-FR_allsite_header', [970, 250], 'div-gpt-ad-1398890625899-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    ///*nuovi extrabacino*/googletag.defineSlot('/6412672/DB-Fr_extra_header', [970, 250], 'div-gpt-ad-1412088217390-2').setCollapseEmptyDiv(true, true).addService(googletag.pubads());


    if (isProdottoDaNegozio('catalogue') || isRPN()) {
      console.log(isProdottoDaNegozio('catalogue') + '\N' + isRPN());
      googletag.defineSlot('/6412672/DB-FR_allsite_top', [300, 250], 'div-gpt-ad-1398890678699-0').setCollapseEmptyDiv(true, true).setCategoryExclusion('GEO').addService(googletag.pubads());
    } else {
      googletag.defineSlot('/6412672/DB-FR_allsite_top', [300, 250], 'div-gpt-ad-1398890678699-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    }
    /*nuovi extrabacino TOP*/googletag.defineSlot('/6412672/DB-Fr_extra_top', [300, 250], 'div-gpt-ad-1412150089221-2').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/Mobile_Leaderboard', [320, 50], 'div-gpt-ad-1418742216608-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());

    googletag.pubads().setTargeting("zona", ['7']);
  }
  else if (window.location.hostname.indexOf("localhost") != -1 || window.location.pathname == 'localhost') {  // localhost
    googletag.pubads().enableAsyncRendering();
    googletag.defineSlot('/6412672/DB-EN_allsite_header', [970, 250], 'div-gpt-ad-1398890472288-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads().setTargeting("zona", "estero"));
    googletag.defineSlot('/6412672/DB-EN_allsite_top', [300, 250], 'div-gpt-ad-1398890523958-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads().setTargeting("zona", "estero"));

    topNoGeo = googletag.defineSlot('/6412672/WM_allsite_top', [300, 250], 'div-gpt-ad-1371035099815-1').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/DBcom_allsite_header', [970, 250], 'div-gpt-ad-1371034583175-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/DBcom_allsite_top', [300, 250], 'div-gpt-ad-1371034583175-1').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/WM_allsite_header', [970, 250], 'div-gpt-ad-1371035099815-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    /*nuovi extrabacino*/googletag.defineSlot('/6412672/WM_IC_TR_allsite_header', [970, 250], 'div-gpt-ad-1400158794018-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    /*nuovi extrabacino TOP*/googletag.defineSlot('/6412672/WM_IC_TR_allsite_top', [300, 250], 'div-gpt-ad-1412090086452-0').addService(googletag.pubads());
    googletag.defineSlot('/6412672/Mobile_Leaderboard', [320, 50], 'div-gpt-ad-1418742216608-0').addService(googletag.pubads());;

    googletag.defineSlot('/6412672/Test_target', [[970, 250], [320, 50]], 'div-gpt-ad-1453369436830-0').setCollapseEmptyDiv(true, true).defineSizeMapping(mapping).addService(googletag.pubads());
    googletag.defineSlot('/6412672/HomeOutlet_header', [[970, 250], [320, 50]], 'div-gpt-ad-1461233723064-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.defineSlot('/6412672/HomeOutlet_rectangle', [300, 250], 'div-gpt-ad-1464102685529-0').addService(googletag.pubads());

    /*nuovi extrabacino*/googletag.defineSlot('/6412672/DB-En_extra_header', [1036, 320], 'div-gpt-ad-1412088217390-1').addService(googletag.pubads());
    //googletag.defineSlot('/6412672/DB-FR_allsite_header', [1036, 320], 'div-gpt-ad-1398890625899-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    //googletag.defineSlot('/6412672/DB-FR_allsite_top', [300, 250], 'div-gpt-ad-1398890678699-0').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    /*nuovi extrabacino*/googletag.defineSlot('/6412672/DB-Fr_extra_header', [970, 250], 'div-gpt-ad-1412088217390-2').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    /*nuovi extrabacino TOP*/googletag.defineSlot('/6412672/DB-Fr_extra_top', [300, 250], 'div-gpt-ad-1412150089221-2').setCollapseEmptyDiv(true, true).addService(googletag.pubads());
    googletag.pubads().setTargeting("zona", ['1', '2', '3', '7', '10', '1000']);
  }
  googletag.pubads().collapseEmptyDivs();
  googletag.pubads().enableSingleRequest();
  if ($('.home').length == 0) {
    googletag.pubads().addEventListener('slotRenderEnded', function (event) {
      if (event.size[0] == 970) {
        if (event.isEmpty) {
          $('.banner-cont').attr('style', '');
        }      
        googletag.pubads().addEventListener('impressionViewable', function (eventCr) {
          //if (eventCr.slot.getName().indexOf('skin') > 0) {
          //  $('.adv-banner-full').hide();
          //} 
          if (eventCr.slot.getName().indexOf('_header') > 0 && $('.home').length == 0) {
            $('#megaMenu').attr('data-offset-top', 250);
            $('.banner-cont').attr('style', 'padding:8px 0 15px 0');
          }
        });
      }
    });
  }
  $(window).resize(function () {
    googletag.pubads().refresh();
  });
  console.log("refreshed");
  googletag.enableServices();
  setInterval(
    function () {
      googletag.pubads().refresh();
      console.log("refreshed");

      googletag.pubads().addEventListener('impressionViewable', function (eventCr) {
        if (eventCr.slot.getName().indexOf('_header') > 0 && $('.home').length == 0) {
          console.log("evento ");
          console.log(eventCr);
          $('.banner-cont div').first().show();
          $('.banner-cont').attr('style', 'padding:8px 0 15px 0');
        }
        //if (eventCr.slot.getName().indexOf('skin') > 0) {
        //  $('.adv-banner-full').hide();
        //} 
      });

    }
    , 50000);
});;
/*!
 * WM AnalyticsTrackEvents Library v1.1.0
 *
 * Contiene le definizioni dei tracciamenti e le chiamate alla ga() di Analytics
 * Necessariamente dev'essere incluso dopo la dichiarazione dello script Analytics, utilizza
 * la varabile ga
 *
 * Date: 2016-03-29
 */
 
 // First, checks if it isn't implemented yet.
if (!String.prototype.format) {
	/**  Implementazione come String.Format() di C# */
  String.prototype.format = function(args) {
    //var args = arguments;
    return this.replace(/{(\d+)}/g, function(match, number) { 
      return typeof args[number] != 'undefined'
        ? args[number]
        : match
      ;
    });
  };
}


function WM_AnalyticsTracking() {

	/** Array associativo con tutti gli eventi possibili nella nostra piattaforma */
  var eventi = [];

	/*****************************************/
	/************ VERSIONE DESKTOP ***********/
	
	// Negozi
  eventi["negozio_write"] = {
    category: "negozio",
    action: "write_{0}",
    label: "mail al negozio"
  };	// aggiungere nel frontend

  eventi["negozio_visit"] = {
    category: "negozio",
    action: "visit_{0}",
    label: "visita al sito negozio"
  };
	
  eventi["negozio_mappa"] = {
    category: "negozio",
    action: "mappa_{0}",
    label: "click alla mappa"
  };

  eventi["negozio_gallery"] = {
    category: "negozio",
    action: "gallery_negozio_{0}",
    label: "click su immagini alternative"
  };

  eventi["negozio_descrizione"] = {
    category: "negozio",
    action: "descrizione_negozio_{0}",
    label: "click apertura descrizione"
  };

  eventi["negozio_outlet"] = {
    category: "negozio",
    action: "outlet_negozio_{0}",
    label: "visita outlet occasioni"
  };
	
	// click ai social (raggruppati) - visite a social
  eventi["negozio_social"] = {
    category: "negozio",
    action: "social_{0}",
    label: "click social"
  };

    // click Mostra Numero
  eventi["negozio_proletario_mostra_tel"] = {
      category: "negozio",
      action: "proletario_mostra_tel_{0}_{1}",
      label: "negozio proletario mostra numero"
  };


  // click pulsante sponsor
  eventi["negozio_butsponsor"] = {
    category: "negozio",
    action: "butsponsor_{0}",
    label: "click al pulsante negozio sponsor"
  };


  //Prodotti
  eventi["prodotto_desc"] = {
    category: "prodotto",
    action: "clickDescId_{0}",
    label: "click apertura descrizione"
  };

  eventi["prodotto_info"] = {
    category: "prodotto",
    action: "clickInfoId_{0}",
    label: "click apertura info e prezzi"
  };
	
  //eventi["prodotto_form_negozi"] = {
  //  category: "prodotto",
  //  action: "switchDestinatarioMail_Negozi{0}",
  //  label: "click pulsante per contattare negozi"
  //};

  //eventi["prodotto_form_manufacturer"] = {
  //  category: "prodotto",
  //  action: "switchDestinatarioMail_Manu{0}",
  //  label: "click pulsante per contattare Manu"
  //};

  eventi["prodotto_open_gallery"] = {
    category: "prodotto",
    action: "product_gallery_open{0}",
    label: "click apertura gallery immagini alternative"
  };

  eventi["prodotto_view_image"] = {
    category: "prodotto",
    action: "product_view_image{0}",
    label: "click apertura gallery immagini alternative"
  };

  eventi["prodotto_to_ManuReccomandation_link"] = {
    category: "prodotto",
    action: "product_recc_manu{0}",
    label: "click su link per pagina catalogo"
  };


	// Produttori
  eventi["produttore_visit"] = {
    category: "produttore",
    action: "visit_{0}",
    label: "visita al sito produttore"
  };
	
	// click ai social (distinti) - visite a <social>
	eventi["produttore_social"] = {
    category: "produttore",
    action: "social_{0}_{1}",
    label: "click a pulsanti social"
  };
	
  eventi["produttore_write"] = {
    category: "produttore",
    action: "write_{0}",
    label: "mail al produttore"
  };
	
  eventi["produttore_downloadPDF"] = {
    category: "produttore",
    action: "downloadPDF_{0}_{1}",
    label: "pdf catalogo scaricato"
  };

  // click al pulsante produttore sponsor
  eventi["produttore_butsponsor"] = {
    category: "produttore",
    action: "butsponsor_{0}",
    label: "click al pulsante produttore sponsor"
  };


  // Architetti
  eventi["professional_write"] = {
    category: "professional",
    action: "write_{0}",
    label: "mail al professional"
  };

  eventi["professional_visit"] = {
    category: "professional",
    action: "visit_{0}",
    label: "visita al sito del professional"
  };

  //// click ai bottoni sponsor
  //eventi["produttore_bottone_click"] = {
  //  category: "produttore",
  //  action: "bottone_click_{0}",
  //  label: "click al Bottone"
  //};

  //// impression dei bottoni sponsor
  //eventi["produttore_bottone_impression"] = {
  //  category: "produttore",
  //  action: "bottone_impression_{0}",
  //  label: "impression del Bottone"
  //};

	
	// Altro
  eventi["spazi"] = {
    category: "spazi",
    action: "click_{0}_{1}",
    label: "click ai pulsanti spazi"
  };
	
  eventi["extralink"] = {	// piazzato a mano dal redattore nelle description
    category: "extralink",
    action: "extralink_{0}",
    label: "click a link esterno inserito manualmente"
  };
    // Landing Page - Occasioni
  eventi["landingpage_occasioni"] = {
      category: "landingpage",
      action: "click_tutte_occasioni",
      label: "Landing Page click a tutte le occasioni"
  };
  eventi["landingpage_occasione"] = {
      category: "landingpage",
      action: "click_occasione",
      label: "Landing Page click singola occasione"
  };
  //DFP refresh counter
  eventi["dfp_count_refresh"] = {
    category: "dfp",
    action: "count_refresh",
    label: "Numero di refresh di dfp in pagina"
  };

  // Authentication
  eventi["authentication_popup_show"] = {
    category: "authentication",
    action: "popup_show",
    label: "Visualizzazione Popup di autenticazione"
  };
  eventi["authentication_popup_close"] = {
    category: "authentication",
    action: "popup_close",
    label: "Chiusura Popup di autenticazione"
  };
  eventi["authentication_fb_login_button"] = {
    category: "authentication",
    action: "fb_login_button",
    label: "Click pulsante login con Facebook"
  };
  eventi["authentication_classic_login_button"] = {
    category: "authentication",
    action: "classic_login_button",
    label: "Click pulsante accedi MyDesignbest"
  };
  eventi["authentication_registration_button"] = {
    category: "authentication",
    action: "registration_button",
    label: "Click pulsante registrazione MyDesignbest"
  };
  eventi["authentication_fb_login_success"] = {
    category: "authentication",
    action: "fb_login_success",
    label: "Login tramite Facebook"
  };
  eventi["authentication_classic_login_success"] = {
    category: "authentication",
    action: "classic_login_success",
    label: "Login tramite MyDesignbest"
  };
  eventi["authentication_registration_success"] = {
    category: "authentication",
    action: "registration_success",
    label: "Registrazione MyDesignbest"
  };
	
	/************ /VERSIONE DESKTOP **********/
	/*****************************************/
	
	
	/*****************************************/
	/************ VERSIONE MOBILE  ***********/
  eventi["negozio_mobile_call"] = {
    category: "negozio_mobile",
    action: "call_{0}",
    label: "chiamata al negozio"
  };
    
  eventi["negozio_mobile_call_proletario"] = {
      category: "negozio_mobile",
      action: "call_proletario_{0}_{1}",
      label: "chiamata al negozio proletario"
  };

  //eventi["negozio_mobile_write"] = {
  //  category: "negozio_mobile",
  //  action: "write_{0}",
  //  label: "mail al negozio"
  //};

  eventi["negozio_mobile_goto"] = {
    category: "negozio_mobile",
    action: "goto_{0}",
    label: "navigazione satellitare verso il negozio"
  };

  //eventi["negozio_mobile_visit"] = {
  //  category: "negozio_mobile",
  //  action: "visit_{0}",
  //  label: "visita al sito negozio"
  //};
	
  //eventi["produttore_mobile_write"] = {
  //  category: "produttore_mobile",
  //  action: "write_{0}",
  //  label: "mail al produttore"
  //};
	/*********** /VERSIONE MOBILE  ***********/
	/*****************************************/

	/** Aggiunge un evento custom che si aggiunge o sostituisce uno di quelli di default */
	this.addEvent = function(eventKey, _category, _action, _label) {
		eventi[eventKey] = {
			category: _category,
			action: _action,
			label: _label
		};
	}

  /** Traccia uno degli eventi predefiniti. Nel caso in cui Analytics sia incluso dopo questo script questa
  funzione necessariamente deve essere chiamata dentro ad un $.ready() */
  this.track = function (key) {
    var args = Array.prototype.slice.call(arguments, 1);	// elimino il primo argomento (key)
    if (typeof ga !== 'undefined') {  // se _gaq non esiste ancora non faccio niente.
      var tracciamento = eventi[key];
      ga('send', 'event', tracciamento.category, tracciamento.action.format(args), tracciamento.label);
    }
    console.log(eventi[key].action.format(args));
  }
	
	/** Traccia uno degli eventi predefiniti */
  this.test = function (key) {
		var args = Array.prototype.slice.call(arguments, 1);	// elimino il primo argomento (key)
    var tracciamento = eventi[key];
		console.log(tracciamento.action.format(args));
  }
}
;
/// <reference path="../jquery/jquery-2.2.0.js" />
/// <reference path="../bootstrap/bootstrap.js" />

/**
WMModals v1.0 del 31/03/2016

Contiene le funzioni per chiamare il form dei contatti da qualsiasi pagina.
E' predisposto per altri tipi di contenuto (si basa su un container e un refresh url).
DIPENDENZE: jquery, bootstrap

Perché funzioni è necessario che in pagina sia presente la struttura del Modale Bootstrap (nascosta in fondo al body).
Il div wrapper del Modale (bootstrapModalId) deve disporre del data attribute data-ajax-url con il link per la action che restituisce
la vista parziale del form in ajax.
*/
function WMModals(bootstrapModalId) {

  var $modal = $("#" + bootstrapModalId);
  var refreshUrl = $("#" + bootstrapModalId).attr("data-ajax-url");

  /** Carica da server e mostra in finestra modale il form per i contatti verso negozio */
  this.shopFormModal = function (shopId) {
    modalFormAjaxRequest(shopId, "ShopC");
  }

  /** Carica da server e mostra in finestra modale il form per i contatti verso negozio */
  this.shopAndProductFormModal = function (shopId, productId) {
    modalFormAjaxRequest(shopId, "ShopA", productId);
  }

  /** Carica da server e mostra in finestra modale il form per i contatti verso negozio */
  this.shopAndProductBFormModal = function (shopId, productId) {
    modalFormAjaxRequest(shopId, "ShopB", productId);
  }

  /** Carica da server e mostra in finestra modale il form per i contatti verso negozio */
  this.shopOutletFormModal = function (shopId) {
    modalFormAjaxRequest(shopId, "ShopD");
  }

  /** Carica da server e mostra in finestra modale il form per i contatti verso produttore */
  this.manufacturerAndProductFormModal = function (manufacturerId, productId) {
    modalFormAjaxRequest(manufacturerId, "ManufacturerA", productId);
  }

  /** Carica da server e mostra in finestra modale il form per i contatti verso produttore */
  this.manufacturerFormModal = function (manufacturerId) {
    modalFormAjaxRequest(manufacturerId, "ManufacturerB");
  }

  /** Carica da server e mostra in finestra modale il form per i contatti verso professional autore progetto */
  this.projAuthorFormModal = function (authorId) {
    modalFormAjaxRequest(authorId, "ProjectAuthor");
  }


  /** Esegue la vera e propria chiamata ajax. Unico metodo centralizzato. */
  function modalFormAjaxRequest(id, type, productId) {
    $.ajax({
      type: "GET",
      url: refreshUrl + "?mailType=" + type + "&recipient=" + id + (productId == null ? "" : "&productId=" + productId),
      dataType: "html",
      success: function (html) {
        $modal.find("form #ModalContent").html(html);

        /* Gestione lista checkbox */
        $openCheckbox = $modal.find("form [data-control='contactForm_checkOpenTextArea']"); // prendo la check che apre la textarea di scrittura libera
        if ($openCheckbox.length > 0) { // se esiste
          $textWrapper = $modal.find($openCheckbox.data("target")).hide();  // nascondo il testo libero
          $openCheckbox.unbind(); // tolgo qualsiasi precedente evento
          $openCheckbox.change(function () {  // aggiungo la funzione di change per visualizzare la casella di testo libero
            if ($(this).is(":checked")) {
              $textWrapper.slideDown();
              $textWrapper.find("textarea").prop("required", true); // ora diventa obbligatorio
            }
            else {
              $textWrapper.slideUp();
              $textWrapper.find("textarea").prop("required", false);  // ora non più obbligatorio
            }
          });
        }
        /* /Gestione lista checkbox */

        $modal.find("form [name='link']").val(location.href); // metto il link attuale, altrimenti la chiamata ajax restituisce quello della vista parziale

        $modal.modal("toggle");
      },
      error: errorLog
    });
  }

  /** Chiamata in caso di errore, notifica all'utente che si è verificato un errore e a console mette i dettagli */
  var errorLog = function (jqXHR, textStatus, errorThrown) {
    alert("Si e' verificato un errore");
    console.log(jqXHR);
    console.log(textStatus);
    console.log(errorThrown);
    //window.location.reload(true);
  }
}
;
var userConnected = $.Deferred();

function DesignbestUser(properties) {
  $.extend({
    GUID: 0,
    FacebookID: null,
    Name: null,
    FirstName: null,
    LastName: null,
    Username: null,
    Email: null,
    Gender: null,
    PictureUrl: null,
    Link: null,
    Locale: null,
    AccessToken:null
  }, properties);

  this.GUID = properties.GUID;
  this.FacebookID = properties.FacebookID;
  this.Name = properties.Name;
  this.FirstName = properties.FirstName;
  this.LastName = properties.LastName;
  this.Username = properties.Username;
  this.Email = properties.Email;
  this.Gender = properties.Gender;
  this.PictureUrl = properties.PictureUrl;
  this.Link = properties.Link;
  this.Locale = properties.Locale;
  this.AccessToken = properties.AccessToken;
};;
/// <reference path="../jquery/js.cookie.js" />
/// <reference path="DesignbestUser.js"/>

/**
 * Classe che gestisce i profili loggati con FB.
 * @param {string} appId
 * @param {string} culture cultura nel formato it_IT , en_GB ecc...
 * @param {function} statusCallback
 * @param {array} params description
 * @returns {undefined}
 */
function DesignbestFacebook(appId, culture, statusCallback) {
  var facebookReady = false;  // indica se lo script Facebook è stato caricato correttamente
  var authCookieName = "__db_facebook_logged";
  var connectionStatus = $.Deferred();
  var _dbuser = null;

  if (!culture) { culture = "it_IT"; }

  // inizializzazione dell'SDK
  $.ajaxSetup({ cache: true });
  $.getScript("//connect.facebook.net/" + culture + "/sdk.js")
    .done(function (script, textStatus) {
      FB.init({
        appId: appId,
        version: "v2.10",
        cookie: true, // necessario per leggere accesstoken server-side
        status: false, // cerca di ottenere info sull'utente subito dopo l'inizializzazione
        xfbml: true // parsa i plugin in pagina
      });
      facebookReady = true;
      //FB.getLoginStatus(updateStatusCallback);
      FB.Event.subscribe("auth.logout", logout);
    })
    .fail(function (jqxhr, settings, exception) {
      facebookReady = false;
      console.log("No facebookscript");
      console.log(exception);
    });

  /**
   * La risposta json dell'sdk che indica se l'utente è loggato su FB.
   * @param {object} request
   * @returns {undefined}
   */
  function updateStatusCallback(request) {

    if (_dbuser !== null && _dbuser.FacebookID !== null) {  // già precedentemente loggato con FB
      connectionStatus.resolve();
      if (statusCallback !== undefined) statusCallback({ status: "connected", data: _dbuser });
    }
    else if (request.status === "connected") {
      var cookieValue = lastSessionFbId();
      var accessToken = request.authResponse.accessToken;

      if (cookieValue == "wantconnect") {
        getUserData(accessToken, statusCallback);
      }
      //else if (cookieValue == request.authResponse.userID) {
      //  getUserDataFromSession(accessToken, statusCallback);
      //}
      else {
        _clean();
        if (statusCallback != null) statusCallback({ status: "not connected" });
      }

    }
    else {
      if (statusCallback != null) statusCallback({ status: request.status });
    }
  };

  /**
  In presenza dell'authcookie restituisce il valore FbID dell'ultimo utente che si è loggato.
  */
  function lastSessionFbId() {
    return Cookies.get(authCookieName);
  };

  /**
  Setta l'authcookie con il valore FbID passato
  */
  function setLoginCookie(fbId) {
    var secondLevelDomain = (location.hostname.split(".")).slice(-2).join(".");
    Cookies.set(authCookieName, fbId, { expires: 360, path: "/", domain: secondLevelDomain });
  };

  /**
  Recupera i dati dell'utente richiedendoli a Facebook + una parte relativa a Magazine lato server (_getUserInfo())
  @param {string} accessToken L'access token ottenuto da request.authResponse.accessToken
  @param {function} callback La funzione di callback
  */
  function getUserData(accessToken, callback) {
    FB.api("/me?fields=name,first_name,last_name,email,link,gender,locale,picture{url}", function (response) {
      if (!response || response.error) {
        console.log("Facebook internal server error - Try later");
      } else {
        _dbuser = new DesignbestUser( {
          FacebookID: response.id,
          Name: response.name,
          FirstName: response.first_name,
          LastName: response.last_name,
          Username: response.email,
          Email: response.email,
          Gender: response.gender,
          PictureUrl: "//graph.facebook.com/" + response.id + "/picture", //response.picture.data.url,
          Link: response.link,
          Locale: response.locale,
          //PrivacyPolicyAccepted: false,
          AccessToken: accessToken
        });
        _getUserInfo(callback);
      }
    });
  };
  function _getUserInfo(callback) {
    $.ajax({
      type: "POST",
      url: "/registersession",
      data: _dbuser,
      dataType: "json",
      success: function (json) {
        if (json.status == "not logged") {
          _clean();
          if (callback != null) callback({ status: "not connected", errors: json.errors });
          return;
        }
        _dbuser = new DesignbestUser(json);
        setLoginCookie(_dbuser.FacebookID);
        connectionStatus.resolve();
        if (callback !== undefined) callback({ status: "connected", data: _dbuser });
      },
      error: errorLog
    });
  };

  /**
  Chiama manualmente il popup di login per FB settando i permessi standard + permesso per email
  */
  function login() {
    FB.login(function (response) {
      //console.log(response);
    }, { scope: "public_profile,email" });
  };

  /**
  Slogga l'utente lato client e lato server (distruggendo la sessione)
  */
  function logout(callback) {
    $.ajax({
      type: "POST",
      url: "/logout",
      dataType: "json",
      success: function (json) {
        _dbuser = null;
        _clean();
        if (callback != null && typeof callback === "function") callback();
      },
      error: errorLog
    });
  };

  /**
   Elimina cookie di sessione e setta lo stato di disconnessione.
   */
  function _clean() {
    connectionStatus = $.Deferred();
    Cookies.remove(authCookieName, { path: "/", domain: (location.hostname.split(".")).slice(-2).join(".") });
    _dbuser = null;
  };

  /**
  Chiamata in caso di errore, notifica all'utente che si è verificato un errore e a console mette i dettagli
  */
  function errorLog(jqXHR, textStatus, errorThrown) {
    console.log(jqXHR);
    console.log(textStatus);
    console.log(errorThrown);
  };


  /**
   * Chiama il popup di autenticazione di Facebook.
   */
  this.AskLogin = function() {
    FB.login(function (response) {
      if (response.status)
        _logUser();
      else if (statusCallback != null)
        statusCallback({ status: "not connected" });
    }, { scope: "public_profile,email" });
  };

  /**
  Metodo pubblico disponibile per refreshare il login status.
  */
  this.LogUser = function () {
    setLoginCookie("wantconnect");
    FB.getLoginStatus(updateStatusCallback);
  };
  var _logUser = this.LogUser;

  /**
  Log-out dell'utente
  */
  this.LogOutUser = function (callback) {
    logout(callback);
  };

  /**
  Restituisce l'utente loggato.
  */
  this.User = function () {
    return _dbuser ? _dbuser : null;
  };

  /**
  Una promise risolta se l'utente è loggato.
  */
  this.Logged = function () {
    return connectionStatus;
  };
}
;
/// <reference path="../jquery/jquery-2.2.0.js" />
/// <reference path="DesignbestUser.js"/>
/// <reference path="DesignbestFacebook.js"/>
/// <reference path="DesignbestWishList.js"/>

/**
 * Gestisce la login su Designbest che può avvenire via Facebook o Classic-login
 */
function DesignbestLoginManager() {
  /** promise relativa allo stato di login */
  var _userConnected = $.Deferred();
  /** Istanza di DesignbestUser */
  var _dbuser = null;
  /** Istanza di DesignbestFacebook */
  var _facebook;

  /**
   * Cambia l'interfaccia in modo da settare la modalità utente loggato.
   */
  function setLoggedUser() {
    if (_dbuser !== null) {
      if ($("#facebookModal").is(':visible'))
        $("#facebookModal").modal("hide");

      $("[data-loginlabel='unlogged']").addClass("hidden");
      $("[data-loginlabel='logged']").removeClass("hidden");
      if (_dbuser.PictureUrl) {
        $("#logarea [data-loginlabel='logged'] .logged, #mobilelogarea > [data-loginlabel='logged'] > img:first").attr("src", _dbuser.PictureUrl);
        $("#logarea [data-loginlabel='logged'] .logged, #mobilelogarea > [data-loginlabel='logged'] > img:first").addClass("logged");
      }
      //$("#logarea, .login-status").attr("href", $("#fb-root").data("wishlistlink"));
      $("#logarea, .login-status").attr("href", "javascript: wishlist.OpenWishlistPopup()");
      $("#wishlistpanel").addClass("wishvisible");

      wishlist.ParseDocument();
      // registro l'utente su Analytics
      if (typeof ga !== 'undefined') { ga('set', 'dimension1', _dbuser.GUID); }


      /* HeartBeat per fare in modo che la sessione non scada mai */
      setInterval(function () {
        $.ajax({
          type: "GET",
          url: "/designbest/it/www/Auth/HeartBeat",
          dataType: "text",
          success: function (data) {
            console.log(data);
          },
          error: function () { }
        });
      }, 30000);

    }
  }

  /**
   * Disconnette l'utente e massacra la sessione lato server
   * @param {function} callback
   */
  function logout(callback) {
    $.ajax({
      type: "GET",
      url: "/it/auth/LogOut",
      dataType: "json",
      success: function (json) {
        _dbuser = null;
        _userConnected = $.Deferred();
        if (callback != null && typeof callback === "function") callback();
      },
      error: errorLog
    });
  };

  /**
   * Mostra un errore generico all'interno del popup quando qualche chiamata lato server va in errore.
   */
  function displayInternalError() {
    // In caso di errore da Magazine
    if ($("#facebookModal").is(':visible')) {
      var $divWrap = $(document.createElement("div"));
      $divWrap.addClass("text-center fbloginbutton");

      var $refreshBut = $(document.createElement("button"));
      $refreshBut.text($("#facebookModal").attr("data-errorbutton"));
      $refreshBut.addClass("fbloginbutton");
      $refreshBut.click(function () {
        location.reload(true);
      });
      $divWrap.append($refreshBut);
      $("#facebookModal .modal-content > .modal-body").empty();
      $("#facebookModal .modal-content > .modal-body").append('<div class="text-center">' + $("#facebookModal").attr("data-errormessage") + '</div>');
      $("#facebookModal .modal-content > .modal-body").append($divWrap);
    }
  }

  /**
   * Mostra una loading gif nel contenitore del selettore specificato.
   * @param {any} selector
   */
  function setFormSpin(selector) {
    $(selector).prepend("<div class=\"loadingSpin\"><div class='uil-spin-css' style='-webkit-transform:scale(0.3)'><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div></div></div>");
  }

  /**
   * Rimuove tutte le ajax loading gif precedentemente sistemate in pagina.
   */
  function removeFormSpin() {
    $(".loadingSpin").remove();
  }

  /**
   * Restituisce i valori della query string della pagina
   * @param {any} name Chiave della query string
   * @param {any} url Url da cui prendere query string, se non specificato usa window.location.href
   */
  function querystring(name, url) {
    if (!url) url = window.location.href;
    name = name.replace(/[\[\]]/g, "\\$&");
    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
      results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, " "));
  }

  /**
   * Mostra eventuale errore in console
   * @param {any} jqXHR
   * @param {any} textStatus
   * @param {any} errorThrown
   */
  function errorLog(jqXHR, textStatus, errorThrown) {
    console.log(textStatus);
    console.log(jqXHR);
  }

  // se nella query string c'è login allora apro il modale
  if (querystring("login")) {
    openModal('facebookModal');
  }

  // quando l'utente fa correttamente la login
  $.when(_userConnected).done(function () {
    setLoggedUser();
    // se l'utente è loggato elimina il prodotto pinnato pre-login dalla sessione
    $.ajax({type: "POST", url: "/wishlist/it/PinnedWhenNotRegistered", dataType: "json", success: function (json) { }, error: function (jqXHR, textStatus, errorThrown) { } });
  });

  // Cerco se nella sessione c'è già un utente loggato
  $.ajax({
    type: "GET",
    url: "/it/auth/GetUser",
    dataType: "json",
    success: function (json) {
      if (json.status != "not logged") {
        _dbuser = new DesignbestUser(json);
        if (_dbuser.GUID == undefined) throw "username con GUID mancante";
        _userConnected.resolve(_dbuser);
      }
    },
    error: errorLog
  });

  // Cerco nella sessione se prima del login/registrazione era stato pinnato un prodotto
  $.ajax({
    type: "GET",
    url: "/wishlist/it/PinnedWhenNotRegistered",
    dataType: "json",
    success: function (json) {
      if (json !== null && json.success) {
        wishlist.PinProduct(json.productId);
      }
    },
    error: errorLog
  });

  // logout events
  $("[data-logout='logout']").click(function (e) {
    e.preventDefault();
    logout(function () {
      location.reload();
    });
  });

  // Classic Login
  $("#classiclogin > button.classicloginbutton").click(function () {
    tracker.track('authentication_classic_login_button');  // traccio click al pulsante accedi a MyDesignbest
    var notvalid = null;
    $("#classiclogin > input").each(function (index, element) {
      if (!(element.checkValidity())) {
        notvalid = element;
        return false; // ferma il ciclo
      }
    });

    if (notvalid !== null) notvalid.reportValidity();
    else {
      setFormSpin('#facebookModal .fblogin');
      $.ajax({
        type: "POST",
        url: "/designbest/it/www/Auth/RequestLogin",
        data: { username: $("#classiclogin > input[name='username']").val(), password: $("#classiclogin > input[name='password']").val() },
        dataType: "json",
        success: function (json) {
          if (json.success) {
            _dbuser = new DesignbestUser(json.data);
            _userConnected.resolve(_dbuser);
            tracker.track('authentication_classic_login_success');  // traccio login classico avvenuto con successo
          }
          else {
            removeFormSpin();
            $("#facebookModal .error").html(json.error);
          }
        },
        error: function (jqXHR, textStatus, errorThrown) {
          displayInternalError();
        }
      });
    }
  });
  $("#classiclogin > input").keydown(function (e) {
    if (e.which === 13) $("#classiclogin > button.classicloginbutton").trigger("click");
  });
  // /Classic Login

  // Facebook Login
  _facebook = new DesignbestFacebook($("#fb-root").attr("data-appid"), $("#fb-root").attr("data-scriptculture"), function (req) {
    if (req.status === "connected" && req.data !== null) {
      _dbuser = new DesignbestUser(req.data);
      _userConnected.resolve(_dbuser);
      tracker.track('authentication_fb_login_success'); // traccio login facebook avvenuto con successo
    } else {
      removeFormSpin(); // rimuovo lo spinner di caricamento
      if (req.errors != null && req.errors.length > 0) {
        $("#facebookModal .error").text("");  // pulisco la lavagna degli errori
        for (var i = 0; i < req.errors.length; i++) // scrivo gli errori nel divo apposito
          $("#facebookModal .error").append(req.errors[i] + "<br/>\n");
      }
      
    }
  });
  // /FacebookLogin



  // METODI PUBBLICI

  /**
  * Restituisce un oggetto DesignbestUser fillato o null se l'utente non è loggato
  */
  this.User = function () {
    return _dbuser;
  }

  /**
  * Chiama il popup di Facebook per il login
  */
  this.AskFBLogin = function () {
    tracker.track('authentication_fb_login_button'); // traccio click ad accedi FB
    _facebook.AskLogin();
    setFormSpin('#facebookModal .fblogin');
  }

};
/// <reference path="DesignbestUser.js"/>

/**
Gestisce una singola Wishlist di un utente.
@param {string} servicePath Url principale per le chiamate REST
@param {function} pinWhenNotLoggedEvent Chiamata in caso di Pin quando l'utente non è loggato. Dovrebbe aprire un popup di login.
*/
function DesignbestWishList(pinWhenNotLoggedEvent) {

  /** ID della Wishlist */
  var wishlistID = 0;
  /** È un array di Wishlist */
  var wishproducts = [];

  /** Contiene l'id prodotto pinnato prima di essere loggati */
  var pinqueue = null;  // quando viene pinnato un cuore ma non si è loggati, salvo qui l'id
  /** Indica se il modale è aperto */
  var modalOpened = false;

  /** Timeout di discesa del pannello wishlist. */
  var timeoutVar = null;
  /** Altezza di partenza del pannello wishlist (per ripristinare dopo l'animazione) */
  var initiaPanelHeight = 48;

  var _animationClosing = true;

  /**
  Chiama $.ajax() estendendo i parametri con eventuali configurazioni personalizzate definite nella
  variabile globale ajaxExtraOptions
  */
  function _ajax(params) {
    if (typeof ajaxExtraOptions !== "undefined") {
      $.extend(params, ajaxExtraOptions);
    }
    $.ajax(params);
  }

  /**
  Aggiunge il prodotto specificato all'utente lato dati
  */
  function pin(productId, callback) {
    if (lm.User() != null) {
      var params = { productID: productId, wishlistID: wishlistID ? wishlistID : 0 }
      _ajax({
        type: "POST",
        url: "/wishlist/it/PinProduct",
        //url: "http://localhost:55605/api/WishlistPinProduct",
        dataType: "json",
        data: params,
        crossDomain: true,
        success: function (json) {
          console.log(json);
          animatePanel(productId);
          if (typeof callback !== "undefined") callback(json);
        },
        error: errorLog
      });
    }
    else pinqueue = productId;
  };

  /**
  Toglie il prodotto specificato all'utente lato dati
  */
  function unpin(productId, callback) {
    if(lm.User() != null) {
      var params = { productID: productId, wishlistID: wishlistID ? wishlistID : 0 }
      _ajax({
        type: "POST",
        url: "/wishlist/it/UnPinProduct",
        //url: "http://localhost:55605/api/WishlistUnPinProduct",
        dataType: "json",
        data: params,
        crossDomain: true,
        success: function (json) {
          console.log(json);
          if (typeof callback !== "undefined") callback(json);
        },
        error: errorLog
      });
    }
  };

  /**
  Recupera gli id della Wishlist dell'utente (se loggato) e filla l'array wishproducts
  */
  function _getWishProducts(callback) {
    if (lm.User() != null) {
      var params = { userID: lm.User().GUID };
      _ajax({
        type: "GET",
        url: "/wishlist/it/AllProductIds",
        dataType: "json",
        data: params,
        crossDomain: true,
        success: function (json) {
          console.log(json.products);
          wishlistID = json.wishlistID;
          wishproducts = json.products;
          if (wishproducts == null) wishproducts = [];
          if (typeof callback !== "undefined") callback(json);
        },
        error: errorLog
      });
    }
  };


  /**
  Cerca tutti gli elementi con data-wishproductid e ci aggiunge la classe wishlistin se questo
  è all'interno dell'array wishproducts
  */
  function _showWishProducts() {
    $("[data-wishproductid]").each(function (index, element) {
      var productId = $(element).data("wishproductid");
      if (productId !== null && $.inArray(productId, wishproducts) !== -1 && !$(element).hasClass("wishlistin"))
        $(element).addClass("wishlistin");
    });
  };


  /**
  Assegna l'evento di toggle a tutti gli elementi che hanno data-wishproductid
  @param {string} parentSelector Opzionale, specifica un wrapper si si vuole parsare solo una parte e non tutto il documento
  */
  function _attachEvents(parentSelector) {
    // evento di apertura del modale
    $('#wishlistModal').on('shown.bs.modal', function (e) {
      $("#wishlistpanel").removeClass("wishvisible");  // nasconde il pannello wishlist
    });
    // evento di chiusura del modale
    $('#wishlistModal').on('hidden.bs.modal', function (e) {
      modalOpened = false;
      $("#wishlistpanel").addClass("wishvisible");  // mostra il pannello wishlist
      initiaPanelHeight = $("#wishlistpanel").outerHeight();
    });
    if (parentSelector == null) parentSelector = "";
    $(parentSelector + " [data-wishproductid]").unbind("click");  // per evitare doppi eventi
    $(parentSelector + " [data-wishproductid]").click(function (e) {
      var wishElement = $(this);
      var productId = $(this).data("wishproductid");
      if (productId !== null) {
        if ($.inArray(productId, wishproducts) !== -1) {  // UNPIN
          unpin(productId, function (e) {
            wishElement.removeClass("wishlistin");
            wishproducts = $.grep(wishproducts, function (value) {  // rimuovo l'elemento dall'array
              return value != productId;
            });
          });
        } else {  // PIN
          if (lm.User() == null && pinWhenNotLoggedEvent !== undefined) pinWhenNotLoggedEvent(productId);
          pin(productId, function (e) {
            wishElement.addClass("wishlistin");
            if (wishlistID == 0) wishlistID = e.wishlistID; // creata nuova wishlist
            wishproducts.push(productId);
          });
        }
      }
    }).children().click(function (e) {  // importante! Altrimenti il "vai alla wishlist" si prendeva l'unpin
      e.stopPropagation();
    });
  }
  _attachEvents();  // assegno gli eventi ai pulsanti (necessario, assegna eventi ai bottoni anche se non si è loggati)
  _showWishProducts(); // coloro il cuore di ogni prodotto in lista

  /**
  Chiamata in caso di errore, notifica all'utente che si è verificato un errore e a console mette i dettagli
  */
  function errorLog(jqXHR, textStatus, errorThrown) {
    console.log(jqXHR);
    console.log(textStatus);
    console.log(errorThrown);
  };

  /**
  Aggiorna la wishlist dell'utente, aggiunge eventuali prodotti in coda (pinnati prima di loggarsi) e infine colora i cuori
  corrispondenti (se presenti).
  */
  this.ParseDocument = function (parentSelector) {
    if (lm.User() != null) {
      _getWishProducts(function () {   // aggiorno la lista dei prodotti in wishlist

        if (pinqueue !== null) {  // evidenzio il cuore eventualmente pinnato quando non si era loggati
          pin(pinqueue, function () {
            $("[data-wishproductid='" + pinqueue + "']").addClass("wishlistin");
            wishproducts.push(pinqueue);
            pinqueue = null;
          });
        }

        if (parentSelector == null) parentSelector = "";
        _attachEvents(parentSelector);  // assegno gli eventi ai pulsanti
        _showWishProducts(); // coloro il cuore di ogni prodotto in lista
      });
    }
    else {  // se sloggato tolgo tutti i cuori colorati
      $(".wishlistin").removeClass("wishlistin");
    }
  };

  /**
  Apre il modale che mostra i prodotti in wishlist.
  */
  this.OpenWishlistPopup = function () {
    if (lm.User() != null && !modalOpened) {
      modalOpened = true;
      _ajax({
        cache: false,
        type: "GET",
        url: "/wishlist/it/WishlistPopup?products=" + escape(wishproducts.join(",")),
        dataType: "html",
        success: function (html) {
          //console.log(html);
          if ($("#wishlistModal").length == 0) $("body").append(html);
          else $("#wishlistModal").replaceWith(html);
          $("#wishlistModal").modal("show");
          _attachEvents("#wishlistModal");  // assegno gli eventi ai pulsanti
          _showWishProducts(); // coloro il cuore di ogni prodotto in lista
        },
        error: errorLog
      });
    }
  };


  this.PinProduct = function (productId, callback) {
    pin(productId, callback);
  };


  this.UnpinProduct = function (productId, callback) {
    unpin(productId, callback);
  };


  this.UnpinProductAndRemove = function (productId, $elementToDelete) {
    unpin(productId, function () {
      $("[data-wishproductid='" + productId + "']").removeClass("wishlistin");
      wishproducts = $.grep(wishproducts, function (value) {  // rimuovo l'elemento dall'array
        return value != productId;
      });
      $elementToDelete.remove();
      if (wishproducts.length == 0) $("#wishlistModal").modal('hide');
    });
  };


  function animatePanel(productId) {
    $whishPanel = $("#wishlistpanel");

    _ajax({
      cache: false,
      type: "GET",
      url: "/wishlist/it/ShortProductInfo?productId=" + productId,
      dataType: "json",
      success: function (json) {
        if (json.success) {
          $.when(_animationClosing).done(function () {
            var image = $(document.createElement("img"));
            image.attr("src", json.smallImage);
            image.attr("alt", json.name);

            var prodInfoDiv = $(document.createElement("div"));
            prodInfoDiv.append(image);
            prodInfoDiv.append("<div class=\"elName\">" + json.name + " - " + json.manufacturer + "</div>");

            $whishPanel.children(".addedProduct").append(prodInfoDiv);

            var heightIncrement = $whishPanel.children(".addedProduct").children("div").last().outerHeight();

            $whishPanel.animate({
              height: "+=" + heightIncrement
            }, 500, function () {
              clearTimeout(timeoutVar);
              timeoutVar = setTimeout(function () {

                // INIZIO sezione critica - Non possono iniziare altre animazioni prima
                _animationClosing = $.Deferred();
                $whishPanel.animate({
                  height: initiaPanelHeight + "px"
                }, 1500, 'swing', function () {
                  $(this).children(".addedProduct").empty();
                  _animationClosing.resolve();
                });
                // FINE sezione critica

              }, 1500);
            });
          });
        }
        else {

        }
      },
      error: errorLog
    });

  }
}
;
/// <reference path="../jquery/jquery-2.2.0.js" />
/// <reference path="../jquery/js.cookie.js" />
/// <reference path="CookiePolicy.js" />
/// <reference path="DesignbestUser.js"/>
/// <reference path="DesignbestFacebook.js"/>
/// <reference path="DesignbestWishList.js"/>

/** Tracker per gli eventi custom analytics */
var tracker;

/** Istanza di DesignbestWishList */
var wishlist;

/** Istanza di DesignbestLoginManager */
var loginManager;


$(function () {

  tracker = new WM_AnalyticsTracking(); // inizializzo il tracker analytics

  $("#cookie-bar").CookieBar(location.hostname.split('.').slice(1).join('.'), function () {
    // callback dell'accettazione
  });


  /*ELIO*/
  $('input[type="checkbox"]').click(function () {
    if ($(this).attr("id") == "AltreInfo") {
      $(".altreinfo").toggle();
    }
  });
  $('#carousel-project').carousel({
    interval: false
  });
  $('#carousel-outlet').carousel({
    interval: false
  });

  function setOccPic(imgClass) {
    var containerHeight = $('#carousel-outlet').height();
    var img = $('.active ' + imgClass);
    var isVertical = img.width() < img.height();
    if (isVertical && ($(window).width() > 768)) {
      img.css("margin-left", "20%");
    }
  }

  /*##-- Fix per banner e sitcky menu  --##*/
  //if ($('.home').length == 1) {
  //  if ($('.banner-cont').children().is(':visible')) {
  //    $('#megaMenu').attr('data-offset-top', 250);
  //    $('.banner-cont').attr('style','padding:15px 0')
  //  } 
  //}
  //$('#shopsFormR .row input[type="checkbox"]').change(function () {
  //  console.log("controlo");
  //  var conta = $('#shopsFormR .row input:checkbox:checked').length
  //  console.log(conta);
  //  if (conta > 1) {
  //    $('#CheckContainer').val(true);
  //    console.log($('#CheckContainer').val());
  //  }
  //}
  //);
  $('#orderOutlet li a span').click(function () {
    Cookies.set("OutletListingOrder", $(this).data("order"), { expires: 360, path: "/", domain: location.hostname });
    location.reload();
  });
  if (Cookies.get("OutletListingOrder") != null) {
    ordinamente = Cookies.get("OutletListingOrder");
    titoloOrdint = $('#orderOutlet li a span[data-order=' + ordinamente + ']').text();
    $('#titleOrderOutlet').text(titoloOrdint);
  }
  var altezzaMenu = $('.mobile-swipe-controllers').offset()
  $('.scrollDowmMenu').click(function () {
    if ($('.mobile-swipe-controllers').hasClass('open')){
      $('.mobile-swipe-controllers').animate({
        'bottom': "-2.7em",'top':altezzaMenu.top
      }, function () {
        $('.mobile-swipe-controllers').removeClass('open');
        $('.scrollDowmMenu').scrollTop(0);
        }
    );

    }else{
      $('.mobile-swipe-controllers').animate({
        'top': "0"}, function() {
          $('.mobile-swipe-controllers').addClass('open');
        }
    );
    }
  });

  /*GIOCHINI CON URL E PAGEVIEW***/
  data = document.URL;
  $('.bigphoto-overlay-product .slick-slider button').click(function () {
    mustTrack = (data.indexOf('/p-') > 0 || data.indexOf('/spn-') > 0);
    if (mustTrack) {
      count = $('.slick-active').attr('data-slick-index');
      if ($('.prodpage').attr('data-shop') == 'True') {
        if (data.indexOf('/spn-') !== -1)
          history.replaceState({}, document.title, data.replace('/spn-', '/spng-') + "-" + count);
      } else {
        if (data.indexOf('/p-') !== -1)
          history.replaceState({}, document.title, data.replace('/p-', '/pg-') + "-" + count);
      }
      console.log(location.pathname);
      if (typeof ga !== 'undefined' && (data.indexOf('/p-') > 0 || data.indexOf('/spn-') > 0)) {  // se _gaq non esiste ancora non faccio niente.
        ga('send', 'pageview', location.pathname);
      }
    }
  });

  $('.bigslider-product .overlay-cta.prod, .bigslider-product .product-zoom').click(function () {
    mustTrack = (data.indexOf('/p-') > 0 || data.indexOf('/spn-') > 0);
    count = $('.slick-current').attr('data-slick-index');
    if (mustTrack) {
      if ($('.prodpage').attr('data-shop') == 'True') {
        history.replaceState({}, document.title, data.replace('/spn-', '/spng-') + "-" + count);
      } else {
        history.replaceState({}, document.title, data.replace('/p-', '/pg-') + "-" + count);
      }
      if (typeof ga !== 'undefined') {  // se _gaq non esiste ancora non faccio niente.
        ga('send', 'pageview', location.pathname);
      }
    }
  });

  $('.bigphoto-overlay-product .slick-slider').on('beforeChange', function (event, slick, currentSlide, nextSlide) {
    mustTrack = (data.indexOf('/p-') > 0 || data.indexOf('/spn-') > 0);
    if (mustTrack) {
      if ($('.prodpage').attr('data-shop') == 'True') {
        if (data.indexOf('/spn-') !== -1)
          history.replaceState({}, document.title, data.replace('/spn-', '/spng-') + "-" + nextSlide);
      } else {
        if (data.indexOf('/p-') !== -1)
          history.replaceState({}, document.title, data.replace('/p-', '/pg-') + "-" + nextSlide);
      }
      if (typeof ga !== 'undefined' && (data.indexOf('/p-') > 0 || data.indexOf('/spn-') > 0)) {  // se _gaq non esiste ancora non faccio niente.
        ga('send', 'pageview', location.pathname);
      }
    }
  });

  $('.close-ic_overlay').click(function(){
    history.replaceState({}, document.title, data);
    //$('.slider-lightbox').slick('unslick');
  });

  // LOGIN + WISHLIST
  lm = new DesignbestLoginManager();
  wishlist = new DesignbestWishList(function (productId) {
    // specifica cosa succede facendo un pin quando non si è loggati
    $.ajax({
      type: "GET",
      url: "/wishlist/it/PinProductInSession?productID=" + productId,
      dataType: "text",
      success: function (data) {
        console.log("ELIMINATO");
        console.log(data);
      },
      error: function () { }
    });
    openModal("facebookModal");
  });
  // /LOGIN + WISHLIST
});


function openModal(id) {
  tracker.track('authentication_popup_show'); // traccio apertura popup
  $("#" + id).modal("show");
}


function assignFormEvents($openCheckbox) {
  $openCheckbox.change(function () {  // aggiungo la funzione di change per visualizzare la casella di testo libero
    $textWrapper = $($(this).data("target"));
    if ($(this).is(":checked")) {
      $textWrapper.slideDown();
      $textWrapper.find("textarea").prop("required", true); // ora diventa obbligatorio
    }
    else {
      $textWrapper.slideUp();
      $textWrapper.find("textarea").prop("required", false);  // ora non più obbligatorio
    }
  });
}

function getFormSpin(selector) {
  $(selector).prepend("<div class=\"loadingSpin\"><div class='uil-spin-css' style='-webkit-transform:scale(0.3)'><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div></div></div>");
}

/**** PROGETTI -*****/
function setProjPic (imgClass) {
  var containerHeight = $('#carousel-project').height();
  var img = $('.active ' + imgClass);
  var isVertical = img.width() < img.height();
  if (isVertical && ($(window).width() > 768)) {
    if (($(window).width() > 768) && ($(window).width() <= 1440)) {
      img.css("margin-left", "0%");
    } else{
      img.css("margin-left", "20%");
    }
  }
}
function setPicprojVinc(image, imagecontainer) {
  var startCss = {
    "margin-left": image.css("margin-left"),
    "width": "initial",
    "height": "initial"
  };
  image.css(startCss);
  var containerW = imagecontainer.width();
  if (containerW / imagecontainer.height() < image.width() / image.height()) {
    image.css({ height: "100%", width: "auto" });
  } else {
    image.css({ width: "100%", height: "auto" });
  }
}

function showMorePicDesc(id) {
  var descriptions = $('.active .pic-desc');
  var maxHeight = 288;
  if ($(window).width() < 1366 && $(window).width() > 768) {
    maxHeight = 140;
  }
  descriptions.each(function (item) {
    var div = $(this);
    var desc = div.text();
    if (div.height() > maxHeight) {
      div.innerHeight(maxHeight);
      div.after("<div class='showPicDesc descClosed' data-toggle=\"modal\" data-target=\"desc-modal-" + id + "\">" + $("#stringaDesc").text() + "</div>");
    }
  });
};

function showMoreProfessionalDesc() {
  var transition = {
    duration: 1000
  };
  var description = $('#professional-description');
  var initHeight = description.height();
  var maxHeight = 145;
  if (initHeight > maxHeight) {
    description.height(maxHeight);
    description.after("<div class='showProfDesc text-capitalize descClosed'>" + $("#stringaDesc").text() + "</div>");
  }
  $('.showProfDesc').click(function () {
    if ($(this).hasClass('descClosed')) {
      description.animate({
        height: initHeight
      }, 1000, function () {
        $('.showProfDesc').text($("#stringaDescOpen").text())
      });
      $(this).removeClass('descClosed');
    } else {
      description.animate({
        height: maxHeight,
      }, 1000, function () {
        $('.showProfDesc').text($("#stringaDesc").text())
      });
      $(this).addClass('descClosed');
    }
  });

};

function showModalDesc(text, modal,characters) {
  var description = $(text);
  var initHeight = description.height();
  var maxHeight = 288;
  var stringLength = description.text().length;
  if ($(window).width() < 1366 && $(window).width() > 768) {
    maxHeight = 140;
  }
  if (stringLength > characters) {
    var trimmedText = description.text().substring(0, characters);
    //description.height(maxHeight);
    //description.innerHeight(maxHeight);
    description.text(trimmedText + " ...");
    description.after("<div class=\'" + modal +" descClosed showPicDesc' data-toggle=\"modal\" data-target=\"desc-modal\">" + $("#stringaDesc").text() + "</div>");
    $("." + modal).click(function (e) {
      e.preventDefault();
      $('#desc-modal').modal({ backdrop: false });
      $('#desc-modal').modal('show');
    });

  }

}

function setCarouselNavTexts(currentIndex, totalItems) {
  var nextpic = parseInt(currentIndex) + 1;
  var prevpic = parseInt(currentIndex) - 1;

  if (currentIndex == totalItems) {
    nextpic = 1;
  }

  $('.numPicPrev').html(prevpic + '/' + parseInt(totalItems - 1) + '');
  $('.numPicNext').html(nextpic + '/' + parseInt(totalItems - 1) + '');

  if (prevpic == 0) {
    $('.numPicPrev').parents("[data-slide='prev']").hide();
  } else {
    $('.numPicPrev').parents("[data-slide='prev']").show();
  }
  if (nextpic >= totalItems) {
    $('.numPicNext').css('visibility', 'hidden');
    $('.numPicNext').siblings().css('visibility', 'hidden');
  } else {
    $('.numPicNext').css('visibility', 'visible');
    $('.numPicNext').siblings().css('visibility', 'visible');
  }
};

function apriDropdownFigli(e, reg) {
  e.preventDefault();
  $('#child-' + reg).siblings('a').toggleClass('showing-children');
  $('#child-' + reg).toggle();
  $('.link-children').not('#child-' + reg).hide();
  $('.link-children').not('#child-' + reg).siblings('a').removeClass('showing-children');

}

$(function () {
  showMoreProfessionalDesc();
  $('#closeProject').click(function () {
    window.close();
  });
  var totalItems = parseInt($('#carousel-project .item').length);
  if (totalItems == 1) {
    $('#carousel-project .carousel-control').hide();
  }
  var currentIndex = $('div.item.active').attr("data-gallery-index");
  showMorePicDesc(currentIndex);

  setCarouselNavTexts(currentIndex, totalItems);

  $('#carousel-project').on('slid.bs.carousel', function () {
    currentIndex = $('div.item.active').attr("data-gallery-index");

    setCarouselNavTexts(currentIndex, totalItems);

    showMorePicDesc(currentIndex);
    $(".showPicDesc").click(function (e) {
      e.preventDefault();
      $('#desc-modal-' + currentIndex).modal({ backdrop: false });
      $('#desc-modal-' + currentIndex).modal('show');
    });
  });
  showMorePicDesc(currentIndex);
  $(".showPicDesc").click(function (e) {
    e.preventDefault();
    $('#desc-modal-' + currentIndex).modal({backdrop:false});
    $('#desc-modal-' + currentIndex).modal('show');
  });

  $('#carousel-project .padre').swipe(function (e) {
    if (e.swipeRight) {
      $('#carousel-project').carousel('prev');
    } else if (e.swipeLeft) {
      $('#carousel-project').carousel('next');
    }
  });

  $('#carousel-auth-relatedpost .item a').swipe(function (e) {
    if (e.swipeRight) {
      //$('#carousel-auth-relatedpost').carousel('prev');
    } else if (e.swipeLeft) {
      //$('#carousel-auth-relatedpost').carousel('next');
    }
  });

  /** Menu a panino **/
  $('.navbar-toggle-sandwich').unbind('click');
  $('.navbar-toggle-sandwich').click(function (e) {
    e.preventDefault();
    if ($(this).hasClass("open")) {
      $(this).removeClass("open");
    } else {
      $(this).addClass("open");
    }
    if ($('.sandwiched .menu-container').hasClass("open")) {
      $('.sandwiched .menu-container').removeClass("open");
      $('.sandwiched .menu-container').hide();
    } else {
      $('.sandwiched .menu-container').addClass("open");
      $('.sandwiched .menu-container').show();
    }

  });

  /** Top Bar menu **/
  $("#topPageNavContainer .sub-menu-topBar").click(function (e) {
    e.preventDefault();
    var id = $(this).attr('id');
    //$('#' + id +'_topNavSubMenu').toggle();
    //$('#' + id + '_topNavSubMenu').css("right", "0");
    $('#' + id + '_topNavSubMenu').toggleClass('open');
    $('#' + id + '_topNavSubMenu').siblings('.submenu-project.top-bar').hide();
    $('#' + id + '_topNavSubMenu').siblings('.submenu-project.top-bar').removeClass('open');

  });

  $(".exitmenu.topBar").click(function () {
    $('.submenu-project.top-bar').hide();
    $(".submenu-project.top-bar").siblings().find(".sub-topBarMenu").removeClass('open');
  });
  /* SCROLL PER ANCORA */
  $(".scroll").click(function (event) {
    event.preventDefault();
    //calculate destination place
    var dest = 0;
    if ($(this.hash).offset().top > $(document).height() - $(window).height()) {
      dest = $(document).height() - $(window).height();
    } else {
      dest = $(this.hash).offset().top;
    }
    //go to destination
    $('html,body').animate({ scrollTop: dest }, 1000, 'swing');
  });

});
;
jQuery(function () {
  var openedPopup = false;
  var popupsNames = $('[data-type="popup"]')         // find spans with ID attribute
    .map(function () { return $(this).attr('data-namepopup'); }) // convert to set of IDs
    .get();

  var refs = ['internicasa', 'webmobili', 'tavolaregalo', 'designbest', 'icdemo', 'wmdemo', 'trdemo', 'dbdemocom'];
  var referrer = document.referrer.split('.')[1];
  if (jQuery.inArray("Wishlist", popupsNames) !== -1) {
    var popup = new WhishlistPopup(jQuery('#PopupAlertWishlistContainer'));
    if (document.referrer.match('campaign') == "campaign") {
      console.log(referrer);
      return;
    } else {
      popup.CheckAndDo();   
    }
    if (jQuery('#PopupAlertWishlistContainer').hasClass('active')) {
      openedPopup = true;
    }
  }

  if (jQuery.inArray("Magazine", popupsNames) !== -1) {
    var popupM = new MagazinePopup(jQuery('#PopupAlertMagazineContainer'));
    if (document.referrer.match('campaign') == "campaign") {
      console.log(referrer);
      return;
    } else {
      if (!openedPopup) {
        popupM.CheckAndDo();
      }
    }  
  }
});
;
var MagazinePopup = function ($popup) {
  if ($popup == null || $popup.lenght == 0) {
    throw "Empty popup";
    return false;
  }
  var theThis = this;
  var scrolled = false;
  var dominioPopup = location.hostname.split('.').slice(1).join('.');
  var maxPageViews = 2;
  var expireDays = 2


  // evento di chiusura al bottone
  $popup.find("button.close").click(function () {
    theThis.Close();
  });

  // evento di chiusura allo scroll
  $(window).bind("scroll.magazinepopup", function (event) {
    if (scrolled) return;
    scrollPosition = $(this).scrollTop();
    if (scrollPosition >= 50) {
      // chiudo il pannello 2 secondi dopo lo scroll
      setTimeout(function () {
        theThis.Close();
        $(this).unbind(".magazinepopup"); // autoelimino l'evento
      }, 2000);
    }
  });

  this.Show = function () {
    $popup.addClass("active");
  };

  this.Hide = function () {
    $popup.removeClass("active");
  };

  this.Close = function () {
    theThis.Hide();
  };

  this.GetCookieMagazinePageViews = function (c) {
    return c.pageViews;
  };

  this.SetCookieMagazinePageViews = function (mp) {
    setCookie({ pageViews: mp - 1});
  };

  /**** NUOVO COOKIE CON VISIBILITA a seconda delle pagine viste ******/
  /**
  Setta il cookie strutturato così
    { pageViews: <int val> }
  Se pageViews è maxPageViews allora setta un expire di expireDays giorni.
  */
  var setCookie = function (cookieObj) {
    if (cookieObj.pageViews >= maxPageViews)
      Cookies.get('WM_MagazinePopup', JSON.stringify(cookieObj), { expires: expireDays, path: '/', domain: dominioPopup });
    else
      Cookies.set('WM_MagazinePopup', JSON.stringify(cookieObj), { path: '/', domain: dominioPopup });
  }

  /**
  Restituisce il cookie come oggetto json
  */
  var getCookie = function () {
    var rit = Cookies.get('WM_MagazinePopup');
    return (rit != undefined) ? JSON.parse(rit) : rit;
  }

  this.CheckAndDo = function (forceHide = false) {
    var cookie = getCookie();
    if (cookie == undefined) {
      if (maxPageViews == 0) {
        if (!forceHide) {
          this.Show();
        }
      };  // caso particolare di settaggio di maxPageViews = 1
      setCookie({ pageViews: 2 });
    }
    else {
      if (cookie.pageViews == maxPageViews) {
        if (!forceHide) {
          this.Show();
        }

      }// se siamo alla maxPageViews-esima pagina vista faccio partire il popup
       
      cookie.pageViews++; // incremento pageViews
      setCookie(cookie);
    }
  }
};;
var WhishlistPopup = function ($popup) {
  var dominioPopup = location.hostname.split('.').slice(1).join('.');
  var maxPageViews = 1;
  var expireDays = 2

  var theThis = this;
  var scrolled = false;
  var showed = false;
  // evento di chiusura al bottone
  $popup.find("button.close").click(function () {
    theThis.Close();
  });

  // evento di chiusura allo scroll
  $(window).bind("scroll.whishlistpopup", function (event) {
    if (scrolled) return;
    scrollPosition = $(this).scrollTop();
    if (scrollPosition >= 50) {
      // chiudo il pannello 2 secondi dopo lo scroll
      setTimeout(function () {
        theThis.Close();
        $(this).unbind(".whishlistpopup"); // autoelimino l'evento
      }, 2000);
    }
  });

  this.Show = function () {
    $popup.addClass("active");
  };

  this.Hide = function () {
    $popup.removeClass("active");
  };

  this.Close = function () {
    theThis.Hide();
  };

  var setCookie = function (cookieObj) {
    if (cookieObj.pageViews >= maxPageViews)
      Cookies.get('WM_WhishlistPopup', JSON.stringify(cookieObj), { path: '/', domain: dominioPopup });
    else
      Cookies.set('WM_WhishlistPopup', JSON.stringify(cookieObj), { path: '/', domain: dominioPopup });
  }

  /**
Restituisce il cookie come oggetto json
*/
  var getCookie = function () {
    var rit = Cookies.get('WM_WhishlistPopup');
    return (rit != undefined) ? JSON.parse(rit) : rit;
  }

  this.CheckAndDo = function (forceHide = false) {
    var cookie = getCookie();
    if (cookie == undefined ) {
      this.Show();
      setCookie({ pageViews: 1 });
      return true;
    }
    else {
      if (cookie.pageViews == 0){
        this.Show();
      }
      setCookie(cookie);
    }
    return false;
  }


};
;
