vendor: 15,088 bytes, lines 1-2
1/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ 2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}
vendor: 4,356 bytes, line 2
2:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];
vendor: 10,068 bytes, line 2
2if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pe
vendor: 8,547 bytes, line 2
2nding",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone
vendor: 51,417 bytes, line 2
2=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join("|"),"i");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",y.checkOn=""!==rt.value,y.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",y.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)Dt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
3 4siteurl = jQuery('body').data('siteurl'); 5directory = jQuery('body').data('directory'); 6pagina = jQuery('body').data('pagina'); 7 8$(function(){ 9 10 var campoVaga = $('input[name="pagina"]'); 11 if (campoVaga.length > 0) { 12 campoVaga.val(pagina); 13 } 14 15 $('#menu__toggle').on('change', function() { 16 if ($(this).is(':checked')) { 17 $('html').addClass('no-scroll'); 18 } else { 19 $('html').removeClass('no-scroll'); 20 } 21 }); 22 23 24 $('.slick').slick({ 25 prevArrow: '<a href="#" class="slick-prev" aria-label="Previous"><img src="'+directory+'/src/img/ico-ball-left.svg" alt="anterior" width="35"></a>', 26 nextArrow: '<a href="#" class="slick-next" aria-label="Next"><img src="'+directory+'/src/img/ico-ball-right.svg" alt="próximo" width="35"></a>', 27 }); 28 29 $('body').on('change','.js-select-url',function(e){ 30 if ($(this).val()) { 31 window.location = $(this).val(); 32 } 33 }); 34 35 36 $('body').on('click', '[data-togo]', function(e){ 37 e.preventDefault(); 38 var elem = $(this); 39 $('[data-togo]').removeClass('active'); 40 elem.addClass('active'); 41 var slick = elem.data('slick'); 42 var togo = elem.data('togo'); 43 $(slick).slick('slickGoTo', togo); 44 }); 45 46 $('body').on('click', '[data-prev]', function(e){ 47 e.preventDefault(); 48 var $elem = $(this); 49 var $slide = $elem.data('prev'); 50 $($slide).slick("slickPrev"); 51 }); 52 53 $('body').on('click', '[data-next]', function(e){ 54 e.preventDefault(); 55 var $elem = $(this); 56 var $slide = $elem.data('next'); 57 $($slide).slick('slickNext'); 58 }) 59 60 61 if($('#select-estado').length > 0){ 62 country_id = 31; 63 var states = siteurl+'/wp-json/kriaweb-api/v1/states?country_id='+country_id; 64 $('#select-estado').html(''); 65 $.getJSON(states, function(data) { 66 if(data.length){ 67 $('#select-estado').append('<option value="">'+zanottiTranslations.select__estado+'</option>'); 68 $.each(data, function(index, item) { 69 $('#select-estado').append('<option value="'+item.iso2+'" data-id="'+item.id+'">'+item.name+'</option>'); 70 }); 71 }else{ 72 $('#select-estado').html('<option value="-">-</option>'); 73 } 74 }).fail(function() { 75 console.error("Erro ao buscar dados do JSON."); 76 }); 77 } 78 79 $('body').on('change', '#select-estado', function(e){ 80 var elem = $(this); 81 var state_id = elem.find('option:selected').data('id'); 82 var states = siteurl+'/wp-json/kriaweb-api/v1/cities?state_id='+state_id; 83 $('#select-cidade').html(''); 84 $.getJSON(states, function(data) { 85 if(data.length){ 86 $('#select-cidade').append('<option value="">'+zanottiTranslations.select__cidade+'</option>'); 87 $.each(data, function(index, item) { 88 $('#select-cidade').append('<option value="'+item.name+'">'+item.name+'</option>'); 89 }); 90 }else{ 91 $('#select-cidade').html('<option value="-">-</option>'); 92 } 93 }).fail(function() { 94 console.error("Erro ao buscar dados do JSON."); 95 }); 96 }); 97 98 99 100 $('body').on('click', '[data-cor]', function(e){ 101 e.preventDefault(); 102 var elem = $(this); 103 var cor_id = elem.data('cor'); 104 $('[data-cor]').removeClass('active'); 105 $(elem).addClass('active'); 106 107 $('.cor-details').addClass('d-none'); 108 $('.cor-detail-'+cor_id).removeClass('d-none'); 109 110 }); 111 112 113 /* 114 $('body').on('click', '[data-change]', function(e){ 115 e.preventDefault(); 116 117 var elem = $(this); 118 var change = elem.data('change'); 119 var hexa = elem.data('hexa'); 120 var id = elem.data('id'); 121 122 $('.produto-change-'+id+' .'+change).css({'background-color': hexa}); 123 124 }); 125 126 127 $('body').on('click', '[data-toggle]', function(e){ 128 e.preventDefault(); 129 var $elem = $(this); 130 131 var href = $elem.attr('href'); 132 if(!(/#/.test(href))) { 133 e.preventDefault(); 134 } 135 var array = $elem.data('toggle'); 136 137 138 var options = {}; 139 array = array.replace(/\s/g, '').split('|'); 140 $.each(array, function(x){ 141 var arr = array[x].split(':'); 142 arr[1] && (options[arr[0]] = arr[1]); 143 }); 144 145 var target = $elem.parent().find(options.target); 146 target.length > 0 ? target.toggleClass(options.classname) : $(options.target).toggleClass(options.classname); 147 var activeElem = options.active ? $elem.closest(options.active).toggleClass('active') : $elem.toggleClass('active'); 148 149 }); 150 151 */ 152 153 $('[id^=filtro_cor]').on('input', function() { 154 var filtro = $(this).val().toLowerCase(); 155 156 157 $('.cartela-de-cores .cor').each(function() { 158 var corNome = $(this).data('cor-nome').toString().toLowerCase(); 159 160 if (corNome.indexOf(filtro) !== -1) { 161 $(this).show(); 162 } else { 163 $(this).hide(); 164 } 165 }); 166 }); 167 168 $('input[type="checkbox"]').on('change', function() { 169 170 var selectedMaterials = []; 171 172 $('input[type="checkbox"]:checked').each(function() { 173 selectedMaterials.push($(this).data('filtro-produto')); 174 }); 175 176 if (selectedMaterials.length > 0) { 177 $('.produto').hide(); // Oculta todos os produtos inicialmente 178 179 $('.produto').each(function() { 180 var produto = $(this); 181 var hasClass = false;
182 183 // Verifica se a div do produto possui alguma das classes selecionadas 184 selectedMaterials.forEach(function(material) { 185 if (produto.hasClass(material.toString())) { 186 hasClass = true; 187 return false; // Sai do loop early 188 } 189 }); 190 191 if (hasClass) { 192 produto.show(); 193 } 194 }); 195 } else { 196 $('.produto').show(); // Mostra todos os produtos se nenhum checkbox estiver selecionado 197 } 198 }); 199 200 201 202 function filterColors() { 203 // Obtém os tipos selecionados 204 var selectedTypes = $('[data-filtro-tipo]:checked').map(function() { 205 $('[data-filtro-nome]').val(''); 206 return $(this).data('filtro-tipo'); 207 }).get(); 208 209 // Obtém as escalas selecionadas 210 var selectedScales = $('[data-filtro-escala]:checked').map(function() { 211 $('[data-filtro-nome]').val(''); 212 return $(this).data('filtro-escala'); 213 }).get(); 214 215 // Oculta todas as classes de cores 216 $('.cor').hide(); 217 218 var visibleCount = 0; 219 220 if (selectedTypes.length > 0 && selectedScales.length > 0) { 221 // Se ambos os filtros estão selecionados, exibe apenas as cores que correspondem a ambos 222 selectedTypes.forEach(function(type) { 223 selectedScales.forEach(function(scale) { 224 var elements = $('.cor.' + type + '.' + scale).show(); 225 visibleCount += elements.length; 226 }); 227 }); 228 } else if (selectedTypes.length > 0) { 229 // Se apenas os tipos estão selecionados, exibe as cores correspondentes aos tipos 230 selectedTypes.forEach(function(type) { 231 var elements = $('.cor.' + type).show(); 232 visibleCount += elements.length; 233 }); 234 } else if (selectedScales.length > 0) { 235 // Se apenas as escalas estão selecionadas, exibe as cores correspondentes às escalas 236 selectedScales.forEach(function(scale) { 237 var elements = $('.cor.' + scale).show(); 238 visibleCount += elements.length; 239 }); 240 } else { 241 // Se nenhum filtro está selecionado, exibe todas as cores 242 var elements = $('.cor').show(); 243 visibleCount = elements.length; 244 } 245 246 // Exibe o número de resultados encontrados no console 247 $('.num-colors').html(visibleCount); 248 } 249 250 // Função para filtrar cores pelo nome digitado 251 function filterByName() { 252 var visibleCount = 0; 253 var searchTerm = $('[data-filtro-nome]').val().toLowerCase(); 254 if (searchTerm) { 255 // Desmarca todos os checkboxes 256 $('[data-filtro-tipo], [data-filtro-escala]').prop('checked', false); 257 // Oculta todas as cores 258 $('.cor').hide(); 259 // Mostra apenas as cores que correspondem ao nome digitado 260 var elements = $('.cor').filter(function() { 261 return $(this).text().toLowerCase().includes(searchTerm); 262 }).show(); 263 visibleCount = elements.length; 264 $('.num-colors').html(visibleCount); 265 } else { 266 // Se a caixa de texto estiver vazia, aplica o filtro original 267 filterColors(); 268 } 269 } 270 271 // Aciona o filtro quando os checkboxes são alterados 272 $('[data-filtro-tipo], [data-filtro-escala]').change(filterColors); 273 274 // Aciona a filtragem por nome quando o texto é digitado 275 $('[data-filtro-nome]').on('input', filterByName); 276 277 // Aciona o filtro na inicialização para definir o estado inicial 278 filterColors(); 279 280 281 //$('.num-colors').html(visibleCount); 282 283 // *************************************************************** retorna endereço pelo CEP 284 /* 285 $(document).on('keyup', '[name=billing_postcode]', function(e) { 286 e.preventDefault(); 287 var $elem = $(this); 288 var $cep = $elem.val(); 289 if($cep.length >= 8){ 290 $.ajax({ 291 dataType: "json", 292 url: 'https://viacep.com.br/ws/'+$cep+'/json/', 293 success: function(data) { 294 if(data.erro==true){ 295 $elem.attr('placeholder','CEP não encontrado.'); 296 $elem.val(''); 297 }else{ 298 $('[name=billing_city]').val(data.localidade).attr('readonly','readonly'); 299 $('[name=billing_state]').val(data.uf).change(); 300 $('[name=billing_address_1]').val('Bairro: '+data.bairro+' - Rua: '+data.logradouro+' Nº: '); 301 $('[name=billing_address_1]').focus(); 302 } 303 }, 304 error: function(data) { 305 console.log(data); 306 } 307 }); 308 } 309 }); 310 */ 311 312}); 313 314 315 316(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports!=="undefined"){module.exports=factory(require("jquery"))}else{factory(jQuery)}})(function($){"use strict";var Slick=window.Slick||{};Slick=function(){var instanceUid=0;function Slick(element,settings){var _=this,dataSettings;_.defaults={accessibility:true,adaptiveHeight:false,appendArrows:$(element),appendDots:$(element),arrows:true,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:false,autoplaySpeed:3e3,centerMode:false,centerPadding:"50px",cssEase:"ease",customPaging:function(slider,i){return $('<button type="button" />').text(i+1)},dots:false,dotsClass:"slick-dots",draggable:true,easing:"linear",edgeFriction:.35,fade:false,focusOnSelect:false,focusOnChange:false,infinite:fals
vendor: 32,238 bytes, line 316
316e,initialSlide:0,lazyLoad:"ondemand",mobileFirst:false,pauseOnHover:true,pauseOnFocus:true,pauseOnDotsHover:false,respondTo:"window",responsive:null,rows:1,rtl:false,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:true,swipeToSlide:false,touchMove:true,touchThreshold:5,useCSS:true,useTransform:true,variableWidth:false,vertical:false,verticalSwiping:false,waitForAnimate:true,zIndex:1e3};_.initials={animating:false,dragging:false,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:false,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:false,slideOffset:0,swipeLeft:null,swiping:false,$list:null,touchObject:{},transformsEnabled:false,unslicked:false};$.extend(_,_.initials);_.activeBreakpoint=null;_.animType=null;_.animProp=null;_.breakpoints=[];_.breakpointSettings=[];_.cssTransitions=false;_.focussed=false;_.interrupted=false;_.hidden="hidden";_.paused=true;_.positionProp=null;_.respondTo=null;_.rowCount=1;_.shouldClick=true;_.$slider=$(element);_.$slidesCache=null;_.transformType=null;_.transitionType=null;_.visibilityChange="visibilitychange";_.windowWidth=0;_.windowTimer=null;dataSettings=$(element).data("slick")||{};_.options=$.extend({},_.defaults,settings,dataSettings);_.currentSlide=_.options.initialSlide;_.originalSettings=_.options;if(typeof document.mozHidden!=="undefined"){_.hidden="mozHidden";_.visibilityChange="mozvisibilitychange"}else if(typeof document.webkitHidden!=="undefined"){_.hidden="webkitHidden";_.visibilityChange="webkitvisibilitychange"}_.autoPlay=$.proxy(_.autoPlay,_);_.autoPlayClear=$.proxy(_.autoPlayClear,_);_.autoPlayIterator=$.proxy(_.autoPlayIterator,_);_.changeSlide=$.proxy(_.changeSlide,_);_.clickHandler=$.proxy(_.clickHandler,_);_.selectHandler=$.proxy(_.selectHandler,_);_.setPosition=$.proxy(_.setPosition,_);_.swipeHandler=$.proxy(_.swipeHandler,_);_.dragHandler=$.proxy(_.dragHandler,_);_.keyHandler=$.proxy(_.keyHandler,_);_.instanceUid=instanceUid++;_.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;_.registerBreakpoints();_.init(true)}return Slick}();Slick.prototype.activateADA=function(){var _=this;_.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})};Slick.prototype.addSlide=Slick.prototype.slickAdd=function(markup,index,addBefore){var _=this;if(typeof index==="boolean"){addBefore=index;index=null}else if(index<0||index>=_.slideCount){return false}_.unload();if(typeof index==="number"){if(index===0&&_.$slides.length===0){$(markup).appendTo(_.$slideTrack)}else if(addBefore){$(markup).insertBefore(_.$slides.eq(index))}else{$(markup).insertAfter(_.$slides.eq(index))}}else{if(addBefore===true){$(markup).prependTo(_.$slideTrack)}else{$(markup).appendTo(_.$slideTrack)}}_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slides.each(function(index,element){$(element).attr("data-slick-index",index)});_.$slidesCache=_.$slides;_.reinit()};Slick.prototype.animateHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.animate({height:targetHeight},_.options.speed)}};Slick.prototype.animateSlide=function(targetLeft,callback){var animProps={},_=this;_.animateHeight();if(_.options.rtl===true&&_.options.vertical===false){targetLeft=-targetLeft}if(_.transformsEnabled===false){if(_.options.vertical===false){_.$slideTrack.animate({left:targetLeft},_.options.speed,_.options.easing,callback)}else{_.$slideTrack.animate({top:targetLeft},_.options.speed,_.options.easing,callback)}}else{if(_.cssTransitions===false){if(_.options.rtl===true){_.currentLeft=-_.currentLeft}$({animStart:_.currentLeft}).animate({animStart:targetLeft},{duration:_.options.speed,easing:_.options.easing,step:function(now){now=Math.ceil(now);if(_.options.vertical===false){animProps[_.animType]="translate("+now+"px, 0px)";_.$slideTrack.css(animProps)}else{animProps[_.animType]="translate(0px,"+now+"px)";_.$slideTrack.css(animProps)}},complete:function(){if(callback){callback.call()}}})}else{_.applyTransition();targetLeft=Math.ceil(targetLeft);if(_.options.vertical===false){animProps[_.animType]="translate3d("+targetLeft+"px, 0px, 0px)"}else{animProps[_.animType]="translate3d(0px,"+targetLeft+"px, 0px)"}_.$slideTrack.css(animProps);if(callback){setTimeout(function(){_.disableTransition();callback.call()},_.options.speed)}}}};Slick.prototype.getNavTarget=function(){var _=this,asNavFor=_.options.asNavFor;if(asNavFor&&asNavFor!==null){asNavFor=$(asNavFor).not(_.$slider)}return asNavFor};Slick.prototype.asNavFor=function(index){var _=this,asNavFor=_.getNavTarget();if(asNavFor!==null&&typeof asNavFor==="object"){asNavFor.each(function(){var target=$(this).slick("getSlick");if(!target.unslicked){target.slideHandler(index,true)}})}};Slick.prototype.applyTransition=function(slide){var _=this,transition={};if(_.options.fade===false){transition[_.transitionType]=_.transformType+" "+_.options.speed+"ms "+_.options.cssEase}else{transition[_.transitionType]="opacity "+_.options.speed+"ms "+_.options.cssEase}if(_.options.fade===false){_.$slideTrack.css(transition)}else{_.$slides.eq(slide).css(transition)}};Slick.prototype.autoPlay=function(){var _=this;_.autoPlayClear();if(_.slideCount>_.options.slidesToShow){_.autoPlayTimer=setInterval(_.autoPlayIterator,_.options.autoplaySpeed)}};Slick.prototype.autoPlayClear=function(){var _=this;if(_.autoPlayTimer){clearInterval(_.autoPlayTimer)}};Slick.prototype.autoPlayIterator=function(){var _=this,slideTo=_.currentSlide+_.options.slidesToScroll;if(!_.paused&&!_.interrupted&&!_.focussed){if(_.options.infinite===false){if(_.direction===1&&_.currentSlide+1===_.slideCount-1){_.direction=0}else if(_.direction===0){slideTo=_.currentSlide-_.options.slidesToScroll;if(_.currentSlide-1===0){_.direction=1}}}_.slideHandler(slideTo)}};Slick.prototype.buildArrows=function(){var _=this;if(_.options.arrows===true){_.$prevArrow=$(_.options.prevArrow).addClass("slick-arrow");_.$nextArrow=$(_.options.nextArrow).addClass("slick-arrow");if(_.slideCount>_.options.slidesToShow){_.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");_.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex");if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.prependTo(_.options.appendArrows)}if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.appendTo(_.options.appendArrows)}if(_.options.infinite!==true){_.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")}}else{_.$prevArrow.add(_.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"})}}};Slick.prototype.buildDots=function(){var _=this,i,dot;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$slider.addClass("slick-dotted");dot=$("<ul />").addClass(_.options.dotsClass);for(i=0;i<=_.getDotCount();i+=1){dot.append($("<li />").append(_.options.customPaging.call(this,_,i)))}_.$dots=dot.appendTo(_.options.appendDots);_.$dots.find("li").first().addClass("slick-active")}};Slick.prototype.buildOut=function(){var _=this;_.$slides=_.$slider.children(_.options.slide+":not(.slick-cloned)").addClass("slick-slide");_.slideCount=_.$slides.length;_.$slides.each(function(index,element){$(element).attr("data-slick-index",index).data("originalStyling",$(element).attr("style")||"")});_.$slider.addClass("slick-slider");_.$slideTrack=_.slideCount===0?$('<div class="slick-track"/>').appendTo(_.$slider):_.$slides.wrapAll('<div class="slick-track"/>').parent();_.$list=_.$slideTrack.wrap('<div class="slick-list"/>').parent();_.$slideTrack.css("opacity",0);if(_.options.centerMode===true||_.options.swipeToSlide===true){_.options.slidesToScroll=1}$("img[data-lazy]",_.$slider).not("[src]").addClass("slick-loading");_.setupInfinite();_.buildArrows();_.buildDots();_.updateDots();_.setSlideClasses(typeof _.currentSlide==="number"?_.currentSlide:0);if(_.options.draggable===true){_.$list.addClass("draggable")}};Slick.prototype.buildRows=function(){var _=this,a,b,c,newSlides,numOfSlides,originalSlides,slidesPerSection;newSlides=document.createDocumentFragment();originalSlides=_.$slider.children();if(_.options.rows>0){slidesPerSection=_.options.slidesPerRow*_.options.rows;numOfSlides=Math.ceil(originalSlides.length/slidesPerSection);for(a=0;a<numOfSlides;a++){var slide=document.createElement("div");for(b=0;b<_.options.rows;b++){var row=document.createElement("div");for(c=0;c<_.options.slidesPerRow;c++){var target=a*slidesPerSection+(b*_.options.slidesPerRow+c);if(originalSlides.get(target)){row.appendChild(originalSlides.get(target))}}slide.appendChild(row)}newSlides.appendChild(slide)}_.$slider.empty().append(newSlides);_.$slider.children().children().children().css({width:100/_.options.slidesPerRow+"%",display:"inline-block"})}};Slick.prototype.checkResponsive=function(initial,forceUpdate){var _=this,breakpoint,targetBreakpoint,respondToWidth,triggerBreakpoint=false;var sliderWidth=_.$slider.width();var windowWidth=window.innerWidth||$(window).width();if(_.respondTo==="window"){respondToWidth=windowWidth}else if(_.respondTo==="slider"){respondToWidth=sliderWidth}else if(_.respondTo==="min"){respondToWidth=Math.min(windowWidth,sliderWidth)}if(_.options.responsive&&_.options.responsive.length&&_.options.responsive!==null){targetBreakpoint=null;for(breakpoint in _.breakpoints){if(_.breakpoints.hasOwnProperty(breakpoint)){if(_.originalSettings.mobileFirst===false){if(respondToWidth<_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint]}}else{if(respondToWidth>_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint]}}}}if(targetBreakpoint!==null){if(_.activeBreakpoint!==null){if(targetBreakpoint!==_.activeBreakpoint||forceUpdate){_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==="unslick"){_.unslick(targetBreakpoint)}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial)}triggerBreakpoint=targetBreakpoint}}else{_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==="unslick"){_.unslick(targetBreakpoint)}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial)}triggerBreakpoint=targetBreakpoint}}else{if(_.activeBreakpoint!==null){_.activeBreakpoint=null;_.options=_.originalSettings;if(initial===true){_.currentSlide=_.options.initialSlide}_.refresh(initial);triggerBreakpoint=targetBreakpoint}}if(!initial&&triggerBreakpoint!==false){_.$slider.trigger("breakpoint",[_,triggerBreakpoint])}}};Slick.prototype.changeSlide=function(event,dontAnimate){var _=this,$target=$(event.currentTarget),indexOffset,slideOffset,unevenOffset;if($target.is("a")){event.preventDefault()}if(!$target.is("li")){$target=$target.closest("li")}unevenOffset=_.slideCount%_.options.slidesToScroll!==0;indexOffset=unevenOffset?0:(_.slideCount-_.currentSlide)%_.options.slidesToScroll;switch(event.data.message){case"previous":slideOffset=indexOffset===0?_.options.slidesToScroll:_.options.slidesToShow-indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide-slideOffset,false,dontAnimate)}break;case"next":slideOffset=indexOffset===0?_.options.slidesToScroll:indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide+slideOffset,false,dontAnimate)}break;case"index":var index=event.data.index===0?0:event.data.index||$target.index()*_.options.slidesToScroll;_.slideHandler(_.checkNavigable(index),false,dontAnimate);$target.children().trigger("focus");break;default:return}};Slick.prototype.checkNavigable=function(index){var _=this,navigables,prevNavigable;navigables=_.getNavigableIndexes();prevNavigable=0;if(index>navigables[navigables.length-1]){index=navigables[navigables.length-1]}else{for(var n in navigables){if(index<navigables[n]){index=prevNavigable;break}prevNavigable=navigables[n]}}return index};Slick.prototype.cleanUpEvents=function(){var _=this;if(_.options.dots&&_.$dots!==null){$("li",_.$dots).off("click.slick",_.changeSlide).off("mouseenter.slick",$.proxy(_.interrupt,_,true)).off("mouseleave.slick",$.proxy(_.interrupt,_,false));if(_.options.accessibility===true){_.$dots.off("keydown.slick",_.keyHandler)}}_.$slider.off("focus.slick blur.slick");if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow&&_.$prevArrow.off("click.slick",_.changeSlide);_.$nextArrow&&_.$nextArrow.off("click.slick",_.changeSlide);if(_.options.accessibility===true){_.$prevArrow&&_.$prevArrow.off("keydown.slick",_.keyHandler);_.$nextArrow&&_.$nextArrow.off("keydown.slick",_.keyHandler)}}_.$list.off("touchstart.slick mousedown.slick",_.swipeHandler);_.$list.off("touchmove.slick mousemove.slick",_.swipeHandler);_.$list.off("touchend.slick mouseup.slick",_.swipeHandler);_.$list.off("touchcancel.slick mouseleave.slick",_.swipeHandler);_.$list.off("click.slick",_.clickHandler);$(document).off(_.visibilityChange,_.visibility);_.cleanUpSlideEvents();if(_.options.accessibility===true){_.$list.off("keydown.slick",_.keyHandler)}if(_.options.focusOnSelect===true){$(_.$slideTrack).children().off("click.slick",_.selectHandler)}$(window).off("orientationchange.slick.slick-"+_.instanceUid,_.orientationChange);$(window).off("resize.slick.slick-"+_.instanceUid,_.resize);$("[draggable!=true]",_.$slideTrack).off("dragstart",_.preventDefault);$(window).off("load.slick.slick-"+_.instanceUid,_.setPosition)};Slick.prototype.cleanUpSlideEvents=function(){var _=this;_.$list.off("mouseenter.slick",$.proxy(_.interrupt,_,true));_.$list.off("mouseleave.slick",$.proxy(_.interrupt,_,false))};Slick.prototype.cleanUpRows=function(){var _=this,originalSlides;if(_.options.rows>0){originalSlides=_.$slides.children().children();originalSlides.removeAttr("style");_.$slider.empty().append(originalSlides)}};Slick.prototype.clickHandler=function(event){var _=this;if(_.shouldClick===false){event.stopImmediatePropagation();event.stopPropagation();event.preventDefault()}};Slick.prototype.destroy=function(refresh){var _=this;_.autoPlayClear();_.touchObject={};_.cleanUpEvents();$(".slick-cloned",_.$slider).detach();if(_.$dots){_.$dots.remove()}if(_.$prevArrow&&_.$prevArrow.length){_.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display","");if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove()}}if(_.$nextArrow&&_.$nextArrow.length){_.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display","");if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove()}}if(_.$slides){_.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){$(this).attr("style",$(this).data("originalStyling"))});_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.detach();_.$list.detach();_.$slider.append(_.$slides)}_.cleanUpRows();_.$slider.removeClass("slick-slider");_.$slider.removeClass("slick-initialized");_.$slider.removeClass("slick-dotted");_.unslicked=true;if(!refresh){_.$slider.trigger("destroy",[_])}};Slick.prototype.disableTransition=function(slide){var _=this,transition={};transition[_.transitionType]="";if(_.options.fade===false){_.$slideTrack.css(transition)}else{_.$slides.eq(slide).css(transition)}};Slick.prototype.fadeSlide=function(slideIndex,callback){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).css({zIndex:_.options.zIndex});_.$slides.eq(slideIndex).animate({opacity:1},_.options.speed,_.options.easing,callback)}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:1,zIndex:_.options.zIndex});if(callback){setTimeout(function(){_.disableTransition(slideIndex);callback.call()},_.options.speed)}}};Slick.prototype.fadeSlideOut=function(slideIndex){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).animate({opacity:0,zIndex:_.options.zIndex-2},_.options.speed,_.options.easing)}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:0,zIndex:_.options.zIndex-2})}};Slick.prototype.filterSlides=Slick.prototype.slickFilter=function(filter){var _=this;if(filter!==null){_.$slidesCache=_.$slides;_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.filter(filter).appendTo(_.$slideTrack);_.reinit()}};Slick.prototype.focusHandler=function(){var _=this;_.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(event){var $sf=$(this);setTimeout(function(){if(_.options.pauseOnFocus){if($sf.is(":focus")){_.focussed=true;_.autoPlay()}}},0)}).on("blur.slick","*",function(event){var $sf=$(this);if(_.options.pauseOnFocus){_.focussed=false;_.autoPlay()}})};Slick.prototype.getCurrent=Slick.prototype.slickCurrentSlide=function(){var _=this;return _.currentSlide};Slick.prototype.getDotCount=function(){var _=this;var breakPoint=0;var counter=0;var pagerQty=0;if(_.options.infinite===true){if(_.slideCount<=_.options.slidesToShow){++pagerQty}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}}}else if(_.options.centerMode===true){pagerQty=_.slideCount}else if(!_.options.asNavFor){pagerQty=1+Math.ceil((_.slideCount-_.options.slidesToShow)/_.options.slidesToScroll)}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}}return pagerQty-1};Slick.prototype.getLeft=function(slideIndex){var _=this,targetLeft,verticalHeight,verticalOffset=0,targetSlide,coef;_.slideOffset=0;verticalHeight=_.$slides.first().outerHeight(true);if(_.options.infinite===true){if(_.slideCount>_.options.slidesToShow){_.slideOffset=_.slideWidth*_.options.slidesToShow*-1;coef=-1;if(_.options.vertical===true&&_.options.centerMode===true){if(_.options.slidesToShow===2){coef=-1.5}else if(_.options.slidesToShow===1){coef=-2}}verticalOffset=verticalHeight*_.options.slidesToShow*coef}if(_.slideCount%_.options.slidesToScroll!==0){if(slideIndex+_.options.slidesToScroll>_.slideCount&&_.slideCount>_.options.slidesToShow){if(slideIndex>_.slideCount){_.slideOffset=(_.options.slidesToShow-(slideIndex-_.slideCount))*_.slideWidth*-1;verticalOffset=(_.options.slidesToShow-(slideIndex-_.slideCount))*verticalHeight*-1}else{_.slideOffset=_.slideCount%_.options.slidesToScroll*_.slideWidth*-1;verticalOffset=_.slideCount%_.options.slidesToScroll*verticalHeight*-1}}}}else{if(slideIndex+_.options.slidesToShow>_.slideCount){_.slideOffset=(slideIndex+_.options.slidesToShow-_.slideCount)*_.slideWidth;verticalOffset=(slideIndex+_.options.slidesToShow-_.slideCount)*verticalHeight}}if(_.slideCount<=_.options.slidesToShow){_.slideOffset=0;verticalOffset=0}if(_.options.centerMode===true&&_.slideCount<=_.options.slidesToShow){_.slideOffset=_.slideWidth*Math.floor(_.options.slidesToShow)/2-_.slideWidth*_.slideCount/2}else if(_.options.centerMode===true&&_.options.infinite===true){_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)-_.slideWidth}else if(_.options.centerMode===true){_.slideOffset=0;_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)}if(_.options.vertical===false){targetLeft=slideIndex*_.slideWidth*-1+_.slideOffset}else{targetLeft=slideIndex*verticalHeight*-1+verticalOffset}if(_.options.variableWidth===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex)}else{targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex+_.options.slidesToShow)}if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())*-1}else{targetLeft=0}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft*-1:0}if(_.options.centerMode===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex)}else{targetSlide=_.$slideTrack.children(".slick-slide").eq(slideIndex+_.options.slidesToShow+1)}if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())*-1}else{targetLeft=0}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft*-1:0}targetLeft+=(_.$list.width()-targetSlide.outerWidth())/2}}return targetLeft};Slick.prototype.getOption=Slick.prototype.slickGetOption=function(option){var _=this;return _.options[option]};Slick.prototype.getNavigableIndexes=function(){var _=this,breakPoint=0,counter=0,indexes=[],max;if(_.options.infinite===false){max=_.slideCount}else{breakPoint=_.options.slidesToScroll*-1;counter=_.options.slidesToScroll*-1;max=_.slideCount*2}while(breakPoint<max){indexes.push(breakPoint);breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow}return indexes};Slick.prototype.getSlick=function(){return this};Slick.prototype.getSlideCount=function(){var _=this,slidesTraversed,swipedSlide,swipeTarget,centerOffset;centerOffset=_.options.centerMode===true?Math.floor(_.$list.width()/2):0;swipeTarget=_.swipeLeft*-1+centerOffset;if(_.options.swipeToSlide===true){_.$slideTrack.find(".slick-slide").each(function(index,slide){var slideOuterWidth,slideOffset,slideRightBoundary;slideOuterWidth=$(slide).outerWidth();slideOffset=slide.offsetLeft;if(_.options.centerMode!==true){slideOffset+=slideOuterWidth/2}slideRightBoundary=slideOffset+slideOuterWidth;if(swipeTarget<slideRightBoundary){swipedSlide=slide;return false}});slidesTraversed=Math.abs($(swipedSlide).attr("data-slick-index")-_.currentSlide)||1;return slidesTraversed}else{return _.options.slidesToScroll}};Slick.prototype.goTo=Slick.prototype.slickGoTo=function(slide,dontAnimate){var _=this;_.changeSlide({data:{message:"index",index:parseInt(slide)}},dontAnimate)};Slick.prototype.init=function(creation){var _=this;if(!$(_.$slider).hasClass("slick-initialized")){$(_.$slider).addClass("slick-initialized");_.buildRows();_.buildOut();_.setProps();_.startLoad();_.loadSlider();_.initializeEvents();_.updateArrows();_.updateDots();_.checkResponsive(true);_.focusHandler()}if(creation){_.$slider.trigger("init",[_])}if(_.options.accessibility===true){_.initADA()}if(_.options.autoplay){_.paused=false;_.autoPlay()}};Slick.prototype.initADA=function(){var _=this,numDotGroups=Math.ceil(_.slideCount/_.options.slidesToShow),tabControlIndexes=_.getNavigableIndexes().filter(function(val){return val>=0&&val<_.slideCount});_.$slides.add(_.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"});if(_.$dots!==null){_.$slides.not(_.$slideTrack.find(".slick-cloned")).each(function(i){var slideControlIndex=tabControlIndexes.indexOf(i);$(this).attr({role:"tabpanel",id:"slick-slide"+_.instanceUid+i,tabindex:-1});if(slideControlIndex!==-1){var ariaButtonControl="slick-slide-control"+_.instanceUid+slideControlIndex;if($("#"+ariaButtonControl).length){$(this).attr({"aria-describedby":ariaButtonControl})}}});_.$dots.attr("role","tablist").find("li").each(function(i){var mappedSlideIndex=tabControlIndexes[i];$(this).attr({role:"presentation"});$(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+_.instanceUid+i,"aria-controls":"slick-slide"+_.instanceUid+mappedSlideIndex,"aria-label":i+1+" of "+numDotGroups,"aria-selected":null,tabindex:"-1"})}).eq(_.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end()}for(var i=_.currentSlide,max=i+_.options.slidesToShow;i<max;i++){if(_.options.focusOnChange){_.$slides.eq(i).attr({tabindex:"0"})}else{_.$slides.eq(i).removeAttr("tabindex")}}_.activateADA()};Slick.prototype.initArrowEvents=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},_.changeSlide);_.$nextArrow.off("click.slick").on("click.slick",{message:"next"},_.changeSlide);if(_.options.accessibility===true){_.$prevArrow.on("keydown.slick",_.keyHandler);_.$nextArrow.on("keydown.slick",_.keyHandler)}}};Slick.prototype.initDotEvents=function(){var _=this;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){$("li",_.$dots).on("click.slick",{message:"index"},_.changeSlide);if(_.options.accessibility===true){_.$dots.on("keydown.slick",_.keyHandler)}}if(_.options.dots===true&&_.options.pauseOnDotsHover===true&&_.slideCount>_.options.slidesToShow){$("li",_.$dots).on("mouseenter.slick",$.proxy(_.interrupt,_,true)).on("mouseleave.slick",$.proxy(_.interrupt,_,false))}};Slick.prototype.initSlideEvents=function(){var _=this;if(_.options.pauseOnHover){_.$list.on("mouseenter.slick",$.proxy(_.interrupt,_,true));_.$list.on("mouseleave.slick",$.proxy(_.interrupt,_,false))}};Slick.prototype.initializeEvents=function(){var _=this;_.initArrowEvents();_.initDotEvents();_.initSlideEvents();_.$list.on("touchstart.slick mousedown.slick",{action:"start"},_.swipeHandler);_.$list.on("touchmove.slick mousemove.slick",{action:"move"},_.swipeHandler);_.$list.on("touchend.slick mouseup.slick",{action:"end"},_.swipeHandler);_.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},_.swipeHandler);_.$list.on("click.slick",_.clickHandler);$(document).on(_.visibilityChange,$.proxy(_.visibility,_));if(_.options.accessibility===true){_.$list.on("keydown.slick",_.keyHandler)}if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on("click.slick",_.selectHandler)}$(window).on("orientationchange.slick.slick-"+_.instanceUid,$.proxy(_.orientationChange,_));$(window).on("resize.slick.slick-"+_.instanceUid,$.proxy(_.resize,_));$("[draggable!=true]",_.$slideTrack).on("dragstart",_.preventDefault);$(window).on("load.slick.slick-"+_.instanceUid,_.setPosition);$(_.setPosition)};Slick.prototype.initUI=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.show();_.$nextArrow.show()}if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.show()}};Slick.prototype.keyHandler=function(event){var _=this;if(!event.target.tagName.match("TEXTAREA|INPUT|SELECT")){if(event.keyCode===37&&_.options.accessibility===true){_.changeSlide({data:{message:_.options.rtl===true?"next":"previous"}})}else if(event.keyCode===39&&_.options.accessibility===true){_.changeSlide({data:{message:_.options.rtl===true?"previous":"next"}})}}};Slick.prototype.lazyLoad=function(){var _=this,loadRange,cloneRange,rangeStart,rangeEnd;function loadImages(imagesScope){$("img[data-lazy]",imagesScope).each(function(){var image=$(this),imageSource=$(this).attr("data-lazy"),imageSrcSet=$(this).attr("data-srcset"),imageSizes=$(this).attr("data-sizes")||_.$slider.attr("data-sizes"),imageToLoad=document.createElement("img");imageToLoad.onload=function(){image.animate({opacity:0},100,function(){if(imageSrcSet){image.attr("srcset",imageSrcSet);if(imageSizes){image.attr("sizes",imageSizes)}}image.attr("src",imageSource).animate({opacity:1},200,function(){image.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")});_.$slider.trigger("lazyLoaded",[_,image,imageSource])})};imageToLoad.onerror=function(){image.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");_.$slider.trigger("lazyLoadError",[_,image,imageSource])};imageToLoad.src=imageSource})}if(_.options.centerMode===true){if(_.options.infinite===true){rangeStart=_.currentSlide+(_.options.slidesToShow/2+1);rangeEnd=rangeStart+_.options.slidesToShow+2}else{rangeStart=Math.max(0,_.currentSlide-(_.options.slidesToShow/2+1));rangeEnd=2+(_.options.slidesToShow/2+1)+_.currentSlide}}else{rangeStart=_.options.infinite?_.options.slidesToShow+_.currentSlide:_.currentSlide;rangeEnd=Math.ceil(rangeStart+_.options.slidesToShow);if(_.options.fade===true){if(rangeStart>0)rangeStart--;if(rangeEnd<=_.slideCount)rangeEnd++}}loadRange=_.$slider.find(".slick-slide").slice(rangeStart,rangeEnd);if(_.options.lazyLoad==="anticipated"){var prevSlide=rangeStart-1,nextSlide=rangeEnd,$slides=_.$slider.find(".slick-slide");for(var i=0;i<_.options.slidesToScroll;i++){if(prevSlide<0)prevSlide=_.slideCount-1;loadRange=loadRange.add($slides.eq(prevSlide));loadRange=loadRange.add($slides.eq(nextSlide));prevSlide--;nextSlide++}}loadImages(loadRange);if(_.slideCount<=_.options.slidesToShow){cloneRange=_.$slider.find(".slick-slide");loadImages(cloneRange)}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow){cloneRange=_.$slider.find(".slick-cloned").slice(0,_.options.slidesToShow);loadImages(cloneRange)}else if(_.currentSlide===0){cloneRange=_.$slider.find(".slick-cloned").slice(_.options.slidesToShow*-1);loadImages(cloneRange)}};Slick.prototype.loadSlider=function(){var _=this;_.setPosition();_.$slideTrack.css({opacity:1});_.$slider.removeClass("slick-loading");_.initUI();if(_.options.lazyLoad==="progressive"){_.progressiveLazyLoad()}};Slick.prototype.next=Slick.prototype.slickNext=function(){var _=this;_.changeSlide({data:{message:"next"}})};Slick.prototype.orientationChange=function(){var _=this;_.checkResponsive();_.setPosition()};Slick.prototype.pause=Slick.prototype.slickPause=function(){var _=this;_.autoPlayClear();_.paused=true};Slick.prototype.play=Slick.prototype.slickPlay=function(){var _=this;_.autoPlay();_.options.autoplay=true;_.paused=false;_.focussed=false;_.interrupted=false};Slick.prototype.postSlide=function(index){var _=this;if(!_.unslicked){_.$slider.trigger("afterChange",[_,index]);_.animating=false;if(_.slideCount>_.options.slidesToShow){_.setPosition()}_.swipeLeft=null;if(_.options.autoplay){_.autoPlay()}if(_.options.accessibility===true){_.initADA();if(_.options.focusOnChange){var $currentSlide=$(_.$slides.get(_.currentSlide));$currentSlide.attr("tabindex",0).focus()}}}};Slick.prototype.prev=Slick.prototype.slickPrev=function(){var _=this;_.changeSlide({data:{message:"previous"}})};Slick.prototype.preventDefault=function(event){event.preventDefault()};Slick.prototype.progressiveLazyLoad=function(tryCount){tryCount=tryCount||1;var _=this,$imgsToLoad=$("img[data-lazy]",_.$slider),image,imageSource,imageSrcSet,imageSizes,imageToLoad;if($imgsToLoad.length){image=$imgsToLoad.first();imageSource=image.attr("data-lazy");imageSrcSet=image.attr("data-srcset");imageSizes=image.attr("data-sizes")||_.$slider.attr("data-sizes");imageToLoad=document.createElement("img");imageToLoad.onload=function(){if(imageSrcSet){image.attr("srcset",imageSrcSet);if(imageSizes){image.attr("sizes",imageSizes)}}image.attr("src",imageSource).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading");if(_.options.adaptiveHeight===true){_.setPosition()}_.$slider.trigger("lazyLoaded",[_,image,imageSource]);_.progressiveLazyLoad()};imageToLoad.onerror=function(){if(tryCount<3){setTimeout(function(){_.progressiveLazyLoad(tryCount+1)},500)}else{image.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");_.$slider.trigger("lazyLoadError",[_,image,imageSource]);_.progressiveLazyLoad()}};imageToLoad.src=imageSource}else{_.$slider.trigger("allImagesLoaded",[_])}};Slick.prototype.refresh=function(initializing){var _=this,currentSlide,lastVisibleIndex;lastVisibleIndex=_.slideCount-_.options.slidesToShow;if(!_.options.infinite&&_.currentSlide>lastVisibleIndex){_.currentSlide=lastVisibleIndex}if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0}currentSlide=_.currentSlide;_.destroy(true);$.extend(_,_.initials,{currentSlide:currentSlide});_.init();if(!initializing){_.changeSlide({data:{message:"index",index:currentSlide}},false)}};Slick.prototype.registerBreakpoints=function(){var _=this,breakpoint,currentBreakpoint,l,responsiveSettings=_.options.responsive||null;if(
vendor: 4,085 bytes, line 316
316$.type(responsiveSettings)==="array"&&responsiveSettings.length){_.respondTo=_.options.respondTo||"window";for(breakpoint in responsiveSettings){l=_.breakpoints.length-1;if(responsiveSettings.hasOwnProperty(breakpoint)){currentBreakpoint=responsiveSettings[breakpoint].breakpoint;while(l>=0){if(_.breakpoints[l]&&_.breakpoints[l]===currentBreakpoint){_.breakpoints.splice(l,1)}l--}_.breakpoints.push(currentBreakpoint);_.breakpointSettings[currentBreakpoint]=responsiveSettings[breakpoint].settings}}_.breakpoints.sort(function(a,b){return _.options.mobileFirst?a-b:b-a})}};Slick.prototype.reinit=function(){var _=this;_.$slides=_.$slideTrack.children(_.options.slide).addClass("slick-slide");_.slideCount=_.$slides.length;if(_.currentSlide>=_.slideCount&&_.currentSlide!==0){_.currentSlide=_.currentSlide-_.options.slidesToScroll}if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0}_.registerBreakpoints();_.setProps();_.setupInfinite();_.buildArrows();_.updateArrows();_.initArrowEvents();_.buildDots();_.updateDots();_.initDotEvents();_.cleanUpSlideEvents();_.initSlideEvents();_.checkResponsive(false,true);if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on("click.slick",_.selectHandler)}_.setSlideClasses(typeof _.currentSlide==="number"?_.currentSlide:0);_.setPosition();_.focusHandler();_.paused=!_.options.autoplay;_.autoPlay();_.$slider.trigger("reInit",[_])};Slick.prototype.resize=function(){var _=this;if($(window).width()!==_.windowWidth){clearTimeout(_.windowDelay);_.windowDelay=window.setTimeout(function(){_.windowWidth=$(window).width();_.checkResponsive();if(!_.unslicked){_.setPosition()}},50)}};Slick.prototype.removeSlide=Slick.prototype.slickRemove=function(index,removeBefore,removeAll){var _=this;if(typeof index==="boolean"){removeBefore=index;index=removeBefore===true?0:_.slideCount-1}else{index=removeBefore===true?--index:index}if(_.slideCount<1||index<0||index>_.slideCount-1){return false}_.unload();if(removeAll===true){_.$slideTrack.children().remove()}else{_.$slideTrack.children(this.options.slide).eq(index).remove()}_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slidesCache=_.$slides;_.reinit()};Slick.prototype.setCSS=function(position){var _=this,positionProps={},x,y;if(_.options.rtl===true){position=-position}x=_.positionProp=="left"?Math.ceil(position)+"px":"0px";y=_.positionProp=="top"?Math.ceil(position)+"px":"0px";positionProps[_.positionProp]=position;if(_.transformsEnabled===false){_.$slideTrack.css(positionProps)}else{positionProps={};if(_.cssTransitions===false){positionProps[_.animType]="translate("+x+", "+y+")";_.$slideTrack.css(positionProps)}else{positionProps[_.animType]="translate3d("+x+", "+y+", 0px)";_.$slideTrack.css(positionProps)}}};Slick.prototype.setDimensions=function(){var _=this;if(_.options.vertical===false){if(_.options.centerMode===true){_.$list.css({padding:"0px "+_.options.centerPadding})}}else{_.$list.height(_.$slides.first().outerHeight(true)*_.options.slidesToShow);if(_.options.centerMode===true){_.$list.css({padding:_.options.centerPadding+" 0px"})}}_.listWidth=_.$list.width();_.listHeight=_.$list.height();if(_.options.vertical===false&&_.options.variableWidth===false){_.slideWidth=Math.ceil(_.listWidth/_.options.slidesToShow);_.$slideTrack.width(Math.ceil(_.slideWidth*_.$slideTrack.children(".slick-slide").length))}else if(_.options.variableWidth===true){_.$slideTrack.width(5e3*_.slideCount)}else{_.slideWidth=Math.ceil(_.listWidth);_.$slideTrack.height(Math.ceil(_.$slides.first().outerHeight(true)*_.$slideTrack.children(".slick-slide").length))}var offset=_.$slides.first().outerWidth(true)-_.$slides.first().width();if(_.options.variableWidth===false)_.$slideTrack.children(".slick-slide").width(_.slideWidth-offset)};Slick.prototype.setFade=function(){var _=this,targetLeft;_.$slides.each(function(index,element){targetLeft=_.slideWidth*index*-1;if(_.options.rtl===true){$(element).css({position:"relative",right:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0}
316)}else{$(element).css({position:"relative",left:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0})}});_.$slides.eq(_.currentSlide).css({zIndex:_.options.zIndex-1,opacity:1})};Slick.prototype.setHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.css("height",targetHeight)}};Slick.prototype.setOption=Slick.prototype.slickSetOption=function(){var _=this,l,item,option,value,refresh=false,type;if($.type(arguments[0])==="object"){option=arguments[0];refresh=arguments[1];type="multiple"}else if($.type(arguments[0])==="string"){option=arguments[0];value=arguments[1];refresh=arguments[2];if(arguments[0]==="responsive"&&$.type(arguments[1])==="array"){type="responsive"}else if(typeof arguments[1]!=="undefined"){type="single"}}if(type==="single"){_.options[option]=value}else if(type==="multiple"){$.each(option,function(opt,val){_.options[opt]=val})}else if(type==="responsive"){for(item in value){if($.type(_.options.responsive)!=="array"
vendor: 14,808 bytes, line 316
316){_.options.responsive=[value[item]]}else{l=_.options.responsive.length-1;while(l>=0){if(_.options.responsive[l].breakpoint===value[item].breakpoint){_.options.responsive.splice(l,1)}l--}_.options.responsive.push(value[item])}}}if(refresh){_.unload();_.reinit()}};Slick.prototype.setPosition=function(){var _=this;_.setDimensions();_.setHeight();if(_.options.fade===false){_.setCSS(_.getLeft(_.currentSlide))}else{_.setFade()}_.$slider.trigger("setPosition",[_])};Slick.prototype.setProps=function(){var _=this,bodyStyle=document.body.style;_.positionProp=_.options.vertical===true?"top":"left";if(_.positionProp==="top"){_.$slider.addClass("slick-vertical")}else{_.$slider.removeClass("slick-vertical")}if(bodyStyle.WebkitTransition!==undefined||bodyStyle.MozTransition!==undefined||bodyStyle.msTransition!==undefined){if(_.options.useCSS===true){_.cssTransitions=true}}if(_.options.fade){if(typeof _.options.zIndex==="number"){if(_.options.zIndex<3){_.options.zIndex=3}}else{_.options.zIndex=_.defaults.zIndex}}if(bodyStyle.OTransform!==undefined){_.animType="OTransform";_.transformType="-o-transform";_.transitionType="OTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false}if(bodyStyle.MozTransform!==undefined){_.animType="MozTransform";_.transformType="-moz-transform";_.transitionType="MozTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.MozPerspective===undefined)_.animType=false}if(bodyStyle.webkitTransform!==undefined){_.animType="webkitTransform";_.transformType="-webkit-transform";_.transitionType="webkitTransition";if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false}if(bodyStyle.msTransform!==undefined){_.animType="msTransform";_.transformType="-ms-transform";_.transitionType="msTransition";if(bodyStyle.msTransform===undefined)_.animType=false}if(bodyStyle.transform!==undefined&&_.animType!==false){_.animType="transform";_.transformType="transform";_.transitionType="transition"}_.transformsEnabled=_.options.useTransform&&(_.animType!==null&&_.animType!==false)};Slick.prototype.setSlideClasses=function(index){var _=this,centerOffset,allSlides,indexOffset,remainder;allSlides=_.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true");_.$slides.eq(index).addClass("slick-current");if(_.options.centerMode===true){var evenCoef=_.options.slidesToShow%2===0?1:0;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.infinite===true){if(index>=centerOffset&&index<=_.slideCount-1-centerOffset){_.$slides.slice(index-centerOffset+evenCoef,index+centerOffset+1).addClass("slick-active").attr("aria-hidden","false")}else{indexOffset=_.options.slidesToShow+index;allSlides.slice(indexOffset-centerOffset+1+evenCoef,indexOffset+centerOffset+2).addClass("slick-active").attr("aria-hidden","false")}if(index===0){allSlides.eq(allSlides.length-1-_.options.slidesToShow).addClass("slick-center")}else if(index===_.slideCount-1){allSlides.eq(_.options.slidesToShow).addClass("slick-center")}}_.$slides.eq(index).addClass("slick-center")}else{if(index>=0&&index<=_.slideCount-_.options.slidesToShow){_.$slides.slice(index,index+_.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")}else if(allSlides.length<=_.options.slidesToShow){allSlides.addClass("slick-active").attr("aria-hidden","false")}else{remainder=_.slideCount%_.options.slidesToShow;indexOffset=_.options.infinite===true?_.options.slidesToShow+index:index;if(_.options.slidesToShow==_.options.slidesToScroll&&_.slideCount-index<_.options.slidesToShow){allSlides.slice(indexOffset-(_.options.slidesToShow-remainder),indexOffset+remainder).addClass("slick-active").attr("aria-hidden","false")}else{allSlides.slice(indexOffset,indexOffset+_.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")}}}if(_.options.lazyLoad==="ondemand"||_.options.lazyLoad==="anticipated"){_.lazyLoad()}};Slick.prototype.setupInfinite=function(){var _=this,i,slideIndex,infiniteCount;if(_.options.fade===true){_.options.centerMode=false}if(_.options.infinite===true&&_.options.fade===false){slideIndex=null;if(_.slideCount>_.options.slidesToShow){if(_.options.centerMode===true){infiniteCount=_.options.slidesToShow+1}else{infiniteCount=_.options.slidesToShow}for(i=_.slideCount;i>_.slideCount-infiniteCount;i-=1){slideIndex=i-1;$(_.$slides[slideIndex]).clone(true).attr("id","").attr("data-slick-index",slideIndex-_.slideCount).prependTo(_.$slideTrack).addClass("slick-cloned")}for(i=0;i<infiniteCount+_.slideCount;i+=1){slideIndex=i;$(_.$slides[slideIndex]).clone(true).attr("id","").attr("data-slick-index",slideIndex+_.slideCount).appendTo(_.$slideTrack).addClass("slick-cloned")}_.$slideTrack.find(".slick-cloned").find("[id]").each(function(){$(this).attr("id","")})}}};Slick.prototype.interrupt=function(toggle){var _=this;if(!toggle){_.autoPlay()}_.interrupted=toggle};Slick.prototype.selectHandler=function(event){var _=this;var targetElement=$(event.target).is(".slick-slide")?$(event.target):$(event.target).parents(".slick-slide");var index=parseInt(targetElement.attr("data-slick-index"));if(!index)index=0;if(_.slideCount<=_.options.slidesToShow){_.slideHandler(index,false,true);return}_.slideHandler(index)};Slick.prototype.slideHandler=function(index,sync,dontAnimate){var targetSlide,animSlide,oldSlide,slideLeft,targetLeft=null,_=this,navTarget;sync=sync||false;if(_.animating===true&&_.options.waitForAnimate===true){return}if(_.options.fade===true&&_.currentSlide===index){return}if(sync===false){_.asNavFor(index)}targetSlide=index;targetLeft=_.getLeft(targetSlide);slideLeft=_.getLeft(_.currentSlide);_.currentLeft=_.swipeLeft===null?slideLeft:_.swipeLeft;if(_.options.infinite===false&&_.options.centerMode===false&&(index<0||index>_.getDotCount()*_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide)})}else{_.postSlide(targetSlide)}}return}else if(_.options.infinite===false&&_.options.centerMode===true&&(index<0||index>_.slideCount-_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide)})}else{_.postSlide(targetSlide)}}return}if(_.options.autoplay){clearInterval(_.autoPlayTimer)}if(targetSlide<0){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=_.slideCount-_.slideCount%_.options.slidesToScroll}else{animSlide=_.slideCount+targetSlide}}else if(targetSlide>=_.slideCount){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=0}else{animSlide=targetSlide-_.slideCount}}else{animSlide=targetSlide}_.animating=true;_.$slider.trigger("beforeChange",[_,_.currentSlide,animSlide]);oldSlide=_.currentSlide;_.currentSlide=animSlide;_.setSlideClasses(_.currentSlide);if(_.options.asNavFor){navTarget=_.getNavTarget();navTarget=navTarget.slick("getSlick");if(navTarget.slideCount<=navTarget.options.slidesToShow){navTarget.setSlideClasses(_.currentSlide)}}_.updateDots();_.updateArrows();if(_.options.fade===true){if(dontAnimate!==true){_.fadeSlideOut(oldSlide);_.fadeSlide(animSlide,function(){_.postSlide(animSlide)})}else{_.postSlide(animSlide)}_.animateHeight();return}if(dontAnimate!==true&&_.slideCount>_.options.slidesToShow){_.animateSlide(targetLeft,function(){_.postSlide(animSlide)})}else{_.postSlide(animSlide)}};Slick.prototype.startLoad=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.hide();_.$nextArrow.hide()}if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.hide()}_.$slider.addClass("slick-loading")};Slick.prototype.swipeDirection=function(){var xDist,yDist,r,swipeAngle,_=this;xDist=_.touchObject.startX-_.touchObject.curX;yDist=_.touchObject.startY-_.touchObject.curY;r=Math.atan2(yDist,xDist);swipeAngle=Math.round(r*180/Math.PI);if(swipeAngle<0){swipeAngle=360-Math.abs(swipeAngle)}if(swipeAngle<=45&&swipeAngle>=0){return _.options.rtl===false?"left":"right"}if(swipeAngle<=360&&swipeAngle>=315){return _.options.rtl===false?"left":"right"}if(swipeAngle>=135&&swipeAngle<=225){return _.options.rtl===false?"right":"left"}if(_.options.verticalSwiping===true){if(swipeAngle>=35&&swipeAngle<=135){return"down"}else{return"up"}}return"vertical"};Slick.prototype.swipeEnd=function(event){var _=this,slideCount,direction;_.dragging=false;_.swiping=false;if(_.scrolling){_.scrolling=false;return false}_.interrupted=false;_.shouldClick=_.touchObject.swipeLength>10?false:true;if(_.touchObject.curX===undefined){return false}if(_.touchObject.edgeHit===true){_.$slider.trigger("edge",[_,_.swipeDirection()])}if(_.touchObject.swipeLength>=_.touchObject.minSwipe){direction=_.swipeDirection();switch(direction){case"left":case"down":slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide+_.getSlideCount()):_.currentSlide+_.getSlideCount();_.currentDirection=0;break;case"right":case"up":slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide-_.getSlideCount()):_.currentSlide-_.getSlideCount();_.currentDirection=1;break;default:}if(direction!="vertical"){_.slideHandler(slideCount);_.touchObject={};_.$slider.trigger("swipe",[_,direction])}}else{if(_.touchObject.startX!==_.touchObject.curX){_.slideHandler(_.currentSlide);_.touchObject={}}}};Slick.prototype.swipeHandler=function(event){var _=this;if(_.options.swipe===false||"ontouchend"in document&&_.options.swipe===false){return}else if(_.options.draggable===false&&event.type.indexOf("mouse")!==-1){return}_.touchObject.fingerCount=event.originalEvent&&event.originalEvent.touches!==undefined?event.originalEvent.touches.length:1;_.touchObject.minSwipe=_.listWidth/_.options.touchThreshold;if(_.options.verticalSwiping===true){_.touchObject.minSwipe=_.listHeight/_.options.touchThreshold}switch(event.data.action){case"start":_.swipeStart(event);break;case"move":_.swipeMove(event);break;case"end":_.swipeEnd(event);break}};Slick.prototype.swipeMove=function(event){var _=this,edgeWasHit=false,curLeft,swipeDirection,swipeLength,positionOffset,touches,verticalSwipeLength;touches=event.originalEvent!==undefined?event.originalEvent.touches:null;if(!_.dragging||_.scrolling||touches&&touches.length!==1){return false}curLeft=_.getLeft(_.currentSlide);_.touchObject.curX=touches!==undefined?touches[0].pageX:event.clientX;_.touchObject.curY=touches!==undefined?touches[0].pageY:event.clientY;_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curX-_.touchObject.startX,2)));verticalSwipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curY-_.touchObject.startY,2)));if(!_.options.verticalSwiping&&!_.swiping&&verticalSwipeLength>4){_.scrolling=true;return false}if(_.options.verticalSwiping===true){_.touchObject.swipeLength=verticalSwipeLength}swipeDirection=_.swipeDirection();if(event.originalEvent!==undefined&&_.touchObject.swipeLength>4){_.swiping=true;event.preventDefault()}positionOffset=(_.options.rtl===false?1:-1)*(_.touchObject.curX>_.touchObject.startX?1:-1);if(_.options.verticalSwiping===true){positionOffset=_.touchObject.curY>_.touchObject.startY?1:-1}swipeLength=_.touchObject.swipeLength;_.touchObject.edgeHit=false;if(_.options.infinite===false){if(_.currentSlide===0&&swipeDirection==="right"||_.currentSlide>=_.getDotCount()&&swipeDirection==="left"){swipeLength=_.touchObject.swipeLength*_.options.edgeFriction;_.touchObject.edgeHit=true}}if(_.options.vertical===false){_.swipeLeft=curLeft+swipeLength*positionOffset}else{_.swipeLeft=curLeft+swipeLength*(_.$list.height()/_.listWidth)*positionOffset}if(_.options.verticalSwiping===true){_.swipeLeft=curLeft+swipeLength*positionOffset}if(_.options.fade===true||_.options.touchMove===false){return false}if(_.animating===true){_.swipeLeft=null;return false}_.setCSS(_.swipeLeft)};Slick.prototype.swipeStart=function(event){var _=this,touches;_.interrupted=true;if(_.touchObject.fingerCount!==1||_.slideCount<=_.options.slidesToShow){_.touchObject={};return false}if(event.originalEvent!==undefined&&event.originalEvent.touches!==undefined){touches=event.originalEvent.touches[0]}_.touchObject.startX=_.touchObject.curX=touches!==undefined?touches.pageX:event.clientX;_.touchObject.startY=_.touchObject.curY=touches!==undefined?touches.pageY:event.clientY;_.dragging=true};Slick.prototype.unfilterSlides=Slick.prototype.slickUnfilter=function(){var _=this;if(_.$slidesCache!==null){_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.appendTo(_.$slideTrack);_.reinit()}};Slick.prototype.unload=function(){var _=this;$(".slick-cloned",_.$slider).remove();if(_.$dots){_.$dots.remove()}if(_.$prevArrow&&_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove()}if(_.$nextArrow&&_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove()}_.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")};Slick.prototype.unslick=function(fromBreakpoint){var _=this;_.$slider.trigger("unslick",[_,fromBreakpoint]);_.destroy()};Slick.prototype.updateArrows=function(){var _=this,centerOffset;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow&&!_.options.infinite){_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false");_.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false");if(_.currentSlide===0){_.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow&&_.options.centerMode===false){_.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")}else if(_.currentSlide>=_.slideCount-1&&_.options.centerMode===true){_.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true");_.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")}}};Slick.prototype.updateDots=function(){var _=this;if(_.$dots!==null){_.$dots.find("li").removeClass("slick-active").end();_.$dots.find("li").eq(Math.floor(_.currentSlide/_.options.slidesToScroll)).addClass("slick-active")}};Slick.prototype.visibility=function(){var _=this;if(_.options.autoplay){if(document[_.hidden]){_.interrupted=true}else{_.interrupted=false}}};$.fn.slick=function(){var _=this,opt=arguments[0],args=Array.prototype.slice.call(arguments,1),l=_.length,i,ret;for(i=0;i<l;i++){if(typeof opt=="object"||typeof opt=="undefined")_[i].slick=new Slick(_[i],opt);else ret=_[i].slick[opt].apply(_[i].slick,args);if(typeof ret!="undefined")return ret}return _}});
vendor: 161,569 bytes, lines 316-5949
316 317 318// ================================================== 319// fancyBox v3.5.7 320// 321// Licensed GPLv3 for open source use 322// or fancyBox Commercial License for commercial use 323// 324// http://fancyapps.com/fancybox/ 325// Copyright 2019 fancyApps 326// 327// ================================================== 328(function (window, document, $, undefined) { 329 "use strict"; 330 331 window.console = window.console || { 332 info: function (stuff) {} 333 }; 334 335 // If there's no jQuery, fancyBox can't work 336 // ========================================= 337 338 if (!$) { 339 return; 340 } 341 342 // Check if fancyBox is already initialized 343 // ======================================== 344 345 if ($.fn.fancybox) { 346 console.info("fancyBox already initialized"); 347 348 return; 349 } 350 351 // Private default settings 352 // ======================== 353 354 var defaults = { 355 // Close existing modals 356 // Set this to false if you do not need to stack multiple instances 357 closeExisting: false, 358 359 // Enable infinite gallery navigation 360 loop: false, 361 362 // Horizontal space between slides 363 gutter: 50, 364 365 // Enable keyboard navigation 366 keyboard: true, 367 368 // Should allow caption to overlap the content 369 preventCaptionOverlap: true, 370 371 // Should display navigation arrows at the screen edges 372 arrows: true, 373 374 // Should display counter at the top left corner 375 infobar: true, 376 377 // Should display close button (using `btnTpl.smallBtn` template) over the content 378 // Can be true, false, "auto" 379 // If "auto" - will be automatically enabled for "html", "inline" or "ajax" items 380 smallBtn: "auto", 381 382 // Should display toolbar (buttons at the top) 383 // Can be true, false, "auto" 384 // If "auto" - will be automatically hidden if "smallBtn" is enabled 385 toolbar: "auto", 386 387 // What buttons should appear in the top right corner. 388 // Buttons will be created using templates from `btnTpl` option 389 // and they will be placed into toolbar (class="fancybox-toolbar"` element) 390 buttons: [ 391 //"zoom", 392 //"share", 393 //"slideShow", 394 //"fullScreen", 395 //"download", 396 //"thumbs", 397 "close" 398 ], 399 400 // Detect "idle" time in seconds 401 idleTime: 3, 402 403 // Disable right-click and use simple image protection for images 404 protect: false, 405 406 // Shortcut to make content "modal" - disable keyboard navigtion, hide buttons, etc 407 modal: false, 408 409 image: { 410 // Wait for images to load before displaying 411 // true - wait for image to load and then display; 412 // false - display thumbnail and load the full-sized image over top, 413 // requires predefined image dimensions (`data-width` and `data-height` attributes) 414 preload: false 415 }, 416 417 ajax: { 418 // Object containing settings for ajax request 419 settings: { 420 // This helps to indicate that request comes from the modal 421 // Feel free to change naming 422 data: { 423 fancybox: true 424 } 425 } 426 }, 427 428 iframe: { 429 // Iframe template 430 tpl: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>', 431 432 // Preload iframe before displaying it 433 // This allows to calculate iframe content width and height 434 // (note: Due to "Same Origin Policy", you can't get cross domain data). 435 preload: true, 436 437 // Custom CSS styling for iframe wrapping element 438 // You can use this to set custom iframe dimensions 439 css: {}, 440 441 // Iframe tag attributes 442 attr: { 443 scrolling: "auto" 444 } 445 }, 446 447 // For HTML5 video only 448 video: { 449 tpl: '<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}">' + 450 '<source src="{{src}}" type="{{format}}" />' + 451 'Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!' + 452 "</video>", 453 format: "", // custom video format 454 autoStart: true 455 }, 456 457 // Default content type if cannot be detected automatically 458 defaultType: "image", 459 460 // Open/close animation type 461 // Possible values: 462 // false - disable 463 // "zoom" - zoom images from/to thumbnail 464 // "fade" 465 // "zoom-in-out" 466 // 467 animationEffect: "zoom", 468 469 // Duration in ms for open/close animation 470 animationDuration: 366, 471 472 // Should image change opacity while zooming 473 // If opacity is "auto", then opacity will be changed if image and thumbnail have different aspect ratios 474 zoomOpacity: "auto", 475 476 // Transition effect between slides 477 // 478 // Possible values: 479 // false - disable 480 // "fade' 481 // "slide' 482 // "circular' 483 // "tube' 484 // "zoom-in-out' 485 // "rotate' 486 // 487 transitionEffect: "fade", 488 489 // Duration in ms for transition animation 490 transitionDuration: 366, 491 492 // Custom CSS class for slide element 493 slideClass: "", 494 495 // Custom CSS class for layout 496 baseClass: "", 497 498 // Base template for layout 499 baseTpl: '<div class="fancybox-container" role="dialog" tabindex="-1">' + 500 '<div class="fancybox-bg"></div>' + 501 '<div class="fancybox-inner">' + 502 '<div class="fancybox-infobar"><span data-fancybox-index></span> / <span data-fancybox-count></span></div>' + 503 '<div class="fancybox-toolbar">{{buttons}}</div>' + 504 '<div class="fancybox-navigation">{{arrows}}</div>' + 505 '<div class="fancybox-stage"></div>' + 506 '<div class="fancybox-caption"><div class="fancybox-caption__body"></div></div>' + 507 "</div>" + 508 "</div>", 509 510 // Loading indicator template 511 spinnerTpl: '<div class="fancybox-loading"></div>', 512 513 // Error message template 514 errorTpl: '<div class="fancybox-error"><p>{{ERROR}}</p></div>', 515 516 btnTpl: { 517 download: '<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;">' + 518 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg>' + 519 "</a>", 520 521 zoom: '<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}">' + 522 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m18.2 9.6c0 2-0.7 3.9-1.9 5.3l6.2 6.3l-1.3 1.3l-6.3-6.3c-1.4 1-3 1.6-4.8 1.6c-4.5 0-8.2-3.7-8.2-8.2c0-4.5 3.7-8.2 8.2-8.2c4.5 0 8.1 3.7 8.1 8.2zm-0.9 0c0-4-3.2-7.2-7.2-7.2c-4 0-7.2 3.2-7.2 7.2c0 4 3.2 7.2 7.2 7.2c4 0 7.2-3.2 7.2-7.2z"/></svg>' + 523 "</button>", 524 525 close: '<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' + 526 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m12 11.3l8.3-8.3l0.7 0.7l-8.3 8.3l8.3 8.3l-0.7 0.7l-8.3-8.3l-8.3 8.3l-0.7-0.7l8.3-8.3l-8.3-8.3l0.7-0.7z"/></svg>' + 527 "</button>", 528 529 // Arrows 530 arrowLeft: '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' + 531 '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m5.979 11.341 11.1-11.07a.93.93 0 1 1 1.314 1.318L7.953 12l10.441 10.411a.93.93 0 0 1-1.314 1.317l-11.1-11.07a.93.93 0 0 1 0-1.317Z"/></svg></div>' + 532 "</button>", 533 534 arrowRight: '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' + 535 '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.021 11.341 6.92.271a.93.93 0 1 0-1.313 1.318L16.047 12 5.606 22.411a.93.93 0 0 0 1.314 1.317l11.1-11.07a.93.93 0 0 0 0-1.317Z"/></svg></div>' + 536 "</button>", 537 538 // This small close button will be appended to your html/inline/ajax content by default, 539 // if "smallBtn" option is not set to false 540 smallBtn: '<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}">' + 541 '<svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg>' + 542 "</button>" 543 }, 544 545 // Container is injected into this element 546 parentEl: "body", 547 548 // Hide browser vertical scrollbars; use at your own risk 549 hideScrollbar: true, 550 551 // Focus handling 552 // ============== 553 554 // Try to focus on the first focusable element after opening 555 autoFocus: true, 556 557 // Put focus back to active element after closing 558 backFocus: true, 559 560 // Do not let user to focus on element outside modal content 561 trapFocus: true, 562 563 // Module specific options 564 // ======================= 565 566 fullScreen: { 567 autoStart: false 568 }, 569 570 // Set `touch: false` to disable panning/swiping 571 touch: { 572 vertical: true, // Allow to drag content vertically 573 momentum: true // Continue movement after releasing mouse/touch when panning 574 }, 575 576 // Hash value when initializing manually, 577 // set `false` to disable hash change 578 hash: null, 579 580 // Customize or add new media types 581 // Example: 582 /* 583 media : { 584 youtube : { 585 params : { 586 autoplay : 0 587 } 588 } 589 } 590 */ 591 media: {}, 592 593 slideShow: { 594 autoStart: false, 595 speed: 3000 596 }, 597 598 thumbs: { 599 autoStart: false, // Display thumbnails on opening 600 hideOnClose: true, // Hide thumbnail grid when closing animation starts 601 parentEl: ".fancybox-container", // Container is injected into this element 602 axis: "y" // Vertical (y) or horizontal (x) scrolling 603 }, 604 605 // Use mousewheel to navigate gallery 606 // If 'auto' - enabled for images only 607 wheel: "auto", 608 609 // Callbacks 610 //========== 611 612 // See Documentation/API/Events for more information 613 // Example: 614 /* 615 afterShow: function( instance, current ) { 616 console.info( 'Clicked element:' ); 617 console.info( current.opts.$orig ); 618 } 619 */ 620 621 onInit: $.noop, // When instance has been initialized 622 623 beforeLoad: $.noop, // Before the content of a slide is being loaded 624 afterLoad: $.noop, // When the content of a slide is done loading 625 626 beforeShow: $.noop, // Before open animation starts 627 afterShow: $.noop, // When content is done loading and animating 628 629 beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close. 630 afterClose: $.noop, // After instance has been closed 631 632 onActivate: $.noop, // When instance is brought to front 633 onDeactivate: $.noop, // When other instance has been activated 634 635 // Interaction 636 // =========== 637 638 // Use options below to customize taken action when user clicks or double clicks on the fancyBox area, 639 // each option can be string or method that returns value. 640 // 641 // Possible values: 642 // "close" - close instance 643 // "next" - move to next gallery item 644 // "nextOrClose" - move to next gallery item or close if gallery has only one item 645 // "toggleControls" - show/hide controls 646 // "zoom" - zoom image (if loaded) 647 // false - do nothing 648 649 // Clicked on the content 650 clickContent: function (current, event) { 651 return current.type === "image" ? "zoom" : false; 652 }, 653 654 // Clicked on the slide 655 clickSlide: "close", 656 657 // Clicked on the background (backdrop) element; 658 // if you have not changed the layout, then most likely you need to use `clickSlide` option 659 clickOutside: "close", 660 661 // Same as previous two, but for double click 662 dblclickContent: false, 663 dblclickSlide: false, 664 dblclickOutside: false, 665 666 // Custom options when mobile device is detected 667 // ============================================= 668 669 mobile: { 670 preventCaptionOverlap: false, 671 idleTime: false, 672 clickContent: function (current, event) { 673 return current.type === "image" ? "toggleControls" : false; 674 }, 675 clickSlide: function (current, event) { 676 return current.type === "image" ? "toggleControls" : "close"; 677 }, 678 dblclickContent: function (current, event) { 679 return current.type === "image" ? "zoom" : false; 680 }, 681 dblclickSlide: function (current, event) { 682 return current.type === "image" ? "zoom" : false; 683 } 684 }, 685 686 // Internationalization 687 // ==================== 688 689 lang: "en", 690 i18n: { 691 en: { 692 CLOSE: "Close", 693 NEXT: "Next", 694 PREV: "Previous", 695 ERROR: "The requested content cannot be loaded. <br/> Please try again later.", 696 PLAY_START: "Start slideshow", 697 PLAY_STOP: "Pause slideshow", 698 FULL_SCREEN: "Full screen", 699 THUMBS: "Thumbnails", 700 DOWNLOAD: "Download", 701 SHARE: "Share", 702 ZOOM: "Zoom" 703 }, 704 de: { 705 CLOSE: "Schließen", 706 NEXT: "Weiter", 707 PREV: "Zurück", 708 ERROR: "Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.", 709 PLAY_START: "Diaschau starten", 710 PLAY_STOP: "Diaschau beenden", 711 FULL_SCREEN: "Vollbild", 712 THUMBS: "Vorschaubilder", 713 DOWNLOAD: "Herunterladen", 714 SHARE: "Teilen", 715 ZOOM: "Vergrößern" 716 } 717 } 718 }; 719 720 // Few useful variables and methods 721 // ================================ 722 723 var $W = $(window); 724 var $D = $(document); 725 726 var called = 0; 727 728 // Check if an object is a jQuery object and not a native JavaScript object 729 // ======================================================================== 730 var isQuery = function (obj) { 731 return obj && obj.hasOwnProperty && obj instanceof $; 732 }; 733 734 // Handle multiple browsers for "requestAnimationFrame" and "cancelAnimationFrame" 735 // =============================================================================== 736 var requestAFrame = (function () { 737 return ( 738 window.requestAnimationFrame || 739 window.webkitRequestAnimationFrame || 740 window.mozRequestAnimationFrame || 741 window.oRequestAnimationFrame || 742 // if all else fails, use setTimeout 743 function (callback) { 744 return window.setTimeout(callback, 1000 / 60); 745 } 746 ); 747 })(); 748 749 var cancelAFrame = (function () { 750 return ( 751 window.cancelAnimationFrame || 752 window.webkitCancelAnimationFrame || 753 window.mozCancelAnimationFrame || 754 window.oCancelAnimationFrame || 755 function (id) { 756 window.clearTimeout(id); 757 } 758 ); 759 })(); 760 761 // Detect the supported transition-end event property name 762 // ======================================================= 763 var transitionEnd = (function () { 764 var el = document.createElement("fakeelement"), 765 t; 766 767 var transitions = { 768 transition: "transitionend", 769 OTransition: "oTransitionEnd", 770 MozTransition: "transitionend", 771 WebkitTransition: "webkitTransitionEnd" 772 }; 773 774 for (t in transitions) { 775 if (el.style[t] !== undefined) { 776 return transitions[t]; 777 } 778 } 779 780 return "transitionend"; 781 })(); 782 783 // Force redraw on an element. 784 // This helps in cases where the browser doesn't redraw an updated element properly 785 // ================================================================================ 786 var forceRedraw = function ($el) { 787 return $el && $el.length && $el[0].offsetHeight; 788 }; 789 790 // Exclude array (`buttons`) options from deep merging 791 // =================================================== 792 var mergeOpts = function (opts1, opts2) { 793 var rez = $.extend(true, {}, opts1, opts2); 794 795 $.each(opts2, function (key, value) { 796 if ($.isArray(value)) { 797 rez[key] = value; 798 } 799 }); 800 801 return rez; 802 }; 803 804 // How much of an element is visible in viewport 805 // ============================================= 806 807 var inViewport = function (elem) { 808 var elemCenter, rez; 809 810 if (!elem || elem.ownerDocument !== document) { 811 return false; 812 } 813 814 $(".fancybox-container").css("pointer-events", "none"); 815 816 elemCenter = { 817 x: elem.getBoundingClientRect().left + elem.offsetWidth / 2, 818 y: elem.getBoundingClientRect().top + elem.offsetHeight / 2 819 }; 820 821 rez = document.elementFromPoint(elemCenter.x, elemCenter.y) === elem; 822 823 $(".fancybox-container").css("pointer-events", ""); 824 825 return rez; 826 }; 827 828 // Class definition 829 // ================ 830 831 var FancyBox = function (content, opts, index) { 832 var self = this; 833 834 self.opts = mergeOpts({ 835 index: index 836 }, $.fancybox.defaults); 837 838 if ($.isPlainObject(opts)) { 839 self.opts = mergeOpts(self.opts, opts); 840 } 841 842 if ($.fancybox.isMobile) { 843 self.opts = mergeOpts(self.opts, self.opts.mobile); 844 } 845 846 self.id = self.opts.id || ++called; 847 848 self.currIndex = parseInt(self.opts.index, 10) || 0; 849 self.prevIndex = null; 850 851 self.prevPos = null; 852 self.currPos = 0; 853 854 self.firstRun = true; 855 856 // All group items 857 self.group = []; 858 859 // Existing slides (for current, next and previous gallery items) 860 self.slides = {}; 861 862 // Create group elements 863 self.addContent(content); 864 865 if (!self.group.length) { 866 return; 867 } 868 869 self.init(); 870 }; 871 872 $.extend(FancyBox.prototype, { 873 // Create DOM structure 874 // ==================== 875 876 init: function () { 877 var self = this, 878 firstItem = self.group[self.currIndex], 879 firstItemOpts = firstItem.opts, 880 $container, 881 buttonStr; 882 883 if (firstItemOpts.closeExisting) { 884 $.fancybox.close(true); 885 } 886 887 // Hide scrollbars 888 // =============== 889 890 $("body").addClass("fancybox-active"); 891 892 if ( 893 !$.fancybox.getInstance() && 894 firstItemOpts.hideScrollbar !== false && 895 !$.fancybox.isMobile && 896 document.body.scrollHeight > window.innerHeight 897 ) { 898 $("head").append( 899 '<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:' + 900 (window.innerWidth - document.documentElement.clientWidth) + 901 "px;}</style>" 902 ); 903 904 $("body").addClass("compensate-for-scrollbar"); 905 } 906 907 // Build html markup and set references 908 // ==================================== 909 910 // Build html code for buttons and insert into main template 911 buttonStr = ""; 912 913 $.each(firstItemOpts.buttons, function (index, value) { 914 buttonStr += firstItemOpts.btnTpl[value] || ""; 915 }); 916 917 // Create markup from base template, it will be initially hidden to 918 // avoid unnecessary work like painting while initializing is not complete 919 $container = $( 920 self.translate( 921 self, 922 firstItemOpts.baseTpl 923 .replace("{{buttons}}", buttonStr) 924 .replace("{{arrows}}", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight) 925 ) 926 ) 927 .attr("id", "fancybox-container-" + self.id) 928 .addClass(firstItemOpts.baseClass) 929 .data("FancyBox", self) 930 .appendTo(firstItemOpts.parentEl); 931 932 // Create object holding references to jQuery wrapped nodes 933 self.$refs = { 934 container: $container 935 }; 936 937 ["bg", "inner", "infobar", "toolbar", "stage", "caption", "navigation"].forEach(function (item) { 938 self.$refs[item] = $container.find(".fancybox-" + item); 939 }); 940 941 self.trigger("onInit"); 942 943 // Enable events, deactive previous instances 944 self.activate(); 945 946 // Build slides, load and reveal content 947 self.jumpTo(self.currIndex); 948 }, 949 950 // Simple i18n support - replaces object keys found in template 951 // with corresponding values 952 // ============================================================ 953 954 translate: function (obj, str) { 955 var arr = obj.opts.i18n[obj.opts.lang] || obj.opts.i18n.en; 956 957 return str.replace(/\{\{(\w+)\}\}/g, function (match, n) { 958 return arr[n] === undefined ? match : arr[n]; 959 }); 960 }, 961 962 // Populate current group with fresh content 963 // Check if each object has valid type and content 964 // =============================================== 965 966 addContent: function (content) { 967 var self = this, 968 items = $.makeArray(content), 969 thumbs; 970 971 $.each(items, function (i, item) { 972 var obj = {}, 973 opts = {}, 974 $item, 975 type, 976 found, 977 src, 978 srcParts; 979 980 // Step 1 - Make sure we have an object 981 // ==================================== 982 983 if ($.isPlainObject(item)) { 984 // We probably have manual usage here, something like 985 // $.fancybox.open( [ { src : "image.jpg", type : "image" } ] ) 986 987 obj = item; 988 opts = item.opts || item; 989 } else if ($.type(item) === "object" && $(item).length) { 990 // Here we probably have jQuery collection returned by some selector 991 $item = $(item); 992 993 // Support attributes like `data-options='{"touch" : false}'` and `data-touch='false'` 994 opts = $item.data() || {}; 995 opts = $.extend(true, {}, opts, opts.options); 996 997 // Here we store clicked element 998 opts.$orig = $item; 999 1000 obj.src = self.opts.src || opts.src || $item.attr("href"); 1001 1002 // Assume that simple syntax is used, for example: 1003 // `$.fancybox.open( $("#test"), {} );` 1004 if (!obj.type && !obj.src) { 1005 obj.type = "inline"; 1006 obj.src = item; 1007 } 1008 } else { 1009 // Assume we have a simple html code, for example: 1010 // $.fancybox.open( '<div><h1>Hi!</h1></div>' ); 1011 obj = { 1012 type: "html", 1013 src: item + "" 1014 }; 1015 } 1016 1017 // Each gallery object has full collection of options 1018 obj.opts = $.extend(true, {}, self.opts, opts); 1019 1020 // Do not merge buttons array 1021 if ($.isArray(opts.buttons)) { 1022 obj.opts.buttons = opts.buttons; 1023 } 1024 1025 if ($.fancybox.isMobile && obj.opts.mobile) { 1026 obj.opts = mergeOpts(obj.opts, obj.opts.mobile); 1027 } 1028 1029 // Step 2 - Make sure we have content type, if not - try to guess 1030 // ============================================================== 1031 1032 type = obj.type || obj.opts.type; 1033 src = obj.src || ""; 1034 1035 if (!type && src) { 1036 if ((found = src.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))) { 1037 type = "video"; 1038 1039 if (!obj.opts.video.format) { 1040 obj.opts.video.format = "video/" + (found[1] === "ogv" ? "ogg" : found[1]); 1041 } 1042 } else if (src.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)) { 1043 type = "image"; 1044 } else if (src.match(/\.(pdf)((\?|#).*)?$/i)) { 1045 type = "iframe"; 1046 obj = $.extend(true, obj, { 1047 contentType: "pdf", 1048 opts: { 1049 iframe: { 1050 preload: false 1051 } 1052 } 1053 }); 1054 } else if (src.charAt(0) === "#") { 1055 type = "inline"; 1056 } 1057 } 1058 1059 if (type) { 1060 obj.type = type; 1061 } else { 1062 self.trigger("objectNeedsType", obj); 1063 } 1064 1065 if (!obj.contentType) { 1066 obj.contentType = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1 ? "html" : obj.type; 1067 } 1068 1069 // Step 3 - Some adjustments 1070 // ========================= 1071 1072 obj.index = self.group.length; 1073 1074 if (obj.opts.smallBtn == "auto") { 1075 obj.opts.smallBtn = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1; 1076 } 1077 1078 if (obj.opts.toolbar === "auto") { 1079 obj.opts.toolbar = !obj.opts.smallBtn; 1080 } 1081 1082 // Find thumbnail image, check if exists and if is in the viewport 1083 obj.$thumb = obj.opts.$thumb || null; 1084 1085 if (obj.opts.$trigger && obj.index === self.opts.index) { 1086 obj.$thumb = obj.opts.$trigger.find("img:first"); 1087 1088 if (obj.$thumb.length) { 1089 obj.opts.$orig = obj.opts.$trigger; 1090 } 1091 } 1092 1093 if (!(obj.$thumb && obj.$thumb.length) && obj.opts.$orig) { 1094 obj.$thumb = obj.opts.$orig.find("img:first"); 1095 } 1096 1097 if (obj.$thumb && !obj.$thumb.length) { 1098 obj.$thumb = null; 1099 } 1100 1101 obj.thumb = obj.opts.thumb || (obj.$thumb ? obj.$thumb[0].src : null); 1102 1103 // "caption" is a "special" option, it can be used to customize caption per gallery item 1104 if ($.type(obj.opts.caption) === "function") { 1105 obj.opts.caption = obj.opts.caption.apply(item, [self, obj]); 1106 } 1107 1108 if ($.type(self.opts.caption) === "function") { 1109 obj.opts.caption = self.opts.caption.apply(item, [self, obj]); 1110 } 1111 1112 // Make sure we have caption as a string or jQuery object 1113 if (!(obj.opts.caption instanceof $)) { 1114 obj.opts.caption = obj.opts.caption === undefined ? "" : obj.opts.caption + ""; 1115 } 1116 1117 // Check if url contains "filter" used to filter the content 1118 // Example: "ajax.html #something" 1119 if (obj.type === "ajax") { 1120 srcParts = src.split(/\s+/, 2); 1121 1122 if (srcParts.length > 1) { 1123 obj.src = srcParts.shift(); 1124 1125 obj.opts.filter = srcParts.shift(); 1126 } 1127 } 1128 1129 // Hide all buttons and disable interactivity for modal items 1130 if (obj.opts.modal) { 1131 obj.opts = $.extend(true, obj.opts, { 1132 trapFocus: true, 1133 // Remove buttons 1134 infobar: 0, 1135 toolbar: 0, 1136 1137 smallBtn: 0, 1138 1139 // Disable keyboard navigation 1140 keyboard: 0, 1141 1142 // Disable some modules 1143 slideShow: 0, 1144 fullScreen: 0, 1145 thumbs: 0, 1146 touch: 0, 1147 1148 // Disable click event handlers 1149 clickContent: false, 1150 clickSlide: false, 1151 clickOutside: false, 1152 dblclickContent: false, 1153 dblclickSlide: false, 1154 dblclickOutside: false 1155 }); 1156 } 1157 1158 // Step 4 - Add processed object to group 1159 // ====================================== 1160 1161 self.group.push(obj); 1162 }); 1163 1164 // Update controls if gallery is already opened 1165 if (Object.keys(self.slides).length) { 1166 self.updateControls(); 1167 1168 // Update thumbnails, if needed 1169 thumbs = self.Thumbs; 1170 1171 if (thumbs && thumbs.isActive) { 1172 thumbs.create(); 1173 1174 thumbs.focus(); 1175 } 1176 } 1177 }, 1178 1179 // Attach an event handler functions for: 1180 // - navigation buttons 1181 // - browser scrolling, resizing; 1182 // - focusing 1183 // - keyboard 1184 // - detecting inactivity 1185 // ====================================== 1186 1187 addEvents: function () { 1188 var self = this; 1189 1190 self.removeEvents(); 1191 1192 // Make navigation elements clickable 1193 // ================================== 1194 1195 self.$refs.container 1196 .on("click.fb-close", "[data-fancybox-close]", function (e) { 1197 e.stopPropagation(); 1198 e.preventDefault(); 1199 1200 self.close(e); 1201 }) 1202 .on("touchstart.fb-prev click.fb-prev", "[data-fancybox-prev]", function (e) { 1203 e.stopPropagation(); 1204 e.preventDefault(); 1205 1206 self.previous(); 1207 }) 1208 .on("touchstart.fb-next click.fb-next", "[data-fancybox-next]", function (e) { 1209 e.stopPropagation(); 1210 e.preventDefault(); 1211 1212 self.next(); 1213 }) 1214 .on("click.fb", "[data-fancybox-zoom]", function (e) { 1215 // Click handler for zoom button 1216 self[self.isScaledDown() ? "scaleToActual" : "scaleToFit"](); 1217 }); 1218 1219 // Handle page scrolling and browser resizing 1220 // ========================================== 1221 1222 $W.on("orientationchange.fb resize.fb", function (e) { 1223 if (e && e.originalEvent && e.originalEvent.type === "resize") { 1224 if (self.requestId) { 1225 cancelAFrame(self.requestId); 1226 } 1227 1228 self.requestId = requestAFrame(function () { 1229 self.update(e); 1230 }); 1231 } else { 1232 if (self.current && self.current.type === "iframe") { 1233 self.$refs.stage.hide(); 1234 } 1235 1236 setTimeout( 1237 function () { 1238 self.$refs.stage.show(); 1239 1240 self.update(e); 1241 }, 1242 $.fancybox.isMobile ? 600 : 250 1243 ); 1244 } 1245 }); 1246 1247 $D.on("keydown.fb", function (e) { 1248 var instance = $.fancybox ? $.fancybox.getInstance() : null, 1249 current = instance.current, 1250 keycode = e.keyCode || e.which; 1251 1252 // Trap keyboard focus inside of the modal 1253 // ======================================= 1254 1255 if (keycode == 9) { 1256 if (current.opts.trapFocus) { 1257 self.focus(e); 1258 } 1259 1260 return; 1261 } 1262 1263 // Enable keyboard navigation 1264 // ========================== 1265 1266 if (!current.opts.keyboard || e.ctrlKey || e.altKey || e.shiftKey || $(e.target).is("input,textarea,video,audio,select")) { 1267 return; 1268 } 1269 1270 // Backspace and Esc keys 1271 if (keycode === 8 || keycode === 27) { 1272 e.preventDefault(); 1273 1274 self.close(e); 1275 1276 return; 1277 } 1278 1279 // Left arrow and Up arrow 1280 if (keycode === 37 || keycode === 38) { 1281 e.preventDefault(); 1282 1283 self.previous(); 1284 1285 return; 1286 } 1287 1288 // Righ arrow and Down arrow 1289 if (keycode === 39 || keycode === 40) { 1290 e.preventDefault(); 1291 1292 self.next(); 1293 1294 return; 1295 } 1296 1297 self.trigger("afterKeydown", e, keycode); 1298 }); 1299 1300 // Hide controls after some inactivity period 1301 if (self.group[self.currIndex].opts.idleTime) { 1302 self.idleSecondsCounter = 0; 1303 1304 $D.on( 1305 "mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle", 1306 function (e) { 1307 self.idleSecondsCounter = 0; 1308 1309 if (self.isIdle) { 1310 self.showControls(); 1311 } 1312 1313 self.isIdle = false; 1314 } 1315 ); 1316 1317 self.idleInterval = window.setInterval(function () { 1318 self.idleSecondsCounter++; 1319 1320 if (self.idleSecondsCounter >= self.group[self.currIndex].opts.idleTime && !self.isDragging) { 1321 self.isIdle = true; 1322 self.idleSecondsCounter = 0; 1323 1324 self.hideControls(); 1325 } 1326 }, 1000); 1327 } 1328 }, 1329 1330 // Remove events added by the core 1331 // =============================== 1332 1333 removeEvents: function () { 1334 var self = this; 1335 1336 $W.off("orientationchange.fb resize.fb"); 1337 $D.off("keydown.fb .fb-idle"); 1338 1339 this.$refs.container.off(".fb-close .fb-prev .fb-next"); 1340 1341 if (self.idleInterval) { 1342 window.clearInterval(self.idleInterval); 1343 1344 self.idleInterval = null; 1345 } 1346 }, 1347 1348 // Change to previous gallery item 1349 // =============================== 1350 1351 previous: function (duration) { 1352 return this.jumpTo(this.currPos - 1, duration); 1353 }, 1354 1355 // Change to next gallery item 1356 // =========================== 1357 1358 next: function (duration) { 1359 return this.jumpTo(this.currPos + 1, duration); 1360 }, 1361 1362 // Switch to selected gallery item 1363 // =============================== 1364 1365 jumpTo: function (pos, duration) { 1366 var self = this, 1367 groupLen = self.group.length, 1368 firstRun, 1369 isMoved, 1370 loop, 1371 current, 1372 previous, 1373 slidePos, 1374 stagePos, 1375 prop, 1376 diff; 1377 1378 if (self.isDragging || self.isClosing || (self.isAnimating && self.firstRun)) { 1379 return; 1380 } 1381 1382 // Should loop? 1383 pos = parseInt(pos, 10); 1384 loop = self.current ? self.current.opts.loop : self.opts.loop; 1385 1386 if (!loop && (pos < 0 || pos >= groupLen)) { 1387 return false; 1388 } 1389 1390 // Check if opening for the first time; this helps to speed things up 1391 firstRun = self.firstRun = !Object.keys(self.slides).length; 1392 1393 // Create slides 1394 previous = self.current; 1395 1396 self.prevIndex = self.currIndex; 1397 self.prevPos = self.currPos; 1398 1399 current = self.createSlide(pos); 1400 1401 if (groupLen > 1) { 1402 if (loop || current.index < groupLen - 1) { 1403 self.createSlide(pos + 1); 1404 } 1405 1406 if (loop || current.index > 0) { 1407 self.createSlide(pos - 1); 1408 } 1409 } 1410 1411 self.current = current; 1412 self.currIndex = current.index; 1413 self.currPos = current.pos; 1414 1415 self.trigger("beforeShow", firstRun); 1416 1417 self.updateControls(); 1418 1419 // Validate duration length 1420 current.forcedDuration = undefined; 1421 1422 if ($.isNumeric(duration)) { 1423 current.forcedDuration = duration; 1424 } else { 1425 duration = current.opts[firstRun ? "animationDuration" : "transitionDuration"]; 1426 } 1427 1428 duration = parseInt(duration, 10); 1429 1430 // Check if user has swiped the slides or if still animating 1431 isMoved = self.isMoved(current); 1432 1433 // Make sure current slide is visible 1434 current.$slide.addClass("fancybox-slide--current"); 1435 1436 // Fresh start - reveal container, current slide and start loading content 1437 if (firstRun) { 1438 if (current.opts.animationEffect && duration) { 1439 self.$refs.container.css("transition-duration", duration + "ms"); 1440 } 1441 1442 self.$refs.container.addClass("fancybox-is-open").trigger("focus"); 1443 1444 // Attempt to load content into slide 1445 // This will later call `afterLoad` -> `revealContent` 1446 self.loadSlide(current); 1447 1448 self.preload("image"); 1449 1450 return; 1451 } 1452 1453 // Get actual slide/stage positions (before cleaning up) 1454 slidePos = $.fancybox.getTranslate(previous.$slide); 1455 stagePos = $.fancybox.getTranslate(self.$refs.stage); 1456 1457 // Clean up all slides 1458 $.each(self.slides, function (index, slide) { 1459 $.fancybox.stop(slide.$slide, true); 1460 }); 1461 1462 if (previous.pos !== current.pos) { 1463 previous.isComplete = false; 1464 } 1465 1466 previous.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"); 1467 1468 // If slides are out of place, then animate them to correct position 1469 if (isMoved) { 1470 // Calculate horizontal swipe distance 1471 diff = slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter); 1472 1473 $.each(self.slides, function (index, slide) { 1474 slide.$slide.removeClass("fancybox-animated").removeClass(function (index, className) { 1475 return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" "); 1476 }); 1477 1478 // Make sure that each slide is in equal distance 1479 // This is mostly needed for freshly added slides, because they are not yet positioned 1480 var leftPos = slide.pos * slidePos.width + slide.pos * slide.opts.gutter; 1481 1482 $.fancybox.setTranslate(slide.$slide, { 1483 top: 0, 1484 left: leftPos - stagePos.left + diff 1485 }); 1486 1487 if (slide.pos !== current.pos) { 1488 slide.$slide.addClass("fancybox-slide--" + (slide.pos > current.pos ? "next" : "previous")); 1489 } 1490 1491 // Redraw to make sure that transition will start 1492 forceRedraw(slide.$slide); 1493 1494 // Animate the slide 1495 $.fancybox.animate( 1496 slide.$slide, { 1497 top: 0, 1498 left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter 1499 }, 1500 duration, 1501 function () { 1502 slide.$slide 1503 .css({ 1504 transform: "", 1505 opacity: "" 1506 }) 1507 .removeClass("fancybox-slide--next fancybox-slide--previous"); 1508 1509 if (slide.pos === self.currPos) { 1510 self.complete(); 1511 } 1512 } 1513 ); 1514 }); 1515 } else if (duration && current.opts.transitionEffect) { 1516 // Set transition effect for previously active slide 1517 prop = "fancybox-animated fancybox-fx-" + current.opts.transitionEffect; 1518 1519 previous.$slide.addClass("fancybox-slide--" + (previous.pos > current.pos ? "next" : "previous")); 1520 1521 $.fancybox.animate( 1522 previous.$slide, 1523 prop, 1524 duration, 1525 function () { 1526 previous.$slide.removeClass(prop).removeClass("fancybox-slide--next fancybox-slide--previous"); 1527 }, 1528 false 1529 ); 1530 } 1531 1532 if (current.isLoaded) { 1533 self.revealContent(current); 1534 } else { 1535 self.loadSlide(current); 1536 } 1537 1538 self.preload("image"); 1539 }, 1540 1541 // Create new "slide" element 1542 // These are gallery items that are actually added to DOM 1543 // ======================================================= 1544 1545 createSlide: function (pos) { 1546 var self = this, 1547 $slide, 1548 index; 1549 1550 index = pos % self.group.length; 1551 index = index < 0 ? self.group.length + index : index; 1552 1553 if (!self.slides[pos] && self.group[index]) { 1554 $slide = $('<div class="fancybox-slide"></div>').appendTo(self.$refs.stage); 1555 1556 self.slides[pos] = $.extend(true, {}, self.group[index], { 1557 pos: pos, 1558 $slide: $slide, 1559 isLoaded: false 1560 }); 1561 1562 self.updateSlide(self.slides[pos]); 1563 } 1564 1565 return self.slides[pos]; 1566 }, 1567 1568 // Scale image to the actual size of the image; 1569 // x and y values should be relative to the slide 1570 // ============================================== 1571 1572 scaleToActual: function (x, y, duration) { 1573 var self = this, 1574 current = self.current, 1575 $content = current.$content, 1576 canvasWidth = $.fancybox.getTranslate(current.$slide).width, 1577 canvasHeight = $.fancybox.getTranslate(current.$slide).height, 1578 newImgWidth = current.width, 1579 newImgHeight = current.height, 1580 imgPos, 1581 posX, 1582 posY, 1583 scaleX, 1584 scaleY; 1585 1586 if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) { 1587 return; 1588 } 1589 1590 self.isAnimating = true; 1591 1592 $.fancybox.stop($content); 1593 1594 x = x === undefined ? canvasWidth * 0.5 : x; 1595 y = y === undefined ? canvasHeight * 0.5 : y; 1596 1597 imgPos = $.fancybox.getTranslate($content); 1598 1599 imgPos.top -= $.fancybox.getTranslate(current.$slide).top; 1600 imgPos.left -= $.fancybox.getTranslate(current.$slide).left; 1601 1602 scaleX = newImgWidth / imgPos.width; 1603 scaleY = newImgHeight / imgPos.height; 1604 1605 // Get center position for original image 1606 posX = canvasWidth * 0.5 - newImgWidth * 0.5; 1607 posY = canvasHeight * 0.5 - newImgHeight * 0.5; 1608 1609 // Make sure image does not move away from edges 1610 if (newImgWidth > canvasWidth) { 1611 posX = imgPos.left * scaleX - (x * scaleX - x); 1612 1613 if (posX > 0) { 1614 posX = 0; 1615 } 1616 1617 if (posX < canvasWidth - newImgWidth) { 1618 posX = canvasWidth - newImgWidth; 1619 } 1620 } 1621 1622 if (newImgHeight > canvasHeight) { 1623 posY = imgPos.top * scaleY - (y * scaleY - y); 1624 1625 if (posY > 0) { 1626 posY = 0; 1627 } 1628 1629 if (posY < canvasHeight - newImgHeight) { 1630 posY = canvasHeight - newImgHeight; 1631 } 1632 } 1633 1634 self.updateCursor(newImgWidth, newImgHeight); 1635 1636 $.fancybox.animate( 1637 $content, { 1638 top: posY, 1639 left: posX, 1640 scaleX: scaleX, 1641 scaleY: scaleY 1642 }, 1643 duration || 366, 1644 function () { 1645 self.isAnimating = false; 1646 } 1647 ); 1648 1649 // Stop slideshow 1650 if (self.SlideShow && self.SlideShow.isActive) { 1651 self.SlideShow.stop(); 1652 } 1653 }, 1654 1655 // Scale image to fit inside parent element 1656 // ======================================== 1657 1658 scaleToFit: function (duration) { 1659 var self = this, 1660 current = self.current, 1661 $content = current.$content, 1662 end; 1663 1664 if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) { 1665 return; 1666 } 1667 1668 self.isAnimating = true; 1669 1670 $.fancybox.stop($content); 1671 1672 end = self.getFitPos(current); 1673 1674 self.updateCursor(end.width, end.height); 1675 1676 $.fancybox.animate( 1677 $content, { 1678 top: end.top, 1679 left: end.left, 1680 scaleX: end.width / $content.width(), 1681 scaleY: end.height / $content.height() 1682 }, 1683 duration || 366, 1684 function () { 1685 self.isAnimating = false; 1686 } 1687 ); 1688 }, 1689 1690 // Calculate image size to fit inside viewport 1691 // =========================================== 1692 1693 getFitPos: function (slide) { 1694 var self = this, 1695 $content = slide.$content, 1696 $slide = slide.$slide, 1697 width = slide.width || slide.opts.width, 1698 height = slide.height || slide.opts.height, 1699 maxWidth, 1700 maxHeight, 1701 minRatio, 1702 aspectRatio, 1703 rez = {}; 1704 1705 if (!slide.isLoaded || !$content || !$content.length) { 1706 return false; 1707 } 1708 1709 maxWidth = $.fancybox.getTranslate(self.$refs.stage).width; 1710 maxHeight = $.fancybox.getTranslate(self.$refs.stage).height; 1711 1712 maxWidth -= 1713 parseFloat($slide.css("paddingLeft")) + 1714 parseFloat($slide.css("paddingRight")) + 1715 parseFloat($content.css("marginLeft")) + 1716 parseFloat($content.css("marginRight")); 1717 1718 maxHeight -= 1719 parseFloat($slide.css("paddingTop")) + 1720 parseFloat($slide.css("paddingBottom")) + 1721 parseFloat($content.css("marginTop")) + 1722 parseFloat($content.css("marginBottom")); 1723 1724 if (!width || !height) { 1725 width = maxWidth; 1726 height = maxHeight; 1727 } 1728 1729 minRatio = Math.min(1, maxWidth / width, maxHeight / height); 1730 1731 width = minRatio * width; 1732 height = minRatio * height; 1733 1734 // Adjust width/height to precisely fit into container 1735 if (width > maxWidth - 0.5) { 1736 width = maxWidth; 1737 } 1738 1739 if (height > maxHeight - 0.5) { 1740 height = maxHeight; 1741 } 1742 1743 if (slide.type === "image") { 1744 rez.top = Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css("paddingTop")); 1745 rez.left = Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css("paddingLeft")); 1746 } else if (slide.contentType === "video") { 1747 // Force aspect ratio for the video 1748 // "I say the whole world must learn of our peaceful ways… by force!" 1749 aspectRatio = slide.opts.width && slide.opts.height ? width / height : slide.opts.ratio || 16 / 9; 1750 1751 if (height > width / aspectRatio) { 1752 height = width / aspectRatio; 1753 } else if (width > height * aspectRatio) { 1754 width = height * aspectRatio; 1755 } 1756 } 1757 1758 rez.width = width; 1759 rez.height = height; 1760 1761 return rez; 1762 }, 1763 1764 // Update content size and position for all slides 1765 // ============================================== 1766 1767 update: function (e) { 1768 var self = this; 1769 1770 $.each(self.slides, function (key, slide) { 1771 self.updateSlide(slide, e); 1772 }); 1773 }, 1774 1775 // Update slide content position and size 1776 // ====================================== 1777 1778 updateSlide: function (slide, e) { 1779 var self = this, 1780 $content = slide && slide.$content, 1781 width = slide.width || slide.opts.width, 1782 height = slide.height || slide.opts.height, 1783 $slide = slide.$slide; 1784 1785 // First, prevent caption overlap, if needed 1786 self.adjustCaption(slide); 1787 1788 // Then resize content to fit inside the slide 1789 if ($content && (width || height || slide.contentType === "video") && !slide.hasError) { 1790 $.fancybox.stop($content); 1791 1792 $.fancybox.setTranslate($content, self.getFitPos(slide)); 1793 1794 if (slide.pos === self.currPos) { 1795 self.isAnimating = false; 1796 1797 self.updateCursor(); 1798 } 1799 } 1800 1801 // Then some adjustments 1802 self.adjustLayout(slide); 1803 1804 if ($slide.length) { 1805 $slide.trigger("refresh"); 1806 1807 if (slide.pos === self.currPos) { 1808 self.$refs.toolbar 1809 .add(self.$refs.navigation.find(".fancybox-button--arrow_right")) 1810 .toggleClass("compensate-for-scrollbar", $slide.get(0).scrollHeight > $slide.get(0).clientHeight); 1811 } 1812 } 1813 1814 self.trigger("onUpdate", slide, e); 1815 }, 1816 1817 // Horizontally center slide 1818 // ========================= 1819 1820 centerSlide: function (duration) { 1821 var self = this, 1822 current = self.current, 1823 $slide = current.$slide; 1824 1825 if (self.isClosing || !current) { 1826 return; 1827 } 1828 1829 $slide.siblings().css({ 1830 transform: "", 1831 opacity: "" 1832 }); 1833 1834 $slide 1835 .parent() 1836 .children() 1837 .removeClass("fancybox-slide--previous fancybox-slide--next"); 1838 1839 $.fancybox.animate( 1840 $slide, { 1841 top: 0, 1842 left: 0, 1843 opacity: 1 1844 }, 1845 duration === undefined ? 0 : duration, 1846 function () { 1847 // Clean up 1848 $slide.css({ 1849 transform: "", 1850 opacity: "" 1851 }); 1852 1853 if (!current.isComplete) { 1854 self.complete(); 1855 } 1856 }, 1857 false 1858 ); 1859 }, 1860 1861 // Check if current slide is moved (swiped) 1862 // ======================================== 1863 1864 isMoved: function (slide) { 1865 var current = slide || this.current, 1866 slidePos, 1867 stagePos; 1868 1869 if (!current) { 1870 return false; 1871 } 1872 1873 stagePos = $.fancybox.getTranslate(this.$refs.stage); 1874 slidePos = $.fancybox.getTranslate(current.$slide); 1875 1876 return ( 1877 !current.$slide.hasClass("fancybox-animated") && 1878 (Math.abs(slidePos.top - stagePos.top) > 0.5 || Math.abs(slidePos.left - stagePos.left) > 0.5) 1879 ); 1880 }, 1881 1882 // Update cursor style depending if content can be zoomed 1883 // ====================================================== 1884 1885 updateCursor: function (nextWidth, nextHeight) { 1886 var self = this, 1887 current = self.current, 1888 $container = self.$refs.container, 1889 canPan, 1890 isZoomable; 1891 1892 if (!current || self.isClosing || !self.Guestures) { 1893 return; 1894 } 1895 1896 $container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"); 1897 1898 canPan = self.canPan(nextWidth, nextHeight); 1899 1900 isZoomable = canPan ? true : self.isZoomable(); 1901 1902 $container.toggleClass("fancybox-is-zoomable", isZoomable); 1903 1904 $("[data-fancybox-zoom]").prop("disabled", !isZoomable); 1905 1906 if (canPan) { 1907 $container.addClass("fancybox-can-pan"); 1908 } else if ( 1909 isZoomable && 1910 (current.opts.clickContent === "zoom" || ($.isFunction(current.opts.clickContent) && current.opts.clickContent(current) == "zoom")) 1911 ) { 1912 $container.addClass("fancybox-can-zoomIn"); 1913 } else if (current.opts.touch && (current.opts.touch.vertical || self.group.length > 1) && current.contentType !== "video") { 1914 $container.addClass("fancybox-can-swipe"); 1915 } 1916 }, 1917 1918 // Check if current slide is zoomable 1919 // ================================== 1920 1921 isZoomable: function () { 1922 var self = this, 1923 current = self.current, 1924 fitPos; 1925 1926 // Assume that slide is zoomable if: 1927 // - image is still loading 1928 // - actual size of the image is smaller than available area 1929 if (current && !self.isClosing && current.type === "image" && !current.hasError) { 1930 if (!current.isLoaded) { 1931 return true; 1932 } 1933 1934 fitPos = self.getFitPos(current); 1935 1936 if (fitPos && (current.width > fitPos.width || current.height > fitPos.height)) { 1937 return true; 1938 } 1939 } 1940 1941 return false; 1942 }, 1943 1944 // Check if current image dimensions are smaller than actual 1945 // ========================================================= 1946 1947 isScaledDown: function (nextWidth, nextHeight) { 1948 var self = this, 1949 rez = false, 1950 current = self.current, 1951 $content = current.$content; 1952 1953 if (nextWidth !== undefined && nextHeight !== undefined) { 1954 rez = nextWidth < current.width && nextHeight < current.height; 1955 } else if ($content) { 1956 rez = $.fancybox.getTranslate($content); 1957 rez = rez.width < current.width && rez.height < current.height; 1958 } 1959 1960 return rez; 1961 }, 1962 1963 // Check if image dimensions exceed parent element 1964 // =============================================== 1965 1966 canPan: function (nextWidth, nextHeight) { 1967 var self = this, 1968 current = self.current, 1969 pos = null, 1970 rez = false; 1971 1972 if (current.type === "image" && (current.isComplete || (nextWidth && nextHeight)) && !current.hasError) { 1973 rez = self.getFitPos(current); 1974 1975 if (nextWidth !== undefined && nextHeight !== undefined) { 1976 pos = { 1977 width: nextWidth, 1978 height: nextHeight 1979 }; 1980 } else if (current.isComplete) { 1981 pos = $.fancybox.getTranslate(current.$content); 1982 } 1983 1984 if (pos && rez) { 1985 rez = Math.abs(pos.width - rez.width) > 1.5 || Math.abs(pos.height - rez.height) > 1.5; 1986 } 1987 } 1988 1989 return rez; 1990 }, 1991 1992 // Load content into the slide 1993 // =========================== 1994 1995 loadSlide: function (slide) { 1996 var self = this, 1997 type, 1998 $slide, 1999 ajaxLoad; 2000 2001 if (slide.isLoading || slide.isLoaded) { 2002 return; 2003 } 2004 2005 slide.isLoading = true; 2006 2007 if (self.trigger("beforeLoad", slide) === false) { 2008 slide.isLoading = false; 2009 2010 return false; 2011 } 2012 2013 type = slide.type; 2014 $slide = slide.$slide; 2015 2016 $slide 2017 .off("refresh") 2018 .trigger("onReset") 2019 .addClass(slide.opts.slideClass); 2020 2021 // Create content depending on the type 2022 switch (type) { 2023 case "image": 2024 self.setImage(slide); 2025 2026 break; 2027 2028 case "iframe": 2029 self.setIframe(slide); 2030 2031 break; 2032 2033 case "html": 2034 self.setContent(slide, slide.src || slide.content); 2035 2036 break; 2037 2038 case "video": 2039 self.setContent( 2040 slide, 2041 slide.opts.video.tpl 2042 .replace(/\{\{src\}\}/gi, slide.src) 2043 .replace("{{format}}", slide.opts.videoFormat || slide.opts.video.format || "") 2044 .replace("{{poster}}", slide.thumb || "") 2045 ); 2046 2047 break; 2048 2049 case "inline": 2050 if ($(slide.src).length) { 2051 self.setContent(slide, $(slide.src)); 2052 } else { 2053 self.setError(slide); 2054 } 2055 2056 break; 2057 2058 case "ajax": 2059 self.showLoading(slide); 2060 2061 ajaxLoad = $.ajax( 2062 $.extend({}, slide.opts.ajax.settings, { 2063 url: slide.src, 2064 success: function (data, textStatus) { 2065 if (textStatus === "success") { 2066 self.setContent(slide, data); 2067 } 2068 }, 2069 error: function (jqXHR, textStatus) { 2070 if (jqXHR && textStatus !== "abort") { 2071 self.setError(slide); 2072 } 2073 } 2074 }) 2075 ); 2076 2077 $slide.one("onReset", function () { 2078 ajaxLoad.abort(); 2079 }); 2080 2081 break; 2082 2083 default: 2084 self.setError(slide); 2085 2086 break; 2087 } 2088 2089 return true; 2090 }, 2091 2092 // Use thumbnail image, if possible 2093 // ================================ 2094 2095 setImage: function (slide) { 2096 var self = this, 2097 ghost; 2098 2099 // Check if need to show loading icon 2100 setTimeout(function () { 2101 var $img = slide.$image; 2102 2103 if (!self.isClosing && slide.isLoading && (!$img || !$img.length || !$img[0].complete) && !slide.hasError) { 2104 self.showLoading(slide); 2105 } 2106 }, 50); 2107 2108 //Check if image has srcset 2109 self.checkSrcset(slide); 2110 2111 // This will be wrapper containing both ghost and actual image 2112 slide.$content = $('<div class="fancybox-content"></div>') 2113 .addClass("fancybox-is-hidden") 2114 .appendTo(slide.$slide.addClass("fancybox-slide--image")); 2115 2116 // If we have a thumbnail, we can display it while actual image is loading 2117 // Users will not stare at black screen and actual image will appear gradually 2118 if (slide.opts.preload !== false && slide.opts.width && slide.opts.height && slide.thumb) { 2119 slide.width = slide.opts.width; 2120 slide.height = slide.opts.height; 2121 2122 ghost = document.createElement("img"); 2123 2124 ghost.onerror = function () { 2125 $(this).remove(); 2126 2127 slide.$ghost = null; 2128 }; 2129 2130 ghost.onload = function () { 2131 self.afterLoad(slide); 2132 }; 2133 2134 slide.$ghost = $(ghost) 2135 .addClass("fancybox-image") 2136 .appendTo(slide.$content) 2137 .attr("src", slide.thumb); 2138 } 2139 2140 // Start loading actual image 2141 self.setBigImage(slide); 2142 }, 2143 2144 // Check if image has srcset and get the source 2145 // ============================================ 2146 checkSrcset: function (slide) { 2147 var srcset = slide.opts.srcset || slide.opts.image.srcset, 2148 found, 2149 temp, 2150 pxRatio, 2151 windowWidth; 2152 2153 // If we have "srcset", then we need to find first matching "src" value. 2154 // This is necessary, because when you set an src attribute, the browser will preload the image 2155 // before any javascript or even CSS is applied. 2156 if (srcset) { 2157 pxRatio = window.devicePixelRatio || 1; 2158 windowWidth = window.innerWidth * pxRatio; 2159 2160 temp = srcset.split(",").map(function (el) { 2161 var ret = {}; 2162 2163 el.trim() 2164 .split(/\s+/) 2165 .forEach(function (el, i) { 2166 var value = parseInt(el.substring(0, el.length - 1), 10); 2167 2168 if (i === 0) { 2169 return (ret.url = el); 2170 } 2171 2172 if (value) { 2173 ret.value = value; 2174 ret.postfix = el[el.length - 1]; 2175 } 2176 }); 2177 2178 return ret; 2179 }); 2180 2181 // Sort by value 2182 temp.sort(function (a, b) { 2183 return a.value - b.value; 2184 }); 2185 2186 // Ok, now we have an array of all srcset values 2187 for (var j = 0; j < temp.length; j++) { 2188 var el = temp[j]; 2189 2190 if ((el.postfix === "w" && el.value >= windowWidth) || (el.postfix === "x" && el.value >= pxRatio)) { 2191 found = el; 2192 break; 2193 } 2194 } 2195 2196 // If not found, take the last one 2197 if (!found && temp.length) { 2198 found = temp[temp.length - 1]; 2199 } 2200 2201 if (found) { 2202 slide.src = found.url; 2203 2204 // If we have default width/height values, we can calculate height for matching source 2205 if (slide.width && slide.height && found.postfix == "w") { 2206 slide.height = (slide.width / slide.height) * found.value; 2207 slide.width = found.value; 2208 } 2209 2210 slide.opts.srcset = srcset; 2211 } 2212 } 2213 }, 2214 2215 // Create full-size image 2216 // ====================== 2217 2218 setBigImage: function (slide) { 2219 var self = this, 2220 img = document.createElement("img"), 2221 $img = $(img); 2222 2223 slide.$image = $img 2224 .one("error", function () { 2225 self.setError(slide); 2226 }) 2227 .one("load", function () { 2228 var sizes; 2229 2230 if (!slide.$ghost) { 2231 self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight); 2232 2233 self.afterLoad(slide); 2234 } 2235 2236 if (self.isClosing) { 2237 return; 2238 } 2239 2240 if (slide.opts.srcset) { 2241 sizes = slide.opts.sizes; 2242 2243 if (!sizes || sizes === "auto") { 2244 sizes = 2245 (slide.width / slide.height > 1 && $W.width() / $W.height() > 1 ? "100" : Math.round((slide.width / slide.height) * 100)) + 2246 "vw"; 2247 } 2248 2249 $img.attr("sizes", sizes).attr("srcset", slide.opts.srcset); 2250 } 2251 2252 // Hide temporary image after some delay 2253 if (slide.$ghost) { 2254 setTimeout(function () { 2255 if (slide.$ghost && !self.isClosing) { 2256 slide.$ghost.hide(); 2257 } 2258 }, Math.min(300, Math.max(1000, slide.height / 1600))); 2259 } 2260 2261 self.hideLoading(slide); 2262 }) 2263 .addClass("fancybox-image") 2264 .attr("src", slide.src) 2265 .appendTo(slide.$content); 2266 2267 if ((img.complete || img.readyState == "complete") && $img.naturalWidth && $img.naturalHeight) { 2268 $img.trigger("load"); 2269 } else if (img.error) { 2270 $img.trigger("error"); 2271 } 2272 }, 2273 2274 // Computes the slide size from image size and maxWidth/maxHeight 2275 // ============================================================== 2276 2277 resolveImageSlideSize: function (slide, imgWidth, imgHeight) { 2278 var maxWidth = parseInt(slide.opts.width, 10), 2279 maxHeight = parseInt(slide.opts.height, 10); 2280 2281 // Sets the default values from the image 2282 slide.width = imgWidth; 2283 slide.height = imgHeight; 2284 2285 if (maxWidth > 0) { 2286 slide.width = maxWidth; 2287 slide.height = Math.floor((maxWidth * imgHeight) / imgWidth); 2288 } 2289 2290 if (maxHeight > 0) { 2291 slide.width = Math.floor((maxHeight * imgWidth) / imgHeight); 2292 slide.height = maxHeight; 2293 } 2294 }, 2295 2296 // Create iframe wrapper, iframe and bindings 2297 // ========================================== 2298 2299 setIframe: function (slide) { 2300 var self = this, 2301 opts = slide.opts.iframe, 2302 $slide = slide.$slide, 2303 $iframe; 2304 2305 slide.$content = $('<div class="fancybox-content' + (opts.preload ? " fancybox-is-hidden" : "") + '"></div>') 2306 .css(opts.css) 2307 .appendTo($slide); 2308 2309 $slide.addClass("fancybox-slide--" + slide.contentType); 2310 2311 slide.$iframe = $iframe = $(opts.tpl.replace(/\{rnd\}/g, new Date().getTime())) 2312 .attr(opts.attr) 2313 .appendTo(slide.$content); 2314 2315 if (opts.preload) { 2316 self.showLoading(slide); 2317 2318 // Unfortunately, it is not always possible to determine if iframe is successfully loaded 2319 // (due to browser security policy) 2320 2321 $iframe.on("load.fb error.fb", function (e) { 2322 this.isReady = 1; 2323 2324 slide.$slide.trigger("refresh"); 2325 2326 self.afterLoad(slide); 2327 }); 2328 2329 // Recalculate iframe content size 2330 // =============================== 2331 2332 $slide.on("refresh.fb", function () { 2333 var $content = slide.$content, 2334 frameWidth = opts.css.width, 2335 frameHeight = opts.css.height, 2336 $contents, 2337 $body; 2338 2339 if ($iframe[0].isReady !== 1) { 2340 return; 2341 } 2342 2343 try { 2344 $contents = $iframe.contents(); 2345 $body = $contents.find("body"); 2346 } catch (ignore) {} 2347 2348 // Calculate content dimensions, if it is accessible 2349 if ($body && $body.length && $body.children().length) { 2350 // Avoid scrolling to top (if multiple instances) 2351 $slide.css("overflow", "visible"); 2352 2353 $content.css({ 2354 width: "100%", 2355 "max-width": "100%", 2356 height: "9999px" 2357 }); 2358 2359 if (frameWidth === undefined) { 2360 frameWidth = Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true))); 2361 } 2362 2363 $content.css("width", frameWidth ? frameWidth : "").css("max-width", ""); 2364 2365 if (frameHeight === undefined) { 2366 frameHeight = Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true))); 2367 } 2368 2369 $content.css("height", frameHeight ? frameHeight : ""); 2370 2371 $slide.css("overflow", "auto"); 2372 } 2373 2374 $content.removeClass("fancybox-is-hidden"); 2375 }); 2376 } else { 2377 self.afterLoad(slide); 2378 } 2379 2380 $iframe.attr("src", slide.src); 2381 2382 // Remove iframe if closing or changing gallery item 2383 $slide.one("onReset", function () { 2384 // This helps IE not to throw errors when closing 2385 try { 2386 $(this) 2387 .find("iframe") 2388 .hide() 2389 .unbind() 2390 .attr("src", "//about:blank"); 2391 } catch (ignore) {} 2392 2393 $(this) 2394 .off("refresh.fb") 2395 .empty(); 2396 2397 slide.isLoaded = false; 2398 slide.isRevealed = false; 2399 }); 2400 }, 2401 2402 // Wrap and append content to the slide 2403 // ====================================== 2404 2405 setContent: function (slide, content) { 2406 var self = this; 2407 2408 if (self.isClosing) { 2409 return; 2410 } 2411 2412 self.hideLoading(slide); 2413 2414 if (slide.$content) { 2415 $.fancybox.stop(slide.$content); 2416 } 2417 2418 slide.$slide.empty(); 2419 2420 // If content is a jQuery object, then it will be moved to the slide. 2421 // The placeholder is created so we will know where to put it back. 2422 if (isQuery(content) && content.parent().length) { 2423 // Make sure content is not already moved to fancyBox 2424 if (content.hasClass("fancybox-content") || content.parent().hasClass("fancybox-content")) { 2425 content.parents(".fancybox-slide").trigger("onReset"); 2426 } 2427 2428 // Create temporary element marking original place of the content 2429 slide.$placeholder = $("<div>") 2430 .hide() 2431 .insertAfter(content); 2432 2433 // Make sure content is visible 2434 content.css("display", "inline-block"); 2435 } else if (!slide.hasError) { 2436 // If content is just a plain text, try to convert it to html 2437 if ($.type(content) === "string") { 2438 content = $("<div>") 2439 .append($.trim(content)) 2440 .contents(); 2441 } 2442 2443 // If "filter" option is provided, then filter content 2444 if (slide.opts.filter) { 2445 content = $("<div>") 2446 .html(content) 2447 .find(slide.opts.filter); 2448 } 2449 } 2450 2451 slide.$slide.one("onReset", function () { 2452 // Pause all html5 video/audio 2453 $(this) 2454 .find("video,audio") 2455 .trigger("pause"); 2456 2457 // Put content back 2458 if (slide.$placeholder) { 2459 slide.$placeholder.after(content.removeClass("fancybox-content").hide()).remove(); 2460 2461 slide.$placeholder = null; 2462 } 2463 2464 // Remove custom close button 2465 if (slide.$smallBtn) { 2466 slide.$smallBtn.remove(); 2467 2468 slide.$smallBtn = null; 2469 } 2470 2471 // Remove content and mark slide as not loaded 2472 if (!slide.hasError) { 2473 $(this).empty(); 2474 2475 slide.isLoaded = false; 2476 slide.isRevealed = false; 2477 } 2478 }); 2479 2480 $(content).appendTo(slide.$slide); 2481 2482 if ($(content).is("video,audio")) { 2483 $(content).addClass("fancybox-video"); 2484 2485 $(content).wrap("<div></div>"); 2486 2487 slide.contentType = "video"; 2488 2489 slide.opts.width = slide.opts.width || $(content).attr("width"); 2490 slide.opts.height = slide.opts.height || $(content).attr("height"); 2491 } 2492 2493 slide.$content = slide.$slide 2494 .children() 2495 .filter("div,form,main,video,audio,article,.fancybox-content") 2496 .first(); 2497 2498 slide.$content.siblings().hide(); 2499 2500 // Re-check if there is a valid content 2501 // (in some cases, ajax response can contain various elements or plain text) 2502 if (!slide.$content.length) { 2503 slide.$content = slide.$slide 2504 .wrapInner("<div></div>") 2505 .children() 2506 .first(); 2507 } 2508 2509 slide.$content.addClass("fancybox-content"); 2510 2511 slide.$slide.addClass("fancybox-slide--" + slide.contentType); 2512 2513 self.afterLoad(slide); 2514 }, 2515 2516 // Display error message 2517 // ===================== 2518 2519 setError: function (slide) { 2520 slide.hasError = true; 2521 2522 slide.$slide 2523 .trigger("onReset") 2524 .removeClass("fancybox-slide--" + slide.contentType) 2525 .addClass("fancybox-slide--error"); 2526 2527 slide.contentType = "html"; 2528 2529 this.setContent(slide, this.translate(slide, slide.opts.errorTpl)); 2530 2531 if (slide.pos === this.currPos) { 2532 this.isAnimating = false; 2533 } 2534 }, 2535 2536 // Show loading icon inside the slide 2537 // ================================== 2538 2539 showLoading: function (slide) { 2540 var self = this; 2541 2542 slide = slide || self.current; 2543 2544 if (slide && !slide.$spinner) { 2545 slide.$spinner = $(self.translate(self, self.opts.spinnerTpl)) 2546 .appendTo(slide.$slide) 2547 .hide() 2548 .fadeIn("fast"); 2549 } 2550 }, 2551 2552 // Remove loading icon from the slide 2553 // ================================== 2554 2555 hideLoading: function (slide) { 2556 var self = this; 2557 2558 slide = slide || self.current; 2559 2560 if (slide && slide.$spinner) { 2561 slide.$spinner.stop().remove(); 2562 2563 delete slide.$spinner; 2564 } 2565 }, 2566 2567 // Adjustments after slide content has been loaded 2568 // =============================================== 2569 2570 afterLoad: function (slide) { 2571 var self = this; 2572 2573 if (self.isClosing) { 2574 return; 2575 } 2576 2577 slide.isLoading = false; 2578 slide.isLoaded = true; 2579 2580 self.trigger("afterLoad", slide); 2581 2582 self.hideLoading(slide); 2583 2584 // Add small close button 2585 if (slide.opts.smallBtn && (!slide.$smallBtn || !slide.$smallBtn.length)) { 2586 slide.$smallBtn = $(self.translate(slide, slide.opts.btnTpl.smallBtn)).appendTo(slide.$content); 2587 } 2588 2589 // Disable right click 2590 if (slide.opts.protect && slide.$content && !slide.hasError) { 2591 slide.$content.on("contextmenu.fb", function (e) { 2592 if (e.button == 2) { 2593 e.preventDefault(); 2594 } 2595 2596 return true; 2597 }); 2598 2599 // Add fake element on top of the image 2600 // This makes a bit harder for user to select image 2601 if (slide.type === "image") { 2602 $('<div class="fancybox-spaceball"></div>').appendTo(slide.$content); 2603 } 2604 } 2605 2606 self.adjustCaption(slide); 2607 2608 self.adjustLayout(slide); 2609 2610 if (slide.pos === self.currPos) { 2611 self.updateCursor(); 2612 } 2613 2614 self.revealContent(slide); 2615 }, 2616 2617 // Prevent caption overlap, 2618 // fix css inconsistency across browsers 2619 // ===================================== 2620 2621 adjustCaption: function (slide) { 2622 var self = this, 2623 current = slide || self.current, 2624 caption = current.opts.caption, 2625 preventOverlap = current.opts.preventCaptionOverlap, 2626 $caption = self.$refs.caption, 2627 $clone, 2628 captionH = false; 2629 2630 $caption.toggleClass("fancybox-caption--separate", preventOverlap); 2631 2632 if (preventOverlap && caption && caption.length) { 2633 if (current.pos !== self.currPos) { 2634 $clone = $caption.clone().appendTo($caption.parent()); 2635 2636 $clone 2637 .children() 2638 .eq(0) 2639 .empty() 2640 .html(caption); 2641 2642 captionH = $clone.outerHeight(true); 2643 2644 $clone.empty().remove(); 2645 } else if (self.$caption) { 2646 captionH = self.$caption.outerHeight(true); 2647 } 2648 2649 current.$slide.css("padding-bottom", captionH || ""); 2650 } 2651 }, 2652 2653 // Simple hack to fix inconsistency across browsers, described here (affects Edge, too): 2654 // https://bugzilla.mozilla.org/show_bug.cgi?id=748518 2655 // ==================================================================================== 2656 2657 adjustLayout: function (slide) { 2658 var self = this, 2659 current = slide || self.current, 2660 scrollHeight, 2661 marginBottom, 2662 inlinePadding, 2663 actualPadding; 2664 2665 if (current.isLoaded && current.opts.disableLayoutFix !== true) { 2666 current.$content.css("margin-bottom", ""); 2667 2668 // If we would always set margin-bottom for the content, 2669 // then it would potentially break vertical align 2670 if (current.$content.outerHeight() > current.$slide.height() + 0.5) { 2671 inlinePadding = current.$slide[0].style["padding-bottom"]; 2672 actualPadding = current.$slide.css("padding-bottom"); 2673 2674 if (parseFloat(actualPadding) > 0) { 2675 scrollHeight = current.$slide[0].scrollHeight; 2676 2677 current.$slide.css("padding-bottom", 0); 2678 2679 if (Math.abs(scrollHeight - current.$slide[0].scrollHeight) < 1) { 2680 marginBottom = actualPadding; 2681 } 2682 2683 current.$slide.css("padding-bottom", inlinePadding); 2684 } 2685 } 2686 2687 current.$content.css("margin-bottom", marginBottom); 2688 } 2689 }, 2690 2691 // Make content visible 2692 // This method is called right after content has been loaded or 2693 // user navigates gallery and transition should start 2694 // ============================================================ 2695 2696 revealContent: function (slide) { 2697 var self = this, 2698 $slide = slide.$slide, 2699 end = false, 2700 start = false, 2701 isMoved = self.isMoved(slide), 2702 isRevealed = slide.isRevealed, 2703 effect, 2704 effectClassName, 2705 duration, 2706 opacity; 2707 2708 slide.isRevealed = true; 2709 2710 effect = slide.opts[self.firstRun ? "animationEffect" : "transitionEffect"]; 2711 duration = slide.opts[self.firstRun ? "animationDuration" : "transitionDuration"]; 2712 2713 duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10); 2714 2715 if (isMoved || slide.pos !== self.currPos || !duration) { 2716 effect = false; 2717 } 2718 2719 // Check if can zoom 2720 if (effect === "zoom") { 2721 if (slide.pos === self.currPos && duration && slide.type === "image" && !slide.hasError && (start = self.getThumbPos(slide))) { 2722 end = self.getFitPos(slide); 2723 } else { 2724 effect = "fade"; 2725 } 2726 } 2727 2728 // Zoom animation 2729 // ============== 2730 if (effect === "zoom") { 2731 self.isAnimating = true; 2732 2733 end.scaleX = end.width / start.width; 2734 end.scaleY = end.height / start.height; 2735 2736 // Check if we need to animate opacity 2737 opacity = slide.opts.zoomOpacity; 2738 2739 if (opacity == "auto") { 2740 opacity = Math.abs(slide.width / slide.height - start.width / start.height) > 0.1; 2741 } 2742 2743 if (opacity) { 2744 start.opacity = 0.1; 2745 end.opacity = 1; 2746 } 2747 2748 // Draw image at start position 2749 $.fancybox.setTranslate(slide.$content.removeClass("fancybox-is-hidden"), start); 2750 2751 forceRedraw(slide.$content); 2752 2753 // Start animation 2754 $.fancybox.animate(slide.$content, end, duration, function () { 2755 self.isAnimating = false; 2756 2757 self.complete(); 2758 }); 2759 2760 return; 2761 } 2762 2763 self.updateSlide(slide); 2764 2765 // Simply show content if no effect 2766 // ================================ 2767 if (!effect) { 2768 slide.$content.removeClass("fancybox-is-hidden"); 2769 2770 if (!isRevealed && isMoved && slide.type === "image" && !slide.hasError) { 2771 slide.$content.hide().fadeIn("fast"); 2772 } 2773 2774 if (slide.pos === self.currPos) { 2775 self.complete(); 2776 } 2777 2778 return; 2779 } 2780 2781 // Prepare for CSS transiton 2782 // ========================= 2783 $.fancybox.stop($slide); 2784 2785 //effectClassName = "fancybox-animated fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-fx-" + effect; 2786 effectClassName = "fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-animated fancybox-fx-" + effect; 2787 2788 $slide.addClass(effectClassName).removeClass("fancybox-slide--current"); //.addClass(effectClassName); 2789 2790 slide.$content.removeClass("fancybox-is-hidden"); 2791 2792 // Force reflow 2793 forceRedraw($slide); 2794 2795 if (slide.type !== "image") { 2796 slide.$content.hide().show(0); 2797 } 2798 2799 $.fancybox.animate( 2800 $slide, 2801 "fancybox-slide--current", 2802 duration, 2803 function () { 2804 $slide.removeClass(effectClassName).css({ 2805 transform: "", 2806 opacity: "" 2807 }); 2808 2809 if (slide.pos === self.currPos) { 2810 self.complete(); 2811 } 2812 }, 2813 true 2814 ); 2815 }, 2816 2817 // Check if we can and have to zoom from thumbnail 2818 //================================================ 2819 2820 getThumbPos: function (slide) { 2821 var rez = false, 2822 $thumb = slide.$thumb, 2823 thumbPos, 2824 btw, 2825 brw, 2826 bbw, 2827 blw; 2828 2829 if (!$thumb || !inViewport($thumb[0])) { 2830 return false; 2831 } 2832 2833 thumbPos = $.fancybox.getTranslate($thumb); 2834 2835 btw = parseFloat($thumb.css("border-top-width") || 0); 2836 brw = parseFloat($thumb.css("border-right-width") || 0); 2837 bbw = parseFloat($thumb.css("border-bottom-width") || 0); 2838 blw = parseFloat($thumb.css("border-left-width") || 0); 2839 2840 rez = { 2841 top: thumbPos.top + btw, 2842 left: thumbPos.left + blw, 2843 width: thumbPos.width - brw - blw, 2844 height: thumbPos.height - btw - bbw, 2845 scaleX: 1, 2846 scaleY: 1 2847 }; 2848 2849 return thumbPos.width > 0 && thumbPos.height > 0 ? rez : false; 2850 }, 2851 2852 // Final adjustments after current gallery item is moved to position 2853 // and it`s content is loaded 2854 // ================================================================== 2855 2856 complete: function () { 2857 var self = this, 2858 current = self.current, 2859 slides = {}, 2860 $el; 2861 2862 if (self.isMoved() || !current.isLoaded) { 2863 return; 2864 } 2865 2866 if (!current.isComplete) { 2867 current.isComplete = true; 2868 2869 current.$slide.siblings().trigger("onReset"); 2870 2871 self.preload("inline"); 2872 2873 // Trigger any CSS transiton inside the slide 2874 forceRedraw(current.$slide); 2875 2876 current.$slide.addClass("fancybox-slide--complete"); 2877 2878 // Remove unnecessary slides 2879 $.each(self.slides, function (key, slide) { 2880 if (slide.pos >= self.currPos - 1 && slide.pos <= self.currPos + 1) { 2881 slides[slide.pos] = slide; 2882 } else if (slide) { 2883 $.fancybox.stop(slide.$slide); 2884 2885 slide.$slide.off().remove(); 2886 } 2887 }); 2888 2889 self.slides = slides; 2890 } 2891 2892 self.isAnimating = false; 2893 2894 self.updateCursor(); 2895 2896 self.trigger("afterShow"); 2897 2898 // Autoplay first html5 video/audio 2899 if (!!current.opts.video.autoStart) { 2900 current.$slide 2901 .find("video,audio") 2902 .filter(":visible:first") 2903 .trigger("play") 2904 .one("ended", function () { 2905 if (Document.exitFullscreen) { 2906 Document.exitFullscreen(); 2907 } else if (this.webkitExitFullscreen) { 2908 this.webkitExitFullscreen(); 2909 } 2910 2911 self.next(); 2912 }); 2913 } 2914 2915 // Try to focus on the first focusable element 2916 if (current.opts.autoFocus && current.contentType === "html") { 2917 // Look for the first input with autofocus attribute 2918 $el = current.$content.find("input[autofocus]:enabled:visible:first"); 2919 2920 if ($el.length) { 2921 $el.trigger("focus"); 2922 } else { 2923 self.focus(null, true); 2924 } 2925 } 2926 2927 // Avoid jumping 2928 current.$slide.scrollTop(0).scrollLeft(0); 2929 }, 2930 2931 // Preload next and previous slides 2932 // ================================ 2933 2934 preload: function (type) { 2935 var self = this, 2936 prev, 2937 next; 2938 2939 if (self.group.length < 2) { 2940 return; 2941 } 2942 2943 next = self.slides[self.currPos + 1]; 2944 prev = self.slides[self.currPos - 1]; 2945 2946 if (prev && prev.type === type) { 2947 self.loadSlide(prev); 2948 } 2949 2950 if (next && next.type === type) { 2951 self.loadSlide(next); 2952 } 2953 }, 2954 2955 // Try to find and focus on the first focusable element 2956 // ==================================================== 2957 2958 focus: function (e, firstRun) { 2959 var self = this, 2960 focusableStr = [ 2961 "a[href]", 2962 "area[href]", 2963 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 2964 "select:not([disabled]):not([aria-hidden])", 2965 "textarea:not([disabled]):not([aria-hidden])", 2966 "button:not([disabled]):not([aria-hidden])", 2967 "iframe", 2968 "object", 2969 "embed", 2970 "video", 2971 "audio", 2972 "[contenteditable]", 2973 '[tabindex]:not([tabindex^="-"])' 2974 ].join(","), 2975 focusableItems, 2976 focusedItemIndex; 2977 2978 if (self.isClosing) { 2979 return; 2980 } 2981 2982 if (e || !self.current || !self.current.isComplete) { 2983 // Focus on any element inside fancybox 2984 focusableItems = self.$refs.container.find("*:visible"); 2985 } else { 2986 // Focus inside current slide 2987 focusableItems = self.current.$slide.find("*:visible" + (firstRun ? ":not(.fancybox-close-small)" : "")); 2988 } 2989 2990 focusableItems = focusableItems.filter(focusableStr).filter(function () { 2991 return $(this).css("visibility") !== "hidden" && !$(this).hasClass("disabled"); 2992 }); 2993 2994 if (focusableItems.length) { 2995 focusedItemIndex = focusableItems.index(document.activeElement); 2996 2997 if (e && e.shiftKey) { 2998 // Back tab 2999 if (focusedItemIndex < 0 || focusedItemIndex == 0) { 3000 e.preventDefault(); 3001 3002 focusableItems.eq(focusableItems.length - 1).trigger("focus"); 3003 } 3004 } else { 3005 // Outside or Forward tab 3006 if (focusedItemIndex < 0 || focusedItemIndex == focusableItems.length - 1) { 3007 if (e) { 3008 e.preventDefault(); 3009 } 3010 3011 focusableItems.eq(0).trigger("focus"); 3012 } 3013 } 3014 } else { 3015 self.$refs.container.trigger("focus"); 3016 } 3017 }, 3018 3019 // Activates current instance - brings container to the front and enables keyboard, 3020 // notifies other instances about deactivating 3021 // ================================================================================= 3022 3023 activate: function () { 3024 var self = this; 3025 3026 // Deactivate all instances 3027 $(".fancybox-container").each(function () { 3028 var instance = $(this).data("FancyBox"); 3029 3030 // Skip self and closing instances 3031 if (instance && instance.id !== self.id && !instance.isClosing) { 3032 instance.trigger("onDeactivate"); 3033 3034 instance.removeEvents(); 3035 3036 instance.isVisible = false; 3037 } 3038 }); 3039 3040 self.isVisible = true; 3041 3042 if (self.current || self.isIdle) { 3043 self.update(); 3044 3045 self.updateControls(); 3046 } 3047 3048 self.trigger("onActivate"); 3049 3050 self.addEvents(); 3051 }, 3052 3053 // Start closing procedure 3054 // This will start "zoom-out" animation if needed and clean everything up afterwards 3055 // ================================================================================= 3056 3057 close: function (e, d) { 3058 var self = this, 3059 current = self.current, 3060 effect, 3061 duration, 3062 $content, 3063 domRect, 3064 opacity, 3065 start, 3066 end; 3067 3068 var done = function () { 3069 self.cleanUp(e); 3070 }; 3071 3072 if (self.isClosing) { 3073 return false; 3074 } 3075 3076 self.isClosing = true; 3077 3078 // If beforeClose callback prevents closing, make sure content is centered 3079 if (self.trigger("beforeClose", e) === false) { 3080 self.isClosing = false; 3081 3082 requestAFrame(function () { 3083 self.update(); 3084 }); 3085 3086 return false; 3087 } 3088 3089 // Remove all events 3090 // If there are multiple instances, they will be set again by "activate" method 3091 self.removeEvents(); 3092 3093 $content = current.$content; 3094 effect = current.opts.animationEffect; 3095 duration = $.isNumeric(d) ? d : effect ? current.opts.animationDuration : 0; 3096 3097 current.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"); 3098 3099 if (e !== true) { 3100 $.fancybox.stop(current.$slide); 3101 } else { 3102 effect = false; 3103 } 3104 3105 // Remove other slides 3106 current.$slide 3107 .siblings() 3108 .trigger("onReset") 3109 .remove(); 3110 3111 // Trigger animations 3112 if (duration) { 3113 self.$refs.container 3114 .removeClass("fancybox-is-open") 3115 .addClass("fancybox-is-closing") 3116 .css("transition-duration", duration + "ms"); 3117 } 3118 3119 // Clean up 3120 self.hideLoading(current); 3121 3122 self.hideControls(true); 3123 3124 self.updateCursor(); 3125 3126 // Check if possible to zoom-out 3127 if ( 3128 effect === "zoom" && 3129 !($content && duration && current.type === "image" && !self.isMoved() && !current.hasError && (end = self.getThumbPos(current))) 3130 ) { 3131 effect = "fade"; 3132 } 3133 3134 if (effect === "zoom") { 3135 $.fancybox.stop($content); 3136 3137 domRect = $.fancybox.getTranslate($content); 3138 3139 start = { 3140 top: domRect.top, 3141 left: domRect.left, 3142 scaleX: domRect.width / end.width, 3143 scaleY: domRect.height / end.height, 3144 width: end.width, 3145 height: end.height 3146 }; 3147 3148 // Check if we need to animate opacity 3149 opacity = current.opts.zoomOpacity; 3150 3151 if (opacity == "auto") { 3152 opacity = Math.abs(current.width / current.height - end.width / end.height) > 0.1; 3153 } 3154 3155 if (opacity) { 3156 end.opacity = 0; 3157 } 3158 3159 $.fancybox.setTranslate($content, start); 3160 3161 forceRedraw($content); 3162 3163 $.fancybox.animate($content, end, duration, done); 3164 3165 return true; 3166 } 3167 3168 if (effect && duration) { 3169 $.fancybox.animate( 3170 current.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"), 3171 "fancybox-animated fancybox-fx-" + effect, 3172 duration, 3173 done 3174 ); 3175 } else { 3176 // If skip animation 3177 if (e === true) { 3178 setTimeout(done, duration); 3179 } else { 3180 done(); 3181 } 3182 } 3183 3184 return true; 3185 }, 3186 3187 // Final adjustments after removing the instance 3188 // ============================================= 3189 3190 cleanUp: function (e) { 3191 var self = this, 3192 instance, 3193 $focus = self.current.opts.$orig, 3194 x, 3195 y; 3196 3197 self.current.$slide.trigger("onReset"); 3198 3199 self.$refs.container.empty().remove(); 3200 3201 self.trigger("afterClose", e); 3202 3203 // Place back focus 3204 if (!!self.current.opts.backFocus) { 3205 if (!$focus || !$focus.length || !$focus.is(":visible")) { 3206 $focus = self.$trigger; 3207 } 3208 3209 if ($focus && $focus.length) { 3210 x = window.scrollX; 3211 y = window.scrollY; 3212 3213 $focus.trigger("focus"); 3214 3215 $("html, body") 3216 .scrollTop(y) 3217 .scrollLeft(x); 3218 } 3219 } 3220 3221 self.current = null; 3222 3223 // Check if there are other instances 3224 instance = $.fancybox.getInstance(); 3225 3226 if (instance) { 3227 instance.activate(); 3228 } else { 3229 $("body").removeClass("fancybox-active compensate-for-scrollbar"); 3230 3231 $("#fancybox-style-noscroll").remove(); 3232 } 3233 }, 3234 3235 // Call callback and trigger an event 3236 // ================================== 3237 3238 trigger: function (name, slide) { 3239 var args = Array.prototype.slice.call(arguments, 1), 3240 self = this, 3241 obj = slide && slide.opts ? slide : self.current, 3242 rez; 3243 3244 if (obj) { 3245 args.unshift(obj); 3246 } else { 3247 obj = self; 3248 } 3249 3250 args.unshift(self); 3251 3252 if ($.isFunction(obj.opts[name])) { 3253 rez = obj.opts[name].apply(obj, args); 3254 } 3255 3256 if (rez === false) { 3257 return rez; 3258 } 3259 3260 if (name === "afterClose" || !self.$refs) { 3261 $D.trigger(name + ".fb", args); 3262 } else { 3263 self.$refs.container.trigger(name + ".fb", args); 3264 } 3265 }, 3266 3267 // Update infobar values, navigation button states and reveal caption 3268 // ================================================================== 3269 3270 updateControls: function () { 3271 var self = this, 3272 current = self.current, 3273 index = current.index, 3274 $container = self.$refs.container, 3275 $caption = self.$refs.caption, 3276 caption = current.opts.caption; 3277 3278 // Recalculate content dimensions 3279 current.$slide.trigger("refresh"); 3280 3281 // Set caption 3282 if (caption && caption.length) { 3283 self.$caption = $caption; 3284 3285 $caption 3286 .children() 3287 .eq(0) 3288 .html(caption); 3289 } else { 3290 self.$caption = null; 3291 } 3292 3293 if (!self.hasHiddenControls && !self.isIdle) { 3294 self.showControls(); 3295 } 3296 3297 // Update info and navigation elements 3298 $container.find("[data-fancybox-count]").html(self.group.length); 3299 $container.find("[data-fancybox-index]").html(index + 1); 3300 3301 $container.find("[data-fancybox-prev]").prop("disabled", !current.opts.loop && index <= 0); 3302 $container.find("[data-fancybox-next]").prop("disabled", !current.opts.loop && index >= self.group.length - 1); 3303 3304 if (current.type === "image") { 3305 // Re-enable buttons; update download button source 3306 $container 3307 .find("[data-fancybox-zoom]") 3308 .show() 3309 .end() 3310 .find("[data-fancybox-download]") 3311 .attr("href", current.opts.image.src || current.src) 3312 .show(); 3313 } else if (current.opts.toolbar) { 3314 $container.find("[data-fancybox-download],[data-fancybox-zoom]").hide(); 3315 } 3316 3317 // Make sure focus is not on disabled button/element 3318 if ($(document.activeElement).is(":hidden,[disabled]")) { 3319 self.$refs.container.trigger("focus"); 3320 } 3321 }, 3322 3323 // Hide toolbar and caption 3324 // ======================== 3325 3326 hideControls: function (andCaption) { 3327 var self = this, 3328 arr = ["infobar", "toolbar", "nav"]; 3329 3330 if (andCaption || !self.current.opts.preventCaptionOverlap) { 3331 arr.push("caption"); 3332 } 3333 3334 this.$refs.container.removeClass( 3335 arr 3336 .map(function (i) { 3337 return "fancybox-show-" + i; 3338 }) 3339 .join(" ") 3340 ); 3341 3342 this.hasHiddenControls = true; 3343 }, 3344 3345 showControls: function () { 3346 var self = this, 3347 opts = self.current ? self.current.opts : self.opts, 3348 $container = self.$refs.container; 3349 3350 self.hasHiddenControls = false; 3351 self.idleSecondsCounter = 0; 3352 3353 $container 3354 .toggleClass("fancybox-show-toolbar", !!(opts.toolbar && opts.buttons)) 3355 .toggleClass("fancybox-show-infobar", !!(opts.infobar && self.group.length > 1)) 3356 .toggleClass("fancybox-show-caption", !!self.$caption) 3357 .toggleClass("fancybox-show-nav", !!(opts.arrows && self.group.length > 1)) 3358 .toggleClass("fancybox-is-modal", !!opts.modal); 3359 }, 3360 3361 // Toggle toolbar and caption 3362 // ========================== 3363 3364 toggleControls: function () { 3365 if (this.hasHiddenControls) { 3366 this.showControls(); 3367 } else { 3368 this.hideControls(); 3369 } 3370 } 3371 }); 3372 3373 $.fancybox = { 3374 version: "3.5.7", 3375 defaults: defaults, 3376 3377 // Get current instance and execute a command. 3378 // 3379 // Examples of usage: 3380 // 3381 // $instance = $.fancybox.getInstance(); 3382 // $.fancybox.getInstance().jumpTo( 1 ); 3383 // $.fancybox.getInstance( 'jumpTo', 1 ); 3384 // $.fancybox.getInstance( function() { 3385 // console.info( this.currIndex ); 3386 // }); 3387 // ====================================================== 3388 3389 getInstance: function (command) { 3390 var instance = $('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"), 3391 args = Array.prototype.slice.call(arguments, 1); 3392 3393 if (instance instanceof FancyBox) { 3394 if ($.type(command) === "string") { 3395 instance[command].apply(instance, args); 3396 } else if ($.type(command) === "function") { 3397 command.apply(instance, args); 3398 } 3399 3400 return instance; 3401 } 3402 3403 return false; 3404 }, 3405 3406 // Create new instance 3407 // =================== 3408 3409 open: function (items, opts, index) { 3410 return new FancyBox(items, opts, index); 3411 }, 3412 3413 // Close current or all instances 3414 // ============================== 3415 3416 close: function (all) { 3417 var instance = this.getInstance(); 3418 3419 if (instance) { 3420 instance.close(); 3421 3422 // Try to find and close next instance 3423 if (all === true) { 3424 this.close(all); 3425 } 3426 } 3427 }, 3428 3429 // Close all instances and unbind all events 3430 // ========================================= 3431 3432 destroy: function () { 3433 this.close(true); 3434 3435 $D.add("body").off("click.fb-start", "**"); 3436 }, 3437 3438 // Try to detect mobile devices 3439 // ============================ 3440 3441 isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), 3442 3443 // Detect if 'translate3d' support is available 3444 // ============================================ 3445 3446 use3d: (function () { 3447 var div = document.createElement("div"); 3448 3449 return ( 3450 window.getComputedStyle && 3451 window.getComputedStyle(div) && 3452 window.getComputedStyle(div).getPropertyValue("transform") && 3453 !(document.documentMode && document.documentMode < 11) 3454 ); 3455 })(), 3456 3457 // Helper function to get current visual state of an element 3458 // returns array[ top, left, horizontal-scale, vertical-scale, opacity ] 3459 // ===================================================================== 3460 3461 getTranslate: function ($el) { 3462 var domRect; 3463 3464 if (!$el || !$el.length) { 3465 return false; 3466 } 3467 3468 domRect = $el[0].getBoundingClientRect(); 3469 3470 return { 3471 top: domRect.top || 0, 3472 left: domRect.left || 0, 3473 width: domRect.width, 3474 height: domRect.height, 3475 opacity: parseFloat($el.css("opacity")) 3476 }; 3477 }, 3478 3479 // Shortcut for setting "translate3d" properties for element 3480 // Can set be used to set opacity, too 3481 // ======================================================== 3482 3483 setTranslate: function ($el, props) { 3484 var str = "", 3485 css = {}; 3486 3487 if (!$el || !props) { 3488 return; 3489 } 3490 3491 if (props.left !== undefined || props.top !== undefined) { 3492 str = 3493 (props.left === undefined ? $el.position().left : props.left) + 3494 "px, " + 3495 (props.top === undefined ? $el.position().top : props.top) + 3496 "px"; 3497 3498 if (this.use3d) { 3499 str = "translate3d(" + str + ", 0px)"; 3500 } else { 3501 str = "translate(" + str + ")"; 3502 } 3503 } 3504 3505 if (props.scaleX !== undefined && props.scaleY !== undefined) { 3506 str += " scale(" + props.scaleX + ", " + props.scaleY + ")"; 3507 } else if (props.scaleX !== undefined) { 3508 str += " scaleX(" + props.scaleX + ")"; 3509 } 3510 3511 if (str.length) { 3512 css.transform = str; 3513 } 3514 3515 if (props.opacity !== undefined) { 3516 css.opacity = props.opacity; 3517 } 3518 3519 if (props.width !== undefined) { 3520 css.width = props.width; 3521 } 3522 3523 if (props.height !== undefined) { 3524 css.height = props.height; 3525 } 3526 3527 return $el.css(css); 3528 }, 3529 3530 // Simple CSS transition handler 3531 // ============================= 3532 3533 animate: function ($el, to, duration, callback, leaveAnimationName) { 3534 var self = this, 3535 from; 3536 3537 if ($.isFunction(duration)) { 3538 callback = duration; 3539 duration = null; 3540 } 3541 3542 self.stop($el); 3543 3544 from = self.getTranslate($el); 3545 3546 $el.on(transitionEnd, function (e) { 3547 // Skip events from child elements and z-index change 3548 if (e && e.originalEvent && (!$el.is(e.originalEvent.target) || e.originalEvent.propertyName == "z-index")) { 3549 return; 3550 } 3551 3552 self.stop($el); 3553 3554 if ($.isNumeric(duration)) { 3555 $el.css("transition-duration", ""); 3556 } 3557 3558 if ($.isPlainObject(to)) { 3559 if (to.scaleX !== undefined && to.scaleY !== undefined) { 3560 self.setTranslate($el, { 3561 top: to.top, 3562 left: to.left, 3563 width: from.width * to.scaleX, 3564 height: from.height * to.scaleY, 3565 scaleX: 1, 3566 scaleY: 1 3567 }); 3568 } 3569 } else if (leaveAnimationName !== true) { 3570 $el.removeClass(to); 3571 } 3572 3573 if ($.isFunction(callback)) { 3574 callback(e); 3575 } 3576 }); 3577 3578 if ($.isNumeric(duration)) { 3579 $el.css("transition-duration", duration + "ms"); 3580 } 3581 3582 // Start animation by changing CSS properties or class name 3583 if ($.isPlainObject(to)) { 3584 if (to.scaleX !== undefined && to.scaleY !== undefined) { 3585 delete to.width; 3586 delete to.height; 3587 3588 if ($el.parent().hasClass("fancybox-slide--image")) { 3589 $el.parent().addClass("fancybox-is-scaling"); 3590 } 3591 } 3592 3593 $.fancybox.setTranslate($el, to); 3594 } else { 3595 $el.addClass(to); 3596 } 3597 3598 // Make sure that `transitionend` callback gets fired 3599 $el.data( 3600 "timer", 3601 setTimeout(function () { 3602 $el.trigger(transitionEnd); 3603 }, duration + 33) 3604 ); 3605 }, 3606 3607 stop: function ($el, callCallback) { 3608 if ($el && $el.length) { 3609 clearTimeout($el.data("timer")); 3610 3611 if (callCallback) { 3612 $el.trigger(transitionEnd); 3613 } 3614 3615 $el.off(transitionEnd).css("transition-duration", ""); 3616 3617 $el.parent().removeClass("fancybox-is-scaling"); 3618 } 3619 } 3620 }; 3621 3622 // Default click handler for "fancyboxed" links 3623 // ============================================ 3624 3625 function _run(e, opts) { 3626 var items = [], 3627 index = 0, 3628 $target, 3629 value, 3630 instance; 3631 3632 // Avoid opening multiple times 3633 if (e && e.isDefaultPrevented()) { 3634 return; 3635 } 3636 3637 e.preventDefault(); 3638 3639 opts = opts || {}; 3640 3641 if (e && e.data) { 3642 opts = mergeOpts(e.data.options, opts); 3643 } 3644 3645 $target = opts.$target || $(e.currentTarget).trigger("blur"); 3646 instance = $.fancybox.getInstance(); 3647 3648 if (instance && instance.$trigger && instance.$trigger.is($target)) { 3649 return; 3650 } 3651 3652 if (opts.selector) { 3653 items = $(opts.selector); 3654 } else { 3655 // Get all related items and find index for clicked one 3656 value = $target.attr("data-fancybox") || ""; 3657 3658 if (value) { 3659 items = e.data ? e.data.items : []; 3660 items = items.length ? items.filter('[data-fancybox="' + value + '"]') : $('[data-fancybox="' + value + '"]'); 3661 } else { 3662 items = [$target]; 3663 } 3664 } 3665 3666 index = $(items).index($target); 3667 3668 // Sometimes current item can not be found 3669 if (index < 0) { 3670 index = 0; 3671 } 3672 3673 instance = $.fancybox.open(items, opts, index); 3674 3675 // Save last active element 3676 instance.$trigger = $target; 3677 } 3678 3679 // Create a jQuery plugin 3680 // ====================== 3681 3682 $.fn.fancybox = function (options) { 3683 var selector; 3684 3685 options = options || {}; 3686 selector = options.selector || false; 3687 3688 if (selector) { 3689 // Use body element instead of document so it executes first 3690 $("body") 3691 .off("click.fb-start", selector) 3692 .on("click.fb-start", selector, { 3693 options: options 3694 }, _run); 3695 } else { 3696 this.off("click.fb-start").on( 3697 "click.fb-start", { 3698 items: this, 3699 options: options 3700 }, 3701 _run 3702 ); 3703 } 3704 3705 return this; 3706 }; 3707 3708 // Self initializing plugin for all elements having `data-fancybox` attribute 3709 // ========================================================================== 3710 3711 $D.on("click.fb-start", "[data-fancybox]", _run); 3712 3713 // Enable "trigger elements" 3714 // ========================= 3715 3716 $D.on("click.fb-start", "[data-fancybox-trigger]", function (e) { 3717 $('[data-fancybox="' + $(this).attr("data-fancybox-trigger") + '"]') 3718 .eq($(this).attr("data-fancybox-index") || 0) 3719 .trigger("click.fb-start", { 3720 $trigger: $(this) 3721 }); 3722 }); 3723 3724 // Track focus event for better accessibility styling 3725 // ================================================== 3726 (function () { 3727 var buttonStr = ".fancybox-button", 3728 focusStr = "fancybox-focus", 3729 $pressed = null; 3730 3731 $D.on("mousedown mouseup focus blur", buttonStr, function (e) { 3732 switch (e.type) { 3733 case "mousedown": 3734 $pressed = $(this); 3735 break; 3736 case "mouseup": 3737 $pressed = null; 3738 break; 3739 case "focusin": 3740 $(buttonStr).removeClass(focusStr); 3741 3742 if (!$(this).is($pressed) && !$(this).is("[disabled]")) { 3743 $(this).addClass(focusStr); 3744 } 3745 break; 3746 case "focusout": 3747 $(buttonStr).removeClass(focusStr); 3748 break; 3749 } 3750 }); 3751 })(); 3752})(window, document, jQuery); 3753// ========================================================================== 3754// 3755// Media 3756// Adds additional media type support 3757// 3758// ========================================================================== 3759(function ($) { 3760 "use strict"; 3761 3762 // Object containing properties for each media type 3763 var defaults = { 3764 youtube: { 3765 matcher: /(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i, 3766 params: { 3767 autoplay: 1, 3768 autohide: 1, 3769 fs: 1, 3770 rel: 0, 3771 hd: 1, 3772 wmode: "transparent", 3773 enablejsapi: 1, 3774 html5: 1 3775 }, 3776 paramPlace: 8, 3777 type: "iframe", 3778 url: "https://www.youtube-nocookie.com/embed/$4", 3779 thumb: "https://img.youtube.com/vi/$4/hqdefault.jpg" 3780 }, 3781 3782 vimeo: { 3783 matcher: /^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/, 3784 params: { 3785 autoplay: 1, 3786 hd: 1, 3787 show_title: 1, 3788 show_byline: 1, 3789 show_portrait: 0, 3790 fullscreen: 1 3791 }, 3792 paramPlace: 3, 3793 type: "iframe", 3794 url: "//player.vimeo.com/video/$2" 3795 }, 3796 3797 instagram: { 3798 matcher: /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, 3799 type: "image", 3800 url: "//$1/p/$2/media/?size=l" 3801 }, 3802 3803 // Examples: 3804 // http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 3805 // https://www.google.com/maps/@37.7852006,-122.4146355,14.65z 3806 // https://www.google.com/maps/@52.2111123,2.9237542,6.61z?hl=en 3807 // https://www.google.com/maps/place/Googleplex/@37.4220041,-122.0833494,17z/data=!4m5!3m4!1s0x0:0x6c296c66619367e0!8m2!3d37.4219998!4d-122.0840572 3808 gmap_place: { 3809 matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i, 3810 type: "iframe", 3811 url: function (rez) { 3812 return ( 3813 "//maps.google." + 3814 rez[2] + 3815 "/?ll=" + 3816 (rez[9] ? rez[9] + "&z=" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\//, "&") : "") : rez[12] + "").replace(/\?/, "&") + 3817 "&output=" + 3818 (rez[12] && rez[12].indexOf("layer=c") > 0 ? "svembed" : "embed") 3819 ); 3820 } 3821 }, 3822 3823 // Examples: 3824 // https://www.google.com/maps/search/Empire+State+Building/ 3825 // https://www.google.com/maps/search/?api=1&query=centurylink+field 3826 // https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393 3827 gmap_search: { 3828 matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i, 3829 type: "iframe", 3830 url: function (rez) { 3831 return "//maps.google." + rez[2] + "/maps?q=" + rez[5].replace("query=", "q=").replace("api=1", "") + "&output=embed"; 3832 } 3833 } 3834 }; 3835 3836 // Formats matching url to final form 3837 var format = function (url, rez, params) { 3838 if (!url) { 3839 return; 3840 } 3841 3842 params = params || ""; 3843 3844 if ($.type(params) === "object") { 3845 params = $.param(params, true); 3846 } 3847 3848 $.each(rez, function (key, value) { 3849 url = url.replace("$" + key, value || ""); 3850 }); 3851 3852 if (params.length) { 3853 url += (url.indexOf("?") > 0 ? "&" : "?") + params; 3854 } 3855 3856 return url; 3857 }; 3858 3859 $(document).on("objectNeedsType.fb", function (e, instance, item) { 3860 var url = item.src || "", 3861 type = false, 3862 media, 3863 thumb, 3864 rez, 3865 params, 3866 urlParams, 3867 paramObj, 3868 provider; 3869 3870 media = $.extend(true, {}, defaults, item.opts.media); 3871 3872 // Look for any matching media type 3873 $.each(media, function (providerName, providerOpts) { 3874 rez = url.match(providerOpts.matcher); 3875 3876 if (!rez) { 3877 return; 3878 } 3879 3880 type = providerOpts.type; 3881 provider = providerName; 3882 paramObj = {}; 3883 3884 if (providerOpts.paramPlace && rez[providerOpts.paramPlace]) { 3885 urlParams = rez[providerOpts.paramPlace]; 3886 3887 if (urlParams[0] == "?") { 3888 urlParams = urlParams.substring(1); 3889 } 3890 3891 urlParams = urlParams.split("&"); 3892 3893 for (var m = 0; m < urlParams.length; ++m) { 3894 var p = urlParams[m].split("=", 2); 3895 3896 if (p.length == 2) { 3897 paramObj[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); 3898 } 3899 } 3900 } 3901 3902 params = $.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj); 3903 3904 url = 3905 $.type(providerOpts.url) === "function" ? providerOpts.url.call(this, rez, params, item) : format(providerOpts.url, rez, params); 3906 3907 thumb = 3908 $.type(providerOpts.thumb) === "function" ? providerOpts.thumb.call(this, rez, params, item) : format(providerOpts.thumb, rez); 3909 3910 if (providerName === "youtube") { 3911 url = url.replace(/&t=((\d+)m)?(\d+)s/, function (match, p1, m, s) { 3912 return "&start=" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10)); 3913 }); 3914 } else if (providerName === "vimeo") { 3915 url = url.replace("&%23", "#"); 3916 } 3917 3918 return false; 3919 }); 3920 3921 // If it is found, then change content type and update the url 3922 3923 if (type) { 3924 if (!item.opts.thumb && !(item.opts.$thumb && item.opts.$thumb.length)) { 3925 item.opts.thumb = thumb; 3926 } 3927 3928 if (type === "iframe") { 3929 item.opts = $.extend(true, item.opts, { 3930 iframe: { 3931 preload: false, 3932 attr: { 3933 scrolling: "no" 3934 } 3935 } 3936 }); 3937 } 3938 3939 $.extend(item, { 3940 type: type, 3941 src: url, 3942 origSrc: item.src, 3943 contentSource: provider, 3944 contentType: type === "image" ? "image" : provider == "gmap_place" || provider == "gmap_search" ? "map" : "video" 3945 }); 3946 } else if (url) { 3947 item.type = item.opts.defaultType; 3948 } 3949 }); 3950 3951 // Load YouTube/Video API on request to detect when video finished playing 3952 var VideoAPILoader = { 3953 youtube: { 3954 src: "https://www.youtube.com/iframe_api", 3955 class: "YT", 3956 loading: false, 3957 loaded: false 3958 }, 3959 3960 vimeo: { 3961 src: "https://player.vimeo.com/api/player.js", 3962 class: "Vimeo", 3963 loading: false, 3964 loaded: false 3965 }, 3966 3967 load: function (vendor) { 3968 var _this = this, 3969 script; 3970 3971 if (this[vendor].loaded) { 3972 setTimeout(function () { 3973 _this.done(vendor); 3974 }); 3975 return; 3976 } 3977 3978 if (this[vendor].loading) { 3979 return; 3980 } 3981 3982 this[vendor].loading = true; 3983 3984 script = document.createElement("script"); 3985 script.type = "text/javascript"; 3986 script.src = this[vendor].src; 3987 3988 if (vendor === "youtube") { 3989 window.onYouTubeIframeAPIReady = function () { 3990 _this[vendor].loaded = true; 3991 _this.done(vendor); 3992 }; 3993 } else { 3994 script.onload = function () { 3995 _this[vendor].loaded = true; 3996 _this.done(vendor); 3997 }; 3998 } 3999 4000 document.body.appendChild(script); 4001 }, 4002 done: function (vendor) { 4003 var instance, $el, player; 4004 4005 if (vendor === "youtube") { 4006 delete window.onYouTubeIframeAPIReady; 4007 } 4008 4009 instance = $.fancybox.getInstance(); 4010 4011 if (instance) { 4012 $el = instance.current.$content.find("iframe"); 4013 4014 if (vendor === "youtube" && YT !== undefined && YT) { 4015 player = new YT.Player($el.attr("id"), { 4016 events: { 4017 onStateChange: function (e) { 4018 if (e.data == 0) { 4019 instance.next(); 4020 } 4021 } 4022 } 4023 }); 4024 } else if (vendor === "vimeo" && Vimeo !== undefined && Vimeo) { 4025 player = new Vimeo.Player($el); 4026 4027 player.on("ended", function () { 4028 instance.next(); 4029 }); 4030 } 4031 } 4032 } 4033 }; 4034 4035 $(document).on({ 4036 "afterShow.fb": function (e, instance, current) { 4037 if (instance.group.length > 1 && (current.contentSource === "youtube" || current.contentSource === "vimeo")) { 4038 VideoAPILoader.load(current.contentSource); 4039 } 4040 } 4041 }); 4042})(jQuery); 4043// ========================================================================== 4044// 4045// Guestures 4046// Adds touch guestures, handles click and tap events 4047// 4048// ========================================================================== 4049(function (window, document, $) { 4050 "use strict"; 4051 4052 var requestAFrame = (function () { 4053 return ( 4054 window.requestAnimationFrame || 4055 window.webkitRequestAnimationFrame || 4056 window.mozRequestAnimationFrame || 4057 window.oRequestAnimationFrame || 4058 // if all else fails, use setTimeout 4059 function (callback) { 4060 return window.setTimeout(callback, 1000 / 60); 4061 } 4062 ); 4063 })(); 4064 4065 var cancelAFrame = (function () { 4066 return ( 4067 window.cancelAnimationFrame || 4068 window.webkitCancelAnimationFrame || 4069 window.mozCancelAnimationFrame || 4070 window.oCancelAnimationFrame || 4071 function (id) { 4072 window.clearTimeout(id); 4073 } 4074 ); 4075 })(); 4076 4077 var getPointerXY = function (e) { 4078 var result = []; 4079 4080 e = e.originalEvent || e || window.e; 4081 e = e.touches && e.touches.length ? e.touches : e.changedTouches && e.changedTouches.length ? e.changedTouches : [e]; 4082 4083 for (var key in e) { 4084 if (e[key].pageX) { 4085 result.push({ 4086 x: e[key].pageX, 4087 y: e[key].pageY 4088 }); 4089 } else if (e[key].clientX) { 4090 result.push({ 4091 x: e[key].clientX, 4092 y: e[key].clientY 4093 }); 4094 } 4095 } 4096 4097 return result; 4098 }; 4099 4100 var distance = function (point2, point1, what) { 4101 if (!point1 || !point2) { 4102 return 0; 4103 } 4104 4105 if (what === "x") { 4106 return point2.x - point1.x; 4107 } else if (what === "y") { 4108 return point2.y - point1.y; 4109 } 4110 4111 return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2)); 4112 }; 4113 4114 var isClickable = function ($el) { 4115 if ( 4116 $el.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe') || 4117 $.isFunction($el.get(0).onclick) || 4118 $el.data("selectable") 4119 ) { 4120 return true; 4121 } 4122 4123 // Check for attributes like data-fancybox-next or data-fancybox-close 4124 for (var i = 0, atts = $el[0].attributes, n = atts.length; i < n; i++) { 4125 if (atts[i].nodeName.substr(0, 14) === "data-fancybox-") { 4126 return true; 4127 } 4128 } 4129 4130 return false; 4131 }; 4132 4133 var hasScrollbars = function (el) { 4134 var overflowY = window.getComputedStyle(el)["overflow-y"], 4135 overflowX = window.getComputedStyle(el)["overflow-x"], 4136 vertical = (overflowY === "scroll" || overflowY === "auto") && el.scrollHeight > el.clientHeight, 4137 horizontal = (overflowX === "scroll" || overflowX === "auto") && el.scrollWidth > el.clientWidth; 4138 4139 return vertical || horizontal; 4140 }; 4141 4142 var isScrollable = function ($el) { 4143 var rez = false; 4144 4145 while (true) { 4146 rez = hasScrollbars($el.get(0)); 4147 4148 if (rez) { 4149 break; 4150 } 4151 4152 $el = $el.parent(); 4153 4154 if (!$el.length || $el.hasClass("fancybox-stage") || $el.is("body")) { 4155 break; 4156 } 4157 } 4158 4159 return rez; 4160 }; 4161 4162 var Guestures = function (instance) { 4163 var self = this; 4164 4165 self.instance = instance; 4166 4167 self.$bg = instance.$refs.bg; 4168 self.$stage = instance.$refs.stage; 4169 self.$container = instance.$refs.container; 4170 4171 self.destroy(); 4172 4173 self.$container.on("touchstart.fb.touch mousedown.fb.touch", $.proxy(self, "ontouchstart")); 4174 }; 4175 4176 Guestures.prototype.destroy = function () { 4177 var self = this; 4178 4179 self.$container.off(".fb.touch"); 4180 4181 $(document).off(".fb.touch"); 4182 4183 if (self.requestId) { 4184 cancelAFrame(self.requestId); 4185 self.requestId = null; 4186 } 4187 4188 if (self.tapped) { 4189 clearTimeout(self.tapped); 4190 self.tapped = null; 4191 } 4192 }; 4193 4194 Guestures.prototype.ontouchstart = function (e) { 4195 var self = this, 4196 $target = $(e.target), 4197 instance = self.instance, 4198 current = instance.current, 4199 $slide = current.$slide, 4200 $content = current.$content, 4201 isTouchDevice = e.type == "touchstart"; 4202 4203 // Do not respond to both (touch and mouse) events 4204 if (isTouchDevice) { 4205 self.$container.off("mousedown.fb.touch"); 4206 } 4207 4208 // Ignore right click 4209 if (e.originalEvent && e.originalEvent.button == 2) { 4210 return; 4211 } 4212 4213 // Ignore taping on links, buttons, input elements 4214 if (!$slide.length || !$target.length || isClickable($target) || isClickable($target.parent())) { 4215 return; 4216 } 4217 // Ignore clicks on the scrollbar 4218 if (!$target.is("img") && e.originalEvent.clientX > $target[0].clientWidth + $target.offset().left) { 4219 return; 4220 } 4221 4222 // Ignore clicks while zooming or closing 4223 if (!current || instance.isAnimating || current.$slide.hasClass("fancybox-animated")) { 4224 e.stopPropagation(); 4225 e.preventDefault(); 4226 4227 return; 4228 } 4229 4230 self.realPoints = self.startPoints = getPointerXY(e); 4231 4232 if (!self.startPoints.length) { 4233 return; 4234 } 4235 4236 // Allow other scripts to catch touch event if "touch" is set to false 4237 if (current.touch) { 4238 e.stopPropagation(); 4239 } 4240 4241 self.startEvent = e; 4242 4243 self.canTap = true; 4244 self.$target = $target; 4245 self.$content = $content; 4246 self.opts = current.opts.touch; 4247 4248 self.isPanning = false; 4249 self.isSwiping = false; 4250 self.isZooming = false; 4251 self.isScrolling = false; 4252 self.canPan = instance.canPan(); 4253 4254 self.startTime = new Date().getTime(); 4255 self.distanceX = self.distanceY = self.distance = 0; 4256 4257 self.canvasWidth = Math.round($slide[0].clientWidth); 4258 self.canvasHeight = Math.round($slide[0].clientHeight); 4259 4260 self.contentLastPos = null; 4261 self.contentStartPos = $.fancybox.getTranslate(self.$content) || { 4262 top: 0, 4263 left: 0 4264 }; 4265 self.sliderStartPos = $.fancybox.getTranslate($slide); 4266 4267 // Since position will be absolute, but we need to make it relative to the stage 4268 self.stagePos = $.fancybox.getTranslate(instance.$refs.stage); 4269 4270 self.sliderStartPos.top -= self.stagePos.top; 4271 self.sliderStartPos.left -= self.stagePos.left; 4272 4273 self.contentStartPos.top -= self.stagePos.top; 4274 self.contentStartPos.left -= self.stagePos.left; 4275 4276 $(document) 4277 .off(".fb.touch") 4278 .on(isTouchDevice ? "touchend.fb.touch touchcancel.fb.touch" : "mouseup.fb.touch mouseleave.fb.touch", $.proxy(self, "ontouchend")) 4279 .on(isTouchDevice ? "touchmove.fb.touch" : "mousemove.fb.touch", $.proxy(self, "ontouchmove")); 4280 4281 if ($.fancybox.isMobile) { 4282 document.addEventListener("scroll", self.onscroll, true); 4283 } 4284 4285 // Skip if clicked outside the sliding area 4286 if (!(self.opts || self.canPan) || !($target.is(self.$stage) || self.$stage.find($target).length)) { 4287 if ($target.is(".fancybox-image")) { 4288 e.preventDefault(); 4289 } 4290 4291 if (!($.fancybox.isMobile && $target.parents(".fancybox-caption").length)) { 4292 return; 4293 } 4294 } 4295 4296 self.isScrollable = isScrollable($target) || isScrollable($target.parent()); 4297 4298 // Check if element is scrollable and try to prevent default behavior (scrolling) 4299 if (!($.fancybox.isMobile && self.isScrollable)) { 4300 e.preventDefault(); 4301 } 4302 4303 // One finger or mouse click - swipe or pan an image 4304 if (self.startPoints.length === 1 || current.hasError) { 4305 if (self.canPan) { 4306 $.fancybox.stop(self.$content); 4307 4308 self.isPanning = true; 4309 } else { 4310 self.isSwiping = true; 4311 } 4312 4313 self.$container.addClass("fancybox-is-grabbing"); 4314 } 4315 4316 // Two fingers - zoom image 4317 if (self.startPoints.length === 2 && current.type === "image" && (current.isLoaded || current.$ghost)) { 4318 self.canTap = false; 4319 self.isSwiping = false; 4320 self.isPanning = false; 4321 4322 self.isZooming = true; 4323 4324 $.fancybox.stop(self.$content); 4325 4326 self.centerPointStartX = (self.startPoints[0].x + self.startPoints[1].x) * 0.5 - $(window).scrollLeft(); 4327 self.centerPointStartY = (self.startPoints[0].y + self.startPoints[1].y) * 0.5 - $(window).scrollTop(); 4328 4329 self.percentageOfImageAtPinchPointX = (self.centerPointStartX - self.contentStartPos.left) / self.contentStartPos.width; 4330 self.percentageOfImageAtPinchPointY = (self.centerPointStartY - self.contentStartPos.top) / self.contentStartPos.height; 4331 4332 self.startDistanceBetweenFingers = distance(self.startPoints[0], self.startPoints[1]); 4333 } 4334 }; 4335 4336 Guestures.prototype.onscroll = function (e) { 4337 var self = this; 4338 4339 self.isScrolling = true; 4340 4341 document.removeEventListener("scroll", self.onscroll, true); 4342 }; 4343 4344 Guestures.prototype.ontouchmove = function (e) { 4345 var self = this; 4346 4347 // Make sure user has not released over iframe or disabled element 4348 if (e.originalEvent.buttons !== undefined && e.originalEvent.buttons === 0) { 4349 self.ontouchend(e); 4350 return; 4351 } 4352 4353 if (self.isScrolling) { 4354 self.canTap = false; 4355 return; 4356 } 4357 4358 self.newPoints = getPointerXY(e); 4359 4360 if (!(self.opts || self.canPan) || !self.newPoints.length || !self.newPoints.length) { 4361 return; 4362 } 4363 4364 if (!(self.isSwiping && self.isSwiping === true)) { 4365 e.preventDefault(); 4366 } 4367 4368 self.distanceX = distance(self.newPoints[0], self.startPoints[0], "x"); 4369 self.distanceY = distance(self.newPoints[0], self.startPoints[0], "y"); 4370 4371 self.distance = distance(self.newPoints[0], self.startPoints[0]); 4372 4373 // Skip false ontouchmove events (Chrome) 4374 if (self.distance > 0) { 4375 if (self.isSwiping) { 4376 self.onSwipe(e); 4377 } else if (self.isPanning) { 4378 self.onPan(); 4379 } else if (self.isZooming) { 4380 self.onZoom(); 4381 } 4382 } 4383 }; 4384 4385 Guestures.prototype.onSwipe = function (e) { 4386 var self = this, 4387 instance = self.instance, 4388 swiping = self.isSwiping, 4389 left = self.sliderStartPos.left || 0, 4390 angle; 4391 4392 // If direction is not yet determined 4393 if (swiping === true) { 4394 // We need at least 10px distance to correctly calculate an angle 4395 if (Math.abs(self.distance) > 10) { 4396 self.canTap = false; 4397 4398 if (instance.group.length < 2 && self.opts.vertical) { 4399 self.isSwiping = "y"; 4400 } else if (instance.isDragging || self.opts.vertical === false || (self.opts.vertical === "auto" && $(window).width() > 800)) { 4401 self.isSwiping = "x"; 4402 } else { 4403 angle = Math.abs((Math.atan2(self.distanceY, self.distanceX) * 180) / Math.PI); 4404 4405 self.isSwiping = angle > 45 && angle < 135 ? "y" : "x"; 4406 } 4407 4408 if (self.isSwiping === "y" && $.fancybox.isMobile && self.isScrollable) { 4409 self.isScrolling = true; 4410 4411 return; 4412 } 4413 4414 instance.isDragging = self.isSwiping; 4415 4416 // Reset points to avoid jumping, because we dropped first swipes to calculate the angle 4417 self.startPoints = self.newPoints; 4418 4419 $.each(instance.slides, function (index, slide) { 4420 var slidePos, stagePos; 4421 4422 $.fancybox.stop(slide.$slide); 4423 4424 slidePos = $.fancybox.getTranslate(slide.$slide); 4425 stagePos = $.fancybox.getTranslate(instance.$refs.stage); 4426 4427 slide.$slide 4428 .css({ 4429 transform: "", 4430 opacity: "", 4431 "transition-duration": "" 4432 }) 4433 .removeClass("fancybox-animated") 4434 .removeClass(function (index, className) { 4435 return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" "); 4436 }); 4437 4438 if (slide.pos === instance.current.pos) { 4439 self.sliderStartPos.top = slidePos.top - stagePos.top; 4440 self.sliderStartPos.left = slidePos.left - stagePos.left; 4441 } 4442 4443 $.fancybox.setTranslate(slide.$slide, { 4444 top: slidePos.top - stagePos.top, 4445 left: slidePos.left - stagePos.left 4446 }); 4447 }); 4448 4449 // Stop slideshow 4450 if (instance.SlideShow && instance.SlideShow.isActive) { 4451 instance.SlideShow.stop(); 4452 } 4453 } 4454 4455 return; 4456 } 4457 4458 // Sticky edges 4459 if (swiping == "x") { 4460 if ( 4461 self.distanceX > 0 && 4462 (self.instance.group.length < 2 || (self.instance.current.index === 0 && !self.instance.current.opts.loop)) 4463 ) { 4464 left = left + Math.pow(self.distanceX, 0.8); 4465 } else if ( 4466 self.distanceX < 0 && 4467 (self.instance.group.length < 2 || 4468 (self.instance.current.index === self.instance.group.length - 1 && !self.instance.current.opts.loop)) 4469 ) { 4470 left = left - Math.pow(-self.distanceX, 0.8); 4471 } else { 4472 left = left + self.distanceX; 4473 } 4474 } 4475 4476 self.sliderLastPos = { 4477 top: swiping == "x" ? 0 : self.sliderStartPos.top + self.distanceY, 4478 left: left 4479 }; 4480 4481 if (self.requestId) { 4482 cancelAFrame(self.requestId); 4483 4484 self.requestId = null; 4485 } 4486 4487 self.requestId = requestAFrame(function () { 4488 if (self.sliderLastPos) { 4489 $.each(self.instance.slides, function (index, slide) { 4490 var pos = slide.pos - self.instance.currPos; 4491 4492 $.fancybox.setTranslate(slide.$slide, { 4493 top: self.sliderLastPos.top, 4494 left: self.sliderLastPos.left + pos * self.canvasWidth + pos * slide.opts.gutter 4495 }); 4496 }); 4497 4498 self.$container.addClass("fancybox-is-sliding"); 4499 } 4500 }); 4501 }; 4502 4503 Guestures.prototype.onPan = function () { 4504 var self = this; 4505 4506 // Prevent accidental movement (sometimes, when tapping casually, finger can move a bit) 4507 if (distance(self.newPoints[0], self.realPoints[0]) < ($.fancybox.isMobile ? 10 : 5)) { 4508 self.startPoints = self.newPoints; 4509 return; 4510 } 4511 4512 self.canTap = false; 4513 4514 self.contentLastPos = self.limitMovement(); 4515 4516 if (self.requestId) { 4517 cancelAFrame(self.requestId); 4518 } 4519 4520 self.requestId = requestAFrame(function () { 4521 $.fancybox.setTranslate(self.$content, self.contentLastPos); 4522 }); 4523 }; 4524 4525 // Make panning sticky to the edges 4526 Guestures.prototype.limitMovement = function () { 4527 var self = this; 4528 4529 var canvasWidth = self.canvasWidth; 4530 var canvasHeight = self.canvasHeight; 4531 4532 var distanceX = self.distanceX; 4533 var distanceY = self.distanceY; 4534 4535 var contentStartPos = self.contentStartPos; 4536 4537 var currentOffsetX = contentStartPos.left; 4538 var currentOffsetY = contentStartPos.top; 4539 4540 var currentWidth = contentStartPos.width; 4541 var currentHeight = contentStartPos.height; 4542 4543 var minTranslateX, minTranslateY, maxTranslateX, maxTranslateY, newOffsetX, newOffsetY; 4544 4545 if (currentWidth > canvasWidth) { 4546 newOffsetX = currentOffsetX + distanceX; 4547 } else { 4548 newOffsetX = currentOffsetX; 4549 } 4550 4551 newOffsetY = currentOffsetY + distanceY; 4552 4553 // Slow down proportionally to traveled distance 4554 minTranslateX = Math.max(0, canvasWidth * 0.5 - currentWidth * 0.5); 4555 minTranslateY = Math.max(0, canvasHeight * 0.5 - currentHeight * 0.5); 4556 4557 maxTranslateX = Math.min(canvasWidth - currentWidth, canvasWidth * 0.5 - currentWidth * 0.5); 4558 maxTranslateY = Math.min(canvasHeight - currentHeight, canvasHeight * 0.5 - currentHeight * 0.5); 4559 4560 // -> 4561 if (distanceX > 0 && newOffsetX > minTranslateX) { 4562 newOffsetX = minTranslateX - 1 + Math.pow(-minTranslateX + currentOffsetX + distanceX, 0.8) || 0; 4563 } 4564 4565 // <- 4566 if (distanceX < 0 && newOffsetX < maxTranslateX) { 4567 newOffsetX = maxTranslateX + 1 - Math.pow(maxTranslateX - currentOffsetX - distanceX, 0.8) || 0; 4568 } 4569 4570 // \/ 4571 if (distanceY > 0 && newOffsetY > minTranslateY) { 4572 newOffsetY = minTranslateY - 1 + Math.pow(-minTranslateY + currentOffsetY + distanceY, 0.8) || 0; 4573 } 4574 4575 // /\ 4576 if (distanceY < 0 && newOffsetY < maxTranslateY) { 4577 newOffsetY = maxTranslateY + 1 - Math.pow(maxTranslateY - currentOffsetY - distanceY, 0.8) || 0; 4578 } 4579 4580 return { 4581 top: newOffsetY, 4582 left: newOffsetX 4583 }; 4584 }; 4585 4586 Guestures.prototype.limitPosition = function (newOffsetX, newOffsetY, newWidth, newHeight) { 4587 var self = this; 4588 4589 var canvasWidth = self.canvasWidth; 4590 var canvasHeight = self.canvasHeight; 4591 4592 if (newWidth > canvasWidth) { 4593 newOffsetX = newOffsetX > 0 ? 0 : newOffsetX; 4594 newOffsetX = newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth : newOffsetX; 4595 } else { 4596 // Center horizontally 4597 newOffsetX = Math.max(0, canvasWidth / 2 - newWidth / 2); 4598 } 4599 4600 if (newHeight > canvasHeight) { 4601 newOffsetY = newOffsetY > 0 ? 0 : newOffsetY; 4602 newOffsetY = newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight : newOffsetY; 4603 } else { 4604 // Center vertically 4605 newOffsetY = Math.max(0, canvasHeight / 2 - newHeight / 2); 4606 } 4607 4608 return { 4609 top: newOffsetY, 4610 left: newOffsetX 4611 }; 4612 }; 4613 4614 Guestures.prototype.onZoom = function () { 4615 var self = this; 4616 4617 // Calculate current distance between points to get pinch ratio and new width and height 4618 var contentStartPos = self.contentStartPos; 4619 4620 var currentWidth = contentStartPos.width; 4621 var currentHeight = contentStartPos.height; 4622 4623 var currentOffsetX = contentStartPos.left; 4624 var currentOffsetY = contentStartPos.top; 4625 4626 var endDistanceBetweenFingers = distance(self.newPoints[0], self.newPoints[1]); 4627 4628 var pinchRatio = endDistanceBetweenFingers / self.startDistanceBetweenFingers; 4629 4630 var newWidth = Math.floor(currentWidth * pinchRatio); 4631 var newHeight = Math.floor(currentHeight * pinchRatio); 4632 4633 // This is the translation due to pinch-zooming 4634 var translateFromZoomingX = (currentWidth - newWidth) * self.percentageOfImageAtPinchPointX; 4635 var translateFromZoomingY = (currentHeight - newHeight) * self.percentageOfImageAtPinchPointY; 4636 4637 // Point between the two touches 4638 var centerPointEndX = (self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft(); 4639 var centerPointEndY = (self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop(); 4640 4641 // And this is the translation due to translation of the centerpoint 4642 // between the two fingers 4643 var translateFromTranslatingX = centerPointEndX - self.centerPointStartX; 4644 var translateFromTranslatingY = centerPointEndY - self.centerPointStartY; 4645 4646 // The new offset is the old/current one plus the total translation 4647 var newOffsetX = currentOffsetX + (translateFromZoomingX + translateFromTranslatingX); 4648 var newOffsetY = currentOffsetY + (translateFromZoomingY + translateFromTranslatingY); 4649 4650 var newPos = { 4651 top: newOffsetY, 4652 left: newOffsetX, 4653 scaleX: pinchRatio, 4654 scaleY: pinchRatio 4655 }; 4656 4657 self.canTap = false; 4658 4659 self.newWidth = newWidth; 4660 self.newHeight = newHeight; 4661 4662 self.contentLastPos = newPos; 4663 4664 if (self.requestId) { 4665 cancelAFrame(self.requestId); 4666 } 4667 4668 self.requestId = requestAFrame(function () { 4669 $.fancybox.setTranslate(self.$content, self.contentLastPos); 4670 }); 4671 }; 4672 4673 Guestures.prototype.ontouchend = function (e) { 4674 var self = this; 4675 4676 var swiping = self.isSwiping; 4677 var panning = self.isPanning; 4678 var zooming = self.isZooming; 4679 var scrolling = self.isScrolling; 4680 4681 self.endPoints = getPointerXY(e); 4682 self.dMs = Math.max(new Date().getTime() - self.startTime, 1); 4683 4684 self.$container.removeClass("fancybox-is-grabbing"); 4685 4686 $(document).off(".fb.touch"); 4687 4688 document.removeEventListener("scroll", self.onscroll, true); 4689 4690 if (self.requestId) { 4691 cancelAFrame(self.requestId); 4692 4693 self.requestId = null; 4694 } 4695 4696 self.isSwiping = false; 4697 self.isPanning = false; 4698 self.isZooming = false; 4699 self.isScrolling = false; 4700 4701 self.instance.isDragging = false; 4702 4703 if (self.canTap) { 4704 return self.onTap(e); 4705 } 4706 4707 self.speed = 100; 4708 4709 // Speed in px/ms 4710 self.velocityX = (self.distanceX / self.dMs) * 0.5; 4711 self.velocityY = (self.distanceY / self.dMs) * 0.5; 4712 4713 if (panning) { 4714 self.endPanning(); 4715 } else if (zooming) { 4716 self.endZooming(); 4717 } else { 4718 self.endSwiping(swiping, scrolling); 4719 } 4720 4721 return; 4722 }; 4723 4724 Guestures.prototype.endSwiping = function (swiping, scrolling) { 4725 var self = this, 4726 ret = false, 4727 len = self.instance.group.length, 4728 distanceX = Math.abs(self.distanceX), 4729 canAdvance = swiping == "x" && len > 1 && ((self.dMs > 130 && distanceX > 10) || distanceX > 50), 4730 speedX = 300; 4731 4732 self.sliderLastPos = null; 4733 4734 // Close if swiped vertically / navigate if horizontally 4735 if (swiping == "y" && !scrolling && Math.abs(self.distanceY) > 50) { 4736 // Continue vertical movement 4737 $.fancybox.animate( 4738 self.instance.current.$slide, { 4739 top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150, 4740 opacity: 0 4741 }, 4742 200 4743 ); 4744 ret = self.instance.close(true, 250); 4745 } else if (canAdvance && self.distanceX > 0) { 4746 ret = self.instance.previous(speedX); 4747 } else if (canAdvance && self.distanceX < 0) { 4748 ret = self.instance.next(speedX); 4749 } 4750 4751 if (ret === false && (swiping == "x" || swiping == "y")) { 4752 self.instance.centerSlide(200); 4753 } 4754 4755 self.$container.removeClass("fancybox-is-sliding"); 4756 }; 4757 4758 // Limit panning from edges 4759 // ======================== 4760 Guestures.prototype.endPanning = function () { 4761 var self = this, 4762 newOffsetX, 4763 newOffsetY, 4764 newPos; 4765 4766 if (!self.contentLastPos) { 4767 return; 4768 } 4769 4770 if (self.opts.momentum === false || self.dMs > 350) { 4771 newOffsetX = self.contentLastPos.left; 4772 newOffsetY = self.contentLastPos.top; 4773 } else { 4774 // Continue movement 4775 newOffsetX = self.contentLastPos.left + self.velocityX * 500; 4776 newOffsetY = self.contentLastPos.top + self.velocityY * 500; 4777 } 4778 4779 newPos = self.limitPosition(newOffsetX, newOffsetY, self.contentStartPos.width, self.contentStartPos.height); 4780 4781 newPos.width = self.contentStartPos.width; 4782 newPos.height = self.contentStartPos.height; 4783 4784 $.fancybox.animate(self.$content, newPos, 366); 4785 }; 4786 4787 Guestures.prototype.endZooming = function () { 4788 var self = this; 4789 4790 var current = self.instance.current; 4791 4792 var newOffsetX, newOffsetY, newPos, reset; 4793 4794 var newWidth = self.newWidth; 4795 var newHeight = self.newHeight; 4796 4797 if (!self.contentLastPos) { 4798 return; 4799 } 4800 4801 newOffsetX = self.contentLastPos.left; 4802 newOffsetY = self.contentLastPos.top; 4803 4804 reset = { 4805 top: newOffsetY, 4806 left: newOffsetX, 4807 width: newWidth, 4808 height: newHeight, 4809 scaleX: 1, 4810 scaleY: 1 4811 }; 4812 4813 // Reset scalex/scaleY values; this helps for perfomance and does not break animation 4814 $.fancybox.setTranslate(self.$content, reset); 4815 4816 if (newWidth < self.canvasWidth && newHeight < self.canvasHeight) { 4817 self.instance.scaleToFit(150); 4818 } else if (newWidth > current.width || newHeight > current.height) { 4819 self.instance.scaleToActual(self.centerPointStartX, self.centerPointStartY, 150); 4820 } else { 4821 newPos = self.limitPosition(newOffsetX, newOffsetY, newWidth, newHeight); 4822 4823 $.fancybox.animate(self.$content, newPos, 150); 4824 } 4825 }; 4826 4827 Guestures.prototype.onTap = function (e) { 4828 var self = this; 4829 var $target = $(e.target); 4830 4831 var instance = self.instance; 4832 var current = instance.current; 4833 4834 var endPoints = (e && getPointerXY(e)) || self.startPoints; 4835 4836 var tapX = endPoints[0] ? endPoints[0].x - $(window).scrollLeft() - self.stagePos.left : 0; 4837 var tapY = endPoints[0] ? endPoints[0].y - $(window).scrollTop() - self.stagePos.top : 0; 4838 4839 var where; 4840 4841 var process = function (prefix) { 4842 var action = current.opts[prefix]; 4843 4844 if ($.isFunction(action)) { 4845 action = action.apply(instance, [current, e]); 4846 } 4847 4848 if (!action) { 4849 return; 4850 } 4851 4852 switch (action) { 4853 case "close": 4854 instance.close(self.startEvent); 4855 4856 break; 4857 4858 case "toggleControls": 4859 instance.toggleControls(); 4860 4861 break; 4862 4863 case "next": 4864 instance.next(); 4865 4866 break; 4867 4868 case "nextOrClose": 4869 if (instance.group.length > 1) { 4870 instance.next(); 4871 } else { 4872 instance.close(self.startEvent); 4873 } 4874 4875 break; 4876 4877 case "zoom": 4878 if (current.type == "image" && (current.isLoaded || current.$ghost)) { 4879 if (instance.canPan()) { 4880 instance.scaleToFit(); 4881 } else if (instance.isScaledDown()) { 4882 instance.scaleToActual(tapX, tapY); 4883 } else if (instance.group.length < 2) { 4884 instance.close(self.startEvent); 4885 } 4886 } 4887 4888 break; 4889 } 4890 }; 4891 4892 // Ignore right click 4893 if (e.originalEvent && e.originalEvent.button == 2) { 4894 return; 4895 } 4896 4897 // Skip if clicked on the scrollbar 4898 if (!$target.is("img") && tapX > $target[0].clientWidth + $target.offset().left) { 4899 return; 4900 } 4901 4902 // Check where is clicked 4903 if ($target.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container")) { 4904 where = "Outside"; 4905 } else if ($target.is(".fancybox-slide")) { 4906 where = "Slide"; 4907 } else if ( 4908 instance.current.$content && 4909 instance.current.$content 4910 .find($target) 4911 .addBack() 4912 .filter($target).length 4913 ) { 4914 where = "Content"; 4915 } else { 4916 return; 4917 } 4918 4919 // Check if this is a double tap 4920 if (self.tapped) { 4921 // Stop previously created single tap 4922 clearTimeout(self.tapped); 4923 self.tapped = null; 4924 4925 // Skip if distance between taps is too big 4926 if (Math.abs(tapX - self.tapX) > 50 || Math.abs(tapY - self.tapY) > 50) { 4927 return this; 4928 } 4929 4930 // OK, now we assume that this is a double-tap 4931 process("dblclick" + where); 4932 } else { 4933 // Single tap will be processed if user has not clicked second time within 300ms 4934 // or there is no need to wait for double-tap 4935 self.tapX = tapX; 4936 self.tapY = tapY; 4937 4938 if (current.opts["dblclick" + where] && current.opts["dblclick" + where] !== current.opts["click" + where]) { 4939 self.tapped = setTimeout(function () { 4940 self.tapped = null; 4941 4942 if (!instance.isAnimating) { 4943 process("click" + where); 4944 } 4945 }, 500); 4946 } else { 4947 process("click" + where); 4948 } 4949 } 4950 4951 return this; 4952 }; 4953 4954 $(document) 4955 .on("onActivate.fb", function (e, instance) { 4956 if (instance && !instance.Guestures) { 4957 instance.Guestures = new Guestures(instance); 4958 } 4959 }) 4960 .on("beforeClose.fb", function (e, instance) { 4961 if (instance && instance.Guestures) { 4962 instance.Guestures.destroy(); 4963 } 4964 }); 4965})(window, document, jQuery); 4966// ========================================================================== 4967// 4968// SlideShow 4969// Enables slideshow functionality 4970// 4971// Example of usage: 4972// $.fancybox.getInstance().SlideShow.start() 4973// 4974// ========================================================================== 4975(function (document, $) { 4976 "use strict"; 4977 4978 $.extend(true, $.fancybox.defaults, { 4979 btnTpl: { 4980 slideShow: '<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}">' + 4981 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m23 12c0 6.1-4.9 11-11 11c-6.1 0-11-4.9-11-11c0-6.1 4.9-11 11-11c6.1 0 11 4.9 11 11zm-0.9 0c0-5.6-4.5-10.1-10.1-10.1c-5.6 0-10.1 4.5-10.1 10.1c0 5.6 4.5 10.1 10.1 10.1c5.6 0 10.1-4.5 10.1-10.1zm-5.4 0l-6.2 6.2q-0.1 0.1-0.3 0.1q-0.2 0-0.4-0.1q-0.1-0.2-0.1-0.4q0-0.2 0.1-0.3l5.5-5.5l-5.5-5.5q-0.1-0.1-0.1-0.2q0-0.2 0-0.3q0.1-0.2 0.2-0.2q0.1-0.1 0.3-0.1q0 0 0.1 0q0 0 0 0q0.1 0 0.1 0.1q0.1 0 0.1 0z"/></svg>' + 4982 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m23 12c0 6.1-4.9 11-11 11c-6.1 0-11-4.9-11-11c0-6.1 4.9-11 11-11c6.1 0 11 4.9 11 11zm-0.9 0c0-5.6-4.5-10.1-10.1-10.1c-5.6 0-10.1 4.5-10.1 10.1c0 5.6 4.5 10.1 10.1 10.1c5.6 0 10.1-4.5 10.1-10.1z" /><path class="s0" d="m9 6.5c0-0.3 0.2-0.5 0.5-0.5c0.3 0 0.5 0.2 0.5 0.5v11c0 0.3-0.2 0.5-0.5 0.5c-0.3 0-0.5-0.2-0.5-0.5z" /><path class="s0" d="m14 6.5c0-0.3 0.2-0.5 0.5-0.5c0.3 0 0.5 0.2 0.5 0.5v11c0 0.3-0.2 0.5-0.5 0.5c-0.3 0-0.5-0.2-0.5-0.5z"/></svg>' + 4983 "</button>" 4984 }, 4985 slideShow: { 4986 autoStart: false, 4987 speed: 3000, 4988 progress: true 4989 } 4990 }); 4991 4992 var SlideShow = function (instance) { 4993 this.instance = instance; 4994 this.init(); 4995 }; 4996 4997 $.extend(SlideShow.prototype, { 4998 timer: null, 4999 isActive: false, 5000 $button: null, 5001 5002 init: function () { 5003 var self = this, 5004 instance = self.instance, 5005 opts = instance.group[instance.currIndex].opts.slideShow; 5006 5007 self.$button = instance.$refs.toolbar.find("[data-fancybox-play]").on("click", function () { 5008 self.toggle(); 5009 }); 5010 5011 if (instance.group.length < 2 || !opts) { 5012 self.$button.hide(); 5013 } else if (opts.progress) { 5014 self.$progress = $('<div class="fancybox-progress"></div>').appendTo(instance.$refs.inner); 5015 } 5016 }, 5017 5018 set: function (force) { 5019 var self = this, 5020 instance = self.instance, 5021 current = instance.current; 5022 5023 // Check if reached last element 5024 if (current && (force === true || current.opts.loop || instance.currIndex < instance.group.length - 1)) { 5025 if (self.isActive && current.contentType !== "video") { 5026 if (self.$progress) { 5027 $.fancybox.animate(self.$progress.show(), { 5028 scaleX: 1 5029 }, current.opts.slideShow.speed); 5030 } 5031 5032 self.timer = setTimeout(function () { 5033 if (!instance.current.opts.loop && instance.current.index == instance.group.length - 1) { 5034 instance.jumpTo(0); 5035 } else { 5036 instance.next(); 5037 } 5038 }, current.opts.slideShow.speed); 5039 } 5040 } else { 5041 self.stop(); 5042 instance.idleSecondsCounter = 0; 5043 instance.showControls(); 5044 } 5045 }, 5046 5047 clear: function () { 5048 var self = this; 5049 5050 clearTimeout(self.timer); 5051 5052 self.timer = null; 5053 5054 if (self.$progress) { 5055 self.$progress.removeAttr("style").hide(); 5056 } 5057 }, 5058 5059 start: function () { 5060 var self = this, 5061 current = self.instance.current; 5062 5063 if (current) { 5064 self.$button 5065 .attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_STOP) 5066 .removeClass("fancybox-button--play") 5067 .addClass("fancybox-button--pause"); 5068 5069 self.isActive = true; 5070 5071 if (current.isComplete) { 5072 self.set(true); 5073 } 5074 5075 self.instance.trigger("onSlideShowChange", true); 5076 } 5077 }, 5078 5079 stop: function () { 5080 var self = this, 5081 current = self.instance.current; 5082 5083 self.clear(); 5084 5085 self.$button 5086 .attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_START) 5087 .removeClass("fancybox-button--pause") 5088 .addClass("fancybox-button--play"); 5089 5090 self.isActive = false; 5091 5092 self.instance.trigger("onSlideShowChange", false); 5093 5094 if (self.$progress) { 5095 self.$progress.removeAttr("style").hide(); 5096 } 5097 }, 5098 5099 toggle: function () { 5100 var self = this; 5101 5102 if (self.isActive) { 5103 self.stop(); 5104 } else { 5105 self.start(); 5106 } 5107 } 5108 }); 5109 5110 $(document).on({ 5111 "onInit.fb": function (e, instance) { 5112 if (instance && !instance.SlideShow) { 5113 instance.SlideShow = new SlideShow(instance); 5114 } 5115 }, 5116 5117 "beforeShow.fb": function (e, instance, current, firstRun) { 5118 var SlideShow = instance && instance.SlideShow; 5119 5120 if (firstRun) { 5121 if (SlideShow && current.opts.slideShow.autoStart) { 5122 SlideShow.start(); 5123 } 5124 } else if (SlideShow && SlideShow.isActive) { 5125 SlideShow.clear(); 5126 } 5127 }, 5128 5129 "afterShow.fb": function (e, instance, current) { 5130 var SlideShow = instance && instance.SlideShow; 5131 5132 if (SlideShow && SlideShow.isActive) { 5133 SlideShow.set(); 5134 } 5135 }, 5136 5137 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 5138 var SlideShow = instance && instance.SlideShow; 5139 5140 // "P" or Spacebar 5141 if (SlideShow && current.opts.slideShow && (keycode === 80 || keycode === 32) && !$(document.activeElement).is("button,a,input")) { 5142 keypress.preventDefault(); 5143 5144 SlideShow.toggle(); 5145 } 5146 }, 5147 5148 "beforeClose.fb onDeactivate.fb": function (e, instance) { 5149 var SlideShow = instance && instance.SlideShow; 5150 5151 if (SlideShow) { 5152 SlideShow.stop(); 5153 } 5154 } 5155 }); 5156 5157 // Page Visibility API to pause slideshow when window is not active 5158 $(document).on("visibilitychange", function () { 5159 var instance = $.fancybox.getInstance(), 5160 SlideShow = instance && instance.SlideShow; 5161 5162 if (SlideShow && SlideShow.isActive) { 5163 if (document.hidden) { 5164 SlideShow.clear(); 5165 } else { 5166 SlideShow.set(); 5167 } 5168 } 5169 }); 5170})(document, jQuery); 5171// ========================================================================== 5172// 5173// FullScreen 5174// Adds fullscreen functionality 5175// 5176// ========================================================================== 5177(function (document, $) { 5178 "use strict"; 5179 5180 // Collection of methods supported by user browser 5181 var fn = (function () { 5182 var fnMap = [ 5183 ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], 5184 // new WebKit 5185 [ 5186 "webkitRequestFullscreen", 5187 "webkitExitFullscreen", 5188 "webkitFullscreenElement", 5189 "webkitFullscreenEnabled", 5190 "webkitfullscreenchange", 5191 "webkitfullscreenerror" 5192 ], 5193 // old WebKit (Safari 5.1) 5194 [ 5195 "webkitRequestFullScreen", 5196 "webkitCancelFullScreen", 5197 "webkitCurrentFullScreenElement", 5198 "webkitCancelFullScreen", 5199 "webkitfullscreenchange", 5200 "webkitfullscreenerror" 5201 ], 5202 [ 5203 "mozRequestFullScreen", 5204 "mozCancelFullScreen", 5205 "mozFullScreenElement", 5206 "mozFullScreenEnabled", 5207 "mozfullscreenchange", 5208 "mozfullscreenerror" 5209 ], 5210 ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"] 5211 ]; 5212 5213 var ret = {}; 5214 5215 for (var i = 0; i < fnMap.length; i++) { 5216 var val = fnMap[i]; 5217 5218 if (val && val[1] in document) { 5219 for (var j = 0; j < val.length; j++) { 5220 ret[fnMap[0][j]] = val[j]; 5221 } 5222 5223 return ret; 5224 } 5225 } 5226 5227 return false; 5228 })(); 5229 5230 if (fn) { 5231 var FullScreen = { 5232 request: function (elem) { 5233 elem = elem || document.documentElement; 5234 5235 elem[fn.requestFullscreen](elem.ALLOW_KEYBOARD_INPUT); 5236 }, 5237 exit: function () { 5238 document[fn.exitFullscreen](); 5239 }, 5240 toggle: function (elem) { 5241 elem = elem || document.documentElement; 5242 5243 if (this.isFullscreen()) { 5244 this.exit(); 5245 } else { 5246 this.request(elem); 5247 } 5248 }, 5249 isFullscreen: function () { 5250 return Boolean(document[fn.fullscreenElement]); 5251 }, 5252 enabled: function () { 5253 return Boolean(document[fn.fullscreenEnabled]); 5254 } 5255 }; 5256 5257 $.extend(true, $.fancybox.defaults, { 5258 btnTpl: { 5259 fullScreen: '<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}">' + 5260 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>' + 5261 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg>' + 5262 "</button>" 5263 }, 5264 fullScreen: { 5265 autoStart: false 5266 } 5267 }); 5268 5269 $(document).on(fn.fullscreenchange, function () { 5270 var isFullscreen = FullScreen.isFullscreen(), 5271 instance = $.fancybox.getInstance(); 5272 5273 if (instance) { 5274 // If image is zooming, then force to stop and reposition properly 5275 if (instance.current && instance.current.type === "image" && instance.isAnimating) { 5276 instance.isAnimating = false; 5277 5278 instance.update(true, true, 0); 5279 5280 if (!instance.isComplete) { 5281 instance.complete(); 5282 } 5283 } 5284 5285 instance.trigger("onFullscreenChange", isFullscreen); 5286 5287 instance.$refs.container.toggleClass("fancybox-is-fullscreen", isFullscreen); 5288 5289 instance.$refs.toolbar 5290 .find("[data-fancybox-fullscreen]") 5291 .toggleClass("fancybox-button--fsenter", !isFullscreen) 5292 .toggleClass("fancybox-button--fsexit", isFullscreen); 5293 } 5294 }); 5295 } 5296 5297 $(document).on({ 5298 "onInit.fb": function (e, instance) { 5299 var $container; 5300 5301 if (!fn) { 5302 instance.$refs.toolbar.find("[data-fancybox-fullscreen]").remove(); 5303 5304 return; 5305 } 5306 5307 if (instance && instance.group[instance.currIndex].opts.fullScreen) { 5308 $container = instance.$refs.container; 5309 5310 $container.on("click.fb-fullscreen", "[data-fancybox-fullscreen]", function (e) { 5311 e.stopPropagation(); 5312 e.preventDefault(); 5313 5314 FullScreen.toggle(); 5315 }); 5316 5317 if (instance.opts.fullScreen && instance.opts.fullScreen.autoStart === true) { 5318 FullScreen.request(); 5319 } 5320 5321 // Expose API 5322 instance.FullScreen = FullScreen; 5323 } else if (instance) { 5324 instance.$refs.toolbar.find("[data-fancybox-fullscreen]").hide(); 5325 } 5326 }, 5327 5328 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 5329 // "F" 5330 if (instance && instance.FullScreen && keycode === 70) { 5331 keypress.preventDefault(); 5332 5333 instance.FullScreen.toggle(); 5334 } 5335 }, 5336 5337 "beforeClose.fb": function (e, instance) { 5338 if (instance && instance.FullScreen && instance.$refs.container.hasClass("fancybox-is-fullscreen")) { 5339 FullScreen.exit(); 5340 } 5341 } 5342 }); 5343})(document, jQuery); 5344// ========================================================================== 5345// 5346// Thumbs 5347// Displays thumbnails in a grid 5348// 5349// ========================================================================== 5350(function (document, $) { 5351 "use strict"; 5352 5353 var CLASS = "fancybox-thumbs", 5354 CLASS_ACTIVE = CLASS + "-active"; 5355 5356 // Make sure there are default values 5357 $.fancybox.defaults = $.extend( 5358 true, { 5359 btnTpl: { 5360 thumbs: '<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}">' + 5361 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg>' + 5362 "</button>" 5363 }, 5364 thumbs: { 5365 autoStart: false, // Display thumbnails on opening 5366 hideOnClose: true, // Hide thumbnail grid when closing animation starts 5367 parentEl: ".fancybox-container", // Container is injected into this element 5368 axis: "y" // Vertical (y) or horizontal (x) scrolling 5369 } 5370 }, 5371 $.fancybox.defaults 5372 ); 5373 5374 var FancyThumbs = function (instance) { 5375 this.init(instance); 5376 }; 5377 5378 $.extend(FancyThumbs.prototype, { 5379 $button: null, 5380 $grid: null, 5381 $list: null, 5382 isVisible: false, 5383 isActive: false, 5384 5385 init: function (instance) { 5386 var self = this, 5387 group = instance.group, 5388 enabled = 0; 5389 5390 self.instance = instance; 5391 self.opts = group[instance.currIndex].opts.thumbs; 5392 5393 instance.Thumbs = self; 5394 5395 self.$button = instance.$refs.toolbar.find("[data-fancybox-thumbs]"); 5396 5397 // Enable thumbs if at least two group items have thumbnails 5398 for (var i = 0, len = group.length; i < len; i++) { 5399 if (group[i].thumb) { 5400 enabled++; 5401 } 5402 5403 if (enabled > 1) { 5404 break; 5405 } 5406 } 5407 5408 if (enabled > 1 && !!self.opts) { 5409 self.$button.removeAttr("style").on("click", function () { 5410 self.toggle(); 5411 }); 5412 5413 self.isActive = true; 5414 } else { 5415 self.$button.hide(); 5416 } 5417 }, 5418 5419 create: function () { 5420 var self = this, 5421 instance = self.instance, 5422 parentEl = self.opts.parentEl, 5423 list = [], 5424 src; 5425 5426 if (!self.$grid) { 5427 // Create main element 5428 self.$grid = $('<div class="' + CLASS + " " + CLASS + "-" + self.opts.axis + '"></div>').appendTo( 5429 instance.$refs.container 5430 .find(parentEl) 5431 .addBack() 5432 .filter(parentEl) 5433 ); 5434 5435 // Add "click" event that performs gallery navigation 5436 self.$grid.on("click", "a", function () { 5437 instance.jumpTo($(this).attr("data-index")); 5438 }); 5439 } 5440 5441 // Build the list 5442 if (!self.$list) { 5443 self.$list = $('<div class="' + CLASS + '__list">').appendTo(self.$grid); 5444 } 5445 5446 $.each(instance.group, function (i, item) { 5447 src = item.thumb; 5448 5449 if (!src && item.type === "image") { 5450 src = item.src; 5451 } 5452 5453 list.push( 5454 '<a href="javascript:;" tabindex="0" data-index="' + 5455 i + 5456 '"' + 5457 (src && src.length ? ' style="background-image:url(' + src + ')"' : 'class="fancybox-thumbs-missing"') + 5458 "></a>" 5459 ); 5460 }); 5461 5462 self.$list[0].innerHTML = list.join(""); 5463 5464 if (self.opts.axis === "x") { 5465 // Set fixed width for list element to enable horizontal scrolling 5466 self.$list.width( 5467 parseInt(self.$grid.css("padding-right"), 10) + 5468 instance.group.length * 5469 self.$list 5470 .children() 5471 .eq(0) 5472 .outerWidth(true) 5473 ); 5474 } 5475 }, 5476 5477 focus: function (duration) { 5478 var self = this, 5479 $list = self.$list, 5480 $grid = self.$grid, 5481 thumb, 5482 thumbPos; 5483 5484 if (!self.instance.current) { 5485 return; 5486 } 5487 5488 thumb = $list 5489 .children() 5490 .removeClass(CLASS_ACTIVE) 5491 .filter('[data-index="' + self.instance.current.index + '"]') 5492 .addClass(CLASS_ACTIVE); 5493 5494 thumbPos = thumb.position(); 5495 5496 // Check if need to scroll to make current thumb visible 5497 if (self.opts.axis === "y" && (thumbPos.top < 0 || thumbPos.top > $list.height() - thumb.outerHeight())) { 5498 $list.stop().animate({ 5499 scrollTop: $list.scrollTop() + thumbPos.top 5500 }, 5501 duration 5502 ); 5503 } else if ( 5504 self.opts.axis === "x" && 5505 (thumbPos.left < $grid.scrollLeft() || thumbPos.left > $grid.scrollLeft() + ($grid.width() - thumb.outerWidth())) 5506 ) { 5507 $list 5508 .parent() 5509 .stop() 5510 .animate({ 5511 scrollLeft: thumbPos.left 5512 }, 5513 duration 5514 ); 5515 } 5516 }, 5517 5518 update: function () { 5519 var that = this; 5520 that.instance.$refs.container.toggleClass("fancybox-show-thumbs", this.isVisible); 5521 5522 if (that.isVisible) { 5523 if (!that.$grid) { 5524 that.create(); 5525 } 5526 5527 that.instance.trigger("onThumbsShow"); 5528 5529 that.focus(0); 5530 } else if (that.$grid) { 5531 that.instance.trigger("onThumbsHide"); 5532 } 5533 5534 // Update content position 5535 that.instance.update(); 5536 }, 5537 5538 hide: function () { 5539 this.isVisible = false; 5540 this.update(); 5541 }, 5542 5543 show: function () { 5544 this.isVisible = true; 5545 this.update(); 5546 }, 5547 5548 toggle: function () { 5549 this.isVisible = !this.isVisible; 5550 this.update(); 5551 } 5552 }); 5553 5554 $(document).on({ 5555 "onInit.fb": function (e, instance) { 5556 var Thumbs; 5557 5558 if (instance && !instance.Thumbs) { 5559 Thumbs = new FancyThumbs(instance); 5560 5561 if (Thumbs.isActive && Thumbs.opts.autoStart === true) { 5562 Thumbs.show(); 5563 } 5564 } 5565 }, 5566 5567 "beforeShow.fb": function (e, instance, item, firstRun) { 5568 var Thumbs = instance && instance.Thumbs; 5569 5570 if (Thumbs && Thumbs.isVisible) { 5571 Thumbs.focus(firstRun ? 0 : 250); 5572 } 5573 }, 5574 5575 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 5576 var Thumbs = instance && instance.Thumbs; 5577 5578 // "G" 5579 if (Thumbs && Thumbs.isActive && keycode === 71) { 5580 keypress.preventDefault(); 5581 5582 Thumbs.toggle(); 5583 } 5584 }, 5585 5586 "beforeClose.fb": function (e, instance) { 5587 var Thumbs = instance && instance.Thumbs; 5588 5589 if (Thumbs && Thumbs.isVisible && Thumbs.opts.hideOnClose !== false) { 5590 Thumbs.$grid.hide(); 5591 } 5592 } 5593 }); 5594})(document, jQuery); 5595//// ========================================================================== 5596// 5597// Share 5598// Displays simple form for sharing current url 5599// 5600// ========================================================================== 5601(function (document, $) { 5602 "use strict"; 5603 5604 $.extend(true, $.fancybox.defaults, { 5605 btnTpl: { 5606 share: '<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}">' + 5607 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg>' + 5608 "</button>" 5609 }, 5610 share: { 5611 url: function (instance, item) { 5612 return ( 5613 (!instance.currentHash && !(item.type === "inline" || item.type === "html") ? item.origSrc || item.src : false) || window.location 5614 ); 5615 }, 5616 tpl: '<div class="fancybox-share">' + 5617 "<h1>{{SHARE}}</h1>" + 5618 "<p>" + 5619 '<a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}">' + 5620 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg>' + 5621 "<span>Facebook</span>" + 5622 "</a>" + 5623 '<a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}">' + 5624 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg>' + 5625 "<span>Twitter</span>" + 5626 "</a>" + 5627 '<a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}">' + 5628 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg>' + 5629 "<span>Pinterest</span>" + 5630 "</a>" + 5631 "</p>" + 5632 '<p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p>' + 5633 "</div>" 5634 } 5635 }); 5636 5637 function escapeHtml(string) { 5638 var entityMap = { 5639 "&": "&", 5640 "<": "<", 5641 ">": ">", 5642 '"': """, 5643 "'": "'", 5644 "/": "/", 5645 "`": "`", 5646 "=": "=" 5647 }; 5648 5649 return String(string).replace(/[&<>"'`=\/]/g, function (s) { 5650 return entityMap[s]; 5651 }); 5652 } 5653 5654 $(document).on("click", "[data-fancybox-share]", function () { 5655 var instance = $.fancybox.getInstance(), 5656 current = instance.current || null, 5657 url, 5658 tpl; 5659 5660 if (!current) { 5661 return; 5662 } 5663 5664 if ($.type(current.opts.share.url) === "function") { 5665 url = current.opts.share.url.apply(current, [instance, current]); 5666 } 5667 5668 tpl = current.opts.share.tpl 5669 .replace(/\{\{media\}\}/g, current.type === "image" ? encodeURIComponent(current.src) : "") 5670 .replace(/\{\{url\}\}/g, encodeURIComponent(url)) 5671 .replace(/\{\{url_raw\}\}/g, escapeHtml(url)) 5672 .replace(/\{\{descr\}\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()) : ""); 5673 5674 $.fancybox.open({ 5675 src: instance.translate(instance, tpl), 5676 type: "html", 5677 opts: { 5678 touch: false, 5679 animationEffect: false, 5680 afterLoad: function (shareInstance, shareCurrent) { 5681 // Close self if parent instance is closing 5682 instance.$refs.container.one("beforeClose.fb", function () { 5683 shareInstance.close(null, 0); 5684 }); 5685 5686 // Opening links in a popup window 5687 shareCurrent.$content.find(".fancybox-share__button").click(function () { 5688 window.open(this.href, "Share", "width=550, height=450"); 5689 return false; 5690 }); 5691 }, 5692 mobile: { 5693 autoFocus: false 5694 } 5695 } 5696 }); 5697 }); 5698})(document, jQuery); 5699// ========================================================================== 5700// 5701// Hash 5702// Enables linking to each modal 5703// 5704// ========================================================================== 5705(function (window, document, $) { 5706 "use strict"; 5707 5708 // Simple $.escapeSelector polyfill (for jQuery prior v3) 5709 if (!$.escapeSelector) { 5710 $.escapeSelector = function (sel) { 5711 var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 5712 var fcssescape = function (ch, asCodePoint) { 5713 if (asCodePoint) { 5714 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 5715 if (ch === "\0") { 5716 return "\uFFFD"; 5717 } 5718 5719 // Control characters and (dependent upon position) numbers get escaped as code points 5720 return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " "; 5721 } 5722 5723 // Other potentially-special ASCII characters get backslash-escaped 5724 return "\\" + ch; 5725 }; 5726 5727 return (sel + "").replace(rcssescape, fcssescape); 5728 }; 5729 } 5730 5731 // Get info about gallery name and current index from url 5732 function parseUrl() { 5733 var hash = window.location.hash.substr(1), 5734 rez = hash.split("-"), 5735 index = rez.length > 1 && /^\+?\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1, 5736 gallery = rez.join("-"); 5737 5738 return { 5739 hash: hash, 5740 /* Index is starting from 1 */ 5741 index: index < 1 ? 1 : index, 5742 gallery: gallery 5743 }; 5744 } 5745 5746 // Trigger click evnt on links to open new fancyBox instance 5747 function triggerFromUrl(url) { 5748 if (url.gallery !== "") { 5749 // If we can find element matching 'data-fancybox' atribute, 5750 // then triggering click event should start fancyBox 5751 $("[data-fancybox='" + $.escapeSelector(url.gallery) + "']") 5752 .eq(url.index - 1) 5753 .focus() 5754 .trigger("click.fb-start"); 5755 } 5756 } 5757 5758 // Get gallery name from current instance 5759 function getGalleryID(instance) { 5760 var opts, ret; 5761 5762 if (!instance) { 5763 return false; 5764 } 5765 5766 opts = instance.current ? instance.current.opts : instance.opts; 5767 ret = opts.hash || (opts.$orig ? opts.$orig.data("fancybox") || opts.$orig.data("fancybox-trigger") : ""); 5768 5769 return ret === "" ? false : ret; 5770 } 5771 5772 // Start when DOM becomes ready 5773 $(function () { 5774 // Check if user has disabled this module 5775 if ($.fancybox.defaults.hash === false) { 5776 return; 5777 } 5778 5779 // Update hash when opening/closing fancyBox 5780 $(document).on({ 5781 "onInit.fb": function (e, instance) { 5782 var url, gallery; 5783 5784 if (instance.group[instance.currIndex].opts.hash === false) { 5785 return; 5786 } 5787 5788 url = parseUrl(); 5789 gallery = getGalleryID(instance); 5790 5791 // Make sure gallery start index matches index from hash 5792 if (gallery && url.gallery && gallery == url.gallery) { 5793 instance.currIndex = url.index - 1; 5794 } 5795 }, 5796 5797 "beforeShow.fb": function (e, instance, current, firstRun) { 5798 var gallery; 5799 5800 if (!current || current.opts.hash === false) { 5801 return; 5802 } 5803 5804 // Check if need to update window hash 5805 gallery = getGalleryID(instance); 5806 5807 if (!gallery) { 5808 return; 5809 } 5810 5811 // Variable containing last hash value set by fancyBox 5812 // It will be used to determine if fancyBox needs to close after hash change is detected 5813 instance.currentHash = gallery + (instance.group.length > 1 ? "-" + (current.index + 1) : ""); 5814 5815 // If current hash is the same (this instance most likely is opened by hashchange), then do nothing 5816 if (window.location.hash === "#" + instance.currentHash) { 5817 return; 5818 } 5819 5820 if (firstRun && !instance.origHash) { 5821 instance.origHash = window.location.hash; 5822 } 5823 5824 if (instance.hashTimer) { 5825 clearTimeout(instance.hashTimer); 5826 } 5827 5828 // Update hash 5829 instance.hashTimer = setTimeout(function () { 5830 if ("replaceState" in window.history) { 5831 window.history[firstRun ? "pushState" : "replaceState"]({}, 5832 document.title, 5833 window.location.pathname + window.location.search + "#" + instance.currentHash 5834 ); 5835 5836 if (firstRun) { 5837 instance.hasCreatedHistory = true; 5838 } 5839 } else { 5840 window.location.hash = instance.currentHash; 5841 } 5842 5843 instance.hashTimer = null; 5844 }, 300); 5845 }, 5846 5847 "beforeClose.fb": function (e, instance, current) { 5848 if (!current || current.opts.hash === false) { 5849 return; 5850 } 5851 5852 clearTimeout(instance.hashTimer); 5853 5854 // Goto previous history entry 5855 if (instance.currentHash && instance.hasCreatedHistory) { 5856 window.history.back(); 5857 } else if (instance.currentHash) { 5858 if ("replaceState" in window.history) { 5859 window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash || "")); 5860 } else { 5861 window.location.hash = instance.origHash; 5862 } 5863 } 5864 5865 instance.currentHash = null; 5866 } 5867 }); 5868 5869 // Check if need to start/close after url has changed 5870 $(window).on("hashchange.fb", function () { 5871 var url = parseUrl(), 5872 fb = null; 5873 5874 // Find last fancyBox instance that has "hash" 5875 $.each( 5876 $(".fancybox-container") 5877 .get() 5878 .reverse(), 5879 function (index, value) { 5880 var tmp = $(value).data("FancyBox"); 5881 5882 if (tmp && tmp.currentHash) { 5883 fb = tmp; 5884 return false; 5885 } 5886 } 5887 ); 5888 5889 if (fb) { 5890 // Now, compare hash values 5891 if (fb.currentHash !== url.gallery + "-" + url.index && !(url.index === 1 && fb.currentHash == url.gallery)) { 5892 fb.currentHash = null; 5893 5894 fb.close(); 5895 } 5896 } else if (url.gallery !== "") { 5897 triggerFromUrl(url); 5898 } 5899 }); 5900 5901 // Check current hash and trigger click event on matching element to start fancyBox, if needed 5902 setTimeout(function () { 5903 if (!$.fancybox.getInstance()) { 5904 triggerFromUrl(parseUrl()); 5905 } 5906 }, 50); 5907 }); 5908})(window, document, jQuery); 5909// ========================================================================== 5910// 5911// Wheel 5912// Basic mouse weheel support for gallery navigation 5913// 5914// ========================================================================== 5915(function (document, $) { 5916 "use strict"; 5917 5918 var prevTime = new Date().getTime(); 5919 5920 $(document).on({ 5921 "onInit.fb": function (e, instance, current) { 5922 instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function (e) { 5923 var current = instance.current, 5924 currTime = new Date().getTime(); 5925 5926 if (instance.group.length < 2 || current.opts.wheel === false || (current.opts.wheel === "auto" && current.type !== "image")) { 5927 return; 5928 } 5929 5930 e.preventDefault(); 5931 e.stopPropagation(); 5932 5933 if (current.$slide.hasClass("fancybox-animated")) { 5934 return; 5935 } 5936 5937 e = e.originalEvent || e; 5938 5939 if (currTime - prevTime < 250) { 5940 return; 5941 } 5942 5943 prevTime = currTime; 5944 5945 instance[(-e.deltaY || -e.deltaX || e.wheelDelta || -e.detail) < 0 ? "next" : "previous"](); 5946 }); 5947 } 5948 }); 5949})(document, jQuery);
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.