PageSourceSearch

https://www.campaignmonitor.com/wp-content/themes/cm-theme/assets/js/resources-hub.con.js?ver=415

js campaignmonitor.com collected 2026-10-01 07:56:01 UTC 565,985 bytes, 11,389 lines download raw bytes

vendor: 4,182 bytes, lines 1-2
1/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
2!function(a,b){"use strict";"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){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.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||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},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?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;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(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;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;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=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*ne
vendor: 18,228 bytes, line 2
2w Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(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 qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.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),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},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(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),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){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(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("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.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?I(k,a)-I(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?I(k,a)-I(k,b):0;if(e===f)return la(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?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$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 ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.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},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.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=ga.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=ga.selectors={cacheLength:50,createPseudo:ia,match:V,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(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===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]||ga.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]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.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(_,aa).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("(^|"+K+")"+a+"("+K+"|$)"))&&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=ga.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(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},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()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(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:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).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:oa(!1),disabled:oa(!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 X.test(a.nodeName)},input:function(a){return W.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:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?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]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.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=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[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?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(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 va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(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?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(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}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(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]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>
vendor: 64,249 bytes, lines 2-4
22&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.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 r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=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){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.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||b||(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};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,N,e),g(f,c,O,e)):(f++,j.call(a,g(f,c,N,e),g(f,c,O,e),g(f,c,N,c.notifyWith))):(d!==N&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),
3a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;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},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(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[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.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=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.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 W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.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=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=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};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.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 ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ga[d]=e,e)}function ia(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=W.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&da(d)&&(e[f]=ha(d))):"none"!==c&&(e[f]="none",W.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ia(this,!0)},hide:function(){return ia(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){da(this)?r(this).show():r(this).hide()})}});var ja=/^(?:checkbox|radio)$/i,ka=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={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,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c<d;c++)W.set(a[c],"globalEval",!b||W.get(b[c],"globalEval"))}var pa=/<|&#?\w+;/;function qa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(pa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ka.exec(f)||["",""])[1].toLowerCase(),i=ma[h]||ma._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.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),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(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)ya(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=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,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),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==xa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===xa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&B(this,"input"))return this.click(),!1},_default:function(a){return B(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?va:wa,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:wa,isPropagationStopped:wa,isImmediatePropagationStopped:wa,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=va,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=va,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=va,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&sa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ta.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return ya(this,a,b,c,d)},one:function(a,b,c,d){return ya(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(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=wa),this.each(function(){r.event.remove(this,a,c,b)})}});var za=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/<script|<style|<link/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,Ca=/^true\/(.*)/,Da=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}X.hasData(a)&&(h=X.access(a),i=r.extend({},h),X.set(b,i))}}function Ia(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ja.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ja(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,na(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ga),l=0;l<i;l++)j=h[l],la.test(j.type||"")&&!W.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Da,""),k))}return a}function Ka(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(na(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&oa(na(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(za,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d<e;d++)Ia(f[d],g[d]);if(b)if(c)for(f=f||na(a),g=g||na(h),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);else Ha(a,h);return g=na(h,"script"),g.length>0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.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 Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(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&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(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&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(na(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ja(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(na(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var La=/^margin/,Ma=new RegExp("^("+aa+")(?!px)[a-z%]+$","i"),Na=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",ra.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,ra.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Oa(a,b,c){var d,e,f,g,h=a.style;return c=c||Na(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ma.test(g)&&La.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 Pa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Qa=/^(none|table(?!-c[ea]).+)/,Ra=/^--/,Sa={position:"absolute",visibility:"hidden",display:"block"},Ta={letterSpacing:"0",fontWeight:"400"},Ua=["Webkit","Moz","ms"],Va=d.createElement("div").style;function Wa(a){if(a in Va)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ua.length;while(c--)if(a=Ua[c]+b,a in Va)return a}function Xa(a){var b=r.cssProps[a];return b||(b=r.cssProps[a]=Wa(a)||a),b}function Ya(a,b,c){var d=ba.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Za(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ca[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ca[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ca[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ca[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ca[f]+"Width",!0,e)));return g}function $a(a,b,c){var d,e=Na(a),f=Oa(a,b,e),g="border-box"===r.css(a,"boxSizing",!1,e);return Ma.test(f)?f:(d=g&&(o.boxSizingReliable()||f===a.style[b]),"auto"===f&&(f=a["offset"+b[0].toUpperCase()+b.slice(1)]),f=parseFloat(f)||0,f+Za(a,b,c||(g?"border":"content"),d,e)+"px")}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Oa(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=r.camelCase(b),i=Ra.test(b),j=a.style;return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:j[b]:(f=typeof c,"string"===f&&(e=ba.exec(c))&&e[1]&&(c=fa(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(j[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i?j.setProperty(b,c):j[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b),i=Ra.test(b);return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Oa(a,b,d)),"normal"===e&&b in Ta&&(e=Ta[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Qa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?$a(a,b,d):ea(a,Sa,function(){return $a(a,b,d)})},set:function(a,c,d){var e,f=d&&Na(a),g=d&&Za(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=ba.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ya(a,c,g)}}}),r.cssHooks.marginLeft=Pa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Oa(a,"marginLeft"))||a.getBoundingClientRect().left-ea(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ca[d]+b]=f[d]||f[d-2]||f[0];return e}},La.test(a)||(r.cssHooks[a+b].set=Ya)}),r.fn.extend({css:function(a,b){return T(this,function(a,b,c){var d,e,f={},g=0;if(Array.isArray(b)){for(d=Na(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.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):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.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=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&da(a),q=W.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],cb.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=W.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ia([a],!0),j=a.style.display||j,k=r.css(a,"display"),ia([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=W.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ia([a],!0),m.done(function(){p||ia([a]),W.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=hb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],Array.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.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 kb(a,b,c){var d,e,f=0,g=kb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=ab||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(i||h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:ab||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.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;c<d;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(jb(k,j.opts.specialEasing);f<g;f++)if(d=kb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,hb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j}r.Animation=r.extend(kb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return fa(c.elem,a,ba.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(L);for(var c,d=0,e=a.length;d<e;d++)c=a[d],kb.tweeners[c]=kb.tweeners[c]||[],kb.tweeners[c].unshift(b)},prefilters:[ib],prefilter:function(a,b){b?kb.prefilters.unshift(a):kb.prefilters.push(a)}}),r.speed=function(a,b,c){var d=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off?d.duration=0:"number"!=typeof d.duration&&(d.duration in r.fx.speeds?d.duration=r.fx.speeds[d.duration]:d.duration=r.fx.speeds._default),null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){r.isFunction(d.old)&&d.old.call(this),d.queue&&r.dequeue(this,d.queue)},d},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(da).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=kb(this,r.extend({},a),f);(e||W.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=r.timers,g=W.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&db.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||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=W.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.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;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),r.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(ab=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),ab=void 0},r.fx.timer=function(a){r.timers.push(a),r.fx.start()},r.fx.interval=13,r.fx.start=function(){bb||(bb=!0,eb())},r.fx.stop=function(){bb=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.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",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var lb,mb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.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=r.find.attr(a,b),
4null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.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=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(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):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.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||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.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 Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.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 Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(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}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(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}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,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":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),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,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(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 r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{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(Rb[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()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.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 r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<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 Tb=[],Ub=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Tb.pop()||r.expando+"_"+ub++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ub.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ub.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ub,"$1"+e):b.jsonp!==!1&&(b.url+=(vb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.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?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Tb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=pb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.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),r.isFunction(b)&&(b=b.call(a,c,r.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)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),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)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.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)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Vb=a.jQuery,Wb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Wb),b&&a.jQuery===r&&(a.jQuery=Vb),r},b||(a.jQuery=a.$=r),r});
5
6(function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s=e.sessionStorage,s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ (++e)+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}
6:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getL
6ocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()})(window)
7/*
8 * jQuery One Page Nav Plugin
9 * http://github.com/davist11/jQuery-One-Page-Nav
10 *
11 * Copyright (c) 2010 Trevor Davis (http://trevordavis.net)
12 * Dual licensed under the MIT and GPL licenses.
13 * Uses the same license as jQuery, see:
14 * http://jquery.org/license
15 *
16 * @version 3.0.0
17 *
18 * Example usage:
19 * $('#nav').onePageNav({
20 *   currentClass: 'current',
21 *   changeHash: false,
22 *   scrollSpeed: 750
23 * });
24 */
25
26;(function($, window, document, undefined){
27
28	// our plugin constructor
29	var OnePageNav = function(elem, options){
30		this.elem = elem;
31		this.$elem = $(elem);
32		this.options = options;
33		this.metadata = this.$elem.data('plugin-options');
34		this.$win = $(window);
35		this.sections = {};
36		this.didScroll = false;
37		this.$doc = $(document);
38		this.docHeight = this.$doc.height();
39	};
40
41	// the plugin prototype
42	OnePageNav.prototype = {
43		defaults: {
44			navItems: 'a',
45			currentClass: 'current',
46			changeHash: true,
47			easing: 'swing',
48			filter: '',
49			scrollSpeed: 750,
50			scrollThreshold: 0.5,
51			begin: false,
52			end: false,
53			scrollChange: false,
54                        handleClick: true,
55                        handleClickFunc: false,
56                        offset: 0
57		},
58
59		init: function() {
60			// Introduce defaults that can be extended either
61			// globally or using an object literal.
62			this.config = $.extend({}, this.defaults, this.options, this.metadata);
63
64			this.$nav = this.$elem.find(this.config.navItems);
65
66			//Filter any links out of the nav
67			if(this.config.filter !== '') {
68				this.$nav = this.$nav.filter(this.config.filter);
69			}
70
71			//Handle clicks on the nav
72			this.$nav.on('click.onePageNav', $.proxy(this.handleClick, this));
73
74			//Get the section positions
75			this.getPositions();
76
77			//Handle scroll changes
78			this.bindInterval();
79
80			//Update the positions on resize too
81			this.$win.on('resize.onePageNav', $.proxy(this.getPositions, this));
82
83			return this;
84		},
85
86		adjustNav: function(self, $parent) {
87			self.$elem.find('.' + self.config.currentClass).removeClass(self.config.currentClass);
88			$parent.addClass(self.config.currentClass);
89		},
90
91		bindInterval: function() {
92			var self = this;
93			var docHeight;
94
95			self.$win.on('scroll.onePageNav', function() {
96				self.didScroll = true;
97			});
98
99			self.t = setInterval(function() {
100				docHeight = self.$doc.height();
101
102				//If it was scrolled
103				if(self.didScroll) {
104					self.didScroll = false;
105					self.scrollChange();
106				}
107
108				//If the document height changes
109				if(docHeight !== self.docHeight) {
110					self.docHeight = docHeight;
111					self.getPositions();
112				}
113			}, 250);
114		},
115
116		getHash: function($link) {
117			return $link.attr('href').split('#')[1];
118		},
119
120		getPositions: function() {
121			var self = this;
122			var linkHref;
123			var topPos;
124			var $target;
125
126			self.$nav.each(function() {
127				linkHref = self.getHash($(this));
128				$target = $('#' + linkHref);
129
130				if($target.length) {
131					topPos = $target.offset().top;
132					self.sections[linkHref] = Math.round(topPos);
133				}
134			});
135		},
136
137		getSection: function(windowPos) {
138			var returnValue = null;
139			var windowHeight = Math.round(this.$win.height() * this.config.scrollThreshold);
140
141			for(var section in this.sections) {
142				if((this.sections[section] - windowHeight) < windowPos) {
143					returnValue = section;
144				}
145			}
146
147			return returnValue;
148		},
149
150		handleClick: function(e) {
151			var self = this;
152			var $link = $(e.currentTarget);
153			var $parent = $link.parent();
154			var newLoc = '#' + self.getHash($link);
155
156			if(!$parent.hasClass(self.config.currentClass) && self.config.handleClick) {
157				//Start callback
158				if(self.config.begin) {
159					self.config.begin($parent);
160				}
161
162				//Change the highlighted nav item
163				self.adjustNav(self, $parent);
164
165				//Removing the auto-adjust on scroll
166				self.unbindInterval();
167
168				//Scroll to the correct position
169				self.scrollTo(newLoc, function() {
170					//Do we need to change the hash?
171					if(self.config.changeHash) {
172						window.location.hash = newLoc;
173					}
174
175					//Add the auto-adjust on scroll back in
176					self.bindInterval();
177
178					//End callback
179					if(self.config.end) {
180						self.config.end($parent);
181					}
182				});
183			}
184                        
185                        if (self.config.handleClickFunc) {
186                            self.config.handleClickFunc($parent, self.config);
187                        }
188
189			e.preventDefault();
190		},
191
192		scrollChange: function() {
193			var windowTop = this.$win.scrollTop();
194			var position = this.getSection(windowTop);
195			var $parent;
196
197			//If the position is set
198			if(position !== null) {
199				$parent = this.$elem.find('a[href$="#' + position + '"]').parent();
200
201				//If it's not already the current section
202				if(!$parent.hasClass(this.config.currentClass)) {
203					//Change the highlighted nav item
204					this.adjustNav(this, $parent);
205					//window.location.hash = position;
206					
207					//e.preventDefault();
208
209					//If there is a scrollChange callback
210					if(this.config.scrollChange) {
211						this.config.scrollChange($parent);
212					}
213				}
214			}
215			
216		},
217
218		scrollTo: function(target, callback) {
219			var offset = $(target).offset().top - this.config.offset;
220
221			$('html, body').animate({
222				scrollTop: offset
223			}, this.config.scrollSpeed, this.config.easing, callback);
224		},
225
226		unbindInterval: function() {
227			clearInterval(this.t);
228			this.$win.unbind('scroll.onePageNav');
229		}
230	};
231
232	OnePageNav.defaults = OnePageNav.prototype.defaults;
233
234	$.fn.onePageNav = function(options) {
235		return this.each(function() {
236			new OnePageNav(this, options).init();
237		});
238	};
239
240})( jQuery, window , document );
241/*! algoliasearch 3.7.5 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
242!function(e){var t;"undefined"!=typeof window?t=window:"undefined"!=typeof self&&(t=self),t.ALGOLIA_MIGRATION_LAYER=e()}(function(){return function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){function r(e,t){for(var n in t)e.setAttribute(n,t[n])}function o(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function i(e,t){e.onreadystatechange=function(){("complete"==this.readyState||"loaded"==this.readyState)&&(this.onreadystatechange=null,t(null,e))}}t.exports=function(e,t,n){var s=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof t&&(n=t,t={}),t=t||{},n=n||function(){},a.type=t.type||"text/javascript",a.charset=t.charset||"utf8",a.async="async"in t?!!t.async:!0,a.src=e,t.attrs&&r(a,t.attrs),t.text&&(a.text=""+t.text);var u="onload"in a?o:i;u(a,n),a.onload||o(a,n),s.appendChild(a)}},{}],2:[function(e,t,n){"use strict";function r(e){for(var t=new RegExp("cdn\\.jsdelivr\\.net/algoliasearch/latest/"+e.replace(".","\\.")+"(?:\\.min)?\\.js$"),n=document.getElementsByTagName("script"),r=!1,o=0,i=n.length;i>o;o++)if(n[o].src&&t.test(n[o].src)){r=!0;break}return r}t.exports=r},{}],3:[function(e,t,n){"use strict";function r(t){var n=e(1),r="//cdn.jsdelivr.net/algoliasearch/2/"+t+".min.js",i="-- AlgoliaSearch `latest` warning --\nWarning, you are using the `latest` version string from jsDelivr to load the AlgoliaSearch library.\
242nUsing `latest` is no more recommended, you should load //cdn.jsdelivr.net/algoliasearch/2/algoliasearch.min.js\n\nAlso, we updated the AlgoliaSearch JavaScript client to V3. If you want to upgrade,\nplease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch  `latest` warning --";window.console&&(window.console.warn?window.console.warn(i):window.console.log&&window.console.log(i));try{document.write("<script>window.ALGOLIA_SUPPORTS_DOCWRITE = true</script>"),window.ALGOLIA_SUPPORTS_DOCWRITE===!0?(document.write('<script src="'+r+'"></script>'),o("document.write")()):n(r,o("DOMElement"))}catch(s){n(r,o("DOMElement"))}}function o(e){return function(){var t="AlgoliaSearch: loaded V2 script using "+e;window.console&&window.console.log&&window.console.log(t)}}t.exports=r},{1:1}],4:[function(e,t,n){"use strict";function r(){var e="-- AlgoliaSearch V2 => V3 error --\nYou are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\nPlease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch V2 => V3 error --";window.AlgoliaSearch=function(){throw new Error(e)},window.AlgoliaSearchHelper=function(){throw new Error(e)},window.AlgoliaExplainResults=function(){throw new Error(e)}}t.exports=r},{}],5:[function(e,t,n){"use strict";function r(t){var n=e(2),r=e(3),o=e(4);n(t)?r(t):o()}r("algoliasearch")},{2:2,3:3,4:4}]},{},[5])(5)}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.algoliasearch=e()}}(function(){var e;return function t(e,n,r){function o(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(e){return"function"==typeof e}function i(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,i,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],a(n))return!1;if(o(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),u=1;r>u;u++)i[u-1]=arguments[u];n.apply(this,i)}else if(s(n)){for(r=arguments.length,i=new Array(r-1),u=1;r>u;u++)i[u-1]=arguments[u];for(c=n.slice(),r=c.length,u=0;r>u;u++)c[u].apply(this,i)}return!0},r.prototype.addListener=function(e,t){var n;if(!o(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,o(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned){var n;n=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!o(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,i,a;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,r=-1,n===t||o(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit
242("removeListener",e,t);else if(s(n)){for(a=i;a-->0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(0>r)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],o(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?o(e._events[t])?1:e._events[t].length:0}},{}],2:[function(e,t,n){function r(){l=!1,a.length?c=a.concat(c):f=-1,c.length&&o()}function o(){if(!l){var e=setTimeout(r);l=!0;for(var t=c.length;t;){for(a=c,c=[];++f<t;)a[f].run();f=-1,t=c.length}a=null,l=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function s(){}var a,u=t.exports={},c=[],l=!1,f=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new i(e,t)),1!==c.length||l||setTimeout(o,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=s,u.addListener=s,u.once=s,u.off=s,u.removeListener=s,u.removeAllListeners=s,u.emit=s,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],3:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,i){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;c>l;++l){var f,d,p,h,y=e[l].replace(a,"%20"),m=y.indexOf(n);m>=0?(f=y.substr(0,m),d=y.substr(m+1)):(f=y,d=""),p=decodeURIComponent(f),h=decodeURIComponent(d),r(s,p)?o(s[p])?s[p].push(h):s[p]=[s[p],h]:s[p]=h}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],4:[function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var o=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?r(s(e),function(s){var a=encodeURIComponent(o(s))+n;return i(e[s])?r(e[s],function(e){return a+encodeURIComponent(o(e))}).join(t):a+encodeURIComponent(o(e[s]))}).join(t):a?encodeURIComponent(o(a))+n+encodeURIComponent(o(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},{}],5:[function(e,t,n){"use strict";n.decode=n.parse=e(3),n.encode=n.stringify=e(4)},{3:3,4:4}],6:[function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0,i=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))}),e.splice(i,0,r),e}function i(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(t){}}function a(){var e;try{e=n.storage.debug}catch(t){}return e}function u(){try{return window.localStorage}catch(e){}}n=t.exports=e(7),n.log=i,n.formatArgs=o,n.save=s,n.load=a,n.useColors=r,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(a())},{7:7}],7:[function(e,t,n){function r(){return n.colors[l++%n.colors.length]}function o(e){function t(){}function o(){var e=o,t=+new Date,i=t-(c||t);e.diff=i,e.prev=c,e.curr=t,c=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=r());var s=Array.prototype.slice.call(arguments);s[0]=n.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;a++;var o=n.formatters[r];if("function"==typeof o){var i=s[a];t=o.call(e,i),s.splice(a,1),a--}return t}),"function"==typeof n.formatArgs&&(s=n.formatArgs.apply(e,s));var u=o.log||n.log||console.log.bind(console);u.apply(e,s)}t.enabled=!1,o.enabled=!0;var i=n.enabled(e)?o:t;return i.namespace=e,i}function i(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,o=0;r>o;o++)t[o]&&(e=t[o].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))}function s(){n.enable("")}function a(e){var t,r;for(t=0,r=n.skips.length;r>t;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;r>t;t++)if(n.names[t].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}n=t.exports=o,n.coerce=u,n.disable=s,n.enable=i,n.enabled=a,n.humanize=e(8),n.names=[],n.skips=[],n.formatters={};var c,l=0},{8:8}],8:[function(e,t,n){function r(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*f;case"days":case"day":case"d":return n*l;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=c?Math.round(e/c)+"h":e>=u?Math.round(e/u)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function i(e){return s(e,l,"day")||s(e,c,"hour")||s(e,u,"minute")||s(e,a,"second")||e+" ms"}function s(e,t,n){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var a=1e3,u=60*a,c=60*u,l=24*c,f=365.25*l;
vendor: 3,666 bytes, line 242
242t.exports=function(e,t){return t=t||{},"string"==typeof e?r(e):t["long"]?i(e):o(e)}},{}],9:[function(t,n,r){(function(r,o){(function(){"use strict";function i(e){return"function"==typeof e||"object"==typeof e&&null!==e}function s(e){return"function"==typeof e}function a(e){return"object"==typeof e&&null!==e}function u(e){G=e}function c(e){X=e}function l(){var e=r.nextTick,t=r.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(t)&&"0"===t[1]&&"10"===t[2]&&(e=setImmediate),function(){e(y)}}function f(){return function(){Q(y)}}function d(){var e=0,t=new Z(y),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function p(){var e=new MessageChannel;return e.port1.onmessage=y,function(){e.port2.postMessage(0)}}function h(){return function(){setTimeout(y,1)}}function y(){for(var e=0;W>e;e+=2){var t=ne[e],n=ne[e+1];t(n),ne[e]=void 0,ne[e+1]=void 0}W=0}function m(){try{var e=t,n=e("vertx");return Q=n.runOnLoop||n.runOnContext,f()}catch(r){return h()}}function v(){}function g(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function w(e){try{return e.then}catch(t){return se.error=t,se}}function x(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function _(e,t,n){X(function(e){var r=!1,o=x(n,t,function(n){r||(r=!0,t!==n?A(e,n):O(e,n))},function(t){r||(r=!0,k(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,k(e,o))},e)}function j(e,t){t._state===oe?O(e,t._result):t._state===ie?k(e,t._result):P(t,void 0,function(t){A(e,t)},function(t){k(e,t)})}function T(e,t){if(t.constructor===e.constructor)j(e,t);else{var n=w(t);n===se?k(e,se.error):void 0===n?O(e,t):s(n)?_(e,t,n):O(e,t)}}function A(e,t){e===t?k(e,g()):i(t)?T(e,t):O(e,t)}function S(e){e._onerror&&e._onerror(e._result),I(e)}function O(e,t){e._state===re&&(e._result=t,e._state=oe,0!==e._subscribers.length&&X(I,e))}function k(e,t){e._state===re&&(e._state=ie,e._result=t,X(S,e))}function P(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+oe]=n,o[i+ie]=r,0===i&&e._state&&X(I,e)}function I(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,o,i=e._result,s=0;s<t.length;s+=3)r=t[s],o=t[s+n],r?q(n,r,o,i):o(i);e._subscribers.length=0}}function R(){this.error=null}function E(e,t){try{return e(t)}catch(n){return ae.error=n,ae}}function q(e,t,n,r){var o,i,a,u,c=s(n);if(c){if(o=E(n,r),o===ae?(u=!0,i=o.error,o=null):a=!0,t===o)return void k(t,b())}else o=r,a=!0;t._state!==re||(c&&a?A(t,o):u?k(t,i):e===oe?O(t,o):e===ie&&k(t,o))}function U(e,t){try{t(function(t){A(e,t)},function(t){k(e,t)})}catch(n){k(e,n)}}function C(e,t){var n=this;n._instanceConstructor=e,n.promise=new e(v),n._validateInput(t)?(n._input=t,n.length=t.length,n._remaining=t.length,n._init(),0===n.length?O(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&O(n.promise,n._result))):k(n.promise,n._validationError())}function N(e){return new ue(this,e).promise}function L(e){function t(e){A(o,e)}function n(e){k(o,e)}var r=this,o=new r(v);if(!V(e))return k(o,new TypeError("You must pass an array to race.")),o;for(var i=e.length,s=0;o._state===re&&i>s;s++)P(r.resolve(e[s]),void 0,t,n);return o}function D(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(v);return A(n,e),n}function M(e){var t=this,n=new t(v);return k(n,e),n}function H(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object c
242onstructor cannot be called as a function.")}function B(e){this._id=pe++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==e&&(s(e)||H(),this instanceof B||F(),U(this,e))}function J(){var e;if("undefined"!=typeof o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(e.Promise=he)}var K;K=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var Q,G,$,V=K,W=0,X=({}.toString,function(e,t){ne[W]=e,ne[W+1]=t,W+=2,2===W&&(G?G(y):$())}),Y="undefined"!=typeof window?window:void 0,z=Y||{},Z=z.MutationObserver||z.WebKitMutationObserver,ee="undefined"!=typeof r&&"[object process]"==={}.toString.call(r),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ne=new Array(1e3);$=ee?l():Z?d():te?p():void 0===Y&&"function"==typeof t?m():h();var re=void 0,oe=1,ie=2,se=new R,ae=new R;C.prototype._validateInput=function(e){return V(e)},C.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},C.prototype._init=function(){this._result=new Array(this.length)};var ue=C;C.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,o=0;n._state===re&&t>o;o++)e._eachEntry(r[o],o)},C.prototype._eachEntry=function(e,t){var n=this,r=n._instanceConstructor;a(e)?e.constructor===r&&e._state!==re?(e._onerror=null,n._settledAt(e._state,t,e._result)):n._willSettleAt(r.resolve(e),t):(n._remaining--,n._result[t]=e)},C.prototype._settledAt=function(e,t,n){var r=this,o=r.promise;o._state===re&&(r._remaining--,e===ie?k(o,n):r._result[t]=n),0===r._remaining&&O(o,r._result)},C.prototype._willSettleAt=function(e,t){var n=this;P(e,void 0,function(e){n._settledAt(oe,t,e)},function(e){n._settledAt(ie,t,e)})};var ce=N,le=L,fe=D,de=M,pe=0,he=B;B.all=ce,B.race=le,B.resolve=fe,B.reject=de,B._setScheduler=u,B._setAsap=c,B._asap=X,B.prototype={constructor:B,then:function(e,t){var n=this,r=n._state;if(r===oe&&!e||r===ie&&!t)return this;var o=new this.constructor(v),i=n._result;if(r){var s=arguments[r-1];X(function(){q(r,o,s,i)})}else P(n,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var ye=J,me={Promise:he,polyfill:ye};"function"==typeof e&&e.amd?e(function(){return me}):"undefined"!=typeof n&&n.exports?n.exports=me:"undefined"!=typeof this&&(this.ES6Promise=me),ye()}).call(this)}).call(this,t(2),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],10:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],11:[function(e,t,n){var r=e(14),o=e(18),i=e(30),s=i(r,o);t.exports=s},{14:14,18:18,30:30}],12:[function(e,t,n){function r(e,t){if("function"!=typeof e)throw new TypeError(o);return t=i(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-t,0),s=Array(o);++r<o;)s[r]=n[t+r];switch(t){case 0:return e.call(this,s);case 1:return e.call(this,n[0],s);case 2:return e.call(this,n[0],n[1],s)}var a=Array(t+1);for(r=-1;++r<t;)a[r]=n[r];return a[t]=s,e.apply(this,a)}}var o="Expected a function",i=Math.max;t.exports=r},{}],13:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],14:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=r},{}],15:[function(e,t,n){function r(e,t){return null==t?e:o(t,i(t),e)}var o=e(17),i=e(55);t.exports=r},{17:17,55:55}],16:[function(e,t,n){function r(e,t,n,y,m,v,g){var w;if(n&&(w=m?n(e,y,m):n(e)),void 0!==w)return w;if(!p(e))return e;var x=f(e);if(x){if(w=u(e),!t)return o(e,w)}else{var j=M.call(e),T=j==b;if(j!=_&&j!=h&&(!T||m))return L[j]?c(e,j,t):m?e:{};if(d(e))return m?e:{};if(w=l(T?{}:e),!t)return s(w,e)}v||(v=[]),g||(g=[]);for(var A=v.length;A--;)if(v[A]==e)return g[A];return v.push(e),g.push(w),(x?i:a)(e,function(o,i){w[i]=r(o,t,n,i,e,v,g)}),w}var o=e(13),i=e(14),s=e(15),a=e(21),u=e(33),c=e(34),l=e(35),f=e(47),d=e(37),p=e(50),h="[object Arguments]",y="[object Array]",m="[object Boolean]",v="[object Date]",g="[object Error]",b="[object Function]",w="[object Map]",x="[object Number]",_="[object Object]",j="[object RegExp]",T="[object Set]",A="[object String]",S="[object WeakMap]",O="[object ArrayBuffer]",k="[object Float32Array]",P="[object Float64Array
242]",I="[object Int8Array]",R="[object Int16Array]",E="[object Int32Array]",q="[object Uint8Array]",U="[object Uint8ClampedArray]",C="[object Uint16Array]",N="[object Uint32Array]",L={};L[h]=L[y]=L[O]=L[m]=L[v]=L[k]=L[P]=L[I]=L[R]=L[E]=L[x]=L[_]=L[j]=L[A]=L[q]=L[U]=L[C]=L[N]=!0,L[g]=L[b]=L[w]=L[T]=L[S]=!1;var D=Object.prototype,M=D.toString;t.exports=r},{13:13,14:14,15:15,21:21,33:33,34:34,35:35,37:37,47:47,50:50}],17:[function(e,t,n){function r(e,t,n){n||(n={});for(var r=-1,o=t.length;++r<o;){var i=t[r];n[i]=e[i]}return n}t.exports=r},{}],18:[function(e,t,n){var r=e(21),o=e(28),i=o(r);t.exports=i},{21:21,28:28}],19:[function(e,t,n){var r=e(29),o=r();t.exports=o},{29:29}],20:[function(e,t,n){function r(e,t){return o(e,t,i)}var o=e(19),i=e(56);t.exports=r},{19:19,56:56}],21:[function(e,t,n){function r(e,t){return o(e,t,i)}var o=e(19),i=e(55);t.exports=r},{19:19,55:55}],22:[function(e,t,n){function r(e,t,n,d,p){if(!u(e))return e;var h=a(t)&&(s(t)||l(t)),y=h?void 0:f(t);return o(y||t,function(o,s){if(y&&(s=o,o=t[s]),c(o))d||(d=[]),p||(p=[]),i(e,t,s,r,n,d,p);else{var a=e[s],u=n?n(a,o,s,e,t):void 0,l=void 0===u;l&&(u=o),void 0===u&&(!h||s in e)||!l&&(u===u?u===a:a!==a)||(e[s]=u)}}),e}var o=e(14),i=e(23),s=e(47),a=e(36),u=e(50),c=e(41),l=e(53),f=e(55);t.exports=r},{14:14,23:23,36:36,41:41,47:47,50:50,53:53,55:55}],23:[function(e,t,n){function r(e,t,n,r,f,d,p){for(var h=d.length,y=t[n];h--;)if(d[h]==y)return void(e[n]=p[h]);var m=e[n],v=f?f(m,y,n,e,t):void 0,g=void 0===v;g&&(v=y,a(y)&&(s(y)||c(y))?v=s(m)?m:a(m)?o(m):[]:u(y)||i(y)?v=i(m)?l(m):u(m)?m:{}:g=!1),d.push(y),p.push(v),g?e[n]=r(v,y,f,d,p):(v===v?v!==m:m===m)&&(e[n]=v)}var o=e(13),i=e(46),s=e(47),a=e(36),u=e(51),c=e(53),l=e(54);t.exports=r},{13:13,36:36,46:46,47:47,51:51,53:53,54:54}],24:[function(e,t,n){function r(e){return function(t){return null==t?void 0:o(t)[e]}}var o=e(43);t.exports=r},{43:43}],25:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)return o;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,i){return e.call(t,n,r,o,i)};case 5:return function(n,r,o,i,s){return e.call(t,n,r,o,i,s)}}return function(){return e.apply(t,arguments)}}var o=e(59);t.exports=r},{59:59}],26:[function(e,t,n){(function(e){function n(e){var t=new r(e.byteLength),n=new o(t);return n.set(new o(e)),t}var r=e.ArrayBuffer,o=e.Uint8Array;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],27:[function(e,t,n){function r(e){return s(function(t,n){var r=-1,s=null==t?0:n.length,a=s>2?n[s-2]:void 0,u=s>2?n[2]:void 0,c=s>1?n[s-1]:void 0;for("function"==typeof a?(a=o(a,c,5),s-=2):(a="function"==typeof c?c:void 0,s-=a?1:0),u&&i(n[0],n[1],u)&&(a=3>s?void 0:a,s=1);++r<s;){var l=n[r];l&&e(t,l,a)}return t})}var o=e(25),i=e(39),s=e(12);t.exports=r},{12:12,25:25,39:39}],28:[function(e,t,n){function r(e,t){return function(n,r){var a=n?o(n):0;if(!i(a))return e(n,r);for(var u=t?a:-1,c=s(n);(t?u--:++u<a)&&r(c[u],u,c)!==!1;);return n}}var o=e(31),i=e(40),s=e(43);t.exports=r},{31:31,40:40,43:43}],29:[function(e,t,n){function r(e){return function(t,n,r){for(var i=o(t),s=r(t),a=s.length,u=e?a:-1;e?u--:++u<a;){var c=s[u];if(n(i[c],c,i)===!1)break}return t}}var o=e(43);t.exports=r},{43:43}],30:[function(e,t,n){function r(e,t){return function(n,r,s){return"function"==typeof r&&void 0===s&&i(n)?e(n,r):t(n,o(r,s,3))}}var o=e(25),i=e(47);t.exports=r},{25:25,47:47}],31:[function(e,t,n){var r=e(24),o=r("length");t.exports=o},{24:24}],32:[function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return o(n)?n:void 0}var o=e(49);t.exports=r},{49:49}],33:[function(e,t,n){function r(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&i.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var o=Object.prototype,i=o.hasOwnProperty;t.exports=r},{}],34:[function(e,t,n){(function(n){function r(e,t,n){var r=e.constructor;switch(t){case l:return o(e);case i:case s:return new r(+e);case f:case d:case p:case h:case y:case m:case v:case g:case b:r instanceof r&&(r=_[t]);var x=e.buffer;return new r(n?o(x):x,e.byteOffset,e.length);case a:case c:return new r(e);case u:var j=new r(e.source,w.exec(e));j.lastIndex=e.lastIndex}return j}var o=e(26),i="[object Boolean]",s="[object Date]",a="[object Number]",u="[object RegExp]",c="[object String]",l="[object ArrayBuffer]",f="[object Float32Array]",d="[object Float64Array
242]",p="[object Int8Array]",h="[object Int16Array]",y="[object Int32Array]",m="[object Uint8Array]",v="[object Uint8ClampedArray]",g="[object Uint16Array]",b="[object Uint32Array]",w=/\w*$/,x=n.Uint8Array,_={};_[f]=n.Float32Array,_[d]=n.Float64Array,_[p]=n.Int8Array,_[h]=n.Int16Array,_[y]=n.Int32Array,_[m]=x,_[v]=n.Uint8ClampedArray,_[g]=n.Uint16Array,_[b]=n.Uint32Array,t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{26:26}],35:[function(e,t,n){function r(e){var t=e.constructor;return"function"==typeof t&&t instanceof t||(t=Object),new t}t.exports=r},{}],36:[function(e,t,n){function r(e){return null!=e&&i(o(e))}var o=e(31),i=e(40);t.exports=r},{31:31,40:40}],37:[function(e,t,n){var r=function(){try{Object({toString:0}+"")}catch(e){return function(){return!1}}return function(e){return"function"!=typeof e.toString&&"string"==typeof(e+"")}}();t.exports=r},{}],38:[function(e,t,n){function r(e,t){return e="number"==typeof e||o.test(e)?+e:-1,t=null==t?i:t,e>-1&&e%1==0&&t>e}var o=/^\d+$/,i=9007199254740991;t.exports=r},{}],39:[function(e,t,n){function r(e,t,n){if(!s(n))return!1;var r=typeof t;if("number"==r?o(n)&&i(t,n.length):"string"==r&&t in n){var a=n[t];return e===e?e===a:a!==a}return!1}var o=e(36),i=e(38),s=e(50);t.exports=r},{36:36,38:38,50:50}],40:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&o>=e}var o=9007199254740991;t.exports=r},{}],41:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}t.exports=r},{}],42:[function(e,t,n){function r(e){for(var t=c(e),n=t.length,r=n&&e.length,l=!!r&&a(r)&&(i(e)||o(e)||u(e)),d=-1,p=[];++d<n;){var h=t[d];(l&&s(h,r)||f.call(e,h))&&p.push(h)}return p}var o=e(46),i=e(47),s=e(38),a=e(40),u=e(52),c=e(56),l=Object.prototype,f=l.hasOwnProperty;t.exports=r},{38:38,40:40,46:46,47:47,52:52,56:56}],43:[function(e,t,n){function r(e){if(s.unindexedChars&&i(e)){for(var t=-1,n=e.length,r=Object(e);++t<n;)r[t]=e.charAt(t);return r}return o(e)?e:Object(e)}var o=e(50),i=e(52),s=e(58);t.exports=r},{50:50,52:52,58:58}],44:[function(e,t,n){function r(e,t,n,r){return t&&"boolean"!=typeof t&&s(e,t,n)?t=!1:"function"==typeof t&&(r=n,n=t,t=!1),"function"==typeof n?o(e,t,i(n,r,1)):o(e,t)}var o=e(16),i=e(25),s=e(39);t.exports=r},{16:16,25:25,39:39}],45:[function(e,t,n){function r(e,t,n){return"function"==typeof t?o(e,!0,i(t,n,1)):o(e,!0)}var o=e(16),i=e(25);t.exports=r},{16:16,25:25}],46:[function(e,t,n){function r(e){return i(e)&&o(e)&&a.call(e,"callee")&&!u.call(e,"callee")}var o=e(36),i=e(41),s=Object.prototype,a=s.hasOwnProperty,u=s.propertyIsEnumerable;t.exports=r},{36:36,41:41}],47:[function(e,t,n){var r=e(32),o=e(40),i=e(41),s="[object Array]",a=Object.prototype,u=a.toString,c=r(Array,"isArray"),l=c||function(e){return i(e)&&o(e.length)&&u.call(e)==s};t.exports=l},{32:32,40:40,41:41}],48:[function(e,t,n){function r(e){return o(e)&&a.call(e)==i}var o=e(50),i="[object Function]",s=Object.prototype,a=s.toString;t.exports=r},{50:50}],49:[function(e,t,n){function r(e){return null==e?!1:o(e)?f.test(c.call(e)):s(e)&&(i(e)?f:a).test(e)}var o=e(48),i=e(37),s=e(41),a=/^\[object .+?Constructor\]$/,u=Object.prototype,c=Function.prototype.toString,l=u.hasOwnProperty,f=RegExp("^"+c.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{37:37,41:41,48:48}],50:[function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],51:[function(e,t,n){function r(e){var t;if(!a(e)||d.call(e)!=c||s(e)||i(e)||!f.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return u.ownLast?(o(e,function(e,t,r){return n=f.call(r,t),!1}),n!==!1):(o(e,function(e,t){n=t}),void 0===n||f.call(e,n))}var o=e(20),i=e(46),s=e(37),a=e(41),u=e(58),c="[object Object]",l=Object.prototype,f=l.hasOwnProperty,d=l.toString;t.exports=r},{20:20,37:37,41:41,46:46,58:58}],52:[function(e,t,n){function r(e){return"string"==typeof e||o(e)&&a.call(e)==i}var o=e(41),i="[object String]",s=Object.prototype,a=s.toString;t.exports=r},{41:41}],53:[function(e,t,n){function r(e){return i(e)&&o(e.length)&&!!P[R.call(e)]}var o=e(40),i=e(41),s="[object Arguments]",a="[object Array]",u="[object Boolean]",c="[object Date]",l="[object Error]",f="[object Function]",d="[object Map]",p="[object Number]",h="[object Object]",y="[object RegExp]",m="[object Set]",v="[object String]",g="[object WeakMap]",b="[object ArrayBuffer]",w="[object Float32Array]",x="[object Float64Array
242]",_="[object Int8Array]",j="[object Int16Array]",T="[object Int32Array]",A="[object Uint8Array]",S="[object Uint8ClampedArray]",O="[object Uint16Array]",k="[object Uint32Array]",P={};P[w]=P[x]=P[_]=P[j]=P[T]=P[A]=P[S]=P[O]=P[k]=!0,P[s]=P[a]=P[b]=P[u]=P[c]=P[l]=P[f]=P[d]=P[p]=P[h]=P[y]=P[m]=P[v]=P[g]=!1;var I=Object.prototype,R=I.toString;t.exports=r},{40:40,41:41}],54:[function(e,t,n){function r(e){return o(e,i(e))}var o=e(17),i=e(56);t.exports=r},{17:17,56:56}],55:[function(e,t,n){var r=e(32),o=e(36),i=e(50),s=e(42),a=e(58),u=r(Object,"keys"),c=u?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||("function"==typeof e?a.enumPrototypes:o(e))?s(e):i(e)?u(e):[];
243}:s;t.exports=c},{32:32,36:36,42:42,50:50,58:58}],56:[function(e,t,n){function r(e){if(null==e)return[];l(e)||(e=Object(e));var t=e.length;t=t&&c(t)&&(s(e)||i(e)||f(e))&&t||0;for(var n=e.constructor,r=-1,o=a(n)&&n.prototype||T,p=o===e,h=Array(t),y=t>0,v=d.enumErrorProps&&(e===j||e instanceof Error),g=d.enumPrototypes&&a(e);++r<t;)h[r]=r+"";for(var w in e)g&&"prototype"==w||v&&("message"==w||"name"==w)||y&&u(w,t)||"constructor"==w&&(p||!S.call(e,w))||h.push(w);if(d.nonEnumShadows&&e!==T){var P=e===A?x:e===j?m:O.call(e),I=k[P]||k[b];for(P==b&&(o=T),t=_.length;t--;){w=_[t];var R=I[w];p&&R||(R?!S.call(e,w):e[w]===o[w])||h.push(w)}}return h}var o=e(14),i=e(46),s=e(47),a=e(48),u=e(38),c=e(40),l=e(50),f=e(52),d=e(58),p="[object Array]",h="[object Boolean]",y="[object Date]",m="[object Error]",v="[object Function]",g="[object Number]",b="[object Object]",w="[object RegExp]",x="[object String]",_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],j=Error.prototype,T=Object.prototype,A=String.prototype,S=T.hasOwnProperty,O=T.toString,k={};k[p]=k[y]=k[g]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},k[h]=k[x]={constructor:!0,toString:!0,valueOf:!0},k[m]=k[v]=k[w]={constructor:!0,toString:!0},k[b]={constructor:!0},o(_,function(e){for(var t in k)if(S.call(k,t)){var n=k[t];n[e]=S.call(n,e)}}),t.exports=r},{14:14,38:38,40:40,46:46,47:47,48:48,50:50,52:52,58:58}],57:[function(e,t,n){var r=e(22),o=e(27),i=o(r);t.exports=i},{22:22,27:27}],58:[function(e,t,n){var r=Array.prototype,o=Error.prototype,i=Object.prototype,s=i.propertyIsEnumerable,a=r.splice,u={};!function(e){var t=function(){this.x=e},n={0:e,length:e},r=[];t.prototype={valueOf:e,y:e};for(var i in new t)r.push(i);u.enumErrorProps=s.call(o,"message")||s.call(o,"name"),u.enumPrototypes=s.call(t,"prototype"),u.nonEnumShadows=!/valueOf/.test(r),u.ownLast="x"!=r[0],u.spliceObjects=(a.call(n,0,1),!n[0]),u.unindexedChars="x"[0]+Object("x")[0]!="xx"}(1,0),t.exports=u},{}],59:[function(e,t,n){function r(e){return e}t.exports=r},{}],60:[function(e,t,n){(function(n){"use strict";function r(t,n,r){var s=e(6)("algoliasearch"),a=e(44),u=e(47),c="Usage: algoliasearch(applicationID, apiKey, opts)";if(!t)throw new f.AlgoliaSearchError("Please provide an application ID. "+c);if(!n)throw new f.AlgoliaSearchError("Please provide an API key. "+c);this.applicationID=t,this.apiKey=n;var l=[this.applicationID+"-1.algolianet.com",this.applicationID+"-2.algolianet.com",this.applicationID+"-3.algolianet.com"];this.hosts={read:[],write:[]},this.hostIndex={read:0,write:0},r=r||{};var d=r.protocol||"https:",p=void 0===r.timeout?2e3:r.timeout;if(/:$/.test(d)||(d+=":"),"http:"!==r.protocol&&"https:"!==r.protocol)throw new f.AlgoliaSearchError("protocol must be `http:` or `https:` (was `"+r.protocol+"`)");r.hosts?u(r.hosts)?(this.hosts.read=a(r.hosts),this.hosts.write=a(r.hosts)):(this.hosts.read=a(r.hosts.read),this.hosts.write=a(r.hosts.write)):(this.hosts.read=[this.applicationID+"-dsn.algolia.net"].concat(l),this.hosts.write=[this.applicationID+".algolia.net"].concat(l)),this.hosts.read=o(this.hosts.read,i(d)),this.hosts.write=o(this.hosts.write,i(d)),this.requestTimeout=p,this.extraHeaders=[],this.cache={},this._ua=r._ua,this._useCache=void 0===r._useCache?!0:r._useCache,this._setTimeout=r._setTimeout,s("init done, %j",this)}function o(e,t){for(var n=[],r=0;r<e.length;++r)n.push(t(e[r],r));return n}function i(e){return function(t){return e+"//"+t.toLowerCase()}}function s(){var e="Not implemented in this environment.\nIf you feel this is a mistake, write to supp
243[email protected]";throw new f.AlgoliaSearchError(e)}function a(e,t){var n=e.toLowerCase().replace(".","").replace("()","");return"algoliasearch: `"+e+"` was replaced by `"+t+"`. Please see https://github.com/algolia/algoliasearch-client-js/wiki/Deprecated#"+n}function u(e,t){t(e,0)}function c(e,t){function n(){return r||(console.log(t),r=!0),e.apply(this,arguments)}var r=!1;return n}function l(e){if(void 0===Array.prototype.toJSON)return JSON.stringify(e);var t=Array.prototype.toJSON;delete Array.prototype.toJSON;var n=JSON.stringify(e);return Array.prototype.toJSON=t,n}t.exports=r;var f=e(66);r.prototype={deleteIndex:function(e,t){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(e),hostType:"write",callback:t})},moveIndex:function(e,t,n){var r={operation:"move",destination:t};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:r,hostType:"write",callback:n})},copyIndex:function(e,t,n){var r={operation:"copy",destination:t};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:r,hostType:"write",callback:n})},getLogs:function(e,t,n){return 0===arguments.length||"function"==typeof e?(n=e,e=0,t=10):(1===arguments.length||"function"==typeof t)&&(n=t,t=10),this._jsonRequest({method:"GET",url:"/1/logs?offset="+e+"&length="+t,hostType:"read",callback:n})},listIndexes:function(e,t){var n="";return void 0===e||"function"==typeof e?t=e:n="?page="+e,this._jsonRequest({method:"GET",url:"/1/indexes"+n,hostType:"read",callback:t})},initIndex:function(e){return new this.Index(this,e)},listUserKeys:function(e){return this._jsonRequest({method:"GET",url:"/1/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){return this._jsonRequest({method:"GET",url:"/1/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+e,hostType:"write",callback:t})},addUserKey:function(e,t,n){(1===arguments.length||"function"==typeof t)&&(n=t,t=null);var r={acl:e};return t&&(r.validity=t.validity,r.maxQueriesPerIPPerHour=t.maxQueriesPerIPPerHour,r.maxHitsPerQuery=t.maxHitsPerQuery,r.indexes=t.indexes,r.description=t.description,t.queryParameters&&(r.queryParameters=this._getSearchParams(t.queryParameters,"")),r.referers=t.referers),this._jsonRequest({method:"POST",url:"/1/keys",body:r,hostType:"write",callback:n})},addUserKeyWithValidity:c(function(e,t,n){return this.addUserKey(e,t,n)},a("client.addUserKeyWithValidity()","client.addUserKey()")),updateUserKey:function(e,t,n,r){(2===arguments.length||"function"==typeof n)&&(r=n,n=null);var o={acl:t};return n&&(o.validity=n.validity,o.maxQueriesPerIPPerHour=n.maxQueriesPerIPPerHour,o.maxHitsPerQuery=n.maxHitsPerQuery,o.indexes=n.indexes,o.description=n.description,n.queryParameters&&(o.queryParameters=this._getSearchParams(n.queryParameters,"")),o.referers=n.referers),this._jsonRequest({method:"PUT",url:"/1/keys/"+e,body:o,hostType:"write",callback:r})},setSecurityTags:function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],n=0;n<e.length;++n)if("[object Array]"===Object.prototype.toString.call(e[n])){for(var r=[],o=0;o<e[n].length;++o)r.push(e[n][o]);t.push("("+r.join(",")+")")}else t.push(e[n]);e=t.join(",")}this.securityTags=e},setUserToken:function(e){this.userToken=e},startQueriesBatch:c(function(){this._batch=[]},a("client.startQueriesBatch()","client.search()")),addQueryInBatch:c(function(e,t,n){this._batch.push({indexName:e,query:t,params:n})},a("client.addQueryInBatch()","client.search()")),clearCache:function(){this.cache={}},sendQueriesBatch:c(function(e){return this.search(this._batch,e)},a("client.sendQueriesBatch()","client.search()")),setRequestTimeout:function(e){e&&(this.requestTimeout=parseInt(e,10))},search:function(e,t){var n=this,r={requests:o(e,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:n._getSearchParams(e.params,t)}})};return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:r,hostType:"read",callback:t})},batch:function(e,t){return this._jsonRequest({method:"POST",url:"/1/indexes/*/batch",body:{requests:e},hostType:"write",callback:t})},destroy:s,enableRateLimitForward:s,disableRateLimitForward:s,useSecuredAPIKey:s,disableSecuredAPIKey:s,generateSecuredApiKey:s,Index:function(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}},setExtraHeader:function(e,t){this.extraHeaders.push({name:e.toLowerCase(),value:t})},_sendQueriesBatch:function(e,t){function n(){for(var t="",n=0;n<e.requests.length;++n){var r="/1/indexes/"+encodeURIComponent(e.requests[n].indexName)+"?"+e.requests[n].params;t+=n+"="+encodeURIComponent(r)+"&"}return t}return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:e,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:n()}},callback:t})},_jsonRequest:function(t){function r(e,u){function p(e){var t=e&&e.body&&e.body.message&&e.body.status||e.statusCode||e&&e.body&&200;i("received response: statusCode: %s, computed statusCode: %d, headers: %j",e.statusCode,t,e.headers),n.env.DEBUG&&-1!==n.env.DEBUG.indexOf("debugBody")&&i("body: %j",e.body);var r=200===t||201===t,o=!r&&4!==Math.floor(t/100)&&1!==Math.floor(t/100);if(a._useCache&&r&&s&&(s[m]=e.body),r)return e.body;if(o)return c+=1,y();var u=new f.AlgoliaSearchError(e.body&&e.body.message);return a._promise.reject(u)}function h(n){return i("error: %s, stack: %s",n.message,n.stack),n instanceof f.AlgoliaSearchError||(n=new f.Unknown(n&&n.message,n)),c+=1,n instanceof f.Unknown||n instanceof f.UnparsableJSON||!e.fallback&&n instanceof f.Network||c>=a.hosts[t.hostType].length&&(d||!t.fallback||!a._request.fallback)?a._promise.reject(n):(a.hostIndex[t.hostType]=++a.hostIndex[t.hostType]%a.hosts[t.hostType].length,n instanceof f.RequestTimeout?y():(a._request.fallback&&!a.useFallback&&(a.useFallback=!0),r(e,u)))}function y(){return a.hostIndex[t.hostType]=++a.hostIndex[t.hostType]%a.hosts[t.hostType].length,u.timeout=a.requestTimeout*(c+1),r(e,u)}var m;if(a._useCache&&(m=t.url),a._useCache&&o&&(m+="_body_"+u.body),a._useCache&&s&&void 0!==s[m])return i("serving response from cache"),a._promise.resolve(JSON.parse(l(s[m])));if(c>=a.hosts[t.hostType].length||a.useFallback&&!d)return t.fallback&&a._request.fallback&&!d?(i("switching to fallback"),
243c=0,u.method=t.fallback.method,u.url=t.fallback.url,u.jsonBody=t.fallback.body,u.jsonBody&&(u.body=l(u.jsonBody)),u.timeout=a.requestTimeout*(c+1),a.hostIndex[t.hostType]=0,d=!0,r(a._request.fallback,u)):(i("could not get any response"),a._promise.reject(new f.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API. Send an email to [email protected] to report and resolve the issue. Application id was: "+a.applicationID)));var v=a.hosts[t.hostType][a.hostIndex[t.hostType]]+u.url,g={body:o,jsonBody:t.body,method:u.method,headers:a._computeRequestHeaders(),timeout:u.timeout,debug:i};return i("method: %s, url: %s, headers: %j, timeout: %d",g.method,v,g.headers,g.timeout),e===a._request.fallback&&i("using fallback"),e.call(a,v,g).then(p,h)}var o,i=e(6)("algoliasearch:"+t.url),s=t.cache,a=this,c=0,d=!1;void 0!==t.body&&(o=l(t.body)),i("request start");var p=a.useFallback&&t.fallback,h=p?t.fallback:t,y=r(p?a._request.fallback:a._request,{url:h.url,method:h.method,body:o,jsonBody:t.body,timeout:a.requestTimeout*(c+1)});return t.callback?void y.then(function(e){u(function(){t.callback(null,e)},a._setTimeout||setTimeout)},function(e){u(function(){t.callback(e)},a._setTimeout||setTimeout)}):y},_getSearchParams:function(e,t){if(this._isUndefined(e)||null===e)return t;for(var n in e)null!==n&&void 0!==e[n]&&e.hasOwnProperty(n)&&(t+=""===t?"":"&",t+=n+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[n])?l(e[n]):e[n]));return t},_isUndefined:function(e){return void 0===e},_computeRequestHeaders:function(){var t=e(11),n={"x-algolia-api-key":this.apiKey,"x-algolia-application-id":this.applicationID,"x-algolia-agent":this._ua};return this.userToken&&(n["x-algolia-usertoken"]=this.userToken),this.securityTags&&(n["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&t(this.extraHeaders,function(e){n[e.name]=e.value}),n}},r.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(e,t,n){var r=this;return(1===arguments.length||"function"==typeof t)&&(n=t,t=void 0),this.as._jsonRequest({method:void 0!==t?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(r.indexName)+(void 0!==t?"/"+encodeURIComponent(t):""),body:e,hostType:"write",callback:n})},addObjects:function(e,t){for(var n=this,r={requests:[]},o=0;o<e.length;++o){var i={action:"addObject",body:e[o]};r.requests.push(i)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/batch",body:r,hostType:"write",callback:t})},getObject:function(e,t,n){var r=this;(1===arguments.length||"function"==typeof t)&&(n=t,t=void 0);var o="";if(void 0!==t){o="?attributes=";for(var i=0;i<t.length;++i)0!==i&&(o+=","),o+=t[i]}return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e)+o,hostType:"read",callback:n})},getObjects:function(e,t,n){var r=this;(1===arguments.length||"function"==typeof t)&&(n=t,t=void 0);var i={requests:o(e,function(e){var n={indexName:r.indexName,objectID:e};return t&&(n.attributesToRetrieve=t.join(",")),n})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",hostType:"read",body:i,callback:n})},partialUpdateObject:function(e,t){var n=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/"+encodeURIComponent(e.objectID)+"/partial",body:e,hostType:"write",callback:t})},partialUpdateObjects:function(e,t){for(var n=this,r={requests:[]},o=0;o<e.length;++o){var i={action:"partialUpdateObject",objectID:e[o].objectID,body:e[o]};r.requests.push(i)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/batch",body:r,hostType:"write",callback:t})},saveObject:function(e,t){var n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/"+encodeURIComponent(e.objectID),body:e,hostType:"write",callback:t})},saveObjects:function(e,t){for(var n=this,r={requests:[]},o=0;o<e.length;++o){var i={action:"updateObject",objectID:e[o].objectID,body:e[o]};r.requests.push(i)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/batch",body:r,hostType:"write",callback:t})},deleteObject:function(e,t){if("function"==typeof e||"string"!=typeof e&&"number"!=typeof e){var n=new f.AlgoliaSearchError("Cannot delete an object without an objectID");return t=e,"function"==typeof t?t(n):this.as._promise.reject(n)}
243var r=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e),hostType:"write",callback:t})},deleteObjects:function(e,t){var n=this,r={requests:o(e,function(e){return{action:"deleteObject",objectID:e,body:{objectID:e}}})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/batch",body:r,hostType:"write",callback:t})},deleteByQuery:function(e,t,n){function r(e){if(0===e.nbHits)return e;var t=o(e.hits,function(e){return e.objectID});return l.deleteObjects(t).then(i).then(s)}function i(e){return l.waitTask(e.taskID)}function s(){return l.deleteByQuery(e,t)}function a(){u(function(){n(null)},f._setTimeout||setTimeout)}function c(e){u(function(){n(e)},f._setTimeout||setTimeout)}var l=this,f=l.as;(1===arguments.length||"function"==typeof t)&&(n=t,t={}),t.attributesToRetrieve="objectID",t.hitsPerPage=1e3,this.clearCache();var d=this.search(e,t).then(r);return n?void d.then(a,c):d},search:function(e,t,n){if("function"==typeof e&&"object"==typeof t||"object"==typeof n)throw new f.AlgoliaSearchError("index.search usage is index.search(query, params, cb)");0===arguments.length||"function"==typeof e?(n=e,e=""):(1===arguments.length||"function"==typeof t)&&(n=t,t=void 0),"object"==typeof e&&null!==e?(t=e,e=void 0):(void 0===e||null===e)&&(e="");var r="";return void 0!==e&&(r+="query="+encodeURIComponent(e)),void 0!==t&&(r=this.as._getSearchParams(t,r)),this._search(r,n)},browse:function(t,n,r){var o,i,s=e(57),a=this;0===arguments.length||1===arguments.length&&"function"==typeof arguments[0]?(o=0,r=arguments[0],t=void 0):"number"==typeof arguments[0]?(o=arguments[0],"number"==typeof arguments[1]?i=arguments[1]:"function"==typeof arguments[1]&&(r=arguments[1],i=void 0),t=void 0,n=void 0):"object"==typeof arguments[0]?("function"==typeof arguments[1]&&(r=arguments[1]),n=arguments[0],t=void 0):"string"==typeof arguments[0]&&"function"==typeof arguments[1]&&(r=arguments[1],n=void 0),n=s({},n||{},{page:o,hitsPerPage:i,query:t});var u=this.as._getSearchParams(n,"");return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(a.indexName)+"/browse?"+u,hostType:"read",callback:r})},browseFrom:function(e,t){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse?cursor="+e,hostType:"read",callback:t})},browseAll:function(t,n){function r(e){if(!a._stopped){var t;t=void 0!==e?"cursor="+encodeURIComponent(e):l,u._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(c.indexName)+"/browse?"+t,hostType:"read",callback:o})}}function o(e,t){return a._stopped?void 0:e?void a._error(e):(a._result(t),void 0===t.cursor?void a._end():void r(t.cursor))}"object"==typeof t&&(n=t,t=void 0);var i=e(57),s=e(61),a=new s,u=this.as,c=this,l=u._getSearchParams(i({},n||{},{query:t}),"");return r(),a},ttAdapter:function(e){var t=this;return function(n,r,o){var i;i="function"==typeof o?o:r,t.search(n,e,function(e,t){return e?void i(e):void i(t.hits)})}},waitTask:function(e,t){function n(){return l._jsonRequest({method:"GET",hostType:"read",url:"/1/indexes/"+encodeURIComponent(c.indexName)+"/task/"+e}).then(function(e){a++;var t=i*a*a;return t>s&&(t=s),"published"!==e.status?l._promise.delay(t).then(n):e})}function r(e){u(function(){t(null,e)},l._setTimeout||setTimeout)}function o(e){u(function(){t(e)},l._setTimeout||setTimeout)}var i=100,s=5e3,a=0,c=this,l=c.as,f=n();return t?void f.then(r,o):f},clearIndex:function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},getSettings:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings",hostType:"read",callback:e})},setSettings:function(e,t){var n=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/settings",hostType:"write",body:e,callback:t})},listUserKeys:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){var n=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){var n=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/keys/"+e,hostType:"write",callback:t})},addUserKey:function(e,t,n){(1===arguments.length||"function"==typeof t)&&(n=t,t=null);var r={acl:e};return t&&(r.validity=t.validity,r.maxQueriesPerIPPerHour=t.maxQueriesPerIPPerHour,r.maxHitsPerQuery=t.maxHitsPerQuery,r.description=t.description,t.queryParameters&&(r.queryParameters=this.as._getSearchParams(t.queryParameters,"")),r.referers=t.referers),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:r,hostType:"write",callback:n})},addUserKeyWithValidity:c(function(e,t,n){return this.addUserKey(e,t,n)},a("index.addUserKeyWithValidity()","index.addUserKey()")),updateUserKey:function(e,t,n,r){(2===arguments.length||"function"==typeof n)&&(r=n,n=null);var o={acl:t};return n&&(o.validity=n.validity,o.maxQueriesPerIPPerHour=n.maxQueriesPerIPPerHour,o.maxHitsPerQuery=n.maxHitsPerQuery,o.description=n.description,n.queryParameters&&(o.queryParameters=this.as._getSearchParams(n.queryParameters,"")),o.referers=n.referers),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+e,body:o,hostType:"write",callback:r})},_search:function(e,t){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:t})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}}).call(this,e(2))},{11:11,2:2,44:44,47:47,57:57,6:6,61:61,66:66}],61:[function(e,t,n){"use strict";function r(){}t.exports=r;var o=e(10),i=e(1).EventEmitter;o(r,i),r.prototype.stop=function(){this._stopped=!0,this._clean()}
243,r.prototype._end=function(){this.emit("end"),this._clean()},r.prototype._error=function(e){this.emit("error",e),this._clean()},r.prototype._result=function(e){this.emit("result",e)},r.prototype._clean=function(){this.removeAllListeners("stop"),this.removeAllListeners("end"),this.removeAllListeners("error"),this.removeAllListeners("result")}},{1:1,10:10}],62:[function(e,t,n){"use strict";function r(t,n,i){var s=e(45),a=e(63);return i=s(i||{}),void 0===i.protocol&&(i.protocol=a()),i._ua=i._ua||r.ua,new o(t,n,i)}function o(){a.apply(this,arguments)}t.exports=r;var i=e(10),s=window.Promise||e(9).Promise,a=e(60),u=e(66),c=e(64),l=e(65);r.version=e(67),r.ua="Algolia for vanilla JavaScript "+r.version,window.__algolia={debug:e(6),algoliasearch:r};var f={hasXMLHttpRequest:"XMLHttpRequest"in window,hasXDomainRequest:"XDomainRequest"in window,cors:"withCredentials"in new XMLHttpRequest,timeout:"timeout"in new XMLHttpRequest};i(o,a),o.prototype._request=function(e,t){return new s(function(n,r){function o(){if(!l){f.timeout||clearTimeout(a);var e;try{e={body:JSON.parse(p.responseText),statusCode:p.status,headers:p.getAllResponseHeaders&&p.getAllResponseHeaders()||{}}}catch(t){e=new u.UnparsableJSON({more:p.responseText})}e instanceof u.UnparsableJSON?r(e):n(e)}}function i(e){l||(f.timeout||clearTimeout(a),r(new u.Network({more:e})))}function s(){f.timeout||(l=!0,p.abort()),r(new u.RequestTimeout)}if(!f.cors&&!f.hasXDomainRequest)return void r(new u.Network("CORS not supported"));e=c(e,t.headers);var a,l,d=t.body,p=f.cors?new XMLHttpRequest:new XDomainRequest;p instanceof XMLHttpRequest?p.open(t.method,e,!0):p.open(t.method,e),f.cors&&(d&&("POST"===t.method?p.setRequestHeader("content-type","application/x-www-form-urlencoded"):p.setRequestHeader("content-type","application/json")),p.setRequestHeader("accept","application/json")),p.onprogress=function(){},p.onload=o,p.onerror=i,f.timeout?(p.timeout=t.timeout,p.ontimeout=s):a=setTimeout(s,t.timeout),p.send(d)})},o.prototype._request.fallback=function(e,t){return e=c(e,t.headers),new s(function(n,r){l(e,t,function(e,t){return e?void r(e):void n(t)})})},o.prototype._promise={reject:function(e){return s.reject(e)},resolve:function(e){return s.resolve(e)},delay:function(e){return new s(function(t){setTimeout(t,e)})}}},{10:10,45:45,6:6,60:60,63:63,64:64,65:65,66:66,67:67,9:9}],63:[function(e,t,n){"use strict";function r(){var e=window.document.location.protocol;return"http:"!==e&&"https:"!==e&&(e="http:"),e}t.exports=r},{}],64:[function(e,t,n){"use strict";function r(e,t){return e+=/\?/.test(e)?"&":"?",e+o.encode(t)}t.exports=r;var o=e(5)},{5:5}],65:[function(e,t,n){"use strict";function r(e,t,n){function r(){t.debug("JSONP: success"),y||f||(y=!0,l||(t.debug("JSONP: Fail. Script loaded but did not call the callback"),a(),n(new o.JSONPScriptFail)))}function s(){("loaded"===this.readyState||"complete"===this.readyState)&&r()}function a(){clearTimeout(m),p.onload=null,p.onreadystatechange=null,p.onerror=null,d.removeChild(p);try{delete window[h],delete window[h+"_loaded"]}catch(e){window[h]=null,window[h+"_loaded"]=null}}function u(){t.debug("JSONP: Script timeout"),f=!0,a(),n(new o.RequestTimeout)}function c(){t.debug("JSONP: Script error"),y||f||(a(),n(new o.JSONPScriptError))}if("GET"!==t.method)return void n(new Error("Method "+t.method+" "+e+" is not supported by JSONP."));t.debug("JSONP: start");var l=!1,f=!1;i+=1;var d=document.getElementsByTagName("head")[0],p=document.createElement("script"),h="algoliaJSONP_"+i,y=!1;window[h]=function(e){try{delete window[h]}catch(t){window[h]=void 0}f||(l=!0,a(),n(null,{body:e}))},e+="&callback="+h,t.jsonBody&&t.jsonBody.params&&(e+="&"+t.jsonBody.params);var m=setTimeout(u,t.timeout);p.onreadystatechange=s,p.onload=r,p.onerror=c,p.async=!0,p.defer=!0,p.src=e,d.appendChild(p)}t.exports=r;var o=e(66),i=0},{66:66}],66:[function(e,t,n){"use strict";function r(t,n){var r=e(11),o=this;"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):o.stack=(new Error).stack||"Cannot get a stacktrace, browser is too old",this.name=this.constructor.name,this.message=t||"Unknown error",n&&r(n,function(e,t){o[t]=e})}function o(e,t){function n(){var n=Array.prototype.slice.call(arguments,0);"string"!=typeof n[0]&&n.unshift(t),r.apply(this,n),this.name="AlgoliaSearch"+e+"Error"}return i(n,r),n}var i=e(10);
243i(r,Error),t.exports={AlgoliaSearchError:r,UnparsableJSON:o("UnparsableJSON","Could not parse the incoming response as JSON, see err.more for details"),RequestTimeout:o("RequestTimeout","Request timedout before getting a response"),Network:o("Network","Network issue, see err.more for details"),JSONPScriptFail:o("JSONPScriptFail","<script> was loaded but did not call our provided callback"),JSONPScriptError:o("JSONPScriptError","<script> unable to load due to an `error` event on it"),Unknown:o("Unknown","Unknown error occured")}},{10:10,11:11}],67:[function(e,t,n){t.exports="3.7.5"},{}]},{},[62])(62)});
244//  DISPLAY A 'STICKY' NAVIGATION
245function fixNavigationDesktop(e) {
246  if (e > 1015) {
247    if (window.scrollY > 0) {
248      document.getElementById('darker').style.backgroundColor = '#2F353E'
249      document.getElementById('darker').style.position = 'fixed'
250    } else {
251      document.getElementById('darker').style.backgroundColor = '#2F353E'
252      document.getElementById('darker').style.position = 'relative'
253    }
254  } else {
255    $('#darker').removeAttr('style')
256  }
257}
258
259//  HANDLE TRANSPARENT NAV
260
261var header_anchor = $('.header-anchor')
262if (header_anchor.length > 0 && $('body').hasClass('headscroll')) {
263  $(window).scroll(function() {
264    var win_pos = document.documentElement.scrollTop
265      ? document.documentElement.scrollTop
266      : document.body.scrollTop
267    var anchor_pos = header_anchor.offset().top + header_anchor.outerHeight()
268    //console.log(win_pos+" >= "+anchor_pos);
269    if (win_pos >= anchor_pos && $('body').hasClass('transparent')) {
270      // Slide in sticky nav
271      //console.log(win_pos+" >= "+anchor_pos+" | Slide in");
272      $('header')
273        .css({ top: '-62px' })
274        .animate({ top: '0' }, 300, function() {
275          $(this).removeAttr('style')
276        })
277      $('body')
278        .removeClass('transparent')
279        .css('padding-top', '0px')
280    } else if (
281      win_pos < anchor_pos &&
282      !$('body').hasClass('transparent') &&
283      !$('body').hasClass('temptransparent')
284    ) {
285      // Slide out sticky nav
286      //console.log(win_pos+" >= "+anchor_pos+" | Slide out");
287      $('body').addClass('temptransparent')
288      $('header')
289        .css({ top: '0' })
290        .animate({ top: '-62px' }, 100, function() {
291          $(this).removeAttr('style')
292          $('body')
293            .addClass('transparent')
294            .removeClass('temptransparent')
295            .removeAttr('style')
296        })
297    }
298  })
299}
300
301//  SHOW THE MOBILE NAVIGATION
302function toggleMobileNav() {
303  var html = $('html')
304  var body = $('body')
305  var menu = $('#mainNav')
306  var menulink = $('.menu-link')
307  var winHeight = $(window).height()
308  var setHeight
309
310  menulink.click(function() {
311    winHeight = $(window).height()
312    menulink.toggleClass('active')
313    menulink.parent().toggleClass('active')
314    html.toggleClass('noscroll')
315    if (menu.hasClass('active')) {
316      menu.removeClass('active', 400).removeAttr('style')
317    } else {
318      setHeight = winHeight - 62
319      menu.css('height', setHeight).addClass('active', 400)
320    }
321
322    return false
323  })
324
325  $(window).resize(function() {
326    if (menu.hasClass('active')) {
327      winHeight = $(window).height()
328      setHeight = winHeight - 62
329      menu[0].style.height = setHeight + 'px'
330    }
331  })
332
333  $('#mainNav').removeAttr('style')
334}
335
336// SHOW MOBILE SIGN UP BUTTON
337// $(window).scroll(function() {
338//   var banner = $('#mobileBanner');
339//   var cmLogo = $('#cmlogo');
340//   var isScrolled = window.scrollY > 10;
341
342//   if(isScrolled) {
343//     cmLogo.addClass('logo-small');
344//     banner.addClass('visible');
345//   } else {
346//     banner.removeClass('visible');
347//     cmLogo.removeClass('logo-small');
348//   }
349
350// })
351
352// SET ACTIVE CLASSES ON DROPDOWN MENUS
353var mobileNav = $('#mainNav')
354
355$('.dropdown').each(function() {
356  $(this).click(function(event) {
357    var width = $(window).width()
358    if (width < 850) {
359      if (event.target.id) {
360        var menu = $(this).find('.dropdown_menu--' + event.target.id)
361        var link = $('#' + event.target.id)
362        menu.toggleClass('active')
363        link.toggleClass('active')
364      }
365    }
366  })
367})
368
369function hideOnClickOutside(selector) {
370  function outsideClickListener(event) {
371    $target = $(event.target)
372    if (!$target.closest('.dropdown').length) {
373      $('.dropdown_link').each(function(i) {
374        if ($(this).hasClass('active')) {
375          $(this).removeClass('active')
376        }
377      })
378      $('.dropdown_menu').each(function(i) {
379        if ($(this).hasClass('active')) {
380          $(this).removeClass('active')
381        }
382      })
383    }
384  }
385
386  function removeClickListener() {
387    document.removeEventListener('click', outsideClickListener)
388  }
389
390  document.addEventListener('click', outsideClickListener)
391}
392
393hideOnClickOutside($('.dropdown'))
394
395$(document).ready(function() {
396  toggleMobileNav()
397
398  $('body').addClass('js')
399})
400
401/*
402 * Header menu subnav
403 */
404
405$('header ul#second .open-subnav').click(function() {
406  if ($(this).next('.subnav').length > 0) {
407    var winHeight = $(window).height()
408    var gap = deviceDetectGap()
409    winHeight = winHeight + gap
410    $(this)
411      .next('.subnav')
412      .css('height', winHeight)
413      .addClass('open')
414      .animate({ opacity: 1 }, 300, function() {})
415  }
416})
417
418$(document).on('click touchstart keyup', function(e) {
419  if (
420    (!$(e.target).hasClass('block') &&
421      !$(e.target).closest('.block').length > 0 &&
422      !$(e.target).hasClass('open-subnav')) ||
423    e.keyCode == 27
424  ) {
425    e.stopPropagation()
426    $('header ul#second .subnav').animate({ opacity: 0 }, 300, function() {
427      $(this)
428        .removeClass('open')
429        .removeAttr('style')
430      $('#overlay-display-sales')
431        .show()
432        .next('.sales-info')
433        .hide()
434        .parent()
435        .removeAttr('style')
436        .next()
437        .removeAttr('style')
438        .parent()
439        .removeAttr('style')
440    })
441  }
442})
443
444$('#overlay-display-sales').click(function() {
445  var btn = $(this)
446  var sales_cont = $(this).parent()
447  var sales_width = sales_cont.width()
448  var support_cont = sales_cont.next()
449  var block = sales_cont.parent()
450  support_cont.fadeOut(200, function() {
451    sales_cont.css({ width: sales_width })
452    block.animate(
453      { width: sales_width, 'margin-left': -(sales_width / 2) },
454      300,
455      function() {
456        btn.hide()
457        sales_cont.children('.sales-info').slideDown()
458      }
459    )
460  })
461})
462
463$('.subtitle.call')
464  .parent()
465  .click(function(e) {
466    if ($(e.target).hasClass('call')) {
467      e.preventDefault()
468      var href = $(this)
469        .children('.call')
470        .data('href')
471      window.location = href
472    }
473  })
474
475function deviceDetectGap() {
476  // Assign a variable for the application being used
477  var nVer = navigator.appVersion
478  // Assign a variable for the device being used
479  var nAgt = navigator.userAgent
480  var nameOffset, verOffset, ix
481
482  // First check to see if the platform is an iPhone or iPod
483  if (
484    navigator.platform == 'iPhone' ||
485    navigator.platform == 'iPod' ||
486    navigator.platform == 'iPad'
487  ) {
488    // In Safari, the true version is after "Safari"
489    if ((verOffset = nAgt.indexOf('Safari')) != -1) {
490      // Set a variable to use later
491      var mobileSafari = 'Safari'
492    }
493  }
494
495  // If is mobile Safari set window height +60
496  if (mobileSafari == 'Safari') {
497    return 60
498  } else {
499    return 0
500  }
501}
502
503/*
504 * Accessible Nav Handlers
505 */
506
507$(document).ready(function() {
508  var navLinks = $('.primary-nav-link')
509  var dropdownMenus = $('.dropdown_menu')
510  var subnav = $('.subnav')
511  var contact = $('#contact')
512  var ARROW_DOWN = 40
513  var ARROW_UP = 38
514  var ARROW_RIGHT = 39
515  var ARROW_LEFT = 37
516  var ENTER = 13
517  var TAB = 9
518
519  // Hide all open dropdown menus
520  function hideDropdowns() {
521    navLinks.each(function() {
522      if ($(this).hasClass('dropdown_link')) {
523        if (
524          $(this)
525            .parent()
526            .siblings('.dropdown_menu')
527            .hasClass('active')
528        ) {
529          $(this).toggleClass('active')
530          $(this)
531            .parent()
532            .siblings('.dropdown_menu')
533            .toggleClass('active')
534          $(this).attr('aria-expanded', false)
535        }
536      }
537    })
538  }
539
540  function handleDropdownClick(self) {
541    // Only do work on desktop
542    var width = $(window).width()
543    if (width > 850) {
544      hideDropdowns()
545
546      // Set current active dropdown
547      if ($(self).hasClass('dropdown_link')) {
548        $(self).toggleClass('active')
549        $(self)
550          .parent()
551          .siblings('.dropdown_menu')
552          .toggleClass('active')
553        $(self).attr('aria-expanded', true)
554
555        // Move focus to first item in menu
556        $(self)
557          .parent()
558          .siblings('.dropdown_menu')
559          .find('.dropdown_menu-item:first-of-type > a')
560          .focus()
561      }
562    }
563  }
564
565  function handleDropdownKeydown(event) {
566    // Only do work on desktop
567    var width = $(window).width()
568    if (width > 850) {
569      switch (event.keyCode) {
570        case ARROW_DOWN:
571        case ENTER:
572          var self = this
573
574          handleDropdownClick(self)
575
576          // Show contact nav
577          if ($(self).is('#contact')) {
578            $(subnav).addClass('open')
579            $(subnav).css('height', '100vh')
580            $(subnav).css('opacity', '1')
581            $('.sublink:first-of-type').focus()
582          }
583
584          break
585        case ARROW_RIGHT:
586          hideDropdowns()
587
588          // Move focus to next nav link
589          if ($(this).hasClass('dropdown_link')) {
590            // Handle dropdown links
591            if ($(this).parents('.nav_item-secondary').length) {
592              // Handle secondary nav
593              $(this)
594                .parent()
595                .parent()
596                .prev('.nav_item')
597                .find('a')
598                .focus()
599            } else {
600              // Handle primary nav
601              $(this)
602                .parent()
603                .parent()
604                .next()
605                .find('a')
606                .focus()
607            }
608          } else {
609            // Handle main menu links
610            if ($(this).parents('.nav_item-secondary').length) {
611              // Handle secondary nav
612              $(this)
613                .parent()
614                .prev('.nav_item')
615                .find('a')
616                .focus()
617            } else {
618              if (
619                $(this)
620                  .parent()
621                  .next('.nav_item').length === 0
622              ) {
623                // Handle last item in primary nav
624                $(this)
625                  .parent()
626                  .parent()
627                  .siblings('.secondary-nav')
628                  .find('.nav_item-secondary:last-of-type a')
629                  .focus()
630              } else {
631                // Handle parary nav
632                $(this)
633                  .parent()
634                  .next('.nav_item')
635                  .find('a')
636                  .focus()
637              }
638            }
639          }
640          break
641        case ARROW_LEFT:
642          hideDropdowns()
643
644          // Move focus to previous nav link
645          if ($(event.target).hasClass('dropdown_link')) {
646            // Handle dropdown links
647            if (
648              $(this)
649                .parent()
650                .parent()
651                .parent()
652                .parent()
653                .hasClass('secondary-nav')
654            ) {
655              // Handle secondary nav
656              $(this)
657                .parent()
658                .parent()
659                .next('.nav_item')
660                .find('a')
661                .focus()
662            } else {
663              console.log('running second')
664              // Handle primary nav
665              $(this)
666                .parent()
667                .parent()
668                .prev('.nav_item')
669                .find('a')
670                .focus()
671            }
672          } else {
673            // Handle main nav links
674            if (
675              $(this)
676                .parent()
677                .parent()
678                .parent()
679                .hasClass('secondary-nav')
680            ) {
681              // Handle secondary nav
682              if (
683                $(this)
684                  .parent()
685                  .next('.nav_item').length === 0
686              ) {
687                // Handle last item in secondary nav
688                $(this)
689                  .parent()
690                  .parent()
691                  .parent()
692                  .siblings('.primary-nav')
693                  .find('.nav_item a#agencies')
694                  .focus()
695              } else {
696                $(this)
697                  .parent()
698                  .parent()
699                  .next('.nav_item')
700                  .find('a')
701                  .focus()
702              }
703            } else {
704              // Handle primary nav
705              $(this)
706                .parent()
707                .prev('.nav_item')
708                .find('a')
709                .focus()
710            }
711          }
712        case TAB:
713          hideDropdowns()
714      }
715    }
716  }
717
718  function handleNavItemKeydown(event) {
719    if (event.keyCode === ARROW_UP) {
720      if ($(event.target).hasClass('dropdown_menu-link')) {
721        // Move focus to main nav link if first item
722        if (
723          $(event.target)
724            .parent('li')
725            .prev('li').length == 0
726        ) {
727          $(event.target)
728            .parent()
729            .parent()
730            .siblings('.dropdown_head')
731            .find('a')
732            .focus()
733        } else {
734          // Move focus to next nav item if not first item
735          $(event.target)
736            .parent()
737            .siblings('.dropdown_menu-item')
738            .find('a')
739            .focus()
740        }
741      }
742    }
743
744    if (event.keyCode === ARROW_DOWN) {
745      // Move focus to main nav link if last item
746      if (
747        $(event.target)
748          .parent('li')
749          .next('li').length == 0
750      ) {
751        $(event.target)
752          .parent()
753          .parent()
754          .siblings('.dropdown_head')
755          .find('a')
756          .focus()
757      } else {
758        // Move focus to main nav link if not last item
759        $(event.target)
760          .parent()
761          .siblings('.dropdown_menu-item')
762          .find('a')
763          .focus()
764      }
765    }
766  }
767
768  navLinks.each(function() {
769    var self = this
770    $(this).on('click', function() {
771      handleDropdownClick(self)
772    })
773
774    $(this).on('keydown', handleDropdownKeydown)
775  })
776
777  dropdownMenus.each(function() {
778    $(this).on('keydown', handleNavItemKeydown)
779  })
780
781  contact.on('click', function() {
782    $('.sublink:first-of-type').focus()
783  })
784})
785
786
787// * IMPLEMENTING FEATURES DROPDOWN - enables dropdown on mobile menu
788const enable = $('header > div');
789
790const toggler = $('li.has-dropdown');
791if (enable.length) {
792  toggler.removeClass('open');
793
794  toggler.click(function(e) {
795    if (e.target == this) {
796      toggler.toggleClass('open');
797    }
798  });
799}
800/*
801 * Ensure cookie function exists (TODO: Probably best to have a globalised way to include these)
802 */
803if (typeof get_cookie !== "function") {
804  function get_cookie(cookie_name) {
805      var results = document.cookie.match(cookie_name + '=(.*?)(;|$)');
806      if (results)
807          return (unescape(results[1]));
808      else
809          return null;
810  }
811}
812if (typeof delete_cookie !== "function") {
813  function delete_cookie(name) {
814      var delete_string = "";
815      var expires = new Date();
816      expires.setDate(expires.getDate() - (9));
817      delete_string += "; expires=" + expires.toGMTString();
818    // delete_string += "; expires=Thu, 01 Jan 1970 00:00:00 UTC;"
819      delete_string += "; path=" + escape("/");
820
821      if (/^localhost(\:\d+)?$/.test(location.host)) {
822          delete_string += "; domain=";
823      } else {
824          var host = location.host;
825          host = host.split('.');
826          host = host.splice((host.length - 2), host.length).join('.');
827          delete_string += "; domain=" + escape("." + host);
828      }
829
830      if (typeof(name) !== "undefined") {
831          // Delete single cookie
832          document.cookie = name + "=" + delete_string;
833      } else {
834          // Delete all cookies
835          document.cookie.split(";").forEach(function(c) {document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=" + delete_string);});
836      }
837  }
838
839  // Clear old cookies
840  delete_cookie("CM-location-data");
841  delete_cookie("CM-location-dv1");
842  delete_cookie("CM-location-dv2");
843  delete_cookie("CM-location-dv3");
844  delete_cookie("CM-location-dv4");
845  delete_cookie("CM-location-dv5");
846  delete_cookie("CM-location-dv6");
847}
848
849
850
851if (typeof set_cookie !== "function") {
852  function set_cookie(name, value, days) {
853      var cookie_string = name + "=" + escape(value);
854      if (typeof (days) === 'undefined')
855          days = 365;
856
857      var expires = new Date();
858      expires.setDate(expires.getDate() + (days));
859      cookie_string += "; expires=" + expires.toGMTString();
860      cookie_string += "; path=" + escape("/");
861
862      if (/^localhost(\:\d+)?$/.test(location.host)) {
863          cookie_string += "; domain=";
864      } else {
865          var host = location.host;
866          host = host.split('.');
867          host = host.splice((host.length - 2), host.length).join('.');
868          cookie_string += "; domain=" + escape("." + host);
869      }
870
871      document.cookie = cookie_string;
872  }
873}
874
875var delete_cookie_now = function(name) {
876    document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/; domain=.campaignmonitor.com';
877};
878delete_cookie_now('CM-location-dv6');
879
880/*
881*  localStorage/sessionStorage function with fallback option to cookie if not supported
882*      method: (String) Options:get|set|remove. Default: get
883*      key: (String) key name for stored value
884*      value: (String) value to be stored
885*      expire: (Boolean) Default:false. If true, will use session length
886*/
887
888if (typeof cmStorage !== "function") {
889  function cmStorage(method, key, value, expire) {
890      var methodOptions = ['get', 'set', 'remove'];
891      var methods = {
892          'get':      'getItem',
893          'set':      'setItem',
894          'remove':   'removeItem'
895      };
896      if (typeof(method) === "undefined" || methodOptions.indexOf(method) === -1) method = 'get';
897      if (typeof(expire) === "undefined") expire = false;
898      if (typeof(Storage) !== "undefined") {
899          if (expire) {
900              return sessionStorage[methods[method]](key, value);
901          } else {
902              return localStorage[methods[method]](key, value);
903          }
904      } else {
905          // Fall back to cookie suuport
906          methods = {
907              'get':      'get_cookie',
908              'set':      'set_cookie',
909              'remove':   'delete_cookie'
910          };
911
912          if (expire) {
913              return window[methods[method]](key, value, 1);
914          } else {
915              return window[methods[method]](key, value);
916          }
917      }
918  }
919}
920
921/*
922* Countries that require Sales CTA override to self service
923*/
924
925var country_cta_override = [
926  "ZA", // South Africa
927  "IT", // Italy
928  "IL", // Israel
929  "SA", // Saudi Arabia
930  "PT", // Portugal
931  "IR", // Iran
932  "LT", // Lithuania
933  "FI", // Finland
934  "RU", // Russian Federation
935  "CZ", // Czech Republic
936  "BG", // Bulgaria
937  "LB", // Lebanon
938  "BY", // Belarus
939  "NG", // Nigeria
940  "TR", // Turkey
941  "MA", // Morocco
942  "IN", // India
943];
944
945/*
946* GDPR compliance regions
947*/
948
949var display_regions = [
950  'unitedkingdom' // Region covers all of Europe - see L505
951];
952
953/*
954* Exit intent var set
955*/
956
957var hailmary_pages = [
958  //window.location.hostname + '/blog',
959];
960
961var hailmary_map = {};
962// hailmary_map[hailmary_pages[0]] = {
963//     'image': 'modern-guide-med.png',
964//     'link': '/resources/guides/modern-guidebook-email-marketing/',
965//     'sv': 'blog-popup',
966//     'cid': '701o0000000O71w',
967//     'gate': true
968// };
969
970var activate_page = containsAny(window.location.href, hailmary_pages);
971var visitor_data = false;
972if (typeof (get_cookie) === typeof (Function))
973  visitor_data = get_cookie("CM-Init-Visit");
974//console.log(visitor_data);
975
976/*
977*  ADDING CJ AFFILATE COOKIE WHEN PARAMETER IS DETECTED
978*/
979
980if (typeof getUrlVars()['cjevent'] !== "undefined") {
981  //cmStorage('set', 'cjevent', getUrlVars()['cjevent']);
982  set_cookie('cjevent',getUrlVars()['cjevent']);
983}
984
985/*
986* Add User agent to HTML tag
987*/
988
989document.documentElement.setAttribute('data-useragent', navigator.userAgent);
990
991/*
992* Device detection
993*/
994
995window.mobilecheck = function () {
996  var check = false;
997  (function (a) {
998      if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)))
999          check = true;
1000  })(navigator.userAgent || navigator.vendor || window.opera);
1001  return check;
1002};
1003if (window.mobilecheck())
1004  $("body").addClass('mobile-detected');
1005
1006window.mobileAndTabletcheck = function () {
1007  var check = false;
1008  (function (a) {
1009      if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)))
1010          check = true;
1011  })(navigator.userAgent || navigator.vendor || window.opera);
1012  return check;
1013};
1014if (window.mobileAndTabletcheck())
1015  $("body").addClass('handheld-detected');
1016
1017window.touchcheck = function () {
1018  return !!('ontouchstart' in window) || !!('msmaxtouchpoints' in window.navigator);
1019};
1020if (window.touchcheck())
1021  $("body").addClass('touch-detected');
1022
1023/*
1024* Inview function
1025*/
1026
1027;
1028(function ($) {
1029  var $cache = [];
1030  function getViewportHeight() {
1031      var height = window.innerHeight;
1032      var mode = document.compatMode;
1033      if ((mode || !$.support.boxModel)) {
1034          height = (mode == 'CSS1Compat') ?
1035                  document.documentElement.clientHeight :
1036                  document.body.clientHeight;
1037      }
1038      return height;
1039  }
1040
1041  var orgOnFN = $.fn.on;
1042  $.fn.on = function () {
1043      var ret = orgOnFN.apply(this, arguments);
1044      if (arguments[0] === 'inview' && this.length > 0) {
1045          $cache.push(this);
1046      }
1047      return ret;
1048  };
1049
1050  $(window).scroll(function () {
1051      var vpH = getViewportHeight(),
1052              scrolltop = (document.documentElement.scrollTop ?
1053                      document.documentElement.scrollTop :
1054                      document.body.scrollTop),
1055              elems = $cache;
1056
1057      if (elems.length) {
1058          $(elems).each(function () {
1059              $(this).each(function () {
1060                  var $el = $(this),
1061                          top = $el.offset().top,
1062                          height = $el.height(),
1063                          inview = $el.data('inview') || false;
1064                  if (scrolltop >= (top + height) || scrolltop + vpH <= top) {
1065                      if (inview) {
1066                          $el.data('inview', false);
1067                          $el.trigger('inview', [false]);
1068                      }
1069                  } else if (scrolltop < (top + height)) {
1070                      if (!inview) {
1071                          $el.data('inview', true);
1072                          $el.trigger('inview', [true]);
1073                      }
1074                  }
1075              });
1076          });
1077      }
1078  });
1079  $(function () {
1080      $(window).scroll();
1081  });
1082})(jQuery);
1083
1084// 2 step signup
1085if ($("#pre-signup-form").length > 0) {
1086  $("#pre-signup").click(function(e) {
1087      e.preventDefault();
1088      var loc = $(this).attr('href');
1089      var email = $("#pre-email-address").val().trim();
1090
1091      if (isValidEmailAddress(email)) {
1092          cmStorage('set', 'signup-email', email, true);
1093          window.location = loc;
1094      } else {
1095          $("#pre-email-address").next('.error_field').remove();
1096          $("#pre-email-address").addClass('error').after("<span class='error_field'>Please enter a valid email address</span>");
1097          $("#pre-email-address").focus(function() {
1098              $(this).removeClass('error').next('.error_field').fadeOut(300, function() {
1099                  $(this).remove();
1100              });
1101          });
1102      }
1103  });
1104  $('#pre-email-address').keypress(function(e){
1105      if(e.keyCode == 13 || e.which == 13){
1106          $('#pre-signup').click();
1107      }
1108  });
1109}
1110
1111/*
1112* Signup to demo functionality on handhelds
1113*/
1114
1115if (window.mobileAndTabletcheck() === true || window.innerWidth < 1024) {
1116  // Update all signup buttons to demo buttons
1117  $("a[href*='" + window.location.hostname + "/signup/']").not('.ignoreMob').each(function () {
1118      var link = $(this).attr('href');
1119      link = link.replace('/signup/?sv=', '/signup/?sv=mobile-');
1120
1121      $(this).attr('href', link);
1122  });
1123
1124  // Add "mobile" specification to all SVs when user is on mobile device
1125  $("a[href*='" + window.location.hostname + "/contact-sales/']").not('.ignoreMob').each(function () {
1126      var link = $(this).attr('href');
1127      link = link.replace('/contact-sales/?sv=', '/contact-sales/?sv=mobile-');
1128
1129      $(this).attr('href', link);
1130  });
1131
1132  // Add "mobile" specification to all SVs when user is on mobile device
1133  $("a[href*='" + window.location.hostname + "/demo/direct/']").not('.ignoreMob').each(function () {
1134      var link = $(this).attr('href');
1135      link = link.replace('/demo/direct/?sv=', '/demo/direct/?sv=mobile-');
1136
1137      $(this).attr('href', link);
1138  });
1139
1140  if ($("#pre-signup-form").length > 0) {
1141      // Button
1142      var new_link = $("#pre-signup").data("mob-href");
1143      if (typeof new_link !== "undefined") {
1144          var link = $("#pre-signup").attr("href");
1145          var sv = link.split("?sv=");
1146          sv = "mobile-"+sv[1];
1147          new_link = new_link.split("?sv=");
1148          new_link = new_link[0]+"?sv="+sv;
1149          $("#pre-signup").attr("href", new_link);
1150      }
1151
1152      // Tag
1153      if ($("#pre-signup-form").children('.tag').length > 0) {
1154          $("#pre-signup-form").children('.tag').text($("#pre-signup-form").children('.tag').data("mob-tag"));
1155      }
1156  }
1157}
1158
1159/*
1160* AJAX Subscribe for the newsletter
1161*/
1162
1163$(function () {
1164  $("#subForm input[type=email]").focus(function () {
1165      $(this).attr('placeholder', '');
1166      $("#subForm span.label").animate({top: '-10px', opacity: '1'}, 200);
1167      $("#subForm .subscribe").addClass('active');
1168  });
1169
1170  $("#subForm input[type=email]").blur(function () {
1171      if ($(this).val() == '') {
1172          var input = $(this);
1173          $("#subForm span.label").animate({top: '0px', opacity: '0'}, 150, function () {
1174              input.attr('placeholder', 'Join our newsletter for email marketing tips');
1175          });
1176          $("#subForm .subscribe").removeClass('active');
1177
1178      }
1179  });
1180
1181  $("#subForm input[type=email]").keyup(function () {
1182      $("#subForm .label").removeClass("error");
1183      $("#subForm input[type=email]").removeClass("error");
1184  });
1185
1186  $("#subForm .cmbtn").not('.disabled').click(function () {
1187      $('#subForm').submit();
1188  });
1189
1190  // Not using cmForm library here due to its uniqueness
1191  $('#subForm').submit(function (e) {
1192      e.preventDefault();
1193      var btn = $("#subForm .cmbtn");
1194      var form = $(this);
1195      if (!btn.hasClass('disabled') && $("#subForm input[type=email]").val() !== '') {
1196          var errors = false;
1197          var fieldsArray = $('#subForm').serializeArray();
1198          var fields = {};
1199          $.each(fieldsArray, function (i, field) {
1200              var name = field.name;
1201              var value = field.value;
1202
1203              if (name === 'cm-vuullj-vuullj' && !isValidEmailAddress(value)) {
1204                  errors = true;
1205              }
1206
1207              if (name == 'check-alive' && value != '') {
1208                  errors = true;
1209              }
1210
1211              fields[field.name] = field.value;
1212          });
1213          if (errors) {
1214              setError(form, 'cm-vuullj-vuullj', 'Please enter a valid email address');
1215              return false;
1216          }
1217          if (typeof (fields['check-alive']) !== 'undefined') {
1218              if (fields['check-alive'] !== '')
1219                  return false;
1220          }
1221
1222          btn.addClass('disabled');
1223          fields['CS_account'] = "campmon";
1224          fields['CS_listID'] = "ba019aa688c3c9df26e2d2d092609051";
1225          fields['CS_fieldMap'] = {"name": "cm-name", "email": "cm-vuullj-vuullj"};
1226          fields['cm-name'] = '';
1227          $.post(this.action, fields, function (response) {
1228              btn.removeClass('disabled');
1229              if (!response) {
1230                  // Error
1231                  setError(form, 'cm-vuullj-vuullj', 'Something went wrong, please try again');
1232                  return false;
1233              } else {
1234                  // Success
1235                  $("#subForm input[type=email]").val('').blur();
1236                  $("#subResponse").addClass("show").text("Thanks. You're all set to receive our newsletter.");
1237              }
1238          });
1239      } else {
1240          setError(form, 'cm-vuullj-vuullj', 'Please enter a valid email address');
1241          return false;
1242      }
1243  });
1244});
1245
1246function setError(form, field, msg) {
1247  if (form.find("[name=" + field + "]").length > 0) {
1248      form.find("[name=" + field + "]").next('.error_field').remove();
1249      form.find("[name=" + field + "]").addClass('error').after("<span class='error_field'>" + msg + "</span>");
1250      form.find("[name=" + field + "]").focus(function () {
1251          $(this).removeClass('error').next('.error_field').fadeOut(300, function () {
1252              $(this).remove();
1253          });
1254      });
1255  }
1256}
1257
1258function isValidEmailAddress(emailAddress) {
1259  var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
1260  return pattern.test(emailAddress);
1261}
1262
1263/*
1264* Mobile Sales number popup
1265*/
1266
1267$(".sub-footer .social .phone .number").click(function () {
1268  if ($('body').width() <= 1010) {
1269      $("#sales_overlay").fadeIn(function () {});
1270      $("#sales_overlay .cmbtn").delay(250).animate({'opacity': 1, 'margin-top': '-32px'}, 500);
1271  }
1272});
1273
1274$("#sales_overlay .overlay").click(function () {
1275  $("#sales_overlay .cmbtn").animate({'opacity': 0, 'margin-top': '-37px'}, 500, function () {});
1276  $('#sales_overlay').delay(250).fadeOut(function () {
1277      $(this).find('.cmbtn').removeAttr('style');
1278  });
1279});
1280
1281/*
1282* Cross browser base64 encoder/decoder
1283*/
1284
1285function base64_encode( str )
1286{
1287  if (window.btoa) // Internet Explorer 10 and above
1288      return window.btoa(unescape(encodeURIComponent( str )));
1289  else
1290  {
1291      // Cross-Browser Method (compressed)
1292      // Create Base64 Object
1293      var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}}
1294      // Encode the String
1295      return Base64.encode(unescape(encodeURIComponent( str )));
1296  }
1297}
1298
1299function base64_decode( str )
1300{
1301  if (window.atob) // Internet Explorer 10 and above
1302      return decodeURIComponent(escape(window.atob( str )));
1303  else
1304  {
1305      // Cross-Browser Method (compressed)
1306      // Create Base64 Object
1307      var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1307+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}}
1308      // Encode the String
1309      return decodeURIComponent(escape(Base64.decode( str )));
1310  }
1311}
1312
1313// // * Features dropdown test 10/27
1314// const enable = $('div.feat_drop');
1315// const toggler = $('li.has-dropdown')
1316// if (enable.length) {
1317//   toggler.removeClass('open');
1318
1319//   toggler.click(function(e) {
1320//     if (e.target == this) {
1321//       toggler.toggleClass('open');
1322//     }
1323//   });
1324// }
1325
1326/*
1327* Globalisation for Pricing page
1328*/
1329
1330function storePricingData() {
1331  // Store pricing data
1332  var pdata = get_cookie("CM-location-dv8");
1333  var href = window.location.href;
1334  if (!pdata && href.indexOf('https://help.c') === -1 && href.indexOf('force.com') === -1) {
1335    $.getJSON("/marketing-includes/_inc/cookieset/", function (data) {
1336        var encdata = btoa(unescape(encodeURIComponent(JSON.stringify(data))));
1337        set_cookie("CM-location-dv7", encdata);
1338        if (href.indexOf('/pricing/') > -1 || href.indexOf('/pick-your-plan') > -1) {
1339            var hrefsplit = href.split('?');
1340            window.location = hrefsplit[0];
1341            //updatePricing(data);
1342        }
1343    });
1344  }
1345}
1346
1347$(function () {
1348  // Determine location
1349  setExistingLocale();
1350  if (!window['locale'].region || !window['locale'].countryName || !window['locale'].timezone || !window['locale'].stateName || !window['locale'].cityName || !window['locale'].zip || !window['locale'].countryISO) {
1351    determineLocation(storePricingData);
1352  } else {
1353    setLocationCookies();
1354    storePricingData();
1355  }
1356
1357});
1358
1359function setExistingLocale(whichRegion) {
1360  window['locale'] = {
1361      countryName:    get_cookie("CM-location-country"),
1362      countryISO:     get_cookie("CM-location-abbr"),
1363      timezone:       get_cookie("CM-location-timezone"),
1364      cityName:       get_cookie("CM-location-city"),
1365      stateName:      get_cookie("CM-location-state"),
1366      zip:            get_cookie("CM-location-zip"),
1367      euResident:     get_cookie("CM-location-eu"),
1368      status:         get_cookie("CM-location-status"),
1369  };
1370
1371  if (typeof(whichRegion) !== "undefined" && whichRegion === true)
1372      window['locale'].region = get_cookie("CM-location-set");
1373  else
1374      window['locale'].region = get_cookie("CM-location-check");
1375}
1376
1377function determineLocation(pricingDataCallback) {
1378  window['locale'] = {};
1379
1380  var onSuccess = function (geoipResponse) {
1381      // console.log("determineLocation - geoip:", geoipResponse);
1382      // Continent Name
1383      if ("continent" in geoipResponse)
1384          window['locale'].continentName = geoipResponse.continent;
1385      // Region
1386      if ("region" in geoipResponse)
1387          window['locale'].region = geoipResponse.region;
1388      // Country Name
1389      if ("country" in geoipResponse)
1390          window['locale'].countryName = geoipResponse.country;
1391      // Country ISO
1392      if ("countryISO" in geoipResponse)
1393          window['locale'].countryISO = geoipResponse.countryISO;
1394      // Timezone
1395      if ("timezone" in geoipResponse)
1396          window['locale'].timezone = geoipResponse.timezone;
1397      // City Name
1398      if ("city" in geoipResponse)
1399          window['locale'].cityName = geoipResponse.city;
1400      // State Name
1401      if ("state" in geoipResponse)
1402          window['locale'].stateName = geoipResponse.state;
1403      // Zip/Postcode
1404      if ("zip" in geoipResponse)
1405          window['locale'].zip = geoipResponse.zip;
1406      // Is EU Resident
1407      if ("isEUresident" in geoipResponse)
1408          window['locale'].euResident = geoipResponse.isEUresident;
1409      // Locale set
1410      if ("status" in geoipResponse)
1411          window['locale'].status = geoipResponse.status;
1412
1413      // Set cookies for future pageloads
1414      setLocationCookies();
1415
1416      if (pricingDataCallback) {
1417        pricingDataCallback();
1418      }
1419  };
1420
1421  var onError = function (error) {
1422      // console.log(error);
1423      // Continent Name
1424      window['locale'].continentName = 'Europe';
1425      // Region
1426      window['locale'].region = 'unitedkingdom';
1427      // Country Name
1428      window['locale'].countryName = 'United Kingdom';
1429      // Country ISO
1430      window['locale'].countryISO = 'UK';
1431      // Timezone
1432      //window['locale'].timezone = 'America/Los Angeles';
1433      // City Name
1434      //window['locale'].cityName = 'Los Angeles';
1435      // State Name
1436      //window['locale'].stateName = 'California';
1437      // Zip/Postcode
1438      //window['locale'].zip = '90001';
1439      // Is EU Resident
1440      window['locale'].euResident = true;
1441      // Locale set
1442      window['locale'].status = false;
1443
1444      // Set cookies for future pageloads
1445      setLocationCookies();
1446  }
1447
1448  geoLocate(onSuccess, onError);
1449}
1450
1451function setLocationCookies(show_note) {
1452  if (typeof(show_note) === "undefined") show_note = true;
1453  var check_region = window['locale'].region;
1454  if (get_cookie("CM-location-check") && get_cookie("CM-location-set") && window['locale'].region !== get_cookie("CM-location-set")) {
1455      // User has changed regions AND not responded to the cookie notification. force check
1456      check_region = get_cookie("CM-location-set");
1457
1458  } else if (!get_cookie("CM-location-check") && get_cookie("CM-location-set") && window['locale'].region == get_cookie("CM-location-set")) {
1459      if (window['consent_cookie_name'] && get_cookie(window['consent_cookie_name']) === null && display_regions.indexOf(window['locale'].region) > -1) {
1460          // EU users first visit since GDPR code implemented
1461          //delete_cookie(); // on and after May 25th
1462
1463          // TEMPORARY :: Before May 25th - provide historical accept/deny notice
1464
1465      } // Not in the EU just sets the cookie and moves on
1466
1467      set_cookie("CM-location-check", window['locale'].region, 7);
1468
1469  } else if (!get_cookie("CM-location-check") && get_cookie("CM-location-set") && window['locale'].region !== get_cookie("CM-location-set")) {
1470      // User has changed regions
1471      if (display_regions.indexOf(window['locale'].region) == -1) {
1472          // Previously EU
1473          check_region = get_cookie("CM-location-set");
1474          set_cookie("CM-location-check", get_cookie("CM-location-set"), 7);
1475      } else {
1476          set_cookie("CM-location-check", window['locale'].region, 0.04); // Set for under an hour
1477      }
1478
1479  } else if (!get_cookie("CM-location-check") && "region" in window['locale']) set_cookie("CM-location-check", window['locale'].region, 7);
1480
1481  if (!get_cookie("CM-location-set") && "region" in window['locale']) set_cookie("CM-location-set", window['locale'].region);
1482  if (!get_cookie("CM-location-country") && "countryName" in window['locale']) set_cookie("CM-location-country", window['locale'].countryName);
1483  if (!get_cookie("CM-location-abbr") && "countryISO" in window['locale']) set_cookie("CM-location-abbr", window['locale'].countryISO);
1484  if (!get_cookie("CM-location-timezone") && "timezone" in window['locale']) set_cookie("CM-location-timezone", window['locale'].timezone);
1485  if (!get_cookie("CM-location-city") && "cityName" in window['locale']) set_cookie("CM-location-city", window['locale'].cityName);
1486  if (!get_cookie("CM-location-state") && "stateName" in window['locale']) set_cookie("CM-location-state", window['locale'].stateName);
1487  if (!get_cookie("CM-location-zip") && "zip" in window['locale']) set_cookie("CM-location-zip", window['locale'].zip);
1488  if (!get_cookie("CM-location-eu") && "euResident" in window['locale']) set_cookie("CM-location-eu", window['locale'].euResident);
1489  if (!get_cookie("CM-location-status") && "status" in window['locale']) set_cookie("CM-location-status", window['locale'].status);
1490
1491  var consent = true;
1492  if (display_regions.indexOf(check_region) === -1) consent = false;
1493  if (!get_cookie("CM-location-gdpr") || (get_cookie("CM-location-gdpr") == 'true' ? true : false) !== consent) {
1494      set_cookie("CM-location-gdpr", consent);
1495  }
1496
1497  // Populate any country form fields
1498  updateForms(window['locale'].countryName, window['locale'].timezone, window['locale'].stateName, window['locale'].cityName, window['locale'].zip);
1499  setPhonenumber(window['locale'].region);
1500
1501  // PARSE country to segment
1502  if (typeof (analytics) !== "undefined") {
1503      if (window['locale'].status === true) {
1504          analytics.identify({
1505              country: window['locale'].countryName,
1506              timezone: window['locale'].timezone,
1507              city: window['locale'].cityName,
1508              state: window['locale'].stateName,
1509              zip: window['locale'].zip
1510          });
1511      } else if (window['locale'].status === false) {
1512          analytics.identify({
1513              country: "notfound"
1514          });
1515      }
1516  }
1517
1518  // Show cookie notification if needed
1519  if (show_note)
1520      displayCookieNote(check_region);
1521}
1522
1523function geoLocate(onSuccess, onError) {
1524  var formsGeo = '/marketing-includes/forms/geo/';
1525  var href = window.location.href;
1526
1527  if (href.indexOf('https://help.c') === -1 && href.indexOf('force.com') === -1) {
1528    $.getJSON(formsGeo, function(locale) {
1529      // console.log(locale);
1530      onSuccess(locale);
1531    }).fail(onError);
1532  }
1533}
1534
1535function setPhonenumber(region) {
1536  if ($(".phonenumber[data-region=" + region + "]").length > 0) {
1537      $(".phonenumber.active").removeClass('active');
1538      $(".phonenumber[data-region=" + region + "]").addClass('active');
1539  }
1540}
1541
1542function updateForms(country, timezone, state, city, zip) {
1543  $("input#country.mmpop").val(country);
1544  $("input#Timezone__c").val(timezone);
1545  $("input#state").val(state);
1546  $("input#city").val(city);
1547  $("input#zip").val(zip);
1548}
1549
1550function displayCookieNote(region) {
1551  if (typeof (region) == 'undefined')
1552      region = get_cookie('CM-location-set');
1553  if (display_regions.indexOf(region) > -1) {
1554      if (window['consent_cookie_name'] && get_cookie(window['consent_cookie_name']) && get_cookie(window['consent_cookie_name']) !== 'implied') {
1555          // Do nothing - we already have what we need
1556          cookie_consent.given = (get_cookie(window['consent_cookie_name']) === 'true');
1557      } else {
1558          // Animate in Cookie Notification
1559          var cookie_note = $("#cookie-notification");
1560          cookie_note.show().animate({'margin-top': '-' + cookie_note.outerHeight()}, 250);
1561      }
1562  } else {
1563      if (window['consent_cookie_name'] && !get_cookie(window['consent_cookie_name']))
1564          set_cookie(window['consent_cookie_name'], 'implied');
1565      cookie_consent.given = true;
1566  }
1567}
1568
1569// HIDE COOKIE NOTIFICATION
1570$("#cookie-consent a.cmbtn").click(function () {
1571  var cookie_note = $("#cookie-notification");
1572  cookie_note.animate({'margin-top': '0'}, 250, function () {
1573      $(this).remove();
1574  });
1575  var consent = false;
1576  if ($(this).attr('id') === "cookie-give-consent") {
1577      consent = true;
1578  }
1579  updateConsent(consent);
1580});
1581
1582function updateConsent(consent, show_note) {
1583  if (typeof(show_note) === "undefined") show_note = true;
1584  if (!consent) {
1585      setExistingLocale(true);
1586      setLocationCookies(show_note);
1587      delete_cookie();
1588  }
1589  cookie_consent.given = consent;
1590  if (window['consent_cookie_name'])
1591      set_cookie(window['consent_cookie_name'], consent);
1592}
1593
1594function updatePricing(data) {
1595
1596  /* Monthly */
1597  $.each(data.monthly, function (tier, tierObj) {
1598      /* Title */
1599      $("#subscribers .pricing ." + tier + " h2").text(tierObj.title);
1600      /* Values */
1601      $.each(tierObj.rates, function (maxTier, rateObj) {
1602          $("#subscribers .count button[data-people-count=" + maxTier + "]").data(tier + "-price", (rateObj.RateInCents / 100));
1603          if (rateObj.SendLimit !== null) {
1604              $("#subscribers .count button[data-people-count=" + maxTier + "]").data(tier + "-send-limits", rateObj.SendLimit);
1605          }
1606      });
1607  });
1608
1609  /* PAYG Values */
1610  $("#payg .price .campaign .figure").text((data.payg.DeliveryFeeInCents / 100));
1611  $("#payg .price .recipient .figure").text(data.payg.CostPerRecipient);
1612
1613  /* Currency */
1614  $("#subscribers .pricing .table .price .dollar, #payg .price .campaign .dollar").html(data.MajorSymbol);
1615  $("#payg .price .recipient .dollar").html(data.MinorSymbolAbbreviated);
1616  $("#subscribers .pricing .table .price .currency, #payg .price .campaign .currency").text(data.Currency);
1617  $("#subscribers .notset").fadeIn(function () {
1618      $(this).removeClass('notset');
1619  });
1620}
1621
1622var user_country = false;
1623if (typeof (get_cookie) === typeof (Function))
1624  user_country = get_cookie('CM-location-abbr');
1625
1626if (user_country && country_cta_override.indexOf(user_country) > -1) {
1627  // Update all demo and expert buttons to signup buttons
1628  $("a[href*='" + window.location.hostname + "/demo/direct/'], a[href*='" + window.location.hostname + "/our-experts/']").each(function () {
1629      var link = $(this).attr('href');
1630      var label = $(this).text();
1631      link = link.replace('/demo/direct/?sv=', '/signup/?sv=');
1632      link = link.replace('/our-experts/?sv=', '/signup/?sv=');
1633      if (label.toLowerCase() == 'demo')
1634          label = 'Sign up';
1635      else
1636          label = 'Get started for free';
1637      if ($(this).hasClass('secondary') || $(this).hasClass('tertiary'))
1638          $(this).attr('href', link).text(label).removeClass('secondary').removeClass('tertiary').addClass('primary shortbtn');
1639      else
1640          $(this).attr('href', link).text(label);
1641
1642      // Check its siblings
1643      if ($(this).next("a[href*='" + window.location.hostname + "/signup/']").length > 0) {
1644          $(this).next("a[href*='" + window.location.hostname + "/signup/']").remove();
1645          $(this).css('float', 'none').parent().css({'text-align': 'center', 'display': 'block'});
1646      } else if ($(this).prev("a[href*='" + window.location.hostname + "/signup/']").length > 0) {
1647          $(this).prev("a[href*='" + window.location.hostname + "/signup/']").remove();
1648          $(this).css('float', 'none').parent().css({'text-align': 'center', 'display': 'block'});
1649      }
1650
1651      // Check if it still has siblings and update accordingly
1652      if ($(this).parent(".btn-container").length == 1 && $(this).parent(".btn-container").children('a').length > 1) {
1653          $(this).addClass('shortbtn').parent().css({'max-width': '480px'});
1654      }
1655  });
1656}
1657
1658/*
1659* Scroll to Top
1660*/
1661
1662$(".scroll").click(function (e) {
1663  $("html, body").animate({scrollTop: 0}, 500);
1664  e.preventDefault()
1665});
1666
1667/*
1668* Placeholder plugin for jQuery
1669* Daniel Stocks
1670* http://webcloud.se
1671* Released under the MIT, BSD, and GPL Licenses.
1672*/
1673
1674(function ($) {
1675  function Placeholder(input) {
1676      this.input = input;
1677      if (input.attr('type') == 'password') {
1678          this.handlePassword();
1679      }
1680      $(input[0].form).submit(function () {
1681          if (input.hasClass('placeholder') && input[0].value == input.attr('placeholder')) {
1682              input[0].value = '';
1683          }
1684      });
1685  }
1686  Placeholder.prototype = {
1687      show: function (loading) {
1688          if (this.input[0].value === '' || (loading && this.valueIsPlaceholder())) {
1689              if (this.isPassword) {
1690                  try {
1691                      this.input[0].setAttribute('type', 'text');
1692                  } catch (e) {
1693                      this.input.before(this.fakePassword.show()).hide();
1694                  }
1695              }
1696              this.input.addClass('placeholder');
1697              this.input[0].value = this.input.attr('placeholder');
1698          }
1699      },
1700      hide: function () {
1701          if (this.valueIsPlaceholder() && this.input.hasClass('placeholder')) {
1702              this.input.removeClass('placeholder');
1703              this.input[0].value = '';
1704              if (this.isPassword) {
1705                  try {
1706                      this.input[0].setAttribute('type', 'password');
1707                  } catch (e) {
1708                  }
1709                  this.input.show();
1710                  this.input[0].focus();
1711              }
1712          }
1713      },
1714      valueIsPlaceholder: function () {
1715          return this.input[0].value == this.input.attr('placeholder');
1716      },
1717      handlePassword: function () {
1718          var input = this.input;
1719          input.attr('realType', 'password');
1720          this.isPassword = true;
1721          if ($.browser && $.browser.msie && input[0].outerHTML) {
1722              var fakeHTML = $(input[0].outerHTML.replace(/type=(['"])?password\1
1722/gi, 'type=$1text$1'));
1723              this.fakePassword = fakeHTML.val(input.attr('placeholder')).addClass('placeholder').focus(function () {
1724                  input.trigger('focus');
1725                  $(this).hide();
1726              });
1727              $(input[0].form).submit(function () {
1728                  fakeHTML.remove();
1729                  input.show()
1730              });
1731          }
1732      }
1733  };
1734  var NATIVE_SUPPORT = !!("placeholder" in document.createElement("input"));
1735  $.fn.placeholder = function () {
1736      return NATIVE_SUPPORT ? this : this.each(function () {
1737          var input = $(this);
1738          var placeholder = new Placeholder(input);
1739          placeholder.show(true);
1740          input.focus(function () {
1741              placeholder.hide();
1742          });
1743          input.blur(function () {
1744              placeholder.show(false);
1745          });
1746
1747          if ($.browser && $.browser.msie) {
1748              $(window).on('load', function () {
1749                  if (input.val()) {
1750                      input.removeClass("placeholder");
1751                  }
1752                  placeholder.show(true);
1753              });
1754              input.focus(function () {
1755                  if (this.value == "") {
1756                      var range = this.createTextRange();
1757                      range.collapse(true);
1758                      range.moveStart('character', 0);
1759                      range.select();
1760                  }
1761              });
1762          }
1763      });
1764  }
1765})(jQuery);
1766$('input[placeholder], textarea[placeholder]').placeholder();
1767
1768/*
1769* Remove sticky hover states on touch devices
1770*/
1771
1772if ('createTouch' in document)
1773{
1774  try
1775  {
1776      var ignore = /:hover�/;
1777      for (var i = 0; i < document.styleSheets.length; i++)
1778      {
1779          var sheet = document.styleSheets[i];
1780          for (var j = sheet.cssRules.length - 1; j >= 0; j--)
1781          {
1782              var rule = sheet.cssRules[j];
1783              if (rule.type === CSSRule.STYLE_RULE && ignore.test(rule.selectorText))
1784              {
1785                  sheet.deleteRule(j);
1786              }
1787          }
1788      }
1789  } catch (e) {
1790  }
1791}
1792
1793/*
1794* Check if _gaq is not available and run function for GTM instead
1795*/
1796
1797if (typeof _gaq === 'undefined' || typeof _gaq !== 'object') {
1798  var _gaq = {};
1799  _gaq.push = function (array) {
1800      if (typeof(dataLayer) !== "undefined") {
1801          if (array[0] === '_trackPageview') {
1802              dataLayer.push({
1803                  'event': 'pageview',
1804                  'pagePath': array[1]
1805              });
1806          } else if (array[0] === '_trackEvent') {
1807              dataLayer.push({
1808                  'event': 'event',
1809                  'category': array[1],
1810                  'action': array[2],
1811                  'label': array[3],
1812                  'value': array[4]
1813              });
1814          } else if (array[0] === '_trackSocial') {
1815              dataLayer.push({
1816                  'event': 'social',
1817                  'network': array[1],
1818                  'action': array[2],
1819                  'target': array[3]
1820              });
1821          }
1822      }
1823  }
1824}
1825
1826function getUrlVars() {
1827  var vars = {};
1828  var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
1829      vars[key] = value;
1830  });
1831  return vars;
1832}
1833
1834/*
1835* Exit intent popup
1836*/
1837
1838if (activate_page && !visitor_data) {
1839  //console.log("HailMary set");
1840  addEvent(document, "mouseout", fireHailMary);
1841}
1842if (typeof (set_cookie) === typeof (Function))
1843  set_cookie("CM-Init-Visit", true);
1844
1845function fireHailMary(e) {
1846  e = e ? e : window.event;
1847  var from = e.relatedTarget || e.toElement;
1848  if (!from || from.nodeName == "HTML") {
1849      var querystring = '';
1850      var cid = '';
1851      if (hailmary_map[activate_page].cid !== '') {
1852          cid = "&cid=" + hailmary_map[activate_page].cid;
1853          querystring = "?q";
1854      }
1855      var gate = '';
1856      if (hailmary_map[activate_page].gate === true) {
1857          gate = "&g";
1858          querystring = "?q";
1859      }
1860      var sv = '';
1861      if (hailmary_map[activate_page].sv === true) {
1862          sv = "&sv=" + hailmary_map[activate_page].sv;
1863          querystring = "?q";
1864      }
1865
1866      $("body").append("<div id='hailmary'><div><a href='" + hailmary_map[activate_page].link + querystring + sv + gate + cid + "' target='_blank' rel='noopener'><img src='/wp-content/themes/cm-theme/assets/images/hailmary/" + hailmary_map[activate_page].image + "' /></a><span class='close'></span></div></div>");
1867
1868      parseUTMvars($("#hailmary a"));
1869
1870      $("#hailmary").fadeIn(100).one('click', function () {
1871          $(this).fadeOut(100, function () {
1872              $(this).remove();
1873          });
1874      });
1875
1876      $("#hailmary a").one('click', function () {
1877          $("#hailmary").fadeOut(100, function () {
1878              $(this).remove();
1879          });
1880      });
1881
1882      removeEvent(document, "mouseout", fireHailMary);
1883  }
1884}
1885
1886function containsAny(str, substrings) {
1887  for (var i = 0; i != substrings.length; i++) {
1888      var substring = substrings[i];
1889      if (str.indexOf(substring) != -1) {
1890          return substring;
1891      }
1892  }
1893  return null;
1894}
1895
1896function addEvent(obj, evt, fn) {
1897  if (obj.addEventListener) {
1898      obj.addEventListener(evt, fn, false);
1899  } else if (obj.attachEvent) {
1900      obj.attachEvent("on" + evt, fn);
1901  }
1902}
1903
1904function removeEvent(obj, evt, fn) {
1905  if (obj.removeEventListener) {
1906      obj.removeEventListener(evt, fn, false);
1907  } else if (obj.detachEvent) {
1908      obj.detachEvent("on" + evt, fn);
1909  }
1910}
1911
1912/*
1913* Automatically attach UTM vars to links with data-passvar set
1914* TEMP FIX - adding UTMs to signup buttons for paid attribution tracking
1915* MAJOR TEMP FIX - add UTMs to all links if exists in URL
1916*/
1917
1918// $("[data-passvar], a[href*='/signup/']").each(function () {
1919//     parseUTMvars($(this));
1920// });
1921
1922if (window.location.search.indexOf('utm_') > -1) {
1923  $("[data-passvar], a[href*='" + window.location.hostname + '/' + "']").not("[data-noqs]").each(function () {
1924      parseUTMvars($(this));
1925  });
1926}
1927
1928function parseUTMvars(ele) {
1929  var getVars = getUrlVars();
1930  var url = ele.attr("href");
1931  if (url.indexOf('?') == -1) {
1932      url = url + "?1=1";
1933  }
1934
1935  if (typeof window['addVars'] === "undefined") window['addVars'] = "";
1936  if (window['addVars'] === "") {
1937      for (var key in getVars) {
1938          if (getVars.hasOwnProperty(key) && (key.indexOf('utm_') > -1 || key === 'cid')) {
1939              window['addVars'] = window['addVars'] + "&" + key + "=" + getVars[key];
1940          }
1941      }
1942  }
1943
1944  url = url + addVars;
1945  
1946  ele.attr("href", url);
1947}
1948
1949/*
1950*  Lazy load
1951*/
1952
1953$("img[data-src]").on('inview', function(e,v){
1954  if (v && !$(this).hasClass('loaded')) {
1955      $(this).attr('src', $(this).data('src')+new Date().getTime()); // Date hack for safari load
1956      if ($(this).data('srcset')) {
1957          $(this).attr('srcset', $(this).data('srcset'));
1958      }
1959      $(this).on('load', function() {
1960          $(this).removeAttr('data-src').removeAttr('data-srcset').addClass('loaded');
1961      });
1962  }
1963});
1964
1965$(".llbg[data-src]").on('inview', function(e,v){
1966  if (v && !$(this).hasClass('loaded')) {
1967      var path = $(this).data('src');
1968      var block = $(this);
1969      $('<img/>').attr('src', path).on('load', function() {
1970          $(this).remove();
1971          block.css('background-image', 'url('+path+')').removeAttr('data-src').addClass('loaded');
1972      });
1973  }
1974});
1975
1976$("video.llvid").on('inview', function(e,v){
1977  if (v && !$(this).hasClass('loaded')) {
1978      var poster = $(this).data('poster');
1979      var mp4 = $(this).data('mp4src');
1980      var ogg = $(this).data('oggsrc');
1981      var webm = $(this).data('webmsrc');
1982      var formats = {
1983          ogg: 'video/ogg; codecs="theora"',
1984          h264: 'video/mp4; codecs="avc1.42E01E"',
1985          m4a: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
1986          mpeg4: 'video/mp4; codecs="mp4v.20.8"',
1987          webm: 'video/webm; codecs="vp8, vorbis"',
1988          vp9: 'video/webm; codecs="vp9"',
1989          hls: 'application/x-mpegURL; codecs="avc1.42E01E"'
1990      };
1991      var vtest = document.createElement('video');
1992      var block = $(this);
1993      $('<img/>').attr('src', poster).on('load', function() {
1994          $(this).remove();
1995          block.attr('poster', poster).removeAttr('data-poster').addClass('loaded');
1996          if (vtest.canPlayType(formats['h264']) || vtest.canPlayType(formats('hls')) || vtest.canPlayType(formats('m4a')) || vtest.canPlayType(formats('mpeg4'))) {
1997              block.append('<source src="'+mp4+'"  type="video/mp4" />');
1998          } else if (vtest.canPlayType(formats['webm']) || vtest.canPlayType(formats('vp9'))) {
1999              block.append('<source src="'+webm+'"  type="video/webm" />');
2000          } else if (vtest.canPlayType(formats['ogg'])) {
2001              block.append('<source src="'+ogg+'"  type="video/ogg" />');
2002          }
2003      });
2004  }
2005});
2006
2007$("iframe.llif").on('inview', function(e,v){
2008  if (v && !$(this).hasClass('loaded')) {
2009      $(this).attr('src', $(this).data('src')).on('load', function() {
2010          $(this).removeAttr('data-src').addClass('loaded');
2011      });
2012  }
2013});
2014
2015/*
2016  * @description Prepends https:// to the form input value if it doesn't exist
2017*/
2018function checkUrl() {
2019  $('#cmFormInput').on('blur', function() {
2020      var string = $(this).val();
2021      if (!string.match(/^https?:/) && string.length) {
2022          string = "https://" + string;
2023          $(this).val(string)
2024          console.log(string);
2025      }
2026  })
2027}
2028
2029checkUrl();
2030/*! VelocityJS.org (1.2.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
2031/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
2032!function(e){function t(e){var t=e.length,r=$.type(e);return"function"===r||$.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e}if(!e.jQuery){var $=function(e,t){return new $.fn.init(e,t)};$.isWindow=function(e){return null!=e&&e==e.window}
vendor: 32,408 bytes, lines 2032-2033
2032,$.type=function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?a[o.call(e)]||"object":typeof e},$.isArray=Array.isArray||function(e){return"array"===$.type(e)},$.isPlainObject=function(e){var t;if(!e||"object"!==$.type(e)||e.nodeType||$.isWindow(e))return!1;try{if(e.constructor&&!n.call(e,"constructor")&&!n.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}for(t in e);return void 0===t||n.call(e,t)},$.each=function(e,r,a){var n,o=0,i=e.length,s=t(e);if(a){if(s)for(;i>o&&(n=r.apply(e[o],a),n!==!1);o++);else for(o in e)if(n=r.apply(e[o],a),n===!1)break}else if(s)for(;i>o&&(n=r.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=r.call(e[o],o,e[o]),n===!1)break;return e},$.data=function(e,t,a){if(void 0===a){var n=e[$.expando],o=n&&r[n];if(void 0===t)return o;if(o&&t in o)return o[t]}else if(void 0!==t){var n=e[$.expando]||(e[$.expando]=++$.uuid);return r[n]=r[n]||{},r[n][t]=a,a}},$.removeData=function(e,t){var a=e[$.expando],n=a&&r[a];n&&$.each(t,function(e,t){delete n[t]})},$.extend=function(){var e,t,r,a,n,o,i=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof i&&(u=i,i=arguments[s]||{},s++),"object"!=typeof i&&"function"!==$.type(i)&&(i={}),s===l&&(i=this,s--);l>s;s++)if(null!=(n=arguments[s]))for(a in n)e=i[a],r=n[a],i!==r&&(u&&r&&($.isPlainObject(r)||(t=$.isArray(r)))?(t?(t=!1,o=e&&$.isArray(e)?e:[]):o=e&&$.isPlainObject(e)?e:{},i[a]=$.extend(u,o,r)):void 0!==r&&(i[a]=r));return i},$.queue=function(e,r,a){function n(e,r){var a=r||[];return null!=e&&(t(Object(e))?!function(e,t){for(var r=+t.length,a=0,n=e.length;r>a;)e[n++]=t[a++];if(r!==r)for(;void 0!==t[a];)e[n++]=t[a++];return e.length=n,e}(a,"string"==typeof e?[e]:e):[].push.call(a,e)),a}if(e){r=(r||"fx")+"queue";var o=$.data(e,r);return a?(!o||$.isArray(a)?o=$.data(e,r,n(a)):o.push(a),o):o||[]}},$.dequeue=function(e,t){$.each(e.nodeType?[e]:e,function(e,r){t=t||"fx";var a=$.queue(r,t),n=a.shift();"inprogress"===n&&(n=a.shift()),n&&("fx"===t&&a.unshift("inprogress"),n.call(r,function(){$.dequeue(r,t)}))})},$.fn=$.prototype={init:function(e){if(e.nodeType)return this[0]=e,this;throw new Error("Not a DOM node.")},offset:function(){var t=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:t.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:t.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function e(){for(var e=this.offsetParent||document;e&&"html"===!e.nodeType.toLowerCase&&"static"===e.style.position;)e=e.offsetParent;return e||document}var t=this[0],e=e.apply(t),r=this.offset(),a=/^(?:body|html)$/i.test(e.nodeName)?{top:0,left:0}:$(e).offset();return r.top-=parseFloat(t.style.marginTop)||0,r.left-=parseFloat(t.style.marginLeft)||0,e.style&&(a.top+=parseFloat(e.style.borderTopWidth)||0,a.left+=parseFloat(e.style.borderLeftWidth)||0),{top:r.top-a.top,left:r.left-a.left}}};var r={};$.expando="velocity"+(new Date).getTime(),$.uuid=0;for(var a={},n=a.hasOwnProperty,o=a.toString,i="Boolean Number String Function Array Date RegExp Object Error".split(" "),s=0;s<i.length;s++)a["[object "+i[s]+"]"]=i[s].toLowerCase();$.fn.init.prototype=$.fn,e.Velocity={Utilities:$}}}(window),function(e){"object"==typeof module&&"object"==typeof module.exports?module.exports=e():"function"==typeof define&&define.amd?define(e):e()}(function(){return function(e,t,r,a){function n(e){for(var t=-1,r=e?e.length:0,a=[];++t<r;){var n=e[t];n&&a.push(n)}return a}function o(e){return g.isWrapped(e)?e=[].slice.call(e):g.isNode(e)&&(e=[e]),e}function i(e){var t=$.data(e,"velocity");return null===t?a:t}function s(e){return function(t){return Math.round(t*e)*(1/e)}}function l(e,r,a,n){function o(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,r){return((o(t,r)*e+i(t,r))*e+s(t))*e}function u(e,t,r){return 3*o(t,r)*e*e+2*i(t,r)*e+s(t)}function c(t,r){for(var n=0;m>n;++n){var o=u(r,e,a);if(0===o)return r;var i=l(r,e,a)-t;r-=i/o}return r}function p(){for(var t=0;b>t;++t)w[t]=l(t*x,e,a)}function f(t,r,n){var o,i,s=0;do i=r+(n-r)/2,o=l(i,e,a)-t,o>0?n=i:r=i;while(Math.abs(o)>h&&++s<v);return i}function d(t){for(var r=0,n=1,o=b-1;n!=o&&w[n]<=t;++n)r+=x;--n;var i=(t-w[n])/(w[n+1]-w[n]),s=r+i*x,l=u(s,e,a);return l>=y?c(t,s):0==l?s:f(t,r,r+x)}function g(){V=!0,(e!=r||a!=n)&&p()}var m=4,y=.001,h=1e-7,v=10,b=11,x=1/(b-1),S="Float32Array"in t;if(4!==arguments.length)return!1;for(var P=0;4>P;++P)if("number"!=typeof arguments[P]||isNaN(arguments[P])||!isFinite(arguments[P]))return!1;e=Math.min(e,1),a=Math.min(a,1),e=Math.max(e,0),a=Math.max(a,0);var w=S?new Float32Array(b):new Array(b),V=!1,C=function(t){return V||g(),e===r&&a===n?t:0===t?0:1===t?1:l(d(t),r,n)};C.getControlPoints=function(){return[{x:e,y:r},{x:a,y:n}]};var T="generateBezier("+[e,r,a,n]+")";return C.toString=function(){return T},C}function u(e,t){var r=e;return g.isString(e)?v.Easings[e]||(r=!1):r=g.isArray(e)&&1===e.length?s.apply(null,e):g.isArray(e)&&2===e.length?b.apply(null,e.concat([t])):g.isArray(e)&&4===e.length?l.apply(null,e):!1,r===!1&&(r=v.Easings[v.defaults.easing]?v.defaults.easing:h),r}function c(e){if(e){var t=(new Date).getTime(),r=v.State.calls.length;r>1e4&&(v.State.calls=n(v.State.calls));for(var o=0;r>o;o++)if(v.State.calls[o]){var s=v.State.calls[o],l=s[0],u=s[2],f=s[3],d=!!f,m=null;f||(f=v.State.calls[o][3]=t-16);for(var y=Math.min((t-f)/u.duration,1),h=0,b=l.length;b>h;h++){var S=l[h],w=S.element;if(i(w)){var V=!1;if(u.display!==a&&null!==u.display&&"none"!==u.display){if("flex"===u.display){var C=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];$.each(C,function(e,t){x.setPropertyValue(w,"display",t)})}x.setPropertyValue(w,"display",u.display)}u.visibility!==a&&"hidden"!==u.visibility&&x.setPropertyValue(w,"visibility",u.visibility);for(var T in S)if("element"!==T){var k=S[T],A,F=g.isString(k.easing)?v.Easings[k.easing]:k.easing;if(1===y)A=k.endValue;else{var E=k.endValue-k.startValue;if(A=k.startValue+E*F(y,u,E),!d&&A===k.currentValue)continue}if(k.currentValue=A,"tween"===T)m=A;else{if(x.Hooks.registered[T]){var j=x.Hooks.getRoot(T),H=i(w).rootPropertyValueCache[j];H&&(k.rootPropertyValue=H)}var N=x.setPropertyValue(w,T,k.currentValue+(0===parseFloat(A)?"":k.unitType),k.rootPropertyValue,k.scrollData);x.Hooks.registered[T]&&(i(w).rootPropertyValueCache[j]=x.Normalizations.registered[j]?x.Normalizations.registered[j]("extract",null,N[1]):N[1]),"transform"===N[0]&&(V=!0)}}u.mobileHA&&i(w).transformCache.translate3d===a&&(i(w).transformCache.translate3d="(0px, 0px, 0px)",V=!0),V&&x.flushTransformCache(w)}}u.display!==a&&"none"!==u.display&&(v.State.calls[o][2].display=!1),u.visibility!==a&&"hidden"!==u.visibility&&(v.State.calls[o][2].visibility=!1),u.progress&&u.progress.call(s[1],s[1],y,Math.max(0,f+u.duration-t),f,m),1===y&&p(o)}}v.State.isTicking&&P(c)}function p(e,t){if(!v.State.calls[e])return!1;for(var r=v.State.calls[e][0],n=v.State.calls[e][1],o=v.State.calls[e][2],s=v.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||o.loop||("none"===o.display&&x.setPropertyValue(p,"display",o.display),"hidden"===o.visibility&&x.setPropertyValue(p,"visibility",o.visibility)),o.loop!==!0&&($.queue(p)[1]===a||!/\.velocityQueueEntryFlag/i.test($.queue(p)[1]))&&i(p)){i(p).isAnimating=!1,i(p).rootPropertyValueCache={};var f=!1;$.each(x.Lists.transforms3D,function(e,t){var r=/^scale/.test(t)?1:0,n=i(p).transformCache[t];i(p).transformCache[t]!==a&&new RegExp("^\\("+r+"[^.]").test(n)&&(f=!0,delete i(p).transformCache[t])}),o.mobileHA&&(f=!0,delete i(p).transformCache.translate3d),f&&x.flushTransformCache(p),x.Values.removeClass(p,"velocity-animating")}if(!t&&o.complete&&!o.loop&&u===c-1)try{o.complete.call(n,n)}catch(d){setTimeout(function(){throw d},1)}s&&o.loop!==!0&&s(n),i(p)&&o.loop===!0&&!t&&($.each(i(p).tweensContainer,function(e,t){/^rotate/.test(e)&&360===parseFloat(t.endValue)&&(t.endValue=0,t.startValue=360),/^backgroundPosition/.test(e)&&100===parseFloat(t.endValue)&&"%"===t.unitType&&(t.endValue=0,t.startValue=100)}),v(p,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&$.dequeue(p,o.queue)}v.State.calls[e]=!1;for(var g=0,m=v.State.calls.length;m>g;g++)if(v.State.calls[g]!==!1){l=!0;break}l===!1&&(v.State.isTicking=!1,delete v.State.calls,v.State.calls=[])}var f=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>4;e--){var t=r.createElement("div");if(t.innerHTML="<!--[if IE "+e+"]><span></span><![endif]-->",t.getElementsByTagName("span").length)return t=null,e}return a}(),d=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r=(new Date).getTime(),a;return a=Math.max(0,16-(r-e)),e=r+a,setTimeout(function(){t(r+a)},a)}}(),g={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==typeof e&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==a&&(0===e.length||"object"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)return!1;return!0}},$,m=!1;if(e.fn&&e.fn.jquery?($=e,m=!0):$=t.Velocity.Utilities,8>=f&&!m)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=f)return void(jQuery.fn.velocity=jQuery.fn.animate);var y=400,h="swing",v={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:$,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:y,easing:h,begin:a,complete:a,progress:a,display:a,visibility:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){$.data(e,"velocity",{isSVG:g.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};t.pageYOffset!==a?(v.State.scrollAnchor=t,v.State.scrollPropertyLeft="pageXOffset",v.State.scrollPropertyTop="pageYOffset"):(v.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,v.State.scrollPropertyLeft="scrollLeft",v.State.scrollPropertyTop="scrollTop");var b=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var n={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:n.v,dv:e(n)}}function r(r,a){var n={dx:r.v,dv:e(r)},o=t(r,.5*a,n),i=t(r,.5*a,o),s=t(r,a,i),l=1/6*(n.dx+2*(o.dx+i.dx)+s.dx),u=1/6*(n.dv+2*(o.dv+i.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,n){var o={x:-1,v:0,tension:null,friction:null},i=[0],s=0,l=1e-4,u=.016,c,p,f;for(e=parseFloat(e)||500,t=parseFloat(t)||20,n=n||null,o.tension=e,o.friction=t,c=null!==n,c?(s=a(e,t),p=s/n*u):p=u;;)if(f=r(f||o,p),i.push(1+f.x),s+=16,!(Math.abs(f.x)>l&&Math.abs(f.v)>l))break;return c?function(e){return i[e*(i.length-1)|0]}:s}}();v.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},$.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(e,t){v.Easings[t[0]]=l.apply(null,t[1])});var x=v.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e<x.Lists.colors.length;e++){var t="color"===x.Lists.colors[e]?"0 0 0 1":"255 255 255 1";x.Hooks.templates[x.Lists.colors[e]]=["Red Green Blue Alpha",t]}var r,a,n;if(f)for(r in x.Hooks.templates){a=x.Hooks.templates[r],n=a[0].split(" ");var o=a[1].match(x.RegEx.valueSplit);"Color"===n[0]&&(n.push(n.shift()),o.push(o.shift()),x.Hooks.templates[r]=[n.join(" "),o.join(" ")])}for(r in x.Hooks.templates){a=x.Hooks.templates[r],n=a[0].split(" ");for(var e in n){var i=r+n[e],s=e;x.Hooks.registered[i]=[r,s]}}},getRoot:function(e){var t=x.Hooks.registered[e];return t?t[0]:e},cleanRootPropertyValue:function(e,t){return x.RegEx.valueUnwrap.test(t)&&(t=t.match(x.RegEx.valueUnwrap)[1]),x.Values.isCSSNullValue(t)&&(t=x.Hooks.templates[e][1]),t},extractValue:function(e,t){var r=x.Hooks.registered[e];if(r){var a=r[0],n=r[1];return t=x.Hooks.cleanRootPropertyValue(a,t),t.toString().match(x.RegEx.valueSplit)[n]}return t},injectValue:function(e,t,r){var a=x.Hooks.registered[e];if(a){var n=a[0],o=a[1],i,s;return r=x.Hooks.cleanRootPropertyValue(n,r),i=r.toString().match(x.RegEx.valueSplit),i[o]=t,s=i.join(" ")}return r}},Normalizations:{registered:{clip:function(e,t,r){switch(e){case"name":return"clip";case"extract":var a;return x.RegEx.wrappedValueAlreadyExtracted.test(r)?a=r:(a=r.toString().match(x.RegEx.valueUnwrap),a=a?a[1].replace(/,(\s+)?/g," "):r),a;case"inject":return"rect("+r+")"}},blur:function(e,t,r){switch(e){case"name":return v.State.isFirefox?"filter":"-webkit-filter";case"extract":var a=parseFloat(r);if(!a&&0!==a){var n=r.toString().match(/blur\(([0-9]+[A-z]+)\)/i);a=n?n[1]:0}return a;case"inject":return parseFloat(r)?"blur("+r+")":"none"}},opacity:function(e,t,r){if(8>=f)switch(e){case"name":return"filter";case"extract":var a=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=a?a[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=f||v.State.isGingerbread||(x.Lists.transformsBase=x.Lists.transformsBase.concat(x.Lists.transforms3D));for(var e=0;e<x.Lists.transformsBase.length;e++)!function(){var t=x.Lists.transformsBase[e];x.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return"transform";case"extract":return i(r)===a||i(r).transformCache[t]===a?/^scale/i.test(t)?1:0:i(r).transformCache[t].replace(/[()]/g,"");case"inject":var o=!1;switch(t.substr(0,t.length-1)){case"translate":o=!/(%|px|em|rem|vw|vh|\d)$/i.test(n);break;case"scal":case"scale":v.State.isAndroid&&i(r).transformCache[t]===a&&1>n&&(n=1),o=!/(\d)$/i.test(n);break;case"skew":o=!/(deg|\d)$/i.test(n);break;case"rotate":o=!/(deg|\d)$/i.test(n)}return o||(i(r).transformCache[t]="("+n+")"),i(r).transformCache[t]}}}();for(var e=0;e<x.Lists.colors.length;e++)!function(){var t=x.Lists.colors[e];x.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return t;case"extract":var o;if(x.RegEx.wrappedValueAlreadyExtracted.test(n))o=n;else{var i,s={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(n)?i=s[n]!==a?s[n]:s.black:x.RegEx.isHex.test(n)?i="rgb("+x.Values.hexToRgb(n).join(" ")+")":/^rgba?\(/i.test(n)||(i=s.black),o=(i||n).toString().match(x.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return 8>=f||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=f?4===n.split(" ").length&&(n=n.split(/\s+/).slice(0,3).join(" ")):3===n.split(" ").length&&(n+=" 1"),(8>=f?"rgb":"rgba")+"("+n.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(f||v.State.isAndroid&&!v.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(v.State.prefixMatches[e])return[v.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,a=t.length;a>r;r++){var n;if(n=0===r?e:t[r]+e.replace(/^\w/,function(e){return e.toUpperCase()}),g.isString(v.State.prefixElement.style[n]))return v.State.prefixMatches[e]=n,[n,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,a;return e=e.replace(t,function(e,t,r,a){return t+t+r+r+a+a}),a=r.exec(e),a?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e&&e.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":/^(table)$/i.test(t)?"table":/^(tbody)$/i.test(t)?"table-row-group":"block"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?" ":"")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(e,r,n,o){function s(e,r){function n(){u&&x.setPropertyValue(e,"display","none")}var l=0;if(8>=f)l=$.css(e,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===x.getPropertyValue(e,"display")&&(u=!0,x.setPropertyValue(e,"display",x.Values.getDisplayType(e))),!o){if("height"===r&&"border-box"!==x.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(x.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(x.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(x.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(x.getPropertyValue(e,"paddingBottom"))||0);return n(),c}if("width"===r&&"border-box"!==x.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(x.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(x.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(x.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(x.getPropertyValue(e,"paddingRight"))||0);return n(),p}}var d;d=i(e)===a?t.getComputedStyle(e,null):i(e).computedStyle?i(e).computedStyle:i(e).computedStyle=t.getComputedStyle(e,null),"borderColor"===r&&(r="borderTopColor"),l=9===f&&"filter"===r?d.getPropertyValue(r):d[r],(""===l||null===l)&&(l=e.style[r]),n()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var g=s(e,"position");("fixed"===g||"absolute"===g&&/top|left/i.test(r))&&(l=$(e).position()[r]+"px")}return l}var l;if(x.Hooks.registered[r]){var u=r,c=x.Hooks.getRoot(u);n===a&&(n=x.getPropertyValue(e,x.Names.prefixCheck(c)[0])),x.Normalizations.registered[c]&&(n=x.Normalizations.registered[c]("extract",e,n)),l=x.Hooks.extractValue(u,n)}else if(x.Normalizations.registered[r]){var p,d;p=x.Normalizations.registered[r]("name",e),"transform"!==p&&(d=s(e,x.Names.prefixCheck(p)[0]),x.Values.isCSSNullValue(d)&&x.Hooks.templates[r]&&(d=x.Hooks.templates[r][1])),l=x.Normalizations.registered[r]("extract",e,d)}if(!/^[\d-]/.test(l))if(i(e)&&i(e).isSVG&&x.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{l=e.getBBox()[r]}catch(g){l=0}else l=e.getAttribute(r);else l=s(e,x.Names.prefixCheck(r)[0]);return x.Values.isCSSNullValue(l)&&(l=0),v.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(e,r,a,n,o){var s=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=a:"Left"===o.direction?t.scrollTo(a,o.alternateValue):t.scrollTo(o.alternateValue,a);else if(x.Normalizations.registered[r]&&"transform"===x.Normalizations.registered[r]("name",e))x.Normalizations.registered[r]("inject",e,a),s="transform",a=i(e).transformCache[r];else{if(x.Hooks.registered[r]){var l=r,u=x.Hooks.getRoot(r);n=n||x.getPropertyValue(e,u),a=x.Hooks.injectValue(l,a,n),r=u}if(x.Normalizations.registered[r]&&(a=x.Normalizations.registered[r]("inject",e,a),r=x.Normalizations.registered[r]("name",e)),s=x.Names.prefixCheck(r)[0],8>=f)try{e.style[s]=a}catch(c){v.debug&&console.log("Browser does not support ["+a+"] for ["+s+"]")}else i(e)&&i(e).isSVG&&x.Names.SVGAttribute(r)?e.setAttribute(r,a):e.style[s]=a;v.debug>=2&&console.log("Set "+r+" ("+s+"): "+a)}return[s,a]},flushTransformCache:function(e){function t(t){return parseFloat(x.getPropertyValue(e,t))}var r="";if((f||v.State.isAndroid&&!v.State.isChrome)&&i(e).isSVG){var a={translate:[t("translateX"),t("translateY")],skewX:[t("skewX")],skewY:[t("skewY")],scale:1!==t("scale")?[t("scale"),t("scale")]:[t("scaleX"),t("scaleY")],rotate:[t("rotateZ"),0,0]};$.each(i(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(r+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var n,o;$.each(i(e).transformCache,function(t){return n=i(e).transformCache[t],"transformPerspective"===t?(o=n,!0):(9===f&&"rotateZ"===t&&(t="rotate"),void(r+=t+n+" "))}),o&&(r="perspective"+o+" "+r)}x.setPropertyValue(e,"transform",r)}};x.Hooks.register(),x.Normalizations.register(),v.hook=function(e,t,r){var n=a;return e=o(e),$.each(e,function(e,o){if(i(o)===a&&v.init(o),r===a)n===a&&(n=v.CSS.getPropertyValue(o,t));else{var s=v.CSS.setPropertyValue(o,t,r);"transform"===s[0]&&v.CSS.flushTransformCache(o),n=s}}),n};var S=function(){function e(){return l?T.promise||null:f}function n(){function e(e){function p(e,t){var r=a,i=a,s=a;return g.isArray(e)?(r=e[0],!g.isArray(e[1])&&/^[\d-]/.test(e[1])||g.isFunction(e[1])||x.RegEx.isHex.test(e[1])?s=e[1]:(g.isString(e[1])&&!x.RegEx.isHex.test(e[1])||g.isArray(e[1]))&&(i=t?e[1]:u(e[1],o.duration),e[2]!==a&&(s=e[2]))):r=e,t||(i=i||o.easing),g.isFunction(r)&&(r=r.call(n,w,P)),g.isFunction(s)&&(s=s.call(n,w,P)),[r||0,i,s]}function f(e,t){var r,a;return a=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,""}),r||(r=x.Values.getUnitType(e)),[a,r]}function d(){var e={myParent:n.parentNode||r.body,position:x.getPropertyValue(n,"position"),fontSize:x.getPropertyValue(n,"fontSize")},a=e.position===N.lastPosition&&e.myParent===N.lastParent,o=e.fontSize===N.lastFontSize;N.lastParent=e.myParent,N.lastPosition=e.position,N.lastFontSize=e.fontSize;var s=100,l={};if(o&&a)l.emToPx=N.lastEmToPx,l.percentToPxWidth=N.lastPercentToPxWidth,l.percentToPxHeight=N.lastPercentToPxHeight;else{var u=i(n).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");v.init(u),e.myParent.appendChild(u),$.each(["overflow","overflowX","overflowY"],function(e,t){v.CSS.setPropertyValue(u,t,"hidden")}),v.CSS.setPropertyValue(u,"position",e.position),v.CSS.setPropertyValue(u,"fontSize",e.fontSize),v.CSS.setPropertyValue(u,"boxSizing","content-box"),$.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(e,t){v.CSS.setPropertyValue(u,t,s+"%")}),v.CSS.setPropertyValue(u,"paddingLeft",s+"em"),l.percentToPxWidth=N.lastPercentToPxWidth=(parseFloat(x.getPropertyValue(u,"width",null,!0))||1)/s,l.percentToPxHeight=N.lastPercentToPxHeight=(parseFloat(x.getPropertyValue(u,"height",null,!0))||1)/s,l.emToPx=N.lastEmToPx=(parseFloat(x.getPropertyValue(u,"paddingLeft"))||1)/s,e.myParent.removeChild(u)}return null===N.remToPx&&(N.remToPx=parseFloat(x.getPropertyValue(r.body,"fontSize"))||16),null===N.vwToPx&&(N.vwToPx=parseFloat(t.innerWidth)/100,N.vhToPx=parseFloat(t.innerHeight)/100),l.remToPx=N.remToPx,l.vwToPx=N.vwToPx,l.vhToPx=N.vhToPx,v.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),n),l}if(o.begin&&0===w)try{o.begin.call(m,m)}catch(y){setTimeout(function(){throw y},1)}if("scroll"===k){var S=/^x$/i.test(o.axis)?"Left":"Top",V=parseFloat(o.offset)||0,C,A,F;o.container?g.isWrapped(o.container)||g.isNode(o.container)?(o.container=o.container[0]||o.container,C=o.container["scroll"+S],F=C+$(n).position()[S.toLowerCase()]+V):o.container=null:(C=v.State.scrollAnchor[v.State["scrollProperty"+S]],A=v.State.scrollAnchor[v.State["scrollProperty"+("Left"===S?"Top":"Left")]],F=$(n).offset()[S.toLowerCase()]+V),s={scroll:{rootPropertyValue:!1,startValue:C,currentValue:C,endValue:F,unitType:"",easing:o.easing,scrollData:{container:o.container,direction:S,alternateValue:A}},element:n},v.debug&&console.log("tweensContainer (scroll): ",s.scroll,n)}else if("reverse"===k){if(!i(n).tweensContainer)return void $.dequeue(n,o.queue);"none"===i(n).opts.display&&(i(n).opts.display="auto"),"hidden"===i(n).opts.visibility&&(i(n).opts.visibility="visible"),i(n).opts.loop=!1,i(n).opts.begin=null,i(n).opts.complete=null,b.easing||delete o.easing,b.duration||delete o.duration,o=$.extend({},i(n).opts,o);var E=$.extend(!0,{},i(n).tweensContainer);for(var j in E)if("element"!==j){var H=E[j].startValue;E[j].startValue=E[j].currentValue=E[j].endValue,E[j].endValue=H,g.isEmptyObject(b)||(E[j].easing=o.easing),v.debug&&console.log("reverse tweensContainer ("+j+"): "+JSON.stringify(E[j]),n)}s=E}else if("start"===k){var E;i(n).tweensContainer&&i(n).isAnimating===!0&&(E=i(n).tweensContainer),$.each(h,function(e,t){if(RegExp("^"+x.Lists.colors.join("$|^")+"$").test(e)){var r=p(t,!0),n=r[0],o=r[1],i=r[2];if(x.RegEx.isHex.test(n)){for(var s=["Red","Green","Blue"],l=x.Values.hexToRgb(n),u=i?x.Values.hexToRgb(i):a,c=0;c<s.length;c++){var f=[l[c]];o&&f.push(o),u!==a&&f.push(u[c]),h[e+s[c]]=f}delete h[e]}}});for(var R in h){var O=p(h[R]),z=O[0],q=O[1],M=O[2];R=x.Names.camelCase(R);var I=x.Hooks.getRoot(R),B=!1;if(i(n).isSVG||"tween"===I||x.Names.prefixCheck(I)[1]!==!1||x.Normalizations.registered[I]!==a){(o.display!==a&&null!==o.display&&"none"!==o.display||o.visibility!==a&&"hidden"!==o.visibility)&&/opacity|filter/.test(R)&&!M&&0!==z&&(M=0),o._cacheValues&&E&&E[R]?(M===a&&(M=E[R].endValue+E[R].unitType),B=i(n).rootPropertyValueCache[I]):x.Hooks.registered[R]?M===a?(B=x.getPropertyValue(n,I),M=x.getPropertyValue(n,R,B)):B=x.Hooks.templates[I][1]:M===a&&(M=x.getPropertyValue(n,R));var W,G,D,X=!1;if(W=f(R,M),M=W[0],D=W[1],W=f(R,z),z=W[0].replace(/^([+-\/*])=/,function(e,t){return X=t,""}),G=W[1],M=parseFloat(M)||0,z=parseFloat(z)||0,"%"===G&&(/^(fontSize|lineHeight)$/.test(R)?(z/=100,G="em"):/^scale/.test(R)?(z/=100,G=""):/(Red|Green|Blue)$/i.test(R)&&(z=z/100*255,G="")),/[\/*]/.test(X))G=D;else if(D!==G&&0!==M)if(0===z)G=D;else{l=l||d();var Y=/margin|padding|left|right|width|text|word|letter/i.test(R)||/X$/.test(R)||"x"===R?"x":"y";switch(D){case"%":M*="x"===Y?l.percentToPxWidth:l.percentToPxHeight;break;case"px":break;default:M*=l[D+"ToPx"]}switch(G){case"%":M*=1/("x"===Y?l.percentToPxWidth:l.percentToPxHeight);break;case"px":break;default:M*=1/l[G+"ToPx"]}}switch(X){case"+":z=M+z;break;case"-":z=M-z;break;case"*":z=M*z;break;case"/":z=M/z}s[R]={rootPropertyValue:B,startValue:M,currentValue:M,endValue:z,unitType:G,easing:q},v.debug&&console.log("tweensContainer ("+R+"): "+JSON.stringify(s[R]),n)}else v.debug&&console.log("Skipping ["+I+"] due to a lack of browser support.")}s.element=n}s.element&&(x.Values.addClass(n,"velocity-animating"),L.push(s),""===o.queue&&(i(n).tweensContainer=s,i(n).opts=o),i(n).isAnimating=!0,w===P-1?(v.State.calls.push([L,m,o,null,T.resolver]),v.State.isTicking===!1&&(v.State.isTicking=!0,c())):w++)}var n=this,o=$.extend({},v.defaults,b),s={},l;switch(i(n)===a&&v.init(n),parseFloat(o.delay)&&o.queue!==!1&&$.queue(n,o.queue,function(e){v.velocityQueueEntryFlag=!0,i(n).delayTimer={setTimeout:setTimeout(e,parseFloat(o.delay)),next:e}}),o.duration.toString().toLowerCase()){case"fast":o.duration=200;break;case"normal":o.duration=y;break;case"slow":o.duration=600;break;default:o.duration=parseFloat(o.duration)||1}v.mock!==!1&&(v.mock===!0?o.duration=o.delay=1:(o.duration*=parseFloat(v.mock)||1,o.delay*=parseFloat(v.mock)||1)),o.easing=u(o.easing,o.duration),o.begin&&!g.isFunction(o.begin)&&(o.begin=null),o.progress&&!g.isFunction(o.progress)&&(o.progress=null),o.complete&&!g.isFunction(o.complete)&&(o.complete=null),o.display!==a&&null!==o.display&&(o.display=o.display.toString().toLowerCase(),"auto"===o.display&&(o.display=v.CSS.Values.getDisplayType(n))),o.visibility!==a&&null!==o.visibility&&(o.visibility=o.visibility.toString().toLowerCase()),o.mobileHA=o.mobileHA&&v.State.isMobile&&!v.State.isGingerbread,o.queue===!1?o.delay?setTimeout(e,o.delay):e():$.queue(n,o.queue,function(t,r){return r===!0?(T.promise&&T.resolver(m),!0):(v.velocityQueueEntryFlag=!0,void e(t))}),""!==o.queue&&"fx"!==o.queue||"inprogress"===$.queue(n)[0]||$.dequeue(n)}var s=arguments[0]&&(arguments[0].p||$.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||g.isString(arguments[0].properties)),l,f,d,m,h,b;if(g.isWrapped(this)?(l=!1,d=0,m=this,f=this):(l=!0,d=1,m=s?arguments[0].elements||arguments[0].e:arguments[0]),m=o(m)){s?(h=arguments[0].properties||arguments[0].p,b=arguments[0].options||arguments[0].o):(h=arguments[d],b=arguments[d+1]);var P=m.length,w=0;if(!/^(stop|finish)$/i.test(h)&&!$.isPlainObject(b)){var V=d+1;b={};for(var C=V;C<arguments.length;C++)g.isArray(arguments[C])||!/^(fast|normal|slow)$/i.test(arguments[C])&&!/^\d/.test(arguments[C])?g.isString(arguments[C])||g.isArray(arguments[C])?b.easing=arguments[C]:g.isFunction(arguments[C])&&(b.complete=arguments[C]):b.duration=arguments[C]}var T={promise:null,resolver:null,rejecter:null};l&&v.Promise&&(T.promise=new v.Promise(function(e,t){T.resolver=e,T.rejecter=t}));var k;switch(h){case"scroll":k="scroll";break;case"reverse":k="reverse";break;case"finish":case"stop":$.each(m,function(e,t){i(t)&&i(t).delayTimer&&(clearTimeout(i(t).delayTimer.setTimeout),i(t).delayTimer.next&&i(t).delayTimer.next(),delete i(t).delayTimer)});var A=[];return $.each(v.State.calls,function(e,t){t&&$.each(t[1],function(r,n){var o=b===a?"":b;return o===!0||t[2].queue===o||b===a&&t[2].queue===!1?void $.each(m,function(r,a){a===n&&((b===!0||g.isString(b))&&($.each($.queue(a,g.isString(b)?b:""),function(e,t){g.isFunction(t)&&t(null,!0)}),$.queue(a,g.isString(b)?b:"",[])),"stop"===h?(i(a)&&i(a).tweensContainer&&o!==!1&&$.each(i(a).tweensContainer,function(e,t){t.endValue=t.currentValue
2033}),A.push(e)):"finish"===h&&(t[2].duration=1))}):!0})}),"stop"===h&&($.each(A,function(e,t){p(t,!0)}),T.promise&&T.resolver(m)),e();default:if(!$.isPlainObject(h)||g.isEmptyObject(h)){if(g.isString(h)&&v.Redirects[h]){var F=$.extend({},b),E=F.duration,j=F.delay||0;return F.backwards===!0&&(m=$.extend(!0,[],m).reverse()),$.each(m,function(e,t){parseFloat(F.stagger)?F.delay=j+parseFloat(F.stagger)*e:g.isFunction(F.stagger)&&(F.delay=j+F.stagger.call(t,e,P)),F.drag&&(F.duration=parseFloat(E)||(/^(callout|transition)/.test(h)?1e3:y),F.duration=Math.max(F.duration*(F.backwards?1-e/P:(e+1)/P),.75*F.duration,200)),v.Redirects[h].call(t,t,F||{}
2033,e,P,m,T.promise?T:a)}),e()}var H="Velocity: First argument ("+h+") was not a property map, a known action, or a registered redirect. Aborting.";return T.promise?T.rejecter(new Error(H)):console.log(H),e()}k="start"}var N={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},L=[];$.each(m,function(e,t){g.isNode(t)&&n.call(t)});var F=$.extend({},v.defaults,b),R;if(F.loop=parseInt(F.loop),R=2*F.loop-1,F.loop)for(var O=0;R>O;O++){var z={delay:F.delay,progress:F.progress};O===R-1&&(z.display=F.display,z.visibility=F.visibility,z.complete=F.complete),S(m,"reverse",z)}return e()}};v=$.extend(S,v),v.animate=S;var P=t.requestAnimationFrame||d;return v.State.isMobile||r.hidden===a||r.addEventListener("visibilitychange",function(){r.hidden?(P=function(e){return setTimeout(function(){e(!0)},16)},c()):P=t.requestAnimationFrame||d}),e.Velocity=v,e!==t&&(e.fn.velocity=S,e.fn.velocity.defaults=v.defaults),$.each(["Down","Up"],function(e,t){v.Redirects["slide"+t]=function(e,r,n,o,i,s){var l=$.extend({},r),u=l.begin,c=l.complete,p={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},f={};l.display===a&&(l.display="Down"===t?"inline"===v.CSS.Values.getDisplayType(e)?"inline-block":"block":"none"),l.begin=function(){u&&u.call(i,i);for(var r in p){f[r]=e.style[r];var a=v.CSS.getPropertyValue(e,r);p[r]="Down"===t?[a,0]:[0,a]}f.overflow=e.style.overflow,e.style.overflow="hidden"},l.complete=function(){for(var t in f)e.style[t]=f[t];c&&c.call(i,i),s&&s.resolver(i)},v(e,p,l)}}),$.each(["In","Out"],function(e,t){v.Redirects["fade"+t]=function(e,r,n,o,i,s){var l=$.extend({},r),u={opacity:"In"===t?1:0},c=l.complete;l.complete=n!==o-1?l.begin=null:function(){c&&c.call(i,i),s&&s.resolver(i)},l.display===a&&(l.display="In"===t?"auto":"none"),v(this,u,l)}}),v}(window.jQuery||window.Zepto||window,window,document)});
2034var hljs=new function(){function m(p){return p.replace(/&/gm,"&amp;").replace(/</gm,"&lt;")}function c(r,q,p){return RegExp(q,"m"+(r.cI?"i":"")+(p?"g":""))}function j(r){for(var p=0;p<r.childNodes.length;p++){var q=r.childNodes[p];if(q.nodeName=="CODE"){return q}if(!(q.nodeType==3&&q.nodeValue.match(/\s+/))){break}}}function g(t,s){var r="";for(var q=0;q<t.childNodes.length;q++){if(t.childNodes[q].nodeType==3){var p=t.childNodes[q].nodeValue;if(s){p=p.replace(/\n/g,"")}r+=p}else{if(t.childNodes[q].nodeName=="BR"){r+="\n"}else{r+=g(t.childNodes[q])}}}if(/MSIE [678]/.test(navigator.userAgent)){r=r.replace(/\r/g,"\n")}return r}function a(s){var q=s.className.split(/\s+/);q=q.concat(s.parentNode.className.split(/\s+/));for(var p=0;p<q.length;p++){var r=q[p].replace(/^language-/,"");if(d[r]||r=="no-highlight"){return r}}}function b(p){var q=[];(function(s,t){for(var r=0;r<s.childNodes.length;r++){if(s.childNodes[r].nodeType==3){t+=s.childNodes[r].nodeValue.length}else{if(s.childNodes[r].nodeName=="BR"){t+=1}else{q.push({event:"start",offset:t,node:s.childNodes[r]});t=arguments.callee(s.childNodes[r],t);q.push({event:"stop",offset:t,node:s.childNodes[r]})}}}return t})(p,0);return q}function l(y,z,x){var r=0;var w="";var t=[];function u(){if(y.length&&z.length){if(y[0].offset!=z[0].offset){return(y[0].offset<z[0].offset)?y:z}else{return z[0].event=="start"?y:z}}else{return y.length?y:z}}function s(C){var D="<"+C.nodeName.toLowerCase();for(var A=0;A<C.attributes.length;A++){var B=C.attributes[A];D+=" "+B.nodeName.toLowerCase();if(B.nodeValue!=undefined&&B.nodeValue!=false&&B.nodeValue!=null){D+='="'+m(B.nodeValue)+'"'}}return D+">"}while(y.length||z.length){var v=u().splice(0,1)[0];w+=m(x.substr(r,v.offset-r));r=v.offset;if(v.event=="start"){w+=s(v.node);t.push(v.node)}else{if(v.event=="stop"){var q=t.length;do{q--;var p=t[q];w+=("</"+p.nodeName.toLowerCase()+">")}while(p!=v.node);t.splice(q,1);while(q<t.length){w+=s(t[q]);q++}}}}w+=x.substr(r);return w}function i(){function p(u,t,v){if(u.compiled){return}if(!v){u.bR=c(t,u.b?u.b:"\\B|\\b");if(!u.e&&!u.eW){u.e="\\B|\\b"}if(u.e){u.eR=c(t,u.e)}}if(u.i){u.iR=c(t,u.i)}if(u.r==undefined){u.r=1}if(u.k){u.lR=c(t,u.l||hljs.IR,true)}for(var s in u.k){if(!u.k.hasOwnProperty(s)){continue}if(u.k[s] instanceof Object){u.kG=u.k}else{u.kG={keyword:u.k}}break}if(!u.c){u.c=[]}u.compiled=true;for(var r=0;r<u.c.length;r++){p(u.c[r],t,false)}if(u.starts){p(u.starts,t,false)}}for(var q in d){if(!d.hasOwnProperty(q)){continue}p(d[q].dM,d[q],true)}}function e(J,D){if(!i.called){i();i.called=true}function z(r,M){for(var L=0;L<M.c.length;L++){if(M.c[L].bR.test(r)){return M.c[L]}}}function w(L,r){if(C[L].e&&C[L].eR.test(r)){return 1}if(C[L].eW){var M=w(L-1,r);return M?M+1:0}return 0}function x(r,L){return L.iR&&L.iR.test(r)}function A(O,N){var M=[];for(var L=0;L<O.c.length;L++){M.push(O.c[L].b)}var r=C.length-1;
2034do{if(C[r].e){M.push(C[r].e)}r--}while(C[r+1].eW);if(O.i){M.push(O.i)}return c(N,"("+M.join("|")+")",true)}function s(M,L){var N=C[C.length-1];if(!N.t){N.t=A(N,H)}N.t.lastIndex=L;var r=N.t.exec(M);if(r){return[M.substr(L,r.index-L),r[0],false]}else{return[M.substr(L),"",true]}}function p(O,r){var L=H.cI?r[0].toLowerCase():r[0];for(var N in O.kG){if(!O.kG.hasOwnProperty(N)){continue}var M=O.kG[N].hasOwnProperty(L);if(M){return[N,M]}}return false}function F(M,O){if(!O.k){return m(M)}var N="";var P=0;O.lR.lastIndex=0;var L=O.lR.exec(M);while(L){N+=m(M.substr(P,L.index-P));var r=p(O,L);if(r){t+=r[1];N+='<span class="'+r[0]+'">'+m(L[0])+"</span>"}else{N+=m(L[0])}P=O.lR.lastIndex;L=O.lR.exec(M)}N+=m(M.substr(P,M.length-P));return N}function K(r,M){if(M.sL&&d[M.sL]){var L=e(M.sL,r);t+=L.keyword_count;return L.value}else{return F(r,M)}}function I(M,r){var L=M.cN?'<span class="'+M.cN+'">':"";if(M.rB){q+=L;M.buffer=""}else{if(M.eB){q+=m(r)+L;M.buffer=""}else{q+=L;M.buffer=r}}C.push(M);B+=M.r}function E(O,L,Q){var R=C[C.length-1];if(Q){q+=K(R.buffer+O,R);return false}var M=z(L,R);if(M){q+=K(R.buffer+O,R);I(M,L);return M.rB}var r=w(C.length-1,L);if(r){var N=R.cN?"</span>":"";if(R.rE){q+=K(R.buffer+O,R)+N}else{if(R.eE){q+=K(R.buffer+O,R)+N+m(L)}else{q+=K(R.buffer+O+L,R)+N}}while(r>1){N=C[C.length-2].cN?"</span>":"";q+=N;r--;C.length--}var P=C[C.length-1];C.length--;C[C.length-1].buffer="";if(P.starts){I(P.starts,"")}return R.rE}if(x(L,R)){throw"Illegal"}}var H=d[J];var C=[H.dM];var B=0;var t=0;var q="";try{var v=0;H.dM.buffer="";do{var y=s(D,v);var u=E(y[0],y[1],y[2]);v+=y[0].length;if(!u){v+=y[1].length}}while(!y[2]);if(C.length>1){throw"Illegal"}return{r:B,keyword_count:t,value:q}}catch(G){if(G=="Illegal"){return{r:0,keyword_count:0,value:m(D)}}else{throw G}}}function f(t){var r={keyword_count:0,r:0,value:m(t)};var q=r;for(var p in d){if(!d.hasOwnProperty(p)){continue}var s=e(p,t);s.language=p;if(s.keyword_count+s.r>q.keyword_count+q.r){q=s}if(s.keyword_count+s.r>r.keyword_count+r.r){q=r;r=s}}if(q.language){r.second_best=q}return r}function h(r,q,p){if(q){r=r.replace(/^((<[^>]+>|\t)+)/gm,function(t,w,v,u){return w.replace(/\t/g,q)})}if(p){r=r.replace(/\n/g,"<br>")}return r}function o(u,x,q){var y=g(u,q);var s=a(u);if(s=="no-highlight"){return}if(s){var w=e(s,y)}else{var w=f(y);s=w.language}var p=b(u);if(p.length){var r=document.createElement("pre");r.innerHTML=w.value;w.value=l(p,b(r),y)}w.value=h(w.value,x,q);var t=u.className;if(!t.match("(\\s|^)(language-)?"+s+"(\\s|$)")){t=t?(t+" "+s):s}if(/MSIE [678]/.test(navigator.userAgent)&&u.tagName=="CODE"&&u.parentNode.tagName=="PRE"){var r=u.parentNode;var v=document.createElement("div");v.innerHTML="<pre><code>"+w.value+"</code></pre>";u=v.firstChild.firstChild;v.firstChild.cN=r.cN;r.parentNode.replaceChild(v.firstChild,r)}else{u.innerHTML=w.value}u.className=t;u.result={language:s,kw:w.keyword_count,re:w.r};if(w.second_best){u.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function k(){if(k.called){return}k.called=true;var r=document.getElementsByTagName("pre");for(var p=0;p<r.length;p++){var q=j(r[p]);if(q){o(q,hljs.tabReplace)}}}function n(){if(window.addEventListener){window.addEventListener("DOMContentLoaded",k,false);window.addEventListener("load",k,false)}else{if(window.attachEvent){window.attachEvent("onload",k)}else{window.onload=k}}}var d={};this.LANGUAGES=d;this.highlight=e;this.highlightAuto=f;this.fixMarkup=h;this.highlightBlock=o;this.initHighlighting=k;this.initHighlightingOnLoad=n;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.inherit=function(p,s){var r={};for(var q in p){r[q]=p[q]}if(s){for(var q in s){r[q]=s[q]}}return r}}();hljs.LANGUAGES.bash=function(){var d={"true":1,"false":1};var b={cN:"variable",b:"\\$([a-zA-Z0-9_]+)\\b"};var a={cN:"variable",b:"\\$\\{(([^}])|(\\\\}))+\\}",c:[hljs.CNM]};var c={cN:"string",b:'"',e:'"',i:"\\n",c:[hljs.BE,b,a],r:0};var e={cN:"test_condition",b:"",e:"",c:[c,b,a,hljs.CNM],k:{literal:d},r:0};return{dM:{k:{keyword:{"if":1,then:1,"else":1,fi:1,"for":1,"break":1,"continue":1,"while":1,"in":1,"do":1,done:1,echo:1,exit:1,"return":1,set:1,declare:1},literal:d},c:[{cN:"shebang",b:"(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",r:10},hljs.HCM,hljs.CNM,c,b,a,hljs.inherit(e,{b:"\\[ ",e:" \\]",r:0}),hljs.inherit(e,{b:"\\[\\[ ",e:" \\]\\]"})]}}}();hljs.LANGUAGES.cs={dM:{k:{"abstract":1,as:1,base:1,bool:1,"break":1,"byte":1,"case":1,"catch":1,"char":1,checked:1,"class":1,"const":1,"continue":1,decimal
2034:1,"default":1,delegate:1,"do":1,"do":1,"double":1,"else":1,"enum":1,event:1,explicit:1,extern:1,"false":1,"finally":1,fixed:1,"float":1,"for":1,foreach:1,"goto":1,"if":1,implicit:1,"in":1,"int":1,"interface":1,internal:1,is:1,lock:1,"long":1,namespace:1,"new":1,"null":1,object:1,operator:1,out:1,override:1,params:1,"private":1,"protected":1,"public":1,readonly:1,ref:1,"return":1,sbyte:1,sealed:1,"short":1,sizeof:1,stackalloc:1,"static":1,string:1,struct:1,"switch":1,"this":1,"throw":1,"true":1,"try":1,"typeof":1,uint:1,ulong:1,unchecked:1,unsafe:1,ushort:1,using:1,virtual:1,"volatile":1,"void":1,"while":1,ascending:1,descending:1,from:1,get:1,group:1,into:1,join:1,let:1,orderby:1,partial:1,select:1,set:1,value:1,"var":1,where:1,yield:1},c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|<!--|-->"},{cN:"xmlDocTag",b:"</?",e:">"}]},hljs.CLCM,hljs.CBLCLM,{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},hljs.ASM,hljs.QSM,hljs.CNM]}};hljs.LANGUAGES.ruby=function(){var g="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var a="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var n={keyword:{and:1,"false":1,then:1,defined:1,module:1,"in":1,"return":1,redo:1,"if":1,BEGIN:1,retry:1,end:1,"for":1,"true":1,self:1,when:1,next:1,until:1,"do":1,begin:1,unless:1,END:1,rescue:1,nil:1,"else":1,"break":1,undef:1,not:1,"super":1,"class":1,"case":1,require:1,yield:1,alias:1,"while":1,ensure:1,elsif:1,or:1,def:1},keymethods:{__id__:1,__send__:1,abort:1,abs:1,"all?":1,allocate:1,ancestors:1,"any?":1,arity:1,assoc:1,at:1,at_exit:1,autoload:1,"autoload?":1,"between?":1,binding:1,binmode:1,"block_given?":1,call:1,callcc:1,caller:1,capitalize:1,"capitalize!":1,casecmp:1,"catch":1,ceil:1,center:1,chomp:1,"chomp!":1,chop:1,"chop!":1,chr:1,"class":1,class_eval:1,"class_variable_defined?":1,class_variables:1,clear:1,clone:1,close:1,close_read:1,close_write:1,"closed?":1,coerce:1,collect:1,"collect!":1,compact:1,"compact!":1,concat:1,"const_defined?":1,const_get:1,const_missing:1,const_set:1,constants:1,count:1,crypt:1,"default":1,default_proc:1,"delete":1,"delete!":1,delete_at:1,delete_if:1,detect:1,display:1,div:1,divmod:1,downcase:1,"downcase!":1,downto:1,dump:1,dup:1,each:1,each_byte:1,each_index:1,each_key:1,each_line:1,each_pair:1,each_value:1,each_with_index:1,"empty?":1,entries:1,eof:1,"eof?":1,"eql?":1,"equal?":1,"eval":1,exec:1,exit:1,"exit!":1,extend:1,fail:1,fcntl:1,fetch:1,fileno:1,fill:1,find:1,find_all:1,first:1,flatten:1,"flatten!":1,floor:1,flush:1,for_fd:1,foreach:1,fork:1,format:1,freeze:1,"frozen?":1,fsync:1,getc:1,gets:1,global_variables:1,grep:1,gsub:1,"gsub!":1,"has_key?":1,"has_value?":1,hash:1,hex:1,id:1,include:1,"include?":1,included_modules:1,index:1,indexes:1,indices:1,induced_from:1,inject:1,insert:1,inspect:1,instance_eval:1,instance_method:1,instance_methods:1,"instance_of?":1,"instance_variable_defined?":1,instance_variable_get:1,instance_variable_set:1,instance_variables:1,"integer?":1,intern:1,invert:1,ioctl:1,"is_a?":1,isatty:1,"iterator?":1,join:1,"key?":1,keys:1,"kind_of?":1,lambda:1,last:1,length:1,lineno:1,ljust:1,load:1,local_variables:1,loop:1,lstrip:1,"lstrip!":1,map:1,"map!":1,match:1,max:1,"member?":1,merge:1,"merge!":1,method:1,"method_defined?":1,method_missing:1,methods:1,min:1,module_eval:1,modulo:1,name:1,nesting:1,"new":1,next:1,"next!":1,"nil?":1,nitems:1,"nonzero?":1,object_id:1,oct:1,open:1,pack:1,partition:1,pid:1,pipe:1,pop:1,popen:1,pos:1,prec:1,prec_f:1,prec_i:1,print:1,printf:1,private_class_method:1,private_instance_methods:1,"private_method_defined?":1,private_methods:1,proc:1,protected_instance_methods:1,"protected_method_defined?":1,protected_methods:1,public_class_method:1,public_instance_methods:1,"public_method_defined?":1,public_methods:1,push:1,putc:1,puts:1,quo:1,raise:1,rand:1,rassoc:1,read:1,read_nonblock:1,readchar:1,readline:1,readlines:1,readpartial:1,rehash:1,reject:1,"reject!":1,remainder:1,reopen:1,replace:1,require:1,"respond_to?":1,reverse:1,"reverse!":1,reverse_each:1,rewind:1,rindex:1,rjust:1,round:1,rstrip:1,"rstrip!":1,scan:1,seek:1,select:1,send:1,set_trace_func:1,shift:1,singleton_method_added:1,singleton_methods:1,size:1,sleep:1,slice:1,"slice!":1,sort:1,"sort!":1,sort_by:1,split:1,sprintf:1,squeeze:1,"squeeze!":1,srand:1,stat:1,step:1,store:1,strip:1,"strip!":1,sub:1,"sub!":1,succ:1,"succ!":1,sum:1,superclass:1,swapcase:1,"swapcase!":1,sync:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,taint:1,"tainted?":1,tell:1,test:1,"throw":1,times:1,to_a:1,to_ary:1,to_f:1,to_hash:1,to_i:1,to_int:1,to_io:1,to_proc:1,to_s:1,to_str:1,to_sym:1,tr:1,"tr!":1,tr_s:1,"tr_s!":1,trace_var:1,transpose:1,trap:1,truncate:1,"tty?":1,type:1,ungetc:1,uniq:1,"uniq!":1,unpack:1,unshift:1,untaint:1,untrace_var:1,upcase:1,"upcase!":1,update:1,upto:1,"value?":1,values:1,values_at:1,warn:1,write:1,write_nonblock:1,"zero?":1,zip:1}};var h={cN:"yardoctag",b:"@[A-Za-z]+"};var d={cN:"comment",b:"#",e:"$",c:[h]};var c={cN:"comment",b:"^\\=begin",e:"^\\=end",c:[h],r:10};var b={cN:"comment",b:"^__END__",e:"\\n$"};var u={cN:"subst",b:"#\\{",e:"}",l:g,k:n};var p=[hljs.BE,u];var s={cN:"string",b:"'",e:"'",c:p,r:0};var r={cN:"string",b:'"',e:'"',c:p,r:0};var q={cN:"string",b:"%[qw]?\\(",e:"\\)",c:p,r:10};var o={cN:"string",b:"%[qw]?\\[",e:"\\]",c:p,r:10};var m={cN:"string",b:"%[qw]?{",e:"}",c:p,r:10};var l={cN:"string",b:"%[qw]?<",e:">",c:p,r:10};var k={cN:"string",b:"%[qw]?/",e:"/",c:p,r:10};var j={cN:"string",b:"%[qw]?%",e:"%",c:p,r:10};var i={cN:"string",b:"%[qw]?-",e:"-",c:p,r:10};var t={cN:"string",b:"%[qw]?\\|",e:"\\|",c:p,r:10};var e={cN:"function",b:"\\bdef\\s+",e:" |$|;",l:g,k:n,c:[{cN:"title",b:a,l:g,k:n},{cN:"params",b:"\\(",e:"\\)",l:g,k:n},d,c,b]};var f={cN:"identifier",b:g,l:g,k:n,r:0};var v=[d,c,b,s,r,q,o,m,l,k,j,i,t,{cN:"class",b:"\\b(class|module)\\b",e:"$|;",k:{"class":1,module:1},c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+hljs.IR+"::)?"+hljs.IR}]},d,c,b]},e,{cN:"constant",b:"(::)?([A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[s,r,q,o,m,l,k,j,i,t,f],r:0}
2034,{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},f,{b:"("+hljs.RSR+")\\s*",c:[d,c,b,{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[hljs.BE]}],r:0}];u.c=v;e.c[1].c=v;return{dM:{l:g,k:n,c:v}}}();hljs.LANGUAGES.diff={cI:true,dM:{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}};hljs.LANGUAGES.javascript={dM:{k:{keyword:{"in":1,"if":1,"for":1,"while":1,"finally":1,"var":1,"new":1,"function":1,"do":1,"return":1,"void":1,"else":1,"break":1,"catch":1,"instanceof":1,"with":1,"throw":1,"case":1,"default":1,"try":1,"this":1,"switch":1,"continue":1,"typeof":1,"delete":1},literal:{"true":1,"false":1,"null":1}},c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM,hljs.CNM,{b:"("+hljs.RSR+"|case|return|throw)\\s*",k:{"return":1,"throw":1,"case":1},c:[hljs.CLCM,hljs.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",c:[{b:"\\\\/"}]}],r:0},{cN:"function",b:"\\bfunction\\b",e:"{",k:{"function":1},c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[hljs.ASM,hljs.QSM,hljs.CLCM,hljs.CBLCLM]}]}]}};hljs.LANGUAGES.css=function(){var a={cN:"function",b:hljs.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[hljs.NM,hljs.ASM,hljs.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[hljs.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:{"font-face":1,page:1}},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:{"import":1,page:1,media:1,charset:1},c:[a,hljs.ASM,hljs.QSM,hljs.NM]},{cN:"tag",b:hljs.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[hljs.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[a,hljs.NM,hljs.QSM,hljs.ASM,hljs.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}();hljs.LANGUAGES.xml=function(){var b="[A-Za-z0-9\\._:-]+";var a={eW:true,c:[{cN:"attribute",b:b,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style",e:">",k:{title:{style:1}},c:[a],starts:{cN:"css",e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script",e:">",k:{title:{script:1}},c:[a],starts:{cN:"javascript",e:"<\/script>",rE:true,sL:"javascript"}},{cN:"vbscript",b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},a]}]}}}();hljs.LANGUAGES.java={dM:{k:{"false":1,"synchronized":1,"int":1,"abstract":1,"float":1,"private":1,"char":1,"interface":1,"boolean":1,"static":1,"null":1,"if":1,"const":1,"for":1,"true":1,"while":1,"long":1,"throw":1,strictfp:1,"finally":1,"protected":1,"extends":1,"import":1,"native":1,"final":1,"implements":1,"return":1,"void":1,"enum":1,"else":1,"break":1,"transient":1,"new":1,"catch":1,"instanceof":1,"byte":1,"super":1,"class":1,"volatile":1,"case":1,assert:1,"short":1,"package":1,"default":1,"double":1,"public":1,"try":1,"this":1,"switch":1,"continue":1,"throws":1},c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10},hljs.CLCM,hljs.CBLCLM,hljs.ASM,hljs.QSM,{cN:"class",b:"(class |interface )",e:"{",k:{"class":1,"interface":1},i:":",c:[{b:"(implements|extends)",k:{"extends":1,"implements":1},r:10},{cN:"title",b:hljs.UIR}]},hljs.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}};hljs.LANGUAGES.php={cI:true,dM:{k:{and:1,include_once:1,list:1,"abstract":1,global:1,"private":1,echo:1,"interface":1,as:1,"static":1,endswitch:1,array:1,"null":1,"if":1,endwhile:1,or:1,"const":1,"for":1,endforeach:1,self:1,"var":1,"while":1,isset:1,"public":1,"protected":1,exit:1,foreach:1,"throw":1,elseif:1,"extends":1,include:1,__FILE__:1,empty:1,require_once:1,"function":1,"do":1,xor:1,"return":1,"implements":1,parent:1,clone:1,use:1,__CLASS__:1,__LINE__:1,"else":1,"break":1,print:1,"eval":1,"new":1,"catch":1,__METHOD__:1,"class":1,"case":1,exception:1,php_user_filter:1,"default":1,die:1,require:1,__FUNCTION__:1,enddeclare:1,"final":1,"try":1,"this":1,"switch":1,"continue":1,endfor:1,endif:1,declare:1,unset:1,"true":1,"false":1,namespace:1},c:[hljs.CLCM,hljs.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+",r:10}]},hljs.CNM,hljs.inherit(hljs.ASM,{i:null}),hljs.inherit(hljs.QSM,{i:null}),{cN:"variable",b:"\\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"},{cN:"preprocessor",b:"<\\?php",r:10},{cN:"preprocessor",b:"\\?>"}]}};hljs.LANGUAGES.python=function(){var c={cN:"string",b:"(u|b)?r?'''",e:"'''",r:10};var b={cN:"string",b:'(u|b)?r?"""',e:'"""',r:10};
2034var a={cN:"string",b:"(u|r|ur|b|br)'",e:"'",c:[hljs.BE],r:10};var f={cN:"string",b:'(u|r|ur|b|br)"',e:'"',c:[hljs.BE],r:10};var d={cN:"title",b:hljs.UIR};var e={cN:"params",b:"\\(",e:"\\)",c:[c,b,a,f,hljs.ASM,hljs.QSM]};return{dM:{k:{keyword:{and:1,elif:1,is:1,global:1,as:1,"in":1,"if":1,from:1,raise:1,"for":1,except:1,"finally":1,print:1,"import":1,pass:1,"return":1,exec:1,"else":1,"break":1,not:1,"with":1,"class":1,assert:1,yield:1,"try":1,"while":1,"continue":1,del:1,or:1,def:1,lambda:1,nonlocal:10},built_in:{None:1,True:1,False:1,Ellipsis:1,NotImplemented:1}},i:"(</|->|\\?)",c:[hljs.HCM,c,b,a,f,hljs.ASM,hljs.QSM,{cN:"function",b:"\\bdef ",e:":",i:"$",k:{def:1},c:[d,e],r:10},{cN:"class",b:"\\bclass ",e:":",i:"[${]",k:{"class":1},c:[d,e],r:10},hljs.CNM,{cN:"decorator",b:"@",e:"$"}]}}}();hljs.LANGUAGES.sql={cI:true,dM:{i:"[^\\s]",c:[{cN:"operator",b:"(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma)\\b",e:";|$",k:{keyword:{all:1,partial:1,global:1,month:1,current_timestamp:1,using:1,go:1,revoke:1,smallint:1,indicator:1,"end-exec":1,disconnect:1,zone:1,"with":1,character:1,assertion:1,to:1,add:1,current_user:1,usage:1,input:1,local:1,alter:1,match:1,collate:1,real:1,then:1,rollback:1,get:1,read:1,timestamp:1,session_user:1,not:1,integer:1,bit:1,unique:1,day:1,minute:1,desc:1,insert:1,execute:1,like:1,ilike:2,level:1,decimal:1,drop:1,"continue":1,isolation:1,found:1,where:1,constraints:1,domain:1,right:1,national:1,some:1,module:1,transaction:1,relative:1,second:1,connect:1,escape:1,close:1,system_user:1,"for":1,deferred:1,section:1,cast:1,current:1,sqlstate:1,allocate:1,intersect:1,deallocate:1,numeric:1,"public":1,preserve:1,full:1,"goto":1,initially:1,asc:1,no:1,key:1,output:1,collation:1,group:1,by:1,union:1,session:1,both:1,last:1,language:1,constraint:1,column:1,of:1,space:1,foreign:1,deferrable:1,prior:1,connection:1,unknown:1,action:1,commit:1,view:1,or:1,first:1,into:1,"float":1,year:1,primary:1,cascaded:1,except:1,restrict:1,set:1,references:1,names:1,table:1,outer:1,open:1,select:1,size:1,are:1,rows:1,from:1,prepare:1,distinct:1,leading:1,create:1,only:1,next:1,inner:1,authorization:1,schema:1,corresponding:1,option:1,declare:1,precision:1,immediate:1,"else":1,timezone_minute:1,external:1,varying:1,translation:1,"true":1,"case":1,exception:1,join:1,hour:1,"default":1,"double":1,scroll:1,value:1,cursor:1,descriptor:1,values:1,dec:1,fetch:1,procedure:1,"delete":1,and:1,"false":1,"int":1,is:1,describe:1,"char":1,as:1,at:1,"in":1,varchar:1,"null":1,trailing:1,any:1,absolute:1,current_time:1,end:1,grant:1,privileges:1,when:1,cross:1,check:1,write:1,current_date:1,pad:1,begin:1,temporary:1,exec:1,time:1,update:1,catalog:1,user:1,sql:1,date:1,on:1,identity:1,timezone_hour:1,natural:1,whenever:1,interval:1,work:1,order:1,cascade:1,diagnostics:1,nchar:1,having:1,left:1,call:1,"do":1,handler:1,load:1,replace:1,truncate:1,start:1,lock:1,show:1,pragma:1},aggregate:{count:1,sum:1,min:1,max:1,avg:1}},c:[{cN:"string",b:"'",e:"'",c:[hljs.BE,{b:"''"}],r:0},{cN:"string",b:'"',e:'"',c:[hljs.BE,{b:'""'}],r:0},{cN:"string",b:"`",e:"`",c:[hljs.BE]},hljs.CNM,{b:"\\n"}]},hljs.CBLCLM,{cN:"comment",b:"--",e:"$"}]}};hljs.LANGUAGES.ini={cI:true,dM:{i:"[^\\s]",c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9_\\[\\]]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:{on:1,off:1,"true":1,"false":1,yes:1,no:1},c:[hljs.QSM,hljs.NM]}]}]}};hljs.LANGUAGES.perl=function(){var c={getpwent:1,getservent:1,quotemeta:1,msgrcv:1,scalar:1,kill:1,dbmclose:1,undef:1,lc:1,ma:1,syswrite:1,tr:1,send:1,umask:1,sysopen:1,shmwrite:1,vec:1,qx:1,utime:1,local:1,oct:1,semctl:1,localtime:1,readpipe:1,"do":1,"return":1,format:1,read:1,sprintf:1,dbmopen:1,pop:1,getpgrp:1,not:1,getpwnam:1,rewinddir:1,qq:1,fileno:1,qw:1,endprotoent:1,wait:1,sethostent:1,bless:1,s:1,opendir:1,"continue":1,each:1,sleep:1,endgrent:1,shutdown:1,dump:1,chomp:1,connect:1,getsockname:1,die:1,socketpair:1,close:1,flock:1,exists:1,index:1,shmget:1,sub:1,"for":1,endpwent:1,redo:1,lstat:1,msgctl:1,setpgrp:1,abs:1,exit:1,select:1,print:1,ref:1,gethostbyaddr:1,unshift:1,fcntl:1,syscall:1,"goto":1,getnetbyaddr:1,join:1,gmtime:1,symlink:1,semget:1,splice:1,x:1,getpeername:1,recv:1,log:1,setsockopt:1,cos:1,last:1,reverse:1,gethostbyname:1,getgrnam:1,study:1,formline:1,endhostent:1,times:1,chop:1,length:1,gethostent:1,getnetent:1,pack:1,getprotoent:1,getservbyname:1,rand:1,mkdir:1,pos:1,chmod:1,y:1,substr:1,endnetent:1,printf:1,next:1,open:1,msgsnd:1,readdir:1,use:1,unlink:1,getsockopt:1,getpriority:1,rindex:1,wantarray:1,hex:1,system:1,getservbyport:1,endservent:1,"int":1,chr:1,untie:1,rmdir:1,prototype:1,tell:1,listen:1,fork:1,shmread:1,ucfirst:1,setprotoent:1,"else":1,sysseek:1,link:1,getgrgid:1,shmctl:1,waitpid:1,unpack:1,getnetbyname:1,reset:1,chdir:1,grep:1,split:1,require:1,caller:1,lcfirst:1,until:1,warn:1,"while":1,values:1,shift:1,telldir:1,getpwuid:1,my:1,getprotobynumber:1,"delete":1,and:1,sort:1,uc:1,defined:1,srand:1,accept:1,"package":1,seekdir:1,getprotobyname:1,semop:1,our:1,rename:1,seek:1,"if":1,q:1,chroot:1,sysread:1,setpwent:1,no:1,crypt:1,getc:1,chown:1,sqrt:1,write:1,setnetent:1,setpriority:1,foreach:1,tie:1,sin:1,msgget:1,map:1,stat:1,getlogin:1,unless:1,elsif:1,truncate:1,exec:1,keys:1,glob:1,tied:1,closedir:1,ioctl:1,socket:1,readlink:1,"eval":1,xor:1,readline:1,binmode:1,setservent:1,eof:1,ord:1,bind:1,alarm:1,pipe:1,atan2:1,getgrent:1,exp:1,time:1,push:1,setgrent:1,gt:1,lt:1,or:1,ne:1,m:1};var d={cN:"subst",b:"[$@]\\{",e:"}",k:c,r:10};var b={cN:"variable",b:"\\$\\d"};var a={cN:"variable",b:"[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)"};var g=[hljs.BE,d,b,a];var f={b:"->",c:[{b:hljs.IR},{b:"{",e:"}"}]};var e=[b,a,hljs.HCM,{cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5},f,{cN:"string",b:"q[qwxr]?\\s*\\(",e:"\\)",c:g,r:5},{cN:"string",b:"q[qwxr]?\\s*\\[",e:"\\]",c:g,r:5},{cN:"string",b:"q[qwxr]?\\s*\\{",e:"\\}",c:g,r:5},{cN:"string",b:"q[qwxr]?\\s*\\|",e:"\\|",c:g,r:5},{cN:"string",b:"q[qwxr]?\\s*\\<",e:"\\>",c:g,r:5},{cN:"string",b:"qw\\s+q",e:"q",c:g,r:5}
2034,{cN:"string",b:"'",e:"'",c:[hljs.BE],r:0},{cN:"string",b:'"',e:'"',c:g,r:0},{cN:"string",b:"`",e:"`",c:[hljs.BE]},{cN:"string",b:"{\\w+}",r:0},{cN:"string",b:"-?\\w+\\s*\\=\\>",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[hljs.BE],r:0},{cN:"sub",b:"\\bsub\\b",e:"(\\s*\\(.*?\\))?[;{]",k:{sub:1},r:5},{cN:"operator",b:"-\\w\\b",r:0},{cN:"pod",b:"\\=\\w",e:"\\=cut"}];d.c=e;f.c[1].c=e;return{dM:{k:c,c:e}}}();hljs.LANGUAGES.cpp=function(){var b={keyword:{"false":1,"int":1,"float":1,"while":1,"private":1,"char":1,"catch":1,"export":1,virtual:1,operator:2,sizeof:2,dynamic_cast:2,typedef:2,const_cast:2,"const":1,struct:1,"for":1,static_cast:2,union:1,namespace:1,unsigned:1,"long":1,"throw":1,"volatile":2,"static":1,"protected":1,bool:1,template:1,mutable:1,"if":1,"public":1,friend:2,"do":1,"return":1,"goto":1,auto:1,"void":2,"enum":1,"else":1,"break":1,"new":1,extern:1,using:1,"true":1,"class":1,asm:1,"case":1,typeid:1,"short":1,reinterpret_cast:2,"default":1,"double":1,register:1,explicit:1,signed:1,typename:1,"try":1,"this":1,"switch":1,"continue":1,wchar_t:1,inline:1,"delete":1,alignof:1,char16_t:1,char32_t:1,constexpr:1,decltype:1,noexcept:1,nullptr:1,static_assert:1,thread_local:1},built_in:{std:1,string:1,cin:1,cout:1,cerr:1,clog:1,stringstream:1,istringstream:1,ostringstream:1,auto_ptr:1,deque:1,list:1,queue:1,stack:1,vector:1,map:1,set:1,bitset:1,multiset:1,multimap:1,unordered_set:1,unordered_map:1,unordered_multiset:1,unordered_multimap:1,array:1,shared_ptr:1}};var a={cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,r:10};a.c=[a];return{dM:{k:b,i:"</",c:[hljs.CLCM,hljs.CBLCLM,hljs.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},hljs.CNM,{cN:"preprocessor",b:"#",e:"$"},a]}}}();
2035/*global jQuery */
2036/*jshint browser:true */
2037/*!
2038* FitVids 1.1
2039*
2040* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
2041* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
2042* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
2043*
2044*/
2045
2046;(function( $ ){
2047
2048  'use strict';
2049
2050  $.fn.fitVids = function( options ) {
2051    var settings = {
2052      customSelector: null,
2053      ignore: null
2054    };
2055
2056    if(!document.getElementById('fit-vids-style')) {
2057      // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
2058      var head = document.head || document.getElementsByTagName('head')[0];
2059      var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
2060      var div = document.createElement("div");
2061      div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
2062      head.appendChild(div.childNodes[1]);
2063    }
2064
2065    if ( options ) {
2066      $.extend( settings, options );
2067    }
2068
2069    return this.each(function(){
2070      var selectors = [
2071        'iframe[src*="player.vimeo.com"]',
2072        'iframe[src*="youtube.com"]',
2073        'iframe[src*="youtube-nocookie.com"]',
2074        'iframe[src*="kickstarter.com"][src*="video.html"]',
2075        'object',
2076        'embed'
2077      ];
2078
2079      if (settings.customSelector) {
2080        selectors.push(settings.customSelector);
2081      }
2082
2083      var ignoreList = '.fitvidsignore';
2084
2085      if(settings.ignore) {
2086        ignoreList = ignoreList + ', ' + settings.ignore;
2087      }
2088
2089      var $allVideos = $(this).find(selectors.join(','));
2090      $allVideos = $allVideos.not('object object'); // SwfObj conflict patch
2091      $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
2092
2093      $allVideos.each(function(){
2094        var $this = $(this);
2095        if($this.parents(ignoreList).length > 0) {
2096          return; // Disable FitVids on this video.
2097        }
2098        if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
2099        if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
2100        {
2101          $this.attr('height', 9);
2102          $this.attr('width', 16);
2103        }
2104        var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
2105            width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
2106            aspectRatio = height / width;
2107        if(!$this.attr('id')){
2108          var videoID = 'fitvid' + Math.floor(Math.random()*999999);
2109          $this.attr('id', videoID);
2110        }
2111        $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');
2112        $this.removeAttr('height').removeAttr('width');
2113      });
2114    });
2115  };
2116// Works with either jQuery or Zepto
2117})( window.jQuery || window.Zepto );
2118
2119/*!
2120 * Glide.js v3.4.1
2121 * (c) 2013-2019 Jędrzej Chałubek <[email protected]> (http://jedrzejchalubek.com/)
2122 * Released under the MIT License.
2123 */
2124
2125(function (global, factory) {
2126  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
2127  typeof define === 'function' && define.amd ? define(factory) :
2128  (global.Glide = factory());
2129}(this, (function () { 'use strict';
2130
2131  var defaults = {
2132    /**
2133     * Type of the movement.
2134     *
2135     * Available types:
2136     * `slider` - Rewinds slider to the start/end when it reaches the first or last slide.
2137     * `carousel` - Changes slides without starting over when it reaches the first or last slide.
2138     *
2139     * @type {String}
2140     */
2141    type: 'slider',
2142
2143    /**
2144     * Start at specific slide number defined with zero-based index.
2145     *
2146     * @type {Number}
2147     */
2148    startAt: 0,
2149
2150    /**
2151     * A number of slides visible on the single viewport.
2152     *
2153     * @type {Number}
2154     */
2155    perView: 1,
2156
2157    /**
2158     * Focus currently active slide at a specified position in the track.
2159     *
2160     * Available inputs:
2161     * `center` - Current slide will be always focused at the center of a track.
2162     * `0,1,2,3...` - Current slide will be focused on the specified zero-based index.
2163     *
2164     * @type {String|Number}
2165     */
2166    focusAt: 0,
2167
2168    /**
2169     * A size of the gap added between slides.
2170     *
2171     * @type {Number}
2172     */
2173    gap: 10,
2174
2175    /**
2176     * Change slides after a specified interval. Use `false` for turning off autoplay.
2177     *
2178     * @type {Number|Boolean}
2179     */
2180    autoplay: false,
2181
2182    /**
2183     * Stop autoplay on mouseover event.
2184     *
2185     * @type {Boolean}
2186     */
2187    hoverpause: true,
2188
2189    /**
2190     * Allow for changing slides with left and right keyboard arrows.
2191     *
2192     * @type {Boolean}
2193     */
2194    keyboard: true,
2195
2196    /**
2197     * Stop running `perView` number of slides from the end. Use this
2198     * option if you don't want to have an empty space after
2199     * a slider. Works only with `slider` type and a
2200     * non-centered `focusAt` setting.
2201     *
2202     * @type {Boolean}
2203     */
2204    bound: false,
2205
2206    /**
2207     * Minimal swipe distance needed to change the slide. Use `false` for turning off a swiping.
2208     *
2209     * @type {Number|Boolean}
2210     */
2211    swipeThreshold: 80,
2212
2213    /**
2214     * Minimal mouse drag distance needed to change the slide. Use `false` for turning off a dragging.
2215     *
2216     * @type {Number|Boolean}
2217     */
2218    dragThreshold: 120,
2219
2220    /**
2221     * A maximum number of slides to which movement will be made on swiping or dragging. Use `false` for unlimited.
2222     *
2223     * @type {Number|Boolean}
2224     */
2225    perTouch: false,
2226
2227    /**
2228     * Moving distance ratio of the slides on a swiping and dragging.
2229     *
2230     * @type {Number}
2231     */
2232    touchRatio: 0.5,
2233
2234    /**
2235     * Angle required to activate slides moving on swiping or dragging.
2236     *
2237     * @type {Number}
2238     */
2239    touchAngle: 45,
2240
2241    /**
2242     * Duration of the animation in milliseconds.
2243     *
2244     * @type {Number}
2245     */
2246    animationDuration: 400,
2247
2248    /**
2249     * Allows looping the `slider` type. Slider will rewind to the first/last slide when it's at the start/end.
2250     *
2251     * @type {Boolean}
2252     */
2253    rewind: true,
2254
2255    /**
2256     * Duration of the rewinding animation of the `slider` type in milliseconds.
2257     *
2258     * @type {Number}
2259     */
2260    rewindDuration: 800,
2261
2262    /**
2263     * Easing function for the animation.
2264     *
2265     * @type {String}
2266     */
2267    animationTimingFunc: 'cubic-bezier(.165, .840, .440, 1)',
2268
2269    /**
2270     * Throttle costly events at most once per every wait milliseconds.
2271     *
2272     * @type {Number}
2273     */
2274    throttle: 10,
2275
2276    /**
2277     * Moving direction mode.
2278     *
2279     * Available inputs:
2280     * - 'ltr' - left to right movement,
2281     * - 'rtl' - right to left movement.
2282     *
2283     * @type {String}
2284     */
2285    direction: 'ltr',
2286
2287    /**
2288     * The distance value of the next and previous viewports which
2289     * have to peek in the current view. Accepts number and
2290     * pixels as a string. Left and right peeking can be
2291     * set up separately with a directions object.
2292     *
2293     * For example:
2294     * `100` - Peek 100px on the both sides.
2295     * { before: 100, after: 50 }` - Peek 100px on the left side and 50px on the right side.
2296     *
2297     * @type {Number|String|Object}
2298     */
2299    peek: 0,
2300
2301    /**
2302     * Collection of options applied at specified media breakpoints.
2303     * For example: display two slides per view under 800px.
2304     * `{
2305     *   '800px': {
2306     *     perView: 2
2307     *   }
2308     * }`
2309     */
2310    breakpoints: {},
2311
2312    /**
2313     * Collection of internally used HTML classes.
2314     *
2315     * @todo Refactor `slider` and `carousel` properties to single `type: { slider: '', carousel: '' }` object
2316     * @type {Object}
2317     */
2318    classes: {
2319      direction: {
2320        ltr: 'glide--ltr',
2321        rtl: 'glide--rtl'
2322      },
2323      slider: 'glide--slider',
2324      carousel: 'glide--carousel',
2325      swipeable: 'glide--swipeable',
2326      dragging: 'glide--dragging',
2327      cloneSlide: 'glide__slide--clone',
2328      activeNav: 'glide__bullet--active',
2329      activeSlide: 'glide__slide--active',
2330      disabledArrow: 'glide__arrow--disabled'
2331    }
2332  };
2333
2334  /**
2335   * Outputs warning message to the bowser console.
2336   *
2337   * @param  {String} msg
2338   * @return {Void}
2339   */
2340  function warn(msg) {
2341    console.error("[Glide warn]: " + msg);
2342  }
2343
2344  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
2345    return typeof obj;
2346  } : function (obj) {
2347    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2348  };
2349
2350  var classCallCheck = function (instance, Constructor) {
2351    if (!(instance instanceof Constructor)) {
2352      throw new TypeError("Cannot call a class as a function");
2353    }
2354  };
2355
2356  var createClass = function () {
2357    function defineProperties(target, props) {
2358      for (var i = 0; i < props.length; i++) {
2359        var descriptor = props[i];
2360        descriptor.enumerable = descriptor.enumerable || false;
2361        descriptor.configurable = true;
2362        if ("value" in descriptor) descriptor.writable = true;
2363        Object.defineProperty(target, descriptor.key, descriptor);
2364      }
2365    }
2366
2367    return function (Constructor, protoProps, staticProps) {
2368      if (protoProps) defineProperties(Constructor.prototype, protoProps);
2369      if (staticProps) defineProperties(Constructor, staticProps);
2370      return Constructor;
2371    };
2372  }();
2373
2374  var _extends = Object.assign || function (target) {
2375    for (var i = 1; i < arguments.length; i++) {
2376      var source = arguments[i];
2377
2378      for (var key in source) {
2379        if (Object.prototype.hasOwnProperty.call(source, key)) {
2380          target[key] = source[key];
2381        }
2382      }
2383    }
2384
2385    return target;
2386  };
2387
2388  var get = function get(object, property, receiver) {
2389    if (object === null) object = Function.prototype;
2390    var desc = Object.getOwnPropertyDescriptor(object, property);
2391
2392    if (desc === undefined) {
2393      var parent = Object.getPrototypeOf(object);
2394
2395      if (parent === null) {
2396        return undefined;
2397      } else {
2398        return get(parent, property, receiver);
2399      }
2400    } else if ("value" in desc) {
2401      return desc.value;
2402    } else {
2403      var getter = desc.get;
2404
2405      if (getter === undefined) {
2406        return undefined;
2407      }
2408
2409      return getter.call(receiver);
2410    }
2411  };
2412
2413  var inherits = function (subClass, superClass) {
2414    if (typeof superClass !== "function" && superClass !== null) {
2415      throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
2416    }
2417
2418    subClass.prototype = Object.create(superClass && superClass.prototype, {
2419      constructor: {
2420        value: subClass,
2421        enumerable: false,
2422        writable: true,
2423        configurable: true
2424      }
2425    });
2426    if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
2427  };
2428
2429  var possibleConstructorReturn = function (self, call) {
2430    if (!self) {
2431      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2432    }
2433
2434    return call && (typeof call === "object" || typeof call === "function") ? call : self;
2435  };
2436
2437  /**
2438   * Converts value entered as number
2439   * or string to integer value.
2440   *
2441   * @param {String} value
2442   * @returns {Number}
2443   */
2444  function toInt(value) {
2445    return parseInt(value);
2446  }
2447
2448  /**
2449   * Converts value entered as number
2450   * or string to flat value.
2451   *
2452   * @param {String} value
2453   * @returns {Number}
2454   */
2455  function toFloat(value) {
2456    return parseFloat(value);
2457  }
2458
2459  /**
2460   * Indicates whether the specified value is a string.
2461   *
2462   * @param  {*}   value
2463   * @return {Boolean}
2464   */
2465  function isString(value) {
2466    return typeof value === 'string';
2467  }
2468
2469  /**
2470   * Indicates whether the specified value is an object.
2471   *
2472   * @param  {*} value
2473   * @return {Boolean}
2474   *
2475   * @see https://github.com/jashkenas/underscore
2476   */
2477  function isObject(value) {
2478    var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
2479
2480    return type === 'function' || type === 'object' && !!value; // eslint-disable-line no-mixed-operators
2481  }
2482
2483  /**
2484   * Indicates whether the specified value is a number.
2485   *
2486   * @param  {*} value
2487   * @return {Boolean}
2488   */
2489  function isNumber(value) {
2490    return typeof value === 'number';
2491  }
2492
2493  /**
2494   * Indicates whether the specified value is a function.
2495   *
2496   * @param  {*} value
2497   * @return {Boolean}
2498   */
2499  function isFunction(value) {
2500    return typeof value === 'function';
2501  }
2502
2503  /**
2504   * Indicates whether the specified value is undefined.
2505   *
2506   * @param  {*} value
2507   * @return {Boolean}
2508   */
2509  function isUndefined(value) {
2510    return typeof value === 'undefined';
2511  }
2512
2513  /**
2514   * Indicates whether the specified value is an array.
2515   *
2516   * @param  {*} value
2517   * @return {Boolean}
2518   */
2519  function isArray(value) {
2520    return value.constructor === Array;
2521  }
2522
2523  /**
2524   * Creates and initializes specified collection of extensions.
2525   * Each extension receives access to instance of glide and rest of components.
2526   *
2527   * @param {Object} glide
2528   * @param {Object} extensions
2529   *
2530   * @returns {Object}
2531   */
2532  function mount(glide, extensions, events) {
2533    var components = {};
2534
2535    for (var name in extensions) {
2536      if (isFunction(extensions[name])) {
2537        components[name] = extensions[name](glide, components, events);
2538      } else {
2539        warn('Extension must be a function');
2540      }
2541    }
2542
2543    for (var _name in components) {
2544      if (isFunction(components[_name].mount)) {
2545        components[_name].mount();
2546      }
2547    }
2548
2549    return components;
2550  }
2551
2552  /**
2553   * Defines getter and setter property on the specified object.
2554   *
2555   * @param  {Object} obj         Object where property has to be defined.
2556   * @param  {String} prop        Name of the defined property.
2557   * @param  {Object} definition  Get and set definitions for the property.
2558   * @return {Void}
2559   */
2560  function define(obj, prop, definition) {
2561    Object.defineProperty(obj, prop, definition);
2562  }
2563
2564  /**
2565   * Sorts aphabetically object keys.
2566   *
2567   * @param  {Object} obj
2568   * @return {Object}
2569   */
2570  function sortKeys(obj) {
2571    return Object.keys(obj).sort().reduce(function (r, k) {
2572      r[k] = obj[k];
2573
2574      return r[k], r;
2575    }, {});
2576  }
2577
2578  /**
2579   * Merges passed settings object with default options.
2580   *
2581   * @param  {Object} defaults
2582   * @param  {Object} settings
2583   * @return {Object}
2584   */
2585  function mergeOptions(defaults, settings) {
2586    var options = _extends({}, defaults, settings);
2587
2588    // `Object.assign` do not deeply merge objects, so we
2589    // have to do it manually for every nested object
2590    // in options. Although it does not look smart,
2591    // it's smaller and faster than some fancy
2592    // merging deep-merge algorithm script.
2593    if (settings.hasOwnProperty('classes')) {
2594      options.classes = _extends({}, defaults.classes, settings.classes);
2595
2596      if (settings.classes.hasOwnProperty('direction')) {
2597        options.classes.direction = _extends({}, defaults.classes.direction, settings.classes.direction);
2598      }
2599    }
2600
2601    if (settings.hasOwnProperty('breakpoints')) {
2602      options.breakpoints = _extends({}, defaults.breakpoints, settings.breakpoints);
2603    }
2604
2605    return options;
2606  }
2607
2608  var EventsBus = function () {
2609    /**
2610     * Construct a EventBus instance.
2611     *
2612     * @param {Object} events
2613     */
2614    function EventsBus() {
2615      var events = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2616      classCallCheck(this, EventsBus);
2617
2618      this.events = events;
2619      this.hop = events.hasOwnProperty;
2620    }
2621
2622    /**
2623     * Adds listener to the specifed event.
2624     *
2625     * @param {String|Array} event
2626     * @param {Function} handler
2627     */
2628
2629
2630    createClass(EventsBus, [{
2631      key: 'on',
2632      value: function on(event, handler) {
2633        if (isArray(event)) {
2634          for (var i = 0; i < event.length; i++) {
2635            this.on(event[i], handler);
2636          }
2637        }
2638
2639        // Create the event's object if not yet created
2640        if (!this.hop.call(this.events, event)) {
2641          this.events[event] = [];
2642        }
2643
2644        // Add the handler to queue
2645        var index = this.events[event].push(handler) - 1;
2646
2647        // Provide handle back for removal of event
2648        return {
2649          remove: function remove() {
2650            delete this.events[event][index];
2651          }
2652        };
2653      }
2654
2655      /**
2656       * Runs registered handlers for specified event.
2657       *
2658       * @param {String|Array} event
2659       * @param {Object=} context
2660       */
2661
2662    }, {
2663      key: 'emit',
2664      value: function emit(event, context) {
2665        if (isArray(event)) {
2666          for (var i = 0; i < event.length; i++) {
2667            this.emit(event[i], context);
2668          }
2669        }
2670
2671        // If the event doesn't exist, or there's no handlers in queue, just leave
2672        if (!this.hop.call(this.events, event)) {
2673          return;
2674        }
2675
2676        // Cycle through events queue, fire!
2677        this.events[event].forEach(function (item) {
2678          item(context || {});
2679        });
2680      }
2681    }]);
2682    return EventsBus;
2683  }();
2684
2685  var Glide = function () {
2686    /**
2687     * Construct glide.
2688     *
2689     * @param  {String} selector
2690     * @param  {Object} options
2691     */
2692    function Glide(selector) {
2693      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2694      classCallCheck(this, Glide);
2695
2696      this._c = {};
2697      this._t = [];
2698      this._e = new EventsBus();
2699
2700      this.disabled = false;
vendor: 4,247 bytes, lines 2701-2897
2701      this.selector = selector;
2702      this.settings = mergeOptions(defaults, options);
2703      this.index = this.settings.startAt;
2704    }
2705
2706    /**
2707     * Initializes glide.
2708     *
2709     * @param {Object} extensions Collection of extensions to initialize.
2710     * @return {Glide}
2711     */
2712
2713
2714    createClass(Glide, [{
2715      key: 'mount',
2716      value: function mount$$1() {
2717        var extensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2718
2719        this._e.emit('mount.before');
2720
2721        if (isObject(extensions)) {
2722          this._c = mount(this, extensions, this._e);
2723        } else {
2724          warn('You need to provide a object on `mount()`');
2725        }
2726
2727        this._e.emit('mount.after');
2728
2729        return this;
2730      }
2731
2732      /**
2733       * Collects an instance `translate` transformers.
2734       *
2735       * @param  {Array} transformers Collection of transformers.
2736       * @return {Void}
2737       */
2738
2739    }, {
2740      key: 'mutate',
2741      value: function mutate() {
2742        var transformers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2743
2744        if (isArray(transformers)) {
2745          this._t = transformers;
2746        } else {
2747          warn('You need to provide a array on `mutate()`');
2748        }
2749
2750        return this;
2751      }
2752
2753      /**
2754       * Updates glide with specified settings.
2755       *
2756       * @param {Object} settings
2757       * @return {Glide}
2758       */
2759
2760    }, {
2761      key: 'update',
2762      value: function update() {
2763        var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2764
2765        this.settings = mergeOptions(this.settings, settings);
2766
2767        if (settings.hasOwnProperty('startAt')) {
2768          this.index = settings.startAt;
2769        }
2770
2771        this._e.emit('update');
2772
2773        return this;
2774      }
2775
2776      /**
2777       * Change slide with specified pattern. A pattern must be in the special format:
2778       * `>` - Move one forward
2779       * `<` - Move one backward
2780       * `={i}` - Go to {i} zero-based slide (eq. '=1', will go to second slide)
2781       * `>>` - Rewinds to end (last slide)
2782       * `<<` - Rewinds to start (first slide)
2783       *
2784       * @param {String} pattern
2785       * @return {Glide}
2786       */
2787
2788    }, {
2789      key: 'go',
2790      value: function go(pattern) {
2791        this._c.Run.make(pattern);
2792
2793        return this;
2794      }
2795
2796      /**
2797       * Move track by specified distance.
2798       *
2799       * @param {String} distance
2800       * @return {Glide}
2801       */
2802
2803    }, {
2804      key: 'move',
2805      value: function move(distance) {
2806        this._c.Transition.disable();
2807        this._c.Move.make(distance);
2808
2809        return this;
2810      }
2811
2812      /**
2813       * Destroy instance and revert all changes done by this._c.
2814       *
2815       * @return {Glide}
2816       */
2817
2818    }, {
2819      key: 'destroy',
2820      value: function destroy() {
2821        this._e.emit('destroy');
2822
2823        return this;
2824      }
2825
2826      /**
2827       * Start instance autoplaying.
2828       *
2829       * @param {Boolean|Number} interval Run autoplaying with passed interval regardless of `autoplay` settings
2830       * @return {Glide}
2831       */
2832
2833    }, {
2834      key: 'play',
2835      value: function play() {
2836        var interval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2837
2838        if (interval) {
2839          this.settings.autoplay = interval;
2840        }
2841
2842        this._e.emit('play');
2843
2844        return this;
2845      }
2846
2847      /**
2848       * Stop instance autoplaying.
2849       *
2850       * @return {Glide}
2851       */
2852
2853    }, {
2854      key: 'pause',
2855      value: function pause() {
2856        this._e.emit('pause');
2857
2858        return this;
2859      }
2860
2861      /**
2862       * Sets glide into a idle status.
2863       *
2864       * @return {Glide}
2865       */
2866
2867    }, {
2868      key: 'disable',
2869      value: function disable() {
2870        this.disabled = true;
2871
2872        return this;
2873      }
2874
2875      /**
2876       * Sets glide into a active status.
2877       *
2878       * @return {Glide}
2879       */
2880
2881    }, {
2882      key: 'enable',
2883      value: function enable() {
2884        this.disabled = false;
2885
2886        return this;
2887      }
2888
2889      /**
2890       * Adds cuutom event listener with handler.
2891       *
2892       * @param  {String|Array} event
2893       * @param  {Function} handler
2894       * @return {Glide}
2895       */
2896
2897    }, {
2898      key: 'on',
2899      value: function on(event, handler) {
2900        this._e.on(event, handler);
2901
2902        return this;
2903      }
2904
2905      /**
2906       * Checks if glide is a precised type.
2907       *
2908       * @param  {String} name
2909       * @return {Boolean}
2910       */
2911
2912    }, {
2913      key: 'isType',
2914      value: function isType(name) {
2915        return this.settings.type === name;
2916      }
2917
2918      /**
2919       * Gets value of the core options.
2920       *
2921       * @return {Object}
2922       */
2923
2924    }, {
2925      key: 'settings',
2926      get: function get$$1() {
2927        return this._o;
2928      }
2929
2930      /**
2931       * Sets value of the core options.
2932       *
2933       * @param  {Object} o
2934       * @return {Void}
2935       */
2936      ,
2937      set: function set$$1(o) {
2938        if (isObject(o)) {
2939          this._o = o;
2940        } else {
2941          warn('Options must be an `object` instance.');
2942        }
2943      }
2944
2945      /**
2946       * Gets current index of the slider.
2947       *
2948       * @return {Object}
2949       */
2950
2951    }, {
2952      key: 'index',
2953      get: function get$$1() {
2954        return this._i;
2955      }
2956
2957      /**
2958       * Sets current index a slider.
2959       *
2960       * @return {Object}
2961       */
2962      ,
2963      set: function set$$1(i) {
2964        this._i = toInt(i);
2965      }
2966
2967      /**
2968       * Gets type name of the slider.
2969       *
2970       * @return {String}
2971       */
2972
2973    }, {
2974      key: 'type',
2975      get: function get$$1() {
2976        return this.settings.type;
2977      }
2978
2979      /**
2980       * Gets value of the idle status.
2981       *
2982       * @return {Boolean}
2983       */
2984
2985    }, {
2986      key: 'disabled',
2987      get: function get$$1() {
2988        return this._d;
2989      }
2990
2991      /**
2992       * Sets value of the idle status.
2993       *
2994       * @return {Boolean}
2995       */
2996      ,
2997      set: function set$$1(status) {
2998        this._d = !!status;
2999      }
3000    }]);
3001    return Glide;
3002  }();
3003
3004  function Run (Glide, Components, Events) {
3005    var Run = {
3006      /**
3007       * Initializes autorunning of the glide.
3008       *
3009       * @return {Void}
3010       */
3011      mount: function mount() {
3012        this._o = false;
3013      },
3014
3015
3016      /**
3017       * Makes glides running based on the passed moving schema.
3018       *
3019       * @param {String} move
3020       */
3021      make: function make(move) {
3022        var _this = this;
3023
3024        if (!Glide.disabled) {
3025          Glide.disable();
3026
3027          this.move = move;
3028
3029          Events.emit('run.before', this.move);
3030
3031          this.calculate();
3032
3033          Events.emit('run', this.move);
3034
3035          Components.Transition.after(function () {
3036            if (_this.isStart()) {
3037              Events.emit('run.start', _this.move);
3038            }
3039
3040            if (_this.isEnd()) {
3041              Events.emit('run.end', _this.move);
3042            }
3043
3044            if (_this.isOffset('<') || _this.isOffset('>')) {
3045              _this._o = false;
3046
3047              Events.emit('run.offset', _this.move);
3048            }
3049
3050            Events.emit('run.after', _this.move);
3051
3052            Glide.enable();
3053          });
3054        }
3055      },
3056
3057
3058      /**
3059       * Calculates current index based on defined move.
3060       *
3061       * @return {Void}
3062       */
3063      calculate: function calculate() {
3064        var move = this.move,
3065            length = this.length;
3066        var steps = move.steps,
3067            direction = move.direction;
3068
3069
3070        var countableSteps = isNumber(toInt(steps)) && toInt(steps) !== 0;
3071
3072        switch (direction) {
3073          case '>':
3074            if (steps === '>') {
3075              Glide.index = length;
3076            } else if (this.isEnd()) {
3077              if (!(Glide.isType('slider') && !Glide.settings.rewind)) {
3078                this._o = true;
3079
3080                Glide.index = 0;
3081              }
3082            } else if (countableSteps) {
3083              Glide.index += Math.min(length - Glide.index, -toInt(steps));
3084            } else {
3085              Glide.index++;
3086            }
3087            break;
3088
3089          case '<':
3090            if (steps === '<') {
3091              Glide.index = 0;
3092            } else if (this.isStart()) {
3093              if (!(Glide.isType('slider') && !Glide.settings.rewind)) {
3094                this._o = true;
3095
3096                Glide.index = length;
3097              }
3098            } else if (countableSteps) {
3099              Glide.index -= Math.min(Glide.index, toInt(steps));
3100            } else {
3101              Glide.index--;
3102            }
3103            break;
3104
3105          case '=':
3106            Glide.index = steps;
3107            break;
3108
3109          default:
3110            warn('Invalid direction pattern [' + direction + steps + '] has been used');
3111            break;
3112        }
3113      },
3114
3115
3116      /**
3117       * Checks if we are on the first slide.
3118       *
3119       * @return {Boolean}
3120       */
3121      isStart: function isStart() {
3122        return Glide.index === 0;
3123      },
3124
3125
3126      /**
3127       * Checks if we are on the last slide.
3128       *
3129       * @return {Boolean}
3130       */
3131      isEnd: function isEnd() {
3132        return Glide.index === this.length;
3133      },
3134
3135
3136      /**
3137       * Checks if we are making a offset run.
3138       *
3139       * @param {String} direction
3140       * @return {Boolean}
3141       */
3142      isOffset: function isOffset(direction) {
3143        return this._o && this.move.direction === direction;
3144      }
3145    };
3146
3147    define(Run, 'move', {
3148      /**
3149       * Gets value of the move schema.
3150       *
3151       * @returns {Object}
3152       */
3153      get: function get() {
3154        return this._m;
3155      },
3156
3157
3158      /**
3159       * Sets value of the move schema.
3160       *
3161       * @returns {Object}
3162       */
3163      set: function set(value) {
3164        var step = value.substr(1);
3165
3166        this._m = {
3167          direction: value.substr(0, 1),
3168          steps: step ? toInt(step) ? toInt(step) : step : 0
3169        };
3170      }
3171    });
3172
3173    define(Run, 'length', {
3174      /**
3175       * Gets value of the running distance based
3176       * on zero-indexing number of slides.
3177       *
3178       * @return {Number}
3179       */
3180      get: function get() {
3181        var settings = Glide.settings;
3182        var length = Components.Html.slides.length;
3183
3184        // If the `bound` option is acitve, a maximum running distance should be
3185        // reduced by `perView` and `focusAt` settings. Running distance
3186        // should end before creating an empty space after instance.
3187
3188        if (Glide.isType('slider') && settings.focusAt !== 'center' && settings.bound) {
vendor: 57,631 bytes, lines 3189-5649
3189          return length - 1 - (toInt(settings.perView) - 1) + toInt(settings.focusAt);
3190        }
3191
3192        return length - 1;
3193      }
3194    });
3195
3196    define(Run, 'offset', {
3197      /**
3198       * Gets status of the offsetting flag.
3199       *
3200       * @return {Boolean}
3201       */
3202      get: function get() {
3203        return this._o;
3204      }
3205    });
3206
3207    return Run;
3208  }
3209
3210  /**
3211   * Returns a current time.
3212   *
3213   * @return {Number}
3214   */
3215  function now() {
3216    return new Date().getTime();
3217  }
3218
3219  /**
3220   * Returns a function, that, when invoked, will only be triggered
3221   * at most once during a given window of time.
3222   *
3223   * @param {Function} func
3224   * @param {Number} wait
3225   * @param {Object=} options
3226   * @return {Function}
3227   *
3228   * @see https://github.com/jashkenas/underscore
3229   */
3230  function throttle(func, wait, options) {
3231    var timeout = void 0,
3232        context = void 0,
3233        args = void 0,
3234        result = void 0;
3235    var previous = 0;
3236    if (!options) options = {};
3237
3238    var later = function later() {
3239      previous = options.leading === false ? 0 : now();
3240      timeout = null;
3241      result = func.apply(context, args);
3242      if (!timeout) context = args = null;
3243    };
3244
3245    var throttled = function throttled() {
3246      var at = now();
3247      if (!previous && options.leading === false) previous = at;
3248      var remaining = wait - (at - previous);
3249      context = this;
3250      args = arguments;
3251      if (remaining <= 0 || remaining > wait) {
3252        if (timeout) {
3253          clearTimeout(timeout);
3254          timeout = null;
3255        }
3256        previous = at;
3257        result = func.apply(context, args);
3258        if (!timeout) context = args = null;
3259      } else if (!timeout && options.trailing !== false) {
3260        timeout = setTimeout(later, remaining);
3261      }
3262      return result;
3263    };
3264
3265    throttled.cancel = function () {
3266      clearTimeout(timeout);
3267      previous = 0;
3268      timeout = context = args = null;
3269    };
3270
3271    return throttled;
3272  }
3273
3274  var MARGIN_TYPE = {
3275    ltr: ['marginLeft', 'marginRight'],
3276    rtl: ['marginRight', 'marginLeft']
3277  };
3278
3279  function Gaps (Glide, Components, Events) {
3280    var Gaps = {
3281      /**
3282       * Applies gaps between slides. First and last
3283       * slides do not receive it's edge margins.
3284       *
3285       * @param {HTMLCollection} slides
3286       * @return {Void}
3287       */
3288      apply: function apply(slides) {
3289        for (var i = 0, len = slides.length; i < len; i++) {
3290          var style = slides[i].style;
3291          var direction = Components.Direction.value;
3292
3293          if (i !== 0) {
3294            style[MARGIN_TYPE[direction][0]] = this.value / 2 + 'px';
3295          } else {
3296            style[MARGIN_TYPE[direction][0]] = '';
3297          }
3298
3299          if (i !== slides.length - 1) {
3300            style[MARGIN_TYPE[direction][1]] = this.value / 2 + 'px';
3301          } else {
3302            style[MARGIN_TYPE[direction][1]] = '';
3303          }
3304        }
3305      },
3306
3307
3308      /**
3309       * Removes gaps from the slides.
3310       *
3311       * @param {HTMLCollection} slides
3312       * @returns {Void}
3313      */
3314      remove: function remove(slides) {
3315        for (var i = 0, len = slides.length; i < len; i++) {
3316          var style = slides[i].style;
3317
3318          style.marginLeft = '';
3319          style.marginRight = '';
3320        }
3321      }
3322    };
3323
3324    define(Gaps, 'value', {
3325      /**
3326       * Gets value of the gap.
3327       *
3328       * @returns {Number}
3329       */
3330      get: function get() {
3331        return toInt(Glide.settings.gap);
3332      }
3333    });
3334
3335    define(Gaps, 'grow', {
3336      /**
3337       * Gets additional dimentions value caused by gaps.
3338       * Used to increase width of the slides wrapper.
3339       *
3340       * @returns {Number}
3341       */
3342      get: function get() {
3343        return Gaps.value * (Components.Sizes.length - 1);
3344      }
3345    });
3346
3347    define(Gaps, 'reductor', {
3348      /**
3349       * Gets reduction value caused by gaps.
3350       * Used to subtract width of the slides.
3351       *
3352       * @returns {Number}
3353       */
3354      get: function get() {
3355        var perView = Glide.settings.perView;
3356
3357        return Gaps.value * (perView - 1) / perView;
3358      }
3359    });
3360
3361    /**
3362     * Apply calculated gaps:
3363     * - after building, so slides (including clones) will receive proper margins
3364     * - on updating via API, to recalculate gaps with new options
3365     */
3366    Events.on(['build.after', 'update'], throttle(function () {
3367      Gaps.apply(Components.Html.wrapper.children);
3368    }, 30));
3369
3370    /**
3371     * Remove gaps:
3372     * - on destroying to bring markup to its inital state
3373     */
3374    Events.on('destroy', function () {
3375      Gaps.remove(Components.Html.wrapper.children);
3376    });
3377
3378    return Gaps;
3379  }
3380
3381  /**
3382   * Finds siblings nodes of the passed node.
3383   *
3384   * @param  {Element} node
3385   * @return {Array}
3386   */
3387  function siblings(node) {
3388    if (node && node.parentNode) {
3389      var n = node.parentNode.firstChild;
3390      var matched = [];
3391
3392      for (; n; n = n.nextSibling) {
3393        if (n.nodeType === 1 && n !== node) {
3394          matched.push(n);
3395        }
3396      }
3397
3398      return matched;
3399    }
3400
3401    return [];
3402  }
3403
3404  /**
3405   * Checks if passed node exist and is a valid element.
3406   *
3407   * @param  {Element} node
3408   * @return {Boolean}
3409   */
3410  function exist(node) {
3411    if (node && node instanceof window.HTMLElement) {
3412      return true;
3413    }
3414
3415    return false;
3416  }
3417
3418  var TRACK_SELECTOR = '[data-glide-el="track"]';
3419
3420  function Html (Glide, Components) {
3421    var Html = {
3422      /**
3423       * Setup slider HTML nodes.
3424       *
3425       * @param {Glide} glide
3426       */
3427      mount: function mount() {
3428        this.root = Glide.selector;
3429        this.track = this.root.querySelector(TRACK_SELECTOR);
3430        this.slides = Array.prototype.slice.call(this.wrapper.children).filter(function (slide) {
3431          return !slide.classList.contains(Glide.settings.classes.cloneSlide);
3432        });
3433      }
3434    };
3435
3436    define(Html, 'root', {
3437      /**
3438       * Gets node of the glide main element.
3439       *
3440       * @return {Object}
3441       */
3442      get: function get() {
3443        return Html._r;
3444      },
3445
3446
3447      /**
3448       * Sets node of the glide main element.
3449       *
3450       * @return {Object}
3451       */
3452      set: function set(r) {
3453        if (isString(r)) {
3454          r = document.querySelector(r);
3455        }
3456
3457        if (exist(r)) {
3458          Html._r = r;
3459        } else {
3460          warn('Root element must be a existing Html node');
3461        }
3462      }
3463    });
3464
3465    define(Html, 'track', {
3466      /**
3467       * Gets node of the glide track with slides.
3468       *
3469       * @return {Object}
3470       */
3471      get: function get() {
3472        return Html._t;
3473      },
3474
3475
3476      /**
3477       * Sets node of the glide track with slides.
3478       *
3479       * @return {Object}
3480       */
3481      set: function set(t) {
3482        if (exist(t)) {
3483          Html._t = t;
3484        } else {
3485          warn('Could not find track element. Please use ' + TRACK_SELECTOR + ' attribute.');
3486        }
3487      }
3488    });
3489
3490    define(Html, 'wrapper', {
3491      /**
3492       * Gets node of the slides wrapper.
3493       *
3494       * @return {Object}
3495       */
3496      get: function get() {
3497        return Html.track.children[0];
3498      }
3499    });
3500
3501    return Html;
3502  }
3503
3504  function Peek (Glide, Components, Events) {
3505    var Peek = {
3506      /**
3507       * Setups how much to peek based on settings.
3508       *
3509       * @return {Void}
3510       */
3511      mount: function mount() {
3512        this.value = Glide.settings.peek;
3513      }
3514    };
3515
3516    define(Peek, 'value', {
3517      /**
3518       * Gets value of the peek.
3519       *
3520       * @returns {Number|Object}
3521       */
3522      get: function get() {
3523        return Peek._v;
3524      },
3525
3526
3527      /**
3528       * Sets value of the peek.
3529       *
3530       * @param {Number|Object} value
3531       * @return {Void}
3532       */
3533      set: function set(value) {
3534        if (isObject(value)) {
3535          value.before = toInt(value.before);
3536          value.after = toInt(value.after);
3537        } else {
3538          value = toInt(value);
3539        }
3540
3541        Peek._v = value;
3542      }
3543    });
3544
3545    define(Peek, 'reductor', {
3546      /**
3547       * Gets reduction value caused by peek.
3548       *
3549       * @returns {Number}
3550       */
3551      get: function get() {
3552        var value = Peek.value;
3553        var perView = Glide.settings.perView;
3554
3555        if (isObject(value)) {
3556          return value.before / perView + value.after / perView;
3557        }
3558
3559        return value * 2 / perView;
3560      }
3561    });
3562
3563    /**
3564     * Recalculate peeking sizes on:
3565     * - when resizing window to update to proper percents
3566     */
3567    Events.on(['resize', 'update'], function () {
3568      Peek.mount();
3569    });
3570
3571    return Peek;
3572  }
3573
3574  function Move (Glide, Components, Events) {
3575    var Move = {
3576      /**
3577       * Constructs move component.
3578       *
3579       * @returns {Void}
3580       */
3581      mount: function mount() {
3582        this._o = 0;
3583      },
3584
3585
3586      /**
3587       * Calculates a movement value based on passed offset and currently active index.
3588       *
3589       * @param  {Number} offset
3590       * @return {Void}
3591       */
3592      make: function make() {
3593        var _this = this;
3594
3595        var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
3596
3597        this.offset = offset;
3598
3599        Events.emit('move', {
3600          movement: this.value
3601        });
3602
3603        Components.Transition.after(function () {
3604          Events.emit('move.after', {
3605            movement: _this.value
3606          });
3607        });
3608      }
3609    };
3610
3611    define(Move, 'offset', {
3612      /**
3613       * Gets an offset value used to modify current translate.
3614       *
3615       * @return {Object}
3616       */
3617      get: function get() {
3618        return Move._o;
3619      },
3620
3621
3622      /**
3623       * Sets an offset value used to modify current translate.
3624       *
3625       * @return {Object}
3626       */
3627      set: function set(value) {
3628        Move._o = !isUndefined(value) ? toInt(value) : 0;
3629      }
3630    });
3631
3632    define(Move, 'translate', {
3633      /**
3634       * Gets a raw movement value.
3635       *
3636       * @return {Number}
3637       */
3638      get: function get() {
3639        return Components.Sizes.slideWidth * Glide.index;
3640      }
3641    });
3642
3643    define(Move, 'value', {
3644      /**
3645       * Gets an actual movement value corrected by offset.
3646       *
3647       * @return {Number}
3648       */
3649      get: function get() {
3650        var offset = this.offset;
3651        var translate = this.translate;
3652
3653        if (Components.Direction.is('rtl')) {
3654          return translate + offset;
3655        }
3656
3657        return translate - offset;
3658      }
3659    });
3660
3661    /**
3662     * Make movement to proper slide on:
3663     * - before build, so glide will start at `startAt` index
3664     * - on each standard run to move to newly calculated index
3665     */
3666    Events.on(['build.before', 'run'], function () {
3667      Move.make();
3668    });
3669
3670    return Move;
3671  }
3672
3673  function Sizes (Glide, Components, Events) {
3674    var Sizes = {
3675      /**
3676       * Setups dimentions of slides.
3677       *
3678       * @return {Void}
3679       */
3680      setupSlides: function setupSlides() {
3681        var width = this.slideWidth + 'px';
3682        var slides = Components.Html.slides;
3683
3684        for (var i = 0; i < slides.length; i++) {
3685          slides[i].style.width = width;
3686        }
3687      },
3688
3689
3690      /**
3691       * Setups dimentions of slides wrapper.
3692       *
3693       * @return {Void}
3694       */
3695      setupWrapper: function setupWrapper(dimention) {
3696        Components.Html.wrapper.style.width = this.wrapperSize + 'px';
3697      },
3698
3699
3700      /**
3701       * Removes applied styles from HTML elements.
3702       *
3703       * @returns {Void}
3704       */
3705      remove: function remove() {
3706        var slides = Components.Html.slides;
3707
3708        for (var i = 0; i < slides.length; i++) {
3709          slides[i].style.width = '';
3710        }
3711
3712        Components.Html.wrapper.style.width = '';
3713      }
3714    };
3715
3716    define(Sizes, 'length', {
3717      /**
3718       * Gets count number of the slides.
3719       *
3720       * @return {Number}
3721       */
3722      get: function get() {
3723        return Components.Html.slides.length;
3724      }
3725    });
3726
3727    define(Sizes, 'width', {
3728      /**
3729       * Gets width value of the glide.
3730       *
3731       * @return {Number}
3732       */
3733      get: function get() {
3734        return Components.Html.root.offsetWidth;
3735      }
3736    });
3737
3738    define(Sizes, 'wrapperSize', {
3739      /**
3740       * Gets size of the slides wrapper.
3741       *
3742       * @return {Number}
3743       */
3744      get: function get() {
3745        return Sizes.slideWidth * Sizes.length + Components.Gaps.grow + Components.Clones.grow;
3746      }
3747    });
3748
3749    define(Sizes, 'slideWidth', {
3750      /**
3751       * Gets width value of the single slide.
3752       *
3753       * @return {Number}
3754       */
3755      get: function get() {
3756        return Sizes.width / Glide.settings.perView - Components.Peek.reductor - Components.Gaps.reductor;
3757      }
3758    });
3759
3760    /**
3761     * Apply calculated glide's dimensions:
3762     * - before building, so other dimentions (e.g. translate) will be calculated propertly
3763     * - when resizing window to recalculate sildes dimensions
3764     * - on updating via API, to calculate dimensions based on new options
3765     */
3766    Events.on(['build.before', 'resize', 'update'], function () {
3767      Sizes.setupSlides();
3768      Sizes.setupWrapper();
3769    });
3770
3771    /**
3772     * Remove calculated glide's dimensions:
3773     * - on destoting to bring markup to its inital state
3774     */
3775    Events.on('destroy', function () {
3776      Sizes.remove();
3777    });
3778
3779    return Sizes;
3780  }
3781
3782  function Build (Glide, Components, Events) {
3783    var Build = {
3784      /**
3785       * Init glide building. Adds classes, sets
3786       * dimensions and setups initial state.
3787       *
3788       * @return {Void}
3789       */
3790      mount: function mount() {
3791        Events.emit('build.before');
3792
3793        this.typeClass();
3794        this.activeClass();
3795
3796        Events.emit('build.after');
3797      },
3798
3799
3800      /**
3801       * Adds `type` class to the glide element.
3802       *
3803       * @return {Void}
3804       */
3805      typeClass: function typeClass() {
3806        Components.Html.root.classList.add(Glide.settings.classes[Glide.settings.type]);
3807      },
3808
3809
3810      /**
3811       * Sets active class to current slide.
3812       *
3813       * @return {Void}
3814       */
3815      activeClass: function activeClass() {
3816        var classes = Glide.settings.classes;
3817        var slide = Components.Html.slides[Glide.index];
3818
3819        if (slide) {
3820          slide.classList.add(classes.activeSlide);
3821
3822          siblings(slide).forEach(function (sibling) {
3823            sibling.classList.remove(classes.activeSlide);
3824          });
3825        }
3826      },
3827
3828
3829      /**
3830       * Removes HTML classes applied at building.
3831       *
3832       * @return {Void}
3833       */
3834      removeClasses: function removeClasses() {
3835        var classes = Glide.settings.classes;
3836
3837        Components.Html.root.classList.remove(classes[Glide.settings.type]);
3838
3839        Components.Html.slides.forEach(function (sibling) {
3840          sibling.classList.remove(classes.activeSlide);
3841        });
3842      }
3843    };
3844
3845    /**
3846     * Clear building classes:
3847     * - on destroying to bring HTML to its initial state
3848     * - on updating to remove classes before remounting component
3849     */
3850    Events.on(['destroy', 'update'], function () {
3851      Build.removeClasses();
3852    });
3853
3854    /**
3855     * Remount component:
3856     * - on resizing of the window to calculate new dimentions
3857     * - on updating settings via API
3858     */
3859    Events.on(['resize', 'update'], function () {
3860      Build.mount();
3861    });
3862
3863    /**
3864     * Swap active class of current slide:
3865     * - after each move to the new index
3866     */
3867    Events.on('move.after', function () {
3868      Build.activeClass();
3869    });
3870
3871    return Build;
3872  }
3873
3874  function Clones (Glide, Components, Events) {
3875    var Clones = {
3876      /**
3877       * Create pattern map and collect slides to be cloned.
3878       */
3879      mount: function mount() {
3880        this.items = [];
3881
3882        if (Glide.isType('carousel')) {
3883          this.items = this.collect();
3884        }
3885      },
3886
3887
3888      /**
3889       * Collect clones with pattern.
3890       *
3891       * @return {Void}
3892       */
3893      collect: function collect() {
3894        var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
3895        var slides = Components.Html.slides;
3896        var _Glide$settings = Glide.settings,
3897            perView = _Glide$settings.perView,
3898            classes = _Glide$settings.classes;
3899
3900
3901        var peekIncrementer = +!!Glide.settings.peek;
3902        var part = perView + peekIncrementer;
3903        var start = slides.slice(0, part);
3904        var end = slides.slice(-part);
3905
3906        for (var r = 0; r < Math.max(1, Math.floor(perView / slides.length)); r++) {
3907          for (var i = 0; i < start.length; i++) {
3908            var clone = start[i].cloneNode(true);
3909
3910            clone.classList.add(classes.cloneSlide);
3911
3912            items.push(clone);
3913          }
3914
3915          for (var _i = 0; _i < end.length; _i++) {
3916            var _clone = end[_i].cloneNode(true);
3917
3918            _clone.classList.add(classes.cloneSlide);
3919
3920            items.unshift(_clone);
3921          }
3922        }
3923
3924        return items;
3925      },
3926
3927
3928      /**
3929       * Append cloned slides with generated pattern.
3930       *
3931       * @return {Void}
3932       */
3933      append: function append() {
3934        var items = this.items;
3935        var _Components$Html = Components.Html,
3936            wrapper = _Components$Html.wrapper,
3937            slides = _Components$Html.slides;
3938
3939
3940        var half = Math.floor(items.length / 2);
3941        var prepend = items.slice(0, half).reverse();
3942        var append = items.slice(half, items.length);
3943        var width = Components.Sizes.slideWidth + 'px';
3944
3945        for (var i = 0; i < append.length; i++) {
3946          wrapper.appendChild(append[i]);
3947        }
3948
3949        for (var _i2 = 0; _i2 < prepend.length; _i2++) {
3950          wrapper.insertBefore(prepend[_i2], slides[0]);
3951        }
3952
3953        for (var _i3 = 0; _i3 < items.length; _i3++) {
3954          items[_i3].style.width = width;
3955        }
3956      },
3957
3958
3959      /**
3960       * Remove all cloned slides.
3961       *
3962       * @return {Void}
3963       */
3964      remove: function remove() {
3965        var items = this.items;
3966
3967
3968        for (var i = 0; i < items.length; i++) {
3969          Components.Html.wrapper.removeChild(items[i]);
3970        }
3971      }
3972    };
3973
3974    define(Clones, 'grow', {
3975      /**
3976       * Gets additional dimentions value caused by clones.
3977       *
3978       * @return {Number}
3979       */
3980      get: function get() {
3981        return (Components.Sizes.slideWidth + Components.Gaps.value) * Clones.items.length;
3982      }
3983    });
3984
3985    /**
3986     * Append additional slide's clones:
3987     * - while glide's type is `carousel`
3988     */
3989    Events.on('update', function () {
3990      Clones.remove();
3991      Clones.mount();
3992      Clones.append();
3993    });
3994
3995    /**
3996     * Append additional slide's clones:
3997     * - while glide's type is `carousel`
3998     */
3999    Events.on('build.before', function () {
4000      if (Glide.isType('carousel')) {
4001        Clones.append();
4002      }
4003    });
4004
4005    /**
4006     * Remove clones HTMLElements:
4007     * - on destroying, to bring HTML to its initial state
4008     */
4009    Events.on('destroy', function () {
4010      Clones.remove();
4011    });
4012
4013    return Clones;
4014  }
4015
4016  var EventsBinder = function () {
4017    /**
4018     * Construct a EventsBinder instance.
4019     */
4020    function EventsBinder() {
4021      var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4022      classCallCheck(this, EventsBinder);
4023
4024      this.listeners = listeners;
4025    }
4026
4027    /**
4028     * Adds events listeners to arrows HTML elements.
4029     *
4030     * @param  {String|Array} events
4031     * @param  {Element|Window|Document} el
4032     * @param  {Function} closure
4033     * @param  {Boolean|Object} capture
4034     * @return {Void}
4035     */
4036
4037
4038    createClass(EventsBinder, [{
4039      key: 'on',
4040      value: function on(events, el, closure) {
4041        var capture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
4042
4043        if (isString(events)) {
4044          events = [events];
4045        }
4046
4047        for (var i = 0; i < events.length; i++) {
4048          this.listeners[events[i]] = closure;
4049
4050          el.addEventListener(events[i], this.listeners[events[i]], capture);
4051        }
4052      }
4053
4054      /**
4055       * Removes event listeners from arrows HTML elements.
4056       *
4057       * @param  {String|Array} events
4058       * @param  {Element|Window|Document} el
4059       * @param  {Boolean|Object} capture
4060       * @return {Void}
4061       */
4062
4063    }, {
4064      key: 'off',
4065      value: function off(events, el) {
4066        var capture = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
4067
4068        if (isString(events)) {
4069          events = [events];
4070        }
4071
4072        for (var i = 0; i < events.length; i++) {
4073          el.removeEventListener(events[i], this.listeners[events[i]], capture);
4074        }
4075      }
4076
4077      /**
4078       * Destroy collected listeners.
4079       *
4080       * @returns {Void}
4081       */
4082
4083    }, {
4084      key: 'destroy',
4085      value: function destroy() {
4086        delete this.listeners;
4087      }
4088    }]);
4089    return EventsBinder;
4090  }();
4091
4092  function Resize (Glide, Components, Events) {
4093    /**
4094     * Instance of the binder for DOM Events.
4095     *
4096     * @type {EventsBinder}
4097     */
4098    var Binder = new EventsBinder();
4099
4100    var Resize = {
4101      /**
4102       * Initializes window bindings.
4103       */
4104      mount: function mount() {
4105        this.bind();
4106      },
4107
4108
4109      /**
4110       * Binds `rezsize` listener to the window.
4111       * It's a costly event, so we are debouncing it.
4112       *
4113       * @return {Void}
4114       */
4115      bind: function bind() {
4116        Binder.on('resize', window, throttle(function () {
4117          Events.emit('resize');
4118        }, Glide.settings.throttle));
4119      },
4120
4121
4122      /**
4123       * Unbinds listeners from the window.
4124       *
4125       * @return {Void}
4126       */
4127      unbind: function unbind() {
4128        Binder.off('resize', window);
4129      }
4130    };
4131
4132    /**
4133     * Remove bindings from window:
4134     * - on destroying, to remove added EventListener
4135     */
4136    Events.on('destroy', function () {
4137      Resize.unbind();
4138      Binder.destroy();
4139    });
4140
4141    return Resize;
4142  }
4143
4144  var VALID_DIRECTIONS = ['ltr', 'rtl'];
4145  var FLIPED_MOVEMENTS = {
4146    '>': '<',
4147    '<': '>',
4148    '=': '='
4149  };
4150
4151  function Direction (Glide, Components, Events) {
4152    var Direction = {
4153      /**
4154       * Setups gap value based on settings.
4155       *
4156       * @return {Void}
4157       */
4158      mount: function mount() {
4159        this.value = Glide.settings.direction;
4160      },
4161
4162
4163      /**
4164       * Resolves pattern based on direction value
4165       *
4166       * @param {String} pattern
4167       * @returns {String}
4168       */
4169      resolve: function resolve(pattern) {
4170        var token = pattern.slice(0, 1);
4171
4172        if (this.is('rtl')) {
4173          return pattern.split(token).join(FLIPED_MOVEMENTS[token]);
4174        }
4175
4176        return pattern;
4177      },
4178
4179
4180      /**
4181       * Checks value of direction mode.
4182       *
4183       * @param {String} direction
4184       * @returns {Boolean}
4185       */
4186      is: function is(direction) {
4187        return this.value === direction;
4188      },
4189
4190
4191      /**
4192       * Applies direction class to the root HTML element.
4193       *
4194       * @return {Void}
4195       */
4196      addClass: function addClass() {
4197        Components.Html.root.classList.add(Glide.settings.classes.direction[this.value]);
4198      },
4199
4200
4201      /**
4202       * Removes direction class from the root HTML element.
4203       *
4204       * @return {Void}
4205       */
4206      removeClass: function removeClass() {
4207        Components.Html.root.classList.remove(Glide.settings.classes.direction[this.value]);
4208      }
4209    };
4210
4211    define(Direction, 'value', {
4212      /**
4213       * Gets value of the direction.
4214       *
4215       * @returns {Number}
4216       */
4217      get: function get() {
4218        return Direction._v;
4219      },
4220
4221
4222      /**
4223       * Sets value of the direction.
4224       *
4225       * @param {String} value
4226       * @return {Void}
4227       */
4228      set: function set(value) {
4229        if (VALID_DIRECTIONS.indexOf(value) > -1) {
4230          Direction._v = value;
4231        } else {
4232          warn('Direction value must be `ltr` or `rtl`');
4233        }
4234      }
4235    });
4236
4237    /**
4238     * Clear direction class:
4239     * - on destroy to bring HTML to its initial state
4240     * - on update to remove class before reappling bellow
4241     */
4242    Events.on(['destroy', 'update'], function () {
4243      Direction.removeClass();
4244    });
4245
4246    /**
4247     * Remount component:
4248     * - on update to reflect changes in direction value
4249     */
4250    Events.on('update', function () {
4251      Direction.mount();
4252    });
4253
4254    /**
4255     * Apply direction class:
4256     * - before building to apply class for the first time
4257     * - on updating to reapply direction class that may changed
4258     */
4259    Events.on(['build.before', 'update'], function () {
4260      Direction.addClass();
4261    });
4262
4263    return Direction;
4264  }
4265
4266  /**
4267   * Reflects value of glide movement.
4268   *
4269   * @param  {Object} Glide
4270   * @param  {Object} Components
4271   * @return {Object}
4272   */
4273  function Rtl (Glide, Components) {
4274    return {
4275      /**
4276       * Negates the passed translate if glide is in RTL option.
4277       *
4278       * @param  {Number} translate
4279       * @return {Number}
4280       */
4281      modify: function modify(translate) {
4282        if (Components.Direction.is('rtl')) {
4283          return -translate;
4284        }
4285
4286        return translate;
4287      }
4288    };
4289  }
4290
4291  /**
4292   * Updates glide movement with a `gap` settings.
4293   *
4294   * @param  {Object} Glide
4295   * @param  {Object} Components
4296   * @return {Object}
4297   */
4298  function Gap (Glide, Components) {
4299    return {
4300      /**
4301       * Modifies passed translate value with number in the `gap` settings.
4302       *
4303       * @param  {Number} translate
4304       * @return {Number}
4305       */
4306      modify: function modify(translate) {
4307        return translate + Components.Gaps.value * Glide.index;
4308      }
4309    };
4310  }
4311
4312  /**
4313   * Updates glide movement with width of additional clones width.
4314   *
4315   * @param  {Object} Glide
4316   * @param  {Object} Components
4317   * @return {Object}
4318   */
4319  function Grow (Glide, Components) {
4320    return {
4321      /**
4322       * Adds to the passed translate width of the half of clones.
4323       *
4324       * @param  {Number} translate
4325       * @return {Number}
4326       */
4327      modify: function modify(translate) {
4328        return translate + Components.Clones.grow / 2;
4329      }
4330    };
4331  }
4332
4333  /**
4334   * Updates glide movement with a `peek` settings.
4335   *
4336   * @param  {Object} Glide
4337   * @param  {Object} Components
4338   * @return {Object}
4339   */
4340  function Peeking (Glide, Components) {
4341    return {
4342      /**
4343       * Modifies passed translate value with a `peek` setting.
4344       *
4345       * @param  {Number} translate
4346       * @return {Number}
4347       */
4348      modify: function modify(translate) {
4349        if (Glide.settings.focusAt >= 0) {
4350          var peek = Components.Peek.value;
4351
4352          if (isObject(peek)) {
4353            return translate - peek.before;
4354          }
4355
4356          return translate - peek;
4357        }
4358
4359        return translate;
4360      }
4361    };
4362  }
4363
4364  /**
4365   * Updates glide movement with a `focusAt` settings.
4366   *
4367   * @param  {Object} Glide
4368   * @param  {Object} Components
4369   * @return {Object}
4370   */
4371  function Focusing (Glide, Components) {
4372    return {
4373      /**
4374       * Modifies passed translate value with index in the `focusAt` setting.
4375       *
4376       * @param  {Number} translate
4377       * @return {Number}
4378       */
4379      modify: function modify(translate) {
4380        var gap = Components.Gaps.value;
4381        var width = Components.Sizes.width;
4382        var focusAt = Glide.settings.focusAt;
4383        var slideWidth = Components.Sizes.slideWidth;
4384
4385        if (focusAt === 'center') {
4386          return translate - (width / 2 - slideWidth / 2);
4387        }
4388
4389        return translate - slideWidth * focusAt - gap * focusAt;
4390      }
4391    };
4392  }
4393
4394  /**
4395   * Applies diffrent transformers on translate value.
4396   *
4397   * @param  {Object} Glide
4398   * @param  {Object} Components
4399   * @return {Object}
4400   */
4401  function mutator (Glide, Components, Events) {
4402    /**
4403     * Merge instance transformers with collection of default transformers.
4404     * It's important that the Rtl component be last on the list,
4405     * so it reflects all previous transformations.
4406     *
4407     * @type {Array}
4408     */
4409    var TRANSFORMERS = [Gap, Grow, Peeking, Focusing].concat(Glide._t, [Rtl]);
4410
4411    return {
4412      /**
4413       * Piplines translate value with registered transformers.
4414       *
4415       * @param  {Number} translate
4416       * @return {Number}
4417       */
4418      mutate: function mutate(translate) {
4419        for (var i = 0; i < TRANSFORMERS.length; i++) {
4420          var transformer = TRANSFORMERS[i];
4421
4422          if (isFunction(transformer) && isFunction(transformer().modify)) {
4423            translate = transformer(Glide, Components, Events).modify(translate);
4424          } else {
4425            warn('Transformer should be a function that returns an object with `modify()` method');
4426          }
4427        }
4428
4429        return translate;
4430      }
4431    };
4432  }
4433
4434  function Translate (Glide, Components, Events) {
4435    var Translate = {
4436      /**
4437       * Sets value of translate on HTML element.
4438       *
4439       * @param {Number} value
4440       * @return {Void}
4441       */
4442      set: function set(value) {
4443        var transform = mutator(Glide, Components).mutate(value);
4444
4445        Components.Html.wrapper.style.transform = 'translate3d(' + -1 * transform + 'px, 0px, 0px)';
4446      },
4447
4448
4449      /**
4450       * Removes value of translate from HTML element.
4451       *
4452       * @return {Void}
4453       */
4454      remove: function remove() {
4455        Components.Html.wrapper.style.transform = '';
4456      }
4457    };
4458
4459    /**
4460     * Set new translate value:
4461     * - on move to reflect index change
4462     * - on updating via API to reflect possible changes in options
4463     */
4464    Events.on('move', function (context) {
4465      var gap = Components.Gaps.value;
4466      var length = Components.Sizes.length;
4467      var width = Components.Sizes.slideWidth;
4468
4469      if (Glide.isType('carousel') && Components.Run.isOffset('<')) {
4470        Components.Transition.after(function () {
4471          Events.emit('translate.jump');
4472
4473          Translate.set(width * (length - 1));
4474        });
4475
4476        return Translate.set(-width - gap * length);
4477      }
4478
4479      if (Glide.isType('carousel') && Components.Run.isOffset('>')) {
4480        Components.Transition.after(function () {
4481          Events.emit('translate.jump');
4482
4483          Translate.set(0);
4484        });
4485
4486        return Translate.set(width * length + gap * length);
4487      }
4488
4489      return Translate.set(context.movement);
4490    });
4491
4492    /**
4493     * Remove translate:
4494     * - on destroying to bring markup to its inital state
4495     */
4496    Events.on('destroy', function () {
4497      Translate.remove();
4498    });
4499
4500    return Translate;
4501  }
4502
4503  function Transition (Glide, Components, Events) {
4504    /**
4505     * Holds inactivity status of transition.
4506     * When true transition is not applied.
4507     *
4508     * @type {Boolean}
4509     */
4510    var disabled = false;
4511
4512    var Transition = {
4513      /**
4514       * Composes string of the CSS transition.
4515       *
4516       * @param {String} property
4517       * @return {String}
4518       */
4519      compose: function compose(property) {
4520        var settings = Glide.settings;
4521
4522        if (!disabled) {
4523          return property + ' ' + this.duration + 'ms ' + settings.animationTimingFunc;
4524        }
4525
4526        return property + ' 0ms ' + settings.animationTimingFunc;
4527      },
4528
4529
4530      /**
4531       * Sets value of transition on HTML element.
4532       *
4533       * @param {String=} property
4534       * @return {Void}
4535       */
4536      set: function set() {
4537        var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
4538
4539        Components.Html.wrapper.style.transition = this.compose(property);
4540      },
4541
4542
4543      /**
4544       * Removes value of transition from HTML element.
4545       *
4546       * @return {Void}
4547       */
4548      remove: function remove() {
4549        Components.Html.wrapper.style.transition = '';
4550      },
4551
4552
4553      /**
4554       * Runs callback after animation.
4555       *
4556       * @param  {Function} callback
4557       * @return {Void}
4558       */
4559      after: function after(callback) {
4560        setTimeout(function () {
4561          callback();
4562        }, this.duration);
4563      },
4564
4565
4566      /**
4567       * Enable transition.
4568       *
4569       * @return {Void}
4570       */
4571      enable: function enable() {
4572        disabled = false;
4573
4574        this.set();
4575      },
4576
4577
4578      /**
4579       * Disable transition.
4580       *
4581       * @return {Void}
4582       */
4583      disable: function disable() {
4584        disabled = true;
4585
4586        this.set();
4587      }
4588    };
4589
4590    define(Transition, 'duration', {
4591      /**
4592       * Gets duration of the transition based
4593       * on currently running animation type.
4594       *
4595       * @return {Number}
4596       */
4597      get: function get() {
4598        var settings = Glide.settings;
4599
4600        if (Glide.isType('slider') && Components.Run.offset) {
4601          return settings.rewindDuration;
4602        }
4603
4604        return settings.animationDuration;
4605      }
4606    });
4607
4608    /**
4609     * Set transition `style` value:
4610     * - on each moving, because it may be cleared by offset move
4611     */
4612    Events.on('move', function () {
4613      Transition.set();
4614    });
4615
4616    /**
4617     * Disable transition:
4618     * - before initial build to avoid transitioning from `0` to `startAt` index
4619     * - while resizing window and recalculating dimentions
4620     * - on jumping from offset transition at start and end edges in `carousel` type
4621     */
4622    Events.on(['build.before', 'resize', 'translate.jump'], function () {
4623      Transition.disable();
4624    });
4625
4626    /**
4627     * Enable transition:
4628     * - on each running, because it may be disabled by offset move
4629     */
4630    Events.on('run', function () {
4631      Transition.enable();
4632    });
4633
4634    /**
4635     * Remove transition:
4636     * - on destroying to bring markup to its inital state
4637     */
4638    Events.on('destroy', function () {
4639      Transition.remove();
4640    });
4641
4642    return Transition;
4643  }
4644
4645  /**
4646   * Test via a getter in the options object to see
4647   * if the passive property is accessed.
4648   *
4649   * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection
4650   */
4651
4652  var supportsPassive = false;
4653
4654  try {
4655    var opts = Object.defineProperty({}, 'passive', {
4656      get: function get() {
4657        supportsPassive = true;
4658      }
4659    });
4660
4661    window.addEventListener('testPassive', null, opts);
4662    window.removeEventListener('testPassive', null, opts);
4663  } catch (e) {}
4664
4665  var supportsPassive$1 = supportsPassive;
4666
4667  var START_EVENTS = ['touchstart', 'mousedown'];
4668  var MOVE_EVENTS = ['touchmove', 'mousemove'];
4669  var END_EVENTS = ['touchend', 'touchcancel', 'mouseup', 'mouseleave'];
4670  var MOUSE_EVENTS = ['mousedown', 'mousemove', 'mouseup', 'mouseleave'];
4671
4672  function Swipe (Glide, Components, Events) {
4673    /**
4674     * Instance of the binder for DOM Events.
4675     *
4676     * @type {EventsBinder}
4677     */
4678    var Binder = new EventsBinder();
4679
4680    var swipeSin = 0;
4681    var swipeStartX = 0;
4682    var swipeStartY = 0;
4683    var disabled = false;
4684    var capture = supportsPassive$1 ? { passive: true } : false;
4685
4686    var Swipe = {
4687      /**
4688       * Initializes swipe bindings.
4689       *
4690       * @return {Void}
4691       */
4692      mount: function mount() {
4693        this.bindSwipeStart();
4694      },
4695
4696
4697      /**
4698       * Handler for `swipestart` event. Calculates entry points of the user's tap.
4699       *
4700       * @param {Object} event
4701       * @return {Void}
4702       */
4703      start: function start(event) {
4704        if (!disabled && !Glide.disabled) {
4705          this.disable();
4706
4707          var swipe = this.touches(event);
4708
4709          swipeSin = null;
4710          swipeStartX = toInt(swipe.pageX);
4711          swipeStartY = toInt(swipe.pageY);
4712
4713          this.bindSwipeMove();
4714          this.bindSwipeEnd();
4715
4716          Events.emit('swipe.start');
4717        }
4718      },
4719
4720
4721      /**
4722       * Handler for `swipemove` event. Calculates user's tap angle and distance.
4723       *
4724       * @param {Object} event
4725       */
4726      move: function move(event) {
4727        if (!Glide.disabled) {
4728          var _Glide$settings = Glide.settings,
4729              touchAngle = _Glide$settings.touchAngle,
4730              touchRatio = _Glide$settings.touchRatio,
4731              classes = _Glide$settings.classes;
4732
4733
4734          var swipe = this.touches(event);
4735
4736          var subExSx = toInt(swipe.pageX) - swipeStartX;
4737          var subEySy = toInt(swipe.pageY) - swipeStartY;
4738          var powEX = Math.abs(subExSx << 2);
4739          var powEY = Math.abs(subEySy << 2);
4740          var swipeHypotenuse = Math.sqrt(powEX + powEY);
4741          var swipeCathetus = Math.sqrt(powEY);
4742
4743          swipeSin = Math.asin(swipeCathetus / swipeHypotenuse);
4744
4745          if (swipeSin * 180 / Math.PI < touchAngle) {
4746            event.stopPropagation();
4747
4748            Components.Move.make(subExSx * toFloat(touchRatio));
4749
4750            Components.Html.root.classList.add(classes.dragging);
4751
4752            Events.emit('swipe.move');
4753          } else {
4754            return false;
4755          }
4756        }
4757      },
4758
4759
4760      /**
4761       * Handler for `swipeend` event. Finitializes user's tap and decides about glide move.
4762       *
4763       * @param {Object} event
4764       * @return {Void}
4765       */
4766      end: function end(event) {
4767        if (!Glide.disabled) {
4768          var settings = Glide.settings;
4769
4770          var swipe = this.touches(event);
4771          var threshold = this.threshold(event);
4772
4773          var swipeDistance = swipe.pageX - swipeStartX;
4774          var swipeDeg = swipeSin * 180 / Math.PI;
4775          var steps = Math.round(swipeDistance / Components.Sizes.slideWidth);
4776
4777          this.enable();
4778
4779          if (swipeDistance > threshold && swipeDeg < settings.touchAngle) {
4780            // While swipe is positive and greater than threshold move backward.
4781            if (settings.perTouch) {
4782              steps = Math.min(steps, toInt(settings.perTouch));
4783            }
4784
4785            if (Components.Direction.is('rtl')) {
4786              steps = -steps;
4787            }
4788
4789            Components.Run.make(Components.Direction.resolve('<' + steps));
4790          } else if (swipeDistance < -threshold && swipeDeg < settings.touchAngle) {
4791            // While swipe is negative and lower than negative threshold move forward.
4792            if (settings.perTouch) {
4793              steps = Math.max(steps, -toInt(settings.perTouch));
4794            }
4795
4796            if (Components.Direction.is('rtl')) {
4797              steps = -steps;
4798            }
4799
4800            Components.Run.make(Components.Direction.resolve('>' + steps));
4801          } else {
4802            // While swipe don't reach distance apply previous transform.
4803            Components.Move.make();
4804          }
4805
4806          Components.Html.root.classList.remove(settings.classes.dragging);
4807
4808          this.unbindSwipeMove();
4809          this.unbindSwipeEnd();
4810
4811          Events.emit('swipe.end');
4812        }
4813      },
4814
4815
4816      /**
4817       * Binds swipe's starting event.
4818       *
4819       * @return {Void}
4820       */
4821      bindSwipeStart: function bindSwipeStart() {
4822        var _this = this;
4823
4824        var settings = Glide.settings;
4825
4826        if (settings.swipeThreshold) {
4827          Binder.on(START_EVENTS[0], Components.Html.wrapper, function (event) {
4828            _this.start(event);
4829          }, capture);
4830        }
4831
4832        if (settings.dragThreshold) {
4833          Binder.on(START_EVENTS[1], Components.Html.wrapper, function (event) {
4834            _this.start(event);
4835          }, capture);
4836        }
4837      },
4838
4839
4840      /**
4841       * Unbinds swipe's starting event.
4842       *
4843       * @return {Void}
4844       */
4845      unbindSwipeStart: function unbindSwipeStart() {
4846        Binder.off(START_EVENTS[0], Components.Html.wrapper, capture);
4847        Binder.off(START_EVENTS[1], Components.Html.wrapper, capture);
4848      },
4849
4850
4851      /**
4852       * Binds swipe's moving event.
4853       *
4854       * @return {Void}
4855       */
4856      bindSwipeMove: function bindSwipeMove() {
4857        var _this2 = this;
4858
4859        Binder.on(MOVE_EVENTS, Components.Html.wrapper, throttle(function (event) {
4860          _this2.move(event);
4861        }, Glide.settings.throttle), capture);
4862      },
4863
4864
4865      /**
4866       * Unbinds swipe's moving event.
4867       *
4868       * @return {Void}
4869       */
4870      unbindSwipeMove: function unbindSwipeMove() {
4871        Binder.off(MOVE_EVENTS, Components.Html.wrapper, capture);
4872      },
4873
4874
4875      /**
4876       * Binds swipe's ending event.
4877       *
4878       * @return {Void}
4879       */
4880      bindSwipeEnd: function bindSwipeEnd() {
4881        var _this3 = this;
4882
4883        Binder.on(END_EVENTS, Components.Html.wrapper, function (event) {
4884          _this3.end(event);
4885        });
4886      },
4887
4888
4889      /**
4890       * Unbinds swipe's ending event.
4891       *
4892       * @return {Void}
4893       */
4894      unbindSwipeEnd: function unbindSwipeEnd() {
4895        Binder.off(END_EVENTS, Components.Html.wrapper);
4896      },
4897
4898
4899      /**
4900       * Normalizes event touches points accorting to different types.
4901       *
4902       * @param {Object} event
4903       */
4904      touches: function touches(event) {
4905        if (MOUSE_EVENTS.indexOf(event.type) > -1) {
4906          return event;
4907        }
4908
4909        return event.touches[0] || event.changedTouches[0];
4910      },
4911
4912
4913      /**
4914       * Gets value of minimum swipe distance settings based on event type.
4915       *
4916       * @return {Number}
4917       */
4918      threshold: function threshold(event) {
4919        var settings = Glide.settings;
4920
4921        if (MOUSE_EVENTS.indexOf(event.type) > -1) {
4922          return settings.dragThreshold;
4923        }
4924
4925        return settings.swipeThreshold;
4926      },
4927
4928
4929      /**
4930       * Enables swipe event.
4931       *
4932       * @return {self}
4933       */
4934      enable: function enable() {
4935        disabled = false;
4936
4937        Components.Transition.enable();
4938
4939        return this;
4940      },
4941
4942
4943      /**
4944       * Disables swipe event.
4945       *
4946       * @return {self}
4947       */
4948      disable: function disable() {
4949        disabled = true;
4950
4951        Components.Transition.disable();
4952
4953        return this;
4954      }
4955    };
4956
4957    /**
4958     * Add component class:
4959     * - after initial building
4960     */
4961    Events.on('build.after', function () {
4962      Components.Html.root.classList.add(Glide.settings.classes.swipeable);
4963    });
4964
4965    /**
4966     * Remove swiping bindings:
4967     * - on destroying, to remove added EventListeners
4968     */
4969    Events.on('destroy', function () {
4970      Swipe.unbindSwipeStart();
4971      Swipe.unbindSwipeMove();
4972      Swipe.unbindSwipeEnd();
4973      Binder.destroy();
4974    });
4975
4976    return Swipe;
4977  }
4978
4979  function Images (Glide, Components, Events) {
4980    /**
4981     * Instance of the binder for DOM Events.
4982     *
4983     * @type {EventsBinder}
4984     */
4985    var Binder = new EventsBinder();
4986
4987    var Images = {
4988      /**
4989       * Binds listener to glide wrapper.
4990       *
4991       * @return {Void}
4992       */
4993      mount: function mount() {
4994        this.bind();
4995      },
4996
4997
4998      /**
4999       * Binds `dragstart` event on wrapper to prevent dragging images.
5000       *
5001       * @return {Void}
5002       */
5003      bind: function bind() {
5004        Binder.on('dragstart', Components.Html.wrapper, this.dragstart);
5005      },
5006
5007
5008      /**
5009       * Unbinds `dragstart` event on wrapper.
5010       *
5011       * @return {Void}
5012       */
5013      unbind: function unbind() {
5014        Binder.off('dragstart', Components.Html.wrapper);
5015      },
5016
5017
5018      /**
5019       * Event handler. Prevents dragging.
5020       *
5021       * @return {Void}
5022       */
5023      dragstart: function dragstart(event) {
5024        event.preventDefault();
5025      }
5026    };
5027
5028    /**
5029     * Remove bindings from images:
5030     * - on destroying, to remove added EventListeners
5031     */
5032    Events.on('destroy', function () {
5033      Images.unbind();
5034      Binder.destroy();
5035    });
5036
5037    return Images;
5038  }
5039
5040  function Anchors (Glide, Components, Events) {
5041    /**
5042     * Instance of the binder for DOM Events.
5043     *
5044     * @type {EventsBinder}
5045     */
5046    var Binder = new EventsBinder();
5047
5048    /**
5049     * Holds detaching status of anchors.
5050     * Prevents detaching of already detached anchors.
5051     *
5052     * @private
5053     * @type {Boolean}
5054     */
5055    var detached = false;
5056
5057    /**
5058     * Holds preventing status of anchors.
5059     * If `true` redirection after click will be disabled.
5060     *
5061     * @private
5062     * @type {Boolean}
5063     */
5064    var prevented = false;
5065
5066    var Anchors = {
5067      /**
5068       * Setups a initial state of anchors component.
5069       *
5070       * @returns {Void}
5071       */
5072      mount: function mount() {
5073        /**
5074         * Holds collection of anchors elements.
5075         *
5076         * @private
5077         * @type {HTMLCollection}
5078         */
5079        this._a = Components.Html.wrapper.querySelectorAll('a');
5080
5081        this.bind();
5082      },
5083
5084
5085      /**
5086       * Binds events to anchors inside a track.
5087       *
5088       * @return {Void}
5089       */
5090      bind: function bind() {
5091        Binder.on('click', Components.Html.wrapper, this.click);
5092      },
5093
5094
5095      /**
5096       * Unbinds events attached to anchors inside a track.
5097       *
5098       * @return {Void}
5099       */
5100      unbind: function unbind() {
5101        Binder.off('click', Components.Html.wrapper);
5102      },
5103
5104
5105      /**
5106       * Handler for click event. Prevents clicks when glide is in `prevent` status.
5107       *
5108       * @param  {Object} event
5109       * @return {Void}
5110       */
5111      click: function click(event) {
5112        if (prevented) {
5113          event.stopPropagation();
5114          event.preventDefault();
5115        }
5116      },
5117
5118
5119      /**
5120       * Detaches anchors click event inside glide.
5121       *
5122       * @return {self}
5123       */
5124      detach: function detach() {
5125        prevented = true;
5126
5127        if (!detached) {
5128          for (var i = 0; i < this.items.length; i++) {
5129            this.items[i].draggable = false;
5130
5131            this.items[i].setAttribute('data-href', this.items[i].getAttribute('href'));
5132
5133            this.items[i].removeAttribute('href');
5134          }
5135
5136          detached = true;
5137        }
5138
5139        return this;
5140      },
5141
5142
5143      /**
5144       * Attaches anchors click events inside glide.
5145       *
5146       * @return {self}
5147       */
5148      attach: function attach() {
5149        prevented = false;
5150
5151        if (detached) {
5152          for (var i = 0; i < this.items.length; i++) {
5153            this.items[i].draggable = true;
5154
5155            this.items[i].setAttribute('href', this.items[i].getAttribute('data-href'));
5156          }
5157
5158          detached = false;
5159        }
5160
5161        return this;
5162      }
5163    };
5164
5165    define(Anchors, 'items', {
5166      /**
5167       * Gets collection of the arrows HTML elements.
5168       *
5169       * @return {HTMLElement[]}
5170       */
5171      get: function get() {
5172        return Anchors._a;
5173      }
5174    });
5175
5176    /**
5177     * Detach anchors inside slides:
5178     * - on swiping, so they won't redirect to its `href` attributes
5179     */
5180    Events.on('swipe.move', function () {
5181      Anchors.detach();
5182    });
5183
5184    /**
5185     * Attach anchors inside slides:
5186     * - after swiping and transitions ends, so they can redirect after click again
5187     */
5188    Events.on('swipe.end', function () {
5189      Components.Transition.after(function () {
5190        Anchors.attach();
5191      });
5192    });
5193
5194    /**
5195     * Unbind anchors inside slides:
5196     * - on destroying, to bring anchors to its initial state
5197     */
5198    Events.on('destroy', function () {
5199      Anchors.attach();
5200      Anchors.unbind();
5201      Binder.destroy();
5202    });
5203
5204    return Anchors;
5205  }
5206
5207  var NAV_SELECTOR = '[data-glide-el="controls[nav]"]';
5208  var CONTROLS_SELECTOR = '[data-glide-el^="controls"]';
5209
5210  function Controls (Glide, Components, Events) {
5211    /**
5212     * Instance of the binder for DOM Events.
5213     *
5214     * @type {EventsBinder}
5215     */
5216    var Binder = new EventsBinder();
5217
5218    var capture = supportsPassive$1 ? { passive: true } : false;
5219
5220    var Controls = {
5221      /**
5222       * Inits arrows. Binds events listeners
5223       * to the arrows HTML elements.
5224       *
5225       * @return {Void}
5226       */
5227      mount: function mount() {
5228        /**
5229         * Collection of navigation HTML elements.
5230         *
5231         * @private
5232         * @type {HTMLCollection}
5233         */
5234        this._n = Components.Html.root.querySelectorAll(NAV_SELECTOR);
5235
5236        /**
5237         * Collection of controls HTML elements.
5238         *
5239         * @private
5240         * @type {HTMLCollection}
5241         */
5242        this._c = Components.Html.root.querySelectorAll(CONTROLS_SELECTOR);
5243
5244        this.addBindings();
5245      },
5246
5247
5248      /**
5249       * Sets active class to current slide.
5250       *
5251       * @return {Void}
5252       */
5253      setActive: function setActive() {
5254        for (var i = 0; i < this._n.length; i++) {
5255          this.addClass(this._n[i].children);
5256        }
5257      },
5258
5259
5260      /**
5261       * Removes active class to current slide.
5262       *
5263       * @return {Void}
5264       */
5265      removeActive: function removeActive() {
5266        for (var i = 0; i < this._n.length; i++) {
5267          this.removeClass(this._n[i].children);
5268        }
5269      },
5270
5271
5272      /**
5273       * Toggles active class on items inside navigation.
5274       *
5275       * @param  {HTMLElement} controls
5276       * @return {Void}
5277       */
5278      addClass: function addClass(controls) {
5279        var settings = Glide.settings;
5280        var item = controls[Glide.index];
5281
5282        if (item) {
5283          item.classList.add(settings.classes.activeNav);
5284
5285          siblings(item).forEach(function (sibling) {
5286            sibling.classList.remove(settings.classes.activeNav);
5287          });
5288        }
5289      },
5290
5291
5292      /**
5293       * Removes active class from active control.
5294       *
5295       * @param  {HTMLElement} controls
5296       * @return {Void}
5297       */
5298      removeClass: function removeClass(controls) {
5299        var item = controls[Glide.index];
5300
5301        if (item) {
5302          item.classList.remove(Glide.settings.classes.activeNav);
5303        }
5304      },
5305
5306
5307      /**
5308       * Adds handles to the each group of controls.
5309       *
5310       * @return {Void}
5311       */
5312      addBindings: function addBindings() {
5313        for (var i = 0; i < this._c.length; i++) {
5314          this.bind(this._c[i].children);
5315        }
5316      },
5317
5318
5319      /**
5320       * Removes handles from the each group of controls.
5321       *
5322       * @return {Void}
5323       */
5324      removeBindings: function removeBindings() {
5325        for (var i = 0; i < this._c.length; i++) {
5326          this.unbind(this._c[i].children);
5327        }
5328      },
5329
5330
5331      /**
5332       * Binds events to arrows HTML elements.
5333       *
5334       * @param {HTMLCollection} elements
5335       * @return {Void}
5336       */
5337      bind: function bind(elements) {
5338        for (var i = 0; i < elements.length; i++) {
5339          Binder.on('click', elements[i], this.click);
5340          Binder.on('touchstart', elements[i], this.click, capture);
5341        }
5342      },
5343
5344
5345      /**
5346       * Unbinds events binded to the arrows HTML elements.
5347       *
5348       * @param {HTMLCollection} elements
5349       * @return {Void}
5350       */
5351      unbind: function unbind(elements) {
5352        for (var i = 0; i < elements.length; i++) {
5353          Binder.off(['click', 'touchstart'], elements[i]);
5354        }
5355      },
5356
5357
5358      /**
5359       * Handles `click` event on the arrows HTML elements.
5360       * Moves slider in driection precised in
5361       * `data-glide-dir` attribute.
5362       *
5363       * @param {Object} event
5364       * @return {Void}
5365       */
5366      click: function click(event) {
5367        event.preventDefault();
5368
5369        Components.Run.make(Components.Direction.resolve(event.currentTarget.getAttribute('data-glide-dir')));
5370      }
5371    };
5372
5373    define(Controls, 'items', {
5374      /**
5375       * Gets collection of the controls HTML elements.
5376       *
5377       * @return {HTMLElement[]}
5378       */
5379      get: function get() {
5380        return Controls._c;
5381      }
5382    });
5383
5384    /**
5385     * Swap active class of current navigation item:
5386     * - after mounting to set it to initial index
5387     * - after each move to the new index
5388     */
5389    Events.on(['mount.after', 'move.after'], function () {
5390      Controls.setActive();
5391    });
5392
5393    /**
5394     * Remove bindings and HTML Classes:
5395     * - on destroying, to bring markup to its initial state
5396     */
5397    Events.on('destroy', function () {
5398      Controls.removeBindings();
5399      Controls.removeActive();
5400      Binder.destroy();
5401    });
5402
5403    return Controls;
5404  }
5405
5406  function Keyboard (Glide, Components, Events) {
5407    /**
5408     * Instance of the binder for DOM Events.
5409     *
5410     * @type {EventsBinder}
5411     */
5412    var Binder = new EventsBinder();
5413
5414    var Keyboard = {
5415      /**
5416       * Binds keyboard events on component mount.
5417       *
5418       * @return {Void}
5419       */
5420      mount: function mount() {
5421        if (Glide.settings.keyboard) {
5422          this.bind();
5423        }
5424      },
5425
5426
5427      /**
5428       * Adds keyboard press events.
5429       *
5430       * @return {Void}
5431       */
5432      bind: function bind() {
5433        Binder.on('keyup', document, this.press);
5434      },
5435
5436
5437      /**
5438       * Removes keyboard press events.
5439       *
5440       * @return {Void}
5441       */
5442      unbind: function unbind() {
5443        Binder.off('keyup', document);
5444      },
5445
5446
5447      /**
5448       * Handles keyboard's arrows press and moving glide foward and backward.
5449       *
5450       * @param  {Object} event
5451       * @return {Void}
5452       */
5453      press: function press(event) {
5454        if (event.keyCode === 39) {
5455          Components.Run.make(Components.Direction.resolve('>'));
5456        }
5457
5458        if (event.keyCode === 37) {
5459          Components.Run.make(Components.Direction.resolve('<'));
5460        }
5461      }
5462    };
5463
5464    /**
5465     * Remove bindings from keyboard:
5466     * - on destroying to remove added events
5467     * - on updating to remove events before remounting
5468     */
5469    Events.on(['destroy', 'update'], function () {
5470      Keyboard.unbind();
5471    });
5472
5473    /**
5474     * Remount component
5475     * - on updating to reflect potential changes in settings
5476     */
5477    Events.on('update', function () {
5478      Keyboard.mount();
5479    });
5480
5481    /**
5482     * Destroy binder:
5483     * - on destroying to remove listeners
5484     */
5485    Events.on('destroy', function () {
5486      Binder.destroy();
5487    });
5488
5489    return Keyboard;
5490  }
5491
5492  function Autoplay (Glide, Components, Events) {
5493    /**
5494     * Instance of the binder for DOM Events.
5495     *
5496     * @type {EventsBinder}
5497     */
5498    var Binder = new EventsBinder();
5499
5500    var Autoplay = {
5501      /**
5502       * Initializes autoplaying and events.
5503       *
5504       * @return {Void}
5505       */
5506      mount: function mount() {
5507        this.start();
5508
5509        if (Glide.settings.hoverpause) {
5510          this.bind();
5511        }
5512      },
5513
5514
5515      /**
5516       * Starts autoplaying in configured interval.
5517       *
5518       * @param {Boolean|Number} force Run autoplaying with passed interval regardless of `autoplay` settings
5519       * @return {Void}
5520       */
5521      start: function start() {
5522        var _this = this;
5523
5524        if (Glide.settings.autoplay) {
5525          if (isUndefined(this._i)) {
5526            this._i = setInterval(function () {
5527              _this.stop();
5528
5529              Components.Run.make('>');
5530
5531              _this.start();
5532            }, this.time);
5533          }
5534        }
5535      },
5536
5537
5538      /**
5539       * Stops autorunning of the glide.
5540       *
5541       * @return {Void}
5542       */
5543      stop: function stop() {
5544        this._i = clearInterval(this._i);
5545      },
5546
5547
5548      /**
5549       * Stops autoplaying while mouse is over glide's area.
5550       *
5551       * @return {Void}
5552       */
5553      bind: function bind() {
5554        var _this2 = this;
5555
5556        Binder.on('mouseover', Components.Html.root, function () {
5557          _this2.stop();
5558        });
5559
5560        Binder.on('mouseout', Components.Html.root, function () {
5561          _this2.start();
5562        });
5563      },
5564
5565
5566      /**
5567       * Unbind mouseover events.
5568       *
5569       * @returns {Void}
5570       */
5571      unbind: function unbind() {
5572        Binder.off(['mouseover', 'mouseout'], Components.Html.root);
5573      }
5574    };
5575
5576    define(Autoplay, 'time', {
5577      /**
5578       * Gets time period value for the autoplay interval. Prioritizes
5579       * times in `data-glide-autoplay` attrubutes over options.
5580       *
5581       * @return {Number}
5582       */
5583      get: function get() {
5584        var autoplay = Components.Html.slides[Glide.index].getAttribute('data-glide-autoplay');
5585
5586        if (autoplay) {
5587          return toInt(autoplay);
5588        }
5589
5590        return toInt(Glide.settings.autoplay);
5591      }
5592    });
5593
5594    /**
5595     * Stop autoplaying and unbind events:
5596     * - on destroying, to clear defined interval
5597     * - on updating via API to reset interval that may changed
5598     */
5599    Events.on(['destroy', 'update'], function () {
5600      Autoplay.unbind();
5601    });
5602
5603    /**
5604     * Stop autoplaying:
5605     * - before each run, to restart autoplaying
5606     * - on pausing via API
5607     * - on destroying, to clear defined interval
5608     * - while starting a swipe
5609     * - on updating via API to reset interval that may changed
5610     */
5611    Events.on(['run.before', 'pause', 'destroy', 'swipe.start', 'update'], function () {
5612      Autoplay.stop();
5613    });
5614
5615    /**
5616     * Start autoplaying:
5617     * - after each run, to restart autoplaying
5618     * - on playing via API
5619     * - while ending a swipe
5620     */
5621    Events.on(['run.after', 'play', 'swipe.end'], function () {
5622      Autoplay.start();
5623    });
5624
5625    /**
5626     * Remount autoplaying:
5627     * - on updating via API to reset interval that may changed
5628     */
5629    Events.on('update', function () {
5630      Autoplay.mount();
5631    });
5632
5633    /**
5634     * Destroy a binder:
5635     * - on destroying glide instance to clearup listeners
5636     */
5637    Events.on('destroy', function () {
5638      Binder.destroy();
5639    });
5640
5641    return Autoplay;
5642  }
5643
5644  /**
5645   * Sorts keys of breakpoint object so they will be ordered from lower to bigger.
5646   *
5647   * @param {Object} points
5648   * @returns {Object}
5649   */
5650  function sortBreakpoints(points) {
5651    if (isObject(points)) {
5652      return sortKeys(points);
5653    } else {
5654      warn('Breakpoints option must be an object');
5655    }
5656
5657    return {};
5658  }
5659
5660  function Breakpoints (Glide, Components, Events) {
5661    /**
5662     * Instance of the binder for DOM Events.
5663     *
5664     * @type {EventsBinder}
5665     */
5666    var Binder = new EventsBinder();
5667
5668    /**
5669     * Holds reference to settings.
5670     *
5671     * @type {Object}
5672     */
5673    var settings = Glide.settings;
5674
5675    /**
5676     * Holds reference to breakpoints object in settings. Sorts breakpoints
5677     * from smaller to larger. It is required in order to proper
5678     * matching currently active breakpoint settings.
5679     *
5680     * @type {Object}
5681     */
5682    var points = sortBreakpoints(settings.breakpoints);
5683
5684    /**
5685     * Cache initial settings before overwritting.
5686     *
5687     * @type {Object}
5688     */
5689    var defaults = _extends({}, settings);
5690
5691    var Breakpoints = {
5692      /**
5693       * Matches settings for currectly matching media breakpoint.
5694       *
5695       * @param {Object} points
5696       * @returns {Object}
5697       */
5698      match: function match(points) {
5699        if (typeof window.matchMedia !== 'undefined') {
5700          for (var point in points) {
5701            if (points.hasOwnProperty(point)) {
5702              if (window.matchMedia('(max-width: ' + point + 'px)').matches) {
5703                return points[point];
5704              }
5705            }
5706          }
5707        }
5708
5709        return defaults;
5710      }
5711    };
5712
5713    /**
5714     * Overwrite instance settings with currently matching breakpoint settings.
5715     * This happens right after component initialization.
5716     */
5717    _extends(settings, Breakpoints.match(points));
5718
5719    /**
5720     * Update glide with settings of matched brekpoint:
5721     * - window resize to update slider
5722     */
5723    Binder.on('resize', window, throttle(function () {
5724      Glide.settings = mergeOptions(settings, Breakpoints.match(points));
5725    }, Glide.settings.throttle));
5726
5727    /**
5728     * Resort and update default settings:
5729     * - on reinit via API, so breakpoint matching will be performed with options
5730     */
5731    Events.on('update', function () {
5732      points = sortBreakpoints(points);
5733
5734      defaults = _extends({}, settings);
5735    });
5736
5737    /**
5738     * Unbind resize listener:
5739     * - on destroying, to bring markup to its initial state
5740     */
5741    Events.on('destroy', function () {
5742      Binder.off('resize', window);
5743    });
5744
5745    return Breakpoints;
5746  }
5747
5748  var COMPONENTS = {
5749    // Required
5750    Html: Html,
5751    Translate: Translate,
5752    Transition: Transition,
5753    Direction: Direction,
5754    Peek: Peek,
5755    Sizes: Sizes,
5756    Gaps: Gaps,
5757    Move: Move,
5758    Clones: Clones,
5759    Resize: Resize,
5760    Build: Build,
5761    Run: Run,
5762
5763    // Optional
5764    Swipe: Swipe,
5765    Images: Images,
5766    Anchors: Anchors,
5767    Controls: Controls,
5768    Keyboard: Keyboard,
5769    Autoplay: Autoplay,
5770    Breakpoints: Breakpoints
5771  };
5772
5773  var Glide$1 = function (_Core) {
5774    inherits(Glide$$1, _Core);
5775
5776    function Glide$$1() {
5777      classCallCheck(this, Glide$$1);
5778      return possibleConstructorReturn(this, (Glide$$1.__proto__ || Object.getPrototypeOf(Glide$$1)).apply(this, arguments));
5779    }
5780
5781    createClass(Glide$$1, [{
5782      key: 'mount',
5783      value: function mount() {
5784        var extensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5785
5786        return get(Glide$$1.prototype.__proto__ || Object.getPrototypeOf(Glide$$1.prototype), 'mount', this).call(this, _extends({}, COMPONENTS, extensions));
5787      }
5788    }]);
5789    return Glide$$1;
5790  }(Glide);
5791
5792  return Glide$1;
5793
5794})));
5795
5796;(function ( $ ) {
5797 
5798    $.fn.cmVideo = function( options ) {
5799 
5800        // This is the easiest way to have default options.
5801        var settings = $.extend({
5802            // These are the defaults.
5803            video: this.children('iframe'),
5804            video_cont: this,
5805            video_btn: $("#video-btn"),
5806            close_video: this.children('span'),
5807            playerOrigin: '*',
5808            status: 'play',
5809            pauseTime: 0,
5810            durationTime: 0,
5811            percentTime: 0,
5812            fluidEl: $("body"),
5813            disableListeners: true
5814        }, options );
5815        
5816        //console.log(options);
5817        
5818        settings.video.data('aspectRatio-height', settings.video.attr('height') / settings.video.attr('width')).data('aspectRatio-width', settings.video.attr('width') / 
5818settings.video.attr('height')).removeAttr('height').removeAttr('width');
5819 
5820        $(settings.video_btn).click(function(e) {
5821            e.preventDefault();
5822            if (!settings.video.hasClass('loaded')) {
5823                settings.video.attr('src', settings.video.data('src')).on('load', function() {
5824                    $(this).removeAttr('data-src').addClass('loaded');
5825                });
5826            }
5827            settings.video_cont.css({'opacity':0, display: 'block'}).addClass('active');
5828            video_size();
5829            $("body").css({'overflow': 'hidden'}); //, 'padding-right':scrollwidth
5830            settings.video_cont.animate({'opacity':1}, 500);
5831            vimeo_control();
5832            if (typeof(analytics) !== "undefined") {
5833                analytics.track('Site - Viewed Video', {
5834                    'Video Title': settings.video.data('video-title'),	
5835                    'Page Title': document.title,
5836                    'Page Path': location.pathname
5837                });
5838            }
5839        });
5840        
5841        $(window).on('load', function() {
5842            var autoplay = getUrlVars()["play"];
5843            if (typeof(autoplay) != 'undefined') {
5844                $(settings.video_btn).trigger("click");
5845                // if (autoplay == '') autoplay = settings.video_cont.attr('id');
5846                // if (autoplay == settings.video_cont.attr('id')) {
5847                //     settings.video_cont.css({'opacity':0, display: 'block'});
5848                //     video_size();
5849                //     $("body").css({'overflow': 'hidden'}); //, 'padding-right':scrollwidth
5850                //     settings.video_cont.animate({'opacity':1}, 500);
5851                //     vimeo_control();
5852                //     if (typeof(analytics) !== "undefined") {
5853                //         analytics.track('Site - Viewed Video', {
5854                //             'Video Title': settings.video.data('video-title'),	
5855                //             'Page Title': document.title,
5856                //             'Page Path': location.pathname
5857                //         });
5858                //     }
5859                // }
5860            }
5861        });
5862        
5863        $(settings.video_cont).click(function(e) {
5864            if ((!$(e.target).hasClass("wistia_responsive_padding") && $(e.target).closest('.wistia_responsive_padding').length == 0)) {
5865                close_the_video();
5866            }
5867        });
5868        
5869        $(document).keyup(function(e) {
5870            if (e.keyCode == 27) { close_the_video(); }
5871        });
5872        
5873        function close_the_video(delayTime) {
5874            if (typeof(delayTime) == 'undefined') delayTime = 0;
5875            settings.status = 'play';
5876            $("body").removeAttr('style');
5877            settings.video_cont.delay(delayTime).animate({'opacity':0}, 500, function() {
5878                var aspectRatio_height = settings.video.data('aspectRatio-height');
5879                var aspectRatio_width = settings.video.data('aspectRatio-width');
5880                var video_markup = settings.video_cont.html();
5881                settings.video_cont.html('');
5882                $(this).hide();
5883                $(this).html(video_markup);
5884                settings.video = $(this).children('iframe');
5885                settings.video.data('aspectRatio-height', aspectRatio_height);
5886                settings.video.data('aspectRatio-width', aspectRatio_width);
5887                settings.close_video = $(this).children('span');
5888            });
5889        }
5890        
5891        // When the window is resized
5892        $(window).resize(function() {
5893            video_size();
5894        }).resize();
5895
5896        function video_size() {
5897            var newWidth = settings.fluidEl.width();
5898            var winHeight = $(window).height();
5899
5900            var vidHeight = newWidth * settings.video.data('aspectRatio-height');
5901            var vidWidth = newWidth;
5902            if (winHeight < vidHeight) {
5903                vidWidth = winHeight * settings.video.data('aspectRatio-width');
5904                vidHeight = winHeight;
5905            }
5906            settings.video.width(vidWidth).height(vidHeight);
5907        }
5908        
5909        // Listen for messages from the player
5910        if (!settings.disableListeners) {
5911            if (window.addEventListener) {
5912                window.addEventListener('message', onMessageReceived, false);
5913            }
5914            else if (window.attachEvent) {
5915                window.attachEvent('onmessage', onMessageReceived, false);
5916            }
5917        }
5918
5919        // Handle messages received from the player
5920        function onMessageReceived(event) {
5921            // Handle messages from the vimeo player only
5922            if (!(/^https?:\/\/player.vimeo.com/).test(event.origin)) {
5923                return false;
5924            }
5925
5926            if (settings.playerOrigin === '*') {
5927                settings.playerOrigin = event.origin;
5928            }
5929
5930            if (typeof(event.data) != 'object')
5931                var data = JSON.parse(event.data);
5932            else
5933                var data = event.data;
5934            //console.log("ACTION: Event action ("+data.event+")");
5935            switch (data.event) {
5936                case 'ready':
5937                    onReady();
5938                    break;
5939
5940                case 'play':
5941                    onPlay();
5942                    break;
5943
5944                case 'playProgress':
5945                    onPlayProgress(data.data);
5946                    break;
5947
5948                case 'pause':
5949                    onPause();
5950                    break;
5951
5952                case 'finish':
5953                    onFinish();
5954                    break;
5955            }
5956        }
5957
5958        // Helper function for sending a message to the player
5959        function post(action, value) {
5960            // Handle messages from the vimeo player only
5961            if (!(/^https?:\/\/player.vimeo.com/).test(event.origin)) {
5962                return false;
5963            }
5964            //console.log("ACTION: Post action");
5965            var delaytime = 0;
5966            switch (action) {
5967
5968                case 'play':
5969
5970                    break;
5971
5972                case 'pause':
5973
5974                    break;
5975
5976                case 'finish':
5977                    close_the_video(500);
5978                    break;
5979            }
5980
5981            var data = {
5982                method: action
5983            };
5984
5985            if (value) {
5986                data.value = value;
5987            }
5988
5989            if (action !== 'finish') {
5990                var message = JSON.stringify(data);
5991                settings.video[0].contentWindow.postMessage(data, settings.playerOrigin);
5992            }
5993        }
5994
5995        function onReady() {
5996            //console.log("ACTION: Ready");
5997            settings.status = 'play';
5998
5999            post('addEventListener', 'pause');
6000            post('addEventListener', 'finish');
6001            post('addEventListener', 'play');
6002            post('addEventListener', 'playProgress');
6003        }
6004
6005        function onPause() {
6006            //console.log("ACTION: Pause");
6007            settings.status = 'pause';
6008            vimeo_control();
6009        }
6010
6011        function onFinish() {
6012            //console.log("ACTION: Finish");
6013            settings.status = 'finish';
6014            vimeo_control();
6015        }
6016
6017        function onPlay() {
6018            //console.log("ACTION: Play");
6019            settings.status = 'play';
6020            vimeo_control();
6021        }
6022
6023        function onPlayProgress(data) {
6024            settings.pauseTime = data.seconds;
6025            settings.durationTime = data.duration;
6026            settings.percentTime = data.percent;
6027        }
6028
6029        function vimeo_control() {
6030            //console.log(settings.status);
6031            post(settings.status);
6032        }
6033        
6034        function getUrlVars() {
6035            var vars = {};
6036            var parts = window.location.href.replace(/[?&]+([^=&]+)[^=|&?]*([^&*]*)/gi, function(m,key,value) {
6037                vars[key] = value.substring(1);
6038            });
6039            return vars;
6040        }
6041    };
6042 
6043}( jQuery ));
6044
6045//	DETECTING TIMEZONES - /app/js/plugins/detecttimezone.js
6046(function (CS, $) {
6047	var timeZones;
6048
6049	var ambiguousResolutions = {
6050		'(GMT) Coordinated Universal Time': {
6051			'(GMT) Coordinated Universal Time': [
6052				'Burkina Faso',
6053				"Cote D'Ivoire",
6054				'Gambia',
6055				'Ghana',
6056				'Guinea',
6057				'Guinea-Bissau',
6058				'Mali',
6059				'Mauritania',
6060				'St Helena',
6061				'Sao Tome & Principe',
6062				'Senegal',
6063				'Sierra Leone',
6064				'Togo',
6065			],
6066			'(GMT+00:00) Monrovia, Reykjavik': ['Liberia', 'Iceland'],
6067		},
6068		'(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna': {
6069			'(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna': [
6070				'Austria',
6071				'Sweden',
6072				'Italy',
6073				'Switzerland',
6074				'Germany',
6075				'Netherlands',
6076			],
6077			'(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague': [
6078				'Czech Republic',
6079				'Slovenia',
6080				'Hungary',
6081				'Slovakia',
6082				'Serbia',
6083			],
6084			'(GMT+01:00) Brussels, Copenhagen, Madrid, Paris': [
6085				'France',
6086				'Spain',
6087				'Denmark',
6088				'Belgium',
6089			],
6090			'(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb': [
6091				'Croatia',
6092				'Poland',
6093				'Macedonia',
6094				'Bosnia & Herzegovina',
6095			],
6096		},
6097		'(GMT+01:00) Casablanca': {
6098			'(GMT+01:00) Casablanca': ['Morocco'],
6099			'(GMT+01:00) West Central Africa': [
6100				'Algeria',
6101				'Angola',
6102				'Benin',
6103				'Chad',
6104				'Cameroon',
6105				'Central African Republic',
6106				'Congo Democratic Rep',
6107				'Equatorial Guinea',
6108				'Gabon',
6109				'Niger',
6110				'Nigeria',
6111				'Tunisia',
6112			],
6113		},
6114		'(GMT+02:00) Amman': {
6115			'(GMT+02:00) Amman': ['Jordan'],
6116			'(GMT+02:00) Damascus': ['Syria'],
6117		},
6118		'(GMT+02:00) Athens, Bucharest': {
6119			'(GMT+02:00) Athens, Bucharest': ['Romania', 'Greece'],
6120			'(GMT+02:00) Beirut': ['Lebanon'],
6121			'(GMT+02:00) Chisinau': ['Moldova'],
6122			'(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius': [
6123				'Lithuania',
6124				'Estonia',
6125				'Bulgaria',
6126				'Latvia',
6127				'Ukraine',
6128				'Finland',
6129			],
6130		},
6131		'(GMT+02:00) Cairo': {
6132			'(GMT+02:00) Cairo': ['Egypt'],
6133			'(GMT+02:00) Harare, Pretoria': ['South Africa', 'Zimbabwe'],
6134			'(GMT+02:00) Kaliningrad': ['Russia'],
6135			'(GMT+02:00) Tripoli': ['Libya'],
6136			'(GMT+02:00) Windhoek': ['Namibia'],
6137		},
6138		'(GMT+03:00) Baghdad': {
6139			'(GMT+03:00) Baghdad': ['Iraq'],
6140			'(GMT+03:00) Istanbul': ['Turkey'],
6141			'(GMT+03:00) Kuwait, Riyadh': ['Saudi Arabia', 'Kuwait'],
6142			'(GMT+03:00) Minsk': ['Belarus'],
6143			'(GMT+03:00) Moscow, St. Petersburg': ['Russia'],
6144			'(GMT+03:00) Nairobi': ['Kenya'],
6145		},
6146		'(GMT+04:00) Abu Dhabi, Muscat': {
6147			'(GMT+04:00) Abu Dhabi, Muscat': ['Oman', 'United Arab Emirates'],
6148			'(GMT+04:00) Astrakhan, Ulyanovsk': ['Russia'],
6149			'(GMT+04:00) Baku': ['Azerbaijan'],
6150			'(GMT+04:00) Izhevsk, Samara': ['Russia'],
6151			'(GMT+04:00) Port Louis': ['Mauritius'],
6152			'(GMT+04:00) Tbilisi': ['Georgia'],
6153			'(GMT+04:00) Yerevan': ['Armenia'],
6154		},
6155		'(GMT+05:00) Ashgabat, Tashkent': {
6156			'(GMT+05:00) Ashgabat, Tashkent': ['Uzbekistan', 'Turkmenistan'],
6157			'(GMT+05:00) Ekaterinburg': ['Russia'],
6158			'(GMT+05:00) Islamabad, Karachi': ['Pakistan'],
6159		},
6160		'(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi': {
6161			'(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi': ['India'],
6162			'(GMT+05:30) Sri Jayawardenepura': ['Sri Lanka'],
6163		},
6164		'(GMT+06:00) Astana': {
6165			'(GMT+06:00) Astana': ['Kazakhstan'],
6166			'(GMT+06:00) Dhaka': ['Bangladesh'],
6167		},
6168		'(GMT+07:00) Bangkok, Hanoi, Jakarta': {
6169			'(GMT+07:00) Bangkok, Hanoi, Jakarta': [
6170				'Indonesia',
6171				'Vietnam',
6172				'Thailand',
6173			],
6174			'(GMT+07:00) Barnaul, Gorno-Altaysk': ['Russia'],
6175			'(GMT+07:00) Krasnoyarsk': ['Russia'],
6176			'(GMT+07:00) Novosibirsk': ['Russia'],
6177			'(GMT+07:00) Tomsk': ['Russia'],
6178		},
6179		'(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi': {
6180			'(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi': [
6181				'China',
6182				'Hong Kong',
6183			],
6184			'(GMT+08:00) Irkutsk': ['Russia'],
6185			'(GMT+08:00) Kuala Lumpur, Singapore': ['Malaysia', 'Singapore'],
6186			'(GMT+08:00) Perth': ['Australia'],
6187			'(GMT+08:00) Taipei': ['Taiwan'],
6188			'(GMT+08:00) Ulaanbaatar': ['Mongolia'],
6189		},
6190		'(GMT+09:00) Chita': {
6191			'(GMT+09:00) Chita': ['Russia'],
6192			'(GMT+09:00) Osaka, Sapporo, Tokyo': ['Japan'],
6193			'(GMT+09:00) Seoul': ['Korea South'],
6194			'(GMT+09:00) Yakutsk': ['Russia'],
6195		},
6196		'(GMT+10:00) Brisbane': {
6197			'(GMT+10:00) Brisbane': ['Australia'],
6198			'(GMT+10:00) Guam, Port Moresby': ['Papua New Guinea', 'Guam'],
6199			'(GMT+10:00) Vladivostok': ['Russia'],
6200		},
6201		'(GMT+10:00) Canberra, Melbourne, Sydney': {
6202			'(GMT+10:00) Canberra, Melbourne, Sydney': ['Australia'],
6203			'(GMT+10:00) Hobart': ['Australia'],
6204		},
6205		'(GMT+11:00) Bougainville Island': {
6206			'(GMT+11:00) Bougainville Island': ['Papua New Guinea'],
6207			'(GMT+11:00) Chokurdakh': ['Russia'],
6208			'(GMT+11:00) Magadan': ['Russia'],
6209			'(GMT+11:00) Solomon Is., New Caledonia': [
6210				'New Caledonia',
6211				'Solomon Islands',
6212			],
6213		},
6214		'(GMT+12:00) Anadyr, Petropavlovsk-Kamchatsky': {
6215			'(GMT+12:00) Anadyr, Petropavlovsk-Kamchatsky': ['Russia'],
6216			'(GMT+12:00) Coordinated Universal Time+12': [],
6217		},
6218		'(GMT-03:00) Araguaina': {
6219			'(GMT-03:00) Araguaina': ['Brazil'],
6220			'(GMT-03:00) Cayenne, Fortaleza': ['Brazil', 'French Guiana'],
6221			'(GMT-03:00) City of Buenos Aires': ['Argentina'],
6222			'(GMT-03:00) Montevideo': ['Uruguay'],
6223			'(GMT-03:00) Salvador': ['Brazil'],
6224		},
6225		'(GMT-04:00) Caracas': {
6226			'(GMT-04:00) Caracas': ['Venezuela'],
6227			'(GMT-04:00) Georgetown, La Paz, Manaus, San Juan': [
6228				'Bahamas',
6229				'Bolivia',
6230				'Brazil',
6231				'Puerto Rico',
6232			],
6233		},
6234		'(GMT-05:00) Bogota, Lima, Quito, Rio Branco': {
6235			'(GMT-05:00) Bogota, Lima, Quito, Rio Branco': [
6236				'Colombia',
6237				'Peru',
6238				'Ecuador',
6239				'Brazil',
6240			],
6241			'(GMT-05:00) Chetumal': ['Mexico'],
6242		},
6243		'(GMT-05:00) Eastern Time (US & Canada)': {
6244			'(GMT-05:00) Eastern Time (US & Canada)': [
6245				'Canada',
6246				'United States of America',
6247			],
6248			'(GMT-05:00) Haiti': ['Haiti'],
6249			'(GMT-05:00) Indiana (East)': ['United States of America'],
6250			'(GMT-05:00) Turks and Caicos': ['Turks & Caicos Is'],
6251		},
6252		'(GMT-06:00) Central America': {
6253			'(GMT-06:00) Central America': [
6254				'Belize',
6255				'Costa Rica',
6256				'El Salvador',
6257				'Guatemala',
6258				'Honduras',
6259				'Nicaragua',
6260			],
6261			'(GMT-06:00) Saskatchewan': ['Canada'],
6262		},
6263		'(GMT-08:00) Baja California': {
6264			'(GMT-08:00) Baja California': ['Mexico'],
6265			'(GMT-08:00) Pacific Time (US & Canada)': [
6266				'Canada',
6267				'United States of America',
6268			],
6269		},
6270	};
6271
6272	function cmDetermineTimeZone() {
6273		var now = new Date();
6274		var winners = [];
6275		var isDST = false;
6276		var i;
6277
6278		for (i = 0; i < timeZones.length; i++) {
6279			var potential = timeZones[i];
6280
6281			if (
6282				!potential.DaylightSavingTimeStartDate &&
6283				now.getTimezoneOffset() == -potential.UtcOffset &&
6284				!isDST
6285			) {
6286				// First, if there is no DST provided and our offset matches the other offset, that's all we need.
6287				winners.push(potential);
6288			} else if (potential.DaylightSavingTimeStartDate) {
6289				var dstStartDate = new Date(potential.DaylightSavingTimeStartDate);
6290				var dstEndDate = new Date(potential.DaylightSavingTimeEndDate);
6291				var beforeDSTStart = new Date(potential.DaylightSavingTimeStartDate);
6292				var afterDSTStart = new Date(potential.DaylightSavingTimeStartDate);
6293				var beforeDSTEnd = new Date(potential.DaylightSavingTimeEndDate);
6294				var afterDSTEnd = new Date(potential.DaylightSavingTimeEndDate);
6295				beforeDSTStart.setDate(dstStartDate.getDate() - 1);
6296				afterDSTStart.setDate(dstStartDate.getDate() + 1);
6297				beforeDSTEnd.setDate(dstEndDate.getDate() - 1);
6298				afterDSTEnd.setDate(dstEndDate.getDate() + 1);
6299
6300				if (
6301					beforeDSTStart.getTimezoneOffset() == -potential.StandardTimeOffset &&
6302					afterDSTStart.getTimezoneOffset() ==
6303						-potential.DaylightSavingTimeOffset &&
6304					beforeDSTEnd.getTimezoneOffset() ==
6305						-potential.DaylightSavingTimeOffset &&
6306					afterDSTEnd.getTimezoneOffset() == -potential.StandardTimeOffset
6307				) {
6308					isDST = true;
6309					winners.push(potential);
6310				}
6311			}
6312		}
6313
6314		if (isDST) {
6315			for (i = 0; i < winners.length; i++) {
6316				if (!winners[i].DaylightSavingTimeStartDate) {
6317					winners.splice(i, 1);
6318					i--;
6319				}
6320			}
6321		}
6322		return winners;
6323	}
6324
6325	function detect(ambiguousCallback) {
6326		var timezones = cmDetermineTimeZone();
6327
6328		if (timezones.length > 1) {
6329			var country = $('#usrCountry option:selected').val();
6330			var firstChoice = timezones[0].DisplayName;
6331			var possibleResolutions = ambiguousResolutions[firstChoice];
6332
6333			if (possibleResolutions) {
6334				for (var key in possibleResolutions) {
6335					for (var i = 0; i < possibleResolutions[key].length; i++) {
6336						if (possibleResolutions[key][i] == country) {
6337							$('#timezone').val(key);
6338							return key;
6339						}
6340					}
6341				}
6342			}
6343
6344			if (ambiguousCallback) ambiguousCallback(timezones);
6345		}
6346
6347		if (timezones.length == 1) {
6348			$('#timezone').val(timezones[0].DisplayName);
6349			return timezones[0].DisplayName;
6350		}
6351
6352		return false;
6353	}
6354
6355	function init(options) {
6356		timeZones = options.timeZones || [];
6357	}
6358
6359	CS.DetectTimezone = {
6360		init: init,
6361		detect: detect,
6362	};
6363})((window.CS = window.CS || {}), jQuery);
6364
6365(function (CS, $) {
6366	function remapCountry(countryName) {
6367		switch (countryName) {
6368			case 'United States':
6369				return 'United States of America';
6370			case 'Antigua and Barbuda':
6371				return 'Antigua & Barbuda';
6372			case 'Bosnia and Herzegovina':
6373				return 'Bosnia & Herzegovina';
6374			case 'British Indian Ocean Territory':
6375				return 'British Indian Ocean Ter';
6376			case 'Brunei Darussalam':
6377				return 'Brunei';
6378			case 'Cocos (Keeling) Islands':
6379				return 'Cocos Islands';
6380			case 'Congo, The Democratic Republic of the':
6381				return 'Congo Democratic Rep';
6382			case "Cote d'Ivoire":
6383				return 'Cote DIvoire';
6384			case 'Falkland Islands (Malvinas)':
6385				return 'Falkland Islands';
6386			case 'French Southern Territories':
6387				return 'French Southern Ter';
6388			case 'Holy See (Vatican City State)':
6389				return 'Vatican City State';
6390			case 'Iran, Islamic Republic of':
6391				return 'Iran';
6392			case "Korea, Democratic People's Republic of":
6393				return 'Korea North';
6394			case 'Korea, Republic of':
6395				return 'Korea South';
6396			case "Lao People's Democratic Republic":
6397				return 'Laos';
6398			case 'Libyan Arab Jamahiriya':
6399				return 'Libya';
6400			case 'Macao':
6401				return 'Macau';
6402			case 'Moldova, Republic of':
6403				return 'Moldova';
6404			case 'Palau':
6405				return 'Palau Island';
6406			case 'Palestinian Territory':
6407				return 'Palestine';
6408			case 'Pitcairn':
6409				return 'Pitcairn Island';
6410			case 'Russian Federation':
6411				return 'Russia';
6412			case 'Sao Tome and Principe':
6413				return 'Sao Tome & Principe';
6414			case 'Saint Bartelemey':
6415				return 'St Barthelemy';
6416			case 'Saint Helena':
6417				return 'St Helena';
6418			case 'Saint Kitts and Nevis':
6419				return 'St Kitts-Nevis';
6420			case 'Saint Lucia':
6421				return 'St Lucia';
6422			case 'Sint Maarten':
6423				return 'St Maarten';
6424			case 'Saint Pierre and Miquelon':
6425				return 'St Pierre & Miquelon';
6426			case 'Saint Vincent and the Grenadines':
6427				return 'St Vincent & Grenadines';
6428			case 'Syrian Arab Republic':
6429				return 'Syria';
6430			case 'Tanzania, United Republic of':
6431				return 'Tanzania';
6432			case 'Trinidad and Tobago':
6433				return 'Trinidad &amp; Tobago';
6434			case 'Turks and Caicos Islands':
6435				return 'Turks & Caicos Islands';
6436			case 'Virgin Islands, British':
6437				return 'Virgin Islands (Brit)';
6438			case 'Virgin Islands, U.S.':
6439				return 'Virgin Islands (USA)';
6440
6441			default:
6442				// check if there's a value in the dropdown that matches - if not return null
6443
6444				var exists =
6445					0 != $('#usrCountry option[value="' + countryName + '"]').length;
6446
6447				return exists ? countryName : undefined;
6448		}
6449	}
6450
6451	CS.Country = {
6452		Remap: remapCountry,
6453	};
6454})((window.CS = window.CS || {}), jQuery);
6455
6456var timeZones = [
6457	{
6458		TimeZoneInfoID: 'UTC',
6459		DisplayName: '(GMT) Coordinated Universal Time',
6460		UtcOffset: 0,
6461		DaylightSavingTimeStartDate: null,
6462		DaylightSavingTimeEndDate: null,
6463		StandardTimeOffset: 0,
6464		DaylightSavingTimeOffset: null,
6465	},
6466	{
6467		TimeZoneInfoID: 'GMT Standard Time',
6468		DisplayName: '(GMT+00:00) Dublin, Edinburgh, Lisbon, London',
6469		UtcOffset: 60,
6470		DaylightSavingTimeStartDate: '2019-03-31T01:00:00',
6471		DaylightSavingTimeEndDate: '2019-10-27T02:00:00',
6472		StandardTimeOffset: 0,
6473		DaylightSavingTimeOffset: 60,
6474	},
6475	{
6476		TimeZoneInfoID: 'Greenwich Standard Time',
6477		DisplayName: '(GMT+00:00) Monrovia, Reykjavik',
6478		UtcOffset: 0,
6479		DaylightSavingTimeStartDate: null,
6480		DaylightSavingTimeEndDate: null,
6481		StandardTimeOffset: 0,
6482		DaylightSavingTimeOffset: null,
6483	},
6484	{
6485		TimeZoneInfoID: 'W. Europe Standard Time',
6486		DisplayName: '(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna',
6487		UtcOffset: 120,
6488		DaylightSavingTimeStartDate: '2019-03-31T02:00:00',
6489		DaylightSavingTimeEndDate: '2019-10-27T03:00:00',
6490		StandardTimeOffset: 60,
6491		DaylightSavingTimeOffset: 120,
6492	},
6493	{
6494		TimeZoneInfoID: 'Central Europe Standard Time',
6495		DisplayName:
6496			'(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague',
6497		UtcOffset: 120,
6498		DaylightSavingTimeStartDate: '2019-03-31T02:00:00',
6499		DaylightSavingTimeEndDate: '2019-10-27T03:00:00',
6500		StandardTimeOffset: 60,
6501		DaylightSavingTimeOffset: 120,
6502	},
6503	{
6504		TimeZoneInfoID: 'Romance Standard Time',
6505		DisplayName: '(GMT+01:00) Brussels, Copenhagen, Madrid, Paris',
6506		UtcOffset: 120,
6507		DaylightSavingTimeStartDate: '2019-03-31T02:00:00',
6508		DaylightSavingTimeEndDate: '2019-10-27T03:00:00',
6509		StandardTimeOffset: 60,
6510		DaylightSavingTimeOffset: 120,
6511	},
6512	{
6513		TimeZoneInfoID: 'Morocco Standard Time',
6514		DisplayName: '(GMT+01:00) Casablanca',
6515		UtcOffset: 60,
6516		DaylightSavingTimeStartDate: null,
6517		DaylightSavingTimeEndDate: null,
6518		StandardTimeOffset: 60,
6519		DaylightSavingTimeOffset: null,
6520	},
6521	{
6522		TimeZoneInfoID: 'Central European Standard Time',
6523		DisplayName: '(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb',
6524		UtcOffset: 120,
6525		DaylightSavingTimeStartDate: '2019-03-31T02:00:00',
6526		DaylightSavingTimeEndDate: '2019-10-27T03:00:00',
6527		StandardTimeOffset: 60,
6528		DaylightSavingTimeOffset: 120,
6529	},
6530	{
6531		TimeZoneInfoID: 'W. Central Africa Standard Time',
6532		DisplayName: '(GMT+01:00) West Central Africa',
6533		UtcOffset: 60,
6534		DaylightSavingTimeStartDate: null,
6535		DaylightSavingTimeEndDate: null,
6536		StandardTimeOffset: 60,
6537		DaylightSavingTimeOffset: null,
6538	},
6539	{
6540		TimeZoneInfoID: 'Jordan Standard Time',
6541		DisplayName: '(GMT+02:00) Amman',
6542		UtcOffset: 180,
6543		DaylightSavingTimeStartDate: '2019-03-28T23:59:59',
6544		DaylightSavingTimeEndDate: '2019-10-25T01:00:00',
6545		StandardTimeOffset: 120,
6546		DaylightSavingTimeOffset: 180,
6547	},
6548	{
6549		TimeZoneInfoID: 'GTB Standard Time',
6550		DisplayName: '(GMT+02:00) Athens, Bucharest',
6551		UtcOffset: 180,
6552		DaylightSavingTimeStartDate: '2019-03-31T03:00:00',
6553		DaylightSavingTimeEndDate: '2019-10-27T04:00:00',
6554		StandardTimeOffset: 120,
6555		DaylightSavingTimeOffset: 180,
6556	},
6557	{
6558		TimeZoneInfoID: 'Middle East Standard Time',
6559		DisplayName: '(GMT+02:00) Beirut',
6560		UtcOffset: 180,
6561		DaylightSavingTimeStartDate: '2019-03-30T23:59:59',
6562		DaylightSavingTimeEndDate: '2019-10-26T23:59:59',
6563		StandardTimeOffset: 120,
6564		DaylightSavingTimeOffset: 180,
6565	},
6566	{
6567		TimeZoneInfoID: 'Egypt Standard Time',
6568		DisplayName: '(GMT+02:00) Cairo',
6569		UtcOffset: 120,
6570		DaylightSavingTimeStartDate: null,
6571		DaylightSavingTimeEndDate: null,
6572		StandardTimeOffset: 120,
6573		DaylightSavingTimeOffset: null,
6574	},
6575	{
6576		TimeZoneInfoID: 'E. Europe Standard Time',
6577		DisplayName: '(GMT+02:00) Chisinau',
6578		UtcOffset: 180,
6579		DaylightSavingTimeStartDate: '2019-03-31T02:00:00',
6580		DaylightSavingTimeEndDate: '2019-10-27T03:00:00',
6581		StandardTimeOffset: 120,
6582		DaylightSavingTimeOffset: 180,
6583	},
6584	{
6585		TimeZoneInfoID: 'Syria Standard Time',
6586		DisplayName: '(GMT+02:00) Damascus',
6587		UtcOffset: 180,
6588		DaylightSavingTimeStartDate: '2019-03-29T00:00:00',
6589		DaylightSavingTimeEndDate: '2019-10-24T23:59:59',
6590		StandardTimeOffset: 120,
6591		DaylightSavingTimeOffset: 180,
6592	},
6593	{
6594		TimeZoneInfoID: 'West Bank Standard Time',
6595		DisplayName: '(GMT+02:00) Gaza, Hebron',
6596		UtcOffset: 180,
6597		DaylightSavingTimeStartDate: '2019-03-23T01:00:00',
6598		DaylightSavingTimeEndDate: '2019-10-26T01:00:00',
6599		StandardTimeOffset: 120,
6600		DaylightSavingTimeOffset: 180,
6601	},
6602	{
6603		TimeZoneInfoID: 'South Africa Standard Time',
6604		DisplayName: '(GMT+02:00) Harare, Pretoria',
6605		UtcOffset: 120,
6606		DaylightSavingTimeStartDate: null,
6607		DaylightSavingTimeEndDate: null,
6608		StandardTimeOffset: 120,
6609		DaylightSavingTimeOffset: null,
6610	},
6611	{
6612		TimeZoneInfoID: 'FLE Standard Time',
6613		DisplayName: '(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius',
6614		UtcOffset: 180,
6615		DaylightSavingTimeStartDate: '2019-03-31T03:00:00',
6616		DaylightSavingTimeEndDate: '2019-10-27T04:00:00',
6617		StandardTimeOffset: 120,
6618		DaylightSavingTimeOffset: 180,
6619	},
6620	{
6621		TimeZoneInfoID: 'Israel Standard Time',
6622		DisplayName: '(GMT+02:00) Jerusalem',
6623		UtcOffset: 180,
6624		DaylightSavingTimeStartDate: '2019-03-29T02:00:00',
6625		DaylightSavingTimeEndDate: '2019-10-27T02:00:00',
6626		StandardTimeOffset: 120,
6627		DaylightSavingTimeOffset: 180,
6628	},
6629	{
6630		TimeZoneInfoID: 'Kaliningrad Standard Time',
6631		DisplayName: '(GMT+02:00) Kaliningrad',
6632		UtcOffset: 120,
6633		DaylightSavingTimeStartDate: null,
6634		DaylightSavingTimeEndDate: null,
6635		StandardTimeOffset: 120,
6636		DaylightSavingTimeOffset: null,
6637	},
6638	{
6639		TimeZoneInfoID: 'Libya Standard Time',
6640		DisplayName: '(GMT+02:00) Tripoli',
6641		UtcOffset: 120,
6642		DaylightSavingTimeStartDate: null,
6643		DaylightSavingTimeEndDate: null,
6644		StandardTimeOffset: 120,
6645		DaylightSavingTimeOffset: null,
6646	},
6647	{
6648		TimeZoneInfoID: 'Namibia Standard Time',
6649		DisplayName: '(GMT+02:00) Windhoek',
6650		UtcOffset: 120,
6651		DaylightSavingTimeStartDate: null,
6652		DaylightSavingTimeEndDate: null,
6653		StandardTimeOffset: 120,
6654		DaylightSavingTimeOffset: null,
6655	},
6656	{
6657		TimeZoneInfoID: 'Arabic Standard Time',
6658		DisplayName: '(GMT+03:00) Baghdad',
6659		UtcOffset: 180,
6660		DaylightSavingTimeStartDate: null,
6661		DaylightSavingTimeEndDate: null,
6662		StandardTimeOffset: 180,
6663		DaylightSavingTimeOffset: null,
6664	},
6665	{
6666		TimeZoneInfoID: 'Turkey Standard Time',
6667		DisplayName: '(GMT+03:00) Istanbul',
6668		UtcOffset: 180,
6669		DaylightSavingTimeStartDate: null,
6670		DaylightSavingTimeEndDate: null,
6671		StandardTimeOffset: 180,
6672		DaylightSavingTimeOffset: null,
6673	},
6674	{
6675		TimeZoneInfoID: 'Arab Standard Time',
6676		DisplayName: '(GMT+03:00) Kuwait, Riyadh',
6677		UtcOffset: 180,
6678		DaylightSavingTimeStartDate: null,
6679		DaylightSavingTimeEndDate: null,
6680		StandardTimeOffset: 180,
6681		DaylightSavingTimeOffset: null,
6682	},
6683	{
6684		TimeZoneInfoID: 'Belarus Standard Time',
6685		DisplayName: '(GMT+03:00) Minsk',
6686		UtcOffset: 180,
6687		DaylightSavingTimeStartDate: null,
6688		DaylightSavingTimeEndDate: null,
6689		StandardTimeOffset: 180,
6690		DaylightSavingTimeOffset: null,
6691	},
6692	{
6693		TimeZoneInfoID: 'Russian Standard Time',
6694		DisplayName: '(GMT+03:00) Moscow, St. Petersburg',
6695		UtcOffset: 180,
6696		DaylightSavingTimeStartDate: null,
6697		DaylightSavingTimeEndDate: null,
6698		StandardTimeOffset: 180,
6699		DaylightSavingTimeOffset: null,
6700	},
6701	{
6702		TimeZoneInfoID: 'E. Africa Standard Time',
6703		DisplayName: '(GMT+03:00) Nairobi',
6704		UtcOffset: 180,
6705		DaylightSavingTimeStartDate: null,
6706		DaylightSavingTimeEndDate: null,
6707		StandardTimeOffset: 180,
6708		DaylightSavingTimeOffset: null,
6709	},
6710	{
6711		TimeZoneInfoID: 'Iran Standard Time',
6712		DisplayName: '(GMT+03:30) Tehran',
6713		UtcOffset: 270,
6714		DaylightSavingTimeStartDate: '2019-03-22T00:00:00',
6715		DaylightSavingTimeEndDate: '2019-09-21T23:59:59',
6716		StandardTimeOffset: 210,
6717		DaylightSavingTimeOffset: 270,
6718	},
6719	{
6720		TimeZoneInfoID: 'Arabian Standard Time',
6721		DisplayName: '(GMT+04:00) Abu Dhabi, Muscat',
6722		UtcOffset: 240,
6723		DaylightSavingTimeStartDate: null,
6724		DaylightSavingTimeEndDate: null,
6725		StandardTimeOffset: 240,
6726		DaylightSavingTimeOffset: null,
6727	},
6728	{
6729		TimeZoneInfoID: 'Astrakhan Standard Time',
6730		DisplayName: '(GMT+04:00) Astrakhan, Ulyanovsk',
6731		UtcOffset: 240,
6732		DaylightSavingTimeStartDate: null,
6733		DaylightSavingTimeEndDate: null,
6734		StandardTimeOffset: 240,
6735		DaylightSavingTimeOffset: null,
6736	},
6737	{
6738		TimeZoneInfoID: 'Azerbaijan Standard Time',
6739		DisplayName: '(GMT+04:00) Baku',
6740		UtcOffset: 240,
6741		DaylightSavingTimeStartDate: null,
6742		DaylightSavingTimeEndDate: null,
6743		StandardTimeOffset: 240,
6744		DaylightSavingTimeOffset: null,
6745	},
6746	{
6747		TimeZoneInfoID: 'Russia Time Zone 3',
6748		DisplayName: '(GMT+04:00) Izhevsk, Samara',
6749		UtcOffset: 240,
6750		DaylightSavingTimeStartDate: null,
6751		DaylightSavingTimeEndDate: null,
6752		StandardTimeOffset: 240,
6753		DaylightSavingTimeOffset: null,
6754	},
6755	{
6756		TimeZoneInfoID: 'Mauritius Standard Time',
6757		DisplayName: '(GMT+04:00) Port Louis',
6758		UtcOffset: 240,
6759		DaylightSavingTimeStartDate: null,
6760		DaylightSavingTimeEndDate: null,
6761		StandardTimeOffset: 240,
6762		DaylightSavingTimeOffset: null,
6763	},
6764	{
6765		TimeZoneInfoID: 'Georgian Standard Time',
6766		DisplayName: '(GMT+04:00) Tbilisi',
6767		UtcOffset: 240,
6768		DaylightSavingTimeStartDate: null,
6769		DaylightSavingTimeEndDate: null,
6770		StandardTimeOffset: 240,
6771		DaylightSavingTimeOffset: null,
6772	},
6773	{
6774		TimeZoneInfoID: 'Caucasus Standard Time',
6775		DisplayName: '(GMT+04:00) Yerevan',
6776		UtcOffset: 240,
6777		DaylightSavingTimeStartDate: null,
6778		DaylightSavingTimeEndDate: null,
6779		StandardTimeOffset: 240,
6780		DaylightSavingTimeOffset: null,
6781	},
6782	{
6783		TimeZoneInfoID: 'Afghanistan Standard Time',
6784		DisplayName: '(GMT+04:30) Kabul',
6785		UtcOffset: 270,
6786		DaylightSavingTimeStartDate: null,
6787		DaylightSavingTimeEndDate: null,
6788		StandardTimeOffset: 270,
6789		DaylightSavingTimeOffset: null,
6790	},
6791	{
6792		TimeZoneInfoID: 'West Asia Standard Time',
6793		DisplayName: '(GMT+05:00) Ashgabat, Tashkent',
6794		UtcOffset: 300,
6795		DaylightSavingTimeStartDate: null,
6796		DaylightSavingTimeEndDate: null,
6797		StandardTimeOffset: 300,
6798		DaylightSavingTimeOffset: null,
6799	},
6800	{
6801		TimeZoneInfoID: 'Ekaterinburg Standard Time',
6802		DisplayName: '(GMT+05:00) Ekaterinburg',
6803		UtcOffset: 300,
6804		DaylightSavingTimeStartDate: null,
6805		DaylightSavingTimeEndDate: null,
6806		StandardTimeOffset: 300,
6807		DaylightSavingTimeOffset: null,
6808	},
6809	{
6810		TimeZoneInfoID: 'Pakistan Standard Time',
6811		DisplayName: '(GMT+05:00) Islamabad, Karachi',
6812		UtcOffset: 300,
6813		DaylightSavingTimeStartDate: null,
6814		DaylightSavingTimeEndDate: null,
6815		StandardTimeOffset: 300,
6816		DaylightSavingTimeOffset: null,
6817	},
6818	{
6819		TimeZoneInfoID: 'India Standard Time',
6820		DisplayName: '(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi',
6821		UtcOffset: 330,
6822		DaylightSavingTimeStartDate: null,
6823		DaylightSavingTimeEndDate: null,
6824		StandardTimeOffset: 330,
6825		DaylightSavingTimeOffset: null,
6826	},
6827	{
6828		TimeZoneInfoID: 'Sri Lanka Standard Time',
6829		DisplayName: '(GMT+05:30) Sri Jayawardenepura',
6830		UtcOffset: 330,
6831		DaylightSavingTimeStartDate: null,
6832		DaylightSavingTimeEndDate: null,
6833		StandardTimeOffset: 330,
6834		DaylightSavingTimeOffset: null,
6835	},
6836	{
6837		TimeZoneInfoID: 'Nepal Standard Time',
6838		DisplayName: '(GMT+05:45) Kathmandu',
6839		UtcOffset: 345,
6840		DaylightSavingTimeStartDate: null,
6841		DaylightSavingTimeEndDate: null,
6842		StandardTimeOffset: 345,
6843		DaylightSavingTimeOffset: null,
6844	},
6845	{
6846		TimeZoneInfoID: 'Central Asia Standard Time',
6847		DisplayName: '(GMT+06:00) Astana',
6848		UtcOffset: 360,
6849		DaylightSavingTimeStartDate: null,
6850		DaylightSavingTimeEndDate: null,
6851		StandardTimeOffset: 360,
6852		DaylightSavingTimeOffset: null,
6853	},
6854	{
6855		TimeZoneInfoID: 'Bangladesh Standard Time',
6856		DisplayName: '(GMT+06:00) Dhaka',
6857		UtcOffset: 360,
6858		DaylightSavingTimeStartDate: null,
6859		DaylightSavingTimeEndDate: null,
6860		StandardTimeOffset: 360,
6861		DaylightSavingTimeOffset: null,
6862	},
6863	{
6864		TimeZoneInfoID: 'Myanmar Standard Time',
6865		DisplayName: '(GMT+06:30) Yangon (Rangoon)',
6866		UtcOffset: 390,
6867		DaylightSavingTimeStartDate: null,
6868		DaylightSavingTimeEndDate: null,
6869		StandardTimeOffset: 390,
6870		DaylightSavingTimeOffset: null,
6871	},
6872	{
6873		TimeZoneInfoID: 'SE Asia Standard Time',
6874		DisplayName: '(GMT+07:00) Bangkok, Hanoi, Jakarta',
6875		UtcOffset: 420,
6876		DaylightSavingTimeStartDate: null,
6877		DaylightSavingTimeEndDate: null,
6878		StandardTimeOffset: 420,
6879		DaylightSavingTimeOffset: null,
6880	},
6881	{
6882		TimeZoneInfoID: 'Altai Standard Time',
6883		DisplayName: '(GMT+07:00) Barnaul, Gorno-Altaysk',
6884		UtcOffset: 420,
6885		DaylightSavingTimeStartDate: null,
6886		DaylightSavingTimeEndDate: null,
6887		StandardTimeOffset: 420,
6888		DaylightSavingTimeOffset: null,
6889	},
6890	{
6891		TimeZoneInfoID: 'North Asia Standard Time',
6892		DisplayName: '(GMT+07:00) Krasnoyarsk',
6893		UtcOffset: 420,
6894		DaylightSavingTimeStartDate: null,
6895		DaylightSavingTimeEndDate: null,
6896		StandardTimeOffset: 420,
6897		DaylightSavingTimeOffset: null,
6898	},
6899	{
6900		TimeZoneInfoID: 'N. Central Asia Standard Time',
6901		DisplayName: '(GMT+07:00) Novosibirsk',
6902		UtcOffset: 420,
6903		DaylightSavingTimeStartDate: null,
6904		DaylightSavingTimeEndDate: null,
6905		StandardTimeOffset: 420,
6906		DaylightSavingTimeOffset: null,
6907	},
6908	{
6909		TimeZoneInfoID: 'Tomsk Standard Time',
6910		DisplayName: '(GMT+07:00) Tomsk',
6911		UtcOffset: 420,
6912		DaylightSavingTimeStartDate: null,
6913		DaylightSavingTimeEndDate: null,
6914		StandardTimeOffset: 420,
6915		DaylightSavingTimeOffset: null,
6916	},
6917	{
6918		TimeZoneInfoID: 'China Standard Time',
6919		DisplayName: '(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi',
6920		UtcOffset: 480,
6921		DaylightSavingTimeStartDate: null,
6922		DaylightSavingTimeEndDate: null,
6923		StandardTimeOffset: 480,
6924		DaylightSavingTimeOffset: null,
6925	},
6926	{
6927		TimeZoneInfoID: 'North Asia East Standard Time',
6928		DisplayName: '(GMT+08:00) Irkutsk',
6929		UtcOffset: 480,
6930		DaylightSavingTimeStartDate: null,
6931		DaylightSavingTimeEndDate: null,
6932		StandardTimeOffset: 480,
6933		DaylightSavingTimeOffset: null,
6934	},
6935	{
6936		TimeZoneInfoID: 'Singapore Standard Time',
6937		DisplayName: '(GMT+08:00) Kuala Lumpur, Singapore',
6938		UtcOffset: 480,
6939		DaylightSavingTimeStartDate: null,
6940		DaylightSavingTimeEndDate: null,
6941		StandardTimeOffset: 480,
6942		DaylightSavingTimeOffset: null,
6943	},
6944	{
6945		TimeZoneInfoID: 'W. Australia Standard Time',
6946		DisplayName: '(GMT+08:00) Perth',
6947		UtcOffset: 480,
6948		DaylightSavingTimeStartDate: null,
6949		DaylightSavingTimeEndDate: null,
6950		StandardTimeOffset: 480,
6951		DaylightSavingTimeOffset: null,
6952	},
6953	{
6954		TimeZoneInfoID: 'Taipei Standard Time',
6955		DisplayName: '(GMT+08:00) Taipei',
6956		UtcOffset: 480,
6957		DaylightSavingTimeStartDate: null,
6958		DaylightSavingTimeEndDate: null,
6959		StandardTimeOffset: 480,
6960		DaylightSavingTimeOffset: null,
6961	},
6962	{
6963		TimeZoneInfoID: 'Ulaanbaatar Standard Time',
6964		DisplayName: '(GMT+08:00) Ulaanbaatar',
6965		UtcOffset: 480,
6966		DaylightSavingTimeStartDate: null,
6967		DaylightSavingTimeEndDate: null,
6968		StandardTimeOffset: 480,
6969		DaylightSavingTimeOffset: null,
6970	},
6971	{
6972		TimeZoneInfoID: 'Transbaikal Standard Time',
6973		DisplayName: '(GMT+09:00) Chita',
6974		UtcOffset: 540,
6975		DaylightSavingTimeStartDate: null,
6976		DaylightSavingTimeEndDate: null,
6977		StandardTimeOffset: 540,
6978		DaylightSavingTimeOffset: null,
6979	},
6980	{
6981		TimeZoneInfoID: 'Tokyo Standard Time',
6982		DisplayName: '(GMT+09:00) Osaka, Sapporo, Tokyo',
6983		UtcOffset: 540,
6984		DaylightSavingTimeStartDate: null,
6985		DaylightSavingTimeEndDate: null,
6986		StandardTimeOffset: 540,
6987		DaylightSavingTimeOffset: null,
6988	},
6989	{
6990		TimeZoneInfoID: 'Korea Standard Time',
6991		DisplayName: '(GMT+09:00) Seoul',
6992		UtcOffset: 540,
6993		DaylightSavingTimeStartDate: null,
6994		DaylightSavingTimeEndDate: null,
6995		StandardTimeOffset: 540,
6996		DaylightSavingTimeOffset: null,
6997	},
6998	{
6999		TimeZoneInfoID: 'Yakutsk Standard Time',
7000		DisplayName: '(GMT+09:00) Yakutsk',
7001		UtcOffset: 540,
7002		DaylightSavingTimeStartDate: null,
7003		DaylightSavingTimeEndDate: null,
7004		StandardTimeOffset: 540,
7005		DaylightSavingTimeOffset: null,
7006	},
7007	{
7008		TimeZoneInfoID: 'Cen. Australia Standard Time',
7009		DisplayName: '(GMT+09:30) Adelaide',
7010		UtcOffset: 570,
7011		DaylightSavingTimeStartDate: '2019-10-06T02:00:00',
7012		DaylightSavingTimeEndDate: '2019-04-07T03:00:00',
7013		StandardTimeOffset: 570,
7014		DaylightSavingTimeOffset: 630,
7015	},
7016	{
7017		TimeZoneInfoID: 'AUS Central Standard Time',
7018		DisplayName: '(GMT+09:30) Darwin',
7019		UtcOffset: 570,
7020		DaylightSavingTimeStartDate: null,
7021		DaylightSavingTimeEndDate: null,
7022		StandardTimeOffset: 570,
7023		DaylightSavingTimeOffset: null,
7024	},
7025	{
7026		TimeZoneInfoID: 'E. Australia Standard Time',
7027		DisplayName: '(GMT+10:00) Brisbane',
7028		UtcOffset: 600,
7029		DaylightSavingTimeStartDate: null,
7030		DaylightSavingTimeEndDate: null,
7031		StandardTimeOffset: 600,
7032		DaylightSavingTimeOffset: null,
7033	},
7034	{
7035		TimeZoneInfoID: 'AUS Eastern Standard Time',
7036		DisplayName: '(GMT+10:00) Canberra, Melbourne, Sydney',
7037		UtcOffset: 600,
7038		DaylightSavingTimeStartDate: '2019-10-06T02:00:00',
7039		DaylightSavingTimeEndDate: '2019-04-07T03:00:00',
7040		StandardTimeOffset: 600,
7041		DaylightSavingTimeOffset: 660,
7042	},
7043	{
7044		TimeZoneInfoID: 'West Pacific Standard Time',
7045		DisplayName: '(GMT+10:00) Guam, Port Moresby',
7046		UtcOffset: 600,
7047		DaylightSavingTimeStartDate: null,
7048		DaylightSavingTimeEndDate: null,
7049		StandardTimeOffset: 600,
7050		DaylightSavingTimeOffset: null,
7051	},
7052	{
7053		TimeZoneInfoID: 'Tasmania Standard Time',
7054		DisplayName: '(GMT+10:00) Hobart',
7055		UtcOffset: 600,
7056		DaylightSavingTimeStartDate: '2019-10-06T02:00:00',
7057		DaylightSavingTimeEndDate: '2019-04-07T03:00:00',
7058		StandardTimeOffset: 600,
7059		DaylightSavingTimeOffset: 660,
7060	},
7061	{
7062		TimeZoneInfoID: 'Vladivostok Standard Time',
7063		DisplayName: '(GMT+10:00) Vladivostok',
7064		UtcOffset: 600,
7065		DaylightSavingTimeStartDate: null,
7066		DaylightSavingTimeEndDate: null,
7067		StandardTimeOffset: 600,
7068		DaylightSavingTimeOffset: null,
7069	},
7070	{
7071		TimeZoneInfoID: 'Lord Howe Standard Time',
7072		DisplayName: '(GMT+10:30) Lord Howe Island',
7073		UtcOffset: 630,
7074		DaylightSavingTimeStartDate: '2019-10-06T02:00:00',
7075		DaylightSavingTimeEndDate: '2019-04-07T02:00:00',
7076		StandardTimeOffset: 630,
7077		DaylightSavingTimeOffset: 660,
7078	},
7079	{
7080		TimeZoneInfoID: 'Bougainville Standard Time',
7081		DisplayName: '(GMT+11:00) Bougainville Island',
7082		UtcOffset: 660,
7083		DaylightSavingTimeStartDate: null,
7084		DaylightSavingTimeEndDate: null,
7085		StandardTimeOffset: 660,
7086		DaylightSavingTimeOffset: null,
7087	},
7088	{
7089		TimeZoneInfoID: 'Russia Time Zone 10',
7090		DisplayName: '(GMT+11:00) Chokurdakh',
7091		UtcOffset: 660,
7092		DaylightSavingTimeStartDate: null,
7093		DaylightSavingTimeEndDate: null,
7094		StandardTimeOffset: 660,
7095		DaylightSavingTimeOffset: null,
7096	},
7097	{
7098		TimeZoneInfoID: 'Magadan Standard Time',
7099		DisplayName: '(GMT+11:00) Magadan',
7100		UtcOffset: 660,
7101		DaylightSavingTimeStartDate: null,
7102		DaylightSavingTimeEndDate: null,
7103		StandardTimeOffset: 660,
7104		DaylightSavingTimeOffset: null,
7105	},
7106	{
7107		TimeZoneInfoID: 'Central Pacific Standard Time',
7108		DisplayName: '(GMT+11:00) Solomon Is., New Caledonia',
7109		UtcOffset: 660,
7110		DaylightSavingTimeStartDate: null,
7111		DaylightSavingTimeEndDate: null,
7112		StandardTimeOffset: 660,
7113		DaylightSavingTimeOffset: null,
7114	},
7115	{
7116		TimeZoneInfoID: 'Russia Time Zone 11',
7117		DisplayName: '(GMT+12:00) Anadyr, Petropavlovsk-Kamchatsky',
7118		UtcOffset: 720,
7119		DaylightSavingTimeStartDate: null,
7120		DaylightSavingTimeEndDate: null,
7121		StandardTimeOffset: 720,
7122		DaylightSavingTimeOffset: null,
7123	},
7124	{
7125		TimeZoneInfoID: 'New Zealand Standard Time',
7126		DisplayName: '(GMT+12:00) Auckland, Wellington',
7127		UtcOffset: 720,
7128		DaylightSavingTimeStartDate: '2019-09-29T02:00:00',
7129		DaylightSavingTimeEndDate: '2019-04-07T03:00:00',
7130		StandardTimeOffset: 720,
7131		DaylightSavingTimeOffset: 780,
7132	},
7133	{
7134		TimeZoneInfoID: 'UTC+12',
7135		DisplayName: '(GMT+12:00) Coordinated Universal Time+12',
7136		UtcOffset: 720,
7137		DaylightSavingTimeStartDate: null,
7138		DaylightSavingTimeEndDate: null,
7139		StandardTimeOffset: 720,
7140		DaylightSavingTimeOffset: null,
7141	},
7142	{
7143		TimeZoneInfoID: 'Fiji Standard Time',
7144		DisplayName: '(GMT+12:00) Fiji',
7145		UtcOffset: 720,
7146		DaylightSavingTimeStartDate: '2019-11-03T02:00:00',
7147		DaylightSavingTimeEndDate: '2019-01-13T03:00:00',
7148		StandardTimeOffset: 720,
7149		DaylightSavingTimeOffset: 780,
7150	},
7151	{
7152		TimeZoneInfoID: 'Kamchatka Standard Time',
7153		DisplayName: '(GMT+12:00) Petropavlovsk-Kamchatsky - Old',
7154		UtcOffset: 780,
7155		DaylightSavingTimeStartDate: '2019-03-31T02:00:00',
7156		DaylightSavingTimeEndDate: '2019-10-27T03:00:00',
7157		StandardTimeOffset: 720,
7158		DaylightSavingTimeOffset: 780,
7159	},
7160	{
7161		TimeZoneInfoID: 'Tonga Standard Time',
7162		DisplayName: "(GMT+13:00) Nuku'alofa",
7163		UtcOffset: 780,
7164		DaylightSavingTimeStartDate: null,
7165		DaylightSavingTimeEndDate: null,
7166		StandardTimeOffset: 780,
7167		DaylightSavingTimeOffset: null,
7168	},
7169	{
7170		TimeZoneInfoID: 'Samoa Standard Time',
7171		DisplayName: '(GMT+13:00) Samoa',
7172		UtcOffset: 780,
7173		DaylightSavingTimeStartDate: '2019-09-29T03:00:00',
7174		DaylightSavingTimeEndDate: '2019-04-07T04:00:00',
7175		StandardTimeOffset: 780,
7176		DaylightSavingTimeOffset: 840,
7177	},
7178	{
7179		TimeZoneInfoID: 'Line Islands Standard Time',
7180		DisplayName: '(GMT+14:00) Kiritimati Island',
7181		UtcOffset: 840,
7182		DaylightSavingTimeStartDate: null,
7183		DaylightSavingTimeEndDate: null,
7184		StandardTimeOffset: 840,
7185		DaylightSavingTimeOffset: null,
7186	},
7187	{
7188		TimeZoneInfoID: 'Azores Standard Time',
7189		DisplayName: '(GMT-01:00) Azores',
7190		UtcOffset: 0,
7191		DaylightSavingTimeStartDate: '2019-03-31T00:00:00',
7192		DaylightSavingTimeEndDate: '2019-10-27T01:00:00',
7193		StandardTimeOffset: -60,
7194		DaylightSavingTimeOffset: 0,
7195	},
7196	{
7197		TimeZoneInfoID: 'Cape Verde Standard Time',
7198		DisplayName: '(GMT-01:00) Cabo Verde Is.',
7199		UtcOffset: -60,
7200		DaylightSavingTimeStartDate: null,
7201		DaylightSavingTimeEndDate: null,
7202		StandardTimeOffset: -60,
7203		DaylightSavingTimeOffset: null,
7204	},
7205	{
7206		TimeZoneInfoID: 'UTC-02',
7207		DisplayName: '(GMT-02:00) Coordinated Universal Time-02',
7208		UtcOffset: -120,
7209		DaylightSavingTimeStartDate: null,
7210		DaylightSavingTimeEndDate: null,
7211		StandardTimeOffset: -120,
7212		DaylightSavingTimeOffset: null,
7213	},
7214	{
7215		TimeZoneInfoID: 'Mid-Atlantic Standard Time',
7216		DisplayName: '(GMT-02:00) Mid-Atlantic - Old',
7217		UtcOffset: -60,
7218		DaylightSavingTimeStartDate: '2019-03-31T02:00:00',
7219		DaylightSavingTimeEndDate: '2019-09-29T02:00:00',
7220		StandardTimeOffset: -120,
7221		DaylightSavingTimeOffset: -60,
7222	},
7223	{
7224		TimeZoneInfoID: 'Tocantins Standard Time',
7225		DisplayName: '(GMT-03:00) Araguaina',
7226		UtcOffset: -180,
7227		DaylightSavingTimeStartDate: null,
7228		DaylightSavingTimeEndDate: null,
7229		StandardTimeOffset: -180,
7230		DaylightSavingTimeOffset: null,
7231	},
7232	{
7233		TimeZoneInfoID: 'E. South America Standard Time',
7234		DisplayName: '(GMT-03:00) Brasilia',
7235		UtcOffset: -180,
7236		DaylightSavingTimeStartDate: '2019-11-02T23:59:59',
7237		DaylightSavingTimeEndDate: '2019-02-16T23:59:59',
7238		StandardTimeOffset: -180,
7239		DaylightSavingTimeOffset: -120,
7240	},
7241	{
7242		TimeZoneInfoID: 'SA Eastern Standard Time',
7243		DisplayName: '(GMT-03:00) Cayenne, Fortaleza',
7244		UtcOffset: -180,
7245		DaylightSavingTimeStartDate: null,
7246		DaylightSavingTimeEndDate: null,
7247		StandardTimeOffset: -180,
7248		DaylightSavingTimeOffset: null,
7249	},
7250	{
7251		TimeZoneInfoID: 'Argentina Standard Time',
7252		DisplayName: '(GMT-03:00) City of Buenos Aires',
7253		UtcOffset: -180,
7254		DaylightSavingTimeStartDate: null,
7255		DaylightSavingTimeEndDate: null,
7256		StandardTimeOffset: -180,
7257		DaylightSavingTimeOffset: null,
7258	},
7259	{
7260		TimeZoneInfoID: 'Greenland Standard Time',
7261		DisplayName: '(GMT-03:00) Greenland',
7262		UtcOffset: -120,
7263		DaylightSavingTimeStartDate: '2019-03-30T22:00:00',
7264		DaylightSavingTimeEndDate: '2019-10-26T23:00:00',
7265		StandardTimeOffset: -180,
7266		DaylightSavingTimeOffset: -120,
7267	},
7268	{
7269		TimeZoneInfoID: 'Montevideo Standard Time',
7270		DisplayName: '(GMT-03:00) Montevideo',
7271		UtcOffset: -180,
7272		DaylightSavingTimeStartDate: null,
7273		DaylightSavingTimeEndDate: null,
7274		StandardTimeOffset: -180,
7275		DaylightSavingTimeOffset: null,
7276	},
7277	{
7278		TimeZoneInfoID: 'Bahia Standard Time',
7279		DisplayName: '(GMT-03:00) Salvador',
7280		UtcOffset: -180,
7281		DaylightSavingTimeStartDate: null,
7282		DaylightSavingTimeEndDate: null,
7283		StandardTimeOffset: -180,
7284		DaylightSavingTimeOffset: null,
7285	},
7286	{
7287		TimeZoneInfoID: 'Newfoundland Standard Time',
7288		DisplayName: '(GMT-03:30) Newfoundland',
7289		UtcOffset: -150,
7290		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7291		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7292		StandardTimeOffset: -210,
7293		DaylightSavingTimeOffset: -150,
7294	},
7295	{
7296		TimeZoneInfoID: 'Paraguay Standard Time',
7297		DisplayName: '(GMT-04:00) Asuncion',
7298		UtcOffset: -240,
7299		DaylightSavingTimeStartDate: '2019-10-05T23:59:59',
7300		DaylightSavingTimeEndDate: '2019-03-23T23:59:59',
7301		StandardTimeOffset: -240,
7302		DaylightSavingTimeOffset: -180,
7303	},
7304	{
7305		TimeZoneInfoID: 'Atlantic Standard Time',
7306		DisplayName: '(GMT-04:00) Atlantic Time (Canada)',
7307		UtcOffset: -180,
7308		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7309		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7310		StandardTimeOffset: -240,
7311		DaylightSavingTimeOffset: -180,
7312	},
7313	{
7314		TimeZoneInfoID: 'Venezuela Standard Time',
7315		DisplayName: '(GMT-04:00) Caracas',
7316		UtcOffset: -240,
7317		DaylightSavingTimeStartDate: null,
7318		DaylightSavingTimeEndDate: null,
7319		StandardTimeOffset: -240,
7320		DaylightSavingTimeOffset: null,
7321	},
7322	{
7323		TimeZoneInfoID: 'Central Brazilian Standard Time',
7324		DisplayName: '(GMT-04:00) Cuiaba',
7325		UtcOffset: -240,
7326		DaylightSavingTimeStartDate: '2019-11-02T23:59:59',
7327		DaylightSavingTimeEndDate: '2019-02-16T23:59:59',
7328		StandardTimeOffset: -240,
7329		DaylightSavingTimeOffset: -180,
7330	},
7331	{
7332		TimeZoneInfoID: 'SA Western Standard Time',
7333		DisplayName: '(GMT-04:00) Georgetown, La Paz, Manaus, San Juan',
7334		UtcOffset: -240,
7335		DaylightSavingTimeStartDate: null,
7336		DaylightSavingTimeEndDate: null,
7337		StandardTimeOffset: -240,
7338		DaylightSavingTimeOffset: null,
7339	},
7340	{
7341		TimeZoneInfoID: 'Pacific SA Standard Time',
7342		DisplayName: '(GMT-04:00) Santiago',
7343		UtcOffset: -240,
7344		DaylightSavingTimeStartDate: '2019-09-08T00:00:00',
7345		DaylightSavingTimeEndDate: '2019-04-07T00:00:00',
7346		StandardTimeOffset: -240,
7347		DaylightSavingTimeOffset: -180,
7348	},
7349	{
7350		TimeZoneInfoID: 'SA Pacific Standard Time',
7351		DisplayName: '(GMT-05:00) Bogota, Lima, Quito, Rio Branco',
7352		UtcOffset: -300,
7353		DaylightSavingTimeStartDate: null,
7354		DaylightSavingTimeEndDate: null,
7355		StandardTimeOffset: -300,
7356		DaylightSavingTimeOffset: null,
7357	},
7358	{
7359		TimeZoneInfoID: 'Eastern Standard Time (Mexico)',
7360		DisplayName: '(GMT-05:00) Chetumal',
7361		UtcOffset: -300,
7362		DaylightSavingTimeStartDate: null,
7363		DaylightSavingTimeEndDate: null,
7364		StandardTimeOffset: -300,
7365		DaylightSavingTimeOffset: null,
7366	},
7367	{
7368		TimeZoneInfoID: 'Eastern Standard Time',
7369		DisplayName: '(GMT-05:00) Eastern Time (US & Canada)',
7370		UtcOffset: -240,
7371		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7372		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7373		StandardTimeOffset: -300,
7374		DaylightSavingTimeOffset: -240,
7375	},
7376	{
7377		TimeZoneInfoID: 'Haiti Standard Time',
7378		DisplayName: '(GMT-05:00) Haiti',
7379		UtcOffset: -240,
7380		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7381		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7382		StandardTimeOffset: -300,
7383		DaylightSavingTimeOffset: -240,
7384	},
7385	{
7386		TimeZoneInfoID: 'US Eastern Standard Time',
7387		DisplayName: '(GMT-05:00) Indiana (East)',
7388		UtcOffset: -240,
7389		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7390		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7391		StandardTimeOffset: -300,
7392		DaylightSavingTimeOffset: -240,
7393	},
7394	{
7395		TimeZoneInfoID: 'Turks And Caicos Standard Time',
7396		DisplayName: '(GMT-05:00) Turks and Caicos',
7397		UtcOffset: -240,
7398		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7399		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7400		StandardTimeOffset: -300,
7401		DaylightSavingTimeOffset: -240,
7402	},
7403	{
7404		TimeZoneInfoID: 'Central America Standard Time',
7405		DisplayName: '(GMT-06:00) Central America',
7406		UtcOffset: -360,
7407		DaylightSavingTimeStartDate: null,
7408		DaylightSavingTimeEndDate: null,
7409		StandardTimeOffset: -360,
7410		DaylightSavingTimeOffset: null,
7411	},
7412	{
7413		TimeZoneInfoID: 'Central Standard Time',
7414		DisplayName: '(GMT-06:00) Central Time (US & Canada)',
7415		UtcOffset: -300,
7416		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7417		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7418		StandardTimeOffset: -360,
7419		DaylightSavingTimeOffset: -300,
7420	},
7421	{
7422		TimeZoneInfoID: 'Central Standard Time (Mexico)',
7423		DisplayName: '(GMT-06:00) Guadalajara, Mexico City, Monterrey',
7424		UtcOffset: -300,
7425		DaylightSavingTimeStartDate: '2019-04-07T02:00:00',
7426		DaylightSavingTimeEndDate: '2019-10-27T02:00:00',
7427		StandardTimeOffset: -360,
7428		DaylightSavingTimeOffset: -300,
7429	},
7430	{
7431		TimeZoneInfoID: 'Canada Central Standard Time',
7432		DisplayName: '(GMT-06:00) Saskatchewan',
7433		UtcOffset: -360,
7434		DaylightSavingTimeStartDate: null,
7435		DaylightSavingTimeEndDate: null,
7436		StandardTimeOffset: -360,
7437		DaylightSavingTimeOffset: null,
7438	},
7439	{
7440		TimeZoneInfoID: 'US Mountain Standard Time',
7441		DisplayName: '(GMT-07:00) Arizona',
7442		UtcOffset: -420,
7443		DaylightSavingTimeStartDate: null,
7444		DaylightSavingTimeEndDate: null,
7445		StandardTimeOffset: -420,
7446		DaylightSavingTimeOffset: null,
7447	},
7448	{
7449		TimeZoneInfoID: 'Mountain Standard Time (Mexico)',
7450		DisplayName: '(GMT-07:00) Chihuahua, La Paz, Mazatlan',
7451		UtcOffset: -360,
7452		DaylightSavingTimeStartDate: '2019-04-07T02:00:00',
7453		DaylightSavingTimeEndDate: '2019-10-27T02:00:00',
7454		StandardTimeOffset: -420,
7455		DaylightSavingTimeOffset: -360,
7456	},
7457	{
7458		TimeZoneInfoID: 'Mountain Standard Time',
7459		DisplayName: '(GMT-07:00) Mountain Time (US & Canada)',
7460		UtcOffset: -360,
7461		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7462		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7463		StandardTimeOffset: -420,
7464		DaylightSavingTimeOffset: -360,
7465	},
7466	{
7467		TimeZoneInfoID: 'Pacific Standard Time (Mexico)',
7468		DisplayName: '(GMT-08:00) Baja California',
7469		UtcOffset: -420,
7470		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7471		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7472		StandardTimeOffset: -480,
7473		DaylightSavingTimeOffset: -420,
7474	},
7475	{
7476		TimeZoneInfoID: 'UTC-08',
7477		DisplayName: '(GMT-08:00) Coordinated Universal Time-08',
7478		UtcOffset: -480,
7479		DaylightSavingTimeStartDate: null,
7480		DaylightSavingTimeEndDate: null,
7481		StandardTimeOffset: -480,
7482		DaylightSavingTimeOffset: null,
7483	},
7484	{
7485		TimeZoneInfoID: 'Pacific Standard Time',
7486		DisplayName: '(GMT-08:00) Pacific Time (US & Canada)',
7487		UtcOffset: -420,
7488		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7489		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7490		StandardTimeOffset: -480,
7491		DaylightSavingTimeOffset: -420,
7492	},
7493	{
7494		TimeZoneInfoID: 'Alaskan Standard Time',
7495		DisplayName: '(GMT-09:00) Alaska',
7496		UtcOffset: -480,
7497		DaylightSavingTimeStartDate: '2019-03-10T02:00:00',
7498		DaylightSavingTimeEndDate: '2019-11-03T02:00:00',
7499		StandardTimeOffset: -540,
7500		DaylightSavingTimeOffset: -480,
7501	},
7502	{
7503		TimeZoneInfoID: 'UTC-09',
7504		DisplayName: '(GMT-09:00) Coordinated Universal Time-09',
7505		UtcOffset: -540,
7506		DaylightSavingTimeStartDate: null,
7507		DaylightSavingTimeEndDate: null,
7508		StandardTimeOffset: -540,
7509		DaylightSavingTimeOffset: null,
7510	},
7511	{
7512		TimeZoneInfoID: 'Hawaiian Standard Time',
7513		DisplayName: '(GMT-10:00) Hawaii',
7514		UtcOffset: -600,
7515		DaylightSavingTimeStartDate: null,
7516		DaylightSavingTimeEndDate: null,
7517		StandardTimeOffset: -600,
7518		DaylightSavingTimeOffset: null,
7519	},
7520	{
7521		TimeZoneInfoID: 'UTC-11',
7522		DisplayName: '(GMT-11:00) Coordinated Universal Time-11',
7523		UtcOffset: -660,
7524		DaylightSavingTimeStartDate: null,
7525		DaylightSavingTimeEndDate: null,
7526		StandardTimeOffset: -660,
7527		DaylightSavingTimeOffset: null,
7528	},
7529	{
7530		TimeZoneInfoID: 'Dateline Standard Time',
7531		DisplayName: '(GMT-12:00) International Date Line West',
7532		UtcOffset: -720,
7533		DaylightSavingTimeStartDate: null,
7534		DaylightSavingTimeEndDate: null,
7535		StandardTimeOffset: -720,
7536		DaylightSavingTimeOffset: null,
7537	},
7538];
7539$(function () {
7540	$.each(timeZones, function (i, option) {
7541		$('#timezone').append(
7542			$('<option/>').attr('value', option.DisplayName).text(option.DisplayName)
7543		);
7544	});
7545});
7546CS.DetectTimezone.init({ timeZones: timeZones });
7547
7548function showIPfields() {
7549	$('#accountInlineIP').show();
7550}
7551$(function () {
7552	var onSuccess = function (geoipResponse) {
7553		var countryName = CS.Country.Remap(geoipResponse.country);
7554		if (countryName) {
7555			$('#usrCountry').val(countryName);
7556			$('#usrCountry option[value="' + countryName + '"]').attr(
7557				'selected',
7558				'selected'
7559			);
7560			CS.DetectTimezone.detect();
7561		} else {
7562			showIPfields();
7563		}
7564	};
7565	/* If we get an error we will */
7566	var onError = function (error) {
7567		showIPfields();
7568	};
7569	try {
7570		//geoip2.country(onSuccess, onError);
7571		geoLocate(onSuccess, onError);
7572	} catch (err) {
7573		showIPfields();
7574	}
7575});
7576
7577var signupForm = $('form[data-formjs=cm-rego]');
7578var useragent = document.documentElement.getAttribute('data-useragent');
7579var flagagent = false;
7580var flags = ['MSIE 9.0', 'MSIE 8.0'];
7581$.each(flags, function (index, value) {
7582	if (useragent.indexOf(value) > -1) flagagent = true;
7583});
7584if ((!XMLHttpRequest && !XDomainRequest) || flagagent) {
7585	signupForm.find('button').attr('disabled', 'disabled').addClass('processing');
7586	signupForm.prepend(
7587		'<div class="outofdate">Oh no, we don\'t support you browser.<br />To get the full Campaign Monitor experience, please update your browser.</div>'
7588	);
7589}
7590
7591$(document).ready(function () {
7592	var buttonCopy = signupForm.find('button').html();
7593
7594	// CRO test - 2 step signup
7595	var storedEmail = cmStorage('get', 'signup-email', null, true);
7596	if (storedEmail !== 'undefined' && isValidEmailAddress(storedEmail)) {
7597		$('#form-sign-up input[name=email]').val(encodeURI(storedEmail));
7598		//cmStorage('remove', 'signup-email'); // Do we remove it once used or retain for reloads etc?
7599	}
7600
7601	// Random Signup ID to add to blob for CJ Affiliate link up
7602	var jcoid = Math.floor(Math.random() * 10000 + 1) + Date.now();
7603
7604	// $(document).ready(function() {
7605	function getCookie(name) {
7606		var pattern = RegExp(name + '=.[^;]*');
7607		var matched = document.cookie.match(pattern);
7608		if (matched) {
7609			var cookie = matched[0].split('=');
7610			return cookie[1];
7611		}
7612		return false;
7613	}
7614	// });
7615
7616	/* This would work much better if the returning JSON include the field name */
7617	var field_map = {
7618		'Please enter your first and last name': 'contactName',
7619		'Company name is required': 'companyName',
7620		'A valid email address is required': 'email',
7621		'This password is too short': 'password',
7622		'This password is unsafe': 'password',
7623		'This password is too common': 'password',
7624		'This password is too long': 'password',
7625		'Password cannot be left blank': 'password',
7626		'A timezone is required': 'timezone',
7627		'A country is required': 'country',
7628		"Your Campaign Monitor site address can't be empty": 'address',
7629		'Your Campaign Monitor site address contains illegal characters': 'address',
7630		"The Site Address you've selected is already in use, please try a different name":
7631			'address',
7632		'Please select the option that best describes your business':
7633			'CustomerType',
7634	};
7635
7636	var field_map_fields = {};
7637	$.each(field_map, function (k, v) {
7638		field_map_fields[v] = k;
7639	});
7640
7641	var error_override = {
7642		'Please enter your first and last name': 'Please enter your full name',
7643		'Company name is required': 'Company name is required',
7644		'A valid email address is required': 'A valid email address is required',
7645		'This password is too short': 'This password is too short',
7646		'This password is unsafe': 'This password is unsafe',
7647		'This password is too common': 'This password is too common',
7648		'This password is too long': 'This password is too long',
7649		'Password cannot be left blank': 'Password cannot be left blank',
7650		'A timezone is required': 'A timezone is required',
7651		'A country is required': 'A country is required',
7652		"Your Campaign Monitor site address can't be empty":
7653			"Your Campaign Monitor site address can't be empty",
7654		'Your Campaign Monitor site address contains illegal characters':
7655			'Your Campaign Monitor site address contains illegal characters',
7656		"The Site Address you've selected is already in use, please try a different name":
7657			"The Site Address you've selected is already in use, please try a different name",
7658		'Please select the option that best describes your business':
7659			'Please select the option that best describes your business',
7660	};
7661
7662  // * Cookie is currently named _cmgTrkData - if this changes, alert engineering team so they can
7663  // * update their tracking code accordingly
7664	if (typeof CMG_TrkData !== 'undefined') {
7665		var CMG_cookie = CMG_TrkData.getCookie();
7666
7667		if (CMG_cookie) {
7668      console.log('fallback running');
7669			var cmref = CMG_cookie.referralURL;
7670			var cmfirstvisit = CMG_cookie.firstVisit;
7671			var cmlanding = CMG_cookie.landingPageURL;
7672			var cmsignupvar = CMG_cookie.signupVar;
7673			var cmlastref = CMG_cookie.lastReferralURL;
7674			var cmLastLandingPage = CMG_cookie.lastLandingPageURL;
7675			var cmLastViewedPage = CMG_cookie.lastViewedURL;
7676			var cmCurrency = get_cookie('CM-currency');
7677			CMG_cookie['cjoid'] = jcoid;
7678			var trkData = JSON.stringify(CMG_cookie);
7679
7680			var signvarElement = document.getElementById('signupVar');
7681			// don't populate an already populated signupVar form value
7682			if (signvarElement && !signvarElement.value) {
7683				signvarElement.value = cmsignupvar;
7684			}
7685
7686			var o_ref_url = document.getElementById('refererURL');
7687			if (o_ref_url != null) {
7688				o_ref_url.value = cmref;
7689			}
7690
7691			var first_visit = document.getElementById('dateOfFirstVisit');
7692			if (first_visit != null) {
7693				first_visit.value = cmfirstvisit;
7694			}
7695
7696			var o_lp_url = document.getElementById('landingPage');
7697			if (o_lp_url != null) {
7698				o_lp_url.value = cmlanding;
7699			}
7700
7701			var o_last_ref_url = document.getElementById('lastRefererURL');
7702			if (o_last_ref_url != null) {
7703				o_last_ref_url.value = cmlastref;
7704			}
7705
7706			var o_last_lp_url = document.getElementById('lastLandingPage');
7707			if (o_last_lp_url != null) {
7708				o_last_lp_url.value = cmLastLandingPage;
7709			}
7710
7711			var o_last_vw_url = document.getElementById('lastViewedURL');
7712			if (o_last_vw_url != null) {
7713				o_last_vw_url.value = cmLastViewedPage;
7714			}
7715
7716			var currency = document.getElementById('currency');
7717			if (currency != null) {
7718				currency.value = cmCurrency;
7719			}
7720
7721			var trkDataField = document.getElementById('trkData');
7722			if (trkDataField != null) {
7723				trkDataField.value = trkData;
7724			}
7725
7726			var ref_url = document.getElementById('Referral_URL__c');
7727			if (ref_url != null) {
7728				ref_url.value = cmref;
7729			}
7730
7731			var lp_url = document.getElementById('Landing_Page_URL__c');
7732			if (lp_url != null) {
7733				lp_url.value = cmlanding;
7734			}
7735
7736			var last_ref_url = document.getElementById('Last_Referral_URL__c');
7737			if (last_ref_url != null) {
7738				last_ref_url.value = cmlastref;
7739			}
7740
7741			var last_lp_url = document.getElementById('Last_Landing_Page_URL__c');
7742			if (last_lp_url != null) {
7743				last_lp_url.value = cmLastLandingPage;
7744			}
7745
7746			var last_lpc_url = document.getElementById(
7747				'Last_Landing_Page_URL_Contact__c'
7748			);
7749			if (last_lpc_url != null) {
7750				last_lpc_url.value = cmLastLandingPage;
7751			}
7752		}
7753	}
7754
7755	if (signupForm.hasClass('placeholders')) {
7756		signupForm
7757			.find('input[type=text],input[type=email],input[type=password]')
7758			.focus(function () {
7759				$(this).attr('placeholder', '');
7760				$(this).prev('span.label').animate({ top: '0', opacity: '1' }, 200);
7761			});
7762
7763		signupForm
7764			.find('input[type=text],input[type=email],input[type=password]')
7765			.blur(function () {
7766				if ($(this).val() == '') {
7767					var input = $(this);
7768					$(this)
7769						.prev('span.label')
7770						.animate({ top: '15px', opacity: '0' }, 150, function () {
7771							input.attr('placeholder', input.data('placeholder'));
7772						});
7773				}
7774			});
7775
7776		signupForm.find('input[autofocus]').blur().trigger('focus');
7777	}
7778
7779	if (signupForm.hasClass('validation-indicators')) {
7780		var endpoint = signupForm
7781			.attr('action')
7782			.replace('signmeup', 'passwordblacklist');
7783		var blacklist = [];
7784		$.ajax({
7785			url: endpoint,
7786			dataType: 'jsonp',
7787			xhrFields: {
7788				withCredentials: true,
7789			},
7790			success: function (data) {
7791				//console.log(data);
7792				blacklist = data.blacklistedPasswords;
7793			},
7794			error: function () {
7795				//console.log("failed to get blacklist");
7796				// do nothing - leave default
7797			},
7798		});
7799		signupForm
7800			.find('input[type=text],input[type=email],input[type=password]')
7801			.blur(function () {
7802				$(this).removeClass('valid invalid');
7803				var value = $(this).val();
7804				var name = $(this).attr('name');
7805				var class_name = 'valid';
7806				var message = false;
7807
7808				if (name === 'email') {
7809					if (value === '' || !isValidEmailAddress(value)) {
7810						class_name = 'invalid';
7811					}
7812				} else if (name === 'password') {
7813					if (value === '' || value.length < 8) {
7814						class_name = 'invalid';
7815						message = 'This password is too short';
7816					} else if (
7817						blacklist.some(function (v) {
7818							return value === v;
7819						})
7820					) {
7821						class_name = 'invalid';
7822						message = 'This password is unsafe';
7823					}
7824				} else {
7825					if (value === '') {
7826						class_name = 'invalid';
7827					}
7828				}
7829
7830				$(this).addClass(class_name);
7831
7832				if (class_name === 'invalid') {
7833					if (!message) message = error_override[field_map_fields[name]];
7834					if (!$(this).is('select')) {
7835						$(this).next('.error_field').remove();
7836						$(this)
7837							.addClass('error')
7838							.after("<span class='error_field'>" + message + '</span>');
7839						$(this).focus(function () {
7840							$(this)
7841								.removeClass('error')
7842								.next('.error_field')
7843								.fadeOut(300, function () {
7844									$(this).remove();
7845								});
7846						});
7847					} else if ($(this).is('select')) {
7848						$(this).parent().next('.error_field').remove();
7849						$(this)
7850							.parent()
7851							.addClass('error')
7852							.after(
7853								"<span class='error_field selector'>" + message + '</span>'
7854							);
7855						$(this).focus(function () {
7856							$(this)
7857								.parent()
7858								.removeClass('error')
7859								.next('.error_field')
7860								.fadeOut(300, function () {
7861									$(this).remove();
7862								});
7863						});
7864					}
7865				}
7866			});
7867	}
7868
7869	signupForm.submit(function (e) {
7870		e.preventDefault(); // Prevents the URL redirect
7871		var $this = $(this);
7872		$this.parent().find('.response').empty(); // Removes 'error' messages
7873		$this
7874			.find('button')
7875			.html('Processing...')
7876			.addClass('disabled')
7877			.attr('disabled', 'disabled'); // Loading text state of <button>
7878		if ($this.find('[name=companyName]').attr('type') == 'hidden') {
7879			$this
7880				.find('[name=companyName]')
7881				.val($this.find('[name=contactName]').val());
7882		}
7883		// Pass the marketo cookie data through for pickup
7884		var mkto_cookie = get_cookie('_mkto_trk');
7885		var mkto_field = $this.find('[name = Marketo_Cookie__c ]');
7886		if (mkto_field.length === 0) {
7887			$this.append(
7888				"<input type='hidden' name='Marketo_Cookie__c' value='" +
7889					mkto_cookie +
7890					"' />"
7891			);
7892		} else {
7893			mkto_field.val(mkto_cookie);
7894		}
7895
7896		try {
7897			$this.find('[name = anonId]').val(analytics.user().anonymousId());
7898		} catch (e) {
7899			// They probably disabled cookies.
7900		}
7901
7902		var hasAlreadySetWindowLocation = false;
7903		const request = () => {
7904			$.ajax({
7905				type: 'post',
7906				url: this.action, // The action URL in <form>
7907				data: $(this).serialize(),
7908				success: function (data) {
7909					// Provided if the form successfully returns (anything)
7910					if (data.success) {
7911						var redirectUrl = data.redirectUrl;
7912						if (redirectUrl.indexOf('createsend.com') > -1) {
7913							var eventObj = {
7914								event: 'taboolaEvent',
7915								taboolaNotify: 'action',
7916								taboolaName: 'SS_Signup',
7917								orderId: jcoid, //acctRegex[1],
7918								eventCallback: function () {
7919									if (!hasAlreadySetWindowLocation) {
7920										hasAlreadySetWindowLocation = true;
7921										window.location = redirectUrl;
7922									}
7923								},
7924							};
7925
7926							if (
7927								typeof dataLayer !== 'undefined' &&
7928								typeof eventObj !== 'undefined'
7929							) {
7930								dataLayer.push(eventObj);
7931							} else {
7932								window.location = redirectUrl;
7933							}
7934						}
7935					}
7936					// Provided if account creation was NOT successful
7937					else if (data.errors) {
7938						data.errors.forEach(function (error) {
7939							if (error === 'ReCaptcha') {
7940								var response = $this.parent().find('.response');
7941								response.empty();
7942								response.append(
7943									'<li>There was an issue creating your account</li>'
7944								);
7945								response.append(
7946									'<li>Please refresh this page and try again</li>'
7947								);
7948							} else {
7949								const errorField = $this.find(
7950									'[name=' + field_map[error] + ']'
7951								);
7952								if (errorField.length > 0) {
7953									if (!errorField.is('select')) {
7954										if (
7955											!(
7956												field_map[error] == 'companyName' &&
7957												$this.find('[name=companyName]').attr('type') ==
7958													'hidden'
7959											)
7960										) {
7961											errorField.next('.error_field').remove();
7962											errorField
7963												.addClass('error')
7964												.after(
7965													"<span class='error_field'>" +
7966														error_override[error] +
7967														'</span>'
7968												);
7969											errorField.focus(function () {
7970												$(this)
7971													.removeClass('error')
7972													.next('.error_field')
7973													.fadeOut(300, function () {
7974														$(this).remove();
7975													});
7976											});
7977										}
7978									} else {
7979										errorField.parent().next('.error_field').remove();
7980										errorField
7981											.parent()
7982											.addClass('error')
7983											.after(
7984												"<span class='error_field selector'>" +
7985													error_override[error] +
7986													'</span>'
7987											);
7988										errorField.focus(function () {
7989											$(this)
7990												.parent()
7991												.removeClass('error')
7992												.next('.error_field')
7993												.fadeOut(300, function () {
7994													$(this).remove();
7995												});
7996										});
7997									}
7998								}
7999							}
8000						});
8001						$this
8002							.find('button')
8003							.html(buttonCopy)
8004							.removeClass('disabled')
8005							.removeAttr('disabled'); // Returns loading text to state to default
8006					}
8007				},
8008				error: function (data) {
8009					var response = $this.parent().find('.response');
8010					response.empty();
8011					response.append('<li>There was an issue creating your account</li>');
8012					response.append('<li>Please refresh this page and try again</li>');
8013
8014					$this
8015						.find('button')
8016						.html(buttonCopy)
8017						.removeClass('disabled')
8018						.removeAttr('disabled'); // Returns loading text to state to default
8019				},
8020			});
8021		};
8022
8023		if (!grecaptcha || !grecaptcha.execute) {
8024			request();
8025		} else {
8026			grecaptcha
8027				.execute('6LdYWN4ZAAAAAARKVpxGwgjN6FAKsbFulT60_pvn', {
8028					action: 'Signup',
8029				})
8030				.then((token) => {
8031					var recaptchaResponse = document.querySelector(
8032						'input[name="g-recaptcha-response"]'
8033					);
8034					recaptchaResponse.value = token;
8035				})
8036				.then(() => {
8037					request();
8038				});
8039		}
8040	});
8041});
8042
8043jQuery.fn.algoliasearch = function (query, page) {
8044  // public credentials
8045  var client = algoliasearch('APBQR9BPSV', '149222961a73b94dbb3be9dc0c3350c6')
8046	var form = $(this)
8047	var input = form.find('input[type=text]')
8048  
8049  var index;
8050  // check environment to initialize the correct index
8051  // and default to production
8052  if (environment === 'local') {
8053    index = client.initIndex('local_allresources')
8054  } else if (environment === 'development') {
8055    index = client.initIndex('dev_allresources')
8056  } else {
8057    index = client.initIndex('prod_allresources')
8058  }
8059
8060	var post_type_map = {
8061		resources: 'Guide',
8062		devresources: 'Guide',
8063		agencyresources: 'Guide',
8064		infographics: 'Infographic',
8065		webinars: 'Webinar',
8066		cmglossary: 'Glossary term',
8067		post: 'Blog post',
8068		tools: 'Tool',
8069		training: 'Training videos',
8070	}
8071
8072	var auto_flag = {
8073		guides: 'resources',
8074		infographics: 'infographics',
8075		webinars: 'webinars',
8076		blog: 'post',
8077		glossary: 'cmglossary',
8078		tools: 'tools',
8079		training: 'training',
8080	}
8081
8082	if (typeof query != 'undefined' && typeof page != 'undefined') {
8083		compile_results(query, page)
8084	}
8085
8086	var search_type = input.data('search')
8087	if (typeof auto_flag[search_type] !== 'undefined') {
8088		$('#search-filter #type-' + auto_flag[search_type]).attr(
8089			'checked',
8090			'checked'
8091		)
8092		$('#toggle-search-filter span').text(
8093			$('#search-filter input[type=checkbox]:checked').length
8094		)
8095	}
8096
8097	input
8098		.keyup(function (e) {
8099			if (e.keyCode !== 27) {
8100				submit_form('key up')
8101			}
8102		})
8103		.focus(function () {
8104			var curr_width = $(this).outerWidth()
8105			var inner_width =
8106				$(this).parents('.inner').width() -
8107				parseInt($('#search-box').css('padding-right'))
8108			$(this)
8109				.addClass('expanded')
8110				.css({ width: curr_width })
8111				.animate({ width: inner_width }, 400, function () {
8112					form.find('.action-flagged').fadeIn(200)
8113					if ($(this).val() != '') submit_form()
8114				})
8115			$('#search-box').find('.shroud').fadeIn(400)
8116			if ($('#search-filter').is(':visible')) {
8117				input.removeClass('shown-filter')
8118				$('#toggle-search-filter').removeClass('open')
8119				$('#search-filter').hide()
8120				$('#search-results').removeClass('hide')
8121				$('#apply-filters').children('.cmbtn').addClass('disabled')
8122			}
8123		})
8124
8125	$('#toggle-search-filter').click(function () {
8126		if ($('#search-filter').is(':visible')) {
8127			// Hide
8128			input.removeClass('shown-filter')
8129			$(this).removeClass('open')
8130			$('#search-filter').hide()
8131			$('#search-results').removeClass('hide')
8132			$('#apply-filters').children('.cmbtn').addClass('disabled')
8133		} else {
8134			// Show
8135			input.addClass('shown-filter')
8136			$(this).addClass('open')
8137			$('#search-filter').show()
8138			$('#search-results').addClass('hide')
8139		}
8140	})
8141
8142	$('#apply-filters')
8143		.children('.cmbtn')
8144		.click(function () {
8145			$('#toggle-search-filter').trigger('click')
8146		})
8147
8148	$('#search-filter input[type=checkbox]').change(function () {
8149		if ($(this).hasClass('action')) {
8150			var count = 0
8151			var data = {}
8152			$('#search-filter input[type=checkbox]:checked').each(function () {
8153				count += 1
8154				if (typeof data[$(this).attr('name')] === 'undefined')
8155					data[$(this).attr('name')] = []
8156				data[$(this).attr('name')].push($(this).val())
8157			})
8158			$('#toggle-search-filter span').text(count)
8159			$('#apply-filters').children('.cmbtn').removeClass('disabled')
8160
8161			if ($('#search-filter').is(':visible')) {
8162				if (count > 0) {
8163					$('#clear-filters').show()
8164				} else {
8165					$('#clear-filters').hide()
8166				}
8167				//console.log("run search on filter click");
8168				filter_cookie(data)
8169				submit_form('label click: ' + $(this).attr('id'))
8170			}
8171		}
8172	})
8173
8174	$('#clear-filters').click(function () {
8175		$('#search-filter input[type=checkbox]').each(function () {
8176			if ($(this).is(':checked')) {
8177				$(this).removeClass('action').trigger('click').addClass('action')
8178			}
8179		})
8180		$(this).hide()
8181		$('#toggle-search-filter span').text('0')
8182
8183		//console.log("run search on clear filter click");
8184		filter_cookie({})
8185		submit_form('clear filters')
8186	})
8187
8188	form.submit(function (e) {
8189		e.preventDefault()
8190		return false
8191	})
8192
8193	$('#submit-search').click(function () {
8194		submit_form('submit-search click')
8195	})
8196
8197	$(document).on('click touchstart keyup', function (e) {
8198		// console.log(e.target);
8199		if ($('#search-box').find('input[type=text]').hasClass('expanded')) {
8200			if (
8201				(!$(e.target).hasClass('search-form') && !$(e.target).id === 'search-box' &&
8202					$(e.target).closest('.search-form').length == 0) ||
8203				e.keyCode == 27 || $(e.target).hasClass('shroud')
8204			) {
8205				e.stopPropagation()
8206				var blur_width = $('.search-box').width()
8207				form.find('.action-flagged').hide()
8208				$('#search-box')
8209					.find('input[type=text]')
8210					.blur()
8211					.animate({ width: blur_width }, 400, function () {
8212						$(this).removeClass('expanded').removeAttr('style')
8213					})
8214				$('#search-results').hide().html('')
8215				$('#search-filter').hide()
8216				$('#search-results').removeClass('hide')
8217				$('#found-results-count').hide()
8218				$('#toggle-search-filter').removeClass('open')
8219				$('#search-box').find('.shroud').fadeOut(400)
8220			}
8221		}
8222		if ($('#filter-bar .browse-by').hasClass('active')) {
8223			if (
8224				(!$(e.target).hasClass('browse') &&
8225					$(e.target).closest('.browse').length == 0) ||
8226				e.keyCode == 27
8227			) {
8228				$('#filter-bar .browse-by').removeClass('active')
8229				$('#filter-bar .browse-by')
8230					.next('.options')
8231					.animate({ top: '100%', opacity: 0 }, 200, function () {
8232						$(this).hide()
8233					})
8234			}
8235		}
8236
8237		if ($('#filter-bar .section-menu').hasClass('active')) {
8238			//console.log('found', e);
8239			if (
8240				($(e.target).closest('.section-menu').length == 0 &&
8241					$(e.target).closest('.menu-bar').length == 0) ||
8242				e.keyCode == 27
8243			) {
8244				//console.log('Hide it');
8245				// Menu open - close it
8246				$('#filter-bar .section-menu').removeClass('active')
8247				$('.menu-bar').slideUp()
8248			}
8249		}
8250	})
8251
8252	function submit_form(func) {
8253		if (
8254			form.find('input[type=text]').val() !== '' ||
8255			$('#search-filter input[type=checkbox]:checked').length > 0
8256		) {
8257			//$("#search-results").show().html("<div id='search-interm'><div class='inner'>Searching...</div></div>");
8258			//console.log("run search on submit form");
8259			run_search()
8260		} else {
8261			$(this).removeClass('shown-results')
8262			$('#found-results-count').hide()
8263			$('#search-results').hide().html('')
8264		}
8265	}
8266
8267	function filter_cookie(data, retrieve) {
8268		if (typeof retrieve === 'undefined') retrieve = false
8269
8270		if (retrieve) {
8271			return JSON.parse(get_cookie('resource_filters'))
8272		} else {
8273			set_cookie('resource_filters', JSON.stringify(data))
8274		}
8275	}
8276
8277	function searchCallback(err, content) {
8278		if (err) {
8279			return err
8280		}
8281
8282		//console.log(content);
8283		var renderQuery = content.query.replace(/(<\S([^>]+)>)/gi, '')
8284
8285		if (content.hits.length > 0) {
8286			var show_count = content.hits.length
8287			if (show_count > 5) show_count = 5
8288
8289			var title = ''
8290			if (content.nbHits > 5) {
8291				title = 'Top ' + show_count + ' search results'
8292			} else {
8293				title = 'Found ' + show_count + ' search results'
8294			}
8295			if (content.query !== '')
8296				title += ' for &ldquo;' + renderQuery + '&rdquo;'
8297			if (content.params.indexOf('filters=&') === -1)
8298				title += ' with applied filters'
8299			title += '.'
8300
8301			$('#found-results-count')
8302				.text(content.nbHits + ' total results found')
8303				.show()
8304
8305			var postback = '<h4>' + title + "</h4><div class='articles'>"
8306			content.hits.forEach(function (hit) {
8307				var type = hit.post_type
8308				if (typeof post_type_map[type] === 'undefined') {
8309					var f = type.charAt(0).toUpperCase()
8310					type = f + type.substr(1)
8311				} else {
8312					type = post_type_map[type]
8313				}
8314
8315				var article =
8316					'<div id="' +
8317					hit.post_type +
8318					'-' +
8319					hit.ID +
8320					'" class="search-result ' +
8321					hit.post_type +
8322					'">' +
8323					'<a href="' +
8324					hit.permalink +
8325					'"></a>' +
8326					'<div class="title">' +
8327					hit.post_title +
8328					'</div>' +
8329					'<div class="pill"><span>' +
8330					type +
8331					'</span></div>' +
8332					'</div>'
8333				postback += article
8334			})
8335			postback += '</div>'
8336
8337			if (content.nbHits > 5 && content.query !== '') {
8338				postback +=
8339					"<div id='show-all-results'><a href='" +
8340					form.data('searchpath') +
8341					renderQuery +
8342					"/' class='cmbtn tertiary'>See all " +
8343					content.nbHits +
8344					' results</a></div>'
8345			}
8346
8347			$('#search-results').html(postback).show()
8348			form.find('input[type=text]').addClass('shown-results')
8349
8350			$('#show-all-results a').click(function (e) {
8351				e.preventDefault()
8352				var url = $(this).attr('href')
8353				var data = {}
8354				$('#search-filter input[type=checkbox]:checked').each(function () {
8355					if (typeof data[$(this).attr('name')] === 'undefined')
8356						data[$(this).attr('name')] = []
8357					data[$(this).attr('name')].push($(this).val())
8358				})
8359				filter_cookie(data)
8360				window.location = url
8361				return false
8362			})
8363		} else {
8364			$('#found-results-count')
8365				.text(content.nbHits + ' total results found')
8366				.show()
8367			var title = 'Sorry no results found'
8368			if (content.query !== '')
8369				title += ' for &ldquo;' + renderQuery + '&rdquo;'
8370			if (content.params.indexOf('filters=&') === -1)
8371				title += ' with the applied filters'
8372			title += '. Please modify the search criteria.'
8373			$('#search-results')
8374				.show()
8375				.html('<h4>' + title + '</h4>')
8376		}
8377	}
8378
8379	function run_search(term, page) {
8380		if (typeof term == 'undefined') term = form.find('input[type=text]').val()
8381		if (typeof page == 'undefined') page = 0
8382
8383		var filters = {}
8384
8385		$('#search-filter input[type=checkbox]:checked').each(function () {
8386			if (typeof filters[$(this).attr('name')] == 'undefined')
8387				filters[$(this).attr('name')] = []
8388			filters[$(this).attr('name')].push($(this).val())
8389		})
8390
8391		if (term.length >= 3 || !$.isEmptyObject(filters)) {
8392			retrieve_results(term, filters, page, 5, searchCallback)
8393		} else {
8394			$(this).removeClass('shown-results')
8395			$('#found-results-count').hide()
8396			$('#search-results').hide().html('')
8397		}
8398	}
8399
8400	function compileCallback(err, content) {
8401		if (err) {
8402			return err
8403		}
8404
8405		//console.log(content);
8406		var renderQuery = content.query.replace(/(<\S([^>]+)>)/gi, '')
8407
8408		if (content.hits.length) {
8409			var postback = ''
8410			var pagination = ''
8411			content.hits.forEach(function (hit) {
8412				var excerpt = hit.post_excerpt
8413				excerpt = hit.post_excerpt.replace(/<\/?[^>]+(>|$)/g, '')
8414				var maxLength = 100
8415				var new_excerpt = excerpt.substr(0, maxLength)
8416				new_excerpt = new_excerpt.substr(
8417					0,
8418					Math.min(new_excerpt.length, new_excerpt.lastIndexOf(' '))
8419				)
8420				if (new_excerpt !== excerpt) new_excerpt += '...'
8421				hit.post_excerpt = new_excerpt
8422
8423				postback +=
8424					"<div class='tile " +
8425					hit.post_type +
8426					"'>" +
8427					"<div class='image' style='background-image: url(" +
8428					hit.background_image +
8429					")'></div>" +
8430					"<div class='details'>" +
8431					"<h6 class='badge " +
8432					hit.post_type +
8433					"'>" +
8434					post_type_map[hit.post_type] +
8435					'</h6>' +
8436					'<h4>' +
8437					hit.post_title +
8438					'</h4>' +
8439					'<p>' +
8440					hit.post_excerpt +
8441					'</p>' +
8442					'</div>' +
8443					"<a href='" +
8444					hit.permalink +
8445					"' class='tile-link'></a>" +
8446					'</div>'
8447			})
8448
8449			if (content.nbPages > 1) {
8450				pagination = "<div id='pagination-container'><div class='inner'><div id='pagination'>"
8451				var curr_page = content.page + 1
8452				var prev_page = curr_page - 1
8453				var next_page = curr_page + 1
8454
8455				if (prev_page > 0) {
8456					pagination +=
8457						"<a href='" +
8458						form.data('searchpath') +
8459						renderQuery +
8460						'/' +
8461						prev_page +
8462						"/' class='prev'><svg width='7px' height='10px' viewBox='0 0 7 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><g stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'><g transform='translate(-712.000000, -4797.000000)' stroke='currentColor'><g transform='translate(713.000000, 4791.000000)'><polyline transform='translate(2.574990, 11.000000) rotate(-270.000000) translate(-2.574990, -11.000000) ' points='-2.42500991 8.72497026 2.42500991 13.5749901 7.57499009 8.42500991'></polyline></g></g></g></a>"
8463				}
8464
8465				pagination += "<span class='page_counter'>"
8466
8467				if (curr_page > 3) {
8468					pagination +=
8469						"<a href='" +
8470						form.data('searchpath') +
8471						renderQuery +
8472						"/' class='number'>1</a> ... "
8473				}
8474
8475				var start = curr_page - 2
8476				var end = start + 4
8477				if (end > content.nbPages) end = content.nbPages
8478				if (start !== end - 4) start = end - 4
8479				if (start < 1) start = 1
8480
8481				for (var p = start; p <= end; p++) {
8482					var current = ''
8483					if (p == curr_page) current = ' current'
8484					pagination +=
8485						"<a href='" +
8486						form.data('searchpath') +
8487						renderQuery +
8488						'/' +
8489						p +
8490						"/' class='number" +
8491						current +
8492						"'>" +
8493						p +
8494						'</a>'
8495				}
8496
8497				if (curr_page < content.nbPages - 2 && end !== content.nbPages) {
8498					pagination +=
8499						" ... <a href='" +
8500						form.data('searchpath') +
8501						renderQuery +
8502						'/' +
8503						content.nbPages +
8504						"/' class='number'>" +
8505						content.nbPages +
8506						'</a>'
8507				}
8508
8509				pagination += '</span>'
8510
8511				if (next_page <= content.nbPages) {
8512					pagination +=
8513						"<a href='" +
8514						form.data('searchpath') +
8515						renderQuery +
8516						'/' +
8517						next_page +
8518						"/' class='next'><svg width='7px' height='10px' viewBox='0 0 7 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><g stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'><g transform='translate(-822.000000, -4797.000000)' stroke='currentColor'><g transform='translate(713.000000, 4791.000000)'><polyline transform='translate(112.574990, 11.000000) rotate(-90.000000) translate(-112.574990, -11.000000) ' points='107.57499 8.72497026 112.42501 13.5749901 117.57499 8.42500991'></polyline></g></g></g></a>"
8519				}
8520
8521				pagination += '</div></div></div>'
8522				$('#grid-search-results').append(pagination)
8523			}
8524
8525			$('#compiling-search').remove()
8526			$('#grid-search-results .grid').prepend(postback)
8527		} else {
8528			$('#compiling-search').html(
8529				'<hgroup><h4>Sorry, your search produced no results.</h4><p>Check out our featured content below or try adjusting your search for optimal results.</p></hgroup>'
8530			)
8531			$('#grid-related').show()
8532		}
8533	}
8534
8535	function compile_results(term, page) {
8536		if (typeof page == 'undefined') page = 0
8537
8538		var filters = filter_cookie({}, true)
8539
8540		query = decodeURIComponent(query)
8541
8542		$('#banner').find('h1 span').text(query)
8543		$('#search').find('input[type=text]').val(query)
8544
8545		retrieve_results(term, filters, page, 12, compileCallback)
8546	}
8547
8548	function retrieve_results(term, filters, page, hitsPerPage, callback) {
8549		var filter_string = ''
8550		var filter_strings = []
8551		var filter_cond = ''
8552		var filter_to_key = {
8553			industry: 'industries',
8554			topic: 'topics',
8555			type: 'post_type',
8556		}
8557
8558		//console.log(filters);
8559		//console.log(!$.isEmptyObject(filters));
8560		if (!$.isEmptyObject(filters)) {
8561			for (var filter in filters) {
8562				var f_string = ''
8563				var cond = ''
8564				//console.log(filters.hasOwnProperty(filter), filters[filter].length);
8565				if (filters.hasOwnProperty(filter) && filters[filter].length > 0) {
8566					for (var l = 0; l < filters[filter].length; l++) {
8567						//console.log("filter Type: ", filter);
8568						f_string +=
8569							cond +
8570							filter_to_key[filter] +
8571							':' +
8572							JSON.stringify(filters[filter][l])
8573						cond = ' OR '
8574						if (filter == 'type' && filters[filter][l] == 'resources') {
8575							f_string += cond + filter_to_key[filter] + ':devresources'
8576							f_string += cond + filter_to_key[filter] + ':agencyresources'
8577						}
8578						//console.log(f_string);
8579					}
8580					filter_strings.push(f_string)
8581				}
8582				//console.log(filter_strings);
8583			}
8584
8585			if (filter_strings.length > 0) {
8586				for (var s = 0; s < filter_strings.length; s++) {
8587					filter_string += filter_cond + '(' + filter_strings[s] + ')'
8588					filter_cond = ' AND '
8589				}
8590			}
8591		}
8592
8593		term = decodeURIComponent(term)
8594		//console.log("Filter: ", filter_string);
8595		index.search(
8596			term,
8597			{
8598				filters: filter_string,
8599				hitsPerPage: hitsPerPage,
8600				page: page,
8601			},
8602			callback
8603		)
8604	}
8605}
8606
8607$(document).ready(function () {
8608	/*
8609	 * GLOBAL
8610	 */
8611
8612	// OPEN MENU
8613	$('#filter-bar .section-menu').click(function () {
8614		var menu = $(this).data('menu')
8615		if ($(this).hasClass('active')) {
8616			// Menu open - close it
8617			$(this).removeClass('active')
8618			$('#' + menu + '-bar').slideUp()
8619		} else {
8620			// check another menu isn't open
8621			$('.menu-bar:visible').slideUp()
8622			$('#filter-bar .section-menu.active').removeClass('active')
8623			// Menu closed - open it
8624			$(this).addClass('active')
8625			$('#' + menu + '-bar').slideDown()
8626		}
8627	})
8628
8629	// SEARCH FUNCTIONALITY
8630	if ($('#search-filter').length > 0) {
8631		var filters = JSON.parse(get_cookie('resource_filters'))
8632		if (!$.isEmptyObject(filters)) {
8633			var count = 0
8634			$.each(filters, function (k, v) {
8635				for (var c = 0; c < v.length; c++) {
8636					$(
8637						'#search-filter input[name=' + k + "][value='" + v[c] + "']"
8638					).trigger('click')
8639					count += 1
8640				}
8641			})
8642			$('#toggle-search-filter span').text(count)
8643			if (count > 0) {
8644				$('#clear-filters').show()
8645			}
8646		}
8647	}
8648
8649	if ($('#grid-search-results').length > 0) {
8650		$('#grid-search-results .grid').append(
8651			"<div id='compiling-search'><hgroup><h4>Compiling results...</h4></hgroup></div>"
8652		)
8653		var url = window.location.href
8654		var parts = url.split('/resources/search/')
8655		parts = parts[1].split('/')
8656		parts.pop()
8657		if (parts.length > 1) {
8658			//paging
8659			var page = parts.pop() - 1
8660			var query = parts.pop()
8661		} else {
8662			// query
8663			var page = 0
8664			var query = parts.pop()
8665		}
8666
8667		if (query) {
8668			$('#search').algoliasearch(query, page)
8669		} else {
8670			window.location = $('#search').data('searchpath').replace('search/', '')
8671		}
8672	} else {
8673		$('#search').algoliasearch()
8674	}
8675
8676	// Browse by box
8677	$('#filter-bar .browse-by').click(function () {
8678		if ($(this).hasClass('active')) {
8679			$(this).removeClass('active')
8680			$(this)
8681				.next('.options')
8682				.animate({ top: '100%', opacity: 0 }, 200, function () {
8683					$(this).hide()
8684				})
8685		} else {
8686			$(this).addClass('active')
8687			$(this).next('.options').show().animate({ top: '110%', opacity: 1 }, 200)
8688		}
8689	})
8690
8691	// SOCIAL CLICK FUNCTIONALITY
8692	$('a.social')
8693		.not('.embed')
8694		.click(function (e) {
8695			var id = $(this).data('windowid')
8696			var w = 550
8697			var h = 400
8698			var dualScreenLeft =
8699				window.screenLeft != undefined ? window.screenLeft : screen.left
8700			var dualScreenTop =
8701				window.screenTop != undefined ? window.screenTop : screen.top
8702
8703			width = window.innerWidth
8704				? window.innerWidth
8705				: document.documentElement.clientWidth
8706				? document.documentElement.clientWidth
8707				: screen.width
8708			height = window.innerHeight
8709				? window.innerHeight
8710				: document.documentElement.clientHeight
8711				? document.documentElement.clientHeight
8712				: screen.height
8713
8714			var left = width / 2 - w / 2 + dualScreenLeft
8715			var top = height / 2 - h / 2 + dualScreenTop
8716			if (id == null || id.closed) {
8717				id = window.open(
8718					$(this).attr('href'),
8719					'_blank',
8720					'modal=yes, menubar=no, status=no, titlebar=no, toolbar=no, location=no, width=' +
8721						w +
8722						', height=' +
8723						h +
8724						', top=' +
8725						top +
8726						', left=' +
8727						left
8728				)
8729			}
8730			if (id !== null) {
8731				id.focus()
8732				$(this).data('windowid', id)
8733			}
8734			e.preventDefault()
8735			return false
8736		})
8737
8738	// IFRAME FUNCTIONALITY
8739	$('.faux-iframe').each(function () {
8740		$(this).on('inview', function (event, visible) {
8741			if (visible === true && !$(this).hasClass('loaded')) {
8742				var frame = $(this)
8743				var url = frame.data('url')
8744				var width = frame.data('width')
8745				var height = frame.data('height')
8746
8747				frame
8748					.html(
8749						'<iframe frameborder="0" src="' +
8750							url +
8751							'" width="' +
8752							width +
8753							'" height="' +
8754							height +
8755							'" style="width: ' +
8756							width +
8757							'; height: ' +
8758							height +
8759							'px;" class="fitvidsignore"></iframe>'
8760					)
8761					.addClass('loaded')
8762			}
8763		})
8764	})
8765
8766	/*
8767	 * GLOSSARY
8768	 */
8769
8770	// INIT Index
8771	if ($('#glossary-index').length > 0) {
8772		$('#glossary-index')
8773			.find('.filter')
8774			.each(function () {
8775				var letter = $(this).data('letter')
8776				if ($('#letter-' + letter).length == 0) $(this).addClass('disabled')
8777			})
8778	}
8779
8780	// Letter Filter
8781	$('#glossary-index .filter')
8782		.not('.disabled')
8783		.click(function () {
8784			var letter = $(this).data('letter')
8785			var loc_anchor =
8786				$('#letter-' + letter).offset().top - $('header').outerHeight()
8787			$('html, body').animate({ scrollTop: loc_anchor }, 300)
8788		})
8789
8790	// Back to top
8791	$('#back-to-top').click(function () {
8792		var loc_anchor =
8793			$('#glossary-index').offset().top - $('header').outerHeight()
8794		$('html, body').animate({ scrollTop: loc_anchor }, 300)
8795	})
8796
8797	if ($('#glossary-index').length > 0) {
8798		$(window).scroll(function () {
8799			var top = $(window).scrollTop()
8800			var bottom = top + $(window).outerHeight()
8801			var top_pos =
8802				$('#glossary-index').offset().top + $('#glossary-index').outerHeight()
8803			var bottom_pos = $('#subscribe').offset().top
8804
8805			if (top > top_pos && bottom < bottom_pos) {
8806				$('#back-to-top').addClass('visible')
8807			} else if (top <= top_pos || bottom >= bottom_pos) {
8808				$('#back-to-top').removeClass('visible')
8809			}
8810		})
8811	}
8812
8813	/*
8814	 * INFOGRAPHICS
8815	 */
8816
8817	// INFOGRAPHIC EMBED CODE FUNCTIONS
8818	$('a.social.embed, #embed_link').click(function (e) {
8819		display_embed_code()
8820	})
8821
8822	/*
8823	 * BLOG
8824	 */
8825
8826	// TURN DROPDOWN INTO SUB MENU
8827	$('#category-filter').change(function () {
8828		var link = $(this).children('option:selected').data('link')
8829		window.location = link
8830	})
8831
8832	// TRACK CTA CLICKS
8833	$('#cta-box a, #subscribe-box a').click(function () {
8834		//ga('send', 'gaEvent', 'Blog', 'Clicked CTA', $("#banner h1").text());
8835		var eventObj = {
8836			event: 'gaEvent',
8837			eventCategory: 'Blog',
8838			eventAction: 'Clicked CTA',
8839			eventLabel: $('#banner h1').text(),
8840		}
8841		if (typeof dataLayer !== 'undefined') {
8842			dataLayer.push(eventObj)
8843		}
8844		if (typeof analytics !== 'undefined')
8845			analytics.track('Clicked Post CTA', { postname: $('#banner h1').text() })
8846	})
8847
8848	// IMPLEMENTING HIGHLIGHT JS
8849	$('pre code').each(function (i, block) {
8850		if ($(this).attr('class') == '') $(this).addClass('html')
8851		block = this
8852		hljs.highlightBlock(block)
8853	})
8854
8855	// RESPONSIVE VIDEO
8856	if (typeof fitVids == 'function') {
8857		$('#post-content').fitVids()
8858	}
8859
8860	// INITIATE GALLERIES
8861	$('#post-content .gallery').each(function () {
8862		var gallery = $(this)
8863		var highest_img_ele = null
8864		var highest_img_height = 0
8865		$(this)
8866			.find('img')
8867			.each(function () {
8868				if ($(this).height() > highest_img_height) {
8869					highest_img_ele = $(this).clone()
8870					highest_img_height = $(this).height()
8871				}
8872			})
8873
8874		gallery.append(highest_img_ele)
8875		gallery.find('br').remove()
8876		gallery.find('.gallery-item').first().addClass('current')
8877		setTimeout(function () {
8878			rotateGallery(gallery)
8879		}, 4000)
8880	})
8881})
8882
8883$("#jaybird-video").cmVideo({'video_btn':$("#jaybird-video-btn"), 'disableListeners':true});
8884
8885$(document).on('click', function (e) {
8886    var elem = e.target;
8887    var clickText = elem.innerText;
8888    var clickUrl = elem.href;
8889    // console.log(e);
8890    // console.log(elem);
8891    // Sign up links
8892    if (elem.href && elem.href.indexOf('/signup/') > -1) {
8893        dataLayer.push({
8894            event: 'interactionEvent',
8895            eventCategory: 'interaction',
8896            eventAction: 'sign up',
8897            eventLabel: clickText,
8898        });
8899    }
8900    // Subscribe 
8901    if (elem.href && elem.href.indexOf('/preference-center/') > -1) { 
8902        dataLayer.push({
8903            'event': 'interactionEvent',
8904            'eventCategory': 'interaction',
8905            'eventAction': 'newsletter',
8906            'eventLabel': clickText            
8907        });
8908    }
8909    // Related content 
8910    if (elem.href && $(elem).closest('#grid-related').length) {
8911        // Normal tiles have no text, tiles with <ul> do  
8912        if(elem.innerText === '') {
8913            clickText = $(elem).parent().find('h4').text();
8914        } 
8915        dataLayer.push({
8916            'event': 'interactionEvent',
8917            'eventCategory': 'interaction',
8918            'eventAction': 'related content',
8919            'eventLabel': clickText            
8920        });
8921    }
8922    // Social shares
8923    // In button
8924    // dataLayer.push({'event': 'interactionEvent','eventCategory': 'interaction','eventAction': 'social share','eventLabel': this.innerText});
8925    
8926    // In-article link clicks 
8927    if($('body.blog').length && ($(elem).parents('.post').length) && $(elem).parents('#grid-related').length == 0) {
8928        if(elem.tagName == 'SPAN') {
8929            clickUrl = $(elem).parent().attr('href');
8930        }
8931        if(clickUrl) {
8932            dataLayer.push({
8933                'event': 'interactionEvent',
8934                'eventCategory': 'interaction',
8935                'eventAction': 'in-article',
8936                'eventLabel': clickUrl            
8937            });
8938        }
8939    } else if (clickUrl && $('body.guides').length && $(elem).parents('.content.article').length) { 
8940        dataLayer.push({
8941            'event': 'interactionEvent',
8942            'eventCategory': 'interaction',
8943            'eventAction': 'in-article',
8944            'eventLabel': clickUrl            
8945        });
8946    } else if (clickUrl && $('body.training-video').length && $(elem).parents('.sections.content').length) { 
8947        dataLayer.push({
8948            'event': 'interactionEvent',
8949            'eventCategory': 'interaction',
8950            'eventAction': 'in-article',
8951            'eventLabel': clickUrl            
8952        });
8953    } else if (clickUrl && $('body.glossary-posts').length && $(elem).parents('#details-main').length) { 
8954        dataLayer.push({
8955            'event': 'interactionEvent',
8956            'eventCategory': 'interaction',
8957            'eventAction': 'in-article',
8958            'eventLabel': clickUrl            
8959        });
8960    } else if (clickUrl && $('body.infographic').length && $(elem).parents('.content.article').length) { 
8961        dataLayer.push({
8962            'event': 'interactionEvent',
8963            'eventCategory': 'interaction',
8964            'eventAction': 'in-article',
8965            'eventLabel': clickUrl            
8966        });
8967    } else if ($('body.comparisons').length && $(elem).parents('.content.article').length) { 
8968        if(elem.tagName == 'SPAN') {
8969            clickUrl = $(elem).parent().attr('href');
8970        }
8971        if(clickUrl) {
8972            dataLayer.push({
8973                'event': 'interactionEvent',
8974                'eventCategory': 'interaction',
8975                'eventAction': 'in-article',
8976                'eventLabel': clickUrl            
8977            });
8978        }
8979    } else if (clickUrl && $('body.event').length && $(elem).parents('#content .left_text').length) { 
8980        dataLayer.push({
8981            'event': 'interactionEvent',
8982            'eventCategory': 'interaction',
8983            'eventAction': 'in-article',
8984            'eventLabel': clickUrl            
8985        });
8986    } else if(clickUrl && $('body.knowledgebase').length && $(elem).parents('#blogpage-content aritcle').length) {
8987        dataLayer.push({
8988            'event': 'interactionEvent',
8989            'eventCategory': 'interaction',
8990            'eventAction': 'in-article',
8991            'eventLabel': clickUrl            
8992        });
8993    }
8994});
8995
8996function getUrlVars() {
8997    var vars = {};
8998    var parts = window.location.href.replace(/[?&]+([^=&]+)[^=|&?]*([^&*]*)/gi, function(m,key,value) {
8999        vars[key] = value.substring(1);
9000    });
9001    return vars;
9002}
9003function display_embed_code() {
9004    var embed = $('#embed_code');
9005    var textarea = embed.children('textarea');
9006    embed.show();
9007    textarea.height(textarea.prop('scrollHeight')).focus().select();
9008    embed.hide().slideDown(300);
9009    $("html, body").animate({scrollTop: embed.offset().top - 80}, 1000);
9010}
9011
9012function rotateGallery(gallery) {
9013    var curr_cont = gallery.find('.gallery-item.current');
9014    var next_cont = curr_cont.next('.gallery-item');
9015    if (next_cont.length == 0) next_cont = gallery.find('.gallery-item').first();
9016
9017    curr_cont.removeClass('current');
9018    next_cont.addClass('current');
9019
9020    setTimeout(function() {
9021        rotateGallery(gallery);
9022    }, 4000);
9023}
9024
9025function loadpage(href, type) {
9026    if (type == null) {
9027        window.location = window.location.href;
9028    } else if (type == 'category') {
9029        $( "#posts-list" ).animate({'opacity':0}).load( href+" #posts-list", function( response, status, xhr ) {
9030            if ( status == "error" ) {
9031                var msg = "Sorry but there was an error: ";
9032                //console.log(msg);
9033                $( "#error" ).html( msg + xhr.status + " " + xhr.statusText );
9034            } else {
9035                $( "#posts-list" ).animate({'opacity':1});
9036            }
9037        });
9038    } else if (type == 'search') {
9039        $("#search").algoliasearch(history.state['query'], history.state['page'], true);
9040    }
9041}
9042
9043function detectHistory(check) {
9044    var type = null;
9045    if (history.state) type = history.state['type'];
9046    if (type == null) {
9047        if (check && $( "#posts-list" ).length > 0 && $( "#posts-list" ).data('category') != '') type = 'category';
9048        else return;
9049    }
9050    loadpage(document.location.href, type);
9051}
9052
9053detectHistory(false);
9054
9055if (getUrlVars()["utm_source"] == "Email+newsletter+software") {
9056    set_cookie("CM-blog-subscribed", true);
9057}
9058
9059window.onpopstate = function() {
9060    detectHistory(true);
9061};
9062
9063/* GUIDES */
9064
9065$('#nav').onePageNav({
9066    currentClass: 'active',
9067    changeHash: true,
9068    scrollSpeed: 750,
9069    scrollThreshold: 0.5,
9070    'scrollOffset': '1000px',
9071    filter: '',
9072    easing: 'swing',
9073});
9074
9075$('#pagelinks ol').onePageNav({
9076    currentClass: 'active',
9077    changeHash: true,
9078    scrollSpeed: 750,
9079    scrollThreshold: 0.5,
9080    'scrollOffset': '1000px',
9081    filter: '',
9082    easing: 'swing',
9083    handleClick: false
9084});
9085
9086$("#pagelinks a[href^='#']").click(function(e) {
9087    e.preventDefault();
9088    var id = $(this).attr('href');
9089    var loc = $(id).offset();
9090    var pad = 20;
9091    var pos = loc.top - $("header").outerHeight() - pad;
9092    $('html,body').animate({'scrollTop':pos}, 250, function() {
9093        var url = window.location.href;
9094        url = url.split('#');
9095        var PageInfo = {title:document.title, url:url[0]+id};
9096        history.pushState(PageInfo, PageInfo.title, PageInfo.url);
9097    });
9098});
9099if ($('body.guides').length > 0 || $('body.blog').length > 0  || $('body.tech-guides').length > 0) {
9100    const container = $('#bodyCtaModules');
9101    if(container.length > 0) {
9102        if($('body.guides').length > 0 || $('body.tech-guides').length > 0) {
9103            var content = $('#sections');
9104            var paragraphs = $('#sections .content.article > p');
9105            var sections = content.find('.page, .intro-copy');
9106            var end = $(sections[sections.length - 1]).find('.content.article').children().last(
9106);
9107        } else {
9108            var sections = $('article.post')
9109            var paragraphs = $('article.post > p');
9110            var end = paragraphs[paragraphs.length - 1];
9111        }
9112        let top = sections.find('p')[6];
9113        if(paragraphs.length < 12) {
9114            top = sections.find('p')[1];
9115        }
9116        const middle = paragraphs[Math.floor(paragraphs.length / 2)];
9117
9118        ctas = [];
9119        $(container).find('.body-cta').each(function (i, element) {
9120            ctas.push(element);
9121        });
9122
9123        const checkNodeHasImage = (node) => {
9124            const nodeImage = $(node).find('img');
9125            if(nodeImage.length > 0 && !$(node).is(":last-child")) {
9126                node = $(node).next();
9127            }
9128            return node;
9129        }
9130
9131        if(paragraphs.length.length > 12) {
9132          $(ctas[0]).insertAfter(checkNodeHasImage(top));
9133        } else {
9134          $(ctas[0]).detach();
9135        }
9136        if(paragraphs.length.length > 8) {
9137          $(ctas[1]).insertAfter(checkNodeHasImage(middle));
9138        } else {
9139          $(ctas[1]).detach();
9140        }
9141        $(ctas[2]).insertAfter(checkNodeHasImage(end));
9142
9143        if(!$('body').hasClass('knowledgebase')) {
9144            $('#signup').remove();
9145        }
9146    }
9147}
9148if ($("body.guides") || $("body.tech-guides")) {
9149  var userAgent = window.navigator.userAgent,
9150    platform = window.navigator.platform,
9151    macosPlatforms = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"];
9152  // windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],
9153
9154  if (macosPlatforms.indexOf(platform) !== -1) {
9155    $(".bookmark-command").text("CMD+D");
9156  } else {
9157    $(".bookmark-command").text("CTRL+D");
9158  }
9159}
9160$(document).scroll(function(){
9161
9162    var chapters = $("#chapters");
9163    var mark = 0;
9164    var signup = 0;
9165    var head = 0;
9166    var base = 0;
9167    var hide_above = -1;
9168
9169    if ($("#banner").length > 0) {
9170        if($("body.guides").length > 0 ||$("body.tech-guides").length > 0 ) {
9171            mark = $("header").outerHeight() + $("#resource-breadcrumb-bar").outerHeight() - 40;
9172        } else if($("body.blog").length > 0) {
9173            mark = $("#resource-breadcrumb-bar").outerHeight() + 40 ;
9174        }
9175        else {
9176            mark = $("header").outerHeight() + $("#banner").outerHeight();
9177        }
9178    }
9179
9180    if ($("#banner.longhead.guides").length > 0 || $("#banner.longhead.comparisons").length > 0) hide_above = $("#toc").offset().top + $("#toc").outerHeight();
9181
9182    if ($("#grid-related").length > 0)
9183        signup = $("#grid-related").offset().top;
9184    else if ($("#subscribe").length > 0)
9185        signup = $("#subscribe").offset().top;
9186    else if ($("body.policies").length > 0) {
9187        mark = 62;
9188        signup = $("footer").offset().top;
9189    }
9190    else
9191        signup = $("#signup").offset().top;
9192
9193    if($("body.blog").length > 0) {
9194        signup -= 300;
9195    }
9196
9197    if (chapters.length > 0) {
9198        var head = chapters.offset().top;
9199        var base = head + chapters.height();
9200        if($('body.blog').length > 0) {
9201            base = head + chapters.height() - 100;
9202        }
9203    }
9204
9205    var edge = $(window).scrollTop();
9206    if($('body.guides').length > 0 || $('body.tech-guides').length > 0) { 
9207        var top = edge + 100;
9208    } else if($('body.blog').length > 0) {
9209        var top =  edge + 100;
9210    } else {
9211        var top = edge + 110;
9212    }
9213
9214    // New Guide Page code
9215    if (mark <= edge && signup > edge) {
9216        chapters.addClass('sticky');
9217        if(chapters[0]){
9218            chapters[0].style.top = document.querySelector('header').offsetHeight + 'px'
9219        }
9220        if(chapters.find('.primary-cta img')) {
9221            var height = chapters.find('.primary-cta img').height();
9222            chapters.find('.primary-cta .headline').css({'margin-top':'-'+height+'px'})
9223        }
9224        if(chapters.find('.secondary-cta img')) {
9225            var height = chapters.find('.secondary-cta img').height();
9226            chapters.find('.secondary-cta .headline').css({'margin-top':'-'+height+'px'})
9227        }
9228    }
9229    else {
9230        chapters.removeClass('sticky');
9231        if(chapters[0]){
9232            chapters[0].style.top = ''
9233        }
9234        if(chapters.find('.primary-cta img')) {
9235            chapters.find('.primary-cta .headline').css({'margin-top':'0px'})
9236        }
9237        if(chapters.find('.secondary-cta img')) {
9238            chapters.find('.secondary-cta .headline').css({'margin-top':'0px'})
9239        }
9240    }
9241
9242    if (edge > hide_above && !chapters.is(":visible")) {
9243        chapters.fadeIn(200);
9244    } else if (edge <= hide_above && chapters.is(":visible")) {
9245        chapters.fadeOut(200);
9246    }
9247
9248    if (signup <= base && !chapters.hasClass("stuck")) {
9249        if($("#pagelinks").length > 0) {
9250            if($("#pagelinks .mobile-handle").css('display') == 'none') {
9251                chapters.addClass("stuck");
9252            }
9253        }
9254        chapters.addClass("stuck");
9255    }
9256    else if (top <= head && chapters.hasClass("stuck")) {
9257        chapters.removeClass("stuck");
9258    }
9259});
9260
9261//Active states for sticky nav
9262if(document.querySelector('body.comparisons-2022') === null) {
9263    var sections = $('section')
9264      , nav = $('nav')
9265      , nav_height = nav.outerHeight();
9266    
9267    $(window).on('scroll', function () {
9268      var cur_pos = $(this).scrollTop();
9269    
9270      sections.each(function() {
9271        var top = $(this).offset().top - nav_height,
9272            bottom = top + $(this).outerHeight();
9273    
9274        if (cur_pos >= top && cur_pos <= bottom) {
9275          nav.find('a').removeClass('active');
9276          sections.removeClass('active');
9277    
9278          $(this).addClass('active');
9279          nav.find('a[href="#'+$(this).attr('id')+'"]').addClass('active');
9280        }
9281      });
9282    });
9283}
9284
9285$(document).scroll(function(){
9286    var st = $(this).scrollTop();
9287    // When any page has scrolled 1000px - show the email sidebar
9288    if($(this).scrollTop() > 1000)
9289    {
9290        $('.floatingEmailSignup').addClass('show');
9291    }
9292    if($(this).scrollTop() < 1000)
9293    {
9294        $('.floatingEmailSignup').removeClass('show');
9295    }
9296});
9297
9298//Close Email Panel
9299$('#closeEmail').click(function(e){
9300  e.preventDefault();
9301  set_cookie('cmEmailSignup', 'closed', 7);
9302  $('.floatingEmailSignup').hide();
9303});
9304
9305//Add focus style to floating email form
9306$('.floatingEmailSignup #fieldEmail, #entryForm #fieldEmail').focus(function(){
9307  $('.floatingEmailSignup form, #entryForm').addClass('focused');
9308});
9309
9310$('.floatingEmailSignup #fieldEmail, #entryForm #fieldEmail').blur(function(){
9311  $('.floatingEmailSignup form, #entryForm').removeClass('focused');
9312});
9313
9314// Flyout Sidebar
9315
9316if ($("#chapters .flyout-handle").length > 0) {
9317    $("#chapters .flyout-handle").click(function() {
9318        var handle = $(this);
9319        if (handle.hasClass('open')) {
9320            // Close menu
9321            handle.removeClass('open');
9322            handle.next().animate({width: 0}, function() {
9323                $(this).removeClass('open').removeAttr('style');
9324            });
9325        } else {
9326            // Open Menu
9327            handle.addClass('open');
9328            handle.next().animate({width: handle.next().children('.floatmenu').outerWidth()}, function() {
9329                $(this).addClass('open').removeAttr('style');
9330            });
9331        }
9332    });
9333}
9334
9335// Mobile Sidemenu
9336
9337if ($("#pagelinks .mobile-handle").length > 0) {
9338    $("#pagelinks .mobile-handle").click(function() {
9339        var menu = $(this).next().children('ol');
9340        if (menu.hasClass('open')) {
9341            // Close menu
9342            menu.css('display', 'block').removeClass('open').slideUp(200, function() {
9343                $(this).removeAttr('style');
9344            });
9345            $(this).removeClass('open');
9346        } else {
9347            // Open Menu
9348            menu.slideDown(200, function() {
9349                $(this).removeAttr('style').addClass('open');
9350            });
9351            $(this).addClass('open');
9352        }
9353    });
9354
9355    $("#pagelinks a").click(function() {
9356        if ($("#pagelinks .mobile-handle").hasClass('open')) {
9357            $("#pagelinks .mobile-handle").removeClass('open');
9358        }
9359    });
9360}
9361
9362if ($("#toc-anchor").length > 0) {
9363    $(window).scroll(function() {
9364        var block = $("#modules");
9365        var header_height = $("header").height();
9366        if ($("header").css('position') !== 'fixed') header_height = 0;
9367        var top = $(this).scrollTop() + header_height;
9368        var block_top = block.offset().top;
9369        var anchor = $("#toc-anchor");
9370        var anchor_pos = header_height + 32;
9371        //console.log(top+" >= "+block_top);
9372        if (top >= block_top && !anchor.hasClass('show')) {
9373            //console.log('show');
9374            anchor.animate({opacity:1, top: anchor_pos+"px"}, 'easeOut').addClass('show');
9375        } else if (top < block_top && anchor.hasClass('show')) {
9376            //console.log('hide');
9377            anchor.animate({opacity:0, top: 0}, 'easeOut').removeClass('show');
9378        }
9379    });
9380
9381    $("#toc-anchor").click(function() {
9382        var toc_content = $("#toc").html();
9383        $("body").append("<div id='toc-overlay' class='tocover'>"+toc_content+"</div>");
9384        $("#toc-overlay").animate({opacity:1}, 300);
9385
9386        $("#toc-overlay a").click(function(e) {
9387            e.preventDefault();
9388
9389            var target = $(this.hash);
9390            var offset = 0;
9391            // Allowing for sticky header offset
9392            if ($(this).data('offset')) offset = $(this).data('offset');
9393            target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
9394            if (target.length) {
9395                $("#toc-overlay").animate({"opacity":0}, 300, function() {
9396                    $(this).remove();
9397                });
9398                $('html,body').animate({
9399                  scrollTop: target.offset().top - offset
9400                }, 0);
9401                return false;
9402            }
9403        });
9404    });
9405
9406    $(document).on('click touchstart keyup', function(e) {
9407        if ((!$(e.target).closest('nav').length > 0 && ($(e.target).hasClass('tocover') || $(e.target).hasClass('close'))) || e.keyCode == 27) {
9408            e.stopPropagation();
9409            $("#toc-overlay").animate({"opacity":0}, 300, function() {
9410                $(this).remove();
9411            });
9412        }
9413    });
9414}
9415
9416// Counts up to a number
9417(function($) {
9418    $.fn.countTo = function(options) {
9419        options = $.extend({}, $.fn.countTo.defaults, options || {});
9420        var loops = Math.ceil(options.speed / options.refreshInterval),increment = (options.to - options.from) / loops;
9421        return $(this).each(function() {
9422            var _this = this,loopCount = 0, value = options.from,interval = setInterval(updateTimer, options.refreshInterval);
9423            function updateTimer() {
9424                value += increment; loopCount++;
9425                $(_this).html(value.toFixed(options.decimals));
9426                if (loopCount >= loops) { clearInterval(interval); value = options.to; }
9427            }
9428        });
9429    };
9430    $.fn.countTo.defaults = {from: 1, to: 100, speed: 800, refreshInterval: 50, decimals: 0};
9431})(jQuery);
9432
9433/* GRAPHS */
9434
9435var values = {};
9436var scroll_start_perc = 1.3;
9437load_graph1();
9438load_graph2();
9439load_graph3();
9440load_graph4();
9441load_graph5();
9442load_graph6();
9443load_graph7();
9444load_graph8();
9445
9446$(document).scroll(function() {
9447    var top = $(this).scrollTop();
9448    var window_height = $(window).height();
9449    var bottom = parseInt(top + window_height);
9450
9451    animate_graph1(top, bottom);
9452    animate_graph2(top, bottom);
9453    animate_graph3(top, bottom);
9454    animate_graph4(top, bottom);
9455    animate_graph5(top, bottom);
9456    animate_graph6(top, bottom);
9457    animate_graph7(top, bottom);
9458    animate_graph8(top, bottom);
9459    animate_bobg(top, bottom);
9460    animate_csg(top, bottom);
9461    animate_eeg(top, bottom);
9462    animate_svg(top, bottom);
9463    animate_msg(top,bottom);
9464    animate_rsvg(top,bottom);
9465    animate_mfg(top, bottom);
9466    animate_mskg(top,bottom);
9467    animate_bcbb(top,bottom);
9468});
9469
9470$(window).resize(function() {
9471    resize_graph2(550);
9472    resize_graph3(550);
9473    resize_graph5(550);
9474    resize_graph6(550);
9475    resize_graph8(550);
9476});
9477
9478/* GRAPH 1 */
9479
9480function load_graph1() {
9481    if ($("#graph1").length > 0) {
9482        $("#graph1_burst").velocity({'opacity':'0'}, 0);
9483    }
9484}
9485
9486function animate_graph1(window_top, window_bottom) {
9487    if ($("#graph1").length > 0) {
9488        var graph = $("#graph1");
9489        var graph_pos = graph.offset();
9490        var graph_height = graph.height();
9491
9492        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9493            // Start Animation
9494            graph.attr('class', 'animated');
9495
9496            $("#graph1_burst").delay(250).velocity({opacity: 1}, 300);
9497        }
9498    }
9499}
9500
9501/* GRAPH 2 */
9502
9503function load_graph2() {
9504    if ($("#graph2").length > 0) {
9505        var graph = $("#graph2");
9506        var zero_y = graph.find("#graph2_yline").attr('y1');
9507        values[graph.attr('id')] = {};
9508        graph.find('.bar').each(function() {
9509            values[graph.attr('id')][$(this).attr('id')] = {};
9510            values[graph.attr('id')][$(this).attr('id')]['height'] = $(this).attr('height');
9511            values[graph.attr('id')][$(this).attr('id')]['y'] = $(this).attr('y');
9512            $(this).velocity({'height':0, 'y':zero_y}, 0);
9513        });
9514        graph.find('.dot').each(function() {
9515            $(this).velocity({'opacity':'0'}, 0);
9516        });
9517
9518        resize_graph2(550);
9519    }
9520}
9521
9522function resize_graph2(at_width) {
9523    if ($("#graph2").length > 0 && $(window).width() <= at_width && $("#graph2").attr('class') != 'mobile') {
9524        $("#graph2").attr({'class':'mobile'});
9525        $("#graph2")[0].setAttribute('viewBox', "-61.4 114.3 518.1 412.5");
9526        $("#graph2_tv_label").attr({'transform': "matrix(1 0 0 1 -14.2201 449.9951) rotate(45)", 'font-size':'18px'});
9527        $("#graph2_radio_label").attr({'transform': "matrix(1 0 0 1 43.8154 449.9951) rotate(45)", 'font-size':'18px'});
9528        $("#graph2_social_label").attr({'transform': "matrix(1 0 0 1 102.884 449.9951) rotate(45)", 'font-size':'18px'});
9529        $("#graph2_video_label").attr({'transform': "matrix(1 0 0 1 162.5328 449.9951) rotate(45)", 'font-size':'18px'});
9530        $("#graph2_display_label").attr({'transform': "matrix(1 0 0 1 218.6111 449.9951) rotate(45)", 'font-size':'18px'});
9531        $("#graph2_paid_label").attr({'transform': "matrix(1 0 0 1 275.549 449.9951) rotate(45)", 'font-size':'18px'});
9532        $("#graph2_search_label").attr({'transform': "matrix(1 0 0 1 305.649 479.9951) rotate(45)", 'font-size':'18px'});
9533        $("#graph2_affiliate_label").attr({'transform': "matrix(1 0 0 1 334.2435 450.091) rotate(45)", 'font-size':'18px'});
9534        $("#graph2_email_label").attr({'transform': "matrix(1 0 0 1 392.665 449.9951) rotate(45)", 'font-size':'18px'});
9535    } else if ($("#graph2").length > 0 && $(window).width() > at_width && $("#graph2").attr('class') == 'mobile') {
9536        $("#graph2").attr({'class':''});
9537        $("#graph2")[0].setAttribute('viewBox', "-61.4 114.3 518.1 352.5");
9538        $("#graph2_tv_label").attr({'transform': "matrix(1 0 0 1 -9.2201 449.9951)", 'font-size':'10px'});
9539        $("#graph2_radio_label").attr({'transform': "matrix(1 0 0 1 41.8154 449.9951)", 'font-size':'10px'});
9540        $("#graph2_social_label").attr({'transform': "matrix(1 0 0 1 98.884 449.9951)", 'font-size':'10px'});
9541        $("#graph2_video_label").attr({'transform': "matrix(1 0 0 1 157.5328 449.9951)", 'font-size':'10px'});
9542        $("#graph2_display_label").attr({'transform': "matrix(1 0 0 1 211.6111 449.9951)", 'font-size':'10px'});
9543        $("#graph2_paid_label").attr({'transform': "matrix(1 0 0 1 275.549 449.9951)", 'font-size':'10px'});
9544        $("#graph2_search_label").attr({'transform': "matrix(1 0 0 1 270.649 461.9951)", 'font-size':'10px'});
9545        $("#graph2_affiliate_label").attr({'transform': "matrix(1 0 0 1 326.2435 450.091)", 'font-size':'10px'});
9546        $("#graph2_email_label").attr({'transform': "matrix(1 0 0 1 388.665 449.9951)", 'font-size':'10px'});
9547    }
9548}
9549
9550function animate_graph2(window_top, window_bottom) {
9551    if ($("#graph2").length > 0) {
9552        var graph = $("#graph2");
9553        var graph_pos = graph.offset();
9554        var graph_height = graph.height();
9555
9556        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_he
9556ight / scroll_start_perc)) < window_bottom ) {
9557            // Start Animation
9558            graph.attr('class', 'animated');
9559
9560            var delay = 0;
9561            var speed = 600;
9562            graph.find('.bar').each(function() {
9563                var id = $(this).attr('id');
9564                var number = id.replace('bar', '');
9565                $(this).delay(delay).velocity({'height':values[graph.attr('id')][id]['height'], 'y':values[graph.attr('id')][id]['y']}, "ease-out", speed);
9566                graph.find("#dot"+number).delay(((delay+speed)-(speed/2.5))).velocity({opacity:1});
9567                delay += (speed/2);
9568            });
9569        }
9570    }
9571}
9572
9573/* GRAPH 3 */
9574
9575function load_graph3() {
9576    if ($("#graph3").length > 0) {
9577        var graph = $("#graph3");
9578        var zero_y = graph.find("#graph3_line_-_0").attr('y1');
9579        values[graph.attr('id')] = {};
9580        graph.find('.bar').each(function() {
9581            values[graph.attr('id')][$(this).attr('id')] = {};
9582            values[graph.attr('id')][$(this).attr('id')]['height'] = $(this).attr('height');
9583            values[graph.attr('id')][$(this).attr('id')]['y'] = $(this).attr('y');
9584            $(this).velocity({'height':0, 'y':zero_y}, 0);
9585        });
9586
9587        resize_graph3(550);
9588    }
9589}
9590
9591function resize_graph3(at_width) {
9592    if ($("#graph3").length > 0 && $(window).width() <= at_width && $("#graph3").attr('class') != 'mobile') {
9593        $("#graph3").attr({'class':'mobile'});
9594        $("#graph3_legend1_-_Web").attr({'transform': "matrix(1 0 0 1 427.9986 381.2891)", 'font-size':'18px'});
9595        $("#graph3_legend1_-_colour").attr({'cy': "376.2"});
9596        $("#graph3_legend2_-_Desktop").attr({'transform': "matrix(1 0 0 1 427.9986 414.7891)", 'font-size':'18px'});
9597        $("#graph3_legend2_-_colour").attr({'cy': "409.2"});
9598        $("#graph3_legend3_-_Mobile").attr({'transform': "matrix(1 0 0 1 427.9986 448.2891)", 'font-size':'18px'});
9599        $("#graph3_2010_label").attr({'transform': "matrix(1 0 0 1 136.3792 471.4196)", 'font-size':'18px'});
9600        $("#graph3_2015_label").attr({'transform': "matrix(1 0 0 1 265.4 471.4205)", 'font-size':'18px'});
9601        $("#graph3_perc_0_label").attr({'transform': "matrix(1 0 0 1 44.9057 454.4197)", 'font-size':'18px'});
9602        $("#graph3_perc_20_label").attr({'transform': "matrix(1 0 0 1 35.4457 348.0864)", 'font-size':'18px'});
9603        $("#graph3_perc_40_label").attr({'transform': "matrix(1 0 0 1 35.4457 240.7532)", 'font-size':'18px'});
9604        $("#graph3_perc_60_label").attr({'transform': "matrix(1 0 0 1 35.4457 134.769)", 'font-size':'18px'});
9605    } else if ($("#graph3").length > 0 && $(window).width() > at_width && $("#graph3").attr('class') == 'mobile') {
9606        $("#graph3").attr({'class':''});
9607        $("#graph3_legend1_-_Web").attr({'transform': "matrix(1 0 0 1 427.9986 398.2891)", 'font-size':'10px'});
9608        $("#graph3_legend1_-_colour").attr({'cy': "395.2"});
9609        $("#graph3_legend2_-_Desktop").attr({'transform': "matrix(1 0 0 1 427.9986 421.7891)", 'font-size':'10px'});
9610        $("#graph3_legend2_-_colour").attr({'cy': "418.4"});
9611        $("#graph3_legend3_-_Mobile").attr({'transform': "matrix(1 0 0 1 427.9986 445.2891)", 'font-size':'10px'});
9612        $("#graph3_2010_label").attr({'transform': "matrix(1 0 0 1 146.3792 466.4196)", 'font-size':'10px'});
9613        $("#graph3_2015_label").attr({'transform': "matrix(1 0 0 1 275.4 466.4205)", 'font-size':'10px'});
9614        $("#graph3_perc_0_label").attr({'transform': "matrix(1 0 0 1 48.9057 449.4197)", 'font-size':'10px'});
9615        $("#graph3_perc_20_label").attr({'transform': "matrix(1 0 0 1 43.4457 342.0864)", 'font-size':'10px'});
9616        $("#graph3_perc_40_label").attr({'transform': "matrix(1 0 0 1 43.4457 234.7532)", 'font-size':'10px'});
9617        $("#graph3_perc_60_label").attr({'transform': "matrix(1 0 0 1 43.4457 128.769)", 'font-size':'10px'});
9618    }
9619}
9620
9621function animate_graph3(window_top, window_bottom) {
9622    if ($("#graph3").length > 0) {
9623        var graph = $("#graph3");
9624        var graph_pos = graph.offset();
9625        var graph_height = graph.height();
9626
9627        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_he
9627ight / scroll_start_perc)) < window_bottom ) {
9628            // Start Animation
9629            graph.attr('class', 'animated');
9630
9631            var speed = 600;
9632            graph.find('#graph3_bar1_group').children('rect').each(function() {
9633                var id = $(this).attr('id');
9634                $(this).velocity({'height':values[graph.attr('id')][id]['height'], 'y':values[graph.attr('id')][id]['y']}, "ease-out", speed);
9635            });
9636            graph.find('#graph3_bar2_group').children('rect').each(function() {
9637                var id = $(this).attr('id');
9638                $(this).delay((speed/2)).velocity({'height':values[graph.attr('id')][id]['height'], 'y':values[graph.attr('id')][id]['y']}, "ease-out", speed);
9639            });
9640            graph.find('#graph3_bar3_group').children('rect').each(function() {
9641                var id = $(this).attr('id');
9642                $(this).delay(speed).velocity({'height':values[graph.attr('id')][id]['height'], 'y':values[graph.attr('id')][id]['y']}, "ease-out", speed);
9643            });
9644        }
9645    }
9646}
9647
9648/* GRAPH 4 */
9649
9650function load_graph4() {
9651    if ($("#graph4").length > 0) {
9652        $("#graph4_burst").velocity({'opacity':'0'}, 0);
9653    }
9654}
9655
9656function animate_graph4(window_top, window_bottom) {
9657    if ($("#graph4").length > 0) {
9658        var graph = $("#graph4");
9659        var graph_pos = graph.offset();
9660        var graph_height = graph.height();
9661
9662        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9663            // Start Animation
9664            graph.attr('class', 'animated');
9665
9666            $("#graph4_burst").delay(250).velocity({opacity: 1}, 300);
9667        }
9668    }
9669}
9670
9671/* GRAPH 5 */
9672
9673function load_graph5() {
9674    if ($("#graph5").length > 0) {
9675        $("#graph5_burst").velocity({'opacity':'0'}, 0);
9676        resize_graph5(550);
9677    }
9678}
9679
9680function resize_graph5(at_width) {
9681    if ($("#graph5").length > 0 && $(window).width() <= at_width && $("#graph5").attr('class') != 'mobile') {
9682        $("#graph5").attr({'class':'mobile'});
9683        $("#graph5")[0].setAttribute('viewBox', "0 0 841.9 675.3");
9684        $("#graph5_legend1_-_all1").attr({'transform': "matrix(1 0 0 1 50.9462 565.0816)", 'font-size':'40px'});
9685        $("#graph5_legend1_-_all2").attr({'transform': "matrix(1 0 0 1 90.3555 616.5462)", 'font-size':'40px'});
9686        $("#graph5_legend2_-_segmented1").attr({'transform': "matrix(1 0 0 1 445.5837 565.0816)", 'font-size':'40px'});
9687        $("#graph5_legend2_-_segmented2").attr({'transform': "matrix(1 0 0 1 445.0701 616.5462)", 'font-size':'40px'});
9688    } else if ($("#graph5").length > 0 && $(window).width() > at_width && $("#graph5").attr('class') == 'mobile') {
9689        $("#graph5").attr({'class':''});
9690        $("#graph5")[0].setAttribute('viewBox', "0 0 841.9 595.3");
9691        $("#graph5_legend1_-_all1").attr({'transform': "matrix(1 0 0 1 138.9462 529.0816)", 'font-size':'18px'});
9692        $("#graph5_legend1_-_all2").attr({'transform': "matrix(1 0 0 1 154.3555 548.5462)", 'font-size':'18px'});
9693        $("#graph5_legend2_-_segmented1").attr({'transform': "matrix(1 0 0 1 505.5837 528.4195)", 'font-size':'18px'});
9694        $("#graph5_legend2_-_segmented2").attr({'transform': "matrix(1 0 0 1 506.0701 547.8841)", 'font-size':'18px'});
9695    }
9696}
9697
9698function animate_graph5(window_top, window_bottom) {
9699    if ($("#graph5").length > 0) {
9700        var graph = $("#graph5");
9701        var graph_pos = graph.offset();
9702        var graph_height = graph.height();
9703
9704        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9705            // Start Animation
9706            graph.attr('class', 'animated');
9707
9708            $("#graph5_burst").delay(250).velocity({opacity: 1}, 250);
9709        }
9710    }
9711}
9712
9713/* GRAPH 6 */
9714
9715function load_graph6() {
9716    if ($("#graph6").length > 0) {
9717        var graph = $("#graph6");
9718        values[graph.attr('id')] = {};
9719
9720        var zero_y = graph.find("#graph6_line").attr('y1');
9721        $("#graph6_cover").attr({'width':'705'}, 0);
9722        values[graph.attr('id')]["graph6_bar"] = {};
9723        values[graph.attr('id')]["graph6_bar"]['height'] = $("#graph6_bar").attr('height');
9724        values[graph.attr('id')]["graph6_bar"]['y'] = $("#graph6_bar").attr('y');
9725        $("#graph6_bar").velocity({'height':0, 'y':zero_y}, 0);
9726        $("#graph6_burst").velocity({'opacity':0}, 0);
9727
9728        resize_graph6(550);
9729    }
9730}
9731
9732function resize_graph6(at_width) {
9733    if ($("#graph6").length > 0 && $(window).width() <= at_width && $("#graph6").attr('class') != 'mobile') {
9734        $("#graph6").attr({'class':'mobile'});
9735        $("#graph6 .mobile_hide").attr({'style': 'display: none;'});
9736        $("#graph6_now_label").attr({'transform': "matrix(1 0 0 1 555.957 638.7917)", 'font-size':'22px'});
9737        $("#graph6_then_label").attr({'transform': "matrix(1 0 0 1 -146.9242 638.7917)", 'font-size':'22px'});
9738    } else if ($("#graph6").length > 0 && $(window).width() > at_width && $("#graph6").attr('class') == 'mobile') {
9739        $("#graph6").attr({'class':''});
9740        $("#graph6 .mobile_hide").attr({'style': 'display: block;'});
9741        $("#graph6_now_label").attr({'transform': "matrix(1 0 0 1 563.957 628.7917)", 'font-size':'13.9178px'});
9742        $("#graph6_then_label").attr({'transform': "matrix(1 0 0 1 -138.9242 628.7917)", 'font-size':'13.9178px'});
9743    }
9744}
9745
9746function animate_graph6(window_top, window_bottom) {
9747    if ($("#graph6").length > 0) {
9748        var graph = $("#graph6");
9749        var graph_pos = graph.offset();
9750        var graph_height = graph.height();
9751
9752        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_he
9752ight / scroll_start_perc)) < window_bottom ) {
9753            // Start Animation
9754            graph.attr('class', 'animated');
9755
9756            var delay = 0;
9757            var speed = 700;
9758            $("#graph6_cover").velocity({'width':0, 'x':528}, "ease-out", speed);
9759            $("#graph6_bar").delay((speed-100)).velocity({'height':values[graph.attr('id')]["graph6_bar"]['height'], 'y':values[graph.attr('id')]["graph6_bar"]['y']}, 'ease-in-out', 300, function() {
9760                $("#graph6_burst").delay(250).velocity({'opacity':1}, 250);
9761            });
9762        }
9763    }
9764}
9765
9766/* GRAPH 7 */
9767
9768function load_graph7() {
9769    if ($("#graph7").length > 0) {
9770        $("#graph7_burst").velocity({translateY:-15, 'opacity':'0'}, 0);
9771    }
9772}
9773
9774function animate_graph7(window_top, window_bottom) {
9775    if ($("#graph7").length > 0) {
9776        var graph = $("#graph7");
9777        var graph_pos = graph.offset();
9778        var graph_height = graph.height();
9779
9780        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9781            // Start Animation
9782            graph.attr('class', 'animated');
9783
9784            $("#graph7_burst").delay(250).velocity({opacity: 1}, 250);
9785        }
9786    }
9787}
9788
9789/* GRAPH 8 */
9790
9791function load_graph8() {
9792    if ($("#graph8").length > 0) {
9793        var graph = $("#graph8");
9794        var zero_y = graph.find("#graph8_line_0").attr('y1');
9795        values[graph.attr('id')] = {};
9796        graph.find('.bar').each(function() {
9797            values[graph.attr('id')][$(this).attr('id')] = {};
9798            values[graph.attr('id')][$(this).attr('id')]['height'] = $(this).attr('height');
9799            values[graph.attr('id')][$(this).attr('id')]['y'] = $(this).attr('y');
9800            $(this).velocity({'height':0, 'y':zero_y}, 0);
9801        });
9802        $("#graph8_burst").velocity({'opacity':0}, 0);
9803
9804        resize_graph8(550);
9805    }
9806}
9807
9808function resize_graph8(at_width) {
9809    if ($("#graph8").length > 0 && $(window).width() <= at_width && $("#graph8").attr('class') != 'mobile') {
9810        $("#graph8").attr({'class':'mobile'});
9811        $("#graph8")[0].setAttribute('viewBox', "0 0 463.8 416");
9812        $("#graph8_label1").attr({'transform':'matrix(1 0 0 1 25.496 323.9182) rotate(45)'});
9813        $("#graph8_label2").attr({'transform':'matrix(1 0 0 1 101.3167 323.9182) rotate(45)'});
9814        $("#graph8_label3").attr({'transform':'matrix(1 0 0 1 177.1373 323.9182) rotate(45)'});
9815        $("#graph8_label4").attr({'transform':'matrix(1 0 0 1 252.9578 323.9182) rotate(45)'});
9816        $("#graph8_label5").attr({'transform':'matrix(1 0 0 1 328.7785 323.9182) rotate(45)'});
9817        $("#graph8_label6").attr({'transform':'matrix(1 0 0 1 404.5991 323.9182) rotate(45)'});
9818        $("#graph8 tspan").attr({'font-size':'15px'});
9819        $("#graph8 tspan.graph8_line2").attr({'y':'16.8'});
9820        $("#graph8 tspan.graph8_line3").attr({'y':'32.6'});
9821        $("#graph8_legend_Other").attr({'transform': "matrix(1 0 0 1 361.3557 25.5818)", 'font-size':'17px'});
9822        $("#graph8_legend_Other_colour").attr({'cx':'350.9', 'cy':'19.7'});
9823        $("#graph8_legend_Trans").attr({'transform': "matrix(1 0 0 1 166.4529 25.5825)", 'font-size':'17px'});
9824        $("#graph8_legend_Trans_colour").attr({'cx':'154.9', 'cy':'19.7'});
9825    } else if ($("#graph8").length > 0 && $(window).width() > at_width && $("#graph8").attr('class') == 'mobile') {
9826        $("#graph8").attr({'class':''});
9827        $("#graph8")[0].setAttribute('viewBox', "0 0 463.8 356");
9828        $("#graph8_label1").attr({'transform':'matrix(1 0 0 1 20.496 323.9182) rotate(0)'});
9829        $("#graph8_label2").attr({'transform':'matrix(1 0 0 1 96.3167 323.9182) rotate(0)'});
9830        $("#graph8_label3").attr({'transform':'matrix(1 0 0 1 172.1373 323.9182) rotate(0)'});
9831        $("#graph8_label4").attr({'transform':'matrix(1 0 0 1 247.9578 323.9182) rotate(0)'});
9832        $("#graph8_label5").attr({'transform':'matrix(1 0 0 1 323.7785 323.9182) rotate(0)'});
9833        $("#graph8_label6").attr({'transform':'matrix(1 0 0 1 399.5991 323.9182) rotate(0)'});
9834        $("#graph8 tspan").attr({'font-size':'9px'});
9835        $("#graph8 tspan.graph8_line2").attr({'y':'10.8'});
9836        $("#graph8 tspan.graph8_line3").attr({'y':'21.6'});
9837        $("#graph8_legend_Other").attr({'transform': "matrix(1 0 0 1 381.3557 25.5818)", 'font-size':'9px'});
9838        $("#graph8_legend_Other_colour").attr({'cx':'366.9', 'cy':'22.7'});
9839        $("#graph8_legend_Trans").attr({'transform': "matrix(1 0 0 1 266.4529 25.5825)", 'font-size':'9px'});
9840        $("#graph8_legend_Trans_colour").attr({'cx':'254', 'cy':'22.7'});
9841    }
9842}
9843
9844function animate_graph8(window_top, window_bottom) {
9845    if ($("#graph8").length > 0) {
9846        var graph = $("#graph8");
9847        var graph_pos = graph.offset();
9848        var graph_height = graph.height();
9849
9850        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9851            // Start Animation
9852            graph.attr('class', 'animated');
9853
9854            var speed = 600;
9855            graph.find('#graph8_bar1').children('rect').each(function() {
9856                var id = $(this).attr('id');
9857                $(this).velocity({'height':values[graph.attr('id')][id]['height'], 'y':values[graph.attr('id')][id]['y']}, "ease-out", speed);
9858                if (id == 'graph8_bar1_1') {
9859                    $("#graph8_burst").delay((speed*1.3)).velocity({'opacity':1}, 250);
9860                }
9861            });
9862            graph.find('#graph8_bar2').children('rect').each(function() {
9863                var id = $(this).attr('id');
9864                $(this).delay((speed/2)).velocity({'height':values[graph.attr('id')][id]['height'], 'y':values[graph.attr('id')][id]['y']}, "ease-out", speed);
9865            });
9866        }
9867    }
9868}
9869
9870// Testing if this can be removed kc 4-16-21
9871/* Best of Breed Graph */
9872function animate_bobg(window_top, window_bottom) {
9873    if ($("#best-of-breed-graph-guide").length > 0) {
9874        var graph = $("#best-of-breed-graph-guide");
9875        var graph_pos = graph.offset();
9876        var graph_height = graph.height();
9877
9878        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9879            // Start Animation
9880            graph.attr('class', 'animated');
9881
9882            $("#best-of-breed-pie .anim").velocity({'stroke-dashoffset':'0%'}, {duration: 2000});
9883            $("#best-of-breed-graph-guide .best-of-breed-count").stop().countTo({speed: 1400, to: $("#best-of-breed-graph-guide .best-of-breed-count").attr('data-end')});
9884        }
9885    }
9886}
9887
9888/* Competitor Success Graph */
9889
9890function animate_csg(window_top, window_bottom) {
9891    if ($("#competitor-success-graph").length > 0) {
9892        var graph = $("#competitor-success-graph");
9893        var graph_pos = graph.offset();
9894        var graph_height = graph.height();
9895
9896        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9897            // Start Animation
9898            graph.attr('class', 'animated');
9899
9900            $("#competitor-success-pie .anim").velocity({'stroke-dashoffset':'0%'}, {duration: 2000});
9901            $("#competitor-success-graph .competitor-success-count").stop().countTo({speed: 1400, to: $("#competitor-success-graph .competitor-success-count").attr('data-end')});
9902        }
9903    }
9904}
9905
9906/* Email Effect Graph */
9907
9908function animate_eeg(window_top, window_bottom) {
9909    if ($("#email-effect-graph").length > 0) {
9910        var graph = $("#email-effect-graph");
9911        var graph_pos = graph.offset();
9912        var graph_height = graph.height();
9913
9914        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9915            // Start Animation
9916            graph.attr('class', 'animated');
9917
9918            $("#email-effect-pie .anim").velocity({'stroke-dashoffset':'0%'}, {duration: 2000});
9919            $("#email-effect-graph .email-effect-count").stop().countTo({speed: 1400, to: $("#email-effect-graph .email-effect-count").attr('data-end')});
9920        }
9921    }
9922}
9923
9924/* Stack Value Graph */
9925
9926function animate_svg(window_top, window_bottom) {
9927    if ($("#stack-value-graph").length > 0) {
9928        var graph = $("#stack-value-graph");
9929        var graph_pos = graph.offset();
9930        var graph_height = graph.height();
9931
9932        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9933            // Start Animation
9934            graph.attr('class', 'animated');
9935
9936            graph.find('.bar').each(function() {
9937                $(this).velocity({'width':$(this).data('width')}, {duration: 1000, delay:($(this).data('delay') * 500), complete: function() {
9938                    $(this).parent().find('.fade').velocity({'opacity':1}, {duration: 350});
9939                }});
9940            });
9941        }
9942    }
9943}
9944
9945/* Marketing Stats Graph */
9946
9947function animate_msg(window_top, window_bottom) {
9948    if ($("#marketing-stats-graph").length > 0) {
9949        var graph = $("#marketing-stats-graph");
9950        var graph_pos = graph.offset();
9951        var first_circ   = document.getElementById("marketing-stats-pie1");
9952        var circ = first_circ.getBoundingClientRect();
9953        //scroll_start_perc = 2;
9954
9955        if ( graph.attr('class') != 'animated' && (graph_pos.top + circ.height) < window_bottom ) {
9956            // Start Animation
9957            graph.attr('class', 'animated');
9958
9959            $(".marketing-stats-pie .anim").velocity({'stroke-dashoffset':'0%'}, {duration: 2000});
9960            $("#marketing-stats-graph .marketing-stats-count").each(function() {
9961                $(this).stop().countTo({speed: 1400, to: $(this).attr('data-end')});
9962            });
9963        }
9964    }
9965}
9966
9967/* Replace single vendor Graph */
9968
9969function animate_rsvg(window_top, window_bottom) {
9970    if ($("#replace-single-vendor-graph").length > 0) {
9971        var graph = $("#replace-single-vendor-graph");
9972        var graph_pos = graph.offset();
9973        var graph_height = graph.height();
9974
9975        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9976            // Start Animation
9977            graph.attr('class', 'animated');
9978
9979            $("#replace-single-vendor-pie .anim").velocity({'stroke-dashoffset':'0%'}, {duration: 2000});
9980            $("#replace-single-vendor-graph .replace-single-vendor-count").stop().countTo({speed: 1400, to: $("#replace-single-vendor-graph .replace-single-vendor-count").attr('data-end')});
9981        }
9982    }
9983}
9984
9985/* Marketing functions Graph */
9986
9987function animate_mfg(window_top, window_bottom) {
9988    if ($("#marketing-functions-graph").length > 0) {
9989        var graph = $("#marketing-functions-graph");
9990        var graph_pos = graph.offset();
9991        var graph_height = graph.height();
9992
9993        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
9994            // Start Animation
9995            graph.attr('class', 'animated');
9996
9997            //setTimeout(pulse, 250);
9998        }
9999
10000        function pulse() {
10001            $("#marketing-functions-graph .pulse").velocity({scale: 1.1}, {duration: 500}).velocity({scale: 1}, {duration: 500, complete: function() {
10002                setTimeout(pulse, 750);
10003            }});
10004        }
10005    }
10006}
10007
10008/* Marketing stack Graph */
10009
10010function animate_mskg(window_top, window_bottom) {
10011    if ($("#marketing-stack-graph").length > 0) {
10012        var graph = $("#marketing-stack-graph");
10013        var graph_pos = graph.offset();
10014        var graph_height = graph.height();
10015
10016        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
10017            // Start Animation
10018            graph.attr('class', 'animated');
10019
10020            graph.find(".email-bar").velocity({'height':graph.find(".email-bar").data('height'), 'y':graph.find(".email-bar").data('y')}, {duration: 1500, complete: function() {
10021                graph.find(".email-icon").velocity({'opacity':1}, {duration: 500});
10022            }});
10023        }
10024    }
10025}
10026
10027/* B2C vs B2B Graph */
10028
10029function animate_bcbb(window_top, window_bottom) {
10030    if ($("#b2c-vs-b2b-graph").length > 0) {
10031        var graph = $("#b2c-vs-b2b-graph");
10032        var graph_pos = graph.offset();
10033        var graph_height = graph.height();
10034
10035        if ( graph.attr('class') != 'animated' && (graph_pos.top + (graph_height / scroll_start_perc)) < window_bottom ) {
10036            // Start Animation
10037            graph.attr('class', 'animated');
10038
10039            $(".b2c-vs-b2b-pie .anim").velocity({'stroke-dashoffset':'0%'}, {duration: 2000});
10040            $("#b2c-vs-b2b-graph .b2c-vs-b2b-count").each(function() {
10041                $(this).stop().countTo({speed: 1400, to: $(this).attr('data-end')});
10042            });
10043        }
10044    }
10045}
10046
10047/* Survey Demographic Section */
10048if ($("#survey-demographics").length > 0) {
10049    var section = $("#survey-demographics");
10050    var tabs = section.find('.tabs');
10051    var blocks = section.children('.blocks');
10052
10053    tabs.children('.tab').click(function() {
10054        if (!$(this).hasClass('current')) {
10055            var block = $(this).data('tab');
10056
10057            tabs.children('.current').removeClass('current');
10058            $(this).addClass('current');
10059
10060            blocks.children('.current').removeClass('current');
10061            blocks.children('.block[data-block='+block+']').addClass('current');
10062        }
10063    });
10064
10065    section.find(".tab-wrap .dir").click(function() {
10066            var dir = $(this).data('dir');
10067            var curr_tab = section.find(".tab.current");
10068            var curr = curr_tab.data('tab');
10069            var next_tab, next;
10070
10071            if (dir == 'left') {
10072                next_tab = curr_tab.prev('.tab');
10073                if (next_tab.length == 0) next_tab = section.find(".tabs").children(".tab:last-child");
10074                next = next_tab.data('tab');
10075
10076                curr_tab.velocity({'opacity':'0'}
10076, {duration: 300, complete:function() {
10077                    curr_tab.removeClass('current').removeAttr('style');
10078                    blocks.children('.current').removeClass('current');
10079                }});
10080                next_tab.css({opacity:'0', display:'block'}).velocity({'opacity':'1'}, {duration: 300, complete:function() {
10081                    next_tab.addClass('current').removeAttr('style');
10082                    blocks.children('.block[data-block='+next+']').addClass('current');
10083                }});
10084
10085            } else if (dir == 'right') {
10086                next_tab = curr_tab.next('.tab');
10087                if (next_tab.length == 0) next_tab = section.find(".tabs").children(".tab:first-child");
10088                next = next_tab.data('tab');
10089
10090                curr_tab.velocity({'opacity':'0'}, {duration: 300, complete:function() {
10091                    curr_tab.removeClass('current').removeAttr('style');
10092                    blocks.children('.current').removeClass('current');
10093                }});
10094                next_tab.css({opacity:'0', display:'block'}).velocity({'opacity':'1'}, {duration: 300, complete:function() {
10095                    next_tab.addClass('current').removeAttr('style');
10096                    blocks.children('.block[data-block='+next+']').addClass('current');
10097                }});
10098            }
10099        });
10100}
10101
10102/* 25 content infographic */
10103if ($("#banner.contentinfographics").length > 0) {
10104    $(window).on('load', function(){
10105        $('.banner-graphics').addClass('animate');
10106    });
10107
10108    $(window).scroll(function() {
10109        $(".slide.inview").each(function() {
10110            var win = $(window);
10111            var slide = $(this);
10112            var winH = win.height();
10113            var winT = win.scrollTop();
10114            var winC = winT+(winH/2);
10115            var winB = winT+winH;
10116            var slideH = slide.height();
10117            var slideP = slide.offset();
10118            var slideT = slideP.top;
10119            var slideC = slideT+(slideH/2);
10120            var slideB = slideT+slideH;
10121            var startP = 0.5;
10122            var maxD = slideC - (slideC-(winH/2));
10123
10124            if (winC < slideC) {
10125                var currD = slideC - winC;
10126                if (currD >
10126 maxD) currD = maxD;
10127                var newP = (maxD/currD)-startP;
10128                if (newP > 1) newP = 1;
10129                if (newP < startP) newP = startP;
10130                if (slide.hasClass('out') && !slide.hasClass('animate')) slide.addClass('animate');
10131                slide.removeClass('out');//.children(".slide-contents").css({opacity:newP, transform: 'scale('+newP+')'});
10132            } else {
10133                var currD = winC - slideC;
10134                var newP = (maxD/currD)-startP;
10135                if (newP > 1) newP = 1;
10136                if (newP < startP) newP = startP;
10137                if (!slide.hasClass('out') && !slide.hasClass('animate')) slide.addClass('animate');
10138                slide.addClass('out');//.children(".slide-contents").css({opacity:newP, transform: 'scale('+newP+')'});
10139//                if (newP === startP) {
10140//                    var slideCont = slide.children(".slide-contents");
10141//                    var slideContP = slideCont.offset();
10142//                    var trans = winT-slideContP.top;
10143//                    slideCont.css({transform: 'scale('+newP+') translateY('+trans+'px)'});
10144//                }
10145            }
10146        });
10147    });
10148
10149    $(".slide").on("inview", function (event, visible) {
10150        if (visible === true) {
10151            $(this).addClass('inview');
10152        } else {
10153            $(this).removeClass('inview animate');
10154        }
10155    });
10156
10157}
10158
10159
10160/* Predictions 2018 banner */
10161if ($("#banner.predictions2018").length > 0) {
10162    $(window).scroll(function() {
10163        var top = $(this).scrollTop();
10164        var section_height = $("#banner").outerHeight();
10165
10166        /* Social hover */
10167        var section = $("#socials");
10168        if (top >= section_height && !section.hasClass('shown')) {
10169            section.addClass('shown').velocity('stop').velocity({opacity: 1}, 300);
10170        } else if (top < section_height && section.hasClass('shown')) {
10171            section.removeClass('shown').velocity('stop').velocity({opacity: 0}, 300);
10172        }
10173    });
10174
10175    function parallax(e, target, layer) {
10176        var layer_coeff = 10 / layer;
10177        var area = $('#banner'); //$(window);
10178        var x = (area.outerWidth() - target.offsetWidth) / 2 - (e.pageX - (area.outerWidth() / 2)) / layer_coeff;
10179        var y = (area.outerHeight() - (target.offsetHeight / 1.2)) / 2 - (e.pageY - (area.outerHeight() / 2)) / layer_coeff;
10180        $(target).offset({ top: y ,left : x });
10181    };
10182
10183    $('#banner').mousemove(function (e) {
10184        parallax(e, $(this).children('.bottom-layer')[0], 0.25);
10185        parallax(e, $(this).children('.left-layer')[0], 0.5);
10186        parallax(e, $(this).children('.right-layer')[0], 0.5);
10187        parallax(e, $(this).children('.top-layer')[0], 0.75);
10188        parallax(e, $(this).children('.bubbles')[0], 1);
10189    });
10190
10191    function init_figure5() {
10192        $("#figure-5").find(".bar").stop().css({height: 0, opacity: 0}).find(".bar-label").stop().css('opacity', 0);
10193    }
10194    function init_figure6() {
10195        $("#figure-6").find(".bar").each(function() {
10196            if (typeof($(this).data('height')) === 'undefined') {
10197                var height = $(this).css('height');
10198                $(this).data('height', height);
10199            }
10200            $(this).velocity('stop').css({height: 0, opacity: 0}).find(".bar-label").stop().css('opacity', 0);
10201        });
10202    }
10203    function init_fadein() {
10204        $(".prediction blockquote").each(function() {
10205            $(this).stop().css({top: "-10px", opacity: 0});
10206            if ($(this).children('.animflag').length == 0) {
10207                $(this).append("<div class='animflag'></div>");
10208            }
10209        });
10210    }
10211
10212    init_figure5();
10213    init_figure6();
10214    init_fadein();
10215
10216    $("#figure-5 .animflag").on('inview', function (event, visible) {
10217        if (visible === true) {
10218            var basic = $("#figure-5").find('.bar.basic');
10219            var advanced = $("#figure-5").find('.bar.advanced');
10220            basic.stop().animate({height: basic.data('height'), opacity: 1}, 500, function() {
10221                advanced.stop().animate({height: advanced.data('height'), opacity: 1}, 500, function() {
10222                    $("#figure-5").find(".bar-label").stop().animate({opacity: 1}, 500);
10223                });
10224            });
10225        } else {
10226            init_figure5();
10227        }
10228    });
10229
10230    $("#figure-6 .animflag").on('inview', function (event, visible) {
10231        if (visible === true) {
10232            $("#figure-6").find(".bar").each(function() {
10233                var index = $(this).index();
10234                $(this).velocity({height: $(this).data('height'), opacity: 1}, {duration: 500, delay: (200*index), complete: function() {
10235                    if ($(this).next().length == 0) {
10236                        $("#figure-6").find(".bar-label").stop().animate({opacity: 1}, 500);
10237                    }
10238                }});
10239            });
10240        } else {
10241            init_figure6();
10242        }
10243    });
10244
10245    $(".prediction blockquote .animflag").on('inview', function (event, visible) {
10246        if (visible === true) {
10247            $(this).parent().stop().animate({opacity: 1, top: 0}, 500);
10248        } else {
10249            init_fadein();
10250        }
10251    });
10252}
10253
10254/* New Guides */
10255if ($('body.new-guides').length > 0){
10256    $(document).ready(function() {
10257        if ($("#new_guides_form").length > 0) {
10258            var mkto_form = $("#new_guides_form");
10259            var form_id = mkto_form.data('id');
10260            mkto_form.cmMktoForm({
10261                form_id: form_id,
10262                onSuccess: function(v,u,mkto_form) {
10263                    $("#new_guides_form").fadeOut(600, function(){
10264                        $("#thankyou").css('display', 'block');
10265                    });
10266                }
10267            });
10268        }
10269    });
10270}
10271
10272/* WEBINARS */
10273
10274if ($('body.webinar').length > 0 || $('body.webinar-video').length > 0) {
10275
10276    $(document).ready(function() {
10277
10278        if ($("#registerform").length > 0) {
10279
10280            var country = get_cookie("CM-location-set");
10281            if (country === null) country = "unitedstates";
10282            $("#content .date."+country).show();
10283
10284            var mkto_form = $("form.mktoForm.webinarform");
10285            var form_id = mkto_form.data('id');
10286            if (typeof(mkto_form.data('dev-id')) !== 'undefined') {
10287                form_id = {prod:mkto_form.data('id'), dev:mkto_form.data('dev-id')}
10288            }
10289            //console.log(form_id);
10290            mkto_form.cmMktoForm({
10291                form_id: form_id,
10292                labels: mkto_form.data('layout'),
10293                onRender: function(form) {
10294                    if (mkto_form.data('type') == 'ondemand') {
10295                        form.find(".mktoButton").text('View the Webinar');
10296                    } else {
10297                        form.find(".mktoButton").text('Register now');
10298                    }
10299                },
10300                onSuccess: function(v,u,mkto_form) {
10301                    $("footer").fadeOut(600);
10302                    $("#registerform").fadeOut(600, function(){
10303                        var uid_url = $(".addeventatc span.location").text();
10304                        var desc = $(".addeventatc span.description").text();
10305                        desc = desc.replace('{UID_LINK}', uid_url);
10306                        $(".addeventatc span.description").text(desc);
10307                        $.getScript("https://addevent.com/libs/atc/1.6.1/at
10307c.min.js", function(){
10308                            window.addeventasync = function(){
10309                                addeventatc.settings({
10310                                    license     : "aoWtlhszAzhUztWfdmNP15927",
10311                                    css         : false,
10312                                    outlook     : {show:true, text:"Outlook"},
10313                                    google      : {show:true, text:"Google"},
10314                                    yahoo       : {show:false, text:"Yahoo"},
10315                                    outlookcom  : {show:false, text:"Outlook.com"},
10316                                    office365  :  {show:false, text:"Office 365 <em>(online)</em>"},
10317                                    appleical   : {show:true, text:"Apple"},
10318                                    facebook    : {show:false, text:"Facebook"}
10319                                });
10320                            };
10321                        });
10322
10323                        $(window).scrollTop(0);
10324                        $("footer").fadeIn(600);
10325                        if (mkto_form.data('type') == 'ondemand') {
10326                            window.location = uid_url;
10327                        } else {
10328                            $("#thankyou").fadeIn(600);
10329                        }
10330                    });
10331                }
10332            });
10333        }
10334
10335        // Handle live demo iframe ratio
10336        if ($("#livewebinar iframe").length > 0) {
10337            var vs = $("#livewebinar iframe");
10338            var cont = $("#iframe-controller");
10339            var video = vs[0].outerHTML;
10340            vs.data('aspectRatio-height', 405 / 720).data('aspectRatio-width', 720 / 405);
10341
10342            $(window).resize(function() {
10343                video_size();
10344            }).resize();
10345
10346            function video_size() {
10347                var newWidth = cont.width();
10348                var winHeight = cont.height();
10349
10350                var vidHeight = newWidth * vs.data('aspectRatio-height');
10351                var vidWidth = newWidth;
10352                if (winHeight < vidHeight) {
10353                    vidWidth = winHeight * vs.data('aspectRatio-width');
10354                    vidHeight = winHeight;
10355                }
10356                vs.width(vidWidth).height(vidHeight);
10357            }
10358
10359            $("#webinar-footer .transcript").click(function() {
10360                vs.remove();
10361                $(".habla_window_div_base").hide();
10362                $("#transcript").animate({top: 0}, 300);
10363            });
10364
10365            $("#transcript .close-transcript").click(function() {
10366                cont.append(video);
10367                $(".habla_window_div_base").show();
10368                $("#transcript").animate({top: '100%'}, 300);
10369            });
10370        }
10371    });
10372
10373    var flag_func = setInterval(flag, 10000);
10374
10375    var forms_url = "/forms/";
10376    if (window.location.href.indexOf('campmon.com') >= 0) {
10377        forms_url = "/marketing/blog-admin/marketing-includes/forms/";
10378    } else if (window.location.href.indexOf('cm-marketing-blog.com') >= 0) {
10379        forms_url = "/marketing-includes/forms/";
10380    }
10381
10382    function flag() {
10383        var d = new Date();
10384        var php_ts = d.getTime() / 1000;
10385        //console.log(php_ts);
10386        if ($("#livewebinar").data('time') < php_ts) {
10387            //console.log("Time AFTER webinar");
10388            clearInterval(flag_func);
10389            var fields = {};
10390            fields['mkto_program_id'] = $("#livewebinar").data('pid');
10391            if (typeof(fields['mkto_program_id']) !== "undefined" && fields['mkto_program_id'] !== "") {
10392                $.post(forms_url+"marketo/webinars/", fields, function(response) {
10393                    if (!response) {
10394                        // Error
10395                        //console.log("error");
10396                        return false;
10397                    } else {
10398                        // Success
10399                        //console.log("success");
10400                        return true;
10401                    }
10402                });
10403            }
10404
10405        } else {
10406            //console.log("Time BEFORE webinar");
10407        }
10408    }
10409
10410    function setError(field) {
10411        if ($("[name="+field+"]").length > 0) {
10412            $("[name="+field+"]").next('.error_field').remove();
10413            $("[name="+field+"]").addClass('error').after("<span class='error_field'>"+messages[field]+"</span>");
10414            $("[name="+field+"]").focus(function() {
10415                $(this).removeClass('error').next('.error_field').fadeOut(300, function() {
10416                    $(this).remove();
10417                });
10418            });
10419        }
10420    }
10421
10422    function getQuerystringParameterByName(name) {
10423            var match = RegExp('[?&]' + name + '=([^&]*)')
10424                                            .exec(window.location.search);
10425            return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
10426    }
10427}
10428
10429/* TRAINING VIDEOS */
10430if ($('body.training-video').length > 0) {
10431    // Open and close menu accordion
10432    $(".series-menu .group .arrow, .series-menu .group .parent").click(function() {
10433        var group = $(this).parent();
10434        if (group.hasClass("open")) {
10435            // Is open, close it
10436            group.removeClass('open');
10437        } else {
10438            // Is close, open it
10439            group.parent().children('.group').removeClass("open");
10440            group.addClass('open');
10441        }
10442    });
10443
10444    // Active marker for tabs
10445    // Init
10446    var sections = $(".sections.content");
10447    var tabs = sections.children(".tabs");
10448    var active_tab = tabs.children(".tab.active");
10449    tabs.next('.bar').children(".active").css({width: Math.ceil(active_tab.outerWidth())});
10450
10451    tabs.children(".tab").click(function() {
10452        if (!$(this).hasClass('active')) {
10453            var new_section = $(this).data('section');
10454            var curr_section = $(this).parent().children(".tab.active").data("section");
10455
10456            sections.children('.section[data-section='+curr_section+']').slide
10456Up(300, function() {
10457                $(this).removeClass('active');
10458            });
10459            tabs.children('.tab[data-section='+curr_section+']').removeClass('active');
10460
10461            sections.children('.section[data-section='+new_section+']').slideDown(300, function() {
10462                $(this).addClass('active');
10463            });
10464            var new_tab = tabs.children('.tab[data-section='+new_section+']');
10465            new_tab.addClass('active');
10466            var tab_pos = parseInt(new_tab.position().left - parseInt(tabs.css('padding-left')));
10467
10468            tabs.next('.bar').children(".active").css({width: Math.ceil(new_tab.outerWidth()), 'margin-left': Math.ceil(tab_pos)});
10469        }
10470    });
10471
10472    // GATED
10473    if ($("#gatedForm").length > 0) {
10474
10475        var mkto_form = $("form.mktoForm.webinarform");
10476        var form_id = mkto_form.data('id');
10477        if (typeof(mkto_form.data('dev-id')) !== 'undefined') {
10478            form_id = {prod:mkto_form.data('id'), dev:mkto_form.data('dev-id')}
10479        }
10480        mkto_form.cmMktoForm({
10481            form_id: form_id,
10482            labels: mkto_form.data('layout'),
10483            onRender: function(form) {
10484                if (mkto_form.data('type') == 'ondemand') {
10485                    form.find(".mktoButton").text('View the Webinar');
10486                } else if(mkto_form.data('type') == 'gated') {
10487                    form.find(".mktoButton").text('Watch the replay');
10488                } else {
10489                    form.find(".mktoButton").text('Register now');
10490                }
10491            },
10492            onSuccess: function(v,u,mkto_form) {
10493                $("#content").fadeOut(200, 'swing', $("#training, #subscribe, #signup, #grid-related").fadeIn(800));
10494            }
10495        });
10496    }
10497    if ($("#gatedFormGuides").length > 0) {
10498        $(document).ready(function() {
10499            if ($("#gatedFormGuides").length > 0) {
10500                var mkto_form = $("#gatedFormGuides form");
10501                var form_id = mkto_form.data('id');
10502                
10503                mkto_form.cmMktoForm({
10504                    form_id: form_id,
10505                    labels: mkto_form.data('layout'),
10506                    onSuccess: function(v,u,mkto_form) {
10507                        $("#gatedFormGuides form").fadeOut(600, function(){
10508                            $("#thankyou").css('display', 'block');
10509                        });
10510                    }
10511                });
10512            }
10513        });
10514    }
10515
10516}
10517
10518
10519// Check screen width vs amount of slides and show/hide carousel controls
10520function toggleControls(glideInstance, item) {
10521  var breakpoints = [1200, 800, 600];
10522  var slides = $(item).find('.glide__slide');
10523
10524  if (window.innerWidth >= breakpoints[0]) {
10525    if (slides.length > glideInstance['_o'].perView) {
10526      item.classList.add('controls');
10527    } else {
10528      item.classList.remove('controls');
10529    }
10530  } else if (window.innerWidth >= breakpoints[1] && window.innerWidth < breakpoints[0]) {
10531    if (slides.length > glideInstance['_o'].breakpoints['1200'].perView) {
10532      item.classList.add('controls');
10533    } else {
10534      item.classList.remove('controls');
10535    }
10536  } else if (window.innerWidth >= breakpoints[2] && window.innerWidth < breakpoints[1]) {
10537    if (slides.length > glideInstance['_o'].breakpoints['800'].perView) {
10538      item.classList.add('controls');
10539    } else {
10540      item.classList.remove('controls');
10541    }
10542  } else if (window.innerWidth < breakpoints[2]) {
10543    item.classList.remove('controls');
10544  }
10545}
10546
10547
10548function mountGlide(sliders) {
10549  for (var i = 0; i < sliders.length; i++) {
10550    var glide = new Glide(sliders[i], {
10551      gap: 15,
10552      perView: 4,
10553      peek: {
10554        before: 0,
10555        after: 50
10556      },
10557      breakpoints: {
10558        1200: {
10559          perView: 3
10560        },
10561        800: {
10562          perView: 2
10563        },
10564        600: {
10565          perView: 1
10566        }
10567      }
10568    });
10569    
10570    toggleControls(glide, sliders[i]);
10571  
10572    glide.mount();
10573  }
10574
10575  window.addEventListener('resize', () => {
10576
10577    for (var i = 0; i < sliders.length; i++) {
10578      toggleControls(glide, sliders[i]);
10579    }
10580  }, true)
10581}
10582
10583var sliders = document.querySelectorAll('.glide');
10584mountGlide(sliders);
10585
10586
10587// Events
10588
10589
10590class EventAccordion {
10591    constructor(){
10592        this.accordions = jQuery('.event-accordion .event-accordion__title')
10593        this.events()
10594    }
10595
10596    events(){
10597        this.accordions.on('click', function(e){
10598            e.preventDefault()
10599            jQuery(this).attr('aria-expanded', (_, attr) => attr == "true" ? "false" : "true")
10600            jQuery(this).toggleClass('active')
10601            jQuery(this).next('.event-accordion__details').slideToggle()    
10602        })
10603
10604        this.accordions.on('keydown', function(e){
10605            if((e.key === " " || e.key === "Enter" || e.key === "Spacebar")){
10606                e.preventDefault()
10607                jQuery(this).attr('aria-expanded', (_, attr) => attr == "true" ? "false" : "true")
10608                jQuery(this).toggleClass('active')
10609                jQuery(this).next('.event-accordion__details').slideToggle()    
10610            }
10611        })
10612    }
10613}
10614
10615class TranscriptButton {
10616    constructor(){
10617        this.transcriptButtons = jQuery(".transcript-button")
10618        this.events()
10619    }
10620
10621    events(){
10622        this.transcriptButtons.on('click', function(e){
10623            e.preventDefault()
10624            jQuery(this).attr('aria-expanded', (_, attr) => attr == "true" ? "false" : "true")
10625            jQuery(this).toggleClass('active')
10626            jQuery(this).closest('.video-card').find('.video-card__transcript').slideToggle()
10627        })
10628        this.transcriptButtons.on('keydown', function(e){
10629            if((e.key === " " || e.key === "Enter" || e.key === "Spacebar")){
10630                e.preventDefault()
10631                jQuery(this).attr('aria-expanded', (_, attr) => attr == "true" ? "false" : "true")
10632                jQuery(this).toggleClass('active')
10633                jQuery(this).closest('.video-card').find('.video-card__transcript').slideToggle()
10634            }
10635        })
10636    }
10637}
10638
10639
10640if ($('body.event').length > 0) {
10641
10642    $(document).ready(function() {
10643
10644        if($(".transcript-button").length > 0){
10645            new TranscriptButton()
10646        }
10647
10648        if (document.querySelector('.event-accordion')){
10649            new EventAccordion()
10650        }
10651
10652        if ($("#registerform").length > 0) {
10653
10654            var country = get_cookie("CM-location-set");
10655            if (country === null) country = "unitedstates";
10656            $("#content .date."+country).show();
10657
10658            var mkto_form = $("form.mktoForm.webinarform");
10659            var form_id = mkto_form.data('id');
10660            if (typeof(mkto_form.data('dev-id')) !== 'undefined') {
10661                form_id = {prod:mkto_form.data('id'), dev:mkto_form.data('dev-id')}
10662            }
10663            //console.log(form_id);
10664            mkto_form.cmMktoForm({
10665                form_id: form_id,
10666                labels: mkto_form.data('layout'),
10667                onRender: function(form) {       
10668                        form.find(".mktoButton").text('Register now');
10669                },
10670                onSuccess: function(v,u,mkto_form) {
10671                    $("footer").fadeOut(600);
10672                    $("#registerform").fadeOut(600, function(){
10673                        var uid_url = $(".addeventatc span.location").text();
10674                        var desc = $(".addeventatc span.description").text();
10675                        desc = desc.replace('{UID_LINK}', uid_url);
10676                        $(".addeventatc span.description").text(desc);
10677                        $.getScript("https://addevent.com/libs/atc/1.6.1/atc.min.js", function(){
10678                            window.addeventasync = function(){
10679                                addeventatc.settings({
10680                                    license     : "aoWtlhszAzhUztWfdmNP15927",
10681                                    css         : false,
10682                                    outlook     : {show:true, text:"Outlook"},
10683                                    google      : {show:true, text:"Google"},
10684                                    yahoo       : {show:false, text:"Yahoo"},
10685                                    outlookcom  : {show:false, text:"Outlook.com"},
10686                                    office365  :  {show:false, text:"Office 365 <em>(online)</em>"},
10687                                    appleical   : {show:true, text:"Apple"},
10688                                    facebook    : {show:false, text:"Facebook"}
10689                                });
10690                            };
10691                        });
10692
10693                        $(window).scrollTop(0);
10694                        $("footer").fadeIn(600);
10695                        $("#thankyou").fadeIn(600);     
10696                    });
10697                }
10698            });
10699        }
10700
10701        
10702    });
10703
10704    function setError(field) {
10705        if ($("[name="+field+"]").length > 0) {
10706            $("[name="+field+"]").next('.error_field').remove();
10707            $("[name="+field+"]").addClass('error').after("<span class='error_field'>"+messages[field]+"</span>");
10708            $("[name="+field+"]").focus(function() {
10709                $(this).removeClass('error').next('.error_field').fadeOut(300, function() {
10710                    $(this).remove();
10711                });
10712            });
10713        }
10714    }
10715
10716    function getQuerystringParameterByName(name) {
10717            var match = RegExp('[?&]' + name + '=([^&]*)')
10718                                            .exec(window.location.search);
10719            return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
10720    }
10721}
10722
10723
10724// AJAX FOR UPDATED RESOURCES PAGE
10725
10726class AjaxResources {
10727    constructor(){
10728        this.loadMoreButton = document.getElementById("ajax-load-more-button")
10729        this.postGrid = document.querySelector(".cm-resource-grid")
10730        this.renderTarget = this.postGrid.querySelector('.inner')
10731        this.filterButtons = document.querySelectorAll("#resource-topics-filter input")
10732        // get the initial load post count to make sure only 6 are loaded when JS is enabled
10733        this.initialPosts = this.renderTarget.querySelectorAll('.cm-resource-tile').length
10734
10735        this.postType = this.postGrid.dataset.type
10736        this.query = this.postGrid.dataset.query
10737        this.filters = []
10738
10739        this.firstLoad = true // on first load 12 posts are present, but ajax pagination works in 6 post increments
10740        this.pendingRequests = [] // array to hold pending requests in case user clicks a bunch of checkboxes quickly
10741        this.events()
10742        this.toggleLoadMoreButton()
10743    }
10744
10745    events(){
10746
10747        // DEPRECATED Remove pagination element - this can be activated if needed for SEO
10748        // document.getElementById('pagination-container').setAttribute("style", "display: none;")
10749
10750        this.loadMoreButton.addEventListener('click', function(e){
10751            e.preventDefault()
10752            this.handleLoadMore()
10753        }.bind(this))
10754        this.loadMoreButton.addEventListener('keydown', function(e){
10755            if((e.key === " " || e.key === "Enter" || e.key === "Spacebar")){
10756                e.preventDefault()
10757                this.handleLoadMore()
10758            }
10759        }.bind(this))
10760
10761        this.filterButtons.forEach(checkBox => {
10762            checkBox.addEventListener('change', e => {
10763                this.handleFilterChange(e)
10764            })
10765        })
10766    }
10767
10768    calculatePagination(){
10769        let json = JSON.parse(this.query)
10770        let postsPerPage =  parseInt(json['posts_per_page'])
10771        let page = parseInt(this.postGrid.dataset.page)
10772
10773        // figure out what page we are on, then adjust by the initial post count to allow for a different number of posts on intial load
10774        let numOfPosts = postsPerPage * (page - 1) + this.initialPosts
10775
10776        return Math.ceil(numOfPosts / 6)
10777        
10778    }
10779
10780    async fetchData(formData){
10781        const res = await fetch('/wp-admin/admin-ajax.php', {
10782            method: 'POST',
10783            body: formData
10784        })
10785        const json = await res.json()
10786        return json.data
10787    }
10788
10789    async handleFilterChange(e) {
10790        this.renderTarget.innerHTML = `<div class="resources-ajax-loader"><div class="loader" aria-label="Loading..."></div></div>`
10791        this.loadMoreButton.setAttribute("style", "display: none;")
10792        this.pendingRequests.push(true)
10793
10794        this.firstLoad = false
10795
10796        var value = e.target.value
10797        var checked = e.target.checked
10798        if(checked === true){
10799            this.filters.push(value)
10800        } else {  
10801            this.filters = this.filters.filter(item => item !== value)  
10802        }
10803
10804        var formData = new FormData();
10805        formData.append( 'action', 'resource_filters_load' );
10806        formData.append('base_query', this.query);
10807        formData.append('post_type', this.postType);
10808
10809        if(this.filters.length > 0){
10810            formData.append('topics', this.filters);
10811        }
10812
10813        const data = await this.fetchData(formData)
10814
10815        this.pendingRequests.pop()
10816
10817        if(this.pendingRequests.length === 0){
10818            this.renderTarget.innerHTML = data.html
10819            this.postGrid.dataset.max = data.max
10820            this.postGrid.dataset.page = 1
10821    
10822            this.toggleLoadMoreButton()  
10823        }
10824    }
10825
10826
10827    async handleLoadMore(){
10828        let currentPage = parseInt(this.postGrid.dataset.page)
10829
10830        // if it is the first time we need to check how many posts are loaded currently
10831        if(this.firstLoad === true) {
10832            currentPage = this.calculatePagination()
10833            this.firstLoad = false
10834        }
10835
10836        var formData = new FormData();
10837
10838        formData.append( 'action', 'load_resources_posts' );
10839        formData.append('current_page', currentPage);
10840        formData.append('post_type', this.postType);
10841        formData.append('base_query', this.query);
10842
10843
10844        if(this.filters.length > 0){
10845            formData.append('topics', this.filters);
10846        }
10847
10848        this.loadMoreButton.setAttribute('disabled', true)
10849        this.loadMoreButton.innerText = 'Loading...'
10850
10851        const data = await this.fetchData(formData)
10852
10853        this.renderTarget.insertAdjacentHTML("beforeend",data.html)
10854        this.postGrid.dataset.page = data.page
10855        this.postGrid.dataset.max = data.max
10856        this.loadMoreButton.removeAttribute('disabled')
10857        this.loadMoreButton.innerText = 'Load more'
10858        this.toggleLoadMoreButton()
10859  
10860
10861
10862    }
10863
10864    toggleLoadMoreButton(){
10865        if(parseInt(this.postGrid.dataset.page) >= parseInt(this.postGrid.dataset.max)){
10866            this.loadMoreButton.setAttribute("style", "display: none;")
10867        } else {
10868            this.loadMoreButton.setAttribute("style", "display: block;")
10869        }
10870    }
10871}
10872
10873class TopicsFilterDropdown {
10874    constructor(){
10875        this.dropdown = jQuery('.topics-filter-dropdown .topics-filter-dropdown__title')
10876        this.topicsContainer = jQuery('.topics-filter-dropdown')
10877        this.events()
10878    }
10879
10880    events(){
10881        document.addEventListener('click', function(e){
10882            if(!this.topicsContainer.is(e.target)
10883            && this.topicsContainer.has(e.target).length === 0
10884            && this.dropdown.hasClass('active')){
10885                
10886                this.dropdown.attr('aria-expanded', "false")
10887                this.dropdown.removeClass('active')
10888                this.dropdown.next('.topics-filter-dropdown__form').slideUp()    
10889            }
10890        }.bind(this))
10891
10892        this.dropdown.on('click', function(e){
10893            e.preventDefault()
10894            jQuery(this).attr('aria-expanded', (_, attr) => attr == "true" ? "false" : "true")
10895            jQuery(this).toggleClass('active')
10896            jQuery(this).next('.topics-filter-dropdown__form').slideToggle()    
10897        })
10898
10899        this.dropdown.on('keydown', function(e){
10900            if((e.key === " " || e.key === "Enter" || e.key === "Spacebar")){
10901                e.preventDefault()
10902                jQuery(this).attr('aria-expanded', (_, attr) => attr == "true" ? "false" : "true")
10903                jQuery(this).toggleClass('active')
10904                jQuery(this).next('.topics-filter-dropdown__form').slideToggle()    
10905            }
10906        })
10907    }
10908}
10909
10910
10911class StickyNavDropdown {
10912    constructor(){
10913        this.dropdown = jQuery('#resource-types-sticky-nav .resource-types-nav__mobile-toggle')
10914        this.events()
10915    }
10916
10917    events(){
10918        this.dropdown.on('click', function(e){
10919            e.preventDefault()
10920            jQuery(this).attr('aria-expanded', (_, attr) => attr == "true" ? "false" : "true")
10921            jQuery(this).toggleClass('active')
10922            jQuery('.resource-types-nav__container').slideToggle()    
10923        })
10924
10925        this.dropdown.on('keydown', function(e){
10926            if((e.key === " " || e.key === "Enter" || e.key === "Spacebar")){
10927                e.preventDefault()
10928                jQuery(this).attr('aria-expanded', (_, attr) => attr == "true" ? "false" : "true")
10929                jQuery(this).toggleClass('active')
10930                jQuery('.resource-types-nav__container').slideToggle()    
10931            }
10932        })
10933
10934        jQuery(window).on('resize', function(e){
10935            if(window.innerWidth < 600){
10936                jQuery('.resource-types-nav__container').hide()
10937                this.dropdown.removeClass('active')
10938                jQuery(this).attr('aria-expanded', "false")
10939
10940            } else {
10941                jQuery('.resource-types-nav__container').show()
10942            }
10943        }.bind(this))
10944    }
10945}
10946
10947
10948
10949// Sticky nav banner
10950
10951if ($('#resource-types-sticky-nav').length > 0) {
10952    window.addEventListener('scroll', function () {
10953      var distToTop = window.pageYOffset
10954      var navigation = document.querySelector('header')
10955      var navigationHeight = navigation.offsetHeight
10956      var stickyNav = document.querySelector('#resource-types-sticky-nav')
10957      var subcribeHeight = stickyNav.getBoundingClientRect().height
10958      var threshhold = document.querySelector('#resource-types-sticky-nav-spacer')
10959      var bannerOffset = window.pageYOffset + threshhold.getBoundingClientRect().top
10960    
10961      // Check to see if user has scrolled to element
10962      if (distToTop + navigationHeight >= bannerOffset) {
10963        threshhold.setAttribute('style', `height: ${subcribeHeight}px;`)
10964        stickyNav.classList.add('stick')
10965        stickyNav.style.top = navigation.offsetHeight + 'px'
10966      } else {
10967        threshhold.removeAttribute('style')
10968        stickyNav.classList.remove('stick')
10969        stickyNav.style.top = ''
10970      }
10971    })
10972}
10973    
10974
10975$(document).ready(function() {
10976
10977    if(document.getElementById("ajax-load-more-button")){
10978        new AjaxResources();
10979    }
10980    if(document.querySelector(".topics-filter-dropdown")){
10981        new TopicsFilterDropdown()
10982    }
10983    if(document.querySelector("#resource-types-sticky-nav")){
10984        new StickyNavDropdown()
10985    }
10986})
10987
10988/**
10989 * Comparison pages
10990 */
10991
10992function ComparisonSections() {
10993    this.stickyNav = () => {
10994        var navLinks = document.querySelectorAll('#menuNav .menu__item a');
10995        var underline = document.querySelector('.menu__underline');
10996        
10997        window.addEventListener('scroll', () => {
10998            this.navScrollPos(navLinks, underline);
10999        });
11000        
11001        this.navState(navLinks, underline);
11002    }
11003    
11004    this.navScrollPos = (navLinks, underline) => {
11005        var hero = document.getElementById('hero');
11006        var topF = document.getElementById('topFeatures').getBoundingClientRect().top;
11007        var navbar = document.getElementById('menuNav');
11008        var headerHeight = document.querySelector('header').clientHeight;
11009        var scrollPos = window.scrollY;
11010
11011        if (topF - navbar.clientHeight - headerHeight <= 0) {
11012            navbar.classList.add('sticky');
11013            hero.classList.add('offset');
11014            navbar.style.top = headerHeight + 'px';
11015            hero.style.paddingBottom = headerHeight + navbar.clientHeight + 'px';
11016        } else {
11017            navbar.classList.remove('sticky');
11018            hero.classList.remove('offset');
11019            navbar.style.top = 'unset';
11020            hero.style.paddingBottom = '8em';
11021        }
11022    
11023        navLinks.forEach((link) => {
11024            var section = document.querySelector(link.hash);
11025        
11026            if (section.offsetTop - 135 <= scrollPos && section.offsetTop + section.offsetHeight - 135 > scrollPos) {
11027                link.classList.add('active');
11028            } else {
11029                link.classList.remove('active');
11030            }
11031        });
11032    
11033        if(document.querySelectorAll('#menuNav .menu__item a.active').length > 0) {
11034            var activeLink = document.querySelector('#menuNav .menu__item a.active');
11035
11036            underline.style.width = activeLink.clientWidth + 32 + 'px';
11037            underline.style.left = activeLink.offsetLeft - 16 + 'px';
11038            underline.style.opacity = 1;
11039        } else {
11040            underline.style.opacity = 0;
11041        }
11042    }
11043
11044    this.navState = (navLinks, underline) => {
11045        navLinks.forEach(link => {
11046            link.addEventListener('mouseenter', (e) => {
11047                var activeLink = e.target;
11048                if (!activeLink.classList.contains('active')) {
11049                    activeLink.classList.add('active')
11050                    
11051                    underline.style.width = activeLink.clientWidth + 32 + 'px';
11052                    underline.style.left = activeLink.offsetLeft - 16 + 'px';
11053                    underline.style.opacity = 1;
11054                } 
11055            });
11056            link.addEventListener('mouseleave', (e) => {
11057                var activeLink = e.target;
11058                if (activeLink.classList.contains('active')) {    
11059                    activeLink.classList.remove('active')
11060                    underline.style.opacity = 0;
11061                } 
11062                this.navScrollPos(navLinks, underline);
11063            })
11064        });
11065    }
11066
11067    this.socialProof = () => {
11068        var tabs = document.querySelectorAll('.customer-header__logo');
11069        var slides = document.querySelectorAll('.customer');
11070        var initialSlide = document.querySelector('.customer.active');
11071
11072        this.getActiveSlideHeight(initialSlide);
11073        
11074        window.addEventListener('resize', () => {
11075            this.getActiveSlideHeight(initialSlide);
11076        })
11077        window.addEventListener('load', () => {
11078            this.getActiveSlideHeight(initialSlide);
11079        })
11080        
11081        tabs.forEach((tab) => {
11082            tab.addEventListener('click', (e) => {
11083                if(!tab.classList.contains('active')) {
11084                    
11085                    tabs.forEach(element => {
11086                        element.classList.remove('active');
11087                    });
11088                    slides.forEach(element => {
11089                        element.classList.remove('active');
11090                    });
11091                    
11092                    var currentTab = tab.dataset.tab;
11093                    currentTab = currentTab - 1;
11094                    tab.classList.add('active')
11095                    slides[currentTab].classList.add('active');
11096                    this.getActiveSlideHeight(slides[currentTab])
11097                }
11098            });
11099        });
11100    }
11101
11102    this.featuresChart = () => {
11103        var chartHeaders = document.querySelectorAll('.headers');
11104        var chart = document.querySelector('.chart');
11105        
11106        window.addEventListener('scroll', (e) => {
11107            var chartPos = chart.getBoundingClientRect().top;
11108            var headerHeight = document.querySelector('header').clientHeight;
11109            var menuNavHeight = document.getElementById('menuNav').clientHeight;
11110            var chartHeadersHeight = chartHeaders[0].clientHeight;
11111            var chartHeadersWidth = chartHeaders[0].clientWidth;
11112            var chartHeadersBottom = chartPos + chart.clientHeight - headerHeight - menuNavHeight - chartHeadersHeight - 20;
11113        
11114            if (chartPos - headerHeight - menuNavHeight < 0 && chartHeadersBottom >= 0) {
11115                chartHeaders.forEach(element => {
11116                    element.classList.add('sticky');
11117                    element.classList.remove('stuck');
11118                    element.style.top = headerHeight + menuNavHeight + 20 + 'px';
11119                    element.style.height = chartHeadersHeight + 'px';
11120                    element.style.width = chartHeadersWidth + 'px';
11121                    document.querySelectorAll('.chart__feature')[0].style.height = chartHeadersHeight + 40 + 'px';
11122                });
11123            } else if(chartPos - headerHeight - menuNavHeight - 16 < 0 && chartHeadersBottom < 0) {
11124                chartHeaders.forEach(element => {
11125                    element.classList.remove('sticky');
11126                    element.classList.add('stuck');
11127                    element.style.top = '';
11128                    element.style.height = chartHeadersHeight + 'px';
11129                    element.style.width = chartHeadersWidth + 'px';
11130                    document.querySelectorAll('.chart__feature')[0].style.height = chartHeadersHeight + 40 + 'px';
11131                });
11132            } else {
11133                chartHeaders.forEach(element => {
11134                    element.classList.remove('sticky');
11135                    element.classList.remove('stuck');
11136                    element.style.top = 'unset';
11137                    element.style.height = '100%';
11138                    element.style.width = '100%';
11139                    document.querySelectorAll('.chart__feature')[0].style.height = '';
11140                });
11141            }
11142        });
11143    }
11144
11145    this.accordions = () => {
11146        var accordions = document.querySelectorAll('.faq__item__button')
11147        accordions.forEach(item => {
11148            item.addEventListener('click', (e) => {
11149                item.classList.toggle('active')
11150                var panel = item.nextElementSibling;
11151                if (panel.style.maxHeight) {
11152                  panel.style.maxHeight = null;
11153                } else {
11154                  panel.style.maxHeight = panel.scrollHeight + "px";
11155                }
11156            })
11157        });
11158    }
11159
11160    this.getActiveSlideHeight = (activeSlide) => {
11161        document.querySelector('.customer-container').style.height = activeSlide.clientHeight + 'px';
11162    }
11163}
11164
11165var comparisonPage = new ComparisonSections();
11166
11167if(document.querySelector('body.comparisons-2022') !== null) {
11168    comparisonPage.stickyNav();
11169    comparisonPage.socialProof();
11170    comparisonPage.featuresChart();
11171    comparisonPage.accordions();
11172}
11173// FOR MIXPANEL
11174
11175function waitUntilLoad(func) {
11176	if (mixpanel.__loaded) func();
11177	else
11178		setTimeout(function () {
11179			waitUntilLoad(func);
11180		}, 10);
11181}
11182
11183function listAdd(property, value) {
11184	waitUntilLoad(function () {
11185		listAddLogic(property, value);
11186	});
11187}
11188
11189function campaignParams() {
11190	waitUntilLoad(function () {
11191		campaignParamsLogic();
11192	});
11193}
11194
11195function addIfUnique(list, value) {
11196	if (list.indexOf(value) == -1) list.push(value);
11197	return list;
11198}
11199
11200function listAddLogic(property, value) {
11201	var obj = {};
11202	obj[property] = [];
11203	mixpanel.register_once(obj); //create an empty list property if it doesn't exist yet
11204	mixpanel.people.union(property, value);
11205	mixpanel.register(
11206		property,
11207		addIfUnique(mixpanel.get_property(property), value)
11208	);
11209}
11210
11211function campaignParamsLogic() {
11212	var campaign_keywords = [
11213		'utm_source',
11214		'utm_medium',
11215		'utm_campaign',
11216		'utm_content',
11217		'utm_term',
11218	];
11219
11220	var kw = '';
11221	var params = {};
11222
11223	for (var i = 0; i < campaign_keywords.length; i++) {
11224		kw = getQueryParam(document.URL, campaign_keywords[i]);
11225		if (kw.length) {
11226			params[campaign_keywords[i] + ' [most recent]'] = kw;
11227			listAdd(campaign_keywords[i] + ' [list]', kw);
11228		}
11229	}
11230
11231	mixpanel.register(params);
11232	mixpanel.people.set(params);
11233}
11234
11235function getQueryParam(url, param) {
11236	param = param.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
11237	var regexS = '[\\?&]' + param + '=([^&#]*)';
11238	var regex = new RegExp(regexS);
11239	var results = regex.exec(url);
11240	if (
11241		results === null ||
11242		(results && typeof results[1] !== 'string' && results[1].length)
11243	)
11244		return '';
11245	else return decodeURIComponent(results[1]).replace(/\+/g, ' ');
11246}
11247
11248function ensureLoaded() {
11249	if (typeof mixpanel !== 'undefined') {
11250		mixpanel.init('1c1eda798f92601aecaa904fe7b3520a', {
11251			loaded: function () {
11252				campaignParams();
11253			},
11254		});
11255	} else {
11256		setTimeout(ensureLoaded, 1000);
11257	}
11258}
11259
11260ensureLoaded();
11261
11262// FOR WISTIA VIDEOS
11263
11264window._wq = window._wq || [];
11265_wq.push({
11266	id: '_all',
11267	onReady: function (video) {
11268		// Set event when loaded
11269		//console.log("Video loaded:", video.hashedId(), typeof(Munchkin));
11270		if (typeof Munchkin !== 'undefined') {
11271			Munchkin.munchkinFunction('clickLink', {
11272				href:
11273					window.location.pathname +
11274					'?videoTrk=' +
11275					video.hashedId() +
11276					'&action=loaded',
11277			});
11278		}
11279
11280		// Set event when played
11281		video.bind('play', function () {
11282			//console.log("Video played @ "+video.secondsWatched()+":", video.hashedId(), typeof(Munchkin));
11283			if (typeof Munchkin !== 'undefined') {
11284				Munchkin.munchkinFunction('clickLink', {
11285					href:
11286						window.location.pathname +
11287						'?videoTrk=' +
11288						video.hashedId() +
11289						'&action=played&duration=' +
11290						video.secondsWatched(),
11291				});
11292			}
11293		});
11294
11295		// Set event when milestones are met
11296		video.bind('percentwatchedchanged', function (percent, lastPercent) {
11297			if (percent >= 0.2 && lastPercent < 0.2) {
11298				//console.log("Video watched 20%:", video.hashedId(), typeof(Munchkin));
11299				if (typeof Munchkin !== 'undefined') {
11300					Munchkin.munchkinFunction('clickLink', {
11301						href:
11302							window.location.pathname +
11303							'?videoTrk=' +
11304							video.hashedId() +
11305							'&action=watched&interval=20',
11306					});
11307				}
11308			} else if (percent >= 0.4 && lastPercent < 0.4) {
11309				//console.log("Video watched 40%:", video.hashedId(), typeof(Munchkin));
11310				if (typeof Munchkin !== 'undefined') {
11311					Munchkin.munchkinFunction('clickLink', {
11312						href:
11313							window.location.pathname +
11314							'?videoTrk=' +
11315							video.hashedId() +
11316							'&action=watched&interval=40',
11317					});
11318				}
11319			} else if (percent >= 0.6 && lastPercent < 0.6) {
11320				//console.log("Video watched 60%:", video.hashedId(), typeof(Munchkin));
11321				if (typeof Munchkin !== 'undefined') {
11322					Munchkin.munchkinFunction('clickLink', {
11323						href:
11324							window.location.pathname +
11325							'?videoTrk=' +
11326							video.hashedId() +
11327							'&action=watched&interval=60',
11328					});
11329				}
11330			} else if (percent >= 0.8 && lastPercent < 0.8) {
11331				//console.log("Video watched 80%:", video.hashedId(), typeof(Munchkin));
11332				if (typeof Munchkin !== 'undefined') {
11333					Munchkin.munchkinFunction('clickLink', {
11334						href:
11335							window.location.pathname +
11336							'?videoTrk=' +
11337							video.hashedId() +
11338							'&action=watched&interval=80',
11339					});
11340				}
11341			}
11342		});
11343
11344		// Set event when seeked/scrubbed
11345		video.bind('seek', function (currentTime, lastTime) {
11346			//console.log("Video scrubbed "+(currentTime < lastTime ? '-' : '')+Math.abs(lastTime - currentTime)+":", video.hashedId(), typeof(Munchkin));
11347			if (typeof Munchkin !== 'undefined') {
11348				Munchkin.munchkinFunction('clickLink', {
11349					href:
11350						window.location.pathname +
11351						'?videoTrk=' +
11352						video.hashedId() +
11353						'&action=scrubbed&duration=' +
11354						(currentTime < lastTime ? '-' : '') +
11355						Math.abs(lastTime - currentTime),
11356				});
11357			}
11358		});
11359
11360		// Set event when paused
11361		video.bind('pause', function () {
11362			//console.log("Video paused @ "+video.secondsWatched()+":", video.hashedId(), typeof(Munchkin));
11363			if (typeof Munchkin !== 'undefined') {
11364				Munchkin.munchkinFunction('clickLink', {
11365					href:
11366						window.location.pathname +
11367						'?videoTrk=' +
11368						video.hashedId() +
11369						'&action=paused&duration=' +
11370						video.secondsWatched(),
11371				});
11372			}
11373		});
11374
11375		// Set event when complete
11376		video.bind('end', function () {
11377			//console.log("Video finished:", video.hashedId(), typeof(Munchkin));
11378			if (typeof Munchkin !== 'undefined') {
11379				Munchkin.munchkinFunction('clickLink', {
11380					href:
11381						window.location.pathname +
11382						'?videoTrk=' +
11383						video.hashedId() +
11384						'&action=ended',
11385				});
11386			}
11387		});
11388	},
11389});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.