PageSourceSearch

https://www.seaquarium.fr/app/themes/wwp_child_theme/assets/final/js/app1785321301187.js

js seaquarium.fr collected 2026-10-03 19:18:33 UTC 626,824 bytes, 11,964 lines download raw bytes

1/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */
2!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3
vendor: 6,937 bytes, line 2
2",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}
vendor: 9,959 bytes, line 2
2function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)}
vendor: 23,110 bytes, lines 2-3
2,input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
3}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{}
vendor: 2,430 bytes, line 3
3,keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}}
vendor: 1,897 bytes, line 3
3,n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);
vendor: 13,110 bytes, line 3
3if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;
vendor: 6,274 bytes, line 3
3for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,
3
4    
vendor: 9,013 bytes, line 4
4e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML}
vendor: 12,483 bytes, line 4
4,flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
vendor: 24,103 bytes, lines 5-13
5/*!
6 * Masonry PACKAGED v4.2.2
7 * Cascading grid layout library
8 * https://masonry.desandro.com
9 * MIT License
10 * by David DeSandro
11 */
12
13!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
13
14!function(root, factory) {
15    "function" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set
16    define([], function() {
17        return root.svg4everybody = factory();
18    }) : "object" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but
19    // only CommonJS-like environments that support module.exports,
20    // like Node.
21    module.exports = factory() : root.svg4everybody = factory();
22}(this, function() {
23    /*! svg4everybody v2.1.8 | github.com/jonathantneal/svg4everybody */
24    function embed(parent, svg, target) {
25        // if the target exists
26        if (target) {
27            // create a document fragment to hold the contents of the target
28            var fragment = document.createDocumentFragment(), viewB
28ox = !svg.hasAttribute("viewBox") && target.getAttribute("viewBox");
29            // conditionally set the viewBox on the svg
30            viewBox && svg.setAttribute("viewBox", viewBox);
31            // copy the contents of the clone into the fragment
32            for (// clone the target
33            var clone = target.cloneNode(!0); clone.childNodes.length; ) {
34                fragment.appendChild(clone.firstChild);
35            }
36            // append the fragment into the svg
37            parent.appendChild(fragment);
38        }
39    }
40    function loadreadystatechange(xhr) {
41        // listen to changes in the request
42        xhr.onreadystatechange = function() {
43            // if the request is ready
44            if (4 === xhr.readyState) {
45                // get the cached html document
46                var cachedDocument = xhr._cachedDocument;
47                // ensure the cached html document based on the xhr response
48                cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(""), 
49                cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item
50                xhr._embeds.splice(0).map(function(item) {
51                    // get the cached target
52                    var target = xhr._cachedTarget[item.id];
53                    // ensure the cached target
54                    target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)), 
55                    // embed the target into the svg
56                    embed(item.parent, item.svg, target);
57                });
58            }
59        }, // test the ready state change immediately
60        xhr.onreadystatechange();
61    }
62    function svg4everybody(rawopts) {
63        function oninterval() {
64            // while the index exists in the live <use> collection
65            for (// get the cached <use> index
66            var index = 0; index < uses.length; ) {
67                // get the current <use>
68                var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent);
69                if (svg) {
70                    var src = use.getAttribute("xlink:href") || use.getAttribute("href");
71                    !src && opts.attributeName && (src = use.getAttribute(opts.attributeName));
72                    if (polyfill) {
73                        if (!opts.validate || opts.validate(src, svg, use)) {
74                            // remove the <use> element
75                            parent.removeChild(use);
76                            // parse the src and get the url and id
77                            var srcSplit = src.split("#"), url = srcSplit.shift(), id = srcSplit.join("#");
78                            // if the link is external
79                            if (url.length) {
80                                // get the cached xhr request
81                                var xhr = requests[url];
82                                // ensure the xhr request exists
83                                xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open("GET", url), xhr.send(), 
84                                xhr._embeds = []), // add the svg and id as an item to the xhr embeds list
85                                xhr._embeds.push({
86                                    parent: parent,
87                                    svg: svg,
88                                    id: id
89                                }), // prepare the xhr ready state change event
90                                loadreadystatechange(xhr);
91                            } else {
92                                // embed the local id into the svg
93                                embed(parent, svg, document.getElementById(id));
94                            }
95                        } else {
96                            // increase the index when the previous value was not "valid"
97                            ++index, ++numberOfSvgUseElementsToBypass;
98                        }
99                    }
100                } else {
101                    // increase the index when the previous value was not "valid"
102                    ++index;
103                }
104            }
105            // continue the interval
106            (!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);
107        }
108        var polyfill, opts = Object(rawopts), newerIEUA = /\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/, webkitUA = /\bAppleWebKit\/(\d+)\b/, olderEdgeUA = /\bEdge\/12\.(\d+)\b/, edgeUA = /\bEdge\/.(\d+)\b/, inIframe = window.top !== window.self;
109        polyfill = "polyfill" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;
110        // create xhr requests object
111        var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName("use"), numberOfSvgUseElementsToBypass = 0;
112        // conditionally start the interval if the polyfill is active
113        polyfill && oninterval();
114    }
115    function getSVGAncestor(node) {
116        for (var svg = node; "svg" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}
117        return svg;
118    }
119    return svg4everybody;
120});
121(function ($, ns) {
122
123    var app = {
124        components: {},
125        modules: {},
126        templates: null,
127        init: function () {
128            this.initSticky();
129            this.initMenu();
130        },
131
132        //Components = js from styleguide elements (sliders, tabs ...)
133        getComponents: function () {
134            return this.components;
135        },
136        registerComponent: function (name, component, opts) {
137            this.components[name] = component;
138        },
139        getComponent: function (name) {
140            return this.components[name] || null;
141        },
142
143        //Modules = js from plugins
144        getModules: function () {
145            return this.modules;
146        },
147        registerModule: function (name, module) {
148            this.modules[name] = module;
149        },
150        getModule: function (name) {
151            return this.modules[name] || null;
152        },
153
154        //Templates
155        getTemplates: function () {
156            this.templates = $.parseJSON($('#jsTemplates').html());
157        },
158        getTemplate: function (tplName) {
159            if (this.templates === null) {
160                this.getTemplates();
161            }
162            return this.templates[tplName] ? this.templates[tplName] : null;
163        },
164
165        initSticky: function () {
166            //
167            var scrollTop = 0,
168                $w = $(window),
169                $header = $header || $('#header'), //Default Header
170                headerAllreadyFixed = false;
171
172            $w.scroll(function () {
173                scrollTop = $w.scrollTop();
174
175                //toggle class on scroll
176                if (scrollTop > 0 && headerAllreadyFixed === false) {
177                    $header.addClass('is-sticky');
178                    headerAllreadyFixed = true;
179                } else if (scrollTop == 0 && headerAllreadyFixed) {
180                    $header.removeClass('is-sticky');
181                    headerAllreadyFixed = false;
182                }
183            });
184
185            $w.trigger('scroll');
186        },
187
188        initMenu: function () {
189            $('.header-menu-opener').on('click', function (e) {
190                e.preventDefault();
191                if ($('body').not('.opened')) {
192                    $('body').addClass('opened');
193                }
194                ;
195            });
196
197            $('.header-menu-close').on('click', function (e) {
198                e.preventDefault();
199                if ($('body').hasClass('opened')) {
200                    $('body').removeClass('opened');
201                }
202            });
203        }
204
205    };
206
207    ns.app = app;
208    ns.app.init();
209
210})(jQuery, window.wonderwp);
211
212(function ($, ns) {
213
214    var dropdownComponent = {
215
216        global: false,
217        initiable: true,
218        defaultSelector: '.dropdown',
219
220
221        init: function ($wrap) {
222
223            var t = this;
224            t.$wrap = $wrap || $(t.defaultSelector);
225
226            t.$wrap.find('.dropdown-toggle').on('click', function (e) {
227                $(this).parent().toggleClass('open');
228            });
229            $(document).on('mouseup', function (e) {
230                if (!$(e.target).hasClass('dropdown-toggle')) {
231                    t.$wrap.removeClass('open');
232                }
233            });
234
235        }
236    };
237
238    ns.app.registerComponent('dropdown', dropdownComponent, {initGlobal: true}); //si on passe { initGlobal:true } il sera meme auto instancie
239
240
241})(jQuery, window.wonderwp);
242/*!
243	Modaal - accessible modals - v0.3.1
244	by Humaan, for all humans.
245	http://humaan.com
246 */
247/**
248	Modaal jQuery Plugin : Accessible Modals
249
250	==== General Options ===
251	type (string) 					: ajax, inline, image, iframe, confirm. Defaults to 'inline'
252	animation (string) 				: Fade, expand, down, up. Defaults to 'fade'
253	after_callback_delay (integer)	: Specify a delay value for the after open callbacks. This is necessary because with the bundled animations
254										have a set duration in the bundled CSS. Specify a delay of the same amount as the animation duration in so
255										more accurately fire the after open/close callbacks. Defaults 350, does not apply if animation is 'none',
256										after open callbacks are dispatched immediately
257
258	is_locked (boolean)				: Set this to true to disable closing the modal via keypress or clicking the background. Beware that if
259										type != 'confirm' there will be no interface to dismiss the modal if is_locked = true, you'd have to
260										programmatically arrange to dismiss the modal. Confirm modals are always locked regardless of this option
261										Defaults to false
262
263	hide_close (boolean)			: Set this to true to hide the close modal button. Key press and overlay click will still close the modal.
264										This method is best used when you want to put a custom close button inside the modal container space.
265
266	background (string)				: Background overlay style. Defaults to '#000'
267	overlay_opacity (float) 		: Background overlay transparency. Defaults to 0.8
268	overlay_close (boolean)			: Set this to false if you want to disable click to close on overlay background.
269
270	accessible_title (string)		: Accessible title. Default 'Dialog Window'
271	start_open (boolean)			: Set this to true to launch the Modaal window immediately on page open
272	fullscreen (boolean)			: Set this to true to make the modaal fill the entire screen, false will default to own width/height attributes.
273	custom_class (string)			: Fill in this string with a custom class that will be applied to the outer most modal wrapper.
274
275	width (integer)					: Desired width of the modal. Required for iframe type. Defaults to undefined //TODO
276	height (integer)				: Desired height of the modal. Required for iframe type. Defaults to undefined //TODO
277
278	background_scroll (boolean)		: Set this to true to enable the page to scroll behind the open modal.
279
280    should_open (boolean|function)  : Boolean or closure that returns a boolean to determine whether to open the modal or not.
281
282	close_text						: String for close button text. Available for localisation and alternative languages to be used.
283	close_aria_label				: String for close button aria-label attribute (value that screen readers will read out). Available for localisation and alternative languages to be used.
284
285	=== Events ===
286	before_open (function) 			: Callback function executed before modal is opened
287	after_open (function)			: Callback function executed after modal is opened
288	before_close (function)			: Callback function executed before modal is closed
289	after_close (function)			: Callback function executed after modal is closed
290	source (function(element, src))	: Callback function executed on the default source, it is intended to transform the
291										source (href in an AJAX modal or iframe). The function passes in the triggering element
292										as well as the default source depending of the modal type. The default output of the
293										function is an untransformed default source.
294
295
296	=== Confirm Options & Events ===
297	confirm_button_text (string)	: Text on the confirm button. Defaults to 'Confirm'
298	confirm_cancel_button_text (string) : Text on the confirm modal cancel button. Defaults to 'Cancel'
299	confirm_title (string)			: Title for confirm modal. Default 'Confirm Title'
300	confirm_content (string)		: HTML content for confirm message
301	confirm_callback (function)		: Callback function for when the confirm button is pressed as opposed to cancel
302	confirm_cancel_callback (function) : Callback function for when the cancel button is pressed
303
304
305	=== Gallery Options & Events ===
306	gallery_active_class (string)	: Active class applied to the currently active image or image slide in a gallery 'gallery_active_item'
307	before_image_change (function)	: Callback function executed before the image slide changes in a gallery modal. Default function( current_item, incoming_item )
308	after_image_change (function)	: Callback function executed after the image slide changes in a gallery modal. Default function ( current_item )
309
310
311	=== AJAX Options & Events ===
312	loading_content (string)		: HTML content for loading message. Default 'Loading &hellip;'
313	loading_class (string)			: Class name to be applied while content is loaded via AJAX. Default 'is_loading'
314	ajax_error_class (string)		: Class name to be applied when content has failed to load. Default is 'modaal-error'
315	ajax_success (function)		 	: Callback for when AJAX content is loaded in
316
317
318	=== SOCIAL CONTENT ===
vendor: 12,007 bytes, lines 319-702
319	instagram_id (string)			: Unique photo ID for an Instagram photo.
320
321*/
322( function( $ ) {
323
324	var modaal_loading_spinner = '<div class="modaal-loading-spinner"><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div><div><div></div></div></div>'
325
326	var Modaal = {
327		init : function(options, elem) {
328			var self = this;
329
330			self.dom = $('body');
331
332			self.$elem = $(elem);
333			self.options = $.extend({}, $.fn.modaal.options, self.$elem.data(), options);
334			self.xhr = null;
335
336			// set up the scope
337			self.scope = {
338				is_open: false,
339				id: 'modaal_' + ( new Date().getTime() ) + ( Math.random().toString(16).substring(2) )
340			};
341
342			// add scope attribute to trigger element
343			self.$elem.attr('data-modaal-scope', self.scope.id);
344
345			// private options
346			self.private_options = {
347				active_class: 'is_active'
348			};
349
350			self.lastFocus = null;
351
352			// if is_locked
353			if ( self.options.is_locked || self.options.type == 'confirm' || self.options.hide_close ) {
354				self.scope.close_btn = '';
355			} else {
356				self.scope.close_btn = '<button type="button" class="modaal-close" id="modaal-close" aria-label="' + self.options.close_aria_label + '"><span>' + self.options.close_text + '</span></button>';
357			}
358
359			// reset animation_speed
360			if (self.options.animation === 'none' ){
361				self.options.animation_speed = 0;
362				self.options.after_callback_delay = 0;
363			}
364
365			// On click to open modal
366			$(elem).on('click.Modaal', function(e) {
367				e.preventDefault();
368
369				var source;
370
371				// Save last active state before modal
372				self.lastFocus = document.activeElement;
373
374				if ( self.options.should_open === false || ( typeof self.options.should_open === 'function' && self.options.should_open() === false ) ) {
375					return;
376				}
377
378				// CB: before_open
379				self.options.before_open.call(self, e);
380
381				switch (self.options.type) {
382					case 'inline':
383						self.create_basic();
384						break;
385
386					case 'ajax':
387						source = self.options.source( self.$elem, self.$elem.attr('href') );
388						self.fetch_ajax( source );
389						break;
390
391					case 'confirm':
392						self.options.is_locked = true;
393						self.create_confirm();
394						break;
395
396					case 'image':
397						self.create_image();
398						break;
399
400					case 'iframe':
401						source = self.options.source( self.$elem, self.$elem.attr('href') );
402						self.create_iframe( source );
403						break;
404
405					case 'video':
406						self.create_video(self.$elem.attr('href'));
407						break;
408
409					case 'instagram':
410						self.create_instagram();
411						break;
412				}
413
414				// call events to be watched (click, tab, keyup, keydown etc.)
415				self.watch_events();
416
417			});
418
419
420			// Check for start_open
421			if (self.options.start_open === true ){
422				$(elem).click();
423			}
424		},
425
426		// Watching Modal
427		// ----------------------------------------------------------------
428		watch_events : function() {
429			var self = this;
430
431			self.dom.off('click.Modaal keyup.Modaal keydown.Modaal');
432
433			// Body keydown
434			self.dom.on('keydown.Modaal', function(e) {
435				var key = e.keyCode;
436				var target = e.target;
437
438				// look for tab change and reset focus to modal window
439				// done in keydown so the check fires repeatedly when you hold the tab key down
440				if (key == 9 && self.scope.is_open) {
441					if (!$.contains(document.getElementById(self.scope.id), target) ) {
442						$('#' + self.scope.id).find('*[tabindex="0"]').focus();
443					}
444				}
445			});
446
447			// Body keyup
448			self.dom.on('keyup.Modaal', function(e) {
449				var key = e.keyCode;
450				var target = e.target;
451
452				if ( (e.shiftKey && e.keyCode == 9) && self.scope.is_open) {
453					// Watch for shift + tab key press. if open shift focus to close button.
454					if (!$.contains(document.getElementById(self.scope.id), target) ) {
455						$('#' + self.scope.id).find('.modaal-close').focus();
456					}
457				}
458
459				if ( !self.options.is_locked ){
460					// On escape key press close modal
461					if (key == 27 && self.scope.is_open ) {
462						if ( $(document.activeElement).is('input:not(:checkbox):not(:radio)') ) {
463							return false;
464						}
465
466						self.modaal_close();
467						return;
468					}
469				}
470
471				// is gallery open and images length is > 1
472				if ( self.options.type == 'image' ) {
473					// arrow left for back
474					if (key == 37 && self.scope.is_open && (!$('#' + self.scope.id + ' .modaal-gallery-prev').hasClass('is_hidden')) ) {
475						self.gallery_update('prev');
476					}
477					// arrow right for next
478					if (key == 39 && self.scope.is_open && (!$('#' + self.scope.id + ' .modaal-gallery-next').hasClass('is_hidden')) ) {
479						self.gallery_update('next');
480					}
481					return;
482				}
483			});
484
485			// Body click
486			self.dom.on('click.Modaal', function(e) {
487				var trigger = $(e.target);
488
489				// General Controls: If it's not locked allow greedy close
490				if ( !self.options.is_locked ){
491					if ( (self.options.overlay_close && trigger.is('.modaal-inner-wrapper')) || trigger.is('.modaal-close') || trigger.closest('.modaal-close').length ) {
492						self.modaal_close();
493						return;
494					}
495				}
496
497				//Confirm Controls
498				if ( trigger.is('.modaal-confirm-btn' ) ){
499					// if 'OK' button is clicked, run confirm_callback()
500					if ( trigger.is('.modaal-ok') ) {
501						self.options.confirm_callback.call(self, self.lastFocus);
502					}
503
504					if ( trigger.is('.modaal-cancel') ) {
505						self.options.confirm_cancel_callback.call(self, self.lastFocus);
506					}
507					self.modaal_close();
508					return;
509				}
510
511				// Gallery Controls
512				if ( trigger.is( '.modaal-gallery-control' ) ){
513					// it not active, don't do nuthin!
514					if ( trigger.hasClass('is_hidden') ) {
515						return;
516					}
517
518					// trigger previous
519					if ( trigger.is('.modaal-gallery-prev') ) {
520						self.gallery_update('prev');
521					}
522					// trigger next
523					if ( trigger.is('.modaal-gallery-next') ) {
524						self.gallery_update('next');
525					}
526					return;
527				}
528			});
529		},
530
531		// Append markup into DOM
532		build_modal : function(content) {
533			var self = this;
534
535			// if is instagram
536			var igClass = '';
537			if ( self.options.type == 'instagram' ) {
538				igClass = ' modaal-instagram';
539			}
540
541			var wrap_class = (self.options.type == 'video') ? 'modaal-video-wrap' : 'modaal-content';
542
543			/*
544				modaal-start_none : fully hidden via display:none;
545				modaal-start_fade : hidden via opacity:0
546				modaal-start_slidedown : ...
547
548			*/
549			var animation_class;
550			switch ( self.options.animation ) {
551				case 'fade' :
552					animation_class = ' modaal-start_fade';
553					break;
554				case 'slide-down' :
555					animation_class = ' modaal-start_slidedown';
556					break;
557				default :
558					animation_class = ' modaal-start_none'
559			}
560
561			// fullscreen check
562			var fullscreen_class = '';
563			if ( self.options.fullscreen ) {
564				fullscreen_class = ' modaal-fullscreen';
565			}
566
567			// custom class check
568			if ( self.options.custom_class !== '' || typeof(self.options.custom_class) !== 'undefined' ) {
569				self.options.custom_class = ' ' + self.options.custom_class;
570			}
571
572			// if width and heights exists and is typeof number
573			var dimensionsStyle = '';
574			if ( self.options.width && self.options.height && typeof self.options.width == 'number' && typeof self.options.height == 'number' ) {
575				// if width and height exist, and they are both numbers
576				dimensionsStyle = ' style="max-width:' + self.options.width + 'px;height:' + self.options.height + 'px;overflow:auto;"';
577			} else if ( self.options.width && typeof self.options.width == 'number' ) {
578				// if only width
579				dimensionsStyle = ' style="max-width:' + self.options.width + 'px;"';
580			} else if ( self.options.height && typeof self.options.height == 'number' ) {
581				// if only height
582				dimensionsStyle = ' style="height:' + self.options.height + 'px;overflow:auto;"';
583			}
584
585			// Reset dimensions style (width and height) for certain types
586			if ( self.options.type == 'image' || self.options.type == 'video' || self.options.type == 'instagram' || self.options.fullscreen ) {
587				dimensionsStyle = '';
588			}
589
590			//var build_markup = '<div class="modaal-wrapper modaal-start_fade' + igClass + '" id="' + self.scope.id + '"><div class="modaal-outer-wrapper"><div class="modaal-inner-wrapper">';
591			var build_markup = '<div class="modaal-wrapper modaal-' + self.options.type + animation_class + igClass + fullscreen_class + self.options.custom_class + '" id="' + self.scope.id + '"><div class="modaal-outer-wrapper"><div class="modaal-inner-wrapper">';
592
593					// hide if video
594					if (self.options.type != 'video') {
595						build_markup += '<div class="modaal-container"' + dimensionsStyle + '>';
596					}
597
598					// add the guts of the content
599					build_markup +=	'<div class="' + wrap_class + ' modaal-focus" aria-hidden="false" aria-label="' + self.options.accessible_title + ' (Press escape to close)" role="dialog">';
600
601							// If it's inline type, we want to clone content instead of dropping it straight in
602							if (self.options.type == 'inline') {
603								build_markup += '<div class="modaal-content-container"></div>';
604							} else {
605								// Drop in the content if it's not inline
606								build_markup +=	content;
607							}
608
609					// close wrap_class
610					build_markup += '</div>' + self.scope.close_btn;
611
612					// hide if video
613					if (self.options.type != 'video') {
614						build_markup += '</div>';
615					}
616
617			// close off modaal-wrapper
618			build_markup +=	'</div></div></div>';
619
620			// append ajax modal markup to dom
621			self.dom.append(build_markup);
622
623			// if inline, clone content into space
624			if (self.options.type == 'inline') {
625				content.appendTo('#' + self.scope.id + ' .modaal-content-container');
626			}
627
628			// Trigger overlay show (which triggers modal show)
629			self.modaal_overlay('show');
630		},
631
632		// Create Basic Inline Modal
633		// ----------------------------------------------------------------
634		create_basic : function() {
635			var self = this;
636			// if $elem is a link, then href points to the target, otherwise assume target was passed in initially
637			var target = (self.$elem.is('[href]')) ? $(self.$elem.attr('href')) : self.$elem;
638			var content = '';
639
640			if (target.length) {
641				content = target.contents().clone(true,true);
642				target.empty();
643			} else {
644				content = 'Content could not be loaded. Please check the source and try again.';
645			}
646
647			// now push content into markup
648			self.build_modal(content);
649		},
650
651		// Create Instagram Modal
652		// ----------------------------------------------------------------
653		create_instagram : function() {
654			var self = this;
655			var id = self.options.instagram_id;
656			var content = '';
657
658			var error_msg = 'Instagram photo couldn\'t be loaded, please check the embed code and try again.';
659
660			self.build_modal('<div class="modaal-content-container' + ( self.options.loading_class != '' ? ' ' + self.options.loading_class : '' ) + '">' + self.options.loading_content + '</div>' );
661
662			// ID exists, is not empty null or undefined.
663			if ( id != '' && id !== null && id !== undefined ) {
664				// set up oembed url
665				var ig_url = 'https://api.instagram.com/oembed?url=http://instagr.am/p/' + id + '/';
666
667				$.ajax({
668					url: ig_url,
669					dataType: "jsonp",
670					cache: false,
671					success: function (data) {
672						// set up the new content
673						content = data.html;
674
675						// now set location for new content
676						var target = $('#' + self.scope.id + ' .modaal-content-container');
677						if ( target.length > 0) {
678							// add HTML into target region
679							target.removeClass( self.options.loading_class );
680							target.html(content);
681
682							// now trigger an instagram refresh
683							window.instgrm.Embeds.process();
684						}
685					},
686					error: function() {
687						content = error_msg;
688
689						// now set location for new content
690						var target = $('#' + self.scope.id + ' .modaal-content-container');
691						if ( target.length > 0) {
692							target.removeClass( self.options.loading_class ).addClass( self.options.ajax_error_class );
693							target.html(content);
694						}
695					}
696				});
697
698			} else {
699				content = error_msg;
700			}
701
702			return false;
703		},
704
705		// Fetch Ajax Data
706		// ----------------------------------------------------------------
707		fetch_ajax : function(url) {
708			var self = this;
709			var content = '';
710
711			// If no accessible title, set it to 'Dialog Window'
712			if ( self.options.accessible_title == null ) {
713				self.options.accessible_title = 'Dialog Window'
714			}
715
716			if ( self.xhr !== null ){
717				self.xhr.abort();
718				self.xhr = null;
719			}
720
721			self.build_modal('<div class="modaal-content-container' + ( self.options.loading_class != '' ? ' ' + self.options.loading_class : '' ) + '">' + self.options.loading_content + '</div>' );
722
723			self.xhr = $.ajax(url, {
724				success: function(data) {
725					// content fetch is successful so push it into markup
726					var target = $('#' + self.scope.id).find('.modaal-content-container');
727					if ( target.length > 0){
728						target.removeClass( self.options.loading_class );
729						target.html( data );
730
731						self.options.ajax_success.call(self, target);
732					}
733				},
734				error: function( xhr ) {
735					// There were some errors so return an error message
736					if ( xhr.statusText == 'abort' ){
737						return;
738					}
739
740					var target = $('#' + self.scope.id + ' .modaal-content-container');
741					if ( target.length > 0){
742						target.removeClass( self.options.loading_class ).addClass( self.options.ajax_error_class );
743						target.html( 'Content could not be loaded. Please check the source and try again.' );
744					}
745				}
746			});
747		},
748
749		// Create Confirm Modal
750		// ----------------------------------------------------------------
751		create_confirm : function() {
752			var self = this;
753			var content;
754
755			content = '<div class="modaal-content-container">' +
756					'<h1 id="modaal-title">' + self.options.confirm_title + '</h1>' +
757					'<div class="modaal-confirm-content">' + self.options.confirm_content + '</div>' +
758						'<div class="modaal-confirm-wrap">' +
759							'<button type="button" class="modaal-confirm-btn modaal-ok" aria-label="Confirm">' + self.options.confirm_button_text + '</button>' +
760							'<button type="button" class="modaal-confirm-btn modaal-cancel" aria-label="Cancel">' + self.options.confirm_cancel_button_text + '</button>' +
761						'</div>' +
762					'</div>' +
763				'</div>';
764
765			// now push content into markup
766			self.build_modal(content);
767		},
768
769		// Create Image/Gallery Modal
770		// ----------------------------------------------------------------
771		create_image : function() {
772			var self = this;
773			var content;
774
775			var modaal_image_markup = '';
776			var gallery_total;
777			var prev_btn = '<button type="button" class="modaal-gallery-control modaal-gallery-prev" id="modaal-gallery-prev" aria-label="Previous image (use left arrow to change)"><span>Previous Image</span></button>';
778			var next_btn = '<button type="button" class="modaal-gallery-control modaal-gallery-next" id="modaal-gallery-next" aria-label="Next image (use right arrow to change)"><span>Next Image</span></button>';
779
780			// If has rel attribute
781			if ( self.$elem.is('[rel]') ) {
782				// find gallery rel
783				var gallery_group = self.$elem.attr('rel');
784				var gallery_group_items = $('[rel="' + gallery_group + '"]');
785
786				// remove any previous active attribute to any in the group
787				gallery_group_items.removeAttr('data-gallery-active', 'is_active');
788				// add active attribute to the item clicked
789				self.$elem.attr('data-gallery-active', 'is_active');
790
791				// how many in the rel grouping are there (-1 to connect with each function starting with 0)
792				gallery_total = gallery_group_items.length - 1;
793
794				// prepare array for gallery data
795				var gallery = [];
796
797				// start preparing markup
798				modaal_image_markup = '<div class="modaal-gallery-item-wrap">';
799
800				// loop each grouping item and push it into our gallery array
801				gallery_group_items.each(function(i, item) {
802					// setup default content
803					var img_src = '';
804					var img_alt = '';
805					var img_description = '';
806					var img_active = false;
807
808					var data_modaal_desc = item.getAttribute('data-modaal-desc');
809					var data_item_active = item.getAttribute('data-gallery-active');
810
811					// is it an img SRC or link HREF value
812					if ( item.href !== '' || item.href !== undefined ) {
813						img_src = item.href;
814					} else if ( item.src !== '' || item.src !== undefined ) {
815						img_src = item.src;
816					}
817
818					// Does it have a modaal description
819					if ( data_modaal_desc != '' && data_modaal_desc !== null && data_modaal_desc !== undefined ) {
820						img_alt = data_modaal_desc;
821						img_description = '<div class="modaal-gallery-label"><span class="modaal-accessible-hide">Image ' + (i+1) + ' - </span>' + data_modaal_desc + '</div>'
822					} else {
823						img_description = '<div class="modaal-gallery-label"><span class="modaal-accessible-hide">Image ' + (i+1) + '</span></div>';
824					}
825
826					// is it the active item
827					if ( data_item_active ) {
828						img_active = true
829					}
830
831					// set new object for values we want
832					var gallery_item = {
833						'url': img_src,
834						'alt': img_alt,
835						'rawdesc': data_modaal_desc,
836						'desc': img_description,
837						'active': img_active
838					};
839
840					// push object into gallery array
841					gallery.push( gallery_item );
842				});
843
844				// now loop through all items in the gallery and build up the markup
845				for (var i = 0; i < gallery.length; i++) {
846					// Set default active class, then check if array item active is true and update string for class
847					var is_active = '';
848					var aria_label = gallery[i].rawdesc ? 'Image: ' + gallery[i].rawdesc : 'Image ' + i + ' no description';
849
850					if ( gallery[i].active ) {
851						is_active = ' ' + self.private_options.active_class;
852					}
853
854					// for each item build up the markup
855					modaal_image_markup += '<div class="modaal-gallery-item gallery-item-' + i + is_active + '" aria-label="' + aria_label + '">' +
856						'<img src="' + gallery[i].url + '" alt=" " style="width:100%">' +
857						gallery[i].desc +
858					'</div>';
859				}
860
861				// close off the markup for the gallery and add next/previous buttons
862				modaal_image_markup += '</div>' + prev_btn + next_btn;
863			} else {
864				// This is only a single gallery item so let's grab the necessary values
865
866				// Setup selected image
867				var this_img_src = self.$elem.attr('href');
868				var this_img_alt_txt = '';
869				var this_img_alt = '';
870				var aria_label = '';
871
872				if ( self.$elem.attr('data-modaal-desc') ) {
873					aria_label = self.$elem.attr('data-modaal-desc');
874					this_img_alt_txt = self.$elem.attr('data-modaal-desc');
875					this_img_alt = '<div class="modaal-gallery-label"><span class="modaal-accessible-hide">Image - </span>' + this_img_alt_txt + '</div>';
876				} else {
877					aria_label = "Image with no description";
878				}
879
880				// build up the html
881				modaal_image_markup = '<div class="modaal-gallery-item is_active" aria-label="' + aria_label + '">' +
882					'<img src="' + this_img_src + '" alt=" " style="width:100%">' +
883					this_img_alt +
884				'</div>';
885			}
886
887			// Update content variable
888			content = modaal_image_markup;
889
890			// now push content into markup
891			self.build_modal(content);
892
893			// setup next & prev buttons
894			if ( $('.modaal-gallery-item.is_active').is('.gallery-item-0') ) {
895				$('.modaal-gallery-prev').hide();
896			}
897			if ( $('.modaal-gallery-item.is_active').is('.gallery-item-' + gallery_total) ) {
898				$('.modaal-gallery-next').hide();
899			}
900		},
901
902		// Gallery Change Image
903		// ----------------------------------------------------------------
904		gallery_update : function(direction) {
905			var self = this;
906			var this_gallery = $('#' + self.scope.id);
907			var this_gallery_item = this_gallery.find('.modaal-gallery-item');
908			var this_gallery_total = this_gallery_item.length - 1;
909
910			// if single item, don't proceed
911			if ( this_gallery_total == 0 ) {
912				return false;
vendor: 5,735 bytes, lines 913-1076
913			}
914
915			var prev_btn = this_gallery.find('.modaal-gallery-prev'),
916				next_btn = this_gallery.find('.modaal-gallery-next');
917
918			var duration = 250;
919
920			var new_img_w = 0,
921				new_img_h = 0;
922
923			// CB: Before image change
924			var current_item = this_gallery.find( '.modaal-gallery-item.' + self.private_options.active_class ),
925				incoming_item = ( direction == 'next' ? current_item.next( '.modaal-gallery-item' ) : current_item.prev( '.modaal-gallery-item' ) );
926			self.options.before_image_change.call(self, current_item, incoming_item);
927
928			// stop change if at start of end
929			if ( direction == 'prev' && this_gallery.find('.gallery-item-0').hasClass('is_active') ) {
930				return false;
931			} else if ( direction == 'next' && this_gallery.find('.gallery-item-' + this_gallery_total).hasClass('is_active') ) {
932				return false;
933			}
934
935
936			// lock dimensions
937			current_item.stop().animate({
938				opacity: 0
939			}, duration, function(){
940				// Move to appropriate image
941				incoming_item.addClass('is_next').css({
942					'position': 'absolute',
943					'display': 'block',
944					'opacity': 0
945				});
946
947				// Collect doc width
948				var doc_width = $(document).width();
949				var width_threshold = doc_width > 1140 ? 280 : 50;
950
951				// start toggle to 'is_next'
952				new_img_w = this_gallery.find('.modaal-gallery-item.is_next').width();
953				new_img_h = this_gallery.find('.modaal-gallery-item.is_next').height();
954
955				var new_natural_w = this_gallery.find('.modaal-gallery-item.is_next img').prop('naturalWidth');
956				var new_natural_h = this_gallery.find('.modaal-gallery-item.is_next img').prop('naturalHeight');
957
958				// if new image is wider than doc width
959				if ( new_natural_w > (doc_width - width_threshold) ) {
960					// set new width just below doc width
961					new_img_w = doc_width - width_threshold;
962
963					// Set temp widths so we can calulate the correct height;
964					this_gallery.find('.modaal-gallery-item.is_next').css({ 'width': new_img_w });
965					this_gallery.find('.modaal-gallery-item.is_next img').css({ 'width': new_img_w });
966
967					// Set new height variable
968					new_img_h = this_gallery.find('.modaal-gallery-item.is_next').find('img').height();
969				} else {
970					// new img is not wider than screen, so let's set the new dimensions
971					new_img_w = new_natural_w;
972					new_img_h = new_natural_h;
973				}
974
975				// resize gallery region
976				this_gallery.find('.modaal-gallery-item-wrap').stop().animate({
977					'width': new_img_w,
978					'height': new_img_h
979				}, duration, function() {
980					// hide old active image
981					current_item.removeClass(self.private_options.active_class + ' ' + self.options.gallery_active_class).removeAttr('style');
982					current_item.find('img').removeAttr('style');
983
984					// show new image
985					incoming_item.addClass(self.private_options.active_class + ' ' + self.options.gallery_active_class).removeClass('is_next').css('position','');
986
987					// animate in new image (now has the normal is_active class
988					incoming_item.stop().animate({
989						opacity: 1
990					}, duration, function(){
991						$(this).removeAttr('style').css({
992							'width': '100%'
993						});
994						$(this).find('img').css('width', '100%');
995
996						// remove dimension lock
997						this_gallery.find('.modaal-gallery-item-wrap').removeAttr('style');
998
999						// CB: After image change
1000						self.options.after_image_change.call( self, incoming_item );
1001					});
1002
1003					// Focus on the new gallery item
1004					this_gallery.find('.modaal-gallery-item').removeAttr('tabindex');
1005					this_gallery.find('.modaal-gallery-item.' + self.private_options.active_class + '').attr('tabindex', '0').focus();
1006
1007					// hide/show next/prev
1008					if ( this_gallery.find('.modaal-gallery-item.' + self.private_options.active_class).is('.gallery-item-0') ) {
1009						prev_btn.stop().animate({
1010							opacity: 0
1011						}, 150, function(){
1012							$(this).hide();
1013						});
1014					} else {
1015						prev_btn.stop().css({
1016							'display': 'block',
1017							'opacity': prev_btn.css('opacity')
1018						}).animate({
1019							opacity: 1
1020						}, 150);
1021					}
1022					if ( this_gallery.find('.modaal-gallery-item.' + self.private_options.active_class).is('.gallery-item-' + this_gallery_total) ) {
1023						next_btn.stop().animate({
1024							opacity: 0
1025						}, 150, function(){
1026							$(this).hide();
1027						});
1028					} else {
1029						next_btn.stop().css({
1030							'display': 'block',
1031							'opacity': prev_btn.css('opacity')
1032						}).animate({
1033							opacity: 1
1034						}, 150);
1035					}
1036				});
1037			});
1038		},
1039
1040		// Create Video Modal
1041		// ----------------------------------------------------------------
1042		create_video : function(url) {
1043			var self = this;
1044			var content;
1045
1046			// video markup
1047			content = '<iframe src="' + url + '" class="modaal-video-frame" frameborder="0" allowfullscreen></iframe>';
1048
1049			// now push content into markup
1050			self.build_modal('<div class="modaal-video-container">' + content + '</div>');
1051		},
1052
1053		// Create iFrame Modal
1054		// ----------------------------------------------------------------
1055		create_iframe : function(url) {
1056			var self = this;
1057			var content;
1058
1059			if ( self.options.width !== null || self.options.width !== undefined || self.options.height !== null || self.options.height !== undefined ) {
1060				// video markup
1061				content = '<iframe src="' + url + '" class="modaal-iframe-elem" frameborder="0" allowfullscreen></iframe>';
1062			} else {
1063				content = '<div class="modaal-content-container">Please specify a width and height for your iframe</div>';
1064			}
1065
1066			// now push content into markup
1067			self.build_modal(content);
1068		},
1069
1070		// Open Modaal
1071		// ----------------------------------------------------------------
1072		modaal_open : function() {
1073			var self = this;
1074			var modal_wrapper = $( '#' + self.scope.id );
1075			var animation_type = self.options.animation;
1076
1077			if (animation_type === 'none' ){
1078				modal_wrapper.removeClass('modaal-start_none');
1079				self.options.after_open.call(self, modal_wrapper);
1080			}
1081
1082			// Open with fade
1083			if (animation_type === 'fade') {
1084				modal_wrapper.removeClass('modaal-start_fade');
1085			}
1086
1087			// Open with slide down
1088			if (animation_type === 'slide-down') {
1089				modal_wrapper.removeClass('modaal-start_slide_down');
1090			}
1091
1092			var focusTarget = modal_wrapper;
1093
1094			// Switch focusTarget tabindex (switch from other modal if exists)
1095			$('.modaal-wrapper *[tabindex=0]').removeAttr('tabindex');
1096
1097			if ( self.options.type == 'image' ) {
1098				focusTarget = $('#' + self.scope.id).find('.modaal-gallery-item.' + self.private_options.active_class);
1099
1100			} else if ( modal_wrapper.find('.modaal-iframe-elem').length ) {
1101				focusTarget = modal_wrapper.find('.modaal-iframe-elem');
1102
1103			} else if ( modal_wrapper.find('.modaal-video-wrap').length ) {
1104				focusTarget = modal_wrapper.find('.modaal-video-wrap');
1105
1106			} else {
1107				focusTarget = modal_wrapper.find('.modaal-focus');
1108
1109			}
1110
1111			// now set the focus
1112			focusTarget.attr('tabindex', '0').focus();
1113
1114			// Run after_open
1115			if (animation_type !== 'none') {
1116				// CB: after_open
1117				setTimeout(function() {
1118					self.options.after_open.call(self, modal_wrapper)
1119				}, self.options.after_callback_delay);
1120			}
1121		},
1122
1123		// Close Modal
1124		// ----------------------------------------------------------------
1125		modaal_close : function() {
1126			var self = this;
1127			var modal_wrapper = $( '#' + self.scope.id );
1128
1129			// CB: before_close
1130			self.options.before_close.call(self, modal_wrapper);
1131
1132			if (self.xhr !== null){
1133				self.xhr.abort();
1134				self.xhr = null;
1135			}
1136
1137			// Now we close the modal
1138			if (self.options.animation === 'none' ){
1139				modal_wrapper.addClass('modaal-start_none');
1140			}
1141
1142			// Close with fade
1143			if (self.options.animation === 'fade') {
1144				modal_wrapper.addClass('modaal-start_fade');
1145			}
1146
1147			// Close with slide up (using initial slide down)
1148			if (self.options.animation === 'slide-down') {
1149				modal_wrapper.addClass('modaal-start_slide_down');
1150			}
1151
1152			// CB: after_close and remove
1153			setTimeout(function() {
1154				// clone inline content back to origin place
1155				if (self.options.type == 'inline') {
1156					$('#' + self.scope.id + ' .modaal-content-container').contents().clone(true,true).appendTo( self.$elem.attr('href') )
1157				}
1158				// remove markup from dom
1159				modal_wrapper.remove();
1160				// CB: after_close
1161				self.options.after_close.call(self);
1162				// scope is now closed
1163				self.scope.is_open = false;
1164
1165			}, self.options.after_callback_delay);
1166
1167			// Call overlay hide
1168			self.modaal_overlay('hide');
1169
1170			// Roll back to last focus state before modal open. If was closed programmatically, this might not be set
1171			if (self.lastFocus != null) {
1172				self.lastFocus.focus();
1173			}
1174		},
1175
1176		// Overlay control (accepts action for show or hide)
1177		// ----------------------------------------------------------------
1178		modaal_overlay : function(action) {
1179			var self = this;
1180
1181			if (action == 'show') {
1182				// Modal is open so update scope
1183				self.scope.is_open = true;
1184
1185				// set body to overflow hidden if background_scroll is false
1186				if (! self.options.background_scroll) {
1187					self.dom.addClass('modaal-noscroll');
1188				}
1189
1190				// append modaal overlay
1191				self.dom.append('<div class="modaal-overlay" id="' + self.scope.id + '_overlay"></div>');
1192
1193				// now show
1194				$('#' + self.scope.id + '_overlay').css('background', self.options.background).stop().animate({
1195					opacity: self.options.overlay_opacity
1196				}, self.options.animation_speed, function(){
1197					// now open the modal
1198					self.modaal_open();
1199				});
1200
1201			} else if (action == 'hide') {
1202				// remove body overflow lock
1203				self.dom.removeClass('modaal-noscroll');
1204
1205				// now hide the overlay
1206				$('#' + self.scope.id + '_overlay').stop().animate({
1207					opacity: 0
1208				}, self.options.animation_speed, function(){
1209					// remove overlay from dom
1210					$(this).remove();
1211				});
1212			}
1213		}
1214	};
1215
1216	// Declare the modaal jQuery method
1217	// ------------------------------------------------------------
1218	$.fn.modaal = function(options) {
1219		return this.each(function () {
1220			var existing_modaal = $(this).data('modaal');
1221
1222			if ( existing_modaal ){
1223				// Checking for string value, used for methods
1224				if (typeof(options) == 'string'){
1225					switch (options) {
1226						case 'close':
1227							existing_modaal.modaal_close();
1228							break;
1229					}
1230				}
1231			} else {
1232				// Not a string, so let's setup the modal ready to use
1233				var modaal = Object.create(Modaal);
1234				modaal.init(options, this);
1235				$.data(this, "modaal", modaal);
1236			}
1237		});
1238	};
1239
1240	// Default options
1241	// ------------------------------------------------------------
1242	$.fn.modaal.options = {
1243
1244		//General
1245		type : 'inline',
1246		animation : 'fade',
1247		animation_speed : 300,
1248		after_callback_delay : 350,
1249		is_locked : false,
1250		hide_close: false,
1251		background: '#000',
1252		overlay_opacity: '0.8',
1253		overlay_close: true,
1254		accessible_title: 'Dialog Window',
1255		start_open: false,
1256		fullscreen: false,
1257		custom_class: '',
1258		background_scroll: false,
1259		should_open: true,
1260		close_text: 'Close',
1261		close_aria_label: 'Close (Press escape to close)',
1262		width: null,
1263		height: null,
1264
1265		//Events
1266		before_open : function(){},
1267		after_open : function(){},
1268		before_close : function(){},
1269		after_close : function(){},
1270		source : function( element, src ){
1271			return src;
1272		},
1273
1274		//Confirm Modal
1275		confirm_button_text: 'Confirm', // text on confirm button
1276		confirm_cancel_button_text: 'Cancel',
1277		confirm_title: 'Confirm Title', // title for confirm modal
1278		confirm_content: '<p>This is the default confirm dialog content. Replace me through the options</p>', // html for confirm message
1279		confirm_callback: function() {},
1280		confirm_cancel_callback: function() {},
1281
1282
1283		//Gallery Modal
1284		gallery_active_class: 'gallery_active_item',
1285		before_image_change: function( current_item, incoming_item ) {},
1286		after_image_change: function( current_item ) {},
1287
1288		//Ajax Modal
1289		loading_content : modaal_loading_spinner,
1290		loading_class : 'is_loading',
1291		ajax_error_class : 'modaal-error',
1292		ajax_success : function(){},
1293
1294		//Instagram
1295		instagram_id : null
1296	};
1297
1298} ( jQuery, window, document ) );
1299
1300(function ($, ns) {
1301
1302  var modalComponent = {
1303
1304    global: false,
1305    initiable: true,
1306    defaultSelector: '.modaal',
1307
1308    init: function ($wrap, opts) {
1309
1310      var t = this;
1311      t.$wrap = $wrap || $(t.defaultSelector);
1312
1313      var single_modaal = t.$wrap;
1314
1315      if (single_modaal.length) {
1316        single_modaal.each(function () {
1317          var self = $(this);
1318
1319          // new empty options
1320          var options = {};
1321          var inline_options = false;
1322
1323          // option: type
1324          if (self.attr('data-modaal-type')) {
1325            inline_options = true;
1326            options.type = self.attr('data-modaal-type');
1327          }
1328          if (self.hasClass('modaal-video')) {
1329            inline_options = true;
1330            options.type = 'video';
1331          }
1332
1333          if (self.hasClass('modaal-ajax')) {
1334            inline_options = true;
1335            options.type = 'ajax';
1336            options.ajax_success = function () {
1337
1338              var $context = $('.modaal-content-container');
1339              if ($context.height() > $('.modaal-content').height()) {
1340                $context.css('height', '100%');
1341              }
1342              ns.theme.initModulesInContext($context);
1343              var $sliderInfosPratiques = $context.find('.slider-infos-pratiques');
1344              if($sliderInfosPratiques.length){
1345                var sliderOpts = {
1346                  'mode': 'horizontal',
1347                  'auto': false,
1348                  'autoControls': true,
1349                  'autoControlsCombine': true,
1350                  'keyboardEnabled': true,
1351                  'easing': 'ease',
1352                  'adaptiveHeight': true,
1353                  'stopAutoOnClick': false,
1354                  'touchEnabled': false
1355                };
1356                $sliderInfosPratiques.bxSlider(sliderOpts);
1357              }
1358              //ns.theme.initComponents(false,$context);
1359            }
1360          }
1361
1362          // option: animation
1363          if (self.attr('data-modaal-animation')) {
1364            inline_options = true;
1365            options.animation = self.attr('data-modaal-animation');
1366          }
1367
1368          // option: animation_speed
1369          if (self.attr('data-modaal-animation-speed')) {
1370            inline_options = true;
1371            options.animation_speed = self.attr('data-modaal-animation-speed');
1372          }
1373
1374          // option: after_callback_delay
1375          if (self.attr('data-modaal-after-callback-delay')) {
1376            inline_options = true;
1377            options.after_callback_delay = self.attr('data-modaal-after-callback-delay');
1378          }
1379
1380          // option: after_callback_delay
1381          if (self.attr('data-modaal-is-locked')) {
1382            inline_options = true;
1383            options.is_locked = (self.attr('data-modaal-is-locked') === 'true' ? true : false);
1384          }
1385
1386          // option: hide_close
1387          if (self.attr('data-modaal-hide-close')) {
1388            inline_options = true;
1389            options.hide_close = (self.attr('data-modaal-hide-close') === 'true' ? true : false);
1390          }
1391
1392          // option: background
1393          if (self.attr('data-modaal-background')) {
1394            inline_options = true;
1395            options.background = self.attr('data-modaal-background');
1396          }
1397
1398          // option: overlay_opacity
1399          if (self.attr('data-modaal-overlay-opacity')) {
1400            inline_options = true;
1401            options.overlay_opacity = self.attr('data-modaal-overlay-opacity');
1402          }
1403
1404          // option: overlay_close
1405          if (self.attr('data-modaal-overlay-close')) {
1406            inline_options = true;
1407            options.overlay_close = (self.attr('data-modaal-overlay-close') === 'false' ? false : true);
1408          }
1409
1410          // option: accessible_title
1411          if (self.attr('data-modaal-accessible-title')) {
1412            inline_options = true;
1413            options.accessible_title = self.attr('data-modaal-accessible-title');
1414          }
1415
1416          // option: start_open
1417          if (self.attr('data-modaal-start-open')) {
1418            inline_options = true;
1419            options.start_open = (self.attr('data-modaal-start-open') === 'true' ? true : false);
1420          }
1421
1422          // option: fullscreen
1423          if (self.attr('data-modaal-fullscreen')) {
1424            inline_options = true;
1425            options.fullscreen = (self.attr('data-modaal-fullscreen') === 'true' ? true : false);
1426          }
1427
1428          // option: custom_class
1429          if (self.attr('data-modaal-custom-class')) {
1430            inline_options = true;
1431            options.custom_class = self.attr('data-modaal-custom-class');
1432          }
1433
1434          // option: close_text
1435          if (self.attr('data-modaal-close-text')) {
1436            inline_options = true;
1437            options.close_text = self.attr('data-modaal-close-text');
1438          }
1439
1440          // option: close_aria_label
1441          if (self.attr('data-modaal-close-aria-label')) {
1442            inline_options = true;
1443            options.close_aria_label = self.attr('data-modaal-close-aria-label');
1444          }
1445
1446          // option: background_scroll
1447          if (self.attr('data-modaal-background-scroll')) {
1448            inline_options = true;
1449            options.background_scroll = (self.attr('data-modaal-background-scroll') === 'true' ? true : false);
1450          }
1451
1452          // option: width
1453          if (self.attr('data-modaal-width')) {
1454            inline_options = true;
1455            options.width = parseInt(self.attr('data-modaal-width'));
1456          }
1457
1458          // option: height
1459          if (self.attr('data-modaal-height')) {
1460            inline_options = true;
1461            options.height = parseInt(self.attr('data-modaal-height'));
1462          }
1463
1464          // option: confirm_button_text
1465          if (self.attr('data-modaal-confirm-button-text')) {
1466            inline_options = true;
1467            options.confirm_button_text = self.attr('data-modaal-confirm-button-text');
1468          }
1469
1470          // option: confirm_cancel_button_text
1471          if (self.attr('data-modaal-confirm-cancel-button-text')) {
1472            inline_options = true;
1473            options.confirm_cancel_button_text = self.attr('data-modaal-confirm-cancel-button-text');
1474          }
1475
1476          // option: confirm_title
1477          if (self.attr('data-modaal-confirm-title')) {
1478            inline_options = true;
1479            options.confirm_title = self.attr('data-modaal-confirm-title');
1480          }
1481
1482          // option: confirm_content
1483          if (self.attr('data-modaal-confirm-content')) {
1484            inline_options = true;
1485            options.confirm_content = self.attr('data-modaal-confirm-content');
1486          }
1487
1488          // option: gallery_active_class
1489          if (self.attr('data-modaal-gallery-active-class')) {
1490            inline_options = true;
1491            options.gallery_active_class = self.attr('data-modaal-gallery-active-class');
1492          }
1493
1494          // option: loading_content
1495          if (self.attr('data-modaal-loading-content')) {
1496            inline_options = true;
1497            options.loading_content = self.attr('data-modaal-loading-content');
1498          }
1499
1500          // option: loading_class
1501          if (self.attr('data-modaal-loading-class')) {
1502            inline_options = true;
1503            options.loading_class = self.attr('data-modaal-loading-class');
1504          }
1505
1506          // option: ajax_error_class
1507          if (self.attr('data-modaal-ajax-error-class')) {
1508            inline_options = true;
1509            options.ajax_error_class = self.attr('data-modaal-ajax-error-class');
1510          }
1511
1512          // option: start_open
1513          if (self.attr('data-modaal-instagram-id')) {
1514            inline_options = true;
1515            options.instagram_id = self.attr('data-modaal-instagram-id');
1516          }
1517
1518          var computedOpts = $.extend(options, opts);
1519
1520          // now set it up for the trigger, but only if inline_options is true
1521          if (inline_options) {
1522            self.modaal(computedOpts);
1523          }
1524        });
1525      }
1526    }
1527  };
1528
1529  ns.app.registerComponent('modal', modalComponent, {initGlobal: true}); //si on passe { initGlobal:true } il sera meme auto instancie
1530
1531})(jQuery, window.wonderwp);
1532
1533(function($,ns){
1534
1535    ns.initTabs = function($tabs) {
1536
1537        /*
1538         * jQuery Accessible tab panel system, using ARIA
1539         * Website: http://a11y.nicolas-hoffmann.net/tabs/
1540         * License MIT: https://github.com/nico3333fr/jquery-accessible-tabs-aria/blob/master/LICENSE
1541         */
1542        // Store current URL hash.
1543        var hash = window.location.hash.replace("#", "");
1544
1545        if ($tabs.length) {
1546
1547            var $tab_list = $tabs.find(".js-tablist");
1548            $tab_list.each(function () {
1549                var $this_tab_list = $(this),
1550                    options = $this_tab_list.data(),
1551                    $tabs_prefix_classes = typeof options.tabsPrefixClass !== 'undefined' ? options.tabsPrefixClass + '-' : '',
1552                    $hx = typeof options.hx !== 'undefined' ? options.hx : '',
1553                    $existing_hx = typeof options.existingHx !== 'undefined' ? options.existingHx : '',
1554                    $this_tab_list_items = $this_tab_list.children(".js-tablist__item"),
1555                    $this_tab_list_links = $this_tab_list.find(".js-tablist__link");
1556
1557                // roles init
1558                $this_tab_list.attr("role", "tablist");                   // ul
1559                $this_tab_list_items.attr("role", "presentation");        // li
1560                $this_tab_list_links.attr("role", "tab");                 // a
1561
1562                // classes init
1563                $this_tab_list.addClass($tabs_prefix_classes + 'tabs__list');
1564                $this_tab_list_items.addClass($tabs_prefix_classes + 'tabs__item');
1565                $this_tab_list_links.addClass($tabs_prefix_classes + 'tabs__link');
1566
1567                // controls/tabindex attributes
1568                $this_tab_list_links.each(function () {
1569                    var $this = $(this),
1570                        $hx_generated_class = typeof options.tabsGeneratedHxClass !== 'undefined' ? options.tabsGeneratedHxClass : 'invisible',
1571                        $href = $this.attr("href"),
1572                        $controls = $($href),
1573                        $text = $this.text();
1574
1575                    if ($hx !== "") {
1576                        $controls.prepend('<' + $hx + ' class="' + $hx_generated_class + '" tabindex="0">' + $text + '</' + $hx + '>');
1577                    }
1578                    if ($existing_hx !== "") {
1579                        $controls.find($existing_hx + ':first-child').attr('tabindex', 0);
1580                    }
1581                    if (typeof $href !== "undefined" && $href !== "" && $href !== "#") {
1582                        $this.attr({
1583                            "aria-controls": $href.replace("#", ""),
1584                            "tabindex": -1,
1585                            "aria-selected": "false"
1586                        });
1587                    }
1588
1589                    $this.removeAttr("href");
1590
1591                });
1592            });
1593
1594            /* Tabs content ---------------------------------------------------------------------------------------------------- */
1595            $(".js-tabcontent").attr({
1596                "role": "tabpanel",             // contents
1597                "aria-hidden": "true"           // all hidden
1598                //"tabindex": 0
1599            })
1600                .each(function () {
1601                    var $this = $(this),
1602                        $this_id = $this.attr("id"),
1603                        $prefix_attribute = $("#label_" + $this_id).closest('.js-tablist').attr('data-tabs-prefix-class'),
1604                        $tabs_prefix_classes = typeof $prefix_attribute !== 'undefined' ? $prefix_attribute + '-' : '';
1605                    // label by link
1606                    $this.attr("aria-labelledby", "label_" + $this_id);
1607
1608                    $this.addClass($tabs_prefix_classes + 'tabs__content');
1609                });
1610
1611            // search if hash is ON tabs
1612            if (hash !== "" && $("#" + hash + ".js-tabcontent").length !== 0) {
1613                // display
1614                $("#" + hash + ".js-tabcontent").removeAttr("aria-hidden");
1615                // selection menu
1616                $("#label_" + hash + ".js-tablist__link").attr({
1617                    "aria-selected": "true",
1618                    "tabindex": 0
1619                });
1620            }
1621            // search if hash is IN tabs
1622            if (hash !== "" && $("#" + hash).parents('.js-tabcontent').length) {
1623                var $this_hash = $("#" + hash),
1624                    $tab_content_parent = $this_hash.parents('.js-tabcontent'),
1625                    $tab_content_parent_id = $tab_content_parent.attr('id');
1626
1627                $tab_content_parent.removeAttr("aria-hidden");
1628                // selection menu
1629                $("#label_" + $tab_content_parent_id + ".js-tablist__link").attr({
1630                    "aria-selected": "true",
1631                    "tabindex": 0
1632                });
1633            }
1634
1635            // if no selected => select first
1636            $tabs.each(function () {
1637                var $this = $(this),
1638                    $tab_selected = $this.find('.js-tablist__link[aria-selected="true"]'),
1639                    $first_link = $this.find(".js-tablist__link:first"),
1640                    $first_content = $this.find(".js-tabcontent:first");
1641
1642                if ($tab_selected.length === 0) {
1643                    $first_link.attr({
1644                        "aria-selected": "true",
1645                        "tabindex": 0
1646                    });
1647                    $first_content.removeAttr("aria-hidden");
1648                }
1649            });
1650
1651            /* Events ---------------------------------------------------------------------------------------------------------- */
1652            /* click on a tab link */
1653            $("body").on("click", ".js-tablist__link", function (event) {
1654                var $this = $(this),
1655                    $hash_to_update = $this.attr("aria-controls"),
1656                    $tab_content_linked = $("#" + $this.attr("aria-controls")),
1657                    $parent = $this.closest(".js-tabs"),
1658                    $all_tab_links = $parent.find(".js-tablist__link"),
1659                    $all_tab_contents = $parent.find(".js-tabcontent");
1660
1661                // aria selected false on all links
1662                $all_tab_links.attr({
1663                    "tabindex": -1,
1664                    "aria-selected": "false"
1665                });
1666
1667                // add aria selected on $this
1668                $this.attr({
1669                    "aria-selected": "true",
1670                    "tabindex": 0
1671                });
1672
1673                // add aria-hidden on all tabs contents
1674                $all_tab_contents.attr("aria-hidden", "true");
1675
1676                // remove aria-hidden on tab linked
1677                $tab_content_linked.removeAttr("aria-hidden");
1678
1679                // add fragment (timeout for transitions)
1680                setTimeout(function () {
1681                    history.pushState(null, null, location.pathname + location.search + '#' + $hash_to_update)
1682                }, 1000);
1683
1684                event.preventDefault();
1685            })
1686            /* Key down in tabs */
1687                .on("keydown", ".js-tablist", function (event) {
1688
1689                    var $parent = $(this).closest('.js-tabs'),
1690                        $activated = $parent.find('.js-tablist__link[aria-selected="true"]').parent(),
1691                        $last_link = $parent.find(".js-tablist__item:last-child .js-tablist__link"),
1692                        $first_link = $parent.find(".js-tablist__item:first-child .js-tablist__link"),
1693                        $focus_on_tab_only = false;
1694
1695                    // some event should be activated only if the focus is on tabs (not on tabpanel)
1696                    if ($(document.activeElement).is($parent.find('.js-tablist__link'))) {
1697                        $focus_on_tab_only = true;
1698                    }
1699
1700                    // catch keyboard event only if focus is on tab
1701                    if ($focus_on_tab_only && !event.ctrlKey) {
1702                        // strike up or left in the tab
1703                        if (event.keyCode == 37 || event.keyCode == 38) {
1704                            // if we are on first => activate last
1705                            if ($activated.is(".js-tablist__item:first-child")) {
1706                                $last_link.click().focus();
1707                            }
1708                            // else activate previous
1709                            else {
1710                                $activated.prev().children(".js-tablist__link").click().focus();
1711                            }
1712                            event.preventDefault();
1713                        }
1714                        // strike down or right in the tab
1715                        else if (event.keyCode == 40 || event.keyCode == 39) {
1716                            // if we are on last => activate first
1717                            if ($activated.is(".js-tablist__item:last-child")) {
1718                                $first_link.click().focus();
1719                            }
1720                            // else activate next
1721                            else {
1722                                $activated.next().children(".js-tablist__link").click().focus();
1723                            }
1724                            event.preventDefault();
1725                        }
1726                        else if (event.keyCode == 36) {
1727                            // activate first tab
1728                            $first_link.click().focus();
1729                            event.preventDefault();
1730                        }
1731                        else if (event.keyCode == 35) {
1732                            // activate last tab
1733                            $last_link.click().focus();
1734                            event.preventDefault();
1735                        }
1736
1737                    }
1738
1739                })
1740                .on("keydown", ".js-tabcontent", function (event) {
1741
1742                    var $this = $(this),
1743                        $selector_tab_to_focus = $this.attr('aria-labelledby'),
1744                        $tab_to_focus = $("#" + $selector_tab_to_focus),
1745                        $parent_item = $tab_to_focus.parent(),
1746                        $parent_list = $parent_item.parent();
1747
1748                    // CTRL up/Left
1749                    if ((event.keyCode == 37 || event.keyCode == 38) && event.ctrlKey) {
1750                        $tab_to_focus.focus();
1751                        event.preventDefault();
1752                    }
1753                    // CTRL PageUp
1754                    if (event.keyCode == 33 && event.ctrlKey) {
1755                        $tab_to_focus.focus();
1756
1757                        // if we are on first => activate last
1758                        if ($parent_item.is(".js-tablist__item:first-child")) {
1759                            $parent_list.find(".js-tablist__item:last-child .js-tablist__link").click().focus();
1760                        }
1761                        // else activate prev
1762                        else {
1763                            $parent_item.prev().children(".js-tablist__link").click().focus();
1764                        }
1765                        event.preventDefault();
1766                    }
1767                    // CTRL PageDown
1768                    if (event.keyCode == 34 && event.ctrlKey) {
1769                        $tab_to_focus.focus();
1770
1771                        // if we are on last => activate first
1772                        if ($parent_item.is(".js-tablist__item:last-child")) {
1773                            $parent_list.find(".js-tablist__item:first-child .js-tablist__link").click().focus();
1774                        }
1775                        // else activate next
1776                        else {
1777                            $parent_item.next().children(".js-tablist__link").click().focus();
1778                        }
1779                        event.preventDefault();
1780                    }
1781
1782                })
1783                /* click on a tab link */
1784                .on("click", ".js-link-to-tab", function (event) {
1785                    var $this = $(this),
1786                        $tab_to_go = $($this.attr('href')),
1787                        $button_to_click = $('#' + $tab_to_go.attr('aria-labelledby'));
1788
1789                    // activate tabs
1790                    $button_to_click.click();
1791                    // give focus to the good button
1792                    setTimeout(function () {
1793                        $button_to_click.focus()
1794                    }, 10);
1795                });
1796
1797        }
1798
1799    };
1800  
1801})(jQuery,window.wonderwp);
1802(function ($, ns) {
1803
1804    var tabComponent = {
1805
1806        global: false,
1807        initiable: true,
1808        defaultSelector: '.js-tabs',
1809
1810
1811        init: function ($wrap) {
1812
1813            var t = this;
1814            t.$wrap = $wrap || $(t.defaultSelector);
1815
1816            if(t.$wrap.length){
1817                ns.initTabs(t.$wrap);
1818            }
1819
1820        }
1821    };
1822
1823    ns.app.registerComponent('tab', tabComponent, {initGlobal: true}); //si on passe { initGlobal:true } il sera meme auto instancie
1824
1825
1826})(jQuery, window.wonderwp);
1827(function($,ns){
1828
1829    ns.initAccordion = function($accordions) {
1830    /*
1831     * jQuery Accessible Accordion system, using ARIA
1832     * Website: http://a11y.nicolas-hoffmann.net/accordion/
1833     * License MIT: https://github.com/nico3333fr/jquery-accessible-accordion-aria/blob/master/LICENSE
1834     */
1835    // var $accordions = $( ".js-accordion" );
1836    if ( $accordions.length  ) { // if there are at least one :)
1837
1838        // init
1839        $accordions.each( function( index ) {
1840            var $this = $( this );
1841            $options = $this.data(),
1842                $accordions_headers = $this.children( ".js-accordion__header" ),
1843                $accordions_prefix_classes = $options.accordionPrefixClasses || '',
1844                $accordions_multiselectable = $options.accordionMultiselectable || '',
1845                $index_accordion = index+1 ;
1846
1847            $this.attr({
1848                "role": "tablist",
1849                "aria-multiselectable": "true",
1850                "class": $accordions_prefix_classes
1851            });
1852
1853            // multiselectable or not
1854            if ($accordions_multiselectable === "none") {
1855                $this.attr( "aria-multiselectable", "false" );
1856            }
1857
1858            $accordions_headers.each( function( index_h ) {
1859                var $that = $( this ),
1860                    $text = $that.text(),
1861                    $accordion_panel = $that.next( ".js-accordion__panel" ),
1862                    $index_header = index_h+1 ;
1863
1864                $accordion_panel.prepend( $that.removeClass( "js-accordion__header" ).addClass( $accordions_prefix_classes + "__title" ).attr( "tabindex", "0") );
1865
1866                $accordion_header = $( '<button class="js-accordion__header ' + $accordions_prefix_classes + '__header">' + $text + '</button>' );
1867                $accordion_panel.before( $accordion_header );
1868
1869                $accordion_header.attr({
1870                    "aria-controls": "accordion" + $index_accordion + "_panel" + $index_header,
1871                    "aria-expanded": "false",
1872                    "role": "tab",
1873                    "id": "accordion" + $index_accordion + "_tab" + $index_header,
1874                    "tabindex": "-1",
1875                    "aria-selected": "false"
1876                });
1877                $accordion_panel.attr({
1878                    "aria-labelledby": "accordion" + $index_accordion + "_tab" + $index_header,
1879                    "role": "tabpanel",
1880                    "id": "accordion" + $index_accordion + "_panel" + $index_header,
1881                    "aria-hidden": "true"
1882                }).addClass( $accordions_prefix_classes + "__panel" );
1883
1884                // if opened by default
1885                if ( $that.attr( "data-accordion-opened" ) == "true" ) {
1886                    $accordion_header.attr( "aria-expanded", "true" ).removeAttr( "data-accordion-opened" );
1887                    $accordion_panel.attr( "aria-hidden", "false" );
1888                }
1889
1890                // init first one focusable
1891                if ( $index_header === 1 ) {
1892                    $accordion_header.removeAttr( "tabindex" );
1893                }
1894
1895            });
1896        });
1897
1898        /* Events ---------------------------------------------------------------------------------------------------------- */
1899        /* click on a tab link */
1900        $( "body" ).on( "focus", ".js-accordion__header", function( event ) {
1901            var $this = $( this ),
1902                $accordion = $this.parent(),
1903                $all_accordion_headers = $accordion.find( ".js-accordion__header" );
1904
1905            // selected
1906            $all_accordion_headers.attr({
1907                "tabindex": "-1",
1908                "aria-selected": "false"
1909            });
1910            $this.attr( "aria-selected", "true" ).removeAttr( "tabindex" );
1911
1912        })
1913            .on( "click", ".js-accordion__header", function( event ) {
1914                var $this = $( this ),
1915                    $this_panel = $( "#" + $this.attr("aria-controls" )),
1916                    $accordion = $this.parent(),
1917                    $accordion_multiselectable = $accordion.attr( "aria-multiselectable" ),
1918                    $all_accordion_headers = $accordion.find( ".js-accordion__header" ),
1919                    $all_accordion_panels = $accordion.find( ".js-accordion__panel" );
1920
1921                $all_accordion_headers.attr( "aria-selected", "false" );
1922                $this.attr( "aria-selected", "true" );
1923
1924                // opened or closed?
1925                if ( $this.attr( "aria-expanded" ) == "false" ) { // closed
1926                    $this.attr( "aria-expanded", "true" );
1927                    $this_panel.attr( "aria-hidden", "false" );
1928                }
1929                else { // opened
1930                    $this.attr( "aria-expanded", "false" );
1931                    $this_panel.attr( "aria-hidden", "true" );
1932                }
1933
1934                if ( $accordion_multiselectable == "false" ){
1935                    $all_accordion_panels.not( $this_panel ).attr( "aria-hidden", "true" );
1936                    $all_accordion_headers.not( $this ).attr( "aria-expanded", "false" );
1937                }
1938
1939                setTimeout(function(){ $this.focus(); }, 0);
1940                event.preventDefault();
1941
1942            })
1943            .on( "keydown", ".js-accordion__header", function( event ) {
1944                var $this = $( this ),
1945                    $accordion = $this.parent(),
1946                    $all_accordion_headers = $accordion.find( ".js-accordion__header" ),
1947                    $first_header = $accordion.find( ".js-accordion__header" ).first(),
1948                    $last_header = $accordion.find( ".js-accordion__header" ).last(),
1949                    $prev_header = $this.prevAll( ".js-accordion__header" ).first(),
1950                    $next_header = $this.nextAll( ".js-accordion__header" ).first();
1951
1952                // strike up or left in the tab => previous tab
1953                if ( ( event.keyCode == 37 || event.keyCode == 38 ) && !event.ctrlKey ) {
1954                    $all_accordion_headers.attr({
1955                        "tabindex": "-1",
1956                        "aria-selected": "false"
1957                    });
1958                    // if we are on first one, activate last
1959                    if ( $this.is( $first_header ) ) {
1960                        $last_header.attr( "aria-selected", "true" ).removeAttr( "tabindex" );
1961                        setTimeout(function(){ $last_header.focu
1961s(); }, 0);
1962                    }
1963                    // else activate previous
1964                    else {
1965                        $prev_header.attr( "aria-selected", "true" ).removeAttr( "tabindex" );
1966                        setTimeout(function(){ $prev_header.focus(); }, 0);
1967                    }
1968                    event.preventDefault();
1969                }
1970                // strike down or right in the tab => next tab
1971                else if ( ( event.keyCode == 40 || event.keyCode == 39 ) && !event.ctrlKey ) {
1972                    $all_accordion_headers.attr({
1973                        "tabindex": "-1",
1974                        "aria-selected": "false"
1975                    });
1976                    // if we are on last one, activate first
1977                    if ( $this.is( $last_header ) ) {
1978                        $first_header.attr( "aria-selected", "true" ).removeAttr( "tabindex" );
1979                        setTimeout(function(){ $first_header.focus(); }, 0);
1980                    }
1981                    // else activate next
1982                    else {
1983                        $next_header.attr( "aria-selected", "true" ).removeAttr( "tabindex" );
1984                        setTimeout(function(){ $next_header.focus(); }, 0);
1985                    }
1986                    event.preventDefault();
1987                }
1988                // strike home in the tab => 1st tab
1989                else if ( event.keyCode == 36 ) {
1990                    $all_accordion_headers.attr({
1991                        "tabindex": "-1",
1992                        "aria-selected": "false"
1993                    });
1994                    $first_header.attr( "aria-selected", "true" ).removeAttr( "tabindex" );
1995                    setTimeout(function(){ $first_header.focus(); }, 0);
1996                    event.preventDefault();
1997                }
1998                // strike end in the tab => last tab
1999                else if ( event.keyCode == 35 ) {
2000                    $all_accordion_headers.attr({
2001                        "tabindex": "-1",
2002                        "aria-selected": "false"
2003                    });
2004                    $last_header.attr( "aria-selected", "true" ).removeAttr( "tabindex" );
2005                    setTimeout(function(){ $last_header.focus(); }, 0);
2006                    event.preventDefault();
2007                }
2008            })
2009            .on( "keydown", ".js-accordion__panel", function( event ) {
2010                var $this = $( this ),
2011                    $this_header = $( "#" + $this.attr("aria-labelledby" )),
2012                    $accordion = $this.parent( ),
2013                    $first_header = $accordion.find( ".js-accordion__header" ).first(),
2014                    $prev_header = $this_header.prevAll( ".js-accordion__header" ).first(),
2015                    $next_header = $this_header.nextAll( ".js-accordion__header" ).first(),
2016                    $last_header = $accordion.find( ".js-accordion__header" ).last();
2017
2018                // strike up + ctrl => go to header
2019                if ( event.keyCode == 38 && event.ctrlKey ) {
2020                    setTimeout(function(){ $this_header.focus(); }, 0);
2021                    event.preventDefault();
2022                }
2023                // strike pageup + ctrl => go to prev header
2024                else if ( event.keyCode == 33 && event.ctrlKey ) {
2025                    if ( $this_header.is( $first_header ) ) {
2026                        setTimeout(function(){ $last_header.focus(); }, 0);
2027                        event.preventDefault();
2028                    }
2029                    else {
2030                        setTimeout(function(){ $prev_header.focus(); }, 0);
2031                        event.preventDefault();
2032                    }
2033                }
2034                // strike pagedown + ctrl => go to next header
2035                else if ( event.keyCode == 34 && event.ctrlKey ) {
2036                    if ( $this_header.is( $last_header ) ) {
2037                        setTimeout(function(){ $first_header.focus(); }, 0);
2038                        event.preventDefault();
2039                    }
2040                    else {
2041                        setTimeout(function(){ $next_header.focu
2041s(); }, 0);
2042                        event.preventDefault();
2043                    }
2044                }
2045
2046            });
2047
2048
2049    }
2050
2051
2052};
2053
2054})(jQuery,window.wonderwp);
2055
2056(function ($, ns) {
2057
2058    var accordionComponent = {
2059
2060        global: false,
2061        initiable: true,
2062        defaultSelector: '.js-accordion',
2063
2064
2065        init: function ($wrap) {
2066
2067            var t = this;
2068            t.$wrap = $wrap || $(t.defaultSelector);
2069
2070            if(t.$wrap.length){
2071                ns.initAccordion(t.$wrap);
2072            }
2073
2074        }
2075    };
2076
2077    ns.app.registerComponent('accordion', accordionComponent);
2078
2079
2080})(jQuery, window.wonderwp);
2081(function ($, ns) {
2082
2083  var notificationComponent = {
2084
2085    global: false,
2086    initiable: false,
2087
2088    show: function (type, message, $dest, delay) {
2089      $dest = $dest || $('body');
2090      delay = delay || 4000;
2091      var t = this,
2092        notifTpl = ns.app.getTemplate('notification');
2093
2094      if (notifTpl) {
2095        var notif = notifTpl
2096          .replace('{type}', type)
2097          .replace('{message}', message)
2098        ;
2099        var $notif = $(notif);
2100        $notif.addClass('alert-js active').prependTo($dest);
2101
2102        $notif.on('click', function () {
2103          t.close($notif);
2104        });
2105
2106        setTimeout(function () {
2107          t.close($notif);
2108        }, delay);
2109      }
2110    },
2111    close: function ($notif) {
2112      var closeTimeout = setTimeout(function () {
2113        $notif.remove();
2114      }, 1000);
2115      $notif.removeClass('active');
2116      $notif.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function () {
2117        $notif.remove();
2118        clearTimeout(closeTimeout);
2119      });
2120    }
2121
2122  };
2123
2124  $(document).on('notification', function (e, showOpts) {
2125    notificationComponent.show(showOpts.type, showOpts.msg, showOpts.dest, showOpts.delay);
2126    return notificationComponent;
2127  });
2128
2129  ns.app.registerComponent('notification', notificationComponent); //si on passe { initGlobal:true } il sera meme auto instancie
2130
2131})(jQuery, window.wonderwp);
2132
2133(function ($, ns) {
2134
2135    var temoignageComponent = {
2136
2137        global: false,
2138        initiable: true,
2139        defaultSelector: '.home-live-content',
2140
2141
2142        init: function ($wrap) {
2143
2144            var t = this;
2145            t.$wrap = $wrap || $(t.defaultSelector);
2146
2147            if(t.$wrap.length){
2148                $targetLink = '<a class="civiliz-timeline" href="http://www.civiliz.fr/avis-clients/194/56197/seaquarium.html" data-slug="seaquarium" style="display: none;">Avis Civiliz</a>';
2149                t.$wrap.prepend($targetLink);
2150                setTimeout(function(){!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?"http":"https";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://widget.civiliz.fr/widget.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","civiliz-wjs");}, 1500);
2151            }
2152
2153        }
2154
2155    };
2156
2157    ns.app.registerComponent('temoignage', temoignageComponent); //si on passe { initGlobal:true } il sera meme auto instancie
2158
2159
2160})(jQuery, window.wonderwp);
2161
2162/**
2163 * Created by dev on 21/03/2017.
2164 * Créé à l'origine pour la liste des espèces, peut désormais s'utiliser n'importe où
2165 * en ajoutant seulement la classe "scrollable-item" sur la section cible.
2166 * Le lien "scroll-link" sera automatiquement ajouté à la section précédente.
2167 */
2168(function ($, ns) {
2169
2170  var ScrollableItem = function ($wrap) {
2171    this.$wrap = $wrap;
2172
2173    this.initAnchor();
2174  };
2175
2176  ScrollableItem.prototype = {
2177    initAnchor: function () {
2178      var $voisin = this.$wrap.next();
2179      if ($voisin.hasClass('scrollable-item')) {
2180        this.injectAnchor();
2181      }
2182      var $anchor = this.$wrap.find('.scroll-link');
2183      if ($anchor.length) {
2184        this.registerAnchorClick($anchor);
2185      }
2186    },
2187    injectAnchor: function () {
2188      var t = this;
2189      var scrollLabel = wonderwp.i18n['anchor.discover'] ? wonderwp.i18n['anchor.discover'] : 'Découvrez';
2190      var $anchor = $('<a href="#" class="scroll-link"> <span>' + scrollLabel + '</span><svg class="shape-svg shape-ico-scroll">' +
2191        '<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/app/themes/wwp_child_theme/assets/final/svg/symbol/svg/sprite.symbol.svg#ico-scroll"></use>' +
2192        '</svg> </a>');
2193
2194      t.$wrap.append($anchor);
2195    },
2196    registerAnchorClick: function ($anchor) {
2197      var t = this;
2198      $anchor.on('click', function (e) {
2199        e.preventDefault();
2200        var newOffset = t.$wrap.next().offset().top;
2201        $('html,body').animate({
2202          scrollTop: newOffset
2203        })
2204      });
2205    }
2206  };
2207
2208  ns.app.scrollableItem = ScrollableItem;
2209
2210  var discoveryComponent = {
2211
2212    global: false,
2213    initiable: true,
2214    defaultSelector: '.scrollable-item',
2215
2216    init: function ($wrap) {
2217
2218      var t = this;
2219      t.$wrap = $wrap || $(t.defaultSelector);
2220
2221      t.$wrap.each(function () {
2222        new ns.app.scrollableItem($(this));
2223      });
2224
2225    }
2226
2227  };
2228
2229  ns.app.registerComponent('discovery', discoveryComponent); //si on passe { initGlobal:true } il sera meme auto instancie
2230
2231})(jQuery, window.wonderwp);
2232
2233/**
2234 * Created by Erick on 21/03/2017.
2235 */
2236
2237document.addEventListener("DOMContentLoaded",
2238    function() {
2239        var div, n,
2240            v = document.getElementsByClassName("youtube-player");
2241        for (n = 0; n < v.length; n++) {
2242            div = document.createElement("div");
2243            div.setAttribute("data-id", v[n].dataset.id);
2244            div.innerHTML = labnolThumb(v[n].dataset.id);
2245            div.onclick = labnolIframe;
2246            v[n].appendChild(div);
2247        }
2248    });
2249
2250function labnolThumb(id) {
2251    var thumb = '<img src="https://i.ytimg.com/vi/ID/hqdefault.jpg">',
2252        play = '<div class="play"></div>';
2253    return thumb.replace("ID", id) + play;
2254}
2255
2256function labnolIframe() {
2257    var iframe = document.createElement("iframe");
2258    var embed = "https://www.youtube.com/embed/ID?autoplay=1";
2259    iframe.setAttribute("src", embed.replace("ID", this.dataset.id));
2260    iframe.setAttribute("frameborder", "0");
2261    iframe.setAttribute("allowfullscreen", "1");
2262    this.parentNode.replaceChild(iframe, this);
2263}
2264/**
2265 * bxSlider v4.2.5
2266 * Copyright 2013-2015 Steven Wanderski
2267 * Written while drinking Belgian ales and listening to jazz
2268
2269 * Licensed under MIT (http://opensource.org/licenses/MIT)
2270 */
2271
2272;(function($) {
2273
2274    var defaults = {
2275
2276        // GENERAL
2277        mode: 'horizontal',
2278        slideSelector: '',
2279        infiniteLoop: true,
2280        hideControlOnEnd: false,
2281        speed: 500,
2282        easing: null,
2283        slideMargin: 0,
2284        startSlide: 0,
2285        randomStart: false,
2286        captions: false,
2287        ticker: false,
2288        tickerHover: false,
2289        adaptiveHeight: false,
2290        adaptiveHeightSpeed: 500,
2291        video: false,
2292        useCSS: true,
2293        preloadImages: 'visible',
2294        responsive: true,
2295        slideZIndex: 50,
2296        wrapperClass: 'bx-wrapper',
2297
2298        // TOUCH
2299        touchEnabled: true,
2300        swipeThreshold: 50,
2301        oneToOneTouch: true,
2302        preventDefaultSwipeX: true,
2303        preventDefaultSwipeY: false,
2304
2305        // ACCESSIBILITY
2306        ariaLive: true,
2307        ariaHidden: true,
2308
2309        // KEYBOARD
2310        keyboardEnabled: false,
2311
2312        // PAGER
2313        pager: true,
2314        pagerType: 'full',
2315        pagerShortSeparator: ' / ',
2316        pagerSelector: null,
2317        buildPager: null,
2318        pagerCustom: null,
2319
2320        // CONTROLS
2321        controls: true,
2322        nextText: 'Next',
2323        prevText: 'Prev',
2324        nextSelector: null,
2325        prevSelector: null,
2326        autoControls: false,
2327        startText: 'Start',
2328        stopText: 'Stop',
2329        autoControlsCombine: false,
2330        autoControlsSelector: null,
2331
2332        // AUTO
2333        auto: false,
2334        pause: 4000,
2335        autoStart: true,
2336        autoDirection: 'next',
2337        stopAutoOnClick: false,
2338        autoHover: false,
2339        autoDelay: 0,
2340        autoSlideForOnePage: false,
2341
2342        // CAROUSEL
2343        minSlides: 1,
2344        maxSlides: 1,
2345        moveSlides: 0,
2346        slideWidth: 0,
2347        shrinkItems: false,
2348
2349        // CALLBACKS
2350        onSliderLoad: function() { return true; },
2351        onSlideBefore: function() { return true; },
2352        onSlideAfter: function() { return true; },
2353        onSlideNext: function() { return true; },
2354        onSlidePrev: function() { return true; },
2355        onSliderResize: function() { return true; }
2356    };
2357
2358    $.fn.bxSlider = function(options) {
2359
2360        if (this.length === 0) {
2361            return this;
2362        }
2363
2364        // support multiple elements
2365        if (this.length > 1) {
2366            this.each(function() {
2367                $(this).bxSlider(options);
2368            });
2369            return this;
2370        }
2371
2372        // create a namespace to be used throughout the plugin
2373        var slider = {},
2374            // set a reference to our slider element
2375            el = this,
2376            // get the original window dimens (thanks a lot IE)
2377            windowWidth = $(window).width(),
2378            windowHeight = $(window).height();
2379
2380        // Return if slider is already initialized
2381        if ($(el).data('bxSlider')) { return; }
2382
2383        /**
2384         * ===================================================================================
2385         * = PRIVATE FUNCTIONS
2386         * ===================================================================================
2387         */
2388
2389        /**
2390         * Initializes namespace settings to be used throughout plugin
2391         */
2392        var init = function() {
2393            // Return if slider is already initialized
2394            if ($(el).data('bxSlider')) { return; }
2395            // merge user-supplied options with the defaults
2396            slider.settings = $.extend({}, defaults, options);
2397            // parse slideWidth setting
2398            slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
2399            // store the original children
2400            slider.children = el.children(slider.settings.slideSelector);
2401            // check if actual number of slides is less than minSlides / maxSlides
2402            if (slider.children.length < slider.settings.minSlides) { slider.settings.minSlides = slider.children.length; }
2403            if (slider.children.length < slider.settings.maxSlides) { slider.settings.maxSlides = slider.children.length; }
2404            // if random start, set the startSlide setting to random number
2405            if (slider.settings.randomStart) { slider.settings.startSlide = Math.floor(Math.random() * slider.children.length); }
2406            // store active slide information
2407            slider.active = { index: slider.settings.startSlide };
vendor: 69,425 bytes, lines 2408-3830
2408            // store if the slider is in carousel mode (displaying / moving multiple slides)
2409            slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1 ? true : false;
2410            // if carousel, force preloadImages = 'all'
2411            if (slider.carousel) { slider.settings.preloadImages = 'all'; }
2412            // calculate the min / max width thresholds based on min / max number of slides
2413            // used to setup and update carousel slides dimensions
2414            slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
2415            slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
2416            // store the current state of the slider (if currently animating, working is true)
2417            slider.working = false;
2418            // initialize the controls object
2419            slider.controls = {};
2420            // initialize an auto interval
2421            slider.interval = null;
2422            // determine which property to use for transitions
2423            slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left';
2424            // determine if hardware acceleration can be used
2425            slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function() {
2426                    // create our test div element
2427                    var div = document.createElement('div'),
2428                        // css transition properties
2429                        props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
2430                    // test for each property
2431                    for (var i = 0; i < props.length; i++) {
2432                        if (div.style[props[i]] !== undefined) {
2433                            slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
2434                            slider.animProp = '-' + slider.cssPrefix + '-transform';
2435                            return true;
2436                        }
2437                    }
2438                    return false;
2439                }());
2440            // if vertical mode always make maxSlides and minSlides equal
2441            if (slider.settings.mode === 'vertical') { slider.settings.maxSlides = slider.settings.minSlides; }
2442            // save original style data
2443            el.data('origStyle', el.attr('style'));
2444            el.children(slider.settings.slideSelector).each(function() {
2445                $(this).data('origStyle', $(this).attr('style'));
2446            });
2447
2448            // perform all DOM / CSS modifications
2449            setup();
2450        };
2451
2452        /**
2453         * Performs all DOM and CSS modifications
2454         */
2455        var setup = function() {
2456            var preloadSelector = slider.children.eq(slider.settings.startSlide); // set the default preload selector (visible)
2457
2458            // wrap el in a wrapper
2459            el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
2460            // store a namespace reference to .bx-viewport
2461            slider.viewport = el.parent();
2462
2463            // add aria-live if the setting is enabled and ticker mode is disabled
2464            if (slider.settings.ariaLive && !slider.settings.ticker) {
2465                slider.viewport.attr('aria-live', 'polite');
2466            }
2467            // add a loading div to display while images are loading
2468            slider.loader = $('<div class="bx-loading" />');
2469            slider.viewport.prepend(slider.loader);
2470            // set el to a massive width, to hold any needed slides
2471            // also strip any margin and padding from el
2472            el.css({
2473                width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto',
2474                position: 'relative'
2475            });
2476            // if using CSS, add the easing property
2477            if (slider.usingCSS && slider.settings.easing) {
2478                el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
2479                // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
2480            } else if (!slider.settings.easing) {
2481                slider.settings.easing = 'swing';
2482            }
2483            // make modifications to the viewport (.bx-viewport)
2484            slider.viewport.css({
2485                width: '100%',
2486                overflow: 'hidden',
2487                position: 'relative'
2488            });
2489            slider.viewport.parent().css({
2490                maxWidth: getViewportMaxWidth()
2491            });
2492            // make modification to the wrapper (.bx-wrapper)
2493            if (!slider.settings.pager && !slider.settings.controls) {
2494                slider.viewport.parent().css({
2495                    margin: '0 auto 0px'
2496                });
2497            }
2498            // apply css to all slider children
2499            slider.children.css({
2500                float: slider.settings.mode === 'horizontal' ? 'left' : 'none',
2501                listStyle: 'none',
2502                position: 'relative'
2503            });
2504            // apply the calculated width after the float is applied to prevent scrollbar interference
2505            slider.children.css('width', getSlideWidth());
2506            // if slideMargin is supplied, add the css
2507            if (slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0) { slider.children.css('marginRight', slider.settings.slideMargin); }
2508            if (slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0) { slider.children.css('marginBottom', slider.settings.slideMargin); }
2509            // if "fade" mode, add positioning and z-index CSS
2510            if (slider.settings.mode === 'fade') {
2511                slider.children.css({
2512                    position: 'absolute',
2513                    zIndex: 0,
2514                    display: 'none'
2515                });
2516                // prepare the z-index on the showing element
2517                slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
2518            }
2519            // create an element to contain all slider controls (pager, start / stop, etc)
2520            slider.controls.el = $('<div class="bx-controls" />');
2521            // if captions are requested, add them
2522            if (slider.settings.captions) { appendCaptions(); }
2523            // check if startSlide is last slide
2524            slider.active.last = slider.settings.startSlide === getPagerQty() - 1;
2525            // if video is true, set up the fitVids plugin
2526            if (slider.settings.video) { el.fitVids(); }
2527            if (slider.settings.preloadImages === 'all' || slider.settings.ticker) { preloadSelector = slider.children; }
2528            // only check for control addition if not in "ticker" mode
2529            if (!slider.settings.ticker) {
2530                // if controls are requested, add them
2531                if (slider.settings.controls) { appendControls(); }
2532                // if auto is true, and auto controls are requested, add them
2533                if (slider.settings.auto && slider.settings.autoControls) { appendControlsAuto(); }
2534                // if pager is requested, add it
2535                if (slider.settings.pager) { appendPager(); }
2536                // if any control option is requested, add the controls wrapper
2537                if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) { slider.viewport.after(slider.controls.el); }
2538                // if ticker mode, do not allow a pager
2539            } else {
2540                slider.settings.pager = false;
2541            }
2542            loadElements(preloadSelector, start);
2543        };
2544
2545        var loadElements = function(selector, callback) {
2546            var total = selector.find('img:not([src=""]), iframe').length,
2547                count = 0;
2548            if (total === 0) {
2549                callback();
2550                return;
2551            }
2552            selector.find('img:not([src=""]), iframe').each(function() {
2553                $(this).one('load error', function() {
2554                    if (++count === total) { callback(); }
2555                }).each(function() {
2556                    if (this.complete) { $(this).load(); }
2557                });
2558            });
2559        };
2560
2561        /**
2562         * Start the slider
2563         */
2564        var start = function() {
2565            // if infinite loop, prepare additional slides
2566            if (slider.settings.infiniteLoop && slider.settings.mode !== 'fade' && !slider.settings.ticker) {
2567                var slice    = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides,
2568                    sliceAppend  = slider.children.slice(0, slice).clone(true).addClass('bx-clone'),
2569                    slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone');
2570                if (slider.settings.ariaHidden) {
2571                    sliceAppend.attr('aria-hidden', true);
2572                    slicePrepend.attr('aria-hidden', true);
2573                }
2574                el.append(sliceAppend).prepend(slicePrepend);
2575            }
2576            // remove the loading DOM element
2577            slider.loader.remove();
2578            // set the left / top position of "el"
2579            setSlidePosition();
2580            // if "vertical" mode, always use adaptiveHeight to prevent odd behavior
2581            if (slider.settings.mode === 'vertical') { slider.settings.adaptiveHeight = true; }
2582            // set the viewport height
2583            slider.viewport.height(getViewportHeight());
2584            // make sure everything is positioned just right (same as a window resize)
2585            el.redrawSlider();
2586            // onSliderLoad callback
2587            slider.settings.onSliderLoad.call(el, slider.active.index);
2588            // slider has been fully initialized
2589            slider.initialized = true;
2590            // bind the resize call to the window
2591            if (slider.settings.responsive) { $(window).bind('resize', resizeWindow); }
2592            // if auto is true and has more than 1 page, start the show
2593            if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) { initAuto(); }
2594            // if ticker is true, start the ticker
2595            if (slider.settings.ticker) { initTicker(); }
2596            // if pager is requested, make the appropriate pager link active
2597            if (slider.settings.pager) { updatePagerActive(slider.settings.startSlide); }
2598            // check for any updates to the controls (like hideControlOnEnd updates)
2599            if (slider.settings.controls) { updateDirectionControls(); }
2600            // if touchEnabled is true, setup the touch events
2601            if (slider.settings.touchEnabled && !slider.settings.ticker) { initTouch(); }
2602            // if keyboardEnabled is true, setup the keyboard events
2603            if (slider.settings.keyboardEnabled && !slider.settings.ticker) {
2604                $(document).keydown(keyPress);
2605            }
2606        };
2607
2608        /**
2609         * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
2610         */
2611        var getViewportHeight = function() {
2612            var height = 0;
2613            // first determine which children (slides) should be used in our height calculation
2614            var children = $();
2615            // if mode is not "vertical" and adaptiveHeight is false, include all children
2616            if (slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight) {
2617                children = slider.children;
2618            } else {
2619                // if not carousel, return the single active child
2620                if (!slider.carousel) {
2621                    children = slider.children.eq(slider.active.index);
2622                    // if carousel, return a slice of children
2623                } else {
2624                    // get the individual slide index
2625                    var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy();
2626                    // add the current slide to the children
2627                    children = slider.children.eq(currentIndex);
2628                    // cycle through the remaining "showing" slides
2629                    for (i = 1; i <= slider.settings.maxSlides - 1; i++) {
2630                        // if looped back to the start
2631                        if (currentIndex + i >= slider.children.length) {
2632                            children = children.add(slider.children.eq(i - 1));
2633                        } else {
2634                            children = children.add(slider.children.eq(currentIndex + i));
2635                        }
2636                    }
2637                }
2638            }
2639            // if "vertical" mode, calculate the sum of the heights of the children
2640            if (slider.settings.mode === 'vertical') {
2641                children.each(function(index) {
2642                    height += $(this).outerHeight();
2643                });
2644                // add user-supplied margins
2645                if (slider.settings.slideMargin > 0) {
2646                    height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
2647                }
2648                // if not "vertical" mode, calculate the max height of the children
2649            } else {
2650                height = Math.max.apply(Math, children.map(function() {
2651                    return $(this).outerHeight(false);
2652                }).get());
2653            }
2654
2655            if (slider.viewport.css('box-sizing') === 'border-box') {
2656                height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
2657                    parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
2658            } else if (slider.viewport.css('box-sizing') === 'padding-box') {
2659                height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
2660            }
2661
2662            return height;
2663        };
2664
2665        /**
2666         * Returns the calculated width to be used for the outer wrapper / viewport
2667         */
2668        var getViewportMaxWidth = function() {
2669            var width = '100%';
2670            if (slider.settings.slideWidth > 0) {
2671                if (slider.settings.mode === 'horizontal') {
2672                    width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
2673                } else {
2674                    width = slider.settings.slideWidth;
2675                }
2676            }
2677            return width;
2678        };
2679
2680        /**
2681         * Returns the calculated width to be applied to each slide
2682         */
2683        var getSlideWidth = function() {
2684            var newElWidth = slider.settings.slideWidth, // start with any user-supplied slide width
2685                wrapWidth      = slider.viewport.width();    // get the current viewport width
2686            // if slide width was not supplied, or is larger than the viewport use the viewport width
2687            if (slider.settings.slideWidth === 0 ||
2688                (slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
2689                slider.settings.mode === 'vertical') {
2690                newElWidth = wrapWidth;
2691                // if carousel, use the thresholds to determine the width
2692            } else if (slider.settings.maxSlides > 1 && slider.settings.mode === 'horizontal') {
2693                if (wrapWidth > slider.maxThreshold) {
2694                    return newElWidth;
2695                } else if (wrapWidth < slider.minThreshold) {
2696                    newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
2697                } else if (slider.settings.shrinkItems) {
2698                    newElWidth = Math.floor((wrapWidth + slider.settings.slideMargin) / (Math.ceil((wrapWidth + slider.settings.slideMargin) / (newElWidth + slider.settings.slideMargin))) - slider.settings.slideMargin);
2699                }
2700            }
2701            return newElWidth;
2702        };
2703
2704        /**
2705         * Returns the number of slides currently visible in the viewport (includes partially visible slides)
2706         */
2707        var getNumberSlidesShowing = function() {
2708            var slidesShowing = 1,
2709                childWidth = null;
2710            if (slider.settings.mode === 'horizontal' && slider.settings.slideWidth > 0) {
2711                // if viewport is smaller than minThreshold, return minSlides
2712                if (slider.viewport.width() < slider.minThreshold) {
2713                    slidesShowing = slider.settings.minSlides;
2714                    // if viewport is larger than maxThreshold, return maxSlides
2715                } else if (slider.viewport.width() > slider.maxThreshold) {
2716                    slidesShowing = slider.settings.maxSlides;
2717                    // if viewport is between min / max thresholds, divide viewport width by first child width
2718                } else {
2719                    childWidth = slider.children.first().width() + slider.settings.slideMargin;
2720                    slidesShowing = Math.floor((slider.viewport.width() +
2721                        slider.settings.slideMargin) / childWidth);
2722                }
2723                // if "vertical" mode, slides showing will always be minSlides
2724            } else if (slider.settings.mode === 'vertical') {
2725                slidesShowing = slider.settings.minSlides;
2726            }
2727            return slidesShowing;
2728        };
2729
2730        /**
2731         * Returns the number of pages (one full viewport of slides is one "page")
2732         */
2733        var getPagerQty = function() {
2734            var pagerQty = 0,
2735                breakPoint = 0,
2736                counter = 0;
2737            // if moveSlides is specified by the user
2738            if (slider.settings.moveSlides > 0) {
2739                if (slider.settings.infiniteLoop) {
2740                    pagerQty = Math.ceil(slider.children.length / getMoveBy());
2741                } else {
2742                    // when breakpoint goes above children length, counter is the number of pages
2743                    while (breakPoint < slider.children.length) {
2744                        ++pagerQty;
2745                        breakPoint = counter + getNumberSlidesShowing();
2746                        counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
2747                    }
2748                }
2749                // if moveSlides is 0 (auto) divide children length by sides showing, then round up
2750            } else {
2751                pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
2752            }
2753            return pagerQty;
2754        };
2755
2756        /**
2757         * Returns the number of individual slides by which to shift the slider
2758         */
2759        var getMoveBy = function() {
2760            // if moveSlides was set by the user and moveSlides is less than number of slides showing
2761            if (slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()) {
2762                return slider.settings.moveSlides;
2763            }
2764            // if moveSlides is 0 (auto)
2765            return getNumberSlidesShowing();
2766        };
2767
2768        /**
2769         * Sets the slider's (el) left or top position
2770         */
2771        var setSlidePosition = function() {
2772            var position, lastChild, lastShowingIndex;
2773            // if last slide, not infinite loop, and number of children is larger than specified maxSlides
2774            if (slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop) {
2775                if (slider.settings.mode === 'horizontal') {
2776                    // get the last child's position
2777                    lastChild = slider.children.last();
2778                    position = lastChild.position();
2779                    // set the left position
2780                    setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
2781                } else if (slider.settings.mode === 'vertical') {
2782                    // get the last showing index's position
2783                    lastShowingIndex = slider.children.length - slider.settings.minSlides;
2784                    position = slider.children.eq(lastShowingIndex).position();
2785                    // set the top position
2786                    setPositionProperty(-position.top, 'reset', 0);
2787                }
2788                // if not last slide
2789            } else {
2790                // get the position of the first showing slide
2791                position = slider.children.eq(slider.active.index * getMoveBy()).position();
2792                // check for last slide
2793                if (slider.active.index === getPagerQty() - 1) { slider.active.last = true; }
2794                // set the respective position
2795                if (position !== undefined) {
2796                    if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
2797                    else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
2798                }
2799            }
2800        };
2801
2802        /**
2803         * Sets the el's animating property position (which in turn will sometimes animate el).
2804         * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
2805         *
2806         * @param value (int)
2807         *  - the animating property's value
2808         *
2809         * @param type (string) 'slide', 'reset', 'ticker'
2810         *  - the type of instance for which the function is being
2811         *
2812         * @param duration (int)
2813         *  - the amount of time (in ms) the transition should occupy
2814         *
2815         * @param params (array) optional
2816         *  - an optional parameter containing any variables that need to be passed in
2817         */
2818        var setPositionProperty = function(value, type, duration, params) {
2819            var animateObj, propValue;
2820            // use CSS transform
2821            if (slider.usingCSS) {
2822                // determine the translate3d value
2823                propValue = slider.settings.mode === 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
2824                // add the CSS transition-duration
2825                el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
2826                if (type === 'slide') {
2827                    // set the property value
2828                    el.css(slider.animProp, propValue);
2829                    if (duration !== 0) {
2830                        // bind a callback method - executes when CSS transition completes
2831                        el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) {
2832                            //make sure it's the correct one
2833                            if (!$(e.target).is(el)) { return; }
2834                            // unbind the callback
2835                            el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
2836                            updateAfterSlideTransition();
2837                        });
2838                    } else { //duration = 0
2839                        updateAfterSlideTransition();
2840                    }
2841                } else if (type === 'reset') {
2842                    el.css(slider.animProp, propValue);
2843                } else if (type === 'ticker') {
2844                    // make the transition use 'linear'
2845                    el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
2846                    el.css(slider.animProp, propValue);
2847                    if (duration !== 0) {
2848                        el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) {
2849                            //make sure it's the correct one
2850                            if (!$(e.target).is(el)) { return; }
2851                            // unbind the callback
2852                            el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
2853                            // reset the position
2854                            setPositionProperty(params.resetValue, 'reset', 0);
2855                            // start the loop again
2856                            tickerLoop();
2857                        });
2858                    } else { //duration = 0
2859                        setPositionProperty(params.resetValue, 'reset', 0);
2860                        tickerLoop();
2861                    }
2862                }
2863                // use JS animate
2864            } else {
2865                animateObj = {};
2866                animateObj[slider.animProp] = value;
2867                if (type === 'slide') {
2868                    el.animate(animateObj, duration, slider.settings.easing, function() {
2869                        updateAfterSlideTransition();
2870                    });
2871                } else if (type === 'reset') {
2872                    el.css(slider.animProp, value);
2873                } else if (type === 'ticker') {
2874                    el.animate(animateObj, duration, 'linear', function() {
2875                        setPositionProperty(params.resetValue, 'reset', 0);
2876                        // run the recursive loop after animation
2877                        tickerLoop();
2878                    });
2879                }
2880            }
2881        };
2882
2883        /**
2884         * Populates the pager with proper amount of pages
2885         */
2886        var populatePager = function() {
2887            var pagerHtml = '',
2888                linkContent = '',
2889                pagerQty = getPagerQty();
2890            // loop through each pager item
2891            for (var i = 0; i < pagerQty; i++) {
2892                linkContent = '';
2893                // if a buildPager function is supplied, use it to get pager link value, else use index + 1
2894                if (slider.settings.buildPager && $.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom) {
2895                    linkContent = slider.settings.buildPager(i);
2896                    slider.pagerEl.addClass('bx-custom-pager');
2897                } else {
2898                    linkContent = i + 1;
2899                    slider.pagerEl.addClass('bx-default-pager');
2900                }
2901                // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
2902                // add the markup to the string
2903                pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
2904            }
2905            // populate the pager element with pager links
2906            slider.pagerEl.html(pagerHtml);
2907        };
2908
2909        /**
2910         * Appends the pager to the controls element
2911         */
2912        var appendPager = function() {
2913            if (!slider.settings.pagerCustom) {
2914                // create the pager DOM element
2915                slider.pagerEl = $('<div class="bx-pager" />');
2916                // if a pager selector was supplied, populate it with the pager
2917                if (slider.settings.pagerSelector) {
2918                    $(slider.settings.pagerSelector).html(slider.pagerEl);
2919                    // if no pager selector was supplied, add it after the wrapper
2920                } else {
2921                    slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
2922                }
2923                // populate the pager
2924                populatePager();
2925            } else {
2926                slider.pagerEl = $(slider.settings.pagerCustom);
2927            }
2928            // assign the pager click binding
2929            slider.pagerEl.on('click touchend', 'a', clickPagerBind);
2930        };
2931
2932        /**
2933         * Appends prev / next controls to the controls element
2934         */
2935        var appendControls = function() {
2936            slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
2937            slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
2938            // bind click actions to the controls
2939            slider.controls.next.bind('click touchend', clickNextBind);
2940            slider.controls.prev.bind('click touchend', clickPrevBind);
2941            // if nextSelector was supplied, populate it
2942            if (slider.settings.nextSelector) {
2943                $(slider.settings.nextSelector).append(slider.controls.next);
2944            }
2945            // if prevSelector was supplied, populate it
2946            if (slider.settings.prevSelector) {
2947                $(slider.settings.prevSelector).append(slider.controls.prev);
2948            }
2949            // if no custom selectors were supplied
2950            if (!slider.settings.nextSelector && !slider.settings.prevSelector) {
2951                // add the controls to the DOM
2952                slider.controls.directionEl = $('<div class="bx-controls-direction" />');
2953                // add the control elements to the directionEl
2954                slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
2955                // slider.viewport.append(slider.controls.directionEl);
2956                slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
2957            }
2958        };
2959
2960        /**
2961         * Appends start / stop auto controls to the controls element
2962         */
2963        var appendControlsAuto = function() {
2964            slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
2965            slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
2966            // add the controls to the DOM
2967            slider.controls.autoEl = $('<div class="bx-controls-auto" />');
2968            // bind click actions to the controls
2969            slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
2970            slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
2971            // if autoControlsCombine, insert only the "start" control
2972            if (slider.settings.autoControlsCombine) {
2973                slider.controls.autoEl.append(slider.controls.start);
2974                // if autoControlsCombine is false, insert both controls
2975            } else {
2976                slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
2977            }
2978            // if auto controls selector was supplied, populate it with the controls
2979            if (slider.settings.autoControlsSelector) {
2980                $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
2981                // if auto controls selector was not supplied, add it after the wrapper
2982            } else {
2983                slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
2984            }
2985            // update the auto controls
2986            updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
2987        };
2988
2989        /**
2990         * Appends image captions to the DOM
2991         */
2992        var appendCaptions = function() {
2993            // cycle through each child
2994            slider.children.each(function(index) {
2995                // get the image title attribute
2996                var title = $(this).find('img:first').attr('title');
2997                // append the caption
2998                if (title !== undefined && ('' + title).length) {
2999                    $(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
3000                }
3001            });
3002        };
3003
3004        /**
3005         * Click next binding
3006         *
3007         * @param e (event)
3008         *  - DOM event object
3009         */
3010        var clickNextBind = function(e) {
3011            e.preventDefault();
3012            if (slider.controls.el.hasClass('disabled')) { return; }
3013            // if auto show is running, stop it
3014            if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); }
3015            el.goToNextSlide();
3016        };
3017
3018        /**
3019         * Click prev binding
3020         *
3021         * @param e (event)
3022         *  - DOM event object
3023         */
3024        var clickPrevBind = function(e) {
3025            e.preventDefault();
3026            if (slider.controls.el.hasClass('disabled')) { return; }
3027            // if auto show is running, stop it
3028            if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); }
3029            el.goToPrevSlide();
3030        };
3031
3032        /**
3033         * Click start binding
3034         *
3035         * @param e (event)
3036         *  - DOM event object
3037         */
3038        var clickStartBind = function(e) {
3039            el.startAuto();
3040            e.preventDefault();
3041        };
3042
3043        /**
3044         * Click stop binding
3045         *
3046         * @param e (event)
3047         *  - DOM event object
3048         */
3049        var clickStopBind = function(e) {
3050            el.stopAuto();
3051            e.preventDefault();
3052        };
3053
3054        /**
3055         * Click pager binding
3056         *
3057         * @param e (event)
3058         *  - DOM event object
3059         */
3060        var clickPagerBind = function(e) {
3061            var pagerLink, pagerIndex;
3062            e.preventDefault();
3063            if (slider.controls.el.hasClass('disabled')) {
3064                return;
3065            }
3066            // if auto show is running, stop it
3067            if (slider.settings.auto  && slider.settings.stopAutoOnClick) { el.stopAuto(); }
3068            pagerLink = $(e.currentTarget);
3069            if (pagerLink.attr('data-slide-index') !== undefined) {
3070                pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
3071                // if clicked pager link is not active, continue with the goToSlide call
3072                if (pagerIndex !== slider.active.index) { el.goToSlide(pagerIndex); }
3073            }
3074        };
3075
3076        /**
3077         * Updates the pager links with an active class
3078         *
3079         * @param slideIndex (int)
3080         *  - index of slide to make active
3081         */
3082        var updatePagerActive = function(slideIndex) {
3083            // if "short" pager type
3084            var len = slider.children.length; // nb of children
3085            if (slider.settings.pagerType === 'short') {
3086                if (slider.settings.maxSlides > 1) {
3087                    len = Math.ceil(slider.children.length / slider.settings.maxSlides);
3088                }
3089                slider.pagerEl.html((slideIndex + 1) + slider.settings.pagerShortSeparator + len);
3090                return;
3091            }
3092            // remove all pager active classes
3093            slider.pagerEl.find('a').removeClass('active');
3094            // apply the active class for all pagers
3095            slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });
3096        };
3097
3098        /**
3099         * Performs needed actions after a slide transition
3100         */
3101        var updateAfterSlideTransition = function() {
3102            // if infinite loop is true
3103            if (slider.settings.infiniteLoop) {
3104                var position = '';
3105                // first slide
3106                if (slider.active.index === 0) {
3107                    // set the new position
3108                    position = slider.children.eq(0).position();
3109                    // carousel, last slide
3110                } else if (slider.active.index === getPagerQty() - 1 && slider.carousel) {
3111                    position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
3112                    // last slide
3113                } else if (slider.active.index === slider.children.length - 1) {
3114                    position = slider.children.eq(slider.children.length - 1).position();
3115                }
3116                if (position) {
3117                    if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
3118                    else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
3119                }
3120            }
3121            // declare that the transition is complete
3122            slider.working = false;
3123            // onSlideAfter callback
3124            slider.settings.onSlideAfter.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
3125        };
3126
3127        /**
3128         * Updates the auto controls state (either active, or combined switch)
3129         *
3130         * @param state (string) "start", "stop"
3131         *  - the new state of the auto show
3132         */
3133        var updateAutoControls = function(state) {
3134            // if autoControlsCombine is true, replace the current control with the new state
3135            if (slider.settings.autoControlsCombine) {
3136                slider.controls.autoEl.html(slider.controls[state]);
3137                // if autoControlsCombine is false, apply the "active" class to the appropriate control
3138            } else {
3139                slider.controls.autoEl.find('a').removeClass('active');
3140                slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
3141            }
3142        };
3143
3144        /**
3145         * Updates the direction controls (checks if either should be hidden)
3146         */
3147        var updateDirectionControls = function() {
3148            if (getPagerQty() === 1) {
3149                slider.controls.prev.addClass('disabled');
3150                slider.controls.next.addClass('disabled');
3151            } else if (!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd) {
3152                // if first slide
3153                if (slider.active.index === 0) {
3154                    slider.controls.prev.addClass('disabled');
3155                    slider.controls.next.removeClass('disabled');
3156                    // if last slide
3157                } else if (slider.active.index === getPagerQty() - 1) {
3158                    slider.controls.next.addClass('disabled');
3159                    slider.controls.prev.removeClass('disabled');
3160                    // if any slide in the middle
3161                } else {
3162                    slider.controls.prev.removeClass('disabled');
3163                    slider.controls.next.removeClass('disabled');
3164                }
3165            }
3166        };
3167
3168        /**
3169         * Initializes the auto process
3170         */
3171        var initAuto = function() {
3172            // if autoDelay was supplied, launch the auto show using a setTimeout() call
3173            if (slider.settings.autoDelay > 0) {
3174                var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
3175                // if autoDelay was not supplied, start the auto show normally
3176            } else {
3177                el.startAuto();
3178
3179                //add focus and blur events to ensure its running if timeout gets paused
3180                $(window).focus(function() {
3181                    el.startAuto();
3182                }).blur(function() {
3183                    el.stopAuto();
3184                });
3185            }
3186            // if autoHover is requested
3187            if (slider.settings.autoHover) {
3188                // on el hover
3189                el.hover(function() {
3190                    // if the auto show is currently playing (has an active interval)
3191                    if (slider.interval) {
3192                        // stop the auto show and pass true argument which will prevent control update
3193                        el.stopAuto(true);
3194                        // create a new autoPaused value which will be used by the relative "mouseout" event
3195                        slider.autoPaused = true;
3196                    }
3197                }, function() {
3198                    // if the autoPaused value was created be the prior "mouseover" event
3199                    if (slider.autoPaused) {
3200                        // start the auto show and pass true argument which will prevent control update
3201                        el.startAuto(true);
3202                        // reset the autoPaused value
3203                        slider.autoPaused = null;
3204                    }
3205                });
3206            }
3207        };
3208
3209        /**
3210         * Initializes the ticker process
3211         */
3212        var initTicker = function() {
3213            var startPosition = 0,
3214                position, transform, value, idx, ratio, property, newSpeed, totalDimens;
3215            // if autoDirection is "next", append a clone of the entire slider
3216            if (slider.settings.autoDirection === 'next') {
3217                el.append(slider.children.clone().addClass('bx-clone'));
3218                // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
3219            } else {
3220                el.prepend(slider.children.clone().addClass('bx-clone'));
3221                position = slider.children.first().position();
3222                startPosition = slider.settings.mode === 'horizontal' ? -position.left : -position.top;
3223            }
3224            setPositionProperty(startPosition, 'reset', 0);
3225            // do not allow controls in ticker mode
3226            slider.settings.pager = false;
3227            slider.settings.controls = false;
3228            slider.settings.autoControls = false;
3229            // if autoHover is requested
3230            if (slider.settings.tickerHover) {
3231                if (slider.usingCSS) {
3232                    idx = slider.settings.mode === 'horizontal' ? 4 : 5;
3233                    slider.viewport.hover(function() {
3234                        transform = el.css('-' + slider.cssPrefix + '-transform');
3235                        value = parseFloat(transform.split(',')[idx]);
3236                        setPositionProperty(value, 'reset', 0);
3237                    }, function() {
3238                        totalDimens = 0;
3239                        slider.children.each(function(index) {
3240                            totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
3241                        });
3242                        // calculate the speed ratio (used to determine the new speed to finish the paused animation)
3243                        ratio = slider.settings.speed / totalDimens;
3244                        // determine which property to use
3245                        property = slider.settings.mode === 'horizontal' ? 'left' : 'top';
3246                        // calculate the new speed
3247                        newSpeed = ratio * (totalDimens - (Math.abs(parseInt(value))));
3248                        tickerLoop(newSpeed);
3249                    });
3250                } else {
3251                    // on el hover
3252                    slider.viewport.hover(function() {
3253                        el.stop();
3254                    }, function() {
3255                        // calculate the total width of children (used to calculate the speed ratio)
3256                        totalDimens = 0;
3257                        slider.children.each(function(index) {
3258                            totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
3259                        });
3260                        // calculate the speed ratio (used to determine the new speed to finish the paused animation)
3261                        ratio = slider.settings.speed / totalDimens;
3262                        // determine which property to use
3263                        property = slider.settings.mode === 'horizontal' ? 'left' : 'top';
3264                        // calculate the new speed
3265                        newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
3266                        tickerLoop(newSpeed);
3267                    });
3268                }
3269            }
3270            // start the ticker loop
3271            tickerLoop();
3272        };
3273
3274        /**
3275         * Runs a continuous loop, news ticker-style
3276         */
3277        var tickerLoop = function(resumeSpeed) {
3278            var speed = resumeSpeed ? resumeSpeed : slider.settings.speed,
3279                position = {left: 0, top: 0},
3280                reset = {left: 0, top: 0},
3281                animateProperty, resetValue, params;
3282
3283            // if "next" animate left position to last child, then reset left to 0
3284            if (slider.settings.autoDirection === 'next') {
3285                position = el.find('.bx-clone').first().position();
3286                // if "prev" animate left position to 0, then reset left to first non-clone child
3287            } else {
3288                reset = slider.children.first().position();
3289            }
3290            animateProperty = slider.settings.mode === 'horizontal' ? -position.left : -position.top;
3291            resetValue = slider.settings.mode === 'horizontal' ? -reset.left : -reset.top;
3292            params = {resetValue: resetValue};
3293            setPositionProperty(animateProperty, 'ticker', speed, params);
3294        };
3295
3296        /**
3297         * Check if el is on screen
3298         */
3299        var isOnScreen = function(el) {
3300            var win = $(window),
3301                viewport = {
3302                    top: win.scrollTop(),
3303                    left: win.scrollLeft()
3304                },
3305                bounds = el.offset();
3306
3307            viewport.right = viewport.left + win.width();
3308            viewport.bottom = viewport.top + win.height();
3309            bounds.right = bounds.left + el.outerWidth();
3310            bounds.bottom = bounds.top + el.outerHeight();
3311
3312            return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
3313        };
3314
3315        /**
3316         * Initializes keyboard events
3317         */
3318        var keyPress = function(e) {
3319            var activeElementTag = document.activeElement.tagName.toLowerCase(),
3320                tagFilters = 'input|textarea',
3321                p = new RegExp(activeElementTag,['i']),
3322                result = p.exec(tagFilters);
3323
3324            if (result == null && isOnScreen(el)) {
3325                if (e.keyCode === 39) {
3326                    clickNextBind(e);
3327                    return false;
3328                } else if (e.keyCode === 37) {
3329                    clickPrevBind(e);
3330                    return false;
3331                }
3332            }
3333        };
3334
3335        /**
3336         * Initializes touch events
3337         */
3338        var initTouch = function() {
3339            // initialize object to contain all touch values
3340            slider.touch = {
3341                start: {x: 0, y: 0},
3342                end: {x: 0, y: 0}
3343            };
3344            slider.viewport.bind('touchstart MSPointerDown pointerdown', onTouchStart);
3345
3346            //for browsers that have implemented pointer events and fire a click after
3347            //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not
3348            slider.viewport.on('click', '.bxslider a', function(e) {
3349                if (slider.viewport.hasClass('click-disabled')) {
3350                    e.preventDefault();
3351                    slider.viewport.removeClass('click-disabled');
3352                }
3353            });
3354        };
3355
3356        /**
3357         * Event handler for "touchstart"
3358         *
3359         * @param e (event)
3360         *  - DOM event object
3361         */
3362        var onTouchStart = function(e) {
3363            //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls
3364            slider.controls.el.addClass('disabled');
3365
3366            if (slider.working) {
3367                e.preventDefault();
3368                slider.controls.el.removeClass('disabled');
3369            } else {
3370                // record the original position when touch starts
3371                slider.touch.originalPos = el.position();
3372                var orig = e.originalEvent,
3373                    touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig];
3374                // record the starting touch x, y coordinates
3375                slider.touch.start.x = touchPoints[0].pageX;
3376                slider.touch.start.y = touchPoints[0].pageY;
3377
3378                if (slider.viewport.get(0).setPointerCapture) {
3379                    slider.pointerId = orig.pointerId;
3380                    slider.viewport.get(0).setPointerCapture(slider.pointerId);
3381                }
3382                // bind a "touchmove" event to the viewport
3383                slider.viewport.bind('touchmove MSPointerMove pointermove', onTouchMove);
3384                // bind a "touchend" event to the viewport
3385                slider.viewport.bind('touchend MSPointerUp pointerup', onTouchEnd);
3386                slider.viewport.bind('MSPointerCancel pointercancel', onPointerCancel);
3387            }
3388        };
3389
3390        /**
3391         * Cancel Pointer for Windows Phone
3392         *
3393         * @param e (event)
3394         *  - DOM event object
3395         */
3396        var onPointerCancel = function(e) {
3397            /* onPointerCancel handler is needed to deal with situations when a touchend
3398             doesn't fire after a touchstart (this happens on windows phones only) */
3399            setPositionProperty(slider.touch.originalPos.left, 'reset', 0);
3400
3401            //remove handlers
3402            slider.controls.el.removeClass('disabled');
3403            slider.viewport.unbind('MSPointerCancel pointercancel', onPointerCancel);
3404            slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);
3405            slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);
3406            if (slider.viewport.get(0).releasePointerCapture) {
3407                slider.viewport.get(0).releasePointerCapture(slider.pointerId);
3408            }
3409        };
3410
3411        /**
3412         * Event handler for "touchmove"
3413         *
3414         * @param e (event)
3415         *  - DOM event object
3416         */
3417        var onTouchMove = function(e) {
3418            var orig = e.originalEvent,
3419                touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],
3420                // if scrolling on y axis, do not prevent default
3421                xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x),
3422                yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y),
3423                value = 0,
3424                change = 0;
3425
3426            // x axis swipe
3427            if ((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX) {
3428                e.preventDefault();
3429                // y axis swipe
3430            } else if ((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY) {
3431                e.preventDefault();
3432            }
3433            if (slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch) {
3434                // if horizontal, drag along x axis
3435                if (slider.settings.mode === 'horizontal') {
3436                    change = touchPoints[0].pageX - slider.touch.start.x;
3437                    value = slider.touch.originalPos.left + change;
3438                    // if vertical, drag along y axis
3439                } else {
3440                    change = touchPoints[0].pageY - slider.touch.start.y;
3441                    value = slider.touch.originalPos.top + change;
3442                }
3443                setPositionProperty(value, 'reset', 0);
3444            }
3445        };
3446
3447        /**
3448         * Event handler for "touchend"
3449         *
3450         * @param e (event)
3451         *  - DOM event object
3452         */
3453        var onTouchEnd = function(e) {
3454            slider.viewport.unbind('touchmove MSPointerMove pointermove', onTouchMove);
3455            //enable slider controls as soon as user stops interacing with slides
3456            slider.controls.el.removeClass('disabled');
3457            var orig    = e.originalEvent,
3458                touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig],
3459                value       = 0,
3460                distance    = 0;
3461            // record end x, y positions
3462            slider.touch.end.x = touchPoints[0].pageX;
3463            slider.touch.end.y = touchPoints[0].pageY;
3464            // if fade mode, check if absolute x distance clears the threshold
3465            if (slider.settings.mode === 'fade') {
3466                distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
3467                if (distance >= slider.settings.swipeThreshold) {
3468                    if (slider.touch.start.x > slider.touch.end.x) {
3469                        el.goToNextSlide();
3470                    } else {
3471                        el.goToPrevSlide();
3472                    }
3473                    el.stopAuto();
3474                }
3475                // not fade mode
3476            } else {
3477                // calculate distance and el's animate property
3478                if (slider.settings.mode === 'horizontal') {
3479                    distance = slider.touch.end.x - slider.touch.start.x;
3480                    value = slider.touch.originalPos.left;
3481                } else {
3482                    distance = slider.touch.end.y - slider.touch.start.y;
3483                    value = slider.touch.originalPos.top;
3484                }
3485                // if not infinite loop and first / last slide, do not attempt a slide transition
3486                if (!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))) {
3487                    setPositionProperty(value, 'reset', 200);
3488                } else {
3489                    // check if distance clears threshold
3490                    if (Math.abs(distance) >= slider.settings.swipeThreshold) {
3491                        if (distance < 0) {
3492                            el.goToNextSlide();
3493                        } else {
3494                            el.goToPrevSlide();
3495                        }
3496                        el.stopAuto();
3497                    } else {
3498                        // el.animate(property, 200);
3499                        setPositionProperty(value, 'reset', 200);
3500                    }
3501                }
3502            }
3503            slider.viewport.unbind('touchend MSPointerUp pointerup', onTouchEnd);
3504            if (slider.viewport.get(0).releasePointerCapture) {
3505                slider.viewport.get(0).releasePointerCapture(slider.pointerId);
3506            }
3507        };
3508
3509        /**
3510         * Window resize event callback
3511         */
3512        var resizeWindow = function(e) {
3513            // don't do anything if slider isn't initialized.
3514            if (!slider.initialized) { return; }
3515            // Delay if slider working.
3516            if (slider.working) {
3517                window.setTimeout(resizeWindow, 10);
3518            } else {
3519                // get the new window dimens (again, thank you IE)
3520                var windowWidthNew = $(window).width(),
3521                    windowHeightNew = $(window).height();
3522                // make sure that it is a true window resize
3523                // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
3524                // are resized. Can you just die already?*
3525                if (windowWidth !== windowWidthNew || windowHeight !== windowHeightNew) {
3526                    // set the new window dimens
3527                    windowWidth = windowWidthNew;
3528                    windowHeight = windowHeightNew;
3529                    // update all dynamic elements
3530                    el.redrawSlider();
3531                    // Call user resize handler
3532                    slider.settings.onSliderResize.call(el, slider.active.index);
3533                }
3534            }
3535        };
3536
3537        /**
3538         * Adds an aria-hidden=true attribute to each element
3539         *
3540         * @param startVisibleIndex (int)
3541         *  - the first visible element's index
3542         */
3543        var applyAriaHiddenAttributes = function(startVisibleIndex) {
3544            var numberOfSlidesShowing = getNumberSlidesShowing();
3545            // only apply attributes if the setting is enabled and not in ticker mode
3546            if (slider.settings.ariaHidden && !slider.settings.ticker) {
3547                // add aria-hidden=true to all elements
3548                slider.children.attr('aria-hidden', 'true');
3549                // get the visible elements and change to aria-hidden=false
3550                slider.children.slice(startVisibleIndex, startVisibleIndex + numberOfSlidesShowing).attr('aria-hidden', 'false');
3551            }
3552        };
3553
3554        /**
3555         * Returns index according to present page range
3556         *
3557         * @param slideOndex (int)
3558         *  - the desired slide index
3559         */
3560        var setSlideIndex = function(slideIndex) {
3561            if (slideIndex < 0) {
3562                if (slider.settings.infiniteLoop) {
3563                    return getPagerQty() - 1;
3564                }else {
3565                    //we don't go to undefined slides
3566                    return slider.active.index;
3567                }
3568                // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
3569            } else if (slideIndex >= getPagerQty()) {
3570                if (slider.settings.infiniteLoop) {
3571                    return 0;
3572                } else {
3573                    //we don't move to undefined pages
3574                    return slider.active.index;
3575                }
3576                // set active index to requested slide
3577            } else {
3578                return slideIndex;
3579            }
3580        };
3581
3582        /**
3583         * ===================================================================================
3584         * = PUBLIC FUNCTIONS
3585         * ===================================================================================
3586         */
3587
3588        /**
3589         * Performs slide transition to the specified slide
3590         *
3591         * @param slideIndex (int)
3592         *  - the destination slide's index (zero-based)
3593         *
3594         * @param direction (string)
3595         *  - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
3596         */
3597        el.goToSlide = function(slideIndex, direction) {
3598            // onSlideBefore, onSlideNext, onSlidePrev callbacks
3599            // Allow transition canceling based on returned value
3600            var performTransition = true,
3601                moveBy = 0,
3602                position = {left: 0, top: 0},
3603                lastChild = null,
3604                lastShowingIndex, eq, value, requestEl;
3605            // store the old index
3606            slider.oldIndex = slider.active.index;
3607            //set new index
3608            slider.active.index = setSlideIndex(slideIndex);
3609
3610            // if plugin is currently in motion, ignore request
3611            if (slider.working || slider.active.index === slider.oldIndex) { return; }
3612            // declare that plugin is in motion
3613            slider.working = true;
3614
3615            performTransition = slider.settings.onSlideBefore.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
3616
3617            // If transitions canceled, reset and return
3618            if (typeof (performTransition) !== 'undefined' && !performTransition) {
3619                slider.active.index = slider.oldIndex; // restore old index
3620                slider.working = false; // is not in motion
3621                return;
3622            }
3623
3624            if (direction === 'next') {
3625                // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
3626                if (!slider.settings.onSlideNext.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {
3627                    performTransition = false;
3628                }
3629            } else if (direction === 'prev') {
3630                // Prevent canceling in future functions or lack there-of from negating previous commands to cancel
3631                if (!slider.settings.onSlidePrev.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) {
3632                    performTransition = false;
3633                }
3634            }
3635
3636            // check if last slide
3637            slider.active.last = slider.active.index >= getPagerQty() - 1;
3638            // update the pager with active class
3639            if (slider.settings.pager || slider.settings.pagerCustom) { updatePagerActive(slider.active.index); }
3640            // // check for direction control update
3641            if (slider.settings.controls) { updateDirectionControls(); }
3642            // if slider is set to mode: "fade"
3643            if (slider.settings.mode === 'fade') {
3644                // if adaptiveHeight is true and next height is different from current height, animate to the new height
3645                if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {
3646                    slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
3647                }
3648                // fade out the visible child and reset its z-index value
3649                slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
3650                // fade in the newly requested slide
3651                slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex + 1).fadeIn(slider.settings.speed, function() {
3652                    $(this).css('zIndex', slider.settings.slideZIndex);
3653                    updateAfterSlideTransition();
3654                });
3655                // slider mode is not "fade"
3656            } else {
3657                // if adaptiveHeight is true and next height is different from current height, animate to the new height
3658                if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) {
3659                    slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
3660                }
3661                // if carousel and not infinite loop
3662                if (!slider.settings.infiniteLoop && slider.carousel && slider.active.last) {
3663                    if (slider.settings.mode === 'horizontal') {
3664                        // get the last child position
3665                        lastChild = slider.children.eq(slider.children.length - 1);
3666                        position = lastChild.position();
3667                        // calculate the position of the last slide
3668                        moveBy = slider.viewport.width() - lastChild.outerWidth();
3669                    } else {
3670                        // get last showing index position
3671                        lastShowingIndex = slider.children.length - slider.settings.minSlides;
3672                        position = slider.children.eq(lastShowingIndex).position();
3673                    }
3674                    // horizontal carousel, going previous while on first slide (infiniteLoop mode)
3675                } else if (slider.carousel && slider.active.last && direction === 'prev') {
3676                    // get the last child position
3677                    eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
3678                    lastChild = el.children('.bx-clone').eq(eq);
3679                    position = lastChild.position();
3680                    // if infinite loop and "Next" is clicked on the last slide
3681                } else if (direction === 'next' && slider.active.index === 0) {
3682                    // get the last clone position
3683                    position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
3684                    slider.active.last = false;
3685                    // normal non-zero requests
3686                } else if (slideIndex >= 0) {
3687                    //parseInt is applied to allow floats for slides/page
3688                    requestEl = slideIndex * parseInt(getMoveBy());
3689                    position = slider.children.eq(requestEl).position();
3690                }
3691
3692                /* If the position doesn't exist
3693                 * (e.g. if you destroy the slider on a next click),
3694                 * it doesn't throw an error.
3695                 */
3696                if (typeof (position) !== 'undefined') {
3697                    value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top;
3698                    // plugin values to be animated
3699                    setPositionProperty(value, 'slide', slider.settings.speed);
3700                } else {
3701                    slider.working = false;
3702                }
3703            }
3704            if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); }
3705        };
3706
3707        /**
3708         * Transitions to the next slide in the show
3709         */
3710        el.goToNextSlide = function() {
3711            // if infiniteLoop is false and last page is showing, disregard call
3712            if (!slider.settings.infiniteLoop && slider.active.last) { return; }
3713            var pagerIndex = parseInt(slider.active.index) + 1;
3714            el.goToSlide(pagerIndex, 'next');
3715        };
3716
3717        /**
3718         * Transitions to the prev slide in the show
3719         */
3720        el.goToPrevSlide = function() {
3721            // if infiniteLoop is false and last page is showing, disregard call
3722            if (!slider.settings.infiniteLoop && slider.active.index === 0) { return; }
3723            var pagerIndex = parseInt(slider.active.index) - 1;
3724            el.goToSlide(pagerIndex, 'prev');
3725        };
3726
3727        /**
3728         * Starts the auto show
3729         *
3730         * @param preventControlUpdate (boolean)
3731         *  - if true, auto controls state will not be updated
3732         */
3733        el.startAuto = function(preventControlUpdate) {
3734            // if an interval already exists, disregard call
3735            if (slider.interval) { return; }
3736            // create an interval
3737            slider.interval = setInterval(function() {
3738                if (slider.settings.autoDirection === 'next') {
3739                    el.goToNextSlide();
3740                } else {
3741                    el.goToPrevSlide();
3742                }
3743            }, slider.settings.pause);
3744            // if auto controls are displayed and preventControlUpdate is not true
3745            if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('stop'); }
3746        };
3747
3748        /**
3749         * Stops the auto show
3750         *
3751         * @param preventControlUpdate (boolean)
3752         *  - if true, auto controls state will not be updated
3753         */
3754        el.stopAuto = function(preventControlUpdate) {
3755            // if no interval exists, disregard call
3756            if (!slider.interval) { return; }
3757            // clear the interval
3758            clearInterval(slider.interval);
3759            slider.interval = null;
3760            // if auto controls are displayed and preventControlUpdate is not true
3761            if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('start'); }
3762        };
3763
3764        /**
3765         * Returns current slide index (zero-based)
3766         */
3767        el.getCurrentSlide = function() {
3768            return slider.active.index;
3769        };
3770
3771        /**
3772         * Returns current slide element
3773         */
3774        el.getCurrentSlideElement = function() {
3775            return slider.children.eq(slider.active.index);
3776        };
3777
3778        /**
3779         * Returns a slide element
3780         * @param index (int)
3781         *  - The index (zero-based) of the element you want returned.
3782         */
3783        el.getSlideElement = function(index) {
3784            return slider.children.eq(index);
3785        };
3786
3787        /**
3788         * Returns number of slides in show
3789         */
3790        el.getSlideCount = function() {
3791            return slider.children.length;
3792        };
3793
3794        /**
3795         * Return slider.working variable
3796         */
3797        el.isWorking = function() {
3798            return slider.working;
3799        };
3800
3801        /**
3802         * Update all dynamic slider elements
3803         */
3804        el.redrawSlider = function() {
3805            // resize all children in ratio to new screen size
3806            slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth());
3807            // adjust the height
3808            slider.viewport.css('height', getViewportHeight());
3809            // update the slide position
3810            if (!slider.settings.ticker) { setSlidePosition(); }
3811            // if active.last was true before the screen resize, we want
3812            // to keep it last no matter what screen size we end on
3813            if (slider.active.last) { slider.active.index = getPagerQty() - 1; }
3814            // if the active index (page) no longer exists due to the resize, simply set the index as last
3815            if (slider.active.index >= getPagerQty()) { slider.active.last = true; }
3816            // if a pager is being displayed and a custom pager is not being used, update it
3817            if (slider.settings.pager && !slider.settings.pagerCustom) {
3818                populatePager();
3819                updatePagerActive(slider.active.index);
3820            }
3821            if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); }
3822        };
3823
3824        /**
3825         * Destroy the current instance of the slider (revert everything back to original state)
3826         */
3827        el.destroySlider = function() {
3828            // don't do anything if slider has already been destroyed
3829            if (!slider.initialized) { return; }
3830            slider.initialized = false;
3831            $('.bx-clone', this).remove();
3832            slider.children.each(function() {
3833                if ($(this).data('origStyle') !== undefined) {
3834                    $(this).attr('style', $(this).data('origStyle'));
3835                } else {
3836                    $(this).removeAttr('style');
3837                }
3838            });
3839            if ($(this).data('origStyle') !== undefined) {
3840                this.attr('style', $(this).data('origStyle'));
3841            } else {
3842                $(this).removeAttr('style');
3843            }
3844            $(this).unwrap().unwrap();
3845            if (slider.controls.el) { slider.controls.el.remove(); }
3846            if (slider.controls.next) { slider.controls.next.remove(); }
3847            if (slider.controls.prev) { slider.controls.prev.remove(); }
3848            if (slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom) { slider.pagerEl.remove(); }
3849            $('.bx-caption', this).remove();
3850            if (slider.controls.autoEl) { slider.controls.autoEl.remove(); }
3851            clearInterval(slider.interval);
3852            if (slider.settings.responsive) { $(window).unbind('resize', resizeWindow); }
3853            if (slider.settings.keyboardEnabled) { $(document).unbind('keydown', keyPress); }
3854            //remove self reference in data
3855            $(this).removeData('bxSlider');
3856        };
3857
3858        /**
3859         * Reload the slider (revert all DOM changes, and re-initialize)
3860         */
3861        el.reloadSlider = function(settings) {
3862            if (settings !== undefined) { options = settings; }
3863            el.destroySlider();
3864            init();
3865            //store reference to self in order to access public functions later
3866            $(el).data('bxSlider', this);
3867        };
3868
3869        init();
3870
3871        $(el).data('bxSlider', this);
3872
3873        // returns the current jQuery object
3874        return this;
3875    };
3876
3877})(jQuery);
3878
3879(function ($, ns) {
3880
3881    var sliderComponent = {
3882
3883        global         : true,
3884        initiable      : true,
3885        defaultSelector: '.bxslider',
3886
3887
3888        init: function ($wrap, opts) {
3889            var t   = this;
3890            t.$wrap = $wrap || $(t.defaultSelector);
3891
3892            t.$wrap.each(function(){
3893                var $sliderWrap = $(this);
3894
3895                var sliderOpts = {
3896                    'mode': 'horizontal',
3897                    'auto': true,
3898                    'autoControls': true,
3899                    'autoControlsCombine': true,
3900                    'keyboardEnabled': true,
3901                    'easing': 'ease',
3902                    'adaptiveHeight': true,
3903                    'stopAutoOnClick': false
3904                };
3905
3906                //Si slideshow homepage
3907                if($sliderWrap.hasClass('slider')){
3908                    sliderOpts['auto'] = true;
3909                    sliderOpts['mode'] = 'fade';
3910                    sliderOpts['speed'] = 700;
3911                    sliderOpts['easing'] = 'ease-in-out';
3912                }
3913
3914              if($sliderWrap.hasClass('slider-infos-pratiques')){
3915                sliderOpts['auto'] = false;
3916                sliderOpts['adaptiveHeight'] = true;
3917                sliderOpts['touchEnabled'] = false;
3918              }
3919
3920                $sliderWrap.bxSlider(sliderOpts);
3921            })
3922
3923        }
3924    };
3925
3926    ns.app.registerComponent('slider', sliderComponent, {initGlobal: true}); //si on passe { initGlobal:true } il sera meme auto instancie
3927
3928})(jQuery, window.wonderwp);
3929
3930(function ($, ns) {
3931
3932    var scrollComponent = {
3933
3934        global: false,
3935        initiable: true,
3936        defaultSelector: '.scrollable-item',
3937
3938        init: function ($wrap) {
3939
3940            var t = this;
3941            t.$wrap = $wrap || $(t.defaultSelector);
3942        }
3943
3944    };
3945
3946    ns.app.registerComponent('scroll', scrollComponent); //si on passe { initGlobal:true } il sera meme auto instancie
3947
3948})
3949(jQuery, window.wonderwp);
3950(function ($, ns) {
3951
3952    var imgListComponent = {
3953
3954        global: false,
3955        initiable: true,
3956        defaultSelector: '.img-list',
3957
3958        init: function ($wrap) {
3959
3960            var t   = this;
3961
3962            setTimeout(function(){
3963                t.$wrap = $wrap || $(t.defaultSelector);
3964
3965                var originalHeight = t.$wrap.height(),
3966                    reducedHeight  = t.$wrap.find('li').height() * 2;
3967
3968                var styles = {
3969                    height: reducedHeight,
3970                    overflow: 'hidden'
3971                };
3972
3973                t.$wrap.css(styles);
3974
3975
3976                $('.btn-toggle-height').on('click', function (e) {
3977                    e.preventDefault();
3978                    t.$wrap.animate({
3979                        height: originalHeight,
3980                        overflow: 'visible'
3981                    }, 1000, function () {});
3982
3983                    $(this).css('display', 'none');
3984                })
3985
3986            },1000);
3987        }
3988
3989    };
3990
3991    ns.app.registerComponent('imgList', imgListComponent); //si on passe { initGlobal:true } il sera meme auto instancie
3992
3993})
3994(jQuery, window.wonderwp);
3995
3996(function ($, ns) {
3997
3998    var visitComponentIniter = {
3999
4000        global: false,
4001        initiable: true,
4002        defaultSelector: '.block-visit',
4003
4004        init: function ($wrap) {
4005
4006            var t   = this;
4007            t.$wrap = $wrap || $(t.defaultSelector);
4008            t.$wrap.each(function () {
4009                new visit($wrap)
4010            });
4011        }
4012
4013    };
4014
4015    var visit = function ($wrap) {
4016        this.$wrap = $wrap;
4017        this.init();
4018    };
4019
4020    visit.prototype = {
4021        init: function () {
4022            var self = this;
4023            self.$wrap.find('.block-visit-list a').on('mouseover', function () {
4024                var newBg = $(this).data('associatedbg');
4025                if (newBg && newBg.length) {
4026                    self.$wrap.css('background-image','url("'+newBg+'")');
4027                }
4028            });
4029        }
4030    };
4031
4032    ns.app.registerComponent('visit', visitComponentIniter); //si on passe { initGlobal:true } il sera meme auto instancie
4033
4034})
4035(jQuery, window.wonderwp);
4036
4037(function ($, ns) {
4038
4039  var partnerToggleComponentIniter = {
4040
4041    global: false,
4042    initiable: true,
4043    defaultSelector: '.partner-toggle',
4044
4045    init: function ($wrap) {
4046      var t = this;
4047      t.$wrap = $wrap || $(t.defaultSelector);
4048      t.$wrap.each(function () {
4049        new partnerToggle($(this))
4050      });
4051    }
4052
4053  };
4054
4055  var partnerToggle = function ($wrap) {
4056    this.$toggleBtn = $wrap;
4057    this.$partnerCard = $wrap.parents('.item.has-link').parent();
4058    this.init();
4059  };
4060
4061  partnerToggle.prototype = {
4062    init: function () {
4063      this.registerToggle();
4064    },
4065    registerToggle: function () {
4066      var self = this;
4067      this.$toggleBtn.on('click',function(){
4068        self.$partnerCard.toggleClass('is-opened');
4069        self.$partnerCard.find('.togglable-content-wrapper').slideToggle();
4070      });
4071    }
4072  };
4073
4074  ns.app.registerComponent('partnerToggle', partnerToggleComponentIniter); //si on passe { initGlobal:true } il sera meme auto instancie
4075
4076})
4077(jQuery, window.wonderwp);
4078
4079(function ($, ns) {
4080  "use strict";
4081
4082  var moduleActu = function ($context, opts) {
4083    this.dom = $context;
4084    this.$context = $($context);
4085
4086    var defaultOpts = {
4087      pushState: (ns.actu && ns.actu.opts && ns.actu.opts.pushState !== undefined) ? ns.actu.opts.pushState : true,
4088      autoSubmitFilters: (ns.actu && ns.actu.opts && ns.actu.opts.autoSubmitFilters !== undefined) ? ns.actu.opts.autoSubmitFilters : true,
4089    };
4090    opts = opts || {};
4091    this.opts = $.extend(defaultOpts, opts);
4092
4093    this.init();
4094  };
4095
4096  moduleActu.prototype = {
4097    init: function () {
4098      var self = this;
4099      self.registerEvents();
4100
4101      if (this.opts.pushState) {
4102        window.history && history.replaceState({
4103          'module': 'actu',
4104          'href': window.location.href
4105        }, null, window.location.href);
4106        window.onpopstate = function (event) {
4107          if (event.state && event.state.module && event.state.module === 'actu' && event.state.href) {
4108            self.loadPage(event.state.href);
4109          }
4110        }
4111      }
4112
4113      self.recomputeIndexes();
4114    },
4115    registerEvents: function () {
4116      this.registerPagination();
4117      this.registerSearch(this.opts.autoSubmitFilters);
4118      this.registerReset();
4119    },
4120    recomputeIndexes: function () {
4121      jQuery('.module-actu').each(function (i, instance) {
4122        $(instance).data('index', i);
4123      });
4124    },
4125    loadPage: function (href, cb) {
4126      var self = this;
4127      self.$context.addClass('ajax-loading');
4128      $.get(href, {}, function (res) {
4129        self.$context.removeClass('ajax-loading');
4130        var index = self.$context.data('index');
4131        var $newContext = null;
4132        if (index) {
4133          $newContext = $($(res).find('.module-actu')[index]);
4134          $newContext.data('index', index);
4135        } else {
4136          $newContext = $(res).find('.module-actu').first();
4137        }
4138        self.$context.replaceWith($newContext);
4139        self.$context = $newContext;
4140
4141        var topPos = self.$context && self.$context.offset() && self.$context.offset().top ? self.$context.offset().top : null;
4142        if (topPos) {
4143          if (window.smoothScrollMargin) {
4144            topPos -= window.smoothScrollMargin;
4145          }
4146
4147          $('html,body').animate({
4148            scrollTop: topPos
4149          }, 750);
4150        }
4151
4152        self.registerEvents();
4153
4154        if (self.opts.pushState) {
4155          window.history && history.pushState({'module': 'actu', 'href': href}, null, href);
4156        }
4157
4158        if (ns.theme && ns.theme.runCurrentPageJs) {
4159          ns.theme.runCurrentPageJs(self.$context);
4160        }
4161        if (window.pew) {
4162          window.pew.enhanceRegistry(self.$context[0]);
4163        }
4164        cb && cb();
4165      });
4166    },
4167    registerPagination: function () {
4168      var self = this;
4169      this.$context.find('.pagination a.navlink').on('click', function (e) {
4170        e.preventDefault();
4171        $(this).replaceWith('<span class="loader loader--small"></span>')
4172        self.loadPage($(this).attr('href'));
4173      })
4174    },
4175    registerSearch: function (autoSubmit) {
4176      var self = this,
4177        $filtersForm = this.$context.find('form.news-filters');
4178
4179      $filtersForm.on('submit', function (e) {
4180        var $form = $(this);
4181        e.preventDefault();
4182        if (!self.$context.hasClass('ajax-loading')) {
4183          self.loadPage($form.prop('action') + '?' + $form.serialize());
4184        }
4185      });
4186      if (autoSubmit) {
4187        $filtersForm.addClass('auto-submit');
4188
4189        //auto submit on input change
4190        var $inputs = $filtersForm.find('.checkbox, input, select').not('.exclude');
4191        $inputs.on('change', function () {
4192          $(this).parent().addClass('currently-loading');
4193          $filtersForm.submit();
4194        });
4195
4196        //Possibility to uncheck a radio input
4197        $("input:radio:checked").data("chk", true);
4198        $inputs.on('click', function () {
4199          //on valid if it's a radio input
4200          if (!$(this).is(':radio')) {
4201            return;
4202          }
4203          $(this).data("chk", !$(this).data("chk"));
4204          $(this).prop("checked", $(this).data("chk")).trigger('change');
4205        });
4206      }
4207    },
4208    registerReset: function () {
4209      var $filtersForm = this.$context.find('.news-filters');
4210      $filtersForm.find('button[type="reset"]').on('click', function () {
4211        $filtersForm.find('select, input[type="text"], textarea').val('');
4212        $filtersForm.find('input[type="checkbox"], input[type="radio"]').prop('checked', false).attr('checked', false);
4213        $filtersForm.submit();
4214      });
4215    }
4216  };
4217
4218  if (ns && ns.app) {
4219    ns.app.registerModule('actu', moduleActu);
4220  } else {
4221    window.pew.addRegistryEntry({key: 'wdf-plugin-actu', domSelector: '.module-actu', classDef: moduleActu});
4222  }
4223
4224})(jQuery, window.wonderwp);
4225
4226(function ($, ns) {
4227  "use strict";
4228
4229  var moduleActuTheme = function ($context, opts) {
4230    this.dom = $context;
4231    this.$context = $($context);
4232
4233    var defaultOpts = {
4234      pushState: (ns.actu && ns.actu.opts && ns.actu.opts.pushState !== undefined) ? ns.actu.opts.pushState : true,
4235      autoSubmitFilters: (ns.actu && ns.actu.opts && ns.actu.opts.autoSubmitFilters !== undefined) ? ns.actu.opts.autoSubmitFilters : true,
4236    };
4237    opts = opts || {};
4238    this.opts = $.extend(defaultOpts, opts);
4239
4240    this.init();
4241  };
4242
4243  var parentPrototype = ns.app.getModule('actu').prototype;
4244  moduleActuTheme.prototype = jQuery.extend({}, parentPrototype);
4245
4246  moduleActuTheme.prototype.registerEvents = function () {
4247    parentPrototype.registerEvents.call(this);
4248    this.registerCalendarToggle();
4249    this.registerCalendarNav();
4250    this.registerMasonry();
4251  };
4252
4253  // see https://bxslider.com/options/
4254  moduleActuTheme.prototype.registerCalendarToggle = function () {
4255    var $calendarToggle = this.$context.find(".month-filter-toggle");
4256    var $calendar = this.$context.find(".month-filter-list");
4257
4258    $calendarToggle.on("click", function (e) {
4259      e.preventDefault();
4260      $calendar.slideToggle();
4261    });
4262  };
4263
4264  moduleActuTheme.prototype.registerCalendarNav = function () {
4265    //When clicking on a month, we extract from its attribute the month value, then we submit the form
4266    var $calendar = this.$context.find(".month-filter-list");
4267    var $monthInput = this.$context.find('#month');
4268
4269    $calendar.find('button').on('click', function (e) {
4270      //Extract the data-month attribute from the button
4271      var month = $(this).data('month');
4272      //Inject it into the month hidden input
4273      $monthInput.val(month);
4274      //Trigger a change event on the month input to submit the form
4275      $monthInput.trigger('change');
4276    });
4277  };
4278
4279  moduleActuTheme.prototype.registerMasonry = function () {
4280    var $actuList = this.$context.find('.actu-list');
4281    //activate masonry on actu list
4282    $actuList.masonry({
4283      itemSelector: 'li',
4284      columnWidth: 'li',
4285      percentPosition: true
4286    });
4287  };
4288
4289  if (ns && ns.app) {
4290    ns.app.registerModule('actu', moduleActuTheme);
4291  } else {
4292    window.pew.addRegistryEntry({key: 'wdf-plugin-actu', domSelector: '.module-actu', classDef: moduleActuTheme});
4293  }
4294})(jQuery, window.wonderwp);
4295
4296(function ($, ns) {
4297
4298  var AlertComponent = function ($context) {
4299    this.element = $context;
4300
4301    this.options = {
4302      componentWrappersSelector: "[data-alert-wrap]",
4303      alertCloseTriggerSelector: ".close-trigger",
4304      alertTransitionSpeed: 400
4305    };
4306
4307    this.init();
4308  };
4309
4310  AlertComponent.prototype = {
4311
4312    init: function () {
4313      this.debug = true;
4314      this.alertComponents = [];
4315      this.EventManager = window.EventManager || $(document);
4316      this.ajaxUrl = wonderwp.resturl + 'wwp-alerte/v1';
4317      var cacheEnabled = this.element.data('cache-enabled');
4318      var hasAlerts = this.element.data('has-alerts');
4319      if (cacheEnabled && hasAlerts) {
4320        this.revealDisplayableAlerts();
4321      } else if (hasAlerts) {
4322        this.scanAlerts();
4323      }
4324    },
4325
4326    scanAlerts: function () {
4327      var $alertComponentsWraps = this.element.find(this.options.componentWrappersSelector);
4328      self = this;
4329
4330      if ($alertComponentsWraps.length) {
4331        $alertComponentsWraps.each(function (i, alertComponentWrap) {
4332          var $wrap = $(alertComponentWrap);
4333          $wrap.find(self.options.alertCloseTriggerSelector).on('click', function () {
4334            self.storeAlertClosed($wrap.attr('data-wrapping-id'), $wrap);
4335          });
4336          self.alertComponents[i] = $wrap;
4337        });
4338      }
4339    },
4340
4341    storeAlertClosed: function (alerteId, $alerteWrap) {
4342      this.log('store alerte closed', alerteId);
4343      var closeUrl = this.getCloseUrl(alerteId),
4344        closeParams = this.getCloseAjaxParams();
4345      $alerteWrap.fadeOut(500, function () {
4346        $.ajax($.extend({
4347          url: closeUrl,
4348        }, closeParams))
4349      });
4350    },
4351
4352    getCloseUrl: function (alerteId) {
4353      var requestUrl = this.ajaxUrl + '/close';
4354      var params = {
4355        alerte: alerteId
4356      };
4357      var queryString = Object.keys(params).map(key => key + '=' + params[key]).join('&');
4358
4359      return requestUrl + '?' + queryString;
4360    },
4361
4362    getCloseAjaxParams: function () {
4363      return {
4364        type: 'PUT'
4365      }
4366    },
4367
4368    revealDisplayableAlerts: function () {
4369      this.scanAlerts();
4370      for (var i in this.alertComponents) {
4371        var $wrap = this.alertComponents[i],
4372          isAlertSeen = this.isAlertSeen($wrap.attr('data-wrapping-id'));
4373        if (!isAlertSeen) {
4374          $wrap.addClass('revealed');
4375        }
4376      }
4377    },
4378
4379    isAlertSeen: function(alerteId) {
4380      var seenAlerts = this.getSeenAlerts();
4381      return !!seenAlerts[alerteId];
4382    },
4383
4384    getSeenAlerts: function() {
4385      if (!this.seenAlerts) {
4386        var cookieVal = this.getCookieVal('wwp-alerte');
4387        if (cookieVal === '') {
4388          cookieVal = '{}';
4389        }
4390        this.seenAlerts = JSON.parse(cookieVal);
4391      }
4392      return this.seenAlerts;
4393    },
4394
4395    getCookieVal: function(cname) {
4396      var name = cname + "=";
4397      var decodedCookie = decodeURIComponent(document.cookie);
4398      var ca = decodedCookie.split(';');
4399      for (var i = 0; i < ca.length; i++) {
4400        var c = ca[i];
4401        while (c.charAt(0) === ' ') {
4402          c = c.substring(1);
4403        }
4404        if (c.indexOf(name) === 0) {
4405          return c.substring(name.length, c.length);
4406        }
4407      }
4408      return "";
4409    },
4410
4411    log: function (msg) {
4412      if (this.debug) {
4413        console.log('[wwp-alert] ', ...arguments);
4414      }
4415    }
4416
4417  };
4418
4419  if (ns && ns.app) {
4420    ns.app.registerModule('alerte', AlertComponent);
4421  }
4422
4423})(jQuery, window.wonderwp);
4424
4425(function ($, ns) {
4426    "use strict";
4427
4428    var ThemeAlert = function ($context) {
4429      this.element = $context;
4430
4431      this.options = {
4432        componentWrappersSelector: "[data-alert-wrap]",
4433        alertCloseTriggerSelector: ".close-trigger",
4434        alertTransitionSpeed: 400
4435      };
4436
4437      this.init();
4438    };
4439
4440    var parentPrototype = ns.app.modules['alerte'].prototype;
4441    ThemeAlert.prototype = jQuery.extend({}, parentPrototype);
4442
4443    ThemeAlert.prototype.init = function () {
4444      parentPrototype.init.call(this);
4445      this.registerToggler();
4446    }
4447
4448    ThemeAlert.prototype.storeAlertClosed = function (alerteId, $alerteWrap) {
4449      $alerteWrap.removeClass('revealed');
4450      var closeUrl = this.getCloseUrl(alerteId),
4451        closeParams = this.getCloseAjaxParams();
4452      $.ajax($.extend({
4453        url: closeUrl,
4454      }, closeParams))
4455    }
4456
4457    ThemeAlert.prototype.storeAlertOpened = function(alerteId, $alerteWrap){
4458      $alerteWrap.addClass('revealed');
4459    }
4460
4461    ThemeAlert.prototype.registerToggler = function () {
4462      var $alertComponentsWraps = this.element.find(this.options.componentWrappersSelector);
4463      self = this;
4464
4465      if ($alertComponentsWraps.length) {
4466        $alertComponentsWraps.each(function (i, alertComponentWrap) {
4467          var $wrap = $(alertComponentWrap);
4468          $wrap.find('.toggle-trigger').on('click', function () {
4469            if($wrap.hasClass('revealed')){
4470              //Popin is open -> close it
4471              self.storeAlertClosed($wrap.attr('data-wrapping-id'), $wrap);
4472            } else {
4473              //Popin is closed -> open it
4474              self.storeAlertOpened($wrap.attr('data-wrapping-id'), $wrap);
4475            }
4476          });
4477        });
4478      }
4479
4480    }
4481
4482    ns.app.registerModule('alerte', ThemeAlert);
4483
4484  }
4485)(jQuery, window.wonderwp);
4486
4487wonderwp.CachePluginComponent = function () {
4488  this.debug = false;
4489  this.storageKey = 'wwp-cache';
4490  this.storageEnabled = true;
4491  this.EventManager = window.EventManager || jQuery(document);
4492  this._initialLoadDone = false;
4493  this._fetchInProgress = false;
4494  this.onCacheNeedsRefresh(this.EventManager);
4495  var self = this;
4496  setTimeout(function () {
4497    self.loadCacheData();
4498  }, 50);
4499};
4500
4501wonderwp.CachePluginComponent.prototype = {
4502
4503  loadCacheData: function () {
4504    if (!wonderwp.cache_enabled) {
4505      return false;
4506    }
4507    if (!wonderwp.cacheConfig || !wonderwp.cacheConfig.uri) {
4508      throw new Error('Missing wwp-cache api cache uri');
4509    }
4510
4511    if (this._fetchInProgress) {
4512      this.log('Load Cache Data skipped (fetch already in progress)');
4513      return false;
4514    }
4515
4516    var res = this.storageEnabled ? sessionStorage.getItem(this.storageKey) : false;
4517    if (res) {
4518      this.log('Load Cache Data (storage)');
4519      this._initialLoadDone = true;
4520      this.onCacheLoadSuccess(JSON.parse(res));
4521    } else {
4522      this.log('Load Cache Data (api)');
4523      var self = this;
4524      this._fetchInProgress = true;
4525      jQuery.get(wonderwp.cacheConfig.uri, {}, function (res) {
4526        self._fetchInProgress = false;
4527        if (res && res.code && res.code === 200) {
4528          sessionStorage.setItem(self.storageKey, JSON.stringify(res));
4529          self._initialLoadDone = true;
4530          self.onCacheLoadSuccess(res);
4531        } else {
4532          self.onCacheLoadError(res);
4533        }
4534      }, 'json').fail(function () {
4535        self._fetchInProgress = false;
4536      });
4537    }
4538  },
4539
4540  onCacheLoadSuccess: function (res) {
4541    this.log('Emit wwp-cache-onCacheLoadSuccess');
4542    this.EventManager.trigger('wwp-cache-onCacheLoadSuccess', {
4543      res: res
4544    });
4545  },
4546
4547  onCacheLoadError: function (res) {
4548    this.EventManager.trigger('wwp-cache-onCacheLoadError', {
4549      res: res
4550    });
4551  },
4552
4553  onCacheNeedsRefresh: function (EventManager) {
4554    var self = this;
4555    EventManager.on('wwp-cache-onCacheNeedsRefresh', function () {
4556      self.log('wwp-cache-onCacheNeedsRefresh');
4557      sessionStorage.removeItem(self.storageKey);
4558      if (self._initialLoadDone) {
4559        self.loadCacheData();
4560      }
4561    });
4562  },
4563
4564  log: function (msg) {
4565    if (this.debug) {
4566      console.log('[Cache Component] ', msg);
4567    }
4568  }
4569
4570};
4571
4572new wonderwp.CachePluginComponent();
4573
4574/**
4575 * contact.js. Created by jeremydesvaux the 16 mai 2014
4576 */
4577
4578(function ($, ns) {
4579
4580    "use strict";
4581
4582    /**
4583     * init module scripts, relative to its context (multiple context of the same module may exist in a page)
4584     * @param context wraper div of the module
4585     */
4586    var contact = function (context) {
4587        this.$context = (context instanceof jQuery) ? context : $(context);
4588        this.init();
4589    };
4590
4591    contact.prototype = {
4592        init: function () {
4593            var t = this,
4594                $forms = this.$context.find('form.contactForm');
4595
4596            $forms.each(function (i, form) {
4597                t.registerFormSubmit($(form));
4598            });
4599            if ($forms.length > 1) {
4600                this.registerFormSwitcher($forms);
4601            }
4602        },
4603        registerFormSubmit: function ($form) {
4604            var t = this;
4605            $form.on('submit', function (e) {
4606                e.preventDefault();
4607                var $_form = $(this);
4608
4609                //check form validity
4610                if ($_form.valid && !$_form.valid()) {
4611                    return false;
4612                }
4613                if ($_form.hasClass('loading')) {
4614                    return false;
4615                }
4616
4617                var formData = new FormData(this);
4618                $_form.addClass('loading');
4619                $_form.find('[type="submit"]').prop("disabled", true);
4620
4621                $.ajax($.extend({
4622                    url: $_form.attr('action'),
4623                    data: formData,
4624                }, t.getAjaxParams()))
4625                    .done(function (data, textStatus, jqXHR) {
4626                        t.submitCallBack(data, $_form);
4627                    })
4628                    .fail(function (jqXHR, textStatus, errorThrown) {
4629                        t.submitCallBack({code: 500}, $_form);
4630                    })
4631                    .always(function () {
4632                        $_form.removeClass('loading');
4633                    });
4634            })
4635        },
4636        getAjaxParams: function () {
4637            return {
4638                type: 'POST',
4639                cache: false,
4640                contentType: false,
4641                processData: false
4642            };
4643        },
4644        submitCallBack: function (res, $form) {
4645            var t = this;
4646            if (res && res.code && res.code === 200) {
4647                t.onSubmitSuccess(res, $form);
4648                setTimeout(function () {
4649                    $form.find('[type="submit"]').prop('disabled', false);
4650                }, 5000);
4651            } else {
4652                t.onSubmitError(res, $form);
4653                $form.find('[type="submit"]').prop('disabled', false);
4654            }
4655        },
4656        onSubmitSuccess: function (res, $form) {
4657            var notifComponent = ns.app.getComponent('notification');
4658            notifComponent.show('success', res.data.msg, $form.parent());
4659            var topPos = $form.parent().find('.alert').offset().top;
4660            if (window.smoothScrollMargin) {
4661                topPos -= window.smoothScrollMargin;
4662            }
4663            $('html,body').animate({
4664                scrollTop: topPos
4665            }, 750);
4666            $form[0].reset();
4667        },
4668        onSubmitError: function (res, $form) {
4669
4670            var notifComponent = ns.app.getComponent('notification');
4671            var notifType      = res && res.code && res.code === 202 ? 'info' : 'error',
4672                notifMsg       = res && res.data && res.data.msg ? res.data.msg : 'Error';
4673            notifComponent.show(notifType, notifMsg, $form.parent());
4674
4675            var topPos = $form.parent().find('.alert').offset().top;
4676            if (window.smoothScrollMargin) {
4677                topPos -= window.smoothScrollMargin;
4678            }
4679
4680            $('html,body').animate({
4681                scrollTop: topPos
4682            }, 750);
4683        },
4684        registerFormSwitcher: function() {
4685            var $context           = this.$context;
4686            var pickerLabel        = 'Votre demande concerne';
4687            var pickerDefaultLabel = 'Choisissez un sujet';
4688
4689            if (window.wonderwp.i18n) {
4690
4691                if (window.wonderwp.i18n.contactPickerLabel) {
4692                    pickerLabel = window.wonderwp.i18n.contactPickerLabel;
4693                }
4694                if (window.wonderwp.i18n.themeContactPickerDefaultLabel) {
4695                    pickerDefaultLabel = window.wonderwp.i18n.themeContactPickerDefaultLabel;
4696                }
4697            }
4698
4699            var picker = '<select><option value="">' + pickerDefaultLabel + '</option>';
4700
4701            $context.find('.contactForm').each(function (index) {
4702                var $contactDomFrag = $(this).parent();
4703                $contactDomFrag.hide();
4704                var title = $(this).data('title');
4705                picker += '<option value="' + index + '">' + title + '</option>';
4706            });
4707            picker += '</select>';
4708            var $picker = $(picker);
4709
4710            var $pickerWrap = $('<div class="picker-wrap select-wrap"><label>' + pickerLabel + '</label><div class="select-style"></div></div>');
4711            $pickerWrap.find('.select-style').append($picker);
4712            $context.prepend($pickerWrap);
4713
4714            var select = $context.find('.picker-wrap.select-wrap .select-style select');
4715            if($ && $.fn && $.fn.selectric) {
4716                select.selectric();
4717            }
4718
4719            select.on('change', function () {
4720                var formIndex = $(this).val();
4721                $context.find('.contactForm').parent().hide();
4722                var $toShow = $context.find('.contactForm:eq(' + formIndex + ')');
4723
4724                $toShow.parent().show();
4725                var $toShowSelect = $toShow.find('select');
4726                if($ && $.fn && $.fn.selectric) {
4727                    $($toShowSelect[0]).selectric();
4728                }
4729            });
4730        }
4731    };
4732    if (ns && ns.app) {
4733        ns.app.registerModule('contact', contact);
4734    }
4735
4736})(jQuery, window.wonderwp);
4737
4738(function ($, ns) {
4739  "use strict";
4740
4741  var moduleEvent = function (context, opts) {
4742    this.$context = $(context);
4743
4744    var defaultOpts = {
4745      pushState: (ns.event && ns.event.opts && ns.event.opts.pushState !== undefined) ? ns.event.opts.pushState : true
4746    };
4747    opts = opts || {};
4748    this.opts = $.extend(defaultOpts, opts);
4749
4750    this.init();
4751  };
4752
4753  moduleEvent.prototype = {
4754    init: function () {
4755      var self = this;
4756
4757      self.registerEvents();
4758
4759      if (this.opts.pushState) {
4760        window.history && history.replaceState({
4761          'module': 'event',
4762          'href': window.location.href
4763        }, null, window.location.href);
4764        window.onpopstate = function (event) {
4765          if (event.state && event.state.module && event.state.module === 'event' && event.state.href) {
4766            self.loadPage(event.state.href);
4767          }
4768        }
4769      }
4770
4771      self.recomputeIndexes();
4772    },
4773    registerEvents: function () {
4774      this.registerPagination();
4775      this.registerSearch(true);
4776      this.registerReset();
4777    },
4778    recomputeIndexes: function () {
4779      jQuery('.module-wwp-event').each(function (i, instance) {
4780        $(instance).data('index', i);
4781      });
4782    },
4783    loadPage: function (href, sourceParam, cb) {
4784      var source = 'pagination';
4785
4786      if (!!sourceParam) {
4787        source = sourceParam;
4788      }
4789
4790      var self = this;
4791      self.$context.addClass('ajax-loading');
4792      $.get(href, {}, function (res) {
4793        self.$context.removeClass('ajax-loading');
4794        var index = self.$context.data('index');
4795        var $newContext = null;
4796        if (index) {
4797          $newContext = $($(res).find('.module-wwp-event')[index]);
4798          $newContext.data('index', index);
4799        } else {
4800          $newContext = $(res).find('.module-wwp-event').first();
4801        }
4802
4803        self.handleNewContext($newContext, href, source, cb);
4804      });
4805    },
4806    handleNewContext: function ($newContext, href, source, cb) {
4807      var self = this;
4808      var paginationMode = this.$context.data('pagination-mode');
4809
4810      if (paginationMode === 'append' && source === "pagination") {
4811        var $newItems = $newContext.find('.items-list > *');
4812        this.$context.find('.items-list')
4813          .append($newItems);
4814        this.$context.find('.pagination').replaceWith($newContext.find('.pagination'));
4815      } else {
4816        self.$context.replaceWith($newContext);
4817
4818        self.$context = $newContext;
4819
4820        var topPos = self.$context.offset().top;
4821        if (window.smoothScrollMargin) {
4822          topPos -= window.smoothScrollMargin;
4823        }
4824
4825        $('html,body').animate({
4826          scrollTop: topPos
4827        }, 750);
4828      }
4829
4830      self.registerEvents();
4831
4832      if (self.opts.pushState) {
4833        window.history && history.pushState({'module': 'event', 'href': href}, null, href);
4834      }
4835
4836      if (ns.theme && ns.theme.runCurrentPageJs) {
4837        ns.theme.runCurrentPageJs(self.$context);
4838      }
4839
4840      if (window.pew) {
4841        window.pew.enhanceRegistry(self.$context[0]);
4842      }
4843
4844      cb && cb(self.$context, paginationMode, source);
4845    },
4846    registerPagination: function () {
4847      var self = this;
4848
4849      this.$context.find('.pagination a.navlink').on('click', function (e) {
4850        e.preventDefault();
4851        $(this).replaceWith('<span class="loader loader--small"></span>')
4852        var cb = self.loadPageCallback.bind(self);
4853        self.loadPage($(this).attr('href'), 'pagination', cb);
4854      });
4855    },
4856    registerSearch: function (autoSubmit) {
4857      var self = this,
4858        $filtersForm = this.$context.find('form.event-filters');
4859
4860      $filtersForm.on('submit', function (e) {
4861        var $form = $(this);
4862        e.preventDefault();
4863        if (!self.$context.hasClass('ajax-loading')) {
4864          var cb = self.loadPageCallback.bind(self);
4865          self.loadPage($form.prop('action') + '?' + $form.serialize(), 'search', cb);
4866        }
4867      });
4868      if (autoSubmit) {
4869        $filtersForm.addClass('auto-submit');
4870
4871        const handleChange = function () {
4872          $(this).parent().addClass('currently-loading');
4873          $filtersForm.submit();
4874        }
4875
4876        const EventManager = window.EventManager || $(document);
4877
4878        EventManager.on('select-change', handleChange);
4879
4880        this.$context.find('.checkbox, input, select').not('.exclude').on('change', handleChange);
4881      }
4882    },
4883    loadPageCallback: function ($context, paginationMode, source) {
4884    },
4885    registerReset: function () {
4886      var self = this,
4887        $filtersForm = this.$context.find('.event-filters');
4888      $filtersForm.find('button[type="reset"]').on('click', function () {
4889        $filtersForm.find('select, input, textarea').val('');
4890        $filtersForm.submit();
4891      });
4892    }
4893  };
4894
4895  if (ns && ns.app) {
4896    ns.app.registerModule('wwp-event', moduleEvent);
4897  } else {
4898    window.pew.addRegistryEntry({key: 'wdf-plugin-event', domSelector: '.module-wwp-event', classDef: moduleEvent});
4899  }
4900
4901})(jQuery, window.wonderwp);
4902
4903/**
4904 * newsletter.js. Created by jeremydesvaux the 16 mai 2014
4905 */
4906(function ($, ns) {
4907
4908  "use strict";
4909
4910  /**
4911   * init module scripts, relative to its context (multiple context of the same module may exist in a page)
4912   * @param jQuery $context wraper div of the module
4913   */
4914  var newsletter = function (context) {
4915    this.$context = (context instanceof jQuery) ? context : $(context);
4916    this.init();
4917  };
4918
4919  newsletter.prototype = {
4920    init: function () {
4921      this.registerFormSubmit();
4922    },
4923    registerFormSubmit: function () {
4924      var t = this;
4925      var $form = t.$context.find('form.nlForm');
4926
4927      /**
4928       * Add no-ajax class to your newsletter form or form submit to disable ajax
4929      */
4930      if ($form.hasClass("no-ajax") || $form.find(":submit").hasClass("no-ajax")) {
4931          return false;
4932      }
4933
4934      $form.on('submit', function (e) {
4935        e.preventDefault();
4936
4937        //check form validity
4938        if ($form.valid && !$form.valid()) {
4939          return false;
4940        }
4941        if ($form.hasClass('loading')) {
4942          return false;
4943        }
4944
4945        $form.addClass('loading').find('input[type="submit"]').prop("disabled", true);
4946        t.removeNotifications();
4947
4948        t.submitForm($form);
4949      })
4950    },
4951
4952    submitForm: function ($form) {
4953      var t = this;
4954
4955      $.post($form.attr('action'), $form.serializeArray(), function (res) {
4956
4957        if (res && res.code && res.code === 200) {
4958          t.onFormSuccess(res, $form);
4959        } else {
4960          t.onFormError(res, $form)
4961        }
4962      })
4963        .fail(function (jqXHR, textStatus, errorThrown) {
4964          t.onFormError({code: 500, textStatus: textStatus, errorThrown: errorThrown}, $form)
4965        })
4966        .always(function (jqXHR, textStatus) {
4967          $form.removeClass('loading').find('input[type="submit"]').prop('disabled', false);
4968        });
4969    },
4970
4971    onFormSuccess: function (res, $form) {
4972      this.notify('success', res.data.msg, $form.parent());
4973      this.trackSubmitEvent($form, res);
4974      $form[0].reset();
4975    },
4976
4977    onFormError: function (res, $form) {
4978      var notifType = res && res.code && res.code === 202 ? 'info' : 'error',
4979        notifMsg = res && res.data && res.data.msg ? res.data.msg : 'Error';
4980      this.notify(notifType, notifMsg, $form.parent());
4981
4982      if (res && res.data && res.data.errors) {
4983        for (var i in res.data.errors) {
4984          var fieldName = i,
4985            fieldErrors = res.data.errors[i],
4986            $inputWrap = this.$context.find('.' + i + '-wrap');
4987
4988          if ($inputWrap.length) {
4989            var errorLabel = '<label class="error">';
4990            for (var j in fieldErrors) {
4991              errorLabel += fieldErrors[j];
4992            }
4993            errorLabel += '</label>';
4994
4995            var $existingLabel = $inputWrap.find('label.error');
4996            if ($existingLabel.length) {
4997              $existingLabel.replaceWith($(errorLabel));
4998            } else {
4999              $inputWrap.append($(errorLabel));
5000            }
5001          }
5002        }
5003      }
5004    },
5005
5006    notify: function (type, msg, $dest) {
5007      var EventManager = window.EventManager || $(document);
5008      EventManager.trigger('notification', {
5009        type: type,
5010        msg: msg,
5011        dest: $dest,
5012        focus: true
5013      });
5014    },
5015    removeNotifications: function () {
5016      var $alert = this.$context.find('.alert');
5017      if ($alert.length) {
5018        $alert.remove();
5019      }
5020    },
5021    trackSubmitEvent: function ($form, res) {
5022      var $listInputs = $form.find('input[name="list[]"]')
5023      var EventManager = window.EventManager || $(document);
5024
5025      $listInputs.each(function (i, listInput) {
5026        EventManager.trigger('Tracking.customEvent', {
5027          action: 'form_sent',
5028          category: 'newsletter',
5029          label: 'Inscription page : ' + window.location.pathname,
5030          value: listInput.value
5031        });
5032      });
5033    }
5034  };
5035
5036  if (ns && ns.app) {
5037    ns.app.registerModule('newsletter', newsletter);
5038  } else {
5039    window.pew.addRegistryEntry({
5040      key: 'wdf-plugin-newsletter',
5041      domSelector: '.module-newsletter',
5042      classDef: newsletter
5043    });
5044  }
5045
5046})(jQuery, window.wonderwp);
5047
5048(function ($, ns) {
5049
5050  "use strict";
5051
5052  /**
5053   * init module scripts, relative to its context (multiple context of the same module may exist in a page)
5054   * @param jQuery $context wraper div of the module
5055   */
5056  var ThemeNewsletter = function (context) {
5057    this.$context = (context instanceof jQuery) ? context : $(context);
5058    this.init();
5059  };
5060
5061  //var parentPrototype = window.pew.getRegistryEntry('wdf-plugin-newsletter').classDef.prototype;
5062  var parentPrototype = ns.app.getModule('newsletter').prototype;
5063  ThemeNewsletter.prototype = jQuery.extend({}, parentPrototype);
5064
5065  ThemeNewsletter.prototype.init = function () {
5066    parentPrototype.init.call(this);
5067    this.registerClose();
5068    this.registerShow();
5069    this.registerPostcodeAutocomplete();
5070  };
5071  ThemeNewsletter.prototype.registerShow = function () {
5072    var self = this;
5073    const $popinWrap = this.$context.parents('.newsletter-popin');
5074    if (!$popinWrap.length) {
5075      return;
5076    }
5077
5078    var cookieSet = this.checkIfCookieSet("newsletter_closed_popup");
5079    //console.log('Popin cookie set', cookieSet);
5080
5081    //If cookie set, do not show
5082    if (cookieSet) {
5083      return;
5084    }
5085
5086    //Then check if trackers set
5087    const trackersSet = this.checkIfCookieSet("enabled_trackers");
5088    //console.log('Trackers cookie set', trackersSet);
5089    if (!trackersSet) {
5090      //Wait for trackers
5091      this.waitForTrackers($popinWrap);
5092    } else {
5093      //Show now
5094      this.showPopin($popinWrap);
5095    }
5096
5097  };
5098  ThemeNewsletter.prototype.showPopin = function ($popinWrap) {
5099    //show popin
5100    $popinWrap.removeClass('closed');
5101    $('body').addClass('has-newsletter-popin');
5102
5103    //show overlay
5104    var $overlay = $popinWrap.next('.popin-overlay');
5105    if ($overlay.length) {
5106      $overlay.removeClass('closed');
5107    }
5108
5109    // Uncomment the content of nl-subsc-image
5110    var $imageDiv = $popinWrap.find('.nl-subsc-image');
5111    var commentedHtml = $imageDiv.html();
5112    var uncommentedHtml = commentedHtml.replace(/<!--/g, '').replace(/-->/g, '');
5113    $imageDiv.html(uncommentedHtml);
5114
5115    //Record view event
5116    setTimeout(() => {
5117      var EventManager = window.EventManager || $(document);
5118      const popinRef = $popinWrap.data('ref');
5119      EventManager.trigger('Tracking.customEvent', {
5120        action: 'popin_view',
5121        category: 'newsletter',
5122        label: 'Popin : ' + popinRef
5123      });
5124    }, 500);
5125  };
5126  ThemeNewsletter.prototype.waitForTrackers = function ($popinWrap) {
5127    //console.log('wait for trackers', $popinWrap);
5128    var EventManager = window.EventManager || $(document);
5129    EventManager.on('trackers.submit.success', () => {
5130      this.showPopin($popinWrap);
5131    });
5132  };
5133  ThemeNewsletter.prototype.registerClose = function () {
5134    var self = this;
5135    const $popinWrap = this.$context.parents('.newsletter-popin');
5136    if (!$popinWrap.length) {
5137      return;
5138    }
5139    const $closeBtn = $popinWrap.find('.nl-subsc-close');
5140    if (!$closeBtn.length) {
5141      return;
5142    }
5143
5144    $closeBtn.on('click', (e) => {
5145      self.closePopin($popinWrap, 30);
5146
5147      //register close event
5148      var EventManager = window.EventManager || $(document);
5149      var listInputs = $popinWrap.find('form input[name="list[]"]').val();
5150      const eventData = {
5151        action: 'form_closed',
5152        category: 'newsletter',
5153        label: 'Fermeture page : ' + window.location.pathname,
5154        value: listInputs
5155      };
5156      EventManager.trigger('Tracking.customEvent', eventData);
5157    });
5158
5159  }
5160
5161  ThemeNewsletter.prototype.closePopin = function ($popinWrap, exDays) {
5162    //remove popin
5163    $popinWrap.addClass('closed');
5164    $('body').removeClass('has-newsletter-popin');
5165
5166    //remove overlay
5167    const $overlay = $popinWrap.next('.popin-overlay');
5168    if ($overlay.length) {
5169      $overlay.addClass('closed');
5170    }
5171
5172    //Persist close
5173    this.setCookie("newsletter_closed_popup", 'true', exDays);
5174  }
5175
5176  ThemeNewsletter.prototype.setCookie = function (cname, cvalue, exdays) {
5177    var d = new Date();
5178    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
5179    var expires = "expires=" + d.toUTCString();
5180    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
5181  };
5182
5183  ThemeNewsletter.prototype.checkIfCookieSet = function (cname) {
5184    const cookieVal = this.getCookieVal(cname);
5185
5186    return (cookieVal && cookieVal.length > 0);
5187  };
5188
5189  ThemeNewsletter.prototype.getCookieVal = function (cname) {
5190    const name = cname + "=";
5191    const decodedCookie = decodeURIComponent(document.cookie);
5192    const ca = decodedCookie.split(';');
5193    for (let i = 0; i < ca.length; i++) {
5194      let c = ca[i];
5195      while (c.charAt(0) === ' ') {
5196        c = c.substring(1);
5197      }
5198      if (c.indexOf(name) === 0) {
5199        return c.substring(name.length, c.length);
5200      }
5201    }
5202    return "";
5203  }
5204
5205  ThemeNewsletter.prototype.onFormSuccess = function (res, $form) {
5206    parentPrototype.onFormSuccess.call(this, res, $form);
5207    const $popinWrap = $form.parents('.newsletter-popin');
5208    if ($popinWrap.length) {
5209      //send a custom event for this popup
5210      const popinRef = $popinWrap.data('ref');
5211      const eventData = {
5212        action: 'popin_success',
5213        category: 'newsletter',
5214        label: 'Popin : ' + popinRef
5215      };
5216      var EventManager = window.EventManager || $(document);
5217      EventManager.trigger('Tracking.customEvent', eventData);
5218
5219      setTimeout(() => {
5220        this.closePopin($popinWrap, 365);
5221      }, 2000);
5222    }
5223  }
5224
5225  ThemeNewsletter.prototype.registerPostcodeAutocomplete = function () {
5226    //Check if a postcode input is present
5227    var $postcodeLookupInput = this.$context.find('input[name="postcode_lookup"]');
5228    var $postcodeInput = this.$context.find('input[name="postcode"]');
5229    var $cityInput = this.$context.find('input[name="city"]');
5230    var $adminArea1Input = this.$context.find('input[name="admin_area_level_1"]');
5231    var $countryInput = this.$context.find('input[name="country"]');
5232
5233    if (!$postcodeLookupInput.length) {
5234      return;
5235    }
5236
5237    var self = this;
5238
5239    //Wait for the script to be loaded
5240    // Attach your callback function to the `window` object
5241    window.initPostcodeAutocomplete = function () {
5242      // JS API is loaded and available
5243      var input = $postcodeLookupInput[0];
5244
5245      const validityMessage = window.wonderwp
5246      && window.wonderwp.i18n
5247      && window.wonderwp.i18n['wwp-newsletter']
5248      && window.wonderwp.i18n['wwp-newsletter']['nl.postcode.validation']
5249        ? window.wonderwp.i18n['wwp-newsletter']['nl.postcode.validation']
5250        : "Please choose a valid address from the suggestions.";
5251      input.setCustomValidity(validityMessage);
5252      $postcodeLookupInput.on('input', function () {
5253        input.setCustomValidity('');
5254        if (input.value === '') {
5255          input.setCustomValidity(validityMessage);
5256          $(input).removeClass('valid');
5257        }
5258      })
5259        .on('blur', function () {
5260          if ($cityInput.val() === '') {
5261            input.setCustomValidity(validityMessage);
5262            $(input).removeClass('valid');
5263          }
5264        });
5265
5266      var locale = window.wonderwp.locale || null,
5267        langCode = locale ? locale.split('_')[0] : null,
5268        countryCode = locale ? locale.split('_')[1] : null;
5269
5270      var autocompleteOptions = {
5271        types: ['postal_code'],
5272        fields: ['name', 'address_components', 'geometry'] // Specify the fields to retrieve
5273      };
5274
5275      if (langCode) {
5276        autocompleteOptions.language = langCode;
5277      }
5278      if (countryCode) {
5279        if (countryCode === 'GB') {
5280          autocompleteOptions.componentRestrictions = {country: ['GB', 'UK', 'IE']};
5281        } else {
5282          autocompleteOptions.componentRestrictions = {country: countryCode.toLowerCase()};
5283        }
5284      }
5285
5286      //console.log(autocompleteOptions);
5287
5288      //Init the autocomplete
5289      var autocomplete = new google.maps.places.Autocomplete(input, autocompleteOptions);
5290
5291      google.maps.event.addListener(autocomplete, 'place_changed', function () {
5292        var place = autocomplete.getPlace();
5293
5294        if (!place.geometry) {
5295          alert("Place details not available for input: '" + place.name + "'");
5296          return;
5297        }
5298
5299        var postalCode = self.getPostalCode(place); // Extract postal code from place
5300        var city = self.getCity(place); // Extract city from place
5301        var adminArea1 = self.getAdminArea1(place); // Extract admin area 1 from place
5302        var country = self.getCountryCode(place); // Extract country from place
5303
5304        //console.log("City: " + city + ", Postal Code: " + postalCode + ", Admin Area 1: " + adminArea1 + ", Country: " + country);
5305
5306        //populate the fields
5307        $postcodeInput.val(postalCode);
5308        $cityInput.val(city);
5309        $adminArea1Input.val(adminArea1);
5310        $countryInput.val(country);
5311        $postcodeLookupInput[0].setCustomValidity('');
5312        $postcodeLookupInput.addClass('valid');
5313      });
5314    };
5315
5316  }
5317
5318  ThemeNewsletter.prototype.getPostalCode = function (place) {
5319    for (var i = 0; i < place.address_components.length; i++) {
5320      var addressType = place.address_components[i].types[0];
5321      if (addressType === 'postal_code') {
5322        return place.address_components[i].long_name;
5323      }
5324    }
5325    return 'N/A'; // If postal code is not available
5326  };
5327
5328  ThemeNewsletter.prototype.getCity = function (place) {
5329    for (var i = 0; i < place.address_components.length; i++) {
5330      var addressType = place.address_components[i].types[0];
5331      if (addressType === 'locality') {
5332        return place.address_components[i].long_name;
5333      }
5334      if (addressType === 'postal_town') {
5335        return place.address_components[i].long_name;
5336      }
5337    }
5338    return 'N/A'; // If city is not available
5339  };
5340
5341  ThemeNewsletter.prototype.getAdminArea1 = function (place) {
5342    for (var i = 0; i < place.address_components.length; i++) {
5343      var addressType = place.address_components[i].types[0];
5344      if (addressType === 'administrative_area_level_1') {
5345        return place.address_components[i].long_name;
5346      }
5347    }
5348    return 'N/A'; // If admin area 1 is not available
5349  };
5350
5351  ThemeNewsletter.prototype.getCountryCode = function (place) {
5352    for (var i = 0; i < place.address_components.length; i++) {
5353      var addressType = place.address_components[i].types[0];
5354      if (addressType === 'country') {
5355        return place.address_components[i].short_name;
5356      }
5357    }
5358    return 'N/A'; // If country is not available
5359  }
5360
5361
5362  ns.app.registerModule('newsletter', ThemeNewsletter);
5363
5364
5365})(jQuery, window.wonderwp);
5366
5367/**
5368 * rgpd.js. Created by jeremydesvaux the 16 mai 2014
5369 */
5370(function ($, ns) {
5371
5372  "use strict";
5373
5374  /**
5375   * init module scripts, relative to its context (multiple context of the same module may exist in a page)
5376   * @param context
5377   */
5378  var rgpd = function (context) {
5379    this.$context = (context instanceof jQuery) ? context : $(context);
5380    this.init();
5381  };
5382
5383  rgpd.prototype = {
5384    init: function () {
5385      if (this.$context.hasClass('consents-form-wrap')) {
5386        this.registerConsentForm();
5387      } else if (this.$context.hasClass('auth-form-wrap')) {
5388        this.registerAuthForm();
5389      }
5390    },
5391    registerConsentForm: function () {
5392      var cf = new ConsentForm(this.$context.find('> form'));
5393      cf.init();
5394    },
5395    registerAuthForm: function () {
5396      var af = new AuthForm(this.$context.find('.wwpform'));
5397      af.init();
5398    }
5399
5400  };
5401
5402  var ConsentForm = function ($form) {
5403    this.$form = $form;
5404  };
5405
5406  ConsentForm.prototype = {
5407    init: function () {
5408      this.registerSubmit();
5409    },
5410    registerSubmit: function () {
5411      var self = this;
5412      this.$form.find('.submit-trigger').on('click', function (e) {
5413        e.preventDefault();
5414        self.showConfirmation(false);
5415        self.scrollToTop();
5416      });
5417      this.$form.find('.submit-wrap .cancel').on('click', function (e) {
5418        e.preventDefault();
5419        self.showConfirmation(true);
5420        self.scrollToTop();
5421      });
5422      this.$form.on('submit', function (e) {
5423        setTimeout(function () {
5424          self.$form.removeClass('loading');
5425        }, 50);
5426      });
5427    },
5428    scrollToTop: function () {
5429      $('html,body').animate({
5430        scrollTop: 0
5431      }, 500);
5432    },
5433    showConfirmation: function (show) {
5434      var $consentsWrap = this.$form.find('.consents-wrap'),
5435        $confirmWrap = this.$form.find('.confirm-wrap'),
5436        $submitTrigger = this.$form.find('.submit-trigger'),
5437        $exportTrigger = this.$form.find('.export-btn')
5438      ;
5439      this.toggleConsents(show, $consentsWrap, $confirmWrap, $submitTrigger, $exportTrigger);
5440    },
5441    toggleConsents: function (showUncheckedConsents, $consentsWrap, $confirmWrap, $submitTrigger, $exportTrigger) {
5442      var self = this;
5443      if ($consentsWrap.length > 0) {
5444        $consentsWrap.each(function (i, cw) {
5445          var $cw = $(cw),
5446            $consents = $cw.find('.consent-item'),
5447            consentsLength = $consents.length,
5448            consentsChecked = 0;
5449
5450          if (consentsLength > 0) {
5451            $consents.each(function (i, c) {
5452              var $thisConsent = $(c);
5453              var $cb = $thisConsent.find('.checkbox');
5454              if (!$cb.is(':checked')) {
5455                if (showUncheckedConsents) {
5456                  $thisConsent.slideDown('slow');
5457                } else {
5458                  $thisConsent.slideUp('slow');
5459                }
5460              } else {
5461                consentsChecked++;
5462                if (!showUncheckedConsents) {
5463                  $thisConsent.find('.detail-consent').slideUp('slow');
5464                } else {
5465                  $thisConsent.find('.detail-consent').slideDown('slow');
5466                }
5467              }
5468            });
5469          }
5470          if (showUncheckedConsents) {
5471            $cw.fadeIn();
5472            $cw.find('.subtitle').show();
5473            $cw.find('.beforeDeleteWarning').hide();
5474          } else {
5475            if (consentsChecked === 0) {
5476              $cw.slideUp('slow');
5477            } else {
5478              $cw.slideDown('slow');
5479              $cw.find('.subtitle').hide();
5480              $cw.find('.beforeDeleteWarning').show();
5481            }
5482          }
5483        });
5484      }
5485
5486      if (showUncheckedConsents) {
5487        $submitTrigger.slideDown();
5488        $confirmWrap.slideUp();
5489        $exportTrigger.fadeIn();
5490      } else {
5491        $submitTrigger.slideUp();
5492        $confirmWrap.slideDown();
5493        $exportTrigger.fadeOut();
5494      }
5495
5496    }
5497  };
5498
5499  var AuthForm = function ($form) {
5500    this.$form = $form;
5501  };
5502
5503  AuthForm.prototype = {
5504    init: function () {
5505      this.registerSubmit();
5506    },
5507    registerSubmit: function () {
5508      var self = this;
5509      this.$form.on('submit', function (e) {
5510        e.preventDefault();
5511        self.handleSubmit(self.$form);
5512      });
5513    },
5514    handleSubmit: function ($form) {
5515      var t = this;
5516
5517      //check form validity
5518      if ($form.valid && !$form.valid()) {
5519        return false;
5520      }
5521      if ($form.hasClass('loading')) {
5522        return false;
5523      }
5524
5525      t.clearNotifications($form);
5526
5527      var formData = new FormData($form[0]);
5528      $form.addClass('loading');
5529      $form.find('[type="submit"]').prop("disabled", true);
5530
5531      $.ajax($.extend({
5532        url: $form.attr('action'),
5533        data: formData,
5534      }, t.getAjaxParams()))
5535        .done(function (data, textStatus, jqXHR) {
5536          t.submitCallBack(data, $form);
5537        })
5538        .fail(function (jqXHR, textStatus, errorThrown) {
5539          t.submitCallBack({code: 500}, $form);
5540        })
5541        .always(function () {
5542          $form.removeClass('loading');
5543        });
5544    },
5545    getAjaxParams: function () {
5546      return {
5547        type: 'POST',
5548        cache: false,
5549        contentType: false,
5550        processData: false
5551      };
5552    },
5553    submitCallBack: function (res, $form) {
5554      var t = this;
5555      if (res && res.code && res.code === 200) {
5556        t.onSubmitSuccess(res, $form);
5557        setTimeout(function () {
5558          $form.find('[type="submit"]').prop('disabled', false);
5559        }, 5000);
5560      } else {
5561        t.onSubmitError(res, $form);
5562        $form.find('[type="submit"]').prop('disabled', false);
5563      }
5564    },
5565    onSubmitSuccess: function (res, $form) {
5566      this.notify('success', res.message.translated, $form);
5567      $form[0].reset();
5568    },
5569    onSubmitError: function (res, $form) {
5570      var notifType = res && res.code && res.code === 202 ? 'info' : 'error',
5571        notifMsg = res && res.message && res.message.translated ? res.message.translated : 'Error';
5572      this.notify(notifType, notifMsg, $form);
5573    },
5574    notify: function (type, msg, $context) {
5575      var EventManager = window.EventManager || $(document);
5576      EventManager.trigger('notification', {
5577        type: type,
5578        msg: msg,
5579        dest: $context,
5580        focus: true
5581      });
5582    },
5583    clearNotifications: function($dest) {
5584      var $alerts = $dest.find('.alert');
5585      if ($alerts.length) {
5586        $alerts.fadeOut(400, function () {
5587          $(this).remove();
5588        });
5589      }
5590    }
5591  };
5592
5593  if (ns && ns.app) {
5594    ns.app.registerModule('rgpd', rgpd);
5595  } else {
5596    window.pew.addRegistryEntry({key: 'wdf-plugin-rgpd', domSelector: '.module-rgpd', classDef: rgpd});
5597  }
5598
5599})(jQuery, window.wonderwp);
5600
5601(function ($, ns) {
5602
5603  var TrackerComponent = function ($context) {
5604    this.element = $context;
5605    this.init();
5606  };
5607
5608  TrackerComponent.prototype = {
5609
5610    init: function () {
5611      this.EventManager = window.EventManager || $(document);
5612      this.debug = (ns && ns.trackers && ns.trackers.opts && ns.trackers.opts.debug) ? ns.trackers.opts.debug : false;
5613
5614      if (this.element.hasClass('has-form')) {
5615        this.registerDeny();
5616        this.registerMoreOptionsToggler();
5617        this.registerFormSubmit();
5618      }
5619      if (this.element.hasClass('has-reopener')) {
5620        this.registerManagerReopener();
5621      }
5622
5623      var cacheEnabled = this.element.data('cache-enabled');
5624      if (cacheEnabled) {
5625        if (this.checkIfCookieSet()) {
5626          this.asyncLoadTrackers();
5627        } else {
5628          this.EventManager.trigger('wwp-cache-onCacheNeedsRefresh', {});
5629          this.asyncLoadFormFromCache();
5630        }
5631      } else {
5632        this.reveal();
5633      }
5634    },
5635
5636    reveal: function () {
5637      var t = this;
5638      setTimeout(function () {
5639        t.element.removeClass('loading');
5640      }, 1000);
5641    },
5642
5643    registerMoreOptionsToggler: function () {
5644      var t = this;
5645      this.element.find('.btn-more-options').on('click', function (e) {
5646        e.preventDefault();
5647        t.element.find('.checkbox').prop('checked', false);
5648        t.element.find('.trackers-list').slideDown();
5649        $(e.currentTarget).fadeOut();
5650      });
5651    },
5652
5653    registerFormSubmit: function () {
5654      var t = this;
5655      this.element.find('form').on('submit', function (e) {
5656        e.preventDefault($(e.currentTarget));
5657        t.submitForm($(e.currentTarget));
5658      });
5659    },
5660
5661    submitForm: function ($form) {
5662      var t = this;
5663      t.removeNotifications();
5664
5665      var formData = $form.serializeArray();
5666
5667      $form.addClass('loading').find('input,button').prop('disabled', true);
5668      $.post($form.attr('action'), formData, function (res) {
5669        if (res && res.code && res.code == 200) {
5670          t.onSuccess(res, $form);
5671        } else {
5672          t.onError(res, $form);
5673        }
5674        $form.removeClass('loading').find('input,button').prop('disabled', false);
5675      });
5676    },
5677
5678    onSuccess: function (res, $form) {
5679      var t = this;
5680      t.notify('success', res.data.msg, this.element);
5681      t.insertTrackers(res.data.enabledTrackingCode);
5682
5683      if (!$('body').hasClass('page-vos-donnees-personnelles')) {
5684        t.element.find('.trackers-cookie-container').slideUp();
5685        setTimeout(function () {
5686          if (t.element.hasClass('has-reopener')) {
5687            t.showReopener();
5688          } else {
5689            t.element.fadeOut(400, function () {
5690              t.element.remove();
5691            });
5692          }
5693        }, 2000);
5694      }
5695
5696    },
5697
5698    onError: function (res, $form) {
5699      this.notify('error', res.data.msg || 'Error', this.element);
5700    },
5701
5702    notify: function (type, msg, $context) {
5703      var EventManager = window.EventManager || $(document);
5704      EventManager.trigger('notification', {
5705        type: type,
5706        msg: msg,
5707        dest: $context,
5708        focus: false
5709      });
5710    },
5711
5712    insertTrackers: function (enabledTrackingCodes) {
5713      var $head = $('head');
5714      var trackingCodeMarkup = "<!-- [wwp-tracker] -->\n";
5715      for (var i in enabledTrackingCodes) {
5716        trackingCodeMarkup += this.stripslashes(enabledTrackingCodes[i]);
5717      }
5718      trackingCodeMarkup += '<!-- [/wwp-tracker] -->';
5719      $head.append(trackingCodeMarkup);
5720    },
5721
5722    stripslashes: function (str) {
5723      return (str + '').replace(/\\(.?)/g, function (s, n1) {
5724        switch (n1) {
5725          case '\\':
5726            return '\\';
5727          case '0':
5728            return '\u0000';
5729          case '':
5730            return '';
5731          default:
5732            return n1;
5733        }
5734      });
5735    },
5736
5737    removeNotifications: function () {
5738      var $alert = this.element.find('.alert');
5739      if ($alert.length) {
5740        $alert.remove();
5741      }
5742    },
5743
5744    registerDeny: function () {
5745      var t = this;
5746      this.element.find('.btn-deny').on('click', function (e) {
5747        e.preventDefault();
5748        t.element.find('.checkbox').prop('checked', false);
5749        t.submitForm(t.element.find('form'));
5750      });
5751    },
5752
5753    registerManagerReopener: function () {
5754      var t = this;
5755
5756      // Prevent double-binding if we inject the form dynamically.
5757      if (t._managerReopenerRegistered) return;
5758      t._managerReopenerRegistered = true;
5759
5760      this.element.find('.manager-reopener').on('click', function (e) {
5761        e.preventDefault();
5762
5763        var $formWrap = t.element.find('.trackers-cookie-container');
5764        if ($formWrap.length) {
5765          // The form is already here: just show it again.
5766          t.element.find('.manager-reopener').fadeOut(300, function () {
5767            t.element.addClass('has-form');
5768            $formWrap.fadeIn();
5769          });
5770        } else {
5771          // The form isn't there yet: fetch it then inject into the DOM.
5772          t.element.addClass('loading').find('input,button').prop('disabled', true);
5773          $.get('/trackers/get_form', {}, function (res) {
5774            if (res && res.code && res.code == 200) {
5775              t.injectForm(res.data['content']);
5776            } else {
5777              t.finishLoading();
5778            }
5779          });
5780        }
5781      });
5782    },
5783
5784    showReopener: function () {
5785      var t = this;
5786      var $alert = t.element.find('.alert');
5787
5788      // If the notification alert does not exist, just show the reopener button.
5789      if (!$alert.length) {
5790        t.element.find('.manager-reopener').fadeIn(300, function () {
5791          t.element.removeClass('has-form');
5792        }).prop('disabled', false);
5793        return;
5794      }
5795
5796      $alert.slideUp(400, function () {
5797        t.element.find('.manager-reopener').fadeIn(300, function () {
5798          t.element.removeClass('has-form');
5799        }).prop('disabled', false);
5800        $alert.remove();
5801      });
5802    },
5803
5804    injectForm: function (formMarkup) {
5805      var t = this;
5806      formMarkup = this.stripslashes(formMarkup);
5807
5808      var $form = $(formMarkup).find('.trackers-cookie-container');
5809      if ($form.length) {
5810        t.element.append($form);
5811      }
5812
5813      t.element.removeClass('no-form').addClass('has-form');
5814      t.registerDeny();
5815      t.registerMoreOptionsToggler();
5816      t.registerFormSubmit();
5817      t.registerManagerReopener();
5818      t.finishLoading();
5819    },
5820
5821    finishLoading: function () {
5822      this.element.removeClass('loading');
5823    },
5824
5825    checkIfCookieSet: function () {
5826      var cookieVal = this.getCookieVal('enabled_trackers');
5827      return !!(cookieVal && cookieVal.length > 0);
5828    },
5829
5830    getCookieVal: function (cname) {
5831      var name = cname + '=';
5832      var decodedCookie = decodeURIComponent(document.cookie);
5833      var ca = decodedCookie.split(';');
5834      for (var i = 0; i < ca.length; i++) {
5835        var c = ca[i];
5836        while (c.charAt(0) === ' ') {
5837          c = c.substring(1);
5838        }
5839        if (c.indexOf(name) === 0) {
5840          return c.substring(name.length, c.length);
5841        }
5842      }
5843      return '';
5844    },
5845
5846    asyncLoadTrackers: function () {
5847      var t = this;
5848      t.log('listen for onCacheLoadSuccess (trackers)');
5849      t.EventManager.on('wwp-cache-onCacheLoadSuccess', function (event, eventData) {
5850        t.log('on CacheLoadSuccess : loading trackers');
5851        var res = eventData.res;
5852        if (res && res.data && res.data['wwp-tracker'] && res.data['wwp-tracker']['trackers']) {
5853          var trackersToInsert = [];
5854          var siteUrl = window.location.protocol + '//' + window.location.host;
5855          for (var i in res.data['wwp-tracker']['trackers']) {
5856            var trackerData = res.data['wwp-tracker']['trackers'][i];
5857            if (TrackerComponent.isTrackerAllowedInPage(trackerData, window.location.href, siteUrl)) {
5858              t.log('Tracker is allowed in page', trackerData, window.location.href);
5859              trackersToInsert.push(trackerData.code);
5860            }
5861          }
5862          if (trackersToInsert.length) {
5863            t.insertTrackers(trackersToInsert);
5864          }
5865        }
5866        t.finishLoading();
5867      });
5868    },
5869
5870    asyncLoadFormFromCache: function () {
5871      var t = this;
5872
5873      var tryInjectForm = function (res) {
5874        if (res && res.data && res.data['wwp-tracker'] && res.data['wwp-tracker']['form']) {
5875          t.log('on CacheLoadSuccess : loading form');
5876          t.injectForm(res.data['wwp-tracker']['form']);
5877        }
5878      };
5879
5880      try {
5881        var cached = sessionStorage.getItem('wwp-cache');
5882        if (cached) {
5883          tryInjectForm(JSON.parse(cached));
5884          return;
5885        }
5886      } catch (e) {}
5887
5888      t.log('listen for onCacheLoadSuccess (form)');
5889      t.EventManager.on('wwp-cache-onCacheLoadSuccess', function (event, eventData) {
5890        tryInjectForm(eventData.res);
5891      });
5892    },
5893
5894    log: function (msg) {
5895      if (this.debug) {
5896        console.log('[wwp-tracker] ', msg);
5897      }
5898    }
5899
5900  };
5901
5902  TrackerComponent.isTrackerAllowedInPage = function (trackerData, url, siteUrl) {
5903    if (trackerData && trackerData.urls && trackerData.urls.length > 0) {
5904      var allowedUrls = trackerData.urls;
5905      for (var j in allowedUrls) {
5906        var pattern = allowedUrls[j];
5907        pattern = '' + pattern.trim().replace(siteUrl, '').replace('/', '\\/') + '';
5908        var regex = new RegExp(pattern);
5909        if (regex.test(url)) {
5910          return true;
5911        }
5912      }
5913      return false;
5914    }
5915    return true;
5916  };
5917
5918  if (ns && ns.app) {
5919    ns.app.registerModule('tracker', TrackerComponent);
5920  }
5921
5922})(jQuery, window.wonderwp);
5923
5924wonderwp.HorairesOpeningComponent = function () {
5925  this.debug = false;
5926  this.openingData = null;
5927  this.serverOffset = 0;
5928  this.timerId = null;
5929  this.EventManager = window.EventManager || jQuery(document);
5930  this.init();
5931};
5932
5933wonderwp.HorairesOpeningComponent.prototype = {
5934
5935  init: function () {
5936    if (!wonderwp.cache_enabled) {
5937      return;
5938    }
5939    this.bindCacheEvents();
5940    var self = this;
5941    jQuery(function () {
5942      self.tryLoadFromSessionStorage();
5943    });
5944  },
5945
5946  bindCacheEvents: function () {
5947    var self = this;
5948    self.EventManager.on('wwp-cache-onCacheLoadSuccess', function (event, eventData) {
5949      self.onCacheLoadSuccess(eventData.res);
5950    });
5951  },
5952
5953  tryLoadFromSessionStorage: function () {
5954    try {
5955      var cached = sessionStorage.getItem('wwp-cache');
5956      if (cached) {
5957        this.onCacheLoadSuccess(JSON.parse(cached));
5958      }
5959    } catch (e) {}
5960  },
5961
5962  onCacheLoadSuccess: function (res) {
5963    if (this._cacheHandled) {
5964      return;
5965    }
5966    if (!res || !res.data || !res.data['sqm-horaires']) {
5967      return;
5968    }
5969    this._cacheHandled = true;
5970    var horairesPayload = res.data['sqm-horaires'];
5971    var self = this;
5972    jQuery(function () {
5973      if (horairesPayload.markup) {
5974        self.injectMarkup(horairesPayload.markup);
5975      }
5976      if (horairesPayload.openingData) {
5977        self.setOpeningData(horairesPayload.openingData);
5978      }
5979    });
5980  },
5981
5982  setOpeningData: function (openingData) {
5983    this.openingData = openingData;
5984    this.serverOffset = openingData.serverTime ? (Math.floor(Date.now() / 1000) - openingData.serverTime) : 0;
5985    this.scheduleNextTransition();
5986  },
5987
5988  getNow: function () {
5989    return Math.floor(Date.now() / 1000) - this.serverOffset;
5990  },
5991
5992  injectMarkup: function (markup) {
5993    markup = this.stripslashes(markup);
5994    var $markup = jQuery(markup.trim());
5995    if (!$markup.length) {
5996      return;
5997    }
5998    $markup.attr('data-cache-enabled', '1');
5999    jQuery('.count-down-wrap[data-cache-enabled="1"]').each(function (i, el) {
6000      jQuery(el).replaceWith($markup.clone());
6001    });
6002    this.reveal();
6003  },
6004
6005  updateAllFromCountDown: function (countDown) {
6006    var markup = this.buildMarkup(countDown);
6007    var $markup = jQuery(markup.trim());
6008    $markup.attr('data-cache-enabled', '1');
6009    jQuery('.count-down-wrap[data-cache-enabled="1"]').each(function (i, el) {
6010      jQuery(el).replaceWith($markup.clone());
6011    });
6012    this.reveal();
6013  },
6014
6015  reveal: function () {
6016    jQuery('.count-down-wrap[data-cache-enabled="1"]').removeClass('loading is-hidden');
6017  },
6018
6019  scheduleNextTransition: function () {
6020    var self = this;
6021    if (self.timerId) {
6022      clearTimeout(self.timerId);
6023      self.timerId = null;
6024    }
6025    if (!self.openingData || !self.openingData.openings) {
6026      return;
6027    }
6028    var countDown = self.openingData.countDown;
6029    if (!countDown || !countDown.nextStateTime) {
6030      return;
6031    }
6032    var delayMs = (countDown.nextStateTime - self.getNow()) * 1000;
6033    if (delayMs <= 0) {
6034      self.refreshFromClient();
6035      return;
6036    }
6037    self.timerId = setTimeout(function () {
6038      self.refreshFromClient();
6039    }, delayMs + 500);
6040  },
6041
6042  refreshFromClient: function () {
6043    if (!this.openingData || !this.openingData.openings) {
6044      return;
6045    }
6046    var now = this.getNow();
6047    var watchResult = this.openingWatch(this.openingData.openings, now);
6048    var countDown = {
6049      thisTime: now,
6050      thisTimeDate: this.formatDateTime(now),
6051      currentState: watchResult.state,
6052      nextState: watchResult.nextState,
6053      nextStateTime: watchResult.nextStateTime,
6054      countDown: this.countDownToNextState(watchResult.nextState, watchResult.nextStateTime, now),
6055      thisMonthOpenings: watchResult.thisMonthOpenings
6056    };
6057    this.openingData.countDown = countDown;
6058    this.updateAllFromCountDown(countDown);
6059    this.scheduleNextTransition();
6060  },
6061
6062  openingWatch: function (completeOpenings, thisTime) {
6063    var thisMonth = parseInt(this.formatMonth(thisTime), 10);
6064    var thisMonthOpenings = completeOpenings[thisMonth];
6065    var opensTodayAt = this.parseDateTime(this.formatDate(thisTime) + ' ' + thisMonthOpenings.o);
6066    var closesTodayAt = this.parseDateTime(this.formatDate(thisTime) + ' ' + thisMonthOpenings.f);
6067    var exceptionStartsAt = null;
6068    var exceptionEndsAt = null;
6069    var state = null;
6070    var nextState = null;
6071    var nextStateTime = null;
6072
6073    if (completeOpenings.exception && completeOpenings.exception.o && completeOpenings.exception.f) {
6074      exceptionStartsAt = this.parseDateTime(completeOpenings.exception.o + ' 00:00:00');
6075      exceptionEndsAt = this.parseDateTime(completeOpenings.exception.f + ' 04:00:00');
6076    }
6077
6078    if (exceptionStartsAt && exceptionEndsAt && thisTime >= exceptionStartsAt && thisTime <= exceptionEndsAt) {
6079      state = 'closed_exception';
6080      nextState = 'opened';
6081      nextStateTime = exceptionEndsAt;
6082    } else if (this.formatDayMonth(thisTime) === '25-12') {
6083      var dayAfter = this.opensDayAfter(completeOpenings, thisTime);
6084      state = dayAfter.state;
6085      nextState = dayAfter.nextState;
6086      nextStateTime = dayAfter.nextStateTime;
6087      thisMonthOpenings = dayAfter.thisMonthOpenings;
6088    } else if (thisTime < opensTodayAt) {
6089      state = 'closed';
6090      nextState = 'opened';
6091      nextStateTime = opensTodayAt;
6092    } else if (thisTime >= opensTodayAt && thisTime <= closesTodayAt) {
6093      state = 'opened';
6094      nextState = 'closed';
6095      nextStateTime = closesTodayAt;
6096    } else if (thisTime > closesTodayAt) {
6097      var thisTimeCopy = thisTime;
6098      if (this.formatDayMonth(thisTime) === '31-12') {
6099        state = 'closed';
6100        nextState = 'opened';
6101        nextStateTime = this.parseDateTime((this.formatYear(thisTime) + 1) + '-01-01 12:30:00');
6102        thisMonth = 1;
6103        thisMonthOpenings = completeOpenings[thisMonth];
6104      } else {
6105        if (this.formatDayMonth(thisTime) === '24-12') {
6106          thisTimeCopy = this.addDays(thisTime, 1);
6107        }
6108        var opensAfter = this.opensDayAfter(completeOpenings, thisTimeCopy);
6109        state = opensAfter.state;
6110        nextState = opensAfter.nextState;
6111        nextStateTime = opensAfter.nextStateTime;
6112        thisMonthOpenings = opensAfter.thisMonthOpenings;
6113      }
6114    }
6115
6116    return {
6117      state: state,
6118      nextState: nextState,
6119      nextStateTime: nextStateTime,
6120      thisMonthOpenings: thisMonthOpenings
6121    };
6122  },
6123
6124  opensDayAfter: function (completeOpenings, thisTime) {
6125    var tomorrowTime = this.addDays(thisTime, 1);
6126    var tomorrowMonth = parseInt(this.formatMonth(tomorrowTime), 10);
6127    var tomorrowMonthOpenings = completeOpenings[tomorrowMonth];
6128    var opensDayAfterAt = this.parseDateTime(this.formatDate(tomorrowTime) + ' ' + tomorrowMonthOpenings.o);
6129
6130    return {
6131      state: 'closed',
6132      nextState: 'opened',
6133      nextStateTime: opensDayAfterAt,
6134      thisMonthOpenings: tomorrowMonthOpenings
6135    };
6136  },
6137
6138  countDownToNextState: function (nextState, nextStateTime, thisTime) {
6139    if (!nextState || !nextStateTime) {
6140      return false;
6141    }
6142    var remainSeconds = nextStateTime - thisTime;
6143    if (remainSeconds < 0) {
6144      remainSeconds = 0;
6145    }
6146    var days = Math.floor(remainSeconds / 86400);
6147    remainSeconds -= days * 86400;
6148    var hours = Math.floor(remainSeconds / 3600);
6149    remainSeconds -= hours * 3600;
6150    var minutes = Math.floor(remainSeconds / 60);
6151
6152    return {
6153      days: days,
6154      hours: hours,
6155      minutes: minutes
6156    };
6157  },
6158
6159  buildMarkup: function (countDown) {
6160    var i18n = (this.openingData && this.openingData.i18n) ? this.openingData.i18n : {};
6161    var state = countDown.currentState;
6162    if (state === 'closed_exception') {
6163      state = 'closed';
6164    }
6165    var mk = '<div class="count-down-wrap">';
6166    mk += '<span class="current-state current-state-' + state + '">' + (i18n[state + '.state'] || state) + '</span>';
6167
6168    if (countDown && countDown.nextState) {
6169      mk += '<div class="next-state-wrap">';
6170      var showClosingCountDown = (
6171        countDown.countDown
6172        && state === 'closed'
6173        && countDown.countDown.days === 0
6174        && countDown.countDown.hours <= 2
6175      );
6176      var showOpeningDate = (
6177        (countDown.countDown && state === 'opened' && countDown.countDown.days > 1)
6178        || countDown.currentState === 'closed_exception'
6179      );
6180
6181      if (showClosingCountDown) {
6182        mk += '<span class="next-state">' + (i18n[countDown.nextState + '.noun'] || countDown.nextState) + '</span>';
6183        mk += '<span class="next-state-time"><span class="next-state-in">' + (i18n.in || 'in') + '</span>';
6184        for (var unit in countDown.countDown) {
6185          if (countDown.countDown.hasOwnProperty(unit) && countDown.countDown[unit]) {
6186            mk += ' <span>' + countDown.countDown[unit] + ' ' + (i18n[unit + '.unit'] || unit) + '</span>';
6187          }
6188        }
6189        mk += '</span>';
6190      }
6191
6192      if (showOpeningDate) {
6193        mk += '<span class="next-state">' + (i18n[countDown.nextState + '.noun'] || countDown.nextState) + '</span>';
6194        mk += '<span class="next-state-in">' + (i18n.on || 'on') + '</span>';
6195        mk += ' <span>' + this.formatOpeningDate(countDown.nextStateTime) + '</span>';
6196      }
6197
6198      var showHoraires = (
6199        !showClosingCountDown
6200        && !showOpeningDate
6201        && countDown.thisMonthOpenings
6202        && countDown.thisMonthOpenings.o
6203        && countDown.thisMonthOpenings.f
6204      );
6205      if (showHoraires) {
6206        mk += ' <span class="horaires">' + countDown.thisMonthOpenings.o + ' - ' + countDown.thisMonthOpenings.f + '</span>';
6207      }
6208
6209      mk += '</div>';
6210    }
6211
6212    mk += '</div>';
6213    return mk;
6214  },
6215
6216  formatOpeningDate: function (timestamp) {
6217    var d = new Date(timestamp * 1000);
6218    return d.toLocaleDateString('fr-FR', { day: 'numeric', month: 'long' });
6219  },
6220
6221  formatDate: function (timestamp) {
6222    var d = new Date(timestamp * 1000);
6223    var month = ('0' + (d.getMonth() + 1)).slice(-2);
6224    var day = ('0' + d.getDate()).slice(-2);
6225    return d.getFullYear() + '-' + month + '-' + day;
6226  },
6227
6228  formatDateTime: function (timestamp) {
6229    var d = new Date(timestamp * 1000);
6230    var month = ('0' + (d.getMonth() + 1)).slice(-2);
6231    var day = ('0' + d.getDate()).slice(-2);
6232    var hours = ('0' + d.getHours()).slice(-2);
6233    var minutes = ('0' + d.getMinutes()).slice(-2);
6234    var seconds = ('0' + d.getSeconds()).slice(-2);
6235    return day + '/' + month + '/' + d.getFullYear().toString().slice(-2) + ' ' + hours + ':' + minutes + ':' + seconds;
6236  },
6237
6238  formatMonth: function (timestamp) {
6239    return String(new Date(timestamp * 1000).getMonth() + 1);
6240  },
6241
6242  formatDayMonth: function (timestamp) {
6243    var d = new Date(timestamp * 1000);
6244    var day = ('0' + d.getDate()).slice(-2);
6245    var month = ('0' + (d.getMonth() + 1)).slice(-2);
6246    return day + '-' + month;
6247  },
6248
6249  formatYear: function (timestamp) {
6250    return new Date(timestamp * 1000).getFullYear();
6251  },
6252
6253  parseDateTime: function (dateTimeStr) {
6254    var normalized = dateTimeStr.replace(' ', 'T');
6255    return Math.floor(new Date(normalized).getTime() / 1000);
6256  },
6257
6258  addDays: function (timestamp, days) {
6259    var d = new Date(timestamp * 1000);
6260    d.setDate(d.getDate() + days);
6261    return Math.floor(d.getTime() / 1000);
6262  },
6263
6264  stripslashes: function (str) {
6265    return (str + '').replace(/\\(.?)/g, function (s, n1) {
6266      switch (n1) {
6267        case '\\':
6268          return '\\';
6269        case '0':
6270          return '\u0000';
6271        case '':
6272          return '';
6273        default:
6274          return n1;
6275      }
6276    });
6277  },
6278
6279  log: function (msg) {
6280    if (this.debug) {
6281      console.log('[sqm-horaires] ', msg);
6282    }
6283  }
6284
6285};
6286
6287new wonderwp.HorairesOpeningComponent();
6288
6289/*!
6290 * GSAP 3.14.2
6291 * https://gsap.com
6292 * 
6293 * @license Copyright 2025, GreenSock. All rights reserved.
6294 * Subject to the terms at https://gsap.com/standard-license.
6295 * @author: Jack Doyle, [email protected]
6296 */
6297
6298!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["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 r(t){return"string"==typeof t}function s(t){return"function"==typeof t}function t(t){return"number"==typeof t}function u(t){return void 0===t}function v(t){return"object"==typeof t}function w(t){return!1!==t}function x(){return"undefined"!=typeof window}function y(t){return s(t)||r(t)}function R(t){return(i=bt(t,ht))&&Fe}function S(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function T(t,e){return!e&&console.warn(t)}function U(t,e){return t&&(ht[t]=e)&&i&&(i[t]=e)||ht}function V(){return 0}function ga(t){var e,r,i=t[0];if(v(i)||s(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=yt.length;r--&&!yt[r].targetTest(i););e=yt[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Xt(t[r],e)))||t.splice(r,1);return t}function ha(t){return t._gsap||ga(Pt(t))[0]._gsap}function ia(t,e,r){return(r=t[e])&&s(r)?t[e]():u(r)&&t.getAttribute&&t.getAttribute(e)||r}
vendor: 15,582 bytes, line 6298
6298function ja(t,e){return(t=t.split(",")).forEach(e)||t}function ka(t){return Math.round(1e5*t)/1e5||0}function la(t){return Math.round(1e7*t)/1e7||0}function ma(t,e){var r=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+i:"-"===r?t-i:"*"===r?t*i:t/i}function na(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r}function oa(){var t,e,r=pt.length,i=pt.slice(0);for(_t={},t=pt.length=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)}function pa(t){return!!(t._initted||t._startAt||t.add)}function qa(t,e,r,i){pt.length&&!I&&oa(),t.render(e,r,i||!!(I&&e<0&&pa(t))),pt.length&&!I&&oa()}function ra(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(ot).length<2?e:r(t)?t.trim():t}function sa(t){return t}function ta(t,e){for(var r in e)r in t||(t[r]=e[r]);return t}function wa(t,e){for(var r in e)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=v(e[r])?wa(t[r]||(t[r]={}),e[r]):e[r]);return t}function xa(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i}function ya(t){var e=t.parent||L,r=t.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])}}($(t.keyframes)):ta;if(w(t.inherit))for(;e;)r(t,e.vars.defaults),e=e.parent||e._dp;return t}function Aa(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;return 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,e}function Ba(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 Ca(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0}function Da(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 Fa(t,e,r,i){return t._startAt&&(I?t._startAt.revert(ft):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))}function Ha(t){return t._repeat?wt(t._tTime,t=t.duration()+t._rDelay)*t:0}function Ja(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function Ka(t){return t._end=la(t._start+(t._tDur/Math.abs(t._ts||t._rts||q)||0))}function La(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=la(r._time-(0<t._ts?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ka(t),r._dirty||Da(r,t)),t}function Ma(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Ja(t.rawTime(),e),(!e._dur||Mt(0,e.totalDuration(),r)-e._tTime>q)&&e.render(r,!0)),Da(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=-q}}function Na(e,r,i,n){return r.parent&&Ca(r),r._start=la((t(i)?i:i||e!==L?Ot(e,i,r):e._time)+r._delay),r._end=la(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),Aa(e,r,"_first","_last",e._sort?"_start":0),xt(r)||(e._recent=r),n||Ma(e,r),e._ts<0&&La(e,e._tTime),e}function Oa(t,e){return(ht.ScrollTrigger||S("scrollTrigger",e))&&ht.ScrollTrigger.create(e,t)}function Pa(t,e,r,i,n){return Qt(t,e,n),t._initted?!r&&t._pt&&!I&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==It.frame?(pt.push(t),t._lazy=[n,i],1):void 0:1}function Ua(t,e,r,i){var n=t._repeat,a=la(e)||0,s=t._tTime/t._tDur;return s&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:la(a*(n+1)+t._rDelay*n):a,0<s&&!i&&La(t,t._tTime=t._tDur*s),t.parent&&Ka(t),r||Da(t.parent,t),t}function Va(t){return t instanceof Zt?Da(t):Ua(t,t._dur)}function Ya(e,r,i){var n,a,s=t(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=w(a.vars.inherit)&&a.parent;u.immediateRender=w(n.immediateRender),e<2?u.runBackwards=1:u.startAt=r[o-1]}return new te(r[0],u,r[1+o])}function Za(t,e){return t||0===t?e(t):e}function _a(t,e){return r(t)&&(e=ut.exec(t))?e[1]:""}function cb(t,e){return t&&v(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&v(t[0]))&&!t.nodeType&&t!==h}function fb(r){return r=Pt(r)[0]||T("Invalid scope")||{},function(t){var e=r.current||r.nativeElement||r;return Pt(t,e.querySelectorAll?e:e===r?T("Invalid scope")||a.createElement("div"):r)}}function gb(t){return t.sort(function(){return.5-Math.random()})}function hb(t){if(s(t))return t;var p=v(t)?t:{each:t},_=Vt(p.ease),m=p.from||0,g=parseFloat(p.base)||0,y={},e=0<m&&m<1,T=isNaN(m)||e,b=p.axis,w=m,x=m;return r(m)?w=x={center:.5,edges:.5,end:1}[m]||0:!e&&T&&(w=m[0],x=m[1]),function(t,e,r){var i,n,a,s,o,u,h,l,f,d=(r||p).length,c=y[d];if(!c){if(!(f="auto"===p.grid?0:(p.grid||[1,X])[1])){for(h=-X;h<(h=r[f++].getBoundingClientRect().left)&&f<d;);f<d&&f--}for(c=y[d]=[],i=T?Math.min(f,d)*w-.5:m%f,n=f===X?0:T?d*x/f-.5:m/f|0,l=X,u=h=0;u<d;u++)a=u%f-i,s=n-(u/f|0),c[u]=o=b?Math.abs("y"===b?s:a):J(a*a+s*s),h<o&&(h=o),o<l&&(l=o);"random"===m&&gb(c),c.max=h-l,c.min=l,c.v=d=(parseFloat(p.amount)||parseFloat(p.each)*(d<f?d-1:b?"y"===b?d/f:f:Math.max(f,d/f))||0)*("edges"===m?-1:1),c.b=d<0?g-d:g,c.u=_a(p.amount||p.each)||0,_=_&&d<0?jt(_):_}return d=(c[t]-c.min)/c.max||0,la(c.b+(_?_(d):d)*c.v)+c.u}}function ib(i){var n=Math.pow(10,((i+"").split(".")[1]||"").length);return function(e){var r=la(Math.round(parseFloat(e)/i)*i*n);return(r-r%1)/n+(t(e)?0:_a(e))}}function jb(h,e){var l,f,r=$(h);return!r&&v(h)&&(l=r=h.radius||X,h.values?(h=Pt(h.values),(f=!t(h[0]))&&(l*=l)):h=ib(h.increment)),Za(e,r?s(h)?function(t){return f=h(t),Math.abs(f-t)<=l?f:t}:function(e){for(var r,i,n=parseFloat(f?e.x:e),a=parseFloat(f?e.y:0),s=X,o=0,u=h.length;u--;)(r=f?(r=h[u].x-n)*r+(i=h[u].y-a)*i:Math.abs(h[u]-n))<s&&(s=r,o=u);return o=!l||s<=l?h[o]:e,f||o===e||t(e)?o:o+_a(e)}:ib(h))}function kb(t,e,r,i){return Za($(t)?!e:!0===r?!!(r=0):!i,function(){return $(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 ob(e,r,t){return Za(t,function(t){return e[~~r(t)]})}function rb(t){return t.replace(tt,function(t){var e=t.indexOf("[")+1,r=t.substring(e||7,e?t.indexOf("]"):t.length-1).split(et);return kb(e?r:+r[0],e?0:+r[1],+r[2]||1e-5)})}function ub(t,e,r){var i,n,a,s=t.labels,o=X;for(i in s)(n=s[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(a=i,o=n);return a}function wb(t){return Ca(t),t.scrollTrigger&&t.scrollTrigger.kill(!!I),t.progress()<1&&Dt(t,"onInterrupt"),t}function zb(t){if(t)if(t=!t.name&&t.default||t,x()||t.headless){var e=t.name,r=s(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:V,render:ve,add:Jt,kill:Te,modifier:ye,rawVars:0},a={targetTest:0,get:0,getSetter:le,aliases:{},register:0};if(Lt(),t!==i){if(mt[e])return;ta(i,ta(xa(t,n),a)),bt(i.prototype,bt(n,xa(t,a))),mt[i.prop=e]=i,t.targetTest&&(yt.push(i),ct[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}U(e,i),t.register&&t.register(Fe,i,we)}else St.push(t)}function Cb(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)*zt+.5|0}function Db(e,r,i){var n,a,s,o,u,h,l,f,d,c,p=e?t(e)?[e>>16,e>>8&zt,e&zt]:0:Et.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Et[e])p=Et[e];else if("#"===e.charAt(0)){if(e.length<6&&(e="#"+(n=e.charAt(1))+n+(a=e.charAt(2))+a+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&zt,p&zt,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&zt,e&zt]}else if("hsl"===e.substr(0,3))if(p=c=e.match(rt),r){if(~e.indexOf("="))return p=e.match(it),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,u=p[1]/100,n=2*(h=p[2]/100)-(a=h<=.5?h*(u+1):h+u-h*u),3<p.length&&(p[3]*=1),p[0]=Cb(o+1/3,n,a),p[1]=Cb(o,n,a),p[2]=Cb(o-1/3,n,a);else p=e.match(rt)||Et.transparent;p=p.map(Number)}return r&&!c&&(n=p[0]/zt,a=p[1]/zt,s=p[2]/zt,h=((l=Math.max(n,a,s))+(f=Math.min(n,a,s)))/2,l===f?o=u=0:(d=l-f,u=.5<h?d/(2-l-f):d/(l+f),o=l===n?(a-s)/d+(a<s?6:0):l===a?(s-n)/d+2:(n-a)/d+4,o*=60),p[0]=~~(o+.5),p[1]=~~(100*u+.5),p[2]=~~(100*h+.5)),i&&p.length<4&&(p[3]=1),p}function Eb(t){var r=[],i=[],n=-1;return t.split(Rt).forEach(function(t){var e=t.match(nt)||[];r.push.apply(r,e),i.push(n+=e.length+1)}),r.c=i,r}function Fb(t,e,r){var i,n,a,s,o="",u=(t+o).match(Rt),h=e?"hsla(":"rgba(",l=0;if(!u)return t;if(u=u.map(function(t){return(t=Db(t,e,1))&&h+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"}),r&&(a=Eb(t),(i=r.c).join(o)!==a.c.join(o)))for(s=(n=t.replace(Rt,"1").split(nt)).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(Rt)).length-1;l<s;l++)o+=n[l]+u[l];return o+n[s]}function Ib(t){var e,r=t.join(" ");if(Rt.lastIndex=0,Rt.test(r))return e=Ft.test(r),t[1]=Fb(t[1],e),t[0]=Fb(t[0],e,Eb(t[1])),!0}function Rb(t){var e=(t+"").split("("),r=Bt[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(Nt,"").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(ra)):Bt._CE&&Yt.test(t)?Bt._CE("",t):r}function Tb(t,e){for(var r,i=t._first;i;)i instanceof Zt?Tb(i,e):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===e||(i.timeline?Tb(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next}function Vb(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 ja(t,function(t){for(var e in Bt[t]=ht[t]=a,Bt[n=t.toLowerCase()]=r,a)Bt[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Bt[t+"."+e]=a[e]}),a}function Wb(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}}function Xb(r,t,e){function Lm(t){return 1===t?1:i*Math.pow(2,-10*t)*G((t-a)*n)+1}var i=1<=t?t:1,n=(e||(r?.3:.45))/(t<1?t:1),a=n/Z*(Math.asin(1/i)||0),s="out"===r?Lm:"in"===r?function(t){return 1-Lm(1-t)}:Wb(Lm);return n=Z/n,s.config=function(t,e){return Xb(r,t,e)},s}function Yb(e,r){function Tm(t){return t?--t*t*((r+1)*t+r)+1:0}void 0===r&&(r=1.70158);var t="out"===e?Tm:"in"===e?function(t){return 1-Tm(1-t)}:Wb(Tm);return t.config=function(t){return Yb(e,t)},t}var F,I,l,L,h,n,a,i,o,f,d,c,p,_,m,g,b,k,O,M,C,P,A,D,z,E,B,Y,N={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},j={duration:.5,overwrite:!1,delay:0},X=1e8,q=1/X,Z=2*Math.PI,W=Z/4,H=0,J=Math.sqrt,Q=Math.cos,G=Math.sin,K="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},$=Array.isArray,tt=/random\([^)]+\)/g,et=/,\s*/g,rt=/(?:-?\.?\d|\.)+/gi,it=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,nt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,at=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,st=/[+-]=-?[.\d]+/,ot=/[^,'"\[\]\s]+/gi,ut=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ht={},lt={suppressEvents:!0,isStart:!0,kill:!1},ft={suppressEvents:!0,kill:!1},dt={suppressEvents:!0},ct={},pt=[],_t={},mt={},gt={},vt=30,yt=[],Tt="",bt=function _merge(t,e){for(var r in e)t[r]=e[r];return t},wt=function _animationCycle(t,e){var r=Math.floor(t=la(t/e));return t&&r===t?r-1:r},xt=function _isFromOrFromStart(t){var e=t.data;return"isFromStart"===e||"isStart"===e},kt={_start:0,endTime:V,totalDuration:V},Ot=function _parsePosition(t,e,i){var n,a,s,o=t.labels,u=t._recent||kt,h=t.duration()>=X?u.endTime(!1):t._dur;return r(e)&&(isNaN(e)||e in o)?(a=e.charAt(0),s="%"===e.substr(-1),n=e.indexOf("="),"<"===a||">"===a?(0<=n&&(e=e.replace(/=/,"")),("<"===a?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(s?(n<0?u:i).totalDuration()/100:1)):n<0?(e in o||(o[e]=h),o[e]):(a=parseFloat(e.charAt(n-1)+e.substr(n+1)),s&&i&&(a=a/100*($(i)?i[0]:i).totalDuration()),1<n?_parsePosition(t,e.substr(0,n-1),i)+a:h+a)):null==e?h:+e},Mt=function _clamp(t,e,r){return r<t?t:e<r?e:r},Ct=[].slice,Pt=function toArray(t,e,i){return l&&!e&&l.selector?l.selector(t):!r(t)||i||!n&&Lt()?$(t)?function _flatten(t,e,i){return void 0===i&&(i=[]),t.forEach(function(t){return r(t)&&!e||cb(t,1)?i.push.apply(i,Pt(t)):i.push(t)})||i}(t,i):cb(t)?Ct.call(t,0):t?[t]:[]:Ct.call((e||a).querySelectorAll(t),0)},At=function mapRange(e,t,r,i,n){var a=t-e,s=i-r;return Za(n,function(t){return r+((t-e)/a*s||0)})},Dt=function _callback(t,e,r){var i,n,a,s=t.vars,o=s[e],u=l,h=t._ctx;if(o)return i=s[e+"Params"],n=s.callbackScope||t,r&&pt.length&&oa(),h&&(l=h),a=i?o.apply(n,i):o.call(n),l=u,a},St=[],zt=255,Et={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},Rt=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Et)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),Ft=/hsl[a]?\(/,It=(O=Date.now,M=500,C=33,P=O(),A=P,z=D=1e3/240,g={time:0,frame:0,tick:function tick(){Al(!0)},deltaRatio:function deltaRatio(t){return b/(1e3/(t||60))},wake:function wake(){o&&(!n&&x()&&(h=n=window,a=h.document||{},ht.gsap=Fe,(h.gsapVersions||(h.gsapVersions=[])).push(Fe.version),R(i||h.GreenSockGlobals||!h.gsap&&h||{}),St.forEach(zb)),m="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,p&&g.sleep(),_=m||function(t){return setTimeout(t,z-1e3*g.time+1|0)},c=1,Al(2))},sleep:function sleep(){(m?cancelAnimationFrame:clearTimeout)(p),c=0,_=V},lagSmoothing:function lagSmoothing(t,e){M=t||1/0,C=Math.min(e||33,M)},fps:function fps(t){D=1e3/(t||240),z=1e3*g.time+D},add:function add(n,t,e){var a=t?function(t,e,r,i){n(t,e,r,i),g.remove(a)}:n;return g.remove(n),E[e?"unshift":"push"](a),Lt(),a},remove:function remove(t,e){~(e=E.indexOf(t))&&E.splice(e,1)&&e<=k&&k--},_listeners:E=[]}),Lt=function _wake(){return!c&&It.wake()},Bt={},Yt=/^[\d.\-M][\d.\-,\s]/,Nt=/["']/g,jt=function _invertEase(e){return function(t){return 1-e(1-t)}},Vt=function _parseEase(t,e){return t&&(s(t)?t:Bt[t]||Rb(t))||e};function Al(t){var e,r,i,n,a=O()-A,s=!0===t;if((M<a||a<0)&&(P+=a-C),(0<(e=(i=(A+=a)-P)-z)||s)&&(n=++g.frame,b=i-1e3*g.time,g.time=i/=1e3,z+=e+(D<=e?4:D-e),r=1),s||(p=_(Al)),r)for(k=0;k<E.length;k++)E[k](i,b,n,t)}function jn(t){return t<Y?B*t*t:t<.7272727272727273?B*Math.pow(t-1.5/2.75,2)+.75:t<.9090909090909092?B*(t-=2.25/2.75)*t+.9375:B*Math.pow(t-2.625/2.75,2)+.984375}ja("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var r=e<5?e+1:e;Vb(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})}),Bt.Linear.easeNone=Bt.none=Bt.Linear.easeIn,Vb("Elastic",Xb("in"),Xb("out"),Xb()),B=7.5625,Y=1/2.75,Vb("Bounce",function(t){return 1-jn(1-t)},jn),Vb("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)}),Vb("Circ",function(t){return-(J(1-t*t)-1)}),Vb("Sine",function(t){return 1===t?1:1-Q(t*W)}),Vb("Back",Yb("in"),Yb("out"),Yb()),Bt.SteppedEase=Bt.steps=ht.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*Mt(0,.99999999,t)|0)+n)*r}}},j.ease=Bt["quad.out"],ja("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Tt+=t+","+t+"Param
6298s,"});var Ut,Xt=function GSCache(t,e){this.id=H++,(t._gsap=this).target=t,this.harness=e,this.get=e?e.get:ia,this.set=e?e.getSetter:le},qt=((Ut=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},Ut.duration=function duration(t){return arguments.length?this.totalDuration(0<this._repeat?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},Ut.totalDuration=function totalDuration(t){return arguments.length?(this._dirty=0,Ua(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},Ut.totalTime=function totalTime(t,e){if(Lt(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(La(this,t),!r._dp||r.parent||Ma(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)&&Na(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===q||!this._initted&&this._dur&&t||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),qa(this,t,e)),this},Ut.time=function time(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Ha(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},Ut.totalProgress=function totalProgress(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):0<=this.rawTime()&&this._initted?1:0},Ut.progress=function progress(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Ha(this),e):this.duration()?Math.min(1,this._time/this._dur):0<this.rawTime()?1:0},Ut.iteration=function iteration(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?wt(this._tTime,r)+1:1},Ut.timeScale=function timeScale(t,e){if(!arguments.length)return this._rts===-q?0:this._rts;if(this._rts===t)return this;var r=this.parent&&this._ts?Ja(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-q?0:this._rts,this.totalTime(Mt(-Math.abs(this._delay),this.totalDuration(),r),!1!==e),Ka(this),function _recacheAncestors(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},Ut.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):(Lt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==q&&(this._tTime-=q)))),this):this._ps},Ut.startTime=function startTime(t){if(arguments.length){this._start=la(t);var e=this.parent||this._dp;return!e||!e._sort&&this.parent||Na(e,this,this._start-this._delay),this}return this._start},Ut.endTime=function endTime(t){return this._start+(w(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},Ut.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?Ja(e.rawTime(t),this):this._tTime:this._tTime},Ut.revert=function revert(t){void 0===t&&(t=dt);var e=I;return I=t,pa(this)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),I=e,this},Ut.globalTime=function globalTime(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):r},Ut.repeat=function repeat(t){return arguments.length?(this._repeat=t===1/0?-2:t,Va(this)):-2===this._repeat?1/0:this._repeat},Ut.repeatDelay=function repeatDelay(t){if(arguments.length){var e=this._time;return this._rDelay=t,Va(this),e?this.time(e):this}return this._rDelay},Ut.yoyo=function yoyo(t){return arguments.length?(this._yoyo=t,this):this._yoyo},Ut.seek=function seek(t,e){return this.totalTime(Ot(this,t),w(e))},Ut.restart=function restart(t,e){return this.play().totalTime(t?-this._delay:0,w(e)),this._dur||(this._zTime=-q),this},Ut.play=function play(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},Ut.reverse=function reverse(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},Ut.pause=function pause(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},Ut.resume=function resume(){return this.paused(!1)},Ut.reversed=function reversed(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-q:0)),this):this._rts<0}
vendor: 41,097 bytes, line 6298
6298,Ut.invalidate=function invalidate(){return this._initted=this._act=0,this._zTime=-q,this},Ut.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)-q))},Ut.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]},Ut.then=function then(t){var i=this,n=i._prom;return new Promise(function(e){function Fo(){var t=i.then;i.then=null,n&&n(),s(r)&&(r=r(i))&&(r.then||r===i)&&(i.then=t),e(r),i.then=t}var r=s(t)?t:sa;i._initted&&1===i.totalProgress()&&0<=i._ts||!i._tTime&&i._ts<0?Fo():i._prom=Fo})},Ut.kill=function kill(){wb(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,Ua(this,+t.duration,1,1),this.data=t.data,l&&(this._ctx=l).data.push(this),c||It.wake()}ta(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:-q,_prom:0,_ps:!1,_rts:1});var Zt=function(i){function Timeline(t,e){var r;return void 0===t&&(t={}),(r=i.call(this,t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=w(t.sortChildren),L&&Na(t.parent||L,_assertThisInitialized(r),e),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&Oa(_assertThisInitialized(r),t.scrollTrigger),r}_inheritsLoose(Timeline,i);var e=Timeline.prototype;return e.to=function to(t,e,r){return Ya(0,arguments,this),this},e.from=function from(t,e,r){return Ya(1,arguments,this),this},e.fromTo=function fromTo(t,e,r,i){return Ya(2,arguments,this),this},e.set=function set(t,e,r){return e.duration=0,e.parent=this,ya(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new te(t,e,Ot(this,r),1),this},e.call=function call(t,e,r){return Na(this,te.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 te(t,r,Ot(this,n)),this},e.staggerFrom=function staggerFrom(t,e,r,i,n,a,s){return r.runBackwards=1,ya(r).immediateRender=w(r.immediateRender),this.staggerTo(t,e,r,i,n,a,s)},e.staggerFromTo=function staggerFromTo(t,e,r,i,n,a,s,o){return i.startAt=r,ya(i).immediateRender=w(i.immediateRender),this.staggerTo(t,e,i,n,a,s,o)},e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d,c,p,_=this._time,m=this._dirty?this.totalDuration():this._tDur,g=this._dur,v=t<=0?0:la(t),y=this._zTime<0!=t<0&&(this._initted||!g);if(this!==L&&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(c=this._yoyo,o=g+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,r);if(i=la(v%o),v===m?(s=this._repeat,i=g):((s=~~(d=la(v/o)))&&s===d&&(i=g,s--),g<i&&(i=g)),d=wt(this._tTime,o),!_&&this._tTime&&d!==s&&this._tTime-d*o-this._dur<=0&&(d=s),c&&1&s&&(i=g-i,p=1),s!==d&&!this._lock){var T=c&&1&d,b=T===(c&&1&s);if(s<d&&(T=!T),_=T?0:v%g?g:v,this._lock=1,this.render(_||(p?0:la(s*o)),e,!g)._lock=0,this._tTime=v,!e&&this.parent&&Dt(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1,d=s),_&&_!==this._time||u!=!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(g=this._dur,m=this._tDur,b&&(this._lock=2,_=T?g:-1e-4,this.render(_,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;Tb(this,p)}}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,la(_),la(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),!_&&v&&g&&!e&&!d&&(Dt(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=-q);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&&pa(n)),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=w?-q:q);break}}n=a}}if(h&&!e&&(this.pause(),h.render(_<=i?0:-q)._zTime=_<=i?1:-1,this._ts))return this._start=f,Ka(this),this.render(t,e,r);this._onUpdate&&!e&&Dt(this,"onUpdate",!0),(v===m&&this._tTime>=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)||Ca(this,1),e||t<0&&!_||!v&&!_&&m||(Dt(this,v===m&&0<=t?"onComplete":"onReverseComplete",!0),!this._prom||v<m&&0<this.timeScale()||this._prom())))}return this},e.add=function add(e,i){var n=this;if(t(i)||(i=Ot(this,i,e)),!(e instanceof qt)){if($(e))return e.forEach(function(t){return n.add(t,i)}),this;if(r(e))return this.addLabel(e,i);if(!s(e))return this;e=te.delayedCall(0,e)}return this!==e?Na(this,e,i):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=-X);for(var n=[],a=this._first;a;)a._start>=i&&(a instanceof te?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 r(t)?this.removeLabel(t):s(t)?this.killTweensOf(t):(t.parent===this&&Ba(this,t),t===this._recent&&(this._recent=this._last),Da(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=la(It.time-(0<this._ts?t/this._ts:(this.totalDuration()-t)/-this._ts))),i.prototype.totalTime.call(this,t,e),this._forcing=0,this):this._tTime},e.addLabel=function addLabel(t,e){return this.labels[t]=Ot(this,e),this},e.removeLabel=function removeLabel(t){return delete this.labels[t],this},e.addPause=function addPause(t,e,r){var i=te.delayedCall(0,e||V,r);return i.data="isPause",this._hasPause=1,Na(this,i,Ot(this,t))},e.removePause=function removePause(t){var e=this._first;for(t=Ot(this,t);e;)e._start===t&&"isPause"===e.data&&Ca(e),e=e._next},e.killTweensOf=function killTweensOf(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)Wt!==i[n]&&i[n].kill(t,e);return this},e.getTweensOf=function getTweensOf(e,r){for(var i,n=[],a=Pt(e),s=this._first,o=t(r);s;)s instanceof te?na(s._targets,a)&&(o?(!Wt||s._initted&&s._ts)&&s.globalTime(0)<=r&&s.globalTime(s.totalDuration())>r:!r||s.isActive())&&n.push(s):(i=s.getTweensOf(a,r)).length&&n.push.apply(n,i),s=s._next;return n},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=Ot(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=te.to(i,ta({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())||q,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&&Ua(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,ta({startAt:{time:Ot(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),ub(this,Ot(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),ub(this,Ot(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+q)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);var i,n=this._first,a=this.labels;for(t=la(t);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 Da(this)},e.invalidate=function invalidate(t){var e=this._first;for(this._lock=0;e;)e.invalidate(t),e=e._next;return i.prototype.invalidate.call(this,t)},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={}),Da(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=X;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,Na(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=la(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;Ua(a,a===L&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(L._ts&&(qa(L,Ja(t,L)),f=It.frame),It.frame>=vt){vt+=N.autoSleep||120;var e=L._first;if((!e||!e._ts)&&N.autoSleep&&It._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||It.sleep()}}},Timeline}(qt);ta(Zt.prototype,{_lock:0,_hasPause:0,_forcing:0});function dc(t,e,i,n,a,o){var u,h,l,f;if(mt[t]&&!1!==(u=new mt[t]).init(a,u.rawVars?e[t]:function _processVars(t,e,i,n,a){if(s(t)&&(t=Gt(t,a,e,i,n)),!v(t)||t.style&&t.nodeType||$(t)||K(t))return r(t)?Gt(t,a,e,i,n):t;var o,u={};for(o in t)u[o]=Gt(t[o],a,e,i,n);return u}(e[t],n,a,o,i),i,n,o)&&(i._pt=h=new we(i._pt,a,t,0,1,u.render,u,0,u.priority),i!==d))for(l=i._ptLookup[i._targets.indexOf(a)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function jc(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if($(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 Wt,Ht,Jt=function _addPropTween(t,e,i,n,a,o,u,h,l,f){s(n)&&(n=n(a||0,t,o));var d,c=t[e],p="get"!==i?i:s(c)?l?t[e.indexOf("set")||!s(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():c,_=s(c)?l?ue:re:ee;if(r(n)&&(~n.indexOf("random(")&&(n=rb(n)),"="===n.charAt(1)&&(!(d=ma(p,n)+(_a(p)||0))&&0!==d||(n=d))),!f||p!==n||Ht)return isNaN(p*n)||""===n?(c||e in t||S(e,n),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,d,c,p,_=new we(this._pt,t,e,0,1,ge,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(c=~(i+="").indexOf("random("))&&(i=rb(i)),a&&(a(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(at)||[];o=at.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)?ma(d,l)-d:parseFloat(l)-d,m:h&&h<4?Math.round:0},m=at.lastIndex);return _.c=m<i.length?i.substring(m,i.length):"",_.fp=s,(st.test(i)||c)&&(_.e=0),this._pt=_}.call(this,t,e,p,n,_,h||N.stringFilter,l)):(d=new we(this._pt,t,e,+p||0,n-(p||0),"boolean"==typeof c?_e:ce,0,_),l&&(d.fp=l),u&&d.modifier(u,this,t),this._pt=d)},Qt=function _initTween(t,e,r){var i,n,a,s,o,u,h,l,f,d,c,p,_,m=t.vars,g=m.ease,v=m.startAt,y=m.immediateRender,T=m.lazy,b=m.onUpdate,x=m.runBackwards,k=m.yoyoEase,O=m.keyframes,M=m.autoRevert,C=t._dur,P=t._startAt,A=t._targets,D=t.parent,S=D&&"nested"===D.data?D.vars.targets:A,z="auto"===t._overwrite&&!F,E=t.timeline;if(!E||O&&g||(g="none"),t._ease=Vt(g,j.ease),t._yEase=k?jt(Vt(!0===k?g:k,j.ease)):0,k&&t._yoyo&&!t._repeat&&(k=t._yEase,t._yEase=t._ease,t._ease=k),t._from=!E&&!!m.runBackwards,!E||O&&!m.stagger){if(p=(l=A[0]?ha(A[0]).harness:0)&&m[l.prop],i=xa(m,ct),P&&(P._zTime<0&&P.progress(1),e<0&&x&&y&&!M?P.render(-1,!0):P.revert(x&&C?ft:lt),P._lazy=0),v){if(Ca(t._startAt=te.set(A,ta({data:"isStart",overwrite:!1,parent:D,immediateRender:!0,lazy:!P&&w(T),startAt:null,delay:0,onUpdate:b&&function(){return Dt(t,"onUpdate")},stagger:0},v))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(I||!y&&!M)&&t._startAt.revert(ft),y&&C&&e<=0&&r<=0)return void(e&&(t._zTime=e))}else if(x&&C&&!P)if(e&&(y=!1),a=ta({overwrite:!1,data:"isFromStart",lazy:y&&!P&&w(T),immediateRender:y,stagger:0,parent:D},i),p&&(a[l.prop]=p),Ca(t._startAt=te.set(A,a)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(I?t._startAt.revert(ft):t._startAt.render(-1,!0)),t._zTime=e,y){if(!e)return}else _initTween(t._startAt,q,q);for(t._pt=t._ptCache=0,T=C&&w(T)||T&&!C,n=0;n<A.length;n++){if(h=(o=A[n])._gsap||ga(A)[n]._gsap,t._ptLookup[n]=d={},_t[h.id]&&pt.length&&oa(),c=S===A?n:S.indexOf(o),l&&!1!==(f=new l).init(o,p||i,t,c,S)&&(t._pt=s=new we(t._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||p)for(a in i)mt[a]&&(f=dc(a,i,t,c,o,S))?f.priority&&(u=1):d[a]=s=Jt.call(t,o,a,"get",i[a],c,S,0,m.stringFilter);t._op&&t._op[n]&&t.kill(o,t._op[n]),z&&t._pt&&(Wt=t,L.killTweensOf(o,d,t.globalTime(e)),_=!t.parent,Wt=0),t._pt&&T&&(_t[h.id]=1)}u&&be(t),t._onInit&&t._onInit(t)}t._onUpdate=b,t._initted=(!t._op||t._pt)&&!_,O&&e<=0&&E.render(X,!0,!0)},Gt=function _parseFuncOrString(t,e,i,n,a){return s(t)?t.call(e,i,n,a):r(t)&&~t.indexOf("random(")?rb(t):t},Kt=Tt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",$t={};ja(Kt+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return $t[t]=1});var te=function(R){function Tween(e,r,i,n){var a;"number"==typeof r&&(i.duration=r,r=i,i=null);var s,o,u,h,l,f,d,c,p=(a=R.call(this,n?r:ya(r))||this).vars,_=p.duration,m=p.delay,g=p.immediateRender,b=p.stagger,x=p.overwrite,k=p.keyframes,O=p.defaults,M=p.scrollTrigger,C=p.yoyoEase,P=r.parent||L,A=($(e)||K(e)?t(e[0]):"length"in r)?[e]:Pt(e);if(a._targets=A.length?ga(A):T("GSAP target "+e+" not found. https://gsap.com",!N.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=x,k||b||y(_)||y(m)){if(r=a.vars,(s=a.timeline=new Zt({data:"nested",defaults:O||{},targets:P&&"nested"===P.data?P.vars.targets:A})).kill(),s.parent=s._dp=_assertThisInitialized(a),s._start=0,b||y(_)||y(m)){if(h=A.length,d=b&&hb(b),v(b))for(l in b)~Kt.indexOf(l)&&((c=c||{})[l]=b[l]);for(o=0;o<h;o++)(u=xa(r,$t)).stagger=0,C&&(u.yoyoEase=C),c&&bt(u,c),f=A[o],u.duration=+Gt(_,_assertThisInitialized(a),o,f,A),u.delay=(+Gt(m,_assertThisInitialized(a),o,f,A)||0)-a._delay,!b&&1===h&&u.delay&&(a._delay=m=u.delay,a._start+=m,u.delay=0),s.to(f,u,d?d(o,f,A):0),s._ease=Bt.none;s.duration()?_=m=0:a.timeline=0}else if(k){ya(ta(s.vars.defaults,{ease:"none"})),s._ease=Vt(k.ease||r.ease||"none");var D,S,z,E=0;if($(k))k.forEach(function(t){return s.to(A,t,">")}),s.duration();else{for(l in u={},k)"ease"===l||"easeEach"===l||jc(l,k[l],u,k.easeEach);for(l in u)for(D=u[l].sort(function(t,e){return t.t-e.t}),o=E=0;o<D.length;o++)(z={ease:(S=D[o]).e,duration:(S.t-(o?D[o-1].t:0))/100*_})[l]=S.v,s.to(A,z,E),E+=z.duration;s.duration()<_&&s.to({},{duration:_-s.duration()})}}_||a.duration(_=s.duration())}else a.timeline=0;return!0!==x||F||(Wt=_assertThisInitialized(a),L.killTweensOf(A),Wt=0),Na(P,_assertThisInitialized(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(g||!_&&!k&&a._start===la(P._time)&&w(g)&&function _hasNoPausedAncestors(t){return!t||t._ts&&_hasNoPausedAncestors(t.parent)}(_assertThisInitialized(a))&&"nested"!==P.data)&&(a._tTime=-q,a.render(Math.max(0,-m)||0)),M&&Oa(_assertThisInitialized(a),M),a}_inheritsLoose(Tween,R);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,c=this._tDur,p=this._dur,_=t<0,m=c-q<t&&!_?c:t<q?0:t;if(p){if(m!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=_||this._lazy){if(i=m,l=this.timeline,this._repeat){if(s=p+this._rDelay,this._repeat<-1&&_)return this.totalTime(100*s+t,e,r);if(i=la(m%s),m===c?(a=this._repeat,i=p):(a=~~(o=la(m/s)))&&a===o?(i=p,a--):p<i&&(i=p),(u=this._yoyo&&1&a)&&(f=this._yEase,i=p-i),o=wt(this._tTime,s),i===d&&!r&&this._initted&&a===o)return this._tTime=m,this;a!==o&&(l&&this._yEase&&Tb(l,u),this.vars.repeatRefresh&&!u&&!this._lock&&i!==s&&this._initted&&(this._lock=r=1,this.render(la(s*a),!0).invalidate()._lock=0))}if(!this._initted){if(Pa(this,_?t:i,r,e,m))return this._tTime=0,this;if(!(d===this._time||r&&this.vars.repeatRefresh&&a!==o))return this;if(p!==this._dur)return this.render(t,e,r)}if(this._tTime=m,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=h=(f||this._ease)(i/p),this._from&&(this.ratio=h=1-h),!d&&m&&!e&&!o&&(Dt(this,"onStart"),this._tTime!==m))return this;for(n=this._pt;n;)n.r(h,n.d),n=n._next;l&&l.render(t<0?t:l._dur*l._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(_&&Fa(this,t,0,r),Dt(this,"onUpdate")),this._repeat&&a!==o&&this.vars.onRepeat&&!e&&this.parent&&Dt(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(_&&!this._onUpdate&&Fa(this,t,0,!0),!t&&p||!(m===this._tDur&&0<this._ts||!m&&this._ts<0)||Ca(this,1),e||_&&!d||!(m||d||u)||(Dt(this,m===c?"onComplete":"onReverseComplete",!0),!this._prom||m<c&&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||!xt(t))||(t._ts<0||t._dp._ts<0)&&!xt(t))?0:1,h=t._rDelay,l=0;if(h&&t._repeat&&(l=Mt(0,t._tDur,e),a=wt(l,h),t._yoyo&&1&a&&(u=1-u),a!==wt(t._tTime,h)&&(o=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==o||I||i||t._zTime===q||!e&&t._zTime){if(!t._initted&&Pa(t,e,i,r,l))return;for(s=t._zTime,t._zTime=e||(r?q: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;e<0&&Fa(t,e,0,!0),t._onUpdate&&!r&&Dt(t,"onUpdate"),l&&t._repeat&&!r&&t.parent&&Dt(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&Ca(t,1),r||I||(Dt(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(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),R.prototype.invalidate.call(this,t)},e.resetTo=function resetTo(t,e,r,i,n){c||It.wake(),this._ts||this.play();var a,s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Qt(this,s),a=this._ease(s/this._dur),function _updatePropTweens(t,e,r,i,n,a,s,o){var u,h,l,f,d=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!d)for(d=t._ptCache[e]=[],l=t._ptLookup,f=t._targets.length;f--;){if((u=l[f][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return Ht=1,t.vars[e]="+=0",Qt(t,s),Ht=0,o?T(e+" not eligible for reset"):1;d.push(u)}for(f=d.length;f--;)(u=(h=d[f])._pt||h).s=!i&&0!==i||n?u.s+(i||0)+a*u.c:i,u.c=r-u.s,h.e&&(h.e=ka(r)+_a(h.e)),h.b&&(h.b=u.s+_a(h.b))}(this,t,e,r,i,a,s,n)?this.resetTo(t,e,r,i,1):(La(this,0),this.parent||Aa(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?wb(this):this.scrollTrigger&&this.scrollTrigger.kill(!!I),this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Wt&&!0!==Wt.vars.overwrite)._first||wb(this),this.parent&&i!==this.timeline.totalDuration()&&Ua(this,this._dur*this.timeline._tDur/i,0,1),this}var n,a,s,o,u,h,l,f=this._targets,d=t?Pt(t):f,c=this._ptLookup,p=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),wb(this);for(n=this._op=this._op||[],"all"!==e&&(r(e)&&(u={},ja(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?ha(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=bt({},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 a=c[l],"all"===e?(n[l]=e,o=a,s={}):(s=n[l]=n[l]||{},o=e),o)(h=a&&a[u])&&("kill"in h.d&&!0!==h.d.kill(u)||Ba(this,h,"_pt"),delete a[u]),"all"!==s&&(s[u]=1);return this._initted&&!this._pt&&p&&wb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Ya(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 Ya(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 L.killTweensOf(t,e,r)},Tween}(qt);ta(te.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ja("staggerTo,staggerFrom,staggerFromTo",function(r){te[r]=function(){var t=new Zt,e=Ct.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function rc(t,e,r){return t.setAttribute(e,r)}function zc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var ee=function _setterPlain(t,e,r){return t[e]=r},re=function _setterFunc(t,e,r){return t[e](r)},ue=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},le=function _getSetter(t,e){return s(t[e])?re:u(t[e])&&t.setAttribute?rc:ee},ce=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},_e=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ge=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)},ve=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},ye=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},Te=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?Ba(this,i,"_pt"):i.dep||(e=1),i=r;return!e},be=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},we=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=zc,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||ce,this.d=s||this,this.set=o||ee,this.pr=u||0,(this._next=t)&&(t._prev=this)}ja(Tt+"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 ct[t]=1}),ht.TweenMax=ht.TweenLite=te,ht.TimelineLite=ht.TimelineMax=Zt,L=new Zt({sortChildren:!1,defaults:j,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),N.stringFilter=Ib;function Hc(t){return(Oe[t]||Me).map(function(t){return t()})}function Ic(){var t=Date.now(),o=[];2<t-Ce&&(Hc("matchMediaInit"),ke.forEach(function(t){var e,r,i,n,a=t.queries,s=t.conditions;for(r in a)(e=h.matchMedia(a[r]).matches)&&(i=1),e!==s[r]&&(s[r]=e,n=1);n&&(t.revert(),i&&o.push(t))}),Hc("matchMediaRevert"),o.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),Ce=t,Hc("matchMedia"))}var xe,ke=[],Oe={},Me=[],Ce=0,Pe=0,De=((xe=Context.prototype).add=function add(t,i,n){function Jw(){var t,e=l,r=a.selector;return e&&e!==a&&e.data.push(a),n&&(a.selector=fb(n)),l=a,t=i.apply(a,arguments),s(t)&&a._r.push(t),l=e,a.selector=r,a.isReverted=!1,t}s(t)&&(n=i,i=t,t=s);var a=this;return a.last=Jw,t===s?Jw(a,function(t){return a.add(null,t)}):t?a[t]=Jw:Jw},xe.ignore=function ignore(t){var e=l;l=null,t(this),l=e},xe.getTweens=function getTweens(){var e=[];return this.data.forEach(function(t){return t instanceof Context?e.push.apply(e,t.getTweens()):t instanceof te&&!(t.parent&&"nested"===t.parent.data)&&e.push(t)}),e},xe.clear=function clear(){this._r.length=this.data.length=0},xe.kill=function kill(i,t){var n=this;if(i?function(){for(var t,e=n.getTweens(),r=n.data.length;r--;)"isFlip"===(t=n.data[r]).data&&(t.revert(),t.getChildren(!0,!0,!1).forEach(function(t){return e.splice(e.indexOf(t),1)}));for(e.map(function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t:t}}).sort(function(t,e){return e.g-t.g||-1/0}).forEach(function(t){return t.t.revert(i)}),r=n.data.length;r--;)(t=n.data[r])instanceof Zt?"nested"!==t.data&&(t.scrollTrigger&&t.scrollTrigger.revert(),t.kill()):t instanceof te||!t.revert||t.revert(i);n._r.forEach(function(t){return t(i,n)}),n.isReverted=!0}():this.data.forEach(function(t){return t.kill&&t.kill()}),this.clear(),t)for(var e=ke.length;e--;)ke[e].id===this.id&&ke.splice(e,1)},xe.revert=function revert(t){this.kill(t||{})},Context);function Context(t,e){this.selector=e&&fb(e),this.data=[],this._r=[],this.isReverted=!1,this.id=Pe++,t&&this.add(t)}var Se,Ee=((Se=MatchMedia.prototype).add=function add(t,e,r){v(t)||(t={matches:t});var i,n,a,s=new De(0,r||this.scope),o=s.conditions={};for(n in l&&!s.selector&&(s.selector=l.selector),this.contexts.push(s),e=s.add("onMatch",e),s.queries=t)"all"===n?a=1:(i=h.matchMedia(t[n]))&&(ke.indexOf(s)<0&&ke.push(s),(o[n]=i.matches)&&(a=1),i.addListener?i.addListener(Ic):i.addEventListener("change",Ic));return a&&e(s,function(t){return s.add(null,t)}),this},Se.revert=function revert(t){this.kill(t||{})},Se.kill=function kill(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},MatchMedia);function MatchMedia(t){this.contexts=[],this.scope=t,l&&l.data.push(this)}var Re={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 zb(t)})},timeline:function timeline(t){return new Zt(t)},getTweensOf:function getTweensOf(t,e){return L.getTweensOf(t,e)},getProperty:function getProperty(i,t,e,n){r(i)&&(i=Pt(i)[0]);var a=ha(i||{}).get,s=e?sa:ra;return"native"===e&&(e=""),i?t?s((mt[t]&&mt[t].get||a)(i,t,e,n)):function(t,e,r){return s((mt[t]&&mt[t].get||a)(i,t,e,r))}:i},quickSetter:function quickSetter(r,e,i){if(1<(r=Pt(r)).length){var n=r.map(function(t){return Fe.quickSetter(t,e,i)}),a=n.length;return function(t){for(var e=a;e--;)n[e](t)}}r=r[0]||{};var s=mt[e],o=ha(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&&ve(1,d)}:o.set(r,u);return s?h:function(t){return h(r,u,i?t+i:t,o,1)}},quickTo:function quickTo(t,i,e){function by(t,e,r){return n.resetTo(i,t,e,r)}var r,n=Fe.to(t,ta(((r={})[i]="+=0.1",r.paused=!0,r.stagger=0,r),e||{}));return by.tween=n,by},isTweening:function isTweening(t){return 0<L.getTweensOf(t,!0).length},defaults:function defaults(t){return t&&t.ease&&(t.ease=Vt(t.ease,j.ease)),wa(j,t||{})},config:function config(t){return wa(N,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&&!mt[t]&&!ht[t]&&T(i+" effect requires "+t+" plugin.")}),gt[i]=function(t,e,r){return n(Pt(t),ta(e||{},a),r)},r&&(Zt.prototype[i]=function(t,e,r){return this.add(gt[i](t,v(e)?e:(r=e)&&{},this),r)})},registerEase:function registerEase(t,e){Bt[t]=Vt(e)},parseEase:function parseEase(t,e){return arguments.length?Vt(t,e):Bt},getById:function getById(t){return L.getById(t)},exportRoot:function exportRoot(t,e){void 0===t&&(t={});var r,i,n=new Zt(t);for(n.smoothChildTiming=w(t.smoothChildTiming),L.remove(n),n._dp=0,n._time=n._tTime=L._time,r=L._first;r;)i=r._next,!e&&!r._dur&&r instanceof te&&r.vars.onComplete===r._targets[0]||Na(n,r,r._start-r._delay),r=i;return Na(L,n,0),n},context:function context(t,e){return t?new De(t,e):l},matchMedia:function matchMedia(t){return new Ee(t)},matchMediaRefresh:function matchMediaRefresh(){return ke.forEach(function(t){var e,r,i=t.conditions;for(r in i)i[r]&&(i[r]=!1,e=1);e&&t.revert()})||Ic()},addEventListener:function addEventListener(t,e){var r=Oe[t]||(Oe[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function removeEventListener(t,e){var r=Oe[t],i=r&&r.indexOf(e);0<=i&&r.splice(i,1)},utils:{wrap:function wrap(e,t,r){var i=t-e;return $(e)?ob(e,wrap(0,e.length),t):Za(r,function(t){return(i+(t-e)%i)%i+e})},wrapYoyo:function wrapYoyo(e,t,r){var i=t-e,n=2*i;return $(e)?ob(e,wrapYoyo(0,e.length-1),t):Za(r,function(t){return e+(i<(t=(n+(t-e)%n)%n||0)?n-t:t)})},distribute:hb,random:kb,snap:jb,normalize:function normalize(t,e,r){return At(t,e,0,1,r)},getUnit:_a,clamp:function clamp(e,r,t){return Za(t,function(t){return Mt(e,r,t)})},splitColor:Db,toArray:Pt,selector:fb,mapRange:At,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||_a(t))}},interpolate:function interpolate(e,i,t,n){var a=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!a){var s,o,u,h,l,f=r(e),d={};if(!0===t&&(n=1)&&(t=null),f)e={p:e},i={p:i};else if($(e)&&!$(i)){for(u=[],h=e.length,l=h-2,o=1;o<h;o++)u.push(interpolate(e[o-1],e[o]));h--,a=function func(t){t*=h;var e=Math.min(l,~~t);return u[e](t-e)},t=i}else n||(e=bt($(e)?[]:{},e));if(!u){for(s in i)Jt.call(d,e,s,"get",i[s]);a=function func(t){return ve(t,d)||(f?e.p:e)}}}return Za(t,a)},shuffle:gb},install:R,effects:gt,ticker:It,updateRoot:Zt.updateRoot,plugins:mt,globalTimeline:L,core:{PropTween:we,globals:U,Tween:te,Timeline:Zt,Animation:qt,getCache:ha,_removeLinkedListItem:Ba,reverting:function reverting(){return I},context:function context(t){return t&&l&&(l.data.push(t),t._ctx=l),l},suppressOverwrites:function suppressOverwrites(t){return F=t}}};ja("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Re[t]=te[t]}),It.add(Zt.updateRoot),d=Re.to({},{duration:0});function Mc(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r}function Oc(t,a){return{name:t,headless:1,rawVars:1,init:function init(t,n,e){e._onInit=function(t){var e,i;if(r(n)&&(e={},ja(n,function(t){return e[t]=1}),n=e),a){for(i in e={},n)e[i]=a(n[i]);n=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=Mc(n,r)),n&&n.modifier&&n.modifier(e[r],t,a[i],r))}(t,n)}}}}var Fe=Re.registerPlugin({name:"attr",init:function init(t,e,r,i,n){var a,s,o;for(a in this.tween=r,e)o=t.getAttribute(a)||"",(s=this.add(t,"setAttribute",(o||0)+"",e[a],i,n,0,0,a)).op=a,s.b=o,this._props.push(a)},render:function render(t,e){for(var r=e._pt;r;)I?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function init(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},Oc("roundProps",ib),Oc("modifiers"),Oc("snap",jb))||Re;te.version=Zt.version=Fe.version="3.14.2",o=1,x()&&Lt();function yd(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function zd(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 Ad(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 Bd(t,e){return e.set(e.t,e.p,1===t?e.e:t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function Cd(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)}function Dd(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)}function Ed(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)}function Fd(t,e,r){return t.style[e]=r}function Gd(t,e,r){return t.style.setProperty(e,r)}function Hd(t,e,r){return t._gsap[e]=r}function Id(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r}function Jd(t,e,r,i,n){var a=t._gsap;a.scaleX=a.scaleY=r,a.renderTransform(n,a)}function Kd(t,e,r,i,n){var a=t._gsap;a[e]=r,a.renderTransform(n,a)}function Nd(t,e){var r=this,i=this.target,n=i.style,a=i._gsap;if(t in hr&&n){if(this.tfm=this.tfm||{},"transform"===t)return mr.transform.split(",").forEach(function(t){return Nd.call(r,t,e)});if(~(t=mr[t]||t).indexOf(",")?t.split(",").forEach(function(t){return r.tfm[t]=xr(i,t)}):this.tfm[t]=a.x?a[t]:xr(i,t),t===vr&&(this.tfm.zOrigin=a.zOrigin),0<=this.props.indexOf(gr))return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(vr,e,"")),t=gr}(n||e)&&this.props.push(t,e,n[t])}function Od(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))}function Pd(){var t,e,r=this.props,i=this.target,n=i.style,a=i._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?i[r[t]](r[t+2]):i[r[t]]=r[t+2]:r[t+2]?n[r[t]]=r[t+2]:n.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(cr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)a[e]=this.tfm[e];a.svg&&(a.renderTransform(),i.setAttribute("data-svg-origin",this.svgo||"")),(t=Ue())&&t.isStart||n[gr]||(Od(n),a.zOrigin&&n[vr]&&(n[vr]+=" "+a.zOrigin+"px",a.zOrigin=0,a.renderTransform()),a.uncache=1)}}function Qd(t,e){var r={target:t,props:[],revert:Pd,save:Nd};return t._gsap||Fe.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(t){return r.save(t)}),r}function Sd(t,e){var r=Le.createElementNS?Le.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Le.createElement(t);return r&&r.style?r:Le.createElement(t)}function Td(t,e,r){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(cr,"-$1").toLowerCase())||i.getPropertyValue(e)||!r&&Td(t,Tr(e)||e,1)||""}function Wd(){(function _windowExists(){return"undefined"!=typeof window})()&&window.document&&(Ie=window,Le=Ie.document,Ye=Le.documentElement,je=Sd("div")||{style:{}},Sd("div"),gr=Tr(gr),vr=gr+"Origin",je.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Xe=!!Tr("perspective"),Ue=Fe.core.reverting,Ne=1)}function Xd(t){var e,r=t.ownerSVGElement,i=Sd("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0);n.style.display="block",i.appendChild(n),Ye.appendChild(i);try{e=n.getBBox()}catch(t){}return i.removeChild(n),Ye.removeChild(i),e}function Yd(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])}function Zd(e){var r,i;try{r=e.getBBox()}catch(t){r=Xd(e),i=1}return r&&(r.width||r.height)||i||(r=Xd(e)),!r||r.width||r.x||r.y?r:{x:+Yd(e,["x","cx","x1"])||0,y:+Yd(e,["y","cy","y1"])||0,width:0,height:0}}function $d(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Zd(t))}function _d(t,e){if(e){var r,i=t.style;e in hr&&e!==vr&&(e=gr),i.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),i.removeProperty("--"===r?e:e.replace(cr,"-$1").toLowerCase())):i.removeAttribute(e)}}function ae(t,e,r,i,n,a){var s=new we(t._pt,e,r,0,1,a?Ed:Dd);return(t._pt=s).b=i,s.e=n,t._props.push(r),s}function de(t,e,r,i){var n,a,s,o,u=parseFloat(r)||0,h=(r+"").trim().substr((u+"").length)||"px",l=je.style,f=pr.test(e),d="svg"===t.tagName.toLowerCase(),c=(d?"client":"offset")+(f?"Width":"Height"),p="px"===i,_="%"===i;if(i===h||!u||br[i]||br[h])return u;if("px"===h||p||(u=de(t,e,r,"px")),o=t.getCTM&&$d(t),(_||"%"===h)&&(hr[e]||~e.indexOf("adius")))return n=o?t.getBBox()[f?"width":"height"]:t[c],ka(_?u/n*100:u/100*n);if(l[f?"width":"height"]=100+(p?h:i),a="rem"!==i&&~e.indexOf("adius")||"em"===i&&t.appendChild&&!d?t:t.parentNode,o&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==Le&&a.appendChild||(a=Le.body),(s=a._gsap)&&_&&s.width&&f&&s.time===It.time&&!s.uncache)return ka(u/s.width*100);if(!_||"height"!==e&&"width"!==e)!_&&"%"!==h||wr[Td(a,"display")]||(l.position=Td(t,"position")),a===t&&(l.position="static"),a.appendChild(je),n=je[c],a.removeChild(je),l.position="absolute";else{var m=t.style[e];t.style[e]=100+i,n=t[c],m?t.style[e]=m:_d(t,e)}return f&&_&&((s=ha(a)).time=It.time,s.width=a[c]),ka(p?n*u/100:n&&u?100/n*u:0)}function fe(t,e,r,i){if(!r||"none"===r){var n=Tr(e,t,1),a=n&&Td(t,n,1);a&&a!==r?(e=n,r=a):"borderColor"===e&&(r=Td(t,"borderTopColor"))}var s,o,u,h,l,f,d,c,p,_,m,g=new we(this._pt,t.style,e,0,1,ge),v=0,y=0;if(g.b=r,g.e=i,r+="","var(--"===(i+="").substring(0,6)&&(i=Td(t,i.substring(4,i.indexOf(")")))),"auto"===i&&(f=t.style[e],t.style[e]=i,i=Td(t,e)||i,f?t.style[e]=f:_d(t,e)),Ib(s=[r,i]),i=s[1],u=(r=s[0]).match(nt)||[],(i.match(nt)||[]).length){for(;o=nt.exec(i);)d=o[0],p=i.substring(v,o.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),d!==(f=u[y++]||"")&&(h=parseFloat(f)||0,m=f.substr((h+"").length),"="===d.charAt(1)&&(d=ma(h,d)+m),c=parseFloat(d),_=d.substr((c+"").length),v=nt.lastIndex-_.length,_||(_=_||N.units[e]||m,v===i.length&&(i+=_,g.e+=_)),m!==_&&(h=de(t,e,f,_)||0),g._pt={_next:g._pt,p:p||1===y?p:",",s:h,c:c-h,m:l&&l<4||"zIndex"===e?Math.round:0});g.c=v<i.length?i.substring(v,i.length):""}else g.r="display"===e&&"none"===i?Ed:Dd;return st.test(i)&&(g.e=0),this._pt=g}function he(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]=kr[r]||r,e[1]=kr[i]||i,e.join(" ")}function ie(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],hr[r]&&(i=1,r="transformOrigin"===r?vr:gr),_d(a,r);i&&(_d(a,gr),u&&(u.svg&&a.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Pr(a,1),u.uncache=1,Od(s)))}}function me(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t}function ne(t){var e=Td(t,gr);return me(e)?Mr:e.substr(7).match(it).map(ka)}function oe(t,e){var r,i,n,a,s=t._gsap||ha(t),o=t.style,u=ne(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(",")?Mr:u:(u!==Mr||t.offsetParent||t===Ye||s.svg||(n=o.display,o.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(a=1,i=t.nextElementSibling,Ye.appendChild(t)),u=ne(t),n?o.display=n:_d(t,"display"),a&&(i?r.insertBefore(t,i):r?r.appendChild(t):Ye.removeChild(t))),e&&6<u.length?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)}function pe(t,e,r,i,n,a){var s,o,u,h=t._gsap,l=n||oe(t,!0),f=h.xOrigin||0,d=h.yOrigin||0,c=h.xOffset||0,p=h.yOffset||0,_=l[0],m=l[1],g=l[2],v=l[3],y=l[4],T=l[5],b=e.split(" "),w=parseFloat(b[0])||0,x=parseFloat(b[1])||0;r?l!==Mr&&(o=_*v-m*g)&&(u=w*(-m/o)+x*(_/o)-(_*T-m*y)/o,w=w*(v/o)+x*(-g/o)+(g*T-v*y)/o,x=u):(w=(s=Zd(t)).x+(~b[0].indexOf("%")?w/100*s.width:w),x=s.y+(~(b[1]||b[0]).indexOf("%")?x/100*s.height:x)),i||!1!==i&&h.smooth?(y=w-f,T=x-d,h.xOffset=c+(y*_+T*g)-y,h.yOffset=p+(y*m+T*v)-T):h.xOffset=h.yOffset=0,h.xOrigin=w,h.yOrigin=x,h.smooth=!!i,h.origin=e,h.originIsAbsolute=!!r,t.style[vr]="0px 0px",a&&(ae(a,h,"xOrigin",f,w),ae(a,h,"yOrigin",d,x),ae(a,h,"xOffset",c,h.xOffset),ae(a,h,"yOffset",p,h.yOffset)),t.setAttribute("data-svg-origin",w+" "+x)}function se(t,e,r){var i=_a(e);return ka(parseFloat(e)+parseFloat(de(t,"x",r+"px",i)))+i}function ze(t,e,i,n,a){var s,o,u=360,h=r(a),l=parseFloat(a)*(h&&~a.indexOf("rad")?lr:1)-n,f=n+l+"deg";return h&&("short"===(s=a.split("_")[1])&&(l%=u)!==l%180&&(l+=l<0?u:-u),"cw"===s&&l<0?l=(l+36e9)%u-~~(l/u)*u:"ccw"===s&&0<l&&(l=(l-36e9)%u-~~(l/u)*u)),t._pt=o=new we(t._pt,e,i,n,l,zd),o.e=f,o.u="deg",t._props.push(i),o}function Ae(t,e){for(var r in e)t[r]=e[r];return t}function Be(t,e,r){var i,n,a,s,o,u,h,l=Ae({},r._gsap),f=r.style;for(n in l.svg?(a=r.getAttribute("transform"),r.setAttribute("transform",""),f[gr]=e,i=Pr(r,1),_d(r,gr),r.setAttribute("transform",a)):(a=getComputedStyle(r)[gr],f[gr]=e,i=Pr(r,1),f[gr]=a),hr)(a=l[n])!==(s=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=_a(a)!==(h=_a(s))?de(r,n,a,h):parseFloat(a),u=parseFloat(s),t._pt=new we(t._pt,i,n,o,u-o,yd),t._pt.u=h||0,t._props.push(n));Ae(i,l)}var Ie,Le,Ye,Ne,je,Ve,Ue,Xe,qe=Bt.Power0,Ze=Bt.Power1,We=Bt.Power2,He=Bt.Power3,Je=Bt.Power4,Qe=Bt.Linear,Ge=Bt.Quad,Ke=Bt.Cubic,$e=Bt.Quart,tr=Bt.Quint,er=Bt.Strong,rr=Bt.Elastic,ir=Bt.Back,nr=Bt.SteppedEase,ar=Bt.Bounce,sr=Bt.Sine,or=Bt.Expo,ur=Bt.Circ,hr={},lr=180/Math.PI,fr=Math.PI/180,dr=Math.atan2,cr=/([A-Z])/g,pr=/(left|right|width|margin|padding|x)/i,_r=/[\s,\(]\S/,mr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},gr="transform",vr=gr+"Origin",yr="O,Moz,ms,Ms,Webkit".split(","),Tr=function _checkPropPrefix(t,e,r){var i=(e||je).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(yr[n]+t in i););return n<0?null:(3===n?"ms":0<=n?yr[n]:"")+t},br={deg:1,rad:1,turn:1},wr={grid:1,flex:1},xr=function _get(t,e,r,i){var n;return Ne||Wd(),e in mr&&"transform"!==e&&~(e=mr[e]).indexOf(",")&&(e=e.split(",")[0]),hr[e]&&"transform"!==e?(n=Pr(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:Ar(Td(t,vr))+" "+n.zOrigin+"px"):(n=t.style[e])&&"auto"!==n&&!i&&!~(n+"").indexOf("calc(")||(n=Or[e]&&Or[e](t,e,r)||Td(t,e)||ia(t,e)||("op
6298acity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?de(t,e,n,r)+r:n},kr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Or={clearProps:function clearProps(t,e,r,i,n){if("isFromStart"!==n.data){var a=t._pt=new we(t._pt,e,r,0,0,ie);return a.u=i,a.pr=-10,a.tween=n,t._props.push(r),1}}},Mr=[1,0,0,1,0,0],Cr={},Pr=function _parseTransform(t,e){var r=t._gsap||new Xt(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,a,s,o,u,h,l,f,d,c,p,_,m,g,v,y,T,b,w,x,k,O,M,C,P,A,D,S,z,E,R,F=t.style,I=r.scaleX<0,L="deg",B=getComputedStyle(t),Y=Td(t,vr)||"0";return i=n=a=u=h=l=f=d=c=0,s=o=1,r.svg=!(!t.getCTM||!$d(t)),B.translate&&("none"===B.translate&&"none"===B.scale&&"none"===B.rotate||(F[gr]=("none"!==B.translate?"translate3d("+(B.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==B.rotate?"rotate("+B.rotate+") ":"")+("none"!==B.scale?"scale("+B.scale.split(" ").join(",")+") ":"")+("none"!==B[gr]?B[gr]:"")),F.scale=F.rotate=F.translate="none"),m=oe(t,r.svg),r.svg&&(M=r.uncache?(C=t.getBBox(),Y=r.xOrigin-C.x+"px "+(r.yOrigin-C.y)+"px",""):!e&&t.getAttribute("data-svg-origin"),pe(t,M||Y,!!M||r.originIsAbsolute,!1!==r.smooth,m)),p=r.xOrigin||0,_=r.yOrigin||0,m!==Mr&&(T=m[0],b=m[1],w=m[2],x=m[3],i=k=m[4],n=O=m[5],6===m.length?(s=Math.sqrt(T*T+b*b),o=Math.sqrt(x*x+w*w),u=T||b?dr(b,T)*lr:0,(f=w||x?dr(w,x)*lr+u:0)&&(o*=Math.abs(Math.cos(f*fr))),r.svg&&(i-=p-(p*T+_*w),n-=_-(p*b+_*x))):(R=m[6],z=m[7],A=m[8],D=m[9],S=m[10],E=m[11],i=m[12],n=m[13],a=m[14],h=(g=dr(R,S))*lr,g&&(M=k*(v=Math.cos(-g))+A*(y=Math.sin(-g)),C=O*v+D*y,P=R*v+S*y,A=k*-y+A*v,D=O*-y+D*v,S=R*-y+S*v,E=z*-y+E*v,k=M,O=C,R=P),l=(g=dr(-w,S))*lr,g&&(v=Math.cos(-g),E=x*(y=Math.sin(-g))+E*v,T=M=T*v-A*y,b=C=b*v-D*y,w=P=w*v-S*y),u=(g=dr(b,T))*lr,g&&(M=T*(v=Math.cos(g))+b*(y=Math.sin(g)),C=k*v+O*y,b=b*v-T*y,O=O*v-k*y,T=M,k=C),h&&359.9<Math.abs(h)+Math.abs(u)&&(h=u=0,l=180-l),s=ka(Math.sqrt(T*T+b*b+w*w)),o=ka(Math.sqrt(O*O+R*R)),g=dr(k,O),f=2e-4<Math.abs(g)?g*lr:0,c=E?1/(E<0?-E:E):0),r.svg&&(M=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!me(Td(t,gr)),M&&t.setAttribute("transform",M))),90<Math.abs(f)&&Math.abs(f)<270&&(I?(s*=-1,f+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,f+=f<=0?180:-180)),e=e||r.uncache,r.x=i-((r.xPercent=i&&(!e&&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&&(!e&&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=ka(s),r.scaleY=ka(o),r.rotation=ka(u)+L,r.rotationX=ka(h)+L,r.rotationY=ka(l)+L,r.skewX=f+L,r.skewY=d+L,r.transformPerspective=c+"px",(r.zOrigin=parseFloat(Y.split(" ")[2])||!e&&r.zOrigin||0)&&(F[vr]=Ar(Y)),r.xOffset=r.yOffset=0,r.force3D=N.force3D,r.renderTransform=r.svg?Fr:Xe?Rr:Dr,r.uncache=0,r},Ar=function _firstTwoOnly(t){return(t=t.split(" "))[0]+" "+t[1]},Dr=function _renderNon3DTransforms(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Rr(t,e)},Sr="0deg",zr="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,c=r.scaleX,p=r.scaleY,_=r.transformPerspective,m=r.force3D,g=r.target,v=r.zOrigin,y="",T="auto"===m&&t&&1!==t||!0===m;if(v&&(l!==Sr||h!==Sr)){var b,w=parseFloat(h)*fr,x=Math.sin(w),k=Math.cos(w);w=parseFloat(l)*fr,b=Math.cos(w),a=se(g,a,x*b*-v),s=se(g,s,-Math.sin(w)*-v),o=se(g,o,k*b*-v+v)}_!==zr&&(y+="perspective("+_+Er),(i||n)&&(y+="translate("+i+"%, "+n+"%) "),!T&&a===zr&&s===zr&&o===zr||(y+=o!==zr||T?"translate3d("+a+", "+s+", "+o+") ":"translate("+a+", "+s+Er),u!==Sr&&(y+="rotate("+u+Er),h!==Sr&&(y+="rotateY("+h+Er),l!==Sr&&(y+="rotateX("+l+Er),f===Sr&&d===Sr||(y+="skew("+f+", "+d+Er),1===c&&1===p||(y+="scale("+c+", "+p+Er),g.style[gr]=y||"translate(0, 0)"},Fr=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,c=o.skewX,p=o.skewY,_=o.scaleX,m=o.scaleY,g=o.target,v=o.xOrigin,y=o.yOrigin,T=o.xOffset,b=o.yOffset,w=o.forceCSS,x=parseFloat(l),k=parseFloat(f);d=parseFloat(d),c=parseFloat(c),(p=parseFloat(p))&&(c+=p=parseFloat(p),d+=p),d||c?(d*=fr,c*=fr,r=Math.cos(d)*_,i=Math.sin(d)*_,n=Math.sin(d-c)*-m,a=Math.cos(d-c)*m,c&&(p*=fr,s=Math.tan(c-p),n*=s=Math.sqrt(1+s*s),a*=s,p&&(s=Math.tan(p),r*=s=Math.sqrt(1+s*s),i*=s)),r=ka(r),i=ka(i),n=ka(n),a=ka(a)):(r=_,a=m,i=n=0),(x&&!~(l+"").indexOf("px")||k&&!~(f+"").indexOf("px"))&&(x=de(g,"x",l,"px"),k=de(g,"y",f,"px")),(v||y||T||b)&&(x=ka(x+v-(v*r+y*n)+T),k=ka(k+y-(v*i+y*a)+b)),(u||h)&&(s=g.getBBox(),x=ka(x+u/100*s.width),k=ka(k+h/100*s.height)),s="matrix("+r+","+i+","+n+","+a+","+x+","+k+")",g.setAttribute("transform",s),w&&(g.style[gr]=s)};ja("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});Or[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 xr(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 Ir,Lr,Br,Yr={name:"css",register:Wd,targetTest:function targetTest(t){return t.style&&t.nodeType},init:function init(t,e,i,n,a){var s,o,u,h,l,f,d,c,p,_,m,g,v,y,T,b,w,x=this._props,k=t.style,O=i.vars.startAt;for(d in Ne||Wd(),this.styles=this.styles||Qd(t),b=this.styles.props,this.tween=i,e)if("autoRound"!==d&&(o=e[d],!mt[d]||!dc(d,e,i,n,t,a)))if(l=typeof o,f=Or[d],"function"===l&&(l=typeof(o=o.call(i,n,t,a))),"string"===l&&~o.indexOf("random(")&&(o=rb(o)),f)f(this,t,d,o,i)&&(T=1);else if("--"===d.substr(0,2))s=(getComputedStyle(t).getPropertyValue(d)+"").trim(),o+="",Rt.lastIndex=0,Rt.test(s)||(c=_a(s),(p=_a(o))?c!==p&&(s=de(t,d,s,p)+p):c&&(o+=c)),this.add(k,"setProperty",s,o,n,a,0,0,d),x.push(d),b.push(d,0,k[d]);
vendor: 5,358 bytes, lines 6298-6356
6298else if("undefined"!==l){if(O&&d in O?(s="function"==typeof O[d]?O[d].call(i,n,t,a):O[d],r(s)&&~s.indexOf("random(")&&(s=rb(s)),_a(s+"")||"auto"===s||(s+=N.units[d]||_a(xr(t,d))||""),"="===(s+"").charAt(1)&&(s=xr(t,d))):s=xr(t,d),h=parseFloat(s),(_="string"===l&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),u=parseFloat(o),d in mr&&("autoAlpha"===d&&(1===h&&"hidden"===xr(t,"visibility")&&u&&(h=0),b.push("visibility",0,k.visibility),ae(this,k,"visibility",h?"inherit":"hidden",u?"inherit":"hidden",!u)),"scale"!==d&&"transform"!==d&&~(d=mr[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in hr){if(this.styles.save(d),w=o,"string"===l&&"var(--"===o.substring(0,6)){if("calc("===(o=Td(t,o.substring(4,o.indexOf(")")))).substring(0,5)){var M=t.style.perspective;t.style.perspective=o,o=Td(t,"perspective"),M?t.style.perspective=M:_d(t,"perspective")}u=parseFloat(o)}if(g||((v=t._gsap).renderTransform&&!e.parseTransform||Pr(t,e.parseTransform),y=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new we(this._pt,k,gr,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new we(this._pt,v,"scaleY",v.scaleY,(_?ma(v.scaleY,_+u):u)-v.scaleY||0,yd),this._pt.u=0,x.push("scaleY",d),d+="X";else{if("transformOrigin"===d){b.push(vr,0,k[vr]),o=he(o),v.svg?pe(t,o,0,y,0,this):((p=parseFloat(o.split(" ")[2])||0)!==v.zOrigin&&ae(this,v,"zOrigin",v.zOrigin,p),ae(this,k,d,Ar(s),Ar(o)));continue}if("svgOrigin"===d){pe(t,o,1,y,0,this);continue}if(d in Cr){ze(this,v,d,h,_?ma(h,_+o):o);continue}if("smoothOrigin"===d){ae(this,v,"smooth",v.smooth,o);continue}if("force3D"===d){v[d]=o;continue}if("transform"===d){Be(this,o,t);continue}}}else d in k||(d=Tr(d)||d);if(m||(u||0===u)&&(h||0===h)&&!_r.test(o)&&d in k)u=u||0,(c=(s+"").substr((h+"").length))!==(p=_a(o)||(d in N.units?N.units[d]:c))&&(h=de(t,d,s,p)),this._pt=new we(this._pt,m?v:k,d,h,(_?ma(h,_+u):u)-h,m||"px"!==p&&"zIndex"!==d||!1===e.autoRound?yd:Cd),this._pt.u=p||0,m&&w!==o?(this._pt.b=s,this._pt.e=w,this._pt.r=Bd):c!==p&&"%"!==p&&(this._pt.b=s,this._pt.r=Ad);else if(d in k)fe.call(this,t,d,s,_?_+o:o);else if(d in t)this.add(t,d,s||t[d],_?_+o:o,n,a);else if("parseTransform"!==d){S(d,o);continue}m||(d in k?b.push(d,0,k[d]):"function"==typeof t[d]?b.push(d,2,t[d]()):b.push(d,1,s||t[d])),x.push(d)}T&&be(this)},render:function render(t,e){if(e.tween._time||!Ue())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:xr,aliases:mr,getSetter:function getSetter(t,e,r){var i=mr[e];return i&&i.indexOf(",")<0&&(e=i),e in hr&&e!==vr&&(t._gsap.x||xr(t,"x"))?r&&Ve===r?"scale"===e?Id:Hd:(Ve=r||{})&&("scale"===e?Jd:Kd):t.style&&!u(t.style[e])?Fd:~e.indexOf("-")?Gd:le(t,e)},core:{_removeProperty:_d,_getMatrix:oe}};Fe.utils.checkPrefix=Tr,Fe.core.getStyleSaver=Qd,Br=ja((Ir="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Lr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){hr[t]=1}),ja(Lr,function(t){N.units[t]="deg",Cr[t]=1}),mr[Br[13]]=Ir+","+Lr,ja("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");mr[e[1]]=Br[e[0]]}),ja("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){N.units[t]="px"}),Fe.registerPlugin(Yr);var Nr=Fe.registerPlugin(Yr)||Fe,jr=Nr.core.Tween;e.Back=ir,e.Bounce=ar,e.CSSPlugin=Yr,e.Circ=ur,e.Cubic=Ke,e.Elastic=rr,e.Expo=or,e.Linear=Qe,e.Power0=qe,e.Power1=Ze,e.Power2=We,e.Power3=He,e.Power4=Je,e.Quad=Ge,e.Quart=$e,e.Quint=tr,e.Sine=sr,e.SteppedEase=nr,e.Strong=er,e.TimelineLite=Zt,e.TimelineMax=Zt,e.TweenLite=te,e.TweenMax=jr,e.default=Nr,e.gsap=Nr;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});
6299
6300
6301/*!
6302 * ScrollMagic v2.0.8 (2020-08-14)
6303 * The javascript library for magical scroll interactions.
6304 * (c) 2020 Jan Paepke (@janpaepke)
6305 * Project Website: http://scrollmagic.io
6306 * 
6307 * @version 2.0.8
6308 * @license Dual licensed under MIT license and GPL.
6309 * @author Jan Paepke - [email protected]
6310 *
6311 * @file ScrollMagic main library.
6312 */
6313/**
6314 * @namespace ScrollMagic
6315 */
6316(function (root, factory) {
6317	if (typeof define === 'function' && define.amd) {
6318		// AMD. Register as an anonymous module.
6319		define(factory);
6320	} else if (typeof exports === 'object') {
6321		// CommonJS
6322		module.exports = factory();
6323	} else {
6324		// Browser global
6325		root.ScrollMagic = factory();
6326	}
6327}(this, function () {
6328	"use strict";
6329
6330	var ScrollMagic = function () {
6331		_util.log(2, '(COMPATIBILITY NOTICE) -> As of ScrollMagic 2.0.0 you need to use \'new ScrollMagic.Controller()\' to create a new controller instance. Use \'new ScrollMagic.Scene()\' to instance a scene.');
6332	};
6333
6334	ScrollMagic.version = "2.0.8";
6335
6336	// TODO: temporary workaround for chrome's scroll jitter bug
6337	if (typeof (window) !== 'undefined') {
6338		window.addEventListener("mousewheel", void(0));
6339	}
6340
6341	// global const
6342	var PIN_SPACER_ATTRIBUTE = "data-scrollmagic-pin-spacer";
6343
6344	/**
6345	 * The main class that is needed once per scroll container.
6346	 *
6347	 * @class
6348	 *
6349	 * @example
6350	 * // basic initialization
6351	 * var controller = new ScrollMagic.Controller();
6352	 *
6353	 * // passing options
6354	 * var controller = new ScrollMagic.Controller({container: "#myContainer", loglevel: 3});
6355	 *
6356	 * @param {object}
6356 [options] - An object containing one or more options for the controller.
6357	 * @param {(string|object)} [options.container=window] - A selector, DOM object that references the main container for scrolling.
6358	 * @param {boolean} [options.vertical=true] - Sets the scroll mode to vertical (`true`) or horizontal (`false`) scrolling.
6359	 * @param {object} [options.globalSceneOptions={}] - These options will be passed to every Scene that is added to the controller using the addScene method. For more information on Scene options see {@link ScrollMagic.Scene}.
6360	 * @param {number} [options.loglevel=2] Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic.
6361											 ** `0` => silent
6362											 ** `1` => errors
6363											 ** `2` => errors, warnings
6364											 ** `3` => errors, warnings, debuginfo
6365	 * @param {boolean} [options.refreshInterval=100] - Some changes don't call events by default, like changing the container size or moving a scene trigger element.  
6366	 																										 This interval polls these parameters to fire the necessary events.  
6367	 																										 If you don't use custom containers, trigger elements or have static layouts, where the positions of the trigger elements don't change, you can set this to 0 disable interval checking and improve performance.
6368	 *
6369	 */
6370	ScrollMagic.Controller = function (options) {
6371		/*
6372		 * ----------------------------------------------------------------
6373		 * settings
6374		 * ----------------------------------------------------------------
6375		 */
6376		var
6377			NAMESPACE = 'ScrollMagic.Controller',
6378			SCROLL_DIRECTION_FORWARD = 'FORWARD',
6379			SCROLL_DIRECTION_REVERSE = 'REVERSE',
6380			SCROLL_DIRECTION_PAUSED = 'PAUSED',
6381			DEFAULT_OPTIONS = CONTROLLER_OPTIONS.defaults;
6382
6383		/*
6384		 * ----------------------------------------------------------------
6385		 * private vars
6386		 * ----------------------------------------------------------------
6387		 */
6388		var
6389			Controller = this,
6390			_options = _util.extend({}, DEFAULT_OPTIONS, options),
6391			_sceneObjects = [],
6392			_updateScenesOnNextCycle = false, // can be boolean (true => all scenes) or an array of scenes to be updated
6393			_scrollPos = 0,
6394			_scrollDirection = SCROLL_DIRECTION_PAUSED,
6395			_isDocument = true,
6396			_viewPortSize = 0,
6397			_enabled = true,
6398			_updateTimeout,
6399			_refreshTimeout;
6400
6401		/*
6402		 * ----------------------------------------------------------------
6403		 * private functions
6404		 * ----------------------------------------------------------------
6405		 */
6406
6407		/**
6408		 * Internal constructor function of the ScrollMagic Controller
6409		 * @private
6410		 */
6411		var construct = function () {
6412			for (var key in _options) {
6413				if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {
6414					log(2, "WARNING: Unknown option \"" + key + "\"");
6415					delete _options[key];
6416				}
6417			}
6418			_options.container = _util.get.elements(_options.container)[0];
6419			// check ScrollContainer
6420			if (!_options.container) {
6421				log(1, "ERROR creating object " + NAMESPACE + ": No valid scroll container supplied");
6422				throw NAMESPACE + " init failed."; // cancel
6423			}
6424			_isDocument = _options.container === window || _options.container === document.body || !document.body.contains(_options.container);
6425			// normalize to window
6426			if (_isDocument) {
6427				_options.container = window;
6428			}
6429			// update container size immediately
6430			_viewPortSize = getViewportSize();
6431			// set event handlers
6432			_options.container.addEventListener("resize", onChange);
6433			_options.container.addEventListener("scroll", onChange);
6434
6435			var ri = parseInt(_options.refreshInterval, 10);
6436			_options.refreshInterval = _util.type.Number(ri) ? ri : DEFAULT_OPTIONS.refreshInterval;
6437			scheduleRefresh();
6438
6439			log(3, "added new " + NAMESPACE + " controller (v" + ScrollMagic.version + ")");
6440		};
6441
6442		/**
6443		 * Schedule the next execution of the refresh function
6444		 * @private
6445		 */
6446		var scheduleRefresh = function () {
6447			if (_options.refreshInterval > 0) {
6448				_refreshTimeout = window.setTimeout(refresh, _options.refreshInterval);
6449			}
6450		};
6451
6452		/**
6453		 * Default function to get scroll pos - overwriteable using `Controller.scrollPos(newFunction)`
6454		 * @private
6455		 */
6456		var getScrollPos = function () {
6457			return _options.vertical ? _util.get.scrollTop(_options.container) : _util.get.scrollLeft(_options.container);
6458		};
6459
6460		/**
6461		 * Returns the current viewport Size (width vor horizontal, height for vertical)
6462		 * @private
6463		 */
6464		var getViewportSize = function () {
6465			return _options.vertical ? _util.get.height(_options.container) : _util.get.width(_options.container);
6466		};
6467
6468		/**
6469		 * Default function to set scroll pos - overwriteable using `Controller.scrollTo(newFunction)`
6470		 * Make available publicly for pinned mousewheel workaround.
6471		 * @private
6472		 */
6473		var setScrollPos = this._setScrollPos = function (pos) {
6474			if (_options.vertical) {
6475				if (_isDocument) {
6476					window.scrollTo(_util.get.scrollLeft(), pos);
6477				} else {
6478					_options.container.scrollTop = pos;
6479				}
6480			} else {
6481				if (_isDocument) {
6482					window.scrollTo(pos, _util.get.scrollTop());
6483				} else {
6484					_options.container.scrollLeft = pos;
6485				}
6486			}
6487		};
6488
6489		/**
6490		 * Handle updates in cycles instead of on scroll (performance)
6491		 * @private
6492		 */
6493		var updateScenes = function () {
6494			if (_enabled && _updateScenesOnNextCycle) {
6495				// determine scenes to update
6496				var scenesToUpdate = _util.type.Array(_updateScenesOnNextCycle) ? _updateScenesOnNextCycle : _sceneObjects.slice(0);
6497				// reset scenes
6498				_updateScenesOnNextCycle = false;
6499				var oldScrollPos = _scrollPos;
6500				// update scroll pos now instead of onChange, as it might have changed since scheduling (i.e. in-browser smooth scroll)
6501				_scrollPos = Controller.scrollPos();
6502				var deltaScroll = _scrollPos - oldScrollPos;
6503				if (deltaScroll !== 0) { // scroll position changed?
6504					_scrollDirection = (deltaScroll > 0) ? SCROLL_DIRECTION_FORWARD : SCROLL_DIRECTION_REVERSE;
6505				}
6506				// reverse order of scenes if scrolling reverse
6507				if (_scrollDirection === SCROLL_DIRECTION_REVERSE) {
6508					scenesToUpdate.reverse();
6509				}
6510				// update scenes
6511				scenesToUpdate.forEach(function (scene, index) {
6512					log(3, "updating Scene " + (index + 1) + "/" + scenesToUpdate.length + " (" + _sceneObjects.length + " total)");
6513					scene.update(true);
6514				});
6515				if (scenesToUpdate.length === 0 && _options.loglevel >= 3) {
6516					log(3, "updating 0 Scenes (nothing added to controller)");
6517				}
6518			}
6519		};
6520
6521		/**
6522		 * Initializes rAF callback
6523		 * @private
6524		 */
6525		var debounceUpdate = function () {
6526			_updateTimeout = _util.rAF(updateScenes);
6527		};
6528
6529		/**
6530		 * Handles Container changes
6531		 * @private
6532		 */
6533		var onChange = function (e) {
6534			log(3, "event fired causing an update:", e.type);
6535			if (e.type == "resize") {
6536				// resize
6537				_viewPortSize = getViewportSize();
6538				_scrollDirection = SCROLL_DIRECTION_PAUSED;
6539			}
6540			// schedule update
6541			if (_updateScenesOnNextCycle !== true) {
6542				_updateScenesOnNextCycle = true;
6543				debounceUpdate();
6544			}
6545		};
6546
6547		var refresh = function () {
6548			if (!_isDocument) {
6549				// simulate resize event. Only works for viewport relevant param (performance)
6550				if (_viewPortSize != getViewportSize()) {
6551					var resizeEvent;
6552					try {
6553						resizeEvent = new Event('resize', {
6554							bubbles: false,
6555							cancelable: false
6556						});
6557					} catch (e) { // stupid IE
6558						resizeEvent = document.createEvent("Event");
6559						resizeEvent.initEvent("resize", false, false);
6560					}
6561					_options.container.dispatchEvent(resizeEvent);
6562				}
6563			}
6564			_sceneObjects.forEach(function (scene, index) { // refresh all scenes
6565				scene.refresh();
6566			});
6567			scheduleRefresh();
6568		};
6569
6570		/**
6571		 * Send a debug message to the console.
6572		 * provided publicly with _log for plugins
6573		 * @private
6574		 *
6575		 * @param {number} loglevel - The loglevel required to initiate output for the message.
6576		 * @param {...mixed} output - One or more variables that should be passed to the console.
6577		 */
6578		var log = this._log = function (loglevel, output) {
6579			if (_options.loglevel >= loglevel) {
6580				Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->");
6581				_util.log.apply(window, arguments);
6582			}
6583		};
6584		// for scenes we have getters for each option, but for the controller we don't, so we need to make it available externally for plugins
6585		this._options = _options;
6586
6587		/**
6588		 * Sort scenes in ascending order of their start offset.
6589		 * @private
6590		 *
6591		 * @param {array} ScenesArray - an array of ScrollMagic Scenes that should be sorted
6592		 * @return {array} The sorted array of Scenes.
6593		 */
6594		var sortScenes = function (ScenesArray) {
6595			if (ScenesArray.length <= 1) {
6596				return ScenesArray;
6597			} else {
6598				var scenes = ScenesArray.slice(0);
6599				scenes.sort(function (a, b) {
6600					return a.scrollOffset() > b.scrollOffset() ? 1 : -1;
6601				});
6602				return scenes;
6603			}
6604		};
6605
6606		/**
6607		 * ----------------------------------------------------------------
6608		 * public functions
6609		 * ----------------------------------------------------------------
6610		 */
6611
6612		/**
6613		 * Add one ore more scene(s) to the controller.  
6614		 * This is the equivalent to `Scene.addTo(controller)`.
6615		 * @public
6616		 * @example
6617		 * // with a previously defined scene
6618		 * controller.addScene(scene);
6619		 *
6620		 * // with a newly created scene.
6621		 * controller.addScene(new ScrollMagic.Scene({duration : 0}));
6622		 *
6623		 * // adding multiple scenes
6624		 * controller.addScene([scene, scene2, new ScrollMagic.Scene({duration : 0})]);
6625		 *
6626		 * @param {(ScrollMagic.Scene|array)} newScene - ScrollMagic Scene or Array of Scenes to be added to the controller.
6627		 * @return {Controller} Parent object for chaining.
6628		 */
6629		this.addScene = function (newScene) {
6630			if (_util.type.Array(newScene)) {
6631				newScene.forEach(function (scene, index) {
6632					Controller.addScene(scene);
6633				});
6634			} else if (newScene instanceof ScrollMagic.Scene) {
6635				if (newScene.controller() !== Controller) {
6636					newScene.addTo(Controller);
6637				} else if (_sceneObjects.indexOf(newScene) < 0) {
6638					// new scene
6639					_sceneObjects.push(newScene); // add to array
6640					_sceneObjects = sortScenes(_sceneObjects); // sort
6641					newScene.on("shift.controller_sort", function () { // resort whenever scene moves
6642						_sceneObjects = sortScenes(_sceneObjects);
6643					});
6644					// insert Global defaults.
6645					for (var key in _options.globalSceneOptions) {
6646						if (newScene[key]) {
6647							newScene[key].call(newScene, _options.globalSceneOptions[key]);
6648						}
6649					}
6650					log(3, "adding Scene (now " + _sceneObjects.length + " total)");
6651				}
6652			} else {
6653				log(1, "ERROR: invalid argument supplied for '.addScene()'");
6654			}
6655			return Controller;
6656		};
6657
6658		/**
6659		 * Remove one ore more scene(s) from the controller.  
6660		 * This is the equivalent to `Scene.remove()`.
6661		 * @public
6662		 * @example
6663		 * // remove a scene from the controller
6664		 * controller.removeScene(scene);
6665		 *
6666		 * // remove multiple scenes from the controller
6667		 * controller.removeScene([scene, scene2, scene3]);
6668		 *
6669		 * @param {(ScrollMagic.Scene|array)}
6669 Scene - ScrollMagic Scene or Array of Scenes to be removed from the controller.
6670		 * @returns {Controller} Parent object for chaining.
6671		 */
6672		this.removeScene = function (Scene) {
6673			if (_util.type.Array(Scene)) {
6674				Scene.forEach(function (scene, index) {
6675					Controller.removeScene(scene);
6676				});
6677			} else {
6678				var index = _sceneObjects.indexOf(Scene);
6679				if (index > -1) {
6680					Scene.off("shift.controller_sort");
6681					_sceneObjects.splice(index, 1);
6682					log(3, "removing Scene (now " + _sceneObjects.length + " left)");
6683					Scene.remove();
6684				}
6685			}
6686			return Controller;
6687		};
6688
6689		/**
6690	 * Update one ore more scene(s) according to the scroll position of the container.  
6691	 * This is the equivalent to `Scene.update()`.  
6692	 * The update method calculates the scene's start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container.  
6693	 * It then updates the current scene state accordingly (or does nothing, if the state is already correct) – Pins will be set to their correct position and tweens will be updated to their correct progress.  
6694	 * _**Note:** This method gets called constantly whenever Controller detects a change. The only application for you is if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._
6695	 * @public
6696	 * @example
6697	 * // update a specific scene on next cycle
6698 	 * controller.updateScene(scene);
6699 	 *
6700	 * // update a specific scene immediately
6701	 * controller.updateScene(scene, true);
6702 	 *
6703	 * // update multiple scenes scene on next cycle
6704	 * controller.updateScene([scene1, scene2, scene3]);
6705	 *
6706	 * @param {ScrollMagic.Scene} Scene - ScrollMagic Scene or Array of Scenes that is/are supposed to be updated.
6707	 * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle.  
6708	 										  This is useful when changing multiple properties of the scene - this way it will only be updated once all new properties are set (updateScenes).
6709	 * @return {Controller} Parent object for chaining.
6710	 */
6711		this.updateScene = function (Scene, immediately) {
6712			if (_util.type.Array(Scene)) {
6713				Scene.forEach(function (scene, index) {
6714					Controller.updateScene(scene, immediately);
6715				});
6716			} else {
6717				if (immediately) {
6718					Scene.update(true);
6719				} else if (_updateScenesOnNextCycle !== true && Scene instanceof ScrollMagic.Scene) { // if _updateScenesOnNextCycle is true, all connected scenes are already scheduled for update
6720					// prep array for next update cycle
6721					_updateScenesOnNextCycle = _updateScenesOnNextCycle || [];
6722					if (_updateScenesOnNextCycle.indexOf(Scene) == -1) {
6723						_updateScenesOnNextCycle.push(Scene);
6724					}
6725					_updateScenesOnNextCycle = sortScenes(_updateScenesOnNextCycle); // sort
6726					debounceUpdate();
6727				}
6728			}
6729			return Controller;
6730		};
6731
6732		/**
6733		 * Updates the controller params and calls updateScene on every scene, that is attached to the controller.  
6734		 * See `Controller.updateScene()` for more information about what this means.  
6735		 * In most cases you will not need this function, as it is called constantly, whenever ScrollMagic detects a state change event, like resize or scroll.  
6736		 * The only application for this method is when ScrollMagic fails to detect these events.  
6737		 * One application is with some external scroll libraries (like iScroll) that move an internal container to a negative offset instead of actually scrolling. In this case the update on the controller needs to be called whenever the child container's position changes.
6738		 * For this case there will also be the need to provide a custom function to calculate the correct scroll position. See `Controller.scrollPos()` for details.
6739		 * @public
6740		 * @example
6741		 * // update the controller on next cycle (saves performance due to elimination of redundant updates)
6742		 * controller.update();
6743		 *
6744		 * // update the controller immediately
6745		 * controller.update(true);
6746		 *
6747		 * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance)
6748		 * @return {Controller} Parent object for chaining.
6749		 */
6750		this.update = function (immediately) {
6751			onChange({
6752				type: "resize"
6753			}); // will update size and set _updateScenesOnNextCycle to true
6754			if (immediately) {
6755				updateScenes();
6756			}
6757			return Controller;
6758		};
6759
6760		/**
6761		 * Scroll to a numeric scroll offset, a DOM element, the start of a scene or provide an alternate method for scrolling.  
6762		 * For vertical controllers it will change the top scroll offset and for horizontal applications it will change the left offset.
6763		 * @public
6764		 *
6765		 * @since 1.1.0
6766		 * @example
6767		 * // scroll to an offset of 100
6768		 * controller.scrollTo(100);
6769		 *
6770		 * // scroll to a DOM element
6771		 * controller.scrollTo("#anchor");
6772		 *
6773		 * // scroll to the beginning of a scene
6774		 * var scene = new ScrollMagic.Scene({offset: 200});
6775		 * controller.scrollTo(scene);
6776		 *
6777		 * // define a new scroll position modification function (jQuery animate instead of jump)
6778		 * controller.scrollTo(function (newScrollPos) {
6779		 *	$("html, body").animate({scrollTop: newScrollPos});
6780		 * });
6781		 * controller.scrollTo(100); // call as usual, but the new function will be used instead
6782		 *
6783		 * // define a new scroll function with an additional parameter
6784		 * controller.scrollTo(function (newScrollPos, message) {
6785		 *  console.log(message);
6786		 *	$(this).animate({scrollTop: newScrollPos});
6787		 * });
6788		 * // call as usual, but supply an extra parameter to the defined custom function
6789		 * controller.scrollTo(100, "my message");
6790		 *
6791		 * // define a new scroll function with an additional parameter containing multiple variables
6792		 * controller.scrollTo(function (newScrollPos, options) {
6793		 *  someGlobalVar = options.a + options.b;
6794		 *	$(this).animate({scrollTop: newScrollPos});
6795		 * });
6796		 * // call as usual, but supply an extra parameter containing multiple options
6797		 * controller.scrollTo(100, {a: 1, b: 2});
6798		 *
6799		 * // define a new scroll function with a callback supplied as an additional parameter
6800		 * controller.scrollTo(function (newScrollPos, callback) {
6801		 *	$(this).animate({scrollTop: newScrollPos}, 400, "swing", callback);
6802		 * });
6803		 * // call as usual, but supply an extra parameter, which is used as a callback in the previously defined custom scroll function
6804		 * controller.scrollTo(100, function() {
6805		 *	console.log("scroll has finished.");
6806		 * });
6807		 *
6808		 * @param {mixed} scrollTarget - The supplied argument can be one of these types:
6809		 * 1. `number` -> The container will scroll to this new scroll offset.
6810		 * 2. `string` or `object` -> Can be a selector or a DOM object.  
6811		 *  The container will scroll to the position of this element.
6812		 * 3. `ScrollMagic Scene` -> The container will scroll to the start of this scene.
6813		 * 4. `function` -> This function will be used for future scroll position modifications.  
6814		 *  This provides a way for you to change the behaviour of scrolling and adding new behaviour like animation. The function receives the new scroll position as a parameter and a reference to the container element using `this`.  
6815		 *  It may also optionally receive an optional additional parameter (see below)  
6816		 *  _**NOTE:**  
6817		 *  All other options will still work as expected, using the new function to scroll._
6818		 * @param {mixed} [additionalParameter] - If a custom scroll function was defined (see above 4.), you may want to supply additional parameters to it, when calling it. You can do this using this parameter – see examples for details. Please note, that this parameter will have no effect, if you use the default scrolling function.
6819		 * @returns {Controller} Parent object for chaining.
6820		 */
6821		this.scrollTo = function (scrollTarget, additionalParameter) {
6822			if (_util.type.Number(scrollTarget)) { // excecute
6823				setScrollPos.call(_options.container, scrollTarget, additionalParameter);
6824			} else if (scrollTarget instanceof ScrollMagic.Scene) { // scroll to scene
6825				if (scrollTarget.controller() === Controller) { // check if the controller is associated with this scene
6826					Controller.scrollTo(scrollTarget.scrollOffset(), additionalParameter);
6827				} else {
6828					log(2, "scrollTo(): The supplied scene does not belong to this controller. Scroll cancelled.", scrollTarget);
6829				}
6830			} else if (_util.type.Function(scrollTarget)) { // assign new scroll function
6831				setScrollPos = scrollTarget;
6832			} else { // scroll to element
6833				var elem = _util.get.elements(scrollTarget)[0];
6834				if (elem) {
6835					// if parent is pin spacer, use spacer position instead so correct start position is returned for pinned elements.
6836					while (elem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) {
6837						elem = elem.parentNode;
6838					}
6839
6840					var
6841						param = _options.vertical ? "top" : "left", // which param is of interest ?
6842						containerOffset = _util.get.offset(_options.container), // container position is needed because element offset is returned in relation to document, not in relation to container.
6843						elementOffset = _util.get.offset(elem);
6844
6845					if (!_isDocument) { // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent
6846						containerOffset[param] -= Controller.scrollPos();
6847					}
6848
6849					Controller.scrollTo(elementOffset[param] - containerOffset[param], additionalParameter);
6850				} else {
6851					log(2, "scrollTo(): The supplied argument is invalid. Scroll cancelled.", scrollTarget);
6852				}
6853			}
6854			return Controller;
6855		};
6856
6857		/**
6858		 * **Get** the current scrollPosition or **Set** a new method to calculate it.  
6859		 * -> **GET**:
6860		 * When used as a getter this function will return the current scroll position.  
6861		 * To get a cached value use Controller.info("scrollPos"), which will be updated in the update cycle.  
6862		 * For vertical controllers it will return the top scroll offset and for horizontal applications it will return the left offset.
6863		 *
6864		 * -> **SET**:
6865		 * When used as a setter this method prodes a way to permanently overwrite the controller's scroll position calculation.  
6866		 * A typical usecase is when the scroll position is not reflected by the containers scrollTop or scrollLeft values, but for example by the inner offset of a child container.  
6867		 * Moving a child container inside a parent is a commonly used method for several scrolling frameworks, including iScroll.  
6868		 * By providing an alternate calculation function you can make sure ScrollMagic receives the correct scroll position.  
6869		 * Please also bear in mind that your function should return y values for vertical scrolls an x for horizontals.
6870		 *
6871		 * To change the current scroll position please use `Controller.scrollTo()`.
6872		 * @public
6873		 *
6874		 * @example
6875		 * // get the current scroll Position
6876		 * var scrollPos = controller.scrollPos();
6877		 *
6878		 * // set a new scroll position calculation method
6879		 * controller.scrollPos(function () {
6880		 *	return this.info("vertical") ? -mychildcontainer.y : -mychildcontainer.x
6881		 * });
6882		 *
6883		 * @param {function} [scrollPosMethod] - The function to be used for the scroll position calculation of the container.
6884		 * @returns {(number|Controller)} Current scroll position or parent object for chaining.
6885		 */
6886		this.scrollPos = function (scrollPosMethod) {
6887			if (!arguments.length) { // get
6888				return getScrollPos.call(Controller);
6889			} else { // set
6890				if (_util.type.Function(scrollPosMethod)) {
6891					getScrollPos = scrollPosMethod;
6892				} else {
6893					log(2, "Provided value for method 'scrollPos' is not a function. To change the current scroll position use 'scrollTo()'.");
6894				}
6895			}
6896			return Controller;
6897		};
6898
6899		/**
6900		 * **Get** all infos or one in particular about the controller.
6901		 * @public
6902		 * @example
6903		 * // returns the current scroll position (number)
6904		 * var scrollPos = controller.info("scrollPos");
6905		 *
6906		 * // returns all infos as an object
6907		 * var infos = controller.info();
6908		 *
6909		 * @param {string} [about] - If passed only this info will be returned instead of an object c
6909ontaining all.  
6910		 							 Valid options are:
6911		 							 ** `"size"` => the current viewport size of the container
6912		 							 ** `"vertical"` => true if vertical scrolling, otherwise false
6913		 							 ** `"scrollPos"` => the current scroll position
6914		 							 ** `"scrollDirection"` => the last known direction of the scroll
6915		 							 ** `"container"` => the container element
6916		 							 ** `"isDocument"` => true if container element is the document.
6917		 * @returns {(mixed|object)} The requested info(s).
6918		 */
6919		this.info = function (about) {
6920			var values = {
6921				size: _viewPortSize, // contains height or width (in regard to orientation);
6922				vertical: _options.vertical,
6923				scrollPos: _scrollPos,
6924				scrollDirection: _scrollDirection,
6925				container: _options.container,
6926				isDocument: _isDocument
6927			};
6928			if (!arguments.length) { // get all as an object
6929				return values;
6930			} else if (values[about] !== undefined) {
6931				return values[about];
6932			} else {
6933				log(1, "ERROR: option \"" + about + "\" is not available");
6934				return;
6935			}
6936		};
6937
6938		/**
6939		 * **Get** or **Set** the current loglevel option value.
6940		 * @public
6941		 *
6942		 * @example
6943		 * // get the current value
6944		 * var loglevel = controller.loglevel();
6945		 *
6946		 * // set a new value
6947		 * controller.loglevel(3);
6948		 *
6949		 * @param {number} [newLoglevel] - The new loglevel setting of the Controller. `[0-3]`
6950		 * @returns {(number|Controller)} Current loglevel or parent object for chaining.
6951		 */
6952		this.loglevel = function (newLoglevel) {
6953			if (!arguments.length) { // get
6954				return _options.loglevel;
6955			} else if (_options.loglevel != newLoglevel) { // set
6956				_options.loglevel = newLoglevel;
6957			}
6958			return Controller;
6959		};
6960
6961		/**
6962		 * **Get** or **Set** the current enabled state of the controller.  
6963		 * This can be used to disable all Scenes connected to the controller without destroying or removing them.
6964		 * @public
6965		 *
6966		 * @example
6967		 * // get the current value
6968		 * var enabled = controller.enabled();
6969		 *
6970		 * // disable the controller
6971		 * controller.enabled(false);
6972		 *
6973		 * @param {boolean} [newState] - The new enabled state of the controller `true` or `false`.
6974		 * @returns {(boolean|Controller)} Current enabled state or parent object for chaining.
6975		 */
6976		this.enabled = function (newState) {
6977			if (!arguments.length) { // get
6978				return _enabled;
6979			} else if (_enabled != newState) { // set
6980				_enabled = !!newState;
6981				Controller.updateScene(_sceneObjects, true);
6982			}
6983			return Controller;
6984		};
6985
6986		/**
6987		 * Destroy the Controller, all Scenes and everything.
6988		 * @public
6989		 *
6990		 * @example
6991		 * // without resetting the scenes
6992		 * controller = controller.destroy();
6993		 *
6994		 * // with scene reset
6995		 * controller = controller.destroy(true);
6996		 *
6997		 * @param {boolean} [resetScenes=false] - If `true` the pins and tweens (if existent) of all scenes will be reset.
6998		 * @returns {null} Null to unset handler variables.
6999		 */
7000		this.destroy = function (resetScenes) {
7001			window.clearTimeout(_refreshTimeout);
7002			var i = _sceneObjects.length;
7003			while (i--) {
7004				_sceneObjects[i].destroy(resetScenes);
7005			}
7006			_options.container.removeEventListener("resize", onChange);
7007			_options.container.removeEventListener("scroll", onChange);
7008			_util.cAF(_updateTimeout);
7009			log(3, "destroyed " + NAMESPACE + " (reset: " + (resetScenes ? "true" : "false") + ")");
7010			return null;
7011		};
7012
7013		// INIT
7014		construct();
7015		return Controller;
7016	};
7017
7018	// store pagewide controller options
7019	var CONTROLLER_OPTIONS = {
7020		defaults: {
7021			container: window,
7022			vertical: true,
7023			globalSceneOptions: {},
7024			loglevel: 2,
7025			refreshInterval: 100
7026		}
7027	};
7028	/*
7029	 * method used to add an option to ScrollMagic Scenes.
7030	 */
7031	ScrollMagic.Controller.addOption = function (name, defaultValue) {
7032		CONTROLLER_OPTIONS.defaults[name] = defaultValue;
7033	};
7034	// instance extension function for plugins
7035	ScrollMagic.Controller.extend = function (extension) {
7036		var oldClass = this;
7037		ScrollMagic.Controller = function () {
7038			oldClass.apply(this, arguments);
7039			this.$super = _util.extend({}, this); // copy parent state
7040			return extension.apply(this, arguments) || this;
7041		};
7042		_util.extend(ScrollMagic.Controller, oldClass); // copy properties
7043		ScrollMagic.Controller.prototype = oldClass.prototype; // copy prototype
7044		ScrollMagic.Controller.prototype.constructor = ScrollMagic.Controller; // restore constructor
7045	};
7046
7047
7048	/**
7049	 * A Scene defines where the controller should react and how.
7050	 *
7051	 * @class
7052	 *
7053	 * @example
7054	 * // create a standard scene and add it to a controller
7055	 * new ScrollMagic.Scene()
7056	 *		.addTo(controller);
7057	 *
7058	 * // create a scene with custom options and assign a handler to it.
7059	 * var scene = new ScrollMagic.Scene({
7060	 * 		duration: 100,
7061	 *		offset: 200,
7062	 *		triggerHook: "onEnter",
7063	 *		reverse: false
7064	 * });
7065	 *
7066	 * @param {object} [options] - Options for the Scene. The options can be updated at any time.  
7067	 							   Instead of setting the options for each scene individually you can also set them globally in the controller as the controllers `globalSceneOptions` option. The object accepts the same properties as the ones below.  
7068	 							   When a scene is added to the controller the options defined using the Scene constructor will be overwritten by those set in `globalSceneOptions`.
7069	 * @param {(number|string|function)} [options.duration=0] - The duration of the scene. 
7070	 					Please see `Scene.duration()` for details.
7071	 * @param {number} [options.offset=0] - Offset Value for the Trigger Position. If no triggerElement is defined this will be the scroll distance from the start of the page, after which the scene will start.
7072	 * @param {(string|object)} [options.triggerElement=null] - Selector or DOM object that defines the start of the scene. If undefined the scene will start right at the start of the page (unless an offset is set).
7073	 * @param {(number|string)} [options.triggerHook="onCenter"] - Can be a number between 0 and 1 defining the position of the trigger Hook in relation to the viewport.  
7074	 															  Can also be defined using a string:
7075	 															  ** `"onEnter"` => `1`
7076	 															  ** `"onCenter"` => `0.5`
7077	 															  ** `"onLeave"` => `0`
7078	 * @param {boolean} [options.reverse=true] - Should the scene reverse, when scrolling up?
7079	 * @param {number} [options.loglevel=2] - Loglevel for debugging. Note that logging is disabled in the minified version of ScrollMagic.
7080	 										  ** `0` => silent
7081	 										  ** `1` => errors
7082	 										  ** `2` => errors, warnings
7083	 										  ** `3` => errors, warnings, debuginfo
7084	 * 
7085	 */
7086	ScrollMagic.Scene = function (options) {
7087
7088		/*
7089		 * ----------------------------------------------------------------
7090		 * settings
7091		 * ----------------------------------------------------------------
7092		 */
7093
7094		var
7095			NAMESPACE = 'ScrollMagic.Scene',
7096			SCENE_STATE_BEFORE = 'BEFORE',
7097			SCENE_STATE_DURING = 'DURING',
7098			SCENE_STATE_AFTER = 'AFTER',
7099			DEFAULT_OPTIONS = SCENE_OPTIONS.defaults;
7100
7101		/*
7102		 * ----------------------------------------------------------------
7103		 * private vars
7104		 * ----------------------------------------------------------------
7105		 */
7106
7107		var
7108			Scene = this,
7109			_options = _util.extend({}, DEFAULT_OPTIONS, options),
7110			_state = SCENE_STATE_BEFORE,
7111			_progress = 0,
7112			_scrollOffset = {
7113				start: 0,
7114				end: 0
7115			}, // reflects the controllers's scroll position for the start and end of the scene respectively
7116			_triggerPos = 0,
7117			_enabled = true,
7118			_durationUpdateMethod,
7119			_controller;
7120
7121		/**
7122		 * Internal constructor function of the ScrollMagic Scene
7123		 * @private
7124		 */
7125		var construct = function () {
7126			for (var key in _options) { // check supplied options
7127				if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {
7128					log(2, "WARNING: Unknown option \"" + key + "\"");
7129					delete _options[key];
7130				}
7131			}
7132			// add getters/setters for all possible options
7133			for (var optionName in DEFAULT_OPTIONS) {
7134				addSceneOption(optionName);
7135			}
7136			// validate all options
7137			validateOption();
7138		};
7139
7140		/*
7141		 * ----------------------------------------------------------------
7142		 * Event Management
7143		 * ----------------------------------------------------------------
7144		 */
7145
7146		var _listeners = {};
7147		/**
7148		 * Scene start event.  
7149		 * Fires whenever the scroll position its the starting point of the scene.  
7150		 * It will also fire when scrolling back up going over the start position of the scene. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback.
7151		 *
7152		 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.
7153		 *
7154		 * @event ScrollMagic.Scene#start
7155		 *
7156		 * @example
7157		 * scene.on("start", function (event) {
7158		 * 	console.log("Hit start point of scene.");
7159		 * });
7160		 *
7161		 * @property {object} event - The event Object passed to each callback
7162		 * @property {string} event.type - The name of the event
7163		 * @property {Scene} event.target - The Scene object that triggered this event
7164		 * @property {number} event.progress - Reflects the current progress of the scene
7165		 * @property {string} event.state - The current state of the scene `"BEFORE"` or `"DURING"`
7166		 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`
7167		 */
7168		/**
7169		 * Scene end event.  
7170		 * Fires whenever the scroll position its the ending point of the scene.  
7171		 * It will also fire when scrolling back up from after the scene and going over its end position. If you want something to happen only when scrolling down/right, use the scrollDirection parameter passed to the callback.
7172		 *
7173		 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.
7174		 *
7175		 * @event ScrollMagic.Scene#end
7176		 *
7177		 * @example
7178		 * scene.on("end", function (event) {
7179		 * 	console.log("Hit end point of scene.");
7180		 * });
7181		 *
7182		 * @property {object} event - The event Object passed to each callback
7183		 * @property {string} event.type - The name of the event
7184		 * @property {Scene} event.target - The Scene object that triggered this event
7185		 * @property {number} event.progress - Reflects the current progress of the scene
7186		 * @property {string} event.state - The current state of the scene `"DURING"` or `"AFTER"`
7187		 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`
7188		 */
7189		/**
7190		 * Scene enter event.  
7191		 * Fires whenever the scene enters the "DURING" state.  
7192		 * Keep in mind that it doesn't matter if the scene plays forward or backward: This event always fires when the scene enters its active scroll timeframe, regardless of the scroll-direction.
7193		 *
7194		 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.
7195		 *
7196		 * @event ScrollMagic.Scene#enter
7197		 *
7198		 * @example
7199		 * scene.on("enter", function (event) {
7200		 * 	console.log("Scene entered.");
7201		 * });
7202		 *
7203		 * @property {object} event - The event Object passed to each callback
7204		 * @property {string} event.type - The name of the event
7205		 * @property {Scene} event.target - The Scene object that triggered this event
7206		 * @property {number} event.progress - Reflects the current progress of the scene
7207		 * @property {string} event.state - The current state of the scene - always `"DURING"`
7208		 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`
7209		 */
7210		/**
7211		 * Scene leave event.  
7212		 * Fires whenever the scene's state goes from "DURING" to either "BEFORE" or "AFTER".  
7213		 * Keep in mind that it doesn't matter if the scene plays forward or backward: This event al
7213ways fires when the scene leaves its active scroll timeframe, regardless of the scroll-direction.
7214		 *
7215		 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.
7216		 *
7217		 * @event ScrollMagic.Scene#leave
7218		 *
7219		 * @example
7220		 * scene.on("leave", function (event) {
7221		 * 	console.log("Scene left.");
7222		 * });
7223		 *
7224		 * @property {object} event - The event Object passed to each callback
7225		 * @property {string} event.type - The name of the event
7226		 * @property {Scene} event.target - The Scene object that triggered this event
7227		 * @property {number} event.progress - Reflects the current progress of the scene
7228		 * @property {string} event.state - The current state of the scene `"BEFORE"` or `"AFTER"`
7229		 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`
7230		 */
7231		/**
7232		 * Scene update event.  
7233		 * Fires whenever the scene is updated (but not necessarily changes the progress).
7234		 *
7235		 * @event ScrollMagic.Scene#update
7236		 *
7237		 * @example
7238		 * scene.on("update", function (event) {
7239		 * 	console.log("Scene updated.");
7240		 * });
7241		 *
7242		 * @property {object} event - The event Object passed to each callback
7243		 * @property {string} event.type - The name of the event
7244		 * @property {Scene} event.target - The Scene object that triggered this event
7245		 * @property {number} event.startPos - The starting position of the scene (in relation to the conainer)
7246		 * @property {number} event.endPos - The ending position of the scene (in relation to the conainer)
7247		 * @property {number} event.scrollPos - The current scroll position of the container
7248		 */
7249		/**
7250		 * Scene progress event.  
7251		 * Fires whenever the progress of the scene changes.
7252		 *
7253		 * For details on this event and the order in which it is fired, please review the {@link Scene.progress} method.
7254		 *
7255		 * @event ScrollMagic.Scene#progress
7256		 *
7257		 * @example
7258		 * scene.on("progress", function (event) {
7259		 * 	console.log("Scene progress changed to " + event.progress);
7260		 * });
7261		 *
7262		 * @property {object} event - The event Object passed to each callback
7263		 * @property {string} event.type - The name of the event
7264		 * @property {Scene} event.target - The Scene object that triggered this event
7265		 * @property {number} event.progress - Reflects the current progress of the scene
7266		 * @property {string} event.state - The current state of the scene `"BEFORE"`, `"DURING"` or `"AFTER"`
7267		 * @property {string} event.scrollDirection - Indicates which way we are scrolling `"PAUSED"`, `"FORWARD"` or `"REVERSE"`
7268		 */
7269		/**
7270		 * Scene change event.  
7271		 * Fires whenvever a property of the scene is changed.
7272		 *
7273		 * @event ScrollMagic.Scene#change
7274		 *
7275		 * @example
7276		 * scene.on("change", function (event) {
7277		 * 	console.log("Scene Property \"" + event.what + "\" changed to " + event.newval);
7278		 * });
7279		 *
7280		 * @property {object} event - The event Object passed to each callback
7281		 * @property {string} event.type - The name of the event
7282		 * @property {Scene} event.target - The Scene object that triggered this event
7283		 * @property {string} event.what - Indicates what value has been changed
7284		 * @property {mixed} event.newval - The new value of the changed property
7285		 */
7286		/**
7287		 * Scene shift event.  
7288		 * Fires whenvever the start or end **scroll offset** of the scene change.
7289		 * This happens explicitely, when one of these values change: `offset`, `duration` or `triggerHook`.
7290		 * It will fire implicitly when the `triggerElement` changes, if the new element has a different position (most cases).
7291		 * It will also fire implicitly when the size of the container changes and the triggerHook is anything other than `onLeave`.
7292		 *
7293		 * @event ScrollMagic.Scene#shift
7294		 * @since 1.1.0
7295		 *
7296		 * @example
7297		 * scene.on("shift", function (event) {
7298		 * 	console.log("Scene moved, because the " + event.reason + " has changed.)");
7299		 * });
7300		 *
7301		 * @property {object} event - The event Object passed to each callback
7302		 * @property {string} event.type - The name of the event
7303		 * @property {Scene} event.target - The Scene object that triggered this event
7304		 * @property {string} event.reason - Indicates why the scene has shifted
7305		 */
7306		/**
7307		 * Scene destroy event.  
7308		 * Fires whenvever the scene is destroyed.
7309		 * This can be used to tidy up custom behaviour used in events.
7310		 *
7311		 * @event ScrollMagic.Scene#destroy
7312		 * @since 1.1.0
7313		 *
7314		 * @example
7315		 * scene.on("enter", function (event) {
7316		 *        // add custom action
7317		 *        $("#my-elem").left("200");
7318		 *      })
7319		 *      .on("destroy", function (event) {
7320		 *        // reset my element to start position
7321		 *        if (event.reset) {
7322		 *          $("#my-elem").left("0");
7323		 *        }
7324		 *      });
7325		 *
7326		 * @property {object} event - The event Object passed to each callback
7327		 * @property {string} event.type - The name of the event
7328		 * @property {Scene} event.target - The Scene object that triggered this event
7329		 * @property {boolean} event.reset - Indicates if the destroy method was called with reset `true` or `false`.
7330		 */
7331		/**
7332		 * Scene add event.  
7333		 * Fires when the scene is added to a controller.
7334		 * This is mostly used by plugins to know that change might be due.
7335		 *
7336		 * @event ScrollMagic.Scene#add
7337		 * @since 2.0.0
7338		 *
7339		 * @example
7340		 * scene.on("add", function (event) {
7341		 * 	console.log('Scene was added to a new controller.');
7342		 * });
7343		 *
7344		 * @property {object} event - The event Object passed to each callback
7345		 * @property {string} event.type - The name of the event
7346		 * @property {Scene} event.target - The Scene object that triggered this event
7347		 * @property {boolean} event.controller - The controller object the scene was added to.
7348		 */
7349		/**
7350		 * Scene remove event.  
7351		 * Fires when the scene is removed from a controller.
7352		 * This is mostly used by plugins to know that change might be due.
7353		 *
7354		 * @event ScrollMagic.Scene#remove
7355		 * @since 2.0.0
7356		 *
7357		 * @example
7358		 * scene.on("remove", function (event) {
7359		 * 	console.log('Scene was removed from its controller.');
7360		 * });
7361		 *
7362		 * @property {object} event - The event Object passed to each callback
7363		 * @property {string} event.type - The name of the event
7364		 * @property {Scene} event.target - The Scene object that triggered this event
7365		 */
7366
7367		/**
7368		 * Add one ore more event listener.  
7369		 * The callback function will be fired at the respective event, and an object c
7369ontaining relevant data will be passed to the callback.
7370		 * @method ScrollMagic.Scene#on
7371		 *
7372		 * @example
7373		 * function callback (event) {
7374		 * 		console.log("Event fired! (" + event.type + ")");
7375		 * }
7376		 * // add listeners
7377		 * scene.on("change update progress start end enter leave", callback);
7378		 *
7379		 * @param {string} names - The name or names of the event the callback should be attached to.
7380		 * @param {function} callback - A function that should be executed, when the event is dispatched. An event object will be passed to the callback.
7381		 * @returns {Scene} Parent object for chaining.
7382		 */
7383		this.on = function (names, callback) {
7384			if (_util.type.Function(callback)) {
7385				names = names.trim().split(' ');
7386				names.forEach(function (fullname) {
7387					var
7388						nameparts = fullname.split('.'),
7389						eventname = nameparts[0],
7390						namespace = nameparts[1];
7391					if (eventname != "*") { // disallow wildcards
7392						if (!_listeners[eventname]) {
7393							_listeners[eventname] = [];
7394						}
7395						_listeners[eventname].push({
7396							namespace: namespace || '',
7397							callback: callback
7398						});
7399					}
7400				});
7401			} else {
7402				log(1, "ERROR when calling '.on()': Supplied callback for '" + names + "' is not a valid function!");
7403			}
7404			return Scene;
7405		};
7406
7407		/**
7408		 * Remove one or more event listener.
7409		 * @method ScrollMagic.Scene#off
7410		 *
7411		 * @example
7412		 * function callback (event) {
7413		 * 		console.log("Event fired! (" + event.type + ")");
7414		 * }
7415		 * // add listeners
7416		 * scene.on("change update", callback);
7417		 * // remove listeners
7418		 * scene.off("change update", callback);
7419		 *
7420		 * @param {string} names - The name or names of the event that should be removed.
7421		 * @param {function} [callback] - A specific callback function that should be removed. If none is passed all callbacks to the event listener will be removed.
7422		 * @returns {Scene} Parent object for chaining.
7423		 */
7424		this.off = function (names, callback) {
7425			if (!names) {
7426				log(1, "ERROR: Invalid event name supplied.");
7427				return Scene;
7428			}
7429			names = names.trim().split(' ');
7430			names.forEach(function (fullname, key) {
7431				var
7432					nameparts = fullname.split('.'),
7433					eventname = nameparts[0],
7434					namespace = nameparts[1] || '',
7435					removeList = eventname === '*' ? Object.keys(_listeners) : [eventname];
7436				removeList.forEach(function (remove) {
7437					var
7438						list = _listeners[remove] || [],
7439						i = list.length;
7440					while (i--) {
7441						var listener = list[i];
7442						if (listener && (namespace === listener.namespace || namespace === '*') && (!callback || callback == listener.callback)) {
7443							list.splice(i, 1);
7444						}
7445					}
7446					if (!list.length) {
7447						delete _listeners[remove];
7448					}
7449				});
7450			});
7451			return Scene;
7452		};
7453
7454		/**
7455		 * Trigger an event.
7456		 * @method ScrollMagic.Scene#trigger
7457		 *
7458		 * @example
7459		 * this.trigger("change");
7460		 *
7461		 * @param {string} name - The name of the event that should be triggered.
7462		 * @param {object} [vars] - An object containing info that should be passed to the callback.
7463		 * @returns {Scene} Parent object for chaining.
7464		 */
7465		this.trigger = function (name, vars) {
7466			if (name) {
7467				var
7468					nameparts = name.trim().split('.'),
7469					eventname = nameparts[0],
7470					namespace = nameparts[1],
7471					listeners = _listeners[eventname];
7472				log(3, 'event fired:', eventname, vars ? "->" : '', vars || '');
7473				if (listeners) {
7474					listeners.forEach(function (listener, key) {
7475						if (!namespace || namespace === listener.namespace) {
7476							listener.callback.call(Scene, new ScrollMagic.Event(eventname, listener.namespace, Scene, vars));
7477						}
7478					});
7479				}
7480			} else {
7481				log(1, "ERROR: Invalid event name supplied.");
7482			}
7483			return Scene;
7484		};
7485
7486		// set event listeners
7487		Scene
7488			.on("change.internal", function (e) {
7489				if (e.what !== "loglevel" && e.what !== "tweenChanges") { // no need for a scene update scene with these options...
7490					if (e.what === "triggerElement") {
7491						updateTriggerElementPosition();
7492					} else if (e.what === "reverse") { // the only property left that may have an impact on the current scene state. Everything else is handled by the shift event.
7493						Scene.update();
7494					}
7495				}
7496			})
7497			.on("shift.internal", function (e) {
7498				updateScrollOffset();
7499				Scene.update(); // update scene to reflect new position
7500			});
7501
7502		/**
7503		 * Send a debug message to the console.
7504		 * @private
7505		 * but provided publicly with _log for plugins
7506		 *
7507		 * @param {number} loglevel - The loglevel required to initiate output for the message.
7508		 * @param {...mixed} output - One or more variables that should be passed to the console.
7509		 */
7510		var log = this._log = function (loglevel, output) {
7511			if (_options.loglevel >= loglevel) {
7512				Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ") ->");
7513				_util.log.apply(window, arguments);
7514			}
7515		};
7516
7517		/**
7518		 * Add the scene to a controller.  
7519		 * This is the equivalent to `Controller.addScene(scene)`.
7520		 * @method ScrollMagic.Scene#addTo
7521		 *
7522		 * @example
7523		 * // add a scene to a ScrollMagic Controller
7524		 * scene.addTo(controller);
7525		 *
7526		 * @param {ScrollMagic.Controller} controller - The controller to which the scene should be added.
7527		 * @returns {Scene} Parent object for chaining.
7528		 */
7529		this.addTo = function (controller) {
7530			if (!(controller instanceof ScrollMagic.Controller)) {
7531				log(1, "ERROR: supplied argument of 'addTo()' is not a valid ScrollMagic Controller");
7532			} else if (_controller != controller) {
7533				// new controller
7534				if (_controller) { // was associated to a different controller before, so remove it...
7535					_controller.removeScene(Scene);
7536				}
7537				_controller = controller;
7538				validateOption();
7539				updateDuration(true);
7540				updateTriggerElementPosition(true);
7541				updateScrollOffset();
7542				_controller.info("container").addEventListener('resize', onContainerResize);
7543				controller.addScene(Scene);
7544				Scene.trigger("add", {
7545					controller: _controller
7546				});
7547				log(3, "added " + NAMESPACE + " to controller");
7548				Scene.update();
7549			}
7550			return Scene;
7551		};
7552
7553		/**
7554		 * **Get** or **Set** the current enabled state of the scene.  
7555		 * This can be used to disable this scene without removing or destroying it.
7556		 * @method ScrollMagic.Scene#enabled
7557		 *
7558		 * @example
7559		 * // get the current value
7560		 * var enabled = scene.enabled();
7561		 *
7562		 * // disable the scene
7563		 * scene.enabled(false);
7564		 *
7565		 * @param {boolean} [newState] - The new enabled state of the scene `true` or `false`.
7566		 * @returns {(boolean|Scene)} Current enabled state or parent object for chaining.
7567		 */
7568		this.enabled = function (newState) {
7569			if (!arguments.length) { // get
7570				return _enabled;
7571			} else if (_enabled != newState) { // set
7572				_enabled = !!newState;
7573				Scene.update(true);
7574			}
7575			return Scene;
7576		};
7577
7578		/**
7579		 * Remove the scene from the controller.  
7580		 * This is the equivalent to `Controller.removeScene(scene)`.
7581		 * The scene will not be updated anymore until you readd it to a controller.
7582		 * To remove the pin or the tween you need to call removeTween() or removePin() respectively.
7583		 * @method ScrollMagic.Scene#remove
7584		 * @example
7585		 * // remove the scene from its controller
7586		 * scene.remove();
7587		 *
7588		 * @returns {Scene} Parent object for chaining.
7589		 */
7590		this.remove = function () {
7591			if (_controller) {
7592				_controller.info("container").removeEventListener('resize', onContainerResize);
7593				var tmpParent = _controller;
7594				_controller = undefined;
7595				tmpParent.removeScene(Scene);
7596				Scene.trigger("remove");
7597				log(3, "removed " + NAMESPACE + " from controller");
7598			}
7599			return Scene;
7600		};
7601
7602		/**
7603		 * Destroy the scene and everything.
7604		 * @method ScrollMagic.Scene#destroy
7605		 * @example
7606		 * // destroy the scene without resetting the pin and tween to their initial positions
7607		 * scene = scene.destroy();
7608		 *
7609		 * // destroy the scene and reset the pin and tween
7610		 * scene = scene.destroy(true);
7611		 *
7612		 * @param {boolean} [reset=false] - If `true` the pin and tween (if existent) will be reset.
7613		 * @returns {null} Null to unset handler variables.
7614		 */
7615		this.destroy = function (reset) {
7616			Scene.trigger("destroy", {
7617				reset: reset
7618			});
7619			Scene.remove();
7620			Scene.off("*.*");
7621			log(3, "destroyed " + NAMESPACE + " (reset: " + (reset ? "true" : "false") + ")");
7622			return null;
7623		};
7624
7625
7626		/**
7627		 * Updates the Scene to reflect the current state.  
7628		 * This is the equivalent to `Controller.updateScene(scene, immediately)`.  
7629		 * The update method calculates the scene's start and end position (based on the trigger element, trigger hook, duration and offset) and checks it against the current scroll position of the container.  
7630		 * It then updates the current scene state accordingly (or does nothing, if the state is already correct) – Pins will be set to their correct position and tweens will be updated to their correct progress.
7631		 * This means an update doesn't necessarily result in a progress change. The `progress` event will be fired if the progress has indeed changed between this update and the last.  
7632		 * _**NOTE:** This method gets called constantly whenever ScrollMagic detects a change. The only application for you is 
7632if you change something outside of the realm of ScrollMagic, like moving the trigger or changing tween parameters._
7633		 * @method ScrollMagic.Scene#update
7634		 * @example
7635		 * // update the scene on next tick
7636		 * scene.update();
7637		 *
7638		 * // update the scene immediately
7639		 * scene.update(true);
7640		 *
7641		 * @fires Scene.update
7642		 *
7643		 * @param {boolean} [immediately=false] - If `true` the update will be instant, if `false` it will wait until next update cycle (better performance).
7644		 * @returns {Scene} Parent object for chaining.
7645		 */
7646		this.update = function (immediately) {
7647			if (_controller) {
7648				if (immediately) {
7649					if (_controller.enabled() && _enabled) {
7650						var
7651							scrollPos = _controller.info("scrollPos"),
7652							newProgress;
7653
7654						if (_options.duration > 0) {
7655							newProgress = (scrollPos - _scrollOffset.start) / (_scrollOffset.end - _scrollOffset.start);
7656						} else {
7657							newProgress = scrollPos >= _scrollOffset.start ? 1 : 0;
7658						}
7659
7660						Scene.trigger("update", {
7661							startPos: _scrollOffset.start,
7662							endPos: _scrollOffset.end,
7663							scrollPos: scrollPos
7664						});
7665
7666						Scene.progress(newProgress);
7667					} else if (_pin && _state === SCENE_STATE_DURING) {
7668						updatePinState(true); // unpin in position
7669					}
7670				} else {
7671					_controller.updateScene(Scene, false);
7672				}
7673			}
7674			return Scene;
7675		};
7676
7677		/**
7678		 * Updates dynamic scene variables like the trigger element position or the duration.
7679		 * This method is automatically called in regular intervals from the controller. See {@link ScrollMagic.Controller} option `refreshInterval`.
7680		 * 
7681		 * You can call it to minimize lag, for example when you intentionally change the position of the triggerElement.
7682		 * If you don't it will simply be updated in the next refresh interval of the container, which is usually sufficient.
7683		 *
7684		 * @method ScrollMagic.Scene#refresh
7685		 * @since 1.1.0
7686		 * @example
7687		 * scene = new ScrollMagic.Scene({triggerElement: "#trigger"});
7688		 * 
7689		 * // change the position of the trigger
7690		 * $("#trigger").css("top", 500);
7691		 * // immediately let the scene know of this change
7692		 * scene.refresh();
7693		 *
7694		 * @fires {@link Scene.shift}, if the trigger element position or the duration changed
7695		 * @fires {@link Scene.change}, if the duration changed
7696		 *
7697		 * @returns {Scene} Parent object for chaining.
7698		 */
7699		this.refresh = function () {
7700			updateDuration();
7701			updateTriggerElementPosition();
7702			// update trigger element position
7703			return Scene;
7704		};
7705
7706		/**
7707		 * **Get** or **Set** the scene's progress.  
7708		 * Usually it shouldn't be necessary to use this as a setter, as it is set automatically by scene.update().  
7709		 * The order in which the events are fired depends on the duration of the scene:
7710		 *  1. Scenes with `duration == 0`:  
7711		 *  Scenes that have no duration by definition have no ending. Thus the `end` event will never be fired.  
7712		 *  When the trigger position of the scene is passed the events are always fired in this order:  
7713		 *  `enter`, `start`, `progress` when scrolling forward  
7714		 *  and  
7715		 *  `progress`, `start`, `leave` when scrolling in reverse
7716		 *  2. Scenes with `duration > 0`:  
7717		 *  Scenes with a set duration have a defined start and end point.  
7718		 *  When scrolling past the start position of the scene it will fire these events in this order:  
7719		 *  `enter`, `start`, `progress`  
7720		 *  When continuing to scroll and passing the end point it will fire these events:  
7721		 *  `progress`, `end`, `leave`  
7722		 *  When reversing through the end point these events are fired:  
7723		 *  `enter`, `end`, `progress`  
7724		 *  And when continuing to scroll past the start position in reverse it will fire:  
7725		 *  `progress`, `start`, `leave`  
7726		 *  In between start and end the `progress` event will be called constantly, whenever the progress changes.
7727		 * 
7728		 * In short:  
7729		 * `enter` events will always trigger **before** the progress update and `leave` envents will trigger **after** the progress update.  
7730		 * `start` and `end` will always trigger at their respective position.
7731		 * 
7732		 * Please review the event descriptions for details on the events and the event object that is passed to the callback.
7733		 * 
7734		 * @method ScrollMagic.Scene#progress
7735		 * @example
7736		 * // get the current scene progress
7737		 * var progress = scene.progress();
7738		 *
7739		 * // set new scene progress
7740		 * scene.progress(0.3);
7741		 *
7742		 * @fires {@link Scene.enter}, when used as setter
7743		 * @fires {@link Scene.start}, when used as setter
7744		 * @fires {@link Scene.progress}, when used as setter
7745		 * @fires {@link Scene.end}, when used as setter
7746		 * @fires {@link Scene.leave}, when used as setter
7747		 *
7748		 * @param {number} [progress] - The new progress value of the scene `[0-1]`.
7749		 * @returns {number} `get` -  Current scene progress.
7750		 * @returns {Scene} `set` -  Parent object for chaining.
7751		 */
7752		this.progress = function (progress) {
7753			if (!arguments.length) { // get
7754				return _progress;
7755			} else { // set
7756				var
7757					doUpdate = false,
7758					oldState = _state,
7759					scrollDirection = _controller ? _controller.info("scrollDirection") : 'PAUSED',
7760					reverseOrForward = _options.reverse || progress >= _progress;
7761				if (_options.duration === 0) {
7762					// zero duration scenes
7763					doUpdate = _progress != progress;
7764					_progress = progress < 1 && reverseOrForward ? 0 : 1;
7765					_state = _progress === 0 ? SCENE_STATE_BEFORE : SCENE_STATE_DURING;
7766				} else {
7767					// scenes with start and end
7768					if (progress < 0 && _state !== SCENE_STATE_BEFORE && reverseOrForward) {
7769						// go back to initial state
7770						_progress = 0;
7771						_state = SCENE_STATE_BEFORE;
7772						doUpdate = true;
7773					} else if (progress >= 0 && progress < 1 && reverseOrForward) {
7774						_progress = progress;
7775						_state = SCENE_STATE_DURING;
7776						doUpdate = true;
7777					} else if (progress >= 1 && _state !== SCENE_STATE_AFTER) {
7778						_progress = 1;
7779						_state = SCENE_STATE_AFTER;
7780						doUpdate = true;
7781					} else if (_state === SCENE_STATE_DURING && !reverseOrForward) {
7782						updatePinState(); // in case we scrolled backwards mid-scene and reverse is disabled => update the pin position, so it doesn't move back as well.
7783					}
7784				}
7785				if (doUpdate) {
7786					// fire events
7787					var
7788						eventVars = {
7789							progress: _progress,
7790							state: _state,
7791							scrollDirection: scrollDirection
7792						},
7793						stateChanged = _state != oldState;
7794
7795					var trigger = function (eventName) { // tmp helper to simplify code
7796						Scene.trigger(eventName, eventVars);
7797					};
7798
7799					if (stateChanged) { // enter events
7800						if (oldState !== SCENE_STATE_DURING) {
7801							trigger("enter");
7802							trigger(oldState === SCENE_STATE_BEFORE ? "start" : "end");
7803						}
7804					}
7805					trigger("progress");
7806					if (stateChanged) { // leave events
7807						if (_state !== SCENE_STATE_DURING) {
7808							trigger(_state === SCENE_STATE_BEFORE ? "start" : "end");
7809							trigger("leave");
7810						}
7811					}
7812				}
7813
7814				return Scene;
7815			}
7816		};
7817
7818
7819		/**
7820		 * Update the start and end scrollOffset of the container.
7821		 * The positions reflect what the controller's scroll position will be at the start and end respectively.
7822		 * Is called, when:
7823		 *   - Scene event "change" is called with: offset, triggerHook, duration 
7824		 *   - scroll container event "resize" is called
7825		 *   - the position of the triggerElement changes
7826		 *   - the controller changes -> addTo()
7827		 * @private
7828		 */
7829		var updateScrollOffset = function () {
7830			_scrollOffset = {
7831				start: _triggerPos + _options.offset
7832			};
7833			if (_controller && _options.triggerElement) {
7834				// take away triggerHook portion to get relative to top
7835				_scrollOffset.start -= _controller.info("size") * _options.triggerHook;
7836			}
7837			_scrollOffset.end = _scrollOffset.start + _options.duration;
7838		};
7839
7840		/**
7841		 * Updates the duration if set to a dynamic function.
7842		 * This method is called when the scene is added to a controller and in regular intervals from the controller through scene.refresh().
7843		 * 
7844		 * @fires {@link Scene.change}, if the duration changed
7845		 * @fires {@link Scene.shift}, if the duration changed
7846		 *
7847		 * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed.
7848		 * @private
7849		 */
7850		var updateDuration = function (suppressEvents) {
7851			// update duration
7852			if (_durationUpdateMethod) {
7853				var varname = "duration";
7854				if (changeOption(varname, _durationUpdateMethod.call(Scene)) && !suppressEvents) { // set
7855					Scene.trigger("change", {
7856						what: varname,
7857						newval: _options[varname]
7858					});
7859					Scene.trigger("shift", {
7860						reason: varname
7861					});
7862				}
7863			}
7864		};
7865
7866		/**
7867		 * Updates the position of the triggerElement, if present.
7868		 * This method is called ...
7869		 *  - ... when the triggerElement is changed
7870		 *  - ... when the scene is added to a (new) controller
7871		 *  - ... in regular intervals from the controller through scene.refresh().
7872		 * 
7873		 * @fires {@link Scene.shift}, if the position changed
7874		 *
7875		 * @param {boolean} [suppressEvents=false] - If true the shift event will be suppressed.
7876		 * @private
7877		 */
7878		var updateTriggerElementPosition = function (suppressEvents) {
7879			var
7880				elementPos = 0,
7881				telem = _options.triggerElement;
7882			if (_controller && (telem || _triggerPos > 0)) { // either an element exists or was removed and the triggerPos is still > 0
7883				if (telem) { // there currently a triggerElement set
7884					if (telem.parentNode) { // check if element is still attached to DOM
7885						var
7886							controllerInfo = _controller.info(),
7887							containerOffset = _util.get.offset(controllerInfo.container), // container position is needed because element offset is returned in relation to document, not in relation to container.
7888							param = controllerInfo.vertical ? "top" : "left"; // which param is of interest ?
7889
7890						// if parent is spacer, use spacer position instead so correct start position is returned for pinned elements.
7891						while (telem.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) {
7892							telem = telem.parentNode;
7893						}
7894
7895						var elementOffset = _util.get.offset(telem);
7896
7897						if (!controllerInfo.isDocument) { // container is not the document root, so substract scroll Position to get correct trigger element position relative to scrollcontent
7898							containerOffset[param] -= _controller.scrollPos();
7899						}
7900
7901						elementPos = elementOffset[param] - containerOffset[param];
7902
7903					} else { // there was an element, but it was removed from DOM
7904						log(2, "WARNING: triggerElement was removed from DOM and will be reset to", undefined);
7905						Scene.triggerElement(undefined); // unset, so a change event is triggered
7906					}
7907				}
7908
7909				var changed = elementPos != _triggerPos;
7910				_triggerPos = elementPos;
7911				if (changed && !suppressEvents) {
7912					Scene.trigger("shift", {
7913						reason: "triggerElementPosition"
7914					});
7915				}
7916			}
7917		};
7918
7919		/**
7920		 * Trigger a shift event, when the container is resized and the triggerHook is > 1.
7921		 * @private
7922		 */
7923		var onContainerResize = function (e) {
7924			if (_options.triggerHook > 0) {
7925				Scene.trigger("shift", {
7926					reason: "containerResize"
7927				});
7928			}
7929		};
7930
7931
7932		var _validate = _util.extend(SCENE_OPTIONS.validate, {
7933			// validation for duration handled internally for reference to private var _durationMethod
7934			duration: function (val) {
7935				if (_util.type.String(val) && val.match(/^(\.|\d)*\d+%$/)) {
7936					// percentage value
7937					var perc = parseFloat(val) / 100;
7938					val = function () {
7939						return _controller ? _controller.info("size") * perc : 0;
7940					};
7941				}
7942				if (_util.type.Function(val)) {
7943					// function
7944					_durationUpdateMethod = val;
7945					try {
7946						val = parseFloat(_durationUpdateMethod.call(Scene));
7947					} catch (e) {
7948						val = -1; // will cause error below
7949					}
7950				}
7951				// val has to be float
7952				val = parseFloat(val);
7953				if (!_util.type.Number(val) || val < 0) {
7954					if (_durationUpdateMethod) {
7955						_durationUpdateMethod = undefined;
7956						throw ["Invalid return value of supplied function for option \"duration\":", val];
7957					} else {
7958						throw ["Invalid value for option \"duration\":", val];
7959					}
7960				}
7961				return val;
7962			}
7963		});
7964
7965		/**
7966		 * Checks the validity of a specific or all options and reset to default if neccessary.
7967		 * @private
7968		 */
7969		var validateOption = function (check) {
7970			check = arguments.length ? [check] : Object.keys(_validate);
7971			check.forEach(function (optionName, key) {
7972				var value;
7973				if (_validate[optionName]) { // there is a validation method for this option
7974					try { // validate value
7975						value = _validate[optionName](_options[optionName]);
7976					} catch (e) { // validation failed -> reset to default
7977						value = DEFAULT_OPTIONS[optionName];
7978						var logMSG = _util.type.String(e) ? [e] : e;
7979						if (_util.type.Array(logMSG)) {
7980							logMSG[0] = "ERROR: " + logMSG[0];
7981							logMSG.unshift(1); // loglevel 1 for error msg
7982							log.apply(this, logMSG);
7983						} else {
7984							log(1, "ERROR: Problem executing validation callback for option '" + optionName + "':", e.message);
7985						}
7986					} finally {
7987						_options[optionName] = value;
7988					}
7989				}
7990			});
7991		};
7992
7993		/**
7994		 * Helper used by the setter/getters for scene options
7995		 * @private
7996		 */
7997		var changeOption = function (varname, newval) {
7998			var
7999				changed = false,
8000				oldval = _options[varname];
8001			if (_options[varname] != newval) {
8002				_options[varname] = newval;
8003				validateOption(varname); // resets to default if necessary
8004				changed = oldval != _options[varname];
8005			}
8006			return changed;
8007		};
8008
8009		// generate getters/setters for all options
8010		var addSceneOption = function (optionName) {
8011			if (!Scene[optionName]) {
8012				Scene[optionName] = function (newVal) {
8013					if (!arguments.length) { // get
8014						return _options[optionName];
8015					} else {
8016						if (optionName === "duration") { // new duration is set, so any previously set function must be unset
8017							_durationUpdateMethod = undefined;
8018						}
8019						if (changeOption(optionName, newVal)) { // set
8020							Scene.trigger("change", {
8021								what: optionName,
8022								newval: _options[optionName]
8023							});
8024							if (SCENE_OPTIONS.shifts.indexOf(optionName) > -1) {
8025								Scene.trigger("shift", {
8026									reason: optionName
8027								});
8028							}
8029						}
8030					}
8031					return Scene;
8032				};
8033			}
8034		};
8035
8036		/**
8037		 * **Get** or **Set** the duration option value.
8038		 *
8039		 * As a **setter** it accepts three types of parameters:
8040		 * 1. `number`: Sets the duration of the scene to exactly this amount of pixels.  
8041		 *   This means the scene will last for exactly this amount of pixels scrolled. Sub-Pixels are also valid.
8042		 *   A value of `0` means that the scene is 'open end' and no end will be triggered. Pins will never unpin and animations will play independently of scroll progress.
8043		 * 2. `string`: Always updates the duration relative to parent scroll container.  
8044		 *   For example `"100%"` will keep the duration always exactly at the inner height of the scroll container.
8045		 *   When scrolling vertically the width is used for reference respectively.
8046		 * 3. `function`: The supplied function will be called to return the scene duration.
8047		 *   This is useful in setups where the duration depends on other elements who might change size. By supplying a function you can return a value instead of updating potentially multiple scene durations.  
8048		 *   The scene can be referenced inside the callback using `this`.
8049		 *   _**WARNING:** This is an easy way to kill performance, as the callback will be executed every time `Scene.refresh()` is called, which happens a lot. The interval is defined by the controller (see ScrollMagic.Controller option `refreshInterval`).  
8050		 *   It's recomended to avoid calculations within the function and use cached variables as return values.  
8051		 *   This counts double if you use the same function for multiple scenes._
8052		 *
8053		 * @method ScrollMagic.Scene#duration
8054		 * @example
8055		 * // get the current duration value
8056		 * var duration = scene.duration();
8057		 *
8058		 * // set a new duration
8059		 * scene.duration(300);
8060		 *
8061		 * // set duration responsively to container size
8062		 * scene.duration("100%");
8063		 *
8064		 * // use a function to randomize the duration for some reason.
8065		 * var durationValueCache;
8066		 * function durationCallback () {
8067		 *   return durationValueCache;
8068		 * }
8069		 * function updateDuration () {
8070		 *   durationValueCache = Math.random() * 100;
8071		 * }
8072		 * updateDuration(); // set to initial value
8073		 * scene.duration(durationCallback); // set duration callback
8074		 *
8075		 * @fires {@link Scene.change}, when used as setter
8076		 * @fires {@link Scene.shift}, when used as setter
8077		 * @param {(number|string|function)} [newDuration] - The new duration setting for the scene.
8078		 * @returns {number} `get` -  Current scene duration.
8079		 * @returns {Scene} `set` -  Parent object for chaining.
8080		 */
8081
8082		/**
8083		 * **Get** or **Set** the offset option value.
8084		 * @method ScrollMagic.Scene#offset
8085		 * @example
8086		 * // get the current offset
8087		 * var offset = scene.offset();
8088		 *
8089		 * // set a new offset
8090		 * scene.offset(100);
8091		 *
8092		 * @fires {@link Scene.change}, when used as setter
8093		 * @fires {@link Scene.shift}, when used as setter
8094		 * @param {number} [newOffset] - The new offset of the scene.
8095		 * @returns {number} `get` -  Current scene offset.
8096		 * @returns {Scene} `set` -  Parent object for chaining.
8097		 */
8098
8099		/**
8100		 * **Get** or **Set** the triggerElement option value.
8101		 * Does **not** fire `Scene.shift`, because changing the trigger Element doesn't necessarily mean the start position changes. This will be determined in `Scene.refresh()`, which is automatically triggered.
8102		 * @method ScrollMagic.Scene#triggerElement
8103		 * @example
8104		 * // get the current triggerElement
8105		 * var triggerElement = scene.triggerElement();
8106		 *
8107		 * // set a new triggerElement using a selector
8108		 * scene.triggerElement("#trigger");
8109		 * // set a new triggerElement using a DOM object
8110		 * scene.triggerElement(document.getElementById("trigger"));
8111		 *
8112		 * @fires {@link Scene.change}, when used as setter
8113		 * @param {(string|object)} [newTriggerElement] - The new trigger element for the scene.
8114		 * @returns {(string|object)} `get` -  Current triggerElement.
8115		 * @returns {Scene} `set` -  Parent object for chaining.
8116		 */
8117
8118		/**
8119		 * **Get** or **Set** the triggerHook option value.
8120		 * @method ScrollMagic.Scene#triggerHook
8121		 * @example
8122		 * // get the current triggerHook value
8123		 * var triggerHook = scene.triggerHook();
8124		 *
8125		 * // set a new triggerHook using a string
8126		 * scene.triggerHook("onLeave");
8127		 * // set a new triggerHook using a number
8128		 * scene.triggerHook(0.7);
8129		 *
8130		 * @fires {@link Scene.change}, when used as setter
8131		 * @fires {@link Scene.shift}, when used as setter
8132		 * @param {(number|string)} [newTriggerHook] - The new triggerHook of the scene. See {@link Scene} parameter description for value options.
8133		 * @returns {number} `get` -  Current triggerHook (ALWAYS numerical).
8134		 * @returns {Scene} `set` -  Parent object for chaining.
8135		 */
8136
8137		/**
8138		 * **Get** or **Set** the reverse option value.
8139		 * @method ScrollMagic.Scene#reverse
8140		 * @example
8141		 * // get the current reverse option
8142		 * var reverse = scene.reverse();
8143		 *
8144		 * // set new reverse option
8145		 * scene.reverse(false);
8146		 *
8147		 * @fires {@link Scene.change}, when used as setter
8148		 * @param {boolean} [newReverse] - The new reverse setting of the scene.
8149		 * @returns {boolean} `get` -  Current reverse option value.
8150		 * @returns {Scene} `set` -  Parent object for chaining.
8151		 */
8152
8153		/**
8154		 * **Get** or **Set** the loglevel option value.
8155		 * @method ScrollMagic.Scene#loglevel
8156		 * @example
8157		 * // get the current loglevel
8158		 * var loglevel = scene.loglevel();
8159		 *
8160		 * // set new loglevel
8161		 * scene.loglevel(3);
8162		 *
8163		 * @fires {@link Scene.change}, when used as setter
8164		 * @param {number} [newLoglevel] - The new loglevel setting of the scene. `[0-3]`
8165		 * @returns {number} `get` -  Current loglevel.
8166		 * @returns {Scene} `set` -  Parent object for chaining.
8167		 */
8168
8169		/**
8170		 * **Get** the associated controller.
8171		 * @method ScrollMagic.Scene#controller
8172		 * @example
8173		 * // get the controller of a scene
8174		 * var controller = scene.controller();
8175		 *
8176		 * @returns {ScrollMagic.Controller} Parent controller or `undefined`
8177		 */
8178		this.controller = function () {
8179			return _controller;
8180		};
8181
8182		/**
8183		 * **Get** the current state.
8184		 * @method ScrollMagic.Scene#state
8185		 * @example
8186		 * // get the current state
8187		 * var state = scene.state();
8188		 *
8189		 * @returns {string} `"BEFORE"`, `"DURING"` or `"AFTER"`
8190		 */
8191		this.state = function () {
8192			return _state;
8193		};
8194
8195		/**
8196		 * **Get** the current scroll offset for the start of the scene.  
8197		 * Mind, that the scrollOffset is related to the size of the container, if `triggerHook` is bigger than `0` (or `"onLeave"`).  
8198		 * This means, that resizing the container or changing the `triggerHook` will influence the scene's start offset.
8199		 * @method ScrollMagic.Scene#scrollOffset
8200		 * @example
8201		 * // get the current scroll offset for the start and end of the scene.
8202		 * var start = scene.scrollOffset();
8203		 * var end = scene.scrollOffset() + scene.duration();
8204		 * console.log("the scene starts at", start, "and ends at", end);
8205		 *
8206		 * @returns {number} The scroll offset (of the container) at which the scene will trigger. Y value for vertical and X value for horizontal scrolls.
8207		 */
8208		this.scrollOffset = function () {
8209			return _scrollOffset.start;
8210		};
8211
8212		/**
8213		 * **Get** the trigger position of the scene (including the value of the `offset` option).  
8214		 * @method ScrollMagic.Scene#triggerPosition
8215		 * @example
8216		 * // get the scene's trigger position
8217		 * var triggerPosition = scene.triggerPosition();
8218		 *
8219		 * @returns {number} Start position of the scene. Top position value for vertical and left position value for horizontal scrolls.
8220		 */
8221		this.triggerPosition = function () {
8222			var pos = _options.offset; // the offset is the basis
8223			if (_controller) {
8224				// get the trigger position
8225				if (_options.triggerElement) {
8226					// Element as trigger
8227					pos += _triggerPos;
8228				} else {
8229					// return the height of the triggerHook to start at the beginning
8230					pos += _controller.info("size") * Scene.triggerHook();
8231				}
8232			}
8233			return pos;
8234		};
8235
8236
8237		var
8238			_pin,
8239			_pinOptions;
8240
8241		Scene
8242			.on("shift.internal", function (e) {
8243				var durationChanged = e.reason === "duration";
8244				if ((_state === SCENE_STATE_AFTER && durationChanged) || (_state === SCENE_STATE_DURING && _options.duration === 0)) {
8245					// if [duration changed after a scene (inside scene progress updates pin position)] or [duration is 0, we are in pin phase and some other value changed].
8246					updatePinState();
8247				}
8248				if (durationChanged) {
8249					updatePinDimensions();
8250				}
8251			})
8252			.on("progress.internal", function (e) {
8253				updatePinState();
8254			})
8255			.on("add.internal", function (e) {
8256				updatePinDimensions();
8257			})
8258			.on("destroy.internal", function (e) {
8259				Scene.removePin(e.reset);
8260			});
8261		/**
8262		 * Update the pin state.
8263		 * @private
8264		 */
8265		var updatePinState = function (forceUnpin) {
8266			if (_pin && _controller) {
8267				var
8268					containerInfo = _controller.info(),
8269					pinTarget = _pinOptions.spacer.firstChild; // may be pin element or another spacer, if cascading pins
8270
8271				if (!forceUnpin && _state === SCENE_STATE_DURING) { // during scene or if duration is 0 and we are past the trigger
8272					// pinned state
8273					if (_util.css(pinTarget, "position") != "fixed") {
8274						// change state before updating pin spacer (position changes due to fixed collapsing might occur.)
8275						_util.css(pinTarget, {
8276							"position": "fixed"
8277						});
8278						// update pin spacer
8279						updatePinDimensions();
8280					}
8281
8282					var
8283						fixedPos = _util.get.offset(_pinOptions.spacer, true), // get viewport position of spacer
8284						scrollDistance = _options.reverse || _options.duration === 0 ?
8285						containerInfo.scrollPos - _scrollOffset.start // quicker
8286						:
8287						Math.round(_progress * _options.duration * 10) / 10; // if no reverse and during pin the position needs to be recalculated using the progress
8288
8289					// add scrollDistance
8290					fixedPos[containerInfo.vertical ? "top" : "left"] += scrollDistance;
8291
8292					// set new values
8293					_util.css(_pinOptions.spacer.firstChild, {
8294						top: fixedPos.top,
8295						left: fixedPos.left
8296					});
8297				} else {
8298					// unpinned state
8299					var
8300						newCSS = {
8301							position: _pinOptions.inFlow ? "relative" : "absolute",
8302							top: 0,
8303							left: 0
8304						},
8305						change = _util.css(pinTarget, "position") != newCSS.position;
8306
8307					if (!_pinOptions.pushFollowers) {
8308						newCSS[containerInfo.vertical ? "top" : "left"] = _options.duration * _progress;
8309					} else if (_options.duration > 0) { // only concerns scenes with duration
8310						if (_state === SCENE_STATE_AFTER && parseFloat(_util.css(_pinOptions.spacer, "padding-top")) === 0) {
8311							change = true; // if in after state but havent updated spacer yet (jumped past pin)
8312						} else if (_state === SCENE_STATE_BEFORE && parseFloat(_util.css(_pinOptions.spacer, "padding-bottom")) === 0) { // before
8313							change = true; // jumped past fixed state upward direction
8314						}
8315					}
8316					// set new values
8317					_util.css(pinTarget, newCSS);
8318					if (change) {
8319						// update pin spacer if state changed
8320						updatePinDimensions();
8321					}
8322				}
8323			}
8324		};
8325
8326		/**
8327		 * Update the pin spacer and/or element size.
8328		 * The size of the spacer needs to be updated whenever the duration of the scene changes, if it is to push down following elements.
8329		 * @private
8330		 */
8331		var updatePinDimensions = function () {
8332			if (_pin && _controller && _pinOptions.inFlow) { // no spacerresize, if original position is absolute
8333				var
8334					after = (_state === SCENE_STATE_AFTER),
8335					before = (_state === SCENE_STATE_BEFORE),
8336					during = (_state === SCENE_STATE_DURING),
8337					vertical = _controller.info("vertical"),
8338					pinTarget = _pinOptions.spacer.firstChild, // usually the pined element but can also be another spacer (cascaded pins)
8339					marginCollapse = _util.isMarginCollapseType(_util.css(_pinOptions.spacer, "display")),
8340					css = {};
8341
8342				// set new size
8343				// if relsize: spacer -> pin | else: pin -> spacer
8344				if (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) {
8345					if (during) {
8346						_util.css(_pin, {
8347							"width": _util.get.width(_pinOptions.spacer)
8348						});
8349					} else {
8350						_util.css(_pin, {
8351							"width": "100%"
8352						});
8353					}
8354				} else {
8355					// minwidth is needed for cascaded pins.
8356					css["min-width"] = _util.get.width(vertical ? _pin : pinTarget, true, true);
8357					css.width = during ? css["min-width"] : "auto";
8358				}
8359				if (_pinOptions.relSize.height) {
8360					if (during) {
8361						// the only padding the spacer should ever include is the duration (if pushFollowers = true), so we need to substract that.
8362						_util.css(_pin, {
8363							"height": _util.get.height(_pinOptions.spacer) - (_pinOptions.pushFollowers ? _options.duration : 0)
8364						});
8365					} else {
8366						_util.css(_pin, {
8367							"height": "100%"
8368						});
8369					}
8370				} else {
8371					// margin is only included if it's a cascaded pin to resolve an IE9 bug
8372					css["min-height"] = _util.get.height(vertical ? pinTarget : _pin, true, !marginCollapse); // needed for cascading pins
8373					css.height = during ? css["min-height"] : "auto";
8374				}
8375
8376				// add space for duration if pushFollowers is true
8377				if (_pinOptions.pushFollowers) {
8378					css["padding" + (vertical ? "Top" : "Left")] = _options.duration * _progress;
8379					css["padding" + (vertical ? "Bottom" : "Right")] = _options.duration * (1 - _progress);
8380				}
8381				_util.css(_pinOptions.spacer, css);
8382			}
8383		};
8384
8385		/**
8386		 * Updates the Pin state (in certain scenarios)
8387		 * If the controller container is not the document and we are mid-pin-phase scrolling or resizing the main document can result to wrong pin positions.
8388		 * So this function is called on resize and scroll of the document.
8389		 * @private
8390		 */
8391		var updatePinInContainer = function () {
8392			if (_controller && _pin && _state === SCENE_STATE_DURING && !_controller.info("isDocument")) {
8393				updatePinState();
8394			}
8395		};
8396
8397		/**
8398		 * Updates the Pin spacer size state (in certain scenarios)
8399		 * If container is resized during pin and relatively sized the size of the pin might need to be updated...
8400		 * So this function is called on resize of the container.
8401		 * @private
8402		 */
8403		var updateRelativePinSpacer = function () {
8404			if (_controller && _pin && // well, duh
8405				_state === SCENE_STATE_DURING && // element in pinned state?
8406				( // is width or height relatively sized, but not in relation to body? then we need to recalc.
8407					((_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) && _util.get.width(window) != _util.get.width(_pinOptions.spacer.parentNode)) ||
8408					(_pinOptions.relSize.height && _util.get.height(window) != _util.get.height(_pinOptions.spacer.parentNode))
8409				)
8410			) {
8411				updatePinDimensions();
8412			}
8413		};
8414
8415		/**
8416		 * Is called, when the mousewhel is used while over a pinned element inside a div container.
8417		 * If the scene is in fixed state scroll events would be counted towards the body. This forwards the event to the scroll container.
8418		 * @private
8419		 */
8420		var onMousewheelOverPin = function (e) {
8421			if (_controller && _pin && _state === SCENE_STATE_DURING && !_controller.info("isDocument")) { // in pin 
8421state
8422				e.preventDefault();
8423				_controller._setScrollPos(_controller.info("scrollPos") - ((e.wheelDelta || e[_controller.info("vertical") ? "wheelDeltaY" : "wheelDeltaX"]) / 3 || -e.detail * 30));
8424			}
8425		};
8426
8427		/**
8428		 * Pin an element for the duration of the scene.
8429		 * If the scene duration is 0 the element will only be unpinned, if the user scrolls back past the start position.  
8430		 * Make sure only one pin is applied to an element at the same time.
8431		 * An element can be pinned multiple times, but only successively.
8432		 * _**NOTE:** The option `pushFollowers` has no effect, when the scene duration is 0._
8433		 * @method ScrollMagic.Scene#setPin
8434		 * @example
8435		 * // pin element and push all following elements down by the amount of the pin duration.
8436		 * scene.setPin("#pin");
8437		 *
8438		 * // pin element and keeping all following elements in their place. The pinned element will move past them.
8439		 * scene.setPin("#pin", {pushFollowers: false});
8440		 *
8441		 * @param {(string|object)} element - A Selector targeting an element or a DOM object that is supposed to be pinned.
8442		 * @param {object} [settings] - settings for the pin
8443		 * @param {boolean} [settings.pushFollowers=true] - If `true` following elements will be "pushed" down for the duration of the pin, if `false` the pinned element will just scroll past them.  
8444		 												   Ignored, when duration is `0`.
8445		 * @param {string} [settings.spacerClass="scrollmagic-pin-spacer"] - Classname of the pin spacer element, which is used to replace the element.
8446		 *
8447		 * @returns {Scene} Parent object for chaining.
8448		 */
8449		this.setPin = function (element, settings) {
8450			var
8451				defaultSettings = {
8452					pushFollowers: true,
8453					spacerClass: "scrollmagic-pin-spacer"
8454				};
8455			var pushFollowersActivelySet = settings && settings.hasOwnProperty('pushFollowers');
8456			settings = _util.extend({}, defaultSettings, settings);
8457
8458			// validate Element
8459			element = _util.get.elements(element)[0];
8460			if (!element) {
8461				log(1, "ERROR calling method 'setPin()': Invalid pin element supplied.");
8462				return Scene; // cancel
8463			} else if (_util.css(element, "position") === "fixed") {
8464				log(1, "ERROR calling method 'setPin()': Pin does not work with elements that are positioned 'fixed'.");
8465				return Scene; // cancel
8466			}
8467
8468			if (_pin) { // preexisting pin?
8469				if (_pin === element) {
8470					// same pin we already have -> do nothing
8471					return Scene; // cancel
8472				} else {
8473					// kill old pin
8474					Scene.removePin();
8475				}
8476
8477			}
8478			_pin = element;
8479
8480			var
8481				parentDisplay = _pin.parentNode.style.display,
8482				boundsParams = ["top", "left", "bottom", "right", "margin", "marginLeft", "marginRight", "marginTop", "marginBottom"];
8483
8484			_pin.parentNode.style.display = 'none'; // hack start to force css to return stylesheet values instead of calculated px values.
8485			var
8486				inFlow = _util.css(_pin, "position") != "absolute",
8487				pinCSS = _util.css(_pin, boundsParams.concat(["display"])),
8488				sizeCSS = _util.css(_pin, ["width", "height"]);
8489			_pin.parentNode.style.display = parentDisplay; // hack end.
8490
8491			if (!inFlow && settings.pushFollowers) {
8492				log(2, "WARNING: If the pinned element is positioned absolutely pushFollowers will be disabled.");
8493				settings.pushFollowers = false;
8494			}
8495			window.setTimeout(function () { // wait until all finished, because with responsive duration it will only be set after scene is added to controller
8496				if (_pin && _options.duration === 0 && pushFollowersActivelySet && settings.pushFollowers) {
8497					log(2, "WARNING: pushFollowers =", true, "has no effect, when scene duration is 0.");
8498				}
8499			}, 0);
8500
8501			// create spacer and insert
8502			var
8503				spacer = _pin.parentNode.insertBefore(document.createElement('div'), _pin),
8504				spacerCSS = _util.extend(pinCSS, {
8505					position: inFlow ? "relative" : "absolute",
8506					boxSizing: "content-box",
8507					mozBoxSizing: "content-box",
8508					webkitBoxSizing: "content-box"
8509				});
8510
8511			if (!inFlow) { // copy size if positioned absolutely, to work for bottom/right positioned elements.
8512				_util.extend(spacerCSS, _util.css(_pin, ["width", "height"]));
8513			}
8514
8515			_util.css(spacer, spacerCSS);
8516			spacer.setAttribute(PIN_SPACER_ATTRIBUTE, "");
8517			_util.addClass(spacer, settings.spacerClass);
8518
8519			// set the pin Options
8520			_pinOptions = {
8521				spacer: spacer,
8522				relSize: { // save if size is defined using % values. if so, handle spacer resize differently...
8523					width: sizeCSS.width.slice(-1) === "%",
8524					height: sizeCSS.height.slice(-1) === "%",
8525					autoFullWidth: sizeCSS.width === "auto" && inFlow && _util.isMarginCollapseType(pinCSS.display)
8526				},
8527				pushFollowers: settings.pushFollowers,
8528				inFlow: inFlow, // stores if the element takes up space in the document flow
8529			};
8530
8531			if (!_pin.___origStyle) {
8532				_pin.___origStyle = {};
8533				var
8534					pinInlineCSS = _pin.style,
8535					copyStyles = boundsParams.concat(["width", "height", "position", "boxSizing", "mozBoxSizing", "webkitBoxSizing"]);
8536				copyStyles.forEach(function (val) {
8537					_pin.___origStyle[val] = pinInlineCSS[val] || "";
8538				});
8539			}
8540
8541			// if relative size, transfer it to spacer and make pin calculate it...
8542			if (_pinOptions.relSize.width) {
8543				_util.css(spacer, {
8544					width: sizeCSS.width
8545				});
8546			}
8547			if (_pinOptions.relSize.height) {
8548				_util.css(spacer, {
8549					height: sizeCSS.height
8550				});
8551			}
8552
8553			// now place the pin element inside the spacer	
8554			spacer.appendChild(_pin);
8555			// and set new css
8556			_util.css(_pin, {
8557				position: inFlow ? "relative" : "absolute",
8558				margin: "auto",
8559				top: "auto",
8560				left: "auto",
8561				bottom: "auto",
8562				right: "auto"
8563			});
8564
8565			if (_pinOptions.relSize.width || _pinOptions.relSize.autoFullWidth) {
8566				_util.css(_pin, {
8567					boxSizing: "border-box",
8568					mozBoxSizing: "border-box",
8569					webkitBoxSizing: "border-box"
8570				});
8571			}
8572
8573			// add listener to document to update pin position in case controller is not the document.
8574			window.addEventListener('scroll', updatePinInContainer);
8575			window.addEventListener('resize', updatePinInContainer);
8576			window.addEventListener('resize', updateRelativePinSpacer);
8577			// add mousewheel listener to catch scrolls over fixed elements
8578			_pin.addEventListener("mousewheel", onMousewheelOverPin);
8579			_pin.addEventListener("DOMMouseScroll", onMousewheelOverPin);
8580
8581			log(3, "added pin");
8582
8583			// finally update the pin to init
8584			updatePinState();
8585
8586			return Scene;
8587		};
8588
8589		/**
8590		 * Remove the pin from the scene.
8591		 * @method ScrollMagic.Scene#removePin
8592		 * @example
8593		 * // remove the pin from the scene without resetting it (the spacer is not removed)
8594		 * scene.removePin();
8595		 *
8596		 * // remove the pin from the scene and reset the pin element to its initial position (spacer is removed)
8597		 * scene.removePin(true);
8598		 *
8599		 * @param {boolean} [reset=false] - If `false` the spacer will not be removed and the element's position will not be reset.
8600		 * @returns {Scene} Parent object for chaining.
8601		 */
8602		this.removePin = function (reset) {
8603			if (_pin) {
8604				if (_state === SCENE_STATE_DURING) {
8605					updatePinState(true); // force unpin at position
8606				}
8607				if (reset || !_controller) { // if there's no controller no progress was made anyway...
8608					var pinTarget = _pinOptions.spacer.firstChild; // usually the pin element, but may be another spacer (cascaded pins)...
8609					if (pinTarget.hasAttribute(PIN_SPACER_ATTRIBUTE)) { // copy margins to child spacer
8610						var
8611							style = _pinOptions.spacer.style,
8612							values = ["margin", "marginLeft", "marginRight", "marginTop", "marginBottom"],
8613							margins = {};
8614						values.forEach(function (val) {
8615							margins[val] = style[val] || "";
8616						});
8617						_util.css(pinTarget, margins);
8618					}
8619					_pinOptions.spacer.parentNode.insertBefore(pinTarget, _pinOptions.spacer);
8620					_pinOptions.spacer.parentNode.removeChild(_pinOptions.spacer);
8621					if (!_pin.parentNode.hasAttribute(PIN_SPACER_ATTRIBUTE)) { // if it's the last pin for this element -> restore inline styles
8622						// TODO: only correctly set for first pin (when cascading) - how to fix?
8623						_util.css(_pin, _pin.___origStyle);
8624						delete _pin.___origStyle;
8625					}
8626				}
8627				window.removeEventListener('scroll', updatePinInContainer);
8628				window.removeEventListener('resize', updatePinInContainer);
8629				window.removeEventListener('resize', updateRelativePinSpacer);
8630				_pin.removeEventListener("mousewheel", onMousewheelOverPin);
8631				_pin.removeEventListener("DOMMouseScroll", onMousewheelOverPin);
8632				_pin = undefined;
8633				log(3, "removed pin (reset: " + (reset ? "true" : "false") + ")");
8634			}
8635			return Scene;
8636		};
8637
8638
8639		var
8640			_cssClasses,
8641			_cssClassElems = [];
8642
8643		Scene
8644			.on("destroy.internal", function (e) {
8645				Scene.removeClassToggle(e.reset);
8646			});
8647		/**
8648		 * Define a css class modification while the scene is active.  
8649		 * When the scene triggers the classes will be added to the supplied element and removed, when the scene is over.
8650		 * If the scene duration is 0 the classes will only be removed if the user scrolls back past the start position.
8651		 * @method ScrollMagic.Scene#setClassToggle
8652		 * @example
8653		 * // add the class 'myclass' to the element with the id 'my-elem' for the duration of the scene
8654		 * scene.setClassToggle("#my-elem", "myclass");
8655		 *
8656		 * // add multiple classes to multiple elements defined by the selector '.classChange'
8657		 * scene.setClassToggle(".classChange", "class1 class2 class3");
8658		 *
8659		 * @param {(string|object)} element - A Selector targeting one or more elements or a DOM object that is supposed to be modified.
8660		 * @param {string} classes - One or more Classnames (separated by space) that should be added to the element during the scene.
8661		 *
8662		 * @returns {Scene} Parent object for chaining.
8663		 */
8664		this.setClassToggle = function (element, classes) {
8665			var elems = _util.get.elements(element);
8666			if (elems.length === 0 || !_util.type.String(classes)) {
8667				log(1, "ERROR calling method 'setClassToggle()': Invalid " + (elems.length === 0 ? "element" : "classes") + " supplied.");
8668				return Scene;
8669			}
8670			if (_cssClassElems.length > 0) {
8671				// remove old ones
8672				Scene.removeClassToggle();
8673			}
8674			_cssClasses = classes;
8675			_cssClassElems = elems;
8676			Scene.on("enter.internal_class leave.internal_class", function (e) {
8677				var toggle = e.type === "enter" ? _util.addClass : _util.removeClass;
8678				_cssClassElems.forEach(function (elem, key) {
8679					toggle(elem, _cssClasses);
8680				});
8681			});
8682			return Scene;
8683		};
8684
8685		/**
8686		 * Remove the class binding from the scene.
8687		 * @method ScrollMagic.Scene#removeClassToggle
8688		 * @example
8689		 * // remove class binding from the scene without reset
8690		 * scene.removeClassToggle();
8691		 *
8692		 * // remove class binding and remove the changes it caused
8693		 * scene.removeClassToggle(true);
8694		 *
8695		 * @param {boolean} [reset=false] - If `false` and the classes are currently active, they will remain on the element. If `true` they will be removed.
8696		 * @returns {Scene} Parent object for chaining.
8697		 */
8698		this.removeClassToggle = function (reset) {
8699			if (reset) {
8700				_cssClassElems.forEach(function (elem, key) {
8701					_util.removeClass(elem, _cssClasses);
8702				});
8703			}
8704			Scene.off("start.internal_class end.internal_class");
8705			_cssClasses = undefined;
8706			_cssClassElems = [];
8707			return Scene;
8708		};
8709
8710		// INIT
8711		construct();
8712		return Scene;
8713	};
8714
8715	// store pagewide scene options
8716	var SCENE_OPTIONS = {
8717		defaults: {
8718			duration: 0,
8719			offset: 0,
8720			triggerElement: undefined,
8721			triggerHook: 0.5,
8722			reverse: true,
8723			loglevel: 2
8724		},
8725		validate: {
8726			offset: function (val) {
8727				val = parseFloat(val);
8728				if (!_util.type.Number(val)) {
8729					throw ["Invalid value for option \"offset\":", val];
8730				}
8731				return val;
8732			},
8733			triggerElement: function (val) {
8734				val = val || undefined;
8735				if (val) {
8736					var elem = _util.get.elements(val)[0];
8737					if (elem && elem.parentNode) {
8738						val = elem;
8739					} else {
8740						throw ["Element defined in option \"triggerElement\" was not found:", val];
8741					}
8742				}
8743				return val;
8744			},
8745			triggerHook: function (val) {
8746				var translate = {
8747					"onCenter": 0.5,
8748					"onEnter": 1,
8749					"onLeave": 0
8750				};
8751				if (_util.type.Number(val)) {
8752					val = Math.max(0, Math.min(parseFloat(val), 1)); //  make sure its betweeen 0 and 1
8753				} else if (val in translate) {
8754					val = translate[val];
8755				} else {
8756					throw ["Invalid value for option \"triggerHook\": ", val];
8757				}
8758				return val;
8759			},
8760			reverse: function (val) {
8761				return !!val; // force boolean
8762			},
8763			loglevel: function (val) {
8764				val = parseInt(val);
8765				if (!_util.type.Number(val) || val < 0 || val > 3) {
8766					throw ["Invalid value for option \"loglevel\":", val];
8767				}
8768				return val;
8769			}
8770		}, // holder for  validation methods. duration validation is handled in 'getters-setters.js'
8771		shifts: ["duration", "offset", "triggerHook"], // list of options that trigger a `shift` event
8772	};
8773	/*
8774	 * method used to add an option to ScrollMagic Scenes.
8775	 * TODO: DOC (private for dev)
8776	 */
8777	ScrollMagic.Scene.addOption = function (name, defaultValue, validationCallback, shifts) {
8778		if (!(name in SCENE_OPTIONS.defaults)) {
8779			SCENE_OPTIONS.defaults[name] = defaultValue;
8780			SCENE_OPTIONS.validate[name] = validationCallback;
8781			if (shifts) {
8782				SCENE_OPTIONS.shifts.push(name);
8783			}
8784		} else {
8785			ScrollMagic._util.log(1, "[static] ScrollMagic.Scene -> Cannot add Scene option '" + name + "', because it already exists.");
8786		}
8787	};
8788	// instance extension function for plugins
8789	// TODO: DOC (private for dev)
8790	ScrollMagic.Scene.extend = function (extension) {
8791		var oldClass = this;
8792		ScrollMagic.Scene = function () {
8793			oldClass.apply(this, arguments);
8794			this.$super = _util.extend({}, this); // copy parent state
8795			return extension.apply(this, arguments) || this;
8796		};
8797		_util.extend(ScrollMagic.Scene, oldClass); // copy properties
8798		ScrollMagic.Scene.prototype = oldClass.prototype; // copy prototype
8799		ScrollMagic.Scene.prototype.constructor = ScrollMagic.Scene; // restore constructor
8800	};
8801
8802
8803
8804	/**
8805	 * TODO: DOCS (private for dev)
8806	 * @class
8807	 * @private
8808	 */
8809
8810	ScrollMagic.Event = function (type, namespace, target, vars) {
8811		vars = vars || {};
8812		for (var key in vars) {
8813			this[key] = vars[key];
8814		}
8815		this.type = type;
8816		this.target = this.currentTarget = target;
8817		this.namespace = namespace || '';
8818		this.timeStamp = this.timestamp = Date.now();
8819		return this;
8820	};
8821
8822	/*
8823	 * TODO: DOCS (private for dev)
8824	 */
8825
8826	var _util = ScrollMagic._util = (function (window) {
8827		var U = {},
8828			i;
8829
8830		/**
8831		 * ------------------------------
8832		 * internal helpers
8833		 * ------------------------------
8834		 */
8835
8836		// parse float and fall back to 0.
8837		var floatval = function (number) {
8838			return parseFloat(number) || 0;
8839		};
8840		// get current style IE safe (otherwise IE would return calculated values for 'auto')
8841		var _getComputedStyle = function (elem) {
8842			return elem.currentStyle ? elem.currentStyle : window.getComputedStyle(elem);
8843		};
8844
8845		// get element dimension (width or height)
8846		var _dimension = function (which, elem, outer, includeMargin) {
8847			elem = (elem === document) ? window : elem;
8848			if (elem === window) {
8849				includeMargin = false;
8850			} else if (!_type.DomElement(elem)) {
8851				return 0;
8852			}
8853			which = which.charAt(0).toUpperCase() + which.substr(1).toLowerCase();
8854			var dimension = (outer ? elem['offset' + which] || elem['outer' + which] : elem['client' + which] || elem['inner' + which]) || 0;
8855			if (outer && includeMargin) {
8856				var style = _getComputedStyle(elem);
8857				dimension += which === 'Height' ? floatval(style.marginTop) + floatval(style.marginBottom) : floatval(style.marginLeft) + floatval(style.marginRight);
8858			}
8859			return dimension;
8860		};
8861		// converts 'margin-top' into 'marginTop'
8862		var _camelCase = function (str) {
8863			return str.replace(/^[^a-z]+([a-z])/g, '$1').replace(/-([a-z])/g, function (g) {
8864				return g[1].toUpperCase();
8865			});
8866		};
8867
8868		/**
8869		 * ------------------------------
8870		 * external helpers
8871		 * ------------------------------
8872		 */
8873
8874		// extend obj – same as jQuery.extend({}, objA, objB)
8875		U.extend = function (obj) {
8876			obj = obj || {};
8877			for (i = 1; i < arguments.length; i++) {
8878				if (!arguments[i]) {
8879					continue;
8880				}
8881				for (var key in arguments[i]) {
8882					if (arguments[i].hasOwnProperty(key)) {
8883						obj[key] = arguments[i][key];
8884					}
8885				}
8886			}
8887			return obj;
8888		};
8889
8890		// check if a css display type results in margin-collapse or not
8891		U.isMarginCollapseType = function (str) {
8892			return ["block", "flex", "list-item", "table", "-webkit-box"].indexOf(str) > -1;
8893		};
8894
8895		// implementation of requestAnimationFrame
8896		// based on https://gist.github.com/paulirish/1579671
8897		var
8898			lastTime = 0,
8899			vendors = ['ms', 'moz', 'webkit', 'o'];
8900		var _requestAnimationFrame = window.requestAnimationFrame;
8901		var _cancelAnimationFrame = window.cancelAnimationFrame;
8902		// try vendor prefixes if the above doesn't work
8903		for (i = 0; !_requestAnimationFrame && i < vendors.length; ++i) {
8904			_requestAnimationFrame = window[vendors[i] + 'RequestAnimationFrame'];
8905			_cancelAnimationFrame = window[vendors[i] + 'CancelAnimationFrame'] || window[vendors[i] + 'CancelRequestAnimationFrame'];
8906		}
8907
8908		// fallbacks
8909		if (!_requestAnimationFrame) {
8910			_requestAnimationFrame = function (callback) {
8911				var
8912					currTime = new Date().getTime(),
8913					timeToCall = Math.max(0, 16 - (currTime - lastTime)),
8914					id = window.setTimeout(function () {
8915						callback(currTime + timeToCall);
8916					}, timeToCall);
8917				lastTime = currTime + timeToCall;
8918				return id;
8919			};
8920		}
8921		if (!_cancelAnimationFrame) {
8922			_cancelAnimationFrame = function (id) {
8923				window.clearTimeout(id);
8924			};
8925		}
8926		U.rAF = _requestAnimationFrame.bind(window);
8927		U.cAF = _cancelAnimationFrame.bind(window);
8928
8929		var
8930			loglevels = ["error", "warn", "log"],
8931			console = window.console || {};
8932
8933		console.log = console.log || function () {}; // no console log, well - do nothing then...
8934		// make sure methods for all levels exist.
8935		for (i = 0; i < loglevels.length; i++) {
8936			var method = loglevels[i];
8937			if (!console[method]) {
8938				console[method] = console.log; // prefer .log over nothing
8939			}
8940		}
8941		U.log = function (loglevel) {
8942			if (loglevel > loglevels.length || loglevel <= 0) loglevel = loglevels.length;
8943			var now = new Date(),
8944				time = ("0" + now.getHours()).slice(-2) + ":" + ("0" + now.getMinutes()).slice(-2) + ":" + ("0" + now.getSeconds()).slice(-2) + ":" + ("00" + now.getMilliseconds()).slice(-3),
8945				method = loglevels[loglevel - 1],
8946				args = Array.prototype.splice.call(arguments, 1),
8947				func = Function.prototype.bind.call(console[method], console);
8948			args.unshift(time);
8949			func.apply(console, args);
8950		};
8951
8952		/**
8953		 * ------------------------------
8954		 * type testing
8955		 * ------------------------------
8956		 */
8957
8958		var _type = U.type = function (v) {
8959			return Object.prototype.toString.call(v).replace(/^\[object (.+)\]$/, "$1").toLowerCase();
8960		};
8961		_type.String = function (v) {
8962			return _type(v) === 'string';
8963		};
8964		_type.Function = function (v) {
8965			return _type(v) === 'function';
8966		};
8967		_type.Array = function (v) {
8968			return Array.isArray(v);
8969		};
8970		_type.Number = function (v) {
8971			return !_type.Array(v) && (v - parseFloat(v) + 1) >= 0;
8972		};
8973		_type.DomElement = function (o) {
8974			return (
8975				typeof HTMLElement === "object" || typeof HTMLElement === "function" ? o instanceof HTMLElement || o instanceof SVGElement : //DOM2
8976				o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string"
8977			);
8978		};
8979
8980		/**
8981		 * ------------------------------
8982		 * DOM Element info
8983		 * ------------------------------
8984		 */
8985		// always returns a list of matching DOM elements, from a selector, a DOM element or an list of elements or even an array of selectors
8986		var _get = U.get = {};
8987		_get.elements = function (selector) {
8988			var arr = [];
8989			if (_type.String(selector)) {
8990				try {
8991					selector = document.querySelectorAll(selector);
8992				} catch (e) { // invalid selector
8993					return arr;
8994				}
8995			}
8996			if (_type(selector) === 'nodelist' || _type.Array(selector) || selector instanceof NodeList) {
8997				for (var i = 0, ref = arr.length = selector.length; i < ref; i++) { // list of elements
8998					var elem = selector[i];
8999					arr[i] = _type.DomElement(elem) ? elem : _get.elements(elem); // if not an element, try to resolve recursively
9000				}
9001			} else if (_type.DomElement(selector) || selector === document || selector === window) {
9002				arr = [selector]; // only the element
9003			}
9004			return arr;
9005		};
9006		// get scroll top value
9007		_get.scrollTop = function (elem) {
9008			return (elem && typeof elem.scrollTop === 'number') ? elem.scrollTop : window.pageYOffset || 0;
9009		};
9010		// get scroll left value
9011		_get.scrollLeft = function (elem) {
9012			return (elem && typeof elem.scrollLeft === 'number') ? elem.scrollLeft : window.pageXOffset || 0;
9013		};
9014		// get element height
9015		_get.width = function (elem, outer, includeMargin) {
9016			return _dimension('width', elem, outer, includeMargin);
9017		};
9018		// get element width
9019		_get.height = function (elem, outer, includeMargin) {
9020			return _dimension('height', elem, outer, includeMargin);
9021		};
9022
9023		// get element position (optionally relative to viewport)
9024		_get.offset = function (elem, relativeToViewport) {
9025			var offset = {
9026				top: 0,
9027				left: 0
9028			};
9029			if (elem && elem.getBoundingClientRect) { // check if available
9030				var rect = elem.getBoundingClientRect();
9031				offset.top = rect.top;
9032				offset.left = rect.left;
9033				if (!relativeToViewport) { // clientRect is by default relative to viewport...
9034					offset.top += _get.scrollTop();
9035					offset.left += _get.scrollLeft();
9036				}
9037			}
9038			return offset;
9039		};
9040
9041		/**
9042		 * ------------------------------
9043		 * DOM Element manipulation
9044		 * ------------------------------
9045		 */
9046
9047		U.addClass = function (elem, classname) {
9048			if (classname) {
9049				if (elem.classList)
9050					elem.classList.add(classname);
9051				else
9052					elem.className += ' ' + classname;
9053			}
9054		};
9055		U.removeClass = function (elem, classname) {
9056			if (classname) {
9057				if (elem.classList)
9058					elem.classList.remove(classname);
9059				else
9060					elem.className = elem.className.replace(new RegExp('(^|\\b)' + classname.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
9061			}
9062		};
9063		// if options is string -> returns css value
9064		// if options is array -> returns object with css value pairs
9065		// if options is object -> set new css values
9066		U.css = function (elem, options) {
9067			if (_type.String(options)) {
9068				return _getComputedStyle(elem)[_camelCase(options)];
9069			} else if (_type.Array(options)) {
9070				var
9071					obj = {},
9072					style = _getComputedStyle(elem);
9073				options.forEach(function (option, key) {
9074					obj[option] = style[_camelCase(option)];
9075				});
9076				return obj;
9077			} else {
9078				for (var option in options) {
9079					var val = options[option];
9080					if (val == parseFloat(val)) { // assume pixel for seemingly numerical values
9081						val += 'px';
9082					}
9083					elem.style[_camelCase(option)] = val;
9084				}
9085			}
9086		};
9087
9088		return U;
9089	}(window || {}));
9090
9091
9092	ScrollMagic.Scene.prototype.addIndicators = function () {
9093		ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling addIndicators() due to missing Plugin \'debug.addIndicators\'. Please make sure to include plugins/debug.addIndicators.js');
9094		return this;
9095	}
9096	ScrollMagic.Scene.prototype.removeIndicators = function () {
9097		ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeIndicators() due to missing Plugin \'debug.addIndicators\'. Please make sure to include plugins/debug.addIndicators.js');
9098		return this;
9099	}
9100	ScrollMagic.Scene.prototype.setTween = function () {
9101		ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling setTween() due to missing Plugin \'animation.gsap\'. Please make sure to include plugins/animation.gsap.js');
9102		return this;
9103	}
9104	ScrollMagic.Scene.prototype.removeTween = function () {
9105		ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeTween() due to missing Plugin \'animation.gsap\'. Please make sure to include plugins/animation.gsap.js');
9106		return this;
9107	}
9108	ScrollMagic.Scene.prototype.setVelocity = function () {
9109		ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling setVelocity() due to missing Plugin \'animation.velocity\'. Please make sure to include plugins/animation.velocity.js');
9110		return this;
9111	}
9112	ScrollMagic.Scene.prototype.removeVelocity = function () {
9113		ScrollMagic._util.log(1, '(ScrollMagic.Scene) -> ERROR calling removeVelocity() due to missing Plugin \'animation.velocity\'. Please make sure to include plugins/animation.velocity.js');
9114		return this;
9115	}
9116
9117	return ScrollMagic;
9118}));
9119/*!
9120 * ScrollMagic v2.0.8 (2020-08-14)
9121 * The javascript library for magical scroll interactions.
9122 * (c) 2020 Jan Paepke (@janpaepke)
9123 * Project Website: http://scrollmagic.io
9124 * 
9125 * @version 2.0.8
9126 * @license Dual licensed under MIT license and GPL.
9127 * @author Jan Paepke - [email protected]
9128 *
9129 * @file ScrollMagic GSAP Animation Plugin.
9130 *
9131 * requires: GSAP ~1.14
9132 * Powered by the Greensock Animation Platform (GSAP): http://www.greensock.com/js
9133 * Greensock License info at http://www.greensock.com/licensing/
9134 */
9135/**
9136 * This plugin is meant to be used in conjunction with the Greensock Animation Plattform.  
9137 * It offers an easy API to trigger Tweens or synchronize them to the scrollbar movement.
9138 *
9139 * Both the `lite` and the `max` versions of the GSAP library are supported.  
9140 * The most basic requirement is `TweenLite`.
9141 * 
9142 * To have access to this extension, please include `plugins/animation.gsap.js`.
9143 * @requires {@link http://greensock.com/gsap|GSAP ~1.14.x}
9144 * @mixin animation.GSAP
9145 */
9146(function (root, factory) {
9147	if (typeof define === 'function' && define.amd) {
9148		// AMD. Register as an anonymous module.
9149		define(['ScrollMagic', 'gsap', 'TweenMax', 'TimelineMax'], factory);
9150	} else if (typeof exports === 'object') {
9151		// CommonJS
9152		// Loads whole gsap package onto global scope.
9153		var gsap = require("gsap/dist/gsap") || require("gsap");
9154
9155		// TweenMax/TimelineMax will be global in v2. In v3, they will be on the gsap object
9156		factory(require('scrollmagic'), gsap, TweenMax || gsap, TimelineMax || gsap);
9157	} else {
9158		// Browser globals
9159		factory(root.ScrollMagic || (root.jQuery && root.jQuery.ScrollMagic), root.gsap, root.gsap || root.TweenMax || root.TweenLite, root.gsap || root.TimelineMax || root.TimelineLite);
9160	}
9161}(this, function (ScrollMagic, Gsap, Tween, Timeline) {
9162	"use strict";
9163	var NAMESPACE = "animation.gsap";
9164	var GSAP3_OR_GREATER = Gsap && parseFloat(Gsap.version) >= 3;
9165
9166	var
9167		console = window.console || {},
9168		err = Function.prototype.bind.call(console.error || console.log || function () {}, console);
9169	if (!ScrollMagic) {
9170		err("(" + NAMESPACE + ") -> 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.");
9171	}
9172	if (!Tween) {
9173		err("(" + NAMESPACE + ") -> ERROR: TweenLite or TweenMax could not be found. Please make sure GSAP is loaded before ScrollMagic or use an asynchronous loader like requirejs.");
9174	}
9175
9176	/*
9177	 * ----------------------------------------------------------------
9178	 * Extensions for Scene
9179	 * ----------------------------------------------------------------
9180	 */
9181	/**
9182	 * Every instance of ScrollMagic.Scene now accepts an additional option.  
9183	 * See {@link ScrollMagic.Scene} for a complete list of the standard options.
9184	 * @memberof! animation.GSAP#
9185	 * @method new ScrollMagic.Scene(options)
9186	 * @example
9187	 * var scene = new ScrollMagic.Scene({tweenChanges: true});
9188	 *
9189	 * @param {object} [options] - Options for the Scene. The options can be updated at any time.
9190	 * @param {boolean} [options.tweenChanges=false] - Tweens Animation to the progress target instead of setting it.  
9191	 												  Does not affect animations where duration is `0`.
9192	 */
9193	/**
9194	 * **Get** or **Set** the tweenChanges option value.  
9195	 * This only affects scenes with a duration. If `tweenChanges` is `true`, the progress update when scrolling will not be immediate, but instead the animation will smoothly animate to the target state.  
9196	 * For a better understanding, try enabling and disabling this option in the [Scene Manipulation Example](../examples/basic/scene_manipulation.html).
9197	 * @memberof! animation.GSAP#
9198	 * @method Scene.tweenChanges
9199	 * 
9200	 * @example
9201	 * // get the current tweenChanges option
9202	 * var tweenChanges = scene.tweenChanges();
9203	 *
9204	 * // set new tweenChanges option
9205	 * scene.tweenChanges(true);
9206	 *
9207	 * @fires {@link Scene.change}, when used as setter
9208	 * @param {boolean} [newTweenChanges] - The new tweenChanges setting of the scene.
9209	 * @returns {boolean} `get` -  Current tweenChanges option value.
9210	 * @returns {Scene} `set` -  Parent object for chaining.
9211	 */
9212	// add option (TODO: DOC (private for dev))
9213	ScrollMagic.Scene.addOption(
9214		"tweenChanges", // name
9215		false, // default
9216		function (val) { // validation callback
9217			return !!val;
9218		}
9219	);
9220	// extend scene
9221	ScrollMagic.Scene.extend(function () {
9222		var Scene = this,
9223			_tween;
9224
9225		var log = function () {
9226			if (Scene._log) { // not available, when main source minified
9227				Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
9228				Scene._log.apply(this, arguments);
9229			}
9230		};
9231
9232		// set listeners
9233		Scene.on("progress.plugin_gsap", function () {
9234			updateTweenProgress();
9235		});
9236		Scene.on("destroy.plugin_gsap", function (e) {
9237			Scene.removeTween(e.reset);
9238		});
9239
9240		/**
9241		 * Update the tween progress to current position.
9242		 * @private
9243		 */
9244		var updateTweenProgress = function () {
9245			if (_tween) {
9246				var
9247					progress = Scene.progress(),
9248					state = Scene.state();
9249				if (_tween.repeat && _tween.repeat() === -1) {
9250					// infinite loop, so not in relation to progress
9251					if (state === 'DURING' && _tween.paused()) {
9252						_tween.play();
9253					} else if (state !== 'DURING' && !_tween.paused()) {
9254						_tween.pause();
9255					}
9256				} else if (progress != _tween.progress()) { // do we even need to update the progress?
9257					// no infinite loop - so should we just play or go to a specific point in t
9257ime?
9258					if (Scene.duration() === 0) {
9259						// play the animation
9260						if (progress > 0) { // play from 0 to 1
9261							_tween.play();
9262						} else { // play from 1 to 0
9263							_tween.reverse();
9264						}
9265					} else {
9266						// go to a specific point in time
9267						if (Scene.tweenChanges() && _tween.tweenTo) {
9268							// go smooth
9269							_tween.tweenTo(progress * _tween.duration());
9270						} else {
9271							// just hard set it
9272							_tween.progress(progress).pause();
9273						}
9274					}
9275				}
9276			}
9277		};
9278
9279		/**
9280		 * Add a tween to the scene.  
9281		 * If you want to add multiple tweens, add them into a GSAP Timeline object and supply it instead (see example below).  
9282		 * 
9283		 * If the scene has a duration, the tween's duration will be projected to the scroll distance of the scene, meaning its progress will be synced to scrollbar movement.  
9284		 * For a scene with a duration of `0`, the tween will be triggered when scrolling forward past the scene's trigger position and reversed, when scrolling back.  
9285		 * To gain better understanding, check out the [Simple Tweening example](../examples/basic/simple_tweening.html).
9286		 *
9287		 * Instead of supplying a tween this method can also be used as a shorthand for `TweenMax.to()` (see example below).
9288		 * @memberof! animation.GSAP#
9289		 *
9290		 * @example
9291		 * // add a single tween directly
9292		 * scene.setTween(TweenMax.to("obj"), 1, {x: 100});
9293		 *
9294		 * // add a single tween via variable
9295		 * var tween = TweenMax.to("obj"), 1, {x: 100};
9296		 * scene.setTween(tween);
9297		 *
9298		 * // add multiple tweens, wrapped in a timeline.
9299		 * var timeline = new TimelineMax();
9300		 * var tween1 = TweenMax.from("obj1", 1, {x: 100});
9301		 * var tween2 = TweenMax.to("obj2", 1, {y: 100});
9302		 * timeline
9303		 *		.add(tween1)
9304		 *		.add(tween2);
9305		 * scene.addTween(timeline);
9306		 *
9307		 * // short hand to add a TweenMax.to() tween
9308		 * scene.setTween("obj3", 0.5, {y: 100});
9309		 *
9310		 * // short hand to add a TweenMax.to() tween for 1 second
9311		 * // this is useful, when the scene has a duration and the tween duration isn't important anyway
9312		 * scene.setTween("obj3", {y: 100});
9313		 *
9314		 * @param {(object|string)} TweenObject - A TweenMax, TweenLite, TimelineMax or TimelineLite object that should be animated in the scene. Can also be a Dom Element or Selector, when using direct tween definition (see examples).
9315		 * @param {(number|object)} duration - A duration for the tween, or tween parameters. If an object containing parameters are supplied, a default duration of 1 will be used.
9316		 * @param {object} params - The parameters for the tween
9317		 * @returns {Scene} Parent object for chaining.
9318		 */
9319		Scene.setTween = function (TweenObject, duration, params) {
9320			var newTween;
9321
9322			if (arguments.length > 1) {
9323				var durationIsSet = typeof arguments['1'] === 'number';
9324
9325				if (GSAP3_OR_GREATER) {
9326					// If we're using gsap 3 with proper gsap 3 syntax of 2 arguments
9327					if (!durationIsSet) {
9328						params = duration;
9329					}
9330					// Add a duration is there isn't one
9331					if (!params.hasOwnProperty('duration')) {
9332						params.duration = durationIsSet ? duration : 1;
9333					}
9334				} else {
9335					// If we're using gsap 2 or earlier syntax
9336					if (arguments.length < 3) {
9337						params = duration;
9338						duration = 1;
9339					}
9340				}
9341
9342				// 2 arguments should be gsap 3 syntax, and 3 arguments for 
9343				TweenObject = GSAP3_OR_GREATER ? Tween.to(TweenObject, params) : Tween.to(TweenObject, duration, params);
9344			}
9345			try {
9346				// wrap Tween into a Timeline Object if not gsap 3 or greater and available to include delay and repeats in the duration and standardize methods.
9347				if (Timeline && !GSAP3_OR_GREATER) {
9348					newTween = new Timeline({
9349							smoothChildTiming: true
9350						})
9351						.add(TweenObject);
9352				} else {
9353					newTween = TweenObject;
9354				}
9355				newTween.pause();
9356			} catch (e) {
9357				log(1, "ERROR calling method 'setTween()': Supplied argument is not a valid TweenObject");
9358				return Scene;
9359			}
9360			if (_tween) { // kill old tween?
9361				Scene.removeTween();
9362			}
9363			_tween = newTween;
9364
9365			// some properties need to be transferred it to the wrapper, otherwise they would get lost.
9366			if (TweenObject.repeat && TweenObject.repeat() === -1) { // TweenMax or TimelineMax Object?
9367				_tween.repeat(-1);
9368				_tween.yoyo(TweenObject.yoyo());
9369			}
9370			// Some tween validations and debugging helpers
9371
9372			if (Scene.tweenChanges() && !_tween.tweenTo) {
9373				log(2, "WARNING: tweenChanges will only work if the TimelineMax object is available for ScrollMagic.");
9374			}
9375
9376			// check if there are position tweens defined for the trigger and warn about it :)
9377			if (_tween && Scene.controller() && Scene.triggerElement() && Scene.loglevel() >= 2) { // controller is needed to know scroll direction.
9378				var
9379					triggerTweens = Tween.getTweensOf(Scene.triggerElement()),
9380					vertical = Scene.controller().info("vertical");
9381				triggerTweens.forEach(function (value, index) {
9382					var
9383						tweenvars = value.vars.css || value.vars,
9384						condition = vertical ? (tweenvars.top !== undefined || tweenvars.bottom !== undefined) : (tweenvars.left !== undefined || tweenvars.right !== undefined);
9385					if (condition) {
9386						log(2, "WARNING: Tweening the position of the trigger element affects the scene timing and should be avoided!");
9387						return false;
9388					}
9389				});
9390			}
9391
9392			// warn about tween overwrites, when an element is tweened multiple times
9393			if (parseFloat(TweenLite.version) >= 1.14) { // onOverwrite only present since GSAP v1.14.0
9394				var
9395					// However, onInterrupt deprecated onOverwrite in GSAP v3
9396					methodUsed = GSAP3_OR_GREATER ? 'onInterrupt' : 'onOverwrite',
9397					list = _tween.getChildren ? _tween.getChildren(true, true, false) : [_tween], // get all nested tween objects
9398					newCallback = function () {
9399						log(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");
9400					};
9401				for (var i = 0, thisTween, oldCallback; i < list.length; i++) {
9402					/*jshint loopfunc: true */
9403					thisTween = list[i];
9404					if (oldCallback !== newCallback) { // if tweens is added more than once
9405						oldCallback = thisTween.vars[methodUsed];
9406						thisTween.vars[methodUsed] = function () {
9407							if (oldCallback) {
9408								oldCallback.apply(this, arguments);
9409							}
9410							newCallback.apply(this, arguments);
9411						};
9412					}
9413				}
9414			}
9415			log(3, "added tween");
9416
9417			updateTweenProgress();
9418			return Scene;
9419		};
9420
9421		/**
9422		 * Remove the tween from the scene.  
9423		 * This will terminate the control of the Scene over the tween.
9424		 *
9425		 * Using the reset option you can decide if the tween should remain in the current state or be rewound to set the target elements back to the state they were in before the tween was added to the scene.
9426		 * @memberof! animation.GSAP#
9427		 *
9428		 * @example
9429		 * // remove the tween from the scene without resetting it
9430		 * scene.removeTween();
9431		 *
9432		 * // remove the tween from the scene and reset it to initial position
9433		 * scene.removeTween(true);
9434		 *
9435		 * @param {boolean} [reset=false] - If `true` the tween will be reset to its initial values.
9436		 * @returns {Scene} Parent object for chaining.
9437		 */
9438		Scene.removeTween = function (reset) {
9439			if (_tween) {
9440				if (reset) {
9441					_tween.progress(0).pause();
9442				}
9443				_tween.kill();
9444				_tween = undefined;
9445				log(3, "removed tween (reset: " + (reset ? "true" : "false") + ")");
9446			}
9447			return Scene;
9448		};
9449
9450	});
9451}));
9452/*!
9453 * ScrollMagic v2.0.8 (2020-08-14)
9454 * The javascript library for magical scroll interactions.
9455 * (c) 2020 Jan Paepke (@janpaepke)
9456 * Project Website: http://scrollmagic.io
9457 * 
9458 * @version 2.0.8
9459 * @license Dual licensed under MIT license and GPL.
9460 * @author Jan Paepke - [email protected]
9461 *
9462 * @file Debug Extension for ScrollMagic.
9463 */
9464/**
9465 * This plugin was formerly known as the ScrollMagic debug extension.
9466 *
9467 * It enables you to add visual indicators to your page, to be able to see exactly when a scene is triggered.
9468 *
9469 * To have access to this extension, please include `plugins/debug.addIndicators.js`.
9470 * @mixin debug.addIndicators
9471 */
9472(function (root, factory) {
9473	if (typeof define === 'function' && define.amd) {
9474		// AMD. Register as an anonymous module.
9475		define(['ScrollMagic'], factory);
9476	} else if (typeof exports === 'object') {
9477		// CommonJS
9478		factory(require('scrollmagic'));
9479	} else {
9480		// no browser global export needed, just execute
9481		factory(root.ScrollMagic || (root.jQuery && root.jQuery.ScrollMagic));
9482	}
9483}(this, function (ScrollMagic) {
9484	"use strict";
9485	var NAMESPACE = "debug.addIndicators";
9486
9487	var
9488		console = window.console || {},
9489		err = Function.prototype.bind.call(console.error || console.log || function () {}, console);
9490	if (!ScrollMagic) {
9491		err("(" + NAMESPACE + ") -> 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.");
9492	}
9493
9494	// plugin settings
9495	var
9496		FONT_SIZE = "0.85em",
9497		ZINDEX = "9999",
9498		EDGE_OFFSET = 15; // minimum edge distance, added to indentation
9499
9500	// overall vars
9501	var
9502		_util = ScrollMagic._util,
9503		_autoindex = 0;
9504
9505
9506
9507	ScrollMagic.Scene.extend(function () {
9508		var
9509			Scene = this,
9510			_indicator;
9511
9512		var log = function () {
9513			if (Scene._log) { // not available, when main source minified
9514				Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
9515				Scene._log.apply(this, arguments);
9516			}
9517		};
9518
9519		/**
9520		 * Add visual indicators for a ScrollMagic.Scene.  
9521		 * @memberof! debug.addIndicators#
9522		 *
9523		 * @example
9524		 * // add basic indicators
9525		 * scene.addIndicators()
9526		 *
9527		 * // passing options
9528		 * scene.addIndicators({name: "pin scene", colorEnd: "#FFFFFF"});
9529		 *
9530		 * @param {object} [options] - An object containing one or more options for the indicators.
9531		 * @param {(string|object)} [options.parent] - A selector, DOM Object or a jQuery object that the indicators should be added to.  
9532		 														 														 If undefined, the controller's container will be used.
9533		 * @param {number} [options.name=""] - This string will be displayed at the start and end indicators of the scene for identification purposes. If no name is supplied an automatic index will be used.
9534		 * @param {number} [options.indent=0] - Additional position offset for the indicators (useful, when having multiple scenes starting at the same position).
9535		 * @param {string} [options.colorStart=green] - CSS color definition for the start indicator.
9536		 * @param {string} [options.colorEnd=red] - CSS color definition for the end indicator.
9537		 * @param {string} [options.colorTrigger=blue] - CSS color definition for the trigger indicator.
9538		 */
9539		Scene.addIndicators = function (options) {
9540			if (!_indicator) {
9541				var
9542					DEFAULT_OPTIONS = {
9543						name: "",
9544						indent: 0,
9545						parent: undefined,
9546						colorStart: "green",
9547						colorEnd: "red",
9548						colorTrigger: "blue",
9549					};
9550
9551				options = _util.extend({}, DEFAULT_OPTIONS, options);
9552
9553				_autoindex++;
9554				_indicator = new Indicator(Scene, options);
9555
9556				Scene.on("add.plugin_addIndicators", _indicator.add);
9557				Scene.on("remove.plugin_addIndicators", _indicator.remove);
9558				Scene.on("destroy.plugin_addIndicators", Scene.removeIndicators);
9559
9560				// it the scene already has a controller we can start right away.
9561				if (Scene.controller()) {
9562					_indicator.add();
9563				}
9564			}
9565			return Scene;
9566		};
9567
9568		/**
9569		 * Removes visual indicators from a ScrollMagic.Scene.
9570		 * @memberof! debug.addIndicators#
9571		 *
9572		 * @example
9573		 * // remove previously added indicators
9574		 * scene.removeIndicators()
9575		 *
9576		 */
9577		Scene.removeIndicators = function () {
9578			if (_indicator) {
9579				_indicator.remove();
9580				this.off("*.plugin_addIndicators");
9581				_indicator = undefined;
9582			}
9583			return Scene;
9584		};
9585
9586	});
9587
9588
9589	/*
9590	 * ----------------------------------------------------------------
9591	 * Extension for controller to store and update related indicators
9592	 * ----------------------------------------------------------------
9593	 */
9594	// add option to globally auto-add indicators to scenes
9595	/**
9596	 * Every ScrollMagic.Controller instance now accepts an additional option.  
9597	 * See {@link ScrollMagic.Controller} for a complete list of the standard options.
9598	 * @memberof! debug.addIndicators#
9599	 * @method new ScrollMagic.Controller(options)
9600	 * @example
9601	 * // make a controller and add indicators to all scenes attached
9602	 * var controller = new ScrollMagic.Controller({addIndicators: true});
9603	 * // this scene will automatically have indicators added to it
9604	 * new ScrollMagic.Scene()
9605	 *                .addTo(controller);
9606	 *
9607	 * @param {object} [options] - Options for the Controller.
9608	 * @param {boolean} [options.addIndicators=false] - If set to `true` every scene that is added to the controller will automatically get indicators added to it.
9609	 */
9610	ScrollMagic.Controller.addOption("addIndicators", false);
9611	// extend Controller
9612	ScrollMagic.Controller.extend(function () {
9613		var
9614			Controller = this,
9615			_info = Controller.info(),
9616			_container = _info.container,
9617			_isDocument = _info.isDocument,
9618			_vertical = _info.vertical,
9619			_indicators = { // container for all indicators and methods
9620				groups: []
9621			};
9622
9623		var log = function () {
9624			if (Controller._log) { // not available, when main source minified
9625				Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
9626				Controller._log.apply(this, arguments);
9627			}
9628		};
9629		if (Controller._indicators) {
9630			log(2, "WARNING: Scene already has a property '_indicators', which will be overwritten by plugin.");
9631		}
9632
9633		// add indicators container
9634		this._indicators = _indicators;
9635		/*
9636			needed updates:
9637			+++++++++++++++
9638			start/end position on scene shift (handled in Indicator class)
9639			trigger parameters on triggerHook value change (handled in Indicator class)
9640			bounds position on container scroll or resize (to keep alignment to bottom/right)
9641			trigger position on container resize, window resize (if container isn't document) and window scroll (if container isn't document)
9642		*/
9643
9644		// event handler for when associated bounds markers need to be repositioned
9645		var handleBoundsPositionChange = function () {
9646			_indicators.updateBoundsPositions();
9647		};
9648
9649		// event handler for when associated trigger groups need to be repositioned
9650		var handleTriggerPositionChange = function () {
9651			_indicators.updateTriggerGroupPositions();
9652		};
9653
9654		_container.addEventListener("resize", handleTriggerPositionChange);
9655		if (!_isDocument) {
9656			window.addEventListener("resize", handleTriggerPositionChange);
9657			window.addEventListener("scroll", handleTriggerPositionChange);
9658		}
9659		// update all related bounds containers
9660		_container.addEventListener("resize", handleBoundsPositionChange);
9661		_container.addEventListener("scroll", handleBoundsPositionChange);
9662
9663
9664		// updates the position of the bounds container to aligned to the right for vertical containers and to the bottom for horizontal
9665		this._indicators.updateBoundsPositions = function (specificIndicator) {
9666			var // constant for all bounds
9667				groups = specificIndicator ? [_util.extend({}, specificIndicator.triggerGroup, {
9668					members: [specificIndicator]
9669				})] : // create a group with only one element
9670				_indicators.groups, // use all
9671				g = groups.length,
9672				css = {},
9673				paramPos = _vertical ? "left" : "top",
9674				paramDimension = _vertical ? "width" : "height",
9675				edge = _vertical ?
9676				_util.get.scrollLeft(_container) + _util.get.width(_container) - EDGE_OFFSET :
9677				_util.get.scrollTop(_container) + _util.get.height(_container) - EDGE_OFFSET,
9678				b, triggerSize, group;
9679			while (g--) { // group loop
9680				group = groups[g];
9681				b = group.members.length;
9682				triggerSize = _util.get[paramDimension](group.element.firstChild);
9683				while (b--) { // indicators loop
9684					css[paramPos] = edge - triggerSize;
9685					_util.css(group.members[b].bounds, css);
9686				}
9687			}
9688		};
9689
9690		// updates the positions of all trigger groups attached to a controller or a specific one, if provided
9691		this._indicators.updateTriggerGroupPositions = function (specificGroup) {
9692			var // constant vars
9693				groups = specificGroup ? [specificGroup] : _indicators.groups,
9694				i = groups.length,
9695				container = _isDocument ? document.body : _container,
9696				containerOffset = _isDocument ? {
9697					top: 0,
9698					left: 0
9699				} : _util.get.offset(container, true),
9700				edge = _vertical ?
9701				_util.get.width(_container) - EDGE_OFFSET :
9702				_util.get.height(_container) - EDGE_OFFSET,
9703				paramDimension = _vertical ? "width" : "height",
9704				paramTransform = _vertical ? "Y" : "X";
9705			var // changing vars
9706				group,
9707				elem,
9708				pos,
9709				elemSize,
9710				transform;
9711			while (i--) {
9712				group = groups[i];
9713				elem = group.element;
9714				pos = group.triggerHook * Controller.info("size");
9715				elemSize = _util.get[paramDimension](elem.firstChild.firstChild);
9716				transform = pos > elemSize ? "translate" + paramTransform + "(-100%)" : "";
9717
9718				_util.css(elem, {
9719					top: containerOffset.top + (_vertical ? pos : edge - group.members[0].options.indent),
9720					left: containerOffset.left + (_vertical ? edge - group.members[0].options.indent : pos)
9721				});
9722				_util.css(elem.firstChild.firstChild, {
9723					"-ms-transform": transform,
9724					"-webkit-transform": transform,
9725					"transform": transform
9726				});
9727			}
9728		};
9729
9730		// updates the label for the group to contain the name, if it only has one member
9731		this._indicators.updateTriggerGroupLabel = function (group) {
9732			var
9733				text = "trigger" + (group.members.length > 1 ? "" : " " + group.members[0].options.name),
9734				elem = group.element.firstChild.firstChild,
9735				doUpdate = elem.textContent !== text;
9736			if (doUpdate) {
9737				elem.textContent = text;
9738				if (_vertical) { // bounds position is dependent on text length, so update
9739					_indicators.updateBoundsPositions();
9740				}
9741			}
9742		};
9743
9744		// add indicators if global option is set
9745		this.addScene = function (newScene) {
9746
9747			if (this._options.addIndicators && newScene instanceof ScrollMagic.Scene && newScene.controller() === Controller) {
9748				newScene.addIndicators();
9749			}
9750			// call original destroy method
9751			this.$super.addScene.apply(this, arguments);
9752		};
9753
9754		// remove all previously set listeners on destroy
9755		this.destroy = function () {
9756			_container.removeEventListener("resize", handleTriggerPositionChange);
9757			if (!_isDocument) {
9758				window.removeEventListener("resize", handleTriggerPositionChange);
9759				window.removeEventListener("scroll", handleTriggerPositionChange);
9760			}
9761			_container.removeEventListener("resize", handleBoundsPositionChange);
9762			_container.removeEventListener("scroll", handleBoundsPositionChange);
9763			// call original destroy method
9764			this.$super.destroy.apply(this, arguments);
9765		};
9766		return Controller;
9767
9768	});
9769
9770	/*
9771	 * ----------------------------------------------------------------
9772	 * Internal class for the construction of Indicators
9773	 * ----------------------------------------------------------------
9774	 */
9775	var Indicator = function (Scene, options) {
9776		var
9777			Indicator = this,
9778			_elemBounds = TPL.bounds(),
9779			_elemStart = TPL.start(options.colorStart),
9780			_elemEnd = TPL.end(options.colorEnd),
9781			_boundsContainer = options.parent && _util.get.elements(options.parent)[0],
9782			_vertical,
9783			_ctrl;
9784
9785		var log = function () {
9786			if (Scene._log) { // not available, when main source minified
9787				Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
9788				Scene._log.apply(this, arguments);
9789			}
9790		};
9791
9792		options.name = options.name || _autoindex;
9793
9794		// prepare bounds elements
9795		_elemStart.firstChild.textContent += " " + options.name;
9796		_elemEnd.textContent += " " + options.name;
9797		_elemBounds.appendChild(_elemStart);
9798		_elemBounds.appendChild(_elemEnd);
9799
9800		// set public variables
9801		Indicator.options = options;
9802		Indicator.bounds = _elemBounds;
9803		// will be set later
9804		Indicator.triggerGroup = undefined;
9805
9806		// add indicators to DOM
9807		this.add = function () {
9808			_ctrl = Scene.controller();
9809			_vertical = _ctrl.info("vertical");
9810
9811			var isDocument = _ctrl.info("isDocument");
9812
9813			if (!_boundsContainer) {
9814				// no parent supplied or doesnt exist
9815				_boundsContainer = isDocument ? document.body : _ctrl.info("container"); // check if window/document (then use body)
9816			}
9817			if (!isDocument && _util.css(_boundsContainer, "position") === 'static') {
9818				// position mode needed for correct positioning of indicators
9819				_util.css(_boundsContainer, {
9820					position: "relative"
9821				});
9822			}
9823
9824			// add listeners for updates
9825			Scene.on("change.plugin_addIndicators", handleTriggerParamsChange);
9826			Scene.on("shift.plugin_addIndicators", handleBoundsParamsChange);
9827
9828			// updates trigger & bounds (will add elements if needed)
9829			updateTriggerGroup();
9830			updateBounds();
9831
9832			setTimeout(function () { // do after all execution is finished otherwise sometimes size calculations are off
9833				_ctrl._indicators.updateBoundsPositions(Indicator);
9834			}, 0);
9835
9836			log(3, "added indicators");
9837		};
9838
9839		// remove indicators from DOM
9840		this.remove = function () {
9841			if (Indicator.triggerGroup) { // if not set there's nothing to remove
9842				Scene.off("change.plugin_addIndicators", handleTriggerParamsChange);
9843				Scene.off("shift.plugin_addIndicators", handleBoundsParamsChange);
9844
9845				if (Indicator.triggerGroup.members.length > 1) {
9846					// just remove from memberlist of old group
9847					var group = Indicator.triggerGroup;
9848					group.members.splice(group.members.indexOf(Indicator), 1);
9849					_ctrl._indicators.updateTriggerGroupLabel(group);
9850					_ctrl._indicators.updateTriggerGroupPositions(group);
9851					Indicator.triggerGroup = undefined;
9852				} else {
9853					// remove complete group
9854					removeTriggerGroup();
9855				}
9856				removeBounds();
9857
9858				log(3, "removed indicators");
9859			}
9860		};
9861
9862		/*
9863		 * ----------------------------------------------------------------
9864		 * internal Event Handlers
9865		 * ----------------------------------------------------------------
9866		 */
9867
9868		// event handler for when bounds params change
9869		var handleBoundsParamsChange = function () {
9870			updateBounds();
9871		};
9872
9873		// event handler for when trigger params change
9874		var handleTriggerParamsChange = function (e) {
9875			if (e.what === "triggerHook") {
9876				updateTriggerGroup();
9877			}
9878		};
9879
9880		/*
9881		 * ----------------------------------------------------------------
9882		 * Bounds (start / stop) management
9883		 * ----------------------------------------------------------------
9884		 */
9885
9886		// adds an new bounds elements to the array and to the DOM
9887		var addBounds = function () {
9888			var v = _ctrl.info("vertical");
9889			// apply stuff we didn't know before...
9890			_util.css(_elemStart.firstChild, {
9891				"border-bottom-width": v ? 1 : 0,
9892				"border-right-width": v ? 0 : 1,
9893				"bottom": v ? -1 : options.indent,
9894				"right": v ? options.indent : -1,
9895				"padding": v ? "0 8px" : "2px 4px",
9896			});
9897			_util.css(_elemEnd, {
9898				"border-top-width": v ? 1 : 0,
9899				"border-left-width": v ? 0 : 1,
9900				"top": v ? "100%" : "",
9901				"right": v ? options.indent : "",
9902				"bottom": v ? "" : options.indent,
9903				"left": v ? "" : "100%",
9904				"padding": v ? "0 8px" : "2px 4px"
9905			});
9906			// append
9907			_boundsContainer.appendChild(_elemBounds);
9908		};
9909
9910		// remove bounds from list and DOM
9911		var removeBounds = function () {
9912			_elemBounds.parentNode.removeChild(_elemBounds);
9913		};
9914
9915		// update the start and end positions of the scene
9916		var updateBounds = function () {
9917			if (_elemBounds.parentNode !== _boundsContainer) {
9918				addBounds(); // Add Bounds elements (start/end)
9919			}
9920			var css = {};
9921			css[_vertical ? "top" : "left"] = Scene.triggerPosition();
9922			css[_vertical ? "height" : "width"] = Scene.duration();
9923			_util.css(_elemBounds, css);
9924			_util.css(_elemEnd, {
9925				display: Scene.duration() > 0 ? "" : "none"
9926			});
9927		};
9928
9929		/*
9930		 * ----------------------------------------------------------------
9931		 * trigger and trigger group management
9932		 * ----------------------------------------------------------------
9933		 */
9934
9935		// adds an new trigger group to the array and to the DOM
9936		var addTriggerGroup = function () {
9937			var triggerElem = TPL.trigger(options.colorTrigger); // new trigger element
9938			var css = {};
9939			css[_vertical ? "right" : "bottom"] = 0;
9940			css[_vertical ? "border-top-width" : "border-left-width"] = 1;
9941			_util.css(triggerElem.firstChild, css);
9942			_util.css(triggerElem.firstChild.firstChild, {
9943				padding: _vertical ? "0 8px 3px 8px" : "3px 4px"
9944			});
9945			document.body.appendChild(triggerElem); // directly add to body
9946			var newGroup = {
9947				triggerHook: Scene.triggerHook(),
9948				element: triggerElem,
9949				members: [Indicator]
9950			};
9951			_ctrl._indicators.groups.push(newGroup);
9952			Indicator.triggerGroup = newGroup;
9953			// update right away
9954			_ctrl._indicators.updateTriggerGroupLabel(newGroup);
9955			_ctrl._indicators.updateTriggerGroupPositions(newGroup);
9956		};
9957
9958		var removeTriggerGroup = function () {
9959			_ctrl._indicators.groups.splice(_ctrl._indicators.groups.indexOf(Indicator.triggerGroup), 1);
9960			Indicator.triggerGroup.element.parentNode.removeChild(Indicator.triggerGroup.element);
9961			Indicator.triggerGroup = undefined;
9962		};
9963
9964		// updates the trigger group -> either join existing or add new one
9965		/*	
9966		 * Logic:
9967		 * 1 if a trigger group exist, check if it's in sync with Scene settings – if so, nothing else needs to happen
9968		 * 2 try to find an existing one that matches Scene parameters
9969		 * 	 2.1 If a match is found check if already assigned to an existing group
9970		 *			 If so:
9971		 *       A: it was the last member of existing group -> kill whole group
9972		 *       B: the existing group has other members -> just remove from member list
9973		 *	 2.2 Assign to matching group
9974		 * 3 if no new match could be found, check if assigned to existing group
9975		 *   A: yes, and it's the only member -> just update parameters and positions and keep using this group
9976		 *   B: yes but there are other members -> remove from member list and create a new one
9977		 *   C: no, so create a new one
9978		 */
9979		var updateTriggerGroup = function () {
9980			var
9981				triggerHook = Scene.triggerHook(),
9982				closeEnough = 0.0001;
9983
9984			// Have a group, check if it still matches
9985			if (Indicator.triggerGroup) {
9986				if (Math.abs(Indicator.triggerGroup.triggerHook - triggerHook) < closeEnough) {
9987					// _util.log(0, "trigger", options.name, "->", "no need to change, still in sync");
9988					return; // all good
9989				}
9990			}
9991			// Don't have a group, check if a matching one exists
9992			// _util.log(0, "trigger", options.name, "->", "out of sync!");
9993			var
9994				groups = _ctrl._indicators.groups,
9995				group,
9996				i = groups.length;
9997			while (i--) {
9998				group = groups[i];
9999				if (Math.abs(group.triggerHook - triggerHook) < closeEnough) {
10000					// found a match!
10001					// _util.log(0, "trigger", options.name, "->", "found match");
10002					if (Indicator.triggerGroup) { // do I have an old group that is out of sync?
10003						if (Indicator.triggerGroup.members.length === 1) { // is it the only remaining group?
10004							// _util.log(0, "trigger", options.name, "->", "kill");
10005							// was the last member, remove the whole group
10006							removeTriggerGroup();
10007						} else {
10008							Indicator.triggerGroup.members.splice(Indicator.triggerGroup.members.indexOf(Indicator), 1); // just remove from memberlist of old group
10009							_ctrl._indicators.updateTriggerGroupLabel(Indicator.triggerGroup);
10010							_ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup);
10011							// _util.log(0, "trigger", options.name, "->", "removing from previous member list");
10012						}
10013					}
10014					// join new group
10015					group.members.push(Indicator);
10016					Indicator.triggerGroup = group;
10017					_ctrl._indicators.updateTriggerGroupLabel(group);
10018					return;
10019				}
10020			}
10021
10022			// at this point I am obviously out of sync and don't match any other group
10023			if (Indicator.triggerGroup) {
10024				if (Indicator.triggerGroup.members.length === 1) {
10025					// _util.log(0, "trigger", options.name, "->", "updating existing");
10026					// out of sync but i'm the only member => just change and update
10027					Indicator.triggerGroup.triggerHook = triggerHook;
10028					_ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup);
10029					return;
10030				} else {
10031					// _util.log(0, "trigger", options.name, "->", "removing from previous member list");
10032					Indicator.triggerGroup.members.splice(Indicator.triggerGroup.members.indexOf(Indicator), 1); // just remove from memberlist of old group
10033					_ctrl._indicators.updateTriggerGroupLabel(Indicator.triggerGroup);
10034					_ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup);
10035					Indicator.triggerGroup = undefined; // need a brand new group...
10036				}
10037			}
10038			// _util.log(0, "trigger", options.name, "->", "add a new one");
10039			// did not find any match, make new trigger group
10040			addTriggerGroup();
10041		};
10042	};
10043
10044	/*
10045	 * ----------------------------------------------------------------
10046	 * Templates for the indicators
10047	 * ----------------------------------------------------------------
10048	 */
10049	var TPL = {
10050		start: function (color) {
10051			// inner element (for bottom offset -1, while keeping top position 0)
10052			var inner = document.createElement("div");
10053			inner.textContent = "start";
10054			_util.css(inner, {
10055				position: "absolute",
10056				overflow: "visible",
10057				"border-width": 0,
10058				"border-style": "solid",
10059				color: color,
10060				"border-color": color
10061			});
10062			var e = document.createElement('div');
10063			// wrapper
10064			_util.css(e, {
10065				position: "absolute",
10066				overflow: "visible",
10067				width: 0,
10068				height: 0
10069			});
10070			e.appendChild(inner);
10071			return e;
10072		},
10073		end: function (color) {
10074			var e = document.createElement('div');
10075			e.textContent = "end";
10076			_util.css(e, {
10077				position: "absolute",
10078				overflow: "visible",
10079				"border-width": 0,
10080				"border-style": "solid",
10081				color: color,
10082				"border-color": color
10083			});
10084			return e;
10085		},
10086		bounds: function () {
10087			var e = document.createElement('div');
10088			_util.css(e, {
10089				position: "absolute",
10090				overflow: "visible",
10091				"white-space": "nowrap",
10092				"pointer-events": "none",
10093				"font-size": FONT_SIZE
10094			});
10095			e.style.zIndex = ZINDEX;
10096			return e;
10097		},
10098		trigger: function (color) {
10099			// inner to be above or below line but keep position
10100			var inner = document.createElement('div');
10101			inner.textContent = "trigger";
10102			_util.css(inner, {
10103				position: "relative",
10104			});
10105			// inner wrapper for right: 0 and main element has no size
10106			var w = document.createElement('div');
10107			_util.css(w, {
10108				position: "absolute",
10109				overflow: "visible",
10110				"border-width": 0,
10111				"border-style": "solid",
10112				color: color,
10113				"border-color": color
10114			});
10115			w.appendChild(inner);
10116			// wrapper
10117			var e = document.createElement('div');
10118			_util.css(e, {
10119				position: "fixed",
10120				overflow: "visible",
10121				"white-space": "nowrap",
10122				"pointer-events": "none",
10123				"font-size": FONT_SIZE
10124			});
10125			e.style.zIndex = ZINDEX;
10126			e.appendChild(w);
10127			return e;
10128		},
10129	};
10130
10131}));
10132/*!
10133 * VERSION: 0.9.2
10134 * DATE: 2019-08-13
10135 * UPDATES AND DOCS AT: http://greensock.com
10136 *
10137 * @license Copyright (c) 2008-2019, GreenSock. All rights reserved.
10138 * MorphSVGPlugin is a Club GreenSock membership benefit; You must have a valid membership to use
10139 * this code without violating the terms of use. Visit http://greensock.com/club/ to sign up or get more details.
10140 * This work is subject to the software agreement that was issued with your membership.
10141 * 
10142 * @author: Jack Doyle, [email protected]
10143 */
10144/* eslint-disable */
10145var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
10146(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
10147
10148	"use strict";
10149
10150
10151	var _PI = Math.PI,
10152		_DEG2RAD = _PI / 180,
10153		_svgPathExp = /[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,
10154		_numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,
10155		_selectorExp = /(^[#\.][a-z]|[a-y][a-z])/gi,
10156		_commands = /[achlmqstvz]/ig,
10157		_scientific = /[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,
10158		_atan2 = Math.atan2,
10159		_cos = Math.cos,
10160		_sin = Math.sin,
10161		_sqrt = Math.sqrt,
10162		_2PI = _PI * 2,
10163		_angleMin = _PI * 0.3,
10164		_angleMax = _PI * 0.7,
10165		_bigNum = 1e20,
10166		_lastLinkedAnchor,
10167		TweenLite = _gsScope._gsDefine.globals.TweenLite,
10168
10169		_log = function(message) {
10170			if (_gsScope.console) {
10171				console.log(message);
10172			}
10173		},
10174
10175		// translates SVG arc data into an array of cubic beziers
10176		_arcToBeziers = function(lastX, lastY, rx, ry, angle, largeArcFlag, sweepFlag, x, y) {
10177			if (lastX === x && lastY === y) {
10178				return;
10179			}
10180			rx = Math.abs(rx);
10181			ry = Math.abs(ry);
10182			var angleRad = (angle % 360) * _DEG2RAD,
10183				cosAngle = _cos(angleRad),
10184				sinAngle = _sin(angleRad),
10185				dx2 = (lastX - x) / 2,
10186				dy2 = (lastY - y) / 2,
10187				x1 = (cosAngle * dx2 + sinAngle * dy2),
10188				y1 = (-sinAngle * dx2 + cosAngle * dy2),
10189				x1_sq = x1 * x1,
10190				y1_sq = y1 * y1,
10191				radiiCheck = x1_sq / (rx * rx) + y1_sq / (ry * ry);
10192			if (radiiCheck > 1) {
10193				rx = _sqrt(radiiCheck) * rx;
10194				ry = _sqrt(radiiCheck) * ry;
10195			}
10196			var rx_sq = rx * rx,
10197				ry_sq = ry * ry,
10198				sq = ((rx_sq * ry_sq) - (rx_sq * y1_sq) - (ry_sq * x1_sq)) / ((rx_sq * y1_sq) + (ry_sq * x1_sq));
10199			if (sq < 0) {
10200				sq = 0;
10201			}
10202			var coef = ((largeArcFlag === sweepFlag) ? -1 : 1) * _sqrt(sq),
10203				cx1 = coef * ((rx * y1) / ry),
10204				cy1 = coef * -((ry * x1) / rx),
10205				sx2 = (lastX + x) / 2,
10206				sy2 = (lastY + y) / 2,
10207				cx = sx2 + (cosAngle * cx1 - sinAngle * cy1),
10208				cy = sy2 + (sinAngle * cx1 + cosAngle * cy1),
10209				ux = (x1 - cx1) / rx,
10210				uy = (y1 - cy1) / ry,
10211				vx = (-x1 - cx1) / rx,
10212				vy = (-y1 - cy1) / ry,
10213				temp = ux * ux + uy * uy,
10214				angleStart = ((uy < 0) ? -1 : 1) * Math.acos(ux / _sqrt(temp)),
10215				angleExtent = ((ux * vy - uy * vx < 0) ? -1 : 1) * Math.acos((ux * vx + uy * vy) / _sqrt(temp * (vx * vx + vy * vy)));
10216			if (isNaN(angleExtent)) { //rare edge case. Math.cos(-1) is NaN.
10217				angleExtent = _PI;
10218			}
10219			if (!sweepFlag && angleExtent > 0) {
10220				angleExtent -= _2PI;
10221			} else if (sweepFlag && angleExtent < 0) {
10222				angleExtent += _2PI;
10223			}
10224			angleStart %= _2PI;
10225			angleExtent %= _2PI;
10226			var segments = Math.ceil(Math.abs(angleExtent) / (_2PI / 4)),
10227				rawPath = [],
10228				angleIncrement = angleExtent / segments,
10229				controlLength = 4 / 3 * _sin(angleIncrement / 2) / (1 + _cos(angleIncrement / 2)),
10230				ma = cosAngle * rx,
10231				mb = sinAngle * rx,
10232				mc = sinAngle * -ry,
10233				md = cosAngle * ry,
10234				i;
10235			for (i = 0; i < segments; i++) {
10236				angle = angleStart + i * angleIncrement;
10237				x1 = _cos(angle);
10238				y1 = _sin(angle);
10239				ux = _cos(angle += angleIncrement);
10240				uy = _sin(angle);
10241				rawPath.push(x1 - controlLength * y1, y1 + controlLength * x1, ux + controlLength * uy, uy - controlLength * ux, ux, uy);
10242			}
10243			//now transform according to the actual size of the ellipse/arc (the beziers were noramlized, between 0 and 1 on a circle).
10244			for (i = 0; i < rawPath.length; i+=2) {
10245				x1 = rawPath[i];
10246				y1 = rawPath[i+1];
10247				rawPath[i] = x1 * ma + y1 * mc + cx;
10248				rawPath[i+1] = x1 * mb + y1 * md + cy;
10249			}
10250			rawPath[i-2] = x; //always set the end to exactly where it's supposed to be
10251			rawPath[i-1] = y;
10252			return rawPath;
10253		},
10254
10255		//Spits back an array of cubic Bezier segments that use absolute coordinates. Each segment starts with a "moveTo" command (x coordinate, then y) and then 2 control points (x, y, x, y), then anchor. The goal is to minimize memory and maximize speed.
10256		_stringToRawPath = function(d) {
10257			var a = (d + "").replace(_scientific, function(m) { var n = +m; return (n < 0.0001 && n > -0.0001) ? 0 : n; }).match(_svgPathExp) || [], //some authoring programs spit out very small numbers in scientific notation like "1e-5", so make sure we round that down to 0 first.
10258				path = [],
10259				relativeX = 0,
10260				relativeY = 0,
10261				twoThirds = 2 / 3,
10262				elements = a.length,
10263				points = 0,
10264				errorMessage = "ERROR: malformed path: " + d,
10265				line = function(sx, sy, ex, ey) {
10266					difX = (ex - sx) / 3;
10267					difY = (ey - sy) / 3;
10268					segment.push(sx + difX, sy + difY, ex - difX, ey - difY, ex, ey);
10269				},
10270				i, j, x, y, command, isRelative, segment, startX, startY, difX, difY, beziers, prevCommand;
10271			if (!d || !isNaN(a[0]) || isNaN(a[1])) {
10272				_log(errorMessage);
10273				return path;
10274			}
10275			for (i = 0; i < elements; i++) {
10276				prevCommand = command;
10277				if (isNaN(a[i])) {
10278					command = a[i].toUpperCase();
10279					isRelative = (command !== a[i]); //lower case means relative
10280				} else { //commands like "C" can be strung together without any new command characters between.
10281					i--;
10282				}
10283				x = +a[i + 1];
10284				y = +a[i + 2];
10285				if (isRelative) {
10286					x += relativeX;
10287					y += relativeY;
10288				}
10289				if (!i) {
10290					startX = x;
10291					startY = y;
10292				}
10293
10294				// "M" (move)
10295				if (command === "M") {
10296					if (segment) {
10297						if (segment.length < 8) { //if the path data was funky and just had a M with no actual drawing anywhere, skip it.
10298							path.length -= 1;
10299						} else {
10300							points += segment.length;
10301						}
10302					}
10303					relativeX = startX = x;
10304					relativeY = startY = y;
10305					segment = [x, y];
10306					path.push(segment);
10307					i += 2;
10308					command = "L"; //an "M" with more than 2 values gets interpreted as "lineTo" commands ("L").
10309
10310				// "C" (cubic bezier)
10311				} else if (command === "C") {
10312					if (!segment) {
10313						segment = [0, 0];
10314					}
10315					if (!isRelative) {
10316						relativeX = relativeY = 0;
10317					}
10318					//note: "*1" is just a fast/short way to cast the value as a Number. WAAAY faster in Chrome, slightly slower in Firefox.
10319					segment.push(x,	y, relativeX + a[i + 3] * 1, relativeY + a[i + 4] * 1, (relativeX += a[i + 5] * 1),	(relativeY += a[i + 6] * 1));
10320					i += 6;
10321
10322				// "S" (continuation of cubic bezier)
10323				} else if (command === "S") {
10324					difX = relativeX;
10325					difY = relativeY;
10326					if (prevCommand === "C" || prevCommand === "S") {
10327						difX += relativeX - segment[segment.length - 4];
10328						difY += relativeY - segment[segment.length - 3];
10329					}
10330					if (!isRelative) {
10331						relativeX = relativeY = 0;
10332					}
10333					segment.push(difX, difY, x,	y, (relativeX += a[i + 3] * 1), (relativeY += a[i + 4] * 1));
10334					i += 4;
10335
10336				// "Q" (quadratic bezier)
10337				} else if (command === "Q") {
10338					difX = relativeX + (x - relativeX) * twoThirds;
10339					difY = relativeY + (y - relativeY) * twoThirds;
10340					if (!isRelative) {
10341						relativeX = relativeY = 0;
10342					}
10343					relativeX += a[i + 3] * 1;
10344					relativeY += a[i + 4] * 1;
10345					segment.push(difX, difY, relativeX + (x - relativeX) * twoThirds, relativeY + (y - relativeY) * twoThirds, relativeX, relativeY);
10346					i += 4;
10347
10348				// "T" (continuation of quadratic bezier)
10349				} else if (command === "T") {
10350					difX = relativeX - segment[segment.length - 4];
10351					difY = relativeY - segment[segment.length - 3];
10352					segment.push(relativeX + difX, relativeY + difY, x + ((relativeX + difX * 1.5) - x) * twoThirds, y + ((relativeY + difY * 1.5) - y) * twoThirds, (relativeX = x), (relativeY = y));
10353					i += 2;
10354
10355				// "H" (horizontal line)
10356				} else if (command === "H") {
10357					line(relativeX, relativeY, (relativeX = x), relativeY);
10358					i += 1;
10359
10360				// "V" (vertical line)
10361				} else if (command === "V") {
10362					//adjust values because the first (and only one) isn't x in this case, it's y.
10363					line(relativeX, relativeY, relativeX, (relativeY = x + (isRelative ? relativeY - relativeX : 0)));
10364					i += 1;
10365
10366				// "L" (line) or "Z" (close)
10367				} else if (command === "L" || command === "Z") {
10368					if (command === "Z") {
10369						x = startX;
10370						y = startY;
10371						segment.closed = true;
10372					}
10373					if (command === "L" || Math.abs(relativeX - x) > 0.5 || Math.abs(relativeY - y) > 0.5) {
10374						line(relativeX, relativeY, x, y);
10375						if (command === "L") {
10376							i += 2;
10377						}
10378					}
10379					relativeX = x;
10380					relativeY = y;
10381
10382				// "A" (arc)
10383				} else if (command === "A") {
10384					beziers = _arcToBeziers(relativeX, relativeY, +a[i+1], +a[i+2], +a[i+3], +a[i+4], +a[i+5], (isRelative ? relativeX : 0) + a[i+6]*1, (isRelative ? relativeY : 0) + a[i+7]*1);
10385					if (beziers) {
10386						for (j = 0; j < beziers.length; j++) {
10387							segment.push(beziers[j]);
10388						}
10389					}
10390					relativeX = segment[segment.length-2];
10391					relativeY = segment[segment.length-1];
10392					i += 7;
10393
10394				} else {
10395					_log(errorMessage);
10396				}
10397			}
10398			i = segment.length;
10399			if (i < 6) { //in case there's odd SVG like a M0,0 command at the very end.
10400				path.pop();
10401				i = 0;
10402			} else if (segment[0] === segment[i-2] && segment[1] === segment[i-1]) {
10403				segment.closed = true;
10404			}
10405			path.totalPoints = points + i;
10406			return path;
10407		},
10408
10409		//adds a certain number of Beziers while maintaining the path shape (so that the start/end values can have a matching quantity of points to animate). Only pass in ONE segment of the Bezier at a time. Format: [xAnchor, yAnchor, xControlPoint1, yControlPoint1, xControlPoint2, yControlPoint2, xAnchor, yAnchor, xControlPoint1, etc...]
10410		_subdivideSegment = function(segment, quantity) {
10411			var tally = 0,
10412				max = 0.999999,
10413				l = segment.length,
10414				newPointsPerSegment = quantity / ((l - 2) / 6),
10415				ax, ay, cp1x, cp1y, cp2x, cp2y, bx, by,
10416				x1, y1, x2, y2, i, t;
10417			for (i = 2; i < l; i += 6) {
10418				tally += newPointsPerSegment;
10419				while (tally > max) { //compare with 0.99999 instead of 1 in order to prevent rounding errors
10420					ax = segment[i-2];
10421					ay = segment[i-1];
10422					cp1x = segment[i];
10423					cp1y = segment[i+1];
10424					cp2x = segment[i+2];
10425					cp2y = segment[i+3];
10426					bx = segment[i+4];
10427					by = segment[i+5];
10428					t = 1 / ((Math.floor(tally) || 1) + 1); //progress along the bezier (value between 0 and 1)
10429					x1 = ax + (cp1x - ax) * t;
10430					x2 = cp1x + (cp2x - cp1x) * t;
10431					x1 += (x2 - x1) * t;
10432					x2 += ((cp2x + (bx - cp2x) * t) - x2) * t;
10433
10434					y1 = ay + (cp1y - ay) * t;
10435					y2 = cp1y + (cp2y - cp1y) * t;
10436					y1 += (y2 - y1) * t;
10437					y2 += ((cp2y + (by - cp2y) * t) - y2) * t;
10438
10439					segment.splice(i, 4,
10440						ax + (cp1x - ax) * t,   //first control point
10441						ay + (cp1y - ay) * t,
10442						x1,                     //second control point
10443						y1,
10444						x1 + (x2 - x1) * t,     //new fabricated anchor on line
10445						y1 + (y2 - y1) * t,
10446						x2,                     //third control point
10447						y2,
10448						cp2x + (bx - cp2x) * t, //fourth control point
10449						cp2y + (by - cp2y) * t
10450					);
10451					i += 6;
10452					l += 6;
10453					tally--;
10454				}
10455			}
10456			return segment;
10457		},
10458		_rawPathToString = function(rawPath, precision) {
10459			var s = "",
10460				space = " ",
10461				l = rawPath.length,
10462				rnd = Math.pow(10, precision || 2),
10463				i, j, segment;
10464			for (j = 0; j < rawPath.length; j++) {
10465				segment = rawPath[j];
10466				l = segment.length;
10467				s += "M" + (((segment[0] * rnd) | 0) / rnd) + space + (((segment[1] * rnd) | 0) / rnd) + " C";
10468				for (i = 2; i < l; i++) { //this is actually faster than just doing a join() on the array, possibly because the numbers have so many decimal places
10469					s += (((segment[i] * rnd) | 0) / rnd) + space;
10470				}
10471				if (segment.closed) {
10472					s += "z";
10473				}
10474			}
10475			return s;
10476		},
10477		_reverseBezier = function(segment) {
10478			var a = [],
10479				i = segment.length - 1,
10480				l = 0;
10481			while (--i > -1) {
10482				a[l++] = segment[i];
10483				a[l++] = segment[i+1];
10484				i--;
10485			}
10486			for (i = 0; i < l; i++) {
10487				segment[i] = a[i];
10488			}
10489			segment.reversed = !segment.reversed;
10490		},
10491		_getAverageXY = function(segment) {
10492			var l = segment.length,
10493				x = 0,
10494				y = 0,
10495				i;
10496			for (i = 0; i < l; i++) {
10497				x += segment[i++];
10498				y += segment[i];
10499			}
10500			return [x / (l / 2), y / (l / 2)];
10501		},
10502		_getSize = function(segment) { //rough estimate of the bounding box (based solely on the anchors) of a single segment. sets "size", "centerX", and "centerY" properties on the bezier array itself, and returns the size (width * height)
10503			var l = segment.length,
10504				xMax = segment[0],
10505				xMin = xMax,
10506				yMax = segment[1],
10507				yMin = yMax,
10508				x, y, i;
10509			for (i = 6; i < l; i+=6) {
10510				x = segment[i];
10511				y = segment[i+1];
10512				if (x > xMax) {
10513					xMax = x;
10514				} else if (x < xMin) {
10515					xMin = x;
10516				}
10517				if (y > yMax) {
10518					yMax = y;
10519				} else if (y < yMin) {
10520					yMin = y;
10521				}
10522			}
10523			segment.centerX = (xMax + xMin) / 2;
10524			segment.centerY = (yMax + yMin) / 2;
10525			return (segment.size = (xMax - xMin) * (yMax - yMin));
10526		},
10527		_getTotalSize = function(rawPath, samplesPerBezier) { //rough estimate of the bounding box of the entire list of Bezier segments (based solely on the anch
10527ors). sets "size", "centerX", and "centerY" properties on the bezier array itself, and returns the size (width * height)
10528			samplesPerBezier = samplesPerBezier || 3;
10529			var j = rawPath.length,
10530				xMax = rawPath[0][0],
10531				xMin = xMax,
10532				yMax = rawPath[0][1],
10533				yMin = yMax,
10534				inc = 1 / samplesPerBezier,
10535				l, x, y, i, segment, k, t, inv, x1, y1, x2, x3, x4, y2, y3, y4;
10536			while (--j > -1) {
10537				segment = rawPath[j];
10538				l = segment.length;
10539				for (i = 6; i < l; i+=6) {
10540					x1 = segment[i];
10541					y1 = segment[i+1];
10542					x2 = segment[i+2] - x1;
10543					y2 = segment[i+3] - y1;
10544					x3 = segment[i+4] - x1;
10545					y3 = segment[i+5] - y1;
10546					x4 = segment[i+6] - x1;
10547					y4 = segment[i+7] - y1;
10548					k = samplesPerBezier;
10549					while (--k > -1) {
10550						t = inc * k;
10551						inv = 1 - t;
10552						x = (t * t * x4 + 3 * inv * (t * x3 + inv * x2)) * t + x1;
10553						y = (t * t * y4 + 3 * inv * (t * y3 + inv * y2)) * t + y1;
10554						if (x > xMax) {
10555							xMax = x;
10556						} else if (x < xMin) {
10557							xMin = x;
10558						}
10559						if (y > yMax) {
10560							yMax = y;
10561						} else if (y < yMin) {
10562							yMin = y;
10563						}
10564					}
10565				}
10566			}
10567			rawPath.centerX = (xMax + xMin) / 2;
10568			rawPath.centerY = (yMax + yMin) / 2;
10569			rawPath.left = xMin;
10570			rawPath.width = (xMax - xMin);
10571			rawPath.top = yMin;
10572			rawPath.height = (yMax - yMin);
10573			return (rawPath.size = (xMax - xMin) * (yMax - yMin));
10574		},
10575		_sortByComplexity = function(a, b) {
10576			return b.length - a.length;
10577		},
10578		_sortBySize = function(a, b) {
10579			var sizeA = a.size || _getSize(a),
10580				sizeB = b.size || _getSize(b);
10581			return (Math.abs(sizeB - sizeA) < (sizeA + sizeB) / 20) ? (b.centerX - a.centerX) || (b.centerY - a.centerY) : sizeB - sizeA; //if the size is within 10% of each other, prioritize position from left to right, then top to bottom.
10582		},
10583		_offsetSegment = function(segment, shapeIndex) {
10584			var a = segment.slice(0),
10585				l = segment.length,
10586				wrap = l - 2,
10587				i, index;
10588			shapeIndex = shapeIndex | 0;
10589			for (i = 0; i < l; i++) {
10590				index = (i + shapeIndex) % wrap;
10591				segment[i++] = a[index];
10592				segment[i] = a[index+1];
10593			}
10594		},
10595		_getTotalMovement = function(sb, eb, shapeIndex, offsetX, offsetY) {
10596			var l = sb.length,
10597				d = 0,
10598				wrap = l - 2,
10599				index, i, x, y;
10600			shapeIndex *= 6;
10601			for (i = 0; i < l; i += 6) {
10602				index = (i + shapeIndex) % wrap;
10603				y = sb[index] - (eb[i] - offsetX);
10604				x = sb[index+1] - (eb[i+1] - offsetY);
10605				d += _sqrt(x * x + y * y);
10606			}
10607			return d;
10608		},
10609		_getClosestShapeIndex = function(sb, eb, checkReverse) { //finds the index in a closed cubic bezier array that's closest to the angle provided (angle measured from the center or average x/y).
10610			var l = sb.length,
10611				sCenter = _getAverageXY(sb), //when comparing distances, adjust the coordinates as if the shapes are centered with each other.
10612				eCenter = _getAverageXY(eb),
10613				offsetX = eCenter[0] - sCenter[0],
10614				offsetY = eCenter[1] - sCenter[1],
10615				min = _getTotalMovement(sb, eb, 0, offsetX, offsetY),
10616				minIndex = 0,
10617				copy, d, i;
10618			for (i = 6; i < l; i += 6) {
10619				d = _getTotalMovement(sb, eb, i / 6, offsetX, offsetY);
10620				if (d < min) {
10621					min = d;
10622					minIndex = i;
10623				}
10624			}
10625			if (checkReverse) {
10626				copy = sb.slice(0);
10627				_reverseBezier(copy);
10628				for (i = 6; i < l; i += 6) {
10629					d = _getTotalMovement(copy, eb, i / 6, offsetX, offsetY);
10630					if (d < min) {
10631						min = d;
10632						minIndex = -i;
10633					}
10634				}
10635			}
10636			return minIndex / 6;
10637		},
10638		_getClosestAnchor = function(rawPath, x, y) { //finds the x/y of the anchor that's closest to the provided x/y coordinate (returns an array, like [x, y]). The bezier should be the top-level type that contains an array for each segment.
10639			var j = rawPath.length,
10640				closestDistance = _bigNum,
10641				closestX = 0,
10642				closestY = 0,
10643				segment, dx, dy, d, i, l;
10644			while (--j > -1) {
10645				segment = rawPath[j];
10646				l = segment.length;
10647				for (i = 0; i < l; i += 6) {
10648					dx = segment[i] - x;
10649					dy = segment[i+1] - y;
10650					d = _sqrt(dx * dx + dy * dy);
10651					if (d < closestDistance) {
10652						closestDistance = d;
10653						closestX = segment[i];
10654						closestY = segment[i+1];
10655					}
10656				}
10657			}
10658			return [closestX, closestY];
10659		},
10660		_getClosestSegment = function(bezier, pool, startIndex, sortRatio, offsetX, offsetY) { //matches the bezier to the closest one in a pool (array) of beziers, assuming they are in order of size and we shouldn't drop more than 20% of the size, otherwise prioritizing location (total distance to the center). Extracts the segment out of the pool array and returns it.
10661			var l = pool.length,
10662				index = 0,
10663				minSize = Math.min(bezier.size || _getSize(bezier), pool[startIndex].size || _getSize(pool[
10663startIndex])) * sortRatio, //limit things based on a percentage of the size of either the bezier or the next element in the array, whichever is smaller.
10664				min = _bigNum,
10665				cx = bezier.centerX + offsetX,
10666				cy = bezier.centerY + offsetY,
10667				size, i, dx, dy, d;
10668			for (i = startIndex; i < l; i++) {
10669				size = pool[i].size || _getSize(pool[i]);
10670				if (size < minSize) {
10671					break;
10672				}
10673				dx = pool[i].centerX - cx;
10674				dy = pool[i].centerY - cy;
10675				d = _sqrt(dx * dx + dy * dy);
10676				if (d < min) {
10677					index = i;
10678					min = d;
10679				}
10680			}
10681			d = pool[index];
10682			pool.splice(index, 1);
10683			return d;
10684		},
10685		_equalizeSegmentQuantity = function(start, end, shapeIndex, map, fillSafe) { //returns an array of shape indexes, 1 for each segment.
10686			var dif = end.length - start.length,
10687				longer = dif > 0 ? end : start,
10688				shorter = dif > 0 ? start : end,
10689				added = 0,
10690				sortMethod = (map === "complexity") ? _sortByComplexity : _sortBySize,
10691				sortRatio = (map === "position") ? 0 : (typeof(map) === "number") ? map : 0.8,
10692				i = shorter.length,
10693				shapeIndices = (typeof(shapeIndex) === "object" && shapeIndex.push) ? shapeIndex.slice(0) : [shapeIndex],
10694				reverse = (shapeIndices[0] === "reverse" || shapeIndices[0] < 0),
10695				log = (shapeIndex === "log"),
10696				eb, sb, b, x, y, offsetX, offsetY;
10697			if (!shorter[0]) {
10698				return;
10699			}
10700			if (longer.length > 1) {
10701				start.sort(sortMethod);
10702				end.sort(sortMethod);
10703				offsetX = longer.size || _getTotalSize(longer); //ensures centerX and centerY are defined (used below).
10704				offsetX = shorter.size || _getTotalSize(shorter);
10705				offsetX = longer.centerX - shorter.centerX;
10706				offsetY = longer.centerY - shorter.centerY;
10707				if (sortMethod === _sortBySize) {
10708					for (i = 0; i < shorter.length; i++) {
10709						longer.splice(i, 0, _getClosestSegment(shorter[i], longer, i, sortRatio, offsetX, offsetY));
10710					}
10711				}
10712			}
10713			if (dif) {
10714				if (dif < 0) {
10715					dif = -dif;
10716				}
10717				if (longer[0].length > shorter[0].length) { //since we use shorter[0] as the one to map the origination point of any brand new fabricated segments, do any subdividing first so that there are more points to choose from (if necessary)
10718					_subdivideSegment(shorter[0], ((longer[0].length - shorter[0].length)/6) | 0);
10719				}
10720				i = shorter.length;
10721				while (added < dif) {
10722					x = longer[i].size || _getSize(longer[i]); //just to ensure centerX and centerY are calculated which we use on the next line.
10723					b = _getClosestAnchor(shorter, longer[i].centerX, longer[i].centerY);
10724					x = b[0];
10725					y = b[1];
10726					shorter[i++] = [x, y, x, y, x, y, x, y];
10727					shorter.totalPoints += 8;
10728					added++;
10729				}
10730			}
10731			for (i = 0; i < start.length; i++) {
10732				eb = end[i];
10733				sb = start[i];
10734				dif = eb.length - sb.length;
10735				if (dif < 0) {
10736					_subdivideSegment(eb, (-dif/6) | 0);
10737				} else if (dif > 0) {
10738					_subdivideSegment(sb, (dif/6) | 0);
10739				}
10740				if (reverse && fillSafe !== false && !sb.reversed) {
10741					_reverseBezier(sb);
10742				}
10743				shapeIndex = (shapeIndices[i] || shapeIndices[i] === 0) ? shapeIndices[i] : "auto";
10744				if (shapeIndex) {
10745					//if start shape is closed, find the closest point to the start/end, and re-organize the bezier points accordingly so that the shape morphs in a more intuitive way.
10746					if (sb.closed || (Math.abs(sb[0] - sb[sb.length - 2]) < 0.5 && Math.abs(sb[1] - sb[sb.length - 1]) < 0.5)) {
10747						if (shapeIndex === "auto" || shapeIndex === "log") {
10748							shapeIndices[i] = shapeIndex = _getClosestShapeIndex(sb, eb, (!i || fillSafe === false));
10749							if (shapeIndex < 0) {
10750								reverse = true;
10751								_reverseBezier(sb);
10752								shapeIndex = -shapeIndex;
10753							}
10754							_offsetSegment(sb, shapeIndex * 6);
10755
10756						} else if (shapeIndex !== "reverse") {
10757							if (i && shapeIndex < 0) { //only happens if an array is passed as shapeIndex and a negative value is defined for an index beyond 0. Very rare, but helpful sometimes.
10758								_reverseBezier(sb);
10759							}
10760							_offsetSegment(sb, (shapeIndex < 0 ? -shapeIndex : shapeIndex) * 6);
10761						}
10762					//otherwise, if it's not a closed shape, consider reversing it if that would make the overall travel less
10763					} else if (!reverse && (shapeIndex === "auto" && (Math.abs(eb[0] - sb[0]) + Math.abs(eb[1] - sb[1]) + Math.abs(eb[eb.length - 2] - sb[sb.length - 2]) + Math.abs(eb[eb.length - 1] - sb[sb.length - 1]) > Math.abs(eb[0] - sb[sb.length - 2]) + Math.abs(eb[1] - sb[sb.length - 1]) + Math.abs(eb[eb.length - 2] - sb[0]) + Math.abs(eb[eb.length - 1] - sb[1])
vendor: 7,956 bytes, lines 10763-10979
10763) || (shapeIndex % 2))) {
10764						_reverseBezier(sb);
10765						shapeIndices[i] = -1;
10766						reverse = true;
10767					} else if (shapeIndex === "auto") {
10768						shapeIndices[i] = 0;
10769					} else if (shapeIndex === "reverse") {
10770						shapeIndices[i] = -1;
10771					}
10772					if (sb.closed !== eb.closed) { //if one is closed and one isn't, don't close either one otherwise the tweening will look weird (but remember, the beginning and final states will honor the actual values, so this only affects the inbetween state)
10773						sb.closed = eb.closed = false;
10774					}
10775				}
10776			}
10777			if (log) {
10778				_log("shapeIndex:[" + shapeIndices.join(",") + "]");
10779			}
10780			start.shapeIndex = shapeIndices;
10781			return shapeIndices;
10782		},
10783		_pathFilter = function(a, shapeIndex, map, precompile, fillSafe) {
10784			var start = _stringToRawPath(a[0]),
10785				end = _stringToRawPath(a[1]);
10786			if (!_equalizeSegmentQuantity(start, end, (shapeIndex || shapeIndex === 0) ? shapeIndex : "auto", map, fillSafe)) {
10787				return; //malformed path data or null target
10788			}
10789			a[0] = _rawPathToString(start);
10790			a[1] = _rawPathToString(end);
10791			if (precompile === "log" || precompile === true) {
10792				_log('precompile:["' + a[0] + '","' + a[1] + '"]');
10793			}
10794		},
10795		/*
10796		_buildPathFilter = function(shapeIndex, map, precompile) {
10797			return (map || precompile || shapeIndex || shapeIndex === 0) ? function(a) {
10798				_pathFilter(a, shapeIndex, map, precompile);
10799			} : _pathFilter;
10800		},
10801		*/
10802		_offsetPoints = function(text, offset) {
10803			if (!offset) {
10804				return text;
10805			}
10806			var a = text.match(_numbersExp) || [],
10807				l = a.length,
10808				s = "",
10809				inc, i, j;
10810			if (offset === "reverse") {
10811				i = l-1;
10812				inc = -2;
10813			} else {
10814				i = (((parseInt(offset, 10) || 0) * 2 + 1) + l * 100) % l;
10815				inc = 2;
10816			}
10817			for (j = 0; j < l; j += 2) {
10818				s += a[i-1] + "," + a[i] + " ";
10819				i = (i + inc) % l;
10820			}
10821			return s;
10822		},
10823		//adds a certain number of points while maintaining the polygon/polyline shape (so that the start/end values can have a matching quantity of points to animate). Returns the revised string.
10824		_equalizePointQuantity = function(a, quantity) {
10825			var tally = 0,
10826				x = parseFloat(a[0]),
10827				y = parseFloat(a[1]),
10828				s = x + "," + y + " ",
10829				max = 0.999999,
10830				newPointsPerSegment, i, l, j, factor, nextX, nextY;
10831			l = a.length;
10832			newPointsPerSegment = quantity * 0.5 / (l * 0.5 - 1);
10833			for (i = 0; i < l-2; i += 2) {
10834				tally += newPointsPerSegment;
10835				nextX = parseFloat(a[i+2]);
10836				nextY = parseFloat(a[i+3]);
10837				if (tally > max) { //compare with 0.99999 instead of 1 in order to prevent rounding errors
10838					factor = 1 / (Math.floor(tally) + 1);
10839					j = 1;
10840					while (tally > max) {
10841						s += (x + (nextX - x) * factor * j).toFixed(2) + "," + (y + (nextY - y) * factor * j).toFixed(2) + " ";
10842						tally--;
10843						j++;
10844					}
10845				}
10846				s += nextX + "," + nextY + " ";
10847				x = nextX;
10848				y = nextY;
10849			}
10850			return s;
10851		},
10852		_pointsFilter = function(a) {
10853			var startNums = a[0].match(_numbersExp) || [],
10854				endNums = a[1].match(_numbersExp) || [],
10855				dif = endNums.length - startNums.length;
10856			if (dif > 0) {
10857				a[0] = _equalizePointQuantity(startNums, dif);
10858			} else {
10859				a[1] = _equalizePointQuantity(endNums, -dif);
10860			}
10861		},
10862		_buildPointsFilter = function(shapeIndex) {
10863			return !isNaN(shapeIndex) ? function(a) {
10864				_pointsFilter(a);
10865				a[1] = _offsetPoints(a[1], parseInt(shapeIndex, 10));
10866			} : _pointsFilter;
10867		},
10868		_createPath = function(e, ignore) {
10869			var path = _gsScope.document.createElementNS("http://www.w3.org/2000/svg", "path"),
10870				attr = Array.prototype.slice.call(e.attributes),
10871				i = attr.length,
10872				name;
10873			ignore = "," + ignore + ",";
10874			while (--i > -1) {
10875				name = attr[i].nodeName.toLowerCase(); //in Microsoft Edge, if you don't set the attribute with a lowercase name, it doesn't render correctly! Super weird.
10876				if (ignore.indexOf("," + name + ",") === -1) {
10877					path.setAttributeNS(null, name, attr[i].nodeValue);
10878				}
10879			}
10880			return path;
10881		},
10882		_typeAttrs = {
10883			rect:"rx,ry,x,y,width,height",
10884			circle:"r,cx,cy",
10885			ellipse:"rx,ry,cx,cy",
10886			line:"x1,x2,y1,y2"
10887		},
10888		_attrToObj = function(e, attrs) {
10889			var props = attrs ? attrs.split(",") : [],
10890				obj = {},
10891				i = props.length;
10892			while (--i > -1) {
10893				obj[props[i]] = +e.getAttribute(props[i]) || 0;
10894			}
10895			return obj;
10896		},
10897		_convertToPath = function(e, swap) {
10898			var type = e.tagName.toLowerCase(),
10899				circ = 0.552284749831,
10900				data, x, y, r, ry, path, rcirc, rycirc, points, w, h, x2, x3, x4, x5, x6, y2, y3, y4, y5, y6, attr;
10901			if (type === "path" || !e.getBBox) {
10902				return e;
10903			}
10904			path = _createPath(e, "x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points");
10905			attr = _attrToObj(e, _typeAttrs[type]);
10906			if (type === "rect") {
10907				r = attr.rx;
10908				ry = attr.ry;
10909				x = attr.x;
10910				y = attr.y;
10911				w = attr.width - r * 2;
10912				h = attr.height - ry * 2;
10913				if (r || ry) { //if there are rounded corners, render cubic beziers
10914					x2 = x + r * (1 - circ);
10915					x3 = x + r;
10916					x4 = x3 + w;
10917					x5 = x4 + r * circ;
10918					x6 = x4 + r;
10919					y2 = y + ry * (1 - circ);
10920					y3 = y + ry;
10921					y4 = y3 + h;
10922					y5 = y4 + ry * circ;
10923					y6 = y4 + ry;
10924					data = "M" + x6 + "," + y3 + " V" + y4 + " C" + [x6, y5, x5, y6, x4, y6, x4 - (x4 - x3) / 3, y6, x3 + (x4 - x3) / 3, y6, x3, y6, x2, y6, x, y5, x, y4, x, y4 - (y4 - y3) / 3, x, y3 + (y4 - y3) / 3, x, y3, x, y2, x2, y, x3, y, x3 + (x4 - x3) / 3, y, x4 - (x4 - x3) / 3, y, x4, y, x5, y, x6, y2, x6, y3].join(",") + "z";
10925				} else {
10926					data = "M" + (x + w) + "," + y + " v" + h + " h" + (-w) + " v" + (-h) + " h" + w + "z";
10927				}
10928
10929			} else if (type === "circle" || type === "ellipse") {
10930				if (type === "circle") {
10931					r = ry = attr.r;
10932					rycirc = r * circ;
10933				} else {
10934					r = attr.rx;
10935					ry = attr.ry;
10936					rycirc = ry * circ;
10937				}
10938				x = attr.cx;
10939				y = attr.cy;
10940				rcirc = r * circ;
10941				data = "M" + (x+r) + "," + y + " C" + [x+r, y + rycirc, x + rcirc, y + ry, x, y + ry, x - rcirc, y + ry, x - r, y + rycirc, x - r, y, x - r, y - rycirc, x - rcirc, y - ry, x, y - ry, x + rcirc, y - ry, x + r, y - rycirc, x + r, y].join(",") + "z";
10942			} else if (type === "line") {
10943				data = "M" + attr.x1 + "," + attr.y1 + " L" + attr.x2 + "," + attr.y2; //previously, we just converted to "Mx,y Lx,y" but Safari has bugs that cause that not to render properly when using a stroke-dasharray that's not fully visible! Using a cubic bezier fixes that issue.
10944			} else if (type === "polyline" || type === "polygon") {
10945				points = (e.getAttribute("points") + "").match(_numbersExp) || [];
10946				x = points.shift();
10947				y = points.shift();
10948				data = "M" + x + "," + y + " L" + points.join(",");
10949				if (type === "polygon") {
10950					data += "," + x + "," + y + "z";
10951				}
10952			}
10953			path.setAttribute("d", _rawPathToString(path._gsRawPath = _stringToRawPath(data)));
10954			if (swap && e.parentNode) {
10955				e.parentNode.insertBefore(path, e);
10956				e.parentNode.removeChild(e);
10957			}
10958
10959			return path;
10960		},
10961		_parseShape = function(shape, forcePath, target) {
10962			var isString = typeof(shape) === "string",
10963				e, type;
10964			if (!isString || _selectorExp.test(shape) || (shape.match(_numbersExp) || []).length < 3) {
10965				e = isString ? TweenLite.selector(shape) : (shape && shape[0]) ? shape : [shape]; //allow array-like objects like jQuery objects.
10966				if (e && e[0]) {
10967					e = e[0];
10968					type = (e.nodeName + "").toUpperCase();
10969					if (forcePath && type !== "PATH") { //if we were passed an element (or selector text for an element) that isn't a path, convert it.
10970						e = _convertToPath(e, false);
10971						type = "PATH";
10972					}
10973					shape = e.getAttribute(type === "PATH" ? "d" : "points") || "";
10974					if (e === target) { //if the shape matches the target element, the user wants to revert to the original which should have been stored in the data-original attribute
10975						shape = e.getAttributeNS(null, "data-original") || shape;
10976					}
10977				} else {
10978					_log("WARNING: invalid morph to: " + shape);
10979					shape = false;
10980				}
10981			}
10982			return shape;
10983		},
10984		//adds an "isSmooth" array to each segment and populates it with a boolean value indicating whether or not it's smooth (the control points have basically the same slope). For any smooth control points, it converts the coordinates into angle (x, in radians) and length (y) and puts them into the same index value in a smoothData array.
10985		_populateSmoothData = function(rawPath, tolerance) {
10986			var j = rawPath.length,
10987				limit = 0.2 * (tolerance || 1),
10988				smooth, segment, x, y, x2, y2, i, l, a, a2, isSmooth, smoothData;
10989			while (--j > -1) {
10990				segment = rawPath[j];
10991				isSmooth = segment.isSmooth = segment.isSmooth || [0, 0, 0, 0];
10992				smoothData = segment.smoothData = segment.smoothData || [0, 0, 0, 0];
10993				isSmooth.length = 4;
10994				l = segment.length - 2;
10995				for (i = 6; i < l; i += 6) {
10996					x = segment[i] - segment[i - 2];
10997					y = segment[i + 1] - segment[i - 1];
10998					x2 = segment[i + 2] - segment[i];
10999					y2 = segment[i + 3] - segment[i + 1];
11000					a = _atan2(y, x);
11001					a2 = _atan2(y2, x2);
11002					smooth = (Math.abs(a - a2) < limit);
11003					if (smooth) {
11004						smoothData[i - 2] = a;
11005						smoothData[i + 2] = a2;
11006						smoothData[i - 1] = _sqrt(x * x + y * y);
11007						smoothData[i + 3] = _sqrt(x2 * x2 + y2 * y2);
11008					}
11009					isSmooth.push(smooth, smooth, 0, 0, smooth, smooth);
11010				}
11011				//if the first and last points are identical, check to see if there's a smooth transition. We must handle this a bit differently due to their positions in the array.
11012				if (segment[l] === segment[0] && segment[l+1] === segment[1]) {
11013					x = segment[0] - segment[l-2];
11014					y = segment[1] - segment[l-1];
11015					x2 = segment[2] - segment[0];
11016					y2 = segment[3] - segment[1];
11017					a = _atan2(y, x);
11018					a2 = _atan2(y2, x2);
11019					if (Math.abs(a - a2) < limit) {
11020						smoothData[l-2] = a;
11021						smoothData[2] = a2;
11022						smoothData[l-1] = _sqrt(x * x + y * y);
11023						smoothData[3] = _sqrt(x2 * x2 + y2 * y2);
11024						isSmooth[l-2] = isSmooth[l-1] = true; //don't change indexes 2 and 3 because we'll trigger everything from the END, and this will optimize file size a bit.
11025					}
11026				}
11027			}
11028			return rawPath;
11029		},
11030		_parseOriginFactors = function(v) {
11031			var a = v.trim().split(" "),
11032				x = (v.indexOf("left") >= 0) ? 0 : (v.indexOf("right") >= 0) ? 100 : isNaN(parseFloat(a[0])) ? 50 : parseFloat(a[0]),
11033				y = (v.indexOf("top") >= 0) ? 0 : (v.indexOf("bottom") >= 0) ? 100 : isNaN(parseFloat(a[1])) ? 50 : parseFloat(a[1]);
11034			return {x:x / 100, y:y / 100};
11035		},
11036		_shortAngle = function(dif) {
11037			return (dif !== dif % _PI) ? dif + ((dif < 0) ? _2PI : -_2PI) : dif;
11038		},
11039		_morphMessage = "Use MorphSVGPlugin.convertToPath(elementOrSelectorText) to convert to a path before morphing.",
11040
11041
11042
11043		MorphSVGPlugin = _gsScope._gsDefine.plugin({
11044			propName: "morphSVG",
11045			API: 2,
11046			global: true,
11047			version: "0.9.2",
11048			overwriteProps: ["morphSVG"],
11049
11050			//called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
11051			init: function(target, value, tween, index) {
11052				var cs = target.nodeType ? window.getComputedStyle(target) : {},
11053					fill = cs.fill + "",
11054					fillSafe = !(fill === "none" || (fill.match(_numbersExp) || [])[3] === "0" || cs.fillRule === "evenodd"),
11055					origins = (value.origin || "50 50").split(","),
11056					type, p, pt, shape, isPoly, shapeIndex, map, startSmooth, endSmooth, start, end, i, j, l, startSeg, endSeg, precompiled, sData, eData, originFactors, useRotation, offset;
11057				if (typeof(value) === "function") {
11058					value = value(index, target);
11059				}
11060				type = (target.nodeName + "").toUpperCase();
11061				isPoly = (type === "POLYLINE" || type === "POLYGON");
11062				if (type !== "PATH" && !isPoly && !value.prop) {
11063					_log("WARNING: cannot morph a <" + type + "> element. " + _morphMessage);
11064					return false;
11065				}
11066				p = (type === "PATH") ? "d" : "points";
11067				if (typeof(value) === "string" || value.getBBox || value[0]) {
11068					value = {shape:value};
11069				}
11070				if (!value.prop && typeof(target.setAttribute) !== "function") {
11071					return false;
11072				}
11073				shape = _parseShape(value.shape || value.d || value.points || "", (p === "d"), target);
11074				if (isPoly && _commands.test(shape)) {
11075					_log("WARNING: a <" + type + "> cannot accept path data. " + _morphMessage);
11076					return false;
11077				}
11078				shapeIndex = (value.shapeIndex || value.shapeIndex === 0) ? value.shapeIndex : "auto";
11079				map = value.map || MorphSVGPlugin.defaultMap;
11080				this._prop = value.prop;
11081				this._render = value.render || MorphSVGPlugin.defaultRender;
11082				this._apply = ("updateTarget" in value) ? value.updateTarget : MorphSVGPlugin.defaultUpdateTarget;
11083				this._rnd = Math.pow(10, isNaN(value.precision) ? 2 : +value.precision);
11084				this._tween = tween;
11085				if (shape) {
11086					this._target = target;
11087					precompiled = (typeof(value.precompile) === "object");
11088					start = this._prop ? target[this._prop] : target.getAttribute(p);
11089					if (!this._prop && !target.getAttributeNS(null, "data-original")) {
11090						target.setAttributeNS(null, "data-original", start); //record the original state in a data-original attribute so that we can revert to it later.
11091					}
11092					if (p === "d" || this._prop) {
11093						start = _stringToRawPath(precompiled ? value.precompile[0] : start);
11094						end = _stringToRawPath(precompiled ? value.precompile[1] : shape);
11095						if (!precompiled && !_equalizeSegmentQuantity(start, end, shapeIndex, map, fillSafe)) {
11096							return false; //malformed path data or null target
11097						}
11098						if (value.precompile === "log" || value.precompile === true) {
11099							_log('precompile:["' + _rawPathToString(start) + '","' + _rawPathToString(end) + '"]');
11100						}
11101
11102						useRotation = (value.type || MorphSVGPlugin.defaultType) !== "linear";
11103
11104						if (useRotation) {
11105							start = _populateSmoothData(start, value.smoothTolerance);
11106							end = _populateSmoothData(end, value.smoothTolerance   );
11107							if (!start.size) {
11108								_getTotalSize(start); //adds top/left/width/height values
11109							}
11110							if (!end.size) {
11111								_getTotalSize(end);
11112							}
11113							originFactors = _parseOriginFactors(origins[0]);
11114							this._origin = start.origin = {x:start.left + originFactors.x * start.width, y:start.top + originFactors.y * start.height};
11115							if (origins[1]) {
11116								originFactors = _parseOriginFactors(origins[1]);
11117							}
11118							this._eOrigin = {x:end.left + originFactors.x * end.width, y:end.top + originFactors.y * end.height};
11119						}
11120
11121						this._rawPath = target._gsRawPath =  start;
11122
11123						j = start.length;
11124						while (--j > -1) {
11125							startSeg = start[j];
11126							endSeg = end[j];
11127							startSmooth = startSeg.isSmooth || [];
11128							endSmooth = endSeg.isSmooth || [];
11129							l = startSeg.length;
11130							_lastLinkedAnchor = 0; //reset; we use _lastLinkedAnchor in the _tweenRotation() method to help make sure that close points don't get ripped apart and rotate opposite directions. Typically we want to go the shortest direction, but if the previous anchor is going a different direction, we override this logic (within certain thresholds)
11131							for (i = 0; i < l; i+=2) {
11132								if (endSeg[i] !== startSeg[i] || endSeg[i+1] !== startSeg[i+1]) {
11133									if (useRotation) {
11134										if (startSmooth[i] && endSmooth[i]) { //if BOTH starting and ending values are smooth (meaning control points have basically the same slope), interpolate the rotation and length instead of the coordinates (this is what makes things smooth).
11135											sData = startSeg.smoothData;
11136											eData = endSeg.smoothData;
11137											offset = i + ((i === l - 4) ? 7 - l : 5); //helps us accommodate wrapping (like if the end and start anchors are identical and the control points are smooth).
11138											this._controlPT = {_next:this._controlPT, i:i, j:j, l1s:sData[i+1], l1c:eData[i+1] - sData[i+1], l2s:sData[offset], l2c:eData[offset] - sData[offset]};
11139											pt = this._tweenRotation(startSeg, endSeg, i+2);
11140											this._tweenRotation(startSeg, endSeg, i, pt);
11141											this._tweenRotation(startSeg, endSeg, offset-1, pt);
11142											i+=4;
11143										} else {
11144											this._tweenRotation(startSeg, endSeg, i);
11145										}
11146									} else {
11147										this._addTween(startSeg, i, startSeg[i], endSeg[i]);
11148										pt = this._addTween(startSeg, i+1, startSeg[i+1], endSeg[i+1]);
11149									}
11150								}
11151							}
11152						}
11153					} else {
11154						pt = this._addTween(target, "setAttribute", target.getAttribute(p) + "", shape + "", "morphSVG", false, p, _buildPointsFilter(shapeIndex));
11155					}
11156
11157					if (useRotation) {
11158						this._addTween(this._origin, "x", this._origin.x, this._eOrigin.x);
11159						pt = this._addTween(this._origin, "y", this._origin.y, this._eOrigin.y);
11160					}
11161
11162					if (pt) {
11163						this._overwriteProps.push("morphSVG");
11164						pt.end = shape;
11165						pt.endProp = p;
11166					}
11167				}
11168				return true;
11169			},
11170
11171			set: function(ratio) {
11172				var rawPath = this._rawPath,
11173					controlPT = this._controlPT,
11174					anchorPT = this._anchorPT,
11175					rnd = this._rnd,
11176					target = this._target,
11177					s, space, easeInOut, pt, segment, l, angle, i, j, x, y, sin, cos, offset;
11178				this._super.setRatio.call(this, ratio);
11179				if (ratio === 1 && this._apply) {
11180					pt = this._firstPT;
11181					while (pt) {
11182						if (pt.end) {
11183							if (this._prop) {
11184								target[this._prop] = pt.end;
11185							} else {
11186								target.setAttribute(pt.endProp, pt.end); //make sure the end value is exactly as specified (in case we had to add fabricated points during the tween)
11187							}
11188						}
11189						pt = pt._next;
11190					}
11191				} else if (rawPath) {
11192
11193					//rotationally position the anchors
11194					while (anchorPT) {
11195						angle = anchorPT.sa + ratio * anchorPT.ca;
11196						l = anchorPT.sl + ratio * anchorPT.cl;    //length
11197						anchorPT.t[anchorPT.i] = this._origin.x + _cos(angle) * l;
11198						anchorPT.t[anchorPT.i + 1] = this._origin.y + _sin(angle) * l;
11199						anchorPT = anchorPT._next;
11200					}
11201
11202					//smooth out the control points
11203					easeInOut = ratio < 0.5 ? 2 * ratio * ratio : (4 - 2 * ratio) * ratio - 1;
11204					while (controlPT) {
11205						i = controlPT.i;
11206						segment = rawPath[controlPT.j];
11207						offset = i + ((i === segment.length - 4) ? 7 - segment.length : 5); //accommodates wrapping around of smooth points, like if the start and end anchors are on top of each other and their handles are smooth.
11208						angle = _atan2(segment[offset] - segment[i+1], segment[offset-1] - segment[i]); //average the angles
11209						sin = _sin(angle);
11210						cos = _cos(angle);
11211						x = segment[i+2];
11212						y = segment[i+3];
11213						l = controlPT.l1s + easeInOut * controlPT.l1c;    //length
11214						segment[i] = x - cos * l;
11215						segment[i+1] = y - sin * l;
11216						l = controlPT.l2s + easeInOut * controlPT.l2c;
11217						segment[offset-1] = x + cos * l;
11218						segment[offset] = y + sin * l;
11219						controlPT = controlPT._next;
11220					}
11221
11222					target._gsRawPath = rawPath;
11223
11224					if (this._apply) {
11225						s = "";
11226						space = " ";
11227						for (j = 0; j < rawPath.length; j++) {
11228							segment = rawPath[j];
11229							l = segment.length;
11230							s += "M" + (((segment[0] * rnd) | 0) / rnd) + space + (((segment[1] * rnd) | 0) / rnd) + " C";
11231							for (i = 2; i < l; i++) { //this is actually faster than just doing a join() on the array, possibly because the numbers have so many decimal places
11232								s += (((segment[i] * rnd) | 0) / rnd) + space;
11233							}
11234						}
11235						if (this._prop) {
11236							target[this._prop] = s;
11237						} else {
11238							target.setAttribute("d", s);
11239						}
11240					}
11241				}
11242				if (this._render && rawPath) {
11243					this._render.call(this._tween, rawPath, target);
11244				}
11245			}
11246		});
11247
11248
11249	MorphSVGPlugin.prototype._tweenRotation = function(start, end, i, linkedPT) {
11250		var so = this._origin,              //starting origin
11251			eo = this._eOrigin,             //ending origin
11252			dx = start[i] - so.x,
11253			dy = start[i+1] - so.y,
11254			d = _sqrt(dx * dx + dy * dy),   //length from starting origin to starting point
11255			sa = _atan2(dy, dx),
11256			angleDif, short;
11257		dx = end[i] - eo.x;
11258		dy = end[i+1] - eo.y;
11259		angleDif = _atan2(dy, dx) - sa;
11260		short = _shortAngle(angleDif);
11261		//in the case of control points, we ALWAYS link them to their anchor so that they don't get torn apart and rotate the opposite direction. If it's not a control point, we look at the most recently linked point as long as they're within a certain rotational range of each other.
11262		if (!linkedPT && _lastLinkedAnchor && Math.abs(short + _lastLinkedAnchor.ca) < _angleMin) {
11263			linkedPT = _lastLinkedAnchor;
11264		}
11265		return (this._anchorPT = _lastLinkedAnchor = {
11266			_next:this._anchorPT,
11267			t:start,
11268			sa:sa,                              //starting angle
11269			ca:(linkedPT && short * linkedPT.ca < 0 && Math.abs(short) > _angleMax) ? angleDif : short,  //change in angle
11270			sl:d,                               //starting length
11271			cl:_sqrt(dx * dx + dy * dy) - d,    //change in length
11272			i:i
11273		});
11274	};
11275
11276	MorphSVGPlugin.pathFilter = _pathFilter;
11277	MorphSVGPlugin.pointsFilter = _pointsFilter;
11278	MorphSVGPlugin.getTotalSize = _getTotalSize;
11279	MorphSVGPlugin.subdivideRawBezier = MorphSVGPlugin.subdivideSegment = _subdivideSegment;
11280	MorphSVGPlugin.rawPathToString = _rawPathToString;
11281	MorphSVGPlugin.defaultType = "linear";
11282	MorphSVGPlugin.defaultUpdateTarget = true;
11283	MorphSVGPlugin.defaultMap = "size";
11284	MorphSVGPlugin.stringToRawPath = MorphSVGPlugin.pathDataToRawBezier = function(data) {
11285		return _stringToRawPath(_parseShape(data, true));
11286	};
11287	MorphSVGPlugin.equalizeSegmentQuantity = _equalizeSegmentQuantity;
11288
11289	MorphSVGPlugin.convertToPath = function(targets, swap) {
11290		if (typeof(targets) === "string") {
11291			targets = TweenLite.selector(targets);
11292		}
11293		var a = (!targets || targets.length === 0) ? [] : (targets.length && targets[0] && targets[0].nodeType) ? Array.prototype.slice.call(targets, 0) : [targets],
11294			i = a.length;
11295		while (--i > -1) {
11296			a[i] = _convertToPath(a[i], (swap !== false));
11297		}
11298		return a;
11299	};
11300
11301	MorphSVGPlugin.pathDataToBezier = function(data, vars) { //converts SVG path data into an array of {x, y} objects that can be plugged directly into a bezier tween. You can optionally pass in a 2D matrix like [a, b, c, d, tx, ty] containing numbers that should transform each point.
11302		var bezier = _stringToRawPath(_parseShape(data, true))[0] || [],
11303			prefix = 0,
11304			a, i, l, matrix, offsetX, offsetY, bbox, e;
11305		vars = vars || {};
11306		e = vars.align || vars.relative;
11307		matrix = vars.matrix || [1,0,0,1,0,0];
11308		offsetX = vars.offsetX || 0;
11309		offsetY = vars.offsetY || 0;
11310		if (e === "relative" || e === true) {
11311			offsetX -= bezier[0] * matrix[0] + bezier[1] * matrix[2];
11312			offsetY -= bezier[0] * matrix[1] + bezier[1] * matrix[3];
11313			prefix = "+=";
11314		} else {
11315			offsetX += matrix[4];
11316			offsetY += matrix[5];
11317			if (e) {
11318				e = (typeof(e) === "string") ? TweenLite.selector(e) : (e && e[0]) ? e : [e]; //allow array-like objects like jQuery objects.
11319				if (e && e[0]) {
11320					bbox = e[0].getBBox() || {x:0, y:0};
11321					offsetX -= bbox.x;
11322					offsetY -= bbox.y;
11323				}
11324			}
11325		}
11326		a = [];
11327		l = bezier.length;
11328		if (matrix && matrix.join(",") !== "1,0,0,1,0,0") {
11329			for (i = 0; i < l; i+=2) {
11330				a.push({x:prefix + (bezier[i] * matrix[0] + bezier[i+1] * matrix[2] + offsetX), y:prefix + (bezier[i] * matrix[1] + bezier[i+1] * matrix[3] + offsetY)});
11331			}
11332		} else {
11333			for (i = 0; i < l; i+=2) {
11334				a.push({x:prefix + (bezier[i] + offsetX), y:prefix + (bezier[i+1] + offsetY)});
11335			}
11336		}
11337		return a;
11338	};
11339
11340
11341
11342}); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
11343//export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date)
11344(function(name) {
11345	"use strict";
11346	var getGlobal = function() {
11347		return (_gsScope.GreenSockGlobals || _gsScope)[name];
11348	};
11349	if (typeof(module) !== "undefined" && module.exports) { //node
11350		require("gsap/umd/TweenLite");
11351		module.exports = getGlobal();
11352	} else if (typeof(define) === "function" && define.amd) { //AMD
11353		define(["gsap/umd/TweenLite"], getGlobal);
11354	}
11355}("MorphSVGPlugin"));
11356/**
11357 * page.js. Created by jeremydesvaux the 30 sept. 2014
11358 */
11359(function ($, $w, ns, $b) {
11360
11361    "use strict";
11362
11363    var pageJs = function ($el, initiable) {
11364        this.$el = $el || $('#content > article');
11365        this.initiable = initiable || true;
11366        this.inited = false;
11367        this.modules = [];
11368        this.appeared = false;
11369
11370        this.transitionClassHidden = 'page-transition-hidden';
11371        this.transitionClassAppear = 'page-transition-appear';
11372        this.transitionClassDisappear = 'page-transition-disappear';
11373
11374        return this;
11375    };
11376
11377    pageJs.prototype = {
11378
11379        init: function () {
11380            if (this.inited) {
11381                $w.trigger('resize'); // update bx sliders
11382            } else {
11383                this.inited = true;
11384                this.initComponents();
11385                this.initModules();
11386                this.bindUiActions();
11387                this.initPage();
11388            }
11389        },
11390        /**
11391         * Init registered and initiable JavaScript components activated by the SiteConfig
11392         */
11393        initComponents: function () {
11394            //ns.app.initComponents(false,this.$el);
11395        },
11396        /**
11397         * init modules script for current page
11398         */
11399        initModules: function () {
11400
11401            var scope = this;
11402            if (!ns.app.modules) return;
11403
11404            for (var moduleSlug in ns.app.modules) {
11405                // init module script in each of its section in the page
11406                var $moduleSection = scope.$el.find('.module-' + moduleSlug);
11407                if ($moduleSection.length) {
11408                    $moduleSection.each(function (i, context) {
11409                        var module = new ns.app.modules[moduleSlug]($(context));
11410                        scope.modules.push(module);
11411                    });
11412                }
11413            }
11414
11415
11416        },
11417        bindUiActions: function () {
11418            this.registerAnchors();
11419            this.registerReadmore();
11420        },
11421        /**
11422         * Smooth scroll to anchors instead of jumping to it
11423         */
11424        registerAnchors: function () {
11425            var scope = this;
11426            ns.app.registerAnchors && ns.app.registerAnchors(scope.$el);
11427        },
11428        /**
11429         * When you have a .readmore link and a .readmore-content in the same parent,
11430         * we change the link behaviour so it slide toggles the .readmore-content
11431         */
11432        registerReadmore: function () {
11433            var scope = this;
11434            var formerText; // Contiendra la valeur initiale du texte (ex: "Lire la suite")
11435            scope.$el.find('.readmore').on('click', function (e) {
11436                var $el = $(this).siblings('.readmore-content');
11437                var $link = $('a', this);
11438
11439                if (typeof formerText === 'undefined') {
11440                    formerText = {readless: $link.text()};
11441                }
11442
11443                if ($el.length > 0) {
11444                    e.preventDefault();
11445                    $el.slideToggle();
11446                    $(this).toggleClass('active');
11447                    // S'il n'y a pas d'attribut data-readless="", on ne fait aucune modification
11448                    if ($(this).data('readless') && typeof formerText !== 'undefined') {
11449                        if ($(this).hasClass('active')) {
11450                            $link.text($(this).data('readless'));
11451                        } else {
11452                            $link.text(formerText.readless);
11453                        }
11454                    }
11455
11456                    $el.trigger('readmore-toggle', [$(this).hasClass('active')]);
11457                }
11458            });
11459        },
11460
11461        /**
11462         * remove page from dom
11463         */
11464        remove: function () {
11465            var scope = this;
11466            scope.$el && scope.$el.remove();
11467        },
11468
11469        /**
11470         * add transition classes to animate appear / disappear
11471         * @param {boolean} appear is it appear or disappear transition
11472         */
11473        addTransitionClasses: function (appear) {
11474            var scope = this;
11475            scope.$el.removeClass(scope.transitionClassHidden + ' ' + scope.transitionClassAppear + ' ' + scope.transitionClassDisappear);
11476
11477            if (appear) {
11478                scope.$el.addClass(scope.transitionClassHidden + ' ' + scope.transitionClassAppear);
11479                setTimeout(function () {
11480                    scope.$el.removeClass(scope.transitionClassHidden + ' ' + scope.transitionClassAppear);
11481                }, 20);
11482            } else {
11483                scope.$el.addClass(scope.transitionClassHidden + ' ' + scope.transitionClassDisappear);
11484            }
11485        },
11486
11487        /**
11488         * called when page appear on dom
11489         */
11490        appear: function () {
11491            if (!this.appeared) {
11492                this.appeared = true;
11493                this.notifyModules();
11494            }
11495        },
11496
11497        /**
11498         * called when page disappear from dom
11499         */
11500        disappear: function () {
11501            if (this.appeared) {
11502                this.appeared = false;
11503                this.notifyModules();
11504            }
11505        },
11506
11507        /**
11508         * call appear / disappear function on modules
11509         */
11510        notifyModules: function () {
11511            var scope = this;
11512            var i = scope.modules.length,
11513                functionName = this.appeared ? 'appear' : 'disappear';
11514            if (i !== 0) {
11515                while (i--) {
11516                    scope.modules[i][functionName] && scope.modules[i][functionName]();
11517                }
11518            }
11519        },
11520
11521        /**
11522         * function to override in your specific pages
11523         */
11524        initPage: function () {
11525
11526        }
11527
11528    };
11529
11530    ns.Page = pageJs;
11531
11532})(jQuery, jQuery(window), window.wonderwp, jQuery('body'));
11533
11534/**
11535 * Created by jeremydesvaux on 10/03/2017.
11536 */
11537(function ($, ns) {
11538
11539    "use strict";
11540
11541    var menu = function ($context) {
11542        this.$context = $context;
11543        this.registerEvents();
11544        //this.loadExtraContent();
11545    };
11546
11547    menu.prototype = {
11548        toggleMenu: function () {
11549            if ($('body').hasClass('mobile-opened')) {
11550                this.closeMenu();
11551            } else {
11552                this.openMenu();
11553            }
11554        },
11555        openMenu: function () {
11556            $('body').addClass('mobile-opened');
11557        },
11558        closeMenu: function () {
11559          $('body').removeClass('mobile-opened');
11560        },
11561        registerEvents: function () {
11562            var self = this;
11563            $('.nav-button').on('click', function (e) {
11564                e.preventDefault();
11565                self.toggleMenu();
11566            });
11567            $('.page_item_has_children > a').on('click',function(e){
11568              e.preventDefault();
11569              self.toggleSubmenu($(e.currentTarget).parent());
11570            });
11571        },
11572        toggleSubmenu: function ($subMenu){
11573          $subMenu.toggleClass('is-opened');
11574        }
11575    };
11576
11577    ns.menu = menu;
11578
11579})(jQuery, window.wonderwp);
11580
11581(function ($, ns, app) {
11582
11583  var themeJs = {
11584
11585    //Chef d'orchestre, que veux faire mon theme?
11586    init: function () {
11587      var t = this;
11588
11589      $(document).one('ready', function () {
11590        t.$wrap = $('body');
11591
11592        //appeler ici une fonction par fonctionnalite
11593        //Ex: this.registerMenuToggle()
11594
11595        //Init Global Components
11596        t.initComponents(true);
11597
11598        //Init Global Modules
11599        t.initGlobalModules();
11600
11601        t.initMenu();
11602        t.initAsyncContent();
11603
11604        //Init SVG4everybody
11605        t.initSVG4everybody();
11606
11607        //Init Drops animation on homepage
11608        if ($('body').hasClass('home')) {
11609          t.revealAlert();
11610        }
11611
11612        //Init current page js + components
11613        t.runCurrentPageJs();
11614      });
11615    },
11616
11617    initComponents: function (global, $context) {
11618      var registeredComponents = app.getComponents();
11619      if (registeredComponents) {
11620        for (var i in registeredComponents) {
11621          var component = registeredComponents[i];
11622
11623          if (component.initiable && component.global === global && component.init) {
11624            if (global) {
11625              component.init();
11626            } else {
11627              component.init($context.find(component.defaultSelector));
11628            }
11629          }
11630        }
11631      }
11632    },
11633
11634    initGlobalModules: function () {
11635      //var t = this;
11636      if (!ns.app.modules) return;
11637      var $defaultPageWrap = $('#content > article.hentry');
11638
11639      for (var moduleSlug in ns.app.modules) {
11640        // init module script in each of its section in the page
11641        var $moduleSection = $('body').find('.module-' + moduleSlug);
11642        if ($moduleSection.length) {
11643          $moduleSection.each(function (i, context) {
11644            if (!$.contains($defaultPageWrap[0], context)) {
11645              var module = new ns.app.modules[moduleSlug]($(context));
11646              //t.modules.push(module);
11647            }
11648          });
11649        }
11650      }
11651    },
11652
11653    initMenu: function () {
11654      new ns.menu($('#header'));
11655      //Init header menu modal
11656      ns.app.components.modal.init($('.sticky-nav .modaal'), {
11657        type: 'ajax'
11658      });
11659    },
11660
11661    initAsyncContent: function () {
11662      this.loadTemoignages();
11663    },
11664
11665    loadTemoignages: function () {
11666
11667    },
11668
11669    initSVG4everybody: function () {
11670      svg4everybody({});
11671    },
11672
11673    revealAlert: function () {
11674      var $alert = $('.seaquarium-alert');
11675      if ($alert.length) {
11676        $alert.find('.close').on('click', function (e) {
11677          e.preventDefault();
11678          $alert.removeClass('active');
11679        });
11680        setTimeout(function () {
11681          $alert.addClass('active');
11682        }, 1000);
11683      }
11684    },
11685
11686    initModulesInContext: function ($context) {
11687      for (var moduleSlug in ns.app.modules) {
11688        // init module script in each of its section in the page
11689        var $moduleSection = $context.find('.module-' + moduleSlug);
11690        if ($moduleSection.length) {
11691          $moduleSection.each(function (i, context) {
11692            var module = new ns.app.modules[moduleSlug]($(context));
11693          });
11694        }
11695      }
11696    },
11697
11698    runCurrentPageJs: function ($pageWrap) {
11699      $pageWrap          = $pageWrap || this.$wrap.find('#content > article.hentry');
11700      //does the page give instructions about the class to load?
11701      var potentialClassName = $pageWrap.data('name') ? 'Page' + $pageWrap.data('name') : 'Page';
11702      var potentialClass = ns[potentialClassName];
11703
11704      //If yes, load it, otherwise, load ns.Page. This potential class should inherit from ns.Page
11705      var classtoCall = (typeof potentialClass == 'function') ? potentialClass : ns['Page'];
11706
11707      //Init page class
11708      var p = new classtoCall($pageWrap).init();
11709      this.initComponents(false, $pageWrap);
11710      return this;
11711    }
11712
11713  };
11714
11715  themeJs.init();
11716  ns.theme = themeJs;
11717
11718})(jQuery, window.wonderwp, window.wonderwp.app);
11719
11720/**
11721 * Created by jeremydesvaux on 24/11/2016.
11722 */
11723
11724(function ($, $w, ns, $b) {
11725
11726  "use strict";
11727
11728  var PageHome = function ($el) {
11729    this.$el = $el || $('#content > article');
11730    this.modules = [];
11731
11732    return this;
11733  };
11734
11735  PageHome.prototype = jQuery.extend({}, ns.Page.prototype);
11736
11737  PageHome.prototype.init = function () {
11738    if (this.inited) {
11739      $w.trigger('resize'); // update bx sliders
11740    } else {
11741      this.inited = true;
11742      this.initComponents();
11743      this.initModules();
11744      this.bindUiActions();
11745      this.initPage();
11746    }
11747    this.scrollMagicController = new ScrollMagic.Controller();
11748    this.registerHomeVideo();
11749    this.registerEngagements();
11750    this.registerInstituts();
11751  };
11752
11753  PageHome.prototype.registerHomeVideo = function () {
11754
11755  };
11756
11757  PageHome.prototype.registerEngagements = function () {
11758    this.registerSharkMorph();
11759    //this.registerTextShine();
11760    this.registerAnimationReveal();
11761  };
11762
11763  PageHome.prototype.registerSharkMorph = function () {
11764    var $blocEngagement = this.$el.find('.home-engagements-block');
11765    var blobTl = new TimelineMax({
11766        repeat: -1,
11767        paused: true
11768      }),
11769      blobSteps = $blocEngagement.find('.svg-blob .step').toArray(),
11770      firstStep = blobSteps.shift(),
11771      timingLength = 5,
11772      timingAdjustment = 0;
11773
11774    for (var i in blobSteps) {
11775      blobTl.to(firstStep, timingLength, {morphSVG: blobSteps[i], ease: Power0.easeNone}, "-=" + timingAdjustment);
11776    }
11777    blobTl.to(firstStep, timingLength, {morphSVG: firstStep, ease: Power0.easeNone}, "-=" + timingAdjustment);
11778
11779    //console.log(blobTl);
11780
11781
11782    var scene = new ScrollMagic.Scene({
11783      triggerElement: $blocEngagement[0],
11784      duration: $blocEngagement.outerHeight()
11785    })
11786      .on("enter", function (event) {
11787        blobTl.play();
11788      })
11789      .on("leave", function (event) {
11790        blobTl.pause();
11791      })
11792      //.addIndicators()
11793      .addTo(this.scrollMagicController);
11794
11795    /*blobTl.to(circle, 1, {morphSVG:"#hippo"})
11796      .to(circle, 1, {morphSVG:"#star"})
11797      .to(circle, 1, {morphSVG:"#elephant"})
11798      .to(circle, 1, {morphSVG:circle});*/
11799  };
11800
11801  PageHome.prototype.registerTextShine = function () {
11802    //Effet texte CTA
11803    var $blocEngagement = this.$el.find('.home-engagements-block');
11804    var $cta = $blocEngagement.find('.link');
11805    //https://codepen.io/GreenSock/pen/gFHza
11806    //https://greensock.com/docs/v2/Utilities/SplitText
11807  };
11808
11809  PageHome.prototype.registerAnimationReveal = function () {
11810
11811    //Animations
11812    var $animationsWrap = this.$el.find('.animations-list');
11813    var tween = TweenMax.staggerFromTo($animationsWrap.find(' > li'), 0.3,
11814      {
11815        autoAlpha: 0,
11816        y: +50
11817      },
11818      {
11819        autoAlpha: 1,
11820        y: 0,
11821        ease: Power1.easeIn,
11822        force3D: true
11823      },
11824      .2 // Stagger duration
11825    );
11826    var scene = new ScrollMagic.Scene({
11827      triggerElement: $animationsWrap[0],
11828      offset: -250
11829    })
11830      .setTween(tween)
11831      //.addIndicators()
11832      .addTo(this.scrollMagicController);
11833
11834    $animationsWrap.find(' > li').each(function (i, li) {
11835
11836      $(li).on('touchstart touchend', function (e) {
11837        $(this).toggleClass('hover_effect');
11838      });
11839    });
11840  };
11841
11842  PageHome.prototype.registerInstituts = function () {
11843
11844  };
11845
11846  ns.Pagefr = PageHome;
11847  ns.Pageen = PageHome;
11848
11849})(jQuery, jQuery(window), window.wonderwp, jQuery('body'));
11850
11851/**
11852 * Created by jeremydesvaux on 24/11/2016.
11853 */
11854
11855(function ($, $w, ns, $b) {
11856
11857  "use strict";
11858
11859  var PageParcours = function ($el) {
11860    this.$el = $el || $('#content > article');
11861    this.modules = [];
11862
11863    return this;
11864  };
11865
11866  PageParcours.prototype = jQuery.extend({}, ns.Page.prototype);
11867
11868  PageParcours.prototype.init = function () {
11869    var t = this;
11870    ns.Page.prototype.init.bind(t);
11871    t.scrollMagicController = new ScrollMagic.Controller();
11872    t.registerFishScroll();
11873    t.registerSurfaceWaves();
11874    t.registerScenes();
11875  };
11876
11877  PageParcours.prototype.registerFishScroll = function () {
11878    var isScrolling,
11879      isSwimming = false,
11880      t = this,
11881      $scrollFish = t.$el.find('.poisson-timeline');
11882
11883    window.addEventListener('scroll', function(event) {
11884      if (!isSwimming) {
11885        $scrollFish.addClass('swimming');
11886        isSwimming = true;
11887      }
11888      window.clearTimeout(isScrolling);
11889      isScrolling = setTimeout(function() {
11890        $scrollFish.removeClass('swimming');
11891        isSwimming = false;
11892      }, 20);
11893    }, false);
11894  };
11895
11896  PageParcours.prototype.registerSurfaceWaves = function () {
11897    var blobTl = new TimelineMax({
11898        repeat: -1,
11899        //paused: true
11900      }),
11901      blobSteps = this.$el.find('.svg-blob .step').toArray(),
11902      firstStep = blobSteps.shift(),
11903      timingLength = 4,
11904      timingAdjustment = 0;
11905
11906    for (var i in blobSteps) {
11907      blobTl.to(firstStep, timingLength, {morphSVG: blobSteps[i], ease: Power0.easeNone}, "-=" + timingAdjustment);
11908    }
11909    blobTl.to(firstStep, timingLength, {morphSVG: firstStep, ease: Power0.easeNone}, "-=" + timingAdjustment);
11910  };
11911
11912  PageParcours.prototype.registerScenes = function () {
11913    var t = this;
11914    //Paralax Etoiles de mer
11915    //Balance des algues
11916    //Interlude
11917    //activation / deactivation scene
11918
11919    this.$el.find('.scene').each(function (i, scene) {
11920      var $scene = $(scene);
11921      var $line = $scene.find('.line-timeline');
11922
11923      var tween = TweenLite.to($line, 1, {height: '75%'});
11924      new ScrollMagic.Scene({triggerElement: $scene[0], duration: $scene.find('.before-scene').outerHeight()})
11925        .setTween(tween)
11926        .on("end", function (event) {
11927          $scene.toggleClass('active');
11928        })
11929        //.addIndicators({name: "line " + i}) // add indicators (requires plugin)
11930        .addTo(t.scrollMagicController);
11931
11932      new ScrollMagic.Scene({
11933        triggerElement: $scene[0],
11934        duration: $scene.outerHeight()
11935      })
11936        .on("enter", function (event) {
11937          //console.log("enter",event);
11938          if (event.scrollDirection === 'REVERSE') {
11939            $scene.addClass('active');
11940          }
11941          var $video = $scene.find('video');
11942          /*if($video.length){
11943            $video[0].play();
11944          }*/
11945
11946        })
11947        .on("leave", function (event) {
11948          //console.log("leave",event);
11949          $scene.removeClass('active');
11950          var $video = $scene.find('video');
11951          /*if($video.length){
11952            $video[0].pause();
11953          }*/
11954        })
11955        //.addIndicators({name: "scene " + i})
11956        .addTo(t.scrollMagicController);
11957
11958    });
11959
11960  };
11961
11962  ns['Pagenos-engagements'] = PageParcours;
11963  ns['Pagethe-seaquarium-mission'] = PageParcours;
11964})(jQuery, jQuery(window), window.wonderwp, jQuery('body'));

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