/*! loglevel - v1.6.8 - https://github.com/pimterry/loglevel - (c) 2020 Tim Perry - licensed MIT */
!function(a,b){"use strict";"function"==typeof define&&define.amd?define('loglevel',b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(c){return"debug"===c&&(c="log"),typeof console!==i&&("trace"===c&&j?b:void 0!==console[c]?a(console,c):void 0!==console.log?a(console,"log"):h)}function d(a,b){for(var c=0;c<k.length;c++){var d=k[c];this[d]=c<a?h:this.methodFactory(d,a,b)}this.log=this.debug}function e(a,b,c){return function(){typeof console!==i&&(d.call(this,b,c),this[a].apply(this,arguments))}}function f(a,b,d){return c(a)||e.apply(this,arguments)}function g(a,b,c){function e(a){var b=(k[a]||"silent").toUpperCase();if(typeof window!==i){try{return void(window.localStorage[l]=b)}catch(a){}try{window.document.cookie=encodeURIComponent(l)+"="+b+";"}catch(a){}}}function g(){var a;if(typeof window!==i){try{a=window.localStorage[l]}catch(a){}if(typeof a===i)try{var b=window.document.cookie,c=b.indexOf(encodeURIComponent(l)+"=");-1!==c&&(a=/^([^;]+)/.exec(b.slice(c))[1])}catch(a){}return void 0===j.levels[a]&&(a=void 0),a}}var h,j=this,l="loglevel";a&&(l+=":"+a),j.name=a,j.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},j.methodFactory=c||f,j.getLevel=function(){return h},j.setLevel=function(b,c){if("string"==typeof b&&void 0!==j.levels[b.toUpperCase()]&&(b=j.levels[b.toUpperCase()]),!("number"==typeof b&&b>=0&&b<=j.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(h=b,!1!==c&&e(b),d.call(j,b,a),typeof console===i&&b<j.levels.SILENT)return"No console available for logging"},j.setDefaultLevel=function(a){g()||j.setLevel(a,!1)},j.enableAll=function(a){j.setLevel(j.levels.TRACE,a)},j.disableAll=function(a){j.setLevel(j.levels.SILENT,a)};var m=g();null==m&&(m=null==b?"WARN":b),j.setLevel(m,!1)}var h=function(){},i="undefined",j=typeof window!==i&&typeof window.navigator!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"],l=new g,m={};l.getLogger=function(a){if("string"!=typeof a||""===a)throw new TypeError("You must supply a name when creating a logger.");var b=m[a];return b||(b=m[a]=new g(a,l.getLevel(),l.methodFactory)),b};var n=typeof window!==i?window.log:void 0;return l.noConflict=function(){return typeof window!==i&&window.log===l&&(window.log=n),l},l.getLoggers=function(){return m},l});
/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={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,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.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,code:!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(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join("|"),"i");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",y.checkOn=""!==rt.value,y.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",y.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)Dt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.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(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('jqueryNoConflict',["jquery"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery")) :
    console && console.error('jquery.noconflict does not support non-amd script loading.');
}(this/* window */, function($) {
    "use strict";
    return $.noConflict();
}));

/*!
 * @fileOverview TouchSwipe - jQuery Plugin
 * @version 1.6.18
 *
 * @author Matt Bryson http://www.github.com/mattbryson
 * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
 * @see http://labs.rampinteractive.co.uk/touchSwipe/
 * @see http://plugins.jquery.com/project/touchSwipe
 * @license
 * Copyright (c) 2010-2015 Matt Bryson
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 */
(function(factory) {
  if (typeof define === 'function' && define.amd && define.amd.jQuery) {
    // AMD. Register as anonymous module.
    define('jqueryTouchSwipe',['jquery'], factory);
  } else if (typeof module !== 'undefined' && module.exports) {
    // CommonJS Module
    factory(require("jquery"));
  } else {
    // Browser globals.
    factory(jQuery);
  }
}(function($) {
  "use strict";

  //Constants
  var VERSION = "1.6.18",
    LEFT = "left",
    RIGHT = "right",
    UP = "up",
    DOWN = "down",
    IN = "in",
    OUT = "out",

    NONE = "none",
    AUTO = "auto",

    SWIPE = "swipe",
    PINCH = "pinch",
    TAP = "tap",
    DOUBLE_TAP = "doubletap",
    LONG_TAP = "longtap",
    HOLD = "hold",

    HORIZONTAL = "horizontal",
    VERTICAL = "vertical",

    ALL_FINGERS = "all",

    DOUBLE_TAP_THRESHOLD = 10,

    PHASE_START = "start",
    PHASE_MOVE = "move",
    PHASE_END = "end",
    PHASE_CANCEL = "cancel",

    SUPPORTS_TOUCH = 'ontouchstart' in window,

    SUPPORTS_POINTER_IE10 = window.navigator.msPointerEnabled && !window.navigator.pointerEnabled && !SUPPORTS_TOUCH,

    SUPPORTS_POINTER = (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) && !SUPPORTS_TOUCH,

    PLUGIN_NS = 'TouchSwipe';



  /**
  * The default configuration, and available options to configure touch swipe with.
  * You can set the default values by updating any of the properties prior to instantiation.
  * @name $.fn.swipe.defaults
  * @namespace
  * @property {int} [fingers=1] The number of fingers to detect in a swipe. Any swipes that do not meet this requirement will NOT trigger swipe handlers.
  * @property {int} [threshold=75] The number of pixels that the user must move their finger by before it is considered a swipe.
  * @property {int} [cancelThreshold=null] The number of pixels that the user must move their finger back from the original swipe direction to cancel the gesture.
  * @property {int} [pinchThreshold=20] The number of pixels that the user must pinch their finger by before it is considered a pinch.
  * @property {int} [maxTimeThreshold=null] Time, in milliseconds, between touchStart and touchEnd must NOT exceed in order to be considered a swipe.
  * @property {int} [fingerReleaseThreshold=250] Time in milliseconds between releasing multiple fingers.  If 2 fingers are down, and are released one after the other, if they are within this threshold, it counts as a simultaneous release.
  * @property {int} [longTapThreshold=500] Time in milliseconds between tap and release for a long tap
  * @property {int} [doubleTapThreshold=200] Time in milliseconds between 2 taps to count as a double tap
  * @property {function} [swipe=null] A handler to catch all swipes. See {@link $.fn.swipe#event:swipe}
  * @property {function} [swipeLeft=null] A handler that is triggered for "left" swipes. See {@link $.fn.swipe#event:swipeLeft}
  * @property {function} [swipeRight=null] A handler that is triggered for "right" swipes. See {@link $.fn.swipe#event:swipeRight}
  * @property {function} [swipeUp=null] A handler that is triggered for "up" swipes. See {@link $.fn.swipe#event:swipeUp}
  * @property {function} [swipeDown=null] A handler that is triggered for "down" swipes. See {@link $.fn.swipe#event:swipeDown}
  * @property {function} [swipeStatus=null] A handler triggered for every phase of the swipe. See {@link $.fn.swipe#event:swipeStatus}
  * @property {function} [pinchIn=null] A handler triggered for pinch in events. See {@link $.fn.swipe#event:pinchIn}
  * @property {function} [pinchOut=null] A handler triggered for pinch out events. See {@link $.fn.swipe#event:pinchOut}
  * @property {function} [pinchStatus=null] A handler triggered for every phase of a pinch. See {@link $.fn.swipe#event:pinchStatus}
  * @property {function} [tap=null] A handler triggered when a user just taps on the item, rather than swipes it. If they do not move, tap is triggered, if they do move, it is not.
  * @property {function} [doubleTap=null] A handler triggered when a user double taps on the item. The delay between taps can be set with the doubleTapThreshold property. See {@link $.fn.swipe.defaults#doubleTapThreshold}
  * @property {function} [longTap=null] A handler triggered when a user long taps on the item. The delay between start and end can be set with the longTapThreshold property. See {@link $.fn.swipe.defaults#longTapThreshold}
  * @property (function) [hold=null] A handler triggered when a user reaches longTapThreshold on the item. See {@link $.fn.swipe.defaults#longTapThreshold}
  * @property {boolean} [triggerOnTouchEnd=true] If true, the swipe events are triggered when the touch end event is received (user releases finger).  If false, it will be triggered on reaching the threshold, and then cancel the touch event automatically.
  * @property {boolean} [triggerOnTouchLeave=false] If true, then when the user leaves the swipe object, the swipe will end and trigger appropriate handlers.
  * @property {string|undefined} [allowPageScroll='auto'] How the browser handles page scrolls when the user is swiping on a touchSwipe object. See {@link $.fn.swipe.pageScroll}.  <br/><br/>
  									<code>"auto"</code> : all undefined swipes will cause the page to scroll in that direction. <br/>
  									<code>"none"</code> : the page will not scroll when user swipes. <br/>
  									<code>"horizontal"</code> : will force page to scroll on horizontal swipes. <br/>
  									<code>"vertical"</code> : will force page to scroll on vertical swipes. <br/>
  * @property {boolean} [fallbackToMouseEvents=true] If true mouse events are used when run on a non touch device, false will stop swipes being triggered by mouse events on non touch devices.
  * @property {string} [excludedElements=".noSwipe"] A jquery selector that specifies child elements that do NOT trigger swipes. By default this excludes elements with the class .noSwipe .
  * @property {boolean} [preventDefaultEvents=true] by default default events are cancelled, so the page doesn't move.  You can disable this so both native events fire as well as your handlers.

  */
  var defaults = {
    fingers: 1,
    threshold: 75,
    cancelThreshold: null,
    pinchThreshold: 20,
    maxTimeThreshold: null,
    fingerReleaseThreshold: 250,
    longTapThreshold: 500,
    doubleTapThreshold: 200,
    swipe: null,
    swipeLeft: null,
    swipeRight: null,
    swipeUp: null,
    swipeDown: null,
    swipeStatus: null,
    pinchIn: null,
    pinchOut: null,
    pinchStatus: null,
    click: null, //Deprecated since 1.6.2
    tap: null,
    doubleTap: null,
    longTap: null,
    hold: null,
    triggerOnTouchEnd: true,
    triggerOnTouchLeave: false,
    allowPageScroll: "auto",
    fallbackToMouseEvents: true,
    excludedElements: ".noSwipe",
    preventDefaultEvents: true
  };



  /**
   * Applies TouchSwipe behaviour to one or more jQuery objects.
   * The TouchSwipe plugin can be instantiated via this method, or methods within
   * TouchSwipe can be executed via this method as per jQuery plugin architecture.
   * An existing plugin can have its options changed simply by re calling .swipe(options)
   * @see TouchSwipe
   * @class
   * @param {Mixed} method If the current DOMNode is a TouchSwipe object, and <code>method</code> is a TouchSwipe method, then
   * the <code>method</code> is executed, and any following arguments are passed to the TouchSwipe method.
   * If <code>method</code> is an object, then the TouchSwipe class is instantiated on the current DOMNode, passing the
   * configuration properties defined in the object. See TouchSwipe
   *
   */
  $.fn.swipe = function(method) {
    var $this = $(this),
      plugin = $this.data(PLUGIN_NS);

    //Check if we are already instantiated and trying to execute a method
    if (plugin && typeof method === 'string') {
      if (plugin[method]) {
        return plugin[method].apply(plugin, Array.prototype.slice.call(arguments, 1));
      } else {
        $.error('Method ' + method + ' does not exist on jQuery.swipe');
      }
    }

    //Else update existing plugin with new options hash
    else if (plugin && typeof method === 'object') {
      plugin['option'].apply(plugin, arguments);
    }

    //Else not instantiated and trying to pass init object (or nothing)
    else if (!plugin && (typeof method === 'object' || !method)) {
      return init.apply(this, arguments);
    }

    return $this;
  };

  /**
   * The version of the plugin
   * @readonly
   */
  $.fn.swipe.version = VERSION;



  //Expose our defaults so a user could override the plugin defaults
  $.fn.swipe.defaults = defaults;

  /**
   * The phases that a touch event goes through.  The <code>phase</code> is passed to the event handlers.
   * These properties are read only, attempting to change them will not alter the values passed to the event handlers.
   * @namespace
   * @readonly
   * @property {string} PHASE_START Constant indicating the start phase of the touch event. Value is <code>"start"</code>.
   * @property {string} PHASE_MOVE Constant indicating the move phase of the touch event. Value is <code>"move"</code>.
   * @property {string} PHASE_END Constant indicating the end phase of the touch event. Value is <code>"end"</code>.
   * @property {string} PHASE_CANCEL Constant indicating the cancel phase of the touch event. Value is <code>"cancel"</code>.
   */
  $.fn.swipe.phases = {
    PHASE_START: PHASE_START,
    PHASE_MOVE: PHASE_MOVE,
    PHASE_END: PHASE_END,
    PHASE_CANCEL: PHASE_CANCEL
  };

  /**
   * The direction constants that are passed to the event handlers.
   * These properties are read only, attempting to change them will not alter the values passed to the event handlers.
   * @namespace
   * @readonly
   * @property {string} LEFT Constant indicating the left direction. Value is <code>"left"</code>.
   * @property {string} RIGHT Constant indicating the right direction. Value is <code>"right"</code>.
   * @property {string} UP Constant indicating the up direction. Value is <code>"up"</code>.
   * @property {string} DOWN Constant indicating the down direction. Value is <code>"cancel"</code>.
   * @property {string} IN Constant indicating the in direction. Value is <code>"in"</code>.
   * @property {string} OUT Constant indicating the out direction. Value is <code>"out"</code>.
   */
  $.fn.swipe.directions = {
    LEFT: LEFT,
    RIGHT: RIGHT,
    UP: UP,
    DOWN: DOWN,
    IN: IN,
    OUT: OUT
  };

  /**
   * The page scroll constants that can be used to set the value of <code>allowPageScroll</code> option
   * These properties are read only
   * @namespace
   * @readonly
   * @see $.fn.swipe.defaults#allowPageScroll
   * @property {string} NONE Constant indicating no page scrolling is allowed. Value is <code>"none"</code>.
   * @property {string} HORIZONTAL Constant indicating horizontal page scrolling is allowed. Value is <code>"horizontal"</code>.
   * @property {string} VERTICAL Constant indicating vertical page scrolling is allowed. Value is <code>"vertical"</code>.
   * @property {string} AUTO Constant indicating either horizontal or vertical will be allowed, depending on the swipe handlers registered. Value is <code>"auto"</code>.
   */
  $.fn.swipe.pageScroll = {
    NONE: NONE,
    HORIZONTAL: HORIZONTAL,
    VERTICAL: VERTICAL,
    AUTO: AUTO
  };

  /**
   * Constants representing the number of fingers used in a swipe.  These are used to set both the value of <code>fingers</code> in the
   * options object, as well as the value of the <code>fingers</code> event property.
   * These properties are read only, attempting to change them will not alter the values passed to the event handlers.
   * @namespace
   * @readonly
   * @see $.fn.swipe.defaults#fingers
   * @property {string} ONE Constant indicating 1 finger is to be detected / was detected. Value is <code>1</code>.
   * @property {string} TWO Constant indicating 2 fingers are to be detected / were detected. Value is <code>2</code>.
   * @property {string} THREE Constant indicating 3 finger are to be detected / were detected. Value is <code>3</code>.
   * @property {string} FOUR Constant indicating 4 finger are to be detected / were detected. Not all devices support this. Value is <code>4</code>.
   * @property {string} FIVE Constant indicating 5 finger are to be detected / were detected. Not all devices support this. Value is <code>5</code>.
   * @property {string} ALL Constant indicating any combination of finger are to be detected.  Value is <code>"all"</code>.
   */
  $.fn.swipe.fingers = {
    ONE: 1,
    TWO: 2,
    THREE: 3,
    FOUR: 4,
    FIVE: 5,
    ALL: ALL_FINGERS
  };

  /**
   * Initialise the plugin for each DOM element matched
   * This creates a new instance of the main TouchSwipe class for each DOM element, and then
   * saves a reference to that instance in the elements data property.
   * @internal
   */
  function init(options) {
    //Prep and extend the options
    if (options && (options.allowPageScroll === undefined && (options.swipe !== undefined || options.swipeStatus !== undefined))) {
      options.allowPageScroll = NONE;
    }

    //Check for deprecated options
    //Ensure that any old click handlers are assigned to the new tap, unless we have a tap
    if (options.click !== undefined && options.tap === undefined) {
      options.tap = options.click;
    }

    if (!options) {
      options = {};
    }

    //pass empty object so we dont modify the defaults
    options = $.extend({}, $.fn.swipe.defaults, options);

    //For each element instantiate the plugin
    return this.each(function() {
      var $this = $(this);

      //Check we havent already initialised the plugin
      var plugin = $this.data(PLUGIN_NS);

      if (!plugin) {
        plugin = new TouchSwipe(this, options);
        $this.data(PLUGIN_NS, plugin);
      }
    });
  }

  /**
   * Main TouchSwipe Plugin Class.
   * Do not use this to construct your TouchSwipe object, use the jQuery plugin method $.fn.swipe(); {@link $.fn.swipe}
   * @private
   * @name TouchSwipe
   * @param {DOMNode} element The HTML DOM object to apply to plugin to
   * @param {Object} options The options to configure the plugin with.  @link {$.fn.swipe.defaults}
   * @see $.fh.swipe.defaults
   * @see $.fh.swipe
   * @class
   */
  function TouchSwipe(element, options) {

    //take a local/instacne level copy of the options - should make it this.options really...
    var options = $.extend({}, options);

    var useTouchEvents = (SUPPORTS_TOUCH || SUPPORTS_POINTER || !options.fallbackToMouseEvents),
      START_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerDown' : 'pointerdown') : 'touchstart') : 'mousedown',
      MOVE_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerMove' : 'pointermove') : 'touchmove') : 'mousemove',
      END_EV = useTouchEvents ? (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerUp' : 'pointerup') : 'touchend') : 'mouseup',
      LEAVE_EV = useTouchEvents ? (SUPPORTS_POINTER ? 'mouseleave' : null) : 'mouseleave', //we manually detect leave on touch devices, so null event here
      CANCEL_EV = (SUPPORTS_POINTER ? (SUPPORTS_POINTER_IE10 ? 'MSPointerCancel' : 'pointercancel') : 'touchcancel');



    //touch properties
    var distance = 0,
      direction = null,
      currentDirection = null,
      duration = 0,
      startTouchesDistance = 0,
      endTouchesDistance = 0,
      pinchZoom = 1,
      pinchDistance = 0,
      pinchDirection = 0,
      maximumsMap = null;



    //jQuery wrapped element for this instance
    var $element = $(element);

    //Current phase of th touch cycle
    var phase = "start";

    // the current number of fingers being used.
    var fingerCount = 0;

    //track mouse points / delta
    var fingerData = {};

    //track times
    var startTime = 0,
      endTime = 0,
      previousTouchEndTime = 0,
      fingerCountAtRelease = 0,
      doubleTapStartTime = 0;

    //Timeouts
    var singleTapTimeout = null,
      holdTimeout = null;

    // Add gestures to all swipable areas if supported
    try {
      $element.on(START_EV, touchStart);
      $element.on(CANCEL_EV, touchCancel);
    } catch (e) {
      $.error('events not supported ' + START_EV + ',' + CANCEL_EV + ' on jQuery.swipe');
    }

    //
    //Public methods
    //

    /**
     * re-enables the swipe plugin with the previous configuration
     * @function
     * @name $.fn.swipe#enable
     * @return {DOMNode} The Dom element that was registered with TouchSwipe
     * @example $("#element").swipe("enable");
     */
    this.enable = function() {
      //Incase we are already enabled, clean up...
      this.disable();
      $element.on(START_EV, touchStart);
      $element.on(CANCEL_EV, touchCancel);
      return $element;
    };

    /**
     * disables the swipe plugin
     * @function
     * @name $.fn.swipe#disable
     * @return {DOMNode} The Dom element that is now registered with TouchSwipe
     * @example $("#element").swipe("disable");
     */
    this.disable = function() {
      removeListeners();
      return $element;
    };

    /**
     * Destroy the swipe plugin completely. To use any swipe methods, you must re initialise the plugin.
     * @function
     * @name $.fn.swipe#destroy
     * @example $("#element").swipe("destroy");
     */
    this.destroy = function() {
      removeListeners();
      $element.data(PLUGIN_NS, null);
      $element = null;
    };


    /**
     * Allows run time updating of the swipe configuration options.
     * @function
     * @name $.fn.swipe#option
     * @param {String} property The option property to get or set, or a has of multiple options to set
     * @param {Object} [value] The value to set the property to
     * @return {Object} If only a property name is passed, then that property value is returned. If nothing is passed the current options hash is returned.
     * @example $("#element").swipe("option", "threshold"); // return the threshold
     * @example $("#element").swipe("option", "threshold", 100); // set the threshold after init
     * @example $("#element").swipe("option", {threshold:100, fingers:3} ); // set multiple properties after init
     * @example $("#element").swipe({threshold:100, fingers:3} ); // set multiple properties after init - the "option" method is optional!
     * @example $("#element").swipe("option"); // Return the current options hash
     * @see $.fn.swipe.defaults
     *
     */
    this.option = function(property, value) {

      if (typeof property === 'object') {
        options = $.extend(options, property);
      } else if (options[property] !== undefined) {
        if (value === undefined) {
          return options[property];
        } else {
          options[property] = value;
        }
      } else if (!property) {
        return options;
      } else {
        $.error('Option ' + property + ' does not exist on jQuery.swipe.options');
      }

      return null;
    }



    //
    // Private methods
    //

    //
    // EVENTS
    //
    /**
     * Event handler for a touch start event.
     * Stops the default click event from triggering and stores where we touched
     * @inner
     * @param {object} jqEvent The normalised jQuery event object.
     */
    function touchStart(jqEvent) {

      //If we already in a touch event (a finger already in use) then ignore subsequent ones..
      if (getTouchInProgress()) {
        return;
      }

      //Check if this element matches any in the excluded elements selectors,  or its parent is excluded, if so, DON'T swipe
      if ($(jqEvent.target).closest(options.excludedElements, $element).length > 0) {
        return;
      }

      //As we use Jquery bind for events, we need to target the original event object
      //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one.
      var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent;


      //If we have a pointer event, whoes type is 'mouse' and we have said NO mouse events, then dont do anything.
      if(event.pointerType && event.pointerType=="mouse" && options.fallbackToMouseEvents==false) {
        return;
      };

      var ret,
        touches = event.touches,
        evt = touches ? touches[0] : event;

      phase = PHASE_START;

      //If we support touches, get the finger count
      if (touches) {
        // get the total number of fingers touching the screen
        fingerCount = touches.length;
      }
      //Else this is the desktop, so stop the browser from dragging content
      else if (options.preventDefaultEvents !== false) {
        jqEvent.preventDefault(); //call this on jq event so we are cross browser
      }

      //clear vars..
      distance = 0;
      direction = null;
      currentDirection=null;
      pinchDirection = null;
      duration = 0;
      startTouchesDistance = 0;
      endTouchesDistance = 0;
      pinchZoom = 1;
      pinchDistance = 0;
      maximumsMap = createMaximumsData();
      cancelMultiFingerRelease();

      //Create the default finger data
      createFingerData(0, evt);

      // check the number of fingers is what we are looking for, or we are capturing pinches
      if (!touches || (fingerCount === options.fingers || options.fingers === ALL_FINGERS) || hasPinches()) {
        // get the coordinates of the touch
        startTime = getTimeStamp();

        if (fingerCount == 2) {
          //Keep track of the initial pinch distance, so we can calculate the diff later
          //Store second finger data as start
          createFingerData(1, touches[1]);
          startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start);
        }

        if (options.swipeStatus || options.pinchStatus) {
          ret = triggerHandler(event, phase);
        }
      } else {
        //A touch with more or less than the fingers we are looking for, so cancel
        ret = false;
      }

      //If we have a return value from the users handler, then return and cancel
      if (ret === false) {
        phase = PHASE_CANCEL;
        triggerHandler(event, phase);
        return ret;
      } else {
        if (options.hold) {
          holdTimeout = setTimeout($.proxy(function() {
            //Trigger the event
            $element.trigger('hold', [event.target]);
            //Fire the callback
            if (options.hold) {
              ret = options.hold.call($element, event, event.target);
            }
          }, this), options.longTapThreshold);
        }

        setTouchInProgress(true);
      }

      return null;
    };



    /**
     * Event handler for a touch move event.
     * If we change fingers during move, then cancel the event
     * @inner
     * @param {object} jqEvent The normalised jQuery event object.
     */
    function touchMove(jqEvent) {

      //As we use Jquery bind for events, we need to target the original event object
      //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one.
      var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent;

      //If we are ending, cancelling, or within the threshold of 2 fingers being released, don't track anything..
      if (phase === PHASE_END || phase === PHASE_CANCEL || inMultiFingerRelease())
        return;

      var ret,
        touches = event.touches,
        evt = touches ? touches[0] : event;


      //Update the  finger data
      var currentFinger = updateFingerData(evt);
      endTime = getTimeStamp();

      if (touches) {
        fingerCount = touches.length;
      }

      if (options.hold) {
        clearTimeout(holdTimeout);
      }

      phase = PHASE_MOVE;

      //If we have 2 fingers get Touches distance as well
      if (fingerCount == 2) {

        //Keep track of the initial pinch distance, so we can calculate the diff later
        //We do this here as well as the start event, in case they start with 1 finger, and the press 2 fingers
        if (startTouchesDistance == 0) {
          //Create second finger if this is the first time...
          createFingerData(1, touches[1]);

          startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start);
        } else {
          //Else just update the second finger
          updateFingerData(touches[1]);

          endTouchesDistance = calculateTouchesDistance(fingerData[0].end, fingerData[1].end);
          pinchDirection = calculatePinchDirection(fingerData[0].end, fingerData[1].end);
        }

        pinchZoom = calculatePinchZoom(startTouchesDistance, endTouchesDistance);
        pinchDistance = Math.abs(startTouchesDistance - endTouchesDistance);
      }

      if ((fingerCount === options.fingers || options.fingers === ALL_FINGERS) || !touches || hasPinches()) {

        //The overall direction of the swipe. From start to now.
        direction = calculateDirection(currentFinger.start, currentFinger.end);

        //The immediate direction of the swipe, direction between the last movement and this one.
        currentDirection = calculateDirection(currentFinger.last, currentFinger.end);

        //Check if we need to prevent default event (page scroll / pinch zoom) or not
        validateDefaultEvent(jqEvent, currentDirection);

        //Distance and duration are all off the main finger
        distance = calculateDistance(currentFinger.start, currentFinger.end);
        duration = calculateDuration();

        //Cache the maximum distance we made in this direction
        setMaxDistance(direction, distance);

        //Trigger status handler
        ret = triggerHandler(event, phase);


        //If we trigger end events when threshold are met, or trigger events when touch leaves element
        if (!options.triggerOnTouchEnd || options.triggerOnTouchLeave) {

          var inBounds = true;

          //If checking if we leave the element, run the bounds check (we can use touchleave as its not supported on webkit)
          if (options.triggerOnTouchLeave) {
            var bounds = getbounds(this);
            inBounds = isInBounds(currentFinger.end, bounds);
          }

          //Trigger end handles as we swipe if thresholds met or if we have left the element if the user has asked to check these..
          if (!options.triggerOnTouchEnd && inBounds) {
            phase = getNextPhase(PHASE_MOVE);
          }
          //We end if out of bounds here, so set current phase to END, and check if its modified
          else if (options.triggerOnTouchLeave && !inBounds) {
            phase = getNextPhase(PHASE_END);
          }

          if (phase == PHASE_CANCEL || phase == PHASE_END) {
            triggerHandler(event, phase);
          }
        }
      } else {
        phase = PHASE_CANCEL;
        triggerHandler(event, phase);
      }

      if (ret === false) {
        phase = PHASE_CANCEL;
        triggerHandler(event, phase);
      }
    }




    /**
     * Event handler for a touch end event.
     * Calculate the direction and trigger events
     * @inner
     * @param {object} jqEvent The normalised jQuery event object.
     */
    function touchEnd(jqEvent) {
      //As we use Jquery bind for events, we need to target the original event object
      //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one.
      var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent,
        touches = event.touches;

      //If we are still in a touch with the device wait a fraction and see if the other finger comes up
      //if it does within the threshold, then we treat it as a multi release, not a single release and end the touch / swipe
      if (touches) {
        if (touches.length && !inMultiFingerRelease()) {
          startMultiFingerRelease(event);
          return true;
        } else if (touches.length && inMultiFingerRelease()) {
          return true;
        }
      }

      //If a previous finger has been released, check how long ago, if within the threshold, then assume it was a multifinger release.
      //This is used to allow 2 fingers to release fractionally after each other, whilst maintaining the event as containing 2 fingers, not 1
      if (inMultiFingerRelease()) {
        fingerCount = fingerCountAtRelease;
      }

      //Set end of swipe
      endTime = getTimeStamp();

      //Get duration incase move was never fired
      duration = calculateDuration();

      //If we trigger handlers at end of swipe OR, we trigger during, but they didnt trigger and we are still in the move phase
      if (didSwipeBackToCancel() || !validateSwipeDistance()) {
        phase = PHASE_CANCEL;
        triggerHandler(event, phase);
      } else if (options.triggerOnTouchEnd || (options.triggerOnTouchEnd === false && phase === PHASE_MOVE)) {
        //call this on jq event so we are cross browser
        if (options.preventDefaultEvents !== false && jqEvent.cancelable !== false) {
          jqEvent.preventDefault();
        }
        phase = PHASE_END;
        triggerHandler(event, phase);
      }
      //Special cases - A tap should always fire on touch end regardless,
      //So here we manually trigger the tap end handler by itself
      //We dont run trigger handler as it will re-trigger events that may have fired already
      else if (!options.triggerOnTouchEnd && hasTap()) {
        //Trigger the pinch events...
        phase = PHASE_END;
        triggerHandlerForGesture(event, phase, TAP);
      } else if (phase === PHASE_MOVE) {
        phase = PHASE_CANCEL;
        triggerHandler(event, phase);
      }

      setTouchInProgress(false);

      return null;
    }



    /**
     * Event handler for a touch cancel event.
     * Clears current vars
     * @inner
     */
    function touchCancel() {
      // reset the variables back to default values
      fingerCount = 0;
      endTime = 0;
      startTime = 0;
      startTouchesDistance = 0;
      endTouchesDistance = 0;
      pinchZoom = 1;

      //If we were in progress of tracking a possible multi touch end, then re set it.
      cancelMultiFingerRelease();

      setTouchInProgress(false);
    }


    /**
     * Event handler for a touch leave event.
     * This is only triggered on desktops, in touch we work this out manually
     * as the touchleave event is not supported in webkit
     * @inner
     */
    function touchLeave(jqEvent) {
      //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one.
      var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent;

      //If we have the trigger on leave property set....
      if (options.triggerOnTouchLeave) {
        phase = getNextPhase(PHASE_END);
        triggerHandler(event, phase);
      }
    }

    /**
     * Removes all listeners that were associated with the plugin
     * @inner
     */
    function removeListeners() {
      $element.off(START_EV, touchStart);
      $element.off(CANCEL_EV, touchCancel);
      $element.off(MOVE_EV, touchMove);
      $element.off(END_EV, touchEnd);

      //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit
      if (LEAVE_EV) {
        $element.off(LEAVE_EV, touchLeave);
      }

      setTouchInProgress(false);
    }


    /**
     * Checks if the time and distance thresholds have been met, and if so then the appropriate handlers are fired.
     */
    function getNextPhase(currentPhase) {

      var nextPhase = currentPhase;

      // Ensure we have valid swipe (under time and over distance  and check if we are out of bound...)
      var validTime = validateSwipeTime();
      var validDistance = validateSwipeDistance();
      var didCancel = didSwipeBackToCancel();

      //If we have exceeded our time, then cancel
      if (!validTime || didCancel) {
        nextPhase = PHASE_CANCEL;
      }
      //Else if we are moving, and have reached distance then end
      else if (validDistance && currentPhase == PHASE_MOVE && (!options.triggerOnTouchEnd || options.triggerOnTouchLeave)) {
        nextPhase = PHASE_END;
      }
      //Else if we have ended by leaving and didn't reach distance, then cancel
      else if (!validDistance && currentPhase == PHASE_END && options.triggerOnTouchLeave) {
        nextPhase = PHASE_CANCEL;
      }

      return nextPhase;
    }


    /**
     * Trigger the relevant event handler
     * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down"
     * @param {object} event the original event object
     * @param {string} phase the phase of the swipe (start, end cancel etc) {@link $.fn.swipe.phases}
     * @inner
     */
    function triggerHandler(event, phase) {



      var ret,
        touches = event.touches;

      // SWIPE GESTURES
      if (didSwipe() || hasSwipes()) {
          ret = triggerHandlerForGesture(event, phase, SWIPE);
      }

      // PINCH GESTURES (if the above didn't cancel)
      if ((didPinch() || hasPinches()) && ret !== false) {
          ret = triggerHandlerForGesture(event, phase, PINCH);
      }

      // CLICK / TAP (if the above didn't cancel)
      if (didDoubleTap() && ret !== false) {
        //Trigger the tap events...
        ret = triggerHandlerForGesture(event, phase, DOUBLE_TAP);
      }

      // CLICK / TAP (if the above didn't cancel)
      else if (didLongTap() && ret !== false) {
        //Trigger the tap events...
        ret = triggerHandlerForGesture(event, phase, LONG_TAP);
      }

      // CLICK / TAP (if the above didn't cancel)
      else if (didTap() && ret !== false) {
        //Trigger the tap event..
        ret = triggerHandlerForGesture(event, phase, TAP);
      }



      // If we are cancelling the gesture, then manually trigger the reset handler
      if (phase === PHASE_CANCEL) {

        touchCancel(event);
      }




      // If we are ending the gesture, then manually trigger the reset handler IF all fingers are off
      if (phase === PHASE_END) {
        //If we support touch, then check that all fingers are off before we cancel
        if (touches) {
          if (!touches.length) {
            touchCancel(event);
          }
        } else {
          touchCancel(event);
        }
      }

      return ret;
    }



    /**
     * Trigger the relevant event handler
     * The handlers are passed the original event, the element that was swiped, and in the case of the catch all handler, the direction that was swiped, "left", "right", "up", or "down"
     * @param {object} event the original event object
     * @param {string} phase the phase of the swipe (start, end cancel etc) {@link $.fn.swipe.phases}
     * @param {string} gesture the gesture to trigger a handler for : PINCH or SWIPE {@link $.fn.swipe.gestures}
     * @return Boolean False, to indicate that the event should stop propagation, or void.
     * @inner
     */
    function triggerHandlerForGesture(event, phase, gesture) {

      var ret;

      //SWIPES....
      if (gesture == SWIPE) {
        //Trigger status every time..
        $element.trigger('swipeStatus', [phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData, currentDirection]);

        if (options.swipeStatus) {
          ret = options.swipeStatus.call($element, event, phase, direction || null, distance || 0, duration || 0, fingerCount, fingerData, currentDirection);
          //If the status cancels, then dont run the subsequent event handlers..
          if (ret === false) return false;
        }

        if (phase == PHASE_END && validateSwipe()) {

          //Cancel any taps that were in progress...
          clearTimeout(singleTapTimeout);
          clearTimeout(holdTimeout);

          $element.trigger('swipe', [direction, distance, duration, fingerCount, fingerData, currentDirection]);

          if (options.swipe) {
            ret = options.swipe.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection);
            //If the status cancels, then dont run the subsequent event handlers..
            if (ret === false) return false;
          }

          //trigger direction specific event handlers
          switch (direction) {
            case LEFT:
              $element.trigger('swipeLeft', [direction, distance, duration, fingerCount, fingerData, currentDirection]);

              if (options.swipeLeft) {
                ret = options.swipeLeft.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection);
              }
              break;

            case RIGHT:
              $element.trigger('swipeRight', [direction, distance, duration, fingerCount, fingerData, currentDirection]);

              if (options.swipeRight) {
                ret = options.swipeRight.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection);
              }
              break;

            case UP:
              $element.trigger('swipeUp', [direction, distance, duration, fingerCount, fingerData, currentDirection]);

              if (options.swipeUp) {
                ret = options.swipeUp.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection);
              }
              break;

            case DOWN:
              $element.trigger('swipeDown', [direction, distance, duration, fingerCount, fingerData, currentDirection]);

              if (options.swipeDown) {
                ret = options.swipeDown.call($element, event, direction, distance, duration, fingerCount, fingerData, currentDirection);
              }
              break;
          }
        }
      }


      //PINCHES....
      if (gesture == PINCH) {
        $element.trigger('pinchStatus', [phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]);

        if (options.pinchStatus) {
          ret = options.pinchStatus.call($element, event, phase, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData);
          //If the status cancels, then dont run the subsequent event handlers..
          if (ret === false) return false;
        }

        if (phase == PHASE_END && validatePinch()) {

          switch (pinchDirection) {
            case IN:
              $element.trigger('pinchIn', [pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]);

              if (options.pinchIn) {
                ret = options.pinchIn.call($element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData);
              }
              break;

            case OUT:
              $element.trigger('pinchOut', [pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData]);

              if (options.pinchOut) {
                ret = options.pinchOut.call($element, event, pinchDirection || null, pinchDistance || 0, duration || 0, fingerCount, pinchZoom, fingerData);
              }
              break;
          }
        }
      }

      if (gesture == TAP) {
        if (phase === PHASE_CANCEL || phase === PHASE_END) {

          clearTimeout(singleTapTimeout);
          clearTimeout(holdTimeout);

          //If we are also looking for doubelTaps, wait incase this is one...
          if (hasDoubleTap() && !inDoubleTap()) {
            doubleTapStartTime = getTimeStamp();

            //Now wait for the double tap timeout, and trigger this single tap
            //if its not cancelled by a double tap
            singleTapTimeout = setTimeout($.proxy(function() {
              doubleTapStartTime = null;
              $element.trigger('tap', [event.target]);

              if (options.tap) {
                ret = options.tap.call($element, event, event.target);
              }
            }, this), options.doubleTapThreshold);

          } else {
            doubleTapStartTime = null;
            $element.trigger('tap', [event.target]);
            if (options.tap) {
              ret = options.tap.call($element, event, event.target);
            }
          }
        }
      } else if (gesture == DOUBLE_TAP) {
        if (phase === PHASE_CANCEL || phase === PHASE_END) {
          clearTimeout(singleTapTimeout);
          clearTimeout(holdTimeout);
          doubleTapStartTime = null;
          $element.trigger('doubletap', [event.target]);

          if (options.doubleTap) {
            ret = options.doubleTap.call($element, event, event.target);
          }
        }
      } else if (gesture == LONG_TAP) {
        if (phase === PHASE_CANCEL || phase === PHASE_END) {
          clearTimeout(singleTapTimeout);
          doubleTapStartTime = null;

          $element.trigger('longtap', [event.target]);
          if (options.longTap) {
            ret = options.longTap.call($element, event, event.target);
          }
        }
      }

      return ret;
    }


    //
    // GESTURE VALIDATION
    //

    /**
     * Checks the user has swipe far enough
     * @return Boolean if <code>threshold</code> has been set, return true if the threshold was met, else false.
     * If no threshold was set, then we return true.
     * @inner
     */
    function validateSwipeDistance() {
      var valid = true;
      //If we made it past the min swipe distance..
      if (options.threshold !== null) {
        valid = distance >= options.threshold;
      }

      return valid;
    }

    /**
     * Checks the user has swiped back to cancel.
     * @return Boolean if <code>cancelThreshold</code> has been set, return true if the cancelThreshold was met, else false.
     * If no cancelThreshold was set, then we return true.
     * @inner
     */
    function didSwipeBackToCancel() {
      var cancelled = false;
      if (options.cancelThreshold !== null && direction !== null) {
        cancelled = (getMaxDistance(direction) - distance) >= options.cancelThreshold;
      }

      return cancelled;
    }

    /**
     * Checks the user has pinched far enough
     * @return Boolean if <code>pinchThreshold</code> has been set, return true if the threshold was met, else false.
     * If no threshold was set, then we return true.
     * @inner
     */
    function validatePinchDistance() {
      if (options.pinchThreshold !== null) {
        return pinchDistance >= options.pinchThreshold;
      }
      return true;
    }

    /**
     * Checks that the time taken to swipe meets the minimum / maximum requirements
     * @return Boolean
     * @inner
     */
    function validateSwipeTime() {
      var result;
      //If no time set, then return true
      if (options.maxTimeThreshold) {
        if (duration >= options.maxTimeThreshold) {
          result = false;
        } else {
          result = true;
        }
      } else {
        result = true;
      }

      return result;
    }


    /**
     * Checks direction of the swipe and the value allowPageScroll to see if we should allow or prevent the default behaviour from occurring.
     * This will essentially allow page scrolling or not when the user is swiping on a touchSwipe object.
     * @param {object} jqEvent The normalised jQuery representation of the event object.
     * @param {string} direction The direction of the event. See {@link $.fn.swipe.directions}
     * @see $.fn.swipe.directions
     * @inner
     */
    function validateDefaultEvent(jqEvent, direction) {

      //If the option is set, allways allow the event to bubble up (let user handle weirdness)
      if (options.preventDefaultEvents === false) {
        return;
      }

      if (options.allowPageScroll === NONE) {
        jqEvent.preventDefault();
      } else {
        var auto = options.allowPageScroll === AUTO;

        switch (direction) {
          case LEFT:
            if ((options.swipeLeft && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) {
              jqEvent.preventDefault();
            }
            break;

          case RIGHT:
            if ((options.swipeRight && auto) || (!auto && options.allowPageScroll != HORIZONTAL)) {
              jqEvent.preventDefault();
            }
            break;

          case UP:
            if ((options.swipeUp && auto) || (!auto && options.allowPageScroll != VERTICAL)) {
              jqEvent.preventDefault();
            }
            break;

          case DOWN:
            if ((options.swipeDown && auto) || (!auto && options.allowPageScroll != VERTICAL)) {
              jqEvent.preventDefault();
            }
            break;

          case NONE:

            break;
        }
      }
    }


    // PINCHES
    /**
     * Returns true of the current pinch meets the thresholds
     * @return Boolean
     * @inner
     */
    function validatePinch() {
      var hasCorrectFingerCount = validateFingers();
      var hasEndPoint = validateEndPoint();
      var hasCorrectDistance = validatePinchDistance();
      return hasCorrectFingerCount && hasEndPoint && hasCorrectDistance;

    }

    /**
     * Returns true if any Pinch events have been registered
     * @return Boolean
     * @inner
     */
    function hasPinches() {
      //Enure we dont return 0 or null for false values
      return !!(options.pinchStatus || options.pinchIn || options.pinchOut);
    }

    /**
     * Returns true if we are detecting pinches, and have one
     * @return Boolean
     * @inner
     */
    function didPinch() {
      //Enure we dont return 0 or null for false values
      return !!(validatePinch() && hasPinches());
    }




    // SWIPES
    /**
     * Returns true if the current swipe meets the thresholds
     * @return Boolean
     * @inner
     */
    function validateSwipe() {
      //Check validity of swipe
      var hasValidTime = validateSwipeTime();
      var hasValidDistance = validateSwipeDistance();
      var hasCorrectFingerCount = validateFingers();
      var hasEndPoint = validateEndPoint();
      var didCancel = didSwipeBackToCancel();

      // if the user swiped more than the minimum length, perform the appropriate action
      // hasValidDistance is null when no distance is set
      var valid = !didCancel && hasEndPoint && hasCorrectFingerCount && hasValidDistance && hasValidTime;

      return valid;
    }

    /**
     * Returns true if any Swipe events have been registered
     * @return Boolean
     * @inner
     */
    function hasSwipes() {
      //Enure we dont return 0 or null for false values
      return !!(options.swipe || options.swipeStatus || options.swipeLeft || options.swipeRight || options.swipeUp || options.swipeDown);
    }


    /**
     * Returns true if we are detecting swipes and have one
     * @return Boolean
     * @inner
     */
    function didSwipe() {
      //Enure we dont return 0 or null for false values
      return !!(validateSwipe() && hasSwipes());
    }

    /**
     * Returns true if we have matched the number of fingers we are looking for
     * @return Boolean
     * @inner
     */
    function validateFingers() {
      //The number of fingers we want were matched, or on desktop we ignore
      return ((fingerCount === options.fingers || options.fingers === ALL_FINGERS) || !SUPPORTS_TOUCH);
    }

    /**
     * Returns true if we have an end point for the swipe
     * @return Boolean
     * @inner
     */
    function validateEndPoint() {
      //We have an end value for the finger
      return fingerData[0].end.x !== 0;
    }

    // TAP / CLICK
    /**
     * Returns true if a click / tap events have been registered
     * @return Boolean
     * @inner
     */
    function hasTap() {
      //Enure we dont return 0 or null for false values
      return !!(options.tap);
    }

    /**
     * Returns true if a double tap events have been registered
     * @return Boolean
     * @inner
     */
    function hasDoubleTap() {
      //Enure we dont return 0 or null for false values
      return !!(options.doubleTap);
    }

    /**
     * Returns true if any long tap events have been registered
     * @return Boolean
     * @inner
     */
    function hasLongTap() {
      //Enure we dont return 0 or null for false values
      return !!(options.longTap);
    }

    /**
     * Returns true if we could be in the process of a double tap (one tap has occurred, we are listening for double taps, and the threshold hasn't past.
     * @return Boolean
     * @inner
     */
    function validateDoubleTap() {
      if (doubleTapStartTime == null) {
        return false;
      }
      var now = getTimeStamp();
      return (hasDoubleTap() && ((now - doubleTapStartTime) <= options.doubleTapThreshold));
    }

    /**
     * Returns true if we could be in the process of a double tap (one tap has occurred, we are listening for double taps, and the threshold hasn't past.
     * @return Boolean
     * @inner
     */
    function inDoubleTap() {
      return validateDoubleTap();
    }


    /**
     * Returns true if we have a valid tap
     * @return Boolean
     * @inner
     */
    function validateTap() {
      return ((fingerCount === 1 || !SUPPORTS_TOUCH) && (isNaN(distance) || distance < options.threshold));
    }

    /**
     * Returns true if we have a valid long tap
     * @return Boolean
     * @inner
     */
    function validateLongTap() {
      //slight threshold on moving finger
      return ((duration > options.longTapThreshold) && (distance < DOUBLE_TAP_THRESHOLD));
    }

    /**
     * Returns true if we are detecting taps and have one
     * @return Boolean
     * @inner
     */
    function didTap() {
      //Enure we dont return 0 or null for false values
      return !!(validateTap() && hasTap());
    }


    /**
     * Returns true if we are detecting double taps and have one
     * @return Boolean
     * @inner
     */
    function didDoubleTap() {
      //Enure we dont return 0 or null for false values
      return !!(validateDoubleTap() && hasDoubleTap());
    }

    /**
     * Returns true if we are detecting long taps and have one
     * @return Boolean
     * @inner
     */
    function didLongTap() {
      //Enure we dont return 0 or null for false values
      return !!(validateLongTap() && hasLongTap());
    }




    // MULTI FINGER TOUCH
    /**
     * Starts tracking the time between 2 finger releases, and keeps track of how many fingers we initially had up
     * @inner
     */
    function startMultiFingerRelease(event) {
      previousTouchEndTime = getTimeStamp();
      fingerCountAtRelease = event.touches.length + 1;
    }

    /**
     * Cancels the tracking of time between 2 finger releases, and resets counters
     * @inner
     */
    function cancelMultiFingerRelease() {
      previousTouchEndTime = 0;
      fingerCountAtRelease = 0;
    }

    /**
     * Checks if we are in the threshold between 2 fingers being released
     * @return Boolean
     * @inner
     */
    function inMultiFingerRelease() {

      var withinThreshold = false;

      if (previousTouchEndTime) {
        var diff = getTimeStamp() - previousTouchEndTime
        if (diff <= options.fingerReleaseThreshold) {
          withinThreshold = true;
        }
      }

      return withinThreshold;
    }


    /**
     * gets a data flag to indicate that a touch is in progress
     * @return Boolean
     * @inner
     */
    function getTouchInProgress() {
      //strict equality to ensure only true and false are returned
      return !!($element.data(PLUGIN_NS + '_intouch') === true);
    }

    /**
     * Sets a data flag to indicate that a touch is in progress
     * @param {boolean} val The value to set the property to
     * @inner
     */
    function setTouchInProgress(val) {

      //If destroy is called in an event handler, we have no el, and we have already cleaned up, so return.
      if(!$element) { return; }

      //Add or remove event listeners depending on touch status
      if (val === true) {
        $element.on(MOVE_EV, touchMove);
        $element.on(END_EV, touchEnd);

        //we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit
        if (LEAVE_EV) {
          $element.on(LEAVE_EV, touchLeave);
        }
      } else {

        $element.off(MOVE_EV, touchMove, false);
        $element.off(END_EV, touchEnd, false);

        //we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit
        if (LEAVE_EV) {
          $element.off(LEAVE_EV, touchLeave, false);
        }
      }


      //strict equality to ensure only true and false can update the value
      $element.data(PLUGIN_NS + '_intouch', val === true);
    }


    /**
     * Creates the finger data for the touch/finger in the event object.
     * @param {int} id The id to store the finger data under (usually the order the fingers were pressed)
     * @param {object} evt The event object containing finger data
     * @return finger data object
     * @inner
     */
    function createFingerData(id, evt) {
      var f = {
        start: {
          x: 0,
          y: 0
        },
        last: {
          x: 0,
          y: 0
        },
        end: {
          x: 0,
          y: 0
        }
      };
      f.start.x = f.last.x = f.end.x = evt.pageX || evt.clientX;
      f.start.y = f.last.y = f.end.y = evt.pageY || evt.clientY;
      fingerData[id] = f;
      return f;
    }

    /**
     * Updates the finger data for a particular event object
     * @param {object} evt The event object containing the touch/finger data to upadte
     * @return a finger data object.
     * @inner
     */
    function updateFingerData(evt) {
      var id = evt.identifier !== undefined ? evt.identifier : 0;
      var f = getFingerData(id);

      if (f === null) {
        f = createFingerData(id, evt);
      }

      f.last.x = f.end.x;
      f.last.y = f.end.y;

      f.end.x = evt.pageX || evt.clientX;
      f.end.y = evt.pageY || evt.clientY;

      return f;
    }

    /**
     * Returns a finger data object by its event ID.
     * Each touch event has an identifier property, which is used
     * to track repeat touches
     * @param {int} id The unique id of the finger in the sequence of touch events.
     * @return a finger data object.
     * @inner
     */
    function getFingerData(id) {
      return fingerData[id] || null;
    }


    /**
     * Sets the maximum distance swiped in the given direction.
     * If the new value is lower than the current value, the max value is not changed.
     * @param {string}  direction The direction of the swipe
     * @param {int}  distance The distance of the swipe
     * @inner
     */
    function setMaxDistance(direction, distance) {
      if(direction==NONE) return;
      distance = Math.max(distance, getMaxDistance(direction));
      maximumsMap[direction].distance = distance;
    }

    /**
     * gets the maximum distance swiped in the given direction.
     * @param {string}  direction The direction of the swipe
     * @return int  The distance of the swipe
     * @inner
     */
    function getMaxDistance(direction) {
      if (maximumsMap[direction]) return maximumsMap[direction].distance;
      return undefined;
    }

    /**
     * Creats a map of directions to maximum swiped values.
     * @return Object A dictionary of maximum values, indexed by direction.
     * @inner
     */
    function createMaximumsData() {
      var maxData = {};
      maxData[LEFT] = createMaximumVO(LEFT);
      maxData[RIGHT] = createMaximumVO(RIGHT);
      maxData[UP] = createMaximumVO(UP);
      maxData[DOWN] = createMaximumVO(DOWN);

      return maxData;
    }

    /**
     * Creates a map maximum swiped values for a given swipe direction
     * @param {string} The direction that these values will be associated with
     * @return Object Maximum values
     * @inner
     */
    function createMaximumVO(dir) {
      return {
        direction: dir,
        distance: 0
      }
    }


    //
    // MATHS / UTILS
    //

    /**
     * Calculate the duration of the swipe
     * @return int
     * @inner
     */
    function calculateDuration() {
      return endTime - startTime;
    }

    /**
     * Calculate the distance between 2 touches (pinch)
     * @param {point} startPoint A point object containing x and y co-ordinates
     * @param {point} endPoint A point object containing x and y co-ordinates
     * @return int;
     * @inner
     */
    function calculateTouchesDistance(startPoint, endPoint) {
      var diffX = Math.abs(startPoint.x - endPoint.x);
      var diffY = Math.abs(startPoint.y - endPoint.y);

      return Math.round(Math.sqrt(diffX * diffX + diffY * diffY));
    }

    /**
     * Calculate the zoom factor between the start and end distances
     * @param {int} startDistance Distance (between 2 fingers) the user started pinching at
     * @param {int} endDistance Distance (between 2 fingers) the user ended pinching at
     * @return float The zoom value from 0 to 1.
     * @inner
     */
    function calculatePinchZoom(startDistance, endDistance) {
      var percent = (endDistance / startDistance) * 1;
      return percent.toFixed(2);
    }


    /**
     * Returns the pinch direction, either IN or OUT for the given points
     * @return string Either {@link $.fn.swipe.directions.IN} or {@link $.fn.swipe.directions.OUT}
     * @see $.fn.swipe.directions
     * @inner
     */
    function calculatePinchDirection() {
      if (pinchZoom < 1) {
        return OUT;
      } else {
        return IN;
      }
    }


    /**
     * Calculate the length / distance of the swipe
     * @param {point} startPoint A point object containing x and y co-ordinates
     * @param {point} endPoint A point object containing x and y co-ordinates
     * @return int
     * @inner
     */
    function calculateDistance(startPoint, endPoint) {
      return Math.round(Math.sqrt(Math.pow(endPoint.x - startPoint.x, 2) + Math.pow(endPoint.y - startPoint.y, 2)));
    }

    /**
     * Calculate the angle of the swipe
     * @param {point} startPoint A point object containing x and y co-ordinates
     * @param {point} endPoint A point object containing x and y co-ordinates
     * @return int
     * @inner
     */
    function calculateAngle(startPoint, endPoint) {
      var x = startPoint.x - endPoint.x;
      var y = endPoint.y - startPoint.y;
      var r = Math.atan2(y, x); //radians
      var angle = Math.round(r * 180 / Math.PI); //degrees

      //ensure value is positive
      if (angle < 0) {
        angle = 360 - Math.abs(angle);
      }

      return angle;
    }

    /**
     * Calculate the direction of the swipe
     * This will also call calculateAngle to get the latest angle of swipe
     * @param {point} startPoint A point object containing x and y co-ordinates
     * @param {point} endPoint A point object containing x and y co-ordinates
     * @return string Either {@link $.fn.swipe.directions.LEFT} / {@link $.fn.swipe.directions.RIGHT} / {@link $.fn.swipe.directions.DOWN} / {@link $.fn.swipe.directions.UP}
     * @see $.fn.swipe.directions
     * @inner
     */
    function calculateDirection(startPoint, endPoint) {

      if( comparePoints(startPoint, endPoint) ) {
        return NONE;
      }

      var angle = calculateAngle(startPoint, endPoint);

      if ((angle <= 45) && (angle >= 0)) {
        return LEFT;
      } else if ((angle <= 360) && (angle >= 315)) {
        return LEFT;
      } else if ((angle >= 135) && (angle <= 225)) {
        return RIGHT;
      } else if ((angle > 45) && (angle < 135)) {
        return DOWN;
      } else {
        return UP;
      }
    }


    /**
     * Returns a MS time stamp of the current time
     * @return int
     * @inner
     */
    function getTimeStamp() {
      var now = new Date();
      return now.getTime();
    }



    /**
     * Returns a bounds object with left, right, top and bottom properties for the element specified.
     * @param {DomNode} The DOM node to get the bounds for.
     */
    function getbounds(el) {
      el = $(el);
      var offset = el.offset();

      var bounds = {
        left: offset.left,
        right: offset.left + el.outerWidth(),
        top: offset.top,
        bottom: offset.top + el.outerHeight()
      }

      return bounds;
    }


    /**
     * Checks if the point object is in the bounds object.
     * @param {object} point A point object.
     * @param {int} point.x The x value of the point.
     * @param {int} point.y The x value of the point.
     * @param {object} bounds The bounds object to test
     * @param {int} bounds.left The leftmost value
     * @param {int} bounds.right The righttmost value
     * @param {int} bounds.top The topmost value
     * @param {int} bounds.bottom The bottommost value
     */
    function isInBounds(point, bounds) {
      return (point.x > bounds.left && point.x < bounds.right && point.y > bounds.top && point.y < bounds.bottom);
    };

    /**
     * Checks if the two points are equal
     * @param {object} point A point object.
     * @param {object} point B point object.
     * @return true of the points match
     */
    function comparePoints(pointA, pointB) {
      return (pointA.x == pointB.x && pointA.y == pointB.y);
    }


  }




  /**
   * A catch all handler that is triggered for all swipe directions.
   * @name $.fn.swipe#swipe
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user swiped
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {object} fingerData The coordinates of fingers in event
   * @param {string} currentDirection The current direction the user is swiping.
   */




  /**
   * A handler that is triggered for "left" swipes.
   * @name $.fn.swipe#swipeLeft
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user swiped
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {object} fingerData The coordinates of fingers in event
   * @param {string} currentDirection The current direction the user is swiping.
   */

  /**
   * A handler that is triggered for "right" swipes.
   * @name $.fn.swipe#swipeRight
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user swiped
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {object} fingerData The coordinates of fingers in event
   * @param {string} currentDirection The current direction the user is swiping.
   */

  /**
   * A handler that is triggered for "up" swipes.
   * @name $.fn.swipe#swipeUp
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user swiped
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {object} fingerData The coordinates of fingers in event
   * @param {string} currentDirection The current direction the user is swiping.
   */

  /**
   * A handler that is triggered for "down" swipes.
   * @name $.fn.swipe#swipeDown
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {int} direction The direction the user swiped in. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user swiped
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {object} fingerData The coordinates of fingers in event
   * @param {string} currentDirection The current direction the user is swiping.
   */

  /**
   * A handler triggered for every phase of the swipe. This handler is constantly fired for the duration of the pinch.
   * This is triggered regardless of swipe thresholds.
   * @name $.fn.swipe#swipeStatus
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {string} phase The phase of the swipe event. See {@link $.fn.swipe.phases}
   * @param {string} direction The direction the user swiped in. This is null if the user has yet to move. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user swiped. This is 0 if the user has yet to move.
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {object} fingerData The coordinates of fingers in event
   * @param {string} currentDirection The current direction the user is swiping.
   */

  /**
   * A handler triggered for pinch in events.
   * @name $.fn.swipe#pinchIn
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user pinched
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {int} zoom The zoom/scale level the user pinched too, 0-1.
   * @param {object} fingerData The coordinates of fingers in event
   */

  /**
   * A handler triggered for pinch out events.
   * @name $.fn.swipe#pinchOut
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user pinched
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {int} zoom The zoom/scale level the user pinched too, 0-1.
   * @param {object} fingerData The coordinates of fingers in event
   */

  /**
   * A handler triggered for all pinch events. This handler is constantly fired for the duration of the pinch. This is triggered regardless of thresholds.
   * @name $.fn.swipe#pinchStatus
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {int} direction The direction the user pinched in. See {@link $.fn.swipe.directions}
   * @param {int} distance The distance the user pinched
   * @param {int} duration The duration of the swipe in milliseconds
   * @param {int} fingerCount The number of fingers used. See {@link $.fn.swipe.fingers}
   * @param {int} zoom The zoom/scale level the user pinched too, 0-1.
   * @param {object} fingerData The coordinates of fingers in event
   */

  /**
   * A click handler triggered when a user simply clicks, rather than swipes on an element.
   * This is deprecated since version 1.6.2, any assignment to click will be assigned to the tap handler.
   * You cannot use <code>on</code> to bind to this event as the default jQ <code>click</code> event will be triggered.
   * Use the <code>tap</code> event instead.
   * @name $.fn.swipe#click
   * @event
   * @deprecated since version 1.6.2, please use {@link $.fn.swipe#tap} instead
   * @default null
   * @param {EventObject} event The original event object
   * @param {DomObject} target The element clicked on.
   */

  /**
   * A click / tap handler triggered when a user simply clicks or taps, rather than swipes on an element.
   * @name $.fn.swipe#tap
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {DomObject} target The element clicked on.
   */

  /**
   * A double tap handler triggered when a user double clicks or taps on an element.
   * You can set the time delay for a double tap with the {@link $.fn.swipe.defaults#doubleTapThreshold} property.
   * Note: If you set both <code>doubleTap</code> and <code>tap</code> handlers, the <code>tap</code> event will be delayed by the <code>doubleTapThreshold</code>
   * as the script needs to check if its a double tap.
   * @name $.fn.swipe#doubleTap
   * @see  $.fn.swipe.defaults#doubleTapThreshold
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {DomObject} target The element clicked on.
   */

  /**
   * A long tap handler triggered once a tap has been release if the tap was longer than the longTapThreshold.
   * You can set the time delay for a long tap with the {@link $.fn.swipe.defaults#longTapThreshold} property.
   * @name $.fn.swipe#longTap
   * @see  $.fn.swipe.defaults#longTapThreshold
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {DomObject} target The element clicked on.
   */

  /**
   * A hold tap handler triggered as soon as the longTapThreshold is reached
   * You can set the time delay for a long tap with the {@link $.fn.swipe.defaults#longTapThreshold} property.
   * @name $.fn.swipe#hold
   * @see  $.fn.swipe.defaults#longTapThreshold
   * @event
   * @default null
   * @param {EventObject} event The original event object
   * @param {DomObject} target The element clicked on.
   */

}));

/**
 * @license Underscore.js 1.8.3
 * http://underscorejs.org
 * (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 * Underscore may be freely distributed under the MIT license.
 */
(function() {

  // Baseline setup
  // --------------

  // Establish the root object, `window` in the browser, or `exports` on the server.
  var root = this;

  // Save the previous value of the `_` variable.
  var previousUnderscore = root._;

  // Save bytes in the minified (but not gzipped) version:
  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;

  // Create quick reference variables for speed access to core prototypes.
  var
    push             = ArrayProto.push,
    slice            = ArrayProto.slice,
    toString         = ObjProto.toString,
    hasOwnProperty   = ObjProto.hasOwnProperty;

  // All **ECMAScript 5** native function implementations that we hope to use
  // are declared here.
  var
    nativeIsArray      = Array.isArray,
    nativeKeys         = Object.keys,
    nativeBind         = FuncProto.bind,
    nativeCreate       = Object.create;

  // Naked function reference for surrogate-prototype-swapping.
  var Ctor = function(){};

  // Create a safe reference to the Underscore object for use below.
  var _ = function(obj) {
    if (obj instanceof _) return obj;
    if (!(this instanceof _)) return new _(obj);
    this._wrapped = obj;
  };

  // Export the Underscore object for **Node.js**, with
  // backwards-compatibility for the old `require()` API. If we're in
  // the browser, add `_` as a global object.
  if (typeof exports !== 'undefined') {
    if (typeof module !== 'undefined' && module.exports) {
      exports = module.exports = _;
    }
    exports._ = _;
  } else {
    root._ = _;
  }

  // Current version.
  _.VERSION = '1.8.3';

  // Internal function that returns an efficient (for current engines) version
  // of the passed-in callback, to be repeatedly applied in other Underscore
  // functions.
  var optimizeCb = function(func, context, argCount) {
    if (context === void 0) return func;
    switch (argCount == null ? 3 : argCount) {
      case 1: return function(value) {
        return func.call(context, value);
      };
      case 2: return function(value, other) {
        return func.call(context, value, other);
      };
      case 3: return function(value, index, collection) {
        return func.call(context, value, index, collection);
      };
      case 4: return function(accumulator, value, index, collection) {
        return func.call(context, accumulator, value, index, collection);
      };
    }
    return function() {
      return func.apply(context, arguments);
    };
  };

  // A mostly-internal function to generate callbacks that can be applied
  // to each element in a collection, returning the desired result ? either
  // identity, an arbitrary callback, a property matcher, or a property accessor.
  var cb = function(value, context, argCount) {
    if (value == null) return _.identity;
    if (_.isFunction(value)) return optimizeCb(value, context, argCount);
    if (_.isObject(value)) return _.matcher(value);
    return _.property(value);
  };
  _.iteratee = function(value, context) {
    return cb(value, context, Infinity);
  };

  // An internal function for creating assigner functions.
  var createAssigner = function(keysFunc, undefinedOnly) {
    return function(obj) {
      var length = arguments.length;
      if (length < 2 || obj == null) return obj;
      for (var index = 1; index < length; index++) {
        var source = arguments[index],
            keys = keysFunc(source),
            l = keys.length;
        for (var i = 0; i < l; i++) {
          var key = keys[i];
          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
        }
      }
      return obj;
    };
  };

  // An internal function for creating a new object that inherits from another.
  var baseCreate = function(prototype) {
    if (!_.isObject(prototype)) return {};
    if (nativeCreate) return nativeCreate(prototype);
    Ctor.prototype = prototype;
    var result = new Ctor;
    Ctor.prototype = null;
    return result;
  };

  var property = function(key) {
    return function(obj) {
      return obj == null ? void 0 : obj[key];
    };
  };

  // Helper for collection methods to determine whether a collection
  // should be iterated as an array or as an object
  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
  // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
  var getLength = property('length');
  var isArrayLike = function(collection) {
    var length = getLength(collection);
    return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
  };

  // Collection Functions
  // --------------------

  // The cornerstone, an `each` implementation, aka `forEach`.
  // Handles raw objects in addition to array-likes. Treats all
  // sparse array-likes as if they were dense.
  _.each = _.forEach = function(obj, iteratee, context) {
    iteratee = optimizeCb(iteratee, context);
    var i, length;
    if (isArrayLike(obj)) {
      for (i = 0, length = obj.length; i < length; i++) {
        iteratee(obj[i], i, obj);
      }
    } else {
      var keys = _.keys(obj);
      for (i = 0, length = keys.length; i < length; i++) {
        iteratee(obj[keys[i]], keys[i], obj);
      }
    }
    return obj;
  };

  // Return the results of applying the iteratee to each element.
  _.map = _.collect = function(obj, iteratee, context) {
    iteratee = cb(iteratee, context);
    var keys = !isArrayLike(obj) && _.keys(obj),
        length = (keys || obj).length,
        results = Array(length);
    for (var index = 0; index < length; index++) {
      var currentKey = keys ? keys[index] : index;
      results[index] = iteratee(obj[currentKey], currentKey, obj);
    }
    return results;
  };

  // Create a reducing function iterating left or right.
  function createReduce(dir) {
    // Optimized iterator function as using arguments.length
    // in the main function will deoptimize the, see #1991.
    function iterator(obj, iteratee, memo, keys, index, length) {
      for (; index >= 0 && index < length; index += dir) {
        var currentKey = keys ? keys[index] : index;
        memo = iteratee(memo, obj[currentKey], currentKey, obj);
      }
      return memo;
    }

    return function(obj, iteratee, memo, context) {
      iteratee = optimizeCb(iteratee, context, 4);
      var keys = !isArrayLike(obj) && _.keys(obj),
          length = (keys || obj).length,
          index = dir > 0 ? 0 : length - 1;
      // Determine the initial value if none is provided.
      if (arguments.length < 3) {
        memo = obj[keys ? keys[index] : index];
        index += dir;
      }
      return iterator(obj, iteratee, memo, keys, index, length);
    };
  }

  // **Reduce** builds up a single result from a list of values, aka `inject`,
  // or `foldl`.
  _.reduce = _.foldl = _.inject = createReduce(1);

  // The right-associative version of reduce, also known as `foldr`.
  _.reduceRight = _.foldr = createReduce(-1);

  // Return the first value which passes a truth test. Aliased as `detect`.
  _.find = _.detect = function(obj, predicate, context) {
    var key;
    if (isArrayLike(obj)) {
      key = _.findIndex(obj, predicate, context);
    } else {
      key = _.findKey(obj, predicate, context);
    }
    if (key !== void 0 && key !== -1) return obj[key];
  };

  // Return all the elements that pass a truth test.
  // Aliased as `select`.
  _.filter = _.select = function(obj, predicate, context) {
    var results = [];
    predicate = cb(predicate, context);
    _.each(obj, function(value, index, list) {
      if (predicate(value, index, list)) results.push(value);
    });
    return results;
  };

  // Return all the elements for which a truth test fails.
  _.reject = function(obj, predicate, context) {
    return _.filter(obj, _.negate(cb(predicate)), context);
  };

  // Determine whether all of the elements match a truth test.
  // Aliased as `all`.
  _.every = _.all = function(obj, predicate, context) {
    predicate = cb(predicate, context);
    var keys = !isArrayLike(obj) && _.keys(obj),
        length = (keys || obj).length;
    for (var index = 0; index < length; index++) {
      var currentKey = keys ? keys[index] : index;
      if (!predicate(obj[currentKey], currentKey, obj)) return false;
    }
    return true;
  };

  // Determine if at least one element in the object matches a truth test.
  // Aliased as `any`.
  _.some = _.any = function(obj, predicate, context) {
    predicate = cb(predicate, context);
    var keys = !isArrayLike(obj) && _.keys(obj),
        length = (keys || obj).length;
    for (var index = 0; index < length; index++) {
      var currentKey = keys ? keys[index] : index;
      if (predicate(obj[currentKey], currentKey, obj)) return true;
    }
    return false;
  };

  // Determine if the array or object contains a given item (using `===`).
  // Aliased as `includes` and `include`.
  _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {
    if (!isArrayLike(obj)) obj = _.values(obj);
    if (typeof fromIndex != 'number' || guard) fromIndex = 0;
    return _.indexOf(obj, item, fromIndex) >= 0;
  };

  // Invoke a method (with arguments) on every item in a collection.
  _.invoke = function(obj, method) {
    var args = slice.call(arguments, 2);
    var isFunc = _.isFunction(method);
    return _.map(obj, function(value) {
      var func = isFunc ? method : value[method];
      return func == null ? func : func.apply(value, args);
    });
  };

  // Convenience version of a common use case of `map`: fetching a property.
  _.pluck = function(obj, key) {
    return _.map(obj, _.property(key));
  };

  // Convenience version of a common use case of `filter`: selecting only objects
  // containing specific `key:value` pairs.
  _.where = function(obj, attrs) {
    return _.filter(obj, _.matcher(attrs));
  };

  // Convenience version of a common use case of `find`: getting the first object
  // containing specific `key:value` pairs.
  _.findWhere = function(obj, attrs) {
    return _.find(obj, _.matcher(attrs));
  };

  // Return the maximum element (or element-based computation).
  _.max = function(obj, iteratee, context) {
    var result = -Infinity, lastComputed = -Infinity,
        value, computed;
    if (iteratee == null && obj != null) {
      obj = isArrayLike(obj) ? obj : _.values(obj);
      for (var i = 0, length = obj.length; i < length; i++) {
        value = obj[i];
        if (value > result) {
          result = value;
        }
      }
    } else {
      iteratee = cb(iteratee, context);
      _.each(obj, function(value, index, list) {
        computed = iteratee(value, index, list);
        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
          result = value;
          lastComputed = computed;
        }
      });
    }
    return result;
  };

  // Return the minimum element (or element-based computation).
  _.min = function(obj, iteratee, context) {
    var result = Infinity, lastComputed = Infinity,
        value, computed;
    if (iteratee == null && obj != null) {
      obj = isArrayLike(obj) ? obj : _.values(obj);
      for (var i = 0, length = obj.length; i < length; i++) {
        value = obj[i];
        if (value < result) {
          result = value;
        }
      }
    } else {
      iteratee = cb(iteratee, context);
      _.each(obj, function(value, index, list) {
        computed = iteratee(value, index, list);
        if (computed < lastComputed || computed === Infinity && result === Infinity) {
          result = value;
          lastComputed = computed;
        }
      });
    }
    return result;
  };

  // Shuffle a collection, using the modern version of the
  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher?Yates_shuffle).
  _.shuffle = function(obj) {
    var set = isArrayLike(obj) ? obj : _.values(obj);
    var length = set.length;
    var shuffled = Array(length);
    for (var index = 0, rand; index < length; index++) {
      rand = _.random(0, index);
      if (rand !== index) shuffled[index] = shuffled[rand];
      shuffled[rand] = set[index];
    }
    return shuffled;
  };

  // Sample **n** random values from a collection.
  // If **n** is not specified, returns a single random element.
  // The internal `guard` argument allows it to work with `map`.
  _.sample = function(obj, n, guard) {
    if (n == null || guard) {
      if (!isArrayLike(obj)) obj = _.values(obj);
      return obj[_.random(obj.length - 1)];
    }
    return _.shuffle(obj).slice(0, Math.max(0, n));
  };

  // Sort the object's values by a criterion produced by an iteratee.
  _.sortBy = function(obj, iteratee, context) {
    iteratee = cb(iteratee, context);
    return _.pluck(_.map(obj, function(value, index, list) {
      return {
        value: value,
        index: index,
        criteria: iteratee(value, index, list)
      };
    }).sort(function(left, right) {
      var a = left.criteria;
      var b = right.criteria;
      if (a !== b) {
        if (a > b || a === void 0) return 1;
        if (a < b || b === void 0) return -1;
      }
      return left.index - right.index;
    }), 'value');
  };

  // An internal function used for aggregate "group by" operations.
  var group = function(behavior) {
    return function(obj, iteratee, context) {
      var result = {};
      iteratee = cb(iteratee, context);
      _.each(obj, function(value, index) {
        var key = iteratee(value, index, obj);
        behavior(result, value, key);
      });
      return result;
    };
  };

  // Groups the object's values by a criterion. Pass either a string attribute
  // to group by, or a function that returns the criterion.
  _.groupBy = group(function(result, value, key) {
    if (_.has(result, key)) result[key].push(value); else result[key] = [value];
  });

  // Indexes the object's values by a criterion, similar to `groupBy`, but for
  // when you know that your index values will be unique.
  _.indexBy = group(function(result, value, key) {
    result[key] = value;
  });

  // Counts instances of an object that group by a certain criterion. Pass
  // either a string attribute to count by, or a function that returns the
  // criterion.
  _.countBy = group(function(result, value, key) {
    if (_.has(result, key)) result[key]++; else result[key] = 1;
  });

  // Safely create a real, live array from anything iterable.
  _.toArray = function(obj) {
    if (!obj) return [];
    if (_.isArray(obj)) return slice.call(obj);
    if (isArrayLike(obj)) return _.map(obj, _.identity);
    return _.values(obj);
  };

  // Return the number of elements in an object.
  _.size = function(obj) {
    if (obj == null) return 0;
    return isArrayLike(obj) ? obj.length : _.keys(obj).length;
  };

  // Split a collection into two arrays: one whose elements all satisfy the given
  // predicate, and one whose elements all do not satisfy the predicate.
  _.partition = function(obj, predicate, context) {
    predicate = cb(predicate, context);
    var pass = [], fail = [];
    _.each(obj, function(value, key, obj) {
      (predicate(value, key, obj) ? pass : fail).push(value);
    });
    return [pass, fail];
  };

  // Array Functions
  // ---------------

  // Get the first element of an array. Passing **n** will return the first N
  // values in the array. Aliased as `head` and `take`. The **guard** check
  // allows it to work with `_.map`.
  _.first = _.head = _.take = function(array, n, guard) {
    if (array == null) return void 0;
    if (n == null || guard) return array[0];
    return _.initial(array, array.length - n);
  };

  // Returns everything but the last entry of the array. Especially useful on
  // the arguments object. Passing **n** will return all the values in
  // the array, excluding the last N.
  _.initial = function(array, n, guard) {
    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
  };

  // Get the last element of an array. Passing **n** will return the last N
  // values in the array.
  _.last = function(array, n, guard) {
    if (array == null) return void 0;
    if (n == null || guard) return array[array.length - 1];
    return _.rest(array, Math.max(0, array.length - n));
  };

  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
  // Especially useful on the arguments object. Passing an **n** will return
  // the rest N values in the array.
  _.rest = _.tail = _.drop = function(array, n, guard) {
    return slice.call(array, n == null || guard ? 1 : n);
  };

  // Trim out all falsy values from an array.
  _.compact = function(array) {
    return _.filter(array, _.identity);
  };

  // Internal implementation of a recursive `flatten` function.
  var flatten = function(input, shallow, strict, startIndex) {
    var output = [], idx = 0;
    for (var i = startIndex || 0, length = getLength(input); i < length; i++) {
      var value = input[i];
      if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
        //flatten current level of array or arguments object
        if (!shallow) value = flatten(value, shallow, strict);
        var j = 0, len = value.length;
        output.length += len;
        while (j < len) {
          output[idx++] = value[j++];
        }
      } else if (!strict) {
        output[idx++] = value;
      }
    }
    return output;
  };

  // Flatten out an array, either recursively (by default), or just one level.
  _.flatten = function(array, shallow) {
    return flatten(array, shallow, false);
  };

  // Return a version of the array that does not contain the specified value(s).
  _.without = function(array) {
    return _.difference(array, slice.call(arguments, 1));
  };

  // Produce a duplicate-free version of the array. If the array has already
  // been sorted, you have the option of using a faster algorithm.
  // Aliased as `unique`.
  _.uniq = _.unique = function(array, isSorted, iteratee, context) {
    if (!_.isBoolean(isSorted)) {
      context = iteratee;
      iteratee = isSorted;
      isSorted = false;
    }
    if (iteratee != null) iteratee = cb(iteratee, context);
    var result = [];
    var seen = [];
    for (var i = 0, length = getLength(array); i < length; i++) {
      var value = array[i],
          computed = iteratee ? iteratee(value, i, array) : value;
      if (isSorted) {
        if (!i || seen !== computed) result.push(value);
        seen = computed;
      } else if (iteratee) {
        if (!_.contains(seen, computed)) {
          seen.push(computed);
          result.push(value);
        }
      } else if (!_.contains(result, value)) {
        result.push(value);
      }
    }
    return result;
  };

  // Produce an array that contains the union: each distinct element from all of
  // the passed-in arrays.
  _.union = function() {
    return _.uniq(flatten(arguments, true, true));
  };

  // Produce an array that contains every item shared between all the
  // passed-in arrays.
  _.intersection = function(array) {
    var result = [];
    var argsLength = arguments.length;
    for (var i = 0, length = getLength(array); i < length; i++) {
      var item = array[i];
      if (_.contains(result, item)) continue;
      for (var j = 1; j < argsLength; j++) {
        if (!_.contains(arguments[j], item)) break;
      }
      if (j === argsLength) result.push(item);
    }
    return result;
  };

  // Take the difference between one array and a number of other arrays.
  // Only the elements present in just the first array will remain.
  _.difference = function(array) {
    var rest = flatten(arguments, true, true, 1);
    return _.filter(array, function(value){
      return !_.contains(rest, value);
    });
  };

  // Zip together multiple lists into a single array -- elements that share
  // an index go together.
  _.zip = function() {
    return _.unzip(arguments);
  };

  // Complement of _.zip. Unzip accepts an array of arrays and groups
  // each array's elements on shared indices
  _.unzip = function(array) {
    var length = array && _.max(array, getLength).length || 0;
    var result = Array(length);

    for (var index = 0; index < length; index++) {
      result[index] = _.pluck(array, index);
    }
    return result;
  };

  // Converts lists into objects. Pass either a single array of `[key, value]`
  // pairs, or two parallel arrays of the same length -- one of keys, and one of
  // the corresponding values.
  _.object = function(list, values) {
    var result = {};
    for (var i = 0, length = getLength(list); i < length; i++) {
      if (values) {
        result[list[i]] = values[i];
      } else {
        result[list[i][0]] = list[i][1];
      }
    }
    return result;
  };

  // Generator function to create the findIndex and findLastIndex functions
  function createPredicateIndexFinder(dir) {
    return function(array, predicate, context) {
      predicate = cb(predicate, context);
      var length = getLength(array);
      var index = dir > 0 ? 0 : length - 1;
      for (; index >= 0 && index < length; index += dir) {
        if (predicate(array[index], index, array)) return index;
      }
      return -1;
    };
  }

  // Returns the first index on an array-like that passes a predicate test
  _.findIndex = createPredicateIndexFinder(1);
  _.findLastIndex = createPredicateIndexFinder(-1);

  // Use a comparator function to figure out the smallest index at which
  // an object should be inserted so as to maintain order. Uses binary search.
  _.sortedIndex = function(array, obj, iteratee, context) {
    iteratee = cb(iteratee, context, 1);
    var value = iteratee(obj);
    var low = 0, high = getLength(array);
    while (low < high) {
      var mid = Math.floor((low + high) / 2);
      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
    }
    return low;
  };

  // Generator function to create the indexOf and lastIndexOf functions
  function createIndexFinder(dir, predicateFind, sortedIndex) {
    return function(array, item, idx) {
      var i = 0, length = getLength(array);
      if (typeof idx == 'number') {
        if (dir > 0) {
            i = idx >= 0 ? idx : Math.max(idx + length, i);
        } else {
            length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
        }
      } else if (sortedIndex && idx && length) {
        idx = sortedIndex(array, item);
        return array[idx] === item ? idx : -1;
      }
      if (item !== item) {
        idx = predicateFind(slice.call(array, i, length), _.isNaN);
        return idx >= 0 ? idx + i : -1;
      }
      for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
        if (array[idx] === item) return idx;
      }
      return -1;
    };
  }

  // Return the position of the first occurrence of an item in an array,
  // or -1 if the item is not included in the array.
  // If the array is large and already in sort order, pass `true`
  // for **isSorted** to use binary search.
  _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);
  _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);

  // Generate an integer Array containing an arithmetic progression. A port of
  // the native Python `range()` function. See
  // [the Python documentation](http://docs.python.org/library/functions.html#range).
  _.range = function(start, stop, step) {
    if (stop == null) {
      stop = start || 0;
      start = 0;
    }
    step = step || 1;

    var length = Math.max(Math.ceil((stop - start) / step), 0);
    var range = Array(length);

    for (var idx = 0; idx < length; idx++, start += step) {
      range[idx] = start;
    }

    return range;
  };

  // Function (ahem) Functions
  // ------------------

  // Determines whether to execute a function as a constructor
  // or a normal function with the provided arguments
  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
    var self = baseCreate(sourceFunc.prototype);
    var result = sourceFunc.apply(self, args);
    if (_.isObject(result)) return result;
    return self;
  };

  // Create a function bound to a given object (assigning `this`, and arguments,
  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
  // available.
  _.bind = function(func, context) {
    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
    if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
    var args = slice.call(arguments, 2);
    var bound = function() {
      return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
    };
    return bound;
  };

  // Partially apply a function by creating a version that has had some of its
  // arguments pre-filled, without changing its dynamic `this` context. _ acts
  // as a placeholder, allowing any combination of arguments to be pre-filled.
  _.partial = function(func) {
    var boundArgs = slice.call(arguments, 1);
    var bound = function() {
      var position = 0, length = boundArgs.length;
      var args = Array(length);
      for (var i = 0; i < length; i++) {
        args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
      }
      while (position < arguments.length) args.push(arguments[position++]);
      return executeBound(func, bound, this, this, args);
    };
    return bound;
  };

  // Bind a number of an object's methods to that object. Remaining arguments
  // are the method names to be bound. Useful for ensuring that all callbacks
  // defined on an object belong to it.
  _.bindAll = function(obj) {
    var i, length = arguments.length, key;
    if (length <= 1) throw new Error('bindAll must be passed function names');
    for (i = 1; i < length; i++) {
      key = arguments[i];
      obj[key] = _.bind(obj[key], obj);
    }
    return obj;
  };

  // Memoize an expensive function by storing its results.
  _.memoize = function(func, hasher) {
    var memoize = function(key) {
      var cache = memoize.cache;
      var address = '' + (hasher ? hasher.apply(this, arguments) : key);
      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
      return cache[address];
    };
    memoize.cache = {};
    return memoize;
  };

  // Delays a function for the given number of milliseconds, and then calls
  // it with the arguments supplied.
  _.delay = function(func, wait) {
    var args = slice.call(arguments, 2);
    return setTimeout(function(){
      return func.apply(null, args);
    }, wait);
  };

  // Defers a function, scheduling it to run after the current call stack has
  // cleared.
  _.defer = _.partial(_.delay, _, 1);

  // Returns a function, that, when invoked, will only be triggered at most once
  // during a given window of time. Normally, the throttled function will run
  // as much as it can, without ever going more than once per `wait` duration;
  // but if you'd like to disable the execution on the leading edge, pass
  // `{leading: false}`. To disable execution on the trailing edge, ditto.
  _.throttle = function(func, wait, options) {
    var context, args, result;
    var timeout = null;
    var previous = 0;
    if (!options) options = {};
    var later = function() {
      previous = options.leading === false ? 0 : _.now();
      timeout = null;
      result = func.apply(context, args);
      if (!timeout) context = args = null;
    };
    return function() {
      var now = _.now();
      if (!previous && options.leading === false) previous = now;
      var remaining = wait - (now - previous);
      context = this;
      args = arguments;
      if (remaining <= 0 || remaining > wait) {
        if (timeout) {
          clearTimeout(timeout);
          timeout = null;
        }
        previous = now;
        result = func.apply(context, args);
        if (!timeout) context = args = null;
      } else if (!timeout && options.trailing !== false) {
        timeout = setTimeout(later, remaining);
      }
      return result;
    };
  };

  // Returns a function, that, as long as it continues to be invoked, will not
  // be triggered. The function will be called after it stops being called for
  // N milliseconds. If `immediate` is passed, trigger the function on the
  // leading edge, instead of the trailing.
  _.debounce = function(func, wait, immediate) {
    var timeout, args, context, timestamp, result;

    var later = function() {
      var last = _.now() - timestamp;

      if (last < wait && last >= 0) {
        timeout = setTimeout(later, wait - last);
      } else {
        timeout = null;
        if (!immediate) {
          result = func.apply(context, args);
          if (!timeout) context = args = null;
        }
      }
    };

    return function() {
      context = this;
      args = arguments;
      timestamp = _.now();
      var callNow = immediate && !timeout;
      if (!timeout) timeout = setTimeout(later, wait);
      if (callNow) {
        result = func.apply(context, args);
        context = args = null;
      }

      return result;
    };
  };

  // Returns the first function passed as an argument to the second,
  // allowing you to adjust arguments, run code before and after, and
  // conditionally execute the original function.
  _.wrap = function(func, wrapper) {
    return _.partial(wrapper, func);
  };

  // Returns a negated version of the passed-in predicate.
  _.negate = function(predicate) {
    return function() {
      return !predicate.apply(this, arguments);
    };
  };

  // Returns a function that is the composition of a list of functions, each
  // consuming the return value of the function that follows.
  _.compose = function() {
    var args = arguments;
    var start = args.length - 1;
    return function() {
      var i = start;
      var result = args[start].apply(this, arguments);
      while (i--) result = args[i].call(this, result);
      return result;
    };
  };

  // Returns a function that will only be executed on and after the Nth call.
  _.after = function(times, func) {
    return function() {
      if (--times < 1) {
        return func.apply(this, arguments);
      }
    };
  };

  // Returns a function that will only be executed up to (but not including) the Nth call.
  _.before = function(times, func) {
    var memo;
    return function() {
      if (--times > 0) {
        memo = func.apply(this, arguments);
      }
      if (times <= 1) func = null;
      return memo;
    };
  };

  // Returns a function that will be executed at most one time, no matter how
  // often you call it. Useful for lazy initialization.
  _.once = _.partial(_.before, 2);

  // Object Functions
  // ----------------

  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
  var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
  var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
                      'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];

  function collectNonEnumProps(obj, keys) {
    var nonEnumIdx = nonEnumerableProps.length;
    var constructor = obj.constructor;
    var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;

    // Constructor is a special case.
    var prop = 'constructor';
    if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);

    while (nonEnumIdx--) {
      prop = nonEnumerableProps[nonEnumIdx];
      if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
        keys.push(prop);
      }
    }
  }

  // Retrieve the names of an object's own properties.
  // Delegates to **ECMAScript 5**'s native `Object.keys`
  _.keys = function(obj) {
    if (!_.isObject(obj)) return [];
    if (nativeKeys) return nativeKeys(obj);
    var keys = [];
    for (var key in obj) if (_.has(obj, key)) keys.push(key);
    // Ahem, IE < 9.
    if (hasEnumBug) collectNonEnumProps(obj, keys);
    return keys;
  };

  // Retrieve all the property names of an object.
  _.allKeys = function(obj) {
    if (!_.isObject(obj)) return [];
    var keys = [];
    for (var key in obj) keys.push(key);
    // Ahem, IE < 9.
    if (hasEnumBug) collectNonEnumProps(obj, keys);
    return keys;
  };

  // Retrieve the values of an object's properties.
  _.values = function(obj) {
    var keys = _.keys(obj);
    var length = keys.length;
    var values = Array(length);
    for (var i = 0; i < length; i++) {
      values[i] = obj[keys[i]];
    }
    return values;
  };

  // Returns the results of applying the iteratee to each element of the object
  // In contrast to _.map it returns an object
  _.mapObject = function(obj, iteratee, context) {
    iteratee = cb(iteratee, context);
    var keys =  _.keys(obj),
          length = keys.length,
          results = {},
          currentKey;
      for (var index = 0; index < length; index++) {
        currentKey = keys[index];
        results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
      }
      return results;
  };

  // Convert an object into a list of `[key, value]` pairs.
  _.pairs = function(obj) {
    var keys = _.keys(obj);
    var length = keys.length;
    var pairs = Array(length);
    for (var i = 0; i < length; i++) {
      pairs[i] = [keys[i], obj[keys[i]]];
    }
    return pairs;
  };

  // Invert the keys and values of an object. The values must be serializable.
  _.invert = function(obj) {
    var result = {};
    var keys = _.keys(obj);
    for (var i = 0, length = keys.length; i < length; i++) {
      result[obj[keys[i]]] = keys[i];
    }
    return result;
  };

  // Return a sorted list of the function names available on the object.
  // Aliased as `methods`
  _.functions = _.methods = function(obj) {
    var names = [];
    for (var key in obj) {
      if (_.isFunction(obj[key])) names.push(key);
    }
    return names.sort();
  };

  // Extend a given object with all the properties in passed-in object(s).
  _.extend = createAssigner(_.allKeys);

  // Assigns a given object with all the own properties in the passed-in object(s)
  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
  _.extendOwn = _.assign = createAssigner(_.keys);

  // Returns the first key on an object that passes a predicate test
  _.findKey = function(obj, predicate, context) {
    predicate = cb(predicate, context);
    var keys = _.keys(obj), key;
    for (var i = 0, length = keys.length; i < length; i++) {
      key = keys[i];
      if (predicate(obj[key], key, obj)) return key;
    }
  };

  // Return a copy of the object only containing the whitelisted properties.
  _.pick = function(object, oiteratee, context) {
    var result = {}, obj = object, iteratee, keys;
    if (obj == null) return result;
    if (_.isFunction(oiteratee)) {
      keys = _.allKeys(obj);
      iteratee = optimizeCb(oiteratee, context);
    } else {
      keys = flatten(arguments, false, false, 1);
      iteratee = function(value, key, obj) { return key in obj; };
      obj = Object(obj);
    }
    for (var i = 0, length = keys.length; i < length; i++) {
      var key = keys[i];
      var value = obj[key];
      if (iteratee(value, key, obj)) result[key] = value;
    }
    return result;
  };

   // Return a copy of the object without the blacklisted properties.
  _.omit = function(obj, iteratee, context) {
    if (_.isFunction(iteratee)) {
      iteratee = _.negate(iteratee);
    } else {
      var keys = _.map(flatten(arguments, false, false, 1), String);
      iteratee = function(value, key) {
        return !_.contains(keys, key);
      };
    }
    return _.pick(obj, iteratee, context);
  };

  // Fill in a given object with default properties.
  _.defaults = createAssigner(_.allKeys, true);

  // Creates an object that inherits from the given prototype object.
  // If additional properties are provided then they will be added to the
  // created object.
  _.create = function(prototype, props) {
    var result = baseCreate(prototype);
    if (props) _.extendOwn(result, props);
    return result;
  };

  // Create a (shallow-cloned) duplicate of an object.
  _.clone = function(obj) {
    if (!_.isObject(obj)) return obj;
    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
  };

  // Invokes interceptor with the obj, and then returns obj.
  // The primary purpose of this method is to "tap into" a method chain, in
  // order to perform operations on intermediate results within the chain.
  _.tap = function(obj, interceptor) {
    interceptor(obj);
    return obj;
  };

  // Returns whether an object has a given set of `key:value` pairs.
  _.isMatch = function(object, attrs) {
    var keys = _.keys(attrs), length = keys.length;
    if (object == null) return !length;
    var obj = Object(object);
    for (var i = 0; i < length; i++) {
      var key = keys[i];
      if (attrs[key] !== obj[key] || !(key in obj)) return false;
    }
    return true;
  };


  // Internal recursive comparison function for `isEqual`.
  var eq = function(a, b, aStack, bStack) {
    // Identical objects are equal. `0 === -0`, but they aren't identical.
    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
    if (a === b) return a !== 0 || 1 / a === 1 / b;
    // A strict comparison is necessary because `null == undefined`.
    if (a == null || b == null) return a === b;
    // Unwrap any wrapped objects.
    if (a instanceof _) a = a._wrapped;
    if (b instanceof _) b = b._wrapped;
    // Compare `[[Class]]` names.
    var className = toString.call(a);
    if (className !== toString.call(b)) return false;
    switch (className) {
      // Strings, numbers, regular expressions, dates, and booleans are compared by value.
      case '[object RegExp]':
      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
      case '[object String]':
        // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
        // equivalent to `new String("5")`.
        return '' + a === '' + b;
      case '[object Number]':
        // `NaN`s are equivalent, but non-reflexive.
        // Object(NaN) is equivalent to NaN
        if (+a !== +a) return +b !== +b;
        // An `egal` comparison is performed for other numeric values.
        return +a === 0 ? 1 / +a === 1 / b : +a === +b;
      case '[object Date]':
      case '[object Boolean]':
        // Coerce dates and booleans to numeric primitive values. Dates are compared by their
        // millisecond representations. Note that invalid dates with millisecond representations
        // of `NaN` are not equivalent.
        return +a === +b;
    }

    var areArrays = className === '[object Array]';
    if (!areArrays) {
      if (typeof a != 'object' || typeof b != 'object') return false;

      // Objects with different constructors are not equivalent, but `Object`s or `Array`s
      // from different frames are.
      var aCtor = a.constructor, bCtor = b.constructor;
      if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
                               _.isFunction(bCtor) && bCtor instanceof bCtor)
                          && ('constructor' in a && 'constructor' in b)) {
        return false;
      }
    }
    // Assume equality for cyclic structures. The algorithm for detecting cyclic
    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.

    // Initializing stack of traversed objects.
    // It's done here since we only need them for objects and arrays comparison.
    aStack = aStack || [];
    bStack = bStack || [];
    var length = aStack.length;
    while (length--) {
      // Linear search. Performance is inversely proportional to the number of
      // unique nested structures.
      if (aStack[length] === a) return bStack[length] === b;
    }

    // Add the first object to the stack of traversed objects.
    aStack.push(a);
    bStack.push(b);

    // Recursively compare objects and arrays.
    if (areArrays) {
      // Compare array lengths to determine if a deep comparison is necessary.
      length = a.length;
      if (length !== b.length) return false;
      // Deep compare the contents, ignoring non-numeric properties.
      while (length--) {
        if (!eq(a[length], b[length], aStack, bStack)) return false;
      }
    } else {
      // Deep compare objects.
      var keys = _.keys(a), key;
      length = keys.length;
      // Ensure that both objects contain the same number of properties before comparing deep equality.
      if (_.keys(b).length !== length) return false;
      while (length--) {
        // Deep compare each member
        key = keys[length];
        if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
      }
    }
    // Remove the first object from the stack of traversed objects.
    aStack.pop();
    bStack.pop();
    return true;
  };

  // Perform a deep comparison to check if two objects are equal.
  _.isEqual = function(a, b) {
    return eq(a, b);
  };

  // Is a given array, string, or object empty?
  // An "empty" object has no enumerable own-properties.
  _.isEmpty = function(obj) {
    if (obj == null) return true;
    if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
    return _.keys(obj).length === 0;
  };

  // Is a given value a DOM element?
  _.isElement = function(obj) {
    return !!(obj && obj.nodeType === 1);
  };

  // Is a given value an array?
  // Delegates to ECMA5's native Array.isArray
  _.isArray = nativeIsArray || function(obj) {
    return toString.call(obj) === '[object Array]';
  };

  // Is a given variable an object?
  _.isObject = function(obj) {
    var type = typeof obj;
    return type === 'function' || type === 'object' && !!obj;
  };

  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
    _['is' + name] = function(obj) {
      return toString.call(obj) === '[object ' + name + ']';
    };
  });

  // Define a fallback version of the method in browsers (ahem, IE < 9), where
  // there isn't any inspectable "Arguments" type.
  if (!_.isArguments(arguments)) {
    _.isArguments = function(obj) {
      return _.has(obj, 'callee');
    };
  }

  // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
  // IE 11 (#1621), and in Safari 8 (#1929).
  if (typeof /./ != 'function' && typeof Int8Array != 'object') {
    _.isFunction = function(obj) {
      return typeof obj == 'function' || false;
    };
  }

  // Is a given object a finite number?
  _.isFinite = function(obj) {
    return isFinite(obj) && !isNaN(parseFloat(obj));
  };

  // Is the given value `NaN`? (NaN is the only number which does not equal itself).
  _.isNaN = function(obj) {
    return _.isNumber(obj) && obj !== +obj;
  };

  // Is a given value a boolean?
  _.isBoolean = function(obj) {
    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
  };

  // Is a given value equal to null?
  _.isNull = function(obj) {
    return obj === null;
  };

  // Is a given variable undefined?
  _.isUndefined = function(obj) {
    return obj === void 0;
  };

  // Shortcut function for checking if an object has a given property directly
  // on itself (in other words, not on a prototype).
  _.has = function(obj, key) {
    return obj != null && hasOwnProperty.call(obj, key);
  };

  // Utility Functions
  // -----------------

  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
  // previous owner. Returns a reference to the Underscore object.
  _.noConflict = function() {
    root._ = previousUnderscore;
    return this;
  };

  // Keep the identity function around for default iteratees.
  _.identity = function(value) {
    return value;
  };

  // Predicate-generating functions. Often useful outside of Underscore.
  _.constant = function(value) {
    return function() {
      return value;
    };
  };

  _.noop = function(){};

  _.property = property;

  // Generates a function for a given object that returns a given property.
  _.propertyOf = function(obj) {
    return obj == null ? function(){} : function(key) {
      return obj[key];
    };
  };

  // Returns a predicate for checking whether an object has a given set of
  // `key:value` pairs.
  _.matcher = _.matches = function(attrs) {
    attrs = _.extendOwn({}, attrs);
    return function(obj) {
      return _.isMatch(obj, attrs);
    };
  };

  // Run a function **n** times.
  _.times = function(n, iteratee, context) {
    var accum = Array(Math.max(0, n));
    iteratee = optimizeCb(iteratee, context, 1);
    for (var i = 0; i < n; i++) accum[i] = iteratee(i);
    return accum;
  };

  // Return a random integer between min and max (inclusive).
  _.random = function(min, max) {
    if (max == null) {
      max = min;
      min = 0;
    }
    return min + Math.floor(Math.random() * (max - min + 1));
  };

  // A (possibly faster) way to get the current timestamp as an integer.
  _.now = Date.now || function() {
    return new Date().getTime();
  };

   // List of HTML entities for escaping.
  var escapeMap = {
    '&': '&amp;',
    '<': '&lt;',
    '>': '&gt;',
    '"': '&quot;',
    "'": '&#x27;',
    '`': '&#x60;'
  };
  var unescapeMap = _.invert(escapeMap);

  // Functions for escaping and unescaping strings to/from HTML interpolation.
  var createEscaper = function(map) {
    var escaper = function(match) {
      return map[match];
    };
    // Regexes for identifying a key that needs to be escaped
    var source = '(?:' + _.keys(map).join('|') + ')';
    var testRegexp = RegExp(source);
    var replaceRegexp = RegExp(source, 'g');
    return function(string) {
      string = string == null ? '' : '' + string;
      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
    };
  };
  _.escape = createEscaper(escapeMap);
  _.unescape = createEscaper(unescapeMap);

  // If the value of the named `property` is a function then invoke it with the
  // `object` as context; otherwise, return it.
  _.result = function(object, property, fallback) {
    var value = object == null ? void 0 : object[property];
    if (value === void 0) {
      value = fallback;
    }
    return _.isFunction(value) ? value.call(object) : value;
  };

  // Generate a unique integer id (unique within the entire client session).
  // Useful for temporary DOM ids.
  var idCounter = 0;
  _.uniqueId = function(prefix) {
    var id = ++idCounter + '';
    return prefix ? prefix + id : id;
  };

  // By default, Underscore uses ERB-style template delimiters, change the
  // following template settings to use alternative delimiters.
  _.templateSettings = {
    evaluate    : /<%([\s\S]+?)%>/g,
    interpolate : /<%=([\s\S]+?)%>/g,
    escape      : /<%-([\s\S]+?)%>/g
  };

  // When customizing `templateSettings`, if you don't want to define an
  // interpolation, evaluation or escaping regex, we need one that is
  // guaranteed not to match.
  var noMatch = /(.)^/;

  // Certain characters need to be escaped so that they can be put into a
  // string literal.
  var escapes = {
    "'":      "'",
    '\\':     '\\',
    '\r':     'r',
    '\n':     'n',
    '\u2028': 'u2028',
    '\u2029': 'u2029'
  };

  var escaper = /\\|'|\r|\n|\u2028|\u2029/g;

  var escapeChar = function(match) {
    return '\\' + escapes[match];
  };

  // JavaScript micro-templating, similar to John Resig's implementation.
  // Underscore templating handles arbitrary delimiters, preserves whitespace,
  // and correctly escapes quotes within interpolated code.
  // NB: `oldSettings` only exists for backwards compatibility.
  _.template = function(text, settings, oldSettings) {
    if (!settings && oldSettings) settings = oldSettings;
    settings = _.defaults({}, settings, _.templateSettings);

    // Combine delimiters into one regular expression via alternation.
    var matcher = RegExp([
      (settings.escape || noMatch).source,
      (settings.interpolate || noMatch).source,
      (settings.evaluate || noMatch).source
    ].join('|') + '|$', 'g');

    // Compile the template source, escaping string literals appropriately.
    var index = 0;
    var source = "__p+='";
    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
      source += text.slice(index, offset).replace(escaper, escapeChar);
      index = offset + match.length;

      if (escape) {
        source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
      } else if (interpolate) {
        source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
      } else if (evaluate) {
        source += "';\n" + evaluate + "\n__p+='";
      }

      // Adobe VMs need the match returned to produce the correct offest.
      return match;
    });
    source += "';\n";

    // If a variable is not specified, place data values in local scope.
    if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';

    source = "var __t,__p='',__j=Array.prototype.join," +
      "print=function(){__p+=__j.call(arguments,'');};\n" +
      source + 'return __p;\n';

    try {
      var render = new Function(settings.variable || 'obj', '_', source);
    } catch (e) {
      e.source = source;
      throw e;
    }

    var template = function(data) {
      return render.call(this, data, _);
    };

    // Provide the compiled source as a convenience for precompilation.
    var argument = settings.variable || 'obj';
    template.source = 'function(' + argument + '){\n' + source + '}';

    return template;
  };

  // Add a "chain" function. Start chaining a wrapped Underscore object.
  _.chain = function(obj) {
    var instance = _(obj);
    instance._chain = true;
    return instance;
  };

  // OOP
  // ---------------
  // If Underscore is called as a function, it returns a wrapped object that
  // can be used OO-style. This wrapper holds altered versions of all the
  // underscore functions. Wrapped objects may be chained.

  // Helper function to continue chaining intermediate results.
  var result = function(instance, obj) {
    return instance._chain ? _(obj).chain() : obj;
  };

  // Add your own custom functions to the Underscore object.
  _.mixin = function(obj) {
    _.each(_.functions(obj), function(name) {
      var func = _[name] = obj[name];
      _.prototype[name] = function() {
        var args = [this._wrapped];
        push.apply(args, arguments);
        return result(this, func.apply(_, args));
      };
    });
  };

  // Add all of the Underscore functions to the wrapper object.
  _.mixin(_);

  // Add all mutator Array functions to the wrapper.
  _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
    var method = ArrayProto[name];
    _.prototype[name] = function() {
      var obj = this._wrapped;
      method.apply(obj, arguments);
      if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
      return result(this, obj);
    };
  });

  // Add all accessor Array functions to the wrapper.
  _.each(['concat', 'join', 'slice'], function(name) {
    var method = ArrayProto[name];
    _.prototype[name] = function() {
      return result(this, method.apply(this._wrapped, arguments));
    };
  });

  // Extracts the result from a wrapped and chained object.
  _.prototype.value = function() {
    return this._wrapped;
  };

  // Provide unwrapping proxy for some methods used in engine operations
  // such as arithmetic and JSON stringification.
  _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;

  _.prototype.toString = function() {
    return '' + this._wrapped;
  };

  // AMD registration happens at the end for compatibility with AMD loaders
  // that may not enforce next-turn semantics on modules. Even though general
  // practice for AMD registration is to be anonymous, underscore registers
  // as a named module because, like jQuery, it is a base library that is
  // popular enough to be bundled in a third party lib, but not be part of
  // an AMD load request. Those cases could generate an error when an
  // anonymous define() is called outside of a loader request.
  if (typeof define === 'function' && define.amd) {
    define('underscore', [], function() {
      return _;
    });
  }
}.call(this));

/**
 * @license BrainJocks CCF EventManager
 * https://brainjocks.atlassian.net/wiki/display/SDD/eventManager
 * Copyright 2020
 */

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('eventManager',["jquery", "underscore", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("underscore"), require('loglevel')) :
    console && console.error('EventManager does not support non-amd script loading.');
}(this/* window */, function($, _, log) {
    "use strict";

    function logRegistration(event, func) {
        log.debug("REGISTER event " + String(event) + " to callback function " + (func.name || "[Anonymous]"));
    }

    function logUnsubscription(event, func) {
        log.debug("UNSUBSCRIBE function " + String(event) + " from event " + (func.name || "[Anonymous]"));
    }

    function logHandledTrigger(subscriber, event) {
        log.debug("TRIGGER function " + (subscriber.callback.name || "[Anonymous]") + " for event " + String(subscriber.event));
        log.debug(JSON.stringify(event, null, 4));
    }

    function logMissedTrigger(event) {
        log.debug("SKIP event with 0 subscriptions: " + String(event));
    }

    function Registration(event, callback, thisp) {
        Object.defineProperties(this, {
            id:       { value: (new Date()).valueOf() },
            event:    { value: event                          },
            callback: { value: callback                       },
            thisp:    { value: thisp                          }
        });
    }

    function EventManager() {
        var subscribers = [], loadingDeferred = $.Deferred(), verbose = true;

        Object.defineProperties(this, {
            verbose: {
                get: function () {
                    return verbose;
                },
                set: function (value) {
                    verbose = Boolean(value);
                }
            }
        });

        this.pauseTriggers = function () {
            loadingDeferred.resolve();
            loadingDeferred = $.Deferred();
            return this;
        };

        this.registrationComplete = function () {
            loadingDeferred.resolve();
            return this;
        };

        function executeCallbacks(isAsync, args) {
            var event = args.splice(0, 1)[0], counter = 0;

            subscribers.forEach(function (subscriber) {
                var operation;
                if (event === subscriber.event) {
                    counter++;
                    logHandledTrigger(subscriber, event);
                    if (args.length <= 1) {
                        if (subscriber.thisp === undefined) {
                            operation = function () {
                                subscriber.callback(args[0]);
                            };
                        } else {
                            operation = function () {
                                subscriber.callback.call(subscriber.thisp, args[0]);
                            };
                        }
                    } else {
                        operation = function () {
                            subscriber.callback.apply(subscriber.thisp || null, args);
                        };
                    }

                    if (isAsync) {
                        window.setTimeout(operation, 0);
                    } else {
                        operation();
                    }
                }
            });

            if (verbose && counter === 0) {
                logMissedTrigger(event);
            }
        }

        this.trigger = function trigger(event) {
            if (!event) {
                log.error("Argument 'event' is required for method EventManager.trigger");
                return;
            }

            // Hold off triggering events until the page is fully loaded and all listeners have been registered
            loadingDeferred.promise().done(executeCallbacks.bind(null, false, $.makeArray(arguments)));
        };

        this.triggerAsync = function triggerAsync(event) {
            if (!event) {
                log.error("Argument 'event' is required for method EventManager.trigger");
                return;
            }

            // Hold off triggering events until the page is fully loaded and all listeners have been registered
            loadingDeferred.promise().done(executeCallbacks.bind(null, true, $.makeArray(arguments)));
        };

        this.subscribe = function subscribe(event, callback, thisp) {
            var registration;

            if (!event || typeof callback !== "function") {
                log.debug(
                    "Skipping event registration. EventManager can only accept " +
                        "registrations that specify an event and a callback function."
                );

                return null;
            }

            if (this.verbose) {
                logRegistration(event, callback);
            }

            registration = new Registration(event, callback, thisp);
            subscribers.push(registration);
            return registration.id;
        };

        this.unsubscribe = function unsubscribe(registrationId) {
            var i = _.findIndex(subscribers, function (i) {
                return i.id === registrationId;
            });

            if (i === -1) return;
            if (this.verbose) {
                logUnsubscription(subscribers[i].event, subscribers[i].callback);
            }

            subscribers.splice(i, 1);
        };
    }

    return new EventManager(); // Singleton
}));

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_ccf/Events/ModulesLoadedEvent',["jquery"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery")) :
    console && console.error('EventManager does not support non-amd script loading.');
}(this/* window */, function ($) {

    function ModulesLoadedEvent(hasErrors, successfulModules, failedModules, scope) {
        if (typeof hasErrors !== "boolean" || !Array.isArray(successfulModules) || !Array.isArray(failedModules))
            throw new Error("Cannot initialize ModulesLoadedEvent - invalid arguments");

        Object.defineProperties(this, {
            scope:             { value: scope              },
            hasErrors:         { value: hasErrors          },
            failedModules:     { value: failedModules      },
            successfulModules: { value: successfulModules  }
        });
    };

    ModulesLoadedEvent.name = "ModulesLoadedEvent";
    return ModulesLoadedEvent;
}));
/**
 * @license BrainJocks CCF Extensions
 * https://brainjocks.atlassian.net/wiki/spaces/SDD/pages/116261662
 * Copyright 2017
 */

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_ccf/extensions',[], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory() :
    console && console.error('Extensions does not support non-amd script loading.');
}(this/* window */, function() {
    "use strict";

    function allOfType(arr, type) {
        var assertFunc;
        if (typeof(type) === "string") {
            assertFunc = function (value) {
                return typeof(value) === type;
            };
        }
        else if (typeof(type) === "function") {
            assertFunc = function (value) {
                return value instanceof type;
            };
        }
        else {
            throw new TypeError("type must be of type function or string");
        }

        return arr.length === 0 || arr.every(assertFunc);
    }

    function pluck(str, propertyName) {
        var props = String(propertyName).split(".");
        return str.map(function (x) {
            var i;

            for (i = 0; i < props.length; i = i + 1) {
                x = x[props[i]];
                if (x === undefined) {
                    break;
                }
            }

            return x;
        });
    }

    function supplant(str, obj) {
        return str.replace(/\{([^{}]*)\}/g, function (a, b) {
            var r = obj[b];
            return typeof r === 'string' || typeof r === 'number' ? r : a;
        });
    }

    return Object.freeze({
        supplant:  supplant,
        pluck:     pluck,
        allOfType: allOfType
    });
}));

// Please keep functions in alphabetical order
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_ccf/jquery.extensions',["jquery"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery")) :
    console && console.error('jquery.extensions does not support non-amd script loading.');
}(this/* window */, function($) {
    "use strict";

    function _copyAttr(to, from, attr) {
        attr = String(attr);
        to.attr(attr, from.attr(attr));
    }

    $.fn.copyAttrFrom = $.fn.copyAttrFrom || function copyAttrFrom(element, attr) {
        var $el = $(element);

        if (Array.isArray(attr)) {
            attr.forEach(_copyAttr.bind(null, this, $el));
        } else {
            _copyAttr(this, $el, attr);
        }

        return this;
    };

    $.fn.descendantOrSelf = $.fn.descendantOrSelf || function descendantOrSelf(sel) {
        return this.filter(sel).add(this.find(sel));
    };
}));

/**
 * @license BrainJocks CCF ModuleLoader
 * https://brainjocks.atlassian.net/wiki/display/SDD/moduleLoader
 * Copyright 2020
 */
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_ccf/ModuleLoader',["jquery", "underscore", "eventManager", "score_ccf/Events/ModulesLoadedEvent", "score_ccf/extensions", "score_ccf/jquery.extensions", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("underscore"), require("eventManager"), require("score_ccf/Events/ModulesLoadedEvent"), require("score_ccf/extensions"), require("score_ccf/jquery.extensions"), require('loglevel')) :
    console && console.error('ModuleLoader does not support non-amd script loading.');
}(this/* window */, function ($, _, eventManager, ModulesLoadedEvent, ext, jqExt, log) {
    "use strict";

    var ModuleState = { pending: "pending", failed: "failed", loaded: "loaded" },
        moduleNameAttr = "data-ux-module",
        moduleStateAttr = "data-ux-state",
        moduleArgsAttr = "data-ux-args",
        findModulesSel = ext.supplant("[{a}][{b}='{state}']", { a:  moduleNameAttr, b: moduleStateAttr });

    function ModuleLoader() { }

    ModuleLoader.prototype.loadPendingModules = function loadPendingModules(scope) {
        var def = $.Deferred(),
            loadScope = scope,
            moduleEls = findModuleElsByState(scope, ModuleState.pending),
            moduleNames = _.invoke(moduleEls, "getAttribute", moduleNameAttr), // Extract module names from module elements
            success = [], failure = [], result; // We will use these to track our progress

        eventManager.pauseTriggers(); // Event manager should hold off on triggering events while new registrations are going on

        require(moduleNames, function () {
            // Here, 'arguments' are the modules loaded by requirejs
            var modules = $.makeArray(arguments), args, i, module, initFunc;

            //add XPRuleLoader for all modules
            require(["score_ccf/XPerience/XPRuleLoader"],
                function(xpRuleLoaderModule) {
                    var ruleLoader = xpRuleLoaderModule.hasOwnProperty('XPRuleLoader') && xpRuleLoaderModule.XPRuleLoader instanceof Function
                        ? new xpRuleLoaderModule.XPRuleLoader() /* named load */
                        : xpRuleLoaderModule.__esModule === !0 && xpRuleLoaderModule.hasOwnProperty("default") && xpRuleLoaderModule.default instanceof Function ? new xpRuleLoaderModule.default() /* default module load */
                        : xpRuleLoaderModule instanceof Function ? new xpRuleLoaderModule() /* old fashioned modules */
                        : log.warn('Cannot load XPRuleLoader module to load XPerience Rules');

                    for (i = 0; i < modules.length; i = i + 1) { // Loop over loaded modules and execute the ones that returned functions

                        // If no ux args were provided then use empty object;
                        args = JSON.parse(moduleEls[i].getAttribute(moduleArgsAttr) || "{}");

                        if (typeof modules[i] === "function") {
                            // Check for an explicit 'init' function
                            initFunc = typeof modules[i]["init"] === "function" ? modules[i]["init"] : modules[i];

                            try {
                                // Error inside a CCF module should not stop other js from executing
                                // Add scope property to module args and to module itself. This is used to contain the module's
                                // js to its wrapper element - we don't want modules changing things outside of their scope.
                                module = initFunc($.extend({ scope: moduleEls[i] }, args));

                                if (module) {
                                    Object.defineProperty(module, "ccf_scope", { value: moduleEls[i] });
                                    $(moduleEls[i]).data("ccf_module", module).data(moduleArgsAttr, args);

                                    //apply rules
                                    if (ruleLoader && moduleEls[i].getAttribute('data-xpr-state') === 'pending' && moduleEls[i].getAttribute('data-xpr-rule') != null) {
                                        ruleLoader.applyRules(module, moduleEls[i].getAttribute('data-xpr-rule'));
                                    }
                                }
                            } catch (err) {
                                err = moduleNames[i] + ": " + err;
                                $(moduleEls[i]).attr(moduleStateAttr, ModuleState.failed);
                                failure.push(err);
                                log.error(err);
                                continue;
                            }
                        }

                        // Update state and clean up ux arguments from DOM so it's less cluttered
                        $(moduleEls[i]).attr(moduleStateAttr, ModuleState.loaded).removeAttr(moduleArgsAttr);
                        success.push(moduleNames[i]);
                    }

                    result = new ModulesLoadedEvent(failure.length > 0, success, failure, loadScope);
                    // Event manager can now resume triggering events
                    eventManager.registrationComplete().trigger(ModulesLoadedEvent.name, result);
                    def.resolve(result);
                });
        });

        return def.promise();
    };

    function findModuleElsByState(scope, state) {
        return $(scope || "body").descendantOrSelf(ext.supplant(findModulesSel, { state: state })).toArray();
    }

    function findModulesByState(scope, state) {
        return findModuleElsByState(scope, state).reduce(function (result, currentEl) {
            var module = $(currentEl).data("ccf_module");
            if (module) result.push(module);
            return result;
        }, []);
    }

    ModuleLoader.prototype.findLoadedModules = function findLoadedModules(scope) {
        return findModulesByState(scope, ModuleState.loaded);
    };

    ModuleLoader.prototype.findFailedModules = function findFailedModules(scope) {
        return findModulesByState(scope, ModuleState.failed);
    };

    ModuleLoader.prototype.findPendingModules = function findPendingModules(scope) {
        return findModulesByState(scope, ModuleState.pending);
    };

    return new ModuleLoader(); // singleton
}));

(function(root) {
define("jqueryMigrate", ["jquery"], function() {
  return (function() {
/*!
 * jQuery Migrate - v3.0.0 - 2016-06-09
 * Copyright jQuery Foundation and other contributors
 */
(function( jQuery, window ) {



jQuery.migrateVersion = "3.0.0";


( function() {

	// Support: IE9 only
	// IE9 only creates console object when dev tools are first opened
	// Also, avoid Function#bind here to simplify PhantomJS usage
	var log = window.console && window.console.log &&
			function() { window.console.log.apply( window.console, arguments ); },
		rbadVersions = /^[12]\./;

	if ( !log ) {
		return;
	}

	// Need jQuery 3.0.0+ and no older Migrate loaded
	if ( !jQuery || rbadVersions.test( jQuery.fn.jquery ) ) {
		log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
	}
	if ( jQuery.migrateWarnings ) {
		log( "JQMIGRATE: Migrate plugin loaded multiple times" );
	}

	// Show a message on the console so devs know we're active
	log( "JQMIGRATE: Migrate is installed" +
		( jQuery.migrateMute ? "" : " with logging active" ) +
		", version " + jQuery.migrateVersion );

} )();

var warnedAbout = {};

// List of warnings already given; public read only
jQuery.migrateWarnings = [];

// Set to false to disable traces that appear with warnings
if ( jQuery.migrateTrace === undefined ) {
	jQuery.migrateTrace = true;
}

// Forget any warnings we've already given; public
jQuery.migrateReset = function() {
	warnedAbout = {};
	jQuery.migrateWarnings.length = 0;
};

function migrateWarn( msg ) {
	var console = window.console;
	if ( !warnedAbout[ msg ] ) {
		warnedAbout[ msg ] = true;
		jQuery.migrateWarnings.push( msg );
		if ( console && console.warn && !jQuery.migrateMute ) {
			console.warn( "JQMIGRATE: " + msg );
			if ( jQuery.migrateTrace && console.trace ) {
				console.trace();
			}
		}
	}
}

function migrateWarnProp( obj, prop, value, msg ) {
	Object.defineProperty( obj, prop, {
		configurable: true,
		enumerable: true,
		get: function() {
			migrateWarn( msg );
			return value;
		}
	} );
}

if ( document.compatMode === "BackCompat" ) {

	// JQuery has never supported or tested Quirks Mode
	migrateWarn( "jQuery is not compatible with Quirks Mode" );
}


var oldInit = jQuery.fn.init,
	oldIsNumeric = jQuery.isNumeric,
	oldFind = jQuery.find,
	rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
	rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g;

jQuery.fn.init = function( arg1 ) {
	var args = Array.prototype.slice.call( arguments );

	if ( typeof arg1 === "string" && arg1 === "#" ) {

		// JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
		migrateWarn( "jQuery( '#' ) is not a valid selector" );
		args[ 0 ] = [];
	}

	return oldInit.apply( this, args );
};
jQuery.fn.init.prototype = jQuery.fn;

jQuery.find = function( selector ) {
	var args = Array.prototype.slice.call( arguments );

	// Support: PhantomJS 1.x
	// String#match fails to match when used with a //g RegExp, only on some strings
	if ( typeof selector === "string" && rattrHashTest.test( selector ) ) {

		// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
		// First see if qS thinks it's a valid selector, if so avoid a false positive
		try {
			document.querySelector( selector );
		} catch ( err1 ) {

			// Didn't *look* valid to qSA, warn and try quoting what we think is the value
			selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) {
				return "[" + attr + op + "\"" + value + "\"]";
			} );

			// If the regexp *may* have created an invalid selector, don't update it
			// Note that there may be false alarms if selector uses jQuery extensions
			try {
				document.querySelector( selector );
				migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] );
				args[ 0 ] = selector;
			} catch ( err2 ) {
				migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] );
			}
		}
	}

	return oldFind.apply( this, args );
};

// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
var findProp;
for ( findProp in oldFind ) {
	if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) {
		jQuery.find[ findProp ] = oldFind[ findProp ];
	}
}

// The number of elements contained in the matched element set
jQuery.fn.size = function() {
	migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" );
	return this.length;
};

jQuery.parseJSON = function() {
	migrateWarn( "jQuery.parseJSON is deprecated; use JSON.parse" );
	return JSON.parse.apply( null, arguments );
};

jQuery.isNumeric = function( val ) {

	// The jQuery 2.2.3 implementation of isNumeric
	function isNumeric2( obj ) {
		var realStringObj = obj && obj.toString();
		return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
	}

	var newValue = oldIsNumeric( val ),
		oldValue = isNumeric2( val );

	if ( newValue !== oldValue ) {
		migrateWarn( "jQuery.isNumeric() should not be called on constructed objects" );
	}

	return oldValue;
};

migrateWarnProp( jQuery, "unique", jQuery.uniqueSort,
	"jQuery.unique is deprecated, use jQuery.uniqueSort" );

// Now jQuery.expr.pseudos is the standard incantation
migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos,
	"jQuery.expr.filters is now jQuery.expr.pseudos" );
migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos,
	"jQuery.expr[\":\"] is now jQuery.expr.pseudos" );


var oldAjax = jQuery.ajax;

jQuery.ajax = function( ) {
	var jQXHR = oldAjax.apply( this, arguments );

	// Be sure we got a jQXHR (e.g., not sync)
	if ( jQXHR.promise ) {
		migrateWarnProp( jQXHR, "success", jQXHR.done,
			"jQXHR.success is deprecated and removed" );
		migrateWarnProp( jQXHR, "error", jQXHR.fail,
			"jQXHR.error is deprecated and removed" );
		migrateWarnProp( jQXHR, "complete", jQXHR.always,
			"jQXHR.complete is deprecated and removed" );
	}

	return jQXHR;
};


var oldRemoveAttr = jQuery.fn.removeAttr,
	oldToggleClass = jQuery.fn.toggleClass,
	rmatchNonSpace = /\S+/g;

jQuery.fn.removeAttr = function( name ) {
	var self = this;

	jQuery.each( name.match( rmatchNonSpace ), function( i, attr ) {
		if ( jQuery.expr.match.bool.test( attr ) ) {
			migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
			self.prop( attr, false );
		}
	} );

	return oldRemoveAttr.apply( this, arguments );
};

jQuery.fn.toggleClass = function( state ) {

	// Only deprecating no-args or single boolean arg
	if ( state !== undefined && typeof state !== "boolean" ) {
		return oldToggleClass.apply( this, arguments );
	}

	migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" );

	// Toggle entire class name of each element
	return this.each( function() {
		var className = this.getAttribute && this.getAttribute( "class" ) || "";

		if ( className ) {
			jQuery.data( this, "__className__", className );
		}

		// If the element has a class name or if we're passed `false`,
		// then remove the whole classname (if there was one, the above saved it).
		// Otherwise bring back whatever was previously saved (if anything),
		// falling back to the empty string if nothing was stored.
		if ( this.setAttribute ) {
			this.setAttribute( "class",
				className || state === false ?
				"" :
				jQuery.data( this, "__className__" ) || ""
			);
		}
	} );
};


var internalSwapCall = false;

// If this version of jQuery has .swap(), don't false-alarm on internal uses
if ( jQuery.swap ) {
	jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
		var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;

		if ( oldHook ) {
			jQuery.cssHooks[ name ].get = function() {
				var ret;

				internalSwapCall = true;
				ret = oldHook.apply( this, arguments );
				internalSwapCall = false;
				return ret;
			};
		}
	} );
}

jQuery.swap = function( elem, options, callback, args ) {
	var ret, name,
		old = {};

	if ( !internalSwapCall ) {
		migrateWarn( "jQuery.swap() is undocumented and deprecated" );
	}

	// Remember the old values, and insert the new ones
	for ( name in options ) {
		old[ name ] = elem.style[ name ];
		elem.style[ name ] = options[ name ];
	}

	ret = callback.apply( elem, args || [] );

	// Revert the old values
	for ( name in options ) {
		elem.style[ name ] = old[ name ];
	}

	return ret;
};

var oldData = jQuery.data;

jQuery.data = function( elem, name, value ) {
	var curData;

	// If the name is transformed, look for the un-transformed name in the data object
	if ( name && name !== jQuery.camelCase( name ) ) {
		curData = jQuery.hasData( elem ) && oldData.call( this, elem );
		if ( curData && name in curData ) {
			migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name );
			if ( arguments.length > 2 ) {
				curData[ name ] = value;
			}
			return curData[ name ];
		}
	}

	return oldData.apply( this, arguments );
};

var oldTweenRun = jQuery.Tween.prototype.run;

jQuery.Tween.prototype.run = function( percent ) {
	if ( jQuery.easing[ this.easing ].length > 1 ) {
		migrateWarn(
			"easing function " +
			"\"jQuery.easing." + this.easing.toString() +
			"\" should use only first argument"
		);

		jQuery.easing[ this.easing ] = jQuery.easing[ this.easing ].bind(
			jQuery.easing,
			percent, this.options.duration * percent, 0, 1, this.options.duration
		);
	}

	oldTweenRun.apply( this, arguments );
};

var oldLoad = jQuery.fn.load,
	originalFix = jQuery.event.fix;

jQuery.event.props = [];
jQuery.event.fixHooks = {};

jQuery.event.fix = function( originalEvent ) {
	var event,
		type = originalEvent.type,
		fixHook = this.fixHooks[ type ],
		props = jQuery.event.props;

	if ( props.length ) {
		migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() );
		while ( props.length ) {
			jQuery.event.addProp( props.pop() );
		}
	}

	if ( fixHook && !fixHook._migrated_ ) {
		fixHook._migrated_ = true;
		migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type );
		if ( ( props = fixHook.props ) && props.length ) {
			while ( props.length ) {
			   jQuery.event.addProp( props.pop() );
			}
		}
	}

	event = originalFix.call( this, originalEvent );

	return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
};

jQuery.each( [ "load", "unload", "error" ], function( _, name ) {

	jQuery.fn[ name ] = function() {
		var args = Array.prototype.slice.call( arguments, 0 );

		// If this is an ajax load() the first arg should be the string URL;
		// technically this could also be the "Anything" arg of the event .load()
		// which just goes to show why this dumb signature has been deprecated!
		// jQuery custom builds that exclude the Ajax module justifiably die here.
		if ( name === "load" && typeof args[ 0 ] === "string" ) {
			return oldLoad.apply( this, args );
		}

		migrateWarn( "jQuery.fn." + name + "() is deprecated" );

		args.splice( 0, 0, name );
		if ( arguments.length ) {
			return this.on.apply( this, args );
		}

		// Use .triggerHandler here because:
		// - load and unload events don't need to bubble, only applied to window or image
		// - error event should not bubble to window, although it does pre-1.7
		// See http://bugs.jquery.com/ticket/11820
		this.triggerHandler.apply( this, args );
		return this;
	};

} );

// Trigger "ready" event only once, on document ready
jQuery( function() {
	jQuery( document ).triggerHandler( "ready" );
} );

jQuery.event.special.ready = {
	setup: function() {
		if ( this === document ) {
			migrateWarn( "'ready' event is deprecated" );
		}
	}
};

jQuery.fn.extend( {

	bind: function( types, data, fn ) {
		migrateWarn( "jQuery.fn.bind() is deprecated" );
		return this.on( types, null, data, fn );
	},
	unbind: function( types, fn ) {
		migrateWarn( "jQuery.fn.unbind() is deprecated" );
		return this.off( types, null, fn );
	},
	delegate: function( selector, types, data, fn ) {
		migrateWarn( "jQuery.fn.delegate() is deprecated" );
		return this.on( types, selector, data, fn );
	},
	undelegate: function( selector, types, fn ) {
		migrateWarn( "jQuery.fn.undelegate() is deprecated" );
		return arguments.length === 1 ?
			this.off( selector, "**" ) :
			this.off( types, selector || "**", fn );
	}
} );


var oldOffset = jQuery.fn.offset;

jQuery.fn.offset = function() {
	var docElem,
		elem = this[ 0 ],
		origin = { top: 0, left: 0 };

	if ( !elem || !elem.nodeType ) {
		migrateWarn( "jQuery.fn.offset() requires a valid DOM element" );
		return origin;
	}

	docElem = ( elem.ownerDocument || document ).documentElement;
	if ( !jQuery.contains( docElem, elem ) ) {
		migrateWarn( "jQuery.fn.offset() requires an element connected to a document" );
		return origin;
	}

	return oldOffset.apply( this, arguments );
};


var oldParam = jQuery.param;

jQuery.param = function( data, traditional ) {
	var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;

	if ( traditional === undefined && ajaxTraditional ) {

		migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" );
		traditional = ajaxTraditional;
	}

	return oldParam.call( this, data, traditional );
};

var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;

jQuery.fn.andSelf = function() {
	migrateWarn( "jQuery.fn.andSelf() replaced by jQuery.fn.addBack()" );
	return oldSelf.apply( this, arguments );
};


var oldDeferred = jQuery.Deferred,
	tuples = [

		// Action, add listener, callbacks, .then handlers, final state
		[ "resolve", "done", jQuery.Callbacks( "once memory" ),
			jQuery.Callbacks( "once memory" ), "resolved" ],
		[ "reject", "fail", jQuery.Callbacks( "once memory" ),
			jQuery.Callbacks( "once memory" ), "rejected" ],
		[ "notify", "progress", jQuery.Callbacks( "memory" ),
			jQuery.Callbacks( "memory" ) ]
	];

jQuery.Deferred = function( func ) {
	var deferred = oldDeferred(),
		promise = deferred.promise();

	deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
		var fns = arguments;

		migrateWarn( "deferred.pipe() is deprecated" );

		return jQuery.Deferred( function( newDefer ) {
			jQuery.each( tuples, function( i, tuple ) {
				var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];

				// Deferred.done(function() { bind to newDefer or newDefer.resolve })
				// deferred.fail(function() { bind to newDefer or newDefer.reject })
				// deferred.progress(function() { bind to newDefer or newDefer.notify })
				deferred[ tuple[ 1 ] ]( function() {
					var returned = fn && fn.apply( this, arguments );
					if ( returned && jQuery.isFunction( returned.promise ) ) {
						returned.promise()
							.done( newDefer.resolve )
							.fail( newDefer.reject )
							.progress( newDefer.notify );
					} else {
						newDefer[ tuple[ 0 ] + "With" ](
							this === promise ? newDefer.promise() : this,
							fn ? [ returned ] : arguments
						);
					}
				} );
			} );
			fns = null;
		} ).promise();

	};

	if ( func ) {
		func.call( deferred, deferred );
	}

	return deferred;
};



})( jQuery, window );


  }).apply(root, arguments);
});
}(this));

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define('promise-polyfill',n):n()}(0,function(){"use strict";function e(){}function n(e){if(!(this instanceof n))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(e,this)}function t(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,n._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(f){return void r(t.promise,f)}o(t.promise,i)}else(1===e._state?o:r)(t.promise,e._value)})):e._deferreds.push(t)}function o(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var o=t.then;if(t instanceof n)return e._state=3,e._value=t,void i(e);if("function"==typeof o)return void f(function(e,n){return function(){e.apply(n,arguments)}}(o,t),e)}e._state=1,e._value=t,i(e)}catch(u){r(e,u)}}function r(e,n){e._state=2,e._value=n,i(e)}function i(e){2===e._state&&0===e._deferreds.length&&n._immediateFn(function(){e._handled||n._unhandledRejectionFn(e._value)});for(var o=0,r=e._deferreds.length;r>o;o++)t(e,e._deferreds[o]);e._deferreds=null}function f(e,n){var t=!1;try{e(function(e){t||(t=!0,o(n,e))},function(e){t||(t=!0,r(n,e))})}catch(i){if(t)return;t=!0,r(n,i)}}var u=function(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})},c=setTimeout;n.prototype["catch"]=function(e){return this.then(null,e)},n.prototype.then=function(n,o){var r=new this.constructor(e);return t(this,new function(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}(n,o,r)),r},n.prototype["finally"]=u,n.all=function(e){return new n(function(n,t){function o(e,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(n){o(e,n)},t)}r[e]=f,0==--i&&n(r)}catch(c){t(c)}}if(!e||"undefined"==typeof e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return n([]);for(var i=r.length,f=0;r.length>f;f++)o(f,r[f])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(n){n(e)})},n.reject=function(e){return new n(function(n,t){t(e)})},n.race=function(e){return new n(function(n,t){for(var o=0,r=e.length;r>o;o++)e[o].then(n,t)})},n._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){c(e,0)},n._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var l=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}();l.Promise?l.Promise.prototype["finally"]||(l.Promise.prototype["finally"]=u):l.Promise=n});

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define('object-assign',[],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.ObjectAssign=e()}}(function(){return function e(n,r,t){function o(f,u){if(!r[f]){if(!n[f]){var l="function"==typeof require&&require;if(!u&&l)return l(f,!0);if(i)return i(f,!0);var c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c}var a=r[f]={exports:{}};n[f][0].call(a.exports,function(e){var r=n[f][1][e];return o(r?r:e)},a,a.exports,e,n,r,t)}return r[f].exports}for(var i="function"==typeof require&&require,f=0;f<t.length;f++)o(t[f]);return o}({1:[function(e,n,r){"use strict";function t(e,n){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),t=1;t<arguments.length;t++){var o=arguments[t];if(void 0!==o&&null!==o)for(var i=Object.keys(Object(o)),f=0,u=i.length;f<u;f++){var l=i[f],c=Object.getOwnPropertyDescriptor(o,l);void 0!==c&&c.enumerable&&(r[l]=o[l])}}return r}function o(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}n.exports={assign:t,polyfill:o}},{}]},{},[1])(1)});

(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/XPElementBase',["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    /**
     * Base XP Rule Element, knows how to maps attributes from xml to an element instance
     */
    var XPElementBase = /** @class */ (function () {
        function XPElementBase(attributes) {
            if (!attributes) {
                throw new Error("Cannot initialize XperienceElement without attribute");
            }
            this.applyAttributes(attributes);
        }
        /**
         * Loop through passed object properties and creates/assigns values to the current instance
         * @param {XPAttributes} attributes A dynamic object with properties
         */
        XPElementBase.prototype.applyAttributes = function (attributes) {
            for (var key in attributes) {
                if (attributes.hasOwnProperty(key)) {
                    // Defined properties on XElement will be populated with a value, the rest will be added as new properties.
                    if (key in this) {
                        this[key] = attributes[key];
                    }
                    else {
                        Object.defineProperty(this, key, { value: attributes[key], enumerable: !1, writable: !0, configurable: !0 });
                    }
                }
            }
        };
        return XPElementBase;
    }());
    exports.XPElementBase = XPElementBase;
});
//# sourceMappingURL=XPElementBase.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/XPActionBase',["require", "exports", "score_ccf/XPerience/XPElementBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var XPElementBase_1 = require("score_ccf/XPerience/XPElementBase");
    /**
     * Encapsulated basic logic for an Action
     */
    var XPActionBase = /** @class */ (function (_super) {
        __extends(XPActionBase, _super);
        function XPActionBase(attributes) {
            return _super.call(this, attributes) || this;
        }
        /**
         * Execute the action logic
         * @param {UXModuleLike} component An instance of a UXModule component to scope the current action
         */
        XPActionBase.prototype.execute = function (component) {
            throw new Error("Execute action is not implemented");
        };
        return XPActionBase;
    }(XPElementBase_1.XPElementBase));
    exports.XPActionBase = XPActionBase;
});
//# sourceMappingURL=XPActionBase.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Actions/CompleteGoalAction',["require", "exports", "jquery", "loglevel", "./../XPActionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var log = require("loglevel");
    var XPActionBase_1 = require("./../XPActionBase");
    var CompleteGoalAction = /** @class */ (function (_super) {
        __extends(CompleteGoalAction, _super);
        function CompleteGoalAction(attributes) {
            var _this = _super.call(this, attributes) || this;
            _this.apiEndpoint = "/scoreui/triggergoal/{goalid}";
            return _this;
        }
        CompleteGoalAction.prototype.execute = function (component) {
            var url = this.apiEndpoint.replace("{goalid}", this.goalid);
            var that = this;
            $.post(url, { goalId: this.goalid }, function (response) {
                if (response.error) {
                    throw new Error(response.error);
                }
                if (response.success) {
                    log.debug("Goal triggered: " + that.goalid);
                }
            }, "json");
        };
        return CompleteGoalAction;
    }(XPActionBase_1.XPActionBase));
    exports.default = CompleteGoalAction;
});
//# sourceMappingURL=CompleteGoalAction.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Actions/ContactVisitWithTheProfileCard',["require", "exports", "jquery", "loglevel", "./../XPActionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var log = require("loglevel");
    var XPActionBase_1 = require("./../XPActionBase");
    var ContactVisitWithTheProfileCard = /** @class */ (function (_super) {
        __extends(ContactVisitWithTheProfileCard, _super);
        function ContactVisitWithTheProfileCard(attributes) {
            var _this = _super.call(this, attributes) || this;
            _this.apiEndpoint = "/scoreui/concatvisitwith/{cardId}";
            return _this;
        }
        ContactVisitWithTheProfileCard.prototype.execute = function (component) {
            var _this = this;
            var url = this.apiEndpoint.replace("{cardId}", this.ProfileCardId);
            $.post(url, function (response) {
                if (response.error) {
                    throw new Error(response.error);
                }
                if (response.success) {
                    log.debug("Profile card associated: " + _this.ProfileCardId);
                }
            }, "json");
        };
        return ContactVisitWithTheProfileCard;
    }(XPActionBase_1.XPActionBase));
    exports.default = ContactVisitWithTheProfileCard;
});
//# sourceMappingURL=ContactVisitWithTheProfileCard.js.map;
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/Utils/global',["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var globalNs = (function () {
        // the only reliable means to get the global object is
        // `Function('return this')()`
        // However, this causes CSP violations in Chrome apps.
        if (self !== void 0) {
            return self;
        }
        if (window !== void 0) {
            return window;
        }
        throw new Error('Unable to get  global object');
    })();
    exports.default = globalNs;
});
//# sourceMappingURL=global.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Actions/ShowAlertMessage',["require", "exports", "./../XPActionBase", "score_ccf/Utils/global"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var XPActionBase_1 = require("./../XPActionBase");
    var global_1 = require("score_ccf/Utils/global");
    var ShowAlertMessage = /** @class */ (function (_super) {
        __extends(ShowAlertMessage, _super);
        function ShowAlertMessage(attribites) {
            return _super.call(this, attribites) || this;
        }
        ShowAlertMessage.prototype.execute = function (component) {
            global_1.default.alert(this.message);
        };
        return ShowAlertMessage;
    }(XPActionBase_1.XPActionBase));
    exports.default = ShowAlertMessage;
});
//# sourceMappingURL=ShowAlertMessage.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Actions/TrackClientEventAction',["require", "exports", "loglevel", "score_ccf/XPerience/XPActionBase", "score_ccf/Utils/global", "object-assign"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var log = require("loglevel");
    var XPActionBase_1 = require("score_ccf/XPerience/XPActionBase");
    var global_1 = require("score_ccf/Utils/global");
    var objectAssign = require("object-assign");
    var TrackClientEventAction = /** @class */ (function (_super) {
        __extends(TrackClientEventAction, _super);
        function TrackClientEventAction(attributes) {
            return _super.call(this, attributes) || this;
        }
        TrackClientEventAction.prototype.execute = function (component) {
            if (global_1.default['gtag'] && global_1.default['gtag'] instanceof Function) {
                var fieldsObj = {};
                if (this.eventCategory != null) {
                    fieldsObj['event_category'] = this.eventCategory;
                }
                if (this.eventLabel != null) {
                    fieldsObj['event_label'] = this.eventLabel;
                }
                if (this.eventValue != null) {
                    fieldsObj['value'] = this.eventValue;
                }
                if (this.dimensions != null) {
                    objectAssign.polyfill();
                    fieldsObj = Object.assign(fieldsObj, this.dimensions);
                }
                global_1.default['gtag'].apply(null, ['event', this.eventAction, fieldsObj]);
            }
            else {
                log.error("Cannot send GA event, because GA is not defined. Please include GA script to a page");
            }
        };
        return TrackClientEventAction;
    }(XPActionBase_1.XPActionBase));
    exports.default = TrackClientEventAction;
});
//# sourceMappingURL=TrackClientEventAction.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/XPConditionBase',["require", "exports", "score_ccf/XPerience/XPElementBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var XPElementBase_1 = require("score_ccf/XPerience/XPElementBase");
    /**
     * Encapsulated basic logic for a Condition
     */
    var XPConditionBase = /** @class */ (function (_super) {
        __extends(XPConditionBase, _super);
        function XPConditionBase(attributes) {
            var _this = _super.call(this, attributes) || this;
            _this.defer = _this._initDeferredCondition();
            return _this;
        }
        /**
         * Setup current condition to a scope of component
         * @param {UXModuleLike} component An instance of a UXModule component to scope the current condition
         */
        XPConditionBase.prototype.setup = function (component) {
            throw new Error('Setup method is not implemented');
        };
        /**
         * Resolve current condition with true state
         */
        XPConditionBase.prototype.true = function () {
            return !0;
        };
        /**
         * Resolve current condition with false state
         */
        XPConditionBase.prototype.false = function () {
            return !1;
        };
        /**
         * Produce a new defer condition computation object
         */
        XPConditionBase.prototype.reset = function () {
            this.defer = this._initDeferredCondition();
        };
        /**
         * Decorate current condition resolve defer object when calling true/false methods
         */
        XPConditionBase.prototype._initDeferredCondition = function () {
            var _this = this;
            return new Promise(function (resolve, reject) {
                var origTrue = _this.true.bind(_this);
                _this.true = function () {
                    var value = origTrue();
                    resolve(value);
                    return value;
                };
                var origFalse = _this.false.bind(_this);
                _this.false = function () {
                    var value = origFalse();
                    resolve(value);
                    return value;
                };
            });
        };
        return XPConditionBase;
    }(XPElementBase_1.XPElementBase));
    exports.XPConditionBase = XPConditionBase;
});
//# sourceMappingURL=XPConditionBase.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/ClickedCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var ComponentClickedCondition = /** @class */ (function (_super) {
        __extends(ComponentClickedCondition, _super);
        function ComponentClickedCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        ComponentClickedCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component || !component.scope) {
                throw new Error("Cannot setup a condition without 'component' with property 'scope'");
            }
            $(component.scope).on('click', function (ev) {
                _this.true();
            });
        };
        return ComponentClickedCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = ComponentClickedCondition;
    ;
});
//# sourceMappingURL=ClickedCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/GetsFocusCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var ComponentGetsFocusCondition = /** @class */ (function (_super) {
        __extends(ComponentGetsFocusCondition, _super);
        function ComponentGetsFocusCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        ComponentGetsFocusCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            $(component).on('focus', function () {
                _this.true();
            });
        };
        return ComponentGetsFocusCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = ComponentGetsFocusCondition;
    ;
});
//# sourceMappingURL=GetsFocusCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/LosesFocusCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var ComponentLosesFocusCondition = /** @class */ (function (_super) {
        __extends(ComponentLosesFocusCondition, _super);
        function ComponentLosesFocusCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        ComponentLosesFocusCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            $(component).on('blur', function () {
                _this.true();
            });
        };
        return ComponentLosesFocusCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = ComponentLosesFocusCondition;
    ;
});
//# sourceMappingURL=LosesFocusCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/OncePerPageViewCondition',["require", "exports", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var ComponentClickedCondition = /** @class */ (function (_super) {
        __extends(ComponentClickedCondition, _super);
        function ComponentClickedCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        ComponentClickedCondition.prototype.setup = function (component) {
            this.true();
        };
        ComponentClickedCondition.prototype.reset = function () {
            // call base logic
            _super.prototype.reset.call(this);
            // reject condition
            this.false();
        };
        return ComponentClickedCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = ComponentClickedCondition;
    ;
});
//# sourceMappingURL=OncePerPageViewCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/SlideChangedCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var ComponentSlideChangedCondition = /** @class */ (function (_super) {
        __extends(ComponentSlideChangedCondition, _super);
        function ComponentSlideChangedCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        ComponentSlideChangedCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            $(component).on('afterChange.slider', function () {
                _this.true();
            });
        };
        return ComponentSlideChangedCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = ComponentSlideChangedCondition;
    ;
});
//# sourceMappingURL=SlideChangedCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/SlideChangingCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var ComponentSlideChangingCondition = /** @class */ (function (_super) {
        __extends(ComponentSlideChangingCondition, _super);
        function ComponentSlideChangingCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        ComponentSlideChangingCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            $(component).on('beforeChange.slider', function () {
                _this.true();
            });
        };
        return ComponentSlideChangingCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = ComponentSlideChangingCondition;
    ;
});
//# sourceMappingURL=SlideChangingCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/VideoHasPlayedExactNSecondsCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var VideoHasPlayedExactNSecondsCondition = /** @class */ (function (_super) {
        __extends(VideoHasPlayedExactNSecondsCondition, _super);
        function VideoHasPlayedExactNSecondsCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        VideoHasPlayedExactNSecondsCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            // parse to number
            this.seconds = this.seconds | 0;
            $(component).on('update.timeline', function (e, currentTime) {
                if (isFinite(_this.seconds) && currentTime === _this.seconds) {
                    _this.true();
                }
            });
        };
        return VideoHasPlayedExactNSecondsCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = VideoHasPlayedExactNSecondsCondition;
    ;
});
//# sourceMappingURL=VideoHasPlayedExactNSecondsCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/VideoHasPlayedNSecondsOrMoreCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var VideoHasPlayedNSecondsCondition = /** @class */ (function (_super) {
        __extends(VideoHasPlayedNSecondsCondition, _super);
        function VideoHasPlayedNSecondsCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        VideoHasPlayedNSecondsCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            this.seconds = this.seconds;
            $(component).on('update.timeline', function (e, currentTime) {
                if (isFinite(_this.seconds) && currentTime >= _this.seconds) {
                    _this.true();
                }
            });
        };
        return VideoHasPlayedNSecondsCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = VideoHasPlayedNSecondsCondition;
    ;
});
//# sourceMappingURL=VideoHasPlayedNSecondsOrMoreCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/VideoIsFinishedCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var VideoIsFinishedCondition = /** @class */ (function (_super) {
        __extends(VideoIsFinishedCondition, _super);
        function VideoIsFinishedCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        VideoIsFinishedCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            $(component).on('end.video', function () {
                _this.true();
            });
        };
        return VideoIsFinishedCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = VideoIsFinishedCondition;
    ;
});
//# sourceMappingURL=VideoIsFinishedCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/VideoIsPausedCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var VideoIsFinishedCondition = /** @class */ (function (_super) {
        __extends(VideoIsFinishedCondition, _super);
        function VideoIsFinishedCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        VideoIsFinishedCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            $(component).on('pause.video', function () {
                _this.true();
            });
        };
        return VideoIsFinishedCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = VideoIsFinishedCondition;
    ;
});
//# sourceMappingURL=VideoIsPausedCondition.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Conditions/VideoStartsToPlayCondition',["require", "exports", "jquery", "score_ccf/XPerience/XPConditionBase"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var $ = require("jquery");
    var XPConditionBase_1 = require("score_ccf/XPerience/XPConditionBase");
    var VideoIsFinishedCondition = /** @class */ (function (_super) {
        __extends(VideoIsFinishedCondition, _super);
        function VideoIsFinishedCondition(attributes) {
            return _super.call(this, attributes) || this;
        }
        VideoIsFinishedCondition.prototype.setup = function (component) {
            var _this = this;
            if (!component) {
                throw new Error('Cannot setup a condition without \'component\' instance');
            }
            $(component).on('start.video', function () {
                _this.true();
            });
        };
        return VideoIsFinishedCondition;
    }(XPConditionBase_1.XPConditionBase));
    exports.default = VideoIsFinishedCondition;
    ;
});
//# sourceMappingURL=VideoStartsToPlayCondition.js.map;
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Contracts/UXModuleLike',["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=UXModuleLike.js.map;
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Contracts/XPContracts',["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=XPContracts.js.map;
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Elements',["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.ElementPairs = {
        conditions: {
            '{8DB82A68-5F50-43B3-A487-D5B9300DEE80}': 'score_ccf/XPerience/Conditions/OncePerPageViewCondition',
            '{982886A0-22D5-4371-8E63-D5F0FA292954}': 'score_ccf/XPerience/Conditions/ClickedCondition',
            '{83C03CA9-68D5-4100-8537-004917B1DEF3}': 'score_ccf/XPerience/Conditions/SlideChangedCondition',
            '{6EDA1FF1-B3CB-411A-ADAC-6029D1763BCB}': 'score_ccf/XPerience/Conditions/SlideChangingCondition',
            '{D153496F-BF42-4A47-A9D5-780693D0C2E7}': 'score_ccf/XPerience/Conditions/GetsFocusCondition',
            '{3FF617C7-4ED5-43FC-A766-4F2414107414}': 'score_ccf/XPerience/Conditions/LosesFocusCondition',
            '{39EDBFA3-3BC8-4E7D-BC32-4BF2712353AC}': 'score_ccf/XPerience/Conditions/VideoHasPlayedExactNSecondsCondition',
            '{67E995CD-155D-42CF-9DC8-B7655F9785A5}': 'score_ccf/XPerience/Conditions/VideoHasPlayedNSecondsOrMoreCondition',
            '{B44C5804-E2F8-4BFA-9060-31108659D475}': 'score_ccf/XPerience/Conditions/VideoIsFinishedCondition',
            '{7B2C46CA-0B9E-453F-A269-FA2E0079659D}': 'score_ccf/XPerience/Conditions/VideoIsPausedCondition',
            '{8D46ACE2-32D4-449C-81EF-7C88808F0A14}': 'score_ccf/XPerience/Conditions/VideoStartsToPlayCondition',
        },
        actions: {
            '{70F1F9DC-3930-41EC-9FBB-40B673B15586}': 'score_ccf/XPerience/Actions/CompleteGoalAction',
            '{7DED5636-8783-431B-A965-31E1A47405E1}': 'score_ccf/XPerience/Actions/TrackClientEventAction',
            '{C87955F1-3E04-45A3-A235-4BACD1594B42}': 'score_ccf/XPerience/Actions/TrackClientEventAction',
            '{4D91B017-F733-4E0E-B387-AB0013A71395}': 'score_ccf/XPerience/Actions/TrackClientEventAction',
            '{8C501C45-D61B-4D10-A9E1-0DEDACCD149F}': 'score_ccf/XPerience/Actions/ShowAlertMessage',
            '{8C23D183-5F62-4336-A6AD-2876A0D45511}': 'score_ccf/XPerience/Actions/ContactVisitWithTheProfileCard'
        }
    };
});
//# sourceMappingURL=Elements.js.map;
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Enums/XPEnums',["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var XPModuleState;
    (function (XPModuleState) {
        XPModuleState["Pending"] = "pending";
        XPModuleState["InProcess"] = "inprocess";
        XPModuleState["Loaded"] = "loaded";
        XPModuleState["Failed"] = "failed";
    })(XPModuleState = exports.XPModuleState || (exports.XPModuleState = {}));
    ;
    var XPJunction;
    (function (XPJunction) {
        XPJunction["AND"] = "and";
        XPJunction["OR"] = "or";
    })(XPJunction = exports.XPJunction || (exports.XPJunction = {}));
    ;
});
//# sourceMappingURL=XPEnums.js.map;
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/Xperience/Enums/XPEnums',["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var XPModuleState;
    (function (XPModuleState) {
        XPModuleState["Pending"] = "pending";
        XPModuleState["InProcess"] = "inprocess";
        XPModuleState["Loaded"] = "loaded";
        XPModuleState["Failed"] = "failed";
    })(XPModuleState = exports.XPModuleState || (exports.XPModuleState = {}));
    ;
    var XPJunction;
    (function (XPJunction) {
        XPJunction["AND"] = "and";
        XPJunction["OR"] = "or";
    })(XPJunction = exports.XPJunction || (exports.XPJunction = {}));
    ;
});
//# sourceMappingURL=XPEnums.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/Utils/XPConditionJunction',["require", "exports", "score_ccf/Xperience/Enums/XPEnums", "promise-polyfill"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var XPEnums_1 = require("score_ccf/Xperience/Enums/XPEnums");
    require("promise-polyfill"); // polyfill
    /**
     * Encapsulates junction logic of two and more conditions
     */
    var XPConditionJunction = /** @class */ (function () {
        function XPConditionJunction(operand, conditions) {
            this.operand = operand;
            this._innerConditions = conditions;
            this._operand = operand;
            this.defer = this._initDeferredCondition();
        }
        XPConditionJunction.prototype._initDeferredCondition = function () {
            var _this = this;
            return new Promise(function (resolve, reject) {
                Promise.all(_this._innerConditions).then(function (conditions) {
                    // nested conditions
                    var innerPromises = [];
                    for (var x = 0; x < conditions.length; x++) {
                        var cond = conditions[x];
                        // collect nested condition defer objects, to build current juction behaviour 
                        innerPromises = innerPromises.concat(cond.defer);
                    }
                    if (_this._operand === XPEnums_1.XPJunction.AND) {
                        // wait until all nested conditions will be executed and join them when AND operation
                        Promise.all(innerPromises).then(function (results) {
                            // because modern hipsters cannot understand bitwise operation it is written in that style
                            resolve(results.every(function (v) { return v === !0; }));
                        });
                    }
                    if (_this._operand === XPEnums_1.XPJunction.OR) {
                        var count_1 = innerPromises.length;
                        for (var x = 0; x < innerPromises.length; x++) {
                            innerPromises[x].then(function (value) {
                                // if at least one condition was resolved with true - current Promise will be resolved with true,
                                // if none of conditions was resolved with true, current Promise will be resolved with false
                                if (!--count_1 || value === !0) {
                                    resolve(!!value || !!count_1);
                                }
                            }, function (reason) {
                                reject(reason);
                            });
                        }
                        ;
                    }
                }, function (reason) {
                    reject(reason);
                });
            });
        };
        /**
         * Setup conditions to a scope of the component
         * @param component An instance of a UXModule component to scope conditions of the current junction
         */
        XPConditionJunction.prototype.setup = function (component) {
            for (var index = 0; index < this._innerConditions.length; index++) {
                var conditionModuleLoader = this._innerConditions[index];
                // setup condition as soon as it is loaded
                conditionModuleLoader.then(function (condModule) {
                    condModule.setup(component);
                });
            }
        };
        XPConditionJunction.prototype.false = function () {
            throw new Error('You cannot resolve Junction condition, only inner conditions can resolve the Junction condition.');
        };
        XPConditionJunction.prototype.true = function () {
            throw new Error('You cannot resolve Junction condition, only inner conditions can resolve the Junction condition.');
        };
        /**
         * Proxy reset call to all nested conditions and product a new defer object for current junction
         */
        XPConditionJunction.prototype.reset = function () {
            Promise.all(this._innerConditions).then(function (conditions) {
                for (var x = 0; x < conditions.length; x++) {
                    conditions[x].reset();
                }
            });
            this.defer = this._initDeferredCondition();
        };
        return XPConditionJunction;
    }());
    exports.XPConditionJunction = XPConditionJunction;
    /**
     * Encapsulates AND Junction logic of two and more conditions
     */
    var XPConditionAnd = /** @class */ (function (_super) {
        __extends(XPConditionAnd, _super);
        function XPConditionAnd(conditions) {
            return _super.call(this, XPEnums_1.XPJunction.AND, conditions) || this;
        }
        return XPConditionAnd;
    }(XPConditionJunction));
    exports.XPConditionAnd = XPConditionAnd;
    /**
     * Encapsulates OR Junction logic of two and more conditions
     */
    var XPConditionOr = /** @class */ (function (_super) {
        __extends(XPConditionOr, _super);
        function XPConditionOr(conditions) {
            return _super.call(this, XPEnums_1.XPJunction.AND, conditions) || this;
        }
        return XPConditionOr;
    }(XPConditionJunction));
    exports.XPConditionOr = XPConditionOr;
});
//# sourceMappingURL=XPConditionJunction.js.map;
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/XPActionLoader',["require", "exports", "score_ccf/XPerience/Elements", "promise-polyfill"], factory);
    }
})(function (require, exports) {
    "use strict";
    var __syncRequire = typeof module === "object" && typeof module.exports === "object";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Elements_1 = require("score_ccf/XPerience/Elements");
    require("promise-polyfill");
    /**
     * Load XP Action modules from xml desription
     */
    var XPActionLoader = /** @class */ (function () {
        function XPActionLoader() {
        }
        /**
         * Load module and create an instance of it
         * @param {string} modulePath path to a module which should be dynamicly loaded
         * @param {XPAttributes} attributes Initial data which will be passed to a loaded module constructor
         */
        XPActionLoader.prototype.getModule = function (modulePath, attributes) {
            // all actions should be inherited from XPActionBase
            return (__syncRequire ? Promise.resolve().then(function () { return require(modulePath); }) : new Promise(function (resolve_1, reject_1) { require([modulePath], resolve_1, reject_1); })).then(function (actModule) {
                // create an instance of a named export
                if (actModule.hasOwnProperty(Elements_1.ElementPairs.actions[attributes["id"]])) {
                    return new actModule[Elements_1.ElementPairs.actions[attributes["id"]]](attributes);
                }
                // create an instance from default export
                if ('__esModule' in actModule === !0 && actModule.hasOwnProperty("default")) {
                    return new actModule.default(attributes);
                }
                // outdated version of module
                if (actModule instanceof Function) {
                    return new actModule(attributes);
                }
                throw new Error("Cannot detect a constructor of the '" + modulePath + "' module.'");
            }, function (reason) {
                throw new Error("Cannot load module '" + modulePath + "'. Reason: " + reason);
            });
        };
        /**
         * Load a list of Action Modules based on xml nodes
         * @param actionNodes A List of xml nodes which describe an action
         */
        XPActionLoader.prototype.loadActions = function (actionNodes) {
            var actions = [];
            for (var index = 0; index < actionNodes.length; index++) {
                var actNode = actionNodes[index];
                var actAttr = {};
                var nodeAttrs = actNode.attributes;
                // create a dynamic object with attributes defined on an XML element
                for (var index_1 = 0; index_1 < nodeAttrs.length; index_1++) {
                    var attr = nodeAttrs[index_1];
                    actAttr[attr.name] = attr.value;
                }
                // check required 'id' attribute, without it we cannot load an action
                if (!('id' in actAttr) || typeof actAttr.id !== "string") {
                    throw new Error("Cannot load action without ID. Action XML: " + actNode.outerHTML);
                }
                // resolve module name based on its id
                var moduleName = Elements_1.ElementPairs.actions[actAttr.id];
                if (!moduleName || moduleName.length <= 0) {
                    throw new Error("Cannot load detect Action Module Name by ID. Please specity it in 'score_ccf/XPerience/Elements' module. Action XML: " + actNode.outerHTML);
                }
                var modulePath = ~moduleName.indexOf('/') ? moduleName : "score_ccf/XPerience/Actions/" + moduleName;
                var actionLoader = this.getModule(modulePath, actAttr);
                actions = actions.concat(actionLoader);
            }
            return actions;
        };
        return XPActionLoader;
    }());
    exports.XPActionLoader = XPActionLoader;
});
//# sourceMappingURL=XPActionLoader.js.map;
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/XPConditionLoader',["require", "exports", "score_ccf/XPerience/Elements", "score_ccf/XPerience/Utils/XPConditionJunction", "promise-polyfill"], factory);
    }
})(function (require, exports) {
    "use strict";
    var __syncRequire = typeof module === "object" && typeof module.exports === "object";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Elements_1 = require("score_ccf/XPerience/Elements");
    var XPConditionJunction_1 = require("score_ccf/XPerience/Utils/XPConditionJunction");
    require("promise-polyfill");
    var XPConditionLoader = /** @class */ (function () {
        function XPConditionLoader() {
        }
        /**
         * Load condition module and create an instance of it
         * @param {string} modulePath path to a module which should be dynamicly loaded
         * @param {XPAttributes} attributes Initial data which will be passed to a loaded module constructor
         */
        XPConditionLoader.prototype.getModule = function (modulePath, attributes) {
            return (__syncRequire ? Promise.resolve().then(function () { return require(modulePath); }) : new Promise(function (resolve_1, reject_1) { require([modulePath], resolve_1, reject_1); })).then(function (condModule) {
                // create an instance of a named export
                if (condModule.hasOwnProperty(Elements_1.ElementPairs.conditions[attributes["id"]])) {
                    return new condModule[Elements_1.ElementPairs.actions[attributes["id"]]](attributes);
                }
                // create an instance from default export
                if ('__esModule' in condModule && condModule.__esModule === !0 && condModule.hasOwnProperty("default")) {
                    return new condModule.default(attributes);
                }
                // outdated version of module
                if (condModule instanceof Function) {
                    return new condModule(attributes);
                }
                throw new Error("Cannot detect a constructor of the '" + modulePath + "' module.'");
            }, function (reason) {
                throw new Error("Cannot load module '" + modulePath + "'. Reason: " + reason);
            });
        };
        /**
         * Load a list of Action Modules based on xml nodes
         * @param actionNodes A List of xml nodes which describe an action
         */
        XPConditionLoader.prototype.loadConditions = function (component, condEls) {
            var conditions = [];
            for (var x = 0; x < condEls.length; x++) {
                var condNode = condEls[x];
                switch (condNode.nodeName) {
                    case '#text':
                        /* do nothing */
                        break;
                    case 'or':
                        /* Junction is a proxy object which calculates passed internal conditions defer object and resolves itself accordingly */
                        conditions = conditions.concat(this.doOrOperation(this.loadConditions(component, condNode.childNodes)));
                        break;
                    case 'and':
                        /* Junction is a proxy object which calculates passed internal conditions defer object and resolves itself accordingly */
                        conditions = conditions.concat(this.doAndOperation(this.loadConditions(component, condNode.childNodes)));
                        break;
                    case 'condition':
                        var condAttr = {};
                        var nodeAttrs = condNode.attributes;
                        // create a dynamic object with attributes defined on an XML element
                        for (var index = 0; index < nodeAttrs.length; index++) {
                            var attr = nodeAttrs[index];
                            condAttr[attr.name] = attr.value;
                        }
                        // check required 'id' attribute, without it we cannot load a condition
                        if (!('id' in condAttr) || typeof condAttr.id !== "string") {
                            throw new Error("Cannot load condition without ID. Condition XML: " + condAttr.outerHTML);
                        }
                        // resolve module name based on its id
                        var moduleName = Elements_1.ElementPairs.conditions[condAttr.id];
                        if (!moduleName || moduleName.length <= 0) {
                            throw new Error("Cannot load detect Condition Module Name by ID. Please specity it in 'score_ccf/XPerience/Elements' module. Condition XML: " + condNode.outerHTML);
                        }
                        var modulePath = ~moduleName.indexOf('/') ? moduleName : "score_ccf/XPerience/Conditions/" + moduleName;
                        conditions = conditions.concat(this.getModule(modulePath, condAttr));
                        break;
                    default:
                        throw new Error("Unsupportable condition element: " + condNode.outerHTML);
                }
            }
            return conditions;
        };
        /**
         * Create a proxy object which handles junction of conditions
         * @param conditions A list of conditions which are going to be joined with "Or" junction
         */
        XPConditionLoader.prototype.doOrOperation = function (conditions) {
            return Promise.resolve(new XPConditionJunction_1.XPConditionOr(conditions));
        };
        /**
         * Create a proxy object which handles junction of conditions
         * @param conditions A list of conditions which are going to be joined with "And" junction
         */
        XPConditionLoader.prototype.doAndOperation = function (conditions) {
            return Promise.resolve(new XPConditionJunction_1.XPConditionAnd(conditions));
        };
        return XPConditionLoader;
    }());
    exports.XPConditionLoader = XPConditionLoader;
});
//# sourceMappingURL=XPConditionLoader.js.map;
/**
 * @license BrainJocks XperienceRuleLoader
 * https://brainjocks.atlassian.net/wiki/spaces/SDD/pages/217972958
 * Copyright 2017
 */
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define('score_ccf/XPerience/XPRuleLoader',["require", "exports", "score_ccf/XPerience/XPActionLoader", "score_ccf/XPerience/XPConditionLoader", "score_ccf/XPerience/Enums/XPEnums", "promise-polyfill"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var XPActionLoader_1 = require("score_ccf/XPerience/XPActionLoader");
    var XPConditionLoader_1 = require("score_ccf/XPerience/XPConditionLoader");
    var XPEnums_1 = require("score_ccf/XPerience/Enums/XPEnums");
    require("promise-polyfill"); // polyfill
    /**
     * Responsible to parse XP Rules and load required conditions and actions.
     */
    var XPRuleLoader = /** @class */ (function () {
        function XPRuleLoader(actionLoader, conditionLoader) {
            if (actionLoader === void 0) { actionLoader = new XPActionLoader_1.XPActionLoader(); }
            if (conditionLoader === void 0) { conditionLoader = new XPConditionLoader_1.XPConditionLoader(); }
            this._actionLoader = actionLoader;
            this._conditionLoader = conditionLoader;
        }
        /**
         * Apply XP Rule xml to a component
         * @param {UXModuleLike} component An instance of a UXModule component to scope the rules
         * @param {string} xml xml structure which defines XP Rule.
         */
        XPRuleLoader.prototype.applyRules = function (component, xml) {
            // TODO: expose hook for custom actions/conditions
            if (!component.scope || !(component.scope instanceof HTMLElement)) {
                throw new Error('Components which does not have \'scope\' property are not supported. Please extend your component with scope property.');
            }
            // don't do anything if xml rule is not a string or empty
            if (!xml || typeof xml !== "string" || xml.length <= 0) {
                return;
            }
            // insure component has a marker that indicates XP Rules in loading
            component.scope.setAttribute('data-xpr-state', XPEnums_1.XPModuleState.InProcess);
            var rulesDoc = new DOMParser().parseFromString(xml, 'text/xml');
            if (rulesDoc.querySelector('action, condition') == null) {
                // no condition or action was found, just skip the whole logic and return
                component.scope.setAttribute('data-xpr-state', XPEnums_1.XPModuleState.Loaded);
                return;
            }
            var rulesPromises = [];
            var rules = rulesDoc.querySelectorAll('rule');
            for (var index = 0; index < rules.length; index++) {
                var ruleEl = rules[index];
                // get promises with action module instances
                var actions = this._actionLoader.loadActions(ruleEl.querySelectorAll('action'));
                // get promises with condition module instances
                var conditions = this._conditionLoader.loadConditions(component, ruleEl.querySelector('conditions').childNodes);
                // set an array with promises 
                rulesPromises = rulesPromises.concat(this.runRule(conditions, actions, component));
            }
            // when all xp rule condition were loaded (modules loaded) mark current component as xp rule loaded.
            Promise.all(rulesPromises).then(function () {
                component.scope.setAttribute('data-xpr-state', XPEnums_1.XPModuleState.Loaded);
            }, function (reason) {
                // mark component as XP Rules failed.
                component.scope.setAttribute('data-xpr-state', XPEnums_1.XPModuleState.Failed);
                throw new Error(reason);
            });
        };
        /**
         * Run one particular rule. Wait until conditions will be computed and run actions after that.
         * @param {Promise<XPCondition>[]} conditions An Arrya of conditions which will be attached to a component
         * @param {Promise<XPAction>[]} actions An Array of actions which can be executed in scope of a component
         * @param {UXModuleLike} component An instance of a UXModule component to scope the rule
         */
        XPRuleLoader.prototype.runRule = function (conditions, actions, component) {
            var _this = this;
            if (conditions.length === 0 && actions.length === 0) {
                // handle case when XP Rule was removed from a component
                return Promise.resolve();
            }
            return Promise.all(conditions).then(function (condModules) {
                var condsDefs = [];
                for (var x = 0; x < condModules.length; x++) {
                    var condModule = condModules[x];
                    // setup a condition
                    condModule.setup(component);
                    // get a condition defer object which indicates is condition computed or not
                    condsDefs = condsDefs.concat(condModule.defer);
                }
                // wait until the conditions computed.
                Promise.all(condsDefs).then(function (values) {
                    if (values.every(function (v) { return v === !0; })) {
                        Promise.all(actions).then(function (actionModules) {
                            // execute actions
                            actionModules.forEach(function (actionModule) { actionModule.execute(component); });
                            // reset conditions to run them more than once per page view
                            condModules.forEach(function (condModule) { condModule.reset(); });
                            _this.runRule(conditions, actions, component);
                        });
                    }
                    else {
                        // reset conditions to run them more than once per page view
                        condModules.forEach(function (condModule) { condModule.reset(); });
                        _this.runRule(conditions, actions, component);
                    }
                });
            });
        };
        return XPRuleLoader;
    }());
    exports.XPRuleLoader = XPRuleLoader;
});
//# sourceMappingURL=XPRuleLoader.js.map;
/** @license
 * RequireJS plugin for async dependency load like JSONP and Google Maps
 * Author: Miller Medeiros
 * Version: 0.1.2 (2014/02/24)
 * Released under the MIT license
 */
define('async',[],function(){

    var DEFAULT_PARAM_NAME = 'callback',
        _uid = 0;

    function injectScript(src){
        var s, t;
        s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = src;
        t = document.getElementsByTagName('script')[0]; t.parentNode.insertBefore(s,t);
    }

    function formatUrl(name, id){
        var paramRegex = /!(.+)/,
            url = name.replace(paramRegex, ''),
            param = (paramRegex.test(name))? name.replace(/.+!/, '') : DEFAULT_PARAM_NAME;
        url += (url.indexOf('?') < 0)? '?' : '&';
        return url + param +'='+ id;
    }

    function uid() {
        _uid += 1;
        return '__async_req_'+ _uid +'__';
    }

    return{
        load : function(name, req, onLoad, config){
            if(config.isBuild){
                onLoad(null); //avoid errors on the optimizer
            }else{
                var id = uid();
                //create a global variable that stores onLoad so callback
                //function can define new module after async load
                window[id] = onLoad;
                injectScript(formatUrl(req.toUrl(name), id));
            }
        }
    };
});

/** @license
 * Plugin to load JS files that have dependencies but aren't wrapped into
 * `define` calls.
 * Author: Miller Medeiros
 * Version: 0.1.0 (2011/12/13)
 * Released under the MIT license
 */
define('depend',[],function () {

    var rParts = /^(.*)\[([^\]]*)\]$/;

    return {

        //example: depend!bar[jquery,lib/foo]
        load : function(name, req, onLoad, config){
            var parts = rParts.exec(name);

            req(parts[2].split(','), function(){
                req([parts[1]], function(mod){
                    onLoad(mod);
                });
            });
        }

    };

});

/**
 * Basic parser for URL properties
 * @author Miller Medeiros
 * @version 0.1.0 (2011/12/06)
 * MIT license
 */
define('propertyParser',[],function(){

    var rProps = /([\w-]+)\s*:\s*(?:(\[[^\]]+\])|([^,]+)),?/g, //match "foo:bar" and "lorem:[ipsum,dolor]" capturing name as $1 and val as $2 or $3
        rArr = /^\[([^\]]+)\]$/; //match "[foo,bar]" capturing "foo,bar"

    function parseProperties(str){
        var match, obj = {};
        while (match = rProps.exec(str)) {
            obj[ match[1] ] = typecastVal(match[2] || match[3]);
        }
        return obj;
    }

    function typecastVal(val){
        if (rArr.test(val)){
            val = val.replace(rArr, '$1').split(',');
        } else if (val === 'null'){
            val = null;
        } else if (val === 'false'){
            val = false;
        } else if (val === 'true'){
            val = true;
        } else if (val === '' || val === "''" || val === '""'){
            val = '';
        } else if (! isNaN(val)) {
            //isNaN('') == false
            val = +val;
        }
        return val;
    }

    //API
    return {
        parseProperties : parseProperties,
        typecastVal : typecastVal
    };
});

/** @license
 * RequireJS plugin for loading web fonts using the WebFont Loader
 * Author: Miller Medeiros
 * Version: 0.2.0 (2011/12/06)
 * Released under the MIT license
 */
define('font',['propertyParser'], function (propertyParser) {

    var rParts = /^([^,]+),([^\|]+)\|?/;

    function parseName(name) {
        var data = {},
            vendors = name.split('|'),
            n = vendors.length,
            match;

        while (n--) {
            match = rParts.exec(vendors[n]);
            data[ match[1] ] = propertyParser.parseProperties(match[2]);
        }
        return data;
    }

    // API
    return {

        //example: font!google,families:[Tangerine,Cantarell,Yanone Kaffeesatz:700]
        load : function(name, req, onLoad, config){
            if (config.isBuild) {
                onLoad(null); //avoid errors on the optimizer
            } else {
                var data = parseName(name);
                data.active = onLoad;
                data.inactive = function(){
                    onLoad(false);
                };
                req([(document.location.protocol === 'https:'? 'https' : 'http') +'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'], function(){
                    WebFont.load(data);
                });
            }
        }

    };

});

/** @license
 * RequireJS plugin for loading Google Ajax API modules thru `google.load`
 * Author: Miller Medeiros
 * Version: 0.2.0 (2011/12/06)
 * Released under the MIT license
 */
define('goog',['async', 'propertyParser'], function (async, propertyParser) {

    var rParts = /^([^,]+)(?:,([^,]+))?(?:,(.+))?/;

    function parseName(name){
        var match = rParts.exec(name),
            data = {
                moduleName : match[1],
                version : match[2] || '1'
            };
        data.settings = propertyParser.parseProperties(match[3]);
        return data;
    }

    return {
        load : function(name, req, onLoad, config){
            if (config.isBuild) {
                onLoad(null); //avoid errors on the optimizer
            } else {
                var data = parseName(name),
                    settings = data.settings;

                settings.callback = onLoad;

                req(['async!'+ (document.location.protocol === 'https:'? 'https' : 'http') +'://www.google.com/jsapi'], function(){
                    google.load(data.moduleName, data.version, settings);
                });
            }
        }
    };

});

/** @license
 * RequireJS Image Plugin
 * Author: Miller Medeiros
 * Version: 0.2.2 (2013/02/08)
 * Released under the MIT license
 */
define('image',[],function(){

    var CACHE_BUST_QUERY_PARAM = 'bust',
        CACHE_BUST_FLAG = '!bust',
        RELATIVE_FLAG = '!rel';

    function noop(){}

    function cacheBust(url){
        url = url.replace(CACHE_BUST_FLAG, '');
        url += (url.indexOf('?') < 0)? '?' : '&';
        return url + CACHE_BUST_QUERY_PARAM +'='+ Math.round(2147483647 * Math.random());
    }

    return {
        load : function(name, req, onLoad, config){
            var img;
            if(config.isBuild){
                onLoad(null); //avoid errors on the optimizer since it can't inline image files
            }else{
                img = new Image();
                img.onerror = function (err) {
                    onLoad.error(err);
                };
                img.onload = function(evt){
                    onLoad(img);
                    try {
                        delete img.onload; //release memory - suggested by John Hann
                    } catch(err) {
                        img.onload = noop; // IE7 :(
                    }
                };
                if (name.indexOf(RELATIVE_FLAG) !== -1) {
                    //load image relative to module path / baseUrl
                    img.src = req.toUrl( name.replace(RELATIVE_FLAG, '') );
                } else {
                    img.src = name;
                }
            }
        },
        normalize : function (name, normalize) {
            //used normalize to avoid caching references to a "cache busted" request
            return (name.indexOf(CACHE_BUST_FLAG) === -1)? name : cacheBust(name);
        }
    };

});

/**
 * @license text 2.0.15 Copyright jQuery Foundation and other contributors.
 * Released under MIT license, http://github.com/requirejs/text/LICENSE
 */
/*jslint regexp: true */
/*global require, XMLHttpRequest, ActiveXObject,
  define, window, process, Packages,
  java, location, Components, FileUtils */

define('text',['module'], function (module) {
    'use strict';

    var text, fs, Cc, Ci, xpcIsWindows,
        progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
        xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
        bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
        hasLocation = typeof location !== 'undefined' && location.href,
        defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
        defaultHostName = hasLocation && location.hostname,
        defaultPort = hasLocation && (location.port || undefined),
        buildMap = {},
        masterConfig = (module.config && module.config()) || {};

    function useDefault(value, defaultValue) {
        return value === undefined || value === '' ? defaultValue : value;
    }

    //Allow for default ports for http and https.
    function isSamePort(protocol1, port1, protocol2, port2) {
        if (port1 === port2) {
            return true;
        } else if (protocol1 === protocol2) {
            if (protocol1 === 'http') {
                return useDefault(port1, '80') === useDefault(port2, '80');
            } else if (protocol1 === 'https') {
                return useDefault(port1, '443') === useDefault(port2, '443');
            }
        }
        return false;
    }

    text = {
        version: '2.0.15',

        strip: function (content) {
            //Strips <?xml ...?> declarations so that external SVG and XML
            //documents can be added to a document without worry. Also, if the string
            //is an HTML document, only the part inside the body tag is returned.
            if (content) {
                content = content.replace(xmlRegExp, "");
                var matches = content.match(bodyRegExp);
                if (matches) {
                    content = matches[1];
                }
            } else {
                content = "";
            }
            return content;
        },

        jsEscape: function (content) {
            return content.replace(/(['\\])/g, '\\$1')
                .replace(/[\f]/g, "\\f")
                .replace(/[\b]/g, "\\b")
                .replace(/[\n]/g, "\\n")
                .replace(/[\t]/g, "\\t")
                .replace(/[\r]/g, "\\r")
                .replace(/[\u2028]/g, "\\u2028")
                .replace(/[\u2029]/g, "\\u2029");
        },

        createXhr: masterConfig.createXhr || function () {
            //Would love to dump the ActiveX crap in here. Need IE 6 to die first.
            var xhr, i, progId;
            if (typeof XMLHttpRequest !== "undefined") {
                return new XMLHttpRequest();
            } else if (typeof ActiveXObject !== "undefined") {
                for (i = 0; i < 3; i += 1) {
                    progId = progIds[i];
                    try {
                        xhr = new ActiveXObject(progId);
                    } catch (e) {}

                    if (xhr) {
                        progIds = [progId];  // so faster next time
                        break;
                    }
                }
            }

            return xhr;
        },

        /**
         * Parses a resource name into its component parts. Resource names
         * look like: module/name.ext!strip, where the !strip part is
         * optional.
         * @param {String} name the resource name
         * @returns {Object} with properties "moduleName", "ext" and "strip"
         * where strip is a boolean.
         */
        parseName: function (name) {
            var modName, ext, temp,
                strip = false,
                index = name.lastIndexOf("."),
                isRelative = name.indexOf('./') === 0 ||
                             name.indexOf('../') === 0;

            if (index !== -1 && (!isRelative || index > 1)) {
                modName = name.substring(0, index);
                ext = name.substring(index + 1);
            } else {
                modName = name;
            }

            temp = ext || modName;
            index = temp.indexOf("!");
            if (index !== -1) {
                //Pull off the strip arg.
                strip = temp.substring(index + 1) === "strip";
                temp = temp.substring(0, index);
                if (ext) {
                    ext = temp;
                } else {
                    modName = temp;
                }
            }

            return {
                moduleName: modName,
                ext: ext,
                strip: strip
            };
        },

        xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,

        /**
         * Is an URL on another domain. Only works for browser use, returns
         * false in non-browser environments. Only used to know if an
         * optimized .js version of a text resource should be loaded
         * instead.
         * @param {String} url
         * @returns Boolean
         */
        useXhr: function (url, protocol, hostname, port) {
            var uProtocol, uHostName, uPort,
                match = text.xdRegExp.exec(url);
            if (!match) {
                return true;
            }
            uProtocol = match[2];
            uHostName = match[3];

            uHostName = uHostName.split(':');
            uPort = uHostName[1];
            uHostName = uHostName[0];

            return (!uProtocol || uProtocol === protocol) &&
                   (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
                   ((!uPort && !uHostName) || isSamePort(uProtocol, uPort, protocol, port));
        },

        finishLoad: function (name, strip, content, onLoad) {
            content = strip ? text.strip(content) : content;
            if (masterConfig.isBuild) {
                buildMap[name] = content;
            }
            onLoad(content);
        },

        load: function (name, req, onLoad, config) {
            //Name has format: some.module.filext!strip
            //The strip part is optional.
            //if strip is present, then that means only get the string contents
            //inside a body tag in an HTML string. For XML/SVG content it means
            //removing the <?xml ...?> declarations so the content can be inserted
            //into the current doc without problems.

            // Do not bother with the work if a build and text will
            // not be inlined.
            if (config && config.isBuild && !config.inlineText) {
                onLoad();
                return;
            }

            masterConfig.isBuild = config && config.isBuild;

            var parsed = text.parseName(name),
                nonStripName = parsed.moduleName +
                    (parsed.ext ? '.' + parsed.ext : ''),
                url = req.toUrl(nonStripName),
                useXhr = (masterConfig.useXhr) ||
                         text.useXhr;

            // Do not load if it is an empty: url
            if (url.indexOf('empty:') === 0) {
                onLoad();
                return;
            }

            //Load the text. Use XHR if possible and in a browser.
            if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
                text.get(url, function (content) {
                    text.finishLoad(name, parsed.strip, content, onLoad);
                }, function (err) {
                    if (onLoad.error) {
                        onLoad.error(err);
                    }
                });
            } else {
                //Need to fetch the resource across domains. Assume
                //the resource has been optimized into a JS module. Fetch
                //by the module name + extension, but do not include the
                //!strip part to avoid file system issues.
                req([nonStripName], function (content) {
                    text.finishLoad(parsed.moduleName + '.' + parsed.ext,
                                    parsed.strip, content, onLoad);
                });
            }
        },

        write: function (pluginName, moduleName, write, config) {
            if (buildMap.hasOwnProperty(moduleName)) {
                var content = text.jsEscape(buildMap[moduleName]);
                write.asModule(pluginName + "!" + moduleName,
                               "define(function () { return '" +
                                   content +
                               "';});\n");
            }
        },

        writeFile: function (pluginName, moduleName, req, write, config) {
            var parsed = text.parseName(moduleName),
                extPart = parsed.ext ? '.' + parsed.ext : '',
                nonStripName = parsed.moduleName + extPart,
                //Use a '.js' file name so that it indicates it is a
                //script that can be loaded across domains.
                fileName = req.toUrl(parsed.moduleName + extPart) + '.js';

            //Leverage own load() method to load plugin value, but only
            //write out values that do not have the strip argument,
            //to avoid any potential issues with ! in file names.
            text.load(nonStripName, req, function (value) {
                //Use own write() method to construct full module value.
                //But need to create shell that translates writeFile's
                //write() to the right interface.
                var textWrite = function (contents) {
                    return write(fileName, contents);
                };
                textWrite.asModule = function (moduleName, contents) {
                    return write.asModule(moduleName, fileName, contents);
                };

                text.write(pluginName, nonStripName, textWrite, config);
            }, config);
        }
    };

    if (masterConfig.env === 'node' || (!masterConfig.env &&
            typeof process !== "undefined" &&
            process.versions &&
            !!process.versions.node &&
            !process.versions['node-webkit'] &&
            !process.versions['atom-shell'])) {
        //Using special require.nodeRequire, something added by r.js.
        fs = require.nodeRequire('fs');

        text.get = function (url, callback, errback) {
            try {
                var file = fs.readFileSync(url, 'utf8');
                //Remove BOM (Byte Mark Order) from utf8 files if it is there.
                if (file[0] === '\uFEFF') {
                    file = file.substring(1);
                }
                callback(file);
            } catch (e) {
                if (errback) {
                    errback(e);
                }
            }
        };
    } else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
            text.createXhr())) {
        text.get = function (url, callback, errback, headers) {
            var xhr = text.createXhr(), header;
            xhr.open('GET', url, true);

            //Allow plugins direct access to xhr headers
            if (headers) {
                for (header in headers) {
                    if (headers.hasOwnProperty(header)) {
                        xhr.setRequestHeader(header.toLowerCase(), headers[header]);
                    }
                }
            }

            //Allow overrides specified in config
            if (masterConfig.onXhr) {
                masterConfig.onXhr(xhr, url);
            }

            xhr.onreadystatechange = function (evt) {
                var status, err;
                //Do not explicitly handle errors, those should be
                //visible via console output in the browser.
                if (xhr.readyState === 4) {
                    status = xhr.status || 0;
                    if (status > 399 && status < 600) {
                        //An http 4xx or 5xx error. Signal an error.
                        err = new Error(url + ' HTTP status: ' + status);
                        err.xhr = xhr;
                        if (errback) {
                            errback(err);
                        }
                    } else {
                        callback(xhr.responseText);
                    }

                    if (masterConfig.onXhrComplete) {
                        masterConfig.onXhrComplete(xhr, url);
                    }
                }
            };
            xhr.send(null);
        };
    } else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
            typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
        //Why Java, why is this so awkward?
        text.get = function (url, callback) {
            var stringBuffer, line,
                encoding = "utf-8",
                file = new java.io.File(url),
                lineSeparator = java.lang.System.getProperty("line.separator"),
                input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
                content = '';
            try {
                stringBuffer = new java.lang.StringBuffer();
                line = input.readLine();

                // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
                // http://www.unicode.org/faq/utf_bom.html

                // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
                // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
                if (line && line.length() && line.charAt(0) === 0xfeff) {
                    // Eat the BOM, since we've already found the encoding on this file,
                    // and we plan to concatenating this buffer with others; the BOM should
                    // only appear at the top of a file.
                    line = line.substring(1);
                }

                if (line !== null) {
                    stringBuffer.append(line);
                }

                while ((line = input.readLine()) !== null) {
                    stringBuffer.append(lineSeparator);
                    stringBuffer.append(line);
                }
                //Make sure we return a JavaScript string and not a Java string.
                content = String(stringBuffer.toString()); //String
            } finally {
                input.close();
            }
            callback(content);
        };
    } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
            typeof Components !== 'undefined' && Components.classes &&
            Components.interfaces)) {
        //Avert your gaze!
        Cc = Components.classes;
        Ci = Components.interfaces;
        Components.utils['import']('resource://gre/modules/FileUtils.jsm');
        xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);

        text.get = function (url, callback) {
            var inStream, convertStream, fileObj,
                readData = {};

            if (xpcIsWindows) {
                url = url.replace(/\//g, '\\');
            }

            fileObj = new FileUtils.File(url);

            //XPCOM, you so crazy
            try {
                inStream = Cc['@mozilla.org/network/file-input-stream;1']
                           .createInstance(Ci.nsIFileInputStream);
                inStream.init(fileObj, 1, 0, false);

                convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
                                .createInstance(Ci.nsIConverterInputStream);
                convertStream.init(inStream, "utf-8", inStream.available(),
                Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);

                convertStream.readString(inStream.available(), readData);
                convertStream.close();
                inStream.close();
                callback(readData.value);
            } catch (e) {
                throw new Error((fileObj && fileObj.path || '') + ': ' + e);
            }
        };
    }
    return text;
});

/** @license
 * RequireJS plugin for loading JSON files
 * - depends on Text plugin and it was HEAVILY "inspired" by it as well.
 * Author: Miller Medeiros
 * Version: 0.4.0 (2014/04/10)
 * Released under the MIT license
 */
define('json',['text'], function(text){

    var CACHE_BUST_QUERY_PARAM = 'bust',
        CACHE_BUST_FLAG = '!bust',
        jsonParse = (typeof JSON !== 'undefined' && typeof JSON.parse === 'function')? JSON.parse : function(val){
            return eval('('+ val +')'); //quick and dirty
        },
        buildMap = {};

    function cacheBust(url){
        url = url.replace(CACHE_BUST_FLAG, '');
        url += (url.indexOf('?') < 0)? '?' : '&';
        return url + CACHE_BUST_QUERY_PARAM +'='+ Math.round(2147483647 * Math.random());
    }

    //API
    return {

        load : function(name, req, onLoad, config) {
            if (( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1)) || (req.toUrl(name).indexOf('empty:') === 0)) {
                //avoid inlining cache busted JSON or if inlineJSON:false
                //and don't inline files marked as empty!
                onLoad(null);
            } else {
                text.get(req.toUrl(name), function(data){
                    var parsed;
                    if (config.isBuild) {
                        buildMap[name] = data;
                        onLoad(data);
                    } else {
                        try {
                            parsed = jsonParse(data);
                        } catch (e) {
                            onLoad.error(e);
                        }
                        onLoad(parsed);
                    }
                },
                    onLoad.error, {
                        accept: 'application/json'
                    }
                );
            }
        },

        normalize : function (name, normalize) {
            // used normalize to avoid caching references to a "cache busted" request
            if (name.indexOf(CACHE_BUST_FLAG) !== -1) {
                name = cacheBust(name);
            }
            // resolve any relative paths
            return normalize(name);
        },

        //write method based on RequireJS official text plugin by James Burke
        //https://github.com/jrburke/requirejs/blob/master/text.js
        write : function(pluginName, moduleName, write){
            if(moduleName in buildMap){
                var content = buildMap[moduleName];
                write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n');
            }
        }

    };
});

//
// edited original source code to convert API and wrap into
// an AMD module, changes are before/after the wrapped code.
//
// you can replace the markdown converter as long as it
// implements the `makeHtml()` method
//
define('markdownConverter',['require', 'exports'], function(require, exports){
// ======= START WRAP


var Markdown;

if (typeof exports === "object" && typeof require === "function") // we're in a CommonJS (e.g. Node.js) module
    Markdown = exports;
else
    Markdown = {};

// The following text is included for historical reasons, but should
// be taken with a pinch of salt; it's not all true anymore.

//
// Wherever possible, Showdown is a straight, line-by-line port
// of the Perl version of Markdown.
//
// This is not a normal parser design; it's basically just a
// series of string substitutions.  It's hard to read and
// maintain this way,  but keeping Showdown close to the original
// design makes it easier to port new features.
//
// More importantly, Showdown behaves like markdown.pl in most
// edge cases.  So web applications can do client-side preview
// in Javascript, and then build identical HTML on the server.
//
// This port needs the new RegExp functionality of ECMA 262,
// 3rd Edition (i.e. Javascript 1.5).  Most modern web browsers
// should do fine.  Even with the new regular expression features,
// We do a lot of work to emulate Perl's regex functionality.
// The tricky changes in this file mostly have the "attacklab:"
// label.  Major or self-explanatory changes don't.
//
// Smart diff tools like Araxis Merge will be able to match up
// this file with markdown.pl in a useful way.  A little tweaking
// helps: in a copy of markdown.pl, replace "#" with "//" and
// replace "$text" with "text".  Be sure to ignore whitespace
// and line endings.
//


//
// Usage:
//
//   var text = "Markdown *rocks*.";
//
//   var converter = new Markdown.Converter();
//   var html = converter.makeHtml(text);
//
//   alert(html);
//
// Note: move the sample code to the bottom of this
// file before uncommenting it.
//

(function () {

    function identity(x) { return x; }
    function returnFalse(x) { return false; }

    function HookCollection() { }

    HookCollection.prototype = {

        chain: function (hookname, func) {
            var original = this[hookname];
            if (!original)
                throw new Error("unknown hook " + hookname);

            if (original === identity)
                this[hookname] = func;
            else
                this[hookname] = function (x) { return func(original(x)); }
        },
        set: function (hookname, func) {
            if (!this[hookname])
                throw new Error("unknown hook " + hookname);
            this[hookname] = func;
        },
        addNoop: function (hookname) {
            this[hookname] = identity;
        },
        addFalse: function (hookname) {
            this[hookname] = returnFalse;
        }
    };

    Markdown.HookCollection = HookCollection;

    // g_urls and g_titles allow arbitrary user-entered strings as keys. This
    // caused an exception (and hence stopped the rendering) when the user entered
    // e.g. [push] or [__proto__]. Adding a prefix to the actual key prevents this
    // (since no builtin property starts with "s_"). See
    // http://meta.stackoverflow.com/questions/64655/strange-wmd-bug
    // (granted, switching from Array() to Object() alone would have left only __proto__
    // to be a problem)
    function SaveHash() { }
    SaveHash.prototype = {
        set: function (key, value) {
            this["s_" + key] = value;
        },
        get: function (key) {
            return this["s_" + key];
        }
    };

    Markdown.Converter = function () {
        var pluginHooks = this.hooks = new HookCollection();
        pluginHooks.addNoop("plainLinkText");  // given a URL that was encountered by itself (without markup), should return the link text that's to be given to this link
        pluginHooks.addNoop("preConversion");  // called with the orignal text as given to makeHtml. The result of this plugin hook is the actual markdown source that will be cooked
        pluginHooks.addNoop("postConversion"); // called with the final cooked HTML code. The result of this plugin hook is the actual output of makeHtml

        //
        // Private state of the converter instance:
        //

        // Global hashes, used by various utility routines
        var g_urls;
        var g_titles;
        var g_html_blocks;

        // Used to track when we're inside an ordered or unordered list
        // (see _ProcessListItems() for details):
        var g_list_level;

        this.makeHtml = function (text) {

            //
            // Main function. The order in which other subs are called here is
            // essential. Link and image substitutions need to happen before
            // _EscapeSpecialCharsWithinTagAttributes(), so that any *'s or _'s in the <a>
            // and <img> tags get encoded.
            //

            // This will only happen if makeHtml on the same converter instance is called from a plugin hook.
            // Don't do that.
            if (g_urls)
                throw new Error("Recursive call to converter.makeHtml");

            // Create the private state objects.
            g_urls = new SaveHash();
            g_titles = new SaveHash();
            g_html_blocks = [];
            g_list_level = 0;

            text = pluginHooks.preConversion(text);

            // attacklab: Replace ~ with ~T
            // This lets us use tilde as an escape char to avoid md5 hashes
            // The choice of character is arbitray; anything that isn't
            // magic in Markdown will work.
            text = text.replace(/~/g, "~T");

            // attacklab: Replace $ with ~D
            // RegExp interprets $ as a special character
            // when it's in a replacement string
            text = text.replace(/\$/g, "~D");

            // Standardize line endings
            text = text.replace(/\r\n/g, "\n"); // DOS to Unix
            text = text.replace(/\r/g, "\n"); // Mac to Unix

            // Make sure text begins and ends with a couple of newlines:
            text = "\n\n" + text + "\n\n";

            // Convert all tabs to spaces.
            text = _Detab(text);

            // Strip any lines consisting only of spaces and tabs.
            // This makes subsequent regexen easier to write, because we can
            // match consecutive blank lines with /\n+/ instead of something
            // contorted like /[ \t]*\n+/ .
            text = text.replace(/^[ \t]+$/mg, "");

            // Turn block-level HTML blocks into hash entries
            text = _HashHTMLBlocks(text);

            // Strip link definitions, store in hashes.
            text = _StripLinkDefinitions(text);

            text = _RunBlockGamut(text);

            text = _UnescapeSpecialChars(text);

            // attacklab: Restore dollar signs
            text = text.replace(/~D/g, "$$");

            // attacklab: Restore tildes
            text = text.replace(/~T/g, "~");

            text = pluginHooks.postConversion(text);

            g_html_blocks = g_titles = g_urls = null;

            return text;
        };

        function _StripLinkDefinitions(text) {
            //
            // Strips link definitions from text, stores the URLs and titles in
            // hash references.
            //

            // Link defs are in the form: ^[id]: url "optional title"

            /*
            text = text.replace(/
                ^[ ]{0,3}\[(.+)\]:  // id = $1  attacklab: g_tab_width - 1
                [ \t]*
                \n?                 // maybe *one* newline
                [ \t]*
                <?(\S+?)>?          // url = $2
                (?=\s|$)            // lookahead for whitespace instead of the lookbehind removed below
                [ \t]*
                \n?                 // maybe one newline
                [ \t]*
                (                   // (potential) title = $3
                    (\n*)           // any lines skipped = $4 attacklab: lookbehind removed
                    [ \t]+
                    ["(]
                    (.+?)           // title = $5
                    [")]
                    [ \t]*
                )?                  // title is optional
                (?:\n+|$)
            /gm, function(){...});
            */

            text = text.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,
                function (wholeMatch, m1, m2, m3, m4, m5) {
                    m1 = m1.toLowerCase();
                    g_urls.set(m1, _EncodeAmpsAndAngles(m2));  // Link IDs are case-insensitive
                    if (m4) {
                        // Oops, found blank lines, so it's not a title.
                        // Put back the parenthetical statement we stole.
                        return m3;
                    } else if (m5) {
                        g_titles.set(m1, m5.replace(/"/g, "&quot;"));
                    }

                    // Completely remove the definition from the text
                    return "";
                }
            );

            return text;
        }

        function _HashHTMLBlocks(text) {

            // Hashify HTML blocks:
            // We only want to do this for block-level HTML tags, such as headers,
            // lists, and tables. That's because we still want to wrap <p>s around
            // "paragraphs" that are wrapped in non-block-level tags, such as anchors,
            // phrase emphasis, and spans. The list of tags we're looking for is
            // hard-coded:
            var block_tags_a = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del"
            var block_tags_b = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math"

            // First, look for nested blocks, e.g.:
            //   <div>
            //     <div>
            //     tags for inner block must be indented.
            //     </div>
            //   </div>
            //
            // The outermost tags must start at the left margin for this to match, and
            // the inner nested divs must be indented.
            // We need to do this before the next, more liberal match, because the next
            // match will start at the first `<div>` and stop at the first `</div>`.

            // attacklab: This regex can be expensive when it fails.

            /*
            text = text.replace(/
                (                       // save in $1
                    ^                   // start of line  (with /m)
                    <($block_tags_a)    // start tag = $2
                    \b                  // word break
                                        // attacklab: hack around khtml/pcre bug...
                    [^\r]*?\n           // any number of lines, minimally matching
                    </\2>               // the matching end tag
                    [ \t]*              // trailing spaces/tabs
                    (?=\n+)             // followed by a newline
                )                       // attacklab: there are sentinel newlines at end of document
            /gm,function(){...}};
            */
            text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm, hashElement);

            //
            // Now match more liberally, simply from `\n<tag>` to `</tag>\n`
            //

            /*
            text = text.replace(/
                (                       // save in $1
                    ^                   // start of line  (with /m)
                    <($block_tags_b)    // start tag = $2
                    \b                  // word break
                                        // attacklab: hack around khtml/pcre bug...
                    [^\r]*?             // any number of lines, minimally matching
                    .*</\2>             // the matching end tag
                    [ \t]*              // trailing spaces/tabs
                    (?=\n+)             // followed by a newline
                )                       // attacklab: there are sentinel newlines at end of document
            /gm,function(){...}};
            */
            text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, hashElement);

            // Special case just for <hr />. It was easier to make a special case than
            // to make the other regex more complicated.

            /*
            text = text.replace(/
                \n                  // Starting after a blank line
                [ ]{0,3}
                (                   // save in $1
                    (<(hr)          // start tag = $2
                        \b          // word break
                        ([^<>])*?
                    \/?>)           // the matching end tag
                    [ \t]*
                    (?=\n{2,})      // followed by a blank line
                )
            /g,hashElement);
            */
            text = text.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, hashElement);

            // Special case for standalone HTML comments:

            /*
            text = text.replace(/
                \n\n                                            // Starting after a blank line
                [ ]{0,3}                                        // attacklab: g_tab_width - 1
                (                                               // save in $1
                    <!
                    (--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)   // see http://www.w3.org/TR/html-markup/syntax.html#comments and http://meta.stackoverflow.com/q/95256
                    >
                    [ \t]*
                    (?=\n{2,})                                  // followed by a blank line
                )
            /g,hashElement);
            */
            text = text.replace(/\n\n[ ]{0,3}(<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g, hashElement);

            // PHP and ASP-style processor instructions (<?...?> and <%...%>)

            /*
            text = text.replace(/
                (?:
                    \n\n            // Starting after a blank line
                )
                (                   // save in $1
                    [ ]{0,3}        // attacklab: g_tab_width - 1
                    (?:
                        <([?%])     // $2
                        [^\r]*?
                        \2>
                    )
                    [ \t]*
                    (?=\n{2,})      // followed by a blank line
                )
            /g,hashElement);
            */
            text = text.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, hashElement);

            return text;
        }

        function hashElement(wholeMatch, m1) {
            var blockText = m1;

            // Undo double lines
            blockText = blockText.replace(/^\n+/, "");

            // strip trailing blank lines
            blockText = blockText.replace(/\n+$/g, "");

            // Replace the element text with a marker ("~KxK" where x is its key)
            blockText = "\n\n~K" + (g_html_blocks.push(blockText) - 1) + "K\n\n";

            return blockText;
        }

        function _RunBlockGamut(text, doNotUnhash) {
            //
            // These are all the transformations that form block-level
            // tags like paragraphs, headers, and list items.
            //
            text = _DoHeaders(text);

            // Do Horizontal Rules:
            var replacement = "<hr />\n";
            text = text.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm, replacement);
            text = text.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm, replacement);
            text = text.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, replacement);

            text = _DoLists(text);
            text = _DoCodeBlocks(text);
            text = _DoBlockQuotes(text);

            // We already ran _HashHTMLBlocks() before, in Markdown(), but that
            // was to escape raw HTML in the original Markdown source. This time,
            // we're escaping the markup we've just created, so that we don't wrap
            // <p> tags around block-level tags.
            text = _HashHTMLBlocks(text);
            text = _FormParagraphs(text, doNotUnhash);

            return text;
        }

        function _RunSpanGamut(text) {
            //
            // These are all the transformations that occur *within* block-level
            // tags like paragraphs, headers, and list items.
            //

            text = _DoCodeSpans(text);
            text = _EscapeSpecialCharsWithinTagAttributes(text);
            text = _EncodeBackslashEscapes(text);

            // Process anchor and image tags. Images must come first,
            // because ![foo][f] looks like an anchor.
            text = _DoImages(text);
            text = _DoAnchors(text);

            // Make links out of things like `<http://example.com/>`
            // Must come after _DoAnchors(), because you can use < and >
            // delimiters in inline links like [this](<url>).
            text = _DoAutoLinks(text);

            text = text.replace(/~P/g, "://"); // put in place to prevent autolinking; reset now

            text = _EncodeAmpsAndAngles(text);
            text = _DoItalicsAndBold(text);

            // Do hard breaks:
            text = text.replace(/  +\n/g, " <br>\n");

            return text;
        }

        function _EscapeSpecialCharsWithinTagAttributes(text) {
            //
            // Within tags -- meaning between < and > -- encode [\ ` * _] so they
            // don't conflict with their use in Markdown for code, italics and strong.
            //

            // Build a regex to find HTML tags and comments.  See Friedl's
            // "Mastering Regular Expressions", 2nd Ed., pp. 200-201.

            // SE: changed the comment part of the regex

            var regex = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;

            text = text.replace(regex, function (wholeMatch) {
                var tag = wholeMatch.replace(/(.)<\/?code>(?=.)/g, "$1`");
                tag = escapeCharacters(tag, wholeMatch.charAt(1) == "!" ? "\\`*_/" : "\\`*_"); // also escape slashes in comments to prevent autolinking there -- http://meta.stackoverflow.com/questions/95987
                return tag;
            });

            return text;
        }

        function _DoAnchors(text) {
            //
            // Turn Markdown link shortcuts into XHTML <a> tags.
            //
            //
            // First, handle reference-style links: [link text] [id]
            //

            /*
            text = text.replace(/
                (                           // wrap whole match in $1
                    \[
                    (
                        (?:
                            \[[^\]]*\]      // allow brackets nested one level
                            |
                            [^\[]           // or anything else
                        )*
                    )
                    \]

                    [ ]?                    // one optional space
                    (?:\n[ ]*)?             // one optional newline followed by spaces

                    \[
                    (.*?)                   // id = $3
                    \]
                )
                ()()()()                    // pad remaining backreferences
            /g, writeAnchorTag);
            */
            text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, writeAnchorTag);

            //
            // Next, inline-style links: [link text](url "optional title")
            //

            /*
            text = text.replace(/
                (                           // wrap whole match in $1
                    \[
                    (
                        (?:
                            \[[^\]]*\]      // allow brackets nested one level
                            |
                            [^\[\]]         // or anything else
                        )*
                    )
                    \]
                    \(                      // literal paren
                    [ \t]*
                    ()                      // no id, so leave $3 empty
                    <?(                     // href = $4
                        (?:
                            \([^)]*\)       // allow one level of (correctly nested) parens (think MSDN)
                            |
                            [^()]
                        )*?
                    )>?
                    [ \t]*
                    (                       // $5
                        (['"])              // quote char = $6
                        (.*?)               // Title = $7
                        \6                  // matching quote
                        [ \t]*              // ignore any spaces/tabs between closing quote and )
                    )?                      // title is optional
                    \)
                )
            /g, writeAnchorTag);
            */

            text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?((?:\([^)]*\)|[^()])*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, writeAnchorTag);

            //
            // Last, handle reference-style shortcuts: [link text]
            // These must come last in case you've also got [link test][1]
            // or [link test](/foo)
            //

            /*
            text = text.replace(/
                (                   // wrap whole match in $1
                    \[
                    ([^\[\]]+)      // link text = $2; can't contain '[' or ']'
                    \]
                )
                ()()()()()          // pad rest of backreferences
            /g, writeAnchorTag);
            */
            text = text.replace(/(\[([^\[\]]+)\])()()()()()/g, writeAnchorTag);

            return text;
        }

        function writeAnchorTag(wholeMatch, m1, m2, m3, m4, m5, m6, m7) {
            if (m7 == undefined) m7 = "";
            var whole_match = m1;
            var link_text = m2.replace(/:\/\//g, "~P"); // to prevent auto-linking withing the link. will be converted back after the auto-linker runs
            var link_id = m3.toLowerCase();
            var url = m4;
            var title = m7;

            if (url == "") {
                if (link_id == "") {
                    // lower-case and turn embedded newlines into spaces
                    link_id = link_text.toLowerCase().replace(/ ?\n/g, " ");
                }
                url = "#" + link_id;

                if (g_urls.get(link_id) != undefined) {
                    url = g_urls.get(link_id);
                    if (g_titles.get(link_id) != undefined) {
                        title = g_titles.get(link_id);
                    }
                }
                else {
                    if (whole_match.search(/\(\s*\)$/m) > -1) {
                        // Special case for explicit empty url
                        url = "";
                    } else {
                        return whole_match;
                    }
                }
            }
            url = encodeProblemUrlChars(url);
            url = escapeCharacters(url, "*_");
            var result = "<a href=\"" + url + "\"";

            if (title != "") {
                title = attributeEncode(title);
                title = escapeCharacters(title, "*_");
                result += " title=\"" + title + "\"";
            }

            result += ">" + link_text + "</a>";

            return result;
        }

        function _DoImages(text) {
            //
            // Turn Markdown image shortcuts into <img> tags.
            //

            //
            // First, handle reference-style labeled images: ![alt text][id]
            //

            /*
            text = text.replace(/
                (                   // wrap whole match in $1
                    !\[
                    (.*?)           // alt text = $2
                    \]

                    [ ]?            // one optional space
                    (?:\n[ ]*)?     // one optional newline followed by spaces

                    \[
                    (.*?)           // id = $3
                    \]
                )
                ()()()()            // pad rest of backreferences
            /g, writeImageTag);
            */
            text = text.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, writeImageTag);

            //
            // Next, handle inline images:  ![alt text](url "optional title")
            // Don't forget: encode * and _

            /*
            text = text.replace(/
                (                   // wrap whole match in $1
                    !\[
                    (.*?)           // alt text = $2
                    \]
                    \s?             // One optional whitespace character
                    \(              // literal paren
                    [ \t]*
                    ()              // no id, so leave $3 empty
                    <?(\S+?)>?      // src url = $4
                    [ \t]*
                    (               // $5
                        (['"])      // quote char = $6
                        (.*?)       // title = $7
                        \6          // matching quote
                        [ \t]*
                    )?              // title is optional
                    \)
                )
            /g, writeImageTag);
            */
            text = text.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, writeImageTag);

            return text;
        }

        function attributeEncode(text) {
            // unconditionally replace angle brackets here -- what ends up in an attribute (e.g. alt or title)
            // never makes sense to have verbatim HTML in it (and the sanitizer would totally break it)
            return text.replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
        }

        function writeImageTag(wholeMatch, m1, m2, m3, m4, m5, m6, m7) {
            var whole_match = m1;
            var alt_text = m2;
            var link_id = m3.toLowerCase();
            var url = m4;
            var title = m7;

            if (!title) title = "";

            if (url == "") {
                if (link_id == "") {
                    // lower-case and turn embedded newlines into spaces
                    link_id = alt_text.toLowerCase().replace(/ ?\n/g, " ");
                }
                url = "#" + link_id;

                if (g_urls.get(link_id) != undefined) {
                    url = g_urls.get(link_id);
                    if (g_titles.get(link_id) != undefined) {
                        title = g_titles.get(link_id);
                    }
                }
                else {
                    return whole_match;
                }
            }

            alt_text = escapeCharacters(attributeEncode(alt_text), "*_[]()");
            url = escapeCharacters(url, "*_");
            var result = "<img src=\"" + url + "\" alt=\"" + alt_text + "\"";

            // attacklab: Markdown.pl adds empty title attributes to images.
            // Replicate this bug.

            //if (title != "") {
            title = attributeEncode(title);
            title = escapeCharacters(title, "*_");
            result += " title=\"" + title + "\"";
            //}

            result += " />";

            return result;
        }

        function _DoHeaders(text) {

            // Setext-style headers:
            //  Header 1
            //  ========
            //
            //  Header 2
            //  --------
            //
            text = text.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,
                function (wholeMatch, m1) { return "<h1>" + _RunSpanGamut(m1) + "</h1>\n\n"; }
            );

            text = text.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,
                function (matchFound, m1) { return "<h2>" + _RunSpanGamut(m1) + "</h2>\n\n"; }
            );

            // atx-style headers:
            //  # Header 1
            //  ## Header 2
            //  ## Header 2 with closing hashes ##
            //  ...
            //  ###### Header 6
            //

            /*
            text = text.replace(/
                ^(\#{1,6})      // $1 = string of #'s
                [ \t]*
                (.+?)           // $2 = Header text
                [ \t]*
                \#*             // optional closing #'s (not counted)
                \n+
            /gm, function() {...});
            */

            text = text.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,
                function (wholeMatch, m1, m2) {
                    var h_level = m1.length;
                    return "<h" + h_level + ">" + _RunSpanGamut(m2) + "</h" + h_level + ">\n\n";
                }
            );

            return text;
        }

        function _DoLists(text) {
            //
            // Form HTML ordered (numbered) and unordered (bulleted) lists.
            //

            // attacklab: add sentinel to hack around khtml/safari bug:
            // http://bugs.webkit.org/show_bug.cgi?id=11231
            text += "~0";

            // Re-usable pattern to match any entirel ul or ol list:

            /*
            var whole_list = /
                (                                   // $1 = whole list
                    (                               // $2
                        [ ]{0,3}                    // attacklab: g_tab_width - 1
                        ([*+-]|\d+[.])              // $3 = first list item marker
                        [ \t]+
                    )
                    [^\r]+?
                    (                               // $4
                        ~0                          // sentinel for workaround; should be $
                        |
                        \n{2,}
                        (?=\S)
                        (?!                         // Negative lookahead for another list item marker
                            [ \t]*
                            (?:[*+-]|\d+[.])[ \t]+
                        )
                    )
                )
            /g
            */
            var whole_list = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;

            if (g_list_level) {
                text = text.replace(whole_list, function (wholeMatch, m1, m2) {
                    var list = m1;
                    var list_type = (m2.search(/[*+-]/g) > -1) ? "ul" : "ol";

                    var result = _ProcessListItems(list, list_type);

                    // Trim any trailing whitespace, to put the closing `</$list_type>`
                    // up on the preceding line, to get it past the current stupid
                    // HTML block parser. This is a hack to work around the terrible
                    // hack that is the HTML block parser.
                    result = result.replace(/\s+$/, "");
                    result = "<" + list_type + ">" + result + "</" + list_type + ">\n";
                    return result;
                });
            } else {
                whole_list = /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;
                text = text.replace(whole_list, function (wholeMatch, m1, m2, m3) {
                    var runup = m1;
                    var list = m2;

                    var list_type = (m3.search(/[*+-]/g) > -1) ? "ul" : "ol";
                    var result = _ProcessListItems(list, list_type);
                    result = runup + "<" + list_type + ">\n" + result + "</" + list_type + ">\n";
                    return result;
                });
            }

            // attacklab: strip sentinel
            text = text.replace(/~0/, "");

            return text;
        }

        var _listItemMarkers = { ol: "\\d+[.]", ul: "[*+-]" };

        function _ProcessListItems(list_str, list_type) {
            //
            //  Process the contents of a single ordered or unordered list, splitting it
            //  into individual list items.
            //
            //  list_type is either "ul" or "ol".

            // The $g_list_level global keeps track of when we're inside a list.
            // Each time we enter a list, we increment it; when we leave a list,
            // we decrement. If it's zero, we're not in a list anymore.
            //
            // We do this because when we're not inside a list, we want to treat
            // something like this:
            //
            //    I recommend upgrading to version
            //    8. Oops, now this line is treated
            //    as a sub-list.
            //
            // As a single paragraph, despite the fact that the second line starts
            // with a digit-period-space sequence.
            //
            // Whereas when we're inside a list (or sub-list), that line will be
            // treated as the start of a sub-list. What a kludge, huh? This is
            // an aspect of Markdown's syntax that's hard to parse perfectly
            // without resorting to mind-reading. Perhaps the solution is to
            // change the syntax rules such that sub-lists must start with a
            // starting cardinal number; e.g. "1." or "a.".

            g_list_level++;

            // trim trailing blank lines:
            list_str = list_str.replace(/\n{2,}$/, "\n");

            // attacklab: add sentinel to emulate \z
            list_str += "~0";

            // In the original attacklab showdown, list_type was not given to this function, and anything
            // that matched /[*+-]|\d+[.]/ would just create the next <li>, causing this mismatch:
            //
            //  Markdown          rendered by WMD        rendered by MarkdownSharp
            //  ------------------------------------------------------------------
            //  1. first          1. first               1. first
            //  2. second         2. second              2. second
            //  - third           3. third                   * third
            //
            // We changed this to behave identical to MarkdownSharp. This is the constructed RegEx,
            // with {MARKER} being one of \d+[.] or [*+-], depending on list_type:

            /*
            list_str = list_str.replace(/
                (^[ \t]*)                       // leading whitespace = $1
                ({MARKER}) [ \t]+               // list marker = $2
                ([^\r]+?                        // list item text   = $3
                    (\n+)
                )
                (?=
                    (~0 | \2 ({MARKER}) [ \t]+)
                )
            /gm, function(){...});
            */

            var marker = _listItemMarkers[list_type];
            var re = new RegExp("(^[ \\t]*)(" + marker + ")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1(" + marker + ")[ \\t]+))", "gm");
            var last_item_had_a_double_newline = false;
            list_str = list_str.replace(re,
                function (wholeMatch, m1, m2, m3) {
                    var item = m3;
                    var leading_space = m1;
                    var ends_with_double_newline = /\n\n$/.test(item);
                    var contains_double_newline = ends_with_double_newline || item.search(/\n{2,}/) > -1;

                    if (contains_double_newline || last_item_had_a_double_newline) {
                        item = _RunBlockGamut(_Outdent(item), /* doNotUnhash = */true);
                    }
                    else {
                        // Recursion for sub-lists:
                        item = _DoLists(_Outdent(item));
                        item = item.replace(/\n$/, ""); // chomp(item)
                        item = _RunSpanGamut(item);
                    }
                    last_item_had_a_double_newline = ends_with_double_newline;
                    return "<li>" + item + "</li>\n";
                }
            );

            // attacklab: strip sentinel
            list_str = list_str.replace(/~0/g, "");

            g_list_level--;
            return list_str;
        }

        function _DoCodeBlocks(text) {
            //
            //  Process Markdown `<pre><code>` blocks.
            //

            /*
            text = text.replace(/
                (?:\n\n|^)
                (                               // $1 = the code block -- one or more lines, starting with a space/tab
                    (?:
                        (?:[ ]{4}|\t)           // Lines must start with a tab or a tab-width of spaces - attacklab: g_tab_width
                        .*\n+
                    )+
                )
                (\n*[ ]{0,3}[^ \t\n]|(?=~0))    // attacklab: g_tab_width
            /g ,function(){...});
            */

            // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
            text += "~0";

            text = text.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,
                function (wholeMatch, m1, m2) {
                    var codeblock = m1;
                    var nextChar = m2;

                    codeblock = _EncodeCode(_Outdent(codeblock));
                    codeblock = _Detab(codeblock);
                    codeblock = codeblock.replace(/^\n+/g, ""); // trim leading newlines
                    codeblock = codeblock.replace(/\n+$/g, ""); // trim trailing whitespace

                    codeblock = "<pre><code>" + codeblock + "\n</code></pre>";

                    return "\n\n" + codeblock + "\n\n" + nextChar;
                }
            );

            // attacklab: strip sentinel
            text = text.replace(/~0/, "");

            return text;
        }

        function hashBlock(text) {
            text = text.replace(/(^\n+|\n+$)/g, "");
            return "\n\n~K" + (g_html_blocks.push(text) - 1) + "K\n\n";
        }

        function _DoCodeSpans(text) {
            //
            // * Backtick quotes are used for <code></code> spans.
            //
            // * You can use multiple backticks as the delimiters if you want to
            //   include literal backticks in the code span. So, this input:
            //
            //      Just type ``foo `bar` baz`` at the prompt.
            //
            //   Will translate to:
            //
            //      <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
            //
            //   There's no arbitrary limit to the number of backticks you
            //   can use as delimters. If you need three consecutive backticks
            //   in your code, use four for delimiters, etc.
            //
            // * You can use spaces to get literal backticks at the edges:
            //
            //      ... type `` `bar` `` ...
            //
            //   Turns to:
            //
            //      ... type <code>`bar`</code> ...
            //

            /*
            text = text.replace(/
                (^|[^\\])       // Character before opening ` can't be a backslash
                (`+)            // $2 = Opening run of `
                (               // $3 = The code block
                    [^\r]*?
                    [^`]        // attacklab: work around lack of lookbehind
                )
                \2              // Matching closer
                (?!`)
            /gm, function(){...});
            */

            text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
                function (wholeMatch, m1, m2, m3, m4) {
                    var c = m3;
                    c = c.replace(/^([ \t]*)/g, ""); // leading whitespace
                    c = c.replace(/[ \t]*$/g, ""); // trailing whitespace
                    c = _EncodeCode(c);
                    c = c.replace(/:\/\//g, "~P"); // to prevent auto-linking. Not necessary in code *blocks*, but in code spans. Will be converted back after the auto-linker runs.
                    return m1 + "<code>" + c + "</code>";
                }
            );

            return text;
        }

        function _EncodeCode(text) {
            //
            // Encode/escape certain characters inside Markdown code runs.
            // The point is that in code, these characters are literals,
            // and lose their special Markdown meanings.
            //
            // Encode all ampersands; HTML entities are not
            // entities within a Markdown code span.
            text = text.replace(/&/g, "&amp;");

            // Do the angle bracket song and dance:
            text = text.replace(/</g, "&lt;");
            text = text.replace(/>/g, "&gt;");

            // Now, escape characters that are magic in Markdown:
            text = escapeCharacters(text, "\*_{}[]\\", false);

            // jj the line above breaks this:
            //---

            //* Item

            //   1. Subitem

            //            special char: *
            //---

            return text;
        }

        function _DoItalicsAndBold(text) {

            // <strong> must go first:
            text = text.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,
            "$1<strong>$3</strong>$4");

            text = text.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,
            "$1<em>$3</em>$4");

            return text;
        }

        function _DoBlockQuotes(text) {

            /*
            text = text.replace(/
                (                           // Wrap whole match in $1
                    (
                        ^[ \t]*>[ \t]?      // '>' at the start of a line
                        .+\n                // rest of the first line
                        (.+\n)*             // subsequent consecutive lines
                        \n*                 // blanks
                    )+
                )
            /gm, function(){...});
            */

            text = text.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,
                function (wholeMatch, m1) {
                    var bq = m1;

                    // attacklab: hack around Konqueror 3.5.4 bug:
                    // "----------bug".replace(/^-/g,"") == "bug"

                    bq = bq.replace(/^[ \t]*>[ \t]?/gm, "~0"); // trim one level of quoting

                    // attacklab: clean up hack
                    bq = bq.replace(/~0/g, "");

                    bq = bq.replace(/^[ \t]+$/gm, "");     // trim whitespace-only lines
                    bq = _RunBlockGamut(bq);             // recurse

                    bq = bq.replace(/(^|\n)/g, "$1  ");
                    // These leading spaces screw with <pre> content, so we need to fix that:
                    bq = bq.replace(
                            /(\s*<pre>[^\r]+?<\/pre>)/gm,
                        function (wholeMatch, m1) {
                            var pre = m1;
                            // attacklab: hack around Konqueror 3.5.4 bug:
                            pre = pre.replace(/^  /mg, "~0");
                            pre = pre.replace(/~0/g, "");
                            return pre;
                        });

                    return hashBlock("<blockquote>\n" + bq + "\n</blockquote>");
                }
            );
            return text;
        }

        function _FormParagraphs(text, doNotUnhash) {
            //
            //  Params:
            //    $text - string to process with html <p> tags
            //

            // Strip leading and trailing lines:
            text = text.replace(/^\n+/g, "");
            text = text.replace(/\n+$/g, "");

            var grafs = text.split(/\n{2,}/g);
            var grafsOut = [];

            var markerRe = /~K(\d+)K/;

            //
            // Wrap <p> tags.
            //
            var end = grafs.length;
            for (var i = 0; i < end; i++) {
                var str = grafs[i];

                // if this is an HTML marker, copy it
                if (markerRe.test(str)) {
                    grafsOut.push(str);
                }
                else if (/\S/.test(str)) {
                    str = _RunSpanGamut(str);
                    str = str.replace(/^([ \t]*)/g, "<p>");
                    str += "</p>"
                    grafsOut.push(str);
                }

            }
            //
            // Unhashify HTML blocks
            //
            if (!doNotUnhash) {
                end = grafsOut.length;
                for (var i = 0; i < end; i++) {
                    var foundAny = true;
                    while (foundAny) { // we may need several runs, since the data may be nested
                        foundAny = false;
                        grafsOut[i] = grafsOut[i].replace(/~K(\d+)K/g, function (wholeMatch, id) {
                            foundAny = true;
                            return g_html_blocks[id];
                        });
                    }
                }
            }
            return grafsOut.join("\n\n");
        }

        function _EncodeAmpsAndAngles(text) {
            // Smart processing for ampersands and angle brackets that need to be encoded.

            // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
            //   http://bumppo.net/projects/amputator/
            text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;");

            // Encode naked <'s
            text = text.replace(/<(?![a-z\/?\$!])/gi, "&lt;");

            return text;
        }

        function _EncodeBackslashEscapes(text) {
            //
            //   Parameter:  String.
            //   Returns:    The string, with after processing the following backslash
            //               escape sequences.
            //

            // attacklab: The polite way to do this is with the new
            // escapeCharacters() function:
            //
            //     text = escapeCharacters(text,"\\",true);
            //     text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
            //
            // ...but we're sidestepping its use of the (slow) RegExp constructor
            // as an optimization for Firefox.  This function gets called a LOT.

            text = text.replace(/\\(\\)/g, escapeCharacters_callback);
            text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g, escapeCharacters_callback);
            return text;
        }

        function _DoAutoLinks(text) {

            // note that at this point, all other URL in the text are already hyperlinked as <a href=""></a>
            // *except* for the <http://www.foo.com> case

            // automatically add < and > around unadorned raw hyperlinks
            // must be preceded by space/BOF and followed by non-word/EOF character
            text = text.replace(/(^|\s)(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\]])($|\W)/gi, "$1<$2$3>$4");

            //  autolink anything like <http://example.com>

            var replacer = function (wholematch, m1) { return "<a href=\"" + m1 + "\">" + pluginHooks.plainLinkText(m1) + "</a>"; }
            text = text.replace(/<((https?|ftp):[^'">\s]+)>/gi, replacer);

            // Email addresses: <address@domain.foo>
            /*
            text = text.replace(/
                <
                (?:mailto:)?
                (
                    [-.\w]+
                    \@
                    [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+
                )
                >
            /gi, _DoAutoLinks_callback());
            */

            /* disabling email autolinking, since we don't do that on the server, either
            text = text.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
                function(wholeMatch,m1) {
                    return _EncodeEmailAddress( _UnescapeSpecialChars(m1) );
                }
            );
            */
            return text;
        }

        function _UnescapeSpecialChars(text) {
            //
            // Swap back in all the special characters we've hidden.
            //
            text = text.replace(/~E(\d+)E/g,
                function (wholeMatch, m1) {
                    var charCodeToReplace = parseInt(m1);
                    return String.fromCharCode(charCodeToReplace);
                }
            );
            return text;
        }

        function _Outdent(text) {
            //
            // Remove one level of line-leading tabs or spaces
            //

            // attacklab: hack around Konqueror 3.5.4 bug:
            // "----------bug".replace(/^-/g,"") == "bug"

            text = text.replace(/^(\t|[ ]{1,4})/gm, "~0"); // attacklab: g_tab_width

            // attacklab: clean up hack
            text = text.replace(/~0/g, "")

            return text;
        }

        function _Detab(text) {
            if (!/\t/.test(text))
                return text;

            var spaces = ["    ", "   ", "  ", " "],
            skew = 0,
            v;

            return text.replace(/[\n\t]/g, function (match, offset) {
                if (match === "\n") {
                    skew = offset + 1;
                    return match;
                }
                v = (offset - skew) % 4;
                skew = offset + 1;
                return spaces[v];
            });
        }

        //
        //  attacklab: Utility functions
        //

        var _problemUrlChars = /(?:["'*()[\]:]|~D)/g;

        // hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems
        function encodeProblemUrlChars(url) {
            if (!url)
                return "";

            var len = url.length;

            return url.replace(_problemUrlChars, function (match, offset) {
                if (match == "~D") // escape for dollar
                    return "%24";
                if (match == ":") {
                    if (offset == len - 1 || /[0-9\/]/.test(url.charAt(offset + 1)))
                        return ":"
                }
                return "%" + match.charCodeAt(0).toString(16);
            });
        }


        function escapeCharacters(text, charsToEscape, afterBackslash) {
            // First we have to escape the escape characters so that
            // we can build a character class out of them
            var regexString = "([" + charsToEscape.replace(/([\[\]\\])/g, "\\$1") + "])";

            if (afterBackslash) {
                regexString = "\\\\" + regexString;
            }

            var regex = new RegExp(regexString, "g");
            text = text.replace(regex, escapeCharacters_callback);

            return text;
        }


        function escapeCharacters_callback(wholeMatch, m1) {
            var charCodeToEscape = m1.charCodeAt(0);
            return "~E" + charCodeToEscape + "E";
        }

    }; // end of the Markdown.Converter constructor

})();


// ======= END WRAP

    // no reason for multiple instances,
    // just call `makeHtml`
    return new Markdown.Converter();
});
/** @license
 * RequireJS plugin for loading Markdown files and converting them into HTML.
 * Author: Miller Medeiros
 * Version: 0.1.1 (2012/02/17)
 * Released under the MIT license
 */

// NOTE :: if you don't need to load markdown files in production outside of
// the build, precompile them into modules and set
// `pragmasOnSave.excludeMdown=true`

define(
    'mdown',[
        'text',
        'markdownConverter'
    ],
    function (
        text, markdownConverter
    ) {

        var buildMap = {};

        //API
        return {

            load : function(name, req, onLoad, config) {
                text.get(req.toUrl(name), function(data){
                    data = markdownConverter.makeHtml(data);
                    if (config.isBuild) {
                        buildMap[name] = data;
                        onLoad(data);
                    } else {
                        onLoad(data);
                    }
                });
            },

            //write method based on RequireJS official text plugin by James Burke
            //https://github.com/jrburke/requirejs/blob/master/text.js
            write : function(pluginName, moduleName, write){
                if(moduleName in buildMap){
                    var content = text.jsEscape(buildMap[moduleName]);
                    write.asModule(pluginName + "!" + moduleName,
                                   "define(function () { return '" +
                                       content +
                                   "';});\n");
                }
            }

        };
});

/** @license
 * RequireJS plugin for loading files without adding the JS extension, useful for
 * JSONP services and any other kind of resource that already contain a file
 * extension or that shouldn't have one (like dynamic scripts).
 * Author: Miller Medeiros
 * Version: 0.3.1 (2011/12/07)
 * Released under the MIT license
 */
define('noext',[],function(){

    var QUERY_PARAM = 'noext';

    //API
    return {
        load : function(name, req, onLoad, config){
            req([req.toUrl(name)], function(mod){
                onLoad(mod);
            });
        },
        normalize : function(name, norm){
            //append query string to avoid adding .js extension
            //needs to be on normalize otherwise it won't work after build
            name += (name.indexOf('?') < 0)? '?' : '&';
            return name + QUERY_PARAM +'=1';
        }

    };
});

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

  }).apply(root, arguments);
});
}(this));

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('bootstrapAmdFix',["jquery", 'loglevel', "bootstrap"], factory) : 
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require('loglevel'), require("bootstrap")) :
    console && console.error('ScoreBootstrapUiAmdFix does not support non-amd script loading.');
}(this/* window */, function ($, log) {

    function ScoreBootstrapUiAmdFix() {

    }

    ScoreBootstrapUiAmdFix.prototype.fix = function () {
        // if we use AMD, most likly we already miss $(window).on('load', foo) event which bootstrap uses to fire up init methods for it's own components. So we should run them manually. 
        if (document.readyState !== "complete") {
            if (window.define === void 0 || typeof (window.define) !== "function") {
                log.debug("Score Bootstrap UI AMD fix was loaded not in AMD solution. In all probability you can remove this reference because it is not needed.");
            }
            // don't do anything, looks like bootstrap was loaded before window.load event - it means that Bootstrap will do everything correct and manage to init js-components by itself.
            return;
        }

        // check version (assume we are working with bootstrap 3 version only
        if (!($.fn["alert"]
            && $.fn["alert"].Constructor
            && +/[\d]+/.exec($.fn["alert"].Constructor.VERSION) === 3)) {
            return;
        }

        // affix
        $('[data-spy="affix"]').each(function() {
            var $this = $(this);
            var data = $this.data();

            data.offset = data.offset || {};

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

            $this.affix(data);
        });

        // carousel
        $('[data-ride="carousel"]').each(function() {
            var $this = $(this);
            var data = $this.data();

            $this.carousel(data);
        });

        // scrollspy
        $('[data-spy="scroll"]').each(function() {
            var $this = $(this);
            var data = $this.data();

            $this.scrollspy(data);
        });
    }

    return new ScoreBootstrapUiAmdFix();

}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('scorebootstrap',["jquery", "bootstrap", "bootstrapAmdFix", "jqueryTouchSwipe"], factory) : 
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("bootstrap"), require("bootstrapAmdFix"), require("jqueryTouchSwipe")) :
    console && console.error('BootstrapUI does not support non-amd script loading.');
}(this/* window */, function ($, bt, btAmdFix) {
    window.BrainJocks = window.BrainJocks || {};

    if (BrainJocks.EE && BrainJocks.EE.Metadata && BrainJocks.EE.Metadata.sitecore &&
        BrainJocks.EE.Metadata.sitecore().version === "8.0") {
        // Fix incompatibilities between Bootstrap and the version of prototype.js that
        // sitecore includes in version 8.0. This is needed for modal and tabs components.
        function handler(event) {
            event.target.hide = undefined;
            setTimeout(function () { delete event.target.hide; }, 0);
            event.target.show = undefined;
            setTimeout(function () { delete event.target.show; }, 0);
        }

        $(window).on("show.bs.modal hide.bs.modal show.bs.tab hide.bs.tab show.bs.dropdown hide.bs.dropdown", handler);
    }

    BrainJocks.BootstrapUI = {
        Settings: {
            causeRepaintsOn: function () {
                return $("h1, h2, h3, h4, h5, h6, p, li");
            },
            hiddenClassList: function() {
                return ["hidden-xs", "hidden-sm", "hidden-md", "hidden-lg"];
            }
        },

        Fonts: {
            scale: function () {
                $(window).on("resize", function () {
                    BrainJocks.BootstrapUI.Settings.causeRepaintsOn().css("z-index", 1);
                });
            }
        },

        Carousel: {
            init: function() {
                $('.score-carousel .item:first-of-type').addClass("active");

                $('.score-carousel').swipe({
                    swipeLeft: function () {
                        $(this).carousel('next');
                    },
                    swipeRight: function () {
                        $(this).carousel('prev');
                    }
                });
            }                
        },

        TabSet: {
            init: function() {
                $('.score-tab').each(function () {
                    var tabComponent = $(this);

                    var tabsNav = tabComponent.find('.nav').first();
                    var tabsContent = tabComponent.find('.tab-content').first();

                    tabsNav.empty();

                    tabsContent.children('.tab-pane').each(function () {
                        var tabPane = $(this);

                        var tabId = tabPane.prop('id');
                        var tabTitle = tabPane.data('title');
                        var anchorable = /^(true|1|yes)$/i.test(tabPane.data('anchorable') || "");

                        var li = '<li class="' + BrainJocks.BootstrapUI.TabSet.getHiddenClasses(this) + '"><a href="#' + tabId + '" data-toggle="tab" data-anchorable="' + anchorable + '">' + tabTitle + '</a></li>';

                        tabsNav.append(li);
                    });
                });
            },

            activate: function () {
                $('.score-tab').each(function() {
                    var tabToActivate = $(this).find('.nav li a')[0]; // first

                    if (BrainJocks.BootstrapUI.Utils.isDeepLinked()) {
                        var anchor = BrainJocks.BootstrapUI.Utils.getAnchor();

                        tabToActivate = $(this).find("a[href='#tab-" + anchor + "']")[0] || tabToActivate;
                    }

                    $(tabToActivate).tab('show');
                });
            },

            getHiddenClasses: function(tabPane) {
                var classList = tabPane.className;
                return BrainJocks.BootstrapUI.Settings.hiddenClassList().filter(function (value) {
                    return new RegExp('(^| )' + value + '( |$)').test(classList);
                }).join(" ");
            }
        },

        Accordion: {
            init: function() {
                $('.score-accordion a[data-toggle="collapse"]').each(function () {
                    var accordion = $(this).closest(".score-accordion")[0];
                    $(this).attr('data-parent', '#' + accordion.id);
                });
            },

            activate: function() {
                $('.score-accordion').each(function () {
                    var shouldBeCollapsed = $(this).hasClass("collapsed");

                    var $firstPanel = $(".panel", this).first();
                    if (BrainJocks.BootstrapUI.Utils.isDeepLinked()) {
                        var anchor = BrainJocks.BootstrapUI.Utils.getAnchor();

                        $firstPanel = $(this).find(".panel:has(a[href='#collapse-" + anchor + "'])")[0] || $firstPanel;
                        shouldBeCollapsed = false;
                    }

                    if (!shouldBeCollapsed) {
                        $('.panel-collapse', $firstPanel).addClass("in");
                        $('a[data-toggle="collapse"]', $firstPanel).removeClass("collapsed").attr("aria-expanded", true);
                    }
                });
            }
        },

        MegaMenu: {
            init: function() {
                $(".score-megamenu").find(".btn").addClass("navbar-btn");    
            }
        },

        Utils: {
            isDeepLinked: function() {
                return document.location.toString().match("#");
            },

            getAnchor: function() {
                if (!this.isDeepLinked()) {
                    return "";
                }

                return document.location.toString().split('#')[1];
            }
        },

        Breadcrumb: {
            init: function () {
                $('.score-breadcrumb > .score-breadcrumb-item:first-child .score-folding')
                    .on('click.score',
                        function(e) {
                            e.preventDefault();
                            var $this = $(this);
                            $this.closest('.score-breadcrumb').toggleClass('alt-visible');

                            var cssDuration = $this.closest('.score-breadcrumb')
                                .find(' > .score-breadcrumb-item:first-child .score-breadcrumb-alternate')
                                .css('transition-duration') || "0s";
                            var stepDuration = (parseFloat(cssDuration) * (/ms/.test(cssDuration) ? 1 : 1000)).toFixed(0);
                            var stepCounts = stepDuration / 100;
                            var stepNumber = 0;
                            var timer = setInterval(function () {
                                /* hack to force sitecore to recalculate active component borders. */
                                $this.closest('.score-breadcrumb').trigger('click');
                                stepNumber++;
                                if (stepNumber > stepCounts) clearInterval(timer);
                            }, 100);
                        });
            }
        },

        init: function () {
            btAmdFix !== void 0 && typeof btAmdFix.fix === "function" && btAmdFix.fix();

            BrainJocks.BootstrapUI.Fonts.scale();
            BrainJocks.BootstrapUI.Carousel.init();
            BrainJocks.BootstrapUI.TabSet.init();
            BrainJocks.BootstrapUI.TabSet.activate();
            BrainJocks.BootstrapUI.Accordion.init();
            BrainJocks.BootstrapUI.Accordion.activate();
            BrainJocks.BootstrapUI.MegaMenu.init();
            BrainJocks.BootstrapUI.Breadcrumb.init();
        }
    };

    return BrainJocks.BootstrapUI;
}));
define('errorHandler',["jquery", 'loglevel'], function($, log) {
    "use strict";

    var logErrorUrl = "/scorebootstrapui/logerror";

    function ErrorHandler() {
        this.logError = function logError(err) {
            if (!err) {
                return;
            }

            err = String(err);
            $.post(logErrorUrl, { message: err }).fail(function () {
                log.error("Failed to log error on server: " + err);
            });
        };
    }

    return new ErrorHandler(); //singleton
});
(function(root) {
define("jqueryValidate", ["jquery"], function() {
  return (function() {
/*! jQuery Validation Plugin - v1.12.0 - 4/1/2014
 * http://jqueryvalidation.org/
 * Copyright (c) 2014 J??rn Zaefferer; Licensed MIT */
!function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",b).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=d.attr("type");return"radio"===e||"checkbox"===e?a("input[name='"+d.attr("name")+"']:checked").val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c[0].toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d=this.errorsFor(b);d.length?(d.removeClass(this.settings.validClass).addClass(this.settings.errorClass),d.html(c)):(d=a("<"+this.settings.errorElement+">").attr("for",this.idOrName(b)).addClass(this.settings.errorClass).html(c||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b))),!c&&this.settings.success&&(d.text(""),"string"==typeof this.settings.success?d.addClass(this.settings.success):this.settings.success(d,b)),this.toShow=this.toShow.add(d)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")===c})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c[0].toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([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]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."}}(jQuery),function(a){var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)})}(jQuery),function(a){a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})}(jQuery);


  }).apply(root, arguments);
});
}(this));

// Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (C) Microsoft Corporation. All rights reserved.
// @version v3.2.10
!function(a){"function"==typeof define&&define.amd?define("jqueryValidateUnobtrusive",["jquery", "jqueryValidate"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery-validation")):jQuery.validator.unobtrusive=a(jQuery)}(function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("<li />").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function u(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=f.unobtrusive.options||{},u=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),u("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),u("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),u("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var m,f=a.validator,v="unobtrusiveValidation";return f.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=u(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){f.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=u(this);a&&a.attachValidation()})}},m=f.unobtrusive.adapters,m.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},m.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},m.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},m.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},f.addMethod("__dummy__",function(a,e,n){return!0}),f.addMethod("regex",function(a,e,n){var t;return!!this.optional(e)||(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),f.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),f.methods.extension?(m.addSingleVal("accept","mimtype"),m.addSingleVal("extension","extension")):m.addSingleVal("extension","extension","accept"),m.addSingleVal("regex","pattern"),m.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),m.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),m.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),m.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),m.add("required",function(a){"INPUT"===a.element.tagName.toUpperCase()&&"CHECKBOX"===a.element.type.toUpperCase()||e(a,"required",!0)}),m.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),m.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),m.add("fileextensions",["extensions"],function(a){e(a,"extension",a.params.extensions)}),a(function(){f.unobtrusive.parse(document)}),f.unobtrusive});
(function(root) {
define("jqueryUnobtrusiveAjax", ["jquery","jqueryValidate","jqueryValidateUnobtrusive"], function() {
  return (function() {
/*
** Unobtrusive Ajax support library for jQuery
** Copyright (C) Microsoft Corporation. All rights reserved.
*/
(function(a){var b="unobtrusiveAjaxClick",g="unobtrusiveValidation";function c(d,b){var a=window,c=(d||"").split(".");while(a&&c.length)a=a[c.shift()];if(typeof a==="function")return a;b.push(d);return Function.constructor.apply(null,b)}function d(a){return a==="GET"||a==="POST"}function f(b,a){!d(a)&&b.setRequestHeader("X-HTTP-Method-Override",a)}function h(c,b,e){var d;if(e.indexOf("application/x-javascript")!==-1)return;d=(c.getAttribute("data-ajax-mode")||"").toUpperCase();a(c.getAttribute("data-ajax-update")).each(function(f,c){var e;switch(d){case"BEFORE":e=c.firstChild;a("<div />").html(b).contents().each(function(){c.insertBefore(this,e)});break;case"AFTER":a("<div />").html(b).contents().each(function(){c.appendChild(this)});break;default:a(c).html(b)}})}function e(b,e){var j,k,g,i;j=b.getAttribute("data-ajax-confirm");if(j&&!window.confirm(j))return;k=a(b.getAttribute("data-ajax-loading"));i=b.getAttribute("data-ajax-loading-duration")||0;a.extend(e,{type:b.getAttribute("data-ajax-method")||undefined,url:b.getAttribute("data-ajax-url")||undefined,beforeSend:function(d){var a;f(d,g);a=c(b.getAttribute("data-ajax-begin"),["xhr"]).apply(this,arguments);a!==false&&k.show(i);return a},complete:function(){k.hide(i);c(b.getAttribute("data-ajax-complete"),["xhr","status"]).apply(this,arguments)},success:function(a,e,d){h(b,a,d.getResponseHeader("Content-Type")||"text/html");c(b.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(this,arguments)},error:c(b.getAttribute("data-ajax-failure"),["xhr","status","error"])});e.data.push({name:"X-Requested-With",value:"XMLHttpRequest"});g=e.type.toUpperCase();if(!d(g)){e.type="POST";e.data.push({name:"X-HTTP-Method-Override",value:g})}a.ajax(e)}function i(c){var b=a(c).data(g);return!b||!b.validate||b.validate()}a(document).on("click","a[data-ajax=true]",function(a){a.preventDefault();e(this,{url:this.href,type:"GET",data:[]})});a(document).on("click","form[data-ajax=true] input[type=image]",function(c){var g=c.target.name,d=a(c.target),f=d.parents("form")[0],e=d.offset();a(f).data(b,[{name:g+".x",value:Math.round(c.pageX-e.left)},{name:g+".y",value:Math.round(c.pageY-e.top)}]);setTimeout(function(){a(f).removeData(b)},0)});a(document).on("click","form[data-ajax=true] :submit",function(c){var e=c.target.name,d=a(c.target).parents("form")[0];a(d).data(b,e?[{name:e,value:c.target.value}]:[]);setTimeout(function(){a(d).removeData(b)},0)});a(document).on("submit","form[data-ajax=true]",function(d){var c=a(this).data(b)||[];d.preventDefault();if(!i(this))return;e(this,{url:this.action,type:this.method||"GET",data:c.concat(a(this).serializeArray())})})})(jQuery);


  }).apply(root, arguments);
});
}(this));

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('scoreunobtrusive',["jquery"], factory) : 
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery")) : 
    console && console.error('Score.jquery.validate.unobtrusive does not support non-amd script loading.');
}(this/* window */, function ($) {
    var findByName = function(currentForm, name) {
        return currentForm.find("[name='" + name + "']");
    };

    var findCurrentForm = function(element) {
        return $(element).closest('form');
    };

    var isAnyValueNotEmpty = function(element, params) {
        var $myForm = findCurrentForm(element);

        var properties = params.properties.split(',');
        var values = $.map(properties, function(property, index) {
            var val = findByName($myForm, property).val();
            return val !== '' ? val : null;
        });

        return values.length > 0;
    };

    $.validator.addMethod("enforcetrue", function(value, element, param) {
        return element.checked;
    });

    $.validator.unobtrusive.adapters.addBool("enforcetrue");

    $.validator.unobtrusive.adapters.add(
        'atleastonerequired', ['properties'], function(options) {
            options.rules['atleastonerequired'] = options.params;
            options.messages['atleastonerequired'] = options.message;
        }
    );

    $.validator.addMethod('atleastonerequired', function(value, element, params) {
        return isAnyValueNotEmpty(element, params);
    }, '');


    $.validator.unobtrusive.adapters.add(
        'requiredor', ['properties'], function(options) {
            options.rules['requiredor'] = options.params;
            options.messages['requiredor'] = options.message;
        }
    );

    $.validator.addMethod('requiredor', function(value, element, params) {
        if (value !== '' && value) {
            return true;
        }

        return isAnyValueNotEmpty(element, params);
    }, '');

}));
/**
* jquery-match-height 0.7.2 by @liabru
* http://brm.io/jquery-match-height/
* License: MIT
*/
/* Includes modifications for SCORE, to disable animation effects while arranging list elements into a row (animation effects lead to wrong height calculation) */
!function(t){"use strict";"function"==typeof define&&define.amd?define('matchHeight',["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=-1,n=-1,o=function(t){return parseFloat(t)||0},i=function(e){var n=null,i=[];return t(e).each(function(){var e=t(this),a=e.offset().top-o(e.css("margin-top")),r=i.length>0?i[i.length-1]:null;null===r?i.push(e):Math.floor(Math.abs(n-a))<=1?i[i.length-1]=r.add(e):i.push(e),n=a}),i},a=function(e){var n={byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(n,e):("boolean"==typeof e?n.byRow=e:"remove"===e&&(n.remove=!0),n)},r=t.fn.matchHeight=function(e){var n=a(e);if(n.remove){var o=this;return this.css(n.property,""),t.each(r._groups,function(t,e){e.elements=e.elements.not(o)}),this}return this.length<=1&&!n.target?this:(r._groups.push({elements:this,options:n}),r._apply(this,n),this)};r.version="0.7.2",r._groups=[],r._throttle=80,r._maintainScroll=!1,r._beforeUpdate=null,r._afterUpdate=null,r._rows=i,r._parse=o,r._parseOptions=a,r._apply=function(e,n){var s=a(n),h=t(e),l=[h],c=t(window).scrollTop(),p=t("html").outerHeight(!0),u=h.parents().filter(":hidden");return u.each(function(){var e=t(this);e.data("style-cache",e.attr("style"))}),u.css("display","block"),s.byRow&&!s.target&&(h.each(function(){var e=t(this),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block"),e.data("style-cache",e.attr("style")),e.css({display:n,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden","-webkit-transition":"none","-moz-transition":"none","-o-transition":"none",transition:"none"})}),l=i(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,n){var i=t(n),a=0;if(s.target)a=s.target.outerHeight(!1);else{if(s.byRow&&i.length<=1)return void i.css(s.property,"");i.each(function(){var e=t(this),n=e.attr("style"),o=e.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block");var i={display:o,"-webkit-transition":"none","-moz-transition":"none","-o-transition":"none",transition:"none"};i[s.property]="",e.css(i),e.outerHeight(!1)>a&&(a=e.outerHeight(!1)),e.attr("style",n||"")})}i.each(function(){var e=t(this),n=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(n+=o(e.css("border-top-width"))+o(e.css("border-bottom-width")),n+=o(e.css("padding-top"))+o(e.css("padding-bottom"))),e.css(s.property,a-n+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)),this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var n=t(this),o=n.attr("data-mh")||n.attr("data-match-height");e[o]=o in e?e[o].add(n):n}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(o,i){if(i&&"resize"===i.type){var a=t(window).width();if(a===e)return;e=a}o?-1===n&&(n=setTimeout(function(){s(i),n=-1},r._throttle)):s(i)},t(r._applyDataApi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})});
/*!
 * Knockout JavaScript library v3.5.1
 * (c) The Knockout.js team - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */

(function() {(function(n){var A=this||(0,eval)("this"),w=A.document,R=A.navigator,v=A.jQuery,H=A.JSON;v||"undefined"===typeof jQuery||(v=jQuery);(function(n){"function"===typeof define&&define.amd?define('knockout',["exports","require"],n):"object"===typeof exports&&"object"===typeof module?n(module.exports||exports):n(A.ko={})})(function(S,T){function K(a,c){return null===a||typeof a in W?a===c:!1}function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function Y(b,c){var d;return function(){clearTimeout(d);
d=a.a.setTimeout(b,c)}}function Z(a,c){c&&"change"!==c?"beforeChange"===c?this.pc(a):this.gb(a,c):this.qc(a)}function aa(a,c){null!==c&&c.s&&c.s()}function ba(a,c){var d=this.qd,e=d[r];e.ra||(this.Qb&&this.mb[c]?(d.uc(c,a,this.mb[c]),this.mb[c]=null,--this.Qb):e.I[c]||d.uc(c,a,e.J?{da:a}:d.$c(a)),a.Ja&&a.gd())}var a="undefined"!==typeof S?S:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.L=function(a,c,d){a[c]=d};a.version="3.5.1";a.b("version",
a.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){for(var c in a)f.call(a,c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}function e(b,c,d,e){var l=b[c].match(q)||[];a.a.D(d.match(q),function(b){a.a.Na(l,b,e)});b[c]=l.join(" ")}var f=Object.prototype.hasOwnProperty,g={__proto__:[]}instanceof Array,h="function"===typeof Symbol,m={},k={};m[R&&/Firefox\/2/i.test(R.userAgent)?
"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];m.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(m,function(a,b){if(b.length)for(var c=0,d=b.length;c<d;c++)k[b[c]]=a});var l={propertychange:!0},p=w&&function(){for(var a=3,b=w.createElement("div"),c=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+ ++a+"]><i></i><![endif]--\x3e",c[0];);return 4<a?a:n}(),q=/\S+/g,t;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],
D:function(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c,a[d],d,a)},A:"function"==typeof Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},Lb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a))return a[d];return n},Pa:function(b,c){var d=a.a.A(b,c);0<d?b.splice(d,1):0===d&&b.shift()},wc:function(b){var c=[];b&&a.a.D(b,function(b){0>a.a.A(c,b)&&c.push(b)});return c},Mb:function(a,
b,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)d.push(b.call(c,a[e],e));return d},jb:function(a,b,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)b.call(c,a[e],e)&&d.push(a[e]);return d},Nb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},Na:function(b,c,d){var e=a.a.A(a.a.bc(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},Ba:g,extend:c,setPrototypeOf:d,Ab:g?d:c,P:b,Ga:function(a,b,c){if(!a)return a;var d={},e;for(e in a)f.call(a,e)&&(d[e]=
b.call(c,a[e],e,a));return d},Tb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Yb:function(b){b=a.a.la(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement("div"),d=0,e=b.length;d<e;d++)c.appendChild(a.oa(b[d]));return c},Ca:function(b,c){for(var d=0,e=b.length,l=[];d<e;d++){var k=b[d].cloneNode(!0);l.push(c?a.oa(k):k)}return l},va:function(b,c){a.a.Tb(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Xc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0],
l=e.parentNode,k=0,f=c.length;k<f;k++)l.insertBefore(c[k],e);k=0;for(f=d.length;k<f;k++)a.removeNode(d[k])}},Ua:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},Zc:function(a,b){7>p?a.setAttribute("selected",b):a.selected=b},Db:function(a){return null===a||a===n?"":a.trim?
a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},vd:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(1!==a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Sb:function(b){return a.a.vd(b,b.ownerDocument.documentElement)},kd:function(b){return!!a.a.Lb(b,a.a.Sb)},R:function(a){return a&&
a.tagName&&a.tagName.toLowerCase()},Ac:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.Ac(b),c)},Gc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},B:function(b,c,d){var e=a.a.Ac(d);d=l[c];if(a.options.useOnlyNativeEvents||d||!v)if(d||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var k=function(a){e.call(b,a)},f="on"+c;b.attachEvent(f,
k);a.a.K.za(b,function(){b.detachEvent(f,k)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(c,e,!1);else t||(t="function"==typeof v(b).on?"on":"bind"),v(b)[t](c,e)},Fb:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var d;"input"===a.a.R(b)&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==d||"radio"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if("function"==typeof w.createEvent)if("function"==
typeof b.dispatchEvent)d=w.createEvent(k[c]||"HTMLEvents"),d.initEvent(c,!0,!0,A,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error("The supplied element doesn't support dispatchEvent");else if(d&&b.click)b.click();else if("undefined"!=typeof b.fireEvent)b.fireEvent("on"+c);else throw Error("Browser doesn't support triggering events");else v(b).trigger(c)},f:function(b){return a.O(b)?b():b},bc:function(b){return a.O(b)?b.v():b},Eb:function(b,c,d){var l;c&&("object"===typeof b.classList?
(l=b.classList[d?"add":"remove"],a.a.D(c.match(q),function(a){l.call(b.classList,a)})):"string"===typeof b.className.baseVal?e(b.className,"baseVal",c,d):e(b,"className",c,d))},Bb:function(b,c){var d=a.a.f(c);if(null===d||d===n)d="";var e=a.h.firstChild(b);!e||3!=e.nodeType||a.h.nextSibling(e)?a.h.va(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.Ad(b)},Yc:function(a,b){a.name=b;if(7>=p)try{var c=a.name.replace(/[&<>'"]/g,function(a){return"&#"+a.charCodeAt(0)+";"});a.mergeAttributes(w.createElement("<input name='"+
c+"'/>"),!1)}catch(d){}},Ad:function(a){9<=p&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},wd:function(a){if(p){var b=a.style.width;a.style.width=0;a.style.width=b}},Pd:function(b,c){b=a.a.f(b);c=a.a.f(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},la:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},Da:function(a){return h?Symbol(a):a},Zd:6===p,$d:7===p,W:p,Lc:function(b,c){for(var d=a.a.la(b.getElementsByTagName("input")).concat(a.a.la(b.getElementsByTagName("textarea"))),
e="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},l=[],k=d.length-1;0<=k;k--)e(d[k])&&l.push(d[k]);return l},Nd:function(b){return"string"==typeof b&&(b=a.a.Db(b))?H&&H.parse?H.parse(b):(new Function("return "+b))():null},hc:function(b,c,d){if(!H||!H.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
return H.stringify(a.a.f(b),c,d)},Od:function(c,d,e){e=e||{};var l=e.params||{},k=e.includeFields||this.Jc,f=c;if("object"==typeof c&&"form"===a.a.R(c))for(var f=c.action,h=k.length-1;0<=h;h--)for(var g=a.a.Lc(c,k[h]),m=g.length-1;0<=m;m--)l[g[m].name]=g[m].value;d=a.a.f(d);var p=w.createElement("form");p.style.display="none";p.action=f;p.method="post";for(var q in d)c=w.createElement("input"),c.type="hidden",c.name=q,c.value=a.a.hc(a.a.f(d[q])),p.appendChild(c);b(l,function(a,b){var c=w.createElement("input");
c.type="hidden";c.name=a;c.value=b;p.appendChild(c)});w.body.appendChild(p);e.submitter?e.submitter(p):p.submit();setTimeout(function(){p.parentNode.removeChild(p)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.D);a.b("utils.arrayFirst",a.a.Lb);a.b("utils.arrayFilter",a.a.jb);a.b("utils.arrayGetDistinctValues",a.a.wc);a.b("utils.arrayIndexOf",a.a.A);a.b("utils.arrayMap",a.a.Mb);a.b("utils.arrayPushAll",a.a.Nb);a.b("utils.arrayRemoveItem",a.a.Pa);a.b("utils.cloneNodes",a.a.Ca);a.b("utils.createSymbolOrString",
a.a.Da);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",a.a.Jc);a.b("utils.getFormFields",a.a.Lc);a.b("utils.objectMap",a.a.Ga);a.b("utils.peekObservable",a.a.bc);a.b("utils.postJson",a.a.Od);a.b("utils.parseJson",a.a.Nd);a.b("utils.registerEventHandler",a.a.B);a.b("utils.stringifyJson",a.a.hc);a.b("utils.range",a.a.Pd);a.b("utils.toggleDomNodeCssClass",a.a.Eb);a.b("utils.triggerEvent",a.a.Fb);a.b("utils.unwrapObservable",a.a.f);a.b("utils.objectForEach",a.a.P);a.b("utils.addOrRemoveItem",
a.a.Na);a.b("utils.setTextContent",a.a.Bb);a.b("unwrap",a.a.f);Function.prototype.bind||(Function.prototype.bind=function(a){var c=this;if(1===arguments.length)return function(){return c.apply(a,arguments)};var d=Array.prototype.slice.call(arguments,1);return function(){var e=d.slice(0);e.push.apply(e,arguments);return c.apply(a,e)}});a.a.g=new function(){var b=0,c="__ko__"+(new Date).getTime(),d={},e,f;a.a.W?(e=function(a,e){var f=a[c];if(!f||"null"===f||!d[f]){if(!e)return n;f=a[c]="ko"+b++;d[f]=
{}}return d[f]},f=function(a){var b=a[c];return b?(delete d[b],a[c]=null,!0):!1}):(e=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d},f=function(a){return a[c]?(delete a[c],!0):!1});return{get:function(a,b){var c=e(a,!1);return c&&c[b]},set:function(a,b,c){(a=e(a,c!==n))&&(a[b]=c)},Ub:function(a,b,c){a=e(a,!0);return a[b]||(a[b]=c)},clear:f,Z:function(){return b++ +c}}};a.b("utils.domData",a.a.g);a.b("utils.domData.clear",a.a.g.clear);a.a.K=new function(){function b(b,c){var d=a.a.g.get(b,e);
d===n&&c&&(d=[],a.a.g.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);a.a.g.clear(c);a.a.K.cleanExternalData(c);g[c.nodeType]&&d(c.childNodes,!0)}function d(b,d){for(var e=[],l,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=l=b[f]),b[f]!==l)for(;f--&&-1==a.a.A(e,b[f]););}var e=a.a.g.Z(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{za:function(a,c){if("function"!=typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},yb:function(c,
d){var f=b(c,!1);f&&(a.a.Pa(f,d),0==f.length&&a.a.g.set(c,e,n))},oa:function(b){a.u.G(function(){f[b.nodeType]&&(c(b),g[b.nodeType]&&d(b.getElementsByTagName("*")))});return b},removeNode:function(b){a.oa(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){v&&"function"==typeof v.cleanData&&v.cleanData([a])}}};a.oa=a.a.K.oa;a.removeNode=a.a.K.removeNode;a.b("cleanNode",a.oa);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.K);a.b("utils.domNodeDisposal.addDisposeCallback",
a.a.K.za);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.K.yb);(function(){var b=[0,"",""],c=[1,"<table>","</table>"],d=[3,"<table><tbody><tr>","</tr></tbody></table>"],e=[1,"<select multiple='multiple'>","</select>"],f={thead:c,tbody:c,tfoot:c,tr:[2,"<table><tbody>","</tbody></table>"],td:d,th:d,option:e,optgroup:e},g=8>=a.a.W;a.a.ua=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var l=e[0];l.parentNode&&11!==l.parentNode.nodeType;)l=l.parentNode;
l.parentNode&&l.parentNode.removeChild(l)}}else{(e=d)||(e=w);var l=e.parentWindow||e.defaultView||A,p=a.a.Db(c).toLowerCase(),q=e.createElement("div"),t;t=(p=p.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&f[p[1]]||b;p=t[0];t="ignored<div>"+t[1]+c+t[2]+"</div>";"function"==typeof l.innerShiv?q.appendChild(l.innerShiv(t)):(g&&e.body.appendChild(q),q.innerHTML=t,g&&q.parentNode.removeChild(q));for(;p--;)q=q.lastChild;e=a.a.la(q.lastChild.childNodes)}return e};a.a.Md=function(b,c){var d=a.a.ua(b,
c);return d.length&&d[0].parentElement||a.a.Yb(d)};a.a.fc=function(b,c){a.a.Tb(b);c=a.a.f(c);if(null!==c&&c!==n)if("string"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ua(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b("utils.parseHtmlFragment",a.a.ua);a.b("utils.setHtml",a.a.fc);a.aa=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.aa.Uc(c.nodeValue);null!=f&&e.push({ud:c,Kd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<h;f++)b(g[f],
e)}var c={};return{Xb:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},bd:function(a,b){var f=c[a];if(f===n)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},cd:function(c,e){var f=
[];b(c,f);for(var g=0,h=f.length;g<h;g++){var m=f[g].ud,k=[m];e&&a.a.Nb(k,e);a.aa.bd(f[g].Kd,k);m.nodeValue="";m.parentNode&&m.parentNode.removeChild(m)}},Uc:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.aa);a.b("memoization.memoize",a.aa.Xb);a.b("memoization.unmemoize",a.aa.bd);a.b("memoization.parseMemoText",a.aa.Uc);a.b("memoization.unmemoizeDomNodeAndDescendants",a.aa.cd);a.na=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=
++c){h=f;a.a.Gc(Error("'Too much recursion' after processing "+c+" task groups."));break}b=f}try{d()}catch(p){a.a.Gc(p)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;A.MutationObserver?d=function(a){var b=w.createElement("div");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle("foo")}}(c):d=w&&"onreadystatechange"in w.createElement("script")?function(a){var b=w.createElement("script");b.onreadystatechange=function(){b.onreadystatechange=null;w.documentElement.removeChild(b);
b=null;a()};w.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,zb:function(b){f||a.na.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},Sd:b}}();a.b("tasks",a.na);a.b("tasks.schedule",a.na.zb);a.b("tasks.runEarly",a.na.Sd);a.Ta={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.$({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)},
c)}})},rateLimit:function(a,c){var d,e,f;"number"==typeof c?d=c:(d=c.timeout,e=c.method);a.Hb=!1;f="function"==typeof e?e:"notifyWhenChangesStop"==e?Y:X;a.ub(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(c){var e,f=!1;return function(){if(!f){a.na.cancel(e);e=a.na.zb(c);try{f=!0,b.notifySubscribers(n,"dirty")}finally{f=
!1}}}}))},notify:function(a,c){a.equalityComparer="always"==c?null:K}};var W={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.Ta);a.ic=function(b,c,d){this.da=b;this.lc=c;this.mc=d;this.Ib=!1;this.fb=this.Jb=null;a.L(this,"dispose",this.s);a.L(this,"disposeWhenNodeIsRemoved",this.l)};a.ic.prototype.s=function(){this.Ib||(this.fb&&a.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)};a.ic.prototype.l=function(b){this.Jb=b;a.a.K.za(b,this.fb=this.s.bind(this))};
a.T=function(){a.a.Ab(this,D);D.qb(this)};var D={qb:function(a){a.U={change:[]};a.sc=1},subscribe:function(b,c,d){var e=this;d=d||"change";var f=new a.ic(e,c?b.bind(c):b,function(){a.a.Pa(e.U[d],f);e.hb&&e.hb(d)});e.Qa&&e.Qa(d);e.U[d]||(e.U[d]=[]);e.U[d].push(f);return f},notifySubscribers:function(b,c){c=c||"change";"change"===c&&this.Gb();if(this.Wa(c)){var d="change"===c&&this.ed||this.U[c].slice(0);try{a.u.xc();for(var e=0,f;f=d[e];++e)f.Ib||f.lc(b)}finally{a.u.end()}}},ob:function(){return this.sc},
Dd:function(a){return this.ob()!==a},Gb:function(){++this.sc},ub:function(b){var c=this,d=a.O(c),e,f,g,h,m;c.gb||(c.gb=c.notifySubscribers,c.notifySubscribers=Z);var k=b(function(){c.Ja=!1;d&&h===c&&(h=c.nc?c.nc():c());var a=f||m&&c.sb(g,h);m=f=e=!1;a&&c.gb(g=h)});c.qc=function(a,b){b&&c.Ja||(m=!b);c.ed=c.U.change.slice(0);c.Ja=e=!0;h=a;k()};c.pc=function(a){e||(g=a,c.gb(a,"beforeChange"))};c.rc=function(){m=!0};c.gd=function(){c.sb(g,c.v(!0))&&(f=!0)}},Wa:function(a){return this.U[a]&&this.U[a].length},
Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var c=0;a.a.P(this.U,function(a,b){"dirty"!==a&&(c+=b.length)});return c},sb:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return"[object Object]"},extend:function(b){var c=this;b&&a.a.P(b,function(b,e){var f=a.Ta[b];"function"==typeof f&&(c=f(c,e)||c)});return c}};a.L(D,"init",D.qb);a.L(D,"subscribe",D.subscribe);a.L(D,"extend",D.extend);a.L(D,"getSubscriptionsCount",D.Bd);a.a.Ba&&a.a.setPrototypeOf(D,
Function.prototype);a.T.fn=D;a.Qc=function(a){return null!=a&&"function"==typeof a.subscribe&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.T);a.b("isSubscribable",a.Qc);a.S=a.u=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{xc:b,end:c,cc:function(b){if(e){if(!a.Qc(b))throw Error("Only subscribable things can act as dependencies");e.od.call(e.pd,b,b.fd||(b.fd=++f))}},G:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},qa:function(){if(e)return e.o.qa()},
Va:function(){if(e)return e.o.Va()},Ya:function(){if(e)return e.Ya},o:function(){if(e)return e.o}}}();a.b("computedContext",a.S);a.b("computedContext.getDependenciesCount",a.S.qa);a.b("computedContext.getDependencies",a.S.Va);a.b("computedContext.isInitial",a.S.Ya);a.b("computedContext.registerDependency",a.S.cc);a.b("ignoreDependencies",a.Yd=a.u.G);var I=a.a.Da("_latestValue");a.ta=function(b){function c(){if(0<arguments.length)return c.sb(c[I],arguments[0])&&(c.ya(),c[I]=arguments[0],c.xa()),this;
a.u.cc(c);return c[I]}c[I]=b;a.a.Ba||a.a.extend(c,a.T.fn);a.T.fn.qb(c);a.a.Ab(c,F);a.options.deferUpdates&&a.Ta.deferred(c,!0);return c};var F={equalityComparer:K,v:function(){return this[I]},xa:function(){this.notifySubscribers(this[I],"spectate");this.notifySubscribers(this[I])},ya:function(){this.notifySubscribers(this[I],"beforeChange")}};a.a.Ba&&a.a.setPrototypeOf(F,a.T.fn);var G=a.ta.Ma="__ko_proto__";F[G]=a.ta;a.O=function(b){if((b="function"==typeof b&&b[G])&&b!==F[G]&&b!==a.o.fn[G])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");
return!!b};a.Za=function(b){return"function"==typeof b&&(b[G]===F[G]||b[G]===a.o.fn[G]&&b.Nc)};a.b("observable",a.ta);a.b("isObservable",a.O);a.b("isWriteableObservable",a.Za);a.b("isWritableObservable",a.Za);a.b("observable.fn",F);a.L(F,"peek",F.v);a.L(F,"valueHasMutated",F.xa);a.L(F,"valueWillMutate",F.ya);a.Ha=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.ta(b);a.a.Ab(b,
a.Ha.fn);return b.extend({trackArrayChanges:!0})};a.Ha.fn={remove:function(b){for(var c=this.v(),d=[],e="function"!=typeof b||a.O(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.ya();if(c[f]!==g)throw Error("Array modified during remove; cannot remove item");d.push(g);c.splice(f,1);f--}}d.length&&this.xa();return d},removeAll:function(b){if(b===n){var c=this.v(),d=c.slice(0);this.ya();c.splice(0,c.length);this.xa();return d}return b?this.remove(function(c){return 0<=
a.a.A(b,c)}):[]},destroy:function(b){var c=this.v(),d="function"!=typeof b||a.O(b)?function(a){return a===b}:b;this.ya();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.xa()},destroyAll:function(b){return b===n?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.A(b,c)}):[]},indexOf:function(b){var c=this();return a.a.A(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.ya(),this.v()[d]=c,this.xa())},sorted:function(a){var c=this().slice(0);
return a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.Ba&&a.a.setPrototypeOf(a.Ha.fn,a.ta.fn);a.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){a.Ha.fn[b]=function(){var a=this.v();this.ya();this.zc(a,b,arguments);var d=a[b].apply(a,arguments);this.xa();return d===a?this:d}});a.a.D(["slice"],function(b){a.Ha.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Pc=function(b){return a.O(b)&&"function"==typeof b.remove&&"function"==
typeof b.push};a.b("observableArray",a.Ha);a.b("isObservableArray",a.Pc);a.Ta.trackArrayChanges=function(b,c){function d(){function c(){if(m){var d=[].concat(b.v()||[]),e;if(b.Wa("arrayChange")){if(!f||1<m)f=a.a.Pb(k,d,b.Ob);e=f}k=d;f=null;m=0;e&&e.length&&b.notifySubscribers(e,"arrayChange")}}e?c():(e=!0,h=b.subscribe(function(){++m},null,"spectate"),k=[].concat(b.v()||[]),f=null,g=b.subscribe(c))}b.Ob={};c&&"object"==typeof c&&a.a.extend(b.Ob,c);b.Ob.sparse=!0;if(!b.zc){var e=!1,f=null,g,h,m=0,
k,l=b.Qa,p=b.hb;b.Qa=function(a){l&&l.call(b,a);"arrayChange"===a&&d()};b.hb=function(a){p&&p.call(b,a);"arrayChange"!==a||b.Wa("arrayChange")||(g&&g.s(),h&&h.s(),h=g=null,e=!1,k=n)};b.zc=function(b,c,d){function l(a,b,c){return k[k.length]={status:a,value:b,index:c}}if(e&&!m){var k=[],p=b.length,g=d.length,h=0;switch(c){case "push":h=p;case "unshift":for(c=0;c<g;c++)l("added",d[c],h+c);break;case "pop":h=p-1;case "shift":p&&l("deleted",b[h],h);break;case "splice":c=Math.min(Math.max(0,0>d[0]?p+d[0]:
d[0]),p);for(var p=1===g?p:Math.min(c+(d[1]||0),p),g=c+g-2,h=Math.max(p,g),U=[],L=[],n=2;c<h;++c,++n)c<p&&L.push(l("deleted",b[c],c)),c<g&&U.push(l("added",d[n],c));a.a.Kc(L,U);break;default:return}f=k}}}};var r=a.a.Da("_state");a.o=a.$=function(b,c,d){function e(){if(0<arguments.length){if("function"===typeof f)f.apply(g.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}g.ra||
a.u.cc(e);(g.ka||g.J&&e.Xa())&&e.ha();return g.X}"object"===typeof b?d=b:(d=d||{},b&&(d.read=b));if("function"!=typeof d.read)throw Error("Pass a function that returns the value of the ko.computed");var f=d.write,g={X:n,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:d.read,nb:c||d.owner,l:d.disposeWhenNodeIsRemoved||d.l||null,Sa:d.disposeWhen||d.Sa,Rb:null,I:{},V:0,Ic:null};e[r]=g;e.Nc="function"===typeof f;a.a.Ba||a.a.extend(e,a.T.fn);a.T.fn.qb(e);a.a.Ab(e,C);d.pure?(g.wb=!0,g.J=!0,a.a.extend(e,da)):
d.deferEvaluation&&a.a.extend(e,ea);a.options.deferUpdates&&a.Ta.deferred(e,!0);g.l&&(g.jc=!0,g.l.nodeType||(g.l=null));g.J||d.deferEvaluation||e.ha();g.l&&e.ja()&&a.a.K.za(g.l,g.Rb=function(){e.s()});return e};var C={equalityComparer:K,qa:function(){return this[r].V},Va:function(){var b=[];a.a.P(this[r].I,function(a,d){b[d.Ka]=d.da});return b},Vb:function(b){if(!this[r].V)return!1;var c=this.Va();return-1!==a.a.A(c,b)?!0:!!a.a.Lb(c,function(a){return a.Vb&&a.Vb(b)})},uc:function(a,c,d){if(this[r].wb&&
c===this)throw Error("A 'pure' computed must not be called recursively");this[r].I[a]=d;d.Ka=this[r].V++;d.La=c.ob()},Xa:function(){var a,c,d=this[r].I;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Ia&&c.da.Ja||c.da.Dd(c.La)))return!0},Jd:function(){this.Ia&&!this[r].rb&&this.Ia(!1)},ja:function(){var a=this[r];return a.ka||0<a.V},Rd:function(){this.Ja?this[r].ka&&(this[r].sa=!0):this.Hc()},$c:function(a){if(a.Hb){var c=a.subscribe(this.Jd,this,"dirty"),d=a.subscribe(this.Rd,
this);return{da:a,s:function(){c.s();d.s()}}}return a.subscribe(this.Hc,this)},Hc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[r].Ic),this[r].Ic=a.a.setTimeout(function(){b.ha(!0)},c)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var c=this[r],d=c.Sa,e=!1;if(!c.rb&&!c.ra){if(c.l&&!a.a.Sb(c.l)||d&&d()){if(!c.jc){this.s();return}}else c.jc=!1;c.rb=!0;try{e=this.zd(b)}finally{c.rb=!1}return e}},zd:function(b){var c=this[r],d=!1,e=c.wb?n:!c.V,d={qd:this,mb:c.I,Qb:c.V};a.u.xc({pd:d,
od:ba,o:this,Ya:e});c.I={};c.V=0;var f=this.yd(c,d);c.V?d=this.sb(c.X,f):(this.s(),d=!0);d&&(c.J?this.Gb():this.notifySubscribers(c.X,"beforeChange"),c.X=f,this.notifySubscribers(c.X,"spectate"),!c.J&&b&&this.notifySubscribers(c.X),this.rc&&this.rc());e&&this.notifySubscribers(c.X,"awake");return d},yd:function(b,c){try{var d=b.Wc;return b.nb?d.call(b.nb):d()}finally{a.u.end(),c.Qb&&!b.J&&a.a.P(c.mb,aa),b.sa=b.ka=!1}},v:function(a){var c=this[r];(c.ka&&(a||!c.V)||c.J&&this.Xa())&&this.ha();return c.X},
ub:function(b){a.T.fn.ub.call(this,b);this.nc=function(){this[r].J||(this[r].sa?this.ha():this[r].ka=!1);return this[r].X};this.Ia=function(a){this.pc(this[r].X);this[r].ka=!0;a&&(this[r].sa=!0);this.qc(this,!a)}},s:function(){var b=this[r];!b.J&&b.I&&a.a.P(b.I,function(a,b){b.s&&b.s()});b.l&&b.Rb&&a.a.K.yb(b.l,b.Rb);b.I=n;b.V=0;b.ra=!0;b.sa=!1;b.ka=!1;b.J=!1;b.l=n;b.Sa=n;b.Wc=n;this.Nc||(b.nb=n)}},da={Qa:function(b){var c=this,d=c[r];if(!d.ra&&d.J&&"change"==b){d.J=!1;if(d.sa||c.Xa())d.I=null,d.V=
0,c.ha()&&c.Gb();else{var e=[];a.a.P(d.I,function(a,b){e[b.Ka]=a});a.a.D(e,function(a,b){var e=d.I[a],m=c.$c(e.da);m.Ka=b;m.La=e.La;d.I[a]=m});c.Xa()&&c.ha()&&c.Gb()}d.ra||c.notifySubscribers(d.X,"awake")}},hb:function(b){var c=this[r];c.ra||"change"!=b||this.Wa("change")||(a.a.P(c.I,function(a,b){b.s&&(c.I[a]={da:b.da,Ka:b.Ka,La:b.La},b.s())}),c.J=!0,this.notifySubscribers(n,"asleep"))},ob:function(){var b=this[r];b.J&&(b.sa||this.Xa())&&this.ha();return a.T.fn.ob.call(this)}},ea={Qa:function(a){"change"!=
a&&"beforeChange"!=a||this.v()}};a.a.Ba&&a.a.setPrototypeOf(C,a.T.fn);var N=a.ta.Ma;C[N]=a.o;a.Oc=function(a){return"function"==typeof a&&a[N]===C[N]};a.Fd=function(b){return a.Oc(b)&&b[r]&&b[r].wb};a.b("computed",a.o);a.b("dependentObservable",a.o);a.b("isComputed",a.Oc);a.b("isPureComputed",a.Fd);a.b("computed.fn",C);a.L(C,"peek",C.v);a.L(C,"dispose",C.s);a.L(C,"isActive",C.ja);a.L(C,"getDependenciesCount",C.qa);a.L(C,"getDependencies",C.Va);a.xb=function(b,c){if("function"===typeof b)return a.o(b,
c,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b("pureComputed",a.xb);(function(){function b(a,f,g){g=g||new d;a=f(a);if("object"!=typeof a||null===a||a===n||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var h=a instanceof Array?[]:{};g.save(a,h);c(a,function(c){var d=f(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":h[c]=d;break;case "object":case "undefined":var l=g.get(d);h[c]=l!==
n?l:b(d,f,g)}});return h}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"function"==typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function d(){this.keys=[];this.values=[]}a.ad=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(c,function(b){for(var c=0;a.O(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.ad(b);return a.a.hc(b,c,d)};d.prototype={constructor:d,save:function(b,c){var d=a.a.A(this.keys,
b);0<=d?this.values[d]=c:(this.keys.push(b),this.values.push(c))},get:function(b){b=a.a.A(this.keys,b);return 0<=b?this.values[b]:n}}})();a.b("toJS",a.ad);a.b("toJSON",a.toJSON);a.Wd=function(b,c,d){function e(c){var e=a.xb(b,d).extend({ma:"always"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.v());return h}return"function"!==typeof Promise||c?e(c.bind(d)):new Promise(e)};a.b("when",a.Wd);(function(){a.w={M:function(b){switch(a.a.R(b)){case "option":return!0===b.__ko__hasDomDataOptionValue__?
a.a.g.get(b,a.c.options.$b):7>=a.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex]):n;default:return b.value}},cb:function(b,c,d){switch(a.a.R(b)){case "option":"string"===typeof c?(a.a.g.set(b,a.c.options.$b,n),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.g.set(b,a.c.options.$b,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===
typeof c?c:"");break;case "select":if(""===c||null===c)c=n;for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.w.M(b.options[f]),h==c||""===h&&c===n){e=f;break}if(d||0<=e||c===n&&1<b.size)b.selectedIndex=e,6===a.a.W&&a.a.setTimeout(function(){b.selectedIndex=e},0);break;default:if(null===c||c===n)c="";b.value=c}}}})();a.b("selectExtensions",a.w);a.b("selectExtensions.readValue",a.w.M);a.b("selectExtensions.writeValue",a.w.cb);a.m=function(){function b(b){b=a.a.Db(b);123===b.charCodeAt(0)&&(b=b.slice(1,
-1));b+="\n,";var c=[],d=b.match(e),p,q=[],h=0;if(1<d.length){for(var x=0,B;B=d[x];++x){var u=B.charCodeAt(0);if(44===u){if(0>=h){c.push(p&&q.length?{key:p,value:q.join("")}:{unknown:p||q.join("")});p=h=0;q=[];continue}}else if(58===u){if(!h&&!p&&1===q.length){p=q.pop();continue}}else if(47===u&&1<B.length&&(47===B.charCodeAt(1)||42===B.charCodeAt(1)))continue;else 47===u&&x&&1<B.length?(u=d[x-1].match(f))&&!g[u[0]]&&(b=b.substr(b.indexOf(B)+1),d=b.match(e),x=-1,B="/"):40===u||123===u||91===u?++h:
41===u||125===u||93===u?--h:p||q.length||34!==u&&39!==u||(B=B.slice(1,-1));q.push(B)}if(0<h)throw Error("Unbalanced parentheses, braces, or brackets");}return c}var c=["true","false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,g={"in":1,"return":1,"typeof":1},
h={};return{Ra:[],wa:h,ac:b,vb:function(e,f){function l(b,e){var f;if(!x){var k=a.getBindingHandler(b);if(k&&k.preprocess&&!(e=k.preprocess(e,b,l)))return;if(k=h[b])f=e,0<=a.a.A(c,f)?f=!1:(k=f.match(d),f=null===k?!1:k[1]?"Object("+k[1]+")"+k[2]:f),k=f;k&&q.push("'"+("string"==typeof h[b]?h[b]:b)+"':function(_z){"+f+"=_z}")}g&&(e="function(){return "+e+" }");p.push("'"+b+"':"+e)}f=f||{};var p=[],q=[],g=f.valueAccessors,x=f.bindingParams,B="string"===typeof e?b(e):e;a.a.D(B,function(a){l(a.key||a.unknown,
a.value)});q.length&&l("_ko_property_writers","{"+q.join(",")+" }");return p.join(",")},Id:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},eb:function(b,c,d,e,f){if(b&&a.O(b))!a.Za(b)||f&&b.v()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();a.b("expressionRewriting",a.m);a.b("expressionRewriting.bindingRewriteValidators",a.m.Ra);a.b("expressionRewriting.parseObjectLiteral",a.m.ac);a.b("expressionRewriting.preProcessBindings",a.m.vb);a.b("expressionRewriting._twoWayBindings",
a.m.wa);a.b("jsonExpressionRewriting",a.m);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.m.vb);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}function d(d,e){for(var f=d,h=1,g=[];f=f.nextSibling;){if(c(f)&&(a.a.g.set(f,k,!0),h--,0===h))return g;g.push(f);b(f)&&h++}if(!e)throw Error("Cannot find closing comment tag to match: "+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c?
0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=w&&"\x3c!--test--\x3e"===w.createComment("test").text,g=f?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,h=f?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,m={ul:!0,ol:!0},k="__ko_matchedEndComment__";a.h={ea:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Ea:function(c){if(b(c)){c=a.h.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Tb(c)},va:function(c,d){if(b(c)){a.h.Ea(c);for(var e=
c.nextSibling,f=0,k=d.length;f<k;f++)e.parentNode.insertBefore(d[f],e)}else a.a.va(c,d)},Vc:function(a,c){var d;b(a)?(d=a.nextSibling,a=a.parentNode):d=a.firstChild;d?c!==d&&a.insertBefore(c,d):a.appendChild(c)},Wb:function(c,d,e){e?(e=e.nextSibling,b(c)&&(c=c.parentNode),e?d!==e&&c.insertBefore(d,e):c.appendChild(d)):a.h.Vc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error("Found invalid end comment, as the first child of "+
a);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.g.get(f,k))throw Error("Found end comment without a matching opening comment, as child of "+d);return null}return d.nextSibling},Cd:b,Vd:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Sc:function(d){if(m[a.a.R(d)]){var f=d.firstChild;if(f){do if(1===f.nodeType){var k;k=f.firstChild;var h=null;if(k){do if(h)h.push(k);else if(b(k)){var g=e(k,!0);g?k=
g:h=[k]}else c(k)&&(h=[k]);while(k=k.nextSibling)}if(k=h)for(h=f.nextSibling,g=0;g<k.length;g++)h?d.insertBefore(k[g],h):d.appendChild(k[g])}while(f=f.nextSibling)}}}}})();a.b("virtualElements",a.h);a.b("virtualElements.allowedBindings",a.h.ea);a.b("virtualElements.emptyNode",a.h.Ea);a.b("virtualElements.insertAfter",a.h.Wb);a.b("virtualElements.prepend",a.h.Vc);a.b("virtualElements.setDomNodeChildren",a.h.va);(function(){a.ga=function(){this.nd={}};a.a.extend(a.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=
b.getAttribute("data-bind")||a.j.getComponentNameForNode(b);case 8:return a.h.Cd(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.j.tc(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.j.tc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.h.Vd(b);default:return null}},
parseBindingsString:function(b,c,d,e){try{var f=this.nd,g=b+(e&&e.valueAccessors||""),h;if(!(h=f[g])){var m,k="with($context){with($data||{}){return{"+a.m.vb(b,e)+"}}}";m=new Function("$context","$element",k);h=f[g]=m}return h(c,d)}catch(l){throw l.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+l.message,l;}}});a.ga.instance=new a.ga})();a.b("bindingProvider",a.ga);(function(){function b(b){var c=(b=a.a.g.get(b,z))&&b.N;c&&(b.N=null,c.Tc())}function c(c,d,e){this.node=c;this.yc=
d;this.kb=[];this.H=!1;d.N||a.a.K.za(c,b);e&&e.N&&(e.N.kb.push(c),this.Kb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Ga(a.u.G(b),function(a,c){return function(){return b()[c]}})}function g(b,c,e){return"function"===typeof b?f(b.bind(null,c,e)):a.a.Ga(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function m(b,c){var d=a.h.firstChild(c);if(d){var e,f=a.ga.instance,l=f.preprocessNode;if(l){for(;e=d;)d=a.h.nextSibling(e),l.call(f,e);
d=a.h.firstChild(c)}for(;e=d;)d=a.h.nextSibling(e),k(b,e)}a.i.ma(c,a.i.H)}function k(b,c){var d=b,e=1===c.nodeType;e&&a.h.Sc(c);if(e||a.ga.instance.nodeHasBindings(c))d=p(c,null,b).bindingContextForDescendants;d&&!u[a.a.R(c)]&&m(d,c)}function l(b){var c=[],d={},e=[];a.a.P(b,function ca(f){if(!d[f]){var k=a.getBindingHandler(f);k&&(k.after&&(e.push(f),a.a.D(k.after,function(c){if(b[c]){if(-1!==a.a.A(e,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+e.join(", "));
ca(c)}}),e.length--),c.push({key:f,Mc:k}));d[f]=!0}});return c}function p(b,c,d){var f=a.a.g.Ub(b,z,{}),k=f.hd;if(!c){if(k)throw Error("You cannot apply bindings multiple times to the same element.");f.hd=!0}k||(f.context=d);f.Zb||(f.Zb={});var g;if(c&&"function"!==typeof c)g=c;else{var p=a.ga.instance,q=p.getBindingAccessors||h,m=a.$(function(){if(g=c?c(d,b):q.call(p,b,d)){if(d[t])d[t]();if(d[B])d[B]()}return g},null,{l:b});g&&m.ja()||(m=null)}var x=d,u;if(g){var J=function(){return a.a.Ga(m?m():
g,e)},r=m?function(a){return function(){return e(m()[a])}}:function(a){return g[a]};J.get=function(a){return g[a]&&e(r(a))};J.has=function(a){return a in g};a.i.H in g&&a.i.subscribe(b,a.i.H,function(){var c=(0,g[a.i.H])();if(c){var d=a.h.childNodes(b);d.length&&c(d,a.Ec(d[0]))}});a.i.pa in g&&(x=a.i.Cb(b,d),a.i.subscribe(b,a.i.pa,function(){var c=(0,g[a.i.pa])();c&&a.h.firstChild(b)&&c(b)}));f=l(g);a.a.D(f,function(c){var d=c.Mc.init,e=c.Mc.update,f=c.key;if(8===b.nodeType&&!a.h.ea[f])throw Error("The binding '"+
f+"' cannot be used with virtual elements");try{"function"==typeof d&&a.u.G(function(){var a=d(b,r(f),J,x.$data,x);if(a&&a.controlsDescendantBindings){if(u!==n)throw Error("Multiple bindings ("+u+" and "+f+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=f}}),"function"==typeof e&&a.$(function(){e(b,r(f),J,x.$data,x)},null,{l:b})}catch(k){throw k.message='Unable to process binding "'+f+": "+g[f]+'"\nMessage: '+k.message,
k;}})}f=u===n;return{shouldBindDescendants:f,bindingContextForDescendants:f&&x}}function q(b,c){return b&&b instanceof a.fa?b:new a.fa(b,n,n,c)}var t=a.a.Da("_subscribable"),x=a.a.Da("_ancestorBindingInfo"),B=a.a.Da("_dataDependency");a.c={};var u={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.c[b]};var J={};a.fa=function(b,c,d,e,f){function k(){var b=p?h():h,f=a.a.f(b);c?(a.a.extend(l,c),x in c&&(l[x]=c[x])):(l.$parents=[],l.$root=f,l.ko=a);l[t]=q;g?f=l.$data:(l.$rawData=
b,l.$data=f);d&&(l[d]=f);e&&e(l,c,f);if(c&&c[t]&&!a.S.o().Vb(c[t]))c[t]();m&&(l[B]=m);return l.$data}var l=this,g=b===J,h=g?n:b,p="function"==typeof h&&!a.O(h),q,m=f&&f.dataDependency;f&&f.exportDependencies?k():(q=a.xb(k),q.v(),q.ja()?q.equalityComparer=null:l[t]=n)};a.fa.prototype.createChildContext=function(b,c,d,e){!e&&c&&"object"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f="function"==typeof b&&!a.O(b);return new a.fa(J,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.fa(b,
this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.fa.prototype.extend=function(b,c){return new a.fa(J,this,null,function(c){a.a.extend(c,"function"==typeof b?b(c):b)},c)};var z=a.a.g.Z();c.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)};c.prototype.sd=function(b){a.a.Pa(this.kb,b);!this.kb.length&&this.H&&this.Cc()};c.prototype.Cc=function(){this.H=!0;this.yc.N&&!this.kb.length&&(this.yc.N=
null,a.a.K.yb(this.node,b),a.i.ma(this.node,a.i.pa),this.Tc())};a.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(b,c,d,e,f){var k=a.a.g.Ub(b,z,{});k.Fa||(k.Fa=new a.T);f&&f.notifyImmediately&&k.Zb[c]&&a.u.G(d,e,[b]);return k.Fa.subscribe(d,e,c)},ma:function(b,c){var d=a.a.g.get(b,z);if(d&&(d.Zb[c]=!0,d.Fa&&d.Fa.notifySubscribers(b,c),c==a.i.H))if(d.N)d.N.Cc();else if(d.N===n&&d.Fa&&d.Fa.Wa(a.i.pa))throw Error("descendantsComplete event not supported for bindings on this node");
},Cb:function(b,d){var e=a.a.g.Ub(b,z,{});e.N||(e.N=new c(b,e,d[x]));return d[x]==e?d:d.extend(function(a){a[x]=e})}};a.Td=function(b){return(b=a.a.g.get(b,z))&&b.context};a.ib=function(b,c,d){1===b.nodeType&&a.h.Sc(b);return p(b,c,q(d))};a.ld=function(b,c,d){d=q(d);return a.ib(b,g(c,d,b),d)};a.Oa=function(a,b){1!==b.nodeType&&8!==b.nodeType||m(q(a),b)};a.vc=function(a,b,c){!v&&A.jQuery&&(v=A.jQuery);if(2>arguments.length){if(b=w.body,!b)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");
}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");k(q(a,c),b)};a.Dc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?n:a.Td(b)};a.Ec=function(b){return(b=a.Dc(b))?b.$data:n};a.b("bindingHandlers",a.c);a.b("bindingEvent",a.i);a.b("bindingEvent.subscribe",a.i.subscribe);a.b("bindingEvent.startPossiblyAsyncContentBinding",a.i.Cb);a.b("applyBindings",a.vc);a.b("applyBindingsToDescendants",a.Oa);
a.b("applyBindingAccessorsToNode",a.ib);a.b("applyBindingsToNode",a.ld);a.b("contextFor",a.Dc);a.b("dataFor",a.Ec)})();(function(b){function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,l;k?k.subscribe(e):(k=f[c]=new a.T,k.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Gd:e};delete f[c];l||e?k.notifySubscribers(b):a.na.zb(function(){k.notifySubscribers(b)})}),l=!0)}function d(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],function(a){b(a,
c)}):b(null,null)})}function e(c,d,f,l){l||(l=a.j.loaders.slice(0));var g=l.shift();if(g){var q=g[c];if(q){var t=!1;if(q.apply(g,d.concat(function(a){t?f(null):null!==a?f(a):e(c,d,f,l)}))!==b&&(t=!0,!g.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else e(c,d,f,l)}else f(null)}var f={},g={};a.j={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.Gd?a.u.G(function(){e(f.definition)}):
a.na.zb(function(){e(f.definition)}):c(d,e)},Bc:function(a){delete g[a]},oc:e};a.j.loaders=[];a.b("components",a.j);a.b("components.get",a.j.get);a.b("components.clearCachedDefinition",a.j.Bc)})();(function(){function b(b,c,d,e){function g(){0===--B&&e(h)}var h={},B=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.j.oc("loadTemplate",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.j.oc("loadViewModel",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if("function"===typeof b)d(function(a){return new b(a)});
else if("function"===typeof b[m])d(b[m]);else if("instance"in b){var e=b.instance;d(function(){return e})}else"viewModel"in b?c(a,b.viewModel,d):a("Unknown viewModel value: "+b)}function d(b){switch(a.a.R(b)){case "script":return a.a.ua(b.text);case "textarea":return a.a.ua(b.value);case "template":if(e(b.content))return a.a.Ca(b.content.childNodes)}return a.a.Ca(b.childNodes)}function e(a){return A.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){"string"===typeof b.require?
T||A.require?(T||A.require)([b.require],function(a){a&&"object"===typeof a&&a.Xd&&a["default"]&&(a=a["default"]);c(a)}):a("Uses require, but no AMD loader is present"):c(b)}function g(a){return function(b){throw Error("Component '"+a+"': "+b);}}var h={};a.j.register=function(b,c){if(!c)throw Error("Invalid configuration for "+b);if(a.j.tb(b))throw Error("Component "+b+" is already registered");h[b]=c};a.j.tb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.j.unregister=function(b){delete h[b];
a.j.Bc(b)};a.j.Fc={getConfig:function(b,c){c(a.j.tb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if("string"===typeof c)f(a.a.ua(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.la(c.childNodes));else if(c.element)if(c=c.element,A.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if("string"===typeof c){var h=w.getElementById(c);h?f(d(h)):b("Cannot find element with ID "+c)}else b("Unknown element type: "+
c);else b("Unknown template value: "+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m="createViewModel";a.b("components.register",a.j.register);a.b("components.isRegistered",a.j.tb);a.b("components.unregister",a.j.unregister);a.b("components.defaultLoader",a.j.Fc);a.j.loaders.push(a.j.Fc);a.j.dd=h})();(function(){function b(b,e){var f=b.getAttribute("params");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ga(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Ga(f,
function(c){var e=c.v();return c.ja()?a.o({read:function(){return a.a.f(c())},write:a.Za(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,"$raw")||(g.$raw=f);return g}return{$raw:{}}}a.j.getComponentNameForNode=function(b){var c=a.a.R(b);if(a.j.tb(c)&&(-1!=c.indexOf("-")||"[object HTMLUnknownElement]"==""+b||8>=a.a.W&&b.tagName===c))return c};a.j.tc=function(c,e,f,g){if(1===e.nodeType){var h=a.j.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the "component" binding on a custom element matching a component');
var m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.ga;9>a.a.W&&(a.j.register=function(a){return function(b){return a.apply(this,arguments)}}(a.j.register),w.createDocumentFragment=function(b){return function(){var c=b(),f=a.j.dd,g;for(g in f);return c}}(w.createDocumentFragment))})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error("Component '"+b+"' has no template");b=a.a.Ca(c);a.h.va(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,
b,c):b}var d=0;a.c.component={init:function(e,f,g,h,m){function k(){var a=l&&l.dispose;"function"===typeof a&&a.call(l);q&&q.s();p=l=q=null}var l,p,q,t=a.a.la(a.h.childNodes(e));a.h.Ea(e);a.a.K.za(e,k);a.o(function(){var g=a.a.f(f()),h,u;"string"===typeof g?h=g:(h=a.a.f(g.name),u=a.a.f(g.params));if(!h)throw Error("No component name specified");var n=a.i.Cb(e,m),z=p=++d;a.j.get(h,function(d){if(p===z){k();if(!d)throw Error("Unknown component '"+h+"'");b(h,d,e);var f=c(d,u,{element:e,templateNodes:t});
d=n.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=t}});f&&f.koDescendantsComplete&&(q=a.i.subscribe(e,a.i.pa,f.koDescendantsComplete,f));l=f;a.Oa(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.h.ea.component=!0})();var V={"class":"className","for":"htmlFor"};a.c.attr={update:function(b,c){var d=a.a.f(c())||{};a.a.P(d,function(c,d){d=a.a.f(d);var g=c.indexOf(":"),g="lookupNamespaceURI"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===
d||d===n;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();8>=a.a.W&&c in V?(c=V[c],h?b.removeAttribute(c):b[c]=d):h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c,d));"name"===c&&a.a.Yc(b,h?"":d)})}};(function(){a.c.checked={after:["value","attr"],init:function(b,c,d){function e(){var e=b.checked,f=g();if(!a.S.Ya()&&(e||!m&&!a.S.qa())){var k=a.u.G(c);if(l){var q=p?k.v():k,z=t;t=f;z!==f?e&&(a.a.Na(q,f,!0),a.a.Na(q,z,!1)):a.a.Na(q,f,e);p&&a.Za(k)&&k(q)}else h&&(f===n?f=e:e||(f=n)),a.m.eb(k,
d,"checked",f,!0)}}function f(){var d=a.a.f(c()),e=g();l?(b.checked=0<=a.a.A(d,e),t=e):b.checked=h&&e===n?!!d:g()===d}var g=a.xb(function(){if(d.has("checkedValue"))return a.a.f(d.get("checkedValue"));if(q)return d.has("value")?a.a.f(d.get("value")):b.value}),h="checkbox"==b.type,m="radio"==b.type;if(h||m){var k=c(),l=h&&a.a.f(k)instanceof Array,p=!(l&&k.push&&k.splice),q=m||l,t=l?g():n;m&&!b.name&&a.c.uniqueName.init(b,function(){return!0});a.o(e,null,{l:b});a.a.B(b,"click",e);a.o(f,null,{l:b});
k=n}}};a.m.wa.checked=!0;a.c.checkedValue={update:function(b,c){b.value=a.a.f(c())}}})();a.c["class"]={update:function(b,c){var d=a.a.Db(a.a.f(c()));a.a.Eb(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;a.a.Eb(b,d,!0)}};a.c.css={update:function(b,c){var d=a.a.f(c());null!==d&&"object"==typeof d?a.a.P(d,function(c,d){d=a.a.f(d);a.a.Eb(b,c,d)}):a.c["class"].update(b,c)}};a.c.enable={update:function(b,c){var d=a.a.f(c());d&&b.disabled?b.removeAttribute("disabled"):d||b.disabled||(b.disabled=!0)}};a.c.disable=
{update:function(b,c){a.c.enable.update(b,function(){return!a.a.f(c())})}};a.c.event={init:function(b,c,d,e,f){var g=c()||{};a.a.P(g,function(g){"string"==typeof g&&a.a.B(b,g,function(b){var k,l=c()[g];if(l){try{var p=a.a.la(arguments);e=f.$data;p.unshift(e);k=l.apply(e,p)}finally{!0!==k&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.c.foreach={Rc:function(b){return function(){var c=b(),d=a.a.bc(c);
if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.ba.Ma};a.a.f(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.ba.Ma}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.Rc(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.foreach.Rc(c),d,e,f)}};a.m.Ra.foreach=!1;a.h.ea.foreach=
!0;a.c.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if("activeElement"in f){var g;try{g=f.activeElement}catch(l){g=f.body}e=g===b}f=c();a.m.eb(f,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.B(b,"focus",f);a.a.B(b,"focusin",f);a.a.B(b,"blur",g);a.a.B(b,"focusout",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.f(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===
d||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.u.G(a.a.Fb,null,[b,d?"focusin":"focusout"]))}};a.m.wa.hasfocus=!0;a.c.hasFocus=a.c.hasfocus;a.m.wa.hasFocus="hasfocus";a.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.fc(b,c())}};(function(){function b(b,d,e){a.c[b]={init:function(b,c,h,m,k){var l,p,q={},t,x,n;if(d){m=h.get("as");var u=h.get("noChildContext");n=!(m&&u);q={as:m,noChildContext:u,exportDependencies:n}}x=(t=
"render"==h.get("completeOn"))||h.has(a.i.pa);a.o(function(){var h=a.a.f(c()),m=!e!==!h,u=!p,r;if(n||m!==l){x&&(k=a.i.Cb(b,k));if(m){if(!d||n)q.dataDependency=a.S.o();r=d?k.createChildContext("function"==typeof h?h:c,q):a.S.qa()?k.extend(null,q):k}u&&a.S.qa()&&(p=a.a.Ca(a.h.childNodes(b),!0));m?(u||a.h.va(b,a.a.Ca(p)),a.Oa(r,b)):(a.h.Ea(b),t||a.i.ma(b,a.i.H));l=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Ra[b]=!1;a.h.ea[b]=!0}b("if");b("ifnot",!1,!0);b("with",!0)})();a.c.let={init:function(b,
c,d,e,f){c=f.extend(c);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.let=!0;var Q={};a.c.options={init:function(b){if("select"!==a.a.R(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.jb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function g(c,d){if(x&&l)a.i.ma(b,a.i.H);else if(t.length){var e=
0<=a.a.A(t,a.w.M(d[0]));a.a.Zc(d[0],e);x&&!e&&a.u.G(a.a.Fb,null,[b,"change"])}}var h=b.multiple,m=0!=b.length&&h?b.scrollTop:null,k=a.a.f(c()),l=d.get("valueAllowUnset")&&d.has("value"),p=d.get("optionsIncludeDestroyed");c={};var q,t=[];l||(h?t=a.a.Mb(e(),a.w.M):0<=b.selectedIndex&&t.push(a.w.M(b.options[b.selectedIndex])));k&&("undefined"==typeof k.length&&(k=[k]),q=a.a.jb(k,function(b){return p||b===n||null===b||!a.a.f(b._destroy)}),d.has("optionsCaption")&&(k=a.a.f(d.get("optionsCaption")),null!==
k&&k!==n&&q.unshift(Q)));var x=!1;c.beforeRemove=function(a){b.removeChild(a)};k=g;d.has("optionsAfterRender")&&"function"==typeof d.get("optionsAfterRender")&&(k=function(b,c){g(0,c);a.u.G(d.get("optionsAfterRender"),null,[c[0],b!==Q?b:n])});a.a.ec(b,q,function(c,e,g){g.length&&(t=!l&&g[0].selected?[a.w.M(g[0])]:[],x=!0);e=b.ownerDocument.createElement("option");c===Q?(a.a.Bb(e,d.get("optionsCaption")),a.w.cb(e,n)):(g=f(c,d.get("optionsValue"),c),a.w.cb(e,a.a.f(g)),c=f(c,d.get("optionsText"),g),
a.a.Bb(e,c));return[e]},c,k);if(!l){var B;h?B=t.length&&e().length<t.length:B=t.length&&0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex])!==t[0]:t.length||0<=b.selectedIndex;B&&a.u.G(a.a.Fb,null,[b,"change"])}(l||a.S.Ya())&&a.i.ma(b,a.i.H);a.a.wd(b);m&&20<Math.abs(m-b.scrollTop)&&(b.scrollTop=m)}};a.c.options.$b=a.a.g.Z();a.c.selectedOptions={init:function(b,c,d){function e(){var e=c(),f=[];a.a.D(b.getElementsByTagName("option"),function(b){b.selected&&f.push(a.w.M(b))});a.m.eb(e,d,"selectedOptions",
f)}function f(){var d=a.a.f(c()),e=b.scrollTop;d&&"number"==typeof d.length&&a.a.D(b.getElementsByTagName("option"),function(b){var c=0<=a.a.A(d,a.w.M(b));b.selected!=c&&a.a.Zc(b,c)});b.scrollTop=e}if("select"!=a.a.R(b))throw Error("selectedOptions binding applies only to SELECT elements");var g;a.i.subscribe(b,a.i.H,function(){g?e():(a.a.B(b,"change",e),g=a.o(f,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}};a.m.wa.selectedOptions=!0;a.c.style={update:function(b,c){var d=a.a.f(c()||
{});a.a.P(d,function(c,d){d=a.a.f(d);if(null===d||d===n||!1===d)d="";if(v)v(b).css(c,d);else if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]=d+"px")}})}};a.c.submit={init:function(b,c,d,e,f){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");a.a.B(b,"submit",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?
a.preventDefault():a.returnValue=!1)}})}};a.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Bb(b,c())}};a.h.ea.text=!0;(function(){if(A&&A.navigator){var b=function(a){if(a)return parseFloat(a[1])},c=A.navigator.userAgent,d,e,f,g,h;(d=A.opera&&A.opera.version&&parseInt(A.opera.version()))||(h=b(c.match(/Edge\/([^ ]+)$/)))||b(c.match(/Chrome\/([^ ]+)/))||(e=b(c.match(/Version\/([^ ]+) Safari/)))||(f=b(c.match(/Firefox\/([^ ]+)/)))||(g=a.a.W||b(c.match(/MSIE ([^ ]+)/)))||
(g=b(c.match(/rv:([^ )]+)/)))}if(8<=g&&10>g)var m=a.a.g.Z(),k=a.a.g.Z(),l=function(b){var c=this.activeElement;(c=c&&a.a.g.get(c,k))&&c(b)},p=function(b,c){var d=b.ownerDocument;a.a.g.get(d,m)||(a.a.g.set(d,m,!0),a.a.B(d,"selectionchange",l));a.a.g.set(b,k,c)};a.c.textInput={init:function(b,c,k){function l(c,d){a.a.B(b,c,d)}function m(){var d=a.a.f(c());if(null===d||d===n)d="";L!==n&&d===L?a.a.setTimeout(m,4):b.value!==d&&(y=!0,b.value=d,y=!1,v=b.value)}function r(){w||(L=b.value,w=a.a.setTimeout(z,
4))}function z(){clearTimeout(w);L=w=n;var d=b.value;v!==d&&(v=d,a.m.eb(c(),k,"textInput",d))}var v=b.value,w,L,A=9==a.a.W?r:z,y=!1;g&&l("keypress",z);11>g&&l("propertychange",function(a){y||"value"!==a.propertyName||A(a)});8==g&&(l("keyup",z),l("keydown",z));p&&(p(b,A),l("dragend",r));(!g||9<=g)&&l("input",A);5>e&&"textarea"===a.a.R(b)?(l("keydown",r),l("paste",r),l("cut",r)):11>d?l("keydown",r):4>f?(l("DOMAutoComplete",z),l("dragdrop",z),l("drop",z)):h&&"number"===b.type&&l("keydown",r);l("change",
z);l("blur",z);a.o(m,null,{l:b})}};a.m.wa.textInput=!0;a.c.textinput={preprocess:function(a,b,c){c("textInput",a)}}})();a.c.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.c.uniqueName.rd;a.a.Yc(b,d)}}};a.c.uniqueName.rd=0;a.c.using={init:function(b,c,d,e,f){var g;d.has("as")&&(g={as:d.get("as"),noChildContext:d.get("noChildContext")});c=f.createChildContext(c,g);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.using=!0;a.c.value={init:function(b,c,d){var e=a.a.R(b),f="input"==
e;if(!f||"checkbox"!=b.type&&"radio"!=b.type){var g=[],h=d.get("valueUpdate"),m=!1,k=null;h&&("string"==typeof h?g=[h]:g=a.a.wc(h),a.a.Pa(g,"change"));var l=function(){k=null;m=!1;var e=c(),f=a.w.M(b);a.m.eb(e,d,"value",f)};!a.a.W||!f||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.A(g,"propertychange")||(a.a.B(b,"propertychange",function(){m=!0}),a.a.B(b,"focus",function(){m=!1}),a.a.B(b,"blur",function(){m&&l()}));a.a.D(g,function(c){var d=l;a.a.Ud(c,"after")&&
(d=function(){k=a.w.M(b);a.a.setTimeout(l,0)},c=c.substring(5));a.a.B(b,c,d)});var p;p=f&&"file"==b.type?function(){var d=a.a.f(c());null===d||d===n||""===d?b.value="":a.u.G(l)}:function(){var f=a.a.f(c()),g=a.w.M(b);if(null!==k&&f===k)a.a.setTimeout(p,0);else if(f!==g||g===n)"select"===e?(g=d.get("valueAllowUnset"),a.w.cb(b,f,g),g||f===a.w.M(b)||a.u.G(l)):a.w.cb(b,f)};if("select"===e){var q;a.i.subscribe(b,a.i.H,function(){q?d.get("valueAllowUnset")?p():l():(a.a.B(b,"change",l),q=a.o(p,null,{l:b}))},
null,{notifyImmediately:!0})}else a.a.B(b,"change",l),a.o(p,null,{l:b})}else a.ib(b,{checkedValue:c})},update:function(){}};a.m.wa.value=!0;a.c.visible={update:function(b,c){var d=a.a.f(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};a.c.hidden={update:function(b,c){a.c.visible.update(b,function(){return!a.a.f(c())})}};(function(b){a.c[b]={init:function(c,d,e,f,g){return a.c.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})("click");
a.ca=function(){};a.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};a.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.ca.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.C.F(d)}if(1==b.nodeType||8==b.nodeType)return new a.C.ia(b);throw Error("Unknown template type: "+b);};a.ca.prototype.renderTemplate=
function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ca.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.ca.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.ca);a.kc=function(){function b(b,c,d,h){b=a.m.ac(b);for(var m=a.m.Ra,k=0;k<b.length;k++){var l=b[k].key;if(Object.prototype.hasOwnProperty.call(m,
l)){var p=m[l];if("function"===typeof p){if(l=p(b[k].value))throw Error(l);}else if(!p)throw Error("This template engine does not support the '"+l+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.m.vb(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,
d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.kc.Ld(b,c)},d)},Ld:function(a,f){return a.replace(c,function(a,c,d,e,l){return b(l,c,d,f)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",f)})},md:function(b,c){return a.aa.Xb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.ib(m,b,h)})}}}();a.b("__tr_ambtns",a.kc.md);(function(){a.C={};a.C.F=function(b){if(this.F=b){var c=
a.a.R(b);this.ab="script"===c?1:"textarea"===c?2:"template"==c&&b.content&&11===b.content.nodeType?3:4}};a.C.F.prototype.text=function(){var b=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.F[b];var c=arguments[0];"innerHTML"===b?a.a.fc(this.F,c):this.F[b]=c};var b=a.a.g.Z()+"_";a.C.F.prototype.data=function(c){if(1===arguments.length)return a.a.g.get(this.F,b+c);a.a.g.set(this.F,b+c,arguments[1])};var c=a.a.g.Z();a.C.F.prototype.nodes=function(){var b=this.F;
if(0==arguments.length){var e=a.a.g.get(b,c)||{},f=e.lb||(3===this.ab?b.content:4===this.ab?b:n);if(!f||e.jd){var g=this.text();g&&g!==e.bb&&(f=a.a.Md(g,b.ownerDocument),a.a.g.set(b,c,{lb:f,bb:g,jd:!0}))}return f}e=arguments[0];this.ab!==n&&this.text("");a.a.g.set(b,c,{lb:e})};a.C.ia=function(a){this.F=a};a.C.ia.prototype=new a.C.F;a.C.ia.prototype.constructor=a.C.ia;a.C.ia.prototype.text=function(){if(0==arguments.length){var b=a.a.g.get(this.F,c)||{};b.bb===n&&b.lb&&(b.bb=b.lb.innerHTML);return b.bb}a.a.g.set(this.F,
c,{bb:arguments[0]})};a.b("templateSources",a.C);a.b("templateSources.domElement",a.C.F);a.b("templateSources.anonymousTemplate",a.C.ia)})();(function(){function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.ga.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):
(c.push(e,f),a.a.Ua(c,g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.vc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.aa.cd(b,[d])});a.a.Ua(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,m){m=m||{};var n=(b&&d(b)||f||{}).ownerDocument,B=m.templateEngine||g;a.kc.xd(f,B,n);f=B.renderTemplate(f,h,m,n);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");n=!1;switch(e){case "replaceChildren":a.h.va(b,
f);n=!0;break;case "replaceNode":a.a.Xc(b,f);n=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}n&&(c(f,h),m.afterRender&&a.u.G(m.afterRender,null,[f,h[m.as||"$data"]]),"replaceChildren"==e&&a.i.ma(b,a.i.H));return f}function f(b,c,d){return a.O(b)?b():"function"===typeof b?b(c,d):b}var g;a.gc=function(b){if(b!=n&&!(b instanceof a.ca))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.dc=function(b,c,h,m,t){h=h||{};if((h.templateEngine||g)==
n)throw Error("Set a template engine before calling renderTemplate");t=t||"replaceChildren";if(m){var x=d(m);return a.$(function(){var g=c&&c instanceof a.fa?c:new a.fa(c,null,null,null,{exportDependencies:!0}),n=f(b,g.$data,g),g=e(m,t,n,g,h);"replaceNode"==t&&(m=g,x=d(m))},null,{Sa:function(){return!x||!a.a.Sb(x)},l:x&&"replaceNode"==t?x.parentNode:x})}return a.aa.Xb(function(d){a.dc(b,c,h,d,"replaceNode")})};a.Qd=function(b,d,g,h,m){function x(b,c){a.u.G(a.a.ec,null,[h,b,u,g,r,c]);a.i.ma(h,a.i.H)}
function r(a,b){c(b,v);g.afterRender&&g.afterRender(b,a);v=null}function u(a,c){v=m.createChildContext(a,{as:z,noChildContext:g.noChildContext,extend:function(a){a.$index=c;z&&(a[z+"Index"]=c)}});var d=f(b,a,v);return e(h,"ignoreTargetNode",d,v,g)}var v,z=g.as,w=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(w||g.beforeRemove||!a.Pc(d))return a.$(function(){var b=a.a.f(d)||[];"undefined"==typeof b.length&&(b=[b]);w&&(b=a.a.jb(b,function(b){return b===n||null===b||
!a.a.f(b._destroy)}));x(b)},null,{l:h});x(d.v());var A=d.subscribe(function(a){x(d(),a)},null,"arrayChange");A.l(h);return A};var h=a.a.g.Z(),m=a.a.g.Z();a.c.template={init:function(b,c){var d=a.a.f(c());if("string"==typeof d||"name"in d)a.h.Ea(b);else if("nodes"in d){d=d.nodes||[];if(a.O(d))throw Error('The "nodes" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.g.get(e,m)||(e=a.a.Yb(d),a.a.g.set(e,m,!0));(new a.C.ia(b)).nodes(e)}else if(d=a.h.childNodes(b),0<d.length)e=
a.a.Yb(d),(new a.C.ia(b)).nodes(e);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.f(g);d=!0;e=null;"string"==typeof c?c={}:(g="name"in c?c.name:b,"if"in c&&(d=a.a.f(c["if"])),d&&"ifnot"in c&&(d=!a.a.f(c.ifnot)),d&&!g&&(d=!1));"foreach"in c?e=a.Qd(g,d&&c.foreach||[],c,b,f):d?(d=f,"data"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),
e=a.dc(g,d,c,b)):a.h.Ea(b);f=e;(c=a.a.g.get(b,h))&&"function"==typeof c.s&&c.s();a.a.g.set(b,h,!f||f.ja&&!f.ja()?n:f)}};a.m.Ra.template=function(b){b=a.m.ac(b);return 1==b.length&&b[0].unknown||a.m.Id(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.h.ea.template=!0})();a.b("setTemplateEngine",a.gc);a.b("renderTemplate",a.dc);a.a.Kc=function(a,c,d){if(a.length&&c.length){var e,f,g,h,m;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;m=c[g];++g)if(h.value===
m.value){h.moved=m.index;m.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Pb=function(){function b(b,d,e,f,g){var h=Math.min,m=Math.max,k=[],l,p=b.length,q,n=d.length,r=n-p||1,v=p+n+1,u,w,z;for(l=0;l<=p;l++)for(w=u,k.push(u=[]),z=h(n,l+r),q=m(0,l-1);q<=z;q++)u[q]=q?l?b[l-1]===d[q-1]?w[q-1]:h(w[q]||v,u[q-1]||v)+1:q+1:l+1;h=[];m=[];r=[];l=p;for(q=n;l||q;)n=k[l][q]-1,q&&n===k[l][q-1]?m.push(h[h.length]={status:e,value:d[--q],index:q}):l&&n===k[l-1][q]?r.push(h[h.length]={status:f,value:b[--l],index:l}):
(--q,--l,g.sparse||h.push({status:"retained",value:d[q]}));a.a.Kc(r,m,!g.dontLimitMoves&&10*p);return h.reverse()}return function(a,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,"added","deleted",e):b(d,a,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.Pb);(function(){function b(b,c,d,h,m){var k=[],l=a.$(function(){var l=c(d,m,a.a.Ua(k,b))||[];0<k.length&&(a.a.Xc(k,l),h&&a.u.G(h,null,[d,l,m]));k.length=0;a.a.Nb(k,l)},null,{l:b,Sa:function(){return!a.a.kd(k)}});
return{Y:k,$:l.ja()?l:n}}var c=a.a.g.Z(),d=a.a.g.Z();a.a.ec=function(e,f,g,h,m,k){function l(b){y={Aa:b,pb:a.ta(w++)};v.push(y);r||F.push(y)}function p(b){y=t[b];w!==y.pb.v()&&D.push(y);y.pb(w++);a.a.Ua(y.Y,e);v.push(y)}function q(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.D(c[d].Y,function(a){b(a,d,c[d].Aa)})}f=f||[];"undefined"==typeof f.length&&(f=[f]);h=h||{};var t=a.a.g.get(e,c),r=!t,v=[],u=0,w=0,z=[],A=[],C=[],D=[],F=[],y,I=0;if(r)a.a.D(f,l);else{if(!k||t&&t._countWaitingForRemove){var E=
a.a.Mb(t,function(a){return a.Aa});k=a.a.Pb(E,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var E=0,G,H,K;G=k[E];E++)switch(H=G.moved,K=G.index,G.status){case "deleted":for(;u<K;)p(u++);H===n&&(y=t[u],y.$&&(y.$.s(),y.$=n),a.a.Ua(y.Y,e).length&&(h.beforeRemove&&(v.push(y),I++,y.Aa===d?y=null:C.push(y)),y&&z.push.apply(z,y.Y)));u++;break;case "added":for(;w<K;)p(u++);H!==n?(A.push(v.length),p(H)):l(G.value)}for(;w<f.length;)p(u++);v._countWaitingForRemove=I}a.a.g.set(e,c,v);q(h.beforeMove,D);a.a.D(z,
h.beforeRemove?a.oa:a.removeNode);var M,O,P;try{P=e.ownerDocument.activeElement}catch(N){}if(A.length)for(;(E=A.shift())!=n;){y=v[E];for(M=n;E;)if((O=v[--E].Y)&&O.length){M=O[O.length-1];break}for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M)}for(E=0;y=v[E];E++){y.Y||a.a.extend(y,b(e,g,y.Aa,m,y.pb));for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M);!y.Ed&&m&&(m(y.Aa,y.Y,y.pb),y.Ed=!0,M=y.Y[y.Y.length-1])}P&&e.ownerDocument.activeElement!=P&&P.focus();q(h.beforeRemove,C);for(E=0;E<C.length;++E)C[E].Aa=d;q(h.afterMove,D);
q(h.afterAdd,F)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.ec);a.ba=function(){this.allowTemplateRewriting=!1};a.ba.prototype=new a.ca;a.ba.prototype.constructor=a.ba;a.ba.prototype.renderTemplateSource=function(b,c,d,e){if(c=(9>a.a.W?0:b.nodes)?b.nodes():null)return a.a.la(c.cloneNode(!0).childNodes);b=b.text();return a.a.ua(b,e)};a.ba.Ma=new a.ba;a.gc(a.ba.Ma);a.b("nativeTemplateEngine",a.ba);(function(){a.$a=function(){var a=this.Hd=function(){if(!v||!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();
this.renderTemplateSource=function(b,e,f,g){g=g||w;f=f||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=v.template(null,"{{ko_with $item.koBindingContext}}"+h+"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(h,b,e);e.appendTo(g.createElement("div"));v.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+
a+" })()) }}"};this.addTemplate=function(a,b){w.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(v.tmpl.tag.ko_code={open:"__.push($1 || '');"},v.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.$a.prototype=new a.ca;a.$a.prototype.constructor=a.$a;var b=new a.$a;0<b.Hd&&a.gc(b);a.b("jqueryTmplTemplateEngine",a.$a)})()})})();})();
define('ko_extended',["knockout"], function (ko) {
    "use strict";

    ko.bindingHandlers.domElement = {
        init: function (element, valueAccessor) {
            var observable = valueAccessor();
            if (ko.isObservable(observable)) {
                observable(element);
            }
        }
    };

    ko.bindingHandlers.toggleClick = {
        init: function (element, valueAccessor) {
            var observable = valueAccessor();
            ko.utils.registerEventHandler(element, "click", function () {
                observable(!observable());
            });
        }
    };

    ko.bindingHandlers.stopBinding = {
        init: function () {
            return { controlsDescendantBindings: true };
        }
    };

    ko.virtualElements.allowedBindings.stopBinding = true;

    return ko;
});
/*!
 * imagesLoaded PACKAGED v3.1.8
 * JavaScript is all like "You images are done yet or what?"
 * MIT License
 * http://imagesloaded.desandro.com/
 */

(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define('imagesLoaded',["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
/*!
 * typeahead.js 0.11.1
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
 */

(function(root, factory) {
    if (typeof define === "function" && define.amd) {
        define("typeahead", [ "jquery" ], function(a0) { // brainjocks edited
            return factory(a0);
        });
    } else if (typeof exports === "object") {
        module.exports = factory(require("jquery"));
    } else {
        factory(jQuery);
    }
})(this, function($) {
    var _ = function() {
        "use strict";
        return {
            isMsie: function() {
                return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false;
            },
            isBlankString: function(str) {
                return !str || /^\s*$/.test(str);
            },
            escapeRegExChars: function(str) {
                return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
            },
            isString: function(obj) {
                return typeof obj === "string";
            },
            isNumber: function(obj) {
                return typeof obj === "number";
            },
            isArray: Array.isArray,
            isFunction: $.isFunction,
            isObject: $.isPlainObject,
            isUndefined: function(obj) {
                return typeof obj === "undefined";
            },
            isElement: function(obj) {
                return !!(obj && obj.nodeType === 1);
            },
            isJQuery: function(obj) {
                return obj instanceof $;
            },
            toStr: function toStr(s) {
                return _.isUndefined(s) || s === null ? "" : s + "";
            },
            bind: $.proxy,
            each: function(collection, cb) {
                $.each(collection, reverseArgs);
                function reverseArgs(index, value) {
                    return cb(value, index);
                }
            },
            map: $.map,
            filter: $.grep,
            every: function(obj, test) {
                var result = true;
                if (!obj) {
                    return result;
                }
                $.each(obj, function(key, val) {
                    if (!(result = test.call(null, val, key, obj))) {
                        return false;
                    }
                });
                return !!result;
            },
            some: function(obj, test) {
                var result = false;
                if (!obj) {
                    return result;
                }
                $.each(obj, function(key, val) {
                    if (result = test.call(null, val, key, obj)) {
                        return false;
                    }
                });
                return !!result;
            },
            mixin: $.extend,
            identity: function(x) {
                return x;
            },
            clone: function(obj) {
                return $.extend(true, {}, obj);
            },
            getIdGenerator: function() {
                var counter = 0;
                return function() {
                    return counter++;
                };
            },
            templatify: function templatify(obj) {
                return typeof obj === "function" ? obj : template;
                function template() {
                    return String(obj);
                }
            },
            defer: function(fn) {
                setTimeout(fn, 0);
            },
            debounce: function(func, wait, immediate) {
                var timeout, result;
                return function() {
                    var context = this, args = arguments, later, callNow;
                    later = function() {
                        timeout = null;
                        if (!immediate) {
                            result = func.apply(context, args);
                        }
                    };
                    callNow = immediate && !timeout;
                    clearTimeout(timeout);
                    timeout = setTimeout(later, wait);
                    if (callNow) {
                        result = func.apply(context, args);
                    }
                    return result;
                };
            },
            throttle: function(func, wait) {
                var context, args, timeout, result, previous, later;
                previous = 0;
                later = function() {
                    previous = new Date();
                    timeout = null;
                    result = func.apply(context, args);
                };
                return function() {
                    var now = new Date(), remaining = wait - (now - previous);
                    context = this;
                    args = arguments;
                    if (remaining <= 0) {
                        clearTimeout(timeout);
                        timeout = null;
                        previous = now;
                        result = func.apply(context, args);
                    } else if (!timeout) {
                        timeout = setTimeout(later, remaining);
                    }
                    return result;
                };
            },
            stringify: function(val) {
                return _.isString(val) ? val : JSON.stringify(val);
            },
            noop: function() {}
        };
    }();
    var WWW = function() {
        "use strict";
        var defaultClassNames = {
            wrapper: "twitter-typeahead",
            input: "tt-input",
            hint: "tt-hint",
            menu: "tt-menu",
            dataset: "tt-dataset",
            suggestion: "tt-suggestion",
            selectable: "tt-selectable",
            empty: "tt-empty",
            open: "tt-open",
            cursor: "tt-cursor",
            highlight: "tt-highlight"
        };
        return build;
        function build(o) {
            var www, classes;
            classes = _.mixin({}, defaultClassNames, o);
            www = {
                css: buildCss(),
                classes: classes,
                html: buildHtml(classes),
                selectors: buildSelectors(classes)
            };
            return {
                css: www.css,
                html: www.html,
                classes: www.classes,
                selectors: www.selectors,
                mixin: function(o) {
                    _.mixin(o, www);
                }
            };
        }
        function buildHtml(c) {
            return {
                wrapper: '<span class="' + c.wrapper + '"></span>',
                menu: '<div class="' + c.menu + '"></div>'
            };
        }
        function buildSelectors(classes) {
            var selectors = {};
            _.each(classes, function(v, k) {
                selectors[k] = "." + v;
            });
            return selectors;
        }
        function buildCss() {
            var css = {
                wrapper: {
                    position: "relative",
                    display: "inline-block"
                },
                hint: {
                    position: "absolute",
                    top: "0",
                    left: "0",
                    borderColor: "transparent",
                    boxShadow: "none",
                    opacity: "1"
                },
                input: {
                    position: "relative",
                    verticalAlign: "top",
                    backgroundColor: "transparent"
                },
                inputWithNoHint: {
                    position: "relative",
                    verticalAlign: "top"
                },
                menu: {
                    position: "absolute",
                    top: "100%",
                    left: "0",
                    zIndex: "100",
                    display: "none"
                },
                ltr: {
                    left: "0",
                    right: "auto"
                },
                rtl: {
                    left: "auto",
                    right: " 0"
                }
            };
            if (_.isMsie()) {
                _.mixin(css.input, {
                    backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"
                });
            }
            return css;
        }
    }();
    var EventBus = function() {
        "use strict";
        var namespace, deprecationMap;
        namespace = "typeahead:";
        deprecationMap = {
            render: "rendered",
            cursorchange: "cursorchanged",
            select: "selected",
            autocomplete: "autocompleted"
        };
        function EventBus(o) {
            if (!o || !o.el) {
                $.error("EventBus initialized without el");
            }
            this.$el = $(o.el);
        }
        _.mixin(EventBus.prototype, {
            _trigger: function(type, args) {
                var $e;
                $e = $.Event(namespace + type);
                (args = args || []).unshift($e);
                this.$el.trigger.apply(this.$el, args);
                return $e;
            },
            before: function(type) {
                var args, $e;
                args = [].slice.call(arguments, 1);
                $e = this._trigger("before" + type, args);
                return $e.isDefaultPrevented();
            },
            trigger: function(type) {
                var deprecatedType;
                this._trigger(type, [].slice.call(arguments, 1));
                if (deprecatedType = deprecationMap[type]) {
                    this._trigger(deprecatedType, [].slice.call(arguments, 1));
                }
            }
        });
        return EventBus;
    }();
    var EventEmitter = function() {
        "use strict";
        var splitter = /\s+/, nextTick = getNextTick();
        return {
            onSync: onSync,
            onAsync: onAsync,
            off: off,
            trigger: trigger
        };
        function on(method, types, cb, context) {
            var type;
            if (!cb) {
                return this;
            }
            types = types.split(splitter);
            cb = context ? bindContext(cb, context) : cb;
            this._callbacks = this._callbacks || {};
            while (type = types.shift()) {
                this._callbacks[type] = this._callbacks[type] || {
                    sync: [],
                    async: []
                };
                this._callbacks[type][method].push(cb);
            }
            return this;
        }
        function onAsync(types, cb, context) {
            return on.call(this, "async", types, cb, context);
        }
        function onSync(types, cb, context) {
            return on.call(this, "sync", types, cb, context);
        }
        function off(types) {
            var type;
            if (!this._callbacks) {
                return this;
            }
            types = types.split(splitter);
            while (type = types.shift()) {
                delete this._callbacks[type];
            }
            return this;
        }
        function trigger(types) {
            var type, callbacks, args, syncFlush, asyncFlush;
            if (!this._callbacks) {
                return this;
            }
            types = types.split(splitter);
            args = [].slice.call(arguments, 1);
            while ((type = types.shift()) && (callbacks = this._callbacks[type])) {
                syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args));
                asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args));
                syncFlush() && nextTick(asyncFlush);
            }
            return this;
        }
        function getFlush(callbacks, context, args) {
            return flush;
            function flush() {
                var cancelled;
                for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {
                    cancelled = callbacks[i].apply(context, args) === false;
                }
                return !cancelled;
            }
        }
        function getNextTick() {
            var nextTickFn;
            if (window.setImmediate) {
                nextTickFn = function nextTickSetImmediate(fn) {
                    setImmediate(function() {
                        fn();
                    });
                };
            } else {
                nextTickFn = function nextTickSetTimeout(fn) {
                    setTimeout(function() {
                        fn();
                    }, 0);
                };
            }
            return nextTickFn;
        }
        function bindContext(fn, context) {
            return fn.bind ? fn.bind(context) : function() {
                fn.apply(context, [].slice.call(arguments, 0));
            };
        }
    }();
    var highlight = function(doc) {
        "use strict";
        var defaults = {
            node: null,
            pattern: null,
            tagName: "strong",
            className: null,
            wordsOnly: false,
            caseSensitive: false
        };
        return function hightlight(o) {
            var regex;
            o = _.mixin({}, defaults, o);
            if (!o.node || !o.pattern) {
                return;
            }
            o.pattern = Array.isArray(o.pattern) ? o.pattern : [ o.pattern ];
            regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly);
            traverse(o.node, hightlightTextNode);
            function hightlightTextNode(textNode) {
                var match, patternNode, wrapperNode;
                if (match = regex.exec(textNode.data)) {
                    wrapperNode = doc.createElement(o.tagName);
                    o.className && (wrapperNode.className = o.className);
                    patternNode = textNode.splitText(match.index);
                    patternNode.splitText(match[0].length);
                    wrapperNode.appendChild(patternNode.cloneNode(true));
                    textNode.parentNode.replaceChild(wrapperNode, patternNode);
                }
                return !!match;
            }
            function traverse(el, hightlightTextNode) {
                var childNode, TEXT_NODE_TYPE = 3;
                for (var i = 0; i < el.childNodes.length; i++) {
                    childNode = el.childNodes[i];
                    if (childNode.nodeType === TEXT_NODE_TYPE) {
                        i += hightlightTextNode(childNode) ? 1 : 0;
                    } else {
                        traverse(childNode, hightlightTextNode);
                    }
                }
            }
        };
        function getRegex(patterns, caseSensitive, wordsOnly) {
            var escapedPatterns = [], regexStr;
            for (var i = 0, len = patterns.length; i < len; i++) {
                escapedPatterns.push(_.escapeRegExChars(patterns[i]));
            }
            regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")";
            return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i");
        }
    }(window.document);
    var Input = function() {
        "use strict";
        var specialKeyCodeMap;
        specialKeyCodeMap = {
            9: "tab",
            27: "esc",
            37: "left",
            39: "right",
            13: "enter",
            38: "up",
            40: "down"
        };
        function Input(o, www) {
            o = o || {};
            if (!o.input) {
                $.error("input is missing");
            }
            www.mixin(this);
            this.$hint = $(o.hint);
            this.$input = $(o.input);
            this.query = this.$input.val();
            this.queryWhenFocused = this.hasFocus() ? this.query : null;
            this.$overflowHelper = buildOverflowHelper(this.$input);
            this._checkLanguageDirection();
            if (this.$hint.length === 0) {
                this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;
            }
        }
        Input.normalizeQuery = function(str) {
            return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " ");
        };
        _.mixin(Input.prototype, EventEmitter, {
            _onBlur: function onBlur() {
                this.resetInputValue();
                this.trigger("blurred");
            },
            _onFocus: function onFocus() {
                this.queryWhenFocused = this.query;
                this.trigger("focused");
            },
            _onKeydown: function onKeydown($e) {
                var keyName = specialKeyCodeMap[$e.which || $e.keyCode];
                this._managePreventDefault(keyName, $e);
                if (keyName && this._shouldTrigger(keyName, $e)) {
                    this.trigger(keyName + "Keyed", $e);
                }
            },
            _onInput: function onInput() {
                this._setQuery(this.getInputValue());
                this.clearHintIfInvalid();
                this._checkLanguageDirection();
            },
            _managePreventDefault: function managePreventDefault(keyName, $e) {
                var preventDefault;
                switch (keyName) {
                  case "up":
                  case "down":
                    preventDefault = !withModifier($e);
                    break;

                  default:
                    preventDefault = false;
                }
                preventDefault && $e.preventDefault();
            },
            _shouldTrigger: function shouldTrigger(keyName, $e) {
                var trigger;
                switch (keyName) {
                  case "tab":
                    trigger = !withModifier($e);
                    break;

                  default:
                    trigger = true;
                }
                return trigger;
            },
            _checkLanguageDirection: function checkLanguageDirection() {
                var dir = (this.$input.css("direction") || "ltr").toLowerCase();
                if (this.dir !== dir) {
                    this.dir = dir;
                    this.$hint.attr("dir", dir);
                    this.trigger("langDirChanged", dir);
                }
            },
            _setQuery: function setQuery(val, silent) {
                var areEquivalent, hasDifferentWhitespace;
                areEquivalent = areQueriesEquivalent(val, this.query);
                hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false;
                this.query = val;
                if (!silent && !areEquivalent) {
                    this.trigger("queryChanged", this.query);
                } else if (!silent && hasDifferentWhitespace) {
                    this.trigger("whitespaceChanged", this.query);
                }
            },
            bind: function() {
                var that = this, onBlur, onFocus, onKeydown, onInput;
                onBlur = _.bind(this._onBlur, this);
                onFocus = _.bind(this._onFocus, this);
                onKeydown = _.bind(this._onKeydown, this);
                onInput = _.bind(this._onInput, this);
                this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown);
                if (!_.isMsie() || _.isMsie() > 9) {
                    this.$input.on("input.tt", onInput);
                } else {
                    this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) {
                        if (specialKeyCodeMap[$e.which || $e.keyCode]) {
                            return;
                        }
                        _.defer(_.bind(that._onInput, that, $e));
                    });
                }
                return this;
            },
            focus: function focus() {
                this.$input.focus();
            },
            blur: function blur() {
                this.$input.blur();
            },
            getLangDir: function getLangDir() {
                return this.dir;
            },
            getQuery: function getQuery() {
                return this.query || "";
            },
            setQuery: function setQuery(val, silent) {
                this.setInputValue(val);
                this._setQuery(val, silent);
            },
            hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() {
                return this.query !== this.queryWhenFocused;
            },
            getInputValue: function getInputValue() {
                return this.$input.val();
            },
            setInputValue: function setInputValue(value) {
                this.$input.val(value);
                this.clearHintIfInvalid();
                this._checkLanguageDirection();
            },
            resetInputValue: function resetInputValue() {
                this.setInputValue(this.query);
            },
            getHint: function getHint() {
                return this.$hint.val();
            },
            setHint: function setHint(value) {
                this.$hint.val(value);
            },
            clearHint: function clearHint() {
                this.setHint("");
            },
            clearHintIfInvalid: function clearHintIfInvalid() {
                var val, hint, valIsPrefixOfHint, isValid;
                val = this.getInputValue();
                hint = this.getHint();
                valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;
                isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow();
                !isValid && this.clearHint();
            },
            hasFocus: function hasFocus() {
                return this.$input.is(":focus");
            },
            hasOverflow: function hasOverflow() {
                var constraint = this.$input.width() - 2;
                this.$overflowHelper.text(this.getInputValue());
                return this.$overflowHelper.width() >= constraint;
            },
            isCursorAtEnd: function() {
                var valueLength, selectionStart, range;
                valueLength = this.$input.val().length;
                selectionStart = this.$input[0].selectionStart;
                if (_.isNumber(selectionStart)) {
                    return selectionStart === valueLength;
                } else if (document.selection) {
                    range = document.selection.createRange();
                    range.moveStart("character", -valueLength);
                    return valueLength === range.text.length;
                }
                return true;
            },
            destroy: function destroy() {
                this.$hint.off(".tt");
                this.$input.off(".tt");
                this.$overflowHelper.remove();
                this.$hint = this.$input = this.$overflowHelper = $("<div>");
            }
        });
        return Input;
        function buildOverflowHelper($input) {
            return $('<pre aria-hidden="true"></pre>').css({
                position: "absolute",
                visibility: "hidden",
                whiteSpace: "pre",
                fontFamily: $input.css("font-family"),
                fontSize: $input.css("font-size"),
                fontStyle: $input.css("font-style"),
                fontVariant: $input.css("font-variant"),
                fontWeight: $input.css("font-weight"),
                wordSpacing: $input.css("word-spacing"),
                letterSpacing: $input.css("letter-spacing"),
                textIndent: $input.css("text-indent"),
                textRendering: $input.css("text-rendering"),
                textTransform: $input.css("text-transform")
            }).insertAfter($input);
        }
        function areQueriesEquivalent(a, b) {
            return Input.normalizeQuery(a) === Input.normalizeQuery(b);
        }
        function withModifier($e) {
            return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;
        }
    }();
    var Dataset = function() {
        "use strict";
        var keys, nameGenerator;
        keys = {
            val: "tt-selectable-display",
            obj: "tt-selectable-object"
        };
        nameGenerator = _.getIdGenerator();
        function Dataset(o, www) {
            o = o || {};
            o.templates = o.templates || {};
            o.templates.notFound = o.templates.notFound || o.templates.empty;
            if (!o.source) {
                $.error("missing source");
            }
            if (!o.node) {
                $.error("missing node");
            }
            if (o.name && !isValidName(o.name)) {
                $.error("invalid dataset name: " + o.name);
            }
            www.mixin(this);
            this.highlight = !!o.highlight;
            this.name = o.name || nameGenerator();
            this.limit = o.limit || 5;
            this.displayFn = getDisplayFn(o.display || o.displayKey);
            this.templates = getTemplates(o.templates, this.displayFn);
            this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source;
            this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async;
            this._resetLastSuggestion();
            this.$el = $(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name);
        }
        Dataset.extractData = function extractData(el) {
            var $el = $(el);
            if ($el.data(keys.obj)) {
                return {
                    val: $el.data(keys.val) || "",
                    obj: $el.data(keys.obj) || null
                };
            }
            return null;
        };
        _.mixin(Dataset.prototype, EventEmitter, {
            _overwrite: function overwrite(query, suggestions) {
                suggestions = suggestions || [];
                if (suggestions.length) {
                    this._renderSuggestions(query, suggestions);
                } else if (this.async && this.templates.pending) {
                    this._renderPending(query);
                } else if (!this.async && this.templates.notFound) {
                    this._renderNotFound(query);
                } else {
                    this._empty();
                }
                this.trigger("rendered", this.name, suggestions, false);
            },
            _append: function append(query, suggestions) {
                suggestions = suggestions || [];
                if (suggestions.length && this.$lastSuggestion.length) {
                    this._appendSuggestions(query, suggestions);
                } else if (suggestions.length) {
                    this._renderSuggestions(query, suggestions);
                } else if (!this.$lastSuggestion.length && this.templates.notFound) {
                    this._renderNotFound(query);
                }
                this.trigger("rendered", this.name, suggestions, true);
            },
            _renderSuggestions: function renderSuggestions(query, suggestions) {
                var $fragment;
                $fragment = this._getSuggestionsFragment(query, suggestions);
                this.$lastSuggestion = $fragment.children().last();
                this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions));
            },
            _appendSuggestions: function appendSuggestions(query, suggestions) {
                var $fragment, $lastSuggestion;
                $fragment = this._getSuggestionsFragment(query, suggestions);
                $lastSuggestion = $fragment.children().last();
                this.$lastSuggestion.after($fragment);
                this.$lastSuggestion = $lastSuggestion;
            },
            _renderPending: function renderPending(query) {
                var template = this.templates.pending;
                this._resetLastSuggestion();
                template && this.$el.html(template({
                    query: query,
                    dataset: this.name
                }));
            },
            _renderNotFound: function renderNotFound(query) {
                var template = this.templates.notFound;
                this._resetLastSuggestion();
                template && this.$el.html(template({
                    query: query,
                    dataset: this.name
                }));
            },
            _empty: function empty() {
                this.$el.empty();
                this._resetLastSuggestion();
            },
            _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) {
                var that = this, fragment;
                fragment = document.createDocumentFragment();
                _.each(suggestions, function getSuggestionNode(suggestion) {
                    var $el, context;
                    context = that._injectQuery(query, suggestion);
                    $el = $(that.templates.suggestion(context)).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable);
                    fragment.appendChild($el[0]);
                });
                this.highlight && highlight({
                    className: this.classes.highlight,
                    node: fragment,
                    pattern: query
                });
                return $(fragment);
            },
            _getFooter: function getFooter(query, suggestions) {
                return this.templates.footer ? this.templates.footer({
                    query: query,
                    suggestions: suggestions,
                    dataset: this.name
                }) : null;
            },
            _getHeader: function getHeader(query, suggestions) {
                return this.templates.header ? this.templates.header({
                    query: query,
                    suggestions: suggestions,
                    dataset: this.name
                }) : null;
            },
            _resetLastSuggestion: function resetLastSuggestion() {
                this.$lastSuggestion = $();
            },
            _injectQuery: function injectQuery(query, obj) {
                return _.isObject(obj) ? _.mixin({
                    _query: query
                }, obj) : obj;
            },
            update: function update(query) {
                var that = this, canceled = false, syncCalled = false, rendered = 0;
                this.cancel();
                this.cancel = function cancel() {
                    canceled = true;
                    that.cancel = $.noop;
                    that.async && that.trigger("asyncCanceled", query);
                };
                this.source(query, sync, async);
                !syncCalled && sync([]);
                function sync(suggestions) {
                    if (syncCalled) {
                        return;
                    }
                    syncCalled = true;
                    suggestions = (suggestions || []).slice(0, that.limit);
                    rendered = suggestions.length;
                    that._overwrite(query, suggestions);
                    if (rendered < that.limit && that.async) {
                        that.trigger("asyncRequested", query);
                    }
                }
                function async(suggestions) {
                    suggestions = suggestions || [];
                    if (!canceled && rendered < that.limit) {
                        that.cancel = $.noop;

                        // start Brainjocks edited
                        that._append(query, suggestions.slice(0, that.limit - rendered));
                        rendered += suggestions.length;
                        that.async && that.trigger("asyncReceived", that, query);
                        // end Brainjocks edited
                    }
                }
            },
            cancel: $.noop,
            clear: function clear() {
                this._empty();
                this.cancel();
                this.trigger("cleared");
            },
            isEmpty: function isEmpty() {
                return this.$el.is(":empty");
            },
            destroy: function destroy() {
                this.$el = $("<div>");
            }
        });
        return Dataset;
        function getDisplayFn(display) {
            display = display || _.stringify;
            return typeof display === "function" ? display : displayFn;
            
            function displayFn(obj) {
                return obj[display];
            }
        }
        function getTemplates(templates, displayFn) {
            return {
                notFound: templates.notFound && _.templatify(templates.notFound),
                pending: templates.pending && _.templatify(templates.pending),
                header: templates.header && _.templatify(templates.header),
                footer: templates.footer && _.templatify(templates.footer),
                suggestion: templates.suggestion || suggestionTemplate
            };
            function suggestionTemplate(context) {
                return $("<div>").text(displayFn(context));
            }
        }
        function isValidName(str) {
            return /^[_a-zA-Z0-9-]+$/.test(str);
        }
    }();
    var Menu = function() {
        "use strict";
        function Menu(o, www) {
            var that = this;
            o = o || {};
            if (!o.node) {
                $.error("node is required");
            }
            www.mixin(this);
            this.$node = $(o.node);
            this.query = null;
            this.datasets = _.map(o.datasets, initializeDataset);
            function initializeDataset(oDataset) {
                var node = that.$node.find(oDataset.node).first();
                oDataset.node = node.length ? node : $("<div>").appendTo(that.$node);
                return new Dataset(oDataset, www);
            }
        }
        _.mixin(Menu.prototype, EventEmitter, {
            _onSelectableClick: function onSelectableClick($e) {
                this.trigger("selectableClicked", $($e.currentTarget));
            },
            _onRendered: function onRendered(type, dataset, suggestions, async) {
                this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty());
                this.trigger("datasetRendered", dataset, suggestions, async);
            },
            _onCleared: function onCleared() {
                this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty());
                this.trigger("datasetCleared");
            },
            _propagate: function propagate() {
                this.trigger.apply(this, arguments);
            },
            _allDatasetsEmpty: function allDatasetsEmpty() {
                return _.every(this.datasets, isDatasetEmpty);
                function isDatasetEmpty(dataset) {
                    return dataset.isEmpty();
                }
            },
            _getSelectables: function getSelectables() {
                return this.$node.find(this.selectors.selectable);
            },
            _removeCursor: function _removeCursor() {
                var $selectable = this.getActiveSelectable();
                $selectable && $selectable.removeClass(this.classes.cursor);
            },
            _ensureVisible: function ensureVisible($el) {
                var elTop, elBottom, nodeScrollTop, nodeHeight;
                elTop = $el.position().top;
                elBottom = elTop + $el.outerHeight(true);
                nodeScrollTop = this.$node.scrollTop();
                nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10);
                if (elTop < 0) {
                    this.$node.scrollTop(nodeScrollTop + elTop);
                } else if (nodeHeight < elBottom) {
                    this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight));
                }
            },
            bind: function() {
                var that = this, onSelectableClick;
                onSelectableClick = _.bind(this._onSelectableClick, this);
                this.$node.on("click.tt", this.selectors.selectable, onSelectableClick);
                _.each(this.datasets, function(dataset) {
                    dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that);
                });
                return this;
            },
            isOpen: function isOpen() {
                return this.$node.hasClass(this.classes.open);
            },
            open: function open() {
                this.$node.addClass(this.classes.open);
            },
            close: function close() {
                this.$node.removeClass(this.classes.open);
                this._removeCursor();
            },
            setLanguageDirection: function setLanguageDirection(dir) {
                this.$node.attr("dir", dir);
            },
            selectableRelativeToCursor: function selectableRelativeToCursor(delta) {
                var $selectables, $oldCursor, oldIndex, newIndex;
                $oldCursor = this.getActiveSelectable();
                $selectables = this._getSelectables();
                oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1;
                newIndex = oldIndex + delta;
                newIndex = (newIndex + 1) % ($selectables.length + 1) - 1;
                newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex;
                return newIndex === -1 ? null : $selectables.eq(newIndex);
            },
            setCursor: function setCursor($selectable) {
                this._removeCursor();
                if ($selectable = $selectable && $selectable.first()) {
                    $selectable.addClass(this.classes.cursor);
                    this._ensureVisible($selectable);
                }
            },
            getSelectableData: function getSelectableData($el) {
                return $el && $el.length ? Dataset.extractData($el) : null;
            },
            getActiveSelectable: function getActiveSelectable() {
                var $selectable = this._getSelectables().filter(this.selectors.cursor).first();
                return $selectable.length ? $selectable : null;
            },
            getTopSelectable: function getTopSelectable() {
                var $selectable = this._getSelectables().first();
                return $selectable.length ? $selectable : null;
            },
            update: function update(query) {
                var isValidUpdate = query !== this.query;
                if (isValidUpdate) {
                    this.query = query;
                    _.each(this.datasets, updateDataset);
                }
                return isValidUpdate;
                function updateDataset(dataset) {
                    dataset.update(query);
                }
            },
            empty: function empty() {
                _.each(this.datasets, clearDataset);
                this.query = null;
                this.$node.addClass(this.classes.empty);
                function clearDataset(dataset) {
                    dataset.clear();
                }
            },
            destroy: function destroy() {
                this.$node.off(".tt");
                this.$node = $("<div>");
                _.each(this.datasets, destroyDataset);
                function destroyDataset(dataset) {
                    dataset.destroy();
                }
            }
        });
        return Menu;
    }();
    var DefaultMenu = function() {
        "use strict";
        var s = Menu.prototype;
        function DefaultMenu() {
            Menu.apply(this, [].slice.call(arguments, 0));
        }
        _.mixin(DefaultMenu.prototype, Menu.prototype, {
            open: function open() {
                !this._allDatasetsEmpty() && this._show();
                return s.open.apply(this, [].slice.call(arguments, 0));
            },
            close: function close() {
                this._hide();
                return s.close.apply(this, [].slice.call(arguments, 0));
            },
            _onRendered: function onRendered() {
                if (this._allDatasetsEmpty()) {
                    this._hide();
                } else {
                    this.isOpen() && this._show();
                }
                return s._onRendered.apply(this, [].slice.call(arguments, 0));
            },
            _onCleared: function onCleared() {
                if (this._allDatasetsEmpty()) {
                    this._hide();
                } else {
                    this.isOpen() && this._show();
                }
                return s._onCleared.apply(this, [].slice.call(arguments, 0));
            },
            setLanguageDirection: function setLanguageDirection(dir) {
                this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl);
                return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0));
            },
            _hide: function hide() {
                this.$node.hide();
            },
            _show: function show() {
                this.$node.css("display", "block");
            }
        });
        return DefaultMenu;
    }();
    var Typeahead = function() {
        "use strict";
        function Typeahead(o, www) {
            var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged;
            o = o || {};
            if (!o.input) {
                $.error("missing input");
            }
            if (!o.menu) {
                $.error("missing menu");
            }
            if (!o.eventBus) {
                $.error("missing event bus");
            }
            www.mixin(this);
            this.eventBus = o.eventBus;
            this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;
            this.input = o.input;
            this.menu = o.menu;
            this.enabled = true;
            this.active = false;
            this.input.hasFocus() && this.activate();
            this.dir = this.input.getLangDir();
            this._hacks();
            this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this);
            onFocused = c(this, "activate", "open", "_onFocused");
            onBlurred = c(this, "deactivate", "_onBlurred");
            onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed");
            onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed");
            onEscKeyed = c(this, "isActive", "_onEscKeyed");
            onUpKeyed = c(this, "isActive", "open", "_onUpKeyed");
            onDownKeyed = c(this, "isActive", "open", "_onDownKeyed");
            onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed");
            onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed");
            onQueryChanged = c(this, "_openIfActive", "_onQueryChanged");
            onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged");
            this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this);
        }
        _.mixin(Typeahead.prototype, {
            _hacks: function hacks() {
                var $input, $menu;
                $input = this.input.$input || $("<div>");
                $menu = this.menu.$node || $("<div>");
                $input.on("blur.tt", function($e) {
                    var active, isActive, hasActive;
                    active = document.activeElement;
                    isActive = $menu.is(active);
                    hasActive = $menu.has(active).length > 0;
                    if (_.isMsie() && (isActive || hasActive)) {
                        $e.preventDefault();
                        $e.stopImmediatePropagation();
                        _.defer(function() {
                            $input.focus();
                        });
                    }
                });
                $menu.on("mousedown.tt", function($e) {
                    $e.preventDefault();
                });
            },
            _onSelectableClicked: function onSelectableClicked(type, $el) {
                this.select($el);
            },
            _onDatasetCleared: function onDatasetCleared() {
                this._updateHint();
            },
            _onDatasetRendered: function onDatasetRendered(type, dataset, suggestions, async) {
                this._updateHint();
                this.eventBus.trigger("render", suggestions, async, dataset);
            },
            _onAsyncRequested: function onAsyncRequested(type, dataset, query) {
                this.eventBus.trigger("asyncrequest", query, dataset);
            },
            _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) {
                this.eventBus.trigger("asynccancel", query, dataset);
            },
            _onAsyncReceived: function onAsyncReceived(type, dataset, query) {
                this.eventBus.trigger("asyncreceive", query, dataset);
            },
            _onFocused: function onFocused() {
                this._minLengthMet() && this.menu.update(this.input.getQuery());
            },
            _onBlurred: function onBlurred() {
                if (this.input.hasQueryChangedSinceLastFocus()) {
                    this.eventBus.trigger("change", this.input.getQuery());
                }
            },
            _onEnterKeyed: function onEnterKeyed(type, $e) {
                var $selectable;
                if ($selectable = this.menu.getActiveSelectable()) {
                    this.select($selectable) && $e.preventDefault();
                }
            },
            _onTabKeyed: function onTabKeyed(type, $e) {
                var $selectable;
                if ($selectable = this.menu.getActiveSelectable()) {
                    this.select($selectable) && $e.preventDefault();
                } else if ($selectable = this.menu.getTopSelectable()) {
                    this.autocomplete($selectable) && $e.preventDefault();
                }
            },
            _onEscKeyed: function onEscKeyed() {
                this.close();
            },
            _onUpKeyed: function onUpKeyed() {
                this.moveCursor(-1);
            },
            _onDownKeyed: function onDownKeyed() {
                this.moveCursor(+1);
            },
            _onLeftKeyed: function onLeftKeyed() {
                if (this.dir === "rtl" && this.input.isCursorAtEnd()) {
                    this.autocomplete(this.menu.getTopSelectable());
                }
            },
            _onRightKeyed: function onRightKeyed() {
                if (this.dir === "ltr" && this.input.isCursorAtEnd()) {
                    this.autocomplete(this.menu.getTopSelectable());
                }
            },
            _onQueryChanged: function onQueryChanged(e, query) {
                this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty();
            },
            _onWhitespaceChanged: function onWhitespaceChanged() {
                this._updateHint();
            },
            _onLangDirChanged: function onLangDirChanged(e, dir) {
                if (this.dir !== dir) {
                    this.dir = dir;
                    this.menu.setLanguageDirection(dir);
                }
            },
            _openIfActive: function openIfActive() {
                this.isActive() && this.open();
            },
            _minLengthMet: function minLengthMet(query) {
                query = _.isString(query) ? query : this.input.getQuery() || "";
                return query.length >= this.minLength;
            },
            _updateHint: function updateHint() {
                var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match;
                $selectable = this.menu.getTopSelectable();
                data = this.menu.getSelectableData($selectable);
                val = this.input.getInputValue();
                if (data && !_.isBlankString(val) && !this.input.hasOverflow()) {
                    query = Input.normalizeQuery(val);
                    escapedQuery = _.escapeRegExChars(query);
                    frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i");
                    match = frontMatchRegEx.exec(data.val);
                    match && this.input.setHint(val + match[1]);
                } else {
                    this.input.clearHint();
                }
            },
            isEnabled: function isEnabled() {
                return this.enabled;
            },
            enable: function enable() {
                this.enabled = true;
            },
            disable: function disable() {
                this.enabled = false;
            },
            isActive: function isActive() {
                return this.active;
            },
            activate: function activate() {
                if (this.isActive()) {
                    return true;
                } else if (!this.isEnabled() || this.eventBus.before("active")) {
                    return false;
                } else {
                    this.active = true;
                    this.eventBus.trigger("active");
                    return true;
                }
            },
            deactivate: function deactivate() {
                if (!this.isActive()) {
                    return true;
                } else if (this.eventBus.before("idle")) {
                    return false;
                } else {
                    this.active = false;
                    this.close();
                    this.eventBus.trigger("idle");
                    return true;
                }
            },
            isOpen: function isOpen() {
                return this.menu.isOpen();
            },
            open: function open() {
                if (!this.isOpen() && !this.eventBus.before("open")) {
                    this.menu.open();
                    this._updateHint();
                    this.eventBus.trigger("open");
                }
                return this.isOpen();
            },
            close: function close() {
                if (this.isOpen() && !this.eventBus.before("close")) {
                    this.menu.close();
                    this.input.clearHint();
                    this.input.resetInputValue();
                    this.eventBus.trigger("close");
                }
                return !this.isOpen();
            },
            setVal: function setVal(val) {
                this.input.setQuery(_.toStr(val));
            },
            getVal: function getVal() {
                return this.input.getQuery();
            },
            select: function select($selectable) {
                var data = this.menu.getSelectableData($selectable);
                if (data && !this.eventBus.before("select", data.obj)) {
                    this.input.setQuery(data.val, true);
                    this.eventBus.trigger("select", data.obj);
                    this.close();
                    return true;
                }
                return false;
            },
            autocomplete: function autocomplete($selectable) {
                var query, data, isValid;
                query = this.input.getQuery();
                data = this.menu.getSelectableData($selectable);
                isValid = data && query !== data.val;
                if (isValid && !this.eventBus.before("autocomplete", data.obj)) {
                    this.input.setQuery(data.val);
                    this.eventBus.trigger("autocomplete", data.obj);
                    return true;
                }
                return false;
            },
            moveCursor: function moveCursor(delta) {
                var query, $candidate, data, payload, cancelMove;
                query = this.input.getQuery();
                $candidate = this.menu.selectableRelativeToCursor(delta);
                data = this.menu.getSelectableData($candidate);
                payload = data ? data.obj : null;
                cancelMove = this._minLengthMet() && this.menu.update(query);
                if (!cancelMove && !this.eventBus.before("cursorchange", payload)) {
                    this.menu.setCursor($candidate);
                    if (data) {
                        this.input.setInputValue(data.val);
                    } else {
                        this.input.resetInputValue();
                        this._updateHint();
                    }
                    this.eventBus.trigger("cursorchange", payload);
                    return true;
                }
                return false;
            },
            destroy: function destroy() {
                this.input.destroy();
                this.menu.destroy();
            }
        });
        return Typeahead;
        function c(ctx) {
            var methods = [].slice.call(arguments, 1);
            return function() {
                var args = [].slice.call(arguments);
                _.each(methods, function(method) {
                    return ctx[method].apply(ctx, args);
                });
            };
        }
    }();
    (function() {
        "use strict";
        var old, keys, methods;
        old = $.fn.typeahead;
        keys = {
            www: "tt-www",
            attrs: "tt-attrs",
            typeahead: "tt-typeahead"
        };
        methods = {
            initialize: function initialize(o, datasets) {
                var www;
                datasets = Array.isArray(datasets) ? datasets : [].slice.call(arguments, 1);
                o = o || {};
                www = WWW(o.classNames);
                return this.each(attach);
                function attach() {
                    var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, typeahead, MenuConstructor;
                    _.each(datasets, function(d) {
                        d.highlight = !!o.highlight;
                    });
                    $input = $(this);
                    $wrapper = $(www.html.wrapper);
                    $hint = $elOrNull(o.hint);
                    $menu = $elOrNull(o.menu);
                    defaultHint = o.hint !== false && !$hint;
                    defaultMenu = o.menu !== false && !$menu;
                    defaultHint && ($hint = buildHintFromInput($input, www));
                    defaultMenu && ($menu = $(www.html.menu).css(www.css.menu));
                    $hint && $hint.val("");
                    $input = prepInput($input, www);
                    if (defaultHint || defaultMenu) {
                        $wrapper.css(www.css.wrapper);
                        $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint);
                        $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null);
                    }
                    MenuConstructor = defaultMenu ? DefaultMenu : Menu;
                    eventBus = new EventBus({
                        el: $input
                    });
                    input = new Input({
                        hint: $hint,
                        input: $input
                    }, www);
                    menu = new MenuConstructor({
                        node: $menu,
                        datasets: datasets
                    }, www);
                    typeahead = new Typeahead({
                        input: input,
                        menu: menu,
                        eventBus: eventBus,
                        minLength: o.minLength
                    }, www);
                    $input.data(keys.www, www);
                    $input.data(keys.typeahead, typeahead);
                }
            },
            isEnabled: function isEnabled() {
                var enabled;
                ttEach(this.first(), function(t) {
                    enabled = t.isEnabled();
                });
                return enabled;
            },
            enable: function enable() {
                ttEach(this, function(t) {
                    t.enable();
                });
                return this;
            },
            disable: function disable() {
                ttEach(this, function(t) {
                    t.disable();
                });
                return this;
            },
            isActive: function isActive() {
                var active;
                ttEach(this.first(), function(t) {
                    active = t.isActive();
                });
                return active;
            },
            activate: function activate() {
                ttEach(this, function(t) {
                    t.activate();
                });
                return this;
            },
            deactivate: function deactivate() {
                ttEach(this, function(t) {
                    t.deactivate();
                });
                return this;
            },
            isOpen: function isOpen() {
                var open;
                ttEach(this.first(), function(t) {
                    open = t.isOpen();
                });
                return open;
            },
            open: function open() {
                ttEach(this, function(t) {
                    t.open();
                });
                return this;
            },
            close: function close() {
                ttEach(this, function(t) {
                    t.close();
                });
                return this;
            },
            select: function select(el) {
                var success = false, $el = $(el);
                ttEach(this.first(), function(t) {
                    success = t.select($el);
                });
                return success;
            },
            autocomplete: function autocomplete(el) {
                var success = false, $el = $(el);
                ttEach(this.first(), function(t) {
                    success = t.autocomplete($el);
                });
                return success;
            },
            moveCursor: function moveCursoe(delta) {
                var success = false;
                ttEach(this.first(), function(t) {
                    success = t.moveCursor(delta);
                });
                return success;
            },
            val: function val(newVal) {
                var query;
                if (!arguments.length) {
                    ttEach(this.first(), function(t) {
                        query = t.getVal();
                    });
                    return query;
                } else {
                    ttEach(this, function(t) {
                        t.setVal(newVal);
                    });
                    return this;
                }
            },
            destroy: function destroy() {
                ttEach(this, function(typeahead, $input) {
                    revert($input);
                    typeahead.destroy();
                });
                return this;
            }
        };
        $.fn.typeahead = function(method) {
            if (methods[method]) {
                return methods[method].apply(this, [].slice.call(arguments, 1));
            } else {
                return methods.initialize.apply(this, arguments);
            }
        };
        $.fn.typeahead.noConflict = function noConflict() {
            $.fn.typeahead = old;
            return this;
        };
        function ttEach($els, fn) {
            $els.each(function() {
                var $input = $(this), typeahead;
                (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input);
            });
        }
        function buildHintFromInput($input, www) {
            return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input))
                .prop("readonly", true).removeAttr("id name placeholder").prop("required", false)
                .attr({
                    autocomplete: "off",
                    spellcheck: "false",
                    tabindex: -1
                });
        }
        function prepInput($input, www) {
            $input.data(keys.attrs, {
                dir: $input.attr("dir"),
                autocomplete: $input.attr("autocomplete"),
                spellcheck: $input.attr("spellcheck"),
                style: $input.attr("style")
            });
            $input.addClass(www.classes.input).attr({
                autocomplete: "off",
                spellcheck: false
            });
            try {
                !$input.attr("dir") && $input.attr("dir", "auto");
            } catch (e) {}
            return $input;
        }
        function getBackgroundStyles($el) {
            return {
                backgroundAttachment: $el.css("background-attachment"),
                backgroundClip: $el.css("background-clip"),
                backgroundColor: $el.css("background-color"),
                backgroundImage: $el.css("background-image"),
                backgroundOrigin: $el.css("background-origin"),
                backgroundPosition: $el.css("background-position"),
                backgroundRepeat: $el.css("background-repeat"),
                backgroundSize: $el.css("background-size")
            };
        }
        function revert($input) {
            var www, $wrapper;
            www = $input.data(keys.www);
            $wrapper = $input.parent().filter(www.selectors.wrapper);
            _.each($input.data(keys.attrs), function(val, key) {
                _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val);
            });
            $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input);
            if ($wrapper.length) {
                $input.detach().insertAfter($wrapper);
                $wrapper.remove();
            }
        }
        function $elOrNull(obj) {
            var isValid, $el;
            isValid = _.isJQuery(obj) || _.isElement(obj);
            $el = isValid ? $(obj).first() : [];
            return $el.length ? $el : null;
        }
    })();
});
/*
 picturefill - v3.0.2 - 2016-02-12
 https://scottjehl.github.io/picturefill/
 Copyright (c) 2016 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT
 Gecko-Picture - v1.0
 https://github.com/scottjehl/picturefill/tree/3.0/src/plugins/gecko-picture
 Firefox's early picture implementation (prior to FF41) is static and does
 not react to viewport changes. This tiny module fixes this.
 Picturefill - v3.0.2
 http://scottjehl.github.io/picturefill
 Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt;
  License: MIT
*/
(function(g){var f=navigator.userAgent;g.HTMLPictureElement&&/ecko/.test(f)&&f.match(/rv\:(\d+)/)&&45>RegExp.$1&&addEventListener("resize",function(){var f,w=document.createElement("source"),K=function(p){var f=p.parentNode;if("PICTURE"===f.nodeName.toUpperCase()){var g=w.cloneNode();f.insertBefore(g,f.firstElementChild);setTimeout(function(){f.removeChild(g)})}else if(!p._pfLastSize||p.offsetWidth>p._pfLastSize){p._pfLastSize=p.offsetWidth;var b=p.sizes;p.sizes+=",100vw";setTimeout(function(){p.sizes=
b})}},L=function(){var f,g=document.querySelectorAll("picture > img, img[srcset][sizes]");for(f=0;f<g.length;f++)K(g[f])},y=function(){clearTimeout(f);f=setTimeout(L,99)},A=g.matchMedia&&matchMedia("(orientation: landscape)"),E=function(){y();A&&A.addListener&&A.addListener(y)};w.srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";/^[c|i]|d$/.test(document.readyState||"")?E():document.addEventListener("DOMContentLoaded",E);return y}())})(window);
(function(g,f,J){function w(a){return" "===a||"\t"===a||"\n"===a||"\f"===a||"\r"===a}function K(a,b){var d=new g.Image;d.onerror=function(){t[a]=!1;q()};d.onload=function(){t[a]=1===d.width;q()};d.src=b;return"pending"}function L(a,b){return a.res-b.res}function y(a,c){var d;if(a&&c){var e=b.parseSet(c);a=b.makeUrl(a);for(d=0;d<e.length;d++)if(a===b.makeUrl(e[d].url)){var m=e[d];break}}return m}function A(a,b){function d(b){if(b=b.exec(a.substring(g)))return b=b[0],g+=b.length,b}function e(){var a=
!1,e,d,c,m,h={};for(m=0;m<f.length;m++){var k=f[m];var l=k[k.length-1];k=k.substring(0,k.length-1);var g=parseInt(k,10);var M=parseFloat(k);if(U.test(k)&&"w"===l){if(e||d)a=!0;0===g?a=!0:e=g}else if(aa.test(k)&&"x"===l){if(e||d||c)a=!0;0>M?a=!0:d=M}else if(U.test(k)&&"h"===l){if(c||d)a=!0;0===g?a=!0:c=g}else a=!0}a||(h.url=B,e&&(h.w=e),d&&(h.d=d),c&&(h.h=c),c||d||e||(h.d=1),1===h.d&&(b.has1x=!0),h.set=b,r.push(h))}for(var c=a.length,B,f,h,k,l,g=0,r=[];;){d(ba);if(g>=c)return r;B=d(ca);f=[];if(","===
B.slice(-1))B=B.replace(da,""),e();else for(d(ea),h="",k="in descriptor";;){l=a.charAt(g);if("in descriptor"===k)if(w(l))h&&(f.push(h),h="",k="after descriptor");else if(","===l){g+=1;h&&f.push(h);e();break}else if("("===l)h+=l,k="in parens";else if(""===l){h&&f.push(h);e();break}else h+=l;else if("in parens"===k)if(")"===l)h+=l,k="in descriptor";else if(""===l){f.push(h);e();break}else h+=l;else if("after descriptor"===k&&!w(l))if(""===l){e();break}else k="in descriptor",--g;g+=1}}}function E(a){function c(a){return d.test(a)&&
0<=parseFloat(a)||e.test(a)||"0"===a||"-0"===a||"+0"===a?!0:!1}var d=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,e=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;var m=function(a){function b(){c&&(m.push(c),c="")}function d(){m[0]&&(h.push(m),m=[])}for(var e,c="",m=[],h=[],g=0,f=0,k=!1;;){e=a.charAt(f);if(""===e)return b(),d(),h;if(k)"*"===e&&"/"===a[f+1]?(k=!1,f+=2,b()):f+=1;else{if(w(e))if(a.charAt(f-1)&&w(a.charAt(f-1))||!c){f+=1;continue}else if(0===
g){b();f+=1;continue}else e=" ";else if("("===e)g+=1;else if(")"===e)--g;else if(","===e){b();d();f+=1;continue}else if("/"===e&&"*"===a.charAt(f+1)){k=!0;f+=2;continue}c+=e;f+=1}}}(a);var f=m.length;for(a=0;a<f;a++){var g=m[a];var h=g[g.length-1];if(c(h)){g.pop();if(0===g.length)return h;g=g.join(" ");if(b.matchesMedia(g))return h}}return"100vw"}f.createElement("picture");var p,T,D,b={},N=!1,F=function(){},v=f.createElement("img"),O=v.getAttribute,V=v.setAttribute,W=v.removeAttribute,u=f.documentElement,
t={},G={algorithm:""},x=navigator.userAgent,fa=/rident/.test(x)||/ecko/.test(x)&&x.match(/rv\:(\d+)/)&&35<RegExp.$1,P="currentSrc",ha=/\s+\+?\d+(e\d+)?w/,ia=/(\([^)]+\))?\s*(.+)/;x=g.picturefillCFG;var H=!0,z={},I={},C=g.devicePixelRatio,n={px:1,"in":96},X=f.createElement("a"),Q=!1,ea=/^[ \t\n\r\u000c]+/,ba=/^[, \t\n\r\u000c]+/,ca=/^[^ \t\n\r\u000c]+/,da=/[,]+$/,U=/^\d+$/,aa=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,Y=function(a,b,d,e){a.addEventListener?a.addEventListener(b,d,e||!1):a.attachEvent&&
a.attachEvent("on"+b,d)},R=function(a){var b={};return function(d){d in b||(b[d]=a(d));return b[d]}},Z=function(){var a=/^([\d\.]+)(em|vw|px)$/,b=function(){for(var a=arguments,b=0,d=a[0];++b in a;)d=d.replace(a[b],a[++b]);return d},d=R(function(a){return"return "+b((a||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/ig,"")+";"});return function(b,
c){var e;if(!(b in z))if(z[b]=!1,c&&(e=b.match(a)))z[b]=e[1]*n[e[2]];else try{z[b]=(new Function("e",d(b)))(n)}catch(M){}return z[b]}}(),S=function(a,c){a.w?(a.cWidth=b.calcListLength(c||"100vw"),a.res=a.w/a.cWidth):a.res=a.d;return a},q=function(a){if(N){var c,d,e=a||{};e.elements&&1===e.elements.nodeType&&("IMG"===e.elements.nodeName.toUpperCase()?e.elements=[e.elements]:(e.context=e.elements,e.elements=null));a=e.elements||b.qsa(e.context||f,e.reevaluate||e.reselect?b.sel:b.selShort);if(d=a.length){b.setupRun(e);
Q=!0;for(c=0;c<d;c++)b.fillImg(a[c],e);b.teardownRun(e)}}};P in v||(P="src");t["image/jpeg"]=!0;t["image/gif"]=!0;t["image/png"]=!0;t["image/svg+xml"]=f.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1");b.ns=("pf"+(new Date).getTime()).substr(0,9);b.supSrcset="srcset"in v;b.supSizes="sizes"in v;b.supPicture=!!g.HTMLPictureElement;b.supSrcset&&b.supPicture&&!b.supSizes&&function(a){v.srcset="data:,a";a.src="data:,a";b.supSrcset=v.complete===a.complete;b.supPicture=b.supSrcset&&
b.supPicture}(f.createElement("img"));b.supSrcset&&!b.supSizes?function(){var a=f.createElement("img"),c=function(){2===a.width&&(b.supSizes=!0);T=b.supSrcset&&!b.supSizes;N=!0;setTimeout(q)};a.onload=c;a.onerror=c;a.setAttribute("sizes","9px");a.srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== 1w,data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw== 9w";a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}():
N=!0;b.selShort="picture>img,img[srcset]";b.sel=b.selShort;b.cfg=G;b.DPR=C||1;b.u=n;b.types=t;b.setSize=F;b.makeUrl=R(function(a){X.href=a;return X.href});b.qsa=function(a,b){return"querySelector"in a?a.querySelectorAll(b):[]};b.matchesMedia=function(){g.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?b.matchesMedia=function(a){return!a||matchMedia(a).matches}:b.matchesMedia=b.mMQ;return b.matchesMedia.apply(this,arguments)};b.mMQ=function(a){return a?Z(a):!0};b.calcLength=function(a){a=
Z(a,!0)||!1;0>a&&(a=!1);return a};b.supportsType=function(a){return a?t[a]:!0};b.parseSize=R(function(a){a=(a||"").match(ia);return{media:a&&a[1],length:a&&a[2]}});b.parseSet=function(a){a.cands||(a.cands=A(a.srcset,a));return a.cands};b.getEmValue=function(){var a;if(!p&&(a=f.body)){var b=f.createElement("div"),d=u.style.cssText,e=a.style.cssText;b.style.cssText="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)";
u.style.cssText="font-size:100%!important;";a.style.cssText="font-size:100%!important;";a.appendChild(b);p=b.offsetWidth;a.removeChild(b);p=parseFloat(p,10);u.style.cssText=d;a.style.cssText=e}return p||16};b.calcListLength=function(a){if(!(a in I)||G.uT){var c=b.calcLength(E(a));I[a]=c?c:n.width}return I[a]};b.setRes=function(a){if(a){var c=b.parseSet(a);for(var d=0,e=c.length;d<e;d++)S(c[d],a.sizes)}return c};b.setRes.res=S;b.applySetCandidate=function(a,c){if(a.length){var d,e,m=c[b.ns];var f=
b.DPR;var g=m.curSrc||c[P];if(!(d=m.curCan)){d=g;var h=a[0].set;!h&&d&&(h=(h=c[b.ns].sets)&&h[h.length-1]);if(h=y(d,h))d=b.makeUrl(d),c[b.ns].curSrc=d,c[b.ns].curCan=h,h.res||S(h,h.set.sizes);d=h}if(d&&d.set===a[0].set){var k=fa&&!c.complete&&d.res-.1>f;k||(d.cached=!0,d.res>=f&&(e=d))}if(!e){a.sort(L);var l=a.length;e=a[l-1];for(h=0;h<l;h++)if(d=a[h],d.res>=f){e=h-1;if(k=a[e]&&(k||g!==b.makeUrl(d.url)))h=a[e].res,l=d.res,"saveData"===G.algorithm?2.7<h?k=f+1:(k=Math.pow(h-.6,1.5),l=(l-f)*k,a[e].cached&&
(l+=.1*k),k=h+l):k=1<f?Math.sqrt(h*l):h,k=k>f;e=k?a[e]:d;break}}e&&(f=b.makeUrl(e.url),m.curSrc=f,m.curCan=e,f!==g&&b.setSrc(c,e),b.setSize(c))}};b.setSrc=function(a,b){a.src=b.url;if("image/svg+xml"===b.set.type){var d=a.style.width;a.style.width=a.offsetWidth+1+"px";a.offsetWidth+1&&(a.style.width=d)}};b.getSet=function(a){var c,d=!1,e=a[b.ns].sets;for(a=0;a<e.length&&!d;a++){var f=e[a];if(f.srcset&&b.matchesMedia(f.media)&&(c=b.supportsType(f.type))){"pending"===c&&(f=c);d=f;break}}return d};b.parseSets=
function(a,f,d){var e=f&&"PICTURE"===f.nodeName.toUpperCase(),c=a[b.ns];if(c.src===J||d.src)c.src=O.call(a,"src"),c.src?V.call(a,"data-pfsrc",c.src):W.call(a,"data-pfsrc");if(c.srcset===J||d.srcset||!b.supSrcset||a.srcset){var g=O.call(a,"srcset");c.srcset=g;var p=!0}c.sets=[];if(e){c.pic=!0;d=c.sets;var h,k,l=f.getElementsByTagName("source");f=0;for(h=l.length;f<h;f++){var n=l[f];n[b.ns]=!0;(k=n.getAttribute("srcset"))&&d.push({srcset:k,media:n.getAttribute("media"),type:n.getAttribute("type"),sizes:n.getAttribute("sizes")})}}if(c.srcset){var r=
{srcset:c.srcset,sizes:O.call(a,"sizes")};c.sets.push(r);var q=(T||c.src)&&ha.test(c.srcset||"");q||!c.src||y(c.src,r)||r.has1x||(r.srcset+=", "+c.src,r.cands.push({url:c.src,d:1,set:r}))}else c.src&&c.sets.push({srcset:c.src,sizes:null});c.curCan=null;c.curSrc=J;c.supported=!(e||r&&!b.supSrcset||q&&!b.supSizes);p&&b.supSrcset&&!c.supported&&(g?(V.call(a,"data-pfsrcset",g),a.srcset=""):W.call(a,"data-pfsrcset"));c.supported&&!c.srcset&&(!c.src&&a.src||a.src!==b.makeUrl(c.src))&&(null===c.src?a.removeAttribute("src"):
a.src=c.src);c.parsed=!0};b.fillImg=function(a,c){var d=c.reselect||c.reevaluate;a[b.ns]||(a[b.ns]={});var e=a[b.ns];if(d||e.evaled!==D)e.parsed&&!c.reevaluate||b.parseSets(a,a.parentNode,c),e.supported?e.evaled=D:(d=b.getSet(a),e=!1,"pending"!==d&&(e=D,d&&(d=b.setRes(d),b.applySetCandidate(d,a))),a[b.ns].evaled=e)};b.setupRun=function(){if(!Q||H||C!==g.devicePixelRatio)H=!1,C=g.devicePixelRatio,z={},I={},b.DPR=C||1,n.width=Math.max(g.innerWidth||0,u.clientWidth),n.height=Math.max(g.innerHeight||
0,u.clientHeight),n.vw=n.width/100,n.vh=n.height/100,D=[n.height,n.width,C].join("-"),n.em=b.getEmValue(),n.rem=n.em};b.supPicture?(q=F,b.fillImg=F):function(){var a,c=g.attachEvent?/d$|^c/:/d$|^c|^i/,d=function(){var g=f.readyState||"";e=setTimeout(d,"loading"===g?200:999);f.body&&(b.fillImgs(),(a=a||c.test(g))&&clearTimeout(e))},e=setTimeout(d,f.body?9:99),m=u.clientHeight;Y(g,"resize",function(a,b){var c,d,e=function(){var f=new Date-d;f<b?c=setTimeout(e,b-f):(c=null,a())};return function(){d=
new Date;c||(c=setTimeout(e,b))}}(function(){H=Math.max(g.innerWidth||0,u.clientWidth)!==n.width||u.clientHeight!==m;m=u.clientHeight;H&&b.fillImgs()},99));Y(f,"readystatechange",d)}();b.picturefill=q;b.fillImgs=q;b.teardownRun=F;q._=b;for(g.picturefillCFG={pf:b,push:function(a){var c=a.shift();"function"===typeof b[c]?b[c].apply(b,a):(G[c]=a[0],Q&&b.fillImgs({reselect:!0}))}};x&&x.length;)g.picturefillCFG.push(x.shift());g.picturefill=q;"object"===typeof module&&"object"===typeof module.exports?
module.exports=q:"function"===typeof define&&define.amd&&define("picturefill",[],function(){return q});b.supPicture||(t["image/webp"]=K("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))})(window,document);
/*! =======================================================
                      VERSION  11.0.2              
========================================================= */
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},windowIsDefined="object"===("undefined"==typeof window?"undefined":_typeof(window));!function(a){if("function"==typeof define&&define.amd)define('bootstrapslider',["jquery"],a);else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports){var b;try{b=require("jquery")}catch(c){b=null}module.exports=a(b)}else window&&(window.Slider=a(window.jQuery))}(function(a){var b="slider",c="bootstrapSlider";windowIsDefined&&!window.console&&(window.console={}),windowIsDefined&&!window.console.log&&(window.console.log=function(){}),windowIsDefined&&!window.console.warn&&(window.console.warn=function(){});var d;return function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l&&l!==k)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}var m=this.map(function(){var d=a.data(this,b);return d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d)),a(this)});return 1===m.length?m[0]:m}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;c(a)}(a),function(a){function e(b,c){function d(a,b){var c="data-slider-"+b.replace(/_/g,"-"),d=a.getAttribute(c);try{return JSON.parse(d)}catch(e){return d}}this._state={value:null,enabled:null,offset:null,size:null,percentage:null,inDrag:!1,over:!1,tickIndex:null},this.ticksCallbackMap={},this.handleCallbackMap={},"string"==typeof b?this.element=document.querySelector(b):b instanceof HTMLElement&&(this.element=b),c=c?c:{};for(var e=Object.keys(this.defaultOptions),f=c.hasOwnProperty("min"),g=c.hasOwnProperty("max"),i=0;i<e.length;i++){var j=e[i],k=c[j];k="undefined"!=typeof k?k:d(this.element,j),k=null!==k?k:this.defaultOptions[j],this.options||(this.options={}),this.options[j]=k}if(this.ticksAreValid=Array.isArray(this.options.ticks)&&this.options.ticks.length>0,this.ticksAreValid||(this.options.lock_to_ticks=!1),"auto"===this.options.rtl){var l=window.getComputedStyle(this.element);null!=l?this.options.rtl="rtl"===l.direction:this.options.rtl="rtl"===this.element.style.direction}"vertical"!==this.options.orientation||"top"!==this.options.tooltip_position&&"bottom"!==this.options.tooltip_position?"horizontal"!==this.options.orientation||"left"!==this.options.tooltip_position&&"right"!==this.options.tooltip_position||(this.options.tooltip_position="top"):this.options.rtl?this.options.tooltip_position="left":this.options.tooltip_position="right";var m,n,o,p,q,r=this.element.style.width,s=!1,t=this.element.parentNode;if(this.sliderElem)s=!0;else{this.sliderElem=document.createElement("div"),this.sliderElem.className="slider";var u=document.createElement("div");u.className="slider-track",n=document.createElement("div"),n.className="slider-track-low",m=document.createElement("div"),m.className="slider-selection",o=document.createElement("div"),o.className="slider-track-high",p=document.createElement("div"),p.className="slider-handle min-slider-handle",p.setAttribute("role","slider"),p.setAttribute("aria-valuemin",this.options.min),p.setAttribute("aria-valuemax",this.options.max),q=document.createElement("div"),q.className="slider-handle max-slider-handle",q.setAttribute("role","slider"),q.setAttribute("aria-valuemin",this.options.min),q.setAttribute("aria-valuemax",this.options.max),u.appendChild(n),u.appendChild(m),u.appendChild(o),this.rangeHighlightElements=[];var v=this.options.rangeHighlights;if(Array.isArray(v)&&v.length>0)for(var w=0;w<v.length;w++){var x=document.createElement("div"),y=v[w]["class"]||"";x.className="slider-rangeHighlight slider-selection "+y,this.rangeHighlightElements.push(x),u.appendChild(x)}var z=Array.isArray(this.options.labelledby);if(z&&this.options.labelledby[0]&&p.setAttribute("aria-labelledby",this.options.labelledby[0]),z&&this.options.labelledby[1]&&q.setAttribute("aria-labelledby",this.options.labelledby[1]),!z&&this.options.labelledby&&(p.setAttribute("aria-labelledby",this.options.labelledby),q.setAttribute("aria-labelledby",this.options.labelledby)),this.ticks=[],Array.isArray(this.options.ticks)&&this.options.ticks.length>0){for(this.ticksContainer=document.createElement("div"),this.ticksContainer.className="slider-tick-container",i=0;i<this.options.ticks.length;i++){var A=document.createElement("div");if(A.className="slider-tick",this.options.ticks_tooltip){var B=this._addTickListener(),C=B.addMouseEnter(this,A,i),D=B.addMouseLeave(this,A);this.ticksCallbackMap[i]={mouseEnter:C,mouseLeave:D}}this.ticks.push(A),this.ticksContainer.appendChild(A)}m.className+=" tick-slider-selection"}if(this.tickLabels=[],Array.isArray(this.options.ticks_labels)&&this.options.ticks_labels.length>0)for(this.tickLabelContainer=document.createElement("div"),this.tickLabelContainer.className="slider-tick-label-container",i=0;i<this.options.ticks_labels.length;i++){var E=document.createElement("div"),F=0===this.options.ticks_positions.length,G=this.options.reversed&&F?this.options.ticks_labels.length-(i+1):i;E.className="slider-tick-label",E.innerHTML=this.options.ticks_labels[G],this.tickLabels.push(E),this.tickLabelContainer.appendChild(E)}var H=function(a){var b=document.createElement("div");b.className="arrow";var c=document.createElement("div");c.className="tooltip-inner",a.appendChild(b),a.appendChild(c)},I=document.createElement("div");I.className="tooltip tooltip-main",I.setAttribute("role","presentation"),H(I);var J=document.createElement("div");J.className="tooltip tooltip-min",J.setAttribute("role","presentation"),H(J);var K=document.createElement("div");K.className="tooltip tooltip-max",K.setAttribute("role","presentation"),H(K),this.sliderElem.appendChild(u),this.sliderElem.appendChild(I),this.sliderElem.appendChild(J),this.sliderElem.appendChild(K),this.tickLabelContainer&&this.sliderElem.appendChild(this.tickLabelContainer),this.ticksContainer&&this.sliderElem.appendChild(this.ticksContainer),this.sliderElem.appendChild(p),this.sliderElem.appendChild(q),t.insertBefore(this.sliderElem,this.element),this.element.style.display="none"}if(a&&(this.$element=a(this.element),this.$sliderElem=a(this.sliderElem)),this.eventToCallbackMap={},this.sliderElem.id=this.options.id,this.touchCapable="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,this.touchX=0,this.touchY=0,this.tooltip=this.sliderElem.querySelector(".tooltip-main"),this.tooltipInner=this.tooltip.querySelector(".tooltip-inner"),this.tooltip_min=this.sliderElem.querySelector(".tooltip-min"),this.tooltipInner_min=this.tooltip_min.querySelector(".tooltip-inner"),this.tooltip_max=this.sliderElem.querySelector(".tooltip-max"),this.tooltipInner_max=this.tooltip_max.querySelector(".tooltip-inner"),h[this.options.scale]&&(this.options.scale=h[this.options.scale]),s===!0&&(this._removeClass(this.sliderElem,"slider-horizontal"),this._removeClass(this.sliderElem,"slider-vertical"),this._removeClass(this.sliderElem,"slider-rtl"),this._removeClass(this.tooltip,"hide"),this._removeClass(this.tooltip_min,"hide"),this._removeClass(this.tooltip_max,"hide"),["left","right","top","width","height"].forEach(function(a){this._removeProperty(this.trackLow,a),this._removeProperty(this.trackSelection,a),this._removeProperty(this.trackHigh,a)},this),[this.handle1,this.handle2].forEach(function(a){this._removeProperty(a,"left"),this._removeProperty(a,"right"),this._removeProperty(a,"top")},this),[this.tooltip,this.tooltip_min,this.tooltip_max].forEach(function(a){this._removeProperty(a,"bs-tooltip-left"),this._removeProperty(a,"bs-tooltip-right"),this._removeProperty(a,"bs-tooltip-top"),this._removeClass(a,"bs-tooltip-right"),this._removeClass(a,"bs-tooltip-left"),this._removeClass(a,"bs-tooltip-top")},this)),"vertical"===this.options.orientation?(this._addClass(this.sliderElem,"slider-vertical"),this.stylePos="top",this.mousePos="pageY",this.sizePos="offsetHeight"):(this._addClass(this.sliderElem,"slider-horizontal"),this.sliderElem.style.width=r,this.options.orientation="horizontal",this.options.rtl?this.stylePos="right":this.stylePos="left",this.mousePos="clientX",this.sizePos="offsetWidth"),this.options.rtl&&this._addClass(this.sliderElem,"slider-rtl"),this._setTooltipPosition(),Array.isArray(this.options.ticks)&&this.options.ticks.length>0&&(g||(this.options.max=Math.max.apply(Math,this.options.ticks)),f||(this.options.min=Math.min.apply(Math,this.options.ticks))),Array.isArray(this.options.value)?(this.options.range=!0,this._state.value=this.options.value):this.options.range?this._state.value=[this.options.value,this.options.max]:this._state.value=this.options.value,this.trackLow=n||this.trackLow,this.trackSelection=m||this.trackSelection,this.trackHigh=o||this.trackHigh,"none"===this.options.selection?(this._addClass(this.trackLow,"hide"),this._addClass(this.trackSelection,"hide"),this._addClass(this.trackHigh,"hide")):("after"===this.options.selection||"before"===this.options.selection)&&(this._removeClass(this.trackLow,"hide"),this._removeClass(this.trackSelection,"hide"),this._removeClass(this.trackHigh,"hide")),this.handle1=p||this.handle1,this.handle2=q||this.handle2,s===!0)for(this._removeClass(this.handle1,"round triangle"),this._removeClass(this.handle2,"round triangle hide"),i=0;i<this.ticks.length;i++)this._removeClass(this.ticks[i],"round triangle hide");var L=["round","triangle","custom"],M=-1!==L.indexOf(this.options.handle);if(M)for(this._addClass(this.handle1,this.options.handle),this._addClass(this.handle2,this.options.handle),i=0;i<this.ticks.length;i++)this._addClass(this.ticks[i],this.options.handle);if(this._state.offset=this._offset(this.sliderElem),this._state.size=this.sliderElem[this.sizePos],this.setValue(this._state.value),this.handle1Keydown=this._keydown.bind(this,0),this.handle1.addEventListener("keydown",this.handle1Keydown,!1),this.handle2Keydown=this._keydown.bind(this,1),this.handle2.addEventListener("keydown",this.handle2Keydown,!1),this.mousedown=this._mousedown.bind(this),this.touchstart=this._touchstart.bind(this),this.touchmove=this._touchmove.bind(this),this.touchCapable&&(this.sliderElem.addEventListener("touchstart",this.touchstart,!1),this.sliderElem.addEventListener("touchmove",this.touchmove,!1)),this.sliderElem.addEventListener("mousedown",this.mousedown,!1),this.resize=this._resize.bind(this),window.addEventListener("resize",this.resize,!1),"hide"===this.options.tooltip)this._addClass(this.tooltip,"hide"),this._addClass(this.tooltip_min,"hide"),this._addClass(this.tooltip_max,"hide");else if("always"===this.options.tooltip)this._showTooltip(),this._alwaysShowTooltip=!0;else{if(this.showTooltip=this._showTooltip.bind(this),this.hideTooltip=this._hideTooltip.bind(this),this.options.ticks_tooltip){var N=this._addTickListener(),O=N.addMouseEnter(this,this.handle1),P=N.addMouseLeave(this,this.handle1);this.handleCallbackMap.handle1={mouseEnter:O,mouseLeave:P},O=N.addMouseEnter(this,this.handle2),P=N.addMouseLeave(this,this.handle2),this.handleCallbackMap.handle2={mouseEnter:O,mouseLeave:P}}else this.sliderElem.addEventListener("mouseenter",this.showTooltip,!1),this.sliderElem.addEventListener("mouseleave",this.hideTooltip,!1),this.touchCapable&&(this.sliderElem.addEventListener("touchstart",this.showTooltip,!1),this.sliderElem.addEventListener("touchmove",this.showTooltip,!1),this.sliderElem.addEventListener("touchend",this.hideTooltip,!1));this.handle1.addEventListener("focus",this.showTooltip,!1),this.handle1.addEventListener("blur",this.hideTooltip,!1),this.handle2.addEventListener("focus",this.showTooltip,!1),this.handle2.addEventListener("blur",this.hideTooltip,!1),this.touchCapable&&(this.handle1.addEventListener("touchstart",this.showTooltip,!1),this.handle1.addEventListener("touchmove",this.showTooltip,!1),this.handle1.addEventListener("touchend",this.hideTooltip,!1),this.handle2.addEventListener("touchstart",this.showTooltip,!1),this.handle2.addEventListener("touchmove",this.showTooltip,!1),this.handle2.addEventListener("touchend",this.hideTooltip,!1))}this.options.enabled?this.enable():this.disable()}var f=void 0,g={formatInvalidInputErrorMsg:function(a){return"Invalid input value '"+a+"' passed in"},callingContextNotSliderInstance:"Calling context element does not have instance of Slider bound to it. Check your code to make sure the JQuery object returned from the call to the slider() initializer is calling the method"},h={linear:{getValue:function(a,b){return a<b.min?b.min:a>b.max?b.max:a},toValue:function(a){var b=a/100*(this.options.max-this.options.min),c=!0;if(this.options.ticks_positions.length>0){for(var d,e,f,g=0,i=1;i<this.options.ticks_positions.length;i++)if(a<=this.options.ticks_positions[i]){d=this.options.ticks[i-1],f=this.options.ticks_positions[i-1],e=this.options.ticks[i],g=this.options.ticks_positions[i];break}var j=(a-f)/(g-f);b=d+j*(e-d),c=!1}var k=c?this.options.min:0,l=k+Math.round(b/this.options.step)*this.options.step;return h.linear.getValue(l,this.options)},toPercentage:function(a){if(this.options.max===this.options.min)return 0;if(this.options.ticks_positions.length>0){for(var b,c,d,e=0,f=0;f<this.options.ticks.length;f++)if(a<=this.options.ticks[f]){b=f>0?this.options.ticks[f-1]:0,d=f>0?this.options.ticks_positions[f-1]:0,c=this.options.ticks[f],e=this.options.ticks_positions[f];break}if(f>0){var g=(a-b)/(c-b);return d+g*(e-d)}}return 100*(a-this.options.min)/(this.options.max-this.options.min)}},logarithmic:{toValue:function(a){var b=1-this.options.min,c=Math.log(this.options.min+b),d=Math.log(this.options.max+b),e=Math.exp(c+(d-c)*a/100)-b;return Math.round(e)===d?d:(e=this.options.min+Math.round((e-this.options.min)/this.options.step)*this.options.step,h.linear.getValue(e,this.options))},toPercentage:function(a){if(this.options.max===this.options.min)return 0;var b=1-this.options.min,c=Math.log(this.options.max+b),d=Math.log(this.options.min+b),e=Math.log(a+b);return 100*(e-d)/(c-d)}}};d=function(a,b){return e.call(this,a,b),this},d.prototype={_init:function(){},constructor:d,defaultOptions:{id:"",min:0,max:10,step:1,precision:0,orientation:"horizontal",value:5,range:!1,selection:"before",tooltip:"show",tooltip_split:!1,lock_to_ticks:!1,handle:"round",reversed:!1,rtl:"auto",enabled:!0,formatter:function(a){return Array.isArray(a)?a[0]+" : "+a[1]:a},natural_arrow_keys:!1,ticks:[],ticks_positions:[],ticks_labels:[],ticks_snap_bounds:0,ticks_tooltip:!1,scale:"linear",focus:!1,tooltip_position:null,labelledby:null,rangeHighlights:[]},getElement:function(){return this.sliderElem},getValue:function(){return this.options.range?this._state.value:this._state.value[0]},setValue:function(a,b,c){a||(a=0);var d=this.getValue();this._state.value=this._validateInputValue(a);var e=this._applyPrecision.bind(this);this.options.range?(this._state.value[0]=e(this._state.value[0]),this._state.value[1]=e(this._state.value[1]),this.ticksAreValid&&this.options.lock_to_ticks&&(this._state.value[0]=this.options.ticks[this._getClosestTickIndex(this._state.value[0])],this._state.value[1]=this.options.ticks[this._getClosestTickIndex(this._state.value[1])]),this._state.value[0]=Math.max(this.options.min,Math.min(this.options.max,this._state.value[0])),this._state.value[1]=Math.max(this.options.min,Math.min(this.options.max,this._state.value[1]))):(this._state.value=e(this._state.value),this.ticksAreValid&&this.options.lock_to_ticks&&(this._state.value=this.options.ticks[this._getClosestTickIndex(this._state.value)]),this._state.value=[Math.max(this.options.min,Math.min(this.options.max,this._state.value))],this._addClass(this.handle2,"hide"),"after"===this.options.selection?this._state.value[1]=this.options.max:this._state.value[1]=this.options.min),this._setTickIndex(),this.options.max>this.options.min?this._state.percentage=[this._toPercentage(this._state.value[0]),this._toPercentage(this._state.value[1]),100*this.options.step/(this.options.max-this.options.min)]:this._state.percentage=[0,0,100],this._layout();var f=this.options.range?this._state.value:this._state.value[0];this._setDataVal(f),b===!0&&this._trigger("slide",f);var g=!1;return g=Array.isArray(f)?d[0]!==f[0]||d[1]!==f[1]:d!==f,g&&c===!0&&this._trigger("change",{oldValue:d,newValue:f}),this},destroy:function(){this._removeSliderEventHandlers(),this.sliderElem.parentNode.removeChild(this.sliderElem),this.element.style.display="",this._cleanUpEventCallbacksMap(),this.element.removeAttribute("data"),a&&(this._unbindJQueryEventHandlers(),f===b&&this.$element.removeData(f),this.$element.removeData(c))},disable:function(){return this._state.enabled=!1,this.handle1.removeAttribute("tabindex"),this.handle2.removeAttribute("tabindex"),this._addClass(this.sliderElem,"slider-disabled"),this._trigger("slideDisabled"),this},enable:function(){return this._state.enabled=!0,this.handle1.setAttribute("tabindex",0),this.handle2.setAttribute("tabindex",0),this._removeClass(this.sliderElem,"slider-disabled"),this._trigger("slideEnabled"),this},toggle:function(){return this._state.enabled?this.disable():this.enable(),this},isEnabled:function(){return this._state.enabled},on:function(a,b){return this._bindNonQueryEventHandler(a,b),this},off:function(b,c){a?(this.$element.off(b,c),this.$sliderElem.off(b,c)):this._unbindNonQueryEventHandler(b,c)},getAttribute:function(a){return a?this.options[a]:this.options},setAttribute:function(a,b){return this.options[a]=b,this},refresh:function(d){var g=this.getValue();return this._removeSliderEventHandlers(),e.call(this,this.element,this.options),d&&d.useCurrentValue===!0&&this.setValue(g),a&&(f===b?(a.data(this.element,b,this),a.data(this.element,c,this)):a.data(this.element,c,this)),this},relayout:function(){return this._resize(),this},_removeTooltipListener:function(a,b){this.handle1.removeEventListener(a,b,!1),this.handle2.removeEventListener(a,b,!1)},_removeSliderEventHandlers:function(){if(this.handle1.removeEventListener("keydown",this.handle1Keydown,!1),this.handle2.removeEventListener("keydown",this.handle2Keydown,!1),this.options.ticks_tooltip){for(var a=this.ticksContainer.getElementsByClassName("slider-tick"),b=0;b<a.length;b++)a[b].removeEventListener("mouseenter",this.ticksCallbackMap[b].mouseEnter,!1),a[b].removeEventListener("mouseleave",this.ticksCallbackMap[b].mouseLeave,!1);this.handleCallbackMap.handle1&&this.handleCallbackMap.handle2&&(this.handle1.removeEventListener("mouseenter",this.handleCallbackMap.handle1.mouseEnter,!1),this.handle2.removeEventListener("mouseenter",this.handleCallbackMap.handle2.mouseEnter,!1),this.handle1.removeEventListener("mouseleave",this.handleCallbackMap.handle1.mouseLeave,!1),this.handle2.removeEventListener("mouseleave",this.handleCallbackMap.handle2.mouseLeave,!1))}this.handleCallbackMap=null,this.ticksCallbackMap=null,this.showTooltip&&this._removeTooltipListener("focus",this.showTooltip),this.hideTooltip&&this._removeTooltipListener("blur",this.hideTooltip),this.showTooltip&&this.sliderElem.removeEventListener("mouseenter",this.showTooltip,!1),this.hideTooltip&&this.sliderElem.removeEventListener("mouseleave",this.hideTooltip,!1),this.sliderElem.removeEventListener("mousedown",this.mousedown,!1),this.touchCapable&&(this.showTooltip&&(this.handle1.removeEventListener("touchstart",this.showTooltip,!1),this.handle1.removeEventListener("touchmove",this.showTooltip,!1),this.handle2.removeEventListener("touchstart",this.showTooltip,!1),this.handle2.removeEventListener("touchmove",this.showTooltip,!1)),this.hideTooltip&&(this.handle1.removeEventListener("touchend",this.hideTooltip,!1),this.handle2.removeEventListener("touchend",this.hideTooltip,!1)),this.showTooltip&&(this.sliderElem.removeEventListener("touchstart",this.showTooltip,!1),this.sliderElem.removeEventListener("touchmove",this.showTooltip,!1)),this.hideTooltip&&this.sliderElem.removeEventListener("touchend",this.hideTooltip,!1),this.sliderElem.removeEventListener("touchstart",this.touchstart,!1),this.sliderElem.removeEventListener("touchmove",this.touchmove,!1)),window.removeEventListener("resize",this.resize,!1)},_bindNonQueryEventHandler:function(a,b){void 0===this.eventToCallbackMap[a]&&(this.eventToCallbackMap[a]=[]),this.eventToCallbackMap[a].push(b)},_unbindNonQueryEventHandler:function(a,b){var c=this.eventToCallbackMap[a];if(void 0!==c)for(var d=0;d<c.length;d++)if(c[d]===b){c.splice(d,1);break}},_cleanUpEventCallbacksMap:function(){for(var a=Object.keys(this.eventToCallbackMap),b=0;b<a.length;b++){var c=a[b];delete this.eventToCallbackMap[c]}},_showTooltip:function(){this.options.tooltip_split===!1?(this._addClass(this.tooltip,"show"),this.tooltip_min.style.display="none",this.tooltip_max.style.display="none"):(this._addClass(this.tooltip_min,"show"),this._addClass(this.tooltip_max,"show"),this.tooltip.style.display="none"),this._state.over=!0},_hideTooltip:function(){this._state.inDrag===!1&&this._alwaysShowTooltip!==!0&&(this._removeClass(this.tooltip,"show"),this._removeClass(this.tooltip_min,"show"),this._removeClass(this.tooltip_max,"show")),this._state.over=!1},_setToolTipOnMouseOver:function(a){function b(a,b){return b?[100-a.percentage[0],c.options.range?100-a.percentage[1]:a.percentage[1]]:[a.percentage[0],a.percentage[1]]}var c=this,d=this.options.formatter(a?a.value[0]:this._state.value[0]),e=a?b(a,this.options.reversed):b(this._state,this.options.reversed);this._setText(this.tooltipInner,d),this.tooltip.style[this.stylePos]=e[0]+"%"},_copyState:function(){return{value:[this._state.value[0],this._state.value[1]],enabled:this._state.enabled,offset:this._state.offset,size:this._state.size,percentage:[this._state.percentage[0],this._state.percentage[1],this._state.percentage[2]],inDrag:this._state.inDrag,over:this._state.over,dragged:this._state.dragged,keyCtrl:this._state.keyCtrl}},_addTickListener:function(){return{addMouseEnter:function(a,b,c){var d=function(){var d=a._copyState(),e=b===a.handle1?d.value[0]:d.value[1],f=void 0;void 0!==c?(e=a.options.ticks[c],f=a.options.ticks_positions.length>0&&a.options.ticks_positions[c]||a._toPercentage(a.options.ticks[c])):f=a._toPercentage(e),d.value[0]=e,d.percentage[0]=f,a._setToolTipOnMouseOver(d),a._showTooltip()};return b.addEventListener("mouseenter",d,!1),d},addMouseLeave:function(a,b){var c=function(){a._hideTooltip()};return b.addEventListener("mouseleave",c,!1),c}}},_layout:function(){var a,b;if(a=this.options.reversed?[100-this._state.percentage[0],this.options.range?100-this._state.percentage[1]:this._state.percentage[1]]:[this._state.percentage[0],this._state.percentage[1]],this.handle1.style[this.stylePos]=a[0]+"%",this.handle1.setAttribute("aria-valuenow",this._state.value[0]),b=this.options.formatter(this._state.value[0]),isNaN(b)?this.handle1.setAttribute("aria-valuetext",b):this.handle1.removeAttribute("aria-valuetext"),this.handle2.style[this.stylePos]=a[1]+"%",this.handle2.setAttribute("aria-valuenow",this._state.value[1]),b=this.options.formatter(this._state.value[1]),isNaN(b)?this.handle2.setAttribute("aria-valuetext",b):this.handle2.removeAttribute("aria-valuetext"),this.rangeHighlightElements.length>0&&Array.isArray(this.options.rangeHighlights)&&this.options.rangeHighlights.length>0)for(var c=0;c<this.options.rangeHighlights.length;c++){var d=this._toPercentage(this.options.rangeHighlights[c].start),e=this._toPercentage(this.options.rangeHighlights[c].end);if(this.options.reversed){var f=100-e;e=100-d,d=f}var g=this._createHighlightRange(d,e);g?"vertical"===this.options.orientation?(this.rangeHighlightElements[c].style.top=g.start+"%",this.rangeHighlightElements[c].style.height=g.size+"%"):(this.options.rtl?this.rangeHighlightElements[c].style.right=g.start+"%":this.rangeHighlightElements[c].style.left=g.start+"%",this.rangeHighlightElements[c].style.width=g.size+"%"):this.rangeHighlightElements[c].style.display="none"}if(Array.isArray(this.options.ticks)&&this.options.ticks.length>0){var h,i="vertical"===this.options.orientation?"height":"width";h="vertical"===this.options.orientation?"marginTop":this.options.rtl?"marginRight":"marginLeft";var j=this._state.size/(this.options.ticks.length-1);if(this.tickLabelContainer){var k=0;if(0===this.options.ticks_positions.length)"vertical"!==this.options.orientation&&(this.tickLabelContainer.style[h]=-j/2+"px"),k=this.tickLabelContainer.offsetHeight;else for(l=0;l<this.tickLabelContainer.childNodes.length;l++)this.tickLabelContainer.childNodes[l].offsetHeight>k&&(k=this.tickLabelContainer.childNodes[l].offsetHeight);"horizontal"===this.options.orientation&&(this.sliderElem.style.marginBottom=k+"px")}for(var l=0;l<this.options.ticks.length;l++){var m=this.options.ticks_positions[l]||this._toPercentage(this.options.ticks[l]);this.options.reversed&&(m=100-m),this.ticks[l].style[this.stylePos]=m+"%",this._removeClass(this.ticks[l],"in-selection"),this.options.range?m>=a[0]&&m<=a[1]&&this._addClass(this.ticks[l],"in-selection"):"after"===this.options.selection&&m>=a[0]?this._addClass(this.ticks[l],"in-selection"):"before"===this.options.selection&&m<=a[0]&&this._addClass(this.ticks[l],"in-selection"),this.tickLabels[l]&&(this.tickLabels[l].style[i]=j+"px","vertical"!==this.options.orientation&&void 0!==this.options.ticks_positions[l]?(this.tickLabels[l].style.position="absolute",this.tickLabels[l].style[this.stylePos]=m+"%",this.tickLabels[l].style[h]=-j/2+"px"):"vertical"===this.options.orientation&&(this.options.rtl?this.tickLabels[l].style.marginRight=this.sliderElem.offsetWidth+"px":this.tickLabels[l].style.marginLeft=this.sliderElem.offsetWidth+"px",this.tickLabelContainer.style[h]=this.sliderElem.offsetWidth/2*-1+"px"),this._removeClass(this.tickLabels[l],"label-in-selection label-is-selection"),this.options.range?m>=a[0]&&m<=a[1]&&(this._addClass(this.tickLabels[l],"label-in-selection"),(m===a[0]||a[1])&&this._addClass(this.tickLabels[l],"label-is-selection")):("after"===this.options.selection&&m>=a[0]?this._addClass(this.tickLabels[l],"label-in-selection"):"before"===this.options.selection&&m<=a[0]&&this._addClass(this.tickLabels[l],"label-in-selection"),m===a[0]&&this._addClass(this.tickLabels[l],"label-is-selection")))}}var n;if(this.options.range){n=this.options.formatter(this._state.value),this._setText(this.tooltipInner,n),this.tooltip.style[this.stylePos]=(a[1]+a[0])/2+"%";var o=this.options.formatter(this._state.value[0]);this._setText(this.tooltipInner_min,o);var p=this.options.formatter(this._state.value[1]);this._setText(this.tooltipInner_max,p),this.tooltip_min.style[this.stylePos]=a[0]+"%",this.tooltip_max.style[this.stylePos]=a[1]+"%"}else n=this.options.formatter(this._state.value[0]),this._setText(this.tooltipInner,n),this.tooltip.style[this.stylePos]=a[0]+"%";if("vertical"===this.options.orientation)this.trackLow.style.top="0",this.trackLow.style.height=Math.min(a[0],a[1])+"%",this.trackSelection.style.top=Math.min(a[0],a[1])+"%",this.trackSelection.style.height=Math.abs(a[0]-a[1])+"%",this.trackHigh.style.bottom="0",this.trackHigh.style.height=100-Math.min(a[0],a[1])-Math.abs(a[0]-a[1])+"%";else{"right"===this.stylePos?this.trackLow.style.right="0":this.trackLow.style.left="0",this.trackLow.style.width=Math.min(a[0],a[1])+"%","right"===this.stylePos?this.trackSelection.style.right=Math.min(a[0],a[1])+"%":this.trackSelection.style.left=Math.min(a[0],a[1])+"%",this.trackSelection.style.width=Math.abs(a[0]-a[1])+"%","right"===this.stylePos?this.trackHigh.style.left="0":this.trackHigh.style.right="0",this.trackHigh.style.width=100-Math.min(a[0],a[1])-Math.abs(a[0]-a[1])+"%";var q=this.tooltip_min.getBoundingClientRect(),r=this.tooltip_max.getBoundingClientRect();"bottom"===this.options.tooltip_position?q.right>r.left?(this._removeClass(this.tooltip_max,"bs-tooltip-bottom"),this._addClass(this.tooltip_max,"bs-tooltip-top"),this.tooltip_max.style.top="",this.tooltip_max.style.bottom="22px"):(this._removeClass(this.tooltip_max,"bs-tooltip-top"),this._addClass(this.tooltip_max,"bs-tooltip-bottom"),this.tooltip_max.style.top=this.tooltip_min.style.top,this.tooltip_max.style.bottom=""):q.right>r.left?(this._removeClass(this.tooltip_max,"bs-tooltip-top"),this._addClass(this.tooltip_max,"bs-tooltip-bottom"),this.tooltip_max.style.top="18px"):(this._removeClass(this.tooltip_max,"bs-tooltip-bottom"),this._addClass(this.tooltip_max,"bs-tooltip-top"),this.tooltip_max.style.top=this.tooltip_min.style.top)}},_createHighlightRange:function(a,b){return this._isHighlightRange(a,b)?a>b?{start:b,size:a-b}:{start:a,size:b-a}:null},_isHighlightRange:function(a,b){return a>=0&&100>=a&&b>=0&&100>=b?!0:!1},_resize:function(a){this._state.offset=this._offset(this.sliderElem),this._state.size=this.sliderElem[this.sizePos],this._layout()},_removeProperty:function(a,b){a.style.removeProperty?a.style.removeProperty(b):a.style.removeAttribute(b)},_mousedown:function(a){if(!this._state.enabled)return!1;a.preventDefault&&a.preventDefault(),this._state.offset=this._offset(this.sliderElem),this._state.size=this.sliderElem[this.sizePos];var b=this._getPercentage(a);if(this.options.range){var c=Math.abs(this._state.percentage[0]-b),d=Math.abs(this._state.percentage[1]-b);this._state.dragged=d>c?0:1,this._adjustPercentageForRangeSliders(b)}else this._state.dragged=0;this._state.percentage[this._state.dragged]=b,this.touchCapable&&(document.removeEventListener("touchmove",this.mousemove,!1),document.removeEventListener("touchend",this.mouseup,!1)),this.mousemove&&document.removeEventListener("mousemove",this.mousemove,!1),this.mouseup&&document.removeEventListener("mouseup",this.mouseup,!1),this.mousemove=this._mousemove.bind(this),this.mouseup=this._mouseup.bind(this),this.touchCapable&&(document.addEventListener("touchmove",this.mousemove,!1),document.addEventListener("touchend",this.mouseup,!1)),document.addEventListener("mousemove",this.mousemove,!1),document.addEventListener("mouseup",this.mouseup,!1),this._state.inDrag=!0;var e=this._calculateValue();return this._trigger("slideStart",e),this.setValue(e,!1,!0),a.returnValue=!1,this.options.focus&&this._triggerFocusOnHandle(this._state.dragged),!0},_touchstart:function(a){this._mousedown(a)},_triggerFocusOnHandle:function(a){0===a&&this.handle1.focus(),1===a&&this.handle2.focus()},_keydown:function(a,b){if(!this._state.enabled)return!1;var c;switch(b.keyCode){case 37:case 40:c=-1;break;case 39:case 38:c=1}if(c){if(this.options.natural_arrow_keys){var d="horizontal"===this.options.orientation,e="vertical"===this.options.orientation,f=this.options.rtl,g=this.options.reversed;d?f?g||(c=-c):g&&(c=-c):e&&(g||(c=-c))}var h;if(this.ticksAreValid&&this.options.lock_to_ticks){var i=void 0;i=this.options.ticks.indexOf(this._state.value[a]),-1===i&&(i=0,window.console.warn("(lock_to_ticks) _keydown: index should not be -1")),i+=c,i=Math.max(0,Math.min(this.options.ticks.length-1,i)),h=this.options.ticks[i]}else h=this._state.value[a]+c*this.options.step;var j=this._toPercentage(h);if(this._state.keyCtrl=a,this.options.range){this._adjustPercentageForRangeSliders(j);var k=this._state.keyCtrl?this._state.value[0]:h,l=this._state.keyCtrl?h:this._state.value[1];h=[Math.max(this.options.min,Math.min(this.options.max,k)),Math.max(this.options.min,Math.min(this.options.max,l))]}else h=Math.max(this.options.min,Math.min(this.options.max,h));return this._trigger("slideStart",h),this.setValue(h,!0,!0),this._trigger("slideStop",h),this._pauseEvent(b),delete this._state.keyCtrl,!1}},_pauseEvent:function(a){a.stopPropagation&&a.stopPropagation(),
a.preventDefault&&a.preventDefault(),a.cancelBubble=!0,a.returnValue=!1},_mousemove:function(a){if(!this._state.enabled)return!1;var b=this._getPercentage(a);this._adjustPercentageForRangeSliders(b),this._state.percentage[this._state.dragged]=b;var c=this._calculateValue(!0);return this.setValue(c,!0,!0),!1},_touchmove:function(a){void 0!==a.changedTouches&&a.preventDefault&&a.preventDefault()},_adjustPercentageForRangeSliders:function(a){if(this.options.range){var b=this._getNumDigitsAfterDecimalPlace(a);b=b?b-1:0;var c=this._applyToFixedAndParseFloat(a,b);0===this._state.dragged&&this._applyToFixedAndParseFloat(this._state.percentage[1],b)<c?(this._state.percentage[0]=this._state.percentage[1],this._state.dragged=1):1===this._state.dragged&&this._applyToFixedAndParseFloat(this._state.percentage[0],b)>c?(this._state.percentage[1]=this._state.percentage[0],this._state.dragged=0):0===this._state.keyCtrl&&this._toPercentage(this._state.value[1])<a?(this._state.percentage[0]=this._state.percentage[1],this._state.keyCtrl=1,this.handle2.focus()):1===this._state.keyCtrl&&this._toPercentage(this._state.value[0])>a&&(this._state.percentage[1]=this._state.percentage[0],this._state.keyCtrl=0,this.handle1.focus())}},_mouseup:function(a){if(!this._state.enabled)return!1;var b=this._getPercentage(a);this._adjustPercentageForRangeSliders(b),this._state.percentage[this._state.dragged]=b,this.touchCapable&&(document.removeEventListener("touchmove",this.mousemove,!1),document.removeEventListener("touchend",this.mouseup,!1)),document.removeEventListener("mousemove",this.mousemove,!1),document.removeEventListener("mouseup",this.mouseup,!1),this._state.inDrag=!1,this._state.over===!1&&this._hideTooltip();var c=this._calculateValue(!0);return this.setValue(c,!1,!0),this._trigger("slideStop",c),this._state.dragged=null,!1},_setValues:function(a,b){var c=0===a?0:100;this._state.percentage[a]!==c&&(b.data[a]=this._toValue(this._state.percentage[a]),b.data[a]=this._applyPrecision(b.data[a]))},_calculateValue:function(a){var b={};return this.options.range?(b.data=[this.options.min,this.options.max],this._setValues(0,b),this._setValues(1,b),a&&(b.data[0]=this._snapToClosestTick(b.data[0]),b.data[1]=this._snapToClosestTick(b.data[1]))):(b.data=this._toValue(this._state.percentage[0]),b.data=parseFloat(b.data),b.data=this._applyPrecision(b.data),a&&(b.data=this._snapToClosestTick(b.data))),b.data},_snapToClosestTick:function(a){for(var b=[a,1/0],c=0;c<this.options.ticks.length;c++){var d=Math.abs(this.options.ticks[c]-a);d<=b[1]&&(b=[this.options.ticks[c],d])}return b[1]<=this.options.ticks_snap_bounds?b[0]:a},_applyPrecision:function(a){var b=this.options.precision||this._getNumDigitsAfterDecimalPlace(this.options.step);return this._applyToFixedAndParseFloat(a,b)},_getNumDigitsAfterDecimalPlace:function(a){var b=(""+a).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return b?Math.max(0,(b[1]?b[1].length:0)-(b[2]?+b[2]:0)):0},_applyToFixedAndParseFloat:function(a,b){var c=a.toFixed(b);return parseFloat(c)},_getPercentage:function(a){!this.touchCapable||"touchstart"!==a.type&&"touchmove"!==a.type&&"touchend"!==a.type||(a=a.changedTouches[0]);var b=a[this.mousePos],c=this._state.offset[this.stylePos],d=b-c;"right"===this.stylePos&&(d=-d);var e=d/this._state.size*100;return e=Math.round(e/this._state.percentage[2])*this._state.percentage[2],this.options.reversed&&(e=100-e),Math.max(0,Math.min(100,e))},_validateInputValue:function(a){if(isNaN(+a)){if(Array.isArray(a))return this._validateArray(a),a;throw new Error(g.formatInvalidInputErrorMsg(a))}return+a},_validateArray:function(a){for(var b=0;b<a.length;b++){var c=a[b];if("number"!=typeof c)throw new Error(g.formatInvalidInputErrorMsg(c))}},_setDataVal:function(a){this.element.setAttribute("data-value",a),this.element.setAttribute("value",a),this.element.value=a},_trigger:function(b,c){c=c||0===c?c:void 0;var d=this.eventToCallbackMap[b];if(d&&d.length)for(var e=0;e<d.length;e++){var f=d[e];f(c)}a&&this._triggerJQueryEvent(b,c)},_triggerJQueryEvent:function(a,b){var c={type:a,value:b};this.$element.trigger(c),this.$sliderElem.trigger(c)},_unbindJQueryEventHandlers:function(){this.$element.off(),this.$sliderElem.off()},_setText:function(a,b){"undefined"!=typeof a.textContent?a.textContent=b:"undefined"!=typeof a.innerText&&(a.innerText=b)},_removeClass:function(a,b){for(var c=b.split(" "),d=a.className,e=0;e<c.length;e++){var f=c[e],g=new RegExp("(?:\\s|^)"+f+"(?:\\s|$)");d=d.replace(g," ")}a.className=d.trim()},_addClass:function(a,b){for(var c=b.split(" "),d=a.className,e=0;e<c.length;e++){var f=c[e],g=new RegExp("(?:\\s|^)"+f+"(?:\\s|$)"),h=g.test(d);h||(d+=" "+f)}a.className=d.trim()},_offsetLeft:function(a){return a.getBoundingClientRect().left},_offsetRight:function(a){return a.getBoundingClientRect().right},_offsetTop:function(a){for(var b=a.offsetTop;(a=a.offsetParent)&&!isNaN(a.offsetTop);)b+=a.offsetTop,"BODY"!==a.tagName&&(b-=a.scrollTop);return b},_offset:function(a){return{left:this._offsetLeft(a),right:this._offsetRight(a),top:this._offsetTop(a)}},_css:function(b,c,d){if(a)a.style(b,c,d);else{var e=c.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(a,b){return b.toUpperCase()});b.style[e]=d}},_toValue:function(a){return this.options.scale.toValue.apply(this,[a])},_toPercentage:function(a){return this.options.scale.toPercentage.apply(this,[a])},_setTooltipPosition:function(){var a=[this.tooltip,this.tooltip_min,this.tooltip_max];if("vertical"===this.options.orientation){var b;b=this.options.tooltip_position?this.options.tooltip_position:this.options.rtl?"left":"right";var c="left"===b?"right":"left";a.forEach(function(a){this._addClass(a,"bs-tooltip-"+b),a.style[c]="100%"}.bind(this))}else"bottom"===this.options.tooltip_position?a.forEach(function(a){this._addClass(a,"bs-tooltip-bottom"),a.style.top="22px"}.bind(this)):a.forEach(function(a){this._addClass(a,"bs-tooltip-top"),a.style.top=-this.tooltip.outerHeight-14+"px"}.bind(this))},_getClosestTickIndex:function(a){for(var b=Math.abs(a-this.options.ticks[0]),c=0,d=0;d<this.options.ticks.length;++d){var e=Math.abs(a-this.options.ticks[d]);b>e&&(b=e,c=d)}return c},_setTickIndex:function(){this.ticksAreValid&&(this._state.tickIndex=[this.options.ticks.indexOf(this._state.value[0]),this.options.ticks.indexOf(this._state.value[1])])}},a&&a.fn&&(a.fn.slider?(windowIsDefined&&window.console.warn("bootstrap-slider.js - WARNING: $.fn.slider namespace is already bound. Use the $.fn.bootstrapSlider namespace instead."),f=c):(a.bridget(b,d),f=b),a.bridget(c,d),a(function(){a("input[data-provide=slider]")[f]()}))}(a),d});
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
;(function(root, factory) {
	// https://github.com/umdjs/umd/blob/master/returnExports.js
	if (typeof exports == 'object') {
		// For Node.js.
		module.exports = factory(root);
	} else if (typeof define == 'function' && define.amd) {
		// For AMD. Register as an anonymous module.
		define('cssEscape',[], factory.bind(root, root));
	} else {
		// For browser globals (not exposing the function separately).
		factory(root);
	}
}(typeof global != 'undefined' ? global : this, function(root) {

	if (root.CSS && root.CSS.escape) {
		return root.CSS.escape;
	}

	// https://drafts.csswg.org/cssom/#serialize-an-identifier
	var cssEscape = function(value) {
		if (arguments.length == 0) {
			throw new TypeError('`CSS.escape` requires an argument.');
		}
		var string = String(value);
		var length = string.length;
		var index = -1;
		var codeUnit;
		var result = '';
		var firstCodeUnit = string.charCodeAt(0);
		while (++index < length) {
			codeUnit = string.charCodeAt(index);
			// Note: there’s no need to special-case astral symbols, surrogate
			// pairs, or lone surrogates.

			// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
			// (U+FFFD).
			if (codeUnit == 0x0000) {
				result += '\uFFFD';
				continue;
			}

			if (
				// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
				// U+007F, […]
				(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
				// If the character is the first character and is in the range [0-9]
				// (U+0030 to U+0039), […]
				(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
				// If the character is the second character and is in the range [0-9]
				// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
				(
					index == 1 &&
					codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
					firstCodeUnit == 0x002D
				)
			) {
				// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
				result += '\\' + codeUnit.toString(16) + ' ';
				continue;
			}

			if (
				// If the character is the first character and is a `-` (U+002D), and
				// there is no second character, […]
				index == 0 &&
				length == 1 &&
				codeUnit == 0x002D
			) {
				result += '\\' + string.charAt(index);
				continue;
			}

			// If the character is not handled by one of the above rules and is
			// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
			// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
			// U+005A), or [a-z] (U+0061 to U+007A), […]
			if (
				codeUnit >= 0x0080 ||
				codeUnit == 0x002D ||
				codeUnit == 0x005F ||
				codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
				codeUnit >= 0x0041 && codeUnit <= 0x005A ||
				codeUnit >= 0x0061 && codeUnit <= 0x007A
			) {
				// the character itself
				result += string.charAt(index);
				continue;
			}

			// Otherwise, the escaped character.
			// https://drafts.csswg.org/cssom/#escape-a-character
			result += '\\' + string.charAt(index);

		}
		return result;
	};

	if (!root.CSS) {
		root.CSS = {};
	}

	root.CSS.escape = cssEscape;
	return cssEscape;

}));

/*
     _ _      _       _
 ___| (_) ___| | __  (_)___
/ __| | |/ __| |/ /  | / __|
\__ \ | | (__|   < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
                   |__/

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

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

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

    Slick = (function() {

        var instanceUid = 0;

        function Slick(element, settings) {

            var _ = this, dataSettings;

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

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

            $.extend(_, _.initials);

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

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

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

            _.currentSlide = _.options.initialSlide;

            _.originalSettings = _.options;

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

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

            _.instanceUid = instanceUid++;

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


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

        }

        return Slick;

    }());

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

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

    };

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

        var _ = this;

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

        _.unload();

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

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

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

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

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

        _.$slidesCache = _.$slides;

        _.reinit();

    };

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

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

        var animProps = {},
            _ = this;

        _.animateHeight();

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

        } else {

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

            } else {

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

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

                if (callback) {
                    setTimeout(function() {

                        _.disableTransition();

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

            }

        }

    };

    Slick.prototype.getNavTarget = function() {

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

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

        return asNavFor;

    };

    Slick.prototype.asNavFor = function(index) {

        var _ = this,
            asNavFor = _.getNavTarget();

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

    };

    Slick.prototype.applyTransition = function(slide) {

        var _ = this,
            transition = {};

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

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

    };

    Slick.prototype.autoPlay = function() {

        var _ = this;

        _.autoPlayClear();

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

    };

    Slick.prototype.autoPlayClear = function() {

        var _ = this;

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

    };

    Slick.prototype.autoPlayIterator = function() {

        var _ = this,
            slideTo = _.currentSlide + _.options.slidesToScroll;

        if ( !_.paused && !_.interrupted && !_.focussed ) {

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

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

                else if ( _.direction === 0 ) {

                    slideTo = _.currentSlide - _.options.slidesToScroll;

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

                }

            }

            _.slideHandler( slideTo );

        }

    };

    Slick.prototype.buildArrows = function() {

        var _ = this;

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

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

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

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

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

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

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

            } else {

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

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

            }

        }

    };

    Slick.prototype.buildDots = function() {

        var _ = this,
            i, dot;

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

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

            dot = $('<ul />').addClass(_.options.dotsClass);

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

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

            _.$dots.find('li').first().addClass('slick-active');

        }

    };

    Slick.prototype.buildOut = function() {

        var _ = this;

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

        _.slideCount = _.$slides.length;

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

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

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

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

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

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

        _.setupInfinite();

        _.buildArrows();

        _.buildDots();

        _.updateDots();


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

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

    };

    Slick.prototype.buildRows = function() {

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

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

        if(_.options.rows > 0) {

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

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

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

        }

    };

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

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

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

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

            targetBreakpoint = null;

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

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

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

    };

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

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

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

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

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

        switch (event.data.message) {

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

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

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

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

            default:
                return;
        }

    };

    Slick.prototype.checkNavigable = function(index) {

        var _ = this,
            navigables, prevNavigable;

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

        return index;
    };

    Slick.prototype.cleanUpEvents = function() {

        var _ = this;

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

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

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

        _.$slider.off('focus.slick blur.slick');

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

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

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

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

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

        _.cleanUpSlideEvents();

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

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

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

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

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

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

    };

    Slick.prototype.cleanUpSlideEvents = function() {

        var _ = this;

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

    };

    Slick.prototype.cleanUpRows = function() {

        var _ = this, originalSlides;

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

    };

    Slick.prototype.clickHandler = function(event) {

        var _ = this;

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

    };

    Slick.prototype.destroy = function(refresh) {

        var _ = this;

        _.autoPlayClear();

        _.touchObject = {};

        _.cleanUpEvents();

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

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

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

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

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

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

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

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


        if (_.$slides) {

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

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

            _.$slideTrack.detach();

            _.$list.detach();

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

        _.cleanUpRows();

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

        _.unslicked = true;

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

    };

    Slick.prototype.disableTransition = function(slide) {

        var _ = this,
            transition = {};

        transition[_.transitionType] = '';

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

    };

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

        var _ = this;

        if (_.cssTransitions === false) {

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

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

        } else {

            _.applyTransition(slideIndex);

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

            if (callback) {
                setTimeout(function() {

                    _.disableTransition(slideIndex);

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

        }

    };

    Slick.prototype.fadeSlideOut = function(slideIndex) {

        var _ = this;

        if (_.cssTransitions === false) {

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

        } else {

            _.applyTransition(slideIndex);

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

        }

    };

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

        var _ = this;

        if (filter !== null) {

            _.$slidesCache = _.$slides;

            _.unload();

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

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

            _.reinit();

        }

    };

    Slick.prototype.focusHandler = function() {

        var _ = this;

        _.$slider
            .off('focus.slick blur.slick')
            .on('focus.slick blur.slick', '*', function(event) {

            event.stopImmediatePropagation();
            var $sf = $(this);

            setTimeout(function() {

                if( _.options.pauseOnFocus ) {
                    _.focussed = $sf.is(':focus');
                    _.autoPlay();
                }

            }, 0);

        });
    };

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

        var _ = this;
        return _.currentSlide;

    };

    Slick.prototype.getDotCount = function() {

        var _ = this;

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

        if (_.options.infinite === true) {
            if (_.slideCount <= _.options.slidesToShow) {
                 ++pagerQty;
            } else {
                while (breakPoint < _.slideCount) {
                    ++pagerQty;
                    breakPoint = counter + _.options.slidesToScroll;
                    counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
                }
            }
        } else if (_.options.centerMode === true) {
            pagerQty = _.slideCount;
        } else if(!_.options.asNavFor) {
            pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
        }else {
            while (breakPoint < _.slideCount) {
                ++pagerQty;
                breakPoint = counter + _.options.slidesToScroll;
                counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
            }
        }

        return pagerQty - 1;

    };

    Slick.prototype.getLeft = function(slideIndex) {

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

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

        if (_.options.infinite === true) {
            if (_.slideCount > _.options.slidesToShow) {
                _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
                coef = -1

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

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

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

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

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

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

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

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

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

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

        return targetLeft;

    };

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

        var _ = this;

        return _.options[option];

    };

    Slick.prototype.getNavigableIndexes = function() {

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

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

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

        return indexes;

    };

    Slick.prototype.getSlick = function() {

        return this;

    };

    Slick.prototype.getSlideCount = function() {

        var _ = this,
            slidesTraversed, swipedSlide, centerOffset;

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

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

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

            return slidesTraversed;

        } else {
            return _.options.slidesToScroll;
        }

    };

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

        var _ = this;

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

    };

    Slick.prototype.init = function(creation) {

        var _ = this;

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

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

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

        }

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

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

        if ( _.options.autoplay ) {

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

        }

    };

    Slick.prototype.initADA = function() {
        var _ = this,
                numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow),
                tabControlIndexes = _.getNavigableIndexes().filter(function(val) {
                    return (val >= 0) && (val < _.slideCount);
                });

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

        if (_.$dots !== null) {
            _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
                var slideControlIndex = tabControlIndexes.indexOf(i);

                $(this).attr({
                    'role': 'tabpanel',
                    'id': 'slick-slide' + _.instanceUid + i,
                    'tabindex': -1
                });

                if (slideControlIndex !== -1) {
                   var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex
                   if ($('#' + ariaButtonControl).length) {
                     $(this).attr({
                         'aria-describedby': ariaButtonControl
                     });
                   }
                }
            });

            _.$dots.attr('role', 'tablist').find('li').each(function(i) {
                var mappedSlideIndex = tabControlIndexes[i];

                $(this).attr({
                    'role': 'presentation'
                });

                $(this).find('button').first().attr({
                    'role': 'tab',
                    'id': 'slick-slide-control' + _.instanceUid + i,
                    'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex,
                    'aria-label': (i + 1) + ' of ' + numDotGroups,
                    'aria-selected': null,
                    'tabindex': '-1'
                });

            }).eq(_.currentSlide).find('button').attr({
                'aria-selected': 'true',
                'tabindex': '0'
            }).end();
        }

        for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) {
          if (_.options.focusOnChange) {
            _.$slides.eq(i).attr({'tabindex': '0'});
          } else {
            _.$slides.eq(i).removeAttr('tabindex');
          }
        }

        _.activateADA();

    };

    Slick.prototype.initArrowEvents = function() {

        var _ = this;

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

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

    };

    Slick.prototype.initDotEvents = function() {

        var _ = this;

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

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

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

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

        }

    };

    Slick.prototype.initSlideEvents = function() {

        var _ = this;

        if ( _.options.pauseOnHover ) {

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

        }

    };

    Slick.prototype.initializeEvents = function() {

        var _ = this;

        _.initArrowEvents();

        _.initDotEvents();
        _.initSlideEvents();

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

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

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

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

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

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

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

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

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

    };

    Slick.prototype.initUI = function() {

        var _ = this;

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

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

        }

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

            _.$dots.show();

        }

    };

    Slick.prototype.keyHandler = function(event) {

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

    };

    Slick.prototype.lazyLoad = function() {

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

        function loadImages(imagesScope) {

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

                var image = $(this),
                    imageSource = $(this).attr('data-lazy'),
                    imageSrcSet = $(this).attr('data-srcset'),
                    imageSizes  = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'),
                    imageToLoad = document.createElement('img');

                imageToLoad.onload = function() {

                    image
                        .animate({ opacity: 0 }, 100, function() {

                            if (imageSrcSet) {
                                image
                                    .attr('srcset', imageSrcSet );

                                if (imageSizes) {
                                    image
                                        .attr('sizes', imageSizes );
                                }
                            }

                            image
                                .attr('src', imageSource)
                                .animate({ opacity: 1 }, 200, function() {
                                    image
                                        .removeAttr('data-lazy data-srcset data-sizes')
                                        .removeClass('slick-loading');
                                });
                            _.$slider.trigger('lazyLoaded', [_, image, imageSource]);
                        });

                };

                imageToLoad.onerror = function() {

                    image
                        .removeAttr( 'data-lazy' )
                        .removeClass( 'slick-loading' )
                        .addClass( 'slick-lazyload-error' );

                    _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);

                };

                imageToLoad.src = imageSource;

            });

        }

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

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

        if (_.options.lazyLoad === 'anticipated') {
            var prevSlide = rangeStart - 1,
                nextSlide = rangeEnd,
                $slides = _.$slider.find('.slick-slide');

            for (var i = 0; i < _.options.slidesToScroll; i++) {
                if (prevSlide < 0) prevSlide = _.slideCount - 1;
                loadRange = loadRange.add($slides.eq(prevSlide));
                loadRange = loadRange.add($slides.eq(nextSlide));
                prevSlide--;
                nextSlide++;
            }
        }

        loadImages(loadRange);

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

    };

    Slick.prototype.loadSlider = function() {

        var _ = this;

        _.setPosition();

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

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

        _.initUI();

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

    };

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

        var _ = this;

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

    };

    Slick.prototype.orientationChange = function() {

        var _ = this;

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

    };

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

        var _ = this;

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

    };

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

        var _ = this;

        _.autoPlay();
        _.options.autoplay = true;
        _.paused = false;
        _.focussed = false;
        _.interrupted = false;

    };

    Slick.prototype.postSlide = function(index) {

        var _ = this;

        if( !_.unslicked ) {

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

            _.animating = false;

            if (_.slideCount > _.options.slidesToShow) {
                _.setPosition();
            }

            _.swipeLeft = null;

            if ( _.options.autoplay ) {
                _.autoPlay();
            }

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

                if (_.options.focusOnChange) {
                    var $currentSlide = $(_.$slides.get(_.currentSlide));
                    $currentSlide.attr('tabindex', 0).focus();
                }
            }

        }

    };

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

        var _ = this;

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

    };

    Slick.prototype.preventDefault = function(event) {

        event.preventDefault();

    };

    Slick.prototype.progressiveLazyLoad = function( tryCount ) {

        tryCount = tryCount || 1;

        var _ = this,
            $imgsToLoad = $( 'img[data-lazy]', _.$slider ),
            image,
            imageSource,
            imageSrcSet,
            imageSizes,
            imageToLoad;

        if ( $imgsToLoad.length ) {

            image = $imgsToLoad.first();
            imageSource = image.attr('data-lazy');
            imageSrcSet = image.attr('data-srcset');
            imageSizes  = image.attr('data-sizes') || _.$slider.attr('data-sizes');
            imageToLoad = document.createElement('img');

            imageToLoad.onload = function() {

                if (imageSrcSet) {
                    image
                        .attr('srcset', imageSrcSet );

                    if (imageSizes) {
                        image
                            .attr('sizes', imageSizes );
                    }
                }

                image
                    .attr( 'src', imageSource )
                    .removeAttr('data-lazy data-srcset data-sizes')
                    .removeClass('slick-loading');

                if ( _.options.adaptiveHeight === true ) {
                    _.setPosition();
                }

                _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
                _.progressiveLazyLoad();

            };

            imageToLoad.onerror = function() {

                if ( tryCount < 3 ) {

                    /**
                     * try to load the image 3 times,
                     * leave a slight delay so we don't get
                     * servers blocking the request.
                     */
                    setTimeout( function() {
                        _.progressiveLazyLoad( tryCount + 1 );
                    }, 500 );

                } else {

                    image
                        .removeAttr( 'data-lazy' )
                        .removeClass( 'slick-loading' )
                        .addClass( 'slick-lazyload-error' );

                    _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);

                    _.progressiveLazyLoad();

                }

            };

            imageToLoad.src = imageSource;

        } else {

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

        }

    };

    Slick.prototype.refresh = function( initializing ) {

        var _ = this, currentSlide, lastVisibleIndex;

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

        // in non-infinite sliders, we don't want to go past the
        // last visible index.
        if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {
            _.currentSlide = lastVisibleIndex;
        }

        // if less slides than to show, go to start.
        if ( _.slideCount <= _.options.slidesToShow ) {
            _.currentSlide = 0;

        }

        currentSlide = _.currentSlide;

        _.destroy(true);

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

        _.init();

        if( !initializing ) {

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

        }

    };

    Slick.prototype.registerBreakpoints = function() {

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

        if (Array.isArray(responsiveSettings) && responsiveSettings.length) {

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

            for ( breakpoint in responsiveSettings ) {

                l = _.breakpoints.length-1;

                if (responsiveSettings.hasOwnProperty(breakpoint)) {
                    currentBreakpoint = responsiveSettings[breakpoint].breakpoint;

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

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

                }

            }

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

        }

    };

    Slick.prototype.reinit = function() {

        var _ = this;

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

        _.slideCount = _.$slides.length;

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

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

        _.registerBreakpoints();

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

        _.checkResponsive(false, true);

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

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

        _.setPosition();
        _.focusHandler();

        _.paused = !_.options.autoplay;
        _.autoPlay();

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

    };

    Slick.prototype.resize = function() {

        var _ = this;

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

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

        var _ = this;

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

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

        _.unload();

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

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

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

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

        _.$slidesCache = _.$slides;

        _.reinit();

    };

    Slick.prototype.setCSS = function(position) {

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

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

        positionProps[_.positionProp] = position;

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

    };

    Slick.prototype.setDimensions = function() {

        var _ = this;

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

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


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

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

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

    };

    Slick.prototype.setFade = function() {

        var _ = this,
            targetLeft;

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

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

    };

    Slick.prototype.setHeight = function() {

        var _ = this;

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

    };

    Slick.prototype.setOption =
    Slick.prototype.slickSetOption = function() {

        /**
         * accepts arguments in format of:
         *
         *  - for changing a single option's value:
         *     .slick("setOption", option, value, refresh )
         *
         *  - for changing a set of responsive options:
         *     .slick("setOption", 'responsive', [{}, ...], refresh )
         *
         *  - for updating multiple values at once (not responsive)
         *     .slick("setOption", { 'option': value, ... }, refresh )
         */

        var _ = this, l, item, option, value, refresh = false, type;

        if( $.type( arguments[0] ) === 'object' ) {

            option =  arguments[0];
            refresh = arguments[1];
            type = 'multiple';

        } else if ( $.type( arguments[0] ) === 'string' ) {

            option =  arguments[0];
            value = arguments[1];
            refresh = arguments[2];

            if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {

                type = 'responsive';

            } else if ( typeof arguments[1] !== 'undefined' ) {

                type = 'single';

            }

        }

        if ( type === 'single' ) {

            _.options[option] = value;


        } else if ( type === 'multiple' ) {

            $.each( option , function( opt, val ) {

                _.options[opt] = val;

            });


        } else if ( type === 'responsive' ) {

            for ( item in value ) {

                if( $.type( _.options.responsive ) !== 'array' ) {

                    _.options.responsive = [ value[item] ];

                } else {

                    l = _.options.responsive.length-1;

                    // loop through the responsive object and splice out duplicates.
                    while( l >= 0 ) {

                        if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {

                            _.options.responsive.splice(l,1);

                        }

                        l--;

                    }

                    _.options.responsive.push( value[item] );

                }

            }

        }

        if ( refresh ) {

            _.unload();
            _.reinit();

        }

    };

    Slick.prototype.setPosition = function() {

        var _ = this;

        _.setDimensions();

        _.setHeight();

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

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

    };

    Slick.prototype.setProps = function() {

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

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

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

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

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

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


    Slick.prototype.setSlideClasses = function(index) {

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

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

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

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

            var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0;

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

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

                if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
                    _.$slides
                        .slice(index - centerOffset + evenCoef, index + centerOffset + 1)
                        .addClass('slick-active')
                        .attr('aria-hidden', 'false');

                } else {

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

                }

                if (index === 0) {

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

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

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

                }

            }

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

        } else {

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

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

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

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

            } else {

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

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

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

                } else {

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

                }

            }

        }

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

    Slick.prototype.setupInfinite = function() {

        var _ = this,
            i, slideIndex, infiniteCount;

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

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

            slideIndex = null;

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

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

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

            }

        }

    };

    Slick.prototype.interrupt = function( toggle ) {

        var _ = this;

        if( !toggle ) {
            _.autoPlay();
        }
        _.interrupted = toggle;

    };

    Slick.prototype.selectHandler = function(event) {

        var _ = this;

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

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

        if (!index) index = 0;

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

            _.slideHandler(index, false, true);
            return;

        }

        _.slideHandler(index);

    };

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

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

        sync = sync || false;

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

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

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

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

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

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

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

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

        _.animating = true;

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

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

        _.setSlideClasses(_.currentSlide);

        if ( _.options.asNavFor ) {

            navTarget = _.getNavTarget();
            navTarget = navTarget.slick('getSlick');

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

        }

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

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

                _.fadeSlideOut(oldSlide);

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

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

        if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) {
            _.animateSlide(targetLeft, function() {
                _.postSlide(animSlide);
            });
        } else {
            _.postSlide(animSlide);
        }

    };

    Slick.prototype.startLoad = function() {

        var _ = this;

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

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

        }

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

            _.$dots.hide();

        }

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

    };

    Slick.prototype.swipeDirection = function() {

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

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

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

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

        return 'vertical';

    };

    Slick.prototype.swipeEnd = function(event) {

        var _ = this,
            slideCount,
            direction;

        _.dragging = false;
        _.swiping = false;

        if (_.scrolling) {
            _.scrolling = false;
            return false;
        }

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

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

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

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

            direction = _.swipeDirection();

            switch ( direction ) {

                case 'left':
                case 'down':

                    slideCount =
                        _.options.swipeToSlide ?
                            _.checkNavigable( _.currentSlide + _.getSlideCount() ) :
                            _.currentSlide + _.getSlideCount();

                    _.currentDirection = 0;

                    break;

                case 'right':
                case 'up':

                    slideCount =
                        _.options.swipeToSlide ?
                            _.checkNavigable( _.currentSlide - _.getSlideCount() ) :
                            _.currentSlide - _.getSlideCount();

                    _.currentDirection = 1;

                    break;

                default:


            }

            if( direction != 'vertical' ) {

                _.slideHandler( slideCount );
                _.touchObject = {};
                _.$slider.trigger('swipe', [_, direction ]);

            }

        } else {

            if ( _.touchObject.startX !== _.touchObject.curX ) {

                _.slideHandler( _.currentSlide );
                _.touchObject = {};

            }

        }

    };

    Slick.prototype.swipeHandler = function(event) {

        var _ = this;

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

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

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

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

        switch (event.data.action) {

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

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

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

        }

    };

    Slick.prototype.swipeMove = function(event) {

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

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

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

        curLeft = _.getLeft(_.currentSlide);

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

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

        verticalSwipeLength = Math.round(Math.sqrt(
            Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));

        if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) {
            _.scrolling = true;
            return false;
        }

        if (_.options.verticalSwiping === true) {
            _.touchObject.swipeLength = verticalSwipeLength;
        }

        swipeDirection = _.swipeDirection();

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

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


        swipeLength = _.touchObject.swipeLength;

        _.touchObject.edgeHit = false;

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

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

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

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

        _.setCSS(_.swipeLeft);

    };

    Slick.prototype.swipeStart = function(event) {

        var _ = this,
            touches;

        _.interrupted = true;

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

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

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

        _.dragging = true;

    };

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

        var _ = this;

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

            _.unload();

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

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

            _.reinit();

        }

    };

    Slick.prototype.unload = function() {

        var _ = this;

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

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

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

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

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

    };

    Slick.prototype.unslick = function(fromBreakpoint) {

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

    };

    Slick.prototype.updateArrows = function() {

        var _ = this,
            centerOffset;

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

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

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

            if (_.currentSlide === 0) {

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

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

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

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

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

            }

        }

    };

    Slick.prototype.updateDots = function() {

        var _ = this;

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

            _.$dots
                .find('li')
                    .removeClass('slick-active')
                    .end();

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

        }

    };

    Slick.prototype.visibility = function() {

        var _ = this;

        if ( _.options.autoplay ) {

            if ( document[_.hidden] ) {

                _.interrupted = true;

            } else {

                _.interrupted = false;

            }

        }

    };

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

}));

define( 'ANSI/Utility/Dimensions', [], function () {

    var dimensions = {};

    var getDimensions = function getDimensions() {
        dimensions.height = window.innerHeight;
        dimensions.width = window.innerWidth;
        return dimensions;
    };

    window.addEventListener( 'resize', getDimensions );

    return getDimensions();

} );
/**
  stickybits - Stickybits is a lightweight alternative to `position: sticky` polyfills
  @version v3.7.2
  @link https://github.com/dollarshaveclub/stickybits#readme
  @author Jeff Wainwright <yowainwright@gmail.com> (https://jeffry.in)
  @license MIT
**/
!function ( t, s ) { "object" == typeof exports && "undefined" != typeof module ? module.exports = s() : "function" == typeof define && define.amd ? define( 'StickyBits',s ) : ( t = t || self ).stickybits = s() }( this, function () { "use strict"; function w() { return ( w = Object.assign || function ( t ) { for ( var s = 1; s < arguments.length; s++ ) { var e = arguments[s]; for ( var i in e ) Object.prototype.hasOwnProperty.call( e, i ) && ( t[i] = e[i] ) } return t } ).apply( this, arguments ) } var e = function () { function t( t, s ) { var e = this, i = void 0 !== s ? s : {}; this.version = "3.7.2", this.userAgent = window.navigator.userAgent || "no `userAgent` provided by the browser", this.props = { customStickyChangeNumber: i.customStickyChangeNumber || null, noStyles: i.noStyles || !1, stickyBitStickyOffset: i.stickyBitStickyOffset || 0, parentClass: i.parentClass || "js-stickybit-parent", scrollEl: "string" == typeof i.scrollEl ? document.querySelector( i.scrollEl ) : i.scrollEl || window, stickyClass: i.stickyClass || "js-is-sticky", stuckClass: i.stuckClass || "js-is-stuck", stickyChangeClass: i.stickyChangeClass || "js-is-sticky--change", useStickyClasses: i.useStickyClasses || !1, useFixed: i.useFixed || !1, useGetBoundingClientRect: i.useGetBoundingClientRect || !1, verticalPosition: i.verticalPosition || "top", applyStyle: i.applyStyle || function ( t, s ) { return e.applyStyle( t, s ) } }, this.props.positionVal = this.definePosition() || "fixed", this.instances = []; var n = this.props, o = n.positionVal, a = n.verticalPosition, l = n.noStyles, r = n.stickyBitStickyOffset, c = "top" !== a || l ? "" : r + "px", p = "fixed" !== o ? o : ""; this.els = "string" == typeof t ? document.querySelectorAll( t ) : t, "length" in this.els || ( this.els = [this.els] ); for ( var f = 0; f < this.els.length; f++ ) { var u, y = this.els[f], h = this.addInstance( y, this.props ); this.props.applyStyle( { styles: ( u = {}, u[a] = c, u.position = p, u ), classes: {} }, h ), this.instances.push( h ) } } var s = t.prototype; return s.definePosition = function () { var t; if ( this.props.useFixed ) t = "fixed"; else { for ( var s = ["", "-o-", "-webkit-", "-moz-", "-ms-"], e = document.head.style, i = 0; i < s.length; i += 1 )e.position = s[i] + "sticky"; t = e.position ? e.position : "fixed", e.position = "" } return t }, s.addInstance = function ( t, s ) { var e = this, i = { el: t, parent: t.parentNode, props: s }; if ( "fixed" === s.positionVal || s.useStickyClasses ) { this.isWin = this.props.scrollEl === window; var n = this.isWin ? window : this.getClosestParent( i.el, i.props.scrollEl ); this.computeScrollOffsets( i ), this.toggleClasses( i.parent, "", s.parentClass ), i.state = "default", i.stateChange = "default", i.stateContainer = function () { return e.manageState( i ) }, n.addEventListener( "scroll", i.stateContainer ) } return i }, s.getClosestParent = function ( t, s ) { var e = s, i = t; if ( i.parentElement === e ) return e; for ( ; i.parentElement !== e; )i = i.parentElement; return e }, s.getTopPosition = function ( t ) { if ( this.props.useGetBoundingClientRect ) return t.getBoundingClientRect().top + ( this.props.scrollEl.pageYOffset || document.documentElement.scrollTop ); for ( var s = 0; s = t.offsetTop + s, t = t.offsetParent; ); return s }, s.computeScrollOffsets = function ( t ) { var s = t, e = s.props, i = s.el, n = s.parent, o = !this.isWin && "fixed" === e.positionVal, a = "bottom" !== e.verticalPosition, l = o ? this.getTopPosition( e.scrollEl ) : 0, r = o ? this.getTopPosition( n ) - l : this.getTopPosition( n ), c = null !== e.customStickyChangeNumber ? e.customStickyChangeNumber : i.offsetHeight, p = r + n.offsetHeight; s.offset = o ? 0 : l + e.stickyBitStickyOffset, s.stickyStart = a ? r - s.offset : 0, s.stickyChange = s.stickyStart + c, s.stickyStop = a ? p - ( i.offsetHeight + s.offset ) : p - window.innerHeight }, s.toggleClasses = function ( t, s, e ) { var i = t, n = i.className.split( " " ); e && -1 === n.indexOf( e ) && n.push( e ); var o = n.indexOf( s ); -1 !== o && n.splice( o, 1 ), i.className = n.join( " " ) }, s.manageState = function ( r ) { var c = r, p = c.props, t = c.state, s = c.stateChange, e = c.stickyStart, i = c.stickyChange, n = c.stickyStop, f = p.positionVal, o = p.scrollEl, u = p.stickyClass, y = p.stickyChangeClass, h = p.stuckClass, d = p.verticalPosition, a = "bottom" !== d, g = p.applyStyle, l = function ( t ) { t() }, k = this.isWin && ( window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame ) || l, m = this.isWin ? window.scrollY || window.pageYOffset : o.scrollTop, v = a && m <= e && ( "sticky" === t || "stuck" === t ), C = n <= m && "sticky" === t; e < m && m < n && ( "default" === t || "stuck" === t ) ? c.state = "sticky" : v ? c.state = "default" : C && ( c.state = "stuck" ); var S = i <= m && m <= n; m < i / 2 || n < m ? c.stateChange = "default" : S && ( c.stateChange = "sticky" ), t === c.state && s === c.stateChange || k( function () { var t, s, e, i, n, o, a = { sticky: { styles: ( t = { position: f, top: "", bottom: "" }, t[d] = p.stickyBitStickyOffset + "px", t ), classes: ( s = {}, s[u] = !0, s ) }, default: { styles: ( e = {}, e[d] = "", e ), classes: {} }, stuck: { styles: w( ( i = {}, i[d] = "", i ), "fixed" === f ? { position: "absolute", top: "", bottom: "0" } : {} ), classes: ( n = {}, n[h] = !0, n ) } }; "fixed" === f && ( a.default.styles.position = "" ); var l = a[c.state]; l.classes = ( ( o = {} )[h] = !!l.classes[h], o[u] = !!l.classes[u], o[y] = S, o ), g( l, r ) } ) }, s.applyStyle = function ( t, s ) { var e = t.styles, i = t.classes, n = s, o = n.el, a = n.props, l = o.style, r = a.noStyles, c = o.className.split( " " ); for ( var p in i ) { if ( i[p] ) -1 === c.indexOf( p ) && c.push( p ); else { var f = c.indexOf( p ); -1 !== f && c.splice( f, 1 ) } } if ( o.className = c.join( " " ), !r ) for ( var u in e ) l[u] = e[u] }, s.update = function ( e ) { var i = this; return void 0 === e && ( e = null ), this.instances.forEach( function ( t ) { if ( i.computeScrollOffsets( t ), e ) for ( var s in e ) t.props[s] = e[s] } ), this }, s.removeInstance = function ( t ) { var s, e, i = t.el, n = t.props; this.applyStyle( { styles: ( s = { position: "" }, s[n.verticalPosition] = "", s ), classes: ( e = {}, e[n.stickyClass] = "", e[n.stuckClass] = "", e ) }, t ), this.toggleClasses( i.parentNode, n.parentClass ) }, s.cleanup = function () { for ( var t = 0; t < this.instances.length; t += 1 ) { var s = this.instances[t]; s.stateContainer && s.props.scrollEl.removeEventListener( "scroll", s.stateContainer ), this.removeInstance( s ) } this.manageState = !1, this.instances = [] }, t }(); return function ( t, s ) { return new e( t, s ) } } );
define( 'ANSI/Utility/SitecoreUtils', [], function () {
    'use strict';

    function sitecoreUtils() {
    }
    sitecoreUtils.prototype = {
        constructor: sitecoreUtils,
        isEditing: function () {
            //Check to see if in Sitecore EE.
            return ( typeof Sitecore != typeof void 0 && typeof Sitecore.PageModes != typeof void 0 && Sitecore.PageModes != null && Sitecore.PageModes.PageEditor != null );
        }
    };

    return sitecoreUtils;
} );
define('Frontend',['jquery', 'eventManager', 'ANSI/Utility/Dimensions', 'StickyBits', 'ANSI/Utility/SitecoreUtils','promise-polyfill' ], function ($, eventManager, dimensions, stickybits, sitecoreUtils) {

    'use strict';

    function frontEnd() {
    }

    // run any logic before score modules load
    frontEnd.prototype.preload = function () {
        if ( !sitecoreUtils.prototype.isEditing() ) {
            //pattern library dropdown animation
            $('.pattern-library-page .dropdown-toggle').on("click", function () {
                $(this).next('.dropdown-menu').slideToggle(100);
            });

            $('.score-modal').on('show.bs.modal', function () {
                $(this).appendTo('body');
                $('.modal-body').attr('tabindex', '0');
            });
        }
    };

    // run any logic after score modules have loaded
    frontEnd.prototype.postload = function () {
        if ( !sitecoreUtils.prototype.isEditing() ) {
            if ( $('.spotlight-content').length > 0 ) {
                $('.spotlight-content *').each(function (i, el) {
                    $(el).attr('style', '');
                });
            }

            var $scoreSlickSlider = $('.score-slick-slider');
            if ($scoreSlickSlider.length > 0) {
                $(window).resize(function () {
                    $scoreSlickSlider.each(function (i, el) {
                        var elSlick = el.slick;
                        if (elSlick) {
                            elSlick.refresh;
                        }
                    });
                });
            }

            if ( document.querySelector('.member-updates-page') ) {
                if ( dimensions.width > 991 ) {
                    var memberStickyColumn = document.querySelector('.sticky-right-column .score-right');
                    stickybits(memberStickyColumn, { stickyBitStickyOffset: 150 });
                }
            }
            var scrollFormThankYou = function scrollFormThankYou() {
                document.addEventListener("sc-forms-submit-success", function (e) {
                    document.querySelector('.ansi-scroll-button').trigger("click");
                });

            }
            scrollFormThankYou();
        }
    };
    return new frontEnd();
});

//TODO move this logic into it's own module
;
(function(root) {
define("StickyKit", ["jquery"], function() {
  return (function() {
(function(){var I=this.jQuery||window.jQuery,A=I(window);I.fn.stick_in_parent=function(t){var _,i,x,P,V,F,s,o,C,z,e,r,n;for(null==t&&(t={}),z=t.sticky_class,P=t.inner_scrolling,C=t.recalc_every,o=t.parent,F=t.offset_top,V=t.spacer,x=t.bottoming,null==F&&(F=0),null==o&&(o=void 0),null==P&&(P=!0),null==z&&(z="is_stuck"),_=I(document),null==x&&(x=!0),s=function(t){var i,o;return window.getComputedStyle?(t[0],i=window.getComputedStyle(t[0]),o=parseFloat(i.getPropertyValue("width"))+parseFloat(i.getPropertyValue("margin-left"))+parseFloat(i.getPropertyValue("margin-right")),"border-box"!==i.getPropertyValue("box-sizing")&&(o+=parseFloat(i.getPropertyValue("border-left-width"))+parseFloat(i.getPropertyValue("border-right-width"))+parseFloat(i.getPropertyValue("padding-left"))+parseFloat(i.getPropertyValue("padding-right"))),o):t.outerWidth(!0)},e=function(r,n,l,a,c,p,d,u){var f,t,h,g,y,k,m,v,i,b,w,e;if(!r.data("sticky_kit")){if(r.data("sticky_kit",!0),y=_.height(),m=r.parent(),null!=o&&(m=m.closest(o)),!m.length)throw"failed to find stick parent";if(f=h=!1,(w=null!=V?V&&r.closest(V):I("<div />"))&&w.css("position",r.css("position")),(v=function(){var t,i,o;if(!u)return y=_.height(),t=parseInt(m.css("border-top-width"),10),i=parseInt(m.css("padding-top"),10),n=parseInt(m.css("padding-bottom"),10),l=m.offset().top+t+i,a=m.height(),h&&(f=h=!1,null==V&&(r.insertAfter(w),w.detach()),r.css({position:"",top:"",width:"",bottom:""}).removeClass(z),o=!0),c=r.offset().top-(parseInt(r.css("margin-top"),10)||0)-F,p=r.outerHeight(!0),d=r.css("float"),w&&w.css({width:s(r),height:p,display:r.css("display"),"vertical-align":r.css("vertical-align"),float:d}),o?e():void 0})(),p!==a)return g=void 0,k=F,b=C,e=function(){var t,i,o,e,s;if(!u)return o=!1,null!=b&&--b<=0&&(b=C,v(),o=!0),o||_.height()===y||(v(),o=!0),o=A.scrollTop(),null!=g&&(i=o-g),g=o,h?(x&&(e=a+l<o+p+k,f&&!e&&(f=!1,r.css({position:"fixed",bottom:"",top:k}).trigger("sticky_kit:unbottom"))),o<c&&(h=!1,k=F,null==V&&("left"!==d&&"right"!==d||r.insertAfter(w),w.detach()),t={position:"",width:"",top:""},r.css(t).removeClass(z).trigger("sticky_kit:unstick")),P&&(s=A.height())<p+F&&(f||(k-=i,k=Math.max(s-p,k),k=Math.min(F,k),h&&r.css({top:k+"px"})))):c<o&&(h=!0,(t={position:"fixed",top:k}).width="border-box"===r.css("box-sizing")?r.outerWidth()+"px":r.width()+"px",r.css(t).addClass(z),null==V&&(r.after(w),"left"!==d&&"right"!==d||w.append(r)),r.trigger("sticky_kit:stick")),h&&x&&(null==e&&(e=a+l<o+p+k),!f&&e)?(f=!0,"static"===m.css("position")&&m.css({position:"relative"}),r.css({position:"absolute",bottom:n,top:"auto"}).trigger("sticky_kit:bottom")):void 0},i=function(){return v(),e()},t=function(){if(u=!0,A.off("touchmove",e),A.off("scroll",e),A.off("resize",i),I(document.body).off("sticky_kit:recalc",i),r.off("sticky_kit:detach",t),r.removeData("sticky_kit"),r.css({position:"",bottom:"",top:"",width:""}),m.position("position",""),h)return null==V&&("left"!==d&&"right"!==d||r.insertAfter(w),w.remove()),r.removeClass(z)},A.on("touchmove",e),A.on("scroll",e),A.on("resize",i),I(document.body).on("sticky_kit:recalc",i),r.on("sticky_kit:detach",t),setTimeout(e,0)}},r=0,n=this.length;r<n;r++)i=this[r],e(I(i));return this}}).call(this);

  }).apply(root, arguments);
});
}(this));

define('IEBugFixes',['jquery', 'StickyKit'], function ($) {
    "use strict";
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf('MSIE ');

    if ( msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) ) {
        $('body').addClass('brows-ie');
        if ( $('.ansi-header').length ) {
            $('.ansi-header').stick_in_parent({ offset_top: 0 });
        }
        if ( $('.ansi-sticky-navbar').length ) {
            $('.ansi-header.pull-up').stick_in_parent({ offset_top: -72 });
            $('.ansi-sticky-navbar.sticky').stick_in_parent({ offset_top: 0 });
        }
    }
});
define( 'Accordions',[ 'jquery', 'ANSI/Utility/SitecoreUtils', 'eventManager', 'promise-polyfill' ], function ( $, sitecoreUtils, eventManager ) {
    'use strict';
    var accordion = {
        init: function () {
            var $coveoResultList = $('.CoveoResultList');
            if ($coveoResultList.length > 0) {
                accordion.collapseAccordionForSearch($coveoResultList);
            }
            var $accordions = $('.score-accordion');
            var accordionsLength = $accordions.length;
            if (accordionsLength > 0) {
                for (var i = 0; i < accordionsLength; i++) {
                    var currentAccordion = $accordions.get(i);
                    var $currentAccordion = $(currentAccordion);
                    accordion.initCommon($currentAccordion);
                    accordion.addMatchId($currentAccordion);
                    if (currentAccordion.classList.contains('ansi-read-more')
                        || currentAccordion.classList.contains('load-more')) {
                        accordion.collapseAccordion($currentAccordion);
                    } else {
                        accordion.addActive($currentAccordion);
                    }
                }
                if ( $('.ansi-sticky-navbar').length > 0 ) {
                    accordion.scrollToPanel();
                    accordion.activeOnClick();
                }
            }
        },
        collapseAccordion: function ($currentAccordion) {
            $currentAccordion.find('.score-accordion-panel:first-of-type').removeClass( 'active' );
            eventManager.subscribe('ModulesLoadedEvent', function () {
                $currentAccordion.find('.panel-collapse').removeClass('in').addClass('collapse').attr('aria-expanded', 'false');
                $currentAccordion.find('.panel-title a').attr( 'aria-expanded', 'false' );
            } );
        },
        collapseAccordionForSearch: function ($coveoResultList) {
            eventManager.subscribe('SearchResultsLoadedEvent', function () {
                var $accordions = $coveoResultList.find('.score-accordion');
                var accordionsLength = $accordions.length;
                if (accordionsLength > 0) {
                    for (var i = 0; i < accordionsLength; i++) {
                        var currentAccordion = $accordions.get(i);
                        var $currentAccordion = $(currentAccordion);
                        $currentAccordion.find('.score-accordion-panel').removeClass('panel');
                        $currentAccordion.find('.panel-collapse').removeClass('in').addClass('collapse').attr('aria-expanded', 'false');
                        $currentAccordion.find('.panel-title a').attr('aria-expanded', 'false');
                    }
                }
            });
        },
        addActive: function ($currentAccordion) {
            var $firstNotCollapsed = $currentAccordion.find('.score-accordion-panel:first-of-type').not('.collapsed .score-accordion-panel');
            if ($firstNotCollapsed.length > 0) {
                $firstNotCollapsed.addClass('active');
                $firstNotCollapsed.find('.panel-collapse').removeClass('collapse').addClass('in').attr('aria-expanded', 'true');
                $firstNotCollapsed.find('.panel-title a').attr('aria-expanded', 'true').removeClass('collapsed');
            }
        },
        initCommon: function ($currentAccordion) {
            $currentAccordion.find('.score-accordion-panel').removeClass('panel');
            //Remove active state from accordions with component property set to be collapsed on load
            $currentAccordion.find('.collapsed .score-accordion-panel').removeClass('active');
            $('.panel-collapse', $currentAccordion).on('shown.bs.collapse', function (e) {
                $(this).closest('.score-accordion-panel').addClass('active');
            });
            $('.panel-collapse', $currentAccordion).on('hidden.bs.collapse', function (e) {
                $(this).closest('.score-accordion-panel').removeClass('active');
            });
            $('.panel-body').on("click", function (e) {
                e.stopPropagation();
            });
        },
        addMatchId: function ($currentAccordion) {
            $currentAccordion.find( '.panel-group .score-accordion-panel' ).each( function ( i ) {
                var upOne = i + 1;
                $( this ).attr( 'id', 'panel' + upOne );
            } );
        },
        scrollToPanel: function () {
            $( '.score-button-menu li:nth-child(1) > a' ).addClass( 'active' );
            var scrollButton = $( '.ansi-sticky-navbar .score-button-menu  a:not( .score-button-menu-item.sticky-nav-modal-btn  a)' );
            $( '.modal.fade' ).on( 'shown.bs.modal', function () {
                $( '.score-modal' ).appendTo( 'body' );
            } );
            scrollButton.on("click", function ( e ) {
                e.preventDefault();

                $( '.score-button-menu li a' ).removeClass( 'active' );
                $( this ).addClass( 'active' );
                $( '.panel-collapse' ).collapse( 'hide' );
                var elem = $( this );
                //Check to see if button has href
                var match = elem.attr( 'href' );

                if ( match == null ) {
                    return;
                }
                var index = match.indexOf( '#' );
                if ( index > -1 && index < match.length - 1 ) {
                    //check to see that it is not just a #
                    var matchedId = match.substring( index + 1, match.length );
                    var foundMatches = $( '.score-accordion-panel' );
                    var self;

                    foundMatches.each( function ( index ) {
                        if ( $( this ).attr( 'id' ) === matchedId ) {
                            self = $( this );
                            $( this ).find( '.panel-collapse' ).collapse( 'show' );
                            setTimeout( function () {
                                scrollToView();
                            }, 600 )
                        }
                    } );
                }

                var scrollToView = function scrollToView() {
                    window.scroll( {
                        top: ( $( elem.attr( 'href' ) ).offset().top ) - 80,
                        behavior: 'smooth'
                    } )
                }
            } );
        },
        activeOnClick: function () {
            $( '.score-accordion-panel' ).on("click", function ( e ) {
                var activePanel = $( this ).attr( 'id' );
                var panelID = '#' + activePanel;
                var self = $( this );
                setTimeout( function () {
                    window.scroll( {
                        top: ( self.offset().top ) - 80,
                        behavior: 'smooth'
                    } )
                }, 600 );

                $( '.ansi-sticky-navbar .score-button-menu  a' ).each( function ( item ) {
                    var ref = $( this ).attr( 'href' );
                    if ( ref === panelID ) {
                        $( '.panel-collapse' ).collapse( 'hide' );
                        $( '.score-button-menu li a' ).removeClass( 'active' );
                        $( this ).addClass( 'active' );
                    }
                } );
            } );
        }
    };
    if ( !sitecoreUtils.prototype.isEditing() ) Promise.resolve().then( accordion.init );
});
define('Header',[
    'jquery',
    'ANSI/Utility/Dimensions',
    'ANSI/Utility/SitecoreUtils',
    'promise-polyfill',
], function ($, dimensions, sitecoreUtils) {
    'use strict';

    var header = {
        init: function () {
            if ($('.ansi-header').length) {
                header.desktopHover();
                header.dropdownAnimation();
                header.scrollLogic();
                header.backButtonMobile();
                header.mobileLevelOneSlide();
                header.mobileLevelTwoSlide();
                header.navToggle();
                header.pageLinksCloseMenu();
                if (dimensions.width > 991 && $('.score-megamenu-dropdown').length > 0) {
                    header.addActiveState();
                }
                header.currentHoveredLink = undefined;
            }
        },
        desktopHover: function () {
            // Nav menu changed to hover from click event
            if (dimensions.width > 991) {
                $(document).off(
                    'click.bs.tab.data-api',
                    '.ansi-header [data-hover="tab"]'
                );
                $(document).on(
                    'mouseenter.bs.tab.data-api',
                    '.ansi-header [data-toggle="tab"], .ansi-header [data-hover="tab"]',
                    function (e) {
                        e.preventDefault();
                        var self = $(this);
                        var closestTab = self.closest('.ansi-header .score-tab');
                        header.currentHoveredLink = e.currentTarget;
                        setTimeout(function () {
                            if (header.currentHoveredLink === self.tab()[0]) {
                                closestTab.find('li.active').removeClass('active');
                                closestTab.find('.score-tab-panel.active').removeClass('active in');
                                self.tab('show');
                            }
                        }, 300);
                    }
                );
                $(document).on(
                    'mouseleave.bs.tab.data-api',
                    '.ansi-header [data-toggle="tab"], .ansi-header [data-hover="tab"]',
                    function (e) {
                        if ($('.score-tab-panel.active').has(e.target) === 0) {
                            var closestTab = self.closest('.ansi-header .score-tab');
                            closestTab.find('li.active').removeClass('active');
                            closestTab.find('.score-tab-panel.active').removeClass('active in');
                        }
                    }
                );
            }
        },
        addActiveState: function () {
            var prefix = "NavHeader.js -> addActiveState: ";
            // Utility function to convert nodelist to Array
            //to use [...nodeList].forEach -  from es6
            function _toConsumableArray(arr) {
                if (Array.isArray(arr)) {
                    for (
                        var i = 0, arr2 = Array(arr.length);
                        i < arr.length;
                        i++
                    ) {
                        arr2[i] = arr[i];
                    }
                    return arr2;
                } else {
                    return Array.from(arr);
                }
            }

            /* Get the active menu item and add class to nav item */
            // For first level of the mega menu
            var check = $('header ul.nav .score-megamenu-dropdown .dropdown-menu .score-tab .tab-content').find('li.active, li.active-section');
            if (check && check.length > 0) {
                $(check).closest('.score-megamenu-dropdown').addClass('activate');
            }

            // For second level of the mega menu
            var levelTwo = document.querySelector('.ansi-tier-two');
            var levelTwoParents = levelTwo.querySelectorAll('.score-megamenu-dropdown');
            var navItems = levelTwo.querySelectorAll('.score-menu-list .score-menu-list-item > a, .level-1.score-section-menu > li > a');
            var isAlreadyActivated = false;
            var isFoundWithoutHash = false;
            var location = window.location;
            var allLevelTwoMenuItems = [].concat(_toConsumableArray(navItems));

            allLevelTwoMenuItems.forEach(function (el) {
                // console.log(prefix + 'el.pathname: ' + el.pathname + ' location.pathname: ' + location.pathname + '; el.hostname: ' + el.hostname + ' location.hostname: ' + location.hostname + '; el.hash: ' + el.hash + '; location.hash: ' + location.hash/* + '; el.parentNode is active: ' + el.parentNode.classList.contains('active')*/);
                if (el.pathname === location.pathname && el.hostname === location.hostname) {
                    isFoundWithoutHash = true;
                    if (location.hash !== "") {
                        $(el).on('click', function (e) {
                            $(levelTwoParents).removeClass('activate');
                            e.target.closest('.score-megamenu-dropdown').classList.add('activate');
                            // console.log(prefix + 'added onClick to add class activate');
                        });
                        if (el.hash === location.hash) {
                            el.closest('.score-megamenu-dropdown').classList.add('activate');
                            isAlreadyActivated = true;
                            // console.log(prefix + 'added class activate');
                        }
                    } else {
                        if (el.hash === "") {
                            el.closest('.score-megamenu-dropdown').classList.add('activate');
                            // console.log(prefix + 'added class activate');
                        }
                        else {
                            $(el).on('click', function (e) {
                                window.location.hash = e.target.hash;
                                window.location.reload(true);
                                // console.log(prefix + 'added onClick to reload page with the hash');
                            });
                        }
                        isAlreadyActivated = true;
                    }
                }
            });

            if (!isAlreadyActivated && isFoundWithoutHash) {
                allLevelTwoMenuItems.forEach(function (el) {
                    if (el.pathname === location.pathname && el.hostname === location.hostname) {
                        el.closest('.score-megamenu-dropdown').classList.add('activate');
                        // console.log(prefix + 'added class activate using second loop');
                    }
                });
            }
        },
        pageLinksCloseMenu: function () {
            if (dimensions.width < 992) {
                //prevents dropdown from closing when clicked inside only in mobile
                var check = $('.ansi-header .score-tab .score-menu-list-item.active a');
                $(document).on('click', '.score-megamenu .dropdown-menu', function(e) {
                        e.stopPropagation();
                });
                if (check.length > 0) {
                    check.on("click", function (e) {
                        e.stopPropagation();
                        $('.navbar-toggle').trigger("click");
                    });
                }
            } else {
                $(document).on('click', '.score-megamenu .score-megamenu-dropdown .dropdown-menu', function (e) {
                    if (e.target.tagName.toLowerCase() !== 'a') {
                        return false;
                    }
                });
                $(document).on('click.bs.tab.data-api', '.ansi-header [data-toggle="tab"]', function (e) {
                    e.preventDefault();
                    return false;
                });
            }
        },
        backButtonMobile: function (e) {
            //Create a bread crumb in mobile to return to parent from all levels.
            $('.score-button.nav-back-button').on("click", function (e) {
                e.stopPropagation();
                e.preventDefault();
                var scoreMegamenuContents = $('.score-megamenu-content');
                var navbarCollapseCollapseIn = $('.navbar-collapse.collapse.in');
                var scoreTabs = $('.ansi-header .score-tab');
                var crumbName = $(this).closest('.score-megamenu-content .score-style-box').find('span').data('crumb');
                if (navbarCollapseCollapseIn.hasClass('slide') && scoreTabs.hasClass('slide')) {
                    scoreTabs.removeClass('slide');
                    scoreMegamenuContents.find('.score-style-box span').text(crumbName);
                } else if (navbarCollapseCollapseIn.hasClass('slide')) {
                    navbarCollapseCollapseIn.removeClass('slide');
                    setTimeout(function () {
                        scoreMegamenuContents.removeClass('slide-in');
                        $('.score-megamenu-dropdown').removeClass('open');
                    }, 800);
                }
            });
        },
        mobileLevelOneSlide: function () {
            // Slide nav on level on click mobile.
            $('.score-megamenu-dropdown').on("click", function () {
                if (dimensions.width < 992) {
                    var breadCrumb = $(this).find('a').first().text();
                    $(this)
                        .find('.score-megamenu-content')
                        .addClass('slide-in');
                    $(this)
                        .find('.nav.nav-tabs')
                        .find('li')
                        .removeClass('active');
                    $('.navbar-collapse').addClass('slide');
                    $(this)
                        .find('.score-megamenu-content .score-style-box span')
                        .text(breadCrumb)
                        .attr('data-crumb', breadCrumb);
                }
            });
        },
        mobileLevelTwoSlide: function () {
            //Slide to level 2 of tabset in nav mobile menu.
            if (dimensions.width < 992) {
                $(document).on(
                    'click.bs.tab.data-api',
                    '.ansi-header [data-toggle="tab"], .ansi-header [data-hover="tab"]',
                    function () {
                        $(this)
                            .closest('.ansi-header .score-tab')
                            .addClass('slide');
                        var secondBreadCrumb = $(this).text();
                        setTimeout(function () {
                            $(
                                '.score-megamenu-content .score-style-box span'
                            ).text(secondBreadCrumb);
                        }, 100);
                    }
                );
            }
        },
        dropdownAnimation: function () {
            // Added slide up animation for mega menu content.
            if (dimensions.width > 991) {
                $('.score-megamenu-dropdown').on('show.bs.dropdown', function (e) {
                    var dropDown = $(this).find('.dropdown-menu'),
                        origMarginTop = parseInt(dropDown.css('margin-top'));
                    dropDown
                        .css({
                            'margin-top': origMarginTop + 30 + 'px',
                            opacity: 0,
                        })
                        .animate(
                            { 'margin-top': origMarginTop + 'px', opacity: 1 },
                            200,
                            function () {
                                $(this).css({ 'margin-top': '' });
                            }
                        );
                });
            }
        },
        scrollLogic: function () {
            // Watch scroll position to hide and show tier 2 nav menu.
            var lastScrollTop = $('.ansi-tier-two').outerHeight();
            var ticking = false;
            var delay = 250;

            var hasScrolled = function (e) {
                var st = $(window).scrollTop();
                if (dimensions.width > 991) {
                    if (st > 5) {
                        if (st > lastScrollTop) {
                            $('.ansi-tier-two').addClass('slide-out');
                        } else {
                            $('.ansi-tier-two').removeClass('slide-out');
                        }
                    }
                    lastScrollTop = st;
                }
            };

            var timeout;

            window.addEventListener(
                'scroll',
                function (event) {
                    if (timeout) {
                        window.cancelAnimationFrame(timeout);
                    }

                    timeout = window.requestAnimationFrame(function () {
                        hasScrolled();
                    });
                },
                false
            );
        },
        navToggle: function () {
            // Close nav in mobile view it nav item is clicked.
            $('.navbar-toggle').on("click", function () {
                //header.navToggle();
                if ($('.navbar-toggle[aria-expanded="false"]')) {
                    $('.score-tab').removeClass('slide');
                    $('body').removeClass('open');
                    $('.navbar-collapse.collapse.in').removeClass('slide');
                    $('.nav.nav-tabs').removeClass('active');
                    $('.score-megamenu-content').removeClass('slide-in');
                } else {
                    $('body').addClass('open');
                }
            });
        },
    };

    if (!sitecoreUtils.prototype.isEditing())
        Promise.resolve().then(header.init);
});

define( 'Footer',[ 'ANSI/Utility/SitecoreUtils', 'promise-polyfill' ], function ( sitecoreUtils ) {
    'use strict';

    function Footer() {}

    Footer.prototype = {
        constructor: Footer,
        init: function () {
            if ( document.body.contains( document.querySelector( 'footer' ) ) ) {
                Footer.prototype.socialBox();
            }
        },
        socialBox: function () {
            //Social button box in footer toggle
            var footer = document.querySelector( '.score-footer' );
            var btnBox = footer.querySelector( '.score-well' );

            var toggle = function toggle() {
                btnBox.classList.toggle( 'open' );
                socialBtn.classList.toggle( 'open' );
            };


            var socialBtn = footer.querySelector( '.js-social-btn img' );
            socialBtn.addEventListener( 'click', toggle );

            btnBox.addEventListener( 'keydown', function ( e ) {
                if ( btnBox.classList.contains( 'open' ) && e.keyCode == 27 ) {
                    btnBox.classList.remove( 'open' );
                    socialBtn.classList.remove( 'open' );
                }
            } )

            footer.querySelector( '.js-social-btn' ).addEventListener( 'keydown', function ( e ) {
                if ( e.keyCode == 13 ) toggle();
            } );

            document.onclick = function ( event ) {
                event.stopPropagation();
                var opened = footer.querySelector( '.score-well.open' );
                if ( event.target !== socialBtn && event.target !== opened ) {
                    btnBox.classList.remove( 'open' );
                    socialBtn.classList.remove( 'open' );
                }
            };
        }
    };
    if ( !sitecoreUtils.prototype.isEditing() ) Promise.resolve().then( Footer.prototype.init );
} );
define('Search',[
    'jquery',
    'ANSI/Utility/Dimensions',
    'ANSI/Utility/SitecoreUtils',
    'eventManager',
    'promise-polyfill',
], function ($, dimensions, sitecoreUtils, eventManager) {
    'use strict';
    var searchpage = {
        init: function () {           
            if ($('.CoveoSearchInterface').length == 0 || $('.CoveoSearchInterface').length) {          
                searchpage.headerSearchOpen();
                searchpage.headerSearchClose();
                searchpage.filterButton();
                if (document.querySelector('.coveo-facet-column'))
                    searchpage.facetColumnHide();
                if (dimensions.width > 991) searchpage.facetCollapse();
            }
        },
        facetCollapse: function () {
            // Highjack coveo collapse and make it work with click on header
            $('.coveo-facet-header').on('click', function () {
                $(this)
                    .closest('.CoveoFacet')
                    .toggleClass('coveo-facet-collapsed');
            });

            $('.coveo-facet-values').on('click', function (e) {
                e.stopPropagation();
            });

            $('.coveo-facet-header-settings-section').on('click', function (e) {
                e.stopPropagation();
            });
        },
        facetColumnHide: function () {
            eventManager.subscribe('SearchResultsLoadedEvent', function () {
                var column = document.querySelector('.coveo-facet-column');  
                //fix upgrade
                setTimeout(function () {
                    $('a.coveo-facet-dropdown-header').on("click", function () {
                        column.style.display = 'block';
                        $('.coveo-facet-modal-close-button').hide();
                        $('body').css('overflow', 'unset');
                        setTimeout(function () {
                            if (jQuery('.coveo-facet-dropdown-modal-content').is(':visible')) {
                                if ($('.coveo-dropdown-background').length == 0) {
                                    $('.CoveoSearchInterface').append('<div class="coveo-dropdown-background coveo-dropdown-background-active" style="opacity: 0.9;"></div>');
                                }
                            } else {
                                $('.coveo-dropdown-background-active').remove();
                                column.style.display = 'none';
                            }
                        }, 50);
                    });
                }, 0);

              
                var facetButton = document.querySelector(
                    '.coveo-dropdown-header-wrapper'
                );
                if (
                    column.querySelector('.CoveoCategoryFacet') &&
                    column.querySelector('.CoveoFacet')
                ) {
                    if (
                        column.querySelectorAll('.CoveoCategoryFacet').length ==
                            column.querySelectorAll(
                                '.CoveoCategoryFacet.coveo-hidden'
                            ).length &&
                        column.querySelectorAll('.CoveoFacet').length ==
                            column.querySelectorAll(
                                '.CoveoFacet.coveo-facet-empty'
                            ).length
                    ) {
                        if (
                            document.querySelector(
                                '.coveo-dropdown-header-wrapper'
                            )
                        )
                            facetButton.style.display = 'none';
                        column.style.display = 'none';
                    } else {
                        if (
                            document.querySelector(
                                '.coveo-dropdown-header-wrapper'
                            )
                        )
                            facetButton.style.display = 'inline-flex';
                        if (dimensions.width < 992) {
                            if (
                                document.querySelector(
                                    '.coveo-dropdown-content'
                                )
                            ) {
                                document.querySelector(
                                    '.coveo-dropdown-content'
                                ).style.display = 'block';
                            }
                        } else {
                            column.style.display = 'block';
                        }
                    }
                } else if (
                    column.querySelector('.CoveoFacet') ||
                    column.querySelector('.CoveoCategoryFacet')
                ) {
                    if (
                        column.querySelector('.coveo-hidden') ||
                        column.querySelector('.coveo-empty-facet')
                    ) {
                        if (
                            document.querySelector(
                                '.coveo-dropdown-header-wrapper'
                            )
                        )
                            facetButton.style.display = 'none';
                        column.style.display = 'none';
                    } else {
                        if (
                            document.querySelector(
                                '.coveo-dropdown-header-wrapper'
                            )
                        )
                            facetButton.style.display = 'inline-flex';
                        if (dimensions.width < 992) {
                            if (
                                document.querySelector(
                                    '.coveo-dropdown-content'
                                )
                            ) {
                                document.querySelector(
                                    '.coveo-dropdown-content'
                                ).style.display = 'block';
                            }
                        } else {
                            column.style.display = 'block';
                        }
                    }
                }
            });
        },
        filterButton: function () {
            $('.coveo-facet-dropdown-header').on("click", function () {
                $(
                    '.coveo-facet-dropdown-header.coveo-dropdown-header-active p'
                ).toggleClass('apply');
                $('.coveo-facet-dropdown-modal-content').addClass('coveo-facet-dropdown-content');
                $('.coveo-facet-modal-close-button').hide();
                $('body').css('overflow', 'unset');
                if ($('.coveo-dropdown-background').size() == 0) {
                    $('.CoveoSearchInterface').append('<div class="coveo-dropdown-background coveo-dropdown-background-active" style="opacity: 0.9;"></div>');
                    
                } else {
                    $('.coveo-dropdown-background').remove();
                }
            });
        },
        headerSearchOpen: function () {
            $('.score-image-button.desktop-search-button').on("click", function (e) {
                e.stopPropagation();
                e.preventDefault();  
                $('.score-style-box.search-box').toggleClass('open');              
                setTimeout(function () {
                    $('header .CoveoSearchbox').find('input').focus();
                }, 300);

                if ($('.score-style-box.search-box').hasClass('open')) {
                    $('body').addClass('open');
                    $('.desktop-search-button').addClass('active');
                } else {
                    $('body').removeClass('open');
                    $('.desktop-search-button').removeClass('active');
                }
            });
            $('.score-style-box.mobile-search-button').on("click", function (e) {
                e.stopPropagation();
                e.preventDefault();
                if ($('.navbar-collapse.collapse.in ').length) {
                    $('.navbar-toggle').trigger("click");
                }

                $('.score-style-box.search-box').addClass('open');
                $('body').addClass('open');
            });
            var srchBtn = $('.desktop-search-button').closest(
                '.score-style-box'
            );
            // close searchbar after pressing enter
            srchBtn.attr({ tabindex: '0' });
            srchBtn.on('keyup', function (e) {
                if (e.keyCode == 13) {
                    $('.desktop-search-button').trigger("click");
                }
            });
        },
        headerSearchClose: function () {
            $('.search-box .score-image-button').on("click", function (e) {
                e.stopPropagation();
                e.preventDefault();
                $('.score-style-box.search-box').removeClass('open');
            });
            // close searchbar when menu item is clicked
            $('.ansi-header .score-megamenu-dropdown').on("click", function () {
                $('.score-style-box.search-box').removeClass('open');
                $('.desktop-search-button').removeClass('active');
                $('body').removeClass('open');
            });
            $(document).on("click", function (e) {
                // close searchbar unless clicking in searchbar
                if ($('.search-box.open').has(e.target).length === 0) {
                    $('.score-style-box.search-box').removeClass('open');
                    $('.desktop-search-button').removeClass('active');
                    $('body').removeClass('open');
                }
            });
            $(document).keyup(function (e) {
                // close searchbar on esc key press
                if (!e) e = event;
                if (e.keyCode == 27) {
                    e.stopPropagation();
                    $('.score-style-box.search-box').removeClass('open');
                    $('.desktop-search-button').removeClass('active');
                    $('body').removeClass('open');
                }
            });
        },
    };
    if (!sitecoreUtils.prototype.isEditing())
        Promise.resolve().then(searchpage.init);
});

define('ScrollBarWidth',['jquery'], function ($) {
  var scrollBarWidth = {
    detectIE: function () {
      var ua = window.navigator.userAgent;
      var msie = ua.indexOf('MSIE ');
      if (msie > 0) {
        return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
      }
      var trident = ua.indexOf('Trident/');
      if (trident > 0) {
        var rv = ua.indexOf('rv:');
        return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
      }
      var edge = ua.indexOf('Edge/');
      if (edge > 0) {
        return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
      }
      return false;
    },
    getwidth: function () {
      if (scrollBarWidth.detectIE()) {
        return 0;
      }
      var inner = document.createElement('p');
      inner.style.width = '100%';
      inner.style.height = '200px';
      var outer = document.createElement('div');
      outer.style.position = 'absolute';
      outer.style.top = '0px';
      outer.style.left = '0px';
      outer.style.visibility = 'hidden';
      outer.style.width = '200px';
      outer.style.height = '150px';
      outer.style.overflow = 'hidden';
      outer.appendChild(inner);
      document.body.appendChild(outer);
      var w1 = inner.offsetWidth;
      outer.style.overflow = 'scroll';
      var w2 = inner.offsetWidth;
      if (w1 === w2) w2 = outer.clientWidth;
      document.body.removeChild(outer);
      return w1 - w2;
    },
    scrollWidth: function () {
      if (!sessionStorage.getItem('browserScrollWidth')) {
        sessionStorage.setItem('browserScrollWidth', scrollBarWidth.getwidth());
      }
    }
  };

  if (typeof Sitecore != typeof void 0 && typeof Sitecore.PageModes != typeof void 0 && Sitecore.PageModes != null && Sitecore.PageModes.PageEditor != null) return;
  setTimeout(scrollBarWidth.scrollWidth, 0);
});

/**
 * Swiper 5.2.1
 * Most modern mobile touch slider and framework with hardware accelerated transitions
 * http://swiperjs.com
 *
 * Copyright 2014-2019 Vladimir Kharlampidi
 *
 * Released under the MIT License
 *
 * Released on: November 16, 2019
 */

!function ( e, t ) { "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define( 'Swiper',t ) : ( e = e || self ).Swiper = t() }( this, ( function () { "use strict"; var e = "undefined" == typeof document ? { body: {}, addEventListener: function () { }, removeEventListener: function () { }, activeElement: { blur: function () { }, nodeName: "" }, querySelector: function () { return null }, querySelectorAll: function () { return [] }, getElementById: function () { return null }, createEvent: function () { return { initEvent: function () { } } }, createElement: function () { return { children: [], childNodes: [], style: {}, setAttribute: function () { }, getElementsByTagName: function () { return [] } } }, location: { hash: "" } } : document, t = "undefined" == typeof window ? { document: e, navigator: { userAgent: "" }, location: {}, history: {}, CustomEvent: function () { return this }, addEventListener: function () { }, removeEventListener: function () { }, getComputedStyle: function () { return { getPropertyValue: function () { return "" } } }, Image: function () { }, Date: function () { }, screen: {}, setTimeout: function () { }, clearTimeout: function () { } } : window, i = function ( e ) { for ( var t = 0; t < e.length; t += 1 )this[t] = e[t]; return this.length = e.length, this }; function s( s, a ) { var r = [], n = 0; if ( s && !a && s instanceof i ) return s; if ( s ) if ( "string" == typeof s ) { var o, l, d = s.trim(); if ( d.indexOf( "<" ) >= 0 && d.indexOf( ">" ) >= 0 ) { var h = "div"; for ( 0 === d.indexOf( "<li" ) && ( h = "ul" ), 0 === d.indexOf( "<tr" ) && ( h = "tbody" ), 0 !== d.indexOf( "<td" ) && 0 !== d.indexOf( "<th" ) || ( h = "tr" ), 0 === d.indexOf( "<tbody" ) && ( h = "table" ), 0 === d.indexOf( "<option" ) && ( h = "select" ), ( l = e.createElement( h ) ).innerHTML = d, n = 0; n < l.childNodes.length; n += 1 )r.push( l.childNodes[n] ) } else for ( o = a || "#" !== s[0] || s.match( /[ .<>:~]/ ) ? ( a || e ).querySelectorAll( s.trim() ) : [e.getElementById( s.trim().split( "#" )[1] )], n = 0; n < o.length; n += 1 )o[n] && r.push( o[n] ) } else if ( s.nodeType || s === t || s === e ) r.push( s ); else if ( s.length > 0 && s[0].nodeType ) for ( n = 0; n < s.length; n += 1 )r.push( s[n] ); return new i( r ) } function a( e ) { for ( var t = [], i = 0; i < e.length; i += 1 )-1 === t.indexOf( e[i] ) && t.push( e[i] ); return t } s.fn = i.prototype, s.Class = i, s.Dom7 = i; var r = { addClass: function ( e ) { if ( void 0 === e ) return this; for ( var t = e.split( " " ), i = 0; i < t.length; i += 1 )for ( var s = 0; s < this.length; s += 1 )void 0 !== this[s] && void 0 !== this[s].classList && this[s].classList.add( t[i] ); return this }, removeClass: function ( e ) { for ( var t = e.split( " " ), i = 0; i < t.length; i += 1 )for ( var s = 0; s < this.length; s += 1 )void 0 !== this[s] && void 0 !== this[s].classList && this[s].classList.remove( t[i] ); return this }, hasClass: function ( e ) { return !!this[0] && this[0].classList.contains( e ) }, toggleClass: function ( e ) { for ( var t = e.split( " " ), i = 0; i < t.length; i += 1 )for ( var s = 0; s < this.length; s += 1 )void 0 !== this[s] && void 0 !== this[s].classList && this[s].classList.toggle( t[i] ); return this }, attr: function ( e, t ) { var i = arguments; if ( 1 === arguments.length && "string" == typeof e ) return this[0] ? this[0].getAttribute( e ) : void 0; for ( var s = 0; s < this.length; s += 1 )if ( 2 === i.length ) this[s].setAttribute( e, t ); else for ( var a in e ) this[s][a] = e[a], this[s].setAttribute( a, e[a] ); return this }, removeAttr: function ( e ) { for ( var t = 0; t < this.length; t += 1 )this[t].removeAttribute( e ); return this }, data: function ( e, t ) { var i; if ( void 0 !== t ) { for ( var s = 0; s < this.length; s += 1 )( i = this[s] ).dom7ElementDataStorage || ( i.dom7ElementDataStorage = {} ), i.dom7ElementDataStorage[e] = t; return this } if ( i = this[0] ) { if ( i.dom7ElementDataStorage && e in i.dom7ElementDataStorage ) return i.dom7ElementDataStorage[e]; var a = i.getAttribute( "data-" + e ); return a || void 0 } }, transform: function ( e ) { for ( var t = 0; t < this.length; t += 1 ) { var i = this[t].style; i.webkitTransform = e, i.transform = e } return this }, transition: function ( e ) { "string" != typeof e && ( e += "ms" ); for ( var t = 0; t < this.length; t += 1 ) { var i = this[t].style; i.webkitTransitionDuration = e, i.transitionDuration = e } return this }, on: function () { for ( var e, t = [], i = arguments.length; i--; )t[i] = arguments[i]; var a = t[0], r = t[1], n = t[2], o = t[3]; function l( e ) { var t = e.target; if ( t ) { var i = e.target.dom7EventData || []; if ( i.indexOf( e ) < 0 && i.unshift( e ), s( t ).is( r ) ) n.apply( t, i ); else for ( var a = s( t ).parents(), o = 0; o < a.length; o += 1 )s( a[o] ).is( r ) && n.apply( a[o], i ) } } function d( e ) { var t = e && e.target && e.target.dom7EventData || []; t.indexOf( e ) < 0 && t.unshift( e ), n.apply( this, t ) } "function" == typeof t[1] && ( a = ( e = t )[0], n = e[1], o = e[2], r = void 0 ), o || ( o = !1 ); for ( var h, p = a.split( " " ), c = 0; c < this.length; c += 1 ) { var u = this[c]; if ( r ) for ( h = 0; h < p.length; h += 1 ) { var v = p[h]; u.dom7LiveListeners || ( u.dom7LiveListeners = {} ), u.dom7LiveListeners[v] || ( u.dom7LiveListeners[v] = [] ), u.dom7LiveListeners[v].push( { listener: n, proxyListener: l } ), u.addEventListener( v, l, o ) } else for ( h = 0; h < p.length; h += 1 ) { var f = p[h]; u.dom7Listeners || ( u.dom7Listeners = {} ), u.dom7Listeners[f] || ( u.dom7Listeners[f] = [] ), u.dom7Listeners[f].push( { listener: n, proxyListener: d } ), u.addEventListener( f, d, o ) } } return this }, off: function () { for ( var e, t = [], i = arguments.length; i--; )t[i] = arguments[i]; var s = t[0], a = t[1], r = t[2], n = t[3]; "function" == typeof t[1] && ( s = ( e = t )[0], r = e[1], n = e[2], a = void 0 ), n || ( n = !1 ); for ( var o = s.split( " " ), l = 0; l < o.length; l += 1 )for ( var d = o[l], h = 0; h < this.length; h += 1 ) { var p = this[h], c = void 0; if ( !a && p.dom7Listeners ? c = p.dom7Listeners[d] : a && p.dom7LiveListeners && ( c = p.dom7LiveListeners[d] ), c && c.length ) for ( var u = c.length - 1; u >= 0; u -= 1 ) { var v = c[u]; r && v.listener === r ? ( p.removeEventListener( d, v.proxyListener, n ), c.splice( u, 1 ) ) : r && v.listener && v.listener.dom7proxy && v.listener.dom7proxy === r ? ( p.removeEventListener( d, v.proxyListener, n ), c.splice( u, 1 ) ) : r || ( p.removeEventListener( d, v.proxyListener, n ), c.splice( u, 1 ) ) } } return this }, trigger: function () { for ( var i = [], s = arguments.length; s--; )i[s] = arguments[s]; for ( var a = i[0].split( " " ), r = i[1], n = 0; n < a.length; n += 1 )for ( var o = a[n], l = 0; l < this.length; l += 1 ) { var d = this[l], h = void 0; try { h = new t.CustomEvent( o, { detail: r, bubbles: !0, cancelable: !0 } ) } catch ( t ) { ( h = e.createEvent( "Event" ) ).initEvent( o, !0, !0 ), h.detail = r } d.dom7EventData = i.filter( ( function ( e, t ) { return t > 0 } ) ), d.dispatchEvent( h ), d.dom7EventData = [], delete d.dom7EventData } return this }, transitionEnd: function ( e ) { var t, i = ["webkitTransitionEnd", "transitionend"], s = this; function a( r ) { if ( r.target === this ) for ( e.call( this, r ), t = 0; t < i.length; t += 1 )s.off( i[t], a ) } if ( e ) for ( t = 0; t < i.length; t += 1 )s.on( i[t], a ); return this }, outerWidth: function ( e ) { if ( this.length > 0 ) { if ( e ) { var t = this.styles(); return this[0].offsetWidth + parseFloat( t.getPropertyValue( "margin-right" ) ) + parseFloat( t.getPropertyValue( "margin-left" ) ) } return this[0].offsetWidth } return null }, outerHeight: function ( e ) { if ( this.length > 0 ) { if ( e ) { var t = this.styles(); return this[0].offsetHeight + parseFloat( t.getPropertyValue( "margin-top" ) ) + parseFloat( t.getPropertyValue( "margin-bottom" ) ) } return this[0].offsetHeight } return null }, offset: function () { if ( this.length > 0 ) { var i = this[0], s = i.getBoundingClientRect(), a = e.body, r = i.clientTop || a.clientTop || 0, n = i.clientLeft || a.clientLeft || 0, o = i === t ? t.scrollY : i.scrollTop, l = i === t ? t.scrollX : i.scrollLeft; return { top: s.top + o - r, left: s.left + l - n } } return null }, css: function ( e, i ) { var s; if ( 1 === arguments.length ) { if ( "string" != typeof e ) { for ( s = 0; s < this.length; s += 1 )for ( var a in e ) this[s].style[a] = e[a]; return this } if ( this[0] ) return t.getComputedStyle( this[0], null ).getPropertyValue( e ) } if ( 2 === arguments.length && "string" == typeof e ) { for ( s = 0; s < this.length; s += 1 )this[s].style[e] = i; return this } return this }, each: function ( e ) { if ( !e ) return this; for ( var t = 0; t < this.length; t += 1 )if ( !1 === e.call( this[t], t, this[t] ) ) return this; return this }, html: function ( e ) { if ( void 0 === e ) return this[0] ? this[0].innerHTML : void 0; for ( var t = 0; t < this.length; t += 1 )this[t].innerHTML = e; return this }, text: function ( e ) { if ( void 0 === e ) return this[0] ? this[0].textContent.trim() : null; for ( var t = 0; t < this.length; t += 1 )this[t].textContent = e; return this }, is: function ( a ) { var r, n, o = this[0]; if ( !o || void 0 === a ) return !1; if ( "string" == typeof a ) { if ( o.matches ) return o.matches( a ); if ( o.webkitMatchesSelector ) return o.webkitMatchesSelector( a ); if ( o.msMatchesSelector ) return o.msMatchesSelector( a ); for ( r = s( a ), n = 0; n < r.length; n += 1 )if ( r[n] === o ) return !0; return !1 } if ( a === e ) return o === e; if ( a === t ) return o === t; if ( a.nodeType || a instanceof i ) { for ( r = a.nodeType ? [a] : a, n = 0; n < r.length; n += 1 )if ( r[n] === o ) return !0; return !1 } return !1 }, index: function () { var e, t = this[0]; if ( t ) { for ( e = 0; null !== ( t = t.previousSibling ); )1 === t.nodeType && ( e += 1 ); return e } }, eq: function ( e ) { if ( void 0 === e ) return this; var t, s = this.length; return new i( e > s - 1 ? [] : e < 0 ? ( t = s + e ) < 0 ? [] : [this[t]] : [this[e]] ) }, append: function () { for ( var t, s = [], a = arguments.length; a--; )s[a] = arguments[a]; for ( var r = 0; r < s.length; r += 1 ) { t = s[r]; for ( var n = 0; n < this.length; n += 1 )if ( "string" == typeof t ) { var o = e.createElement( "div" ); for ( o.innerHTML = t; o.firstChild; )this[n].appendChild( o.firstChild ) } else if ( t instanceof i ) for ( var l = 0; l < t.length; l += 1 )this[n].appendChild( t[l] ); else this[n].appendChild( t ) } return this }, prepend: function ( t ) { var s, a; for ( s = 0; s < this.length; s += 1 )if ( "string" == typeof t ) { var r = e.createElement( "div" ); for ( r.innerHTML = t, a = r.childNodes.length - 1; a >= 0; a -= 1 )this[s].insertBefore( r.childNodes[a], this[s].childNodes[0] ) } else if ( t instanceof i ) for ( a = 0; a < t.length; a += 1 )this[s].insertBefore( t[a], this[s].childNodes[0] ); else this[s].insertBefore( t, this[s].childNodes[0] ); return this }, next: function ( e ) { return this.length > 0 ? e ? this[0].nextElementSibling && s( this[0].nextElementSibling ).is( e ) ? new i( [this[0].nextElementSibling] ) : new i( [] ) : this[0].nextElementSibling ? new i( [this[0].nextElementSibling] ) : new i( [] ) : new i( [] ) }, nextAll: function ( e ) { var t = [], a = this[0]; if ( !a ) return new i( [] ); for ( ; a.nextElementSibling; ) { var r = a.nextElementSibling; e ? s( r ).is( e ) && t.push( r ) : t.push( r ), a = r } return new i( t ) }, prev: function ( e ) { if ( this.length > 0 ) { var t = this[0]; return e ? t.previousElementSibling && s( t.previousElementSibling ).is( e ) ? new i( [t.previousElementSibling] ) : new i( [] ) : t.previousElementSibling ? new i( [t.previousElementSibling] ) : new i( [] ) } return new i( [] ) }, prevAll: function ( e ) { var t = [], a = this[0]; if ( !a ) return new i( [] ); for ( ; a.previousElementSibling; ) { var r = a.previousElementSibling; e ? s( r ).is( e ) && t.push( r ) : t.push( r ), a = r } return new i( t ) }, parent: function ( e ) { for ( var t = [], i = 0; i < this.length; i += 1 )null !== this[i].parentNode && ( e ? s( this[i].parentNode ).is( e ) && t.push( this[i].parentNode ) : t.push( this[i].parentNode ) ); return s( a( t ) ) }, parents: function ( e ) { for ( var t = [], i = 0; i < this.length; i += 1 )for ( var r = this[i].parentNode; r; )e ? s( r ).is( e ) && t.push( r ) : t.push( r ), r = r.parentNode; return s( a( t ) ) }, closest: function ( e ) { var t = this; return void 0 === e ? new i( [] ) : ( t.is( e ) || ( t = t.parents( e ).eq( 0 ) ), t ) }, find: function ( e ) { for ( var t = [], s = 0; s < this.length; s += 1 )for ( var a = this[s].querySelectorAll( e ), r = 0; r < a.length; r += 1 )t.push( a[r] ); return new i( t ) }, children: function ( e ) { for ( var t = [], r = 0; r < this.length; r += 1 )for ( var n = this[r].childNodes, o = 0; o < n.length; o += 1 )e ? 1 === n[o].nodeType && s( n[o] ).is( e ) && t.push( n[o] ) : 1 === n[o].nodeType && t.push( n[o] ); return new i( a( t ) ) }, filter: function ( e ) { for ( var t = [], s = 0; s < this.length; s += 1 )e.call( this[s], s, this[s] ) && t.push( this[s] ); return new i( t ) }, remove: function () { for ( var e = 0; e < this.length; e += 1 )this[e].parentNode && this[e].parentNode.removeChild( this[e] ); return this }, add: function () { for ( var e = [], t = arguments.length; t--; )e[t] = arguments[t]; var i, a; for ( i = 0; i < e.length; i += 1 ) { var r = s( e[i] ); for ( a = 0; a < r.length; a += 1 )this[this.length] = r[a], this.length += 1 } return this }, styles: function () { return this[0] ? t.getComputedStyle( this[0], null ) : {} } }; Object.keys( r ).forEach( ( function ( e ) { s.fn[e] = s.fn[e] || r[e] } ) ); var n = { deleteProps: function ( e ) { var t = e; Object.keys( t ).forEach( ( function ( e ) { try { t[e] = null } catch ( e ) { } try { delete t[e] } catch ( e ) { } } ) ) }, nextTick: function ( e, t ) { return void 0 === t && ( t = 0 ), setTimeout( e, t ) }, now: function () { return Date.now() }, getTranslate: function ( e, i ) { var s, a, r; void 0 === i && ( i = "x" ); var n = t.getComputedStyle( e, null ); return t.WebKitCSSMatrix ? ( ( a = n.transform || n.webkitTransform ).split( "," ).length > 6 && ( a = a.split( ", " ).map( ( function ( e ) { return e.replace( ",", "." ) } ) ).join( ", " ) ), r = new t.WebKitCSSMatrix( "none" === a ? "" : a ) ) : s = ( r = n.MozTransform || n.OTransform || n.MsTransform || n.msTransform || n.transform || n.getPropertyValue( "transform" ).replace( "translate(", "matrix(1, 0, 0, 1," ) ).toString().split( "," ), "x" === i && ( a = t.WebKitCSSMatrix ? r.m41 : 16 === s.length ? parseFloat( s[12] ) : parseFloat( s[4] ) ), "y" === i && ( a = t.WebKitCSSMatrix ? r.m42 : 16 === s.length ? parseFloat( s[13] ) : parseFloat( s[5] ) ), a || 0 }, parseUrlQuery: function ( e ) { var i, s, a, r, n = {}, o = e || t.location.href; if ( "string" == typeof o && o.length ) for ( r = ( s = ( o = o.indexOf( "?" ) > -1 ? o.replace( /\S*\?/, "" ) : "" ).split( "&" ).filter( ( function ( e ) { return "" !== e } ) ) ).length, i = 0; i < r; i += 1 )a = s[i].replace( /#\S+/g, "" ).split( "=" ), n[decodeURIComponent( a[0] )] = void 0 === a[1] ? void 0 : decodeURIComponent( a[1] ) || ""; return n }, isObject: function ( e ) { return "object" == typeof e && null !== e && e.constructor && e.constructor === Object }, extend: function () { for ( var e = [], t = arguments.length; t--; )e[t] = arguments[t]; for ( var i = Object( e[0] ), s = 1; s < e.length; s += 1 ) { var a = e[s]; if ( null != a ) for ( var r = Object.keys( Object( a ) ), o = 0, l = r.length; o < l; o += 1 ) { var d = r[o], h = Object.getOwnPropertyDescriptor( a, d ); void 0 !== h && h.enumerable && ( n.isObject( i[d] ) && n.isObject( a[d] ) ? n.extend( i[d], a[d] ) : !n.isObject( i[d] ) && n.isObject( a[d] ) ? ( i[d] = {}, n.extend( i[d], a[d] ) ) : i[d] = a[d] ) } } return i } }, o = { touch: t.Modernizr && !0 === t.Modernizr.touch || !!( t.navigator.maxTouchPoints > 0 || "ontouchstart" in t || t.DocumentTouch && e instanceof t.DocumentTouch ), pointerEvents: !!t.PointerEvent && "maxTouchPoints" in t.navigator && t.navigator.maxTouchPoints > 0, observer: "MutationObserver" in t || "WebkitMutationObserver" in t, passiveListener: function () { var e = !1; try { var i = Object.defineProperty( {}, "passive", { get: function () { e = !0 } } ); t.addEventListener( "testPassiveListener", null, i ) } catch ( e ) { } return e }(), gestures: "ongesturestart" in t }, l = function ( e ) { void 0 === e && ( e = {} ); var t = this; t.params = e, t.eventsListeners = {}, t.params && t.params.on && Object.keys( t.params.on ).forEach( ( function ( e ) { t.on( e, t.params.on[e] ) } ) ) }, d = { components: { configurable: !0 } }; l.prototype.on = function ( e, t, i ) { var s = this; if ( "function" != typeof t ) return s; var a = i ? "unshift" : "push"; return e.split( " " ).forEach( ( function ( e ) { s.eventsListeners[e] || ( s.eventsListeners[e] = [] ), s.eventsListeners[e][a]( t ) } ) ), s }, l.prototype.once = function ( e, t, i ) { var s = this; if ( "function" != typeof t ) return s; function a() { for ( var i = [], r = arguments.length; r--; )i[r] = arguments[r]; s.off( e, a ), a.f7proxy && delete a.f7proxy, t.apply( s, i ) } return a.f7proxy = t, s.on( e, a, i ) }, l.prototype.off = function ( e, t ) { var i = this; return i.eventsListeners ? ( e.split( " " ).forEach( ( function ( e ) { void 0 === t ? i.eventsListeners[e] = [] : i.eventsListeners[e] && i.eventsListeners[e].length && i.eventsListeners[e].forEach( ( function ( s, a ) { ( s === t || s.f7proxy && s.f7proxy === t ) && i.eventsListeners[e].splice( a, 1 ) } ) ) } ) ), i ) : i }, l.prototype.emit = function () { for ( var e = [], t = arguments.length; t--; )e[t] = arguments[t]; var i, s, a, r = this; if ( !r.eventsListeners ) return r; "string" == typeof e[0] || Array.isArray( e[0] ) ? ( i = e[0], s = e.slice( 1, e.length ), a = r ) : ( i = e[0].events, s = e[0].data, a = e[0].context || r ); var n = Array.isArray( i ) ? i : i.split( " " ); return n.forEach( ( function ( e ) { if ( r.eventsListeners && r.eventsListeners[e] ) { var t = []; r.eventsListeners[e].forEach( ( function ( e ) { t.push( e ) } ) ), t.forEach( ( function ( e ) { e.apply( a, s ) } ) ) } } ) ), r }, l.prototype.useModulesParams = function ( e ) { var t = this; t.modules && Object.keys( t.modules ).forEach( ( function ( i ) { var s = t.modules[i]; s.params && n.extend( e, s.params ) } ) ) }, l.prototype.useModules = function ( e ) { void 0 === e && ( e = {} ); var t = this; t.modules && Object.keys( t.modules ).forEach( ( function ( i ) { var s = t.modules[i], a = e[i] || {}; s.instance && Object.keys( s.instance ).forEach( ( function ( e ) { var i = s.instance[e]; t[e] = "function" == typeof i ? i.bind( t ) : i } ) ), s.on && t.on && Object.keys( s.on ).forEach( ( function ( e ) { t.on( e, s.on[e] ) } ) ), s.create && s.create.bind( t )( a ) } ) ) }, d.components.set = function ( e ) { this.use && this.use( e ) }, l.installModule = function ( e ) { for ( var t = [], i = arguments.length - 1; i-- > 0; )t[i] = arguments[i + 1]; var s = this; s.prototype.modules || ( s.prototype.modules = {} ); var a = e.name || Object.keys( s.prototype.modules ).length + "_" + n.now(); return s.prototype.modules[a] = e, e.proto && Object.keys( e.proto ).forEach( ( function ( t ) { s.prototype[t] = e.proto[t] } ) ), e.static && Object.keys( e.static ).forEach( ( function ( t ) { s[t] = e.static[t] } ) ), e.install && e.install.apply( s, t ), s }, l.use = function ( e ) { for ( var t = [], i = arguments.length - 1; i-- > 0; )t[i] = arguments[i + 1]; var s = this; return Array.isArray( e ) ? ( e.forEach( ( function ( e ) { return s.installModule( e ) } ) ), s ) : s.installModule.apply( s, [e].concat( t ) ) }, Object.defineProperties( l, d ); var h = { updateSize: function () { var e, t, i = this.$el; e = void 0 !== this.params.width ? this.params.width : i[0].clientWidth, t = void 0 !== this.params.height ? this.params.height : i[0].clientHeight, 0 === e && this.isHorizontal() || 0 === t && this.isVertical() || ( e = e - parseInt( i.css( "padding-left" ), 10 ) - parseInt( i.css( "padding-right" ), 10 ), t = t - parseInt( i.css( "padding-top" ), 10 ) - parseInt( i.css( "padding-bottom" ), 10 ), n.extend( this, { width: e, height: t, size: this.isHorizontal() ? e : t } ) ) }, updateSlides: function () { var e = this.params, i = this.$wrapperEl, s = this.size, a = this.rtlTranslate, r = this.wrongRTL, o = this.virtual && e.virtual.enabled, l = o ? this.virtual.slides.length : this.slides.length, d = i.children( "." + this.params.slideClass ), h = o ? this.virtual.slides.length : d.length, p = [], c = [], u = []; function v( t ) { return !e.cssMode || t !== d.length - 1 } var f = e.slidesOffsetBefore; "function" == typeof f && ( f = e.slidesOffsetBefore.call( this ) ); var m = e.slidesOffsetAfter; "function" == typeof m && ( m = e.slidesOffsetAfter.call( this ) ); var g = this.snapGrid.length, b = this.snapGrid.length, w = e.spaceBetween, y = -f, x = 0, T = 0; if ( void 0 !== s ) { var E, S; "string" == typeof w && w.indexOf( "%" ) >= 0 && ( w = parseFloat( w.replace( "%", "" ) ) / 100 * s ), this.virtualSize = -w, a ? d.css( { marginLeft: "", marginTop: "" } ) : d.css( { marginRight: "", marginBottom: "" } ), e.slidesPerColumn > 1 && ( E = Math.floor( h / e.slidesPerColumn ) === h / this.params.slidesPerColumn ? h : Math.ceil( h / e.slidesPerColumn ) * e.slidesPerColumn, "auto" !== e.slidesPerView && "row" === e.slidesPerColumnFill && ( E = Math.max( E, e.slidesPerView * e.slidesPerColumn ) ) ); for ( var C, M = e.slidesPerColumn, P = E / M, z = Math.floor( h / e.slidesPerColumn ), k = 0; k < h; k += 1 ) { S = 0; var $ = d.eq( k ); if ( e.slidesPerColumn > 1 ) { var L = void 0, I = void 0, D = void 0; if ( "row" === e.slidesPerColumnFill && e.slidesPerGroup > 1 ) { var O = Math.floor( k / ( e.slidesPerGroup * e.slidesPerColumn ) ), A = k - e.slidesPerColumn * e.slidesPerGroup * O, G = 0 === O ? e.slidesPerGroup : Math.min( Math.ceil( ( h - O * M * e.slidesPerGroup ) / M ), e.slidesPerGroup ); L = ( I = A - ( D = Math.floor( A / G ) ) * G + O * e.slidesPerGroup ) + D * E / M, $.css( { "-webkit-box-ordinal-group": L, "-moz-box-ordinal-group": L, "-ms-flex-order": L, "-webkit-order": L, order: L } ) } else "column" === e.slidesPerColumnFill ? ( D = k - ( I = Math.floor( k / M ) ) * M, ( I > z || I === z && D === M - 1 ) && ( D += 1 ) >= M && ( D = 0, I += 1 ) ) : I = k - ( D = Math.floor( k / P ) ) * P; $.css( "margin-" + ( this.isHorizontal() ? "top" : "left" ), 0 !== D && e.spaceBetween && e.spaceBetween + "px" ) } if ( "none" !== $.css( "display" ) ) { if ( "auto" === e.slidesPerView ) { var B = t.getComputedStyle( $[0], null ), H = $[0].style.transform, N = $[0].style.webkitTransform; if ( H && ( $[0].style.transform = "none" ), N && ( $[0].style.webkitTransform = "none" ), e.roundLengths ) S = this.isHorizontal() ? $.outerWidth( !0 ) : $.outerHeight( !0 ); else if ( this.isHorizontal() ) { var X = parseFloat( B.getPropertyValue( "width" ) ), V = parseFloat( B.getPropertyValue( "padding-left" ) ), Y = parseFloat( B.getPropertyValue( "padding-right" ) ), F = parseFloat( B.getPropertyValue( "margin-left" ) ), W = parseFloat( B.getPropertyValue( "margin-right" ) ), R = B.getPropertyValue( "box-sizing" ); S = R && "border-box" === R ? X + F + W : X + V + Y + F + W } else { var q = parseFloat( B.getPropertyValue( "height" ) ), j = parseFloat( B.getPropertyValue( "padding-top" ) ), K = parseFloat( B.getPropertyValue( "padding-bottom" ) ), U = parseFloat( B.getPropertyValue( "margin-top" ) ), _ = parseFloat( B.getPropertyValue( "margin-bottom" ) ), Z = B.getPropertyValue( "box-sizing" ); S = Z && "border-box" === Z ? q + U + _ : q + j + K + U + _ } H && ( $[0].style.transform = H ), N && ( $[0].style.webkitTransform = N ), e.roundLengths && ( S = Math.floor( S ) ) } else S = ( s - ( e.slidesPerView - 1 ) * w ) / e.slidesPerView, e.roundLengths && ( S = Math.floor( S ) ), d[k] && ( this.isHorizontal() ? d[k].style.width = S + "px" : d[k].style.height = S + "px" ); d[k] && ( d[k].swiperSlideSize = S ), u.push( S ), e.centeredSlides ? ( y = y + S / 2 + x / 2 + w, 0 === x && 0 !== k && ( y = y - s / 2 - w ), 0 === k && ( y = y - s / 2 - w ), Math.abs( y ) < .001 && ( y = 0 ), e.roundLengths && ( y = Math.floor( y ) ), T % e.slidesPerGroup == 0 && p.push( y ), c.push( y ) ) : ( e.roundLengths && ( y = Math.floor( y ) ), T % e.slidesPerGroup == 0 && p.push( y ), c.push( y ), y = y + S + w ), this.virtualSize += S + w, x = S, T += 1 } } if ( this.virtualSize = Math.max( this.virtualSize, s ) + m, a && r && ( "slide" === e.effect || "coverflow" === e.effect ) && i.css( { width: this.virtualSize + e.spaceBetween + "px" } ), e.setWrapperSize && ( this.isHorizontal() ? i.css( { width: this.virtualSize + e.spaceBetween + "px" } ) : i.css( { height: this.virtualSize + e.spaceBetween + "px" } ) ), e.slidesPerColumn > 1 && ( this.virtualSize = ( S + e.spaceBetween ) * E, this.virtualSize = Math.ceil( this.virtualSize / e.slidesPerColumn ) - e.spaceBetween, this.isHorizontal() ? i.css( { width: this.virtualSize + e.spaceBetween + "px" } ) : i.css( { height: this.virtualSize + e.spaceBetween + "px" } ), e.centeredSlides ) ) { C = []; for ( var Q = 0; Q < p.length; Q += 1 ) { var J = p[Q]; e.roundLengths && ( J = Math.floor( J ) ), p[Q] < this.virtualSize + p[0] && C.push( J ) } p = C } if ( !e.centeredSlides ) { C = []; for ( var ee = 0; ee < p.length; ee += 1 ) { var te = p[ee]; e.roundLengths && ( te = Math.floor( te ) ), p[ee] <= this.virtualSize - s && C.push( te ) } p = C, Math.floor( this.virtualSize - s ) - Math.floor( p[p.length - 1] ) > 1 && p.push( this.virtualSize - s ) } if ( 0 === p.length && ( p = [0] ), 0 !== e.spaceBetween && ( this.isHorizontal() ? a ? d.filter( v ).css( { marginLeft: w + "px" } ) : d.filter( v ).css( { marginRight: w + "px" } ) : d.filter( v ).css( { marginBottom: w + "px" } ) ), e.centeredSlides && e.centeredSlidesBounds ) { var ie = 0; u.forEach( ( function ( t ) { ie += t + ( e.spaceBetween ? e.spaceBetween : 0 ) } ) ); var se = ( ie -= e.spaceBetween ) - s; p = p.map( ( function ( e ) { return e < 0 ? -f : e > se ? se + m : e } ) ) } if ( e.centerInsufficientSlides ) { var ae = 0; if ( u.forEach( ( function ( t ) { ae += t + ( e.spaceBetween ? e.spaceBetween : 0 ) } ) ), ( ae -= e.spaceBetween ) < s ) { var re = ( s - ae ) / 2; p.forEach( ( function ( e, t ) { p[t] = e - re } ) ), c.forEach( ( function ( e, t ) { c[t] = e + re } ) ) } } n.extend( this, { slides: d, snapGrid: p, slidesGrid: c, slidesSizesGrid: u } ), h !== l && this.emit( "slidesLengthChange" ), p.length !== g && ( this.params.watchOverflow && this.checkOverflow(), this.emit( "snapGridLengthChange" ) ), c.length !== b && this.emit( "slidesGridLengthChange" ), ( e.watchSlidesProgress || e.watchSlidesVisibility ) && this.updateSlidesOffset() } }, updateAutoHeight: function ( e ) { var t, i = [], s = 0; if ( "number" == typeof e ? this.setTransition( e ) : !0 === e && this.setTransition( this.params.speed ), "auto" !== this.params.slidesPerView && this.params.slidesPerView > 1 ) for ( t = 0; t < Math.ceil( this.params.slidesPerView ); t += 1 ) { var a = this.activeIndex + t; if ( a > this.slides.length ) break; i.push( this.slides.eq( a )[0] ) } else i.push( this.slides.eq( this.activeIndex )[0] ); for ( t = 0; t < i.length; t += 1 )if ( void 0 !== i[t] ) { var r = i[t].offsetHeight; s = r > s ? r : s } s && this.$wrapperEl.css( "height", s + "px" ) }, updateSlidesOffset: function () { for ( var e = this.slides, t = 0; t < e.length; t += 1 )e[t].swiperSlideOffset = this.isHorizontal() ? e[t].offsetLeft : e[t].offsetTop }, updateSlidesProgress: function ( e ) { void 0 === e && ( e = this && this.translate || 0 ); var t = this.params, i = this.slides, a = this.rtlTranslate; if ( 0 !== i.length ) { void 0 === i[0].swiperSlideOffset && this.updateSlidesOffset(); var r = -e; a && ( r = e ), i.removeClass( t.slideVisibleClass ), this.visibleSlidesIndexes = [], this.visibleSlides = []; for ( var n = 0; n < i.length; n += 1 ) { var o = i[n], l = ( r + ( t.centeredSlides ? this.minTranslate() : 0 ) - o.swiperSlideOffset ) / ( o.swiperSlideSize + t.spaceBetween ); if ( t.watchSlidesVisibility ) { var d = -( r - o.swiperSlideOffset ), h = d + this.slidesSizesGrid[n]; ( d >= 0 && d < this.size - 1 || h > 1 && h <= this.size || d <= 0 && h >= this.size ) && ( this.visibleSlides.push( o ), this.visibleSlidesIndexes.push( n ), i.eq( n ).addClass( t.slideVisibleClass ) ) } o.progress = a ? -l : l } this.visibleSlides = s( this.visibleSlides ) } }, updateProgress: function ( e ) { if ( void 0 === e ) { var t = this.rtlTranslate ? -1 : 1; e = this && this.translate && this.translate * t || 0 } var i = this.params, s = this.maxTranslate() - this.minTranslate(), a = this.progress, r = this.isBeginning, o = this.isEnd, l = r, d = o; 0 === s ? ( a = 0, r = !0, o = !0 ) : ( r = ( a = ( e - this.minTranslate() ) / s ) <= 0, o = a >= 1 ), n.extend( this, { progress: a, isBeginning: r, isEnd: o } ), ( i.watchSlidesProgress || i.watchSlidesVisibility ) && this.updateSlidesProgress( e ), r && !l && this.emit( "reachBeginning toEdge" ), o && !d && this.emit( "reachEnd toEdge" ), ( l && !r || d && !o ) && this.emit( "fromEdge" ), this.emit( "progress", a ) }, updateSlidesClasses: function () { var e, t = this.slides, i = this.params, s = this.$wrapperEl, a = this.activeIndex, r = this.realIndex, n = this.virtual && i.virtual.enabled; t.removeClass( i.slideActiveClass + " " + i.slideNextClass + " " + i.slidePrevClass + " " + i.slideDuplicateActiveClass + " " + i.slideDuplicateNextClass + " " + i.slideDuplicatePrevClass ), ( e = n ? this.$wrapperEl.find( "." + i.slideClass + '[data-swiper-slide-index="' + a + '"]' ) : t.eq( a ) ).addClass( i.slideActiveClass ), i.loop && ( e.hasClass( i.slideDuplicateClass ) ? s.children( "." + i.slideClass + ":not(." + i.slideDuplicateClass + ')[data-swiper-slide-index="' + r + '"]' ).addClass( i.slideDuplicateActiveClass ) : s.children( "." + i.slideClass + "." + i.slideDuplicateClass + '[data-swiper-slide-index="' + r + '"]' ).addClass( i.slideDuplicateActiveClass ) ); var o = e.nextAll( "." + i.slideClass ).eq( 0 ).addClass( i.slideNextClass ); i.loop && 0 === o.length && ( o = t.eq( 0 ) ).addClass( i.slideNextClass ); var l = e.prevAll( "." + i.slideClass ).eq( 0 ).addClass( i.slidePrevClass ); i.loop && 0 === l.length && ( l = t.eq( -1 ) ).addClass( i.slidePrevClass ), i.loop && ( o.hasClass( i.slideDuplicateClass ) ? s.children( "." + i.slideClass + ":not(." + i.slideDuplicateClass + ')[data-swiper-slide-index="' + o.attr( "data-swiper-slide-index" ) + '"]' ).addClass( i.slideDuplicateNextClass ) : s.children( "." + i.slideClass + "." + i.slideDuplicateClass + '[data-swiper-slide-index="' + o.attr( "data-swiper-slide-index" ) + '"]' ).addClass( i.slideDuplicateNextClass ), l.hasClass( i.slideDuplicateClass ) ? s.children( "." + i.slideClass + ":not(." + i.slideDuplicateClass + ')[data-swiper-slide-index="' + l.attr( "data-swiper-slide-index" ) + '"]' ).addClass( i.slideDuplicatePrevClass ) : s.children( "." + i.slideClass + "." + i.slideDuplicateClass + '[data-swiper-slide-index="' + l.attr( "data-swiper-slide-index" ) + '"]' ).addClass( i.slideDuplicatePrevClass ) ) }, updateActiveIndex: function ( e ) { var t, i = this.rtlTranslate ? this.translate : -this.translate, s = this.slidesGrid, a = this.snapGrid, r = this.params, o = this.activeIndex, l = this.realIndex, d = this.snapIndex, h = e; if ( void 0 === h ) { for ( var p = 0; p < s.length; p += 1 )void 0 !== s[p + 1] ? i >= s[p] && i < s[p + 1] - ( s[p + 1] - s[p] ) / 2 ? h = p : i >= s[p] && i < s[p + 1] && ( h = p + 1 ) : i >= s[p] && ( h = p ); r.normalizeSlideIndex && ( h < 0 || void 0 === h ) && ( h = 0 ) } if ( ( t = a.indexOf( i ) >= 0 ? a.indexOf( i ) : Math.floor( h / r.slidesPerGroup ) ) >= a.length && ( t = a.length - 1 ), h !== o ) { var c = parseInt( this.slides.eq( h ).attr( "data-swiper-slide-index" ) || h, 10 ); n.extend( this, { snapIndex: t, realIndex: c, previousIndex: o, activeIndex: h } ), this.emit( "activeIndexChange" ), this.emit( "snapIndexChange" ), l !== c && this.emit( "realIndexChange" ), ( this.initialized || this.runCallbacksOnInit ) && this.emit( "slideChange" ) } else t !== d && ( this.snapIndex = t, this.emit( "snapIndexChange" ) ) }, updateClickedSlide: function ( e ) { var t = this.params, i = s( e.target ).closest( "." + t.slideClass )[0], a = !1; if ( i ) for ( var r = 0; r < this.slides.length; r += 1 )this.slides[r] === i && ( a = !0 ); if ( !i || !a ) return this.clickedSlide = void 0, void ( this.clickedIndex = void 0 ); this.clickedSlide = i, this.virtual && this.params.virtual.enabled ? this.clickedIndex = parseInt( s( i ).attr( "data-swiper-slide-index" ), 10 ) : this.clickedIndex = s( i ).index(), t.slideToClickedSlide && void 0 !== this.clickedIndex && this.clickedIndex !== this.activeIndex && this.slideToClickedSlide() } }; var p = { getTranslate: function ( e ) { void 0 === e && ( e = this.isHorizontal() ? "x" : "y" ); var t = this.params, i = this.rtlTranslate, s = this.translate, a = this.$wrapperEl; if ( t.virtualTranslate ) return i ? -s : s; if ( t.cssMode ) return s; var r = n.getTranslate( a[0], e ); return i && ( r = -r ), r || 0 }, setTranslate: function ( e, t ) { var i = this.rtlTranslate, s = this.params, a = this.$wrapperEl, r = this.wrapperEl, n = this.progress, o = 0, l = 0; this.isHorizontal() ? o = i ? -e : e : l = e, s.roundLengths && ( o = Math.floor( o ), l = Math.floor( l ) ), s.cssMode ? r[this.isHorizontal() ? "scrollLeft" : "scrollTop"] = this.isHorizontal() ? -o : -l : s.virtualTranslate || a.transform( "translate3d(" + o + "px, " + l + "px, 0px)" ), this.previousTranslate = this.translate, this.translate = this.isHorizontal() ? o : l; var d = this.maxTranslate() - this.minTranslate(); ( 0 === d ? 0 : ( e - this.minTranslate() ) / d ) !== n && this.updateProgress( e ), this.emit( "setTranslate", this.translate, t ) }, minTranslate: function () { return -this.snapGrid[0] }, maxTranslate: function () { return -this.snapGrid[this.snapGrid.length - 1] }, translateTo: function ( e, t, i, s, a ) { var r; void 0 === e && ( e = 0 ), void 0 === t && ( t = this.params.speed ), void 0 === i && ( i = !0 ), void 0 === s && ( s = !0 ); var n = this, o = n.params, l = n.wrapperEl; if ( n.animating && o.preventInteractionOnTransition ) return !1; var d, h = n.minTranslate(), p = n.maxTranslate(); if ( d = s && e > h ? h : s && e < p ? p : e, n.updateProgress( d ), o.cssMode ) { var c = n.isHorizontal(); return 0 === t ? l[c ? "scrollLeft" : "scrollTop"] = -d : l.scrollTo ? l.scrollTo( ( ( r = {} )[c ? "left" : "top"] = -d, r.behavior = "smooth", r ) ) : l[c ? "scrollLeft" : "scrollTop"] = -d, !0 } return 0 === t ? ( n.setTransition( 0 ), n.setTranslate( d ), i && ( n.emit( "beforeTransitionStart", t, a ), n.emit( "transitionEnd" ) ) ) : ( n.setTransition( t ), n.setTranslate( d ), i && ( n.emit( "beforeTransitionStart", t, a ), n.emit( "transitionStart" ) ), n.animating || ( n.animating = !0, n.onTranslateToWrapperTransitionEnd || ( n.onTranslateToWrapperTransitionEnd = function ( e ) { n && !n.destroyed && e.target === this && ( n.$wrapperEl[0].removeEventListener( "transitionend", n.onTranslateToWrapperTransitionEnd ), n.$wrapperEl[0].removeEventListener( "webkitTransitionEnd", n.onTranslateToWrapperTransitionEnd ), n.onTranslateToWrapperTransitionEnd = null, delete n.onTranslateToWrapperTransitionEnd, i && n.emit( "transitionEnd" ) ) } ), n.$wrapperEl[0].addEventListener( "transitionend", n.onTranslateToWrapperTransitionEnd ), n.$wrapperEl[0].addEventListener( "webkitTransitionEnd", n.onTranslateToWrapperTransitionEnd ) ) ), !0 } }; var c = { setTransition: function ( e, t ) { this.params.cssMode || this.$wrapperEl.transition( e ), this.emit( "setTransition", e, t ) }, transitionStart: function ( e, t ) { void 0 === e && ( e = !0 ); var i = this.activeIndex, s = this.params, a = this.previousIndex; if ( !s.cssMode ) { s.autoHeight && this.updateAutoHeight(); var r = t; if ( r || ( r = i > a ? "next" : i < a ? "prev" : "reset" ), this.emit( "transitionStart" ), e && i !== a ) { if ( "reset" === r ) return void this.emit( "slideResetTransitionStart" ); this.emit( "slideChangeTransitionStart" ), "next" === r ? this.emit( "slideNextTransitionStart" ) : this.emit( "slidePrevTransitionStart" ) } } }, transitionEnd: function ( e, t ) { void 0 === e && ( e = !0 ); var i = this.activeIndex, s = this.previousIndex, a = this.params; if ( this.animating = !1, !a.cssMode ) { this.setTransition( 0 ); var r = t; if ( r || ( r = i > s ? "next" : i < s ? "prev" : "reset" ), this.emit( "transitionEnd" ), e && i !== s ) { if ( "reset" === r ) return void this.emit( "slideResetTransitionEnd" ); this.emit( "slideChangeTransitionEnd" ), "next" === r ? this.emit( "slideNextTransitionEnd" ) : this.emit( "slidePrevTransitionEnd" ) } } } }; var u = { slideTo: function ( e, t, i, s ) { var a; void 0 === e && ( e = 0 ), void 0 === t && ( t = this.params.speed ), void 0 === i && ( i = !0 ); var r = this, n = e; n < 0 && ( n = 0 ); var o = r.params, l = r.snapGrid, d = r.slidesGrid, h = r.previousIndex, p = r.activeIndex, c = r.rtlTranslate, u = r.wrapperEl; if ( r.animating && o.preventInteractionOnTransition ) return !1; var v = Math.floor( n / o.slidesPerGroup ); v >= l.length && ( v = l.length - 1 ), ( p || o.initialSlide || 0 ) === ( h || 0 ) && i && r.emit( "beforeSlideChangeStart" ); var f, m = -l[v]; if ( r.updateProgress( m ), o.normalizeSlideIndex ) for ( var g = 0; g < d.length; g += 1 )-Math.floor( 100 * m ) >= Math.floor( 100 * d[g] ) && ( n = g ); if ( r.initialized && n !== p ) { if ( !r.allowSlideNext && m < r.translate && m < r.minTranslate() ) return !1; if ( !r.allowSlidePrev && m > r.translate && m > r.maxTranslate() && ( p || 0 ) !== n ) return !1 } if ( f = n > p ? "next" : n < p ? "prev" : "reset", c && -m === r.translate || !c && m === r.translate ) return r.updateActiveIndex( n ), o.autoHeight && r.updateAutoHeight(), r.updateSlidesClasses(), "slide" !== o.effect && r.setTranslate( m ), "reset" !== f && ( r.transitionStart( i, f ), r.transitionEnd( i, f ) ), !1; if ( o.cssMode ) { var b = r.isHorizontal(); return 0 === t ? u[b ? "scrollLeft" : "scrollTop"] = -m : u.scrollTo ? u.scrollTo( ( ( a = {} )[b ? "left" : "top"] = -m, a.behavior = "smooth", a ) ) : u[b ? "scrollLeft" : "scrollTop"] = -m, !0 } return 0 === t ? ( r.setTransition( 0 ), r.setTranslate( m ), r.updateActiveIndex( n ), r.updateSlidesClasses(), r.emit( "beforeTransitionStart", t, s ), r.transitionStart( i, f ), r.transitionEnd( i, f ) ) : ( r.setTransition( t ), r.setTranslate( m ), r.updateActiveIndex( n ), r.updateSlidesClasses(), r.emit( "beforeTransitionStart", t, s ), r.transitionStart( i, f ), r.animating || ( r.animating = !0, r.onSlideToWrapperTransitionEnd || ( r.onSlideToWrapperTransitionEnd = function ( e ) { r && !r.destroyed && e.target === this && ( r.$wrapperEl[0].removeEventListener( "transitionend", r.onSlideToWrapperTransitionEnd ), r.$wrapperEl[0].removeEventListener( "webkitTransitionEnd", r.onSlideToWrapperTransitionEnd ), r.onSlideToWrapperTransitionEnd = null, delete r.onSlideToWrapperTransitionEnd, r.transitionEnd( i, f ) ) } ), r.$wrapperEl[0].addEventListener( "transitionend", r.onSlideToWrapperTransitionEnd ), r.$wrapperEl[0].addEventListener( "webkitTransitionEnd", r.onSlideToWrapperTransitionEnd ) ) ), !0 }, slideToLoop: function ( e, t, i, s ) { void 0 === e && ( e = 0 ), void 0 === t && ( t = this.params.speed ), void 0 === i && ( i = !0 ); var a = e; return this.params.loop && ( a += this.loopedSlides ), this.slideTo( a, t, i, s ) }, slideNext: function ( e, t, i ) { void 0 === e && ( e = this.params.speed ), void 0 === t && ( t = !0 ); var s = this.params, a = this.animating; return s.loop ? !a && ( this.loopFix(), this._clientLeft = this.$wrapperEl[0].clientLeft, this.slideTo( this.activeIndex + s.slidesPerGroup, e, t, i ) ) : this.slideTo( this.activeIndex + s.slidesPerGroup, e, t, i ) }, slidePrev: function ( e, t, i ) { void 0 === e && ( e = this.params.speed ), void 0 === t && ( t = !0 ); var s = this.params, a = this.animating, r = this.snapGrid, n = this.slidesGrid, o = this.rtlTranslate; if ( s.loop ) { if ( a ) return !1; this.loopFix(), this._clientLeft = this.$wrapperEl[0].clientLeft } function l( e ) { return e < 0 ? -Math.floor( Math.abs( e ) ) : Math.floor( e ) } var d, h = l( o ? this.translate : -this.translate ), p = r.map( ( function ( e ) { return l( e ) } ) ), c = ( n.map( ( function ( e ) { return l( e ) } ) ), r[p.indexOf( h )], r[p.indexOf( h ) - 1] ); return void 0 === c && s.cssMode && r.forEach( ( function ( e ) { !c && h >= e && ( c = e ) } ) ), void 0 !== c && ( d = n.indexOf( c ) ) < 0 && ( d = this.activeIndex - 1 ), this.slideTo( d, e, t, i ) }, slideReset: function ( e, t, i ) { return void 0 === e && ( e = this.params.speed ), void 0 === t && ( t = !0 ), this.slideTo( this.activeIndex, e, t, i ) }, slideToClosest: function ( e, t, i, s ) { void 0 === e && ( e = this.params.speed ), void 0 === t && ( t = !0 ), void 0 === s && ( s = .5 ); var a = this.activeIndex, r = Math.floor( a / this.params.slidesPerGroup ), n = this.rtlTranslate ? this.translate : -this.translate; if ( n >= this.snapGrid[r] ) { var o = this.snapGrid[r]; n - o > ( this.snapGrid[r + 1] - o ) * s && ( a += this.params.slidesPerGroup ) } else { var l = this.snapGrid[r - 1]; n - l <= ( this.snapGrid[r] - l ) * s && ( a -= this.params.slidesPerGroup ) } return a = Math.max( a, 0 ), a = Math.min( a, this.snapGrid.length - 1 ), this.slideTo( a, e, t, i ) }, slideToClickedSlide: function () { var e, t = this, i = t.params, a = t.$wrapperEl, r = "auto" === i.slidesPerView ? t.slidesPerViewDynamic() : i.slidesPerView, o = t.clickedIndex; if ( i.loop ) { if ( t.animating ) return; e = parseInt( s( t.clickedSlide ).attr( "data-swiper-slide-index" ), 10 ), i.centeredSlides ? o < t.loopedSlides - r / 2 || o > t.slides.length - t.loopedSlides + r / 2 ? ( t.loopFix(), o = a.children( "." + i.slideClass + '[data-swiper-slide-index="' + e + '"]:not(.' + i.slideDuplicateClass + ")" ).eq( 0 ).index(), n.nextTick( ( function () { t.slideTo( o ) } ) ) ) : t.slideTo( o ) : o > t.slides.length - r ? ( t.loopFix(), o = a.children( "." + i.slideClass + '[data-swiper-slide-index="' + e + '"]:not(.' + i.slideDuplicateClass + ")" ).eq( 0 ).index(), n.nextTick( ( function () { t.slideTo( o ) } ) ) ) : t.slideTo( o ) } else t.slideTo( o ) } }; var v = { loopCreate: function () { var t = this, i = t.params, a = t.$wrapperEl; a.children( "." + i.slideClass + "." + i.slideDuplicateClass ).remove(); var r = a.children( "." + i.slideClass ); if ( i.loopFillGroupWithBlank ) { var n = i.slidesPerGroup - r.length % i.slidesPerGroup; if ( n !== i.slidesPerGroup ) { for ( var o = 0; o < n; o += 1 ) { var l = s( e.createElement( "div" ) ).addClass( i.slideClass + " " + i.slideBlankClass ); a.append( l ) } r = a.children( "." + i.slideClass ) } } "auto" !== i.slidesPerView || i.loopedSlides || ( i.loopedSlides = r.length ), t.loopedSlides = Math.ceil( parseFloat( i.loopedSlides || i.slidesPerView, 10 ) ), t.loopedSlides += i.loopAdditionalSlides, t.loopedSlides > r.length && ( t.loopedSlides = r.length ); var d = [], h = []; r.each( ( function ( e, i ) { var a = s( i ); e < t.loopedSlides && h.push( i ), e < r.length && e >= r.length - t.loopedSlides && d.push( i ), a.attr( "data-swiper-slide-index", e ) } ) ); for ( var p = 0; p < h.length; p += 1 )a.append( s( h[p].cloneNode( !0 ) ).addClass( i.slideDuplicateClass ) ); for ( var c = d.length - 1; c >= 0; c -= 1 )a.prepend( s( d[c].cloneNode( !0 ) ).addClass( i.slideDuplicateClass ) ) }, loopFix: function () { this.emit( "beforeLoopFix" ); var e, t = this.activeIndex, i = this.slides, s = this.loopedSlides, a = this.allowSlidePrev, r = this.allowSlideNext, n = this.snapGrid, o = this.rtlTranslate; this.allowSlidePrev = !0, this.allowSlideNext = !0; var l = -n[t] - this.getTranslate(); if ( t < s ) e = i.length - 3 * s + t, e += s, this.slideTo( e, 0, !1, !0 ) && 0 !== l && this.setTranslate( ( o ? -this.translate : this.translate ) - l ); else if ( t >= i.length - s ) { e = -i.length + t + s, e += s, this.slideTo( e, 0, !1, !0 ) && 0 !== l && this.setTranslate( ( o ? -this.translate : this.translate ) - l ) } this.allowSlidePrev = a, this.allowSlideNext = r, this.emit( "loopFix" ) }, loopDestroy: function () { var e = this.$wrapperEl, t = this.params, i = this.slides; e.children( "." + t.slideClass + "." + t.slideDuplicateClass + ",." + t.slideClass + "." + t.slideBlankClass ).remove(), i.removeAttr( "data-swiper-slide-index" ) } }; var f = { setGrabCursor: function ( e ) { if ( !( o.touch || !this.params.simulateTouch || this.params.watchOverflow && this.isLocked || this.params.cssMode ) ) { var t = this.el; t.style.cursor = "move", t.style.cursor = e ? "-webkit-grabbing" : "-webkit-grab", t.style.cursor = e ? "-moz-grabbin" : "-moz-grab", t.style.cursor = e ? "grabbing" : "grab" } }, unsetGrabCursor: function () { o.touch || this.params.watchOverflow && this.isLocked || this.params.cssMode || ( this.el.style.cursor = "" ) } }; var m, g, b, w, y, x, T, E, S, C, M, P, z, k, $, L = { appendSlide: function ( e ) { var t = this.$wrapperEl, i = this.params; if ( i.loop && this.loopDestroy(), "object" == typeof e && "length" in e ) for ( var s = 0; s < e.length; s += 1 )e[s] && t.append( e[s] ); else t.append( e ); i.loop && this.loopCreate(), i.observer && o.observer || this.update() }, prependSlide: function ( e ) { var t = this.params, i = this.$wrapperEl, s = this.activeIndex; t.loop && this.loopDestroy(); var a = s + 1; if ( "object" == typeof e && "length" in e ) { for ( var r = 0; r < e.length; r += 1 )e[r] && i.prepend( e[r] ); a = s + e.length } else i.prepend( e ); t.loop && this.loopCreate(), t.observer && o.observer || this.update(), this.slideTo( a, 0, !1 ) }, addSlide: function ( e, t ) { var i = this.$wrapperEl, s = this.params, a = this.activeIndex; s.loop && ( a -= this.loopedSlides, this.loopDestroy(), this.slides = i.children( "." + s.slideClass ) ); var r = this.slides.length; if ( e <= 0 ) this.prependSlide( t ); else if ( e >= r ) this.appendSlide( t ); else { for ( var n = a > e ? a + 1 : a, l = [], d = r - 1; d >= e; d -= 1 ) { var h = this.slides.eq( d ); h.remove(), l.unshift( h ) } if ( "object" == typeof t && "length" in t ) { for ( var p = 0; p < t.length; p += 1 )t[p] && i.append( t[p] ); n = a > e ? a + t.length : a } else i.append( t ); for ( var c = 0; c < l.length; c += 1 )i.append( l[c] ); s.loop && this.loopCreate(), s.observer && o.observer || this.update(), s.loop ? this.slideTo( n + this.loopedSlides, 0, !1 ) : this.slideTo( n, 0, !1 ) } }, removeSlide: function ( e ) { var t = this.params, i = this.$wrapperEl, s = this.activeIndex; t.loop && ( s -= this.loopedSlides, this.loopDestroy(), this.slides = i.children( "." + t.slideClass ) ); var a, r = s; if ( "object" == typeof e && "length" in e ) { for ( var n = 0; n < e.length; n += 1 )a = e[n], this.slides[a] && this.slides.eq( a ).remove(), a < r && ( r -= 1 ); r = Math.max( r, 0 ) } else a = e, this.slides[a] && this.slides.eq( a ).remove(), a < r && ( r -= 1 ), r = Math.max( r, 0 ); t.loop && this.loopCreate(), t.observer && o.observer || this.update(), t.loop ? this.slideTo( r + this.loopedSlides, 0, !1 ) : this.slideTo( r, 0, !1 ) }, removeAllSlides: function () { for ( var e = [], t = 0; t < this.slides.length; t += 1 )e.push( t ); this.removeSlide( e ) } }, I = ( m = t.navigator.platform, g = t.navigator.userAgent, b = { ios: !1, android: !1, androidChrome: !1, desktop: !1, iphone: !1, ipod: !1, ipad: !1, edge: !1, ie: !1, firefox: !1, macos: !1, windows: !1, cordova: !( !t.cordova && !t.phonegap ), phonegap: !( !t.cordova && !t.phonegap ), electron: !1 }, w = t.screen.width, y = t.screen.height, x = g.match( /(Android);?[\s\/]+([\d.]+)?/ ), T = g.match( /(iPad).*OS\s([\d_]+)/ ), E = g.match( /(iPod)(.*OS\s([\d_]+))?/ ), S = !T && g.match( /(iPhone\sOS|iOS)\s([\d_]+)/ ), C = g.indexOf( "MSIE " ) >= 0 || g.indexOf( "Trident/" ) >= 0, M = g.indexOf( "Edge/" ) >= 0, P = g.indexOf( "Gecko/" ) >= 0 && g.indexOf( "Firefox/" ) >= 0, z = "Win32" === m, k = g.toLowerCase().indexOf( "electron" ) >= 0, $ = "MacIntel" === m, !T && $ && o.touch && ( 1024 === w && 1366 === y || 834 === w && 1194 === y || 834 === w && 1112 === y || 768 === w && 1024 === y ) && ( T = g.match( /(Version)\/([\d.]+)/ ), $ = !1 ), b.ie = C, b.edge = M, b.firefox = P, x && !z && ( b.os = "android", b.osVersion = x[2], b.android = !0, b.androidChrome = g.toLowerCase().indexOf( "chrome" ) >= 0 ), ( T || S || E ) && ( b.os = "ios", b.ios = !0 ), S && !E && ( b.osVersion = S[2].replace( /_/g, "." ), b.iphone = !0 ), T && ( b.osVersion = T[2].replace( /_/g, "." ), b.ipad = !0 ), E && ( b.osVersion = E[3] ? E[3].replace( /_/g, "." ) : null, b.ipod = !0 ), b.ios && b.osVersion && g.indexOf( "Version/" ) >= 0 && "10" === b.osVersion.split( "." )[0] && ( b.osVersion = g.toLowerCase().split( "version/" )[1].split( " " )[0] ), b.webView = !( !( S || T || E ) || !g.match( /.*AppleWebKit(?!.*Safari)/i ) && !t.navigator.standalone ) || t.matchMedia && t.matchMedia( "(display-mode: standalone)" ).matches, b.webview = b.webView, b.standalone = b.webView, b.desktop = !( b.ios || b.android ) || k, b.desktop && ( b.electron = k, b.macos = $, b.windows = z, b.macos && ( b.os = "macos" ), b.windows && ( b.os = "windows" ) ), b.pixelRatio = t.devicePixelRatio || 1, b ); function D( i ) { var a = this.touchEventsData, r = this.params, o = this.touches; if ( !this.animating || !r.preventInteractionOnTransition ) { var l = i; l.originalEvent && ( l = l.originalEvent ); var d = s( l.target ); if ( ( "wrapper" !== r.touchEventsTarget || d.closest( this.wrapperEl ).length ) && ( a.isTouchEvent = "touchstart" === l.type, ( a.isTouchEvent || !( "which" in l ) || 3 !== l.which ) && !( !a.isTouchEvent && "button" in l && l.button > 0 || a.isTouched && a.isMoved ) ) ) if ( r.noSwiping && d.closest( r.noSwipingSelector ? r.noSwipingSelector : "." + r.noSwipingClass )[0] ) this.allowClick = !0; else if ( !r.swipeHandler || d.closest( r.swipeHandler )[0] ) { o.currentX = "touchstart" === l.type ? l.targetTouches[0].pageX : l.pageX, o.currentY = "touchstart" === l.type ? l.targetTouches[0].pageY : l.pageY; var h = o.currentX, p = o.currentY, c = r.edgeSwipeDetection || r.iOSEdgeSwipeDetection, u = r.edgeSwipeThreshold || r.iOSEdgeSwipeThreshold; if ( !c || !( h <= u || h >= t.screen.width - u ) ) { if ( n.extend( a, { isTouched: !0, isMoved: !1, allowTouchCallbacks: !0, isScrolling: void 0, startMoving: void 0 } ), o.startX = h, o.startY = p, a.touchStartTime = n.now(), this.allowClick = !0, this.updateSize(), this.swipeDirection = void 0, r.threshold > 0 && ( a.allowThresholdMove = !1 ), "touchstart" !== l.type ) { var v = !0; d.is( a.formElements ) && ( v = !1 ), e.activeElement && s( e.activeElement ).is( a.formElements ) && e.activeElement !== d[0] && e.activeElement.blur(); var f = v && this.allowTouchMove && r.touchStartPreventDefault; ( r.touchStartForcePreventDefault || f ) && l.preventDefault() } this.emit( "touchStart", l ) } } } } function O( t ) { var i = this.touchEventsData, a = this.params, r = this.touches, o = this.rtlTranslate, l = t; if ( l.originalEvent && ( l = l.originalEvent ), i.isTouched ) { if ( !i.isTouchEvent || "mousemove" !== l.type ) { var d = "touchmove" === l.type && l.targetTouches && ( l.targetTouches[0] || l.changedTouches[0] ), h = "touchmove" === l.type ? d.pageX : l.pageX, p = "touchmove" === l.type ? d.pageY : l.pageY; if ( l.preventedByNestedSwiper ) return r.startX = h, void ( r.startY = p ); if ( !this.allowTouchMove ) return this.allowClick = !1, void ( i.isTouched && ( n.extend( r, { startX: h, startY: p, currentX: h, currentY: p } ), i.touchStartTime = n.now() ) ); if ( i.isTouchEvent && a.touchReleaseOnEdges && !a.loop ) if ( this.isVertical() ) { if ( p < r.startY && this.translate <= this.maxTranslate() || p > r.startY && this.translate >= this.minTranslate() ) return i.isTouched = !1, void ( i.isMoved = !1 ) } else if ( h < r.startX && this.translate <= this.maxTranslate() || h > r.startX && this.translate >= this.minTranslate() ) return; if ( i.isTouchEvent && e.activeElement && l.target === e.activeElement && s( l.target ).is( i.formElements ) ) return i.isMoved = !0, void ( this.allowClick = !1 ); if ( i.allowTouchCallbacks && this.emit( "touchMove", l ), !( l.targetTouches && l.targetTouches.length > 1 ) ) { r.currentX = h, r.currentY = p; var c = r.currentX - r.startX, u = r.currentY - r.startY; if ( !( this.params.threshold && Math.sqrt( Math.pow( c, 2 ) + Math.pow( u, 2 ) ) < this.params.threshold ) ) { var v; if ( void 0 === i.isScrolling ) this.isHorizontal() && r.currentY === r.startY || this.isVertical() && r.currentX === r.startX ? i.isScrolling = !1 : c * c + u * u >= 25 && ( v = 180 * Math.atan2( Math.abs( u ), Math.abs( c ) ) / Math.PI, i.isScrolling = this.isHorizontal() ? v > a.touchAngle : 90 - v > a.touchAngle ); if ( i.isScrolling && this.emit( "touchMoveOpposite", l ), void 0 === i.startMoving && ( r.currentX === r.startX && r.currentY === r.startY || ( i.startMoving = !0 ) ), i.isScrolling ) i.isTouched = !1; else if ( i.startMoving ) { this.allowClick = !1, a.cssMode || l.preventDefault(), a.touchMoveStopPropagation && !a.nested && l.stopPropagation(), i.isMoved || ( a.loop && this.loopFix(), i.startTranslate = this.getTranslate(), this.setTransition( 0 ), this.animating && this.$wrapperEl.trigger( "webkitTransitionEnd transitionend" ), i.allowMomentumBounce = !1, !a.grabCursor || !0 !== this.allowSlideNext && !0 !== this.allowSlidePrev || this.setGrabCursor( !0 ), this.emit( "sliderFirstMove", l ) ), this.emit( "sliderMove", l ), i.isMoved = !0; var f = this.isHorizontal() ? c : u; r.diff = f, f *= a.touchRatio, o && ( f = -f ), this.swipeDirection = f > 0 ? "prev" : "next", i.currentTranslate = f + i.startTranslate; var m = !0, g = a.resistanceRatio; if ( a.touchReleaseOnEdges && ( g = 0 ), f > 0 && i.currentTranslate > this.minTranslate() ? ( m = !1, a.resistance && ( i.currentTranslate = this.minTranslate() - 1 + Math.pow( -this.minTranslate() + i.startTranslate + f, g ) ) ) : f < 0 && i.currentTranslate < this.maxTranslate() && ( m = !1, a.resistance && ( i.currentTranslate = this.maxTranslate() + 1 - Math.pow( this.maxTranslate() - i.startTranslate - f, g ) ) ), m && ( l.preventedByNestedSwiper = !0 ), !this.allowSlideNext && "next" === this.swipeDirection && i.currentTranslate < i.startTranslate && ( i.currentTranslate = i.startTranslate ), !this.allowSlidePrev && "prev" === this.swipeDirection && i.currentTranslate > i.startTranslate && ( i.currentTranslate = i.startTranslate ), a.threshold > 0 ) { if ( !( Math.abs( f ) > a.threshold || i.allowThresholdMove ) ) return void ( i.currentTranslate = i.startTranslate ); if ( !i.allowThresholdMove ) return i.allowThresholdMove = !0, r.startX = r.currentX, r.startY = r.currentY, i.currentTranslate = i.startTranslate, void ( r.diff = this.isHorizontal() ? r.currentX - r.startX : r.currentY - r.startY ) } a.followFinger && !a.cssMode && ( ( a.freeMode || a.watchSlidesProgress || a.watchSlidesVisibility ) && ( this.updateActiveIndex(), this.updateSlidesClasses() ), a.freeMode && ( 0 === i.velocities.length && i.velocities.push( { position: r[this.isHorizontal() ? "startX" : "startY"], time: i.touchStartTime } ), i.velocities.push( { position: r[this.isHorizontal() ? "currentX" : "currentY"], time: n.now() } ) ), this.updateProgress( i.currentTranslate ), this.setTranslate( i.currentTranslate ) ) } } } } } else i.startMoving && i.isScrolling && this.emit( "touchMoveOpposite", l ) } function A( e ) { var t = this, i = t.touchEventsData, s = t.params, a = t.touches, r = t.rtlTranslate, o = t.$wrapperEl, l = t.slidesGrid, d = t.snapGrid, h = e; if ( h.originalEvent && ( h = h.originalEvent ), i.allowTouchCallbacks && t.emit( "touchEnd", h ), i.allowTouchCallbacks = !1, !i.isTouched ) return i.isMoved && s.grabCursor && t.setGrabCursor( !1 ), i.isMoved = !1, void ( i.startMoving = !1 ); s.grabCursor && i.isMoved && i.isTouched && ( !0 === t.allowSlideNext || !0 === t.allowSlidePrev ) && t.setGrabCursor( !1 ); var p, c = n.now(), u = c - i.touchStartTime; if ( t.allowClick && ( t.updateClickedSlide( h ), t.emit( "tap click", h ), u < 300 && c - i.lastClickTime < 300 && t.emit( "doubleTap doubleClick", h ) ), i.lastClickTime = n.now(), n.nextTick( ( function () { t.destroyed || ( t.allowClick = !0 ) } ) ), !i.isTouched || !i.isMoved || !t.swipeDirection || 0 === a.diff || i.currentTranslate === i.startTranslate ) return i.isTouched = !1, i.isMoved = !1, void ( i.startMoving = !1 ); if ( i.isTouched = !1, i.isMoved = !1, i.startMoving = !1, p = s.followFinger ? r ? t.translate : -t.translate : -i.currentTranslate, !s.cssMode ) if ( s.freeMode ) { if ( p < -t.minTranslate() ) return void t.slideTo( t.activeIndex ); if ( p > -t.maxTranslate() ) return void ( t.slides.length < d.length ? t.slideTo( d.length - 1 ) : t.slideTo( t.slides.length - 1 ) ); if ( s.freeModeMomentum ) { if ( i.velocities.length > 1 ) { var v = i.velocities.pop(), f = i.velocities.pop(), m = v.position - f.position, g = v.time - f.time; t.velocity = m / g, t.velocity /= 2, Math.abs( t.velocity ) < s.freeModeMinimumVelocity && ( t.velocity = 0 ), ( g > 150 || n.now() - v.time > 300 ) && ( t.velocity = 0 ) } else t.velocity = 0; t.velocity *= s.freeModeMomentumVelocityRatio, i.velocities.length = 0; var b = 1e3 * s.freeModeMomentumRatio, w = t.velocity * b, y = t.translate + w; r && ( y = -y ); var x, T, E = !1, S = 20 * Math.abs( t.velocity ) * s.freeModeMomentumBounceRatio; if ( y < t.maxTranslate() ) s.freeModeMomentumBounce ? ( y + t.maxTranslate() < -S && ( y = t.maxTranslate() - S ), x = t.maxTranslate(), E = !0, i.allowMomentumBounce = !0 ) : y = t.maxTranslate(), s.loop && s.centeredSlides && ( T = !0 ); else if ( y > t.minTranslate() ) s.freeModeMomentumBounce ? ( y - t.minTranslate() > S && ( y = t.minTranslate() + S ), x = t.minTranslate(), E = !0, i.allowMomentumBounce = !0 ) : y = t.minTranslate(), s.loop && s.centeredSlides && ( T = !0 ); else if ( s.freeModeSticky ) { for ( var C, M = 0; M < d.length; M += 1 )if ( d[M] > -y ) { C = M; break } y = -( y = Math.abs( d[C] - y ) < Math.abs( d[C - 1] - y ) || "next" === t.swipeDirection ? d[C] : d[C - 1] ) } if ( T && t.once( "transitionEnd", ( function () { t.loopFix() } ) ), 0 !== t.velocity ) { if ( b = r ? Math.abs( ( -y - t.translate ) / t.velocity ) : Math.abs( ( y - t.translate ) / t.velocity ), s.freeModeSticky ) { var P = Math.abs( ( r ? -y : y ) - t.translate ), z = t.slidesSizesGrid[t.activeIndex]; b = P < z ? s.speed : P < 2 * z ? 1.5 * s.speed : 2.5 * s.speed } } else if ( s.freeModeSticky ) return void t.slideToClosest(); s.freeModeMomentumBounce && E ? ( t.updateProgress( x ), t.setTransition( b ), t.setTranslate( y ), t.transitionStart( !0, t.swipeDirection ), t.animating = !0, o.transitionEnd( ( function () { t && !t.destroyed && i.allowMomentumBounce && ( t.emit( "momentumBounce" ), t.setTransition( s.speed ), t.setTranslate( x ), o.transitionEnd( ( function () { t && !t.destroyed && t.transitionEnd() } ) ) ) } ) ) ) : t.velocity ? ( t.updateProgress( y ), t.setTransition( b ), t.setTranslate( y ), t.transitionStart( !0, t.swipeDirection ), t.animating || ( t.animating = !0, o.transitionEnd( ( function () { t && !t.destroyed && t.transitionEnd() } ) ) ) ) : t.updateProgress( y ), t.updateActiveIndex(), t.updateSlidesClasses() } else if ( s.freeModeSticky ) return void t.slideToClosest(); ( !s.freeModeMomentum || u >= s.longSwipesMs ) && ( t.updateProgress(), t.updateActiveIndex(), t.updateSlidesClasses() ) } else { for ( var k = 0, $ = t.slidesSizesGrid[0], L = 0; L < l.length; L += s.slidesPerGroup )void 0 !== l[L + s.slidesPerGroup] ? p >= l[L] && p < l[L + s.slidesPerGroup] && ( k = L, $ = l[L + s.slidesPerGroup] - l[L] ) : p >= l[L] && ( k = L, $ = l[l.length - 1] - l[l.length - 2] ); var I = ( p - l[k] ) / $; if ( u > s.longSwipesMs ) { if ( !s.longSwipes ) return void t.slideTo( t.activeIndex ); "next" === t.swipeDirection && ( I >= s.longSwipesRatio ? t.slideTo( k + s.slidesPerGroup ) : t.slideTo( k ) ), "prev" === t.swipeDirection && ( I > 1 - s.longSwipesRatio ? t.slideTo( k + s.slidesPerGroup ) : t.slideTo( k ) ) } else { if ( !s.shortSwipes ) return void t.slideTo( t.activeIndex ); t.navigation && ( h.target === t.navigation.nextEl || h.target === t.navigation.prevEl ) ? h.target === t.navigation.nextEl ? t.slideTo( k + s.slidesPerGroup ) : t.slideTo( k ) : ( "next" === t.swipeDirection && t.slideTo( k + s.slidesPerGroup ), "prev" === t.swipeDirection && t.slideTo( k ) ) } } } function G() { var e = this.params, t = this.el; if ( !t || 0 !== t.offsetWidth ) { e.breakpoints && this.setBreakpoint(); var i = this.allowSlideNext, s = this.allowSlidePrev, a = this.snapGrid; this.allowSlideNext = !0, this.allowSlidePrev = !0, this.updateSize(), this.updateSlides(), this.updateSlidesClasses(), ( "auto" === e.slidesPerView || e.slidesPerView > 1 ) && this.isEnd && !this.params.centeredSlides ? this.slideTo( this.slides.length - 1, 0, !1, !0 ) : this.slideTo( this.activeIndex, 0, !1, !0 ), this.autoplay && this.autoplay.running && this.autoplay.paused && this.autoplay.run(), this.allowSlidePrev = s, this.allowSlideNext = i, this.params.watchOverflow && a !== this.snapGrid && this.checkOverflow() } } function B( e ) { this.allowClick || ( this.params.preventClicks && e.preventDefault(), this.params.preventClicksPropagation && this.animating && ( e.stopPropagation(), e.stopImmediatePropagation() ) ) } function H() { var e = this.wrapperEl; this.previousTranslate = this.translate, this.translate = this.isHorizontal() ? -e.scrollLeft : -e.scrollTop, -0 === this.translate && ( this.translate = 0 ), this.updateActiveIndex(), this.updateSlidesClasses(); var t = this.maxTranslate() - this.minTranslate(); ( 0 === t ? 0 : ( this.translate - this.minTranslate() ) / t ) !== this.progress && this.updateProgress( this.translate ), this.emit( "setTranslate", this.translate, !1 ) } var N = !1; function X() { } var V = { init: !0, direction: "horizontal", touchEventsTarget: "container", initialSlide: 0, speed: 300, cssMode: !1, updateOnWindowResize: !0, preventInteractionOnTransition: !1, edgeSwipeDetection: !1, edgeSwipeThreshold: 20, freeMode: !1, freeModeMomentum: !0, freeModeMomentumRatio: 1, freeModeMomentumBounce: !0, freeModeMomentumBounceRatio: 1, freeModeMomentumVelocityRatio: 1, freeModeSticky: !1, freeModeMinimumVelocity: .02, autoHeight: !1, setWrapperSize: !1, virtualTranslate: !1, effect: "slide", breakpoints: void 0, spaceBetween: 0, slidesPerView: 1, slidesPerColumn: 1, slidesPerColumnFill: "column", slidesPerGroup: 1, centeredSlides: !1, centeredSlidesBounds: !1, slidesOffsetBefore: 0, slidesOffsetAfter: 0, normalizeSlideIndex: !0, centerInsufficientSlides: !1, watchOverflow: !1, roundLengths: !1, touchRatio: 1, touchAngle: 45, simulateTouch: !0, shortSwipes: !0, longSwipes: !0, longSwipesRatio: .5, longSwipesMs: 300, followFinger: !0, allowTouchMove: !0, threshold: 0, touchMoveStopPropagation: !1, touchStartPreventDefault: !0, touchStartForcePreventDefault: !1, touchReleaseOnEdges: !1, uniqueNavElements: !0, resistance: !0, resistanceRatio: .85, watchSlidesProgress: !1, watchSlidesVisibility: !1, grabCursor: !1, preventClicks: !0, preventClicksPropagation: !0, slideToClickedSlide: !1, preloadImages: !0, updateOnImagesReady: !0, loop: !1, loopAdditionalSlides: 0, loopedSlides: null, loopFillGroupWithBlank: !1, allowSlidePrev: !0, allowSlideNext: !0, swipeHandler: null, noSwiping: !0, noSwipingClass: "swiper-no-swiping", noSwipingSelector: null, passiveListeners: !0, containerModifierClass: "swiper-container-", slideClass: "swiper-slide", slideBlankClass: "swiper-slide-invisible-blank", slideActiveClass: "swiper-slide-active", slideDuplicateActiveClass: "swiper-slide-duplicate-active", slideVisibleClass: "swiper-slide-visible", slideDuplicateClass: "swiper-slide-duplicate", slideNextClass: "swiper-slide-next", slideDuplicateNextClass: "swiper-slide-duplicate-next", slidePrevClass: "swiper-slide-prev", slideDuplicatePrevClass: "swiper-slide-duplicate-prev", wrapperClass: "swiper-wrapper", runCallbacksOnInit: !0 }, Y = { update: h, translate: p, transition: c, slide: u, loop: v, grabCursor: f, manipulation: L, events: { attachEvents: function () { var t = this.params, i = this.touchEvents, s = this.el, a = this.wrapperEl; this.onTouchStart = D.bind( this ), this.onTouchMove = O.bind( this ), this.onTouchEnd = A.bind( this ), t.cssMode && ( this.onScroll = H.bind( this ) ), this.onClick = B.bind( this ); var r = !!t.nested; if ( !o.touch && o.pointerEvents ) s.addEventListener( i.start, this.onTouchStart, !1 ), e.addEventListener( i.move, this.onTouchMove, r ), e.addEventListener( i.end, this.onTouchEnd, !1 ); else { if ( o.touch ) { var n = !( "touchstart" !== i.start || !o.passiveListener || !t.passiveListeners ) && { passive: !0, capture: !1 }; s.addEventListener( i.start, this.onTouchStart, n ), s.addEventListener( i.move, this.onTouchMove, o.passiveListener ? { passive: !1, capture: r } : r ), s.addEventListener( i.end, this.onTouchEnd, n ), i.cancel && s.addEventListener( i.cancel, this.onTouchEnd, n ), N || ( e.addEventListener( "touchstart", X ), N = !0 ) } ( t.simulateTouch && !I.ios && !I.android || t.simulateTouch && !o.touch && I.ios ) && ( s.addEventListener( "mousedown", this.onTouchStart, !1 ), e.addEventListener( "mousemove", this.onTouchMove, r ), e.addEventListener( "mouseup", this.onTouchEnd, !1 ) ) } ( t.preventClicks || t.preventClicksPropagation ) && s.addEventListener( "click", this.onClick, !0 ), t.cssMode && a.addEventListener( "scroll", this.onScroll ), t.updateOnWindowResize ? this.on( I.ios || I.android ? "resize orientationchange observerUpdate" : "resize observerUpdate", G, !0 ) : this.on( "observerUpdate", G, !0 ) }, detachEvents: function () { var t = this.params, i = this.touchEvents, s = this.el, a = this.wrapperEl, r = !!t.nested; if ( !o.touch && o.pointerEvents ) s.removeEventListener( i.start, this.onTouchStart, !1 ), e.removeEventListener( i.move, this.onTouchMove, r ), e.removeEventListener( i.end, this.onTouchEnd, !1 ); else { if ( o.touch ) { var n = !( "onTouchStart" !== i.start || !o.passiveListener || !t.passiveListeners ) && { passive: !0, capture: !1 }; s.removeEventListener( i.start, this.onTouchStart, n ), s.removeEventListener( i.move, this.onTouchMove, r ), s.removeEventListener( i.end, this.onTouchEnd, n ), i.cancel && s.removeEventListener( i.cancel, this.onTouchEnd, n ) } ( t.simulateTouch && !I.ios && !I.android || t.simulateTouch && !o.touch && I.ios ) && ( s.removeEventListener( "mousedown", this.onTouchStart, !1 ), e.removeEventListener( "mousemove", this.onTouchMove, r ), e.removeEventListener( "mouseup", this.onTouchEnd, !1 ) ) } ( t.preventClicks || t.preventClicksPropagation ) && s.removeEventListener( "click", this.onClick, !0 ), t.cssMode && a.removeEventListener( "scroll", this.onScroll ), this.off( I.ios || I.android ? "resize orientationchange observerUpdate" : "resize observerUpdate", G ) } }, breakpoints: { setBreakpoint: function () { var e = this.activeIndex, t = this.initialized, i = this.loopedSlides; void 0 === i && ( i = 0 ); var s = this.params, a = this.$el, r = s.breakpoints; if ( r && ( !r || 0 !== Object.keys( r ).length ) ) { var o = this.getBreakpoint( r ); if ( o && this.currentBreakpoint !== o ) { var l = o in r ? r[o] : void 0; l && ["slidesPerView", "spaceBetween", "slidesPerGroup", "slidesPerColumn"].forEach( ( function ( e ) { var t = l[e]; void 0 !== t && ( l[e] = "slidesPerView" !== e || "AUTO" !== t && "auto" !== t ? "slidesPerView" === e ? parseFloat( t ) : parseInt( t, 10 ) : "auto" ) } ) ); var d = l || this.originalParams, h = s.slidesPerColumn > 1, p = d.slidesPerColumn > 1; h && !p ? a.removeClass( s.containerModifierClass + "multirow " + s.containerModifierClass + "multirow-column" ) : !h && p && ( a.addClass( s.containerModifierClass + "multirow" ), "column" === d.slidesPerColumnFill && a.addClass( s.containerModifierClass + "multirow-column" ) ); var c = d.direction && d.direction !== s.direction, u = s.loop && ( d.slidesPerView !== s.slidesPerView || c ); c && t && this.changeDirection(), n.extend( this.params, d ), n.extend( this, { allowTouchMove: this.params.allowTouchMove, allowSlideNext: this.params.allowSlideNext, allowSlidePrev: this.params.allowSlidePrev } ), this.currentBreakpoint = o, u && t && ( this.loopDestroy(), this.loopCreate(), this.updateSlides(), this.slideTo( e - i + this.loopedSlides, 0, !1 ) ), this.emit( "breakpoint", d ) } } }, getBreakpoint: function ( e ) { if ( e ) { var i = !1, s = []; Object.keys( e ).forEach( ( function ( e ) { s.push( e ) } ) ), s.sort( ( function ( e, t ) { return parseInt( e, 10 ) - parseInt( t, 10 ) } ) ); for ( var a = 0; a < s.length; a += 1 ) { var r = s[a]; r <= t.innerWidth && ( i = r ) } return i || "max" } } }, checkOverflow: { checkOverflow: function () { var e = this.params, t = this.isLocked, i = this.slides.length > 0 && e.slidesOffsetBefore + e.spaceBetween * ( this.slides.length - 1 ) + this.slides[0].offsetWidth * this.slides.length; e.slidesOffsetBefore && e.slidesOffsetAfter && i ? this.isLocked = i <= this.size : this.isLocked = 1 === this.snapGrid.length, this.allowSlideNext = !this.isLocked, this.allowSlidePrev = !this.isLocked, t !== this.isLocked && this.emit( this.isLocked ? "lock" : "unlock" ), t && t !== this.isLocked && ( this.isEnd = !1, this.navigation.update() ) } }, classes: { addClasses: function () { var e = this.classNames, t = this.params, i = this.rtl, s = this.$el, a = []; a.push( "initialized" ), a.push( t.direction ), t.freeMode && a.push( "free-mode" ), t.autoHeight && a.push( "autoheight" ), i && a.push( "rtl" ), t.slidesPerColumn > 1 && ( a.push( "multirow" ), "column" === t.slidesPerColumnFill && a.push( "multirow-column" ) ), I.android && a.push( "android" ), I.ios && a.push( "ios" ), t.cssMode && a.push( "css-mode" ), a.forEach( ( function ( i ) { e.push( t.containerModifierClass + i ) } ) ), s.addClass( e.join( " " ) ) }, removeClasses: function () { var e = this.$el, t = this.classNames; e.removeClass( t.join( " " ) ) } }, images: { loadImage: function ( e, i, s, a, r, n ) { var o; function l() { n && n() } e.complete && r ? l() : i ? ( ( o = new t.Image ).onload = l, o.onerror = l, a && ( o.sizes = a ), s && ( o.srcset = s ), i && ( o.src = i ) ) : l() }, preloadImages: function () { var e = this; function t() { null != e && e && !e.destroyed && ( void 0 !== e.imagesLoaded && ( e.imagesLoaded += 1 ), e.imagesLoaded === e.imagesToLoad.length && ( e.params.updateOnImagesReady && e.update(), e.emit( "imagesReady" ) ) ) } e.imagesToLoad = e.$el.find( "img" ); for ( var i = 0; i < e.imagesToLoad.length; i += 1 ) { var s = e.imagesToLoad[i]; e.loadImage( s, s.currentSrc || s.getAttribute( "src" ), s.srcset || s.getAttribute( "srcset" ), s.sizes || s.getAttribute( "sizes" ), !0, t ) } } } }, F = {}, W = function ( e ) { function t() { for ( var i, a, r, l = [], d = arguments.length; d--; )l[d] = arguments[d]; 1 === l.length && l[0].constructor && l[0].constructor === Object ? r = l[0] : ( a = ( i = l )[0], r = i[1] ), r || ( r = {} ), r = n.extend( {}, r ), a && !r.el && ( r.el = a ), e.call( this, r ), Object.keys( Y ).forEach( ( function ( e ) { Object.keys( Y[e] ).forEach( ( function ( i ) { t.prototype[i] || ( t.prototype[i] = Y[e][i] ) } ) ) } ) ); var h = this; void 0 === h.modules && ( h.modules = {} ), Object.keys( h.modules ).forEach( ( function ( e ) { var t = h.modules[e]; if ( t.params ) { var i = Object.keys( t.params )[0], s = t.params[i]; if ( "object" != typeof s || null === s ) return; if ( !( i in r && "enabled" in s ) ) return; !0 === r[i] && ( r[i] = { enabled: !0 } ), "object" != typeof r[i] || "enabled" in r[i] || ( r[i].enabled = !0 ), r[i] || ( r[i] = { enabled: !1 } ) } } ) ); var p = n.extend( {}, V ); h.useModulesParams( p ), h.params = n.extend( {}, p, F, r ), h.originalParams = n.extend( {}, h.params ), h.passedParams = n.extend( {}, r ), h.$ = s; var c = s( h.params.el ); if ( a = c[0] ) { if ( c.length > 1 ) { var u = []; return c.each( ( function ( e, i ) { var s = n.extend( {}, r, { el: i } ); u.push( new t( s ) ) } ) ), u } var v, f, m; return a.swiper = h, c.data( "swiper", h ), a && a.shadowRoot && a.shadowRoot.querySelector ? ( v = s( a.shadowRoot.querySelector( "." + h.params.wrapperClass ) ) ).children = function ( e ) { return c.children( e ) } : v = c.children( "." + h.params.wrapperClass ), n.extend( h, { $el: c, el: a, $wrapperEl: v, wrapperEl: v[0], classNames: [], slides: s(), slidesGrid: [], snapGrid: [], slidesSizesGrid: [], isHorizontal: function () { return "horizontal" === h.params.direction }, isVertical: function () { return "vertical" === h.params.direction }, rtl: "rtl" === a.dir.toLowerCase() || "rtl" === c.css( "direction" ), rtlTranslate: "horizontal" === h.params.direction && ( "rtl" === a.dir.toLowerCase() || "rtl" === c.css( "direction" ) ), wrongRTL: "-webkit-box" === v.css( "display" ), activeIndex: 0, realIndex: 0, isBeginning: !0, isEnd: !1, translate: 0, previousTranslate: 0, progress: 0, velocity: 0, animating: !1, allowSlideNext: h.params.allowSlideNext, allowSlidePrev: h.params.allowSlidePrev, touchEvents: ( f = ["touchstart", "touchmove", "touchend", "touchcancel"], m = ["mousedown", "mousemove", "mouseup"], o.pointerEvents && ( m = ["pointerdown", "pointermove", "pointerup"] ), h.touchEventsTouch = { start: f[0], move: f[1], end: f[2], cancel: f[3] }, h.touchEventsDesktop = { start: m[0], move: m[1], end: m[2] }, o.touch || !h.params.simulateTouch ? h.touchEventsTouch : h.touchEventsDesktop ), touchEventsData: { isTouched: void 0, isMoved: void 0, allowTouchCallbacks: void 0, touchStartTime: void 0, isScrolling: void 0, currentTranslate: void 0, startTranslate: void 0, allowThresholdMove: void 0, formElements: "input, select, option, textarea, button, video", lastClickTime: n.now(), clickTimeout: void 0, velocities: [], allowMomentumBounce: void 0, isTouchEvent: void 0, startMoving: void 0 }, allowClick: !0, allowTouchMove: h.params.allowTouchMove, touches: { startX: 0, startY: 0, currentX: 0, currentY: 0, diff: 0 }, imagesToLoad: [], imagesLoaded: 0 } ), h.useModules(), h.params.init && h.init(), h } } e && ( t.__proto__ = e ), t.prototype = Object.create( e && e.prototype ), t.prototype.constructor = t; var i = { extendedDefaults: { configurable: !0 }, defaults: { configurable: !0 }, Class: { configurable: !0 }, $: { configurable: !0 } }; return t.prototype.slidesPerViewDynamic = function () { var e = this.params, t = this.slides, i = this.slidesGrid, s = this.size, a = this.activeIndex, r = 1; if ( e.centeredSlides ) { for ( var n, o = t[a].swiperSlideSize, l = a + 1; l < t.length; l += 1 )t[l] && !n && ( r += 1, ( o += t[l].swiperSlideSize ) > s && ( n = !0 ) ); for ( var d = a - 1; d >= 0; d -= 1 )t[d] && !n && ( r += 1, ( o += t[d].swiperSlideSize ) > s && ( n = !0 ) ) } else for ( var h = a + 1; h < t.length; h += 1 )i[h] - i[a] < s && ( r += 1 ); return r }, t.prototype.update = function () { var e = this; if ( e && !e.destroyed ) { var t = e.snapGrid, i = e.params; i.breakpoints && e.setBreakpoint(), e.updateSize(), e.updateSlides(), e.updateProgress(), e.updateSlidesClasses(), e.params.freeMode ? ( s(), e.params.autoHeight && e.updateAutoHeight() ) : ( ( "auto" === e.params.slidesPerView || e.params.slidesPerView > 1 ) && e.isEnd && !e.params.centeredSlides ? e.slideTo( e.slides.length - 1, 0, !1, !0 ) : e.slideTo( e.activeIndex, 0, !1, !0 ) ) || s(), i.watchOverflow && t !== e.snapGrid && e.checkOverflow(), e.emit( "update" ) } function s() { var t = e.rtlTranslate ? -1 * e.translate : e.translate, i = Math.min( Math.max( t, e.maxTranslate() ), e.minTranslate() ); e.setTranslate( i ), e.updateActiveIndex(), e.updateSlidesClasses() } }, t.prototype.changeDirection = function ( e, t ) { void 0 === t && ( t = !0 ); var i = this.params.direction; return e || ( e = "horizontal" === i ? "vertical" : "horizontal" ), e === i || "horizontal" !== e && "vertical" !== e ? this : ( this.$el.removeClass( "" + this.params.containerModifierClass + i ).addClass( "" + this.params.containerModifierClass + e ), this.params.direction = e, this.slides.each( ( function ( t, i ) { "vertical" === e ? i.style.width = "" : i.style.height = "" } ) ), this.emit( "changeDirection" ), t && this.update(), this ) }, t.prototype.init = function () { this.initialized || ( this.emit( "beforeInit" ), this.params.breakpoints && this.setBreakpoint(), this.addClasses(), this.params.loop && this.loopCreate(), this.updateSize(), this.updateSlides(), this.params.watchOverflow && this.checkOverflow(), this.params.grabCursor && this.setGrabCursor(), this.params.preloadImages && this.preloadImages(), this.params.loop ? this.slideTo( this.params.initialSlide + this.loopedSlides, 0, this.params.runCallbacksOnInit ) : this.slideTo( this.params.initialSlide, 0, this.params.runCallbacksOnInit ), this.attachEvents(), this.initialized = !0, this.emit( "init" ) ) }, t.prototype.destroy = function ( e, t ) { void 0 === e && ( e = !0 ), void 0 === t && ( t = !0 ); var i = this, s = i.params, a = i.$el, r = i.$wrapperEl, o = i.slides; return void 0 === i.params || i.destroyed ? null : ( i.emit( "beforeDestroy" ), i.initialized = !1, i.detachEvents(), s.loop && i.loopDestroy(), t && ( i.removeClasses(), a.removeAttr( "style" ), r.removeAttr( "style" ), o && o.length && o.removeClass( [s.slideVisibleClass, s.slideActiveClass, s.slideNextClass, s.slidePrevClass].join( " " ) ).removeAttr( "style" ).removeAttr( "data-swiper-slide-index" ) ), i.emit( "destroy" ), Object.keys( i.eventsListeners ).forEach( ( function ( e ) { i.off( e ) } ) ), !1 !== e && ( i.$el[0].swiper = null, i.$el.data( "swiper", null ), n.deleteProps( i ) ), i.destroyed = !0, null ) }, t.extendDefaults = function ( e ) { n.extend( F, e ) }, i.extendedDefaults.get = function () { return F }, i.defaults.get = function () { return V }, i.Class.get = function () { return e }, i.$.get = function () { return s }, Object.defineProperties( t, i ), t }( l ), R = { name: "device", proto: { device: I }, static: { device: I } }, q = { name: "support", proto: { support: o }, static: { support: o } }, j = { isEdge: !!t.navigator.userAgent.match( /Edge/g ), isSafari: function () { var e = t.navigator.userAgent.toLowerCase(); return e.indexOf( "safari" ) >= 0 && e.indexOf( "chrome" ) < 0 && e.indexOf( "android" ) < 0 }(), isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test( t.navigator.userAgent ) }, K = { name: "browser", proto: { browser: j }, static: { browser: j } }, U = { name: "resize", create: function () { var e = this; n.extend( e, { resize: { resizeHandler: function () { e && !e.destroyed && e.initialized && ( e.emit( "beforeResize" ), e.emit( "resize" ) ) }, orientationChangeHandler: function () { e && !e.destroyed && e.initialized && e.emit( "orientationchange" ) } } } ) }, on: { init: function () { t.addEventListener( "resize", this.resize.resizeHandler ), t.addEventListener( "orientationchange", this.resize.orientationChangeHandler ) }, destroy: function () { t.removeEventListener( "resize", this.resize.resizeHandler ), t.removeEventListener( "orientationchange", this.resize.orientationChangeHandler ) } } }, _ = { func: t.MutationObserver || t.WebkitMutationObserver, attach: function ( e, i ) { void 0 === i && ( i = {} ); var s = this, a = new ( 0, _.func )( ( function ( e ) { if ( 1 !== e.length ) { var i = function () { s.emit( "observerUpdate", e[0] ) }; t.requestAnimationFrame ? t.requestAnimationFrame( i ) : t.setTimeout( i, 0 ) } else s.emit( "observerUpdate", e[0] ) } ) ); a.observe( e, { attributes: void 0 === i.attributes || i.attributes, childList: void 0 === i.childList || i.childList, characterData: void 0 === i.characterData || i.characterData } ), s.observer.observers.push( a ) }, init: function () { if ( o.observer && this.params.observer ) { if ( this.params.observeParents ) for ( var e = this.$el.parents(), t = 0; t < e.length; t += 1 )this.observer.attach( e[t] ); this.observer.attach( this.$el[0], { childList: this.params.observeSlideChildren } ), this.observer.attach( this.$wrapperEl[0], { attributes: !1 } ) } }, destroy: function () { this.observer.observers.forEach( ( function ( e ) { e.disconnect() } ) ), this.observer.observers = [] } }, Z = { name: "observer", params: { observer: !1, observeParents: !1, observeSlideChildren: !1 }, create: function () { n.extend( this, { observer: { init: _.init.bind( this ), attach: _.attach.bind( this ), destroy: _.destroy.bind( this ), observers: [] } } ) }, on: { init: function () { this.observer.init() }, destroy: function () { this.observer.destroy() } } }, Q = { update: function ( e ) { var t = this, i = t.params, s = i.slidesPerView, a = i.slidesPerGroup, r = i.centeredSlides, o = t.params.virtual, l = o.addSlidesBefore, d = o.addSlidesAfter, h = t.virtual, p = h.from, c = h.to, u = h.slides, v = h.slidesGrid, f = h.renderSlide, m = h.offset; t.updateActiveIndex(); var g, b, w, y = t.activeIndex || 0; g = t.rtlTranslate ? "right" : t.isHorizontal() ? "left" : "top", r ? ( b = Math.floor( s / 2 ) + a + l, w = Math.floor( s / 2 ) + a + d ) : ( b = s + ( a - 1 ) + l, w = a + d ); var x = Math.max( ( y || 0 ) - w, 0 ), T = Math.min( ( y || 0 ) + b, u.length - 1 ), E = ( t.slidesGrid[x] || 0 ) - ( t.slidesGrid[0] || 0 ); function S() { t.updateSlides(), t.updateProgress(), t.updateSlidesClasses(), t.lazy && t.params.lazy.enabled && t.lazy.load() } if ( n.extend( t.virtual, { from: x, to: T, offset: E, slidesGrid: t.slidesGrid } ), p === x && c === T && !e ) return t.slidesGrid !== v && E !== m && t.slides.css( g, E + "px" ), void t.updateProgress(); if ( t.params.virtual.renderExternal ) return t.params.virtual.renderExternal.call( t, { offset: E, from: x, to: T, slides: function () { for ( var e = [], t = x; t <= T; t += 1 )e.push( u[t] ); return e }() } ), void S(); var C = [], M = []; if ( e ) t.$wrapperEl.find( "." + t.params.slideClass ).remove(); else for ( var P = p; P <= c; P += 1 )( P < x || P > T ) && t.$wrapperEl.find( "." + t.params.slideClass + '[data-swiper-slide-index="' + P + '"]' ).remove(); for ( var z = 0; z < u.length; z += 1 )z >= x && z <= T && ( void 0 === c || e ? M.push( z ) : ( z > c && M.push( z ), z < p && C.push( z ) ) ); M.forEach( ( function ( e ) { t.$wrapperEl.append( f( u[e], e ) ) } ) ), C.sort( ( function ( e, t ) { return t - e } ) ).forEach( ( function ( e ) { t.$wrapperEl.prepend( f( u[e], e ) ) } ) ), t.$wrapperEl.children( ".swiper-slide" ).css( g, E + "px" ), S() }, renderSlide: function ( e, t ) { var i = this.params.virtual; if ( i.cache && this.virtual.cache[t] ) return this.virtual.cache[t]; var a = i.renderSlide ? s( i.renderSlide.call( this, e, t ) ) : s( '<div class="' + this.params.slideClass + '" data-swiper-slide-index="' + t + '">' + e + "</div>" ); return a.attr( "data-swiper-slide-index" ) || a.attr( "data-swiper-slide-index", t ), i.cache && ( this.virtual.cache[t] = a ), a }, appendSlide: function ( e ) { if ( "object" == typeof e && "length" in e ) for ( var t = 0; t < e.length; t += 1 )e[t] && this.virtual.slides.push( e[t] ); else this.virtual.slides.push( e ); this.virtual.update( !0 ) }, prependSlide: function ( e ) { var t = this.activeIndex, i = t + 1, s = 1; if ( Array.isArray( e ) ) { for ( var a = 0; a < e.length; a += 1 )e[a] && this.virtual.slides.unshift( e[a] ); i = t + e.length, s = e.length } else this.virtual.slides.unshift( e ); if ( this.params.virtual.cache ) { var r = this.virtual.cache, n = {}; Object.keys( r ).forEach( ( function ( e ) { var t = r[e], i = t.attr( "data-swiper-slide-index" ); i && t.attr( "data-swiper-slide-index", parseInt( i, 10 ) + 1 ), n[parseInt( e, 10 ) + s] = t } ) ), this.virtual.cache = n } this.virtual.update( !0 ), this.slideTo( i, 0 ) }, removeSlide: function ( e ) { if ( null != e ) { var t = this.activeIndex; if ( Array.isArray( e ) ) for ( var i = e.length - 1; i >= 0; i -= 1 )this.virtual.slides.splice( e[i], 1 ), this.params.virtual.cache && delete this.virtual.cache[e[i]], e[i] < t && ( t -= 1 ), t = Math.max( t, 0 ); else this.virtual.slides.splice( e, 1 ), this.params.virtual.cache && delete this.virtual.cache[e], e < t && ( t -= 1 ), t = Math.max( t, 0 ); this.virtual.update( !0 ), this.slideTo( t, 0 ) } }, removeAllSlides: function () { this.virtual.slides = [], this.params.virtual.cache && ( this.virtual.cache = {} ), this.virtual.update( !0 ), this.slideTo( 0, 0 ) } }, J = { name: "virtual", params: { virtual: { enabled: !1, slides: [], cache: !0, renderSlide: null, renderExternal: null, addSlidesBefore: 0, addSlidesAfter: 0 } }, create: function () { n.extend( this, { virtual: { update: Q.update.bind( this ), appendSlide: Q.appendSlide.bind( this ), prependSlide: Q.prependSlide.bind( this ), removeSlide: Q.removeSlide.bind( this ), removeAllSlides: Q.removeAllSlides.bind( this ), renderSlide: Q.renderSlide.bind( this ), slides: this.params.virtual.slides, cache: {} } } ) }, on: { beforeInit: function () { if ( this.params.virtual.enabled ) { this.classNames.push( this.params.containerModifierClass + "virtual" ); var e = { watchSlidesProgress: !0 }; n.extend( this.params, e ), n.extend( this.originalParams, e ), this.params.initialSlide || this.virtual.update() } }, setTranslate: function () { this.params.virtual.enabled && this.virtual.update() } } }, ee = { handle: function ( i ) { var s = this.rtlTranslate, a = i; a.originalEvent && ( a = a.originalEvent ); var r = a.keyCode || a.charCode; if ( !this.allowSlideNext && ( this.isHorizontal() && 39 === r || this.isVertical() && 40 === r || 34 === r ) ) return !1; if ( !this.allowSlidePrev && ( this.isHorizontal() && 37 === r || this.isVertical() && 38 === r || 33 === r ) ) return !1; if ( !( a.shiftKey || a.altKey || a.ctrlKey || a.metaKey || e.activeElement && e.activeElement.nodeName && ( "input" === e.activeElement.nodeName.toLowerCase() || "textarea" === e.activeElement.nodeName.toLowerCase() ) ) ) { if ( this.params.keyboard.onlyInViewport && ( 33 === r || 34 === r || 37 === r || 39 === r || 38 === r || 40 === r ) ) { var n = !1; if ( this.$el.parents( "." + this.params.slideClass ).length > 0 && 0 === this.$el.parents( "." + this.params.slideActiveClass ).length ) return; var o = t.innerWidth, l = t.innerHeight, d = this.$el.offset(); s && ( d.left -= this.$el[0].scrollLeft ); for ( var h = [[d.left, d.top], [d.left + this.width, d.top], [d.left, d.top + this.height], [d.left + this.width, d.top + this.height]], p = 0; p < h.length; p += 1 ) { var c = h[p]; c[0] >= 0 && c[0] <= o && c[1] >= 0 && c[1] <= l && ( n = !0 ) } if ( !n ) return } this.isHorizontal() ? ( 33 !== r && 34 !== r && 37 !== r && 39 !== r || ( a.preventDefault ? a.preventDefault() : a.returnValue = !1 ), ( 34 !== r && 39 !== r || s ) && ( 33 !== r && 37 !== r || !s ) || this.slideNext(), ( 33 !== r && 37 !== r || s ) && ( 34 !== r && 39 !== r || !s ) || this.slidePrev() ) : ( 33 !== r && 34 !== r && 38 !== r && 40 !== r || ( a.preventDefault ? a.preventDefault() : a.returnValue = !1 ), 34 !== r && 40 !== r || this.slideNext(), 33 !== r && 38 !== r || this.slidePrev() ), this.emit( "keyPress", r ) } }, enable: function () { this.keyboard.enabled || ( s( e ).on( "keydown", this.keyboard.handle ), this.keyboard.enabled = !0 ) }, disable: function () { this.keyboard.enabled && ( s( e ).off( "keydown", this.keyboard.handle ), this.keyboard.enabled = !1 ) } }, te = { name: "keyboard", params: { keyboard: { enabled: !1, onlyInViewport: !0 } }, create: function () { n.extend( this, { keyboard: { enabled: !1, enable: ee.enable.bind( this ), disable: ee.disable.bind( this ), handle: ee.handle.bind( this ) } } ) }, on: { init: function () { this.params.keyboard.enabled && this.keyboard.enable() }, destroy: function () { this.keyboard.enabled && this.keyboard.disable() } } }; var ie = { lastScrollTime: n.now(), lastEventBeforeSnap: void 0, recentWheelEvents: [], event: function () { return t.navigator.userAgent.indexOf( "firefox" ) > -1 ? "DOMMouseScroll" : function () { var t = "onwheel" in e; if ( !t ) { var i = e.createElement( "div" ); i.setAttribute( "onwheel", "return;" ), t = "function" == typeof i.onwheel } return !t && e.implementation && e.implementation.hasFeature && !0 !== e.implementation.hasFeature( "", "" ) && ( t = e.implementation.hasFeature( "Events.wheel", "3.0" ) ), t }() ? "wheel" : "mousewheel" }, normalize: function ( e ) { var t = 0, i = 0, s = 0, a = 0; return "detail" in e && ( i = e.detail ), "wheelDelta" in e && ( i = -e.wheelDelta / 120 ), "wheelDeltaY" in e && ( i = -e.wheelDeltaY / 120 ), "wheelDeltaX" in e && ( t = -e.wheelDeltaX / 120 ), "axis" in e && e.axis === e.HORIZONTAL_AXIS && ( t = i, i = 0 ), s = 10 * t, a = 10 * i, "deltaY" in e && ( a = e.deltaY ), "deltaX" in e && ( s = e.deltaX ), e.shiftKey && !s && ( s = a, a = 0 ), ( s || a ) && e.deltaMode && ( 1 === e.deltaMode ? ( s *= 40, a *= 40 ) : ( s *= 800, a *= 800 ) ), s && !t && ( t = s < 1 ? -1 : 1 ), a && !i && ( i = a < 1 ? -1 : 1 ), { spinX: t, spinY: i, pixelX: s, pixelY: a } }, handleMouseEnter: function () { this.mouseEntered = !0 }, handleMouseLeave: function () { this.mouseEntered = !1 }, handle: function ( e ) { var t = e, i = this, s = i.params.mousewheel; if ( i.params.cssMode && t.preventDefault(), !i.mouseEntered && !s.releaseOnEdges ) return !0; t.originalEvent && ( t = t.originalEvent ); var a = 0, r = i.rtlTranslate ? -1 : 1, o = ie.normalize( t ); if ( s.forceToAxis ) if ( i.isHorizontal() ) { if ( !( Math.abs( o.pixelX ) > Math.abs( o.pixelY ) ) ) return !0; a = o.pixelX * r } else { if ( !( Math.abs( o.pixelY ) > Math.abs( o.pixelX ) ) ) return !0; a = o.pixelY } else a = Math.abs( o.pixelX ) > Math.abs( o.pixelY ) ? -o.pixelX * r : -o.pixelY; if ( 0 === a ) return !0; if ( s.invert && ( a = -a ), i.params.freeMode ) { var l = { time: n.now(), delta: Math.abs( a ), direction: Math.sign( a ) }, d = i.mousewheel.lastEventBeforeSnap, h = d && l.time < d.time + 500 && l.delta <= d.delta && l.direction === d.direction; if ( !h ) { i.mousewheel.lastEventBeforeSnap = void 0, i.params.loop && i.loopFix(); var p = i.getTranslate() + a * s.sensitivity, c = i.isBeginning, u = i.isEnd; if ( p >= i.minTranslate() && ( p = i.minTranslate() ), p <= i.maxTranslate() && ( p = i.maxTranslate() ), i.setTransition( 0 ), i.setTranslate( p ), i.updateProgress(), i.updateActiveIndex(), i.updateSlidesClasses(), ( !c && i.isBeginning || !u && i.isEnd ) && i.updateSlidesClasses(), i.params.freeModeSticky ) { clearTimeout( i.mousewheel.timeout ), i.mousewheel.timeout = void 0; var v = i.mousewheel.recentWheelEvents; v.length >= 15 && v.shift(); var f = v.length ? v[v.length - 1] : void 0, m = v[0]; if ( v.push( l ), f && ( l.delta > f.delta || l.direction !== f.direction ) ) v.splice( 0 ); else if ( v.length >= 15 && l.time - m.time < 500 && m.delta - l.delta >= 1 && l.delta <= 6 ) { var g = a > 0 ? .8 : .2; i.mousewheel.lastEventBeforeSnap = l, v.splice( 0 ), i.mousewheel.timeout = n.nextTick( ( function () { i.slideToClosest( i.params.speed, !0, void 0, g ) } ), 0 ) } i.mousewheel.timeout || ( i.mousewheel.timeout = n.nextTick( ( function () { i.mousewheel.lastEventBeforeSnap = l, v.splice( 0 ), i.slideToClosest( i.params.speed, !0, void 0, .5 ) } ), 500 ) ) } if ( h || i.emit( "scroll", t ), i.params.autoplay && i.params.autoplayDisableOnInteraction && i.autoplay.stop(), p === i.minTranslate() || p === i.maxTranslate() ) return !0 } } else { var b = { time: n.now(), delta: Math.abs( a ), direction: Math.sign( a ), raw: e }, w = i.mousewheel.recentWheelEvents; w.length >= 2 && w.shift(); var y = w.length ? w[w.length - 1] : void 0; if ( w.push( b ), y ? ( b.direction !== y.direction || b.delta > y.delta ) && i.mousewheel.animateSlider( b ) : i.mousewheel.animateSlider( b ), i.mousewheel.releaseScroll( b ) ) return !0 } return t.preventDefault ? t.preventDefault() : t.returnValue = !1, !1 }, animateSlider: function ( e ) { return e.delta >= 6 && n.now() - this.mousewheel.lastScrollTime < 60 || ( e.direction < 0 ? this.isEnd && !this.params.loop || this.animating || ( this.slideNext(), this.emit( "scroll", e.raw ) ) : this.isBeginning && !this.params.loop || this.animating || ( this.slidePrev(), this.emit( "scroll", e.raw ) ), this.mousewheel.lastScrollTime = ( new t.Date ).getTime(), !1 ) }, releaseScroll: function ( e ) { var t = this.params.mousewheel; if ( e.direction < 0 ) { if ( this.isEnd && !this.params.loop && t.releaseOnEdges ) return !0 } else if ( this.isBeginning && !this.params.loop && t.releaseOnEdges ) return !0; return !1 }, enable: function () { var e = ie.event(); if ( this.params.cssMode ) return this.wrapperEl.removeEventListener( e, this.mousewheel.handle ), !0; if ( !e ) return !1; if ( this.mousewheel.enabled ) return !1; var t = this.$el; return "container" !== this.params.mousewheel.eventsTarged && ( t = s( this.params.mousewheel.eventsTarged ) ), t.on( "mouseenter", this.mousewheel.handleMouseEnter ), t.on( "mouseleave", this.mousewheel.handleMouseLeave ), t.on( e, this.mousewheel.handle ), this.mousewheel.enabled = !0, !0 }, disable: function () { var e = ie.event(); if ( this.params.cssMode ) return this.wrapperEl.addEventListener( e, this.mousewheel.handle ), !0; if ( !e ) return !1; if ( !this.mousewheel.enabled ) return !1; var t = this.$el; return "container" !== this.params.mousewheel.eventsTarged && ( t = s( this.params.mousewheel.eventsTarged ) ), t.off( e, this.mousewheel.handle ), this.mousewheel.enabled = !1, !0 } }, se = { update: function () { var e = this.params.navigation; if ( !this.params.loop ) { var t = this.navigation, i = t.$nextEl, s = t.$prevEl; s && s.length > 0 && ( this.isBeginning ? s.addClass( e.disabledClass ) : s.removeClass( e.disabledClass ), s[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"]( e.lockClass ) ), i && i.length > 0 && ( this.isEnd ? i.addClass( e.disabledClass ) : i.removeClass( e.disabledClass ), i[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"]( e.lockClass ) ) } }, onPrevClick: function ( e ) { e.preventDefault(), this.isBeginning && !this.params.loop || this.slidePrev() }, onNextClick: function ( e ) { e.preventDefault(), this.isEnd && !this.params.loop || this.slideNext() }, init: function () { var e, t, i = this.params.navigation; ( i.nextEl || i.prevEl ) && ( i.nextEl && ( e = s( i.nextEl ), this.params.uniqueNavElements && "string" == typeof i.nextEl && e.length > 1 && 1 === this.$el.find( i.nextEl ).length && ( e = this.$el.find( i.nextEl ) ) ), i.prevEl && ( t = s( i.prevEl ), this.params.uniqueNavElements && "string" == typeof i.prevEl && t.length > 1 && 1 === this.$el.find( i.prevEl ).length && ( t = this.$el.find( i.prevEl ) ) ), e && e.length > 0 && e.on( "click", this.navigation.onNextClick ), t && t.length > 0 && t.on( "click", this.navigation.onPrevClick ), n.extend( this.navigation, { $nextEl: e, nextEl: e && e[0], $prevEl: t, prevEl: t && t[0] } ) ) }, destroy: function () { var e = this.navigation, t = e.$nextEl, i = e.$prevEl; t && t.length && ( t.off( "click", this.navigation.onNextClick ), t.removeClass( this.params.navigation.disabledClass ) ), i && i.length && ( i.off( "click", this.navigation.onPrevClick ), i.removeClass( this.params.navigation.disabledClass ) ) } }, ae = { update: function () { var e = this.rtl, t = this.params.pagination; if ( t.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length ) { var i, a = this.virtual && this.params.virtual.enabled ? this.virtual.slides.length : this.slides.length, r = this.pagination.$el, n = this.params.loop ? Math.ceil( ( a - 2 * this.loopedSlides ) / this.params.slidesPerGroup ) : this.snapGrid.length; if ( this.params.loop ? ( ( i = Math.ceil( ( this.activeIndex - this.loopedSlides ) / this.params.slidesPerGroup ) ) > a - 1 - 2 * this.loopedSlides && ( i -= a - 2 * this.loopedSlides ), i > n - 1 && ( i -= n ), i < 0 && "bullets" !== this.params.paginationType && ( i = n + i ) ) : i = void 0 !== this.snapIndex ? this.snapIndex : this.activeIndex || 0, "bullets" === t.type && this.pagination.bullets && this.pagination.bullets.length > 0 ) { var o, l, d, h = this.pagination.bullets; if ( t.dynamicBullets && ( this.pagination.bulletSize = h.eq( 0 )[this.isHorizontal() ? "outerWidth" : "outerHeight"]( !0 ), r.css( this.isHorizontal() ? "width" : "height", this.pagination.bulletSize * ( t.dynamicMainBullets + 4 ) + "px" ), t.dynamicMainBullets > 1 && void 0 !== this.previousIndex && ( this.pagination.dynamicBulletIndex += i - this.previousIndex, this.pagination.dynamicBulletIndex > t.dynamicMainBullets - 1 ? this.pagination.dynamicBulletIndex = t.dynamicMainBullets - 1 : this.pagination.dynamicBulletIndex < 0 && ( this.pagination.dynamicBulletIndex = 0 ) ), o = i - this.pagination.dynamicBulletIndex, d = ( ( l = o + ( Math.min( h.length, t.dynamicMainBullets ) - 1 ) ) + o ) / 2 ), h.removeClass( t.bulletActiveClass + " " + t.bulletActiveClass + "-next " + t.bulletActiveClass + "-next-next " + t.bulletActiveClass + "-prev " + t.bulletActiveClass + "-prev-prev " + t.bulletActiveClass + "-main" ), r.length > 1 ) h.each( ( function ( e, a ) { var r = s( a ), n = r.index(); n === i && r.addClass( t.bulletActiveClass ), t.dynamicBullets && ( n >= o && n <= l && r.addClass( t.bulletActiveClass + "-main" ), n === o && r.prev().addClass( t.bulletActiveClass + "-prev" ).prev().addClass( t.bulletActiveClass + "-prev-prev" ), n === l && r.next().addClass( t.bulletActiveClass + "-next" ).next().addClass( t.bulletActiveClass + "-next-next" ) ) } ) ); else { var p = h.eq( i ), c = p.index(); if ( p.addClass( t.bulletActiveClass ), t.dynamicBullets ) { for ( var u = h.eq( o ), v = h.eq( l ), f = o; f <= l; f += 1 )h.eq( f ).addClass( t.bulletActiveClass + "-main" ); if ( this.params.loop ) if ( c >= h.length - t.dynamicMainBullets ) { for ( var m = t.dynamicMainBullets; m >= 0; m -= 1 )h.eq( h.length - m ).addClass( t.bulletActiveClass + "-main" ); h.eq( h.length - t.dynamicMainBullets - 1 ).addClass( t.bulletActiveClass + "-prev" ) } else u.prev().addClass( t.bulletActiveClass + "-prev" ).prev().addClass( t.bulletActiveClass + "-prev-prev" ), v.next().addClass( t.bulletActiveClass + "-next" ).next().addClass( t.bulletActiveClass + "-next-next" ); else u.prev().addClass( t.bulletActiveClass + "-prev" ).prev().addClass( t.bulletActiveClass + "-prev-prev" ), v.next().addClass( t.bulletActiveClass + "-next" ).next().addClass( t.bulletActiveClass + "-next-next" ) } } if ( t.dynamicBullets ) { var g = Math.min( h.length, t.dynamicMainBullets + 4 ), b = ( this.pagination.bulletSize * g - this.pagination.bulletSize ) / 2 - d * this.pagination.bulletSize, w = e ? "right" : "left"; h.css( this.isHorizontal() ? w : "top", b + "px" ) } } if ( "fraction" === t.type && ( r.find( "." + t.currentClass ).text( t.formatFractionCurrent( i + 1 ) ), r.find( "." + t.totalClass ).text( t.formatFractionTotal( n ) ) ), "progressbar" === t.type ) { var y; y = t.progressbarOpposite ? this.isHorizontal() ? "vertical" : "horizontal" : this.isHorizontal() ? "horizontal" : "vertical"; var x = ( i + 1 ) / n, T = 1, E = 1; "horizontal" === y ? T = x : E = x, r.find( "." + t.progressbarFillClass ).transform( "translate3d(0,0,0) scaleX(" + T + ") scaleY(" + E + ")" ).transition( this.params.speed ) } "custom" === t.type && t.renderCustom ? ( r.html( t.renderCustom( this, i + 1, n ) ), this.emit( "paginationRender", this, r[0] ) ) : this.emit( "paginationUpdate", this, r[0] ), r[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"]( t.lockClass ) } }, render: function () { var e = this.params.pagination; if ( e.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length ) { var t = this.virtual && this.params.virtual.enabled ? this.virtual.slides.length : this.slides.length, i = this.pagination.$el, s = ""; if ( "bullets" === e.type ) { for ( var a = this.params.loop ? Math.ceil( ( t - 2 * this.loopedSlides ) / this.params.slidesPerGroup ) : this.snapGrid.length, r = 0; r < a; r += 1 )e.renderBullet ? s += e.renderBullet.call( this, r, e.bulletClass ) : s += "<" + e.bulletElement + ' class="' + e.bulletClass + '"></' + e.bulletElement + ">"; i.html( s ), this.pagination.bullets = i.find( "." + e.bulletClass ) } "fraction" === e.type && ( s = e.renderFraction ? e.renderFraction.call( this, e.currentClass, e.totalClass ) : '<span class="' + e.currentClass + '"></span> / <span class="' + e.totalClass + '"></span>', i.html( s ) ), "progressbar" === e.type && ( s = e.renderProgressbar ? e.renderProgressbar.call( this, e.progressbarFillClass ) : '<span class="' + e.progressbarFillClass + '"></span>', i.html( s ) ), "custom" !== e.type && this.emit( "paginationRender", this.pagination.$el[0] ) } }, init: function () { var e = this, t = e.params.pagination; if ( t.el ) { var i = s( t.el ); 0 !== i.length && ( e.params.uniqueNavElements && "string" == typeof t.el && i.length > 1 && 1 === e.$el.find( t.el ).length && ( i = e.$el.find( t.el ) ), "bullets" === t.type && t.clickable && i.addClass( t.clickableClass ), i.addClass( t.modifierClass + t.type ), "bullets" === t.type && t.dynamicBullets && ( i.addClass( "" + t.modifierClass + t.type + "-dynamic" ), e.pagination.dynamicBulletIndex = 0, t.dynamicMainBullets < 1 && ( t.dynamicMainBullets = 1 ) ), "progressbar" === t.type && t.progressbarOpposite && i.addClass( t.progressbarOppositeClass ), t.clickable && i.on( "click", "." + t.bulletClass, ( function ( t ) { t.preventDefault(); var i = s( this ).index() * e.params.slidesPerGroup; e.params.loop && ( i += e.loopedSlides ), e.slideTo( i ) } ) ), n.extend( e.pagination, { $el: i, el: i[0] } ) ) } }, destroy: function () { var e = this.params.pagination; if ( e.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length ) { var t = this.pagination.$el; t.removeClass( e.hiddenClass ), t.removeClass( e.modifierClass + e.type ), this.pagination.bullets && this.pagination.bullets.removeClass( e.bulletActiveClass ), e.clickable && t.off( "click", "." + e.bulletClass ) } } }, re = { setTranslate: function () { if ( this.params.scrollbar.el && this.scrollbar.el ) { var e = this.scrollbar, t = this.rtlTranslate, i = this.progress, s = e.dragSize, a = e.trackSize, r = e.$dragEl, n = e.$el, o = this.params.scrollbar, l = s, d = ( a - s ) * i; t ? ( d = -d ) > 0 ? ( l = s - d, d = 0 ) : -d + s > a && ( l = a + d ) : d < 0 ? ( l = s + d, d = 0 ) : d + s > a && ( l = a - d ), this.isHorizontal() ? ( r.transform( "translate3d(" + d + "px, 0, 0)" ), r[0].style.width = l + "px" ) : ( r.transform( "translate3d(0px, " + d + "px, 0)" ), r[0].style.height = l + "px" ), o.hide && ( clearTimeout( this.scrollbar.timeout ), n[0].style.opacity = 1, this.scrollbar.timeout = setTimeout( ( function () { n[0].style.opacity = 0, n.transition( 400 ) } ), 1e3 ) ) } }, setTransition: function ( e ) { this.params.scrollbar.el && this.scrollbar.el && this.scrollbar.$dragEl.transition( e ) }, updateSize: function () { if ( this.params.scrollbar.el && this.scrollbar.el ) { var e = this.scrollbar, t = e.$dragEl, i = e.$el; t[0].style.width = "", t[0].style.height = ""; var s, a = this.isHorizontal() ? i[0].offsetWidth : i[0].offsetHeight, r = this.size / this.virtualSize, o = r * ( a / this.size ); s = "auto" === this.params.scrollbar.dragSize ? a * r : parseInt( this.params.scrollbar.dragSize, 10 ), this.isHorizontal() ? t[0].style.width = s + "px" : t[0].style.height = s + "px", i[0].style.display = r >= 1 ? "none" : "", this.params.scrollbar.hide && ( i[0].style.opacity = 0 ), n.extend( e, { trackSize: a, divider: r, moveDivider: o, dragSize: s } ), e.$el[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"]( this.params.scrollbar.lockClass ) } }, getPointerPosition: function ( e ) { return this.isHorizontal() ? "touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0].clientX : e.clientX : "touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0].clientY : e.clientY }, setDragPosition: function ( e ) { var t, i = this.scrollbar, s = this.rtlTranslate, a = i.$el, r = i.dragSize, n = i.trackSize, o = i.dragStartPos; t = ( i.getPointerPosition( e ) - a.offset()[this.isHorizontal() ? "left" : "top"] - ( null !== o ? o : r / 2 ) ) / ( n - r ), t = Math.max( Math.min( t, 1 ), 0 ), s && ( t = 1 - t ); var l = this.minTranslate() + ( this.maxTranslate() - this.minTranslate() ) * t; this.updateProgress( l ), this.setTranslate( l ), this.updateActiveIndex(), this.updateSlidesClasses() }, onDragStart: function ( e ) { var t = this.params.scrollbar, i = this.scrollbar, s = this.$wrapperEl, a = i.$el, r = i.$dragEl; this.scrollbar.isTouched = !0, this.scrollbar.dragStartPos = e.target === r[0] || e.target === r ? i.getPointerPosition( e ) - e.target.getBoundingClientRect()[this.isHorizontal() ? "left" : "top"] : null, e.preventDefault(), e.stopPropagation(), s.transition( 100 ), r.transition( 100 ), i.setDragPosition( e ), clearTimeout( this.scrollbar.dragTimeout ), a.transition( 0 ), t.hide && a.css( "opacity", 1 ), this.params.cssMode && this.$wrapperEl.css( "scroll-snap-type", "none" ), this.emit( "scrollbarDragStart", e ) }, onDragMove: function ( e ) { var t = this.scrollbar, i = this.$wrapperEl, s = t.$el, a = t.$dragEl; this.scrollbar.isTouched && ( e.preventDefault ? e.preventDefault() : e.returnValue = !1, t.setDragPosition( e ), i.transition( 0 ), s.transition( 0 ), a.transition( 0 ), this.emit( "scrollbarDragMove", e ) ) }, onDragEnd: function ( e ) { var t = this.params.scrollbar, i = this.scrollbar, s = this.$wrapperEl, a = i.$el; this.scrollbar.isTouched && ( this.scrollbar.isTouched = !1, this.params.cssMode && ( this.$wrapperEl.css( "scroll-snap-type", "" ), s.transition( "" ) ), t.hide && ( clearTimeout( this.scrollbar.dragTimeout ), this.scrollbar.dragTimeout = n.nextTick( ( function () { a.css( "opacity", 0 ), a.transition( 400 ) } ), 1e3 ) ), this.emit( "scrollbarDragEnd", e ), t.snapOnRelease && this.slideToClosest() ) }, enableDraggable: function () { if ( this.params.scrollbar.el ) { var t = this.scrollbar, i = this.touchEventsTouch, s = this.touchEventsDesktop, a = this.params, r = t.$el[0], n = !( !o.passiveListener || !a.passiveListeners ) && { passive: !1, capture: !1 }, l = !( !o.passiveListener || !a.passiveListeners ) && { passive: !0, capture: !1 }; o.touch ? ( r.addEventListener( i.start, this.scrollbar.onDragStart, n ), r.addEventListener( i.move, this.scrollbar.onDragMove, n ), r.addEventListener( i.end, this.scrollbar.onDragEnd, l ) ) : ( r.addEventListener( s.start, this.scrollbar.onDragStart, n ), e.addEventListener( s.move, this.scrollbar.onDragMove, n ), e.addEventListener( s.end, this.scrollbar.onDragEnd, l ) ) } }, disableDraggable: function () { if ( this.params.scrollbar.el ) { var t = this.scrollbar, i = this.touchEventsTouch, s = this.touchEventsDesktop, a = this.params, r = t.$el[0], n = !( !o.passiveListener || !a.passiveListeners ) && { passive: !1, capture: !1 }, l = !( !o.passiveListener || !a.passiveListeners ) && { passive: !0, capture: !1 }; o.touch ? ( r.removeEventListener( i.start, this.scrollbar.onDragStart, n ), r.removeEventListener( i.move, this.scrollbar.onDragMove, n ), r.removeEventListener( i.end, this.scrollbar.onDragEnd, l ) ) : ( r.removeEventListener( s.start, this.scrollbar.onDragStart, n ), e.removeEventListener( s.move, this.scrollbar.onDragMove, n ), e.removeEventListener( s.end, this.scrollbar.onDragEnd, l ) ) } }, init: function () { if ( this.params.scrollbar.el ) { var e = this.scrollbar, t = this.$el, i = this.params.scrollbar, a = s( i.el ); this.params.uniqueNavElements && "string" == typeof i.el && a.length > 1 && 1 === t.find( i.el ).length && ( a = t.find( i.el ) ); var r = a.find( "." + this.params.scrollbar.dragClass ); 0 === r.length && ( r = s( '<div class="' + this.params.scrollbar.dragClass + '"></div>' ), a.append( r ) ), n.extend( e, { $el: a, el: a[0], $dragEl: r, dragEl: r[0] } ), i.draggable && e.enableDraggable() } }, destroy: function () { this.scrollbar.disableDraggable() } }, ne = { setTransform: function ( e, t ) { var i = this.rtl, a = s( e ), r = i ? -1 : 1, n = a.attr( "data-swiper-parallax" ) || "0", o = a.attr( "data-swiper-parallax-x" ), l = a.attr( "data-swiper-parallax-y" ), d = a.attr( "data-swiper-parallax-scale" ), h = a.attr( "data-swiper-parallax-opacity" ); if ( o || l ? ( o = o || "0", l = l || "0" ) : this.isHorizontal() ? ( o = n, l = "0" ) : ( l = n, o = "0" ), o = o.indexOf( "%" ) >= 0 ? parseInt( o, 10 ) * t * r + "%" : o * t * r + "px", l = l.indexOf( "%" ) >= 0 ? parseInt( l, 10 ) * t + "%" : l * t + "px", null != h ) { var p = h - ( h - 1 ) * ( 1 - Math.abs( t ) ); a[0].style.opacity = p } if ( null == d ) a.transform( "translate3d(" + o + ", " + l + ", 0px)" ); else { var c = d - ( d - 1 ) * ( 1 - Math.abs( t ) ); a.transform( "translate3d(" + o + ", " + l + ", 0px) scale(" + c + ")" ) } }, setTranslate: function () { var e = this, t = e.$el, i = e.slides, a = e.progress, r = e.snapGrid; t.children( "[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]" ).each( ( function ( t, i ) { e.parallax.setTransform( i, a ) } ) ), i.each( ( function ( t, i ) { var n = i.progress; e.params.slidesPerGroup > 1 && "auto" !== e.params.slidesPerView && ( n += Math.ceil( t / 2 ) - a * ( r.length - 1 ) ), n = Math.min( Math.max( n, -1 ), 1 ), s( i ).find( "[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]" ).each( ( function ( t, i ) { e.parallax.setTransform( i, n ) } ) ) } ) ) }, setTransition: function ( e ) { void 0 === e && ( e = this.params.speed ); this.$el.find( "[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]" ).each( ( function ( t, i ) { var a = s( i ), r = parseInt( a.attr( "data-swiper-parallax-duration" ), 10 ) || e; 0 === e && ( r = 0 ), a.transition( r ) } ) ) } }, oe = { getDistanceBetweenTouches: function ( e ) { if ( e.targetTouches.length < 2 ) return 1; var t = e.targetTouches[0].pageX, i = e.targetTouches[0].pageY, s = e.targetTouches[1].pageX, a = e.targetTouches[1].pageY; return Math.sqrt( Math.pow( s - t, 2 ) + Math.pow( a - i, 2 ) ) }, onGestureStart: function ( e ) { var t = this.params.zoom, i = this.zoom, a = i.gesture; if ( i.fakeGestureTouched = !1, i.fakeGestureMoved = !1, !o.gestures ) { if ( "touchstart" !== e.type || "touchstart" === e.type && e.targetTouches.length < 2 ) return; i.fakeGestureTouched = !0, a.scaleStart = oe.getDistanceBetweenTouches( e ) } a.$slideEl && a.$slideEl.length || ( a.$slideEl = s( e.target ).closest( ".swiper-slide" ), 0 === a.$slideEl.length && ( a.$slideEl = this.slides.eq( this.activeIndex ) ), a.$imageEl = a.$slideEl.find( "img, svg, canvas" ), a.$imageWrapEl = a.$imageEl.parent( "." + t.containerClass ), a.maxRatio = a.$imageWrapEl.attr( "data-swiper-zoom" ) || t.maxRatio, 0 !== a.$imageWrapEl.length ) ? ( a.$imageEl.transition( 0 ), this.zoom.isScaling = !0 ) : a.$imageEl = void 0 }, onGestureChange: function ( e ) { var t = this.params.zoom, i = this.zoom, s = i.gesture; if ( !o.gestures ) { if ( "touchmove" !== e.type || "touchmove" === e.type && e.targetTouches.length < 2 ) return; i.fakeGestureMoved = !0, s.scaleMove = oe.getDistanceBetweenTouches( e ) } s.$imageEl && 0 !== s.$imageEl.length && ( o.gestures ? i.scale = e.scale * i.currentScale : i.scale = s.scaleMove / s.scaleStart * i.currentScale, i.scale > s.maxRatio && ( i.scale = s.maxRatio - 1 + Math.pow( i.scale - s.maxRatio + 1, .5 ) ), i.scale < t.minRatio && ( i.scale = t.minRatio + 1 - Math.pow( t.minRatio - i.scale + 1, .5 ) ), s.$imageEl.transform( "translate3d(0,0,0) scale(" + i.scale + ")" ) ) }, onGestureEnd: function ( e ) { var t = this.params.zoom, i = this.zoom, s = i.gesture; if ( !o.gestures ) { if ( !i.fakeGestureTouched || !i.fakeGestureMoved ) return; if ( "touchend" !== e.type || "touchend" === e.type && e.changedTouches.length < 2 && !I.android ) return; i.fakeGestureTouched = !1, i.fakeGestureMoved = !1 } s.$imageEl && 0 !== s.$imageEl.length && ( i.scale = Math.max( Math.min( i.scale, s.maxRatio ), t.minRatio ), s.$imageEl.transition( this.params.speed ).transform( "translate3d(0,0,0) scale(" + i.scale + ")" ), i.currentScale = i.scale, i.isScaling = !1, 1 === i.scale && ( s.$slideEl = void 0 ) ) }, onTouchStart: function ( e ) { var t = this.zoom, i = t.gesture, s = t.image; i.$imageEl && 0 !== i.$imageEl.length && ( s.isTouched || ( I.android && e.preventDefault(), s.isTouched = !0, s.touchesStart.x = "touchstart" === e.type ? e.targetTouches[0].pageX : e.pageX, s.touchesStart.y = "touchstart" === e.type ? e.targetTouches[0].pageY : e.pageY ) ) }, onTouchMove: function ( e ) { var t = this.zoom, i = t.gesture, s = t.image, a = t.velocity; if ( i.$imageEl && 0 !== i.$imageEl.length && ( this.allowClick = !1, s.isTouched && i.$slideEl ) ) { s.isMoved || ( s.width = i.$imageEl[0].offsetWidth, s.height = i.$imageEl[0].offsetHeight, s.startX = n.getTranslate( i.$imageWrapEl[0], "x" ) || 0, s.startY = n.getTranslate( i.$imageWrapEl[0], "y" ) || 0, i.slideWidth = i.$slideEl[0].offsetWidth, i.slideHeight = i.$slideEl[0].offsetHeight, i.$imageWrapEl.transition( 0 ), this.rtl && ( s.startX = -s.startX, s.startY = -s.startY ) ); var r = s.width * t.scale, o = s.height * t.scale; if ( !( r < i.slideWidth && o < i.slideHeight ) ) { if ( s.minX = Math.min( i.slideWidth / 2 - r / 2, 0 ), s.maxX = -s.minX, s.minY = Math.min( i.slideHeight / 2 - o / 2, 0 ), s.maxY = -s.minY, s.touchesCurrent.x = "touchmove" === e.type ? e.targetTouches[0].pageX : e.pageX, s.touchesCurrent.y = "touchmove" === e.type ? e.targetTouches[0].pageY : e.pageY, !s.isMoved && !t.isScaling ) { if ( this.isHorizontal() && ( Math.floor( s.minX ) === Math.floor( s.startX ) && s.touchesCurrent.x < s.touchesStart.x || Math.floor( s.maxX ) === Math.floor( s.startX ) && s.touchesCurrent.x > s.touchesStart.x ) ) return void ( s.isTouched = !1 ); if ( !this.isHorizontal() && ( Math.floor( s.minY ) === Math.floor( s.startY ) && s.touchesCurrent.y < s.touchesStart.y || Math.floor( s.maxY ) === Math.floor( s.startY ) && s.touchesCurrent.y > s.touchesStart.y ) ) return void ( s.isTouched = !1 ) } e.preventDefault(), e.stopPropagation(), s.isMoved = !0, s.currentX = s.touchesCurrent.x - s.touchesStart.x + s.startX, s.currentY = s.touchesCurrent.y - s.touchesStart.y + s.startY, s.currentX < s.minX && ( s.currentX = s.minX + 1 - Math.pow( s.minX - s.currentX + 1, .8 ) ), s.currentX > s.maxX && ( s.currentX = s.maxX - 1 + Math.pow( s.currentX - s.maxX + 1, .8 ) ), s.currentY < s.minY && ( s.currentY = s.minY + 1 - Math.pow( s.minY - s.currentY + 1, .8 ) ), s.currentY > s.maxY && ( s.currentY = s.maxY - 1 + Math.pow( s.currentY - s.maxY + 1, .8 ) ), a.prevPositionX || ( a.prevPositionX = s.touchesCurrent.x ), a.prevPositionY || ( a.prevPositionY = s.touchesCurrent.y ), a.prevTime || ( a.prevTime = Date.now() ), a.x = ( s.touchesCurrent.x - a.prevPositionX ) / ( Date.now() - a.prevTime ) / 2, a.y = ( s.touchesCurrent.y - a.prevPositionY ) / ( Date.now() - a.prevTime ) / 2, Math.abs( s.touchesCurrent.x - a.prevPositionX ) < 2 && ( a.x = 0 ), Math.abs( s.touchesCurrent.y - a.prevPositionY ) < 2 && ( a.y = 0 ), a.prevPositionX = s.touchesCurrent.x, a.prevPositionY = s.touchesCurrent.y, a.prevTime = Date.now(), i.$imageWrapEl.transform( "translate3d(" + s.currentX + "px, " + s.currentY + "px,0)" ) } } }, onTouchEnd: function () { var e = this.zoom, t = e.gesture, i = e.image, s = e.velocity; if ( t.$imageEl && 0 !== t.$imageEl.length ) { if ( !i.isTouched || !i.isMoved ) return i.isTouched = !1, void ( i.isMoved = !1 ); i.isTouched = !1, i.isMoved = !1; var a = 300, r = 300, n = s.x * a, o = i.currentX + n, l = s.y * r, d = i.currentY + l; 0 !== s.x && ( a = Math.abs( ( o - i.currentX ) / s.x ) ), 0 !== s.y && ( r = Math.abs( ( d - i.currentY ) / s.y ) ); var h = Math.max( a, r ); i.currentX = o, i.currentY = d; var p = i.width * e.scale, c = i.height * e.scale; i.minX = Math.min( t.slideWidth / 2 - p / 2, 0 ), i.maxX = -i.minX, i.minY = Math.min( t.slideHeight / 2 - c / 2, 0 ), i.maxY = -i.minY, i.currentX = Math.max( Math.min( i.currentX, i.maxX ), i.minX ), i.currentY = Math.max( Math.min( i.currentY, i.maxY ), i.minY ), t.$imageWrapEl.transition( h ).transform( "translate3d(" + i.currentX + "px, " + i.currentY + "px,0)" ) } }, onTransitionEnd: function () { var e = this.zoom, t = e.gesture; t.$slideEl && this.previousIndex !== this.activeIndex && ( t.$imageEl.transform( "translate3d(0,0,0) scale(1)" ), t.$imageWrapEl.transform( "translate3d(0,0,0)" ), e.scale = 1, e.currentScale = 1, t.$slideEl = void 0, t.$imageEl = void 0, t.$imageWrapEl = void 0 ) }, toggle: function ( e ) { var t = this.zoom; t.scale && 1 !== t.scale ? t.out() : t.in( e ) }, in: function ( e ) { var t, i, a, r, n, o, l, d, h, p, c, u, v, f, m, g, b = this.zoom, w = this.params.zoom, y = b.gesture, x = b.image; ( y.$slideEl || ( y.$slideEl = this.clickedSlide ? s( this.clickedSlide ) : this.slides.eq( this.activeIndex ), y.$imageEl = y.$slideEl.find( "img, svg, canvas" ), y.$imageWrapEl = y.$imageEl.parent( "." + w.containerClass ) ), y.$imageEl && 0 !== y.$imageEl.length ) && ( y.$slideEl.addClass( "" + w.zoomedSlideClass ), void 0 === x.touchesStart.x && e ? ( t = "touchend" === e.type ? e.changedTouches[0].pageX : e.pageX, i = "touchend" === e.type ? e.changedTouches[0].pageY : e.pageY ) : ( t = x.touchesStart.x, i = x.touchesStart.y ), b.scale = y.$imageWrapEl.attr( "data-swiper-zoom" ) || w.maxRatio, b.currentScale = y.$imageWrapEl.attr( "data-swiper-zoom" ) || w.maxRatio, e ? ( m = y.$slideEl[0].offsetWidth, g = y.$slideEl[0].offsetHeight, a = y.$slideEl.offset().left + m / 2 - t, r = y.$slideEl.offset().top + g / 2 - i, l = y.$imageEl[0].offsetWidth, d = y.$imageEl[0].offsetHeight, h = l * b.scale, p = d * b.scale, v = -( c = Math.min( m / 2 - h / 2, 0 ) ), f = -( u = Math.min( g / 2 - p / 2, 0 ) ), ( n = a * b.scale ) < c && ( n = c ), n > v && ( n = v ), ( o = r * b.scale ) < u && ( o = u ), o > f && ( o = f ) ) : ( n = 0, o = 0 ), y.$imageWrapEl.transition( 300 ).transform( "translate3d(" + n + "px, " + o + "px,0)" ), y.$imageEl.transition( 300 ).transform( "translate3d(0,0,0) scale(" + b.scale + ")" ) ) }, out: function () { var e = this.zoom, t = this.params.zoom, i = e.gesture; i.$slideEl || ( i.$slideEl = this.clickedSlide ? s( this.clickedSlide ) : this.slides.eq( this.activeIndex ), i.$imageEl = i.$slideEl.find( "img, svg, canvas" ), i.$imageWrapEl = i.$imageEl.parent( "." + t.containerClass ) ), i.$imageEl && 0 !== i.$imageEl.length && ( e.scale = 1, e.currentScale = 1, i.$imageWrapEl.transition( 300 ).transform( "translate3d(0,0,0)" ), i.$imageEl.transition( 300 ).transform( "translate3d(0,0,0) scale(1)" ), i.$slideEl.removeClass( "" + t.zoomedSlideClass ), i.$slideEl = void 0 ) }, enable: function () { var e = this.zoom; if ( !e.enabled ) { e.enabled = !0; var t = !( "touchstart" !== this.touchEvents.start || !o.passiveListener || !this.params.passiveListeners ) && { passive: !0, capture: !1 }, i = !o.passiveListener || { passive: !1, capture: !0 }; o.gestures ? ( this.$wrapperEl.on( "gesturestart", ".swiper-slide", e.onGestureStart, t ), this.$wrapperEl.on( "gesturechange", ".swiper-slide", e.onGestureChange, t ), this.$wrapperEl.on( "gestureend", ".swiper-slide", e.onGestureEnd, t ) ) : "touchstart" === this.touchEvents.start && ( this.$wrapperEl.on( this.touchEvents.start, ".swiper-slide", e.onGestureStart, t ), this.$wrapperEl.on( this.touchEvents.move, ".swiper-slide", e.onGestureChange, i ), this.$wrapperEl.on( this.touchEvents.end, ".swiper-slide", e.onGestureEnd, t ), this.touchEvents.cancel && this.$wrapperEl.on( this.touchEvents.cancel, ".swiper-slide", e.onGestureEnd, t ) ), this.$wrapperEl.on( this.touchEvents.move, "." + this.params.zoom.containerClass, e.onTouchMove, i ) } }, disable: function () { var e = this.zoom; if ( e.enabled ) { this.zoom.enabled = !1; var t = !( "touchstart" !== this.touchEvents.start || !o.passiveListener || !this.params.passiveListeners ) && { passive: !0, capture: !1 }, i = !o.passiveListener || { passive: !1, capture: !0 }; o.gestures ? ( this.$wrapperEl.off( "gesturestart", ".swiper-slide", e.onGestureStart, t ), this.$wrapperEl.off( "gesturechange", ".swiper-slide", e.onGestureChange, t ), this.$wrapperEl.off( "gestureend", ".swiper-slide", e.onGestureEnd, t ) ) : "touchstart" === this.touchEvents.start && ( this.$wrapperEl.off( this.touchEvents.start, ".swiper-slide", e.onGestureStart, t ), this.$wrapperEl.off( this.touchEvents.move, ".swiper-slide", e.onGestureChange, i ), this.$wrapperEl.off( this.touchEvents.end, ".swiper-slide", e.onGestureEnd, t ), this.touchEvents.cancel && this.$wrapperEl.off( this.touchEvents.cancel, ".swiper-slide", e.onGestureEnd, t ) ), this.$wrapperEl.off( this.touchEvents.move, "." + this.params.zoom.containerClass, e.onTouchMove, i ) } } }, le = { loadInSlide: function ( e, t ) { void 0 === t && ( t = !0 ); var i = this, a = i.params.lazy; if ( void 0 !== e && 0 !== i.slides.length ) { var r = i.virtual && i.params.virtual.enabled ? i.$wrapperEl.children( "." + i.params.slideClass + '[data-swiper-slide-index="' + e + '"]' ) : i.slides.eq( e ), n = r.find( "." + a.elementClass + ":not(." + a.loadedClass + "):not(." + a.loadingClass + ")" ); !r.hasClass( a.elementClass ) || r.hasClass( a.loadedClass ) || r.hasClass( a.loadingClass ) || ( n = n.add( r[0] ) ), 0 !== n.length && n.each( ( function ( e, n ) { var o = s( n ); o.addClass( a.loadingClass ); var l = o.attr( "data-background" ), d = o.attr( "data-src" ), h = o.attr( "data-srcset" ), p = o.attr( "data-sizes" ); i.loadImage( o[0], d || l, h, p, !1, ( function () { if ( null != i && i && ( !i || i.params ) && !i.destroyed ) { if ( l ? ( o.css( "background-image", 'url("' + l + '")' ), o.removeAttr( "data-background" ) ) : ( h && ( o.attr( "srcset", h ), o.removeAttr( "data-srcset" ) ), p && ( o.attr( "sizes", p ), o.removeAttr( "data-sizes" ) ), d && ( o.attr( "src", d ), o.removeAttr( "data-src" ) ) ), o.addClass( a.loadedClass ).removeClass( a.loadingClass ), r.find( "." + a.preloaderClass ).remove(), i.params.loop && t ) { var e = r.attr( "data-swiper-slide-index" ); if ( r.hasClass( i.params.slideDuplicateClass ) ) { var s = i.$wrapperEl.children( '[data-swiper-slide-index="' + e + '"]:not(.' + i.params.slideDuplicateClass + ")" ); i.lazy.loadInSlide( s.index(), !1 ) } else { var n = i.$wrapperEl.children( "." + i.params.slideDuplicateClass + '[data-swiper-slide-index="' + e + '"]' ); i.lazy.loadInSlide( n.index(), !1 ) } } i.emit( "lazyImageReady", r[0], o[0] ) } } ) ), i.emit( "lazyImageLoad", r[0], o[0] ) } ) ) } }, load: function () { var e = this, t = e.$wrapperEl, i = e.params, a = e.slides, r = e.activeIndex, n = e.virtual && i.virtual.enabled, o = i.lazy, l = i.slidesPerView; function d( e ) { if ( n ) { if ( t.children( "." + i.slideClass + '[data-swiper-slide-index="' + e + '"]' ).length ) return !0 } else if ( a[e] ) return !0; return !1 } function h( e ) { return n ? s( e ).attr( "data-swiper-slide-index" ) : s( e ).index() } if ( "auto" === l && ( l = 0 ), e.lazy.initialImageLoaded || ( e.lazy.initialImageLoaded = !0 ), e.params.watchSlidesVisibility ) t.children( "." + i.slideVisibleClass ).each( ( function ( t, i ) { var a = n ? s( i ).attr( "data-swiper-slide-index" ) : s( i ).index(); e.lazy.loadInSlide( a ) } ) ); else if ( l > 1 ) for ( var p = r; p < r + l; p += 1 )d( p ) && e.lazy.loadInSlide( p ); else e.lazy.loadInSlide( r ); if ( o.loadPrevNext ) if ( l > 1 || o.loadPrevNextAmount && o.loadPrevNextAmount > 1 ) { for ( var c = o.loadPrevNextAmount, u = l, v = Math.min( r + u + Math.max( c, u ), a.length ), f = Math.max( r - Math.max( u, c ), 0 ), m = r + l; m < v; m += 1 )d( m ) && e.lazy.loadInSlide( m ); for ( var g = f; g < r; g += 1 )d( g ) && e.lazy.loadInSlide( g ) } else { var b = t.children( "." + i.slideNextClass ); b.length > 0 && e.lazy.loadInSlide( h( b ) ); var w = t.children( "." + i.slidePrevClass ); w.length > 0 && e.lazy.loadInSlide( h( w ) ) } } }, de = { LinearSpline: function ( e, t ) { var i, s, a, r, n, o = function ( e, t ) { for ( s = -1, i = e.length; i - s > 1; )e[a = i + s >> 1] <= t ? s = a : i = a; return i }; return this.x = e, this.y = t, this.lastIndex = e.length - 1, this.interpolate = function ( e ) { return e ? ( n = o( this.x, e ), r = n - 1, ( e - this.x[r] ) * ( this.y[n] - this.y[r] ) / ( this.x[n] - this.x[r] ) + this.y[r] ) : 0 }, this }, getInterpolateFunction: function ( e ) { this.controller.spline || ( this.controller.spline = this.params.loop ? new de.LinearSpline( this.slidesGrid, e.slidesGrid ) : new de.LinearSpline( this.snapGrid, e.snapGrid ) ) }, setTranslate: function ( e, t ) { var i, s, a = this, r = a.controller.control; function n( e ) { var t = a.rtlTranslate ? -a.translate : a.translate; "slide" === a.params.controller.by && ( a.controller.getInterpolateFunction( e ), s = -a.controller.spline.interpolate( -t ) ), s && "container" !== a.params.controller.by || ( i = ( e.maxTranslate() - e.minTranslate() ) / ( a.maxTranslate() - a.minTranslate() ), s = ( t - a.minTranslate() ) * i + e.minTranslate() ), a.params.controller.inverse && ( s = e.maxTranslate() - s ), e.updateProgress( s ), e.setTranslate( s, a ), e.updateActiveIndex(), e.updateSlidesClasses() } if ( Array.isArray( r ) ) for ( var o = 0; o < r.length; o += 1 )r[o] !== t && r[o] instanceof W && n( r[o] ); else r instanceof W && t !== r && n( r ) }, setTransition: function ( e, t ) { var i, s = this, a = s.controller.control; function r( t ) { t.setTransition( e, s ), 0 !== e && ( t.transitionStart(), t.params.autoHeight && n.nextTick( ( function () { t.updateAutoHeight() } ) ), t.$wrapperEl.transitionEnd( ( function () { a && ( t.params.loop && "slide" === s.params.controller.by && t.loopFix(), t.transitionEnd() ) } ) ) ) } if ( Array.isArray( a ) ) for ( i = 0; i < a.length; i += 1 )a[i] !== t && a[i] instanceof W && r( a[i] ); else a instanceof W && t !== a && r( a ) } }, he = { makeElFocusable: function ( e ) { return e.attr( "tabIndex", "0" ), e }, addElRole: function ( e, t ) { return e.attr( "role", t ), e }, addElLabel: function ( e, t ) { return e.attr( "aria-label", t ), e }, disableEl: function ( e ) { return e.attr( "aria-disabled", !0 ), e }, enableEl: function ( e ) { return e.attr( "aria-disabled", !1 ), e }, onEnterKey: function ( e ) { var t = this.params.a11y; if ( 13 === e.keyCode ) { var i = s( e.target ); this.navigation && this.navigation.$nextEl && i.is( this.navigation.$nextEl ) && ( this.isEnd && !this.params.loop || this.slideNext(), this.isEnd ? this.a11y.notify( t.lastSlideMessage ) : this.a11y.notify( t.nextSlideMessage ) ), this.navigation && this.navigation.$prevEl && i.is( this.navigation.$prevEl ) && ( this.isBeginning && !this.params.loop || this.slidePrev(), this.isBeginning ? this.a11y.notify( t.firstSlideMessage ) : this.a11y.notify( t.prevSlideMessage ) ), this.pagination && i.is( "." + this.params.pagination.bulletClass ) && i[0].click() } }, notify: function ( e ) { var t = this.a11y.liveRegion; 0 !== t.length && ( t.html( "" ), t.html( e ) ) }, updateNavigation: function () { if ( !this.params.loop && this.navigation ) { var e = this.navigation, t = e.$nextEl, i = e.$prevEl; i && i.length > 0 && ( this.isBeginning ? this.a11y.disableEl( i ) : this.a11y.enableEl( i ) ), t && t.length > 0 && ( this.isEnd ? this.a11y.disableEl( t ) : this.a11y.enableEl( t ) ) } }, updatePagination: function () { var e = this, t = e.params.a11y; e.pagination && e.params.pagination.clickable && e.pagination.bullets && e.pagination.bullets.length && e.pagination.bullets.each( ( function ( i, a ) { var r = s( a ); e.a11y.makeElFocusable( r ), e.a11y.addElRole( r, "button" ), e.a11y.addElLabel( r, t.paginationBulletMessage.replace( /{{index}}/, r.index() + 1 ) ) } ) ) }, init: function () { this.$el.append( this.a11y.liveRegion ); var e, t, i = this.params.a11y; this.navigation && this.navigation.$nextEl && ( e = this.navigation.$nextEl ), this.navigation && this.navigation.$prevEl && ( t = this.navigation.$prevEl ), e && ( this.a11y.makeElFocusable( e ), this.a11y.addElRole( e, "button" ), this.a11y.addElLabel( e, i.nextSlideMessage ), e.on( "keydown", this.a11y.onEnterKey ) ), t && ( this.a11y.makeElFocusable( t ), this.a11y.addElRole( t, "button" ), this.a11y.addElLabel( t, i.prevSlideMessage ), t.on( "keydown", this.a11y.onEnterKey ) ), this.pagination && this.params.pagination.clickable && this.pagination.bullets && this.pagination.bullets.length && this.pagination.$el.on( "keydown", "." + this.params.pagination.bulletClass, this.a11y.onEnterKey ) }, destroy: function () { var e, t; this.a11y.liveRegion && this.a11y.liveRegion.length > 0 && this.a11y.liveRegion.remove(), this.navigation && this.navigation.$nextEl && ( e = this.navigation.$nextEl ), this.navigation && this.navigation.$prevEl && ( t = this.navigation.$prevEl ), e && e.off( "keydown", this.a11y.onEnterKey ), t && t.off( "keydown", this.a11y.onEnterKey ), this.pagination && this.params.pagination.clickable && this.pagination.bullets && this.pagination.bullets.length && this.pagination.$el.off( "keydown", "." + this.params.pagination.bulletClass, this.a11y.onEnterKey ) } }, pe = { init: function () { if ( this.params.history ) { if ( !t.history || !t.history.pushState ) return this.params.history.enabled = !1, void ( this.params.hashNavigation.enabled = !0 ); var e = this.history; e.initialized = !0, e.paths = pe.getPathValues(), ( e.paths.key || e.paths.value ) && ( e.scrollToSlide( 0, e.paths.value, this.params.runCallbacksOnInit ), this.params.history.replaceState || t.addEventListener( "popstate", this.history.setHistoryPopState ) ) } }, destroy: function () { this.params.history.replaceState || t.removeEventListener( "popstate", this.history.setHistoryPopState ) }, setHistoryPopState: function () { this.history.paths = pe.getPathValues(), this.history.scrollToSlide( this.params.speed, this.history.paths.value, !1 ) }, getPathValues: function () { var e = t.location.pathname.slice( 1 ).split( "/" ).filter( ( function ( e ) { return "" !== e } ) ), i = e.length; return { key: e[i - 2], value: e[i - 1] } }, setHistory: function ( e, i ) { if ( this.history.initialized && this.params.history.enabled ) { var s = this.slides.eq( i ), a = pe.slugify( s.attr( "data-history" ) ); t.location.pathname.includes( e ) || ( a = e + "/" + a ); var r = t.history.state; r && r.value === a || ( this.params.history.replaceState ? t.history.replaceState( { value: a }, null, a ) : t.history.pushState( { value: a }, null, a ) ) } }, slugify: function ( e ) { return e.toString().replace( /\s+/g, "-" ).replace( /[^\w-]+/g, "" ).replace( /--+/g, "-" ).replace( /^-+/, "" ).replace( /-+$/, "" ) }, scrollToSlide: function ( e, t, i ) { if ( t ) for ( var s = 0, a = this.slides.length; s < a; s += 1 ) { var r = this.slides.eq( s ); if ( pe.slugify( r.attr( "data-history" ) ) === t && !r.hasClass( this.params.slideDuplicateClass ) ) { var n = r.index(); this.slideTo( n, e, i ) } } else this.slideTo( 0, e, i ) } }, ce = { onHashCange: function () { var t = e.location.hash.replace( "#", "" ); if ( t !== this.slides.eq( this.activeIndex ).attr( "data-hash" ) ) { var i = this.$wrapperEl.children( "." + this.params.slideClass + '[data-hash="' + t + '"]' ).index(); if ( void 0 === i ) return; this.slideTo( i ) } }, setHash: function () { if ( this.hashNavigation.initialized && this.params.hashNavigation.enabled ) if ( this.params.hashNavigation.replaceState && t.history && t.history.replaceState ) t.history.replaceState( null, null, "#" + this.slides.eq( this.activeIndex ).attr( "data-hash" ) || "" ); else { var i = this.slides.eq( this.activeIndex ), s = i.attr( "data-hash" ) || i.attr( "data-history" ); e.location.hash = s || "" } }, init: function () { if ( !( !this.params.hashNavigation.enabled || this.params.history && this.params.history.enabled ) ) { this.hashNavigation.initialized = !0; var i = e.location.hash.replace( "#", "" ); if ( i ) for ( var a = 0, r = this.slides.length; a < r; a += 1 ) { var n = this.slides.eq( a ); if ( ( n.attr( "data-hash" ) || n.attr( "data-history" ) ) === i && !n.hasClass( this.params.slideDuplicateClass ) ) { var o = n.index(); this.slideTo( o, 0, this.params.runCallbacksOnInit, !0 ) } } this.params.hashNavigation.watchState && s( t ).on( "hashchange", this.hashNavigation.onHashCange ) } }, destroy: function () { this.params.hashNavigation.watchState && s( t ).off( "hashchange", this.hashNavigation.onHashCange ) } }, ue = { run: function () { var e = this, t = e.slides.eq( e.activeIndex ), i = e.params.autoplay.delay; t.attr( "data-swiper-autoplay" ) && ( i = t.attr( "data-swiper-autoplay" ) || e.params.autoplay.delay ), clearTimeout( e.autoplay.timeout ), e.autoplay.timeout = n.nextTick( ( function () { e.params.autoplay.reverseDirection ? e.params.loop ? ( e.loopFix(), e.slidePrev( e.params.speed, !0, !0 ), e.emit( "autoplay" ) ) : e.isBeginning ? e.params.autoplay.stopOnLastSlide ? e.autoplay.stop() : ( e.slideTo( e.slides.length - 1, e.params.speed, !0, !0 ), e.emit( "autoplay" ) ) : ( e.slidePrev( e.params.speed, !0, !0 ), e.emit( "autoplay" ) ) : e.params.loop ? ( e.loopFix(), e.slideNext( e.params.speed, !0, !0 ), e.emit( "autoplay" ) ) : e.isEnd ? e.params.autoplay.stopOnLastSlide ? e.autoplay.stop() : ( e.slideTo( 0, e.params.speed, !0, !0 ), e.emit( "autoplay" ) ) : ( e.slideNext( e.params.speed, !0, !0 ), e.emit( "autoplay" ) ), e.params.cssMode && e.autoplay.running && e.autoplay.run() } ), i ) }, start: function () { return void 0 === this.autoplay.timeout && ( !this.autoplay.running && ( this.autoplay.running = !0, this.emit( "autoplayStart" ), this.autoplay.run(), !0 ) ) }, stop: function () { return !!this.autoplay.running && ( void 0 !== this.autoplay.timeout && ( this.autoplay.timeout && ( clearTimeout( this.autoplay.timeout ), this.autoplay.timeout = void 0 ), this.autoplay.running = !1, this.emit( "autoplayStop" ), !0 ) ) }, pause: function ( e ) { this.autoplay.running && ( this.autoplay.paused || ( this.autoplay.timeout && clearTimeout( this.autoplay.timeout ), this.autoplay.paused = !0, 0 !== e && this.params.autoplay.waitForTransition ? ( this.$wrapperEl[0].addEventListener( "transitionend", this.autoplay.onTransitionEnd ), this.$wrapperEl[0].addEventListener( "webkitTransitionEnd", this.autoplay.onTransitionEnd ) ) : ( this.autoplay.paused = !1, this.autoplay.run() ) ) ) } }, ve = { setTranslate: function () { for ( var e = this.slides, t = 0; t < e.length; t += 1 ) { var i = this.slides.eq( t ), s = -i[0].swiperSlideOffset; this.params.virtualTranslate || ( s -= this.translate ); var a = 0; this.isHorizontal() || ( a = s, s = 0 ); var r = this.params.fadeEffect.crossFade ? Math.max( 1 - Math.abs( i[0].progress ), 0 ) : 1 + Math.min( Math.max( i[0].progress, -1 ), 0 ); i.css( { opacity: r } ).transform( "translate3d(" + s + "px, " + a + "px, 0px)" ) } }, setTransition: function ( e ) { var t = this, i = t.slides, s = t.$wrapperEl; if ( i.transition( e ), t.params.virtualTranslate && 0 !== e ) { var a = !1; i.transitionEnd( ( function () { if ( !a && t && !t.destroyed ) { a = !0, t.animating = !1; for ( var e = ["webkitTransitionEnd", "transitionend"], i = 0; i < e.length; i += 1 )s.trigger( e[i] ) } } ) ) } } }, fe = { setTranslate: function () { var e, t = this.$el, i = this.$wrapperEl, a = this.slides, r = this.width, n = this.height, o = this.rtlTranslate, l = this.size, d = this.params.cubeEffect, h = this.isHorizontal(), p = this.virtual && this.params.virtual.enabled, c = 0; d.shadow && ( h ? ( 0 === ( e = i.find( ".swiper-cube-shadow" ) ).length && ( e = s( '<div class="swiper-cube-shadow"></div>' ), i.append( e ) ), e.css( { height: r + "px" } ) ) : 0 === ( e = t.find( ".swiper-cube-shadow" ) ).length && ( e = s( '<div class="swiper-cube-shadow"></div>' ), t.append( e ) ) ); for ( var u = 0; u < a.length; u += 1 ) { var v = a.eq( u ), f = u; p && ( f = parseInt( v.attr( "data-swiper-slide-index" ), 10 ) ); var m = 90 * f, g = Math.floor( m / 360 ); o && ( m = -m, g = Math.floor( -m / 360 ) ); var b = Math.max( Math.min( v[0].progress, 1 ), -1 ), w = 0, y = 0, x = 0; f % 4 == 0 ? ( w = 4 * -g * l, x = 0 ) : ( f - 1 ) % 4 == 0 ? ( w = 0, x = 4 * -g * l ) : ( f - 2 ) % 4 == 0 ? ( w = l + 4 * g * l, x = l ) : ( f - 3 ) % 4 == 0 && ( w = -l, x = 3 * l + 4 * l * g ), o && ( w = -w ), h || ( y = w, w = 0 ); var T = "rotateX(" + ( h ? 0 : -m ) + "deg) rotateY(" + ( h ? m : 0 ) + "deg) translate3d(" + w + "px, " + y + "px, " + x + "px)"; if ( b <= 1 && b > -1 && ( c = 90 * f + 90 * b, o && ( c = 90 * -f - 90 * b ) ), v.transform( T ), d.slideShadows ) { var E = h ? v.find( ".swiper-slide-shadow-left" ) : v.find( ".swiper-slide-shadow-top" ), S = h ? v.find( ".swiper-slide-shadow-right" ) : v.find( ".swiper-slide-shadow-bottom" ); 0 === E.length && ( E = s( '<div class="swiper-slide-shadow-' + ( h ? "left" : "top" ) + '"></div>' ), v.append( E ) ), 0 === S.length && ( S = s( '<div class="swiper-slide-shadow-' + ( h ? "right" : "bottom" ) + '"></div>' ), v.append( S ) ), E.length && ( E[0].style.opacity = Math.max( -b, 0 ) ), S.length && ( S[0].style.opacity = Math.max( b, 0 ) ) } } if ( i.css( { "-webkit-transform-origin": "50% 50% -" + l / 2 + "px", "-moz-transform-origin": "50% 50% -" + l / 2 + "px", "-ms-transform-origin": "50% 50% -" + l / 2 + "px", "transform-origin": "50% 50% -" + l / 2 + "px" } ), d.shadow ) if ( h ) e.transform( "translate3d(0px, " + ( r / 2 + d.shadowOffset ) + "px, " + -r / 2 + "px) rotateX(90deg) rotateZ(0deg) scale(" + d.shadowScale + ")" ); else { var C = Math.abs( c ) - 90 * Math.floor( Math.abs( c ) / 90 ), M = 1.5 - ( Math.sin( 2 * C * Math.PI / 360 ) / 2 + Math.cos( 2 * C * Math.PI / 360 ) / 2 ), P = d.shadowScale, z = d.shadowScale / M, k = d.shadowOffset; e.transform( "scale3d(" + P + ", 1, " + z + ") translate3d(0px, " + ( n / 2 + k ) + "px, " + -n / 2 / z + "px) rotateX(-90deg)" ) } var $ = j.isSafari || j.isUiWebView ? -l / 2 : 0; i.transform( "translate3d(0px,0," + $ + "px) rotateX(" + ( this.isHorizontal() ? 0 : c ) + "deg) rotateY(" + ( this.isHorizontal() ? -c : 0 ) + "deg)" ) }, setTransition: function ( e ) { var t = this.$el; this.slides.transition( e ).find( ".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left" ).transition( e ), this.params.cubeEffect.shadow && !this.isHorizontal() && t.find( ".swiper-cube-shadow" ).transition( e ) } }, me = { setTranslate: function () { for ( var e = this.slides, t = this.rtlTranslate, i = 0; i < e.length; i += 1 ) { var a = e.eq( i ), r = a[0].progress; this.params.flipEffect.limitRotation && ( r = Math.max( Math.min( a[0].progress, 1 ), -1 ) ); var n = -180 * r, o = 0, l = -a[0].swiperSlideOffset, d = 0; if ( this.isHorizontal() ? t && ( n = -n ) : ( d = l, l = 0, o = -n, n = 0 ), a[0].style.zIndex = -Math.abs( Math.round( r ) ) + e.length, this.params.flipEffect.slideShadows ) { var h = this.isHorizontal() ? a.find( ".swiper-slide-shadow-left" ) : a.find( ".swiper-slide-shadow-top" ), p = this.isHorizontal() ? a.find( ".swiper-slide-shadow-right" ) : a.find( ".swiper-slide-shadow-bottom" ); 0 === h.length && ( h = s( '<div class="swiper-slide-shadow-' + ( this.isHorizontal() ? "left" : "top" ) + '"></div>' ), a.append( h ) ), 0 === p.length && ( p = s( '<div class="swiper-slide-shadow-' + ( this.isHorizontal() ? "right" : "bottom" ) + '"></div>' ), a.append( p ) ), h.length && ( h[0].style.opacity = Math.max( -r, 0 ) ), p.length && ( p[0].style.opacity = Math.max( r, 0 ) ) } a.transform( "translate3d(" + l + "px, " + d + "px, 0px) rotateX(" + o + "deg) rotateY(" + n + "deg)" ) } }, setTransition: function ( e ) { var t = this, i = t.slides, s = t.activeIndex, a = t.$wrapperEl; if ( i.transition( e ).find( ".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left" ).transition( e ), t.params.virtualTranslate && 0 !== e ) { var r = !1; i.eq( s ).transitionEnd( ( function () { if ( !r && t && !t.destroyed ) { r = !0, t.animating = !1; for ( var e = ["webkitTransitionEnd", "transitionend"], i = 0; i < e.length; i += 1 )a.trigger( e[i] ) } } ) ) } } }, ge = { setTranslate: function () { for ( var e = this.width, t = this.height, i = this.slides, a = this.$wrapperEl, r = this.slidesSizesGrid, n = this.params.coverflowEffect, l = this.isHorizontal(), d = this.translate, h = l ? e / 2 - d : t / 2 - d, p = l ? n.rotate : -n.rotate, c = n.depth, u = 0, v = i.length; u < v; u += 1 ) { var f = i.eq( u ), m = r[u], g = ( h - f[0].swiperSlideOffset - m / 2 ) / m * n.modifier, b = l ? p * g : 0, w = l ? 0 : p * g, y = -c * Math.abs( g ), x = l ? 0 : n.stretch * g, T = l ? n.stretch * g : 0; Math.abs( T ) < .001 && ( T = 0 ), Math.abs( x ) < .001 && ( x = 0 ), Math.abs( y ) < .001 && ( y = 0 ), Math.abs( b ) < .001 && ( b = 0 ), Math.abs( w ) < .001 && ( w = 0 ); var E = "translate3d(" + T + "px," + x + "px," + y + "px)  rotateX(" + w + "deg) rotateY(" + b + "deg)"; if ( f.transform( E ), f[0].style.zIndex = 1 - Math.abs( Math.round( g ) ), n.slideShadows ) { var S = l ? f.find( ".swiper-slide-shadow-left" ) : f.find( ".swiper-slide-shadow-top" ), C = l ? f.find( ".swiper-slide-shadow-right" ) : f.find( ".swiper-slide-shadow-bottom" ); 0 === S.length && ( S = s( '<div class="swiper-slide-shadow-' + ( l ? "left" : "top" ) + '"></div>' ), f.append( S ) ), 0 === C.length && ( C = s( '<div class="swiper-slide-shadow-' + ( l ? "right" : "bottom" ) + '"></div>' ), f.append( C ) ), S.length && ( S[0].style.opacity = g > 0 ? g : 0 ), C.length && ( C[0].style.opacity = -g > 0 ? -g : 0 ) } } ( o.pointerEvents || o.prefixedPointerEvents ) && ( a[0].style.perspectiveOrigin = h + "px 50%" ) }, setTransition: function ( e ) { this.slides.transition( e ).find( ".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left" ).transition( e ) } }, be = { init: function () { var e = this.params.thumbs, t = this.constructor; e.swiper instanceof t ? ( this.thumbs.swiper = e.swiper, n.extend( this.thumbs.swiper.originalParams, { watchSlidesProgress: !0, slideToClickedSlide: !1 } ), n.extend( this.thumbs.swiper.params, { watchSlidesProgress: !0, slideToClickedSlide: !1 } ) ) : n.isObject( e.swiper ) && ( this.thumbs.swiper = new t( n.extend( {}, e.swiper, { watchSlidesVisibility: !0, watchSlidesProgress: !0, slideToClickedSlide: !1 } ) ), this.thumbs.swiperCreated = !0 ), this.thumbs.swiper.$el.addClass( this.params.thumbs.thumbsContainerClass ), this.thumbs.swiper.on( "tap", this.thumbs.onThumbClick ) }, onThumbClick: function () { var e = this.thumbs.swiper; if ( e ) { var t = e.clickedIndex, i = e.clickedSlide; if ( !( i && s( i ).hasClass( this.params.thumbs.slideThumbActiveClass ) || null == t ) ) { var a; if ( a = e.params.loop ? parseInt( s( e.clickedSlide ).attr( "data-swiper-slide-index" ), 10 ) : t, this.params.loop ) { var r = this.activeIndex; this.slides.eq( r ).hasClass( this.params.slideDuplicateClass ) && ( this.loopFix(), this._clientLeft = this.$wrapperEl[0].clientLeft, r = this.activeIndex ); var n = this.slides.eq( r ).prevAll( '[data-swiper-slide-index="' + a + '"]' ).eq( 0 ).index(), o = this.slides.eq( r ).nextAll( '[data-swiper-slide-index="' + a + '"]' ).eq( 0 ).index(); a = void 0 === n ? o : void 0 === o ? n : o - r < r - n ? o : n } this.slideTo( a ) } } }, update: function ( e ) { var t = this.thumbs.swiper; if ( t ) { var i = "auto" === t.params.slidesPerView ? t.slidesPerViewDynamic() : t.params.slidesPerView; if ( this.realIndex !== t.realIndex ) { var s, a = t.activeIndex; if ( t.params.loop ) { t.slides.eq( a ).hasClass( t.params.slideDuplicateClass ) && ( t.loopFix(), t._clientLeft = t.$wrapperEl[0].clientLeft, a = t.activeIndex ); var r = t.slides.eq( a ).prevAll( '[data-swiper-slide-index="' + this.realIndex + '"]' ).eq( 0 ).index(), n = t.slides.eq( a ).nextAll( '[data-swiper-slide-index="' + this.realIndex + '"]' ).eq( 0 ).index(); s = void 0 === r ? n : void 0 === n ? r : n - a == a - r ? a : n - a < a - r ? n : r } else s = this.realIndex; t.visibleSlidesIndexes && t.visibleSlidesIndexes.indexOf( s ) < 0 && ( t.params.centeredSlides ? s = s > a ? s - Math.floor( i / 2 ) + 1 : s + Math.floor( i / 2 ) - 1 : s > a && ( s = s - i + 1 ), t.slideTo( s, e ? 0 : void 0 ) ) } var o = 1, l = this.params.thumbs.slideThumbActiveClass; if ( this.params.slidesPerView > 1 && !this.params.centeredSlides && ( o = this.params.slidesPerView ), this.params.thumbs.multipleActiveThumbs || ( o = 1 ), o = Math.floor( o ), t.slides.removeClass( l ), t.params.loop || t.params.virtual && t.params.virtual.enabled ) for ( var d = 0; d < o; d += 1 )t.$wrapperEl.children( '[data-swiper-slide-index="' + ( this.realIndex + d ) + '"]' ).addClass( l ); else for ( var h = 0; h < o; h += 1 )t.slides.eq( this.realIndex + h ).addClass( l ) } } }, we = [R, q, K, U, Z, J, te, { name: "mousewheel", params: { mousewheel: { enabled: !1, releaseOnEdges: !1, invert: !1, forceToAxis: !1, sensitivity: 1, eventsTarged: "container" } }, create: function () { n.extend( this, { mousewheel: { enabled: !1, enable: ie.enable.bind( this ), disable: ie.disable.bind( this ), handle: ie.handle.bind( this ), handleMouseEnter: ie.handleMouseEnter.bind( this ), handleMouseLeave: ie.handleMouseLeave.bind( this ), animateSlider: ie.animateSlider.bind( this ), releaseScroll: ie.releaseScroll.bind( this ), lastScrollTime: n.now(), lastEventBeforeSnap: void 0, recentWheelEvents: [] } } ) }, on: { init: function () { !this.params.mousewheel.enabled && this.params.cssMode && this.mousewheel.disable(), this.params.mousewheel.enabled && this.mousewheel.enable() }, destroy: function () { this.params.cssMode && this.mousewheel.enable(), this.mousewheel.enabled && this.mousewheel.disable() } } }, { name: "navigation", params: { navigation: { nextEl: null, prevEl: null, hideOnClick: !1, disabledClass: "swiper-button-disabled", hiddenClass: "swiper-button-hidden", lockClass: "swiper-button-lock" } }, create: function () { n.extend( this, { navigation: { init: se.init.bind( this ), update: se.update.bind( this ), destroy: se.destroy.bind( this ), onNextClick: se.onNextClick.bind( this ), onPrevClick: se.onPrevClick.bind( this ) } } ) }, on: { init: function () { this.navigation.init(), this.navigation.update() }, toEdge: function () { this.navigation.update() }, fromEdge: function () { this.navigation.update() }, destroy: function () { this.navigation.destroy() }, click: function ( e ) { var t, i = this.navigation, a = i.$nextEl, r = i.$prevEl; !this.params.navigation.hideOnClick || s( e.target ).is( r ) || s( e.target ).is( a ) || ( a ? t = a.hasClass( this.params.navigation.hiddenClass ) : r && ( t = r.hasClass( this.params.navigation.hiddenClass ) ), !0 === t ? this.emit( "navigationShow", this ) : this.emit( "navigationHide", this ), a && a.toggleClass( this.params.navigation.hiddenClass ), r && r.toggleClass( this.params.navigation.hiddenClass ) ) } } }, { name: "pagination", params: { pagination: { el: null, bulletElement: "span", clickable: !1, hideOnClick: !1, renderBullet: null, renderProgressbar: null, renderFraction: null, renderCustom: null, progressbarOpposite: !1, type: "bullets", dynamicBullets: !1, dynamicMainBullets: 1, formatFractionCurrent: function ( e ) { return e }, formatFractionTotal: function ( e ) { return e }, bulletClass: "swiper-pagination-bullet", bulletActiveClass: "swiper-pagination-bullet-active", modifierClass: "swiper-pagination-", currentClass: "swiper-pagination-current", totalClass: "swiper-pagination-total", hiddenClass: "swiper-pagination-hidden", progressbarFillClass: "swiper-pagination-progressbar-fill", progressbarOppositeClass: "swiper-pagination-progressbar-opposite", clickableClass: "swiper-pagination-clickable", lockClass: "swiper-pagination-lock" } }, create: function () { n.extend( this, { pagination: { init: ae.init.bind( this ), render: ae.render.bind( this ), update: ae.update.bind( this ), destroy: ae.destroy.bind( this ), dynamicBulletIndex: 0 } } ) }, on: { init: function () { this.pagination.init(), this.pagination.render(), this.pagination.update() }, activeIndexChange: function () { this.params.loop ? this.pagination.update() : void 0 === this.snapIndex && this.pagination.update() }, snapIndexChange: function () { this.params.loop || this.pagination.update() }, slidesLengthChange: function () { this.params.loop && ( this.pagination.render(), this.pagination.update() ) }, snapGridLengthChange: function () { this.params.loop || ( this.pagination.render(), this.pagination.update() ) }, destroy: function () { this.pagination.destroy() }, click: function ( e ) { this.params.pagination.el && this.params.pagination.hideOnClick && this.pagination.$el.length > 0 && !s( e.target ).hasClass( this.params.pagination.bulletClass ) && ( !0 === this.pagination.$el.hasClass( this.params.pagination.hiddenClass ) ? this.emit( "paginationShow", this ) : this.emit( "paginationHide", this ), this.pagination.$el.toggleClass( this.params.pagination.hiddenClass ) ) } } }, { name: "scrollbar", params: { scrollbar: { el: null, dragSize: "auto", hide: !1, draggable: !1, snapOnRelease: !0, lockClass: "swiper-scrollbar-lock", dragClass: "swiper-scrollbar-drag" } }, create: function () { n.extend( this, { scrollbar: { init: re.init.bind( this ), destroy: re.destroy.bind( this ), updateSize: re.updateSize.bind( this ), setTranslate: re.setTranslate.bind( this ), setTransition: re.setTransition.bind( this ), enableDraggable: re.enableDraggable.bind( this ), disableDraggable: re.disableDraggable.bind( this ), setDragPosition: re.setDragPosition.bind( this ), getPointerPosition: re.getPointerPosition.bind( this ), onDragStart: re.onDragStart.bind( this ), onDragMove: re.onDragMove.bind( this ), onDragEnd: re.onDragEnd.bind( this ), isTouched: !1, timeout: null, dragTimeout: null } } ) }, on: { init: function () { this.scrollbar.init(), this.scrollbar.updateSize(), this.scrollbar.setTranslate() }, update: function () { this.scrollbar.updateSize() }, resize: function () { this.scrollbar.updateSize() }, observerUpdate: function () { this.scrollbar.updateSize() }, setTranslate: function () { this.scrollbar.setTranslate() }, setTransition: function ( e ) { this.scrollbar.setTransition( e ) }, destroy: function () { this.scrollbar.destroy() } } }, { name: "parallax", params: { parallax: { enabled: !1 } }, create: function () { n.extend( this, { parallax: { setTransform: ne.setTransform.bind( this ), setTranslate: ne.setTranslate.bind( this ), setTransition: ne.setTransition.bind( this ) } } ) }, on: { beforeInit: function () { this.params.parallax.enabled && ( this.params.watchSlidesProgress = !0, this.originalParams.watchSlidesProgress = !0 ) }, init: function () { this.params.parallax.enabled && this.parallax.setTranslate() }, setTranslate: function () { this.params.parallax.enabled && this.parallax.setTranslate() }, setTransition: function ( e ) { this.params.parallax.enabled && this.parallax.setTransition( e ) } } }, { name: "zoom", params: { zoom: { enabled: !1, maxRatio: 3, minRatio: 1, toggle: !0, containerClass: "swiper-zoom-container", zoomedSlideClass: "swiper-slide-zoomed" } }, create: function () { var e = this, t = { enabled: !1, scale: 1, currentScale: 1, isScaling: !1, gesture: { $slideEl: void 0, slideWidth: void 0, slideHeight: void 0, $imageEl: void 0, $imageWrapEl: void 0, maxRatio: 3 }, image: { isTouched: void 0, isMoved: void 0, currentX: void 0, currentY: void 0, minX: void 0, minY: void 0, maxX: void 0, maxY: void 0, width: void 0, height: void 0, startX: void 0, startY: void 0, touchesStart: {}, touchesCurrent: {} }, velocity: { x: void 0, y: void 0, prevPositionX: void 0, prevPositionY: void 0, prevTime: void 0 } }; "onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out".split( " " ).forEach( ( function ( i ) { t[i] = oe[i].bind( e ) } ) ), n.extend( e, { zoom: t } ); var i = 1; Object.defineProperty( e.zoom, "scale", { get: function () { return i }, set: function ( t ) { if ( i !== t ) { var s = e.zoom.gesture.$imageEl ? e.zoom.gesture.$imageEl[0] : void 0, a = e.zoom.gesture.$slideEl ? e.zoom.gesture.$slideEl[0] : void 0; e.emit( "zoomChange", t, s, a ) } i = t } } ) }, on: { init: function () { this.params.zoom.enabled && this.zoom.enable() }, destroy: function () { this.zoom.disable() }, touchStart: function ( e ) { this.zoom.enabled && this.zoom.onTouchStart( e ) }, touchEnd: function ( e ) { this.zoom.enabled && this.zoom.onTouchEnd( e ) }, doubleTap: function ( e ) { this.params.zoom.enabled && this.zoom.enabled && this.params.zoom.toggle && this.zoom.toggle( e ) }, transitionEnd: function () { this.zoom.enabled && this.params.zoom.enabled && this.zoom.onTransitionEnd() }, slideChange: function () { this.zoom.enabled && this.params.zoom.enabled && this.params.cssMode && this.zoom.onTransitionEnd() } } }, { name: "lazy", params: { lazy: { enabled: !1, loadPrevNext: !1, loadPrevNextAmount: 1, loadOnTransitionStart: !1, elementClass: "swiper-lazy", loadingClass: "swiper-lazy-loading", loadedClass: "swiper-lazy-loaded", preloaderClass: "swiper-lazy-preloader" } }, create: function () { n.extend( this, { lazy: { initialImageLoaded: !1, load: le.load.bind( this ), loadInSlide: le.loadInSlide.bind( this ) } } ) }, on: { beforeInit: function () { this.params.lazy.enabled && this.params.preloadImages && ( this.params.preloadImages = !1 ) }, init: function () { this.params.lazy.enabled && !this.params.loop && 0 === this.params.initialSlide && this.lazy.load() }, scroll: function () { this.params.freeMode && !this.params.freeModeSticky && this.lazy.load() }, resize: function () { this.params.lazy.enabled && this.lazy.load() }, scrollbarDragMove: function () { this.params.lazy.enabled && this.lazy.load() }, transitionStart: function () { this.params.lazy.enabled && ( this.params.lazy.loadOnTransitionStart || !this.params.lazy.loadOnTransitionStart && !this.lazy.initialImageLoaded ) && this.lazy.load() }, transitionEnd: function () { this.params.lazy.enabled && !this.params.lazy.loadOnTransitionStart && this.lazy.load() }, slideChange: function () { this.params.lazy.enabled && this.params.cssMode && this.lazy.load() } } }, { name: "controller", params: { controller: { control: void 0, inverse: !1, by: "slide" } }, create: function () { n.extend( this, { controller: { control: this.params.controller.control, getInterpolateFunction: de.getInterpolateFunction.bind( this ), setTranslate: de.setTranslate.bind( this ), setTransition: de.setTransition.bind( this ) } } ) }, on: { update: function () { this.controller.control && this.controller.spline && ( this.controller.spline = void 0, delete this.controller.spline ) }, resize: function () { this.controller.control && this.controller.spline && ( this.controller.spline = void 0, delete this.controller.spline ) }, observerUpdate: function () { this.controller.control && this.controller.spline && ( this.controller.spline = void 0, delete this.controller.spline ) }, setTranslate: function ( e, t ) { this.controller.control && this.controller.setTranslate( e, t ) }, setTransition: function ( e, t ) { this.controller.control && this.controller.setTransition( e, t ) } } }, { name: "a11y", params: { a11y: { enabled: !0, notificationClass: "swiper-notification", prevSlideMessage: "Previous slide", nextSlideMessage: "Next slide", firstSlideMessage: "This is the first slide", lastSlideMessage: "This is the last slide", paginationBulletMessage: "Go to slide {{index}}" } }, create: function () { var e = this; n.extend( e, { a11y: { liveRegion: s( '<span class="' + e.params.a11y.notificationClass + '" aria-live="assertive" aria-atomic="true"></span>' ) } } ), Object.keys( he ).forEach( ( function ( t ) { e.a11y[t] = he[t].bind( e ) } ) ) }, on: { init: function () { this.params.a11y.enabled && ( this.a11y.init(), this.a11y.updateNavigation() ) }, toEdge: function () { this.params.a11y.enabled && this.a11y.updateNavigation() }, fromEdge: function () { this.params.a11y.enabled && this.a11y.updateNavigation() }, paginationUpdate: function () { this.params.a11y.enabled && this.a11y.updatePagination() }, destroy: function () { this.params.a11y.enabled && this.a11y.destroy() } } }, { name: "history", params: { history: { enabled: !1, replaceState: !1, key: "slides" } }, create: function () { n.extend( this, { history: { init: pe.init.bind( this ), setHistory: pe.setHistory.bind( this ), setHistoryPopState: pe.setHistoryPopState.bind( this ), scrollToSlide: pe.scrollToSlide.bind( this ), destroy: pe.destroy.bind( this ) } } ) }, on: { init: function () { this.params.history.enabled && this.history.init() }, destroy: function () { this.params.history.enabled && this.history.destroy() }, transitionEnd: function () { this.history.initialized && this.history.setHistory( this.params.history.key, this.activeIndex ) }, slideChange: function () { this.history.initialized && this.params.cssMode && this.history.setHistory( this.params.history.key, this.activeIndex ) } } }, { name: "hash-navigation", params: { hashNavigation: { enabled: !1, replaceState: !1, watchState: !1 } }, create: function () { n.extend( this, { hashNavigation: { initialized: !1, init: ce.init.bind( this ), destroy: ce.destroy.bind( this ), setHash: ce.setHash.bind( this ), onHashCange: ce.onHashCange.bind( this ) } } ) }, on: { init: function () { this.params.hashNavigation.enabled && this.hashNavigation.init() }, destroy: function () { this.params.hashNavigation.enabled && this.hashNavigation.destroy() }, transitionEnd: function () { this.hashNavigation.initialized && this.hashNavigation.setHash() }, slideChange: function () { this.hashNavigation.initialized && this.params.cssMode && this.hashNavigation.setHash() } } }, { name: "autoplay", params: { autoplay: { enabled: !1, delay: 3e3, waitForTransition: !0, disableOnInteraction: !0, stopOnLastSlide: !1, reverseDirection: !1 } }, create: function () { var e = this; n.extend( e, { autoplay: { running: !1, paused: !1, run: ue.run.bind( e ), start: ue.start.bind( e ), stop: ue.stop.bind( e ), pause: ue.pause.bind( e ), onVisibilityChange: function () { "hidden" === document.visibilityState && e.autoplay.running && e.autoplay.pause(), "visible" === document.visibilityState && e.autoplay.paused && ( e.autoplay.run(), e.autoplay.paused = !1 ) }, onTransitionEnd: function ( t ) { e && !e.destroyed && e.$wrapperEl && t.target === this && ( e.$wrapperEl[0].removeEventListener( "transitionend", e.autoplay.onTransitionEnd ), e.$wrapperEl[0].removeEventListener( "webkitTransitionEnd", e.autoplay.onTransitionEnd ), e.autoplay.paused = !1, e.autoplay.running ? e.autoplay.run() : e.autoplay.stop() ) } } } ) }, on: { init: function () { this.params.autoplay.enabled && ( this.autoplay.start(), document.addEventListener( "visibilitychange", this.autoplay.onVisibilityChange ) ) }, beforeTransitionStart: function ( e, t ) { this.autoplay.running && ( t || !this.params.autoplay.disableOnInteraction ? this.autoplay.pause( e ) : this.autoplay.stop() ) }, sliderFirstMove: function () { this.autoplay.running && ( this.params.autoplay.disableOnInteraction ? this.autoplay.stop() : this.autoplay.pause() ) }, touchEnd: function () { this.params.cssMode && this.autoplay.paused && !this.params.autoplay.disableOnInteraction && this.autoplay.run() }, destroy: function () { this.autoplay.running && this.autoplay.stop(), document.removeEventListener( "visibilitychange", this.autoplay.onVisibilityChange ) } } }, { name: "effect-fade", params: { fadeEffect: { crossFade: !1 } }, create: function () { n.extend( this, { fadeEffect: { setTranslate: ve.setTranslate.bind( this ), setTransition: ve.setTransition.bind( this ) } } ) }, on: { beforeInit: function () { if ( "fade" === this.params.effect ) { this.classNames.push( this.params.containerModifierClass + "fade" ); var e = { slidesPerView: 1, slidesPerColumn: 1, slidesPerGroup: 1, watchSlidesProgress: !0, spaceBetween: 0, virtualTranslate: !0 }; n.extend( this.params, e ), n.extend( this.originalParams, e ) } }, setTranslate: function () { "fade" === this.params.effect && this.fadeEffect.setTranslate() }, setTransition: function ( e ) { "fade" === this.params.effect && this.fadeEffect.setTransition( e ) } } }, { name: "effect-cube", params: { cubeEffect: { slideShadows: !0, shadow: !0, shadowOffset: 20, shadowScale: .94 } }, create: function () { n.extend( this, { cubeEffect: { setTranslate: fe.setTranslate.bind( this ), setTransition: fe.setTransition.bind( this ) } } ) }, on: { beforeInit: function () { if ( "cube" === this.params.effect ) { this.classNames.push( this.params.containerModifierClass + "cube" ), this.classNames.push( this.params.containerModifierClass + "3d" ); var e = { slidesPerView: 1, slidesPerColumn: 1, slidesPerGroup: 1, watchSlidesProgress: !0, resistanceRatio: 0, spaceBetween: 0, centeredSlides: !1, virtualTranslate: !0 }; n.extend( this.params, e ), n.extend( this.originalParams, e ) } }, setTranslate: function () { "cube" === this.params.effect && this.cubeEffect.setTranslate() }, setTransition: function ( e ) { "cube" === this.params.effect && this.cubeEffect.setTransition( e ) } } }, { name: "effect-flip", params: { flipEffect: { slideShadows: !0, limitRotation: !0 } }, create: function () { n.extend( this, { flipEffect: { setTranslate: me.setTranslate.bind( this ), setTransition: me.setTransition.bind( this ) } } ) }, on: { beforeInit: function () { if ( "flip" === this.params.effect ) { this.classNames.push( this.params.containerModifierClass + "flip" ), this.classNames.push( this.params.containerModifierClass + "3d" ); var e = { slidesPerView: 1, slidesPerColumn: 1, slidesPerGroup: 1, watchSlidesProgress: !0, spaceBetween: 0, virtualTranslate: !0 }; n.extend( this.params, e ), n.extend( this.originalParams, e ) } }, setTranslate: function () { "flip" === this.params.effect && this.flipEffect.setTranslate() }, setTransition: function ( e ) { "flip" === this.params.effect && this.flipEffect.setTransition( e ) } } }, { name: "effect-coverflow", params: { coverflowEffect: { rotate: 50, stretch: 0, depth: 100, modifier: 1, slideShadows: !0 } }, create: function () { n.extend( this, { coverflowEffect: { setTranslate: ge.setTranslate.bind( this ), setTransition: ge.setTransition.bind( this ) } } ) }, on: { beforeInit: function () { "coverflow" === this.params.effect && ( this.classNames.push( this.params.containerModifierClass + "coverflow" ), this.classNames.push( this.params.containerModifierClass + "3d" ), this.params.watchSlidesProgress = !0, this.originalParams.watchSlidesProgress = !0 ) }, setTranslate: function () { "coverflow" === this.params.effect && this.coverflowEffect.setTranslate() }, setTransition: function ( e ) { "coverflow" === this.params.effect && this.coverflowEffect.setTransition( e ) } } }, { name: "thumbs", params: { thumbs: { multipleActiveThumbs: !0, swiper: null, slideThumbActiveClass: "swiper-slide-thumb-active", thumbsContainerClass: "swiper-container-thumbs" } }, create: function () { n.extend( this, { thumbs: { swiper: null, init: be.init.bind( this ), update: be.update.bind( this ), onThumbClick: be.onThumbClick.bind( this ) } } ) }, on: { beforeInit: function () { var e = this.params.thumbs; e && e.swiper && ( this.thumbs.init(), this.thumbs.update( !0 ) ) }, slideChange: function () { this.thumbs.swiper && this.thumbs.update() }, update: function () { this.thumbs.swiper && this.thumbs.update() }, resize: function () { this.thumbs.swiper && this.thumbs.update() }, observerUpdate: function () { this.thumbs.swiper && this.thumbs.update() }, setTransition: function ( e ) { var t = this.thumbs.swiper; t && t.setTransition( e ) }, beforeDestroy: function () { var e = this.thumbs.swiper; e && this.thumbs.swiperCreated && e && e.destroy() } } }]; return void 0 === W.use && ( W.use = W.Class.use, W.installModule = W.Class.installModule ), W.use( we ), W } ) );
//# sourceMappingURL=swiper.min.js.map;
define('SliderPanel',[
    'jquery',
    'slick',
    'Swiper',
    'ANSI/Utility/Dimensions',
    'eventManager',
    'ANSI/Utility/SitecoreUtils',
    'matchHeight',
    'promise-polyfill',
], function ($, slick, Swiper, dimensions, eventManager, sitecoreUtils) {
    'use strict';
    var sliderPanel = {
        init: function () {
            sliderPanel.overviewSlider();
            sliderPanel.basicCardSlider();
            sliderPanel.customEventSlider();
            eventManager.subscribe('ModulesLoadedEvent', function () {
                sliderPanel.stepSlider();
                sliderPanel.mobileSlider();
                sliderPanel.tabSliderHome();
            });
        },
        tabSliderHome: function () {
            if ($('.slider-panel').length) {
                var sliderPanelHome = $(
                    '.slider-panel .score-right .slider-panel'
                );

                var settingsHome = {
                    draggable: true,
                    infinite: false,
                    slidesToShow: 1,
                    slidesToScroll: 1,
                    accessibility: true,
                    centerMode: true,
                    arrows: true,
                    variableWidth: true,
                    touchThreshold: 10,
                    mobileFirst: true,
                    responsive: [
                        {
                            breakpoint: 960,
                            settings: {
                                slidesToShow: 2,
                                arrows: true,
                                mobileFirst: true,
                                centerMode: false,
                            },
                        },
                        {
                            breakpoint: 1260,
                            settings: {
                                slidesToShow: 2,
                                arrows: true,
                                mobileFirst: true,
                                centerMode: false,
                            },
                        },
                        {
                            breakpoint: 1430,
                            settings: {
                                slidesToShow: 3,
                                arrows: true,
                                mobileFirst: true,
                                centerMode: false,
                            },
                        },
                        {
                            breakpoint: 1920,
                            settings: {
                                slidesToShow: 3,
                                arrows: true,
                                mobileFirst: true,
                                centerMode: false,
                            },
                        },
                        {
                            breakpoint: 2448,
                            settings: {
                                slidesToShow: 3,
                                mobileFirst: true,
                                centerMode: false,
                            },
                        },
                        {
                            breakpoint: 2972,
                            settings: {
                                slidesToShow: 3,
                                mobileFirst: true,
                                centerMode: false,
                            },
                        },
                        {
                            breakpoint: 3496,
                            settings: {
                                slidesToShow: 3,
                                mobileFirst: true,
                                centerMode: false,
                            },
                        },
                    ],
                };

                sliderPanelHome.slick(settingsHome);
            }
        },
        overviewSlider: function () {
            if (
                $('.swiper-container.ansi-image-card-slider').length &&
                dimensions.width < 960
            ) {
                $('.ansi-image-card-slider .swiper-slide').matchHeight({
                    byRow: false,
                });
                $('.swiper-container.ansi-image-card-slider').append(
                    '<div class="swiper-pagination"></div>'
                );
                var swiper = new Swiper(
                    '.swiper-container.ansi-image-card-slider',
                    {
                        direction: 'horizontal',
                        centeredSlides: true,
                        slidesPerView: 'auto',
                        spaceBetween: 16,
                        pagination: {
                            el: '.swiper-pagination',
                            clickable: true,
                        },
                    }
                );
            }
        },
        customEventSlider: function () {
            //this is for image grid on the bottom of the custom events page
            var eventSlider = $('.custom-event .grid-5');
            if (dimensions.width < 600) {
                var customEventSliderSettings = {
                    draggable: true,
                    infinite: false,
                    slidesToShow: 1,
                    slidesToScroll: 1,
                    accessibility: true,
                    centerMode: true,
                    arrows: true,
                    variableWidth: true,
                    touchThreshold: 10,
                };
                eventSlider.slick(customEventSliderSettings);
            }
        },
        stepSlider: function () {
            if ($('.ansi-step-slider.swiper-container').length) {
                $('.ansi-step-slider .swiper-slide').matchHeight({
                    byRow: false,
                });
                $('.ansi-step-slider.swiper-container')
                    .append('<div class="swiper-pagination"></div>')
                    .append('<div class="swiper-button-next"></div>')
                    .append('<div class="swiper-button-prev"></div>');
                var swiper = new Swiper('.ansi-step-slider.swiper-container', {
                    pagination: {
                        el: '.swiper-pagination',
                        type: 'fraction',
                    },
                    navigation: {
                        nextEl: '.swiper-button-next',
                        prevEl: '.swiper-button-prev',
                    },
                });

                $(document).on(
                    'shown.bs.tab',
                    'a[data-toggle="tab"]',
                    function (e) {
                        var paneTarget = $(e.target).attr('href');
                        var $thePane = $('.tab-pane' + paneTarget);
                        var paneIndex = $thePane.index();
                        if (
                            $thePane.find('.swiper-container').length > 0 &&
                            0 === $thePane.find('.swiper-slide-active').length
                        ) {
                            swiper[paneIndex].update();
                        }
                    }
                );
            }
        },
        mobileSlider: function () {
            if ($('.mobile-slider').length && dimensions.width < 992) {
                var mobileSlide = $('.mobile-slider');
                var sliderSettings = {
                    draggable: true,
                    infinite: false,
                    slidesToShow: 1,
                    slidesToScroll: 1,
                    accessibility: true,
                    centerMode: true,
                    arrows: true,
                    variableWidth: true,
                    touchThreshold: 10,
                    mobileFirst: true,
                    responsive: [
                        {
                            breakpoint: 575,
                            settings: { slidesToShow: 2 },
                        },
                    ],
                };
                mobileSlide.slick(sliderSettings);
            }
        },
        basicCardSlider: function () {
            if (
                $('.swiper-container.ansi-basic-card-slider').length &&
                dimensions.width < 992
            ) {
                $('.swiper-container.ansi-basic-card-slider')
                    .append('<div class="swiper-button-next"></div>')
                    .append('<div class="swiper-button-prev"></div>');
                var swiper = new Swiper(
                    '.swiper-container.ansi-basic-card-slider',
                    {
                        centeredSlides: true,
                        slidesPerView: 'auto',
                        spaceBetween: 16,
                        freeMode: true,
                        navigation: {
                            nextEl: '.swiper-button-next',
                            prevEl: '.swiper-button-prev',
                        },
                    }
                );
            }
        },
    };
    if (!sitecoreUtils.prototype.isEditing())
        Promise.resolve().then(sliderPanel.init);
});

define( 'VerticalSlider',[ 'jquery', 'Swiper', 'ANSI/Utility/Dimensions', 'ANSI/Utility/SitecoreUtils', 'promise-polyfill', 'matchHeight' ], function ( $, Swiper, dimensions, sitecoreUtils ) {
    'use strict';
    var verticalSlider = {
        init: function () {
            if ( $( '.ansi-vertical-carousel' ).length ) {
                $( '.ansi-vertical-carousel .offset-container.swiper-slide' ).matchHeight( { byRow: false } );
                verticalSlider.resizeSwiper();
                verticalSlider.animate();
            }
        },
        resizeSwiper: function () {
            $( '.swiper-container' ).height( $( '.offset-container.swiper-slide' ).height() );
        },
        animate: function () {
            var swiper = new Swiper( '.swiper-container.ansi-vertical-carousel', {
                direction: 'horizontal',
                freeMode: true,
                freeModeSticky: true,
                slidesPerView: 1,
                autoplay: {
                    delay: 7000,
                    disableOnInteraction: true,
                },
                spaceBetween: 0,
                pagination: {
                    el: '.swiper-pagination',

                    clickable: true
                },
                breakpoints: {
                    992: {

                        direction: 'vertical',
                        spaceBetween: 32
                    }
                }
            } );
        }
    };

    if ( !sitecoreUtils.prototype.isEditing() ) Promise.resolve().then( verticalSlider.init );
} );
define('StickyNav',['jquery', 'ANSI/Utility/Dimensions', 'ANSI/Utility/SitecoreUtils', 'promise-polyfill'], function ($, dimensions, sitecoreUtils) {
    'use strict';
    var stickyNav = {
        init: function () {
            if ($('.ansi-sticky-navbar').length) {
                stickyNav.scroll();
                stickyNav.steps();
                if (dimensions.width < 992) {
                    stickyNav.mobileDropdown();
                }
            }
        },
        sticky: function () {
            var navbar = document.getElementsByClassName('ansi-sticky-navbar')[0];
            var header = document.getElementsByClassName('ansi-header')[0];
            var navOffset = navbar.offsetTop;

            if (window.pageYOffset >= navOffset - 57) {
                navbar.classList.add('sticky');
                header.classList.add('pull-up');
            } else {
                navbar.classList.remove('sticky');
                header.classList.remove('pull-up');
            }
        },
        scroll: function () {
            var timeout;

            window.addEventListener(
                'scroll',
                function (event) {
                    if (timeout) {
                        window.cancelAnimationFrame(timeout);
                    }

                    timeout = window.requestAnimationFrame(function () {
                        stickyNav.sticky();
                    });
                },
                false
            );
        },
        mobileDropdown: function () {
            $('.ansi-sticky-navbar .dropdown-menu li a:not(.ansi-sticky-navbar .dropdown-menu li.sticky-nav-modal-btn a, .ansi-sticky-navbar .score-megamenu .dropdown-menu li a)').on(
                'click',
                function (e) {
                    e.preventDefault();
                    var selText = $(this).text();
                    $(this)
                        .parents('.score-button-menu')
                        .find('.btn')
                        .html(selText + '<span class="caret"></span><span class="sr-only">Toggle</span>');
                }
            );
        },
        steps: function () {
            if ($('.score-megamenu').length) {
                var text = $('.ansi-sticky-navbar .dropdown-menu').find('.active > a').text();
                var newText = text.trim().slice(0, 6);
                var menuText = $('.ansi-sticky-navbar .active-section > a:first-child');
                menuText.text(newText);
            }
        }
    };
    if (!sitecoreUtils.prototype.isEditing()) Promise.resolve().then(stickyNav.init);
});

/*!
 * GSAP 3.9.0
 * https://greensock.com
 * 
 * @license Copyright 2021, GreenSock. All rights reserved.
 * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
 */

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define('gsap',["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t){return"string"==typeof t}function p(t){return"function"==typeof t}function q(t){return"number"==typeof t}function r(t){return void 0===t}function s(t){return"object"==typeof t}function t(t){return!1!==t}function u(){return"undefined"!=typeof window}function v(t){return p(t)||o(t)}function M(t){return(h=mt(t,ot))&&oe}function N(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function O(t,e){return!e&&console.warn(t)}function P(t,e){return t&&(ot[t]=e)&&h&&(h[t]=e)||ot}function Q(){return 0}function $(t){var e,r,i=t[0];if(s(i)||p(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=ct.length;r--&&!ct[r].targetTest(i););e=ct[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Lt(t[r],e)))||t.splice(r,1);return t}function _(t){return t._gsap||$(xt(t))[0]._gsap}function aa(t,e,i){return(i=t[e])&&p(i)?t[e]():r(i)&&t.getAttribute&&t.getAttribute(e)||i}function ba(t,e){return(t=t.split(",")).forEach(e)||t}function ca(t){return Math.round(1e5*t)/1e5||0}function da(t){return Math.round(1e7*t)/1e7||0}function ea(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r}function fa(){var t,e,r=ht.length,i=ht.slice(0);for(lt={},t=ht.length=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)}function ga(t,e,r,i){ht.length&&fa(),t.render(e,r,i),ht.length&&fa()}function ha(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(at).length<2?e:o(t)?t.trim():t}function ia(t){return t}function ja(t,e){for(var r in e)r in t||(t[r]=e[r]);return t}function ma(t,e){for(var r in e)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=s(e[r])?ma(t[r]||(t[r]={}),e[r]):e[r]);return t}function na(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i}function oa(e){var r=e.parent||I,i=e.keyframes?function _setKeyframeDefaults(i){return function(t,e){for(var r in e)r in t||"duration"===r&&i||"ease"===r||(t[r]=e[r])}}(W(e.keyframes)):ja;if(t(e.inherit))for(;r;)i(e,r.vars.defaults),r=r.parent||r._dp;return e}function ra(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,a=e._next;n?n._next=a:t[r]===e&&(t[r]=a),a?a._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null}function sa(t,e){!t.parent||e&&!t.parent.autoRemoveChildren||t.parent.remove(t),t._act=0}function ta(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function wa(t){return t._repeat?gt(t._tTime,t=t.duration()+t._rDelay)*t:0}function ya(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function za(t){return t._end=da(t._start+(t._tDur/Math.abs(t._ts||t._rts||X)||0))}function Aa(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=da(r._time-(0<t._ts?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),za(t),r._dirty||ta(r,t)),t}function Ba(t,e){var r;if((e._time||e._initted&&!e._dur)&&(r=ya(t.rawTime(),e),(!e._dur||Tt(0,e.totalDuration(),r)-e._tTime>X)&&e.render(r,!0)),ta(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)0<=r.rawTime()&&r.totalTime(r._tTime),r=r._dp;t._zTime=-X}}function Ca(t,e,r,i){return e.parent&&sa(e),e._start=da((q(r)?r:r||t!==I?bt(t,r,e):t._time)+e._delay),e._end=da(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),function _addLinkedListItem(t,e,r,i,n){void 0===r&&(r="_first"),void 0===i&&(i="_last");var a,s=t[i];if(n)for(a=e[n];s&&s[n]>a;)s=s._prev;s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t}(t,e,"_first","_last",t._sort?"_start":0),vt(e)||(t._recent=e),i||Ba(t,e),t}function Da(t,e){return(ot.ScrollTrigger||N("scrollTrigger",e))&&ot.ScrollTrigger.create(e,t)}function Ea(t,e,r,i){return jt(t,e),t._initted?!r&&t._pt&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==St.frame?(ht.push(t),t._lazy=[e,i],1):void 0:1}function Ja(t,e,r,i){var n=t._repeat,a=da(e)||0,s=t._tTime/t._tDur;return s&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:da(a*(n+1)+t._rDelay*n):a,0<s&&!i?Aa(t,t._tTime=t._tDur*s):t.parent&&za(t),r||ta(t.parent,t),t}function Ka(t){return t instanceof Nt?ta(t):Ja(t,t._dur)}function Na(e,r,i){var n,a,s=q(r[1]),o=(s?2:1)+(e<2?0:1),u=r[o];if(s&&(u.duration=r[1]),u.parent=i,e){for(n=u,a=i;a&&!("immediateRender"in n);)n=a.vars.defaults||{},a=t(a.vars.inherit)&&a.parent;u.immediateRender=t(n.immediateRender),e<2?u.runBackwards=1:u.startAt=r[o-1]}return new Jt(r[0],u,r[1+o])}function Oa(t,e){return t||0===t?e(t):e}function Qa(t,e){return o(t)&&(e=st.exec(t))?t.substr(e.index+e[0].length):""}function Ta(t,e){return t&&s(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&s(t[0]))&&!t.nodeType&&t!==i}function Xa(t){return t.sort(function(){return.5-Math.random()})}function Ya(t){if(p(t))return t;var c=s(t)?t:{each:t},_=Rt(c.ease),m=c.from||0,g=parseFloat(c.base)||0,v={},e=0<m&&m<1,y=isNaN(m)||e,b=c.axis,T=m,w=m;return o(m)?T=w={center:.5,edges:.5,end:1}[m]||0:!e&&y&&(T=m[0],w=m[1]),function(t,e,r){var i,n,a,s,o,u,h,l,f,d=(r||c).length,p=v[d];if(!p){if(!(f="auto"===c.grid?0:(c.grid||[1,j])[1])){for(h=-j;h<(h=r[f++].getBoundingClientRect().left)&&f<d;);f--}for(p=v[d]=[],i=y?Math.min(f,d)*T-.5:m%f,n=f===j?0:y?d*w/f-.5:m/f|0,l=j,u=h=0;u<d;u++)a=u%f-i,s=n-(u/f|0),p[u]=o=b?Math.abs("y"===b?s:a):G(a*a+s*s),h<o&&(h=o),o<l&&(l=o);"random"===m&&Xa(p),p.max=h-l,p.min=l,p.v=d=(parseFloat(c.amount)||parseFloat(c.each)*(d<f?d-1:b?"y"===b?d/f:f:Math.max(f,d/f))||0)*("edges"===m?-1:1),p.b=d<0?g-d:g,p.u=Qa(c.amount||c.each)||0,_=_&&d<0?Bt(_):_}return d=(p[t]-p.min)/p.max||0,da(p.b+(_?_(d):d)*p.v)+p.u}}function Za(r){var i=Math.pow(10,((r+"").split(".")[1]||"").length);return function(t){var e=Math.round(parseFloat(t)/r)*r*i;return(e-e%1)/i+(q(t)?0:Qa(t))}}function $a(u,t){var h,l,e=W(u);return!e&&s(u)&&(h=e=u.radius||j,u.values?(u=xt(u.values),(l=!q(u[0]))&&(h*=h)):u=Za(u.increment)),Oa(t,e?p(u)?function(t){return l=u(t),Math.abs(l-t)<=h?l:t}:function(t){for(var e,r,i=parseFloat(l?t.x:t),n=parseFloat(l?t.y:0),a=j,s=0,o=u.length;o--;)(e=l?(e=u[o].x-i)*e+(r=u[o].y-n)*r:Math.abs(u[o]-i))<a&&(a=e,s=o);return s=!h||a<=h?u[s]:t,l||s===t||q(t)?s:s+Qa(t)}:Za(u))}function _a(t,e,r,i){return Oa(W(t)?!e:!0===r?!!(r=0):!i,function(){return W(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*i)/i})}function db(e,r,t){return Oa(t,function(t){return e[~~r(t)]})}function gb(t){for(var e,r,i,n,a=0,s="";~(e=t.indexOf("random(",a));)i=t.indexOf(")",e),n="["===t.charAt(e+7),r=t.substr(e+7,i-e-7).match(n?at:tt),s+=t.substr(a,e-a)+_a(n?r:+r[0],n?0:+r[1],+r[2]||1e-5),a=i+1;return s+t.substr(a,t.length-a)}function jb(t,e,r){var i,n,a,s=t.labels,o=j;for(i in s)(n=s[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(a=i,o=n);return a}function lb(t){return sa(t),t.scrollTrigger&&t.scrollTrigger.kill(!1),t.progress()<1&&Mt(t,"onInterrupt"),t}function qb(t,e,r){return(6*(t+=t<0?1:1<t?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*kt+.5|0}function rb(t,e,r){var i,n,a,s,o,u,h,l,f,d,p=t?q(t)?[t>>16,t>>8&kt,t&kt]:0:Ct.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),Ct[t])p=Ct[t];else if("#"===t.charAt(0)){if(t.length<6&&(t="#"+(i=t.charAt(1))+i+(n=t.charAt(2))+n+(a=t.charAt(3))+a+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&kt,p&kt,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&kt,t&kt]}else if("hsl"===t.substr(0,3))if(p=d=t.match(tt),e){if(~t.indexOf("="))return p=t.match(et),r&&p.length<4&&(p[3]=1),p}else s=+p[0]%360/360,o=p[1]/100,i=2*(u=p[2]/100)-(n=u<=.5?u*(o+1):u+o-u*o),3<p.length&&(p[3]*=1),p[0]=qb(s+1/3,i,n),p[1]=qb(s,i,n),p[2]=qb(s-1/3,i,n);else p=t.match(tt)||Ct.transparent;p=p.map(Number)}return e&&!d&&(i=p[0]/kt,n=p[1]/kt,a=p[2]/kt,u=((h=Math.max(i,n,a))+(l=Math.min(i,n,a)))/2,h===l?s=o=0:(f=h-l,o=.5<u?f/(2-h-l):f/(h+l),s=h===i?(n-a)/f+(n<a?6:0):h===n?(a-i)/f+2:(i-n)/f+4,s*=60),p[0]=~~(s+.5),p[1]=~~(100*o+.5),p[2]=~~(100*u+.5)),r&&p.length<4&&(p[3]=1),p}function sb(t){var r=[],i=[],n=-1;return t.split(Pt).forEach(function(t){var e=t.match(rt)||[];r.push.apply(r,e),i.push(n+=e.length+1)}),r.c=i,r}function tb(t,e,r){var i,n,a,s,o="",u=(t+o).match(Pt),h=e?"hsla(":"rgba(",l=0;if(!u)return t;if(u=u.map(function(t){return(t=rb(t,e,1))&&h+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"}),r&&(a=sb(t),(i=r.c).join(o)!==a.c.join(o)))for(s=(n=t.replace(Pt,"1").split(rt)).length-1;l<s;l++)o+=n[l]+(~i.indexOf(l)?u.shift()||h+"0,0,0,0)":(a.length?a:u.length?u:r).shift());if(!n)for(s=(n=t.split(Pt)).length-1;l<s;l++)o+=n[l]+u[l];return o+n[s]}function wb(t){var e,r=t.join(" ");if(Pt.lastIndex=0,Pt.test(r))return e=At.test(r),t[1]=tb(t[1],e),t[0]=tb(t[0],e,sb(t[1])),!0}function Fb(t){var e=(t+"").split("("),r=zt[e[0]];return r&&1<e.length&&r.config?r.config.apply(null,~t.indexOf("{")?[function _parseObjectInString(t){for(var e,r,i,n={},a=t.substr(1,t.length-3).split(":"),s=a[0],o=1,u=a.length;o<u;o++)r=a[o],e=o!==u-1?r.lastIndexOf(","):r.length,i=r.substr(0,e),n[s]=isNaN(i)?i.replace(Et,"").trim():+i,s=r.substr(e+1).trim();return n}(e[1])]:function _valueInParentheses(t){var e=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<r?t.indexOf(")",r+1):r)}(t).split(",").map(ha)):zt._CE&&Ft.test(t)?zt._CE("",t):r}function Hb(t,e){for(var r,i=t._first;i;)i instanceof Nt?Hb(i,e):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===e||(i.timeline?Hb(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next}function Jb(t,e,r,i){void 0===r&&(r=function easeOut(t){return 1-e(1-t)}),void 0===i&&(i=function easeInOut(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var n,a={easeIn:e,easeOut:r,easeInOut:i};return ba(t,function(t){for(var e in zt[t]=ot[t]=a,zt[n=t.toLowerCase()]=r,a)zt[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=zt[t+"."+e]=a[e]}),a}function Kb(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}}function Lb(r,t,e){function Sl(t){return 1===t?1:i*Math.pow(2,-10*t)*K((t-a)*n)+1}var i=1<=t?t:1,n=(e||(r?.3:.45))/(t<1?t:1),a=n/U*(Math.asin(1/i)||0),s="out"===r?Sl:"in"===r?function(t){return 1-Sl(1-t)}:Kb(Sl);return n=U/n,s.config=function(t,e){return Lb(r,t,e)},s}function Mb(e,r){function $l(t){return t?--t*t*((r+1)*t+r)+1:0}void 0===r&&(r=1.70158);var t="out"===e?$l:"in"===e?function(t){return 1-$l(1-t)}:Kb($l);return t.config=function(t){return Mb(e,t)},t}var R,I,i,n,a,h,l,f,d,c,m,g,y,b,T,w,x,k,C,A,S,D,z,F,E,B,Y={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},L={duration:.5,overwrite:!1,delay:0},j=1e8,X=1/j,U=2*Math.PI,V=U/4,J=0,G=Math.sqrt,Z=Math.cos,K=Math.sin,H="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},W=Array.isArray,tt=/(?:-?\.?\d|\.)+/gi,et=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,rt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,it=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,nt=/[+-]=-?[.\d]+/,at=/[^,'"\[\]\s]+/gi,st=/[\d.+\-=]+(?:e[-+]\d*)*/i,ot={},ut={},ht=[],lt={},ft={},dt={},pt=30,ct=[],_t="",mt=function _merge(t,e){for(var r in e)t[r]=e[r];return t},gt=function _animationCycle(t,e){var r=Math.floor(t/=e);return t&&r===t?r-1:r},vt=function _isFromOrFromStart(t){var e=t.data;return"isFromStart"===e||"isStart"===e},yt={_start:0,endTime:Q,totalDuration:Q},bt=function _parsePosition(t,e,r){var i,n,a,s=t.labels,u=t._recent||yt,h=t.duration()>=j?u.endTime(!1):t._dur;return o(e)&&(isNaN(e)||e in s)?(n=e.charAt(0),a="%"===e.substr(-1),i=e.indexOf("="),"<"===n||">"===n?(0<=i&&(e=e.replace(/=/,"")),("<"===n?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(a?(i<0?u:r).totalDuration()/100:1)):i<0?(e in s||(s[e]=h),s[e]):(n=parseFloat(e.charAt(i-1)+e.substr(i+1)),a&&r&&(n=n/100*(W(r)?r[0]:r).totalDuration()),1<i?_parsePosition(t,e.substr(0,i-1),r)+n:h+n)):null==e?h:+e},Tt=function _clamp(t,e,r){return r<t?t:e<r?e:r},wt=[].slice,xt=function toArray(t,e,r){return!o(t)||r||!n&&Dt()?W(t)?function _flatten(t,e,r){return void 0===r&&(r=[]),t.forEach(function(t){return o(t)&&!e||Ta(t,1)?r.push.apply(r,xt(t)):r.push(t)})||r}(t,r):Ta(t)?wt.call(t,0):t?[t]:[]:wt.call((e||a).querySelectorAll(t),0)},Ot=function mapRange(e,t,r,i,n){var a=t-e,s=i-r;return Oa(n,function(t){return r+((t-e)/a*s||0)})},Mt=function _callback(t,e,r){var i,n,a=t.vars,s=a[e];if(s)return i=a[e+"Params"],n=a.callbackScope||t,r&&ht.length&&fa(),i?s.apply(n,i):s.call(n)},kt=255,Ct={aqua:[0,kt,kt],lime:[0,kt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,kt],navy:[0,0,128],white:[kt,kt,kt],olive:[128,128,0],yellow:[kt,kt,0],orange:[kt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[kt,0,0],pink:[kt,192,203],cyan:[0,kt,kt],transparent:[kt,kt,kt,0]},Pt=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Ct)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),At=/hsl[a]?\(/,St=(x=Date.now,k=500,C=33,A=x(),S=A,z=D=1e3/240,b={time:0,frame:0,tick:function tick(){Ok(!0)},deltaRatio:function deltaRatio(t){return T/(1e3/(t||60))},wake:function wake(){l&&(!n&&u()&&(i=n=window,a=i.document||{},ot.gsap=oe,(i.gsapVersions||(i.gsapVersions=[])).push(oe.version),M(h||i.GreenSockGlobals||!i.gsap&&i||{}),y=i.requestAnimationFrame),m&&b.sleep(),g=y||function(t){return setTimeout(t,z-1e3*b.time+1|0)},c=1,Ok(2))},sleep:function sleep(){(y?i.cancelAnimationFrame:clearTimeout)(m),c=0,g=Q},lagSmoothing:function lagSmoothing(t,e){k=t||1e8,C=Math.min(e,k,0)},fps:function fps(t){D=1e3/(t||240),z=1e3*b.time+D},add:function add(t){F.indexOf(t)<0&&F.push(t),Dt()},remove:function remove(t,e){~(e=F.indexOf(t))&&F.splice(e,1)&&e<=w&&w--},_listeners:F=[]}),Dt=function _wake(){return!c&&St.wake()},zt={},Ft=/^[\d.\-M][\d.\-,\s]/,Et=/["']/g,Bt=function _invertEase(e){return function(t){return 1-e(1-t)}},Rt=function _parseEase(t,e){return t&&(p(t)?t:zt[t]||Fb(t))||e};function Ok(t){var e,r,i,n,a=x()-S,s=!0===t;if(k<a&&(A+=a-C),(0<(e=(i=(S+=a)-A)-z)||s)&&(n=++b.frame,T=i-1e3*b.time,b.time=i/=1e3,z+=e+(D<=e?4:D-e),r=1),s||(m=g(Ok)),r)for(w=0;w<F.length;w++)F[w](i,T,n,t)}function pm(t){return t<B?E*t*t:t<.7272727272727273?E*Math.pow(t-1.5/2.75,2)+.75:t<.9090909090909092?E*(t-=2.25/2.75)*t+.9375:E*Math.pow(t-2.625/2.75,2)+.984375}ba("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var r=e<5?e+1:e;Jb(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},function(t){return 1-Math.pow(1-t,r)},function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2})}),zt.Linear.easeNone=zt.none=zt.Linear.easeIn,Jb("Elastic",Lb("in"),Lb("out"),Lb()),E=7.5625,B=1/2.75,Jb("Bounce",function(t){return 1-pm(1-t)},pm),Jb("Expo",function(t){return t?Math.pow(2,10*(t-1)):0}),Jb("Circ",function(t){return-(G(1-t*t)-1)}),Jb("Sine",function(t){return 1===t?1:1-Z(t*V)}),Jb("Back",Mb("in"),Mb("out"),Mb()),zt.SteppedEase=zt.steps=ot.SteppedEase={config:function config(t,e){void 0===t&&(t=1);var r=1/t,i=t+(e?0:1),n=e?1:0;return function(t){return((i*Tt(0,.99999999,t)|0)+n)*r}}},L.ease=zt["quad.out"],ba("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return _t+=t+","+t+"Params,"});var It,Lt=function GSCache(t,e){this.id=J++,(t._gsap=this).target=t,this.harness=e,this.get=e?e.get:aa,this.set=e?e.getSetter:Kt},qt=((It=Animation.prototype).delay=function delay(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},It.duration=function duration(t){return arguments.length?this.totalDuration(0<this._repeat?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},It.totalDuration=function totalDuration(t){return arguments.length?(this._dirty=0,Ja(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},It.totalTime=function totalTime(t,e){if(Dt(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Aa(this,t),!r._dp||r.parent||Ba(r,this);r&&r.parent;)r.parent._time!==r._start+(0<=r._ts?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(0<this._ts&&t<this._tDur||this._ts<0&&0<t||!this._tDur&&!t)&&Ca(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===X||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),ga(this,t,e)),this},It.time=function time(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+wa(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},It.totalProgress=function totalProgress(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},It.progress=function progress(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+wa(this),e):this.duration()?Math.min(1,this._time/this._dur):this.ratio},It.iteration=function iteration(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?gt(this._tTime,r)+1:1},It.timeScale=function timeScale(t){if(!arguments.length)return this._rts===-X?0:this._rts;if(this._rts===t)return this;var e=this.parent&&this._ts?ya(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-X?0:this._rts,function _recacheAncestors(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent}(this.totalTime(Tt(-this._delay,this._tDur,e),!0)),za(this),this},It.paused=function paused(t){return arguments.length?(this._ps!==t&&((this._ps=t)?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Dt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==X&&(this._tTime-=X)))),this):this._ps},It.startTime=function startTime(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return!e||!e._sort&&this.parent||Ca(e,this,t-this._delay),this}return this._start},It.endTime=function endTime(e){return this._start+(t(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},It.rawTime=function rawTime(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ya(e.rawTime(t),this):this._tTime:this._tTime},It.globalTime=function globalTime(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(e._ts||1),e=e._dp;return r},It.repeat=function repeat(t){return arguments.length?(this._repeat=t===1/0?-2:t,Ka(this)):-2===this._repeat?1/0:this._repeat},It.repeatDelay=function repeatDelay(t){if(arguments.length){var e=this._time;return this._rDelay=t,Ka(this),e?this.time(e):this}return this._rDelay},It.yoyo=function yoyo(t){return arguments.length?(this._yoyo=t,this):this._yoyo},It.seek=function seek(e,r){return this.totalTime(bt(this,e),t(r))},It.restart=function restart(e,r){return this.play().totalTime(e?-this._delay:0,t(r))},It.play=function play(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},It.reverse=function reverse(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},It.pause=function pause(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},It.resume=function resume(){return this.paused(!1)},It.reversed=function reversed(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-X:0)),this):this._rts<0},It.invalidate=function invalidate(){return this._initted=this._act=0,this._zTime=-X,this},It.isActive=function isActive(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-X))},It.eventCallback=function eventCallback(t,e,r){var i=this.vars;return 1<arguments.length?(e?(i[t]=e,r&&(i[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete i[t],this):i[t]},It.then=function then(t){var i=this;return new Promise(function(e){function Gn(){var t=i.then;i.then=null,p(r)&&(r=r(i))&&(r.then||r===i)&&(i.then=t),e(r),i.then=t}var r=p(t)?t:ia;i._initted&&1===i.totalProgress()&&0<=i._ts||!i._tTime&&i._ts<0?Gn():i._prom=Gn})},It.kill=function kill(){lb(this)},Animation);function Animation(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Ja(this,+t.duration,1,1),this.data=t.data,c||St.wake()}ja(qt.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-X,_prom:0,_ps:!1,_rts:1});var Nt=function(n){function Timeline(e,r){var i;return void 0===e&&(e={}),(i=n.call(this,e)||this).labels={},i.smoothChildTiming=!!e.smoothChildTiming,i.autoRemoveChildren=!!e.autoRemoveChildren,i._sort=t(e.sortChildren),I&&Ca(e.parent||I,_assertThisInitialized(i),r),e.reversed&&i.reverse(),e.paused&&i.paused(!0),e.scrollTrigger&&Da(_assertThisInitialized(i),e.scrollTrigger),i}_inheritsLoose(Timeline,n);var e=Timeline.prototype;return e.to=function to(t,e,r){return Na(0,arguments,this),this},e.from=function from(t,e,r){return Na(1,arguments,this),this},e.fromTo=function fromTo(t,e,r,i){return Na(2,arguments,this),this},e.set=function set(t,e,r){return e.duration=0,e.parent=this,oa(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new Jt(t,e,bt(this,r),1),this},e.call=function call(t,e,r){return Ca(this,Jt.delayedCall(0,t,e),r)},e.staggerTo=function staggerTo(t,e,r,i,n,a,s){return r.duration=e,r.stagger=r.stagger||i,r.onComplete=a,r.onCompleteParams=s,r.parent=this,new Jt(t,r,bt(this,n)),this},e.staggerFrom=function staggerFrom(e,r,i,n,a,s,o){return i.runBackwards=1,oa(i).immediateRender=t(i.immediateRender),this.staggerTo(e,r,i,n,a,s,o)},e.staggerFromTo=function staggerFromTo(e,r,i,n,a,s,o,u){return n.startAt=i,oa(n).immediateRender=t(n.immediateRender),this.staggerTo(e,r,n,a,s,o,u)},e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d,p,c,_=this._time,m=this._dirty?this.totalDuration():this._tDur,g=this._dur,v=t<=0?0:da(t),y=this._zTime<0!=t<0&&(this._initted||!g);if(this!==I&&m<v&&0<=t&&(v=m),v!==this._tTime||r||y){if(_!==this._time&&g&&(v+=this._time-_,t+=this._time-_),i=v,f=this._start,u=!(l=this._ts),y&&(g||(_=this._zTime),!t&&e||(this._zTime=t)),this._repeat){if(p=this._yoyo,o=g+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,r);if(i=da(v%o),v===m?(s=this._repeat,i=g):((s=~~(v/o))&&s===v/o&&(i=g,s--),g<i&&(i=g)),d=gt(this._tTime,o),!_&&this._tTime&&d!==s&&(d=s),p&&1&s&&(i=g-i,c=1),s!==d&&!this._lock){var b=p&&1&d,T=b===(p&&1&s);if(s<d&&(b=!b),_=b?0:g,this._lock=1,this.render(_||(c?0:da(s*o)),e,!g)._lock=0,this._tTime=v,!e&&this.parent&&Mt(this,"onRepeat"),this.vars.repeatRefresh&&!c&&(this.invalidate()._lock=1),_&&_!==this._time||u!=!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(g=this._dur,m=this._tDur,T&&(this._lock=2,_=b?g:-1e-4,this.render(_,!0),this.vars.repeatRefresh&&!c&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;Hb(this,c)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(h=function _findNextPauseTween(t,e,r){var i;if(e<r)for(i=t._first;i&&i._start<=r;){if("isPause"===i.data&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start<e)return i;i=i._prev}}(this,da(_),da(i)))&&(v-=i-(i=h._start)),this._tTime=v,this._time=i,this._act=!l,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,_=0),!_&&i&&!e&&(Mt(this,"onStart"),this._tTime!==v))return this;if(_<=i&&0<=t)for(n=this._first;n;){if(a=n._next,(n._act||i>=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(i-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(i-n._start)*n._ts,e,r),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=-X);break}}n=a}else{n=this._last;for(var w=t<0?t:i;n;){if(a=n._prev,(n._act||w<=n._end)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(w-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(w-n._start)*n._ts,e,r),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=w?-X:X);break}}n=a}}if(h&&!e&&(this.pause(),h.render(_<=i?0:-X)._zTime=_<=i?1:-1,this._ts))return this._start=f,za(this),this.render(t,e,r);this._onUpdate&&!e&&Mt(this,"onUpdate",!0),(v===m&&m>=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0<this._ts||!v&&this._ts<0)||sa(this,1),e||t<0&&!_||!v&&!_&&m||(Mt(this,v===m&&0<=t?"onComplete":"onReverseComplete",!0),!this._prom||v<m&&0<this.timeScale()||this._prom())))}return this},e.add=function add(t,e){var r=this;if(q(e)||(e=bt(this,e,t)),!(t instanceof qt)){if(W(t))return t.forEach(function(t){return r.add(t,e)}),this;if(o(t))return this.addLabel(t,e);if(!p(t))return this;t=Jt.delayedCall(0,t)}return this!==t?Ca(this,t,e):this},e.getChildren=function getChildren(t,e,r,i){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===i&&(i=-j);for(var n=[],a=this._first;a;)a._start>=i&&(a instanceof Jt?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return o(t)?this.removeLabel(t):p(t)?this.killTweensOf(t):(ra(this,t),t===this._recent&&(this._recent=this._last),ta(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=da(St.time-(0<this._ts?t/this._ts:(this.totalDuration()-t)/-this._ts))),n.prototype.totalTime.call(this,t,e),this._forcing=0,this):this._tTime},e.addLabel=function addLabel(t,e){return this.labels[t]=bt(this,e),this},e.removeLabel=function removeLabel(t){return delete this.labels[t],this},e.addPause=function addPause(t,e,r){var i=Jt.delayedCall(0,e||Q,r);return i.data="isPause",this._hasPause=1,Ca(this,i,bt(this,t))},e.removePause=function removePause(t){var e=this._first;for(t=bt(this,t);e;)e._start===t&&"isPause"===e.data&&sa(e),e=e._next},e.killTweensOf=function killTweensOf(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)Qt!==i[n]&&i[n].kill(t,e);return this},e.getTweensOf=function getTweensOf(t,e){for(var r,i=[],n=xt(t),a=this._first,s=q(e);a;)a instanceof Jt?ea(a._targets,n)&&(s?(!Qt||a._initted&&a._ts)&&a.globalTime(0)<=e&&a.globalTime(a.totalDuration())>e:!e||a.isActive())&&i.push(a):(r=a.getTweensOf(n,e)).length&&i.push.apply(i,r),a=a._next;return i},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=bt(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=Jt.to(i,ja({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||X,onStart:function onStart(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&Ja(h,t,0,1).render(h._time,!0,!0),r=1}s&&s.apply(h,o||[])}},e));return u?h.render(0):h},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,ja({startAt:{time:bt(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),jb(this,bt(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),jb(this,bt(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+X)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,a=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return ta(this)},e.invalidate=function invalidate(){var t=this._first;for(this._lock=0;t;)t.invalidate(),t=t._next;return n.prototype.invalidate.call(this)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),ta(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=j;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Ca(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=r/a._ts,a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ja(a,a===I&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(I._ts&&(ga(I,ya(t,I)),f=St.frame),St.frame>=pt){pt+=Y.autoSleep||120;var e=I._first;if((!e||!e._ts)&&Y.autoSleep&&St._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||St.sleep()}}},Timeline}(qt);ja(Nt.prototype,{_lock:0,_hasPause:0,_forcing:0});function Tb(t,e,r,i,n,a){var u,h,l,f;if(ft[t]&&!1!==(u=new ft[t]).init(n,u.rawVars?e[t]:function _processVars(t,e,r,i,n){if(p(t)&&(t=Xt(t,n,e,r,i)),!s(t)||t.style&&t.nodeType||W(t)||H(t))return o(t)?Xt(t,n,e,r,i):t;var a,u={};for(a in t)u[a]=Xt(t[a],n,e,r,i);return u}(e[t],i,n,a,r),r,i,a)&&(r._pt=h=new ae(r._pt,n,t,0,1,u.render,u,0,u.priority),r!==d))for(l=r._ptLookup[r._targets.indexOf(n)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function Xb(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if(W(r))a=e[t]||(e[t]=[]),r.forEach(function(t,e){return a.push({t:e/(r.length-1)*100,v:t,e:s})});else for(n in r)a=e[n]||(e[n]=[]),"ease"===n||a.push({t:parseFloat(t),v:r[n],e:s})}var Qt,Yt=function _addPropTween(t,e,r,i,n,a,s,u,h){p(i)&&(i=i(n||0,t,a));var l,f=t[e],d="get"!==r?r:p(f)?h?t[e.indexOf("set")||!p(t["get"+e.substr(3)])?e:"get"+e.substr(3)](h):t[e]():f,c=p(f)?h?Zt:$t:Gt;if(o(i)&&(~i.indexOf("random(")&&(i=gb(i)),"="===i.charAt(1)&&(!(l=parseFloat(d)+parseFloat(i.substr(2))*("-"===i.charAt(0)?-1:1)+(Qa(d)||0))&&0!==l||(i=l))),d!==i)return isNaN(d*i)||""===i?(f||e in t||N(e,i),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,d,p,c,_=new ae(this._pt,t,e,0,1,te,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(p=~(i+="").indexOf("random("))&&(i=gb(i)),a&&(a(c=[r,i],t,e),r=c[0],i=c[1]),u=r.match(it)||[];o=it.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(d=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:d,c:"="===l.charAt(1)?parseFloat(l.substr(2))*("-"===l.charAt(0)?-1:1):parseFloat(l)-d,m:h&&h<4?Math.round:0},m=it.lastIndex);return _.c=m<i.length?i.substring(m,i.length):"",_.fp=s,(nt.test(i)||p)&&(_.e=0),this._pt=_}.call(this,t,e,d,i,c,u||Y.stringFilter,h)):(l=new ae(this._pt,t,e,+d||0,i-(d||0),"boolean"==typeof f?Wt:Ht,0,c),h&&(l.fp=h),s&&l.modifier(s,this,t),this._pt=l)},jt=function _initTween(e,r){var i,n,a,s,o,u,h,l,f,d,p,c,m,g=e.vars,v=g.ease,y=g.startAt,b=g.immediateRender,T=g.lazy,w=g.onUpdate,x=g.onUpdateParams,O=g.callbackScope,M=g.runBackwards,k=g.yoyoEase,C=g.keyframes,P=g.autoRevert,A=e._dur,S=e._startAt,D=e._targets,z=e.parent,F=z&&"nested"===z.data?z.parent._targets:D,E="auto"===e._overwrite&&!R,B=e.timeline;if(!B||C&&v||(v="none"),e._ease=Rt(v,L.ease),e._yEase=k?Bt(Rt(!0===k?v:k,L.ease)):0,k&&e._yoyo&&!e._repeat&&(k=e._yEase,e._yEase=e._ease,e._ease=k),e._from=!B&&!!g.runBackwards,!B||C&&!g.stagger){if(c=(l=D[0]?_(D[0]).harness:0)&&g[l.prop],i=na(g,ut),S&&sa(S.render(-1,!0)),y)if(sa(e._startAt=Jt.set(D,ja({data:"isStart",overwrite:!1,parent:z,immediateRender:!0,lazy:t(T),startAt:null,delay:0,onUpdate:w,onUpdateParams:x,callbackScope:O,stagger:0},y))),r<0&&!b&&!P&&e._startAt.render(-1,!0),b){if(0<r&&!P&&(e._startAt=0),A&&r<=0)return void(r&&(e._zTime=r))}else!1===P&&(e._startAt=0);else if(M&&A)if(S)P||(e._startAt=0);else if(r&&(b=!1),a=ja({overwrite:!1,data:"isFromStart",lazy:b&&t(T),immediateRender:b,stagger:0,parent:z},i),c&&(a[l.prop]=c),sa(e._startAt=Jt.set(D,a)),r<0&&e._startAt.render(-1,!0),e._zTime=r,b){if(!r)return}else _initTween(e._startAt,X);for(e._pt=0,T=A&&t(T)||T&&!A,n=0;n<D.length;n++){if(h=(o=D[n])._gsap||$(D)[n]._gsap,e._ptLookup[n]=d={},lt[h.id]&&ht.length&&fa(),p=F===D?n:F.indexOf(o),l&&!1!==(f=new l).init(o,c||i,e,p,F)&&(e._pt=s=new ae(e._pt,o,f.name,0,1,f.render,f,0,f.priority),f._props.forEach(function(t){d[t]=s}),f.priority&&(u=1)),!l||c)for(a in i)ft[a]&&(f=Tb(a,i,e,p,o,F))?f.priority&&(u=1):d[a]=s=Yt.call(e,o,a,"get",i[a],p,F,0,g.stringFilter);e._op&&e._op[n]&&e.kill(o,e._op[n]),E&&e._pt&&(Qt=e,I.killTweensOf(o,d,e.globalTime(r)),m=!e.parent,Qt=0),e._pt&&T&&(lt[h.id]=1)}u&&ne(e),e._onInit&&e._onInit(e)}e._onUpdate=w,e._initted=(!e._op||e._pt)&&!m,C&&r<=0&&B.render(j,!0,!0)},Xt=function _parseFuncOrString(t,e,r,i,n){return p(t)?t.call(e,r,i,n):o(t)&&~t.indexOf("random(")?gb(t):t},Ut=_t+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase",Vt={};ba(Ut+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return Vt[t]=1});var Jt=function(F){function Tween(e,r,i,n){var a;"number"==typeof r&&(i.duration=r,r=i,i=null);var o,u,h,l,f,d,p,c,_=(a=F.call(this,n?r:oa(r))||this).vars,m=_.duration,g=_.delay,y=_.immediateRender,b=_.stagger,T=_.overwrite,w=_.keyframes,x=_.defaults,M=_.scrollTrigger,k=_.yoyoEase,C=r.parent||I,P=(W(e)||H(e)?q(e[0]):"length"in r)?[e]:xt(e);if(a._targets=P.length?$(P):O("GSAP target "+e+" not found. https://greensock.com",!Y.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=T,w||b||v(m)||v(g)){if(r=a.vars,(o=a.timeline=new Nt({data:"nested",defaults:x||{}})).kill(),o.parent=o._dp=_assertThisInitialized(a),o._start=0,b||v(m)||v(g)){if(l=P.length,p=b&&Ya(b),s(b))for(f in b)~Ut.indexOf(f)&&((c=c||{})[f]=b[f]);for(u=0;u<l;u++)(h=na(r,Vt)).stagger=0,k&&(h.yoyoEase=k),c&&mt(h,c),d=P[u],h.duration=+Xt(m,_assertThisInitialized(a),u,d,P),h.delay=(+Xt(g,_assertThisInitialized(a),u,d,P)||0)-a._delay,!b&&1===l&&h.delay&&(a._delay=g=h.delay,a._start+=g,h.delay=0),o.to(d,h,p?p(u,d,P):0),o._ease=zt.none;o.duration()?m=g=0:a.timeline=0}else if(w){oa(ja(o.vars.defaults,{ease:"none"})),o._ease=Rt(w.ease||r.ease||"none");var A,S,D,z=0;if(W(w))w.forEach(function(t){return o.to(P,t,">")});else{for(f in h={},w)"ease"===f||"easeEach"===f||Xb(f,w[f],h,w.easeEach);for(f in h)for(A=h[f].sort(function(t,e){return t.t-e.t}),u=z=0;u<A.length;u++)(D={ease:(S=A[u]).e,duration:(S.t-(u?A[u-1].t:0))/100*m})[f]=S.v,o.to(P,D,z),z+=D.duration;o.duration()<m&&o.to({},{duration:m-o.duration()})}}m||a.duration(m=o.duration())}else a.timeline=0;return!0!==T||R||(Qt=_assertThisInitialized(a),I.killTweensOf(P),Qt=0),Ca(C,_assertThisInitialized(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(y||!m&&!w&&a._start===da(C._time)&&t(y)&&function _hasNoPausedAncestors(t){return!t||t._ts&&_hasNoPausedAncestors(t.parent)}(_assertThisInitialized(a))&&"nested"!==C.data)&&(a._tTime=-X,a.render(Math.max(0,-g))),M&&Da(_assertThisInitialized(a),M),a}_inheritsLoose(Tween,F);var e=Tween.prototype;return e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d=this._time,p=this._tDur,c=this._dur,_=p-X<t&&0<=t?p:t<X?0:t;if(c){if(_!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=t<0){if(i=_,l=this.timeline,this._repeat){if(s=c+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*s+t,e,r);if(i=da(_%s),_===p?(a=this._repeat,i=c):((a=~~(_/s))&&a===_/s&&(i=c,a--),c<i&&(i=c)),(u=this._yoyo&&1&a)&&(f=this._yEase,i=c-i),o=gt(this._tTime,s),i===d&&!r&&this._initted)return this;a!==o&&(l&&this._yEase&&Hb(l,u),!this.vars.repeatRefresh||u||this._lock||(this._lock=r=1,this.render(da(s*a),!0).invalidate()._lock=0))}if(!this._initted){if(Ea(this,t<0?t:i,r,e))return this._tTime=0,this;if(c!==this._dur)return this.render(t,e,r)}if(this._tTime=_,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=h=(f||this._ease)(i/c),this._from&&(this.ratio=h=1-h),i&&!d&&!e&&(Mt(this,"onStart"),this._tTime!==_))return this;for(n=this._pt;n;)n.r(h,n.d),n=n._next;l&&l.render(t<0?t:!i&&u?-X:l._dur*l._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(t<0&&this._startAt&&this._startAt.render(t,!0,r),Mt(this,"onUpdate")),this._repeat&&a!==o&&this.vars.onRepeat&&!e&&this.parent&&Mt(this,"onRepeat"),_!==this._tDur&&_||this._tTime!==_||(t<0&&this._startAt&&!this._onUpdate&&this._startAt.render(t,!0,!0),!t&&c||!(_===this._tDur&&0<this._ts||!_&&this._ts<0)||sa(this,1),e||t<0&&!d||!_&&!d||(Mt(this,_===p?"onComplete":"onReverseComplete",!0),!this._prom||_<p&&0<this.timeScale()||this._prom()))}}else!function _renderZeroDurationTween(t,e,r,i){var n,a,s,o=t.ratio,u=e<0||!e&&(!t._start&&function _parentPlayheadIsBeforeStart(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||_parentPlayheadIsBeforeStart(e))}(t)&&(t._initted||!vt(t))||(t._ts<0||t._dp._ts<0)&&!vt(t))?0:1,h=t._rDelay,l=0;if(h&&t._repeat&&(l=Tt(0,t._tDur,e),a=gt(l,h),t._yoyo&&1&a&&(u=1-u),a!==gt(t._tTime,h)&&(o=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==o||i||t._zTime===X||!e&&t._zTime){if(!t._initted&&Ea(t,e,i,r))return;for(s=t._zTime,t._zTime=e||(r?X:0),r=r||e&&!s,t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=l,n=t._pt;n;)n.r(u,n.d),n=n._next;t._startAt&&e<0&&t._startAt.render(e,!0,!0),t._onUpdate&&!r&&Mt(t,"onUpdate"),l&&t._repeat&&!r&&t.parent&&Mt(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&sa(t,1),r||(Mt(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),F.prototype.invalidate.call(this)},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?lb(this):this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Qt&&!0!==Qt.vars.overwrite)._first||lb(this),this.parent&&r!==this.timeline.totalDuration()&&Ja(this,this._dur*this.timeline._tDur/r,0,1),this}var i,n,a,s,u,h,l,f=this._targets,d=t?xt(t):f,p=this._ptLookup,c=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,d))return"all"===e&&(this._pt=0),lb(this);for(i=this._op=this._op||[],"all"!==e&&(o(e)&&(u={},ba(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?_(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=mt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~d.indexOf(f[l]))for(u in n=p[l],"all"===e?(i[l]=e,s=n,a={}):(a=i[l]=i[l]||{},s=e),s)(h=n&&n[u])&&("kill"in h.d&&!0!==h.d.kill(u)||ra(this,h,"_pt"),delete n[u]),"all"!==a&&(a[u]=1);return this._initted&&!this._pt&&c&&lb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Na(1,arguments)},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return Na(2,arguments)},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return I.killTweensOf(t,e,r)},Tween}(qt);ja(Jt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ba("staggerTo,staggerFrom,staggerFromTo",function(r){Jt[r]=function(){var t=new Nt,e=wt.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function dc(t,e,r){return t.setAttribute(e,r)}function lc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var Gt=function _setterPlain(t,e,r){return t[e]=r},$t=function _setterFunc(t,e,r){return t[e](r)},Zt=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},Kt=function _getSetter(t,e){return p(t[e])?$t:r(t[e])&&t.setAttribute?dc:Gt},Ht=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},Wt=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},te=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},ee=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},re=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},ie=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?ra(this,i,"_pt"):i.dep||(e=1),i=r;return!e},ne=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},ae=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=lc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||Ht,this.d=s||this,this.set=o||Gt,this.pr=u||0,(this._next=t)&&(t._prev=this)}ba(_t+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ut[t]=1}),ot.TweenMax=ot.TweenLite=Jt,ot.TimelineLite=ot.TimelineMax=Nt,I=new Nt({sortChildren:!1,defaults:L,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Y.stringFilter=wb;var se={registerPlugin:function registerPlugin(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t){return function _createPlugin(t){var e=(t=!t.name&&t.default||t).name,r=p(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:Q,render:ee,add:Yt,kill:ie,modifier:re,rawVars:0},a={targetTest:0,get:0,getSetter:Kt,aliases:{},register:0};if(Dt(),t!==i){if(ft[e])return;ja(i,ja(na(t,n),a)),mt(i.prototype,mt(n,na(t,a))),ft[i.prop=e]=i,t.targetTest&&(ct.push(i),ut[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}P(e,i),t.register&&t.register(oe,i,ae)}(t)})},timeline:function timeline(t){return new Nt(t)},getTweensOf:function getTweensOf(t,e){return I.getTweensOf(t,e)},getProperty:function getProperty(i,t,e,r){o(i)&&(i=xt(i)[0]);var n=_(i||{}).get,a=e?ia:ha;return"native"===e&&(e=""),i?t?a((ft[t]&&ft[t].get||n)(i,t,e,r)):function(t,e,r){return a((ft[t]&&ft[t].get||n)(i,t,e,r))}:i},quickSetter:function quickSetter(r,e,i){if(1<(r=xt(r)).length){var n=r.map(function(t){return oe.quickSetter(t,e,i)}),a=n.length;return function(t){for(var e=a;e--;)n[e](t)}}r=r[0]||{};var s=ft[e],o=_(r),u=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(t){var e=new s;d._pt=0,e.init(r,i?t+i:t,d,0,[r]),e.render(1,e),d._pt&&ee(1,d)}:o.set(r,u);return s?h:function(t){return h(r,u,i?t+i:t,o,1)}},isTweening:function isTweening(t){return 0<I.getTweensOf(t,!0).length},defaults:function defaults(t){return t&&t.ease&&(t.ease=Rt(t.ease,L.ease)),ma(L,t||{})},config:function config(t){return ma(Y,t||{})},registerEffect:function registerEffect(t){var i=t.name,n=t.effect,e=t.plugins,a=t.defaults,r=t.extendTimeline;(e||"").split(",").forEach(function(t){return t&&!ft[t]&&!ot[t]&&O(i+" effect requires "+t+" plugin.")}),dt[i]=function(t,e,r){return n(xt(t),ja(e||{},a),r)},r&&(Nt.prototype[i]=function(t,e,r){return this.add(dt[i](t,s(e)?e:(r=e)&&{},this),r)})},registerEase:function registerEase(t,e){zt[t]=Rt(e)},parseEase:function parseEase(t,e){return arguments.length?Rt(t,e):zt},getById:function getById(t){return I.getById(t)},exportRoot:function exportRoot(e,r){void 0===e&&(e={});var i,n,a=new Nt(e);for(a.smoothChildTiming=t(e.smoothChildTiming),I.remove(a),a._dp=0,a._time=a._tTime=I._time,i=I._first;i;)n=i._next,!r&&!i._dur&&i instanceof Jt&&i.vars.onComplete===i._targets[0]||Ca(a,i,i._start-i._delay),i=n;return Ca(I,a,0),a},utils:{wrap:function wrap(e,t,r){var i=t-e;return W(e)?db(e,wrap(0,e.length),t):Oa(r,function(t){return(i+(t-e)%i)%i+e})},wrapYoyo:function wrapYoyo(e,t,r){var i=t-e,n=2*i;return W(e)?db(e,wrapYoyo(0,e.length-1),t):Oa(r,function(t){return e+(i<(t=(n+(t-e)%n)%n||0)?n-t:t)})},distribute:Ya,random:_a,snap:$a,normalize:function normalize(t,e,r){return Ot(t,e,0,1,r)},getUnit:Qa,clamp:function clamp(e,r,t){return Oa(t,function(t){return Tt(e,r,t)})},splitColor:rb,toArray:xt,selector:function selector(r){return r=xt(r)[0]||O("Invalid scope")||{},function(t){var e=r.current||r.nativeElement||r;return xt(t,e.querySelectorAll?e:e===r?O("Invalid scope")||a.createElement("div"):r)}},mapRange:Ot,pipe:function pipe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce(function(t,e){return e(t)},t)}},unitize:function unitize(e,r){return function(t){return e(parseFloat(t))+(r||Qa(t))}},interpolate:function interpolate(e,r,t,i){var n=isNaN(e+r)?0:function(t){return(1-t)*e+t*r};if(!n){var a,s,u,h,l,f=o(e),d={};if(!0===t&&(i=1)&&(t=null),f)e={p:e},r={p:r};else if(W(e)&&!W(r)){for(u=[],h=e.length,l=h-2,s=1;s<h;s++)u.push(interpolate(e[s-1],e[s]));h--,n=function func(t){t*=h;var e=Math.min(l,~~t);return u[e](t-e)},t=r}else i||(e=mt(W(e)?[]:{},e));if(!u){for(a in r)Yt.call(d,e,a,"get",r[a]);n=function func(t){return ee(t,d)||(f?e.p:e)}}}return Oa(t,n)},shuffle:Xa},install:M,effects:dt,ticker:St,updateRoot:Nt.updateRoot,plugins:ft,globalTimeline:I,core:{PropTween:ae,globals:P,Tween:Jt,Timeline:Nt,Animation:qt,getCache:_,_removeLinkedListItem:ra,suppressOverwrites:function suppressOverwrites(t){return R=t}}};ba("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return se[t]=Jt[t]}),St.add(Nt.updateRoot),d=se.to({},{duration:0});function pc(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r}function rc(t,n){return{name:t,rawVars:1,init:function init(t,i,e){e._onInit=function(t){var e,r;if(o(i)&&(e={},ba(i,function(t){return e[t]=1}),i=e),n){for(r in e={},i)e[r]=n(i[r]);i=e}!function _addModifiers(t,e){var r,i,n,a=t._targets;for(r in e)for(i=a.length;i--;)(n=(n=t._ptLookup[i][r])&&n.d)&&(n._pt&&(n=pc(n,r)),n&&n.modifier&&n.modifier(e[r],t,a[i],r))}(t,i)}}}}var oe=se.registerPlugin({name:"attr",init:function init(t,e,r,i,n){var a,s;for(a in e)(s=this.add(t,"setAttribute",(t.getAttribute(a)||0)+"",e[a],i,n,0,0,a))&&(s.op=a),this._props.push(a)}},{name:"endArray",init:function init(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r])}},rc("roundProps",Za),rc("modifiers"),rc("snap",$a))||se;Jt.version=Nt.version=oe.version="3.9.0",l=1,u()&&Dt();function ad(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function bd(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function cd(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function dd(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)}function ed(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)}function fd(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)}function gd(t,e,r){return t.style[e]=r}function hd(t,e,r){return t.style.setProperty(e,r)}function id(t,e,r){return t._gsap[e]=r}function jd(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r}function kd(t,e,r,i,n){var a=t._gsap;a.scaleX=a.scaleY=r,a.renderTransform(n,a)}function ld(t,e,r,i,n){var a=t._gsap;a[e]=r,a.renderTransform(n,a)}function pd(t,e){var r=he.createElementNS?he.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):he.createElement(t);return r.style?r:he.createElement(t)}function qd(t,e,r){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(Ie,"-$1").toLowerCase())||i.getPropertyValue(e)||!r&&qd(t,Xe(e)||e,1)||""}function td(){(function _windowExists(){return"undefined"!=typeof window})()&&window.document&&(ue=window,he=ue.document,le=he.documentElement,de=pd("div")||{style:{}},pd("div"),Qe=Xe(Qe),Ye=Qe+"Origin",de.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",ce=!!Xe("perspective"),fe=1)}function ud(t){var e,r=pd("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,n=this.nextSibling,a=this.style.cssText;if(le.appendChild(r),r.appendChild(this),this.style.display="block",t)try{e=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=ud}catch(t){}else this._gsapBBox&&(e=this._gsapBBox());return i&&(n?i.insertBefore(this,n):i.appendChild(this)),le.removeChild(r),this.style.cssText=a,e}function vd(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])}function wd(e){var r;try{r=e.getBBox()}catch(t){r=ud.call(e,!0)}return r&&(r.width||r.height)||e.getBBox===ud||(r=ud.call(e,!0)),!r||r.width||r.x||r.y?r:{x:+vd(e,["x","cx","x1"])||0,y:+vd(e,["y","cy","y1"])||0,width:0,height:0}}function xd(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!wd(t))}function yd(t,e){if(e){var r=t.style;e in Fe&&e!==Ye&&(e=Qe),r.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),r.removeProperty(e.replace(Ie,"-$1").toLowerCase())):r.removeAttribute(e)}}function zd(t,e,r,i,n,a){var s=new ae(t._pt,e,r,0,1,a?fd:ed);return(t._pt=s).b=i,s.e=n,t._props.push(r),s}function Bd(t,e,r,i){var n,a,s,o,u=parseFloat(r)||0,h=(r+"").trim().substr((u+"").length)||"px",l=de.style,f=Le.test(e),d="svg"===t.tagName.toLowerCase(),p=(d?"client":"offset")+(f?"Width":"Height"),c="px"===i,m="%"===i;return i===h||!u||Ue[i]||Ue[h]?u:("px"===h||c||(u=Bd(t,e,r,"px")),o=t.getCTM&&xd(t),!m&&"%"!==h||!Fe[e]&&!~e.indexOf("adius")?(l[f?"width":"height"]=100+(c?h:i),a=~e.indexOf("adius")||"em"===i&&t.appendChild&&!d?t:t.parentNode,o&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==he&&a.appendChild||(a=he.body),(s=a._gsap)&&m&&s.width&&f&&s.time===St.time?ca(u/s.width*100):(!m&&"%"!==h||(l.position=qd(t,"position")),a===t&&(l.position="static"),a.appendChild(de),n=de[p],a.removeChild(de),l.position="absolute",f&&m&&((s=_(a)).time=St.time,s.width=a[p]),ca(c?n*u/100:n&&u?100/n*u:0))):(n=o?t.getBBox()[f?"width":"height"]:t[p],ca(m?u/n*100:u/100*n)))}function Cd(t,e,r,i){var n;return fe||td(),e in Ne&&"transform"!==e&&~(e=Ne[e]).indexOf(",")&&(e=e.split(",")[0]),Fe[e]&&"transform"!==e?(n=Ze(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:Ke(qd(t,Ye))+" "+n.zOrigin+"px"):(n=t.style[e])&&"auto"!==n&&!i&&!~(n+"").indexOf("calc(")||(n=Je[e]&&Je[e](t,e,r)||qd(t,e)||aa(t,e)||("opacity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?Bd(t,e,n,r)+r:n}function Dd(t,e,r,i){if(!r||"none"===r){var n=Xe(e,t,1),a=n&&qd(t,n,1);a&&a!==r?(e=n,r=a):"borderColor"===e&&(r=qd(t,"borderTopColor"))}var s,o,u,h,l,f,d,p,c,_,m,g,v=new ae(this._pt,t.style,e,0,1,te),y=0,b=0;if(v.b=r,v.e=i,r+="","auto"===(i+="")&&(t.style[e]=i,i=qd(t,e)||i,t.style[e]=r),wb(s=[r,i]),i=s[1],u=(r=s[0]).match(rt)||[],(i.match(rt)||[]).length){for(;o=rt.exec(i);)d=o[0],c=i.substring(y,o.index),l?l=(l+1)%5:"rgba("!==c.substr(-5)&&"hsla("!==c.substr(-5)||(l=1),d!==(f=u[b++]||"")&&(h=parseFloat(f)||0,m=f.substr((h+"").length),(g="="===d.charAt(1)?+(d.charAt(0)+"1"):0)&&(d=d.substr(2)),p=parseFloat(d),_=d.substr((p+"").length),y=rt.lastIndex-_.length,_||(_=_||Y.units[e]||m,y===i.length&&(i+=_,v.e+=_)),m!==_&&(h=Bd(t,e,f,_)||0),v._pt={_next:v._pt,p:c||1===b?c:",",s:h,c:g?g*p:p-h,m:l&&l<4||"zIndex"===e?Math.round:0});v.c=y<i.length?i.substring(y,i.length):""}else v.r="display"===e&&"none"===i?fd:ed;return nt.test(i)&&(v.e=0),this._pt=v}function Fd(t){var e=t.split(" "),r=e[0],i=e[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==i&&"right"!==i||(t=r,r=i,i=t),e[0]=Ve[r]||r,e[1]=Ve[i]||i,e.join(" ")}function Gd(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,i,n,a=e.t,s=a.style,o=e.u,u=a._gsap;if("all"===o||!0===o)s.cssText="",i=1;else for(n=(o=o.split(",")).length;-1<--n;)r=o[n],Fe[r]&&(i=1,r="transformOrigin"===r?Ye:Qe),yd(a,r);i&&(yd(a,Qe),u&&(u.svg&&a.removeAttribute("transform"),Ze(a,1),u.uncache=1))}}function Kd(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t}function Ld(t){var e=qd(t,Qe);return Kd(e)?Ge:e.substr(7).match(et).map(ca)}function Md(t,e){var r,i,n,a,s=t._gsap||_(t),o=t.style,u=Ld(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(n=t.transform.baseVal.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]).join(",")?Ge:u:(u!==Ge||t.offsetParent||t===le||s.svg||(n=o.display,o.display="block",(r=t.parentNode)&&t.offsetParent||(a=1,i=t.nextSibling,le.appendChild(t)),u=Ld(t),n?o.display=n:yd(t,"display"),a&&(i?r.insertBefore(t,i):r?r.appendChild(t):le.removeChild(t))),e&&6<u.length?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)}function Nd(t,e,r,i,n,a){var s,o,u,h=t._gsap,l=n||Md(t,!0),f=h.xOrigin||0,d=h.yOrigin||0,p=h.xOffset||0,c=h.yOffset||0,_=l[0],m=l[1],g=l[2],v=l[3],y=l[4],b=l[5],T=e.split(" "),w=parseFloat(T[0])||0,x=parseFloat(T[1])||0;r?l!==Ge&&(o=_*v-m*g)&&(u=w*(-m/o)+x*(_/o)-(_*b-m*y)/o,w=w*(v/o)+x*(-g/o)+(g*b-v*y)/o,x=u):(w=(s=wd(t)).x+(~T[0].indexOf("%")?w/100*s.width:w),x=s.y+(~(T[1]||T[0]).indexOf("%")?x/100*s.height:x)),i||!1!==i&&h.smooth?(y=w-f,b=x-d,h.xOffset=p+(y*_+b*g)-y,h.yOffset=c+(y*m+b*v)-b):h.xOffset=h.yOffset=0,h.xOrigin=w,h.yOrigin=x,h.smooth=!!i,h.origin=e,h.originIsAbsolute=!!r,t.style[Ye]="0px 0px",a&&(zd(a,h,"xOrigin",f,w),zd(a,h,"yOrigin",d,x),zd(a,h,"xOffset",p,h.xOffset),zd(a,h,"yOffset",c,h.yOffset)),t.setAttribute("data-svg-origin",w+" "+x)}function Qd(t,e,r){var i=Qa(e);return ca(parseFloat(e)+parseFloat(Bd(t,"x",r+"px",i)))+i}function Xd(t,e,r,i,n,a){var s,u,h=360,l=o(n),f=parseFloat(n)*(l&&~n.indexOf("rad")?Ee:1),d=a?f*a:f-i,p=i+d+"deg";return l&&("short"===(s=n.split("_")[1])&&(d%=h)!==d%180&&(d+=d<0?h:-h),"cw"===s&&d<0?d=(d+36e9)%h-~~(d/h)*h:"ccw"===s&&0<d&&(d=(d-36e9)%h-~~(d/h)*h)),t._pt=u=new ae(t._pt,e,r,i,d,bd),u.e=p,u.u="deg",t._props.push(r),u}function Yd(t,e){for(var r in e)t[r]=e[r];return t}function Zd(t,e,r){var i,n,a,s,o,u,h,l=Yd({},r._gsap),f=r.style;for(n in l.svg?(a=r.getAttribute("transform"),r.setAttribute("transform",""),f[Qe]=e,i=Ze(r,1),yd(r,Qe),r.setAttribute("transform",a)):(a=getComputedStyle(r)[Qe],f[Qe]=e,i=Ze(r,1),f[Qe]=a),Fe)(a=l[n])!==(s=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=Qa(a)!==(h=Qa(s))?Bd(r,n,a,h):parseFloat(a),u=parseFloat(s),t._pt=new ae(t._pt,i,n,o,u-o,ad),t._pt.u=h||0,t._props.push(n));Yd(i,l)}var ue,he,le,fe,de,pe,ce,_e=zt.Power0,me=zt.Power1,ge=zt.Power2,ve=zt.Power3,ye=zt.Power4,be=zt.Linear,Te=zt.Quad,we=zt.Cubic,xe=zt.Quart,Oe=zt.Quint,Me=zt.Strong,ke=zt.Elastic,Ce=zt.Back,Pe=zt.SteppedEase,Ae=zt.Bounce,Se=zt.Sine,De=zt.Expo,ze=zt.Circ,Fe={},Ee=180/Math.PI,Be=Math.PI/180,Re=Math.atan2,Ie=/([A-Z])/g,Le=/(?:left|right|width|margin|padding|x)/i,qe=/[\s,\(]\S/,Ne={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Qe="transform",Ye=Qe+"Origin",je="O,Moz,ms,Ms,Webkit".split(","),Xe=function _checkPropPrefix(t,e,r){var i=(e||de).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(je[n]+t in i););return n<0?null:(3===n?"ms":0<=n?je[n]:"")+t},Ue={deg:1,rad:1,turn:1},Ve={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Je={clearProps:function clearProps(t,e,r,i,n){if("isFromStart"!==n.data){var a=t._pt=new ae(t._pt,e,r,0,0,Gd);return a.u=i,a.pr=-10,a.tween=n,t._props.push(r),1}}},Ge=[1,0,0,1,0,0],$e={},Ze=function _parseTransform(t,e){var r=t._gsap||new Lt(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,a,s,o,u,h,l,f,d,p,c,_,m,g,v,y,b,T,w,x,O,M,k,C,P,A,S,D,z,F,E,B=t.style,R=r.scaleX<0,I="deg",L=qd(t,Ye)||"0";return i=n=a=u=h=l=f=d=p=0,s=o=1,r.svg=!(!t.getCTM||!xd(t)),m=Md(t,r.svg),r.svg&&(k=(!r.uncache||"0px 0px"===L)&&!e&&t.getAttribute("data-svg-origin"),Nd(t,k||L,!!k||r.originIsAbsolute,!1!==r.smooth,m)),c=r.xOrigin||0,_=r.yOrigin||0,m!==Ge&&(b=m[0],T=m[1],w=m[2],x=m[3],i=O=m[4],n=M=m[5],6===m.length?(s=Math.sqrt(b*b+T*T),o=Math.sqrt(x*x+w*w),u=b||T?Re(T,b)*Ee:0,(f=w||x?Re(w,x)*Ee+u:0)&&(o*=Math.abs(Math.cos(f*Be))),r.svg&&(i-=c-(c*b+_*w),n-=_-(c*T+_*x))):(E=m[6],z=m[7],A=m[8],S=m[9],D=m[10],F=m[11],i=m[12],n=m[13],a=m[14],h=(g=Re(E,D))*Ee,g&&(k=O*(v=Math.cos(-g))+A*(y=Math.sin(-g)),C=M*v+S*y,P=E*v+D*y,A=O*-y+A*v,S=M*-y+S*v,D=E*-y+D*v,F=z*-y+F*v,O=k,M=C,E=P),l=(g=Re(-w,D))*Ee,g&&(v=Math.cos(-g),F=x*(y=Math.sin(-g))+F*v,b=k=b*v-A*y,T=C=T*v-S*y,w=P=w*v-D*y),u=(g=Re(T,b))*Ee,g&&(k=b*(v=Math.cos(g))+T*(y=Math.sin(g)),C=O*v+M*y,T=T*v-b*y,M=M*v-O*y,b=k,O=C),h&&359.9<Math.abs(h)+Math.abs(u)&&(h=u=0,l=180-l),s=ca(Math.sqrt(b*b+T*T+w*w)),o=ca(Math.sqrt(M*M+E*E)),g=Re(O,M),f=2e-4<Math.abs(g)?g*Ee:0,p=F?1/(F<0?-F:F):0),r.svg&&(k=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!Kd(qd(t,Qe)),k&&t.setAttribute("transform",k))),90<Math.abs(f)&&Math.abs(f)<270&&(R?(s*=-1,f+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,f+=f<=0?180:-180)),r.x=i-((r.xPercent=i&&(r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+"px",r.y=n-((r.yPercent=n&&(r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-n)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+"px",r.z=a+"px",r.scaleX=ca(s),r.scaleY=ca(o),r.rotation=ca(u)+I,r.rotationX=ca(h)+I,r.rotationY=ca(l)+I,r.skewX=f+I,r.skewY=d+I,r.transformPerspective=p+"px",(r.zOrigin=parseFloat(L.split(" ")[2])||0)&&(B[Ye]=Ke(L)),r.xOffset=r.yOffset=0,r.force3D=Y.force3D,r.renderTransform=r.svg?ir:ce?rr:He,r.uncache=0,r},Ke=function _firstTwoOnly(t){return(t=t.split(" "))[0]+" "+t[1]},He=function _renderNon3DTransforms(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,rr(t,e)},We="0deg",tr="0px",er=") ",rr=function _renderCSSTransforms(t,e){var r=e||this,i=r.xPercent,n=r.yPercent,a=r.x,s=r.y,o=r.z,u=r.rotation,h=r.rotationY,l=r.rotationX,f=r.skewX,d=r.skewY,p=r.scaleX,c=r.scaleY,_=r.transformPerspective,m=r.force3D,g=r.target,v=r.zOrigin,y="",b="auto"===m&&t&&1!==t||!0===m;if(v&&(l!==We||h!==We)){var T,w=parseFloat(h)*Be,x=Math.sin(w),O=Math.cos(w);w=parseFloat(l)*Be,T=Math.cos(w),a=Qd(g,a,x*T*-v),s=Qd(g,s,-Math.sin(w)*-v),o=Qd(g,o,O*T*-v+v)}_!==tr&&(y+="perspective("+_+er),(i||n)&&(y+="translate("+i+"%, "+n+"%) "),!b&&a===tr&&s===tr&&o===tr||(y+=o!==tr||b?"translate3d("+a+", "+s+", "+o+") ":"translate("+a+", "+s+er),u!==We&&(y+="rotate("+u+er),h!==We&&(y+="rotateY("+h+er),l!==We&&(y+="rotateX("+l+er),f===We&&d===We||(y+="skew("+f+", "+d+er),1===p&&1===c||(y+="scale("+p+", "+c+er),g.style[Qe]=y||"translate(0, 0)"},ir=function _renderSVGTransforms(t,e){var r,i,n,a,s,o=e||this,u=o.xPercent,h=o.yPercent,l=o.x,f=o.y,d=o.rotation,p=o.skewX,c=o.skewY,_=o.scaleX,m=o.scaleY,g=o.target,v=o.xOrigin,y=o.yOrigin,b=o.xOffset,T=o.yOffset,w=o.forceCSS,x=parseFloat(l),O=parseFloat(f);d=parseFloat(d),p=parseFloat(p),(c=parseFloat(c))&&(p+=c=parseFloat(c),d+=c),d||p?(d*=Be,p*=Be,r=Math.cos(d)*_,i=Math.sin(d)*_,n=Math.sin(d-p)*-m,a=Math.cos(d-p)*m,p&&(c*=Be,s=Math.tan(p-c),n*=s=Math.sqrt(1+s*s),a*=s,c&&(s=Math.tan(c),r*=s=Math.sqrt(1+s*s),i*=s)),r=ca(r),i=ca(i),n=ca(n),a=ca(a)):(r=_,a=m,i=n=0),(x&&!~(l+"").indexOf("px")||O&&!~(f+"").indexOf("px"))&&(x=Bd(g,"x",l,"px"),O=Bd(g,"y",f,"px")),(v||y||b||T)&&(x=ca(x+v-(v*r+y*n)+b),O=ca(O+y-(v*i+y*a)+T)),(u||h)&&(s=g.getBBox(),x=ca(x+u/100*s.width),O=ca(O+h/100*s.height)),s="matrix("+r+","+i+","+n+","+a+","+x+","+O+")",g.setAttribute("transform",s),w&&(g.style[Qe]=s)};ba("padding,margin,Width,Radius",function(e,r){var t="Right",i="Bottom",n="Left",o=(r<3?["Top",t,i,n]:["Top"+n,"Top"+t,i+t,i+n]).map(function(t){return r<2?e+t:"border"+t+e});Je[1<r?"border"+e:e]=function(e,t,r,i,n){var a,s;if(arguments.length<4)return a=o.map(function(t){return Cd(e,t,r)}),5===(s=a.join(" ")).split(a[0]).length?a[0]:s;a=(i+"").split(" "),s={},o.forEach(function(t,e){return s[t]=a[e]=a[e]||a[(e-1)/2|0]}),e.init(t,s,n)}});var nr,ar,sr,or={name:"css",register:td,targetTest:function targetTest(t){return t.style&&t.nodeType},init:function init(t,e,r,i,n){var a,s,u,h,l,f,d,p,c,_,m,g,v,y,b,T=this._props,w=t.style,x=r.vars.startAt;for(d in fe||td(),e)if("autoRound"!==d&&(s=e[d],!ft[d]||!Tb(d,e,r,i,t,n)))if(l=typeof s,f=Je[d],"function"===l&&(l=typeof(s=s.call(r,i,t,n))),"string"===l&&~s.indexOf("random(")&&(s=gb(s)),f)f(this,t,d,s,r)&&(b=1);else if("--"===d.substr(0,2))a=(getComputedStyle(t).getPropertyValue(d)+"").trim(),s+="",Pt.lastIndex=0,Pt.test(a)||(p=Qa(a),c=Qa(s)),c?p!==c&&(a=Bd(t,d,a,c)+c):p&&(s+=p),this.add(w,"setProperty",a,s,i,n,0,0,d),T.push(d);else if("undefined"!==l){if(x&&d in x?(a="function"==typeof x[d]?x[d].call(r,i,t,n):x[d],d in Y.units&&!Qa(a)&&(a+=Y.units[d]),o(a)&&~a.indexOf("random(")&&(a=gb(a)),"="===(a+"").charAt(1)&&(a=Cd(t,d))):a=Cd(t,d),h=parseFloat(a),(_="string"===l&&"="===s.charAt(1)?+(s.charAt(0)+"1"):0)&&(s=s.substr(2)),u=parseFloat(s),d in Ne&&("autoAlpha"===d&&(1===h&&"hidden"===Cd(t,"visibility")&&u&&(h=0),zd(this,w,"visibility",h?"inherit":"hidden",u?"inherit":"hidden",!u)),"scale"!==d&&"transform"!==d&&~(d=Ne[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in Fe)if(g||((v=t._gsap).renderTransform&&!e.parseTransform||Ze(t,e.parseTransform),y=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new ae(this._pt,w,Qe,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new ae(this._pt,v,"scaleY",v.scaleY,(_?_*u:u-v.scaleY)||0),T.push("scaleY",d),d+="X";else{if("transformOrigin"===d){s=Fd(s),v.svg?Nd(t,s,0,y,0,this):((c=parseFloat(s.split(" ")[2])||0)!==v.zOrigin&&zd(this,v,"zOrigin",v.zOrigin,c),zd(this,w,d,Ke(a),Ke(s)));continue}if("svgOrigin"===d){Nd(t,s,1,y,0,this);continue}if(d in $e){Xd(this,v,d,h,s,_);continue}if("smoothOrigin"===d){zd(this,v,"smooth",v.smooth,s);continue}if("force3D"===d){v[d]=s;continue}if("transform"===d){Zd(this,s,t);continue}}else d in w||(d=Xe(d)||d);if(m||(u||0===u)&&(h||0===h)&&!qe.test(s)&&d in w)u=u||0,(p=(a+"").substr((h+"").length))!==(c=Qa(s)||(d in Y.units?Y.units[d]:p))&&(h=Bd(t,d,a,c)),this._pt=new ae(this._pt,m?v:w,d,h,_?_*u:u-h,m||"px"!==c&&"zIndex"!==d||!1===e.autoRound?ad:dd),this._pt.u=c||0,p!==c&&"%"!==c&&(this._pt.b=a,this._pt.r=cd);else if(d in w)Dd.call(this,t,d,a,s);else{if(!(d in t)){N(d,s);continue}this.add(t,d,a||t[d],s,i,n)}T.push(d)}b&&ne(this)},get:Cd,aliases:Ne,getSetter:function getSetter(t,e,i){var n=Ne[e];return n&&n.indexOf(",")<0&&(e=n),e in Fe&&e!==Ye&&(t._gsap.x||Cd(t,"x"))?i&&pe===i?"scale"===e?jd:id:(pe=i||{})&&("scale"===e?kd:ld):t.style&&!r(t.style[e])?gd:~e.indexOf("-")?hd:Kt(t,e)},core:{_removeProperty:yd,_getMatrix:Md}};oe.utils.checkPrefix=Xe,sr=ba((nr="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(ar="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){Fe[t]=1}),ba(ar,function(t){Y.units[t]="deg",$e[t]=1}),Ne[sr[13]]=nr+","+ar,ba("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");Ne[e[1]]=sr[e[0]]}),ba("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective,transformPerspective",function(t){Y.units[t]="px"}),oe.registerPlugin(or);var ur=oe.registerPlugin(or)||oe,hr=ur.core.Tween;e.Back=Ce,e.Bounce=Ae,e.CSSPlugin=or,e.Circ=ze,e.Cubic=we,e.Elastic=ke,e.Expo=De,e.Linear=be,e.Power0=_e,e.Power1=me,e.Power2=ge,e.Power3=ve,e.Power4=ye,e.Quad=Te,e.Quart=xe,e.Quint=Oe,e.Sine=Se,e.SteppedEase=Pe,e.Strong=Me,e.TimelineLite=Nt,e.TimelineMax=Nt,e.TweenLite=Jt,e.TweenMax=hr,e.default=ur,e.gsap=ur;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});


/*! ScrollMagic v2.0.7 | (c) 2019 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(e,t){"function"==typeof define&&define.amd?define('ScrollMagic',t):"object"==typeof exports?module.exports=t():e.ScrollMagic=t()}(this,function(){"use strict";var _=function(){};_.version="2.0.7",window.addEventListener("mousewheel",function(){});var P="data-scrollmagic-pin-spacer";_.Controller=function(e){var n,r,i="REVERSE",t="PAUSED",o=z.defaults,s=this,a=R.extend({},o,e),l=[],c=!1,f=0,u=t,d=!0,h=0,p=!0,g=function(){0<a.refreshInterval&&(r=window.setTimeout(E,a.refreshInterval))},v=function(){return a.vertical?R.get.scrollTop(a.container):R.get.scrollLeft(a.container)},m=function(){return a.vertical?R.get.height(a.container):R.get.width(a.container)},w=this._setScrollPos=function(e){a.vertical?d?window.scrollTo(R.get.scrollLeft(),e):a.container.scrollTop=e:d?window.scrollTo(e,R.get.scrollTop()):a.container.scrollLeft=e},y=function(){if(p&&c){var e=R.type.Array(c)?c:l.slice(0);c=!1;var t=f,n=(f=s.scrollPos())-t;0!==n&&(u=0<n?"FORWARD":i),u===i&&e.reverse(),e.forEach(function(e,t){e.update(!0)})}},S=function(){n=R.rAF(y)},b=function(e){"resize"==e.type&&(h=m(),u=t),!0!==c&&(c=!0,S())},E=function(){if(!d&&h!=m()){var t;try{t=new Event("resize",{bubbles:!1,cancelable:!1})}catch(e){(t=document.createEvent("Event")).initEvent("resize",!1,!1)}a.container.dispatchEvent(t)}l.forEach(function(e,t){e.refresh()}),g()};this._options=a;var x=function(e){if(e.length<=1)return e;var t=e.slice(0);return t.sort(function(e,t){return e.scrollOffset()>t.scrollOffset()?1:-1}),t};return this.addScene=function(e){if(R.type.Array(e))e.forEach(function(e,t){s.addScene(e)});else if(e instanceof _.Scene)if(e.controller()!==s)e.addTo(s);else if(l.indexOf(e)<0)for(var t in l.push(e),l=x(l),e.on("shift.controller_sort",function(){l=x(l)}),a.globalSceneOptions)e[t]&&e[t].call(e,a.globalSceneOptions[t]);return s},this.removeScene=function(e){if(R.type.Array(e))e.forEach(function(e,t){s.removeScene(e)});else{var t=l.indexOf(e);-1<t&&(e.off("shift.controller_sort"),l.splice(t,1),e.remove())}return s},this.updateScene=function(e,n){return R.type.Array(e)?e.forEach(function(e,t){s.updateScene(e,n)}):n?e.update(!0):!0!==c&&e instanceof _.Scene&&(-1==(c=c||[]).indexOf(e)&&c.push(e),c=x(c),S()),s},this.update=function(e){return b({type:"resize"}),e&&y(),s},this.scrollTo=function(e,t){if(R.type.Number(e))w.call(a.container,e,t);else if(e instanceof _.Scene)e.controller()===s&&s.scrollTo(e.scrollOffset(),t);else if(R.type.Function(e))w=e;else{var n=R.get.elements(e)[0];if(n){for(;n.parentNode.hasAttribute(P);)n=n.parentNode;var r=a.vertical?"top":"left",i=R.get.offset(a.container),o=R.get.offset(n);d||(i[r]-=s.scrollPos()),s.scrollTo(o[r]-i[r],t)}}return s},this.scrollPos=function(e){return arguments.length?(R.type.Function(e)&&(v=e),s):v.call(s)},this.info=function(e){var t={size:h,vertical:a.vertical,scrollPos:f,scrollDirection:u,container:a.container,isDocument:d};return arguments.length?void 0!==t[e]?t[e]:void 0:t},this.loglevel=function(e){return s},this.enabled=function(e){return arguments.length?(p!=e&&(p=!!e,s.updateScene(l,!0)),s):p},this.destroy=function(e){window.clearTimeout(r);for(var t=l.length;t--;)l[t].destroy(e);return a.container.removeEventListener("resize",b),a.container.removeEventListener("scroll",b),R.cAF(n),null},function(){for(var e in a)o.hasOwnProperty(e)||delete a[e];if(a.container=R.get.elements(a.container)[0],!a.container)throw"ScrollMagic.Controller init failed.";(d=a.container===window||a.container===document.body||!document.body.contains(a.container))&&(a.container=window),h=m(),a.container.addEventListener("resize",b),a.container.addEventListener("scroll",b);var t=parseInt(a.refreshInterval,10);a.refreshInterval=R.type.Number(t)?t:o.refreshInterval,g()}(),s};var z={defaults:{container:window,vertical:!0,globalSceneOptions:{},loglevel:2,refreshInterval:100}};_.Controller.addOption=function(e,t){z.defaults[e]=t},_.Controller.extend=function(e){var t=this;_.Controller=function(){return t.apply(this,arguments),this.$super=R.extend({},this),e.apply(this,arguments)||this},R.extend(_.Controller,t),_.Controller.prototype=t.prototype,_.Controller.prototype.constructor=_.Controller},_.Scene=function(e){var n,l,c="BEFORE",f="DURING",u="AFTER",r=D.defaults,d=this,h=R.extend({},r,e),p=c,g=0,a={start:0,end:0},v=0,i=!0,s={};this.on=function(e,i){return R.type.Function(i)&&(e=e.trim().split(" ")).forEach(function(e){var t=e.split("."),n=t[0],r=t[1];"*"!=n&&(s[n]||(s[n]=[]),s[n].push({namespace:r||"",callback:i}))}),d},this.off=function(e,o){return e&&(e=e.trim().split(" ")).forEach(function(e,t){var n=e.split("."),r=n[0],i=n[1]||"";("*"===r?Object.keys(s):[r]).forEach(function(e){for(var t=s[e]||[],n=t.length;n--;){var r=t[n];!r||i!==r.namespace&&"*"!==i||o&&o!=r.callback||t.splice(n,1)}t.length||delete s[e]})}),d},this.trigger=function(e,n){if(e){var t=e.trim().split("."),r=t[0],i=t[1],o=s[r];o&&o.forEach(function(e,t){i&&i!==e.namespace||e.callback.call(d,new _.Event(r,e.namespace,d,n))})}return d},d.on("change.internal",function(e){"loglevel"!==e.what&&"tweenChanges"!==e.what&&("triggerElement"===e.what?y():"reverse"===e.what&&d.update())}).on("shift.internal",function(e){t(),d.update()}),this.addTo=function(e){return e instanceof _.Controller&&l!=e&&(l&&l.removeScene(d),l=e,E(),o(!0),y(!0),t(),l.info("container").addEventListener("resize",S),e.addScene(d),d.trigger("add",{controller:l}),d.update()),d},this.enabled=function(e){return arguments.length?(i!=e&&(i=!!e,d.update(!0)),d):i},this.remove=function(){if(l){l.info("container").removeEventListener("resize",S);var e=l;l=void 0,e.removeScene(d),d.trigger("remove")}return d},this.destroy=function(e){return d.trigger("destroy",{reset:e}),d.remove(),d.off("*.*"),null},this.update=function(e){if(l)if(e)if(l.enabled()&&i){var t,n=l.info("scrollPos");t=0<h.duration?(n-a.start)/(a.end-a.start):n>=a.start?1:0,d.trigger("update",{startPos:a.start,endPos:a.end,scrollPos:n}),d.progress(t)}else m&&p===f&&C(!0);else l.updateScene(d,!1);return d},this.refresh=function(){return o(),y(),d},this.progress=function(e){if(arguments.length){var t=!1,n=p,r=l?l.info("scrollDirection"):"PAUSED",i=h.reverse||g<=e;if(0===h.duration?(t=g!=e,p=0===(g=e<1&&i?0:1)?c:f):e<0&&p!==c&&i?(p=c,t=!(g=0)):0<=e&&e<1&&i?(g=e,p=f,t=!0):1<=e&&p!==u?(g=1,p=u,t=!0):p!==f||i||C(),t){var o={progress:g,state:p,scrollDirection:r},s=p!=n,a=function(e){d.trigger(e,o)};s&&n!==f&&(a("enter"),a(n===c?"start":"end")),a("progress"),s&&p!==f&&(a(p===c?"start":"end"),a("leave"))}return d}return g};var m,w,t=function(){a={start:v+h.offset},l&&h.triggerElement&&(a.start-=l.info("size")*h.triggerHook),a.end=a.start+h.duration},o=function(e){if(n){var t="duration";x(t,n.call(d))&&!e&&(d.trigger("change",{what:t,newval:h[t]}),d.trigger("shift",{reason:t}))}},y=function(e){var t=0,n=h.triggerElement;if(l&&(n||0<v)){if(n)if(n.parentNode){for(var r=l.info(),i=R.get.offset(r.container),o=r.vertical?"top":"left";n.parentNode.hasAttribute(P);)n=n.parentNode;var s=R.get.offset(n);r.isDocument||(i[o]-=l.scrollPos()),t=s[o]-i[o]}else d.triggerElement(void 0);var a=t!=v;v=t,a&&!e&&d.trigger("shift",{reason:"triggerElementPosition"})}},S=function(e){0<h.triggerHook&&d.trigger("shift",{reason:"containerResize"})},b=R.extend(D.validate,{duration:function(t){if(R.type.String(t)&&t.match(/^(\.|\d)*\d+%$/)){var e=parseFloat(t)/100;t=function(){return l?l.info("size")*e:0}}if(R.type.Function(t)){n=t;try{t=parseFloat(n.call(d))}catch(e){t=-1}}if(t=parseFloat(t),!R.type.Number(t)||t<0)throw n&&(n=void 0),0;return t}}),E=function(e){(e=arguments.length?[e]:Object.keys(b)).forEach(function(t,e){var n;if(b[t])try{n=b[t](h[t])}catch(e){n=r[t]}finally{h[t]=n}})},x=function(e,t){var n=!1,r=h[e];return h[e]!=t&&(h[e]=t,E(e),n=r!=h[e]),n},z=function(t){d[t]||(d[t]=function(e){return arguments.length?("duration"===t&&(n=void 0),x(t,e)&&(d.trigger("change",{what:t,newval:h[t]}),-1<D.shifts.indexOf(t)&&d.trigger("shift",{reason:t})),d):h[t]})};this.controller=function(){return l},this.state=function(){return p},this.scrollOffset=function(){return a.start},this.triggerPosition=function(){var e=h.offset;return l&&(h.triggerElement?e+=v:e+=l.info("size")*d.triggerHook()),e},d.on("shift.internal",function(e){var t="duration"===e.reason;(p===u&&t||p===f&&0===h.duration)&&C(),t&&F()}).on("progress.internal",function(e){C()}).on("add.internal",function(e){F()}).on("destroy.internal",function(e){d.removePin(e.reset)});var C=function(e){if(m&&l){var t=l.info(),n=w.spacer.firstChild;if(e||p!==f){var r={position:w.inFlow?"relative":"absolute",top:0,left:0},i=R.css(n,"position")!=r.position;w.pushFollowers?0<h.duration&&(p===u&&0===parseFloat(R.css(w.spacer,"padding-top"))?i=!0:p===c&&0===parseFloat(R.css(w.spacer,"padding-bottom"))&&(i=!0)):r[t.vertical?"top":"left"]=h.duration*g,R.css(n,r),i&&F()}else{"fixed"!=R.css(n,"position")&&(R.css(n,{position:"fixed"}),F());var o=R.get.offset(w.spacer,!0),s=h.reverse||0===h.duration?t.scrollPos-a.start:Math.round(g*h.duration*10)/10;o[t.vertical?"top":"left"]+=s,R.css(w.spacer.firstChild,{top:o.top,left:o.left})}}},F=function(){if(m&&l&&w.inFlow){var e=p===f,t=l.info("vertical"),n=w.spacer.firstChild,r=R.isMarginCollapseType(R.css(w.spacer,"display")),i={};w.relSize.width||w.relSize.autoFullWidth?e?R.css(m,{width:R.get.width(w.spacer)}):R.css(m,{width:"100%"}):(i["min-width"]=R.get.width(t?m:n,!0,!0),i.width=e?i["min-width"]:"auto"),w.relSize.height?e?R.css(m,{height:R.get.height(w.spacer)-(w.pushFollowers?h.duration:0)}):R.css(m,{height:"100%"}):(i["min-height"]=R.get.height(t?n:m,!0,!r),i.height=e?i["min-height"]:"auto"),w.pushFollowers&&(i["padding"+(t?"Top":"Left")]=h.duration*g,i["padding"+(t?"Bottom":"Right")]=h.duration*(1-g)),R.css(w.spacer,i)}},L=function(){l&&m&&p===f&&!l.info("isDocument")&&C()},T=function(){l&&m&&p===f&&((w.relSize.width||w.relSize.autoFullWidth)&&R.get.width(window)!=R.get.width(w.spacer.parentNode)||w.relSize.height&&R.get.height(window)!=R.get.height(w.spacer.parentNode))&&F()},A=function(e){l&&m&&p===f&&!l.info("isDocument")&&(e.preventDefault(),l._setScrollPos(l.info("scrollPos")-((e.wheelDelta||e[l.info("vertical")?"wheelDeltaY":"wheelDeltaX"])/3||30*-e.detail)))};this.setPin=function(e,t){if(t=R.extend({},{pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"},t),!(e=R.get.elements(e)[0]))return d;if("fixed"===R.css(e,"position"))return d;if(m){if(m===e)return d;d.removePin()}var n=(m=e).parentNode.style.display,r=["top","left","bottom","right","margin","marginLeft","marginRight","marginTop","marginBottom"];m.parentNode.style.display="none";var i="absolute"!=R.css(m,"position"),o=R.css(m,r.concat(["display"])),s=R.css(m,["width","height"]);m.parentNode.style.display=n,!i&&t.pushFollowers&&(t.pushFollowers=!1);var a=m.parentNode.insertBefore(document.createElement("div"),m),l=R.extend(o,{position:i?"relative":"absolute",boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"});if(i||R.extend(l,R.css(m,["width","height"])),R.css(a,l),a.setAttribute(P,""),R.addClass(a,t.spacerClass),w={spacer:a,relSize:{width:"%"===s.width.slice(-1),height:"%"===s.height.slice(-1),autoFullWidth:"auto"===s.width&&i&&R.isMarginCollapseType(o.display)},pushFollowers:t.pushFollowers,inFlow:i},!m.___origStyle){m.___origStyle={};var c=m.style;r.concat(["width","height","position","boxSizing","mozBoxSizing","webkitBoxSizing"]).forEach(function(e){m.___origStyle[e]=c[e]||""})}return w.relSize.width&&R.css(a,{width:s.width}),w.relSize.height&&R.css(a,{height:s.height}),a.appendChild(m),R.css(m,{position:i?"relative":"absolute",margin:"auto",top:"auto",left:"auto",bottom:"auto",right:"auto"}),(w.relSize.width||w.relSize.autoFullWidth)&&R.css(m,{boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"}),window.addEventListener("scroll",L),window.addEventListener("resize",L),window.addEventListener("resize",T),m.addEventListener("mousewheel",A),m.addEventListener("DOMMouseScroll",A),C(),d},this.removePin=function(e){if(m){if(p===f&&C(!0),e||!l){var t=w.spacer.firstChild;if(t.hasAttribute(P)){var n=w.spacer.style,r={};["margin","marginLeft","marginRight","marginTop","marginBottom"].forEach(function(e){r[e]=n[e]||""}),R.css(t,r)}w.spacer.parentNode.insertBefore(t,w.spacer),w.spacer.parentNode.removeChild(w.spacer),m.parentNode.hasAttribute(P)||(R.css(m,m.___origStyle),delete m.___origStyle)}window.removeEventListener("scroll",L),window.removeEventListener("resize",L),window.removeEventListener("resize",T),m.removeEventListener("mousewheel",A),m.removeEventListener("DOMMouseScroll",A),m=void 0}return d};var N,O=[];return d.on("destroy.internal",function(e){d.removeClassToggle(e.reset)}),this.setClassToggle=function(e,t){var n=R.get.elements(e);return 0!==n.length&&R.type.String(t)&&(0<O.length&&d.removeClassToggle(),N=t,O=n,d.on("enter.internal_class leave.internal_class",function(e){var n="enter"===e.type?R.addClass:R.removeClass;O.forEach(function(e,t){n(e,N)})})),d},this.removeClassToggle=function(e){return e&&O.forEach(function(e,t){R.removeClass(e,N)}),d.off("start.internal_class end.internal_class"),N=void 0,O=[],d},function(){for(var e in h)r.hasOwnProperty(e)||delete h[e];for(var t in r)z(t);E()}(),d};var D={defaults:{duration:0,offset:0,triggerElement:void 0,triggerHook:.5,reverse:!0,loglevel:2},validate:{offset:function(e){if(e=parseFloat(e),!R.type.Number(e))throw 0;return e},triggerElement:function(e){if(e=e||void 0){var t=R.get.elements(e)[0];if(!t||!t.parentNode)throw 0;e=t}return e},triggerHook:function(e){var t={onCenter:.5,onEnter:1,onLeave:0};if(R.type.Number(e))e=Math.max(0,Math.min(parseFloat(e),1));else{if(!(e in t))throw 0;e=t[e]}return e},reverse:function(e){return!!e}},shifts:["duration","offset","triggerHook"]};_.Scene.addOption=function(e,t,n,r){e in D.defaults||(D.defaults[e]=t,D.validate[e]=n,r&&D.shifts.push(e))},_.Scene.extend=function(e){var t=this;_.Scene=function(){return t.apply(this,arguments),this.$super=R.extend({},this),e.apply(this,arguments)||this},R.extend(_.Scene,t),_.Scene.prototype=t.prototype,_.Scene.prototype.constructor=_.Scene},_.Event=function(e,t,n,r){for(var i in r=r||{})this[i]=r[i];return this.type=e,this.target=this.currentTarget=n,this.namespace=t||"",this.timeStamp=this.timestamp=Date.now(),this};var R=_._util=function(s){var n,e={},a=function(e){return parseFloat(e)||0},l=function(e){return e.currentStyle?e.currentStyle:s.getComputedStyle(e)},r=function(e,t,n,r){if((t=t===document?s:t)===s)r=!1;else if(!u.DomElement(t))return 0;e=e.charAt(0).toUpperCase()+e.substr(1).toLowerCase();var i=(n?t["offset"+e]||t["outer"+e]:t["client"+e]||t["inner"+e])||0;if(n&&r){var o=l(t);i+="Height"===e?a(o.marginTop)+a(o.marginBottom):a(o.marginLeft)+a(o.marginRight)}return i},c=function(e){return e.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})};e.extend=function(e){for(e=e||{},n=1;n<arguments.length;n++)if(arguments[n])for(var t in arguments[n])arguments[n].hasOwnProperty(t)&&(e[t]=arguments[n][t]);return e},e.isMarginCollapseType=function(e){return-1<["block","flex","list-item","table","-webkit-box"].indexOf(e)};var i=0,t=["ms","moz","webkit","o"],o=s.requestAnimationFrame,f=s.cancelAnimationFrame;for(n=0;!o&&n<4;++n)o=s[t[n]+"RequestAnimationFrame"],f=s[t[n]+"CancelAnimationFrame"]||s[t[n]+"CancelRequestAnimationFrame"];o||(o=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-i)),r=s.setTimeout(function(){e(t+n)},n);return i=t+n,r}),f||(f=function(e){s.clearTimeout(e)}),e.rAF=o.bind(s),e.cAF=f.bind(s);var u=e.type=function(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};u.String=function(e){return"string"===u(e)},u.Function=function(e){return"function"===u(e)},u.Array=function(e){return Array.isArray(e)},u.Number=function(e){return!u.Array(e)&&0<=e-parseFloat(e)+1},u.DomElement=function(e){return"object"==typeof HTMLElement||"function"==typeof HTMLElement?e instanceof HTMLElement||e instanceof SVGElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var d=e.get={};return d.elements=function(e){var t=[];if(u.String(e))try{e=document.querySelectorAll(e)}catch(e){return t}if("nodelist"===u(e)||u.Array(e)||e instanceof NodeList)for(var n=0,r=t.length=e.length;n<r;n++){var i=e[n];t[n]=u.DomElement(i)?i:d.elements(i)}else(u.DomElement(e)||e===document||e===s)&&(t=[e]);return t},d.scrollTop=function(e){return e&&"number"==typeof e.scrollTop?e.scrollTop:s.pageYOffset||0},d.scrollLeft=function(e){return e&&"number"==typeof e.scrollLeft?e.scrollLeft:s.pageXOffset||0},d.width=function(e,t,n){return r("width",e,t,n)},d.height=function(e,t,n){return r("height",e,t,n)},d.offset=function(e,t){var n={top:0,left:0};if(e&&e.getBoundingClientRect){var r=e.getBoundingClientRect();n.top=r.top,n.left=r.left,t||(n.top+=d.scrollTop(),n.left+=d.scrollLeft())}return n},e.addClass=function(e,t){t&&(e.classList?e.classList.add(t):e.className+=" "+t)},e.removeClass=function(e,t){t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))},e.css=function(e,t){if(u.String(t))return l(e)[c(t)];if(u.Array(t)){var n={},r=l(e);return t.forEach(function(e,t){n[e]=r[c(e)]}),n}for(var i in t){var o=t[i];o==parseFloat(o)&&(o+="px"),e.style[c(i)]=o}},e}(window||{});return _});
!function(e,n){var o;"function"==typeof define&&define.amd?define('AnimationPlugin',["ScrollMagic","gsap"],n):"object"==typeof exports?(o=require("gsap/dist/gsap")||require("gsap"),n(require("scrollmagic"),o,TweenMax||o,TimelineMax||o)):n(e.ScrollMagic||e.jQuery&&e.jQuery.ScrollMagic,e.gsap,e.gsap||e.TweenMax||e.TweenLite,e.gsap||e.TimelineMax||e.TimelineLite)}(this,function(e,n,h,v){"use strict";var o="animation.gsap",m=n&&3<=parseFloat((define.amd?n.gsap:n).version);define.amd&&(h=n.TweenLite);n=window.console||{},n=Function.prototype.bind.call(n.error||n.log||function(){},n);e||n("("+o+") -> ERROR: The ScrollMagic main module could not be found. Please make sure it's loaded before this plugin or use an asynchronous loader like requirejs."),h||n("("+o+") -> ERROR: TweenLite or TweenMax could not be found. Please make sure GSAP is loaded before ScrollMagic or use an asynchronous loader like requirejs."),e.Scene.addOption("tweenChanges",!1,function(e){return!!e}),e.Scene.extend(function(){function d(){f._log&&(Array.prototype.splice.call(arguments,1,0,"("+o+")","->"),f._log.apply(this,arguments))}var g,f=this;f.on("progress.plugin_gsap",function(){w()}),f.on("destroy.plugin_gsap",function(e){f.removeTween(e.reset)});var w=function(){var e,n;g&&(e=f.progress(),n=f.state(),g.repeat&&-1===g.repeat()?"DURING"===n&&g.paused()?g.play():"DURING"===n||g.paused()||g.pause():e!=g.progress()&&(0===f.duration()?0<e?g.play():g.reverse():f.tweenChanges()&&g.tweenTo?g.tweenTo(e*g.duration()):g.progress(e).pause()))};f.setTween=function(e,n,o){var t,r,i;1<arguments.length&&(r="number"==typeof arguments[1],m?(r||(o=n),o.hasOwnProperty("duration")||(o.duration=r?n:1)):arguments.length<3&&(o=n,n=1),e=m?h.to(e,o):h.to(e,n,o));try{(t=v&&!m?new v({smoothChildTiming:!0}).add(e):e).pause()}catch(e){return d(1,"ERROR calling method 'setTween()': Supplied argument is not a valid TweenObject"),f}if(g&&f.removeTween(),g=t,e.repeat&&-1===e.repeat()&&(g.repeat(-1),g.yoyo(e.yoyo())),f.tweenChanges()&&!g.tweenTo&&d(2,"WARNING: tweenChanges will only work if the TimelineMax object is available for ScrollMagic."),g&&f.controller()&&f.triggerElement()&&2<=f.loglevel()&&(o=h.getTweensOf(f.triggerElement()),i=f.controller().info("vertical"),o.forEach(function(e,n){e=e.vars.css||e.vars;if(i?void 0!==e.top||void 0!==e.bottom:void 0!==e.left||void 0!==e.right)return d(2,"WARNING: Tweening the position of the trigger element affects the scene timing and should be avoided!"),!1})),1.14<=parseFloat(TweenLite.version))for(var a,s,l=m?"onInterrupt":"onOverwrite",u=g.getChildren?g.getChildren(!0,!0,!1):[g],p=function(){d(2,"WARNING: tween was overwritten by another. To learn how to avoid this issue see here: https://github.com/janpaepke/ScrollMagic/wiki/WARNING:-tween-was-overwritten-by-another")},c=0;c<u.length;c++)a=u[c],s!==p&&(s=a.vars[l],a.vars[l]=function(){s&&s.apply(this,arguments),p.apply(this,arguments)});return d(3,"added tween"),w(),f},f.removeTween=function(e){return g&&(e&&g.progress(0).pause(),g.kill(),g=void 0,d(3,"removed tween (reset: "+(e?"true":"false")+")")),f}})});
define('AnimatedBackground',['jquery', 'gsap', 'ScrollMagic', 'AnimationPlugin', 'ANSI/Utility/Dimensions', 'ANSI/Utility/SitecoreUtils', 'promise-polyfill'], function (
    $,
    gsap,
    ScrollMagic,
    AnimationPlugin,
    dimensions,
    sitecoreUtils
) {
    var animations = {
        init: function () {
            if ($('.animated-background').length && dimensions.width > 991) {
                animations.backgroundScrollAnimation();
            }
        },
        backgroundScrollAnimation: function () {
            var ctrl = new ScrollMagic.Controller({});

            $('.animated-background').each(function () {
                new ScrollMagic.Scene({
                    triggerElement: this,
                    triggerHook: 0.5,
                    duration: dimensions.height * 1.5
                })
                    .setTween(this, 0.5, {
                        backgroundPosition: '100% 100%'
                    })
                    .addTo(ctrl);
            });
        }
    };
    if (!sitecoreUtils.prototype.isEditing()) Promise.resolve().then(animations.init);
});

define('ANSI/UIComponents/Tabsets',[
    'jquery',
    'StickyBits',
    'slick',
    'eventManager',
    'ANSI/Utility/SitecoreUtils',
    'ANSI/Utility/Dimensions'
], function ($, stickybits, slick, eventManager, sitecoreUtils, dimensions) {
    'use-strict';

    var tabSticky = function tabSticky() {
        var tabHorizontal = document.querySelector(
            '.page-wrapper .horizontal-tab-set'
        );
        var tabSection = tabHorizontal.querySelector('.nav-tabs-wrapper-outer');
        if ( dimensions.width > 767 ) {
            stickybits(tabSection, { stickyBitStickyOffset: 140 });
        } else {
            stickybits(tabSection, { stickyBitStickyOffset: 50 });
        }
    };
    var tabMobileSlider = function tabSlider() {
        var tab = $('.page-wrapper .score-tab')
            .not('.score-tab.horizontal-tab-set')
            .not('.score-tab.ans-overview-tab-set')
            .not('.score-tab.ans-overview-tab-set .score-tab')
            .not('.ansi-home-page .score-tab')
            .not('.news-events-slider.tab .score-tab');

        var tabContent = $(tab).find('.tab-content');
        var navTabs = $(tab).find('.nav-tabs');
        var settings = {
            draggable: true,
            infinite: false,
            slidesToShow: 2,
            slidesToScroll: 1,
            accessibility: true,
            centerMode: false,
            arrows: false,
            variableWidth: true,
            touchThreshold: 10,
            mobileFirst: true,
            asNavFor: tabContent,
            responsive: [
                {
                    breakpoint: 600,
                    settings: { slidesToShow: 3 }
                },
                {
                    breakpoint: 767,
                    settings: { slidesToShow: 4 }
                }
            ]
        };
        var contentSetting = {
            draggable: true,
            infinite: false,
            slidesToShow: 1,
            slidesToScroll: 1,
            accessibility: true,
            centerMode: false,
            arrows: false,
            variableWidth: false,
            touchThreshold: 10,
            asNavFor: navTabs
        };

        if ( dimensions.width < 601 ) {
            $(tab).addClass('slider');
            navTabs.slick(settings);
            tabContent.slick(contentSetting);
        }
    };

    if ( !sitecoreUtils.prototype.isEditing() ) {
        eventManager.subscribe('ModulesLoadedEvent', function () {
            if ( document.querySelector('.horizontal-tab-set') ) {
                Promise.resolve().then(tabSticky);
            }
            if ( document.querySelector('.page-wrapper .score-tab') ) {
                Promise.resolve().then(tabMobileSlider);
            }
        });
    }
});

define('ANSI/UIComponents/Popovers',['jquery', 'eventManager', 'ANSI/Utility/SitecoreUtils'], function ($, eventManager, sitecoreUtils) {
    'use-strict';

    var popovers = {
        init: function () {
            eventManager.subscribe('ModulesLoadedEvent', function () {
                $('[data-toggle="popover"]').popover();
            });

            $(document).on("click", function (e) {
                if ($(e.target).data('toggle') !== 'popover' && $(e.target).parents('.popover.in').length === 0) {
                    $('[data-toggle="popover"]').popover('hide');
                }
            });

            if ($('.tooltip-hero').length > 0) {
                popovers.tooltipHero();
            }
        },
        tooltipHero: function () {
            var btn = $('.tooltip-hero .btn.btn-link');
            $('.tooltip-hero').append(btn);
        }
    };

    if (!sitecoreUtils.prototype.isEditing()) {
        Promise.resolve().then(popovers.init);
    }
});

define( 'ANSI/UIComponents/ReadMore',[ 'jquery', 'eventManager', 'ANSI/Utility/SitecoreUtils' ], function (
    $,
    eventManager,
    sitecoreUtils
) {
    'use-strict';

    var readmore = {
        init: function () {
            eventManager.subscribe( 'SearchResultsLoadedEvent', function () {
                $( '.member-updates-page .js-read-more' )
                    .off( 'click' )
                    .on( 'click', function ( e ) {
                        e.preventDefault();

                        if ( $( this ).siblings( '.read' ).hasClass( 'read-less' ) ) {
                            $( '.read' ).addClass( 'read-less' );
                            $( '.js-read-more' ).text( 'Read More' );
                            $( this ).siblings( '.read' ).removeClass( 'read-less' );
                            $( this ).text( 'Read Less' );

                        } else {
                            $( this ).siblings( '.read' ).addClass( 'read-less' );
                            $( this ).text( 'Read More' );
                        }

                    } );
            } );
        },
    };

    if ( !sitecoreUtils.prototype.isEditing() )
        Promise.resolve().then( readmore.init );
} );
define( 'ANSI/UIComponents/Buttons',[ 'jquery', 'ANSI/Utility/SitecoreUtils' ], function ( $, sitecoreUtils ) {
    'use-strict';

    var ansiScrollButton = function ansiScrollButton() {
        var scrollBtn = document.querySelector( '.ansi-scroll-button' );
        scrollBtn.addEventListener( 'click', function ( e ) {
            e.preventDefault();
            var btnOffset = offset( scrollBtn );
            window.scroll( {
                top: btnOffset.top - 68,
                behavior: 'smooth'
            } );
        } );
    };
    var offset = function offset( el ) {
        var rect = el.getBoundingClientRect(),
            scrollLeft = window.pageXOffset || document.documentElement.scrollLeft,
            scrollTop = window.pageYOffset || document.documentElement.scrollTop;
        return { top: rect.top + scrollTop, left: rect.left + scrollLeft };
    };

    var backBtn = function backBtn() {
        var btn = document.querySelector( '.js-back' );
        btn.addEventListener( 'click', function ( e ) {
            e.preventDefault();
            window.history.back();
        } );
    };

    if ( !sitecoreUtils.prototype.isEditing() ) {
        if ( $( '.ansi-scroll-button' ).length > 0 ) {
            Promise.resolve().then( ansiScrollButton );
        }
        if ( $( '.js-back' ).length > 0 ) {
            Promise.resolve().then( backBtn );
        }
    }
} );;
define('ANSI/Utility/EllipsisMaker',['jquery', 'eventManager', 'ANSI/Utility/SitecoreUtils'], function ($, eventManager, sitecoreUtils) {
    'use-strict';
    function EllipsisMaker() {}

    EllipsisMaker.prototype = {
        init: function () {
            // call updateItems with (number of lines , element)
            eventManager.subscribe('ModulesLoadedEvent', function () {
                if ($('.pagination-buttons').length > 0) {
                    EllipsisMaker.prototype.updateItems(2, $('.overlay h4'));
                }
            });
        },
        getLineHeight: function (el) {
            var lineHeight = window.getComputedStyle(el)['line-height'];
            return lineHeight === 'normal' ? 1.16 * parseFloat(window.getComputedStyle(element)['font-size']) : parseFloat(lineHeight);
        },
        updateItems: function (lines, el) {
            var el = $(el);
            $(el).each(function (i, item) {
                var $item = $(item);
                $item.attr('data-text-content', item.textContent);
                $item.attr('data-line-height', EllipsisMaker.prototype.getLineHeight(item));
                EllipsisMaker.prototype.doEllipsis(lines, item);
            });
        },
        doEllipsis: function (lines, el) {
            var $element = $(el),
                inner = document.createElement('SPAN'),
                text = $element.attr('data-text-content'),
                lineHeight = $element.attr('data-line-height'),
                maxHeight = lines * lineHeight,
                textParts = text.split(' ');

            if (!text) return;

            el.innerHTML = '';
            el.style.height = 'auto';
            el.style.maxHeight = maxHeight + 'px';
            el.appendChild(inner);
            inner.innerHTML = text;
            inner.style.display = 'block';

            if (inner.clientHeight < maxHeight) return;

            while (inner.clientHeight > maxHeight) {
                textParts.pop();
                inner.innerHTML = textParts.join(' ') + '...';
            }
        }
    };
    if (!sitecoreUtils.prototype.isEditing()) Promise.resolve().then(EllipsisMaker.prototype.init);
});

define('main',[
    'score_ccf/ModuleLoader',
    'scorebootstrap',
    'Frontend',
    'IEBugFixes',
    'Accordions',
    'Header',
    'Footer',
    'Search',
    'ScrollBarWidth',
    'SliderPanel',
    'VerticalSlider',
    'StickyNav',
    'AnimatedBackground',
    'ANSI/UIComponents/Tabsets',
    'ANSI/UIComponents/Popovers',
    'ANSI/UIComponents/ReadMore',
    'ANSI/UIComponents/Buttons',
    'ANSI/Utility/EllipsisMaker',
    'promise-polyfill',
    'jqueryMigrate'
], function (moduleLoader, scorebootstrap, frontend) {
    'use strict';

    /**************************************************************************************************************
         Do not add misc code here only use main.js to initialize modules, all misc code that is global
         can be added to front-end.js, preload will init before all ux modules load and postload after all pending
         modules load. Otherwise please make new js module.
         **************************************************************************************************************/

    // init SCORE Bootstrap components (Tabsets, Accordeons, Carousels, etc.)

    scorebootstrap.init();
    Promise.resolve().then(frontend.preload);
    Promise.resolve().then(frontend.postload);

    moduleLoader.loadPendingModules().done(function () {
        try {
            window.ANSILoadGTM();
        } catch (e) {
            console.log("window.ANSILoadGTM() was not found.");
        }
    });

});

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Accordion',["jquery", "eventManager", 'loglevel', "cssEscape"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel'), require("cssEscape")) :
    console && console.error('Accordion does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function Accordion(scope, stateChangeMessages) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });

        //#region message transmitter registration
        if (stateChangeMessages.length) {
            this.$scope.on("shown.bs.collapse hidden.bs.collapse", function () {

                stateChangeMessages.forEach(function (eventName) {
                    log.debug("Accordion raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return false;
            });
        }
        //#endregion

        this._setupDeepLinking();
    }

    Accordion.prototype._setupDeepLinking = function () {
        var that = this;
        // make accordion panel with anchors change the URL to make them sticky
        this.$scope.on('shown.bs.collapse',
            function (e) {
                var anchor = '';
                var oldHash = window.location.hash.substring(1);

                var anchorLink = $(e.target).closest('.panel').find('a[data-toggle="collapse"][href*="#collapse-"][data-anchorable="True"]');
                if (anchorLink.length) {
                    anchor = anchorLink.attr("href").replace("#collapse-", "");
                }

                if (anchor) {
                    window.history && window.history.pushState && window.history.pushState(null, null, '#' + anchor);
                    window.location.hash = anchor;
                } else {
                    // if we open a panel without deep linking, we should release previously selected anchorable panel.
                    if (oldHash && $(e.target).closest('.panel-group').find('a[data-toggle="collapse"][href*="#' + CSS.escape('collapse-' + oldHash) + '"][data-anchorable="True"]').length) {
                        // clear hash without page jump in modern browsers
                        window.history && window.history.pushState && window.history.pushState(null, null, '');
                        window.location.hash = '';
                    }
                    // otherwise we don't care.
                }
            });

        // make all tabs with anchors to be visible when we walk along the browser history
        $(window).on("hashchange", function () {
            if (!window.location.hash) return !1;
            
            // find a tab which should be activated within current tabset. otherwise keep tabset without any changes.
            var panel = that.$scope.find('a[href="#' + CSS.escape('collapse-' + window.location.hash.substring(1)) + '"]');
            if (panel.length) {
                panel.trigger("click");
            }
        });
    }


    Accordion.init = function init(args) {
        return args.IsEditorEditing === true ? null : new Accordion(args.scope, args.StateChangeMessagesTransmitting || []);
    };

    return Accordion;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/AccordionPanel',["jquery", "eventManager"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('AccordionPanel does not support non-amd script loading.');
}(this/* window */, function ($, eventManager) {
    function AccordionPanel(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {
        ///<summary>Initialize a new instance of AccordionPanel. Subscribe to messages which are passed to current instance.</summary>

        var self = this;
        Object.defineProperty(this, "scope", { enumerable: true, value: scope });
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });

        //#region state change message transmitter registration
        if (stateChangeMessages.length) {
            this.$scope.find('.collapse').on("shown.bs.collapse hidden.bs.collapse", function () {
                stateChangeMessages.forEach(function (eventName) {
                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion

        //#region show messages performer
        if (onShowMessagesPerformer.length) {
            onShowMessagesPerformer.forEach(function(messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });
        }
        //#endregion

        //#region hide mesage performer
        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        }
        //#endregion

        this.$scope.find('.collapse').on('shown.bs.collapse', this._onPanelShowHandler.bind(this));
        this.$scope.find('.collapse').on('hidden.bs.collapse', this._onPanelHideHandler.bind(this));
    }

    AccordionPanel.prototype._onPanelShowHandler = function (e) {
        $(this).trigger('focus', [this, e]);
    }

    AccordionPanel.prototype._onPanelHideHandler = function (e) {
        $(this).trigger('blur', [this, e]);
    }

    /**
     * Unfold current accordion panel
     */
    AccordionPanel.prototype.show = function () {
        this.$scope.find('.collapse').collapse('show');
    }

    /**
     * Fold current accordion panel
     */
    AccordionPanel.prototype.hide = function () {
        this.$scope.find('.collapse').collapse('hide');
    }

    AccordionPanel.init = function init(args) {
        if (args.IsEditorEditing) return null;

        var accordion = new AccordionPanel(args.scope,
            args.StateChangeMessagesTransmitting || [],
            args.ShowActionMessages || [],
            args.HideActionMessages || []);

        return accordion;
    };

    return AccordionPanel;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/BackToTop',["jquery", "eventManager"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('Back To Top does not support non-amd script loading.');
}(this/* window */, function ($, eventManager) {
    function BackToTop(scope, clickMessagesTransmitting, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer, animationDuration, showOnScroll, showOnScrollOffset) {
        ///<summary>Initialize a new instance of Back To Top. Subscribe to messages which are passed to current instance.</summary>

        var self = this;
        
        Object.defineProperties(this, {
            scope: { enumerable: true, value: scope },
            $scope: { enumerable: true, value: $(scope) },
            stateChangeMessages: { enumerable: true, value: stateChangeMessages.slice() }
        });

        BackToTop.prototype.scroll = function () {
            var scrollTop = $(window).scrollTop();
            if (scrollTop > showOnScrollOffset) {
                this.$scope.show();
            } else {
                this.$scope.hide();
            }
        };

        if (showOnScroll) {
            this.scroll();

            $(window).on('scroll', function () {
                self.scroll();
            });
        }
      
        this.$scope.on("click", function (e) { 
            e.preventDefault();
            $('html,body').animate({
                scrollTop: 0
            }, animationDuration);
        });

        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", function (e) {
                e.preventDefault();
                clickMessagesTransmitting.forEach(function (ev) {
                    eventManager.trigger(ev, self);
                });

                return !1;
            }).on('keyup', function (e) {
                // catch enter key only
                if (e.keyCode === 13) {
                    e.preventDefault();
                    clickMessagesTransmitting.forEach(function (ev) {
                        eventManager.trigger(ev, self);
                    });

                    return !1;
                }
            });
        }
        //#endregion

        //#region show messages performer
        if (onShowMessagesPerformer.length) {
            onShowMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });

        }
        //#endregion


        //#region hide mesage performer
        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        }
        //#endregion

        this.$scope.on('focus', this._onFocusHandler.bind(this));
        this.$scope.on('blur', this._onBlurHandler.bind(this));
    }

    BackToTop.prototype._onFocusHandler = function (e) {
        $(this).trigger('focus', [this, e]);
    }

    BackToTop.prototype._onBlurHandler = function (e) {
        $(this).trigger('blur', [this, e]);
    }

    BackToTop.prototype.show = function () {
        ///<summary>Make panel visible with jQuery.show() method.</summary>
        this.$scope.show();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    BackToTop.prototype.hide = function () {
        ///<summary>Make panel hidden with jQuery.hide() method.</summary>
        this.$scope.hide();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    BackToTop.init = function init(args) {
        if (args.IsEditorEditing) return null;

        var button = new BackToTop(args.scope,
            args.ClickMessagesTransmitting || [],
            args.StateChangeMessagesTransmitting || [],
            args.ShowActionMessages || [],
            args.HideActionMessages || [],
            args.AnimationDuration || 1000,
            args.ShowOnScroll,
            args.ShowOnScrollOffset || 100);

        return button;
    };

    return BackToTop;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/BasicMenuItem',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('BasicMenuItem does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {
    function BasicMenuItem(scope, clickMessagesTransmitting) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });


        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", "a", function (e) {
                e.preventDefault();

                clickMessagesTransmitting.forEach(function (eventName) {
                    log.debug("BasicMenuItem raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion
    }

    BasicMenuItem.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new BasicMenuItem(args.scope,
                                args.ClickMessagesTransmitting || []);
    };

    return BasicMenuItem;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/BrightcoveVideo',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('BrightcoveVideo does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function BrightcoveVideo(scope, stateChangeMessages, onPlayMessagesPerformer, onPauseMessagePerformer, id, allowFullScreen, showCaptioning) {
        ///<summary>Initialize a new instance of YoutubeVideo. Subscribe to messages which are passed to current instance.</summary>

        var self = this, instance = {};
        instance.stateChangeMessages = stateChangeMessages.slice();
        
        Object.defineProperties(this, {
            $scope: { enumerable: true, value: $(scope) },
            stateChangeMessages: {
                enumerable: true,
                get: function () {
                    return instance.stateChangeMessages.slice();
                }
            },
            player: { enumerable: false, value: videojs(id) },
            isInteractedWithUser: { enumerable: true, configurable: true, writable: true, value: false }
        });

        this.addStateChangeMessage = function addStateChangeMessage(message) {
            if (!message) return;
            if (instance.stateChangeMessages.indexOf(message) > -1) {
                log.debug("Component is already registered for event " + message);
                return;
            }
            
            instance.stateChangeMessages.push(String(message));
        };

        //#region play message performer
        if (onPlayMessagesPerformer.length) {
            onPlayMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.play, self);
            });
        }
        //#endregion

        //#region show messages performer
        if (onPauseMessagePerformer.length) {
            onPauseMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.pause, self);
            });
        }
        //#endregion

        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }

        if (!allowFullScreen) {
            self.$scope.find('.vjs-fullscreen-control').hide();
        }

        if (showCaptioning) {
            this.player.on("loadedmetadata", this._onLoadedMetadataHandler.bind(this));
        }

        this.player.on("play", this._onPlayHandler.bind(this));
        this.player.on("pause", this._onPauseHandler.bind(this));
    }

    BrightcoveVideo.prototype._onPlayHandler = function (e) {
        this.isInteractedWithUser = true;
    }

    BrightcoveVideo.prototype._onPauseHandler = function (e) {
        this.isInteractedWithUser = true;
    }

    BrightcoveVideo.prototype._onLoadedMetadataHandler = function () {
        // Get the browser language 
        var browserLanguage = navigator.language || navigator.userLanguage; // IE <= 10;
        browserLanguage = browserLanguage.substr(0, 2);
        // Get the captions
        var trackLanguage;
        var tracks = this.player.textTracks();

        for (var i = 0; i < (tracks.length); i++) {
            trackLanguage = tracks[i].language.substr(0, 2);
            // Set the default caption language
            // When the caption language equals the browser language, then set it as default 
            if (trackLanguage) {
                if (trackLanguage === browserLanguage) {
                    tracks[i].mode = "showing";
                    return;
                } else {
                    tracks[i].mode = "disabled";
                }
            }
        }
    }

    BrightcoveVideo.prototype.play = function () {
        ///<summary>Start playing the video.</summary>

        if (this.isInteractedWithUser) {
            this.player.muted(false);
            this.player.volume(1.0);
        }

        this.player.play();

        this.transmitStateChange();
    }

    BrightcoveVideo.prototype.pause = function () {
        ///<summary>Put the video on pause.</summary>

        this.player.pause();

        this.transmitStateChange();
    }

    BrightcoveVideo.prototype.transmitStateChange = function () {
        var messages = this.stateChangeMessages, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self, self.player);
            });
        }

    }
    // #endregion

    BrightcoveVideo.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new BrightcoveVideo(args.scope,
                                  args.StateChangeMessagesTransmitting || [],
                                  args.PlayActionMessages || [],
                                  args.PauseActionMessages || [],
                                  args.Id,
                                  args.AllowFullScreen,
                                  args.ShowCaptioning);
    };

    return BrightcoveVideo;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Button',["jquery", "eventManager"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('Button does not support non-amd script loading.');
}(this/* window */, function ($, eventManager) {
    function Button(scope, clickMessagesTransmitting, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {
        ///<summary>Initialize a new instance of Button. Subscribe to messages which are passed to current instance.</summary>

        var self = this;
        Object.defineProperties(this, {
            scope: { enumerable: true, value: scope },
            $scope: { enumerable: true, value: $(scope) },
            stateChangeMessages: { enumerable: true, value: stateChangeMessages.slice() }
        });

        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", function (e) {
                e.preventDefault();
                clickMessagesTransmitting.forEach(function (ev) {
                    eventManager.trigger(ev, self);
                });

                return !1;
            }).on('keyup', function (e) {
                // catch enter key only
                if (e.keyCode === 13) {
                    e.preventDefault();
                    clickMessagesTransmitting.forEach(function (ev) {
                        eventManager.trigger(ev, self);
                    });

                    return !1;
                }
            });
        }
        //#endregion

        //#region show messages performer
        if (onShowMessagesPerformer.length) {
            onShowMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });

        }
        //#endregion


        //#region hide mesage performer
        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        }
        //#endregion

        this.$scope.on('focus', this._onFocusHandler.bind(this));
        this.$scope.on('blur', this._onBlurHandler.bind(this));
    }

    Button.prototype._onFocusHandler = function(e) {
        $(this).trigger('focus', [this, e]);
    }

    Button.prototype._onBlurHandler = function(e) {
        $(this).trigger('blur', [this, e]);
    }

    Button.prototype.show = function () {
        ///<summary>Make panel visible with jQuery.show() method.</summary>
        this.$scope.show();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Button.prototype.hide = function () {
        ///<summary>Make panel hidden with jQuery.hide() method.</summary>
        this.$scope.hide();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Button.init = function init(args) {
        if (args.IsEditorEditing) return null;

        var button = new Button(args.scope,
            args.ClickMessagesTransmitting || [],
            args.StateChangeMessagesTransmitting || [],
            args.ShowActionMessages || [],
            args.HideActionMessages || []);

        return button;
    };

    return Button;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/ButtonMenuItem',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('ButtonMenuItem does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function ButtonMenuItem(scope, clickMessagesTransmitting) {
        var self = this;
        Object.defineProperty(this, "scope", { enumerable: true, value: scope });
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });
        Object.defineProperty(this, 'clickMessagesTransmitting', { enumerable: true, value: clickMessagesTransmitting });

        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", "a", function (e) {
                e.preventDefault();

                clickMessagesTransmitting.forEach(function (eventName) {
                    log.debug("ButtonMenuItem raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            }).on('keyup', 'a', function (e) {
                // catch enter key only
                if (e.keyCode === 13) {
                    e.preventDefault();
                    clickMessagesTransmitting.forEach(function (eventName) {
                        log.debug("ButtonMenuItem raises message: \'%s\'", eventName);

                        eventManager.trigger(eventName, self);
                    });

                    return !1;
                }
            });
        }
        //#endregion

        this.$scope.on('focus', 'a', this._onFocusHandler.bind(this));
        this.$scope.on('blur', 'a', this._onBlurHandler.bind(this));
    }

    ButtonMenuItem.prototype._onFocusHandler = function (e) {
        $(this).trigger('focus', [this, e]);
    }

    ButtonMenuItem.prototype._onBlurHandler = function (e) {
        $(this).trigger('blur', [this, e]);
    }

    ButtonMenuItem.init = function init(args) {
        if (args.IsEditorEditing) return null;

        var buttonMenuItem = new ButtonMenuItem(args.scope, args.ClickMessagesTransmitting || []);

        return buttonMenuItem;
    };

    return ButtonMenuItem;
}));
; (function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Carousel',["jquery", "eventManager"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('Carousel does not support non-amd script loading.');
}(this/* window */, function ($, eventManager) {

    function Carousel(scope, carouselId) {
        var self = this;
        Object.defineProperty(this, "scope", { enumerable: true, value: scope, writable: !1 });
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope), writable: !1 });
        Object.defineProperty(this, 'lastDirection', { enumerable: !1, value: void 0, writable: !0 });

        self.buildIndicator(carouselId);
        self.fallbackIndicators(carouselId);

        this.$scope.on('slide.bs.carousel', this._onBeforeChangeSlide.bind(this));
        this.$scope.on('slid.bs.carousel', this._onAfterChangeSlide.bind(this));
    }


    Carousel.prototype.buildIndicator = function (carouselId) {
        var slides = $('.carousel-inner .item', this.$scope).map(function (i) {
            return "<li data-target=\"#" + carouselId + "\" data-slide-to=\"" + i + "\"" + (!i ? " class=\"active\"" : "") + "><!-- --></li>";
        }).get().join("");

        if (slides.length > 0) {
            this.$scope.prepend("<ol class=\"carousel-indicators\">" + slides + "</ol>");
        }
    }

    Carousel.prototype.fallbackIndicators = function (carouselId) {
        var $carousel = this.$scope;
        var id = carouselId;
        var relatedIndicators = $('li[data-target="#' + id + '"]', this.$scope);
        $carousel.on('slid.bs.carousel', function (e) {
            var index = $carousel.find('.carousel-inner .item').index($carousel.find('.carousel-inner .active'));
            relatedIndicators.removeClass('active');
            relatedIndicators.filter('[data-slide-to="' + index + '"]').addClass('active');
        });
    }

    /**
     * Notify the world about slide is going to be changed
     * @param {jQuery.Event} event from bootstrap carousel 
     */
    Carousel.prototype._onBeforeChangeSlide = function (e) {
        this.lastDirection = e.direction;
        $(this).trigger('beforeChange.slider', [this, e.direction]);
    }

    /**
     * Notify the world about slide was changed
     * @param {jQuery.Event} event from bootstrap carousel 
     */
    Carousel.prototype._onAfterChangeSlide = function (e) {
        this.lastDirection = e.direction;
        $(this).trigger('afterChange.slider', [this, e.direction]);
    }

    Carousel.init = function(args) {
        if (args.IsEditorEditing) return null;

        var carousel = new Carousel(args.scope, args.CarouselId || []);

        return carousel;
    }

    return Carousel;
}));

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/CarouselPane',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('CarouselPane does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function CarouselPane(scope, selectActionMessages) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });

        //#region select on mesage performer
        if (selectActionMessages.length) {
            selectActionMessages.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.makeActive, self);
            });
        }
        //#endregion
    }

    CarouselPane.prototype.makeActive = function () {
        var carousel = this.$scope.closest('.carousel');

        if (!carousel) {
            log.error("Cannot detect carousel element. Carousel panel selection canceled.");
            return !1;
        }

        var index = carousel.find('.carousel-inner > .item').index(this.$scope);
        carousel.carousel(index);
    };


    CarouselPane.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new CarouselPane(args.scope, args.SelectActionMessages || []);
    };

    return CarouselPane;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Utils/window',[], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory() :
    console && console.error('Window does not support non-amd script loading.');
}(this/* window */, function() {
    return this; /* window */
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Base/PictureAsBackground',["jquery", "picturefill", "score_bootstrap/Utils/window"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("picturefill"), require("score_bootstrap/Utils/window")) :
    console && console.error('PictureAsBackground does not support non-amd script loading.');
}(this/* window */, function ($, picturefill, global) {

    function PictureAsBackground($scope, picSelector, eePicSelector) {

        if (!this.$scope) { this.$scope = $scope; }
        this.picSelector = picSelector;
        this.eePicSelector = eePicSelector;

        // combination of a selector for the Published View HTML and a selector for the Experience Editor   
        this.allPicSelector = this.picSelector + "," + this.eePicSelector;
        // default image selector, looks into picture tag and find the default img
        this.defImgSelector = this.picSelector + " img," + this.eePicSelector + " img";

        // init picturefill for an old browser
        if (this.$scope.find(this.allPicSelector).length > 0) {
            picturefill({ context: this.$scope.find(this.allPicSelector).get(0) });
        }

        $(global).on('resize.score', this._resizeHandler.bind(this));
        this._updateBackgroundWhenImageLoaded();

        //#region Handle EE field update event.
        if (typeof Sitecore != typeof void 0 && typeof Sitecore.PageModes != typeof void 0 && Sitecore.PageModes != null && Sitecore.PageModes.PageEditor != null) {
            // wrap picture object into sitecore jQuery object, since SCORE use jQuery 3.x and Sitecore is on jQuery 1.x/2.x and they aren't compatable 
            var $scPicture = $sc(this.$scope.find(this.allPicSelector).get(0));

            var cId = Sitecore.PageModes.ChromeManager.getChrome($scPicture).controlId();
            var that = this;

            var originalHandleMessage = Sitecore.PageModes.ChromeTypes.Field.prototype.handleMessage;
            Sitecore.PageModes.ChromeTypes.Field.prototype.handleMessage = function (message, params, sender) {
                originalHandleMessage.call(this, message, params, sender);
                if (message === "chrome:field:editcontrolcompleted" && this.controlId() == cId) {
                    that._updateBackgroundWhenImageLoaded();
                }
            };
        }
        //#endregion EE handling end
    }

    PictureAsBackground.prototype.update = function () {
        var $img = this.$scope.find(this.defImgSelector);
        if (!$img.length) return;

        var img = $img.get(0);
        var src = img.currentSrc !== void 0 ? img.currentSrc : img.src;

        // image is not set, or was cleared.
        if (src.substr(-img.getAttribute('srcset').length) === img.getAttribute('srcset')) { // cannot use img.srcset because of IE11
            // clear background image
            this.$scope.css({ backgroundImage: "" });
            return;
        }

        // update background image for the parent only in case if it was changed, otherwise don't waste our time.
        if (this.$scope.css('backgroundImage') !== "url(" + src + ")") {
            this.$scope.css({ backgroundImage: "url(" + src + ")" });
        }
    }

    PictureAsBackground.prototype._resizeHandler = function () {
        this._updateBackgroundWhenImageLoaded();
    }

    PictureAsBackground.prototype._updateBackgroundWhenImageLoaded = function () {
        var $img = this.$scope.find(this.defImgSelector);
        if ($img.get(0).complete && $img.get(0).naturalHeight > 0) {
            // update background if image already loaded
            this.update();
        } else {
            // wait until a real picture image will be loaded, Otherwise we got default image (blank image).
            $img.on('load', this.update.bind(this));
        }
    }

    

    return PictureAsBackground;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/CarouselPicturePane',["jquery", "eventManager", 'loglevel', "score_bootstrap/Base/PictureAsBackground"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require('loglevel'), require("score_bootstrap/Base/PictureAsBackground")) :
    console && console.error('CarouselPane does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log, PictureAsBackground) {

    function CarouselPicturePane(scope, selectActionMessages) {
        var self = this;

        Object.defineProperty(this, "$scope", { enumerable: !0, value: $(scope) });

        //#region select on mesage performer
        if (selectActionMessages.length) {
            selectActionMessages.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.makeActive, self);
            });
        }
        //#endregion

        PictureAsBackground.call(this, scope, '> .score-carousel-pic-pane-body > picture', '> .score-editField-group > .pic-thumb > picture');
    }

    CarouselPicturePane.prototype = Object.create(PictureAsBackground.prototype);

    CarouselPicturePane.prototype.makeActive = function () {
        var carousel = this.$scope.closest('.carousel');

        if (!carousel) {
            log.error("Cannot detect carousel element. Carousel panel selection canceled.");
            return !1;
        }

        var index = carousel.find('.carousel-inner > .item').index(this.$scope);
        carousel.carousel(index);
    };

    CarouselPicturePane.init = function init(args) {
        return new CarouselPicturePane(args.scope, args.SelectActionMessages || []);
    };

    return CarouselPicturePane;
}));
define('score_bootstrap/Models/Comments/CommentsRequest',[], function () {
    "use strict";

    function CommentsRequest(componentId, pageNumber, pageSize, pagingEnabled, orderByAscending, cascadedRepliesDepth, userLanguage, rootId) {
        var instance = {
                componentId: componentId,
                pageNumber: pageNumber,
                pageSize: pageSize,
                pagingEnabled: pagingEnabled,
                orderByAscending: orderByAscending,
                cascadedRepliesDepth: cascadedRepliesDepth,
                userLanguage: userLanguage,
                rootId: rootId
            };

        Object.defineProperties(this, {
            componentId: {
                enumerable: true,
                get: function () { return instance.componentId; },
                set: function (value) {
                    instance.componentId = value;
                }
            },
            pageNumber: {
                enumerable: true,
                get: function () { return instance.pageNumber; },
                set: function (value) {
                    instance.pageNumber = value;
                }
            },
            pageSize: {
                enumerable: true,
                get: function () { return instance.pageSize; },
                set: function (value) {
                    instance.pageSize = value;
                }
            },
            pagingEnabled: {
                enumerable: true,
                get: function () { return instance.pagingEnabled; },
                set: function (value) {
                    instance.pagingEnabled = value;
                }
            },
            orderByAscending: {
                enumerable: true,
                get: function () { return instance.orderByAscending; },
                set: function (value) {
                    instance.orderByAscending = value;
                }
            },
            cascadedRepliesDepth: {
                enumerable: true,
                get: function () { return instance.cascadedRepliesDepth; },
                set: function (value) {
                    instance.cascadedRepliesDepth = value;
                }
            },
            userLanguage: {
                enumerable: true,
                get: function () { return instance.userLanguage; },
                set: function (value) {
                    instance.userLanguage = value;
                }
            },
            rootId: {
                enumerable: true,
                get: function () { return instance.rootId; },
                set: function (value) {
                    instance.rootId = value;
                }
            },
            userLocalTimeNow: {
                enumerable: true,
                get: function() {
                     return new Date().toString();
                }
            }
        });
    }

    return CommentsRequest;
});
define('score_bootstrap/Models/Comments/PostCommentModel',[], function () {
    "use strict";



    function PostCommentModel(id, componentId, commentText, postDate, rootId, postCommentAction, userTimeOffset, userLanguage) {
        var instance = {
                id: id,
                componentId: componentId,
                commentText: commentText,
                postDate: postDate,
                rootId: rootId,
                postCommentAction: postCommentAction,
                userTimeOffset: userTimeOffset,
                userLanguage: userLanguage
            };

        Object.defineProperties(this, {
            id: {
                enumerable: true,
                get: function () { return instance.id; },
                set: function (value) {
                    instance.id = value;
                }
            },
            componentId: {
                enumerable: true,
                get: function () { return instance.componentId; },
                set: function (value) {
                    instance.componentId = value;
                }
            },      
            commentText: {
                enumerable: true,
                get: function () { return instance.commentText; },
                set: function (value) {
                    instance.commentText = value;
                }
            },
            postDate: {
                enumerable: true,
                get: function () { return instance.postDate; },
                set: function (value) {
                    instance.postDate = value;
                }
            },
            rootId: {
                enumerable: true,
                get: function () { return instance.rootId; },
                set: function (value) {
                    instance.rootId = value;
                }
            },
            postCommentAction: {
                enumerable: true,
                get: function () { return instance.postCommentAction; },
                set: function (value) {
                    instance.postCommentAction = value;
                }
            },
            userTimeOffset:  {
                enumerable: true,
                value: userTimeOffset
            },
            userLanguage:  {
                enumerable: true,
                value: userLanguage
            }
        });
    }

    return PostCommentModel;
});
define('score_bootstrap/Models/Comments/CommentsClient',[
    "jquery",
    "errorHandler",
    "score_bootstrap/Models/Comments/CommentsRequest",
    "score_bootstrap/Models/Comments/PostCommentModel"
], function ($, errorHandler, CommentsRequest, PostCommentModel) {

    function CommentsClient(commentsUrl, postCommentUrl) {

        Object.defineProperties(this, {
            commentsUrl: { value: commentsUrl },
            postCommentUrl: { value: postCommentUrl }
        });
    }

    CommentsClient.prototype.getComments = function getComments(componentId, pageNumber, pageSize, 
        showMoreEnabled, orderByAscending, maximumCascadedReplies, userLanguage, rootId) {

        var commentsRequest = new CommentsRequest(componentId,
            pageNumber,
            pageSize,
            showMoreEnabled,
            orderByAscending,
            maximumCascadedReplies,
            userLanguage,
            rootId);

        var jqXHR = $.ajax({
            url: this.commentsUrl,
            data: JSON.stringify(commentsRequest),
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataType: "json"
        });

        jqXHR.fail(errorHandler.logError);

        return jqXHR;
    }

    CommentsClient.prototype.postComment = function postComment(id, componentId, commentText, postDate, rootId, postCommentAction, userTimeOffset, userLanguage) {
        var postCommentModel =
            new PostCommentModel(id, componentId, commentText, postDate, rootId, postCommentAction, userTimeOffset, userLanguage);
        var jqXHR = $.ajax({
            url: this.postCommentUrl,
            data: JSON.stringify(postCommentModel),
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataType: "json"
        });

        jqXHR.fail(errorHandler.logError);

        return jqXHR;
    }

    return CommentsClient;
});
define('score_bootstrap/Models/Comments/CommentsResult',[], function () {
    "use strict";

    function CommentsResult(comments, pageNumber, totalComments, totalPages, rootId, resultStatus, userTimeOffset) {

        function intOrNull(value) {
            value = parseInt(value, 10);
            return isNaN(value) ? null : value;
        }

        Object.defineProperties(this,
            {
                comments: {
                    enumerable: true,
                    value: comments || []
                },
                pageNumber: {
                    enumerable: true,
                    value: intOrNull(pageNumber)
                },
                totalComments: {
                    enumerable: true,
                    value: intOrNull(totalComments)
                },
                totalPages: {
                    enumerable: true,
                    value: intOrNull(totalPages)
                },
                rootId: {
                    enumerable: true,
                    value: intOrNull(rootId)
                },
                resultStatus: {
                    enumerable: false,
                    value: resultStatus
                },
                userTimeOffset:  {
                    enumerable: false,
                    value: userTimeOffset
                }
            });
    }

    return CommentsResult;
});
define('score_bootstrap/Models/Comments/CommentModel',[
    "jquery",
    "knockout"
], function ($, ko) {
    "use strict";

    function CommentModel(rootId, comment, maxCommentLength, renderLoadMore, allowedCascadedReplies, pageNumber, pageSize, totalPages, orderByAscending) {

        var self = this;

        self.rootId = rootId;
        self.allowedCascadedReplies = allowedCascadedReplies;
        self.maxCommentLength = maxCommentLength;
        self.pageNumber = ko.observable(pageNumber);
        self.pageSize = pageSize;
        self.orderByAscending = orderByAscending;
        self.totalPages = ko.observable(totalPages);
        self.showMoreEnabled = renderLoadMore;
        self.id = ko.observable(comment.Id);
        self.commentText = ko.observable(comment.CommentText);
        self.newCommentText = ko.observable('');
        self.createDate = ko.observable(comment.CreateDate || null);
        self.editDate = ko.observable(comment.EditDate || null);
        self.displayName = ko.observable(comment.DisplayName || null);
        self.removeDate = ko.observable(comment.RemoveDate || null);
        self.additionalUserInfo = ko.observable(comment.AdditionalUserInfo || null);
        self.isCommentOwner = ko.observable(comment.IsCommentOwner || false);
        self.isEdited = ko.observable(comment.IsEdited || false);
        self.isRemoved = ko.observable(comment.IsRemoved || false);
        self.isRestored = ko.observable(comment.IsRestored || false);
        self.removedByAdmin = ko.observable(comment.RemovedByAdmin);
        self.replies = ko.observableArray();
        self.canReply = ko.observable(allowedCascadedReplies > 0);
        self.isInFocus = ko.observable(false);

        self.canShowMore = ko.pureComputed(function () {
            return self.showMoreEnabled ? self.pageNumber() < self.totalPages() : false;
        }, self);

        self.showEditComment = ko.observable(false);
        self.focusEditComment = ko.pureComputed({
            read: function () {
                return self.showEditComment();
            },
            write: function (value) {
                self.showEditComment(value);                
            },
            owner: self
        }, self).extend({ throttle: 200 });
        self.editComment = function () {            
            self.showEditComment(true);
            if (!self.focusEditComment()) {
                self.focusEditComment(true);
            }
        };
        self.newCommentLength = ko.pureComputed(function () {
            return self.newCommentText() ? self.maxCommentLength - self.newCommentText().length : self.maxCommentLength;
        }, self);
        self.newCommentTooLong = ko.pureComputed(function () {
            var state = self.newCommentLength() < 0;
            
            if (state) {
                self.submitButtonEnabled(false);
            } else {
                self.submitButtonEnabled(self.newCommentLength() !== self.maxCommentLength);
            }

            return state;
        }, self);
        
        this.submitButtonEnabled = ko.observable(true);

        if (comment.Replies && (self.allowedCascadedReplies > 0)) {
            var nextLevelAllowedCascadedReplies = self.allowedCascadedReplies - 1;
            comment.Replies.forEach(function (item) {
                if (this.orderByAscending && !this.showMoreEnabled) {
                    this.replies.unshift(new CommentModel(self.id(),
                        item,
                        self.maxCommentLength,
                        false,
                        nextLevelAllowedCascadedReplies,
                        self.pageNumber(),
                        self.pageSize,
                        self.totalPages(),
                        self.orderByAscending));
                } else {
                    this.replies.push(new CommentModel(self.id(),
                        item,
                        self.maxCommentLength,
                        false,
                        nextLevelAllowedCascadedReplies,
                        self.pageNumber(),
                        self.pageSize,
                        self.totalPages(),
                        self.orderByAscending));
                }
                
            }, self);
        }

        // this stops collapsing text area in IE since IE triggers blur event after clicking on disabled button
        this.stopCollapsingIETextAreaOnDisabledButtonClick = function () {
            if (!self.submitButtonEnabled()) {
                self.focusEditComment(true);
                $(".score-reply-area").focus();
            }
        }
    };

    return CommentModel;
});
define('score_bootstrap/Utils/Enums',[], function() {
    "use strict";

    function Enums() {
        
        this.PostCommentActionEnum = {
            Create: 0,
            Edit: 1,
            Delete: 2,
            Restore: 3
        };        
    }

    return new Enums();
});
define('score_bootstrap/Components/Comments',[
    "jquery",
    "knockout",
    "eventManager",
    'loglevel',
    "score_bootstrap/Models/Comments/CommentsClient",
    "score_bootstrap/Models/Comments/CommentsResult",
    "score_bootstrap/Models/Comments/CommentModel",
    "score_bootstrap/Utils/Enums"
], function (
    $,
    ko,
    eventManager,    
    log,
    CommentsClient,
    CommentsResult,
    CommentModel,
    Enums
) {
    "use strict";

    function Comments(scope, commentsUrl, postCommentUrl, isEditorEditing, stateChangeTransmitMessages, onShowMessagesPerforming, onHideMessagesPerforming, postCommentMessagesTransmitting, removeCommentMessagesTransmitting,
            componentId, pageSize, showMoreEnabled, orderByAscending, maxCommentLength, maximumCascadedReplies, userLanguage) {

        var self = this;

        this.showMessagesPerforming = onShowMessagesPerforming || [];
        this.hideMessagesPerforming = onHideMessagesPerforming || [];
        this.stateChangeTransmitMessages = stateChangeTransmitMessages || [];
        this.postCommentMessagesTransmitting = postCommentMessagesTransmitting || [];
        this.removeCommentMessagesTransmitting = removeCommentMessagesTransmitting || [];
        this.visible = ko.observable(true);
        this.userAuthenticated =  ko.observable(false);
        this.maxCommentLength = maxCommentLength;
        this.maximumCascadedReplies = maximumCascadedReplies;
        this.orderByAscending = orderByAscending;
        this.commentsClient = new CommentsClient(commentsUrl, postCommentUrl);
        this.serviceUnavailable = ko.observable(false);
        this.results = ko.observableArray([]);
        this.pageNumber = 1;
        this.pageSize = pageSize;
        this.componentId = componentId;
        this.userLanguage = userLanguage;
        this.showMoreEnabled = showMoreEnabled;
        this.id = ko.observable(0);
        this.userTimeOffset = 0;
        this.canShowMore = ko.observable(false);
        this.newCommentText = ko.observable('');
        this.editingComment = ko.observable(false).extend({ throttle: 200 });
        this.editModal = $("#editModal");
        this.deleteModal = $("#deleteModal");
        this.restoreModal = $("#restoreModal");
        this.reset = function reset(rootId) {
            if (rootId === 0) {
                self.results.removeAll();
                self.pageNumber = 1;
            } else {
                var rootCommentModel = this.findComment(this.results(), rootId);

                if (rootCommentModel) {
                    rootCommentModel.replies.removeAll();
                }
            }
        };

        this.currentCommentLength = ko.pureComputed(function () {            
            return self.maxCommentLength - self.newCommentText().length;
        }, this);

        this.currentCommentTooLong = ko.pureComputed(function () {
            var state = self.currentCommentLength() < 0;

            if (state) {
                self.submitButtonEnabled(false);
            } else {
                self.submitButtonEnabled(self.currentCommentLength() !== self.maxCommentLength);
            }

            return state;
        }, this);

        this.submitButtonEnabled = ko.observable(true);
        this.modalSubmitEnabled = ko.observable(true);

        this.commentInFocus = ko.observable(null);

        this.openEditModal = function(comment) {
            comment.newCommentText(comment.commentText());
            self.commentInFocus(comment);
        };
        this.openDeleteModal = function (comment) {
            self.commentInFocus(comment);
        }
        this.openRestoreModal = function(comment) {
            self.commentInFocus(comment);
        };

        this.cancelComment = function(comment) {
            comment.newCommentText('');
            log.debug('click cancel on comment id' + comment.id());
        };

        this.submitComment = function(comment) {
            self.editingComment(true);
            self.submitButtonEnabled(false);
            log.debug('click submit on comment id' + comment.id());
            self.commentsClient
                .postComment(
                    0, 
                    self.componentId,
                    comment.id() ? comment.newCommentText() : self.newCommentText(),
                    Date.now(),
                    comment.id(),
                    Enums.PostCommentActionEnum.Create,
                    self.userTimeOffset,
                    self.userLanguage)
                .done(function(result) {
                    if (result) {
                        self.transmitCommentPosted();
                        self.refreshToPage(1, comment.id(), result.Id, comment.showMoreEnabled);
                    }
                    self.editingComment(false);
                    self.submitButtonEnabled(true);
                    self.newCommentText('');
                    comment.newCommentText('');
                })
                .fail(function(jqXHR, textStatus, errorThrown) {
                    self.submitButtonEnabled(true);
                    self.editingComment(true);
                });
        };

        this.editComment = function (comment) {
            log.debug('click remove on comment id' + comment.id());
            self.modalSubmitEnabled(false);
            self.commentsClient
                .postComment(
                    comment.id(), 
                    self.componentId,
                    comment.newCommentText(),
                    Date.now(),
                    comment.rootId,
                    Enums.PostCommentActionEnum.Edit,
                    self.userTimeOffset,
                    self.userLanguage)
                .done(function(result) {
                    if (result) {
                        self.refreshToPage(1, comment.rootId, comment.id(), comment.showMoreEnabled);
                        self.transmitCommentPosted();
                        self.editModal.modal('toggle');
                    }
                    self.modalSubmitEnabled(true);
                })
                .fail(function(jqXHR, textStatus, errorThrown) {
                    self.modalSubmitEnabled(true);
                });
        };

        this.deleteComment = function(comment) {
            log.debug('click remove on comment id' + comment.id());
            self.modalSubmitEnabled(false);
            self.commentsClient
                .postComment(
                    comment.id(), 
                    self.componentId,
                    comment.commentText(),
                    Date.now(),
                    comment.rootId,
                    Enums.PostCommentActionEnum.Delete,
                    self.userTimeOffset,
                    self.userLanguage)
                .done(function(result) {
                    if (result) {
                        self.refreshToPage(1, comment.rootId, comment.id(), comment.showMoreEnabled);
                        self.transmitCommentRemoved();
                        self.deleteModal.modal('toggle');
                    }
                    self.modalSubmitEnabled(true);
                })
                .fail(function(jqXHR, textStatus, errorThrown) {
                    self.modalSubmitEnabled(true);
                });
        };

        this.restoreComment = function(comment) {
            log.debug('click restore on comment id' + comment.id());
            self.modalSubmitEnabled(false);
            self.commentsClient
                .postComment(
                    comment.id(), 
                    self.componentId,
                    comment.commentText(),
                    Date.now(),
                    comment.rootId,
                    Enums.PostCommentActionEnum.Restore,
                    self.userTimeOffset,
                    self.userLanguage)
                .done(function(result) {
                    if (result) {
                        self.refreshToPage(1, comment.rootId, comment.id(), comment.showMoreEnabled);
                        self.transmitCommentPosted();
                        self.restoreModal.modal('toggle');
                    }
                    self.modalSubmitEnabled(true);
                })
                .fail(function(jqXHR, textStatus, errorThrown) {
                    self.modalSubmitEnabled(true);
                });
        };

        this.loadMoreComments = function() {
            self.commentsClient
                .getComments(this.componentId,
                    this.pageNumber + 1,
                    this.pageSize,
                    this.showMoreEnabled,
                    this.orderByAscending,
                    this.maximumCascadedReplies,
                    this.userLanguage,
                    0)
                .done(this.appendComments.bind(this));
        };

        this.loadMoreReplies = function (model) {
            self.commentsClient
                .getComments(self.componentId,
                    model.pageNumber() + 1,
                    self.pageSize,
                    self.showMoreEnabled,
                    self.orderByAscending,
                    self.maximumCascadedReplies,
                    self.userLanguage,
                    model.id())
                .done(self.appendComments.bind(self));
        };

        // this stops collapsing text area in IE since IE triggers blur event after clicking on disabled button
        this.stopCollapsingIETextAreaOnDisabledButtonClick = function () {
            if (!self.submitButtonEnabled()) {
                self.editingComment(true);
                $(".score-comment-area").focus();
            }
        }

        if (!isEditorEditing) {
            self.commentsClient
                .getComments(
                    this.componentId,
                    this.pageNumber,
                    this.pageSize,
                    this.showMoreEnabled,
                    this.orderByAscending,
                    this.maximumCascadedReplies,
                    this.userLanguage,
                    0)
                .done(this.appendComments.bind(this));
        };

        if (!isEditorEditing) {
            ko.applyBindings(self, scope);
        };

        if (this.stateChangeTransmitMessages.length) {
            stateChangeTransmitMessages.forEach(function (msg) {
                eventManager.trigger(msg, self);
            });
        };

        if (this.showMessagesPerforming.length) {
            this.showMessagesPerforming.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });

        };

        if (this.hideMessagesPerforming.length) {
            this.hideMessagesPerforming.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        };
    }

    Comments.prototype.transmitCommentPosted = function transmitCommentPosted() {
        if (this.postCommentMessagesTransmitting.length) {
            this.postCommentMessagesTransmitting.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Comments.prototype.transmitCommentRemoved = function transmitCommentRemoved() {
        if (this.removeCommentMessagesTransmitting.length) {
            this.removeCommentMessagesTransmitting.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Comments.prototype.show = function () {
        var self = this;

        this.visible(true);

        if (this.stateChangeTransmitMessages.length) {
            this.stateChangeTransmitMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Comments.prototype.hide = function () {
        var self = this;

        this.visible(false);
        
        if (this.stateChangeTransmitMessages.length) {
            this.stateChangeTransmitMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Comments.prototype.appendComments = function appendComments(response) {

        var result = new CommentsResult(response.Comments,
            response.PageNumber,
            response.TotalNumberOfComments,
            response.NumberOfPages,
            response.RootId,
            response.ResultStatus);

        this.userTimeOffset = response.UserTimeOffset;
        this.userAuthenticated(response.UserAuthenticated);

        if (!result.resultStatus) {
            this.serviceUnavailable(true);
            this.visible(false);
        } else {
            this.serviceUnavailable(false);
            this.visible(true);
        }        

        if (result.rootId === 0) {
            if (result.pageNumber > this.pageNumber) {
                this.pageNumber = result.pageNumber;    
            }
            if (this.showMoreEnabled) {
                this.canShowMore(this.pageNumber < result.totalPages);
            }
        }

        this.insertCommentsInOrder(result);
    }

    Comments.prototype.insertCommentsInOrder = function insertCommentsInOrder(result) {

        if (result.rootId !== 0) {

            var rootCommentModel = this.findComment(this.results(), result.rootId, null);

            var targetReplies = rootCommentModel.replies;

            var resultRootComment = result.comments.filter(function(comment) {
                return comment.Id === result.rootId ? comment : null;
            });

            if (resultRootComment) {
                rootCommentModel.pageNumber(resultRootComment[0].RepliesPageNumber);
                rootCommentModel.totalPages(resultRootComment[0].TotalReplyPages);  

                resultRootComment[0].Replies.forEach(function (item) {
                    if (this.orderByAscending && !this.showMoreEnabled) {
                        targetReplies.unshift(new CommentModel(
                            rootCommentModel.id(),
                            item,
                            this.maxCommentLength,
                            false,
                            rootCommentModel.allowedCascadedReplies - 1,
                            item.RepliesPageNumber,
                            this.pageSize,
                            item.TotalReplyPages,
                            this.orderByAscending));
                    } else {
                        targetReplies.push(new CommentModel(
                            rootCommentModel.id(),
                            item,
                            this.maxCommentLength,
                            false,
                            rootCommentModel.allowedCascadedReplies - 1,
                            item.RepliesPageNumber,
                            this.pageSize,
                            item.TotalReplyPages,
                            this.orderByAscending));
                    }
                }, this);
            }
        } else {
            result.comments.forEach(function (item) {
                if (this.orderByAscending  && !this.showMoreEnabled) {
                    this.results.unshift(new CommentModel(
                        0,
                        item,
                        this.maxCommentLength,
                        this.showMoreEnabled,
                        this.maximumCascadedReplies,
                        item.RepliesPageNumber,
                        this.pageSize,
                        item.TotalReplyPages,
                        this.orderByAscending));
                } else {
                    this.results.push(new CommentModel(
                        0,
                        item,
                        this.maxCommentLength,
                        this.showMoreEnabled,
                        this.maximumCascadedReplies,
                        item.RepliesPageNumber,
                        this.pageSize,
                        item.TotalReplyPages,
                        this.orderByAscending));
                }
            }, this);
        }
    };

    Comments.prototype.refreshToPage = function refreshToPage(currentPage, rootId, commentId, showMoreEnabled) {
        var self = this;

        this.commentsClient
            .getComments(this.componentId,
                currentPage,
                this.pageSize,
                showMoreEnabled,
                this.orderByAscending,
                this.maximumCascadedReplies,
                this.userLanguage,
                rootId)
            .done(function(result) {
                self.reset(rootId);    
                self.appendComments(result);
            })
            .then(function() {
                var comment = self.findComment(self.results(), commentId, null);
                
                comment.isInFocus(true);
            });
    };

    Comments.prototype.findComment = function findComment(comments, commentId, result) {
        var self = this;

        for (var i = 0; i < comments.length; i++) {
            if (comments[i].id() === commentId) {
                result = comments[i];
                break;
            } else {
                result = self.findComment(comments[i].replies(), commentId, result);
            }
        }

        return result;
    };

    Comments.init = function init(args) { 
        return new Comments(
            args.scope,
            args.commentsUrl,
            args.postCommentUrl,
            args.IsEditorEditing,
            args.StateChangeMessagesTransmitting,
            args.ShowActionMessages,
            args.HideActionMessages,            
            args.PostCommentMessagesTransmitting,
            args.RemoveCommentMessagesTransmitting,
            args.componentId,
            args.pageSize,
            args.showMoreEnabled,
            args.orderByAscending,
            args.maxCommentLength,
            args.maximumCascadedReplies,
            args.UserLanguage);
    };

    return Comments;
});
define('score_bootstrap/Events/SearchRequestChangeEvent',["jquery"], function ($) {
    "use strict";

    function SearchRequestChangeEvent(value) {
        if (typeof value === "object") {
            $.extend(this, value);
        }
    }

    SearchRequestChangeEvent.eventName     = "SearchRequestChangeEvent";
    SearchRequestChangeEvent.queryChange   = SearchRequestChangeEvent.eventName + ":queryChange";
    SearchRequestChangeEvent.deselectFacet = SearchRequestChangeEvent.eventName + ":deselectFacet";
    SearchRequestChangeEvent.clearFacets = SearchRequestChangeEvent.eventName + ":clearFacets";
    SearchRequestChangeEvent.customDataEvent = SearchRequestChangeEvent.eventName + ":customDataEvent";
    SearchRequestChangeEvent.scrollToTopResults = SearchRequestChangeEvent.eventName + ":scrollToTopResults";

    return SearchRequestChangeEvent;
});
define('score_bootstrap/Components/ContentSearch/ActiveFacets',[
    "jquery",
    "knockout",    
    "underscore",
    "eventManager",
    "score_bootstrap/Events/SearchRequestChangeEvent"
], function defineActiveFiltersListingModule(
    $,
    ko,    
    _,
    eventManager,
    SearchRequestChangeEvent
) {
    "use strict";

    function getActiveFacets(searchRequest) {
        var activeFacets = searchRequest.facets.reduce(function(result, facet) {
            var selected = _.where(facet.values, { selected: true });
            if (selected) {
                Array.prototype.push.apply(result, selected);
            }

            return result;
        }, []);

        return activeFacets;
    }

    function getActiveRangeFacets(searchRequest) {
            var activeRangeFacets = searchRequest.rangeFacets.reduce(function(result, facet) {
            
           Array.prototype.push.apply(result, [{
                id: facet.id,
                value: facet.minValue + "-" + facet.maxValue
            }]);

            return result;
        }, []);

        return activeRangeFacets;
    }

    function getActiveRatingsFacets(searchRequest) {

            var activeRatingsFacets = searchRequest.ratingsFacets.reduce(function(result, facet) {
            
            Array.prototype.push.apply(result, [{
                id: facet.id,
                ratings: new Array(parseInt(facet.ratingValue, 10))
            }]);

            return result;
        }, []);

        return activeRatingsFacets;
    }

    function ActiveFacets(scope, refreshEvents) {
        var self = this;
        this.facets = ko.observableArray([]);
        this.rangeFacets = ko.observableArray([]);
        this.ratingsFacets = ko.observableArray([]);

        this.deselectFacet = function deselectFacet(facet) {
            refreshEvents.forEach(function (ev) {
                eventManager.trigger(SearchRequestChangeEvent.deselectFacet + ":" + ev, facet);
            });
        };

        this.clearAll = function clearAll() {
            refreshEvents.forEach(function (ev) {
                eventManager.trigger(SearchRequestChangeEvent.clearFacets + ":" + ev);
            });
        };

        refreshEvents.forEach(function (ev) {
            eventManager.subscribe(SearchRequestChangeEvent.eventName + ":" + ev, function (searchRequest) {
                // Pagination sends a message without facets data, so preserve facets selection
                if (searchRequest.facets) self.facets(getActiveFacets(searchRequest));
                if (searchRequest.rangeFacets) self.rangeFacets(getActiveRangeFacets(searchRequest));
                if (searchRequest.ratingsFacets) self.ratingsFacets(getActiveRatingsFacets(searchRequest));
                var hasActiveFacets = self.facets().length || self.rangeFacets().length || self.ratingsFacets().length;
                $('.clear-all', scope)
                    .toggleClass('disabled', !hasActiveFacets)
                    .attr('aria-disabled', !hasActiveFacets);
            });
        });

        ko.applyBindings(this, scope);
        $(scope).removeClass("js-hide-on-load");
    }

    ActiveFacets.init = function init(args) {
        if (args.IsEditorEditing === true) {
            $(args.scope).removeClass("js-hide-on-load");
            return null;
        }
        return new ActiveFacets(args.scope, args.RefreshActionMessages || []);
    };

    return ActiveFacets;
});
define('score_bootstrap/Utils/UrlHelper',["jquery"], function ($) {
    "use strict";

    var defaultHashDelimiter = "/";

    function createSetRegExp(urlParam) {
        /*
        [\?|&]                      Character set - Match any of these characters: [?|&]
        (urlParam=[^&]+|$)          Capturing parenthesis. (x) matches x and remembers the match.
            urlParam=               Explicit match
            [^&]+                   Negated character set. The + quantifier causes this item to be matched 1 or more times (greedy).
            |                       Or
            $                       Matches end of input.
        */
        return new RegExp("([\?|&])(" + urlParam + "=[^&#]+|$)", "gi");
    }

    function createGetRegExp(urlParam) {
        return new RegExp("[\?|&]" + urlParam + "=([^&#]+|$)", "gi");
    }
    

    function UrlHelper() {
        return undefined;
    }

    UrlHelper.prototype.getHashAsObject = function getHashAsObject(delimiter) {
        return decodeURI(window.location.hash.slice(1))
            .split(delimiter || defaultHashDelimiter)
            .reduce(function (result, value) {
                value = value.split("=");
                if (value.length === 2) {
                    result[value[0]] = value[1];
                }

                return result;
            }, {});
    };

    UrlHelper.prototype.getObjectAsHash = function getObjectAsHash(obj, delimiter) {
        var hash = "", del = delimiter || defaultHashDelimiter;
        $.each(obj, function (key, value) {
            hash = hash + key + "=" + value + del;
        });

        return encodeURI(hash.substring(0, hash.length - del.length)); // cut off trailing delimiter
    };

    UrlHelper.prototype.getHashValue = function getHashValue(paramName, delimiter) {
        return this.getHashAsObject(delimiter || defaultHashDelimiter)[paramName];
    };

    UrlHelper.prototype.setHashValue = function setHashValue(location, paramName, value, delimiter) {
        /**
         * location    - required, https://developer.mozilla.org/en-US/docs/Web/API/Location item
         * paramName   - required, parameter name
         * value       - required, parameter value
         * delimeter   - optional, character delimiting hash parameters
         */

        if (typeof(location.hash) !== "string") {
            throw new Error("location must implement Location");
        }

        var hash = this.getHashAsObject(delimiter);
        if (!value) {
            delete hash[paramName];
        } else {
            hash[paramName] = value;
        }

        var currentHash = this.getObjectAsHash(hash, delimiter || defaultHashDelimiter);
        if (!currentHash) {
            this.removeHash();
        } else {
            location.hash = currentHash;
        }
    };

    UrlHelper.prototype.getUrlParameters = function getUrlParameters(location, urlParam) {
        urlParam = decodeURIComponent(urlParam);
        var regExp = createGetRegExp(urlParam), url = location.href, results = [], value = regExp.exec(url);
        while (value) {
            results.push(value[1]);
            value = regExp.exec(url);
        }

        return results.map(decodeURIComponent);
    };

    UrlHelper.prototype.setUrlParameters = function setUrlParameter(location, urlParam, value) {
        value = encodeURIComponent(value);
        if (location === undefined || location === null) {
            throw new Error("No location URL implemented");
        }

        var url = location.href, regExp = createSetRegExp(urlParam);

        // remove hash from localtion.href, since it can be a window.location.href, as well as a "a" HTML element.
        // later on we will restore hash from the window.location.href
        url = url.replace(/\#.+/, '');

        // Remove anchor
        var anchor = '';
        var hashPosition = window.location.href.indexOf('#');

        if (~hashPosition) {
            anchor = window.location.href.substring(hashPosition + 1);
            //url = window.location.href.substring(0, hashPosition);
        }

        // Clear out all current instances of this param in the query string
        if (regExp.test(url)) {
            url = url.replace(regExp, "$1");
            // If query string was something like ?param=value&otherparam=othervalue and ew removed param=value then we would end up with ?&
            if (url.indexOf("?&") > -1) {
                url = url.replace("?&", "?");
            }
            if (url.indexOf("&&") > -1) {
                url = url.replace("&&", "&");
            }
        }

        if (value) {
            if (url.indexOf("?") < 0) {
                url += "?";
            } else if (new RegExp("[\?&]").test(url.slice(-1)) === false) {
                url += "&";
            }
            url += (urlParam + "=" + value);
        }

        // Search by text query cannot be triggered if filter has preselected values in it
        // In case we press 'Enter' or click on the 'Search' button we redirect without hash
        var buttonConditions = location.classList && location.classList.contains("score-button") || false;
        // If it is a simple anchor - leave the hash part, otherwise erase the hash part because it might have Facet filter
        var isSimpleAnchor = !/[=&]/.test(anchor);

        // Append anchor back to url
        if (~hashPosition && (!buttonConditions || isSimpleAnchor)) {
            url += '#' + anchor;
        }

        if (window.location.pathname === location.pathname) {
            window.history.replaceState(null, document.title, url);
        }
        return url;
    };

    UrlHelper.prototype.removeHash = function() {
        var scrollV, scrollH, loc = window.location;
        if ("pushState" in history)
            history.pushState("", document.title, loc.pathname + loc.search);
        else {
            // Prevent scrolling by storing the page's current scroll offset
            scrollV = $(window).scrollTop();
            scrollH = $(window).scrollLeft();

            loc.hash = "";

            // Restore the scroll offset, should be flicker free
            $(window).scrollTop(scrollV);
            $(window).scrollLeft(scrollH);
        }
    };

    UrlHelper.prototype.SortDirectionKey = "direction";
    UrlHelper.prototype.SortTypeKey = "sort";

    return new UrlHelper(); // singleton
});
define('score_bootstrap/Models/SitecoreId',['loglevel'], function (log) {
    "use strict";

    var re = /^\{?[A-Za-z\d]{8}-(?:[A-Za-z\d]{4}-){3}[A-Za-z\d]{12}\}?$/;

    function normalize(id) {
        // TODO: need unit tests
        id = id.toLowerCase();
        return id.replace("{", "").replace("}", "");
    }

    function SitecoreId(id) {
        var raw = String(id);
        if (re.test(raw) === false) {
            throw new RangeError("Invalid Sitecore ID string.");
        }

        Object.defineProperty(this, "guid", { value: normalize(raw), enumerable: true });
    }

    SitecoreId.prototype.toString = function () {
        return this.guid;
    };

    SitecoreId.prototype.equals = function (other) {
        return !!(other) && other.isSitecoreId === true && other.guid === this.guid;
    };

    Object.defineProperty(SitecoreId.prototype, "isSitecoreId", {
        enumerable: false,
        value: true
    });

    SitecoreId.parse = function (value) {
        if (!value) {
            return null;
        }

        if (value.isSitecoreId === true) {
            return value;
        }

        try {
            return new SitecoreId(value);
        }
        catch (e) {
            log.error(e);
            return null;
        }
    };

    SitecoreId.RegEx = re;
    SitecoreId.RegExGlobal = /\{?[A-Za-z\d]{8}-(?:[A-Za-z\d]{4}-){3}[A-Za-z\d]{12}\}?/g;

    return SitecoreId;
});
define('score_bootstrap/Models/Search/IndexableItemBase',["jquery", "score_bootstrap/Models/SitecoreId"], function ($, SitecoreId) {
    "use strict";

    function IndexableItemBase(id, title, tiles, url) {
        Object.defineProperties(this, {
            id:    { enumerable: true, value: SitecoreId.parse(id) },
            url:   { enumerable: true, value: url },
            title: { enumerable: true, value: title },
            tiles: {
                enumerable: true,
                value: tiles.reduce(function (result, tile) {
                    result[tile.Name] = tile.Html;
                    return result;
                }, {})
            }
        });
    }

    Object.defineProperty(IndexableItemBase.prototype, "isIndexableItemBase", {
        enumerable: false,
        value: true
    });

    return IndexableItemBase;
});
define('score_bootstrap/Events/SearchResponseEvent',[
    "jquery",
    "score_ccf/extensions",
    "../Models/Search/IndexableItemBase"
], function ($, extensions, IndexableItemBase) {
    "use strict";

    function intOrNull(value) {
        value = parseInt(value, 10);
        return isNaN(value) ? null : value;
    }

    function SearchResponseEvent(query, items, page, perPage, totalItems, totalPages, facets) {
        if (items && (!Array.isArray(items) || !extensions.allOfType(items, IndexableItemBase))) {
            throw new TypeError("items should be array of IndexableItemBase");
        }

        if (facets && typeof facets !== "object") {
            throw new TypeError("facets should be object");
        }

        Object.defineProperties(this, {
            query:      {enumerable: true, value: query},
            items:      { enumerable: true, value: items || []           },
            facets:     { enumerable: true, value: facets || {}          },
            page:       { enumerable: true, value: intOrNull(page)       },
            perPage:    { enumerable: true, value: intOrNull(perPage)    },
            totalItems: { enumerable: true, value: intOrNull(totalItems) },
            totalPages: { enumerable: true, value: intOrNull(totalPages) }
        });
    }

    SearchResponseEvent.eventName = "SearchResponseEvent";
    SearchResponseEvent.serverError = SearchResponseEvent.eventName + ":serverError";

    return SearchResponseEvent;
});
define('score_bootstrap/Models/Search/FacetPanel',[
    "jquery",
    "knockout",
    "underscore",
    "score_bootstrap/Models/SitecoreId"
], function ($, ko, _, SitecoreId) {
    "use strict";

    var searchLogic = [ "and", "or_total_count", "or_incremental_count" ];

    function FacetValue(id, value, text, rowElement, isPreselected) {
        var self = this;

        this.id        = SitecoreId.parse(id);
        this.value = value;
        this.text = text;
        this.selected  = ko.observable(isPreselected);
        this.count     = ko.observable(0);

        this.disabled = ko.computed(function () {
            var count = self.count();
            return count === 0 || parseInt(count, 10) === 0;
        });

        this.resetCount = function () {
            this.count(0);
        };

        ko.applyBindings(this, rowElement);
    }

    function FacetPanel(panelElement, allPreselected) {
        var $dataEl = $(".js-facet", panelElement),
            title = $dataEl.attr("data-title"),
            searchLogicType = $dataEl.attr("data-search-logic-type").toLowerCase(),
            preselectedByTitle = allPreselected[title] || "",
            facets = [];

        $(".js-row", panelElement).each(function () {
            var $el = $(this),
                id = $el.attr("data-id"),
                val = $el.attr("data-value"),
                text = $el.find('.score-facet-value').text();
            facets.push(new FacetValue(id, val, text, $el[0], preselectedByTitle.indexOf(val) > -1));
        });

        Object.defineProperties(this, {
            title:           { value: title },
            searchLogicType: { value: searchLogic.indexOf(searchLogicType) },
            facets:          { get: Array.prototype.slice.bind(facets) },
            asString: {
                get: function () {
                    var result = facets.reduce(function (result, facet) {
                        return facet.selected() ? (result + facet.value + "|") : result;
                    }, "");

                    return result ? (this.title + ":" + result.slice(0, -1)) : null;
                }
            }
        });

        this.selectValues = function(selectedValues) {
            var selectedByTitle = selectedValues[title] || "";
            facets.forEach(function (facet) {
                var oldValue = facet.selected();
                var newValue = selectedByTitle.indexOf(facet.value) > -1;
                if (oldValue !== newValue) {
                    facet.selected(selectedByTitle.indexOf(facet.value) > -1);
                }
            });
        };

        this.selectedValues = ko.pureComputed(function () {
            return _.filter(facets, function (val) {
                return val.selected();
            });
        });

        this.unselectAll = function unselectAll() {
            this.selectedValues().forEach(function (value) {
                value.selected(false);
            });
        };
    }

    return FacetPanel;
});
define('score_bootstrap/Models/Search/FacetRangePanel',[
    "jquery",
    "knockout",
    "bootstrapslider"
], function ($, ko, bootstrapslider) {
    "use strict";

    var searchLogic = [ "and", "or" ];

    function FacetRangeValue(preselectedValue, rowElement, initValue) {

        var self = this;
        this.rowElement = rowElement;

        preselectedValue =  preselectedValue || initValue;
        this.initValue = ko.observable("[" + preselectedValue + "]");

        this.selectedRange = ko.observable(preselectedValue || initValue);

        ko.applyBindings(this, rowElement);

        $(rowElement).show();
        $(rowElement).slider({});
        $(rowElement).on("slideStop", function(slider) {
            self.selectedRange(slider.value.join(","));
        });
    }

    function FacetRangePanel(panelElement, allPreselected) {
        var $dataEl = $(".js-facet", panelElement),
            title = $dataEl.attr("data-title"),
            searchLogicType = $dataEl.attr("data-search-logic-type").toLowerCase(),
            initMinValue = $dataEl.attr("data-min-value"),
            initMaxValue = $dataEl.attr("data-max-value"),
            indexFieldName = $dataEl.attr("data-index-field-name"),
            initValue = initMinValue + "," + initMaxValue,
            id = $dataEl.attr("data-id");

        var $rangeSlider = $("input.score-facet-range", panelElement);
        var preselected = allPreselected && allPreselected[title] ? allPreselected[title][0] : null;
        var rangeValue = new FacetRangeValue(preselected, $rangeSlider[0], initValue);

        Object.defineProperties(this, {
            id: {
                value: id                
            },
            title: {
                value: title
            },
            searchLogicType: {
                value: searchLogic.indexOf(searchLogicType)
            },
            rangeFacet: {
                get: function() {
                    return rangeValue.selectedRange() !== initValue ? rangeValue.selectedRange() : null;
                }
            },
            indexFieldName: {
                get: function() {
                    return indexFieldName;
                }
            },
            asString: {
                get: function () {
                    var result = rangeValue.selectedRange();

                    return result && (result !== initValue) ? (this.title + ":" + result) : null;
                }
            }
        });

        this.selectValues = function (selectedValues) {
            var newValue = selectedValues && selectedValues[title] ? selectedValues[title][0] : null;
            var oldValue = rangeValue.selectedRange();
            if (oldValue !== newValue) {
                newValue = newValue || initValue;
                rangeValue.selectedRange(newValue);
                $(rangeValue.rowElement).slider("setValue", newValue.split(",").map(Number));
            }
        };

        this.unselectAll = function unselectAll() {
            $rangeSlider.slider('setValue', [parseInt(initMinValue, 10), parseInt(initMaxValue, 10)], true, true);
            rangeValue.selectedRange(initValue);
        };
    }

    return FacetRangePanel;
});
define('score_bootstrap/Models/Search/FacetRatingsPanel',[
    "jquery",
    "knockout"    
], function ($, ko) {
    "use strict";

    var searchLogic = [ "and", "or" ];

    function FacetRatingsPanel(panelElement, allPreselected) {
        var $dataEl = $(".js-facet", panelElement),
            title = $dataEl.attr("data-title"),
            indexFieldName = $dataEl.attr("data-index-field-name"),
            searchLogicType = $dataEl.attr("data-search-logic-type").toLowerCase(),
            id = $dataEl.attr("data-id");

        var preselected = allPreselected && allPreselected[title] ? allPreselected[title][0] : null;

        this.currentRatingValue = ko.observable(preselected);

        Object.defineProperties(this, {
            id: {
                value: id
            },
            title: {
                value: title
            },
            searchLogicType: {
                value: searchLogic.indexOf(searchLogicType)
            },
            rating: {
                get: function() {
                    return this.currentRatingValue() && this.currentRatingValue() !== "0" ? this.currentRatingValue() : null;
                }
            },
            indexFieldName: {
                get: function() {
                    return indexFieldName;
                }
            },
            asString: {
                get: function () {
                    return this.currentRatingValue() && this.currentRatingValue() !== "0" ? this.title + ":" + this.currentRatingValue() : null;
                }
            }
        });

        this.selectValues = function (selectedValues) {
            var newValue = selectedValues && selectedValues[title] ? selectedValues[title][0] : null;
            var oldValue = this.currentRatingValue();
            if (oldValue !== newValue) {
                this.currentRatingValue(newValue);
            }
        };

        this.unselectAll = function unselectAll() {
            this.currentRatingValue("0");
        };

        ko.applyBindings(this, panelElement);
    }

    return FacetRatingsPanel;
});
define('score_bootstrap/Components/ContentSearch/FacetContainer',[
   "jquery",
   "knockout",
   "underscore",
   "eventManager",   
   "score_bootstrap/Utils/UrlHelper",
   "score_bootstrap/Events/SearchRequestChangeEvent",
   "score_bootstrap/Events/SearchResponseEvent",
   "score_bootstrap/Models/Search/FacetPanel",
   "score_bootstrap/Models/Search/FacetRangePanel",
   "score_bootstrap/Models/Search/FacetRatingsPanel",
   "score_bootstrap/Models/SitecoreId"
], function (
   $,
   ko,
   _,
   eventManager,   
   urlHelper,
   SearchRequestChangeEvent,
   SearchResponseEvent,
   FacetPanel,
   FacetRangePanel,
   FacetRatingsPanel,
   SitecoreId
) {
    "use strict";

    function FacetContainer(scope, uniqueId, inputChangeEvents) {
        var self = this,
            urlParam = uniqueId + "facet",
            facetRangeUrlParam = urlParam + "Range",
            facetRatingsUrlParam = urlParam + "Ratings",
            preselected,
            rangePreselected,
            ratingsPreselected,
            hasPreselected,
            clearAllInProgress = false,
            facetValues;

        getPreselectedValues();

        this.facetPanels = $(".score-facet-panel", scope).toArray().map(function (el) {
            return new FacetPanel(el, preselected);
        });

        this.facetRangePanels = $(".score-facet-range-panel", scope).toArray().map(function (el) {
            return new FacetRangePanel(el, rangePreselected);
        });

        this.facetRatingsPanels = $(".score-facet-ratings-panel", scope).toArray().map(function (el) {
            return new FacetRatingsPanel(el, ratingsPreselected);
        });

        window.addEventListener('hashchange', (function () {

            getPreselectedValues();

            this.facetPanels.forEach(function (panel) {
                panel.selectValues(preselected);
            });

            this.facetRangePanels.forEach(function (panel) {
                panel.selectValues(rangePreselected);
            });

            this.facetRatingsPanels.forEach(function (panel) {
                panel.selectValues(ratingsPreselected);
            });

        }).bind(this));

        facetValues = Array.prototype.concat.apply([], _.pluck(this.facetPanels, "facets"));

        function getPreselectedValues() {
            preselected = urlHelper.getHashValue(urlParam);
            rangePreselected = urlHelper.getHashValue(facetRangeUrlParam);
            ratingsPreselected = urlHelper.getHashValue(facetRatingsUrlParam);

            preselected = preselected ? preselected.split(",") : [];
            hasPreselected = preselected.length > 0;
            preselected = preselected.reduce(processPreselected, {});

            rangePreselected = rangePreselected ? rangePreselected.split("|") : [];
            hasPreselected = hasPreselected || rangePreselected.length > 0;
            rangePreselected = rangePreselected.reduce(processPreselected, {});

            ratingsPreselected = ratingsPreselected ? ratingsPreselected.split(",") : [];
            hasPreselected = hasPreselected || ratingsPreselected.length > 0;
            ratingsPreselected = ratingsPreselected.reduce(processPreselected, {});
        }

        function triggerFacetChange(selectedFacets, selectedFacetRanges, selectedFacetRatings) {
            var data;
            
            if (selectedFacets.length || selectedFacetRanges.length || selectedFacetRatings.length) {
                urlHelper.setHashValue(window.location, urlParam, selectedFacets.length ? selectedFacets.join(",") : null);
                urlHelper.setHashValue(window.location, facetRangeUrlParam, selectedFacetRanges.length ? selectedFacetRanges.join("|") : null);
                urlHelper.setHashValue(window.location, facetRatingsUrlParam, selectedFacetRatings.length ? selectedFacetRatings.join(",") : null);
            } else {
                urlHelper.removeHash();
            }
          
            if (inputChangeEvents.length) {
                data = new SearchRequestChangeEvent({
                    page: 0,
                    startPage: 0,
                    facets: self.facetPanels.map(function (facetPanel) {
                        return {
                            title: facetPanel.title,
                            logic: facetPanel.searchLogicType,
                            values: facetPanel.facets.map(function (facet) {
                                return {
                                    id: facet.id.toString(),
                                    value: facet.value,
                                    text: facet.text,
                                    selected: facet.selected()
                                };
                            })
                        };
                    }),
                    rangeFacets: self.facetRangePanels.filter(function (f) { return f.rangeFacet; }).map(function (facetPanel) {
                        var selectedValueArray = facetPanel.rangeFacet.split(",");

                        return {
                            id: facetPanel.id,
                            title: facetPanel.title,
                            logic: facetPanel.searchLogicType,
                            indexFieldName: facetPanel.indexFieldName,
                            minValue: selectedValueArray[0], 
                            maxValue: selectedValueArray[1]
                        }
                    }),
                    ratingsFacets: self.facetRatingsPanels.filter(function (f) { return f.rating; }).map(function (facetPanel) {
                        return {
                            id: facetPanel.id,
                            title: facetPanel.title,
                            logic: facetPanel.searchLogicType,
                            indexFieldName: facetPanel.indexFieldName,
                            ratingValue: facetPanel.rating ? facetPanel.rating : 0
                        }
                    })
                });

                inputChangeEvents.forEach(function (ev) {
                    eventManager.trigger(SearchRequestChangeEvent.eventName + ":" + ev, data);
                });

                // Enable/disable Clear Facets button
                var hasActiveFacets = selectedFacets.length || selectedFacetRanges.length || selectedFacetRatings.length;
                $('.clear-facets', scope)
                    .toggleClass('disabled', !hasActiveFacets)
                    .attr('aria-disabled', !hasActiveFacets);
            }
        }

        function clearAll() {
            clearAllInProgress = true;
            self.facetPanels.forEach(function (panel) {
                panel.unselectAll();
            });
            self.facetRangePanels.forEach(function (panel) {
                panel.unselectAll();
            });
            self.facetRatingsPanels.forEach(function (panel) {
                panel.unselectAll();
            });

            triggerFacetChange([], [], []);
            clearAllInProgress = false;
        }

        this.selectedFacets = ko.pureComputed(function () {
            return this.facetPanels.reduce(function (result, facetPanel) {
                var asStr = facetPanel.asString;
                if (asStr !== null) {
                    result.push(asStr);
                }

                return result;
            }, []);
        }, this);

        this.selectedFacetRanges = ko.pureComputed(function () {
            return this.facetRangePanels.reduce(function (result, facetPanel) {
                var asStr = facetPanel.asString;
                if (asStr !== null) {
                    result.push(asStr);
                }

                return result;
            }, []);
        }, this);

        this.selectedFacetRatings = ko.pureComputed(function () {
            return this.facetRatingsPanels.reduce(function (result, facetPanel) {
                var asStr = facetPanel.asString;
                if (asStr !== null) {
                    result.push(asStr);
                }

                return result;
            }, []);
        }, this);

        if (hasPreselected) {
            triggerFacetChange(self.selectedFacets(), self.selectedFacetRanges(), self.selectedFacetRatings());
        }

        this.selectedFacets.subscribe(function (facets) {
            if (clearAllInProgress === false) {
                triggerFacetChange(facets, self.selectedFacetRanges(), self.selectedFacetRatings());
            }
        });

        this.selectedFacetRanges.subscribe(function (facets) {
            if (clearAllInProgress === false) {
                triggerFacetChange(self.selectedFacets(), facets, self.selectedFacetRatings());
            }
        });

        this.selectedFacetRatings.subscribe(function (facets) {
            if (clearAllInProgress === false) {
                triggerFacetChange(self.selectedFacets(), self.selectedFacetRanges(), facets);
            }
        });

        this.clearAll = clearAll;

        $(scope).on("click", ".panel-heading", function () {
            var $this = $(this);
            if ($this.hasClass("static")) {
                return;
            }

            $this.next().slideToggle();
            $this.toggleClass("opened").toggleClass("closed");
            $this.attr("aria-expanded", $this.hasClass("opened"));
        });

        $(scope).on("keydown", ".panel-heading", function (e) {
            // toggle expand/collapse on spacebar press
            if (e.keyCode == 32) {
                $(this).trigger("click");
                // disable page scrolling
                return false;
            }
        });

        function refresh(response) {
            // save currently focused element to restore its focus later
            var focusedInput = document.activeElement;

            _.invoke(facetValues, "resetCount");

            if (typeof (response.facets) !== "object") {
                return;
            }

            $.each(response.facets, function (id, count) {
                var parsed = SitecoreId.parse(id), 
                    facet = _.find(facetValues, function (p) {
                        return p.id.equals(parsed);
                    });

                if (facet) {
                    facet.count(count);
                }
            });

            // restore lost focus
            focusedInput.focus();
        }

        function deselectFacet(facet) {
            var deselect = _.find(facetValues, function (fv) {
                return fv.id.toString() === facet.id;
            });

            if (deselect) {
                deselect.selected(false);
            } else {
                deselect = _.find(self.facetRangePanels, function (fv) {
                    return fv.id.toString() === facet.id;
                });                

                if (!deselect) {
                    deselect = _.find(self.facetRatingsPanels, function (fv) {
                        return fv.id.toString() === facet.id;
                    });
                }   
                
                if (deselect) {
                    deselect.unselectAll();
                }
            }
        }        

        if (inputChangeEvents.length) {
            inputChangeEvents.forEach(function (ev) {
                eventManager.subscribe(SearchResponseEvent.eventName + ":" + ev, refresh);
                eventManager.subscribe(SearchRequestChangeEvent.deselectFacet + ":" + ev, deselectFacet);
                eventManager.subscribe(SearchRequestChangeEvent.clearFacets + ":" + ev, clearAll);
            });
        }

        function processPreselected(result, current) {
            var i = current.indexOf(":");
            var facetName = current.substr(0, i);
            var preselectedFacetValues = current.substr(i + 1).split("|");

            if (result.hasOwnProperty(facetName) === false) {
                result[facetName] = [];
            }

            result[facetName] = result[facetName].concat(preselectedFacetValues);
            return result;
        }

        ko.applyBindings(this, scope);
    }

    FacetContainer.init = function init(args) {
        return args.IsEditorEditing === true ? null : new FacetContainer(
            args.scope,
            args.UniqueId,
            args.InputChangeMessagesTransmitting || []
        );
    };

    return FacetContainer;
});
// defines a base module for a Search Results components that uses Search Client
define('score_bootstrap/Components/ContentSearch/SearchResultsBase',[
    "jquery",
    "eventManager",
    "score_bootstrap/Events/SearchResponseEvent",
    "score_bootstrap/Events/SearchRequestChangeEvent",
    "score_bootstrap/Utils/UrlHelper"
], function ($, eventManager, SearchResponseEvent, SearchRequestChangeEvent, urlHelper) {

    function SearchResultsBase(scope, uniqueId, isLazy, refreshEvents, showMessages) {
        var onSearchResponseEvent = this.onSearchResponseEvent.bind(this), page = 0, searchClient;

        Object.defineProperties(this, {
            scope: { enumerable: false, value: scope },
            $scope: { enumerable: false, value: $(scope) },
            $list: { enumerable: false, value: $(".js-search-results", scope) },
            id: { enumerable: true, value: uniqueId },
            isLazy: { enumerable: true, value: Boolean(isLazy) }, // lazy search return nothing for empty queries
            refreshEvents: { enumerable: false, value: refreshEvents || [] },
            showMessages: { enumerable: false, value: showMessages || [] },
            searchClient: {
                enumerable: false,
                get: function () {
                    if (!searchClient) {
                        searchClient = $(".score-search-client", scope).data("ccf_module");
                    }
                    return searchClient;
                }
            },
            // this 'page' property is used by the appendTiles internals only
            page: {
                enumerable: true,
                get: function () { return page; },
                set: function (val) { page = parseInt(val, 10) || 0; }
            },
            tiles: {
                enumerable: false,
                get: function () {
                    return $("li", this.$list);
                }
            }
        });

        // Cannot add lister to Search Client's module because it may not be initialized yet. But the DOM element is definitely there.
        $(".score-search-client", scope).on(SearchResponseEvent.eventName, function (ignore /*event*/, response) {
            onSearchResponseEvent(response);
        });

        function serverError() {
            self.serviceUnavailable(true);
        }

        if (refreshEvents.length) {
            refreshEvents.forEach(function (ev) {
                eventManager.subscribe(SearchResponseEvent.serverError + ":" + ev, serverError);
                eventManager.subscribe(SearchRequestChangeEvent.scrollToTopResults + ":" + ev, this.scrollToTopResults.bind(this));
            }.bind(this));
        }
    }

    SearchResultsBase.prototype.appendTiles = function appendTiles(newTiles) {
        //throw new Error("Not implemented function SearchResultsBase.appendTiles must be overriden");

        if (this.showMessages.length) {
            this.showMessages.forEach(function (ev) {
                eventManager.trigger(ev, this, newTiles);
            }.bind(this));
        }
    };

    SearchResultsBase.prototype.reset = function reset() {
        throw new Error("Not implemented function SearchResultsBase.reset must be overriden");
    };

    SearchResultsBase.prototype.onSearchResponseEvent = function onSearchResponseEvent(searchResponse) {
        if (!this.isLazy || searchResponse.query || this.searchClient.searchRequest.firstActiveFacet) {
            this.showLazySearchMessage(false);
            this.reset();
            this.appendTiles(searchResponse);
        } else {
            this.showLazySearchMessage(true);
            this.canShowMore(false);
            if (this.$scope.hasClass("js-hide-on-load")) {
                this.$scope.removeClass("js-hide-on-load");
            }
        }
    };

    SearchResultsBase.prototype.showMore = function showMore() {
        var searchClient = this.searchClient,
            newPage = this.page + 1;

        urlHelper.setHashValue(window.location, this.id + "page", newPage);
        searchClient.searchRequest.page = newPage;
        searchClient.searchRequest.startPage = newPage;

        searchClient.search().done(this.appendTiles.bind(this));
    };

    SearchResultsBase.howManyTilesPerRow = function howManyTilesPerRow($list) {
        var tilesInRow = 0;
        $list.find("li").each(function () {
            var $this = $(this), $prev = $this.prev();
            if ($prev.length && $this.position().top !== $prev.position().top) {
                return false;
            }

            tilesInRow = tilesInRow + 1;
        });

        return tilesInRow;
    };

    SearchResultsBase.injectPromoTiles = function injectPromoTiles(component, originalQuantity) {
        if (!component.hasOwnProperty("promoTiles")) {
            throw new Error("component.promoTiles must be defined to use static helper SearchResultsBase.injectPromoTiles");
        }

        var newPromoTiles = [];

        component.promoTiles.forEach(function (promoTile) {
            if (promoTile.index <= originalQuantity || promoTile.index > (component.tiles.length + 1)) {
                return;
            }

            var insertElement = $("<li class='promo-tile-li'></li>").append(promoTile.tileHtml);

            if (promoTile.index === 1) {
                $(component.tiles[0]).before(insertElement);
            } else {
                $(component.tiles.get(promoTile.index - 2)).after(insertElement);
            }

            $(".score-promo-tile", insertElement);
            newPromoTiles.push(insertElement[0]);
        });

        return newPromoTiles;
    };

    SearchResultsBase.getLastRowTiles = function getLastRowTiles(component) {
        if (!component.hasOwnProperty("tiles") || !component.hasOwnProperty("tilesPerRow")) {
            throw new Error("component.tiles and component.tilesPerRow must be defined to use static helper SearchResultsBase.getLastRowTiles");
        }

        var tiles = component.tiles.toArray(), tilesPerRow = component.tilesPerRow, mod;

        // When additional tiles are appended via 'show more', we want to run matchHeight on just
        // the new tiles to avoid changing the tiles already on the screen and causing the scroll
        // position to jump. However, if the math of tiles-per-page works out so that the last row
        // of the old tiles ends up with both, old and new, tiles, then the tiles in that row should
        // be included in matchHeight

        // Divides total number of elements by number of tiles-per-row, returning remainder. This is
        // how we figure out which elements are in the last row.
        mod = tiles.length % tilesPerRow;
        return tiles.slice(-1 * (mod || tilesPerRow));
    };

    SearchResultsBase.prototype.scrollToTopResults = function () {
        $("html, body").animate({
            scrollTop: $(this.scope).offset().top
        },
        "slow");
    }

    return SearchResultsBase;
});
define('score_bootstrap/Models/Tile',["knockout"], function (ko) {
    "use strict";

    function Tile(item, tileName) {
        if (item && item.isIndexableItemBase !== true) {
            throw new TypeError("Tile constructor param 'item' must be IndexableItemBase");
        }

        this.id = String(item.id);
        this.element = ko.observable();
        this.tileHtml = item ? item.tiles[tileName] : "";
    }

    return Tile;
});
define('score_bootstrap/Models/Search/SearchRequest',["jquery", "score_bootstrap/Utils/UrlHelper"], function ($, urlHelper) {
    "use strict";

    // maps to Score.BootstrapUI.Web.Areas.ScoreBootstrapUI.Models.ContentSearch.SearchApiComponent
    var searchApiComponentEnum = ["SearchResults", "SuggestionSection"];

    function getFirstActiveFacet(facet) {
        return facet.values.find(function(value) {
            return value.selected;
        });
    }

    function SearchRequest(selectedFacets, selectedRangeFacets, selectedRatingsFacets) {

        var urlQueryParam = "q",
            queryInUrl = urlHelper.getUrlParameters(window.location, urlQueryParam),
            instance = {
                startPage : 0,
                page: 0,
                perPage: 9,
                query: queryInUrl.length ? queryInUrl[0] : "",
                root: "",
                indexName: "",
                facets: Array.isArray(selectedFacets) ? selectedFacets : [],
                rangeFacets: Array.isArray(selectedRangeFacets) ? selectedRangeFacets : [],
                ratingsFacets: Array.isArray(selectedRatingsFacets) ? selectedRatingsFacets : [],
                templates: [],
                language: "en",
                tileNames: [],
                component: 0,
                customData: {}
            };

        Object.defineProperties(this, {
            startPage: {
                enumerable: true,
                get: function () { return instance.startPage; },
                set: function (value) {
                    var valueAsInt = parseInt(value, 10);
                    if (!isNaN(valueAsInt)) {
                        instance.startPage = valueAsInt;
                    }
                }
            },
            page: {
                enumerable: true,
                get: function () { return instance.page; },
                set: function (value) {
                    var valueAsInt = parseInt(value, 10);
                    if (!isNaN(valueAsInt)) {
                        instance.page = valueAsInt;
                    }
                }
            },
            perPage: {
                enumerable: true,
                get: function () {
                    return instance.perPage;
                },
                set: function (value) {
                    var valueAsInt = parseInt(value, 10);
                    if (!isNaN(valueAsInt) && valueAsInt > 0) {
                        instance.perPage = valueAsInt;
                    }
                }
            },
            query: {
                enumerable: true,
                get: function () {
                    var query = urlHelper.getUrlParameters(window.location, urlQueryParam);
                    return query.length ? query[0] : "";
                },
                set: function (value) {
                    urlHelper.setUrlParameters(window.location, urlQueryParam, String(value || ""));
                }
            },
            root: {
                enumerable: true,
                get: function () {
                    return instance.root;
                },
                set: function (value) {
                    instance.root = String(value);
                }
            },
            indexName: {
                enumerable: true,
                get: function () {
                    return instance.indexName;
                },
                set: function (value) {
                    instance.indexName = String(value);
                }
            },
            facets: {
                enumerable: true,
                get: function () {
                    return instance.facets;
                },
                set: function (value) {
                    if (Array.isArray(value)) {
                        instance.facets = value.slice();
                    }
                }
            },
            rangeFacets: {
                enumerable: true,
                get: function () {
                    return instance.rangeFacets;
                },
                set: function (value) {
                    if (Array.isArray(value)) {
                        instance.rangeFacets = value.slice();
                    }
                }
            },
            ratingsFacets: {
                enumerable: true,
                get: function () {
                    return instance.ratingsFacets;
                },
                set: function (value) {
                    if (Array.isArray(value)) {
                        instance.ratingsFacets = value.slice();
                    }
                }
            },
            templates: {
                enumerable: true,
                get: function () {
                    return instance.templates;
                },
                set: function (value) {
                    if (Array.isArray(value)) {
                        instance.templates = value.slice();
                    }
                }
            },
            language: {
                enumerable: true,
                get: function () { return instance.language; },
                set: function (value) {
                    if (value) {
                        instance.language = String(value);
                    }
                }
            },
            tileNames: {
                enumerable: true,
                get: function () {
                    return instance.tileNames;
                },
                set: function (value) {
                    instance.tileNames = value.slice(0);
                }
            },
            component: {
                enumerable: true,
                get: function () {
                    return instance.component;
                },
                set: function (value) {
                    instance.component = searchApiComponentEnum.indexOf(value);
                }
            },
            customData: {
                enumerable: true,
                get: function () {
                    return instance.customData;
                },
                set: function (value) {
                    instance.customData = value;
                }
            },
            firstActiveFacet: {
                enumerable: false,
                get: function () {
                    return instance.facets.length ? instance.facets.find(getFirstActiveFacet) : null;
                }
            }
        });

        this.addTileRequest = function addTileRequest(tileName) {
            if (tileName && typeof (tileName) === "string")
                instance.tileNames.push(tileName);
        };
    }

    return SearchRequest;
});
define('score_bootstrap/Events/MultiViewSearchResultsEvent',["jquery"], function ($) {
    "use strict";

    function MultiViewSearchResultsEvent(value) {
        if (typeof value === "object") {
            $.extend(this, value);
        }
    }

    MultiViewSearchResultsEvent.hasMoreResults = "has-more-results";
    MultiViewSearchResultsEvent.noMoreResults = "no-more-results";
    

    return MultiViewSearchResultsEvent;
});
define('score_bootstrap/Components/ContentSearch/MultiViewSearchResults',[
    "jquery",
    "knockout",
    "eventManager",
    "score_bootstrap/Components/ContentSearch/SearchResultsBase",
    "score_bootstrap/Models/Tile",
    "score_bootstrap/Models/Search/SearchRequest",
    "score_bootstrap/Events/SearchResponseEvent",
    "score_bootstrap/Events/MultiViewSearchResultsEvent",
    "score_bootstrap/Utils/UrlHelper"
    
], function (
    $,
    ko,
    eventManager,
    SearchResultsBase,
    Tile,
    SearchRequest,
    SearchResponseEvent,
    MultiViewSearchResultsEvent,
    urlHelper
) {
    "use strict";

    function MultiViewSearchResults(scope, uniqueId, refreshEvents, showTransmitMsg, stateChangeTransmitMsg, showMoreActionMsg, showQvActionMsg, lazySearch) {
        var searchViews = null, self = this;

        this.query = ko.observable("");
        this.serviceUnavailable = ko.observable(false);
        this.numberOfResults = ko.observable("");
        this.canShowMore = ko.observable();
        this.showLazySearchMessage = ko.observable(false);

        Object.defineProperties(this, {
            searchViews: {
                enumerable: false,
                get: function () {
                    if (searchViews == null) {
                        searchViews = $(".score-search-results-view", scope).map(function () {
                            return $(this).data("ccf_module");
                        }).get();
                    }
                    return searchViews;
                }
            },
            activeView: {
                enumerable: false,
                get: function () {
                    var activeViews = $.grep(this.searchViews, function (view) {
                        return view.isActive;
                    });
                    return activeViews.length > 0 ? activeViews[0] : null;
                }
            }
        });

        // show the first view on page load
        var subscription = eventManager.subscribe("ModulesLoadedEvent", function (ev) {
            // append the initial search load with info from the first view
            var view = this.searchViews[0], self = this;

            this.searchClient.searchRequest.perPage = view.tilesPerPage;

            // Change some parameters for initial page loading when the 'switchToClassicPager' is false 
            // and the component has selected page of results different from first.
            // Need to have results from first page to defined in url. 
            if (!view.switchToClassicPager) {
                var currentPageParameter = urlHelper.getHashValue(this.id + "page");
                if (currentPageParameter) {
                    var currentPage = parseInt(currentPageParameter) | 0;
                    this.searchClient.searchRequest.perPage = parseInt(view.tilesPerPage) * (currentPage + 1);
                    this.searchClient.searchRequest.page = 0;
                    this.searchClient.searchRequest.startPage = 0;
                    this.page = 0;
                    // Get back the parameters after initial page loading
                    var pageLoadedSubscription = eventManager.subscribe("SearchResponseEvent:pageLoaded", function (data) {
                        this.searchClient.searchRequest.perPage = view.tilesPerPage;
                        this.searchClient.searchRequest.page = currentPage;
                        this.searchClient.searchRequest.startPage = currentPage;
                        this.page = currentPage;
                        // Ensure that this event handler is called only once
                        eventManager.unsubscribe(pageLoadedSubscription);
                    }.bind(this));
                }
            }

            this.searchClient.searchRequest.tileNames = [view.tileName, view.quickViewTileName];
            view.show();

            // subscribe to view's 'show' events
            $(this.searchViews).on("SearchResultsView.show", function (ev) {
                // freeze height while tabs are changing so that elements under the search results don't jump up and down
                self.$scope.css("height", self.$scope.height());

                self.searchClient.searchRequest.perPage = this.tilesPerPage;

                // Change some parameters for initial page loading when the 'switchToClassicPager' is false
                // and the component has selected page of results different from first.
                // Need to have results from first page to defined in url. 
                if (!this.switchToClassicPager) {
                    var currentPageParameter = urlHelper.getHashValue(self.id + "page");
                    if (currentPageParameter /*&& !initialResultLoadedForEachView*/) {
                        var currentPage = parseInt(currentPageParameter) | 0;
                        self.searchClient.searchRequest.perPage = parseInt(this.tilesPerPage) * (currentPage + 1);
                        self.searchClient.searchRequest.page = 0;
                        self.searchClient.searchRequest.startPage = 0;
                        self.page = 0;
                        // Get back the parameters after rendering of search tiles
                        var searchRenderedSubscription = eventManager.subscribe("search-rendered", function (data) {
                            self.searchClient.searchRequest.perPage = this.tilesPerPage;
                            self.searchClient.searchRequest.page = currentPage;
                            self.searchClient.searchRequest.startPage = currentPage;
                            self.page = currentPage;
                            // Ensure that this event handler is called only once
                            eventManager.unsubscribe(searchRenderedSubscription);
                        }.bind(this));
                    }
                }

                self.searchClient.searchRequest.tileNames = [this.tileName, this.quickViewTileName];
                self.searchClient.search().done(self.appendTiles.bind(self));
            })
            .on("SearchResultsView.showPage", function(ev, newPage) {
                urlHelper.setHashValue(window.location, this.id + "page", newPage);

                self.searchClient.searchRequest.page = newPage;
                self.searchClient.searchRequest.startPage = newPage;
                self.searchClient.searchRequest.perPage = this.tilesPerPage;
                self.searchClient.searchRequest.tileNames = [this.tileName, this.quickViewTileName];

                var searchProm = self.searchClient.search();
                //searchProm.done((function () { this.results.removeAll(); }).bind(this));
                searchProm.done(self.appendTiles.bind(self));
            });

            // Ensure that this event handler is called only once
            eventManager.unsubscribe(subscription);

            //moduleLoader.loadPendingModules(this.activeView.$list);
        }.bind(this));

        if (showMoreActionMsg.length) {
            showMoreActionMsg.forEach(function (msg) {
                eventManager.subscribe(msg, function () {
                    self.showMore();
                });
            });
        }

        if (showQvActionMsg.length) {
            showQvActionMsg.forEach(function (msg) {
                eventManager.subscribe(msg, function (component) {
                    var $li = component.$scope.closest("li"),
                        view = self.activeView,
                        tile = view.getQuickViewTileByElement($li);

                    view.showQuickView(tile, $li);
                });
            });
        }

        if (stateChangeTransmitMsg.length) {
            this.canShowMore.subscribe(function (canShowMore) {
                stateChangeTransmitMsg.forEach(function (msg) {
                    if ((msg == MultiViewSearchResultsEvent.hasMoreResults && canShowMore) ||
                        (msg == MultiViewSearchResultsEvent.noMoreResults && !canShowMore)) {
                            eventManager.trigger(msg, self);
                    }
                });
            });
        }

        ko.applyBindings(this, scope);

        SearchResultsBase.call(this, scope, uniqueId, lazySearch, refreshEvents, showTransmitMsg);
    }

    MultiViewSearchResults.prototype = Object.create(SearchResultsBase.prototype);

    MultiViewSearchResults.prototype.reset = function reset() {
        this.page = 0;
        this.searchViews.forEach(function (view) {
            view.reset();
        });
    };

    MultiViewSearchResults.prototype.appendTiles = function appendTiles(response) {
        var isLoadMore = false;
        this.serviceUnavailable(false);

        if (response.page !== this.page) {
            urlHelper.setHashValue(window.location, this.id + "page", String(response.page));
        }

        if (response.page <= this.page) {
            // When there is a new search response, current tiles should always be cleared out first,
            // unless the 'page' value has been incremeneted, which means that 'show more' was clicked
            // this.page = 0;
            this.activeView.reset();
        } else {
            // 'show more' was clicked, so page should be incremented
            this.page = response.page;
            isLoadMore = true;
        }

        this.canShowMore((response.page + 1) < response.totalPages);
        this.numberOfResults(response.totalItems);
        this.query(response.query);

        var newTiles = this.activeView.appendTiles(response, isLoadMore);

        if (this.$scope.hasClass("js-hide-on-load")) {
            this.$scope.removeClass("js-hide-on-load");
        }

        this.$scope.css("height", "");

        // call base class implementation
        SearchResultsBase.prototype.appendTiles.call(this, newTiles);
    };

    MultiViewSearchResults.init = function init(args) {
        return new MultiViewSearchResults(
            args.scope,
            args.UniqueId,
            args.RefreshActionMessages || [],
            args.ShowMessagesTransmitting || [],
            args.StateChangeMessagesToTransmitOn || [],
            args.ShowMoreMessagesToPerformOn || [],
            args.ShowQuickViewMessagesToPerformOn ||[],
            args.LazySearch);
    };

    return MultiViewSearchResults;
});
define('score_bootstrap/Components/ContentSearch/QuickView',[ "jquery"], function ($) {

    function QuickView(scope) {
        var $scope = $("li", scope).remove();

        this.index = -1;

        Object.defineProperties(this, {
            $scope: { enumerable: false, value: $scope },
            $body: { enumerable: false, value: $(".quick-view-body", $scope) },
            $prevBtn: { enumerable: false, value: $(".controls-back", $scope) },
            $nextBtn: { enumerable: false, value: $(".controls-forward", $scope) }
        });

        // Clicking on "Quick View" link inserts quick view element into search results grid and loads quick view tile html
        //$(this.scope).on("click", ".quick-view-link", function (event) {
        //    event.preventDefault();
        //    event.stopPropagation();
        //    $(".bj-product-quick-view").removeClass("search-loaded");
        //
        //    var $anchor = $(event.target), $li = $anchor.closest("li"), url = $anchor.attr("href");
        //
        //    this.quickView.$scope.remove();
        //    toggleQuickViewButtons($li.index(), this.tiles.length, this.quickView.$prevBtn, this.quickView.$nextBtn);
        //    this.showQuickView($li);
        //    this.quickView.showTile($li, url);
        //}.bind(this))
        //.on("click", "." + quickViewClass + " .close", this.hideQuickView.bind(this))
        //.on("click", "." + quickViewClass + " .controls-back", function () {
        //    var newIndex = this.quickView.hideTile() - 1, $tile = $(this.tiles.get(newIndex));
        //
        //    // If a promo tile is in the prev position or if prev tile does not have quick
        //    // view link then we need to skip over it.
        //    while ($tile.length && ($tile.hasClass(promoClass) || $tile.find(quickViewLinkClass).length === 0)) {
        //        $tile = $tile.prev();
        //    }
        //
        //    this.quickView.$scope.remove();
        //
        //    // make sure we didn't reach the end of the grid
        //    if ($tile.length === 0) {
        //        return;
        //    }
        //
        //    toggleQuickViewButtons($tile.index(), this.tiles.length, this.quickView.$prevBtn, this.quickView.$nextBtn);
        //    this.showQuickView($tile);
        //    this.quickView.showTile($tile);
        //}.bind(this))
        //.on("click", "." + quickViewClass + " .controls-forward", function () {
        //    var newIndex = this.quickView.hideTile() + 1, tile = this.tiles.get(newIndex), $tile = $(tile);
        //
        //    // If next index if pointing at quick view then we reached the end of the row and we need to skip over it.
        //    // If a promo tile is in the next position then we also need to skip over it.
        //    // If tile does not have Quick View link then we also need to skip over it
        //    while ($tile.length && ($tile.hasClass(quickViewClass) || $tile.hasClass(promoClass) || $tile.find(quickViewLinkClass).length === 0)) {
        //        $tile = $tile.next();
        //    }
        //
        //    this.quickView.$scope.remove();
        //
        //    // make sure we didn't reach the end of the grid
        //    if (!$tile.length) {
        //        return;
        //    }
        //
        //    toggleQuickViewButtons($tile.index(), this.tiles.length, this.quickView.$prevBtn, this.quickView.$nextBtn);
        //    this.showQuickView($tile);
        //    this.quickView.showTile($tile);
        //}.bind(this));
    }

    function scrollIntoView(target) {
        var rect = target.getBoundingClientRect();
        if (rect.bottom > window.innerHeight) {
            target.scrollIntoView(false);
        }

        if (rect.top < 0) {
            target.scrollIntoView();
        }
    }

    QuickView.prototype.toggleControls = function toggleControls(activeIndex, totalTiles) {
        this.$prevBtn.css("display", activeIndex <= 0 ? "none" : "inline-block");
        this.$nextBtn.css("display", activeIndex >= (totalTiles - 1) ? "none" : "inline-block");
    };

    QuickView.prototype.setTile = function setTile(tile) {
        this.$body.html(tile ? tile.tileHtml : "");
    };

    QuickView.prototype.show = function show(tile, index) {
        this.setTile(tile);
        this.$scope.show();
        this.index = index;
        scrollIntoView(this.$scope[0]);
    };

    QuickView.prototype.hide = function hide() {
        this.$scope.remove();
        this.index = -1;
        this.setTile(null);
    };

    QuickView.init = function initQuickView(args) {
        return new QuickView(args.scope);
    };

    return QuickView;
});
define('score_bootstrap/Models/Search/SimpleSearchClient',[
    "jquery",
    "errorHandler",
    "score_bootstrap/Models/Search/SearchRequest"
], function ($, errorHandler, SearchRequest) {

    function SimpleSearchClient(searchUrl, perPage, language, root, indexName, templates, startPage, page, tileNames, component) {
        var searchRequest = new SearchRequest();

        if (perPage !== undefined) searchRequest.perPage = perPage;
        if (language) searchRequest.language = language;
        if (root !== undefined) searchRequest.root = root;
        if (indexName !== undefined) searchRequest.indexName = indexName;
        if (templates !== undefined) searchRequest.templates = templates;
        if (page !== undefined) searchRequest.page = page;
        if (startPage !== undefined) searchRequest.startPage = startPage;
        if (component !== undefined) searchRequest.component = component;

        // we can accept a single string or an array or strings
        if (tileNames) {
            typeof (tileNames) === "string"
                ? searchRequest.addTileRequest(tileNames)
                : tileNames.forEach(searchRequest.addTileRequest);
        }

        Object.defineProperties(this, {
            searchRequest: { value: searchRequest },
            searchUrl: { value: searchUrl }
        });
    }

    SimpleSearchClient.prototype.search = function search() {
        var jqXHR = $.ajax({
            url: this.searchUrl,
            data: JSON.stringify(this.searchRequest),
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataType: "json"
        });
        
        jqXHR.fail(errorHandler.logError);

        return jqXHR;
    }

    return SimpleSearchClient;
});
define('score_bootstrap/Models/Search/SuggestionSection',["jquery", "./SimpleSearchClient"], function ($, SimpleSearchClient) {
    "use strict";

    function SuggestionSection(scope, language, indexName, searchApiUrl, flags) {
        Object.defineProperty(this, '$scope', { value: $(scope), enumerable: !0, configurable: !0, writable: !0 });
        this.setup(language, indexName, searchApiUrl, flags);
    }

    SuggestionSection.prototype.setup = function setup(language, indexName, searchApiUrl, flags) {
        Object.defineProperty(this, 'tileName', { value: this.getTileName(), enumerable: !0, configurable: !0, writable: !0 });
        Object.defineProperty(this, 'searchClient', { value: this.getSearchClient(searchApiUrl, language, indexName, flags), enumerable: !0, configurable: !0, writable: !0 });
        Object.defineProperty(this, 'typeaheadOptions', { value: this.getTypeaheadOptions(), enumerable: !0, configurable: !0, writable: !0 });
    }

    SuggestionSection.prototype.getSuggestions = function (query, ignore /*syncResult*/, asyncResult) {
        this.doSearch(query)
            .done(asyncResult);
    }

    SuggestionSection.prototype.getHeader = function getHeader() {
        var headerText = this.$scope.attr('data-header');
        return headerText ? '<div class="score-typeahead-header">' + headerText + '</div>' : '';
    }

    SuggestionSection.prototype.getPagerSize = function getPagerSize() {
        return (this.$scope.attr('data-count')|0) || 5 /* default value */;
    }

    SuggestionSection.prototype.getTileName = function getTileName() {
        return this.$scope.attr('data-tile-name');
    }

    SuggestionSection.prototype.getSearchClient = function getSearchClient(searchApiUrl, language, indexName, flags) {
        var searchClient = new SimpleSearchClient(searchApiUrl, this.getPagerSize(), language, this.$scope.attr("data-root"),
                                                  indexName, this.$scope.attr("data-templates").split("|"), 0, 0, this.tileName, "SuggestionSection");

        if (typeof (flags) === "object") {
            searchClient.searchRequest.flags = flags;
        }

        return searchClient;
    }

    SuggestionSection.prototype.getTypeaheadOptions = function getTypeaheadOptions() {
        return {
            name: this.$scope.attr("data-id"),
            source: this.getSuggestions.bind(this),
            async: true,
            Key: "Title",
            limit: this.getPagerSize(),
            templates: {
                header: this.getHeader(),
                suggestion: this.buildTile.bind(this),
                footer: this.$scope.html()
            },
            display: function(item) {
                return item.Title;
            }
        };
    }


    SuggestionSection.prototype.buildTile = function buildTile(data) {
        var tileHtml = '';
        if (data && 'Tiles' in data && data.Tiles instanceof Array) {
            // find the tile which we want to show on the suggestion section
            // we aren't using find method because of beloved IE support :) (just kidding), but we don't see a reason to introduce a dependency with "find" polyfill. 
            for (var i = 0; i < data.Tiles.length; i++) {
                var tileEn = data.Tiles[i];
                if (tileEn.Name === this.tileName) {
                    tileHtml = tileEn.Html;
                    // since we already found the tile, lets stop our loop
                    break;
                }
            }
        }

        // short form
        //var tile = data.Tiles.find(function (x) { return x.Name === tileName; }).Html;
        return '<div class="score-typeahead-content">' + tileHtml + '</div>';
    }


    SuggestionSection.prototype.doSearch = function doSearch(query) {
        this.searchClient.searchRequest.query = query;
        return this.searchClient.search().then(function (response) {
            return (response.SearchResults || []);
        });
    };

    return SuggestionSection;
});
define('score_bootstrap/Components/ContentSearch/SearchBox',[
    "jquery",
    "knockout",
    "eventManager",
    "score_bootstrap/Models/Search/SuggestionSection",
    "score_bootstrap/Models/Search/SearchRequest",
    "score_bootstrap/Utils/UrlHelper",
    "score_bootstrap/Events/SearchRequestChangeEvent",
    "typeahead"
], function (
    $,
    ko,
    eventManager,
    SuggestionSection,
    SearchRequest,
    urlHelper,
    SearchRequestChangeEvent
) {
    "use strict";

    function SearchBox(scope, language, indexName, searchApiUrl, flags) {
        var $input = $(".js-typeahead :text", scope),
            $clearInputButton = $('.clear-input', scope),
            $button = $("a", scope),
            datasets = [],
            searchRequest = new SearchRequest(),
            timeout;

        this.$input = $input;
        this.$clearInputButton = $clearInputButton;

        $(".score-suggestion-section", scope).each(function parseSuggestionSection() {
            var suggestion = new SuggestionSection(this, language, indexName, searchApiUrl, flags);
            datasets.push(suggestion.typeaheadOptions);
        });

        function performSearch() {
            var val = $input.val(),
                url = urlHelper.setUrlParameters($button[0], "q", val);

            // Reload the page in case if enter press and page url was not changed.
            if (window.location.href === url) {
                window.location.reload(!0);
            } else {
                window.location = url;
            }
        }


        this.doSearch = performSearch;

        $input.typeahead(null, datasets);

        // attach to selections in the typeahead
        $input.on('typeahead:selected', function (ignore /*evt*/, data) {
            $input.on('change').unbind();
            window.location = data.Url;
            return false;
        });

        // attach to enter key
        $input.on("keyup", function (e, data) {
            if (e.keyCode === 13 && !data) {
                performSearch();
            }
            return false;
        }.bind(this));
        
        this.query = ko.observable(searchRequest.query);
        $input.typeahead('val', this.query());

        this.query.subscribe(function onQueryChange(query) {
            searchRequest.query = query;
            if (timeout) {
                clearTimeout(timeout);
            }

            timeout = setTimeout(function() {
                eventManager.trigger(SearchRequestChangeEvent.queryChange, query);
            }, 400);
        });
        
        ko.applyBindings(this, scope);
    }

    SearchBox.prototype.resetSearch = function () {
        this.query('');
        this.doSearch();
    }

    SearchBox.init = function init(args) {
        return args.IsEditorEditing === true ? null :
            new SearchBox(args.scope, args.Language, args.IndexName, args.SearchApiUrl, args.SearchFlags);
    };

    return SearchBox;
});
define('score_bootstrap/Components/ContentSearch/SearchClient',[
    "jquery",
    "eventManager",
    "score_ccf/Events/ModulesLoadedEvent",
    "score_bootstrap/Events/SearchResponseEvent",
    "score_bootstrap/Events/SearchRequestChangeEvent",
    "score_bootstrap/Models/Search/IndexableItemBase",
    "score_bootstrap/Models/Search/SimpleSearchClient",
    "score_bootstrap/Utils/UrlHelper"
], function (
    $,
    eventManager,
    ModulesLoadedEvent,
    SearchResponseEvent,
    SearchRequestChangeEvent,
    IndexableItemBase,
    SimpleSearchClient,
    UrlHelper
) {
    "use strict";

    function indexMatchToModel(indexMatch) {
        return new IndexableItemBase(
            indexMatch.ID,
            indexMatch.Title,
            indexMatch.Tiles,
            indexMatch.Url
        );
    }

    function SearchClient(scope, refreshEvents, perPage, language, root, indexName, templates, searchUrl, uniqueId, tileNames, flags, lazySearch) {
        var modulesLoaded = false,
            urlParam = uniqueId + "page",
            page = UrlHelper.getHashValue(urlParam),
            startPage = page, // load only current page
            parent = {},
            self = this;
        SimpleSearchClient.call(this, searchUrl, perPage, language, root, indexName, templates, startPage, page, tileNames);

        if (typeof (flags) === "object") {
            this.searchRequest.flags = flags;
        }

        function handleError(err) {
            refreshEvents.forEach(function (ev) {
                eventManager.trigger(SearchResponseEvent.serverError + ":" + ev, err);
            });
        }

        function parseResults(query, results) {
            var indexMatch = results.SearchResults || [];
            return new SearchResponseEvent(
                query,
                indexMatch.map(indexMatchToModel),
                results.PageNumber ? results.PageNumber : 0,
                results.NumberOfResultsPerPage,
                results.TotalNumberOfResults,
                results.NumberOfPages,
                results.FacetCounts
            );
        }

        this.triggerSearchResponseEvent = triggerSearchResponseEvent;

        function triggerSearchResponseEvent(data) {
            // Search Results component has a reference to its Search Client, so Search Results can
            // add listener directly to Search Client without using Event Manager
            $(scope).triggerHandler(SearchResponseEvent.eventName, data);

            eventManager.trigger(SearchResponseEvent.eventName + ":pageLoaded", data);

            // Other components like Facet Container still rely on Event Manager
            refreshEvents.forEach(function (ev) {
                eventManager.trigger(SearchResponseEvent.eventName + ":" + ev, data);
            });
        }

        parent.search = this.search.bind(this);
        this.search = function search() {
            var deferred = $.Deferred();

            // if lazy search is turned on and query string is empty
            // don't dispatch search request and return empty result set
            if (lazySearch && !this.searchRequest.query) {
                deferred.resolve(parseResults(this.searchRequest.query, {}));
            } else {
                deferred = parent.search().then(parseResults.bind(null, this.searchRequest.query), handleError);
            }
                
            return deferred;
        };

        // run a search query on page load
        eventManager.subscribe(ModulesLoadedEvent.name, function () {
            if (modulesLoaded === true) return;
            modulesLoaded = true;
            self.search().done(triggerSearchResponseEvent);
        });

        if (flags && flags["Live Search"] === "true") {
            // run a search query when the query in the search box changes
            eventManager.subscribe(SearchRequestChangeEvent.queryChange, function (newQuery) {
                this.searchRequest.query = newQuery;
                this.searchRequest.startPage = 0;
                this.searchRequest.page = 0;
                this.search().done(triggerSearchResponseEvent);
            }.bind(this));
        }

        function refresh(props) {
            $.each(props, function (key, val) {
                if (self.searchRequest.hasOwnProperty(key)) {
                    self.searchRequest[key] = val;
                }
            });

            if (modulesLoaded === true) {
                self.search().done(triggerSearchResponseEvent);
            }
        }

        if (refreshEvents.length) {
            refreshEvents.forEach(function (ev) {
                eventManager.subscribe(SearchRequestChangeEvent.eventName + ":" + ev, refresh);
            });
        }

        eventManager.subscribe(SearchRequestChangeEvent.customDataEvent, function (customData) {
			this.searchRequest.customData = $.extend(this.searchRequest.customData, customData);
			this.search().done(triggerSearchResponseEvent);
		}.bind(this));
    }

    SearchClient.prototype = Object.create(SimpleSearchClient.prototype);

    SearchClient.init = function init(args) {
        return args.IsEditorEditing === true ? null : new SearchClient(
            args.scope,
            args.RefreshActionMessages || [],
            args.PerPage,
            args.Language,
            args.SearchRoot,
            args.IndexName,
            args.Templates,
            args.SearchApiUrl,
            args.UniqueId,
            args.TileNames,
            args.SearchFlags,
            args.LazySearch
        );
    };

    return SearchClient;
});
define('score_bootstrap/Components/ContentSearch/SearchQueryMessage',[
    "knockout",
    "score_bootstrap/Utils/UrlHelper"
], function (ko, urlHelper) {
    "use strict";

    function SearchQueryMessage(scope) {
        var query = urlHelper.getUrlParameters(window.location, "q");
        query = query.length ? query[0] : "";
        this.query = ko.observable(query);
        this.shouldShowMessage = ko.pureComputed(function () {
            return this.query().length > 0;
        }, this);
        ko.applyBindings(this, scope);
    }

    SearchQueryMessage.init =  function init(args) {
        return new SearchQueryMessage(args.scope);
    };

    return SearchQueryMessage;
});
define('score_bootstrap/Models/Search/PromoTile',["jquery", "knockout"], function ($, ko) {
    "use strict";

    function PromoTile(index, element) {
        if (isNaN(index) || index < 1) {
            throw new Error("PromoTile index must be positive integer");
        }

        if (!element) {
            throw new Error("PromoTile index is required");
        }

        Object.defineProperties(this,
        {
            index:   { value: index },
            tileHtml: { value: element.outerHTML }
        });
    }

    PromoTile.fromElement = function fromElement(element) {
        var index = $(element).attr("data-grid-position");
        index = parseInt(index, 10);
        return new PromoTile(index, element);
    };

    PromoTile.sort = function sort(a, b) {
        return a.index - b.index;
    };

    return PromoTile;
});
define('score_bootstrap/Components/ContentSearch/SearchResults',[
    "jquery",
    "knockout",
    "eventManager",
    "score_bootstrap/Components/ContentSearch/SearchResultsBase",
    "score_bootstrap/Models/Tile",
    "score_bootstrap/Models/Search/PromoTile",
    "score_bootstrap/Models/Search/SearchRequest",
    "score_bootstrap/Events/SearchResponseEvent",
    "imagesLoaded",
    "score_bootstrap/Utils/UrlHelper",
    "matchHeight"
], function (
    $,
    ko,
    eventManager,
    SearchResultsBase,
    Tile,
    PromoTile,
    SearchRequest,
    SearchResponseEvent,
    imagesLoaded,
    urlHelper
) {
    "use strict";

    var tileCache = {};

    function SearchResults(scope, uniqueId, refreshEvents, showMessages, isLazySearch, tileName, switchToClassicPager, classicPagesToDisplay, showEllipsisInBetween, scrollToPageTop) {
        var promoTiles = $(".score-promo-tile", scope).remove().toArray().map(PromoTile.fromElement).sort(PromoTile.sort),
            includeMatchHeight = true;

        this.query = ko.observable("");
        this.serviceUnavailable = ko.observable(false);
        this.results = ko.observableArray([]);
        this.numberOfResults = ko.observable("");
        this.canShowMore = ko.observable(false);
        this.currentPage = ko.observable(0);
        this.allPages = ko.observableArray([]);
        this.showLazySearchMessage = ko.observable(isLazySearch);
        this.totalPages = ko.observable(0);
        this.showPager = ko.observable(false);
        this.isPageReload = false;

        Object.defineProperties(this, {
            promoTiles: { enumerable: false, value: promoTiles },
            tileName: { enumerable: true, value: tileName },
            tilesPerRow: {
                enumerable: false,
                get: function () {
                    return SearchResultsBase.howManyTilesPerRow(this.$list);
                }
            },
            includeMatchHeight: {
                enumerable: false,
                get: function () { return includeMatchHeight; },
                set: function (val) { includeMatchHeight = val; }
            },
            switchToClassicPager: { enumerable: !1, value: !!switchToClassicPager },
            classicPagesToDisplay: { enumerable: !1, value: classicPagesToDisplay | 0 },
            showEllipsisInBetween: { enumerable: !1, value: !!showEllipsisInBetween },
            scrollToPageTop: { enumerable: !1, value: !!scrollToPageTop },
            initialResultLoaded: {enumerable: !1, value: !1, writable: !0}
        });

        // Append some client logic during the initial search loading
        var subscription = eventManager.subscribe("ModulesLoadedEvent", function (ev) {
            var pageNumber = urlHelper.getHashValue(this.id + "page") | 0;
            if (pageNumber > 0) {
                if (!this.switchToClassicPager) {
                    this.reloadPage(pageNumber, false);
                }
            }
        }.bind(this));

        ko.applyBindings(this, scope);

        SearchResultsBase.call(this, scope, uniqueId, isLazySearch, refreshEvents, showMessages);
        tileCache[this.id] = {};

        window.addEventListener('hashchange', (function () {
            var pageNumber = urlHelper.getHashValue(this.id + "page") | 0;
            //execute only if back/forward button is clicked
            if (pageNumber != this.searchClient.searchRequest.page) {
                if (!this.switchToClassicPager) {
                    this.reloadPage(pageNumber, true);
                } else {
                    this.showPage(pageNumber);
                }
            }
        }).bind(this));
    }

    SearchResults.prototype = Object.create(SearchResultsBase.prototype);

    SearchResults.prototype.resetResults = function resetResults() {
        this.$list.empty();
        this.results.removeAll();
        this.allPages.removeAll();
    }

    SearchResults.prototype.reset = function reset() {
        this.resetResults();
        this.currentPage(0);
        this.page = 0;
    }

    SearchResults.prototype.appendTiles = function appendTiles(response) {
        var newTiles = [], lastRowTiles = [], self = this;

        this.serviceUnavailable(false);


        var pageNumber = urlHelper.getHashValue(this.id + "page") | 0;
        if (response.page !== pageNumber && !this.isPageReload) {
            urlHelper.setHashValue(window.location, this.id + "page", String(response.page));
        }

        if (response.page <= this.page) {
            // When there is a new search response, current tiles should always be cleared out first,
            // unless the 'page' value has been incremeneted, which means that 'show more' was clicked
            this.resetResults();
        } else {
            // 'show more' was clicked, so page should be incremented
            this.page = response.page;

            lastRowTiles = SearchResultsBase.getLastRowTiles(this);
        }

        var originalQuantity = this.tiles.length;

        response.items.forEach(function (item) {
            var id = item.id.toString(), tile, cache = tileCache[this.id];

            if (!cache.hasOwnProperty(id)) {
                cache[id] = new Tile(item, this.tileName);
            }

            tile = cache[id];
            this.results.push(tile);
            newTiles.push(tile.element());
        }, this);

        // store amount pages for a classic pager
        this.totalPages(response.totalPages);
        this.currentPage(response.page);
        this.allPages.removeAll();
        Array.apply(null, { length: response.totalPages }).map((function (v, i) { this.allPages.push(i); }).bind(this));
        this.showPager(response.totalPages > 1 && this.switchToClassicPager);


        this.canShowMore((response.page + 1) < response.totalPages);
        this.numberOfResults(response.totalItems);
        this.query(response.query);

        if (!newTiles.length) {
            if ($(self.scope).hasClass("js-hide-on-load")) {
                $(self.scope).removeClass("js-hide-on-load");
            }
            return;
        }

        newTiles = $(newTiles).add(SearchResultsBase.injectPromoTiles(this, originalQuantity));

        if (!this.includeMatchHeight) {
            // Wait to run matchHeight until all the images are loaded since
            // height of images affect the height of the tiles
            imagesLoaded($("img", newTiles), function matchHeightOnNewTiles() {
                var emptySpots = self.tilesPerRow - lastRowTiles.length;
                if (emptySpots > 0) {
                    $(newTiles.slice(0, emptySpots)).add(lastRowTiles).matchHeight(true);
                    newTiles = newTiles.slice(emptySpots);
                }

                $(newTiles).matchHeight(true);
                if ($(self.scope).hasClass("js-hide-on-load")) {
                    $(self.scope).removeClass("js-hide-on-load");
                }
            });
        }

        // explicitly providing hook to tenants for search rendering
        eventManager.trigger("search-rendered", this.scope, response.page|0, response.perPage|0, response.totalItems|0, this.tileName);

        // call base class implementation
        SearchResultsBase.prototype.appendTiles.call(this);

        if ($(self.scope).hasClass("js-hide-on-load")) {
            $(self.scope).removeClass("js-hide-on-load");
        }

        if (this.initialResultLoaded && this.scrollToPageTop) {
            this.scrollToTopResults();
        }

        // setup the initial release was loaded
        this.initialResultLoaded = !0;
    };

    SearchResults.prototype.getPages = function getPages() {
        if (this.totalPages() <= this.classicPagesToDisplay || this.classicPagesToDisplay <= 0) {
            return this.allPages();
        } else {
            var first = 0,
                ellipsisLimit = 3,
                currentPage = this.currentPage(),
                totalPages = this.totalPages();

            var upperLimit = currentPage + 1;
            if (this.showEllipsisInBetween && totalPages - upperLimit === ellipsisLimit) {
                upperLimit++;
            }

            var downLimit = currentPage - 1;
            if (this.showEllipsisInBetween && currentPage === ellipsisLimit) {
                downLimit--;
            }

            while (upperLimit >= totalPages) {
                upperLimit--;
                if (downLimit > first)
                    downLimit--;
            }

            while (downLimit < first) {
                downLimit++;
                if (upperLimit < totalPages)
                    upperLimit++;
            }

            var pages = [];
            for (var i = downLimit; i <= upperLimit; i++) {
                pages.push(i);
            }

            return ko.observableArray(pages);
        }
    };


    SearchResults.prototype.reloadPage = function reloadPage(pageNumber, forceReload) {
        var tilesPerPage = this.searchClient.searchRequest.perPage;
        var currentPage = parseInt(pageNumber) | 0;
        this.searchClient.searchRequest.perPage = parseInt(tilesPerPage) * (currentPage + 1);
        this.searchClient.searchRequest.page = 0;
        this.searchClient.searchRequest.startPage = 0;
        this.page = 0;
        this.isPageReload = true;
        // Get back the parameters after initial page loading
        var pageLoadedSubscription = eventManager.subscribe("SearchResponseEvent:pageLoaded", function (data) {
            this.searchClient.searchRequest.perPage = tilesPerPage;
            this.searchClient.searchRequest.page = currentPage;
            this.searchClient.searchRequest.startPage = currentPage;
            this.page = currentPage;
            // Ensure that this event handler is called only once
            eventManager.unsubscribe(pageLoadedSubscription);
            this.isPageReload = false;
        }.bind(this));

        if (forceReload) {
            var searchProm = this.searchClient.search().done(this.searchClient.triggerSearchResponseEvent);
        }
    }

    SearchResults.prototype.showPage = function showPage(pageNumber) {
        var searchClient = this.searchClient,
            newPage = pageNumber|0;

        searchClient.searchRequest.page = newPage;
        searchClient.searchRequest.startPage = newPage;

        //urlHelper.setHashValue(window.location, this.id + "page", newPage);

        var searchProm = searchClient.search();
        searchProm.done((function() { this.results.removeAll(); }).bind(this));
        searchProm.done(this.appendTiles.bind(this));
    }

    SearchResults.prototype.showLeftBoundary = function showLeftBoundary() {
        var leftArr = this.getPages().slice(0, 1);
        return leftArr[0] !== 0 && (!this.showEllipsisInBetween || leftArr[0] !== 1);
    }

    SearchResults.prototype.showRightBoundary = function showRightBoundary() {
        var leftArr = this.getPages().slice(-1);
        return leftArr[0] < (this.totalPages() - 1) && (!this.showEllipsisInBetween || leftArr[0] < (this.totalPages() - 2));
    }

    SearchResults.prototype.showPrevPage = function showPrevPage() {
        if (this.currentPage() - 1 >= 0) {
            this.showPage(this.currentPage() - 1);
        }
    }

    SearchResults.prototype.showNextPage = function showNextPage() {
        if (this.currentPage() + 1 < this.totalPages()) {
            this.showPage(this.currentPage() + 1);
        }
    }

    SearchResults.prototype.showFirstPage = function showFirstPage() {
        return this.getPages().slice(0, 1)[0] !== 0;
    }

    SearchResults.prototype.showLastPage = function showFirstPage() {
        return this.getPages().slice(-1)[0] < (this.totalPages() - 1);
    }

    SearchResults.prototype.showLastButOnePage = function showLastButOnePage() {
        return !this.showFirstPage() && this.getPages().slice(-1)[0] < (this.totalPages() - 3);
    }

    SearchResults.prototype.firstPageText = function firstPageText() {
        return "1";
    }

    SearchResults.prototype.lastPageText = function lastPageText() {
        return this.totalPages();
    }

    SearchResults.prototype.lastButOnePageText = function lastPageText() {
        return this.totalPages() - 1;
    }

    SearchResults.init = function init(args) {
        if (args.IsEditorEditing === true) {
            $(args.scope).removeClass("js-hide-on-load");
            return null;
        }

        return new SearchResults(
            args.scope,
            args.UniqueId,
            args.RefreshActionMessages || [],
            args.ShowMessagesTransmitting || [],
            args.LazySearch,
            args.TileName,
            args.SwitchToClassicPager,
            args.ClassicPagerButtonsToDisplay,
            args.ShowPagerEllipsisInBetween,
            args.ScrollToPageTop);
    };

    return SearchResults;
});
define('score_bootstrap/Components/ContentSearch/SearchResultsView',[
    "jquery",
    "knockout",
    "eventManager",
    "moduleLoader",
    "score_bootstrap/Components/ContentSearch/SearchResultsBase",
    "score_bootstrap/Models/Tile",
    "score_bootstrap/Models/Search/PromoTile",
    "imagesLoaded",
    "score_bootstrap/Utils/UrlHelper",
    "matchHeight"

], function (
    $,
    ko,
    eventManager,
    moduleLoader,
    SearchResultsBase,
    Tile,
    PromoTile,
    imagesLoaded,
    urlHelper
) {

    var tileCache = {};

    function SearchResultsView(scope, uniqueId, tilesPerPage, tileName, qvTileName, showEvents, switchToClassicPager, classicPagesToDisplay, showEllipsisInBetween, scrollToPageTop) {
        var promoTiles = $(".score-promo-tile", scope).remove().toArray().map(PromoTile.fromElement).sort(PromoTile.sort),
            showMe = this.show.bind(this),
            quickView;

        this.results = ko.observableArray([]);
        this.currentPage = ko.observable(0);
        this.allPages = ko.observableArray([]);
        this.totalPages = ko.observable(0);
        this.showPager = ko.observable(false);

        Object.defineProperties(this, {
            id: { enumerable: true, value: uniqueId },
            tilesPerPage: { enumerable: true, value: tilesPerPage },
            tileName: { enumerable: true, value: tileName },
            quickViewTileName: { enumerable: true, value: qvTileName },
            scope: { enumerable: false, value: scope },
            $scope: { enumerable: false, value: $(scope) },
            $list: { enumerable: false, value: $(".js-search-results", scope) },
            promoTiles: { enumerable: false, value: promoTiles },
            tiles: {
                get: function () {
                    return $("li", this.$list);
                }
            },
            tilesPerRow: {
                enumerable: false,
                get: function () {
                    return SearchResultsBase.howManyTilesPerRow(this.$list);
                }
            },
            isActive: {
                get:function () {
                    return this.$scope.hasClass("active");
                }
            },
            switchToClassicPager: {enumerable:!1, value: !!switchToClassicPager },
            classicPagesToDisplay: { enumerable: !1, value: classicPagesToDisplay|0 },
            showEllipsisInBetween: { enumerable: !1, value: !!showEllipsisInBetween },
            scrollToPageTop: { enumerable: !1, value: !!scrollToPageTop }
        });

        tileCache[this.id] = {};

        if (showEvents.length) {
            showEvents.forEach(function (ev) {
                eventManager.subscribe(ev, showMe);
            });
        }

        if (this.quickViewTileName) {
            Object.defineProperties(this, {
                quickView: {
                    enumerable: false,
                    get: function () {
                        if (!quickView) {
                            quickView = $(".js-quick-view", scope).data("ccf_module");
                        }
                        return quickView;
                    }
                }
            });
        }

        ko.applyBindings(this, scope);
    }

    SearchResultsView.prototype.reset = function reset() {
        this.$list.empty();
        this.results.removeAll();
        this.allPages.removeAll();
        this.currentPage(0);
    };

    SearchResultsView.prototype.appendTiles = function appendTiles(response, isLoadMore) {
        var newTiles = [], originalQuantity = this.tiles.length, lastRowTiles = [];

        // if the current search result is switched to a classic pager, we should clear results collection 
        // which used to render the result results, so it'll have just current page tiles.
        if (this.switchToClassicPager) {
            this.results.removeAll();
        }

        if (isLoadMore) {
            lastRowTiles = SearchResultsBase.getLastRowTiles(this);
        }

        response.items.forEach(function (item) {
            var tileId = item.id.toString(), tile, cache = tileCache[this.id];

            if (!cache.hasOwnProperty(tileId)) {
                cache[tileId] = { item: item };
            }

            if (!cache[tileId].hasOwnProperty(this.tileName)) {
                cache[tileId][this.tileName] = new Tile(item, this.tileName);
            }

            tile = cache[tileId][this.tileName];
            this.results.push(tile);
            newTiles.push(tile.element());
        }, this);

        // store amount pages for a classic pager
        this.totalPages(response.totalPages);
        this.currentPage(response.page);
        this.allPages.removeAll();
        Array.apply(null, { length: response.totalPages }).map((function (v, i) { this.allPages.push(i); }).bind(this));
        this.showPager(response.totalPages > 1 && this.switchToClassicPager);

        if (!newTiles.length) {
            return [];
        }

        moduleLoader.loadPendingModules(this.$list);
        newTiles = $(newTiles).add(SearchResultsBase.injectPromoTiles(this, originalQuantity));
        $(lastRowTiles).add(newTiles).matchHeight({ byRow: true });

        // Wait to run matchHeight until all the images are loaded since
        // height of images affect the height of the tiles
        imagesLoaded($("img", newTiles), function matchHeightOnNewTiles() {
            $.fn.matchHeight._update();
        });

        if (this.initialResultLoaded && this.scrollToPageTop) {
            this.scrollToTopResults();
        }

        // setup the initial release was loaded
        this.initialResultLoaded = !0;

        // explicitly providing hook to tenants for search rendering
        eventManager.trigger("search-rendered", this.scope, response.page | 0, response.perPage | 0, response.totalItems | 0, this.tileName);

        return newTiles;
    };

    SearchResultsView.prototype.show = function show() {
        $(this).triggerHandler("SearchResultsView.show");
        this.$scope.siblings().removeClass("active in");
        this.$scope.addClass("active in");
    };

    SearchResultsView.prototype.getQuickViewTileByElement = function getQuickViewTileByElement($tile) {
        var tileId = $tile.attr("data-id"), cache = tileCache[this.id][tileId];

        if (!cache.hasOwnProperty(this.quickViewTileName)) {
            cache[this.quickViewTileName] = new Tile(cache.item, this.quickViewTileName);
        }

        return cache[this.quickViewTileName];
    };

    SearchResultsView.prototype.showQuickView = function showQuickView(tile, $activeEl) {
        this.tiles.removeClass("active");
        this.quickView.hide();

        if (!tile) return;

        // Calculate where to insert the quick view
        var index = $activeEl.addClass("active").index(),
            tilesPerRow = this.tilesPerRow,
            totalTiles = this.tiles.length,
            positionInRow,
            quickViewPos,
            mod = totalTiles % tilesPerRow,
            fullRows = Math.floor(totalTiles / tilesPerRow);

        // Prev/Next buttons needs to be adjusted before the quick view li is inserted
        this.quickView.toggleControls(index, this.tiles.length);

        // if the active tile is in the last row and the row is not full, insert the quick view directly after the last tile
        if (mod > 0 && index >= (fullRows * tilesPerRow)) {
            quickViewPos = totalTiles - 1;
        }
            // else insert the quick view after the last tile in the current row
        else {
            positionInRow = (index + 1) % tilesPerRow || tilesPerRow;
            quickViewPos = index + (tilesPerRow - positionInRow);
        }

        $(this.tiles[quickViewPos]).closest("li").after(this.quickView.$scope);
        this.quickView.show(tile, index);
        moduleLoader.loadPendingModules(this.quickView.$body);
        this.tiles.matchHeight({ byRow: true });
    };

    SearchResultsView.prototype.getPages = function getPages() {
        //console.log("classicPagesToDisplay", this.classicPagesToDisplay);
        //console.log('totalPages', this.totalPages());
        if (this.totalPages() <= this.classicPagesToDisplay || this.classicPagesToDisplay <= 0) {
            return this.allPages();
        } else {
            var first = 0,
                ellipsisLimit = 3,
                currentPage = this.currentPage(),
                totalPages = this.totalPages();

            var upperLimit = currentPage + 1;
            if (this.showEllipsisInBetween && totalPages - upperLimit === ellipsisLimit) {
                upperLimit++;
            }

            var downLimit = currentPage - 1;
            if (this.showEllipsisInBetween && currentPage === ellipsisLimit) {
                downLimit--;
            }

            while (upperLimit >= totalPages) {
                upperLimit--;
                if (downLimit > first)
                    downLimit--;
            }

            while (downLimit < first) {
                downLimit++;
                if (upperLimit < totalPages)
                    upperLimit++;
            }

            var pages = [];
            for (var i = downLimit; i <= upperLimit; i++) {
                pages.push(i);
            }

            return ko.observableArray(pages);
        }
    };

    SearchResultsView.prototype.showPage = function showPage(pageNumber) {
        $(this).triggerHandler("SearchResultsView.showPage", pageNumber|0);
    }

    SearchResultsView.prototype.showLeftBoundary = function showLeftBoundary() {
        var leftArr = this.getPages().slice(0, 1);
        return leftArr[0] !== 0 && (!this.showEllipsisInBetween || leftArr[0] !== 1);
    }

    SearchResultsView.prototype.showRightBoundary = function showRightBoundary() {
        var leftArr = this.getPages().slice(-1);
        return leftArr[0] < (this.totalPages() - 1) && (!this.showEllipsisInBetween || leftArr[0] < (this.totalPages() - 2));
    }

    SearchResultsView.prototype.showPrevPage = function showPrevPage() {
        if (this.currentPage() - 1 >= 0) {
            this.showPage(this.currentPage() - 1);
        }
    }

    SearchResultsView.prototype.showNextPage = function showNextPage() {
        if (this.currentPage() + 1 < this.totalPages()) {
            this.showPage(this.currentPage() + 1);
        }
    }

    SearchResultsView.prototype.showFirstPage = function showFirstPage() {
        return this.getPages().slice(0, 1)[0] !== 0;
    }

    SearchResultsView.prototype.showLastPage = function showFirstPage() {
        return this.getPages().slice(-1)[0] < (this.totalPages() - 1);
    }
    SearchResultsView.prototype.showLastButOnePage = function showLastButOnePage() {
        return !this.showFirstPage() && this.getPages().slice(-1)[0] < (this.totalPages() - 3);
    }

    SearchResultsView.prototype.firstPageText = function firstPageText() {
        return "1";
    }

    SearchResultsView.prototype.lastPageText = function lastPageText() {
        return this.totalPages();
    }

    SearchResultsView.prototype.lastButOnePageText = function lastPageText() {
        return this.totalPages() - 1;
    }

    SearchResultsView.init = function initSearchResultsView(args) {
        return new SearchResultsView(
            args.scope,
            args.uniqueId,
            args.TilesPerPage,
            args.TileName,
            args.QuickViewTileName,
            args.ShowActionMessages || [],
            args.SwitchToClassicPager,
            args.ClassicPagerButtonsToDisplay,
            args.ShowPagerEllipsisInBetween,
            args.ScrollToPageTop);
    };

    return SearchResultsView;
});
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/GoogleMap',["jquery", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require('loglevel')) :
    console && console.error('GoogleMap does not support non-amd script loading.');
}(this/* window */, function ($, log) {
    var defaultLat = 0, defaultLng = 0, defaultZoom = 12;

    function GoogleMap(scope, lat, lng, zoom, allowZoom, allowPan) {
        var $mapCanvas = $(".google-map-canvas", scope), $pinElements, center, map, $panel;

        if (!$mapCanvas.length) {
            log.warn("Skipping GoogleMap initialization, cannot find .google-map-canvas element");
            return;
        }
        log.debug(allowPan);
        $pinElements = $(".google-map-pin", $mapCanvas).remove();
        center = new google.maps.LatLng(lat, lng);
        map = new google.maps.Map($mapCanvas[0], {
            center: center,
            zoom: zoom,
            scrollwheel: false,
            zoomControl: allowZoom,
            disableDoubleClickZoom: !allowZoom,
            draggable: allowPan,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            panControl: allowPan
        });

        $pinElements.each(function () {
            var $pin = $(this);
            var description = $pin.html().trim();
            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(parseFloat($pin.attr("data-lat")), parseFloat($pin.attr("data-lng"))),
                map: map,
                title: $pin.attr("data-title"),
                cursor: description ? 'pointer' : 'default'
            });

            if (description) {
                description = new google.maps.InfoWindow({ content: description });
                marker.addListener('click', function () {
                    description.open(map, marker);
                });
            }
        });

        google.maps.event.addListenerOnce(map, "idle", (function ($canvas) {
            var $iframe = $("iframe", $canvas);
            if ($iframe.length > 0) {
                $iframe.attr("title", "Google Map");
            }
        }).bind(null, $mapCanvas));

        $mapCanvas.show();

        // The map must be visible at the time when it is rendered, otherwise it does not render correctly.
        // In some cases, it is not visible on page load and needs to be rerendered manually.
        function rerender() {
            google.maps.event.trigger(map, 'resize');
            map.setCenter(center);
            map.setZoom(zoom);
        }

        // If the map is inside a variable column then it needs to be rerendered after it has been
        // initialized, otherwise it looks weird because its initialized while the width is 0.
        if ($mapCanvas.closest(".score-variable-column").length) {
            rerender();
        }

        // If the map is inside a hidden accordion/tab/modal panel, it needs to be rerendered when that panel is made visible.
        $panel = $mapCanvas.closest(".score-accordion-panel");
        if ($panel.length) {
            $panel.on("shown.bs.collapse", rerender);
        }

        $panel = $mapCanvas.closest(".score-tab");
        if ($panel.length) {
            $panel.on("shown.bs.tab", rerender);
        }

        $panel = $mapCanvas.closest(".score-modal");
        if ($panel.length) {
            $panel.on("shown.bs.modal", rerender);
        }

        // If the map is inside a hidden carousel pane it needs to be rerendered when that pane is made visible.
        $panel = $mapCanvas.closest(".score-carousel");
        if ($panel.length) {
            $panel.on("slid.bs.carousel", rerender);
        }
    }

    GoogleMap.init = function init(args) {
        return args.IsEditorEditing === true ? null : new GoogleMap(
            args.scope,
            parseFloat(args.Latitude) || defaultLat,
            parseFloat(args.Longitude) || defaultLng,
            parseInt(args.ZoomLevel || defaultZoom, 10),
            Boolean(args.AllowsZoom),
            Boolean(args.AllowsPan)
        );
    };

    //requireJS load handler - used for passing google maps key to require module definition
    GoogleMap.load = function (name, req, onLoad) {
        // load google deps with google key
        require(["https://maps.googleapis.com/maps/api/js?v=quarterly&key=" + name + "&libraries=places"], function () {
            onLoad(GoogleMap);
        });
    }

    return GoogleMap;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/IFrame',["jquery", "eventManager"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('Iframe does not support non-amd script loading.');
}(this/* window */, function ($, eventManager) {

    function Iframe(scope) {
        ///<summary>Initialize a new instance of Iframe. Subscribe to messages which are passed to current instance.</summary>

        var self = this;
        Object.defineProperty(this, '$scope', { enumerable: true, value: $(scope) });


        var iframeComp = $('iframe', this.$scope);

        // #region calculate the size with 4:3 ratio
        if (!!iframeComp.length && iframeComp.data('autosize') !== 'disabled') {
            //var iframeHolder = iframeComp.parent();
            var width = this.calculateSize(); // iframeHolder.width();

            //This calculation will set the size to a 4:3 ratio.
            iframeComp.css({
                'height': (width / 1.25 | 0) + 'px', 
                'width': width + 'px'
            });
        }
        //#endregion
    }

    Iframe.prototype.calculateSize = function () {
        var tempProps = { /* 'position': 'absolute', */ 'display': 'block', 'visibility': 'hidden' };
        var $hiddenEls = $(this.$scope.parents().addBack().not(':visible').get());
        var savedProps = [];

        // make parents to be hidden, but allocate their size on a page.
        $hiddenEls.each(function () {
            var $this = $(this);
            // preserved props
            var pProps = {};
            for (var key in tempProps) {
                pProps[key] = this.style[key];
                $this.css(key, tempProps[key]);
            }

            savedProps.push(pProps);
        });

        // calculate the size
        var width = this.$scope.width();

        // revert css changes back, to the original
        $hiddenEls.each(function () {
            var $this = $(this);
            var props = savedProps.shift();
            for (var key in tempProps) {
                $this.css(key, props[key]);
            }
        });

        // return size
        return width;
    }

    Iframe.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new Iframe(args.scope);
    };

    return Iframe;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/KalturaVideo',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('Kaltura Video does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function KalturaVideo(scope, targetId, wid, uiconfid, videoId, autoPlay, allowFullScreen, closedCaptions, stateChangeMessages, onPlayMessagesPerformer, onPauseMessagePerformer) {
        ///<summary>Initialize a new instance of KalturaVideo. Subscribe to messages which are passed to current instance.</summary>

        var self = this, instance = {};
        instance.stateChangeMessages = stateChangeMessages.slice();
        
        Object.defineProperties(this, {
            scope: { enumerable: true, value: scope },
            $scope: { enumerable: true, value: $(scope) },
            stateChangeMessages: {
                enumerable: true,
                get: function () {
                    return instance.stateChangeMessages.slice();
                }
            },
            trackPlayStartTimeout: {
                enumerable: !1,
                value: void 0,
                writable: !0
            },
            trackTimelineInterval: {
                enumerable: !1,
                value: void 0,
                writable: !0,
            },
            currentTime: {
                enumerable: !1,
                get: function() {
                    return this.player ? Math.floor(this.player.evaluate('{video.player.currentTime}')) : void 0;
                }
            }
        });
        
        this.addStateChangeMessage = function addStateChangeMessage(message) {
            if (!message) return;
            if (instance.stateChangeMessages.indexOf(message) > -1) {
                log.debug("Component is already registered for event " + message);
                return;
            }
            
            instance.stateChangeMessages.push(String(message));
        };

        //#region play message performer
        if (onPlayMessagesPerformer.length) {
            onPlayMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.play, self);
            });
        }
        //#endregion

        //#region show messages performer
        if (onPauseMessagePerformer.length) {
            onPauseMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.pause, self);
            });
        }
        //#endregion
        
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }

        Object.defineProperties(this,
            {
                videoId: { enumerable: !1, value: videoId },
                player: { enumerable: !1, value: void 0, writable: !0 }
            });

        var flashVars = { // flashvars allows you to set runtime uiVar configuration overrides. 
            'autoPlay': !!autoPlay,
            'autoMute': !!autoPlay
        }

        if (!!closedCaptions) {
            flashVars.closedCaptions = {
                'hideWhenEmpty': true
            };
        }

        kWidget.embed({
            'targetId': targetId,
            'wid': wid,
            'uiconf_id': uiconfid,
            'entry_id' : videoId,
            'flashvars': flashVars,
            'params':{ // params allows you to set flash embed params such as wmode, allowFullScreen etc
                    'wmode': 'transparent'
            },
            'readyCallback' : (function(playerId) {
                var player = document.querySelector('#' + playerId);
                this.player = player;
                //this.player.kBind('playerPlayed', this._onPlayHandler.bind(this));
                this.player.kBind('playerPaused', this._onPauseHandler.bind(this));
                this.player.kBind('playerPlayEnd', this._onEndedHandler.bind(this));
                this.player.kBind('playerStateChange', this._onStateChange.bind(this));

            }).bind(this)
        });

        mw.setConfig('EmbedPlayer.EnableFullscreen', !!allowFullScreen);
    }

    KalturaVideo.prototype._onStateChange = function (playerState) {
        if (playerState === 'playing') {
            this._onPlayHandler();
        }
    }
    KalturaVideo.prototype._onPlayHandler = function () {
        if (this.currentTime === 0) {
            $(this).trigger('start.video', [this.currentTime]);
        }

        $(this).trigger('update.timeline', [this.currentTime]);
        this.startTrackTimeline();
    }

    KalturaVideo.prototype._onPauseHandler = function () {
        this.stopTrackTimeline();
        if (Math.floor(this.player.evaluate('{duration}')) != this.currentTime) {
            $(this).trigger('pause.video', [this.currentTime]);
        }
    }

    KalturaVideo.prototype._onEndedHandler = function () {
        this.stopTrackTimeline();
        $(this).trigger('end.video', [this.currentTime]);
    }

    KalturaVideo.prototype.startTrackTimeline = function () {
        if (this.trackTimelineInterval) {
            clearInterval(this.trackTimelineInterval);
        }

        this.trackTimelineInterval = setInterval((function () {
            $(this).trigger('update.timeline', [this.currentTime]);
        }).bind(this), 1000 /* 1 second */);

        $(this).trigger('update.timeline', [this.currentTime]);
    }

    KalturaVideo.prototype.stopTrackTimeline = function () {
        if (this.trackTimelineInterval) {
            clearInterval(this.trackTimelineInterval);
        }
    }

    KalturaVideo.prototype.play = function () {
        ///<summary>Start playing the video.</summary>
        var kdp = this.$scope.find('.kaltura-wrapper')[0];
        kdp.sendNotification("doPlay");
        this.transmitStateChange();
    }

    KalturaVideo.prototype.pause = function () {
        ///<summary>Put the video on pause.</summary>
        var kdp = this.$scope.find('.kaltura-wrapper')[0];
        kdp.sendNotification("doPause");
        this.transmitStateChange();
    }

    KalturaVideo.prototype.transmitStateChange = function () {
        var messages = this.stateChangeMessages, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self, self.player);
            });
        }

    }
    // #endregion

    KalturaVideo.init = function init(args) {
        if (args.IsEditorEditing) return null;

        var video = new KalturaVideo(args.scope, args.targetId, args.wid, args.uiconfid, args.videoId, args.autoPlay, args.allowFullScreen, args.closedCaptions,
            args.StateChangeMessagesTransmitting || [],
            args.PlayActionMessages || [],
            args.PauseActionMessages || []);

        return video;
    };

    //requireJS load handler - used for passing Kaltura PartnerId and Kaltura UiConf Id kto require module definition
    KalturaVideo.load = function (name, req, onLoad) {
        if (!name || name.length <= 0) {
            log.error("Cannot load Kaltura API, please specify KalturaParnerId and KalturaUiConfId");
            return;
        }

        var nameParts = name.split('|');

        var partnerId = nameParts[0];
        var uiConfId = nameParts[1];

        // load kaltura deps with google key
        require(["//cdnapi.kaltura.com/p/" + partnerId + "/sp/" + partnerId + "00/embedIframeJs/uiconf_id/" + uiConfId + "/partner_id/" + partnerId], function () {
            onLoad(KalturaVideo);
        });
    }

    return KalturaVideo;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/MegaMenuButtonMenu',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('MegaMenuButtonMenu does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function MegaMenuButtonMenu(scope, clickMessagesTransmitting, stateChangeMessages, onShowMessagesTransmitter, onHideMessageTransmitter) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });


        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", "button", function() {
                clickMessagesTransmitting.forEach(function(eventName) {
                    log.debug("MegaMenuButtonMenu raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                // don't hide event, otherwise bootstrap dropdown won't ever open.
                return 1;
            });
        }
        //#endregion

        //#region state change message transmitter registration
        if (stateChangeMessages.length) {
            this.$scope.on("shown.bs.dropdown hidden.bs.dropdown", function () {
                stateChangeMessages.forEach(function (eventName) {
                    log.debug("MegaMenuButtonMenu raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion

        //#region on show message transmitter registration
        if (onShowMessagesTransmitter.length) {
            this.$scope.on("shown.bs.dropdown", function() {
                onShowMessagesTransmitter.forEach(function(eventName) {
                    log.debug("MegaMenuButtonMenu raises message: '%s'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion

        //#region on hide message transmitter registration
        if (onHideMessageTransmitter.length) {
            this.$scope.on("hidden.bs.dropdown", function() {
                onHideMessageTransmitter.forEach(function(eventName) {
                    log.debug("MegaMenuButtonMenu raises message: '%s'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion

    }

    MegaMenuButtonMenu.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new MegaMenuButtonMenu(args.scope,
                                  args.ClickMessagesTransmitting || [],
                                  args.StateChangeMessagesTransmitting || [],
                                  args.ShowMessagesTransmitting || [],
                                  args.HideMessagesTransmitting || []);
    };

    return MegaMenuButtonMenu;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/MegaMenuItem',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('MegaMenuItem does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function MegaMenuItem(scope, clickMessagesTransmitting) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });

        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", "a.dropdown-toggle.toggle-caret", function (e) {
                e.preventDefault();

                clickMessagesTransmitting.forEach(function (eventName) {
                    log.debug("MegaMenuItem raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return 1;
            });
        }
        //#endregion
    }

    MegaMenuItem.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new MegaMenuItem(args.scope, args.ClickMessagesTransmitting || []);
    };

    return MegaMenuItem;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/MenuListImageLink',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('MenuListImageLink does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function MenuListImageLink(scope, clickMessagesTransmitting) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });


        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", "a", function (e) {
                e.preventDefault();

                clickMessagesTransmitting.forEach(function (eventName) {
                    log.debug("MenuListImageLink raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion
    }

    MenuListImageLink.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new MenuListImageLink(args.scope,
                                args.ClickMessagesTransmitting || []);
    };

    return MenuListImageLink;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/MenuListItem',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('MenuListItem does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function MenuListItem(scope, clickMessagesTransmitting) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });


        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", "a", function (e) {
                e.preventDefault();

                clickMessagesTransmitting.forEach(function (eventName) {
                    log.debug("MenuListItem raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion
    }

    MenuListItem.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new MenuListItem(args.scope, args.ClickMessagesTransmitting || []);
    };

    return MenuListItem;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Modal',["jquery", "eventManager"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('Modal does not support non-amd script loading.');
}(this/* window */, function ($, eventManager) {

    function Modal(scope, stateChangeMessages, onShowMessagePerformer, onHideMessagePerformer, onShowMessagesTransmitter, onHideMessageTransmitter) {
        ///<summary>Initialize a new instance of Panel. Subscribe to messages which are passed to current instance.</summary>

        var self = this;
        //Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });
        Object.defineProperties(this,
        {
            $scope: { enumerable: true, value: $(scope) },
            onShowMessagesTransmitter: {
                enumerable: true,
                value: onShowMessagesTransmitter.slice()
            },
            onHideMessageTransmitter: {
                enumerable: true,
                value: onHideMessageTransmitter.slice()
            }
        });


        function doShow() {
            self.show();
            if (stateChangeMessages.length) {
                stateChangeMessages.forEach(function (ev) {
                    eventManager.trigger(ev, "shown");
                });
            }
        }

        function doHide() {
            self.hide();
            if (stateChangeMessages.length) {
                stateChangeMessages.forEach(function (ev) {
                    eventManager.trigger(ev, "hidden");
                });
            }
        }

        if (onShowMessagePerformer.length) {
            onShowMessagePerformer.forEach(function (ev) {
                eventManager.subscribe(ev, doShow);
            });
        }

        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (ev) {
                eventManager.subscribe(ev, doHide);
            });
        }

        //this.$scope.find(".modal-header button.close").on("click", doHide);
        this.$scope.on('hidden.bs.modal', doHide);
        this.$scope.on('shown.bs.modal', doShow);
    }

    Modal.prototype.show =  function show() {
        this.$scope.modal("show");
        this.$scope.attr("aria-hidden", "false")
        this.notifyOnShow();
    };

    Modal.prototype.notifyOnShow = function () {
        var self = this;
        if (this.onShowMessagesTransmitter.length) {
            this.onShowMessagesTransmitter.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    }

    Modal.prototype.hide =  function hide() {
        this.$scope.modal("hide");
        this.$scope.attr("aria-hidden", "true")
        this.notifyOnHide();
    };

    Modal.prototype.notifyOnHide = function() {
        var self = this;
        if (this.onHideMessageTransmitter.length) {
            this.onHideMessageTransmitter.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    }

    Modal.init = function init(args) {
        return args.IsEditorEditing === true ? null : new Modal(
            args.scope,
            args.StateChangeMessagesTransmitting || [],
            args.ShowActionMessages || [],
            args.HideActionMessages || [],
            args.ShowMessagesTransmitting || [],
            args.HideMessagesTransmitting || []
        );
    };

    return Modal;
}));
define('score_bootstrap/Models/Liking/PageLikingModel',[],function () {
    "use strict";

    function PageLikingModel() {

        var instance = {
                userName: '',
                dateLiked: null
            };

        Object.defineProperties(this, {

            userName: {
                enumerable: true,
                get: function () { return instance.userName; },
                set: function (value) {
                    if (value) {
                        instance.userName = String(value);
                    }
                }
            },

            isLiked: {
                enumerable: true,
                get: function () { return instance.isLiked; },
                set: function (value) {
                    if (value) {
                        instance.isLiked = true;
                    } else {
                        instance.isLiked = false;
                    }
                }
            },

            pageId: {
                enumerable: true,
                get: function () { return instance.pageId; },
                set: function (value) {
                    if (value) {
                        instance.pageId = String(value);
                    }
                }
            },

            siteName: {
                enumerable: true,
                get: function () { return instance.siteName; },
                set: function (value) {
                    if (value) {
                        instance.siteName = String(value);
                    }
                }
            },

            pageVersion: {
                enumerable: true,
                get: function () { return instance.pageVersion; },
                set: function (value) {
                    if (value) {
                        instance.pageVersion = String(value);
                    }
                }
            },

            uniqueId: {
                enumerable: true,
                get: function () { return instance.uniqueId; },
                set: function (value) {
                    if (value) {
                        instance.uniqueId = String(value);
                    }
                }
            },

            language: {
                enumerable: true,
                get: function () { return instance.language; },
                set: function (value) {
                    if (value) {
                        instance.language = String(value);
                    }
                }
            },
            
            dateLiked: {
                enumerable: true,
                get: function () { return instance.dateLiked; },
                set: function (value) {
                    if (value) {
                        instance.dateLiked = Date(value);
                    } else {
                        instance.dateLiked = null;
                    }
                    
                }
            },

            isInProgress: {
                enumerable: true,
                get: function () { return instance.isInProgress; },
                set: function (value) {
                    if (value) {
                        instance.isInProgress = true;
                    } else {
                        instance.isInProgress = false;
                    }
                }
            }
        });
    }

    return PageLikingModel;
});
define('score_bootstrap/Components/PageLike',[
    "jquery",
    "knockout",
    "score_bootstrap/Models/Liking/PageLikingModel",
    "eventManager"
], function (
    $,
    ko,
    PageLikingModel,
    eventManager
) {
    "use strict";

    function PageLike(scope, renderingParameters, isLiked, likeNumber, dateLiked, userName, pageId, siteName, pageVersion, uniqueId, language, likePageApiUrl) {
        var self = this;
        var instance = {};
        instance.pageLikeMessagesTransmitting = renderingParameters.PageLikeMessagesTransmitting.slice();
        instance.unlikeMessagesTransmitting = renderingParameters.UnlikeMessagesTransmitting.slice();
        instance.showMessagesTransmitting = renderingParameters.ShowMessagesTransmitting.slice();
        instance.hideMessagesTransmitting = renderingParameters.HideMessagesTransmitting.slice();
        instance.clickMessagesTransmitting = renderingParameters.ClickMessagesTransmitting.slice();

        this.likeNumber = ko.observable(likeNumber);
        this.isLiked = ko.observable(isLiked);
        this.show = ko.observable(true);

        initializePageLikingModel();

        var pageLikingModel;
        function initializePageLikingModel() {
            pageLikingModel = new PageLikingModel();
            if (userName !== undefined) pageLikingModel.userName = userName;
            if (pageId !== undefined) pageLikingModel.pageId = pageId;
            if (dateLiked !== undefined) pageLikingModel.dateLiked = dateLiked;
            if (siteName !== undefined) pageLikingModel.siteName = siteName;
            if (pageVersion !== undefined) pageLikingModel.pageVersion = pageVersion;
            if (uniqueId !== undefined) pageLikingModel.uniqueId = uniqueId;
            if (language !== undefined) pageLikingModel.language = language;
            if (isLiked !== undefined) pageLikingModel.isLiked = isLiked;
        }

        Object.defineProperties(this, {
            pageLikingModel: { value: pageLikingModel },
            likePageApiUrl: { value: likePageApiUrl },
            pageLikeMessagesTransmitting: {
                enumerable: true,
                get: function () {
                    return instance.pageLikeMessagesTransmitting.slice();
                }
            },
            unlikeMessagesTransmitting: {
                enumerable: true,
                get: function () {
                    return instance.unlikeMessagesTransmitting.slice();
                }
            },
            showMessagesTransmitting: {
                enumerable: true,
                get: function () {
                    return instance.showMessagesTransmitting.slice();
                }
            },
            hideMessagesTransmitting: {
                enumerable: true,
                get: function () {
                    return instance.hideMessagesTransmitting.slice();
                }
            },
            clickMessagesTransmitting: {
                enumerable: true,
                get: function () {
                    return instance.clickMessagesTransmitting.slice();
                }
            }
        });

        this.clickOnLike = function () {
            if (!self.pageLikingModel.isLiked) {
                self.pageLikeAction();
            } else {
                self.pageUnlikeAction();
            }
        }

        this.pageLikeAction = function () {
            if (!self.pageLikingModel.isLiked && !self.pageLikingModel.isInProgress) {
                self.pageLikingModel.isLiked = true;
                self.pageLikingModel.isInProgress = true;
                self.likePageRequest().then(function (data) {
                    self.likeNumber(data.LikesCount);
                    self.isLiked(data.IsLiked);
                    self.pageLikingModel.isInProgress = false;
                });

                self.transmitPageLikeMessage();
                self.transmitShowMessage();
                self.transmitClickMessage();
            }
        }

        this.pageUnlikeAction = function () {
            if (self.pageLikingModel.isLiked && !self.pageLikingModel.isInProgress) {
                self.pageLikingModel.isLiked = false;
                self.pageLikingModel.isInProgress = true;
                self.likePageRequest().then(function (data) {
                    self.likeNumber(data.LikesCount);
                    self.isLiked(data.IsLiked);
                    self.pageLikingModel.isInProgress = false;
                });

                self.transmitResetPageLikeMessage();
                self.transmitHideMessage();
                self.transmitClickMessage();
            }
        }

        this.showLike = function () {
            self.show(true);
        }

        this.hideLike = function () {
            self.show(false);
        }

        if (renderingParameters.PageLikeActionMessage.length) {
            renderingParameters.PageLikeActionMessage.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.pageLikeAction, self);
            });
        }

        if (renderingParameters.PageUnlikeActionMessage.length) {
            renderingParameters.PageUnlikeActionMessage.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.pageUnlikeAction, self);
            });
        }

        if (renderingParameters.ShowActionMessages.length) {
            renderingParameters.ShowActionMessages.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.showLike, self);
            });
        }

        if (renderingParameters.HideActionMessages.length) {
            renderingParameters.HideActionMessages.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hideLike, self);
            });
        }

        if (this.pageLikeMessagesTransmitting.length) {
            this.pageLikeMessagesTransmitting.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }

        if (this.unlikeMessagesTransmitting.length) {
            this.unlikeMessagesTransmitting.forEach(function(ev) {
                eventManager.trigger(ev, self);
            });
        }

        ko.applyBindings(this, scope);
    }

    PageLike.prototype.transmitPageLikeMessage = function () {
        var messages = this.pageLikeMessagesTransmitting, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    }

    PageLike.prototype.transmitResetPageLikeMessage = function () {
        var messages = this.unlikeMessagesTransmitting, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    }

    PageLike.prototype.transmitShowMessage = function () {
        var messages = this.showMessagesTransmitting, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    }

    PageLike.prototype.transmitHideMessage = function () {
        var messages = this.hideMessagesTransmitting, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    }

    PageLike.prototype.transmitClickMessage = function () {
        var messages = this.clickMessagesTransmitting, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    }
    
    PageLike.prototype.likePageRequest = function likePageRequest() {
        var jqXHR = $.ajax({
            url: this.likePageApiUrl,
            data: JSON.stringify(this.pageLikingModel),
            type: "POST",
            contentType: "application/json; charset=utf-8",
            dataType: "json"
        });

        return jqXHR;
    }

    PageLike.init = function init(args) {
        return args.IsExperienceEditorEditing === true ? null :
            new PageLike(args.scope, args.RenderingParameters, args.IsLiked, args.LikeNumber, args.DateLiked, args.UserName, args.PageId, args.SiteName, args.PageVersion, args.UniqueId, args.Language, args.LikePageApiUrl);
    };

    return PageLike;
});
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Panel',["jquery", "eventManager"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('Panel does not support non-amd script loading.');
}(this/* window */, function ($, eventManager) {

    function Panel(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {
        ///<summary>Initialize a new instance of Panel. Subscribe to messages which are passed to current instance.</summary>

        var self = this;
        Object.defineProperty(this, "scope", { enumerable: true, value: scope });
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });
        Object.defineProperty(this, "stateChangeMessages", { enumerable: true, value: stateChangeMessages.slice() });

        //#region show messages performer
        if (onShowMessagesPerformer.length) {
            onShowMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });

        }
        //#endregion


        //#region hide mesage performer
        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        }
        //#endregion

        // https://brainjocks.atlassian.net/browse/SCORE-1334
        // prevents Alert being removed from DOM, when X button is clicked
        self.$scope.on('close.bs.alert', function () {
            self.$scope.hide();
            return false;
        });
    }

    Panel.prototype.show = function () {
        ///<summary>Make panel visible with jQuery.show() method.</summary>
        this.$scope.show();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Panel.prototype.hide = function () {
        ///<summary>Make panel hidden with jQuery.hide() method.</summary>
        this.$scope.hide();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Panel.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new Panel(args.scope,
                        args.StateChangeMessagesTransmitting || [],
                        args.ShowActionMessages || [],
                        args.HideActionMessages || []);
    };

    return Panel;
}));
; (function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/Picture',["jquery", "eventManager", "picturefill"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require("picturefill")) :
    console && console.error('Picture does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, picturefill) {

    function Picture(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {
        ///<summary>Initialize a new instance of Picture. </summary>

        var self = this;
        Object.defineProperty(this, '$scope', { enumerable: true, value: $(scope) });
        Object.defineProperty(this, "stateChangeMessages", { enumerable: true, value: stateChangeMessages.slice() });

        //#region show messages performer
        if (onShowMessagesPerformer.length) {
            onShowMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });

        }
        //#endregion


        //#region hide mesage performer
        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        }
        //#endregion

        picturefill({ context: this.$scope.get(0) });
    }

    Picture.prototype.show = function () {
        ///<summary>Make panel visible with jQuery.show() method.</summary>
        this.$scope.show();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Picture.prototype.hide = function () {
        ///<summary>Make panel hidden with jQuery.hide() method.</summary>
        this.$scope.hide();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    Picture.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new Picture(args.scope,
                args.StateChangeMessagesTransmitting || [],
                args.ShowActionMessages || [],
                args.HideActionMessages || []);
    };

    return Picture;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/PictureHero',["jquery", "eventManager", "score_bootstrap/Base/PictureAsBackground"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require("score_bootstrap/Base/PictureAsBackground")) :
    console && console.error('PictureHero does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, PictureAsBackground) {
    
    function PictureHero(scope) {
        ///<summary>Initialize a new instance of PictureStripe.</summary>

        Object.defineProperty(this, "$scope", { enumerable: !0, value: $(scope) });

        PictureAsBackground.call(this, scope, '> picture', '> .score-editField-group > .pic-thumb > picture');
    }

    PictureHero.prototype = Object.create(PictureAsBackground.prototype);

    PictureHero.init = function init(args) {
        return new PictureHero(args.scope);
    };

    return PictureHero;
}));
; (function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/PictureHighlight',["picturefill"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("picturefill")) :
    console && console.error('Picture does not support non-amd script loading.');
}(this/* window */, function (picturefill) {

    // Loads picturefill.js to support <picture> tag in IE

}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/PictureStripe',["jquery", "eventManager", "score_bootstrap/Base/PictureAsBackground"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require("score_bootstrap/Base/PictureAsBackground")) :
    console && console.error('PictureStripe does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, PictureAsBackground) {
    
    function PictureStripe(scope) {
        ///<summary>Initialize a new instance of PictureStripe.</summary>

        Object.defineProperty(this, "$scope", { enumerable: !0, value: $(scope) });

        PictureAsBackground.call(this, scope, '> picture', '> .score-editField-group > .pic-thumb > picture');
    }

    PictureStripe.prototype = Object.create(PictureAsBackground.prototype);

    PictureStripe.init = function init(args) {
        return new PictureStripe(args.scope);
    };

    return PictureStripe;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/PictureStyleBox',["jquery", "eventManager", "score_bootstrap/Base/PictureAsBackground"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require("score_bootstrap/Base/PictureAsBackground")) :
    console && console.error('PictureStyleBox does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, PictureAsBackground) {
    
    function PictureStyleBox(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {
        ///<summary>Initialize a new instance of StyleBox. Subscribe to messages which are passed to current instance.</summary>

        var self = this;

        Object.defineProperty(this, "$scope", { enumerable: !0, value: $(scope) });
        Object.defineProperty(this, "stateChangeMessages", { enumerable: !0, value: stateChangeMessages.slice() });

        //#region show messages performer
        if (onShowMessagesPerformer.length) {
            onShowMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });

        }
        //#endregion


        //#region hide mesage performer
        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        }
        //#endregion

        PictureAsBackground.call(this, scope, '> picture', '> .score-editField-group > .pic-thumb > picture');

    }

    PictureStyleBox.prototype = Object.create(PictureAsBackground.prototype);

    PictureStyleBox.prototype.show = function () {
        ///<summary>Make StyleBox visible with jQuery.show() method.</summary>
        this.$scope.show();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    PictureStyleBox.prototype.hide = function () {
        ///<summary>Make StyleBox hidden with jQuery.hide() method.</summary>
        this.$scope.hide();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    PictureStyleBox.init = function init(args) {
        return new PictureStyleBox(args.scope,
                                   args.StateChangeMessagesTransmitting || [],
                                   args.ShowActionMessages || [],
                                   args.HideActionMessages || []);
    };

    return PictureStyleBox;
}));
define('ANSI/UIComponents/SlickSliderExtended',['jquery', 'slick'], function ($) {
    function SlickSlider(scope, args) {
        Object.defineProperty(this, 'scope', { enumerable: true, value: scope, writable: !1 });
        Object.defineProperty(this, '$scope', { enumerable: !0, value: $(scope) });
        Object.defineProperty(this, 'lastDirection', { enumerable: !1, value: void 0, writable: !0 });

        var fade = $(scope).hasClass('slide-fade') || false;

        var settings = {
            autoplay: args.Speed > 0,
            autoplaySpeed: args.Speed,
            slidesToShow: args.SlidesToShow || 1,
            slidesToScroll: args.SlidesToScroll || 1,

            // defaults
            dots: true,
            responsive: [],

            // extensions
            fade: fade
        };

        if (args.ResponsiveDisplay) {
            var breakpointsArray = [];
            args.ResponsiveDisplay.split('|').forEach(function (kvp) {
                var breakpointValue = kvp.split('=')[0];
                var slidesToShowCount = kvp.split('=')[1];
                var breakpoint = {
                    breakpoint: breakpointValue,
                    settings: {
                        slidesToShow: slidesToShowCount,
                        slidesToScroll: Math.min(args.SlidesToScroll, slidesToShowCount)
                    }
                };

                breakpointsArray.push(breakpoint);
            });

            settings.responsive.push(breakpointsArray);
        }

        var slickSlider = this.$scope.slick(settings)[0].slick;
        Object.defineProperty(this, 'slider', { enumerable: !0, value: slickSlider, writable: !1, configurable: !0 });

        slickSlider.slideHandler = this._captureDirection.bind(this, slickSlider, slickSlider.slideHandler);
        this.$scope.on('afterChange', this._onAfterChangeSlide.bind(this));
        this.$scope.on('beforeChange', this._onBeforeChangeSlide.bind(this));
    }

    /**
     * Capture slider direction, it can be done only with raw parameters received in slideHandler function.
     * @param {} slider an instance of a slider, to run the original function in a context of it
     * @param {} baseFn a reference to the original slideHandler function
     * @param {} index unmodified index number, to understand direction
     * @returns {}
     */
    SlickSlider.prototype._captureDirection = function (slider, baseFn, index) {
        this.lastDirection = index > slider.currentSlide ? 'left' : 'right';
        baseFn.apply(slider, Array.prototype.slice.call(arguments, 2));
    };

    /**
     * Notify the world about slide is going to be changed
     */
    SlickSlider.prototype._onBeforeChangeSlide = function () {
        $(this).trigger('beforeChange.slider', [this, this.lastDirection]);
    };

    /**
     * Notify the world about slide was changed
     * @param {jQuery.Event} event from bootstrap carousel
     */
    SlickSlider.prototype._onAfterChangeSlide = function () {
        $(this).trigger('afterChange.slider', [this, this.lastDirection]);
    };

    SlickSlider.init = function (args) {
        if (args.IsEditorEditing) return null;

        var slick = new SlickSlider(args.scope, args);

        return slick;
    };

    return SlickSlider;
});

;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/SplitButtnMenu',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('SplitButtonMenu does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function SplitButtonMenu(scope, clickMessagesTransmitting, stateChangeMessages, onShowMessagesTransmitter, onHideMessageTransmitter) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });


        //#region click messages transmitting registration
        if (clickMessagesTransmitting.length) {
            this.$scope.on("click", "button", function() {
                clickMessagesTransmitting.forEach(function(eventName) {
                    log.debug("SplitButtonMenu raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return 1;
            });
        }
        //#endregion

        //#region state change message transmitter registration
        if (stateChangeMessages.length) {
            this.$scope.on("shown.bs.dropdown hidden.bs.dropdown", function () {
                stateChangeMessages.forEach(function (eventName) {
                    log.debug("SplitButtonMenu raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion

        //#region on show message transmitter registration
        if (onShowMessagesTransmitter.length) {
            this.$scope.on("shown.bs.dropdown", function() {
                onShowMessagesTransmitter.forEach(function(eventName) {
                    log.debug("SplitButtonMenu raises message: '%s'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion

        //#region on hide message transmitter registration
        if (onHideMessageTransmitter.length) {
            this.$scope.on("hidden.bs.dropdown", function() {
                onHideMessageTransmitter.forEach(function(eventName) {
                    log.debug("SplitButtonMenu rauses message: '%s'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return !1;
            });
        }
        //#endregion

    }

    SplitButtonMenu.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new SplitButtonMenu(args.scope,
                                  args.ClickMessagesTransmitting || [],
                                  args.StateChangeMessagesTransmitting || [],
                                  args.ShowMessagesTransmitting || [],
                                  args.HideMessagesTransmitting || []);
    };

    return SplitButtonMenu;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/StyleBox',["jquery", "eventManager"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager")) :
    console && console.error('StyleBox does not support non-amd script loading.');
}(this/* window */, function ($, eventManager) {

    function StyleBox(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {
        ///<summary>Initialize a new instance of StyleBox. Subscribe to messages which are passed to current instance.</summary>

        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });
        Object.defineProperty(this, "stateChangeMessages", { enumerable: true, value: stateChangeMessages.slice() });

        //#region show messages performer
        if (onShowMessagesPerformer.length) {
            onShowMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });

        }
        //#endregion


        //#region hide mesage performer
        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        }
        //#endregion
    }

    StyleBox.prototype.show = function () {
        ///<summary>Make StyleBox visible with jQuery.show() method.</summary>
        this.$scope.show();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    StyleBox.prototype.hide = function () {
        ///<summary>Make StyleBox hidden with jQuery.hide() method.</summary>
        this.$scope.hide();

        var self = this;
        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
    };

    StyleBox.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new StyleBox(args.scope,
                        args.StateChangeMessagesTransmitting || [],
                        args.ShowActionMessages || [],
                        args.HideActionMessages || []);
    };

    return StyleBox;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/TabPanel',["jquery", "eventManager", 'loglevel'], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel')) :
    console && console.error('TabPanel does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function TabPanel(scope, stateChangeMessages, onShowMessagesPerformer, onHideMessagePerformer) {
        ///<summary>Initialize a new instance of TabPanel. Subscribe to messages which are passed to current instance.</summary>

        var self = this;
        Object.defineProperty(this, "scope", { enumerable: true, value: scope });
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });

        //#region state change message transmitter registration
        if (stateChangeMessages.length) {
            $("a[href='#" + this.$scope.attr("id") + "']").on("shown.bs.tab hidden.bs.tab", function () {
                stateChangeMessages.forEach(function (eventName) {
                    log.debug("TabPanel raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return!1;
            });
        }
        //#endregion

        //#region show messages performer
        if (onShowMessagesPerformer.length) {
            onShowMessagesPerformer.forEach(function(messageName) {
                eventManager.subscribe(messageName, self.show, self);
            });
        }
        //#endregion

        //#region hide mesage performer
        if (onHideMessagePerformer.length) {
            onHideMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.hide, self);
            });
        }
        //#endregion

        $("a[href='#" + this.$scope.attr("id") + "']")
            .on('show.bs.tab', this._onShowHandler.bind(this))
            .on('hide.bs.tab', this._onHideHandler.bind(this));

    }

    TabPanel.prototype._onShowHandler = function (e) {
        $(this).trigger('focus', [this, e]);
    }

    TabPanel.prototype._onHideHandler = function (e) {
        $(this).trigger('blur', [this, e]);
    }

    /**
     * Make current tab active
     * @returns {} 
     */
    TabPanel.prototype.show = function () {
        $("a[href='#" + this.$scope.attr("id") + "']").tab("show");
    }

    /**
     * Activate the first sibling tab in current tabset. To hide current selected tab
     * @returns {} 
     */
    TabPanel.prototype.hide = function () {
        var siblingTabs = $("a[href='#" + this.$scope.attr("id") + "']")
                            .closest(".nav.nav-tabs")
                            .find("a[data-toggle=tab][href!='#" + this.$scope.attr("id") + "']");

        if (siblingTabs.length) {
            siblingTabs[0].tab("show");
        } else {
            log.debug("There is no sibling tabs which we can activate to hide current tab.");
        }

    }

    TabPanel.init = function init(args) {

        if (args.IsEditorEditing) return null;

        var tabPanel = new TabPanel(args.scope,
            args.StateChangeMessagesTransmitting || [],
            args.ShowActionMessages || [],
            args.HideActionMessages || []);

        return tabPanel;
    };

    return TabPanel;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/TabSet',["jquery", "eventManager", 'loglevel', "cssEscape"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel'), require("cssEscape")) :
    console && console.error('TabSet does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {
    
    function TabSet(scope, stateChangeMessages) {
        var self = this;
        Object.defineProperty(this, "$scope", { enumerable: true, value: $(scope) });
        
        //#region message transmitter registration
        if (stateChangeMessages.length) {
            this.$scope.on("shown.bs.tab", function () {

                stateChangeMessages.forEach(function (eventName) {
                    log.debug("TabSet raises message: \'%s\'", eventName);

                    eventManager.trigger(eventName, self);
                });

                return false;
            });
        }
        //#endregion

        this._setupDeepLinking();

        var resizeTimer;
        $(window).resize(function () {
            clearTimeout(resizeTimer);
            resizeTimer = setTimeout(function () {
                self.$scope.find('.tab-pane').each(function (index, element) {
                    if ($(element).is('.active:hidden')) {
                        BrainJocks.BootstrapUI.TabSet.activate();
                    }
                });
            }, 50);
        });

    }

    TabSet.prototype._setupDeepLinking = function () {
        var that = this;
        // make tabs with anchors change the URL to make them sticky
        this.$scope.on('shown.bs.tab',
            'a[data-toggle="tab"][href*="#tab-"]',
            function () {

                var anchor = '';
                var oldHash = window.location.hash.substring(1);
                
                if ($(this).is('a[data-toggle="tab"][href*="#tab-"][data-anchorable="true"]')) {
                    anchor = $(this).attr("href").replace("#tab-", "");
                }

                if (anchor) {
                    window.history && window.history.pushState && window.history.pushState(null, null, '#' + anchor);
                    window.location.hash = anchor;
                    // Manually trigger event "hashchange" as it's not triggered automatically when clicking on tab
                    $(window).trigger("hashchange", anchor);
                } else {
                    // if we open a tab without deep linking, we should release previously selected anchorable tab.
                    if (oldHash && $(this).closest('.nav-tabs').find('a[data-toggle="tab"][href*="#' + CSS.escape('tab-' + oldHash) + '"][data-anchorable="true"]').length) {
                        // clear hash without page jump in modern browsers
                        window.history && window.history.pushState && window.history.pushState(null, null, '#');
                        window.location.hash = '';
                    }
                    // otherwise we don't care.
                }

            });

        // make all tabs with anchors to be visible when we walk along the browser history
        $(window).on("hashchange", function () {
            if (!window.location.hash) return !1;

            // find a tab which should be activated within current tabset. otherwise keep tabset without any changes.
            var tab = that.$scope.find('a[href="#' + CSS.escape('tab-' + window.location.hash.substring(1)) + '"]');
            if (tab.length) {
                tab.trigger("click");
            }
        });

        if (window.location.hash) {
            // find a tab which should be activated within current tabset. otherwise keep tabset without any changes.
            var tab1 = this.$scope.find('a[href="#' + CSS.escape('tab-' + window.location.hash.substring(1)) + '"]');
            if (tab1.length) {
                tab1.trigger("click");
            }
        }
    }

    TabSet.init = function init(args) {
        return args.IsEditorEditing === true
            ? null
            : new TabSet(args.scope,
                         args.StateChangeMessagesTransmitting || []);
    };

    return TabSet;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/VimeoVideo',["jquery", "eventManager", 'loglevel', "//player.vimeo.com/api/player.js"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel'), require("//player.vimeo.com/api/player.js")) :
    console && console.error('Vimeo does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log, vimeoPlayer) {

    function VimeoVideo(scope, stateChangeMessages, onPlayMessagesPerformer, onPauseMessagePerformer) {
        ///<summary>Initialize a new instance of YoutubeVideo. Subscribe to messages which are passed to current instance.</summary>

        var self = this, instance = {};
        instance.stateChangeMessages = stateChangeMessages.slice();
        
        Object.defineProperties(this, {
            scope: { enumerable:!1, value: scope },
            $scope: { enumerable: true, value: $(scope) },
            stateChangeMessages: {
                enumerable: true,
                get: function () {
                    return instance.stateChangeMessages.slice();
                }
            },
            trackTimelineInterval: {
                enumerable: !1,
                value: void 0,
                writable: !0,
            },
            currentTime: {
                enumerable: !1,
                value: void 0,
                writable: !0
            },
            isInteractedWithUser: { enumerable: true, configurable: true, writable: true, value: false }
        });
        
        this.addStateChangeMessage = function addStateChangeMessage(message) {
            if (!message) return;
            if (instance.stateChangeMessages.indexOf(message) > -1) {
                log.debug("Component is already registered for event " + message);
                return;
            }
            
            instance.stateChangeMessages.push(String(message));
        };

        //#region play message performer
        if (onPlayMessagesPerformer.length) {
            onPlayMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.play, self);
            });
        }
        //#endregion

        //#region show messages performer
        if (onPauseMessagePerformer.length) {
            onPauseMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.pause, self);
            });
        }
        //#endregion

        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }
        
        var player = new vimeoPlayer(this.$scope.find('iframe'));
        player.ready().then(function() {
            var videoId = self.$scope.find('iframe').attr('id');

            Object.defineProperties(self,
                {
                    videoId: { enumerable: true, value: videoId },
                    player: { enumerable: false, value: player }
                });
        });

        player.on('play', this._onPlayHandler.bind(this));
        //player.on('pause.score', this._onPauseHandler.bind(this));
        player.on('ended', this._onEndedHandler.bind(this));
    }

    VimeoVideo.prototype._onPlayHandler = function (data) {
        this.currentTime = Math.floor(data.seconds);
        this.isInteractedWithUser = true;

        if (data.seconds === 0) {
            $(this).trigger('start.video', [this.currentTime]);
        }

        $(this).trigger('update.timeline', [this.currentTime]);
        this.startTrackTimeline();
    }

    VimeoVideo.prototype._onPauseHandler = function (data) {
        this.stopTrackTimeline();

        log.debug('vimeo video paused');
        var oldValue = this.currentTime;
        this.currentTime = Math.floor(data.seconds);
        this.isInteractedWithUser = true;
        if (oldValue !== this.currentTime) {
            $(this).trigger('update.timeline', [this.currentTime]);
        }

        $(this).trigger('pause.video', [this.currentTime]);
    }

    VimeoVideo.prototype._onEndedHandler = function (data) {
        this.stopTrackTimeline();

        this.currentTime = Math.floor(data.seconds);
        this.isInteractedWithUser = true;
        $(this).trigger('end.video', [this.currentTime]);
    }

    VimeoVideo.prototype.startTrackTimeline = function () {
        if (this.trackTimelineInterval) {
            clearInterval(this.trackTimelineInterval);
        }

        this.trackTimelineInterval = setInterval((function () {
            this.player.getCurrentTime().then((function(seconds) {
                this.currentTime = Math.floor(seconds);
                $(this).trigger('update.timeline', [this.currentTime]);
            }).bind(this));
        }).bind(this), 1000 /* 1 second */);

        $(this).trigger('update.timeline', [this.currentTime]);

        // some vimeo video keep sending "pause" event all the time while pause. That's why we assign a handler when start tracking and remove it when player stopped.
        this.player.on('pause', this._onPauseHandler.bind(this));
    }

    VimeoVideo.prototype.stopTrackTimeline = function () {
        if (this.trackTimelineInterval) {
            clearInterval(this.trackTimelineInterval);
        }

        // some vimeo video keep sending "pause" event all the time while pause.
        this.player.off('pause');
    }

    VimeoVideo.prototype.play = function () {
        ///<summary>Start playing the video.</summary>
        var player = new vimeoPlayer(this.$scope.find('iframe'));

        // On certain mobile devices, including those running iOS, and in certain desktop browsers like Chrome and Safari, 
        // you can't programmatically trigger the initial playback of a video.
        // https://developer.vimeo.com/player/sdk/reference#play-a-video
        // We can play embedded media via API in muted state only or when user has already interacted with the player.
        if (!this.isInteractedWithUser) {
            player.setVolume(0);
        }

        player.play().then((function() {
            this.transmitStateChange();
        }).bind(this)).catch(function (error) {
            switch (error.name) {
                case 'PasswordError':
                    // the video is password-protected and the viewer needs to enter the
                    // password first
                    break;

                case 'PrivacyError':
                    // the video is private
                    break;

                case 'NotAllowedError':
                    log.error(error.message);
                    break;

                default:
                    break;
            }
        });

    }

    VimeoVideo.prototype.pause = function () {
        ///<summary>Put the video on pause.</summary>

        var player = new vimeoPlayer(this.$scope.find('iframe'));

        player.pause().then((function () {
            this.transmitStateChange();
        }).bind(this)).catch(function (error) {
            switch (error.name) {
            case 'PasswordError':
                // the video is password-protected and the viewer needs to enter the
                // password first
                break;

            case 'PrivacyError':
                // the video is private
                break;

            default:
                // some other error occurred
                break;
            }
        });
    }

    VimeoVideo.prototype.transmitStateChange = function () {
        var messages = this.stateChangeMessages, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self, self.player);
            });
        }

    }
    // #endregion

    VimeoVideo.init = function init(args) {
        if (args.IsEditorEditing) return null;

        var video = new VimeoVideo(args.scope,
            args.StateChangeMessagesTransmitting || [],
            args.PlayActionMessages || [],
            args.PauseActionMessages || []);

        return video;
    };

    return VimeoVideo;
}));
;(function (global, factory) {
    typeof define === 'function' && define.amd ? define('score_bootstrap/Components/YoutubeVideo',["jquery", "eventManager", 'loglevel', "//www.youtube.com/iframe_api"], factory) :
    typeof exports === 'object' && typeof module !== typeof void 0 ? module.exports = factory(require("jquery"), require("eventManager"), require('loglevel'), require("//www.youtube.com/iframe_api")) :
    console && console.error('TabSet does not support non-amd script loading.');
}(this/* window */, function ($, eventManager, log) {

    function YoutubeVideo(scope, stateChangeMessages, onPlayMessagesPerformer, onPauseMessagePerformer) {
        ///<summary>Initialize a new instance of YoutubeVideo. Subscribe to messages which are passed to current instance.</summary>

        var self = this, instance = {};
        instance.stateChangeMessages = stateChangeMessages.slice();
        
        Object.defineProperties(this, {
            scope: {enumerable: !0, value: scope},
            $scope: { enumerable: true, value: $(scope) },
            stateChangeMessages: {
                enumerable: true,
                get: function () {
                    return instance.stateChangeMessages.slice();
                }
            },
            trackTimelineInterval: {
                enumerable: !1,
                value: void 0,
                writable: !0,
            },
            currentTime: {
                enumerable: !1,
                get: function() {
                    return this.player ? Math.floor(this.player.getCurrentTime()) : void 0;
                }
            },
            isInteractedWithUser: { enumerable: true, configurable: true, writable: true, value: false }
        });
        
        this.addStateChangeMessage = function addStateChangeMessage(message) {
            if (!message) return;
            if (instance.stateChangeMessages.indexOf(message) > -1) {
                log.debug("Component is already registered for event " + message);
                return;
            }
            
            instance.stateChangeMessages.push(String(message));
        };

        //#region play message performer
        if (onPlayMessagesPerformer.length) {
            onPlayMessagesPerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.play, self);
            });
        }
        //#endregion

        //#region show messages performer
        if (onPauseMessagePerformer.length) {
            onPauseMessagePerformer.forEach(function (messageName) {
                eventManager.subscribe(messageName, self.pause, self);
            });
        }
        //#endregion

        if (this.stateChangeMessages.length) {
            this.stateChangeMessages.forEach(function (ev) {
                eventManager.trigger(ev, self);
            });
        }

        YT.ready(function () {
            var videoId = self.$scope.find('iframe').attr('id');

            Object.defineProperties(self, {
                videoId: { enumerable: true, value: videoId },
                player: { enumerable: false, value: new YT.Player(videoId) }
            });

            self.player.addEventListener("onStateChange", self._playerStateChange.bind(self));

            // Pause all Youtube videos except one passed in the 'event' parameter and when user has already interacted with it
            eventManager.subscribe("stopYT", function (event, targetIsInteractedWithUser) {
                var target = event.target;
                if (self.player.getIframe() !== target.getIframe() && targetIsInteractedWithUser) {
                    self.player.pauseVideo();
                }
            });
        });
    }

    YoutubeVideo.prototype._playerStateChange = function(e) {

        switch (e.data) {
            case YT.PlayerState.ENDED:
                this.stopTrackTimeline();
                $(this).trigger('end.video', [this.currentTime]);
                this.isInteractedWithUser = true;
                break;
            case YT.PlayerState.PLAYING:
                //if (this.currentTime === 0) {
                    $(this).trigger('start.video', [this.currentTime]);
                //}
                eventManager.trigger("stopYT", e, this.isInteractedWithUser);
                $(this).trigger('update.timeline', [this.currentTime]);
                this.startTrackTimeline();
                this.isInteractedWithUser = true;
                break;
            case YT.PlayerState.PAUSED:
                this.stopTrackTimeline();
                $(this).trigger('pause.video', [this.currentTime]);
                this.isInteractedWithUser = true;
                break;
        }

        this.transmitStateChange.apply(this, arguments);
    }

    YoutubeVideo.prototype.startTrackTimeline = function() {
        if (this.trackTimelineInterval) {
            clearInterval(this.trackTimelineInterval);
        }

        this.trackTimelineInterval = setInterval((function () {
            $(this).trigger('update.timeline', [this.currentTime]);
        }).bind(this), 1000 /* 1 second */);

        $(this).trigger('update.timeline', [this.currentTime]);
    }

    YoutubeVideo.prototype.stopTrackTimeline = function() {
        if (this.trackTimelineInterval) {
            clearInterval(this.trackTimelineInterval);
        }

        $(this).trigger('update.timeline', [this.currentTime]);
    }

    YoutubeVideo.prototype.play = function () {
        ///<summary>Start playing the video.</summary>
        this.isInteractedWithUser = false;

        // According to Youtube IFrame API documentation, embedded media cannot be played automatically in Chrome and Safari.
        // https://developers.google.com/youtube/iframe_api_reference#Autoplay_and_scripted_playback
        // We can play embedded media via API in muted state only or when user has already interacted with the player.
        if (this.player && typeof this.player.mute === "function") {
            this.player.mute().playVideo();
        }

        this.transmitStateChange();
    }

    YoutubeVideo.prototype.pause = function () {
        ///<summary>Put the video on pause.</summary>
        if (this.player && typeof this.player.pauseVideo === "function") {
            this.player.pauseVideo();
        }

        this.transmitStateChange();
    }

    YoutubeVideo.prototype.transmitStateChange = function () {
        var messages = this.stateChangeMessages, self = this;
        if (messages.length) {
            messages.forEach(function (ev) {
                eventManager.trigger(ev, self, self.player);
            });
        }
    }
    // #endregion

    YoutubeVideo.init = function init(args) {
        if (args.IsEditorEditing) return null;

        var video = new YoutubeVideo(args.scope,
            args.StateChangeMessagesTransmitting || [],
            args.PlayActionMessages || [],
            args.PauseActionMessages || []);

        return video;
    };

    return YoutubeVideo;
}));
define('ANSI/Components/Content/ButtonWithModal',['jquery'], function ($) {

    function ButtonWithModal(scope, showExitButton, uniqueId) {
        $('.score-button.js-show-modal', scope).on("click", function (e) {
            e.preventDefault();
            $('#' + uniqueId + '-modal').modal("show");
        });

        if (showExitButton) {
            $('.score-button.js-hide-modal', scope).on("click", function (e) {
                e.preventDefault();
                $('#' + uniqueId + '-modal').modal("hide");
            });
        }
        
    }

    ButtonWithModal.init = function init(args) {
        return args.IsEditorEditing === true ? null : new ButtonWithModal(args.scope, args.ShowExitButton, args.UniqueId);
    };

    return ButtonWithModal;

});
define('ANSI/Components/Content/CardVerticalHover',['jquery'], function ($) {
    'use strict';

    function CardVerticalHover(scope) {
        Object.defineProperty(this, 'scope', { enumerable: true, value: scope, writable: !1 });
        Object.defineProperty(this, '$scope', { enumerable: !0, value: $(scope) });

        var getLineHeight = function (element) {
            var lineHeight = window.getComputedStyle(element)['line-height'];
            return lineHeight === 'normal' ? 1.16 * parseFloat(window.getComputedStyle(element)['font-size']) : parseFloat(lineHeight);
        };

        this.$scope.find('a, .card-body').each(function (i, item) {
            var $item = $(item);

            $item.attr('data-text-content', item.textContent);
            $item.attr('data-line-height', getLineHeight(item));
            $item.attr('lang', document.documentElement.lang);
        });

        this._updateItems();

        var self = this;
        $(document).on('shown.bs.tab', '.page-wrapper a[data-toggle="tab"]', function (e) {
            self._updateItems();
        });
    }


    CardVerticalHover.prototype._updateItems = function () {
        var self = this;

        this.$scope.find('a').each(function (i, item) {
            self._doEllipsis(3, item);
        });

        this.$scope.find('.card-body').each(function (i, item) {
            self._doEllipsis(3, item);
        });
    };

    CardVerticalHover.prototype._doEllipsis = function (lines, element) {
        var $element = $(element),
            inner = document.createElement('SPAN'),
            text = $element.attr('data-text-content'),
            lineHeight = $element.attr('data-line-height'),
            maxHeight = lines * lineHeight,
            textParts = text.split(' ');

        if ( !text ) return;

        element.innerHTML = '';
        element.style.height = 'auto';
        element.style.maxHeight = maxHeight + 'px';
        element.appendChild(inner);
        inner.innerHTML = text;
        inner.style.display = 'block';

        if ( inner.clientHeight < maxHeight ) return;

        while (inner.clientHeight > maxHeight) {
            textParts.pop();
            inner.innerHTML = textParts.join(' ') + '...';
        }
    };


    CardVerticalHover.init = function init(args) {
        return args.IsEditorEditing === true ? null : new CardVerticalHover(args.scope);
    };

    return CardVerticalHover;

});
define('ANSI/Components/Coveo/DropdownFacet',['jquery'], function ($) {

    function initDropdownFacet() {
        var root = document.getElementById('coveoC606340E');
        if (!root) return;        

        var facetField = 'standardsdeveloper';
        let currentSelection = null;        

        Coveo.$$(root).on(Coveo.QueryEvents.querySuccess, function (e, args) {
            var dropdown = document.getElementById('dropdownDynamicSelect');
            if (!dropdown) return;

            var facet = (args.results.facets || [])
                .find(g => g.field.toLowerCase() === facetField.toLowerCase());

            if (!facet) return;

            dropdown.innerHTML = '<option value="">All Standards Developers</option>';

            facet.values.forEach(function (v) {
                var option = document.createElement('option');
                option.value = v.value;
                option.text = v.value + ' (' + v.numberOfResults + ')';
                dropdown.appendChild(option);
            });

            // Restore selection
            if (currentSelection) {
                dropdown.value = currentSelection;
            }
        });
        var dropdown = document.getElementById('dropdownDynamicSelect');
        if (dropdown) {
            dropdown.addEventListener('change', function () {
                currentSelection = this.value || null;
                const facetElement = root.querySelector('.CoveoDynamicFacet[data-field="@' + facetField + '"]');
                const facetInstance = Coveo.get(facetElement);

                facetInstance.reset();
                if (currentSelection) {                    
                    // Toggle a specific value in the facet
                    facetInstance.toggleSelectValue(currentSelection);
                }                
                Coveo.executeQuery(root);
            });
        }
    }

    function DropdownFacet(args) {
        if (args && args.IsEditorEditing) return null;

        initDropdownFacet();
        return {};
    }

    DropdownFacet.init = function (args) {
        return new DropdownFacet(args);
    };

    return DropdownFacet;
});

define('ANSI/Components/Coveo/FilteredViewCategoryList',['jquery', 'eventManager', 'slick', 'underscore'], function (
    $,
    eventManager,
    slick,
    _
) {
    function FilteredViewCategoryList(
        scope,
        templates,
        selectedCategories,
        topics,
        doNotPrefilter,
        isEventsListing
    ) {
        var intervalCount = 0;
        var intervalId = setInterval(function () {
            intervalCount++;
            var testElement = Coveo.$$(document).find('.CoveoSearchInterface').CoveoQueryController;
            if ((testElement !== null && testElement !== undefined) || intervalCount > 25) {
                console.log('coveo cleared ' + intervalCount);
                clearInterval(intervalId);
            }
            var CoveoRelatedContent = function (element, root, options) {
                this.root = root;
                this.options = options;
                this.resultTemplate = _.template(this.options.resultTemplate);
                this.content = element;
                this.templateFilter = templates;
                this.selectedCategories = selectedCategories;
                this.topics = topics;
                this.doNotPrefilter = doNotPrefilter;
                this.isEventsListing = isEventsListing;
                this.fetchNewResults();
                //}, 0);
            };

            CoveoRelatedContent.prototype.fetchNewResults = function () {
                var _this = this;

                //Setting for the slick slider
                var settings = {
                    draggable: true,
                    infinite: false,
                    slidesToShow: 1,
                    slidesToScroll: 1,
                    accessibility: true,
                    centerMode: true,
                    arrows: true,
                    variableWidth: true,
                    touchThreshold: 10,
                    mobileFirst: true,
                    responsive: [{
                        breakpoint: 575,
                        settings: {
                            slidesToShow: 2,
                            arrows: true,
                            centerMode: false
                        }
                    },
                    {
                        breakpoint: 1260,
                        settings: {
                            slidesToShow: 3,
                            arrows: true,
                            centerMode: false
                        }
                    },
                    {
                        breakpoint: 1439,
                        settings: {
                            slidesToShow: 4,
                            arrows: true,
                            centerMode: false
                        }
                    }
                    ]
                };

                var tabSettings = {
                    draggable: true,
                    infinite: false,
                    slidesToShow: 2,
                    slidesToScroll: 1,
                    accessibility: true,
                    centerMode: true,
                    arrows: true,
                    variableWidth: true,
                    touchThreshold: 10,
                    mobileFirst: true,
                    responsive: [{
                        breakpoint: 575,
                        settings: {
                            slidesToShow: 2,
                            arrows: true,
                            centerMode: false
                        }
                    },
                    {
                        breakpoint: 1260,
                        settings: {
                            slidesToShow: 2,
                            arrows: true,
                            centerMode: false
                        }
                    },
                    {
                        breakpoint: 1439,
                        settings: {
                            slidesToShow: 3,
                            arrows: true,
                            centerMode: false
                        }
                    }
                    ]
                };


                var settingsCenter = {
                    draggable: true,
                    infinite: false,
                    slidesToShow: 1,
                    slidesToScroll: 1,
                    accessibility: true,
                    centerMode: true,
                    arrows: true,
                    variableWidth: false,
                    touchThreshold: 10,
                    mobileFirst: true,
                    responsive: [{
                        breakpoint: 575,
                        settings: {
                            slidesToShow: 2,
                            arrows: true,
                            centerMode: false
                        }
                    },
                    {
                        breakpoint: 1200,
                        settings: {
                            slidesToShow: 3,
                            arrows: true,
                            centerMode: false
                        }
                    }
                    ]
                };

                //Initialize slider
                var sliderInit = function (results) {
                    var relatedContainer = $(_this.content).closest(
                        '.news-events-slider'
                    );
                    if (results.length > 0) {
                        var el = $(_this.content);
                        //See if slider is already initialized
                        if (!el.hasClass('slick-initialized')) {
                            if (el.closest('.score-stripe').hasClass('center')) {
                                el.slick(settingsCenter);
                            } else if (el.closest('.full-width').hasClass('tab')) {
                                el.slick(tabSettings);
                            } else {
                                el.slick(settings);
                            }
                        }
                    }
                };

                var tabsetRefresh = function (results) {
                    if (results.length == 0) {
                        var tabContainer = $(_this.content).closest(
                            '.news-events-slider'
                        );
                        var tabset = $(_this.content).closest('.score-tab');
                        var tab = $(_this.content).closest('.tab-pane').attr('id');
                        var li = tabset.find('li a[href="#' + tab + '"]').parent();
                        li.hide();
                        li.addClass('empty');
                        var visiblelistItems = li.parent().find('li').not('.empty').not('.active.empty');
                        if (visiblelistItems.length > 0) {
                            $(visiblelistItems[0]).find('a').tab('show');
                        } else {
                            tabContainer.hide();
                        }
                    }
                };

                var normalizeGuid = function (guid) {
                    return guid
                        .replace(/\|/g, ',')
                        .replace(/{/g, '')
                        .replace(/}/g, '')
                        .replace(/-/g, '');
                };

                var builder = Coveo.$$(document)
                    .find('.CoveoSearchInterface')
                    .CoveoQueryController.createQueryBuilder(
                        '.CoveoSearchInterface'
                    );

                builder.advancedExpression.add(
                    '@z95xtemplate==(' + normalizeGuid(_this.templateFilter) + ')'
                );
                var indexSource = Coveo.$$(document).find('.CoveoForSitecoreContext').CoveoForSitecoreContext.options.scIndexSourceName;

                if (
                    !_this.doNotPrefilter
                ) {
                    if (_this.selectedCategories) {
                        var formattedCategories = normalizeGuid(
                            _this.selectedCategories
                        );
                        builder.advancedExpression.add(
                            '@filteredz32xviewz32xcategory==(' +
                            formattedCategories +
                            ')'
                        );
                    }
                }

                if (!_this.doNotPrefilter) {
                    if (_this.selectedCategories) {
                        var formattedCategories = normalizeGuid(
                            _this.selectedCategories
                        );
                        builder.advancedExpression.add(
                            '@filteredz32xviewz32xcategory==(' +
                            formattedCategories +
                            ')'
                        );
                    }
                }

                if (_this.isEventsListing) {
                    builder.advancedExpression.add('@datesortdateformatcomputed >= today');
                    builder.sortCriteria = '@datesortdateformatcomputed ascending';
                } else {
                    builder.sortCriteria = '@datesortdateformatcomputed descending';
                }

                builder.constantExpression.add(
                    '@source=="' +
                    indexSource +
                    '"'
                );

                builder.constantExpression.add(
                    '@z95xlanguage==' +
                    document.documentElement.lang +
                    ''
                );

                builder.constantExpression.add(
                    '@z95xlatestversion==1'
                );

                var originalQuery = builder.build();

                originalQuery.locale = document.documentElement.lang;

                Coveo.SearchEndpoint.endpoints.default
                    .search(originalQuery)
                    .done(function (data) {
                        _.each(data.results, function (result, index) {
                            _this.content.insertAdjacentHTML(
                                'beforeend',
                                _this.resultTemplate({ result: result })
                            );
                        });
                        //Initialize slick slider after cards are built
                        sliderInit(data.results);
                        tabsetRefresh(data.results);
                    });
            };


            var template = Coveo.$$(scope).find(
                'script.by-related-content-result-template'
            ).innerHTML;

            var relatedContentDiv = Coveo.$$(scope).find(
                '.related-content-placeholder'
            );
            var interfaceDiv = Coveo.$$(scope).find('.CoveoSearchInterface');
            var options = {
                resultTemplate: template
            };

            var results = new CoveoRelatedContent(
                relatedContentDiv,
                interfaceDiv,
                options
            );
        }, 250);
    }

    FilteredViewCategoryList.init = function init(args) {
        return args.IsEditorEditing === true ?
            null :
            new FilteredViewCategoryList(
                args.scope,
                args.templates,
                args.selectedCategories,
                args.topics,
                args.doNotPrefilter,
                args.isEventsListing
            );
    };

    return FilteredViewCategoryList;

});

define('ANSI/Components/Events/CustomEventDetails',['jquery'], function ($) {

    function CustomEventDetails(scope, readMoreLabel, readLessLabel) {
        $('.js-read-more', scope).on("click", function (e) {
            e.preventDefault();
            $('.read', scope).toggleClass('read-less');
            if ($(this).text() === readLessLabel) $(this).text(readMoreLabel);
            else $(this).text(readLessLabel);
        });
    }

    CustomEventDetails.init = function init(args) {
        return args.IsEditorEditing === true ? null : new CustomEventDetails(args.scope, args.ReadMoreLabel, args.ReadLessLabel);
    };

    return CustomEventDetails;

});
define('ANSI/Components/Feature/CookieBanner',[
        'jquery'
    ],
    function ($) {

        function InitializeCookieBanner(necessaryCookies) {
            var cookieBanner = $('.cookie-banner');
            var footer = $('.score-footer');
            var adjustMargin = cookieBanner.outerHeight();
            $('#acceptButton').on('click',
                function () {
                    footer.addClass( 'no-banner' );
                    setCookiSettings('allCookies');
                    cookieBanner.hide();
                    
                    // Reload page as all js scripts/javascript code in Site Header/Footer Scripts or 
                    // Page Header/Footer scripts is not loaded before user accepted cookies.
                    location.reload();
                });

            $('#noAcceptButton').on('click',
                function () {
                    footer.addClass('no-banner');
                    setCookiSettings('necessaryCookies');
                    cookieBanner.hide();
                    
                });

            // Removing Hashtags, Anchors, and Tracking Codes from addThis URLs
            window.addthis_config = window.addthis_config || {};
            window.addthis_config.data_track_addressbar = false;
            window.addthis_config.data_track_clickback = false;

            var cookieSetting = getCookieValue('CookieSettings');
            if ( cookieSetting !== 'allCookies' ) {
                var cookies = document.cookie.split(';');
                for (var i = 0; i < cookies.length; i++) {

                    var cookieName = cookies[i].split('=')[0].trim();
                    if ( !checkIsCookieNecessary(cookieName, necessaryCookies) ) {
                        deleteCookie(cookieName);
                    }
                }
            } else {
                window.addthis_config.data_track_addressbar = true;
                window.addthis_config.data_track_clickback = true;
            }


            if ( cookieSetting === 'allCookies' || cookieSetting === 'necessaryCookies' ) {
                cookieBanner.hide();
                footer.addClass( 'no-banner' );


            } else {
                cookieBanner.show();
                footer.removeClass( 'no-banner' );
                $( '.score-footer' ).css('margin-bottom', adjustMargin + 'px');

            }

            var cookieDesc = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie') ||
                Object.getOwnPropertyDescriptor(HTMLDocument.prototype, 'cookie');

            if ( cookieDesc && cookieDesc.configurable ) {
                Object.defineProperty(document,
                    'cookie',
                    {
                        get: function () {
                            return cookieDesc.get.call(document);
                        },
                        set: function (value) {
                            var cookieElements = value.split('=');
                            if ( cookieElements.length === 0 )
                                return true;
                            if ( cookieSetting === 'allCookies' ||
                                checkIsCookieNecessary(cookieElements[0], necessaryCookies) ) {
                                cookieDesc.set.call(document, value);
                            }
                            return true;
                        }
                    });
            }
        }

        function setCookiSettings(value) {
            var cookieDate = new Date;
            cookieDate.setFullYear(cookieDate.getFullYear() + 1);
            var cookie = 'CookieSettings=' + value + ';expires=' + cookieDate.toGMTString() + '; path=/';
            document.cookie = cookie;
        }

        function getCookieValue(name) {
            var value = '; ' + document.cookie;
            var parts = value.split('; ' + name + '=');
            if ( parts.length === 2 ) {
                return parts.pop().split(';').shift();
            }
            return '';
        }

        function checkIsCookieNecessary(name, necessaryCookies) {
            var cookieIsNecessary = false;
            $.each(necessaryCookies,
                function (index, value) {
                    if ( value === name ) {
                        cookieIsNecessary = true;
                    }
                });
            return cookieIsNecessary;
        }

        function deleteCookie(name) {
            document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/';
        }

        return function init(args) {
            if ( args.IsEditorEditing || (typeof window.Sitecore != typeof void 0 && window.Sitecore.PageModes != typeof void 0 && window.Sitecore.PageModes != null && window.Sitecore.PageModes.PageEditor != null) ) {
                //run only in preview and frontend
                return;
            }

            return new InitializeCookieBanner(
                args.NecessaryCookies
            );
        };
    });
define('ANSI/Components/Maps/InteractiveMap',['jquery'], function ($) {

    function InteractiveMap(scope) {
        $('path', scope).each(function (i, item) {
            if ($(item).hasClass('selected')) {
                $(item).closest('g').addClass('active');
            }
        });

        $('g', scope).each(function (i, item) {
            if ($(item).hasClass('selected')) {
                $(item).addClass('active');
            }
        });

        // Show popover
        $('g', scope).mouseenter(function (e) {
            if ($(this).hasClass('active')) {
                var region = $(this).attr('id');
                $('.' + region, scope).addClass('showpop');
            }
        });

        //Hide popover
        $('g', scope).mouseleave(function (e) {
            if ($(this).hasClass('active')) {
                var region = $(this).attr('id');
                $('.' + region, scope).removeClass('showpop');
            }
        });

        //Stop the popover from hiding when in it
        $('.score-well', scope).mouseenter(function (e) {
            if ($(this).hasClass('showpop')) {
                e.stopPropagation();
            }
        });
    }

    InteractiveMap.init = function init(args) {
        return args.IsEditorEditing === true ? null : new InteractiveMap(args.scope);
    };

    return InteractiveMap;
});
define('ANSI/Components/QuickAction/QuickActionSelectBox',['jquery'], function ($) {
    'use strict';

    function QuickActionSelectBox(scope) {
        $('.score-button-menu', scope).on('click', function () {
            if (!$('.score-button-menu.open', scope).is(':visible')) {
                $('.score-button-menu', scope).closest('.score-style-box').toggleClass('open');
            } else {
                $('.score-button-menu', scope).closest('.score-style-box').removeClass('open');
            }
        });

        $('.dropdown-menu li a', scope).on('click', function (e) {
            $('.ansi-quick-action .score-style-box', scope).removeClass('open');
            e.preventDefault();
            var selText = $(this).text();
            var ref = $(this).attr('href');
            var target = $(this).attr('target');
            $(this).parents('.score-button-menu').find('.btn').html(selText);
            $('.score-button-menu + .score-button', scope).attr('href', ref);
            $('.score-button-menu + .score-button', scope).attr('target', target);
            $('.score-button-menu + .score-button', scope).removeClass('disabled');
        });

        $(document).on("click", function (e) {
            e.stopPropagation();
            //check if the clicked area is in dropdown
            if ($('.ansi-quick-action .score-style-box', scope).has(e.target).length === 0) {
                $('.score-button-menu', scope).closest('.score-style-box').removeClass('open');
            }
        });
    }

    QuickActionSelectBox.init = function init(args) {
        return args.IsEditorEditing === true ? null : new QuickActionSelectBox(args.scope);
    };

    return QuickActionSelectBox;

});

//# sourceMappingURL=ANSI.bundle.js.map