"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e="undefined"!=typeof globalThis?globalThis:e||self).Plyr=t()}(this,(function(){"use strict";function e(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function t(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function i(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var a={addCSS:!0,thumbWidth:15,watch:!0};var l=function(e){return null!=e?e.constructor:null},r=function(e,t){return!!(e&&t&&e instanceof t)},o=function(e){return null==e},c=function(e){return l(e)===Object},u=function(e){return l(e)===String},h=function(e){return Array.isArray(e)},d=function(e){return r(e,NodeList)},m={nullOrUndefined:o,object:c,number:function(e){return l(e)===Number&&!Number.isNaN(e)},string:u,boolean:function(e){return l(e)===Boolean},function:function(e){return l(e)===Function},array:h,nodeList:d,element:function(e){return r(e,Element)},event:function(e){return r(e,Event)},empty:function(e){return o(e)||(u(e)||h(e)||d(e))&&!e.length||c(e)&&!Object.keys(e).length}};function p(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}var g=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),m.element(t)?this.element=t:m.string(t)&&(this.element=document.querySelector(t)),m.element(this.element)&&m.empty(this.element.rangeTouch)&&(this.config=n({},a,{},i),this.init())}return function(e,i,s){i&&t(e.prototype,i),s&&t(e,s)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!m.event(t))return null;var i,s=t.target,n=t.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,l=parseFloat(s.getAttribute("max"))||100,r=parseFloat(s.getAttribute("step"))||1,o=s.getBoundingClientRect(),c=100/o.width*(this.config.thumbWidth/2)/100;return 0>(i=100/o.width*(n.clientX-o.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),a+p(i/100*(l-a),r)}},{key:"set",value:function(t){e.enabled&&m.event(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=null;if(m.empty(t)||m.string(t)?s=Array.from(document.querySelectorAll(m.string(t)?t:'input[type="range"]')):m.element(t)?s=[t]:m.nodeList(t)?s=Array.from(t):m.array(t)&&(s=t.filter(m.element)),m.empty(s))return null;var l=n({},a,{},i);if(m.string(t)&&l.watch){var r=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){m.element(i)&&function(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}(i,t)&&new e(i,l)}))}))}));r.observe(document.body,{childList:!0,subtree:!0})}return s.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const f=e=>null!=e?e.constructor:null,y=(e,t)=>Boolean(e&&t&&e instanceof t),b=e=>null==e,v=e=>f(e)===Object,w=e=>f(e)===String,T=e=>"function"==typeof e,k=e=>Array.isArray(e),C=e=>y(e,NodeList),A=e=>b(e)||(w(e)||k(e)||C(e))&&!e.length||v(e)&&!Object.keys(e).length;var S={nullOrUndefined:b,object:v,number:e=>f(e)===Number&&!Number.isNaN(e),string:w,boolean:e=>f(e)===Boolean,function:T,array:k,weakMap:e=>y(e,WeakMap),nodeList:C,element:e=>null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument,textNode:e=>f(e)===Text,event:e=>y(e,Event),keyboardEvent:e=>y(e,KeyboardEvent),cue:e=>y(e,window.TextTrackCue)||y(e,window.VTTCue),track:e=>y(e,TextTrack)||!b(e)&&w(e.kind),promise:e=>y(e,Promise)&&T(e.then),url:e=>{if(y(e,window.URL))return!0;if(!w(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!A(new URL(t).hostname)}catch(e){return!1}},empty:A};const E=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((t=>void 0!==e.style[t]));return!!S.string(i)&&t[i]})();function P(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}var M={isIE:Boolean(window.document.documentMode),isEdge:/Edge/g.test(navigator.userAgent),isWebKit:"WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone:/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIPadOS:"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function N(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function x(e={},...t){if(!t.length)return e;const i=t.shift();return S.object(i)?(Object.keys(i).forEach((t=>{S.object(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),x(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),x(e,...t)):e}function L(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const s=i>0?t.cloneNode(!0):t,n=e.parentNode,a=e.nextSibling;s.appendChild(e),a?n.insertBefore(s,a):n.appendChild(s)}))}function I(e,t){S.element(e)&&!S.empty(t)&&Object.entries(t).filter((([,e])=>!S.nullOrUndefined(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function $(e,t,i){const s=document.createElement(e);return S.object(t)&&I(s,t),S.string(i)&&(s.innerText=i),s}function _(e,t,i,s){S.element(t)&&t.appendChild($(e,i,s))}function O(e){S.nodeList(e)||S.array(e)?Array.from(e).forEach(O):S.element(e)&&S.element(e.parentNode)&&e.parentNode.removeChild(e)}function j(e){if(!S.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function q(e,t){return S.element(t)&&S.element(t.parentNode)&&S.element(e)?(t.parentNode.replaceChild(e,t),e):null}function D(e,t){if(!S.string(e)||S.empty(e))return{};const i={},s=x({},t);return e.split(",").forEach((e=>{const t=e.trim(),n=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),[l]=a,r=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":S.string(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[l]=r}})),x(s,i)}function H(e,t){if(!S.element(e))return;let i=t;S.boolean(i)||(i=!e.hidden),e.hidden=i}function R(e,t,i){if(S.nodeList(e))return Array.from(e).map((e=>R(e,t,i)));if(S.element(e)){let s="toggle";return void 0!==i&&(s=i?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function F(e,t){return S.element(e)&&e.classList.contains(t)}function V(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function U(e){return this.elements.container.querySelectorAll(e)}function B(e){return this.elements.container.querySelector(e)}function W(e=null,t=!1){S.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const z={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},K={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=K[e]||"html5"!==t;return{api:i,ui:i&&K.rangeInput}},pip:!(M.isIPhone||!S.function($("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||$("video").disablePictureInPicture)),airplay:S.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(S.empty(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(z).includes(i)&&(i+=`; codecs="${z[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==E,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Y=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})();function Q(e,t,i,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||S.empty(t)||!S.function(i))return;const l=t.split(" ");let r=a;Y&&(r={passive:n,capture:a}),l.forEach((t=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:t,callback:i,options:r}),e[s?"addEventListener":"removeEventListener"](t,i,r)}))}function X(e,t="",i,s=!0,n=!1){Q.call(this,e,t,i,!0,s,n)}function J(e,t="",i,s=!0,n=!1){Q.call(this,e,t,i,!1,s,n)}function G(e,t="",i,s=!0,n=!1){const a=(...l)=>{J(e,t,a,s,n),i.apply(this,l)};Q.call(this,e,t,a,!0,s,n)}function Z(e,t="",i=!1,s={}){if(!S.element(e)||S.empty(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...s,plyr:this}});e.dispatchEvent(n)}function ee(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:s,options:n}=e;t.removeEventListener(i,s,n)})),this.eventListeners=[])}function te(){return new Promise((e=>this.ready?setTimeout(e,0):X.call(this,this.elements.container,"ready",e))).then((()=>{}))}function ie(e){S.promise(e)&&e.then(null,(()=>{}))}function se(e){return S.array(e)?e.filter(((t,i)=>e.indexOf(t)===i)):e}function ne(e,t){return S.array(e)&&e.length?e.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e)):null}function ae(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const le=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce(((e,[t,i])=>({...e,[t/i]:[t,i]})),{});function re(e){if(!(S.array(e)||S.string(e)&&e.includes(":")))return!1;return(S.array(e)?e:e.split(":")).map(Number).every(S.number)}function oe(e){if(!S.array(e)||!e.every(S.number))return null;const[t,i]=e,s=(e,t)=>0===t?e:s(t,e%t),n=s(t,i);return[t/n,i/n]}function ce(e){const t=e=>re(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!S.empty(this.embed)&&S.array(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return oe(i)}function ue(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=ce.call(this,e);if(!S.array(i))return{};const[s,n]=oe(i),a=100/s*n;if(ae(`aspect-ratio: ${s}/${n}`)?t.style.aspectRatio=`${s}/${n}`:t.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-a)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:i}}function he(e,t,i=.05){const s=e/t,n=ne(Object.keys(le),s);return Math.abs(n-s)<=i?le[n]:[e,t]}const de={getSources(){if(!this.isHTML5)return[];return Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!S.empty(t)||K.mime.call(this,t)}))},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:de.getSources.call(this).map((e=>Number(e.getAttribute("size")))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,S.empty(this.config.ratio)||ue.call(e),Object.defineProperty(e.media,"quality",{get(){const t=de.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&S.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=de.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!i)return;const{currentTime:s,paused:n,preload:a,readyState:l,playbackRate:r}=e.media;e.media.src=i.getAttribute("src"),("none"!==a||l)&&(e.once("loadedmetadata",(()=>{e.speed=r,e.currentTime=s,n||ie(e.play())})),e.media.load())}Z.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(O(de.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function me(e,...t){return S.empty(e)?e:e.toString().replace(/{(\d+)}/g,((e,i)=>t[i].toString()))}const pe=(e="",t="",i="")=>e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString()),ge=(e="")=>e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));function fe(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=pe(t,"-"," "),t=pe(t,"_"," "),t=ge(t),pe(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}function ye(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const be={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},ve={get(e="",t={}){if(S.empty(e)||S.empty(t))return"";let i=N(t.i18n,e);if(S.empty(i))return Object.keys(be).includes(e)?be[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach((([e,t])=>{i=pe(i,e,t)})),i}};class we{constructor(t){e(this,"get",(e=>{if(!we.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(S.empty(t))return null;const i=JSON.parse(t);return S.string(e)&&e.length?i[e]:i})),e(this,"set",(e=>{if(!we.supported||!this.enabled)return;if(!S.object(e))return;let t=this.get();S.empty(t)&&(t={}),x(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch(e){}})),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}function Te(e,t="text"){return new Promise(((i,s)=>{try{const s=new XMLHttpRequest;if(!("withCredentials"in s))return;s.addEventListener("load",(()=>{if("text"===t)try{i(JSON.parse(s.responseText))}catch(e){i(s.responseText)}else i(s.response)})),s.addEventListener("error",(()=>{throw new Error(s.status)})),s.open("GET",e,!0),s.responseType=t,s.send()}catch(e){s(e)}}))}function ke(e,t){if(!S.string(e))return;const i="cache",s=S.string(t);let n=!1;const a=()=>null!==document.getElementById(t),l=(e,t)=>{e.innerHTML=t,s&&a()||document.body.insertAdjacentElement("afterbegin",e)};if(!s||!a()){const a=we.supported,r=document.createElement("div");if(r.setAttribute("hidden",""),s&&r.setAttribute("id",t),a){const e=window.localStorage.getItem(`${i}-${t}`);if(n=null!==e,n){const t=JSON.parse(e);l(r,t.content)}}Te(e).then((e=>{if(!S.empty(e)){if(a)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:e}))}catch(e){}l(r,e)}})).catch((()=>{}))}}const Ce=e=>Math.trunc(e/60/60%60,10),Ae=e=>Math.trunc(e/60%60,10),Se=e=>Math.trunc(e%60,10);function Ee(e=0,t=!1,i=!1){if(!S.number(e))return Ee(void 0,t,i);const s=e=>`0${e}`.slice(-2);let n=Ce(e);const a=Ae(e),l=Se(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${s(a)}:${s(l)}`}const Pe={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||M.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=B.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:U.call(this,this.config.selectors.buttons.play),pause:B.call(this,this.config.selectors.buttons.pause),restart:B.call(this,this.config.selectors.buttons.restart),rewind:B.call(this,this.config.selectors.buttons.rewind),fastForward:B.call(this,this.config.selectors.buttons.fastForward),mute:B.call(this,this.config.selectors.buttons.mute),pip:B.call(this,this.config.selectors.buttons.pip),airplay:B.call(this,this.config.selectors.buttons.airplay),settings:B.call(this,this.config.selectors.buttons.settings),captions:B.call(this,this.config.selectors.buttons.captions),fullscreen:B.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=B.call(this,this.config.selectors.progress),this.elements.inputs={seek:B.call(this,this.config.selectors.inputs.seek),volume:B.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:B.call(this,this.config.selectors.display.buffer),currentTime:B.call(this,this.config.selectors.display.currentTime),duration:B.call(this,this.config.selectors.display.duration)},S.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",s=Pe.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");I(a,x(t,{"aria-hidden":"true",focusable:"false"}));const l=document.createElementNS(i,"use"),r=`${n}-${e}`;return"href"in l&&l.setAttributeNS("http://www.w3.org/1999/xlink","href",r),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),a.appendChild(l),a},createLabel(e,t={}){const i=ve.get(e,this.config);return $("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(S.empty(e))return null;const t=$("span",{class:this.config.classNames.menu.value});return t.appendChild($("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=x({},t);let s=fe(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])})),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((e=>e===this.config.classNames.control))||x(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:S.empty(n.label)&&(n.label=s),S.empty(n.icon)&&(n.icon=e)}const a=$(n.element);return n.toggle?(a.appendChild(Pe.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(Pe.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(Pe.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(Pe.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(Pe.createIcon.call(this,n.icon)),a.appendChild(Pe.createLabel.call(this,n.label))),x(i,D(this.config.selectors.buttons[s],i)),I(a,i),"play"===s?(S.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,t){const i=$("input",x(D(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":ve.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Pe.updateRangeFill.call(this,i),g.setup(i),i},createProgress(e,t){const i=$("progress",x(D(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild($("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],s=t?ve.get(t,this.config):"";i.innerText=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=D(this.config.selectors.display[e],t),s=$("div",x(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":ve.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){X.call(this,e,"keydown keyup",(i=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const s=V(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(i.key))Pe.showMenuPanel.call(this,t,!0);else{let t;" "!==i.key&&("ArrowDown"===i.key||s&&"ArrowRight"===i.key?(t=e.nextElementSibling,S.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,S.element(t)||(t=e.parentNode.lastElementChild)),W.call(this,t,!0))}}),!1),X.call(this,e,"keyup",(e=>{"Return"===e.key&&Pe.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:s,badge:n=null,checked:a=!1}){const l=D(this.config.selectors.inputs[i]),r=$("button",x(l,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${l.class?l.class:""}`.trim(),"aria-checked":a,value:e})),o=$("span");o.innerHTML=s,S.element(n)&&o.appendChild(n),r.appendChild(o),Object.defineProperty(r,"checked",{enumerable:!0,get:()=>"true"===r.getAttribute("aria-checked"),set(e){e&&Array.from(r.parentNode.children).filter((e=>V(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),r.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(r,"click keyup",(t=>{if(!S.keyboardEvent(t)||" "===t.key){switch(t.preventDefault(),t.stopPropagation(),r.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}Pe.showMenuPanel.call(this,"home",S.keyboardEvent(t))}}),i,!1),Pe.bindMenuItemShortcuts.call(this,r,i),t.appendChild(r)},formatTime(e=0,t=!1){if(!S.number(e))return e;return Ee(e,Ce(this.duration)>0,t)},updateTimeDisplay(e=null,t=0,i=!1){S.element(e)&&S.number(t)&&(e.innerText=Pe.formatTime(t,i))},updateVolume(){this.supported.ui&&(S.element(this.elements.inputs.volume)&&Pe.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),S.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){S.element(e)&&(e.value=t,Pe.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!S.event(e))return;let t=0;const i=(e,t)=>{const i=S.number(t)?t:0,s=S.element(e)?e:this.elements.display.buffer;if(S.element(s)){s.value=i;const e=s.getElementsByTagName("span")[0];S.element(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":s=this.currentTime,n=this.duration,t=0===s||0===n||Number.isNaN(s)||Number.isNaN(n)?0:(s/n*100).toFixed(2),"timeupdate"===e.type&&Pe.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var s,n},updateRangeFill(e){const t=S.event(e)?e.target:e;if(S.element(t)&&"range"===t.getAttribute("type")){if(V(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=Pe.formatTime(this.currentTime),i=Pe.formatTime(this.duration),s=ve.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",e).replace("{duration}",i))}else if(V(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);(M.isWebKit||M.isIPadOS)&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,i;if(!this.config.tooltips.seek||!S.element(this.elements.inputs.seek)||!S.element(this.elements.display.seekTooltip)||0===this.duration)return;const s=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,a=e=>R(s,n,e);if(this.touch)return void a(!1);let l=0;const r=this.elements.progress.getBoundingClientRect();if(S.event(e))l=100/r.width*(e.pageX-r.left);else{if(!F(s,n))return;l=parseFloat(s.style.left,10)}l<0?l=0:l>100&&(l=100);const o=this.duration/100*l;s.innerText=Pe.formatTime(o);const c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(o)));c&&s.insertAdjacentHTML("afterbegin",`${c.label}<br>`),s.style.left=`${l}%`,S.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)},timeUpdate(e){const t=!S.element(this.elements.display.duration)&&this.config.invertTime;Pe.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Pe.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return H(this.elements.display.currentTime,!0),void H(this.elements.progress,!0);S.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=S.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Pe.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Pe.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Pe.setMarkers.call(this),Pe.updateSeekTooltip.call(this)},toggleMenuButton(e,t){H(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const s=this.elements.settings.panels[e];let n=null,a=t;if("captions"===e)n=this.currentTrack;else{if(n=S.empty(i)?this[e]:i,S.empty(n)&&(n=this.config[e].default),!S.empty(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(S.element(a)||(a=s&&s.querySelector('[role="menu"]')),!S.element(a))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Pe.getLabel.call(this,e,n);const l=a&&a.querySelector(`[value="${n}"]`);S.element(l)&&(l.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?ve.get("normal",this.config):`${t}×`;case"quality":if(S.number(t)){const e=ve.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return ge(t);case"captions":return xe.getLabel.call(this);default:return null}},setQualityMenu(e){if(!S.element(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');S.array(e)&&(this.options.quality=se(e).filter((e=>this.config.quality.options.includes(e))));const s=!S.empty(this.options.quality)&&this.options.quality.length>1;if(Pe.toggleMenuButton.call(this,t,s),j(i),Pe.checkMenu.call(this),!s)return;const n=e=>{const t=ve.get(`qualityBadge.${e}`,this.config);return t.length?Pe.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1})).forEach((e=>{Pe.createMenuItem.call(this,{value:e,list:i,type:t,title:Pe.getLabel.call(this,"quality",e),badge:n(e)})})),Pe.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!S.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=xe.getTracks.call(this),s=Boolean(i.length);if(Pe.toggleMenuButton.call(this,e,s),j(t),Pe.checkMenu.call(this),!s)return;const n=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:xe.getLabel.call(this,e),badge:e.language&&Pe.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));n.unshift({value:-1,checked:!this.captions.toggled,title:ve.get("disabled",this.config),list:t,type:"language"}),n.forEach(Pe.createMenuItem.bind(this)),Pe.updateSetting.call(this,e,t)},setSpeedMenu(){if(!S.element(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const i=!S.empty(this.options.speed)&&this.options.speed.length>1;Pe.toggleMenuButton.call(this,e,i),j(t),Pe.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{Pe.createMenuItem.call(this,{value:i,list:t,type:e,title:Pe.getLabel.call(this,"speed",i)})})),Pe.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!S.empty(e)&&Object.values(e).some((e=>!e.hidden));H(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;S.element(i)||(i=Object.values(this.elements.settings.panels).find((e=>!e.hidden)));const s=i.querySelector('[role^="menuitem"]');W.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!S.element(t)||!S.element(i))return;const{hidden:s}=t;let n=s;if(S.boolean(e))n=e;else if(S.keyboardEvent(e)&&"Escape"===e.key)n=!1;else if(S.event(e)){const s=S.function(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(s);if(a||!a&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),H(t,!n),R(this.elements.container,this.config.classNames.menu.open,n),n&&S.keyboardEvent(e)?Pe.focusFirstMenuItem.call(this,null,!0):n||s||W.call(this,i,S.keyboardEvent(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,s=t.scrollHeight;return O(t),{width:i,height:s}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!S.element(i))return;const s=i.parentNode,n=Array.from(s.children).find((e=>!e.hidden));if(K.transitions&&!K.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const e=Pe.getMenuSize.call(this,i),t=e=>{e.target===s&&["width","height"].includes(e.propertyName)&&(s.style.width="",s.style.height="",J.call(this,s,E,t))};X.call(this,s,E,t),s.style.width=`${e.width}px`,s.style.height=`${e.height}px`}H(n,!0),H(i,!1),Pe.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;S.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:s,createRange:n,createTime:a,setQualityMenu:l,setSpeedMenu:r,showMenuPanel:o}=Pe;this.elements.controls=null,S.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=$("div",D(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return se(S.array(this.config.controls)?this.config.controls:[]).forEach((l=>{if("restart"===l&&c.appendChild(i.call(this,"restart",u)),"rewind"===l&&c.appendChild(i.call(this,"rewind",u)),"play"===l&&c.appendChild(i.call(this,"play",u)),"fast-forward"===l&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===l){const t=$("div",{class:`${u.class} plyr__progress__container`}),i=$("div",D(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const e=$("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===l&&c.appendChild(a.call(this,"currentTime",u)),"duration"===l&&c.appendChild(a.call(this,"duration",u)),"mute"===l||"volume"===l){let{volume:t}=this.elements;if(S.element(t)&&c.contains(t)||(t=$("div",x({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===l&&t.appendChild(i.call(this,"mute")),"volume"===l&&!M.isIos&&!M.isIPadOS){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",x(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===l&&c.appendChild(i.call(this,"captions",u)),"settings"===l&&!S.empty(this.config.settings)){const s=$("div",x({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));s.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=$("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),a=$("div"),l=$("div",{id:`plyr-settings-${e.id}-home`}),r=$("div",{role:"menu"});l.appendChild(r),a.appendChild(l),this.elements.settings.panels.home=l,this.config.settings.forEach((i=>{const s=$("button",x(D(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,s,i),X.call(this,s,"click",(()=>{o.call(this,i,!1)}));const n=$("span",null,ve.get(i,this.config)),l=$("span",{class:this.config.classNames.menu.value});l.innerHTML=e[i],n.appendChild(l),s.appendChild(n),r.appendChild(s);const c=$("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=$("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild($("span",{"aria-hidden":!0},ve.get(i,this.config))),u.appendChild($("span",{class:this.config.classNames.hidden},ve.get("menuBack",this.config))),X.call(this,c,"keydown",(e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),o.call(this,"home",!0))}),!1),X.call(this,u,"click",(()=>{o.call(this,"home",!1)})),c.appendChild(u),c.appendChild($("div",{role:"menu"})),a.appendChild(c),this.elements.settings.buttons[i]=s,this.elements.settings.panels[i]=c})),n.appendChild(a),s.appendChild(n),c.appendChild(s),this.elements.settings.popup=n,this.elements.settings.menu=s}if("pip"===l&&K.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===l&&K.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===l){const e=x({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!S.url(t)&&this.isEmbed&&x(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===l&&c.appendChild(i.call(this,"fullscreen",u))})),this.isHTML5&&l.call(this,de.getQualityOptions.call(this)),r.call(this),c},inject(){if(this.config.loadSprite){const e=Pe.getIconUrl.call(this);e.cors&&ke(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;S.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),S.element(this.config.controls)||S.string(this.config.controls)?e=this.config.controls:(e=Pe.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:xe.getLabel.call(this)}),i=!1);let s;i&&S.string(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=pe(i,`{${e}}`,t)})),i})(e)),S.string(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),S.element(s)||(s=this.elements.container);if(s[S.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),S.element(this.elements.controls)||Pe.findElements.call(this),!S.empty(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>F(e,t),set(i=!1){R(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{S.array(t)||S.nodeList(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(M.isEdge&&P(s),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,s=U.call(this,i);Array.from(s).forEach((e=>{R(e,this.config.classNames.hidden,!1),R(e,this.config.classNames.tooltip,!0)}))}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(e){}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((({time:e})=>e>0&&e<this.duration));if(null==i||!i.length)return;const s=document.createDocumentFragment(),n=document.createDocumentFragment();let a=null;const l=`${this.config.classNames.tooltip}--visible`,r=e=>R(a,l,e);i.forEach((e=>{const t=$("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";a&&(t.addEventListener("mouseenter",(()=>{e.label||(a.style.left=i,a.innerHTML=e.label,r(!0))})),t.addEventListener("mouseleave",(()=>{r(!1)}))),t.addEventListener("click",(()=>{this.currentTime=e.time})),t.style.left=i,n.appendChild(t)})),s.appendChild(n),this.config.tooltips.seek||(a=$("span",{class:this.config.classNames.tooltip},""),s.appendChild(a)),this.elements.markers={points:n,tip:a},this.elements.progress.appendChild(s)}};function Me(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch(e){return null}}function Ne(e){const t=new URLSearchParams;return S.object(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const xe={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!K.textTracks)return void(S.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Pe.setCaptionsMenu.call(this));var e,t;if(S.element(this.elements.captions)||(this.elements.captions=$("div",D(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,S.element(e)&&S.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),M.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=Me(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Te(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{O(e)}))}))}const i=se((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let s=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===s&&([s]=i);let n=this.storage.get("captions");if(S.boolean(n)||({active:n}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:n,language:s,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";X.call(this,this.media.textTracks,e,xe.update.bind(this))}setTimeout(xe.update.bind(this),0)},update(){const e=xe.getTracks.call(this,!0),{active:t,language:i,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!s.get(e))).forEach((e=>{this.debug.log("Track added",e),s.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),X.call(this,e,"cuechange",(()=>xe.updateCues.call(this)))})),(a&&this.language!==i||!e.includes(n))&&(xe.setLanguage.call(this,i),xe.toggle.call(this,t&&a)),this.elements&&R(this.elements.container,this.config.classNames.captions.enabled,!S.empty(e)),S.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Pe.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,n=S.nullOrUndefined(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=xe.getTracks.call(this),t=xe.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void xe.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),R(this.elements.container,s,n),this.captions.toggled=n,Pe.updateSetting.call(this,"captions"),Z.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout((()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=xe.getTracks.call(this);if(-1!==e)if(S.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=i[e],{language:n}=s||{};this.captions.currentTrackNode=s,Pe.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),Z.call(this,this.media,"languagechange")}xe.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&xe.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else xe.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!S.string(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const s=xe.getTracks.call(this),n=xe.findTrack.call(this,[i]);xe.set.call(this,s.indexOf(n),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const i=xe.getTracks.call(this),s=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort(((e,t)=>s(t)-s(e)));let a;return e.every((e=>(a=n.find((t=>t.language===e)),!a))),a||(t?n[0]:void 0)},getCurrentTrack(){return xe.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!S.track(t)&&K.textTracks&&this.captions.toggled&&(t=xe.getCurrentTrack.call(this)),S.track(t)?S.empty(t.label)?S.empty(t.language)?ve.get("enabled",this.config):e.language.toUpperCase():t.label:ve.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!S.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!S.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=xe.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map(ye)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){j(this.elements.captions);const e=$("span",D(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),Z.call(this,this.media,"cuechange")}}},Le={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.8/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},Ie="picture-in-picture",$e="inline",_e={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Oe="audio",je="video";const qe=()=>{};class De{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):qe}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):qe}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):qe}}class He{constructor(t){e(this,"onChange",(()=>{if(!this.supported)return;const e=this.player.elements.buttons.fullscreen;S.element(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;Z.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),e(this,"toggleFallback",((e=!1)=>{if(e?this.scrollPosition={x:window.scrollX??0,y:window.scrollY??0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",R(this.target,this.player.config.classNames.fullscreen.fallback,e),M.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const s=S.string(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!s,s||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),e(this,"trapFocus",(e=>{if(M.isIos||M.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=U.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=i,n=i[i.length-1];t!==n||e.shiftKey?t===s&&e.shiftKey&&(n.focus(),e.preventDefault()):(s.focus(),e.preventDefault())})),e(this,"update",(()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":He.nativeSupported?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");R(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)})),e(this,"enter",(()=>{this.supported&&(M.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!He.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?S.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),e(this,"exit",(()=>{if(this.supported)if(M.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),ie(this.player.play());else if(!He.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!S.empty(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),e(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=t,this.prefix=He.prefix,this.property=He.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(V.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),X.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),X.call(this.player,this.player.elements.container,"dblclick",(e=>{S.element(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),X.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return He.nativeSupported&&!this.forceFallback}static get prefix(){if(S.function(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!S.function(document[`${t}ExitFullscreen`])&&!S.function(document[`${t}CancelFullScreen`]))&&(e=t,!0))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,He.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||He.nativeSupported||!M.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!He.nativeSupported||this.forceFallback)return F(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return M.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}}function Re(e,t=1){return new Promise(((i,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})}))}const Fe={addStyleHook(){R(this.elements.container,this.config.selectors.container.replace(".",""),!0),R(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Fe.toggleNativeControls.call(this,!0);S.element(this.elements.controls)||(Pe.inject.call(this),this.listeners.controls()),Fe.toggleNativeControls.call(this),this.isHTML5&&xe.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Pe.updateVolume.call(this),Pe.timeUpdate.call(this),Pe.durationUpdate.call(this),Fe.checkPlaying.call(this),R(this.elements.container,this.config.classNames.pip.supported,K.pip&&this.isHTML5&&this.isVideo),R(this.elements.container,this.config.classNames.airplay.supported,K.airplay&&this.isHTML5),R(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{Z.call(this,this.media,"ready")}),0),Fe.setTitle.call(this),this.poster&&Fe.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&Pe.durationUpdate.call(this),this.config.mediaMetadata&&Pe.setMediaMetadata.call(this)},setTitle(){let e=ve.get("play",this.config);if(S.string(this.config.title)&&!S.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach((t=>{t.setAttribute("aria-label",e)})),this.isEmbed){const e=B.call(this,"iframe");if(!S.element(e))return;const t=S.empty(this.config.title)?"video":this.config.title,i=ve.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){R(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),te.call(this).then((()=>Re(e))).catch((t=>{throw e===this.poster&&Fe.togglePoster.call(this,!1),t})).then((()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Fe.togglePoster.call(this,!0),e))))},checkPlaying(e){R(this.elements.container,this.config.classNames.playing,this.playing),R(this.elements.container,this.config.classNames.paused,this.paused),R(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",ve.get(this.playing?"pause":"play",this.config))})),S.event(e)&&"timeupdate"===e.type||Fe.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{R(this.elements.container,this.config.classNames.loading,this.loading),Fe.toggleControls.call(this)}),this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter((e=>!S.empty(e)&&S.string(e)&&e.startsWith("--plyr"))).forEach((e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)})),S.empty(this.media.style)&&this.media.removeAttribute("style")}};class Ve{constructor(t){e(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,R(t.container,e.config.classNames.isTouch,!0)})),e(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&Q.call(t,window,"keydown keyup",this.handleKey,e,!1),Q.call(t,document.body,"click",this.toggleMenu,e),G.call(t,document.body,"touchstart",this.firstTouch)})),e(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:s}=e;!t.keyboard.global&&t.keyboard.focused&&X.call(e,i.container,"keydown keyup",this.handleKey,!1),X.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);let a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(Fe.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout((()=>Fe.toggleControls.call(e,!1)),a)}));const n=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:s}=e.fullscreen,[n,a]=ce.call(e),l=ae(`aspect-ratio: ${n} / ${a}`);if(!s)return void(l?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[r,o]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=r/o>n/a;l?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?o/a*n+"px":null,t.style.margin=c?"0 auto":null)},a=()=>{clearTimeout(s.resized),s.resized=setTimeout(n,50)};X.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:s}=e.fullscreen;if(s!==i.container)return;if(!e.isEmbed&&S.empty(e.config.ratio))return;n();("enterfullscreen"===t.type?X:J).call(e,window,"resize",a)}))})),e(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(X.call(e,e.media,"timeupdate seeking seeked",(t=>Pe.timeUpdate.call(e,t))),X.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>Pe.durationUpdate.call(e,t))),X.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),X.call(e,e.media,"progress playing seeking seeked",(t=>Pe.updateProgress.call(e,t))),X.call(e,e.media,"volumechange",(t=>Pe.updateVolume.call(e,t))),X.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>Fe.checkPlaying.call(e,t))),X.call(e,e.media,"waiting canplay seeked playing",(t=>Fe.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=B.call(e,`.${e.config.classNames.video}`);if(!S.element(i))return;X.call(e,t.container,"click",(s=>{([t.container,i].includes(s.target)||i.contains(s.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(s,e.restart,"restart"),this.proxy(s,(()=>{ie(e.play())}),"play")):this.proxy(s,(()=>{ie(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&X.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),X.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),X.call(e,e.media,"ratechange",(()=>{Pe.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),X.call(e,e.media,"qualitychange",(t=>{Pe.updateSetting.call(e,"quality",null,t.detail.quality)})),X.call(e,e.media,"ready qualitychange",(()=>{Pe.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");X.call(e,e.media,i,(i=>{let{detail:s={}}=i;"error"===i.type&&(s=e.media.error),Z.call(e,t.container,i.type,!0,s)}))})),e(this,"proxy",((e,t,i)=>{const{player:s}=this,n=s.config.listeners[i];let a=!0;S.function(n)&&(a=n.call(s,e)),!1!==a&&S.function(t)&&t.call(s,e)})),e(this,"bind",((e,t,i,s,n=!0)=>{const{player:a}=this,l=a.config.listeners[s],r=S.function(l);X.call(a,e,t,(e=>this.proxy(e,i,s)),n&&!r)})),e(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=M.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{ie(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{Z.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),Pe.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),Pe.toggleMenu.call(e,t)):Pe.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{"Escape"===t.key&&Pe.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),s=100/i.width*(e.pageX-i.left);e.currentTarget.setAttribute("seek-value",s)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,s="play-on-seeked";if(S.keyboardEvent(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const n=i.hasAttribute(s),a=["mouseup","touchend","keyup"].includes(t.type);n&&a?(i.removeAttribute(s),ie(e.play())):!a&&e.playing&&(i.setAttribute(s,""),e.pause())})),M.isIos){const t=U.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>P(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let s=i.getAttribute("seek-value");S.empty(s)&&(s=i.value),i.removeAttribute("seek-value"),e.currentTime=s/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>Pe.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)})),M.isWebKit&&Array.from(U.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>Pe.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!S.element(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,Pe.timeUpdate.call(e))})),this.bind(t.inputs.volume,i,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((i=>{this.bind(i,"mouseenter mouseleave",(i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:i,timers:s}=e;R(t.controls,i.classNames.noTransition,!0),Fe.toggleControls.call(e,!0),setTimeout((()=>{R(t.controls,i.classNames.noTransition,!1)}),0);const n=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout((()=>Fe.toggleControls.call(e,!1)),n)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[s,n]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),a=Math.sign(Math.abs(s)>Math.abs(n)?s:n);e.increaseVolume(a/50);const{volume:l}=e.media;(1===a&&l<1||-1===a&&l>0)&&t.preventDefault()}),"volume",!1)})),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:s,type:n,altKey:a,ctrlKey:l,metaKey:r,shiftKey:o}=e,c="keydown"===n,u=c&&s===this.lastKey;if(a||l||r||o)return;if(!s)return;if(c){const n=document.activeElement;if(S.element(n)){const{editable:s}=t.config.selectors,{seek:a}=i.inputs;if(n!==a&&V(n,s))return;if(" "===e.key&&V(n,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(s)&&(e.preventDefault(),e.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(h=parseInt(s,10),t.currentTime=t.duration/10*h);break;case" ":case"k":u||ie(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":u||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":u||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===s&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null;var h}toggleMenu(e){Pe.toggleMenu.call(this.player,e)}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Ue=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(){var e=function(){},t={},i={},s={};function n(e,t){e=e.push?e:[e];var n,a,l,r=[],o=e.length,c=o;for(n=function(e,i){i.length&&r.push(e),--c||t(r)};o--;)a=e[o],(l=i[a])?n(a,l):(s[a]=s[a]||[]).push(n)}function a(e,t){if(e){var n=s[e];if(i[e]=t,n)for(;n.length;)n[0](e,t),n.splice(0,1)}}function l(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function r(t,i,s,n){var a,l,o=document,c=s.async,u=(s.numRetries||0)+1,h=s.before||e,d=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img)!/,"");n=n||0,/(^css!|\.css$)/.test(d)?((l=o.createElement("link")).rel="stylesheet",l.href=m,(a="hideFocus"in l)&&l.relList&&(a=0,l.rel="preload",l.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(d)?(l=o.createElement("img")).src=m:((l=o.createElement("script")).src=t,l.async=void 0===c||c),l.onload=l.onerror=l.onbeforeload=function(e){var o=e.type[0];if(a)try{l.sheet.cssText.length||(o="e")}catch(e){18!=e.code&&(o="e")}if("e"==o){if((n+=1)<u)return r(t,i,s,n)}else if("preload"==l.rel&&"style"==l.as)return l.rel="stylesheet";i(t,o,e.defaultPrevented)},!1!==h(t,l)&&o.head.appendChild(l)}function o(e,t,i){var s,n,a=(e=e.push?e:[e]).length,l=a,o=[];for(s=function(e,i,s){if("e"==i&&o.push(e),"b"==i){if(!s)return;o.push(e)}--a||t(o)},n=0;n<l;n++)r(e[n],s,i)}function c(e,i,s){var n,r;if(i&&i.trim&&(n=i),r=(n?s:i)||{},n){if(n in t)throw"LoadJS";t[n]=!0}function c(t,i){o(e,(function(e){l(r,e),t&&l({success:t,error:i},e),a(n,e)}),r)}if(r.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return n(e,(function(e){l(t,e)})),c},c.done=function(e){a(e,[])},c.reset=function(){t={},i={},s={}},c.isDefined=function(e){return e in t},c}()}));function Be(e){return new Promise(((t,i)=>{Ue(e,{success:t,error:i})}))}function We(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Z.call(this,this.media,e?"play":"pause"))}const ze={setup(){const e=this;R(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,ue.call(e),S.object(window.Vimeo)?ze.ready.call(e):Be(e.config.urls.vimeo.sdk).then((()=>{ze.ready.call(e)})).catch((t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:s,...n}=t;let a=e.media.getAttribute("src"),l="";S.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),l=e.media.getAttribute(e.config.attributes.embed.hash)):l=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(a);const r=l?{h:l}:{};i&&Object.assign(n,{controls:!1,sidedock:!1});const o=Ne({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...r,...n}),c=(u=a,S.empty(u)?null:S.number(Number(u))?u:u.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:u);var u;const h=$("iframe"),d=me(e.config.urls.vimeo.iframe,c,o);if(h.setAttribute("src",d),h.setAttribute("allowfullscreen",""),h.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),S.empty(s)||h.setAttribute("referrerPolicy",s),i||!t.customControls)h.setAttribute("data-poster",e.poster),e.media=q(h,e.media);else{const t=$("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(h),e.media=q(t,e.media)}t.customControls||Te(me(e.config.urls.vimeo.api,d)).then((t=>{!S.empty(t)&&t.thumbnail_url&&Fe.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(h,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(We.call(e,!0),e.embed.play()),e.media.pause=()=>(We.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:m}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>m,set(t){const{embed:i,media:s,paused:n,volume:a}=e,l=n&&!i.hasPlayed;s.seeking=!0,Z.call(e,s,"seeking"),Promise.resolve(l&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>l&&i.pause())).then((()=>l&&i.setVolume(a))).catch((()=>{}))}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>p,set(t){e.embed.setPlaybackRate(t).then((()=>{p=t,Z.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:g}=e.config;Object.defineProperty(e.media,"volume",{get:()=>g,set(t){e.embed.setVolume(t).then((()=>{g=t,Z.call(e,e.media,"volumechange")}))}});let{muted:f}=e.config;Object.defineProperty(e.media,"muted",{get:()=>f,set(t){const i=!!S.boolean(t)&&t;e.embed.setMuted(!!i||e.config.muted).then((()=>{f=i,Z.call(e,e.media,"volumechange")}))}});let y,{loop:b}=e.config;Object.defineProperty(e.media,"loop",{get:()=>b,set(t){const i=S.boolean(t)?t:e.config.loop.active;e.embed.setLoop(i).then((()=>{b=i}))}}),e.embed.getVideoUrl().then((t=>{y=t,Pe.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>y}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[i,s]=t;e.embed.ratio=he(i,s),ue.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,Fe.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{m=t,Z.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,Z.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,xe.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const i=t.map((e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText}(e.text)));xe.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{if(e.embed.getPaused().then((t=>{We.call(e,!t),t||Z.call(e,e.media,"playing")})),S.element(e.embed.element)&&e.supported.ui){e.embed.element.setAttribute("tabindex",-1)}})),e.embed.on("bufferstart",(()=>{Z.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{Z.call(e,e.media,"playing")})),e.embed.on("play",(()=>{We.call(e,!0),Z.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{We.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,m=t.seconds,Z.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,Z.call(e,e.media,"progress"),1===parseInt(t.percent,10)&&Z.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,Z.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,Z.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,Z.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,Z.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>Fe.build.call(e)),0)}};function Ke(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Z.call(this,this.media,e?"play":"pause"))}function Ye(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const Qe={setup(){if(R(this.elements.wrapper,this.config.classNames.embed,!0),S.object(window.YT)&&S.function(window.YT.Player))Qe.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{S.function(e)&&e(),Qe.ready.call(this)},Be(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){Te(me(this.config.urls.youtube.api,e)).then((e=>{if(S.object(e)){const{title:t,height:i,width:s}=e;this.config.title=t,Fe.setTitle.call(this),this.embed.ratio=he(s,i)}ue.call(this)})).catch((()=>{ue.call(this)}))},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!S.empty(i)&&i.startsWith("youtube-"))return;let s=e.media.getAttribute("src");S.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=(a=s,S.empty(a)?null:a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:a);var a;const l=$("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=q(l,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;Re(t("maxres"),121).catch((()=>Re(t("sd"),121))).catch((()=>Re(t("hq")))).then((t=>Fe.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:n,host:Ye(t),playerVars:x({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,s={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occurred";e.media.error={code:i,message:s},Z.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),Z.call(e,e.media,"ratechange")},onReady(i){if(S.function(e.media.play))return;const s=i.target;Qe.getTitle.call(e,n),e.media.play=()=>{Ke.call(e,!0),s.playVideo()},e.media.pause=()=>{Ke.call(e,!1),s.pauseVideo()},e.media.stop=()=>{s.stopVideo()},e.media.duration=s.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(s.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Z.call(e,e.media,"seeking"),s.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>s.getPlaybackRate(),set(e){s.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get:()=>a,set(t){a=t,s.setVolume(100*a),Z.call(e,e.media,"volumechange")}});let{muted:l}=e.config;Object.defineProperty(e.media,"muted",{get:()=>l,set(t){const i=S.boolean(t)?t:l;l=i,s[i?"mute":"unMute"](),s.setVolume(100*a),Z.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>s.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const r=s.getAvailablePlaybackRates();e.options.speed=r.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),Z.call(e,e.media,"timeupdate"),Z.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=s.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Z.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Z.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((()=>Fe.build.call(e)),50)},onStateChange(i){const s=i.target;clearInterval(e.timers.playing);switch(e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,Z.call(e,e.media,"seeked")),i.data){case-1:Z.call(e,e.media,"timeupdate"),e.media.buffered=s.getVideoLoadedFraction(),Z.call(e,e.media,"progress");break;case 0:Ke.call(e,!1),e.media.loop?(s.stopVideo(),s.playVideo()):Z.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Ke.call(e,!0),Z.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{Z.call(e,e.media,"timeupdate")}),50),e.media.duration!==s.getDuration()&&(e.media.duration=s.getDuration(),Z.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),Ke.call(e,!1);break;case 3:Z.call(e,e.media,"waiting")}Z.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},Xe={setup(){this.media?(R(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),R(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&R(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=$("div",{class:this.config.classNames.video}),L(this.media,this.elements.wrapper),this.elements.poster=$("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?de.setup.call(this):this.isYouTube?Qe.setup.call(this):this.isVimeo&&ze.setup.call(this)):this.debug.warn("No media element found!")}};class Je{constructor(t){e(this,"load",(()=>{this.enabled&&(S.object(window.google)&&S.object(window.google.ima)?this.ready():Be(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),e(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),e(this,"setupIMA",(()=>{this.elements.container=$("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),e(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),e(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=Ee(Math.max(this.manager.getRemainingTime(),0)),t=`${ve.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),e(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),e(this,"addCuePoints",(()=>{S.empty(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(S.element(t)){const i=100/this.player.duration*e,s=$("span",{class:this.player.config.classNames.cues});s.style.left=`${i.toString()}%`,t.appendChild(s)}}}))})),e(this,"onAdEvent",(e=>{const{container:t}=this.player.elements,i=e.getAd(),s=e.getAdData();switch((e=>{Z.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:s.adError&&this.player.debug.warn(`Non-fatal ad error: ${s.adError.getMessage()}`)}})),e(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),e(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;S.empty(this.cuePoints)||this.cuePoints.forEach(((i,s)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(s,1))}))})),window.addEventListener("resize",(()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),e(this,"play",(()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then((()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),e(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,ie(this.player.media.play())})),e(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),e(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),e(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),e(this,"trigger",((e,...t)=>{const i=this.events[e];S.array(i)&&i.forEach((e=>{S.function(e)&&e.apply(this,t)}))})),e(this,"on",((e,t)=>(S.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),e(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),e(this,"clearSafetyTimer",(e=>{S.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!S.empty(e.publisherId)||S.url(e.tagUrl))}get tagUrl(){const{config:e}=this;if(S.url(e.tagUrl))return e.tagUrl;return`https://go.aniview.com/api/adserver6/vast/?${Ne({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function Ge(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}const Ze=e=>{const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const i={};e.split(/\r\n|\n|\r/).forEach((e=>{if(S.number(i.startTime)){if(!S.empty(e.trim())&&S.empty(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),i.text&&t.push(i)})),t},et=(e,t)=>{const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i};class tt{constructor(t){e(this,"load",(()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)}))})),e(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(S.empty(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(S.function(t))t((e=>{this.thumbnails=e,i()}));else{const e=(S.string(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(i)}})))),e(this,"getThumbnail",(e=>new Promise((t=>{Te(e).then((i=>{const s={frames:Ze(i),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||s.frames[0].text.startsWith("http://")||s.frames[0].text.startsWith("https://")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{s.height=n.naturalHeight,s.width=n.naturalWidth,this.thumbnails.push(s),t()},n.src=s.urlPrefix+s.frames[0].text}))})))),e(this,"startMove",(e=>{if(this.loaded&&S.event(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t,i;const s=this.player.elements.progress.getBoundingClientRect(),n=100/s.width*(e.pageX-s.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Ee(this.seekTime);const a=null===(t=this.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(this.seekTime)));a&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${a.label}<br>`)}this.showImageAtCurrentTime()}})),e(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),e(this,"startScrubbing",(e=>{(S.nullOrUndefined(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),e(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):G.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),e(this,"listeners",(()=>{this.player.on("play",(()=>{this.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(()=>{this.toggleThumbContainer(!1)})),this.player.on("timeupdate",(()=>{this.lastTime=this.player.media.currentTime}))})),e(this,"render",(()=>{this.elements.thumb.container=$("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=$("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=$("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=$("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),S.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=$("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),e(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),e(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,s)=>{this.loadedImages.includes(t.frames[e].text)&&(i=s)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),e(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:s}=i,n=i.frames[t],a=i.frames[t].text,l=s+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,n,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=l,i.dataset.index=t,i.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${l}`),i.onload=()=>this.showImage(i,n,e,t,a,!0),this.loadingImage=i,this.removeOldImages(i)}})),e(this,"showImage",((e,t,i,s,n,a=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${s}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(i,e,t,n))})),e(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),i)}}))})),e(this,"preloadNearby",((e,t=!0)=>new Promise((i=>{setTimeout((()=>{const s=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===s){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;n.forEach((e=>{const t=e.text;if(t!==s&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],s=e+t,n=new Image;n.src=s,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),a||i()}}),300)})))),e(this,"getHigherQuality",((e,t,i,s)=>{if(e<this.thumbnails.length-1){let n=t.naturalHeight;this.usingSprites&&(n=i.h),n<this.thumbContainerHeight&&setTimeout((()=>{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(e+1))}),300)}})),e(this,"toggleThumbContainer",((e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),e(this,"setThumbContainerSizeAndPos",(()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()})),e(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,s=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10,a=this.mousePosX-e.left-i.clientWidth/2,l=Ge(a,s,n);i.style.left=`${l}px`,i.style.setProperty("--preview-arrow-offset",a-l+"px")})),e(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=et(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),e(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`})),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=et(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const it={insertElements(e,t){S.string(t)?_(e,this.media,{src:t}):S.array(t)&&t.forEach((t=>{_(e,this.media,t)}))},change(e){N(e,"sources.length")?(de.cancelRequests.call(this),this.destroy.call(this,(()=>{this.options.quality=[],O(this.media),this.media=null,S.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:s=_e.html5,src:n}]=t,a="html5"===s?i:"div",l="html5"===s?{}:{src:n};Object.assign(this,{provider:s,type:i,supported:K.check(i,s,this.config.playsinline),media:$(a,l)}),this.elements.container.appendChild(this.media),S.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),S.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Fe.addStyleHook.call(this),this.isHTML5&&it.insertElements.call(this,"source",t),this.config.title=e.title,Xe.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&it.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Fe.build.call(this),this.isHTML5&&this.media.load(),S.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new tt(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class st{constructor(t,i){if(e(this,"play",(()=>S.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>ie(this.media.play()))),this.media.play()):null)),e(this,"pause",(()=>this.playing&&S.function(this.media.pause)?this.media.pause():null)),e(this,"togglePlay",(e=>(S.boolean(e)?e:!this.playing)?this.play():this.pause())),e(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):S.function(this.media.stop)&&this.media.stop()})),e(this,"restart",(()=>{this.currentTime=0})),e(this,"rewind",(e=>{this.currentTime-=S.number(e)?e:this.config.seekTime})),e(this,"forward",(e=>{this.currentTime+=S.number(e)?e:this.config.seekTime})),e(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+(S.number(e)?e:0)})),e(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),e(this,"airplay",(()=>{K.airplay&&this.media.webkitShowPlaybackTargetPicker()})),e(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=F(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,s=R(this.elements.container,this.config.classNames.hideControls,i);if(s&&S.array(this.config.controls)&&this.config.controls.includes("settings")&&!S.empty(this.config.settings)&&Pe.toggleMenu.call(this,!1),s!==t){const e=s?"controlshidden":"controlsshown";Z.call(this,this.media,e)}return!s}return!1})),e(this,"on",((e,t)=>{X.call(this,this.elements.container,e,t)})),e(this,"once",((e,t)=>{G.call(this,this.elements.container,e,t)})),e(this,"off",((e,t)=>{J(this.elements.container,e,t)})),e(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(O(this.elements.buttons.play),O(this.elements.captions),O(this.elements.controls),O(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),S.function(e)&&e()):(ee.call(this),de.cancelRequests.call(this),q(this.elements.original,this.elements.container),Z.call(this,this.elements.original,"destroyed",!0),S.function(e)&&e.call(this.elements.original),this.ready=!1,setTimeout((()=>{this.elements=null,this.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Fe.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&S.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))})),e(this,"supports",(e=>K.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=K.touch,this.media=t,S.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||S.nodeList(this.media)||S.array(this.media))&&(this.media=this.media[0]),this.config=x({},Le,st.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(e){return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new De(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",K),S.nullOrUndefined(this.media)||!S.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!K.check().api)return void this.debug.error("Setup failed: no support");const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const n=this.media.tagName.toLowerCase();let a=null,l=null;switch(n){case"div":if(a=this.media.querySelector("iframe"),S.element(a)){if(l=Me(a.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?_e.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?_e.vimeo:null}(l.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",l.search.length){const e=["1","true"];e.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(S.empty(this.provider)||!Object.values(_e).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=je;break;case"video":case"audio":this.type=n,this.provider=_e.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=K.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Ve(this),this.storage=new we(this),this.media.plyr=this,S.element(this.elements.container)||(this.elements.container=$("div"),L(this.media,this.elements.container)),Fe.migrateStyles.call(this),Fe.addStyleHook.call(this),Xe.setup.call(this),this.config.debug&&X.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new He(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Fe.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Je(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>ie(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new tt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===_e.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===_e.youtube}get isVimeo(){return this.provider===_e.vimeo}get isVideo(){return this.type===je}get isAudio(){return this.type===Oe}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=S.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return S.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=S.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;S.string(t)&&(t=Number(t)),S.number(t)||(t=this.storage.get("volume")),S.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!S.empty(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;S.boolean(t)||(t=this.storage.get("muted")),S.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}set speed(e){let t=null;S.number(e)&&(t=e),S.number(t)||(t=this.storage.get("speed")),S.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:s}=this;t=Ge(t,i,s),this.config.speed.selected=t,setTimeout((()=>{this.media&&(this.media.playbackRate=t)}),0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let s=[!S.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(S.number),n=!0;if(!i.includes(s)){const e=ne(i,s);this.debug.warn(`Unsupported quality option: ${s}, using ${e} instead`),s=e,n=!1}t.selected=s,this.media.quality=s,n&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(e){const t=S.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){it.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return S.url(e)?e:this.source}set download(e){S.url(e)&&(this.config.urls.download=e,Pe.setDownloadUrl.call(this))}set poster(e){this.isVideo?Fe.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=oe(ce.call(this));return S.array(e)?e.join(":"):e}set ratio(e){this.isVideo?S.string(e)&&re(e)?(this.config.ratio=oe(e),ue.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=S.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){xe.toggle.call(this,e,!1)}set currentTrack(e){xe.set.call(this,e,!1),xe.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){xe.setLanguage.call(this,e,!1)}get language(){return(xe.getCurrentTrack.call(this)||{}).language}set pip(e){if(!K.pip)return;const t=S.boolean(e)?e:!this.pip;S.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Ie:$e),S.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return K.pip?S.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Ie:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new tt(this))}static supported(e,t){return K.check(e,t)}static loadSprite(e,t){return ke(e,t)}static setup(e,t={}){let i=null;return S.string(e)?i=Array.from(document.querySelectorAll(e)):S.nodeList(e)?i=Array.from(e):S.array(e)&&(i=e.filter(S.element)),S.empty(i)?null:i.map((e=>new st(e,t)))}}var nt;return st.defaults=(nt=Le,JSON.parse(JSON.stringify(nt))),st}));
function collapsible(){let i=document.querySelectorAll(".collapsible-link"),t=document.querySelector(".collapsible-btn"),e=document.querySelector(".collapsible-content");t.addEventListener("click",()=>{e.classList.toggle("active"),t.classList.toggle("active")}),i.forEach(i=>{i.addEventListener("click",function(i){let s=this.getAttribute("href");if(s.startsWith("#")){i.preventDefault();let o=document.querySelector(s);if(o){let n=o.offsetTop-0;window.scrollTo({top:n,behavior:"smooth"}),e.classList.remove("active"),t.classList.remove("active")}}})})}function issueTab(){let i=document.querySelectorAll(".issue__tab-button"),t=document.querySelectorAll(".issue__tab-content__item");i.forEach(e=>{e.addEventListener("click",()=>{let s=e.getAttribute("data-tab");i.forEach(i=>i.classList.remove("active")),e.classList.add("active"),t.forEach(i=>{i.id===s?i.classList.add("active"):i.classList.remove("active")})})})}document.addEventListener("DOMContentLoaded",function(){document.getElementById("quizVideo").play();let i=window.location.href;i.includes("/calliefirst")?(document.body.setAttribute("data-lang","en"),document.getElementById("issueLabelNew")&&(document.getElementById("issueLabelNew").textContent="New!")):(document.body.setAttribute("data-lang","es"),document.getElementById("issueLabelNew")&&(document.getElementById("issueLabelNew").textContent="\xa1Nuevo!")),document.body.getAttribute("data-lang"),collapsible(),issueTab();let t=document.querySelectorAll(".inspiration__inner .section__description a");t&&t.forEach(function(i){i.addEventListener("click",function(t){t.preventDefault(),dataLayer.push({event:"inspiring_content_link_click",link_text:i.textContent}),window.open(i.href,"_blank")})});let e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e);let s=e.offsetWidth-e.clientWidth;document.body.removeChild(e),document.body.style.setProperty("--scrollbar-width",`${s}px`);let o=document.querySelectorAll(".missions__item"),n=document.querySelector(".missions__item-active"),l=document.querySelector(".missions"),r=o[0];r.classList.add("active");let a=r.dataset.title||"",d=r.dataset.description||"",c=r.dataset.link||"",p=JSON.parse(r.dataset.buttons||"[]"),h=`
                <div class="missions__item-active__preview" id="player">
                  <iframe src="https://www.youtube.com/embed/${c}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="border:0"></iframe>
                </div>
                <h3 class="missions__item-active__title">${a}</h3>
                <p class="missions__item-active__description">${d}</p>

                ${p.length?`
                <div class="missions__item-active__btns">
                    ${p.map(i=>`<a href="${i.link}" class="primary-button missions__item-active__btn" onclick="dataLayer.push({'event': 'interactive_mission_item_click', 'technology_name': '${a}', 'external_link': '${i.text}'})" target="_blank"><span>${i.text}</span></a>`).join("")}
                </div> 
                `:""}
              `;n.innerHTML=h,o.forEach(i=>{i.addEventListener("click",()=>{o.forEach(i=>i.classList.remove("active")),i.classList.add("active"),l.scrollIntoView({behavior:"smooth"});let t=i.dataset.title||"",e=i.dataset.description||"",s=i.dataset.link||"",r=JSON.parse(i.dataset.buttons||"[]"),a=`
                        <div class="missions__item-active__preview">
                          <iframe src="https://www.youtube.com/embed/${s}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="border:0"></iframe>
                        </div>
                        <h3 class="missions__item-active__title">${t}</h3>
                        <p class="missions__item-active__description">${e}</p>
                        ${r.length?`
                        <div class="missions__item-active__btns">
                            ${r.map(i=>`<a href="${i.link}" class="primary-button missions__item-active__btn" onclick="dataLayer.push({'event': 'interactive_mission_item_click', 'technology_name': '${t}', 'external_link': '${i.text}'})" target="_blank"><span>${i.text}</span></a>`).join("")}
                        </div>
                        `:""}
                      `;n.innerHTML=a})});let u=document.querySelectorAll(".issue__tab-content__button");u&&u.forEach(i=>{let t=i.getAttribute("href");t&&t.toLowerCase().endsWith(".pdf")&&(i.removeAttribute("target"),i.setAttribute("download",""))})}),document.addEventListener("DOMContentLoaded",()=>{let i=document.querySelector(".quizData");document.querySelector(".mission-join");let t=document.getElementById("quizStartButton"),e=document.getElementById("quizQuestionContainer"),s=document.getElementById("quizResultContainer"),o=document.querySelector(".mission-join__content-default"),n=document.getElementById("quizNextButton"),l=document.getElementById("quizFooter"),r=document.querySelector("#quizFooter ul"),a=r.querySelectorAll("li"),d=a[a.length-1],c=0,p=document.body.getAttribute("data-lang"),h={},u={};function f(){let t=i.getAttribute("data-options");h=JSON.parse(t);let r=i.getAttribute("data-details");u=JSON.parse(r),s.classList.remove("active"),o.style.display="none",e.innerHTML="",s.innerHTML="";let a=v("en"===p?"What subject in school are you most interested in?":"\xbfQu\xe9 asignatura escolar te interesa m\xe1s?",Object.keys(h));e.appendChild(a),e.classList.add("active"),l.style.display="flex",n.textContent="en"===p?"Next":"Siguiente"}function v(i,t){let e=document.createElement("div");e.classList.add("quiz__inner"),e.classList.add("question");let s=document.createElement("span");s.classList.add("section__subtitle"),s.textContent="en"===p?"YOUR FUTURE AT NASA":"TU FUTURO EN LA NASA",e.appendChild(s);let o=document.createElement("p");o.classList.add("section__title"),o.textContent=i,e.appendChild(o);let l=document.createElement("div");return l.classList.add("quiz__items"),e.appendChild(l),t.forEach((i,e)=>{let s=document.createElement("button"),o=String.fromCharCode(65+e);s.classList.add("quiz__item"),s.textContent=`${o}. ${i}`,s.addEventListener("click",e=>{t.forEach(i=>{let t=document.querySelector(`.quiz__item[data-option="${i}"]`);t.classList.remove("active")}),e.target.classList.add("active"),n.setAttribute("data-option",i)}),s.setAttribute("data-option",i),l.appendChild(s)}),e}function k(){return n.getAttribute("data-option")}function g(){let i=k();i&&(0===c?(dataLayer.push({event:"quiz_subject_name_click",subject_name:i}),i&&(d.classList.add("active"),y(i),n.setAttribute("data-first",i),n.setAttribute("data-option",""),c++)):1===c&&(dataLayer.push({event:"quiz_classes_name_click",subject_name:n.getAttribute("data-first"),classes_name:i}),i&&(d.classList.add("active"),y(i),n.setAttribute("data-option",""))))}function y(i){if(e.innerHTML="",h[i]){let t=h[i],o=v("en"===p?"Which classes do you like the best?":"\xbfQu\xe9 clases te gustan m\xe1s?",t);e.appendChild(o),sendQuizGAFirstSteep=!0}else if(u[i]){let r=u[i];e.classList.remove("active"),s.classList.add("active");let a=document.createElement("div");a.classList.add("quiz__final"),a.innerHTML=`
                        <h2 class="section__subtitle">${"en"===p?"Results":"RESULTADOS"}</h2>
                        <h2 class="quiz__final-title">${r.title}</h2>
                        <p class="quiz__final-description">${r.description}</p>
                        <button id="restartButton" class="quiz__final-btn" onclick="dataLayer.push({'event': 'restart_quiz'})">${"en"===p?"Restart":"Reiniciar"}</button>`,s.appendChild(a);let c=document.getElementById("restartButton");c.addEventListener("click",f),n.removeAttribute("data-option"),n.removeAttribute("data-first"),d.classList.remove("active"),l.style.display="none"}}t.addEventListener("click",f),n.addEventListener("click",g);let w=new ScrollMagic.Controller,b=new ScrollMagic.Scene({triggerElement:"#parallax-rover",triggerHook:1,duration:"100%",offset:200});w.addScene(b);let S=new TimelineMax;S.add([TweenMax.to("#parallax-rover-2",1,{backgroundPosition:"100% -175px",ease:Power4}),TweenMax.to("#parallax-rover-3",1,{ease:Power4,backgroundPosition:"50% -210px"}),TweenMax.to("#parallax-rover-4",1,{ease:Power4,backgroundPosition:"50% -190px"}),TweenMax.to("#parallax-rover-5",1,{ease:Power4,backgroundPosition:"50% -180px"}),TweenMax.to("#parallax-rover-6",1,{ease:Power4,backgroundPosition:"50% -50px"}),TweenMax.to("#parallax-rover-7",1,{ease:Power4,backgroundPositionY:"-10px"}),TweenMax.to("#parallax-rover-1-1",1,{y:"300px",ease:Power4})]),b.on("progress",i=>{let t=i.progress;S.progress(t).pause()});let m=new ScrollMagic.Controller,T=new ScrollMagic.Scene({triggerElement:"#parallax-garbage",triggerHook:1,duration:"150%",offset:200});m.addScene(T);let _=new TimelineMax;_.add([TweenMax.to("#parallax-garbage-1",1,{ease:Power4,backgroundPositionY:"100px"}),TweenMax.to("#parallax-garbage-2",1,{ease:Power4,backgroundPositionY:"-300px"}),TweenMax.to("#parallax-garbage-3",1,{ease:Power4,backgroundPositionY:"0px"}),TweenMax.to("#parallax-garbage-4",1,{backgroundPositionY:"-150px",ease:Power4})]),T.on("progress",i=>{let t=i.progress;_.progress(t).pause()});let C=new ScrollMagic.Controller,x=new ScrollMagic.Scene({triggerElement:"#parallax-boots",triggerHook:1,duration:"120%",offset:50});C.addScene(x);let A=new TimelineMax;A.add([TweenMax.to("#parallax-boots-1",1,{ease:Power4,backgroundPositionY:"-100px"}),TweenMax.to("#parallax-boots-2",1,{ease:Power4,backgroundPositionY:"-100px"}),TweenMax.to("#parallax-boots-3",1,{ease:Power4,backgroundPositionY:"0px"}),TweenMax.to("#parallax-boots-4",1,{ease:Power4,backgroundPositionY:"0px"}),TweenMax.to("#parallax-boots-5",1,{ease:Power4,backgroundPositionY:"0px"}),TweenMax.to("#parallax-boots-6",1,{ease:Power4,backgroundPositionY:"0px"}),TweenMax.to("#parallax-boots-7",1,{ease:Power4,backgroundPositionY:"0px"}),]),x.on("progress",i=>{let t=i.progress;A.progress(t).pause()})}),function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var t,e=window.Slick||{};(e=(t=0,function(e,s){var o,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,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:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,e){return i('<button type="button" />').text(e+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(e),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,o=i(e).data("slick")||{},n.options=i.extend({},n.defaults,s,o),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)})).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(t,e,s){var o=this;if("boolean"==typeof e)s=e,e=null;else if(e<0||e>=o.slideCount)return!1;o.unload(),"number"==typeof e?0===e&&0===o.$slides.length?i(t).appendTo(o.$slideTrack):s?i(t).insertBefore(o.$slides.eq(e)):i(t).insertAfter(o.$slides.eq(e)):!0===s?i(t).prependTo(o.$slideTrack):i(t).appendTo(o.$slideTrack),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slides.each(function(t,e){i(e).attr("data-slick-index",t)}),o.$slidesCache=o.$slides,o.reinit()},e.prototype.animateHeight=function(){if(1===this.options.slidesToShow&&!0===this.options.adaptiveHeight&&!1===this.options.vertical){var i=this.$slides.eq(this.currentSlide).outerHeight(!0);this.$list.animate({height:i},this.options.speed)}},e.prototype.animateSlide=function(t,e){var s={},o=this;o.animateHeight(),!0===o.options.rtl&&!1===o.options.vertical&&(t=-t),!1===o.transformsEnabled?!1===o.options.vertical?o.$slideTrack.animate({left:t},o.options.speed,o.options.easing,e):o.$slideTrack.animate({top:t},o.options.speed,o.options.easing,e):!1===o.cssTransitions?(!0===o.options.rtl&&(o.currentLeft=-o.currentLeft),i({animStart:o.currentLeft}).animate({animStart:t},{duration:o.options.speed,easing:o.options.easing,step:function(i){i=Math.ceil(i),!1===o.options.vertical?(s[o.animType]="translate("+i+"px, 0px)",o.$slideTrack.css(s)):(s[o.animType]="translate(0px,"+i+"px)",o.$slideTrack.css(s))},complete:function(){e&&e.call()}})):(o.applyTransition(),t=Math.ceil(t),!1===o.options.vertical?s[o.animType]="translate3d("+t+"px, 0px, 0px)":s[o.animType]="translate3d(0px,"+t+"px, 0px)",o.$slideTrack.css(s),e&&setTimeout(function(){o.disableTransition(),e.call()},o.options.speed))},e.prototype.getNavTarget=function(){var t=this.options.asNavFor;return t&&null!==t&&(t=i(t).not(this.$slider)),t},e.prototype.asNavFor=function(t){var e=this.getNavTarget();null!==e&&"object"==typeof e&&e.each(function(){var e=i(this).slick("getSlick");e.unslicked||e.slideHandler(t,!0)})},e.prototype.applyTransition=function(i){var t=this,e={};!1===t.options.fade?e[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:e[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(e):t.$slides.eq(i).css(e)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,t=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(t=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(t))},e.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&(t.$prevArrow=i(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=i(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var t,e,s=this;if(!0===s.options.dots){for(s.$slider.addClass("slick-dotted"),e=i("<ul />").addClass(s.options.dotsClass),t=0;t<=s.getDotCount();t+=1)e.append(i("<li />").append(s.options.customPaging.call(this,s,t)));s.$dots=e.appendTo(s.options.appendDots),s.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each(function(t,e){i(e).attr("data-slick-index",t).data("originalStyling",i(e).attr("style")||"")}),t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?i('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),!0!==t.options.centerMode&&!0!==t.options.swipeToSlide||(t.options.slidesToScroll=1),i("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,t,e,s,o,n,l;if(s=document.createDocumentFragment(),n=this.$slider.children(),this.options.rows>1){for(l=this.options.slidesPerRow*this.options.rows,o=Math.ceil(n.length/l),i=0;i<o;i++){var r=document.createElement("div");for(t=0;t<this.options.rows;t++){var a=document.createElement("div");for(e=0;e<this.options.slidesPerRow;e++){var d=i*l+(t*this.options.slidesPerRow+e);n.get(d)&&a.appendChild(n.get(d))}r.appendChild(a)}s.appendChild(r)}this.$slider.empty().append(s),this.$slider.children().children().children().css({width:100/this.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(t,e){var s,o,n,l=this,r=!1,a=l.$slider.width(),d=window.innerWidth||i(window).width();if("window"===l.respondTo?n=d:"slider"===l.respondTo?n=a:"min"===l.respondTo&&(n=Math.min(d,a)),l.options.responsive&&l.options.responsive.length&&null!==l.options.responsive){for(s in o=null,l.breakpoints)l.breakpoints.hasOwnProperty(s)&&(!1===l.originalSettings.mobileFirst?n<l.breakpoints[s]&&(o=l.breakpoints[s]):n>l.breakpoints[s]&&(o=l.breakpoints[s]));null!==o?null!==l.activeBreakpoint?(o!==l.activeBreakpoint||e)&&(l.activeBreakpoint=o,"unslick"===l.breakpointSettings[o]?l.unslick(o):(l.options=i.extend({},l.originalSettings,l.breakpointSettings[o]),!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t)),r=o):(l.activeBreakpoint=o,"unslick"===l.breakpointSettings[o]?l.unslick(o):(l.options=i.extend({},l.originalSettings,l.breakpointSettings[o]),!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t)),r=o):null!==l.activeBreakpoint&&(l.activeBreakpoint=null,l.options=l.originalSettings,!0===t&&(l.currentSlide=l.options.initialSlide),l.refresh(t),r=o),t||!1===r||l.$slider.trigger("breakpoint",[l,r])}},e.prototype.changeSlide=function(t,e){var s,o,n,l=i(t.currentTarget);switch(l.is("a")&&t.preventDefault(),l.is("li")||(l=l.closest("li")),s=(n=this.slideCount%this.options.slidesToScroll!=0)?0:(this.slideCount-this.currentSlide)%this.options.slidesToScroll,t.data.message){case"previous":o=0===s?this.options.slidesToScroll:this.options.slidesToShow-s,this.slideCount>this.options.slidesToShow&&this.slideHandler(this.currentSlide-o,!1,e);break;case"next":o=0===s?this.options.slidesToScroll:s,this.slideCount>this.options.slidesToShow&&this.slideHandler(this.currentSlide+o,!1,e);break;case"index":var r=0===t.data.index?0:t.data.index||l.index()*this.options.slidesToScroll;this.slideHandler(this.checkNavigable(r),!1,e),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var t,e;if(t=this.getNavigableIndexes(),e=0,i>t[t.length-1])i=t[t.length-1];else for(var s in t){if(i<t[s]){i=e;break}e=t[s]}return i},e.prototype.cleanUpEvents=function(){this.options.dots&&null!==this.$dots&&(i("li",this.$dots).off("click.slick",this.changeSlide).off("mouseenter.slick",i.proxy(this.interrupt,this,!0)).off("mouseleave.slick",i.proxy(this.interrupt,this,!1)),!0===this.options.accessibility&&this.$dots.off("keydown.slick",this.keyHandler)),this.$slider.off("focus.slick blur.slick"),!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow&&this.$prevArrow.off("click.slick",this.changeSlide),this.$nextArrow&&this.$nextArrow.off("click.slick",this.changeSlide),!0===this.options.accessibility&&(this.$prevArrow&&this.$prevArrow.off("keydown.slick",this.keyHandler),this.$nextArrow&&this.$nextArrow.off("keydown.slick",this.keyHandler))),this.$list.off("touchstart.slick mousedown.slick",this.swipeHandler),this.$list.off("touchmove.slick mousemove.slick",this.swipeHandler),this.$list.off("touchend.slick mouseup.slick",this.swipeHandler),this.$list.off("touchcancel.slick mouseleave.slick",this.swipeHandler),this.$list.off("click.slick",this.clickHandler),i(document).off(this.visibilityChange,this.visibility),this.cleanUpSlideEvents(),!0===this.options.accessibility&&this.$list.off("keydown.slick",this.keyHandler),!0===this.options.focusOnSelect&&i(this.$slideTrack).children().off("click.slick",this.selectHandler),i(window).off("orientationchange.slick.slick-"+this.instanceUid,this.orientationChange),i(window).off("resize.slick.slick-"+this.instanceUid,this.resize),i("[draggable!=true]",this.$slideTrack).off("dragstart",this.preventDefault),i(window).off("load.slick.slick-"+this.instanceUid,this.setPosition)},e.prototype.cleanUpSlideEvents=function(){this.$list.off("mouseenter.slick",i.proxy(this.interrupt,this,!0)),this.$list.off("mouseleave.slick",i.proxy(this.interrupt,this,!1))},e.prototype.cleanUpRows=function(){var i;this.options.rows>1&&((i=this.$slides.children().children()).removeAttr("style"),this.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(t){var e=this;e.autoPlayClear(),e.touchObject={},e.cleanUpEvents(),i(".slick-cloned",e.$slider).detach(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.$prevArrow.length&&(e.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove()),e.$nextArrow&&e.$nextArrow.length&&(e.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove()),e.$slides&&(e.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.detach(),e.$list.detach(),e.$slider.append(e.$slides)),e.cleanUpRows(),e.$slider.removeClass("slick-slider"),e.$slider.removeClass("slick-initialized"),e.$slider.removeClass("slick-dotted"),e.unslicked=!0,t||e.$slider.trigger("destroy",[e])},e.prototype.disableTransition=function(i){var t=this,e={};e[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(e):t.$slides.eq(i).css(e)},e.prototype.fadeSlide=function(i,t){var e=this;!1===e.cssTransitions?(e.$slides.eq(i).css({zIndex:e.options.zIndex}),e.$slides.eq(i).animate({opacity:1},e.options.speed,e.options.easing,t)):(e.applyTransition(i),e.$slides.eq(i).css({opacity:1,zIndex:e.options.zIndex}),t&&setTimeout(function(){e.disableTransition(i),t.call()},e.options.speed))},e.prototype.fadeSlideOut=function(i){!1===this.cssTransitions?this.$slides.eq(i).animate({opacity:0,zIndex:this.options.zIndex-2},this.options.speed,this.options.easing):(this.applyTransition(i),this.$slides.eq(i).css({opacity:0,zIndex:this.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var t=this;null!==i&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(i).appendTo(t.$slideTrack),t.reinit())},e.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(e){e.stopImmediatePropagation();var s=i(this);setTimeout(function(){t.options.pauseOnFocus&&(t.focussed=s.is(":focus"),t.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=0,t=0,e=0;if(!0===this.options.infinite){if(this.slideCount<=this.options.slidesToShow)++e;else for(;i<this.slideCount;)++e,i=t+this.options.slidesToScroll,t+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow}else if(!0===this.options.centerMode)e=this.slideCount;else if(this.options.asNavFor)for(;i<this.slideCount;)++e,i=t+this.options.slidesToScroll,t+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow;else e=1+Math.ceil((this.slideCount-this.options.slidesToShow)/this.options.slidesToScroll);return e-1},e.prototype.getLeft=function(i){var t,e,s,o,n=this,l=0;return n.slideOffset=0,e=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=-(n.slideWidth*n.options.slidesToShow*1),o=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?o=-1.5:1===n.options.slidesToShow&&(o=-2)),l=e*n.options.slidesToShow*o),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=-((n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*1),l=-((n.options.slidesToShow-(i-n.slideCount))*e*1)):(n.slideOffset=-(n.slideCount%n.options.slidesToScroll*n.slideWidth*1),l=-(n.slideCount%n.options.slidesToScroll*e*1)))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,l=(i+n.options.slidesToShow-n.slideCount)*e),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,l=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),t=!1===n.options.vertical?-(i*n.slideWidth*1)+n.slideOffset:-(i*e*1)+l,!0===n.options.variableWidth&&(s=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),t=!0===n.options.rtl?s[0]?-1*(n.$slideTrack.width()-s[0].offsetLeft-s.width()):0:s[0]?-1*s[0].offsetLeft:0,!0===n.options.centerMode&&(s=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),t=!0===n.options.rtl?s[0]?-1*(n.$slideTrack.width()-s[0].offsetLeft-s.width()):0:s[0]?-1*s[0].offsetLeft:0,t+=(n.$list.width()-s.outerWidth())/2)),t},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,t=0,e=0,s=[];for(!1===this.options.infinite?i=this.slideCount:(t=-1*this.options.slidesToScroll,e=-1*this.options.slidesToScroll,i=2*this.slideCount);t<i;)s.push(t),t=e+this.options.slidesToScroll,e+=this.options.slidesToScroll<=this.options.slidesToShow?this.options.slidesToScroll:this.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var t,e,s=this;return e=!0===s.options.centerMode?s.slideWidth*Math.floor(s.options.slidesToShow/2):0,!0===s.options.swipeToSlide?(s.$slideTrack.find(".slick-slide").each(function(o,n){if(n.offsetLeft-e+i(n).outerWidth()/2>-1*s.swipeLeft)return t=n,!1}),Math.abs(i(t).attr("data-slick-index")-s.currentSlide)||1):s.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,t){this.changeSlide({data:{message:"index",index:parseInt(i)}},t)},e.prototype.init=function(t){var e=this;i(e.$slider).hasClass("slick-initialized")||(i(e.$slider).addClass("slick-initialized"),e.buildRows(),e.buildOut(),e.setProps(),e.startLoad(),e.loadSlider(),e.initializeEvents(),e.updateArrows(),e.updateDots(),e.checkResponsive(!0),e.focusHandler()),t&&e.$slider.trigger("init",[e]),!0===e.options.accessibility&&e.initADA(),e.options.autoplay&&(e.paused=!1,e.autoPlay())},e.prototype.initADA=function(){var t=this,e=Math.ceil(t.slideCount/t.options.slidesToShow),s=t.getNavigableIndexes().filter(function(i){return i>=0&&i<t.slideCount});t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==t.$dots&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function(e){var o=s.indexOf(e);i(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+e,tabindex:-1}),-1!==o&&i(this).attr({"aria-describedby":"slick-slide-control"+t.instanceUid+o})}),t.$dots.attr("role","tablist").find("li").each(function(o){var n=s[o];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+o,"aria-controls":"slick-slide"+t.instanceUid+n,"aria-label":o+1+" of "+e,"aria-selected":null,tabindex:"-1"})}).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var o=t.currentSlide,n=o+t.options.slidesToShow;o<n;o++)t.$slides.eq(o).attr("tabindex",0);t.activateADA()},e.prototype.initArrowEvents=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},this.changeSlide),this.$nextArrow.off("click.slick").on("click.slick",{message:"next"},this.changeSlide),!0===this.options.accessibility&&(this.$prevArrow.on("keydown.slick",this.keyHandler),this.$nextArrow.on("keydown.slick",this.keyHandler)))},e.prototype.initDotEvents=function(){!0===this.options.dots&&(i("li",this.$dots).on("click.slick",{message:"index"},this.changeSlide),!0===this.options.accessibility&&this.$dots.on("keydown.slick",this.keyHandler)),!0===this.options.dots&&!0===this.options.pauseOnDotsHover&&i("li",this.$dots).on("mouseenter.slick",i.proxy(this.interrupt,this,!0)).on("mouseleave.slick",i.proxy(this.interrupt,this,!1))},e.prototype.initSlideEvents=function(){this.options.pauseOnHover&&(this.$list.on("mouseenter.slick",i.proxy(this.interrupt,this,!0)),this.$list.on("mouseleave.slick",i.proxy(this.interrupt,this,!1)))},e.prototype.initializeEvents=function(){this.initArrowEvents(),this.initDotEvents(),this.initSlideEvents(),this.$list.on("touchstart.slick mousedown.slick",{action:"start"},this.swipeHandler),this.$list.on("touchmove.slick mousemove.slick",{action:"move"},this.swipeHandler),this.$list.on("touchend.slick mouseup.slick",{action:"end"},this.swipeHandler),this.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},this.swipeHandler),this.$list.on("click.slick",this.clickHandler),i(document).on(this.visibilityChange,i.proxy(this.visibility,this)),!0===this.options.accessibility&&this.$list.on("keydown.slick",this.keyHandler),!0===this.options.focusOnSelect&&i(this.$slideTrack).children().on("click.slick",this.selectHandler),i(window).on("orientationchange.slick.slick-"+this.instanceUid,i.proxy(this.orientationChange,this)),i(window).on("resize.slick.slick-"+this.instanceUid,i.proxy(this.resize,this)),i("[draggable!=true]",this.$slideTrack).on("dragstart",this.preventDefault),i(window).on("load.slick.slick-"+this.instanceUid,this.setPosition),i(this.setPosition)},e.prototype.initUI=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.show(),this.$nextArrow.show()),!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&this.$dots.show()},e.prototype.keyHandler=function(i){i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===this.options.accessibility?this.changeSlide({data:{message:!0===this.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===this.options.accessibility&&this.changeSlide({data:{message:!0===this.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function t(t){i("img[data-lazy]",t).each(function(){var t=i(this),e=i(this).attr("data-lazy"),s=i(this).attr("data-srcset"),o=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),l=document.createElement("img");l.onload=function(){t.animate({opacity:0},100,function(){s&&(t.attr("srcset",s),o&&t.attr("sizes",o)),t.attr("src",e).animate({opacity:1},200,function(){t.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,t,e])})},l.onerror=function(){t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,t,e])},l.src=e})}var e,s,o,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?o=(s=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(s=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),o=n.options.slidesToShow/2+1+2+n.currentSlide):(o=Math.ceil((s=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide)+n.options.slidesToShow),!0===n.options.fade&&(s>0&&s--,o<=n.slideCount&&o++)),e=n.$slider.find(".slick-slide").slice(s,o),"anticipated"===n.options.lazyLoad)for(var l=s-1,r=o,a=n.$slider.find(".slick-slide"),d=0;d<n.options.slidesToScroll;d++)l<0&&(l=n.slideCount-1),e=(e=e.add(a.eq(l))).add(a.eq(r)),l--,r++;t(e),n.slideCount<=n.options.slidesToShow?t(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?t(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&t(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){this.setPosition(),this.$slideTrack.css({opacity:1}),this.$slider.removeClass("slick-loading"),this.initUI(),"progressive"===this.options.lazyLoad&&this.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){this.checkResponsive(),this.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(t){var e=this;e.unslicked||(e.$slider.trigger("afterChange",[e,t]),e.animating=!1,e.slideCount>e.options.slidesToShow&&e.setPosition(),e.swipeLeft=null,e.options.autoplay&&e.autoPlay(),!0===e.options.accessibility&&(e.initADA(),e.options.focusOnChange&&i(e.$slides.get(e.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(t){t=t||1;var e,s,o,n,l,r=this,a=i("img[data-lazy]",r.$slider);a.length?(s=(e=a.first()).attr("data-lazy"),o=e.attr("data-srcset"),n=e.attr("data-sizes")||r.$slider.attr("data-sizes"),(l=document.createElement("img")).onload=function(){o&&(e.attr("srcset",o),n&&e.attr("sizes",n)),e.attr("src",s).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===r.options.adaptiveHeight&&r.setPosition(),r.$slider.trigger("lazyLoaded",[r,e,s]),r.progressiveLazyLoad()},l.onerror=function(){t<3?setTimeout(function(){r.progressiveLazyLoad(t+1)},500):(e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,e,s]),r.progressiveLazyLoad())},l.src=s):r.$slider.trigger("allImagesLoaded",[r])},e.prototype.refresh=function(t){var e,s,o=this;s=o.slideCount-o.options.slidesToShow,!o.options.infinite&&o.currentSlide>s&&(o.currentSlide=s),o.slideCount<=o.options.slidesToShow&&(o.currentSlide=0),e=o.currentSlide,o.destroy(!0),i.extend(o,o.initials,{currentSlide:e}),o.init(),t||o.changeSlide({data:{message:"index",index:e}},!1)},e.prototype.registerBreakpoints=function(){var t,e,s,o=this,n=o.options.responsive||null;if("array"===i.type(n)&&n.length){for(t in o.respondTo=o.options.respondTo||"window",n)if(s=o.breakpoints.length-1,n.hasOwnProperty(t)){for(e=n[t].breakpoint;s>=0;)o.breakpoints[s]&&o.breakpoints[s]===e&&o.breakpoints.splice(s,1),s--;o.breakpoints.push(e),o.breakpointSettings[e]=n[t].settings}o.breakpoints.sort(function(i,t){return o.options.mobileFirst?i-t:t-i})}},e.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),!0===t.options.focusOnSelect&&i(t.$slideTrack).children().on("click.slick",t.selectHandler),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),t.setPosition(),t.focusHandler(),t.paused=!t.options.autoplay,t.autoPlay(),t.$slider.trigger("reInit",[t])},e.prototype.resize=function(){var t=this;i(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=i(window).width(),t.checkResponsive(),t.unslicked||t.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,t,e){var s=this;if(i="boolean"==typeof i?!0===(t=i)?0:s.slideCount-1:!0===t?--i:i,s.slideCount<1||i<0||i>s.slideCount-1)return!1;s.unload(),!0===e?s.$slideTrack.children().remove():s.$slideTrack.children(this.options.slide).eq(i).remove(),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slidesCache=s.$slides,s.reinit()},e.prototype.setCSS=function(i){var t,e,s=this,o={};!0===s.options.rtl&&(i=-i),t="left"==s.positionProp?Math.ceil(i)+"px":"0px",e="top"==s.positionProp?Math.ceil(i)+"px":"0px",o[s.positionProp]=i,!1===s.transformsEnabled?s.$slideTrack.css(o):(o={},!1===s.cssTransitions?(o[s.animType]="translate("+t+", "+e+")",s.$slideTrack.css(o)):(o[s.animType]="translate3d("+t+", "+e+", 0px)",s.$slideTrack.css(o)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var t=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-t)},e.prototype.setFade=function(){var t,e=this;e.$slides.each(function(s,o){t=-(e.slideWidth*s*1),!0===e.options.rtl?i(o).css({position:"relative",right:t,top:0,zIndex:e.options.zIndex-2,opacity:0}):i(o).css({position:"relative",left:t,top:0,zIndex:e.options.zIndex-2,opacity:0})}),e.$slides.eq(e.currentSlide).css({zIndex:e.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){if(1===this.options.slidesToShow&&!0===this.options.adaptiveHeight&&!1===this.options.vertical){var i=this.$slides.eq(this.currentSlide).outerHeight(!0);this.$list.css("height",i)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var t,e,s,o,n,l=this,r=!1;if("object"===i.type(arguments[0])?(s=arguments[0],r=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(s=arguments[0],o=arguments[1],r=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)l.options[s]=o;else if("multiple"===n)i.each(s,function(i,t){l.options[i]=t});else if("responsive"===n)for(e in o)if("array"!==i.type(l.options.responsive))l.options.responsive=[o[e]];else{for(t=l.options.responsive.length-1;t>=0;)l.options.responsive[t].breakpoint===o[e].breakpoint&&l.options.responsive.splice(t,1),t--;l.options.responsive.push(o[e])}r&&(l.unload(),l.reinit())},e.prototype.setPosition=function(){this.setDimensions(),this.setHeight(),!1===this.options.fade?this.setCSS(this.getLeft(this.currentSlide)):this.setFade(),this.$slider.trigger("setPosition",[this])},e.prototype.setProps=function(){var i=this,t=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===t.WebkitTransition&&void 0===t.MozTransition&&void 0===t.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==t.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(i.animType=!1)),void 0!==t.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(i.animType=!1)),void 0!==t.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(i.animType=!1)),void 0!==t.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===t.msTransform&&(i.animType=!1)),void 0!==t.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var t,e,s,o;if(e=this.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),this.$slides.eq(i).addClass("slick-current"),!0===this.options.centerMode){var n=this.options.slidesToShow%2==0?1:0;t=Math.floor(this.options.slidesToShow/2),!0===this.options.infinite&&(i>=t&&i<=this.slideCount-1-t?this.$slides.slice(i-t+n,i+t+1).addClass("slick-active").attr("aria-hidden","false"):(s=this.options.slidesToShow+i,e.slice(s-t+1+n,s+t+2).addClass("slick-active").attr("aria-hidden","false")),0===i?e.eq(e.length-1-this.options.slidesToShow).addClass("slick-center"):i===this.slideCount-1&&e.eq(this.options.slidesToShow).addClass("slick-center")),this.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=this.slideCount-this.options.slidesToShow?this.$slides.slice(i,i+this.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):e.length<=this.options.slidesToShow?e.addClass("slick-active").attr("aria-hidden","false"):(o=this.slideCount%this.options.slidesToShow,s=!0===this.options.infinite?this.options.slidesToShow+i:i,this.options.slidesToShow==this.options.slidesToScroll&&this.slideCount-i<this.options.slidesToShow?e.slice(s-(this.options.slidesToShow-o),s+o).addClass("slick-active").attr("aria-hidden","false"):e.slice(s,s+this.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==this.options.lazyLoad&&"anticipated"!==this.options.lazyLoad||this.lazyLoad()},e.prototype.setupInfinite=function(){var t,e,s,o=this;if(!0===o.options.fade&&(o.options.centerMode=!1),!0===o.options.infinite&&!1===o.options.fade&&(e=null,o.slideCount>o.options.slidesToShow)){for(s=!0===o.options.centerMode?o.options.slidesToShow+1:o.options.slidesToShow,t=o.slideCount;t>o.slideCount-s;t-=1)e=t-1,i(o.$slides[e]).clone(!0).attr("id","").attr("data-slick-index",e-o.slideCount).prependTo(o.$slideTrack).addClass("slick-cloned");for(t=0;t<s+o.slideCount;t+=1)e=t,i(o.$slides[e]).clone(!0).attr("id","").attr("data-slick-index",e+o.slideCount).appendTo(o.$slideTrack).addClass("slick-cloned");o.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var t=this;i||t.autoPlay(),t.interrupted=i},e.prototype.selectHandler=function(t){var e=parseInt((i(t.target).is(".slick-slide")?i(t.target):i(t.target).parents(".slick-slide")).attr("data-slick-index"));e||(e=0),this.slideCount<=this.options.slidesToShow?this.slideHandler(e,!1,!0):this.slideHandler(e)},e.prototype.slideHandler=function(i,t,e){var s,o,n,l,r,a=null,d=this;if(t=t||!1,!(!0===d.animating&&!0===d.options.waitForAnimate||!0===d.options.fade&&d.currentSlide===i)){if(!1===t&&d.asNavFor(i),s=i,a=d.getLeft(s),l=d.getLeft(d.currentSlide),d.currentLeft=null===d.swipeLeft?l:d.swipeLeft,!1===d.options.infinite&&!1===d.options.centerMode&&(i<0||i>d.getDotCount()*d.options.slidesToScroll))!1===d.options.fade&&(s=d.currentSlide,!0!==e?d.animateSlide(l,function(){d.postSlide(s)}):d.postSlide(s));else if(!1===d.options.infinite&&!0===d.options.centerMode&&(i<0||i>d.slideCount-d.options.slidesToScroll))!1===d.options.fade&&(s=d.currentSlide,!0!==e?d.animateSlide(l,function(){d.postSlide(s)}):d.postSlide(s));else{if(d.options.autoplay&&clearInterval(d.autoPlayTimer),o=s<0?d.slideCount%d.options.slidesToScroll!=0?d.slideCount-d.slideCount%d.options.slidesToScroll:d.slideCount+s:s>=d.slideCount?d.slideCount%d.options.slidesToScroll!=0?0:s-d.slideCount:s,d.animating=!0,d.$slider.trigger("beforeChange",[d,d.currentSlide,o]),n=d.currentSlide,d.currentSlide=o,d.setSlideClasses(d.currentSlide),d.options.asNavFor&&(r=(r=d.getNavTarget()).slick("getSlick")).slideCount<=r.options.slidesToShow&&r.setSlideClasses(d.currentSlide),d.updateDots(),d.updateArrows(),!0===d.options.fade)return!0!==e?(d.fadeSlideOut(n),d.fadeSlide(o,function(){d.postSlide(o)})):d.postSlide(o),void d.animateHeight();!0!==e?d.animateSlide(a,function(){d.postSlide(o)}):d.postSlide(o)}}},e.prototype.startLoad=function(){!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&(this.$prevArrow.hide(),this.$nextArrow.hide()),!0===this.options.dots&&this.slideCount>this.options.slidesToShow&&this.$dots.hide(),this.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,t,e,s;return i=this.touchObject.startX-this.touchObject.curX,(s=Math.round(180*(e=Math.atan2(t=this.touchObject.startY-this.touchObject.curY,i))/Math.PI))<0&&(s=360-Math.abs(s)),s<=45&&s>=0?!1===this.options.rtl?"left":"right":s<=360&&s>=315?!1===this.options.rtl?"left":"right":s>=135&&s<=225?!1===this.options.rtl?"right":"left":!0===this.options.verticalSwiping?s>=35&&s<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var t,e,s=this;if(s.dragging=!1,s.swiping=!1,s.scrolling)return s.scrolling=!1,!1;if(s.interrupted=!1,s.shouldClick=!(s.touchObject.swipeLength>10),void 0===s.touchObject.curX)return!1;if(!0===s.touchObject.edgeHit&&s.$slider.trigger("edge",[s,s.swipeDirection()]),s.touchObject.swipeLength>=s.touchObject.minSwipe){switch(e=s.swipeDirection()){case"left":case"down":t=s.options.swipeToSlide?s.checkNavigable(s.currentSlide+s.getSlideCount()):s.currentSlide+s.getSlideCount(),s.currentDirection=0;break;case"right":case"up":t=s.options.swipeToSlide?s.checkNavigable(s.currentSlide-s.getSlideCount()):s.currentSlide-s.getSlideCount(),s.currentDirection=1}"vertical"!=e&&(s.slideHandler(t),s.touchObject={},s.$slider.trigger("swipe",[s,e]))}else s.touchObject.startX!==s.touchObject.curX&&(s.slideHandler(s.currentSlide),s.touchObject={})},e.prototype.swipeHandler=function(i){var t=this;if(!(!1===t.options.swipe||"ontouchend"in document&&!1===t.options.swipe||!1===t.options.draggable&&-1!==i.type.indexOf("mouse")))switch(t.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold,!0===t.options.verticalSwiping&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold),i.data.action){case"start":t.swipeStart(i);break;case"move":t.swipeMove(i);break;case"end":t.swipeEnd(i)}},e.prototype.swipeMove=function(i){var t,e,s,o,n,l,r=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!r.dragging||r.scrolling||n&&1!==n.length)&&(t=r.getLeft(r.currentSlide),r.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,r.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,r.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(r.touchObject.curX-r.touchObject.startX,2))),l=Math.round(Math.sqrt(Math.pow(r.touchObject.curY-r.touchObject.startY,2))),r.options.verticalSwiping||r.swiping||!(l>4)?(!0===r.options.verticalSwiping&&(r.touchObject.swipeLength=l),e=r.swipeDirection(),void 0!==i.originalEvent&&r.touchObject.swipeLength>4&&(r.swiping=!0,i.preventDefault()),o=(!1===r.options.rtl?1:-1)*(r.touchObject.curX>r.touchObject.startX?1:-1),!0===r.options.verticalSwiping&&(o=r.touchObject.curY>r.touchObject.startY?1:-1),s=r.touchObject.swipeLength,r.touchObject.edgeHit=!1,!1===r.options.infinite&&(0===r.currentSlide&&"right"===e||r.currentSlide>=r.getDotCount()&&"left"===e)&&(s=r.touchObject.swipeLength*r.options.edgeFriction,r.touchObject.edgeHit=!0),!1===r.options.vertical?r.swipeLeft=t+s*o:r.swipeLeft=t+s*(r.$list.height()/r.listWidth)*o,!0===r.options.verticalSwiping&&(r.swipeLeft=t+s*o),!0!==r.options.fade&&!1!==r.options.touchMove&&(!0===r.animating?(r.swipeLeft=null,!1):void r.setCSS(r.swipeLeft))):(r.scrolling=!0,!1))},e.prototype.swipeStart=function(i){var t,e=this;if(e.interrupted=!0,1!==e.touchObject.fingerCount||e.slideCount<=e.options.slidesToShow)return e.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(t=i.originalEvent.touches[0]),e.touchObject.startX=e.touchObject.curX=void 0!==t?t.pageX:i.clientX,e.touchObject.startY=e.touchObject.curY=void 0!==t?t.pageY:i.clientY,e.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){null!==this.$slidesCache&&(this.unload(),this.$slideTrack.children(this.options.slide).detach(),this.$slidesCache.appendTo(this.$slideTrack),this.reinit())},e.prototype.unload=function(){i(".slick-cloned",this.$slider).remove(),this.$dots&&this.$dots.remove(),this.$prevArrow&&this.htmlExpr.test(this.options.prevArrow)&&this.$prevArrow.remove(),this.$nextArrow&&this.htmlExpr.test(this.options.nextArrow)&&this.$nextArrow.remove(),this.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},e.prototype.unslick=function(i){this.$slider.trigger("unslick",[this,i]),this.destroy()},e.prototype.updateArrows=function(){this.options.slidesToShow,!0===this.options.arrows&&this.slideCount>this.options.slidesToShow&&!this.options.infinite&&(this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),this.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===this.currentSlide?(this.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):this.currentSlide>=this.slideCount-this.options.slidesToShow&&!1===this.options.centerMode?(this.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):this.currentSlide>=this.slideCount-1&&!0===this.options.centerMode&&(this.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),this.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){null!==this.$dots&&(this.$dots.find("li").removeClass("slick-active").end(),this.$dots.find("li").eq(Math.floor(this.currentSlide/this.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,s=this,o=arguments[0],n=Array.prototype.slice.call(arguments,1),l=s.length;for(i=0;i<l;i++)if("object"==typeof o||void 0===o?s[i].slick=new e(s[i],o):t=s[i].slick[o].apply(s[i].slick,n),void 0!==t)return t;return s}}),$(document).ready(function(){$(".issue__slider").slick({arrows:!1,dots:!0,slidesToShow:1,fade:!0,cssEase:"linear",autoplay:!0,autoplaySpeed:6e3,accessibility:!1,speed:500,pauseOnFocus:!1,pauseOnHover:!1,pauseOnDotsHover:!1,infinite:!0,responsive:[{breakpoint:767,settings:{slidesToShow:1,slidesToScroll:1}},]})});;
/*!
 * GSAP 3.12.2
 * https://greensock.com
 *
 * @license Copyright 2023, GreenSock. All rights reserved.
 * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
 */

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t){return"string"==typeof t}function s(t){return"function"==typeof t}function t(t){return"number"==typeof t}function u(t){return void 0===t}function v(t){return"object"==typeof t}function w(t){return!1!==t}function x(){return"undefined"!=typeof window}function y(t){return s(t)||r(t)}function P(t){return(i=yt(t,ot))&&Ee}function Q(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function R(t,e){return!e&&console.warn(t)}function S(t,e){return t&&(ot[t]=e)&&i&&(i[t]=e)||ot}function T(){return 0}function ea(t){var e,r,i=t[0];if(v(i)||s(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=gt.length;r--&&!gt[r].targetTest(i););e=gt[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Vt(t[r],e)))||t.splice(r,1);return t}function fa(t){return t._gsap||ea(Ot(t))[0]._gsap}function ga(t,e,r){return(r=t[e])&&s(r)?t[e]():u(r)&&t.getAttribute&&t.getAttribute(e)||r}function ha(t,e){return(t=t.split(",")).forEach(e)||t}function ia(t){return Math.round(1e5*t)/1e5||0}function ja(t){return Math.round(1e7*t)/1e7||0}function ka(t,e){var r=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+i:"-"===r?t-i:"*"===r?t*i:t/i}function la(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r}function ma(){var t,e,r=ct.length,i=ct.slice(0);for(dt={},t=ct.length=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)}function na(t,e,r,i){ct.length&&!L&&ma(),t.render(e,r,i||L&&e<0&&(t._initted||t._startAt)),ct.length&&!L&&ma()}function oa(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(at).length<2?e:r(t)?t.trim():t}function pa(t){return t}function qa(t,e){for(var r in e)r in t||(t[r]=e[r]);return t}function ta(t,e){for(var r in e)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=v(e[r])?ta(t[r]||(t[r]={}),e[r]):e[r]);return t}function ua(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i}function va(t){var e=t.parent||I,r=t.keyframes?function _setKeyframeDefaults(i){return function(t,e){for(var r in e)r in t||"duration"===r&&i||"ease"===r||(t[r]=e[r])}}($(t.keyframes)):qa;if(w(t.inherit))for(;e;)r(t,e.vars.defaults),e=e.parent||e._dp;return t}function xa(t,e,r,i,n){void 0===r&&(r="_first"),void 0===i&&(i="_last");var a,s=t[i];if(n)for(a=e[n];s&&s[n]>a;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t,e}function ya(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,a=e._next;n?n._next=a:t[r]===e&&(t[r]=a),a?a._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null}function za(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0}function Aa(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function Ca(t,e,r,i){return t._startAt&&(L?t._startAt.revert(ht):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))}function Ea(t){return t._repeat?Tt(t._tTime,t=t.duration()+t._rDelay)*t:0}function Ga(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function Ha(t){return t._end=ja(t._start+(t._tDur/Math.abs(t._ts||t._rts||X)||0))}function Ia(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=ja(r._time-(0<t._ts?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ha(t),r._dirty||Aa(r,t)),t}function Ja(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Ga(t.rawTime(),e),(!e._dur||kt(0,e.totalDuration(),r)-e._tTime>X)&&e.render(r,!0)),Aa(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)0<=r.rawTime()&&r.totalTime(r._tTime),r=r._dp;t._zTime=-X}}function Ka(e,r,i,n){return r.parent&&za(r),r._start=ja((t(i)?i:i||e!==I?xt(e,i,r):e._time)+r._delay),r._end=ja(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),xa(e,r,"_first","_last",e._sort?"_start":0),bt(r)||(e._recent=r),n||Ja(e,r),e._ts<0&&Ia(e,e._tTime),e}function La(t,e){return(ot.ScrollTrigger||Q("scrollTrigger",e))&&ot.ScrollTrigger.create(e,t)}function Ma(t,e,r,i,n){return Gt(t,e,n),t._initted?!r&&t._pt&&!L&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==Rt.frame?(ct.push(t),t._lazy=[n,i],1):void 0:1}function Ra(t,e,r,i){var n=t._repeat,a=ja(e)||0,s=t._tTime/t._tDur;return s&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:ja(a*(n+1)+t._rDelay*n):a,0<s&&!i&&Ia(t,t._tTime=t._tDur*s),t.parent&&Ha(t),r||Aa(t.parent,t),t}function Sa(t){return t instanceof Xt?Aa(t):Ra(t,t._dur)}function Va(e,r,i){var n,a,s=t(r[1]),o=(s?2:1)+(e<2?0:1),u=r[o];if(s&&(u.duration=r[1]),u.parent=i,e){for(n=u,a=i;a&&!("immediateRender"in n);)n=a.vars.defaults||{},a=w(a.vars.inherit)&&a.parent;u.immediateRender=w(n.immediateRender),e<2?u.runBackwards=1:u.startAt=r[o-1]}return new Zt(r[0],u,r[1+o])}function Wa(t,e){return t||0===t?e(t):e}function Ya(t,e){return r(t)&&(e=st.exec(t))?e[1]:""}function _a(t,e){return t&&v(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&v(t[0]))&&!t.nodeType&&t!==h}function cb(r){return r=Ot(r)[0]||R("Invalid scope")||{},function(t){var e=r.current||r.nativeElement||r;return Ot(t,e.querySelectorAll?e:e===r?R("Invalid scope")||a.createElement("div"):r)}}function db(t){return t.sort(function(){return.5-Math.random()})}function eb(t){if(s(t))return t;var p=v(t)?t:{each:t},_=jt(p.ease),m=p.from||0,g=parseFloat(p.base)||0,y={},e=0<m&&m<1,T=isNaN(m)||e,b=p.axis,w=m,x=m;return r(m)?w=x={center:.5,edges:.5,end:1}[m]||0:!e&&T&&(w=m[0],x=m[1]),function(t,e,r){var i,n,a,s,o,u,h,l,f,c=(r||p).length,d=y[c];if(!d){if(!(f="auto"===p.grid?0:(p.grid||[1,U])[1])){for(h=-U;h<(h=r[f++].getBoundingClientRect().left)&&f<c;);f--}for(d=y[c]=[],i=T?Math.min(f,c)*w-.5:m%f,n=f===U?0:T?c*x/f-.5:m/f|0,l=U,u=h=0;u<c;u++)a=u%f-i,s=n-(u/f|0),d[u]=o=b?Math.abs("y"===b?s:a):K(a*a+s*s),h<o&&(h=o),o<l&&(l=o);"random"===m&&db(d),d.max=h-l,d.min=l,d.v=c=(parseFloat(p.amount)||parseFloat(p.each)*(c<f?c-1:b?"y"===b?c/f:f:Math.max(f,c/f))||0)*("edges"===m?-1:1),d.b=c<0?g-c:g,d.u=Ya(p.amount||p.each)||0,_=_&&c<0?Yt(_):_}return c=(d[t]-d.min)/d.max||0,ja(d.b+(_?_(c):c)*d.v)+d.u}}function fb(i){var n=Math.pow(10,((i+"").split(".")[1]||"").length);return function(e){var r=ja(Math.round(parseFloat(e)/i)*i*n);return(r-r%1)/n+(t(e)?0:Ya(e))}}function gb(h,e){var l,f,r=$(h);return!r&&v(h)&&(l=r=h.radius||U,h.values?(h=Ot(h.values),(f=!t(h[0]))&&(l*=l)):h=fb(h.increment)),Wa(e,r?s(h)?function(t){return f=h(t),Math.abs(f-t)<=l?f:t}:function(e){for(var r,i,n=parseFloat(f?e.x:e),a=parseFloat(f?e.y:0),s=U,o=0,u=h.length;u--;)(r=f?(r=h[u].x-n)*r+(i=h[u].y-a)*i:Math.abs(h[u]-n))<s&&(s=r,o=u);return o=!l||s<=l?h[o]:e,f||o===e||t(e)?o:o+Ya(e)}:fb(h))}function hb(t,e,r,i){return Wa($(t)?!e:!0===r?!!(r=0):!i,function(){return $(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*i)/i})}function lb(e,r,t){return Wa(t,function(t){return e[~~r(t)]})}function ob(t){for(var e,r,i,n,a=0,s="";~(e=t.indexOf("random(",a));)i=t.indexOf(")",e),n="["===t.charAt(e+7),r=t.substr(e+7,i-e-7).match(n?at:tt),s+=t.substr(a,e-a)+hb(n?r:+r[0],n?0:+r[1],+r[2]||1e-5),a=i+1;return s+t.substr(a,t.length-a)}function rb(t,e,r){var i,n,a,s=t.labels,o=U;for(i in s)(n=s[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(a=i,o=n);return a}function tb(t){return za(t),t.scrollTrigger&&t.scrollTrigger.kill(!!L),t.progress()<1&&At(t,"onInterrupt"),t}function wb(t){if(x()&&t){var e=(t=!t.name&&t.default||t).name,r=s(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:T,render:he,add:Qt,kill:ce,modifier:fe,rawVars:0},a={targetTest:0,get:0,getSetter:ne,aliases:{},register:0};if(Ft(),t!==i){if(pt[e])return;qa(i,qa(ua(t,n),a)),yt(i.prototype,yt(n,ua(t,a))),pt[i.prop=e]=i,t.targetTest&&(gt.push(i),ft[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}S(e,i),t.register&&t.register(Ee,i,_e)}else t&&Ct.push(t)}function zb(t,e,r){return(6*(t+=t<0?1:1<t?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*St+.5|0}function Ab(e,r,i){var n,a,s,o,u,h,l,f,c,d,p=e?t(e)?[e>>16,e>>8&St,e&St]:0:Et.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Et[e])p=Et[e];else if("#"===e.charAt(0)){if(e.length<6&&(e="#"+(n=e.charAt(1))+n+(a=e.charAt(2))+a+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&St,p&St,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&St,e&St]}else if("hsl"===e.substr(0,3))if(p=d=e.match(tt),r){if(~e.indexOf("="))return p=e.match(et),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,u=p[1]/100,n=2*(h=p[2]/100)-(a=h<=.5?h*(u+1):h+u-h*u),3<p.length&&(p[3]*=1),p[0]=zb(o+1/3,n,a),p[1]=zb(o,n,a),p[2]=zb(o-1/3,n,a);else p=e.match(tt)||Et.transparent;p=p.map(Number)}return r&&!d&&(n=p[0]/St,a=p[1]/St,s=p[2]/St,h=((l=Math.max(n,a,s))+(f=Math.min(n,a,s)))/2,l===f?o=u=0:(c=l-f,u=.5<h?c/(2-l-f):c/(l+f),o=l===n?(a-s)/c+(a<s?6:0):l===a?(s-n)/c+2:(n-a)/c+4,o*=60),p[0]=~~(o+.5),p[1]=~~(100*u+.5),p[2]=~~(100*h+.5)),i&&p.length<4&&(p[3]=1),p}function Bb(t){var r=[],i=[],n=-1;return t.split(Dt).forEach(function(t){var e=t.match(rt)||[];r.push.apply(r,e),i.push(n+=e.length+1)}),r.c=i,r}function Cb(t,e,r){var i,n,a,s,o="",u=(t+o).match(Dt),h=e?"hsla(":"rgba(",l=0;if(!u)return t;if(u=u.map(function(t){return(t=Ab(t,e,1))&&h+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"}),r&&(a=Bb(t),(i=r.c).join(o)!==a.c.join(o)))for(s=(n=t.replace(Dt,"1").split(rt)).length-1;l<s;l++)o+=n[l]+(~i.indexOf(l)?u.shift()||h+"0,0,0,0)":(a.length?a:u.length?u:r).shift());if(!n)for(s=(n=t.split(Dt)).length-1;l<s;l++)o+=n[l]+u[l];return o+n[s]}function Fb(t){var e,r=t.join(" ");if(Dt.lastIndex=0,Dt.test(r))return e=zt.test(r),t[1]=Cb(t[1],e),t[0]=Cb(t[0],e,Bb(t[1])),!0}function Ob(t){var e=(t+"").split("("),r=Bt[e[0]];return r&&1<e.length&&r.config?r.config.apply(null,~t.indexOf("{")?[function _parseObjectInString(t){for(var e,r,i,n={},a=t.substr(1,t.length-3).split(":"),s=a[0],o=1,u=a.length;o<u;o++)r=a[o],e=o!==u-1?r.lastIndexOf(","):r.length,i=r.substr(0,e),n[s]=isNaN(i)?i.replace(It,"").trim():+i,s=r.substr(e+1).trim();return n}(e[1])]:function _valueInParentheses(t){var e=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<r?t.indexOf(")",r+1):r)}(t).split(",").map(oa)):Bt._CE&&Lt.test(t)?Bt._CE("",t):r}function Qb(t,e){for(var r,i=t._first;i;)i instanceof Xt?Qb(i,e):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===e||(i.timeline?Qb(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next}function Sb(t,e,r,i){void 0===r&&(r=function easeOut(t){return 1-e(1-t)}),void 0===i&&(i=function easeInOut(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var n,a={easeIn:e,easeOut:r,easeInOut:i};return ha(t,function(t){for(var e in Bt[t]=ot[t]=a,Bt[n=t.toLowerCase()]=r,a)Bt[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Bt[t+"."+e]=a[e]}),a}function Tb(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}}function Ub(r,t,e){function Jm(t){return 1===t?1:i*Math.pow(2,-10*t)*H((t-a)*n)+1}var i=1<=t?t:1,n=(e||(r?.3:.45))/(t<1?t:1),a=n/N*(Math.asin(1/i)||0),s="out"===r?Jm:"in"===r?function(t){return 1-Jm(1-t)}:Tb(Jm);return n=N/n,s.config=function(t,e){return Ub(r,t,e)},s}function Vb(e,r){function Rm(t){return t?--t*t*((r+1)*t+r)+1:0}void 0===r&&(r=1.70158);var t="out"===e?Rm:"in"===e?function(t){return 1-Rm(1-t)}:Tb(Rm);return t.config=function(t){return Vb(e,t)},t}var B,L,l,I,h,n,a,i,o,f,c,d,p,_,m,g,b,k,M,O,A,C,E,D,z,F,Y,j,q={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},V={duration:.5,overwrite:!1,delay:0},U=1e8,X=1/U,N=2*Math.PI,W=N/4,G=0,K=Math.sqrt,J=Math.cos,H=Math.sin,Z="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},$=Array.isArray,tt=/(?:-?\.?\d|\.)+/gi,et=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,rt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,it=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,nt=/[+-]=-?[.\d]+/,at=/[^,'"\[\]\s]+/gi,st=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ot={},ut={suppressEvents:!0,isStart:!0,kill:!1},ht={suppressEvents:!0,kill:!1},lt={suppressEvents:!0},ft={},ct=[],dt={},pt={},_t={},mt=30,gt=[],vt="",yt=function _merge(t,e){for(var r in e)t[r]=e[r];return t},Tt=function _animationCycle(t,e){var r=Math.floor(t/=e);return t&&r===t?r-1:r},bt=function _isFromOrFromStart(t){var e=t.data;return"isFromStart"===e||"isStart"===e},wt={_start:0,endTime:T,totalDuration:T},xt=function _parsePosition(t,e,i){var n,a,s,o=t.labels,u=t._recent||wt,h=t.duration()>=U?u.endTime(!1):t._dur;return r(e)&&(isNaN(e)||e in o)?(a=e.charAt(0),s="%"===e.substr(-1),n=e.indexOf("="),"<"===a||">"===a?(0<=n&&(e=e.replace(/=/,"")),("<"===a?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(s?(n<0?u:i).totalDuration()/100:1)):n<0?(e in o||(o[e]=h),o[e]):(a=parseFloat(e.charAt(n-1)+e.substr(n+1)),s&&i&&(a=a/100*($(i)?i[0]:i).totalDuration()),1<n?_parsePosition(t,e.substr(0,n-1),i)+a:h+a)):null==e?h:+e},kt=function _clamp(t,e,r){return r<t?t:e<r?e:r},Mt=[].slice,Ot=function toArray(t,e,i){return l&&!e&&l.selector?l.selector(t):!r(t)||i||!n&&Ft()?$(t)?function _flatten(t,e,i){return void 0===i&&(i=[]),t.forEach(function(t){return r(t)&&!e||_a(t,1)?i.push.apply(i,Ot(t)):i.push(t)})||i}(t,i):_a(t)?Mt.call(t,0):t?[t]:[]:Mt.call((e||a).querySelectorAll(t),0)},Pt=function mapRange(e,t,r,i,n){var a=t-e,s=i-r;return Wa(n,function(t){return r+((t-e)/a*s||0)})},At=function _callback(t,e,r){var i,n,a,s=t.vars,o=s[e],u=l,h=t._ctx;if(o)return i=s[e+"Params"],n=s.callbackScope||t,r&&ct.length&&ma(),h&&(l=h),a=i?o.apply(n,i):o.call(n),l=u,a},Ct=[],St=255,Et={aqua:[0,St,St],lime:[0,St,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,St],navy:[0,0,128],white:[St,St,St],olive:[128,128,0],yellow:[St,St,0],orange:[St,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[St,0,0],pink:[St,192,203],cyan:[0,St,St],transparent:[St,St,St,0]},Dt=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Et)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),zt=/hsl[a]?\(/,Rt=(M=Date.now,O=500,A=33,C=M(),E=C,z=D=1e3/240,g={time:0,frame:0,tick:function tick(){yl(!0)},deltaRatio:function deltaRatio(t){return b/(1e3/(t||60))},wake:function wake(){o&&(!n&&x()&&(h=n=window,a=h.document||{},ot.gsap=Ee,(h.gsapVersions||(h.gsapVersions=[])).push(Ee.version),P(i||h.GreenSockGlobals||!h.gsap&&h||{}),m=h.requestAnimationFrame,Ct.forEach(wb)),p&&g.sleep(),_=m||function(t){return setTimeout(t,z-1e3*g.time+1|0)},d=1,yl(2))},sleep:function sleep(){(m?h.cancelAnimationFrame:clearTimeout)(p),d=0,_=T},lagSmoothing:function lagSmoothing(t,e){O=t||1/0,A=Math.min(e||33,O)},fps:function fps(t){D=1e3/(t||240),z=1e3*g.time+D},add:function add(n,t,e){var a=t?function(t,e,r,i){n(t,e,r,i),g.remove(a)}:n;return g.remove(n),F[e?"unshift":"push"](a),Ft(),a},remove:function remove(t,e){~(e=F.indexOf(t))&&F.splice(e,1)&&e<=k&&k--},_listeners:F=[]}),Ft=function _wake(){return!d&&Rt.wake()},Bt={},Lt=/^[\d.\-M][\d.\-,\s]/,It=/["']/g,Yt=function _invertEase(e){return function(t){return 1-e(1-t)}},jt=function _parseEase(t,e){return t&&(s(t)?t:Bt[t]||Ob(t))||e};function yl(t){var e,r,i,n,a=M()-E,s=!0===t;if(O<a&&(C+=a-A),(0<(e=(i=(E+=a)-C)-z)||s)&&(n=++g.frame,b=i-1e3*g.time,g.time=i/=1e3,z+=e+(D<=e?4:D-e),r=1),s||(p=_(yl)),r)for(k=0;k<F.length;k++)F[k](i,b,n,t)}function gn(t){return t<j?Y*t*t:t<.7272727272727273?Y*Math.pow(t-1.5/2.75,2)+.75:t<.9090909090909092?Y*(t-=2.25/2.75)*t+.9375:Y*Math.pow(t-2.625/2.75,2)+.984375}ha("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var r=e<5?e+1:e;Sb(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},function(t){return 1-Math.pow(1-t,r)},function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2})}),Bt.Linear.easeNone=Bt.none=Bt.Linear.easeIn,Sb("Elastic",Ub("in"),Ub("out"),Ub()),Y=7.5625,j=1/2.75,Sb("Bounce",function(t){return 1-gn(1-t)},gn),Sb("Expo",function(t){return t?Math.pow(2,10*(t-1)):0}),Sb("Circ",function(t){return-(K(1-t*t)-1)}),Sb("Sine",function(t){return 1===t?1:1-J(t*W)}),Sb("Back",Vb("in"),Vb("out"),Vb()),Bt.SteppedEase=Bt.steps=ot.SteppedEase={config:function config(t,e){void 0===t&&(t=1);var r=1/t,i=t+(e?0:1),n=e?1:0;return function(t){return((i*kt(0,.99999999,t)|0)+n)*r}}},V.ease=Bt["quad.out"],ha("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return vt+=t+","+t+"Params,"});var qt,Vt=function GSCache(t,e){this.id=G++,(t._gsap=this).target=t,this.harness=e,this.get=e?e.get:ga,this.set=e?e.getSetter:ne},Ut=((qt=Animation.prototype).delay=function delay(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},qt.duration=function duration(t){return arguments.length?this.totalDuration(0<this._repeat?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},qt.totalDuration=function totalDuration(t){return arguments.length?(this._dirty=0,Ra(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},qt.totalTime=function totalTime(t,e){if(Ft(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Ia(this,t),!r._dp||r.parent||Ja(r,this);r&&r.parent;)r.parent._time!==r._start+(0<=r._ts?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(0<this._ts&&t<this._tDur||this._ts<0&&0<t||!this._tDur&&!t)&&Ka(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===X||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),na(this,t,e)),this},qt.time=function time(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Ea(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},qt.totalProgress=function totalProgress(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},qt.progress=function progress(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Ea(this),e):this.duration()?Math.min(1,this._time/this._dur):this.ratio},qt.iteration=function iteration(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?Tt(this._tTime,r)+1:1},qt.timeScale=function timeScale(t){if(!arguments.length)return this._rts===-X?0:this._rts;if(this._rts===t)return this;var e=this.parent&&this._ts?Ga(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-X?0:this._rts,this.totalTime(kt(-Math.abs(this._delay),this._tDur,e),!0),Ha(this),function _recacheAncestors(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},qt.paused=function paused(t){return arguments.length?(this._ps!==t&&((this._ps=t)?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ft(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==X&&(this._tTime-=X)))),this):this._ps},qt.startTime=function startTime(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return!e||!e._sort&&this.parent||Ka(e,this,t-this._delay),this}return this._start},qt.endTime=function endTime(t){return this._start+(w(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},qt.rawTime=function rawTime(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ga(e.rawTime(t),this):this._tTime:this._tTime},qt.revert=function revert(t){void 0===t&&(t=lt);var e=L;return L=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),L=e,this},qt.globalTime=function globalTime(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(e._ts||1),e=e._dp;return!this.parent&&this._sat?this._sat.vars.immediateRender?-1/0:this._sat.globalTime(t):r},qt.repeat=function repeat(t){return arguments.length?(this._repeat=t===1/0?-2:t,Sa(this)):-2===this._repeat?1/0:this._repeat},qt.repeatDelay=function repeatDelay(t){if(arguments.length){var e=this._time;return this._rDelay=t,Sa(this),e?this.time(e):this}return this._rDelay},qt.yoyo=function yoyo(t){return arguments.length?(this._yoyo=t,this):this._yoyo},qt.seek=function seek(t,e){return this.totalTime(xt(this,t),w(e))},qt.restart=function restart(t,e){return this.play().totalTime(t?-this._delay:0,w(e))},qt.play=function play(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},qt.reverse=function reverse(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},qt.pause=function pause(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},qt.resume=function resume(){return this.paused(!1)},qt.reversed=function reversed(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-X:0)),this):this._rts<0},qt.invalidate=function invalidate(){return this._initted=this._act=0,this._zTime=-X,this},qt.isActive=function isActive(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-X))},qt.eventCallback=function eventCallback(t,e,r){var i=this.vars;return 1<arguments.length?(e?(i[t]=e,r&&(i[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete i[t],this):i[t]},qt.then=function then(t){var i=this;return new Promise(function(e){function Bo(){var t=i.then;i.then=null,s(r)&&(r=r(i))&&(r.then||r===i)&&(i.then=t),e(r),i.then=t}var r=s(t)?t:pa;i._initted&&1===i.totalProgress()&&0<=i._ts||!i._tTime&&i._ts<0?Bo():i._prom=Bo})},qt.kill=function kill(){tb(this)},Animation);function Animation(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Ra(this,+t.duration,1,1),this.data=t.data,l&&(this._ctx=l).data.push(this),d||Rt.wake()}qa(Ut.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-X,_prom:0,_ps:!1,_rts:1});var Xt=function(i){function Timeline(t,e){var r;return void 0===t&&(t={}),(r=i.call(this,t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=w(t.sortChildren),I&&Ka(t.parent||I,_assertThisInitialized(r),e),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&La(_assertThisInitialized(r),t.scrollTrigger),r}_inheritsLoose(Timeline,i);var e=Timeline.prototype;return e.to=function to(t,e,r){return Va(0,arguments,this),this},e.from=function from(t,e,r){return Va(1,arguments,this),this},e.fromTo=function fromTo(t,e,r,i){return Va(2,arguments,this),this},e.set=function set(t,e,r){return e.duration=0,e.parent=this,va(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new Zt(t,e,xt(this,r),1),this},e.call=function call(t,e,r){return Ka(this,Zt.delayedCall(0,t,e),r)},e.staggerTo=function staggerTo(t,e,r,i,n,a,s){return r.duration=e,r.stagger=r.stagger||i,r.onComplete=a,r.onCompleteParams=s,r.parent=this,new Zt(t,r,xt(this,n)),this},e.staggerFrom=function staggerFrom(t,e,r,i,n,a,s){return r.runBackwards=1,va(r).immediateRender=w(r.immediateRender),this.staggerTo(t,e,r,i,n,a,s)},e.staggerFromTo=function staggerFromTo(t,e,r,i,n,a,s,o){return i.startAt=r,va(i).immediateRender=w(i.immediateRender),this.staggerTo(t,e,i,n,a,s,o)},e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,c,d,p,_=this._time,m=this._dirty?this.totalDuration():this._tDur,g=this._dur,v=t<=0?0:ja(t),y=this._zTime<0!=t<0&&(this._initted||!g);if(this!==I&&m<v&&0<=t&&(v=m),v!==this._tTime||r||y){if(_!==this._time&&g&&(v+=this._time-_,t+=this._time-_),i=v,f=this._start,u=!(l=this._ts),y&&(g||(_=this._zTime),!t&&e||(this._zTime=t)),this._repeat){if(d=this._yoyo,o=g+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,r);if(i=ja(v%o),v===m?(s=this._repeat,i=g):((s=~~(v/o))&&s===v/o&&(i=g,s--),g<i&&(i=g)),c=Tt(this._tTime,o),!_&&this._tTime&&c!==s&&this._tTime-c*o-this._dur<=0&&(c=s),d&&1&s&&(i=g-i,p=1),s!==c&&!this._lock){var T=d&&1&c,b=T===(d&&1&s);if(s<c&&(T=!T),_=T?0:v%g?g:v,this._lock=1,this.render(_||(p?0:ja(s*o)),e,!g)._lock=0,this._tTime=v,!e&&this.parent&&At(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1),_&&_!==this._time||u!=!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(g=this._dur,m=this._tDur,b&&(this._lock=2,_=T?g:-1e-4,this.render(_,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;Qb(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(h=function _findNextPauseTween(t,e,r){var i;if(e<r)for(i=t._first;i&&i._start<=r;){if("isPause"===i.data&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start<e)return i;i=i._prev}}(this,ja(_),ja(i)))&&(v-=i-(i=h._start)),this._tTime=v,this._time=i,this._act=!l,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,_=0),!_&&i&&!e&&!s&&(At(this,"onStart"),this._tTime!==v))return this;if(_<=i&&0<=t)for(n=this._first;n;){if(a=n._next,(n._act||i>=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(i-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(i-n._start)*n._ts,e,r),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=-X);break}}n=a}else{n=this._last;for(var w=t<0?t:i;n;){if(a=n._prev,(n._act||w<=n._end)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(w-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(w-n._start)*n._ts,e,r||L&&(n._initted||n._startAt)),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=w?-X:X);break}}n=a}}if(h&&!e&&(this.pause(),h.render(_<=i?0:-X)._zTime=_<=i?1:-1,this._ts))return this._start=f,Ha(this),this.render(t,e,r);this._onUpdate&&!e&&At(this,"onUpdate",!0),(v===m&&this._tTime>=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0<this._ts||!v&&this._ts<0)||za(this,1),e||t<0&&!_||!v&&!_&&m||(At(this,v===m&&0<=t?"onComplete":"onReverseComplete",!0),!this._prom||v<m&&0<this.timeScale()||this._prom())))}return this},e.add=function add(e,i){var n=this;if(t(i)||(i=xt(this,i,e)),!(e instanceof Ut)){if($(e))return e.forEach(function(t){return n.add(t,i)}),this;if(r(e))return this.addLabel(e,i);if(!s(e))return this;e=Zt.delayedCall(0,e)}return this!==e?Ka(this,e,i):this},e.getChildren=function getChildren(t,e,r,i){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===i&&(i=-U);for(var n=[],a=this._first;a;)a._start>=i&&(a instanceof Zt?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return r(t)?this.removeLabel(t):s(t)?this.killTweensOf(t):(ya(this,t),t===this._recent&&(this._recent=this._last),Aa(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ja(Rt.time-(0<this._ts?t/this._ts:(this.totalDuration()-t)/-this._ts))),i.prototype.totalTime.call(this,t,e),this._forcing=0,this):this._tTime},e.addLabel=function addLabel(t,e){return this.labels[t]=xt(this,e),this},e.removeLabel=function removeLabel(t){return delete this.labels[t],this},e.addPause=function addPause(t,e,r){var i=Zt.delayedCall(0,e||T,r);return i.data="isPause",this._hasPause=1,Ka(this,i,xt(this,t))},e.removePause=function removePause(t){var e=this._first;for(t=xt(this,t);e;)e._start===t&&"isPause"===e.data&&za(e),e=e._next},e.killTweensOf=function killTweensOf(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)Nt!==i[n]&&i[n].kill(t,e);return this},e.getTweensOf=function getTweensOf(e,r){for(var i,n=[],a=Ot(e),s=this._first,o=t(r);s;)s instanceof Zt?la(s._targets,a)&&(o?(!Nt||s._initted&&s._ts)&&s.globalTime(0)<=r&&s.globalTime(s.totalDuration())>r:!r||s.isActive())&&n.push(s):(i=s.getTweensOf(a,r)).length&&n.push.apply(n,i),s=s._next;return n},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=xt(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=Zt.to(i,qa({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||X,onStart:function onStart(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&Ra(h,t,0,1).render(h._time,!0,!0),r=1}s&&s.apply(h,o||[])}},e));return u?h.render(0):h},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,qa({startAt:{time:xt(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),rb(this,xt(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),rb(this,xt(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+X)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,a=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return Aa(this)},e.invalidate=function invalidate(t){var e=this._first;for(this._lock=0;e;)e.invalidate(t),e=e._next;return i.prototype.invalidate.call(this,t)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Aa(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=U;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Ka(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=r/a._ts,a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ra(a,a===I&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(I._ts&&(na(I,Ga(t,I)),f=Rt.frame),Rt.frame>=mt){mt+=q.autoSleep||120;var e=I._first;if((!e||!e._ts)&&q.autoSleep&&Rt._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Rt.sleep()}}},Timeline}(Ut);qa(Xt.prototype,{_lock:0,_hasPause:0,_forcing:0});function ac(t,e,i,n,a,o){var u,h,l,f;if(pt[t]&&!1!==(u=new pt[t]).init(a,u.rawVars?e[t]:function _processVars(t,e,i,n,a){if(s(t)&&(t=Kt(t,a,e,i,n)),!v(t)||t.style&&t.nodeType||$(t)||Z(t))return r(t)?Kt(t,a,e,i,n):t;var o,u={};for(o in t)u[o]=Kt(t[o],a,e,i,n);return u}(e[t],n,a,o,i),i,n,o)&&(i._pt=h=new _e(i._pt,a,t,0,1,u.render,u,0,u.priority),i!==c))for(l=i._ptLookup[i._targets.indexOf(a)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function gc(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if($(r))a=e[t]||(e[t]=[]),r.forEach(function(t,e){return a.push({t:e/(r.length-1)*100,v:t,e:s})});else for(n in r)a=e[n]||(e[n]=[]),"ease"===n||a.push({t:parseFloat(t),v:r[n],e:s})}var Nt,Wt,Qt=function _addPropTween(t,e,i,n,a,o,u,h,l,f){s(n)&&(n=n(a||0,t,o));var c,d=t[e],p="get"!==i?i:s(d)?l?t[e.indexOf("set")||!s(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():d,_=s(d)?l?re:te:$t;if(r(n)&&(~n.indexOf("random(")&&(n=ob(n)),"="===n.charAt(1)&&(!(c=ka(p,n)+(Ya(p)||0))&&0!==c||(n=c))),!f||p!==n||Wt)return isNaN(p*n)||""===n?(d||e in t||Q(e,n),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,c,d,p,_=new _e(this._pt,t,e,0,1,ue,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(d=~(i+="").indexOf("random("))&&(i=ob(i)),a&&(a(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(it)||[];o=it.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(c=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:c,c:"="===l.charAt(1)?ka(c,l)-c:parseFloat(l)-c,m:h&&h<4?Math.round:0},m=it.lastIndex);return _.c=m<i.length?i.substring(m,i.length):"",_.fp=s,(nt.test(i)||d)&&(_.e=0),this._pt=_}.call(this,t,e,p,n,_,h||q.stringFilter,l)):(c=new _e(this._pt,t,e,+p||0,n-(p||0),"boolean"==typeof d?se:ae,0,_),l&&(c.fp=l),u&&c.modifier(u,this,t),this._pt=c)},Gt=function _initTween(t,e,r){var i,n,a,s,o,u,h,l,f,c,d,p,_,m=t.vars,g=m.ease,v=m.startAt,y=m.immediateRender,T=m.lazy,b=m.onUpdate,x=m.onUpdateParams,k=m.callbackScope,M=m.runBackwards,O=m.yoyoEase,P=m.keyframes,A=m.autoRevert,C=t._dur,S=t._startAt,E=t._targets,D=t.parent,z=D&&"nested"===D.data?D.vars.targets:E,R="auto"===t._overwrite&&!B,F=t.timeline;if(!F||P&&g||(g="none"),t._ease=jt(g,V.ease),t._yEase=O?Yt(jt(!0===O?g:O,V.ease)):0,O&&t._yoyo&&!t._repeat&&(O=t._yEase,t._yEase=t._ease,t._ease=O),t._from=!F&&!!m.runBackwards,!F||P&&!m.stagger){if(p=(l=E[0]?fa(E[0]).harness:0)&&m[l.prop],i=ua(m,ft),S&&(S._zTime<0&&S.progress(1),e<0&&M&&y&&!A?S.render(-1,!0):S.revert(M&&C?ht:ut),S._lazy=0),v){if(za(t._startAt=Zt.set(E,qa({data:"isStart",overwrite:!1,parent:D,immediateRender:!0,lazy:!S&&w(T),startAt:null,delay:0,onUpdate:b,onUpdateParams:x,callbackScope:k,stagger:0},v))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(L||!y&&!A)&&t._startAt.revert(ht),y&&C&&e<=0&&r<=0)return void(e&&(t._zTime=e))}else if(M&&C&&!S)if(e&&(y=!1),a=qa({overwrite:!1,data:"isFromStart",lazy:y&&!S&&w(T),immediateRender:y,stagger:0,parent:D},i),p&&(a[l.prop]=p),za(t._startAt=Zt.set(E,a)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(L?t._startAt.revert(ht):t._startAt.render(-1,!0)),t._zTime=e,y){if(!e)return}else _initTween(t._startAt,X,X);for(t._pt=t._ptCache=0,T=C&&w(T)||T&&!C,n=0;n<E.length;n++){if(h=(o=E[n])._gsap||ea(E)[n]._gsap,t._ptLookup[n]=c={},dt[h.id]&&ct.length&&ma(),d=z===E?n:z.indexOf(o),l&&!1!==(f=new l).init(o,p||i,t,d,z)&&(t._pt=s=new _e(t._pt,o,f.name,0,1,f.render,f,0,f.priority),f._props.forEach(function(t){c[t]=s}),f.priority&&(u=1)),!l||p)for(a in i)pt[a]&&(f=ac(a,i,t,d,o,z))?f.priority&&(u=1):c[a]=s=Qt.call(t,o,a,"get",i[a],d,z,0,m.stringFilter);t._op&&t._op[n]&&t.kill(o,t._op[n]),R&&t._pt&&(Nt=t,I.killTweensOf(o,c,t.globalTime(e)),_=!t.parent,Nt=0),t._pt&&T&&(dt[h.id]=1)}u&&pe(t),t._onInit&&t._onInit(t)}t._onUpdate=b,t._initted=(!t._op||t._pt)&&!_,P&&e<=0&&F.render(U,!0,!0)},Kt=function _parseFuncOrString(t,e,i,n,a){return s(t)?t.call(e,i,n,a):r(t)&&~t.indexOf("random(")?ob(t):t},Jt=vt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Ht={};ha(Jt+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return Ht[t]=1});var Zt=function(z){function Tween(e,r,i,n){var a;"number"==typeof r&&(i.duration=r,r=i,i=null);var s,o,u,h,l,f,c,d,p=(a=z.call(this,n?r:va(r))||this).vars,_=p.duration,m=p.delay,g=p.immediateRender,T=p.stagger,b=p.overwrite,x=p.keyframes,k=p.defaults,M=p.scrollTrigger,O=p.yoyoEase,P=r.parent||I,A=($(e)||Z(e)?t(e[0]):"length"in r)?[e]:Ot(e);if(a._targets=A.length?ea(A):R("GSAP target "+e+" not found. https://greensock.com",!q.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=b,x||T||y(_)||y(m)){if(r=a.vars,(s=a.timeline=new Xt({data:"nested",defaults:k||{},targets:P&&"nested"===P.data?P.vars.targets:A})).kill(),s.parent=s._dp=_assertThisInitialized(a),s._start=0,T||y(_)||y(m)){if(h=A.length,c=T&&eb(T),v(T))for(l in T)~Jt.indexOf(l)&&((d=d||{})[l]=T[l]);for(o=0;o<h;o++)(u=ua(r,Ht)).stagger=0,O&&(u.yoyoEase=O),d&&yt(u,d),f=A[o],u.duration=+Kt(_,_assertThisInitialized(a),o,f,A),u.delay=(+Kt(m,_assertThisInitialized(a),o,f,A)||0)-a._delay,!T&&1===h&&u.delay&&(a._delay=m=u.delay,a._start+=m,u.delay=0),s.to(f,u,c?c(o,f,A):0),s._ease=Bt.none;s.duration()?_=m=0:a.timeline=0}else if(x){va(qa(s.vars.defaults,{ease:"none"})),s._ease=jt(x.ease||r.ease||"none");var C,S,E,D=0;if($(x))x.forEach(function(t){return s.to(A,t,">")}),s.duration();else{for(l in u={},x)"ease"===l||"easeEach"===l||gc(l,x[l],u,x.easeEach);for(l in u)for(C=u[l].sort(function(t,e){return t.t-e.t}),o=D=0;o<C.length;o++)(E={ease:(S=C[o]).e,duration:(S.t-(o?C[o-1].t:0))/100*_})[l]=S.v,s.to(A,E,D),D+=E.duration;s.duration()<_&&s.to({},{duration:_-s.duration()})}}_||a.duration(_=s.duration())}else a.timeline=0;return!0!==b||B||(Nt=_assertThisInitialized(a),I.killTweensOf(A),Nt=0),Ka(P,_assertThisInitialized(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(g||!_&&!x&&a._start===ja(P._time)&&w(g)&&function _hasNoPausedAncestors(t){return!t||t._ts&&_hasNoPausedAncestors(t.parent)}(_assertThisInitialized(a))&&"nested"!==P.data)&&(a._tTime=-X,a.render(Math.max(0,-m)||0)),M&&La(_assertThisInitialized(a),M),a}_inheritsLoose(Tween,z);var e=Tween.prototype;return e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,c=this._time,d=this._tDur,p=this._dur,_=t<0,m=d-X<t&&!_?d:t<X?0:t;if(p){if(m!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=_){if(i=m,l=this.timeline,this._repeat){if(s=p+this._rDelay,this._repeat<-1&&_)return this.totalTime(100*s+t,e,r);if(i=ja(m%s),m===d?(a=this._repeat,i=p):((a=~~(m/s))&&a===m/s&&(i=p,a--),p<i&&(i=p)),(u=this._yoyo&&1&a)&&(f=this._yEase,i=p-i),o=Tt(this._tTime,s),i===c&&!r&&this._initted)return this._tTime=m,this;a!==o&&(l&&this._yEase&&Qb(l,u),!this.vars.repeatRefresh||u||this._lock||(this._lock=r=1,this.render(ja(s*a),!0).invalidate()._lock=0))}if(!this._initted){if(Ma(this,_?t:i,r,e,m))return this._tTime=0,this;if(c!==this._time)return this;if(p!==this._dur)return this.render(t,e,r)}if(this._tTime=m,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=h=(f||this._ease)(i/p),this._from&&(this.ratio=h=1-h),i&&!c&&!e&&!a&&(At(this,"onStart"),this._tTime!==m))return this;for(n=this._pt;n;)n.r(h,n.d),n=n._next;l&&l.render(t<0?t:!i&&u?-X:l._dur*l._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(_&&Ca(this,t,0,r),At(this,"onUpdate")),this._repeat&&a!==o&&this.vars.onRepeat&&!e&&this.parent&&At(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(_&&!this._onUpdate&&Ca(this,t,0,!0),!t&&p||!(m===this._tDur&&0<this._ts||!m&&this._ts<0)||za(this,1),e||_&&!c||!(m||c||u)||(At(this,m===d?"onComplete":"onReverseComplete",!0),!this._prom||m<d&&0<this.timeScale()||this._prom()))}}else!function _renderZeroDurationTween(t,e,r,i){var n,a,s,o=t.ratio,u=e<0||!e&&(!t._start&&function _parentPlayheadIsBeforeStart(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||_parentPlayheadIsBeforeStart(e))}(t)&&(t._initted||!bt(t))||(t._ts<0||t._dp._ts<0)&&!bt(t))?0:1,h=t._rDelay,l=0;if(h&&t._repeat&&(l=kt(0,t._tDur,e),a=Tt(l,h),t._yoyo&&1&a&&(u=1-u),a!==Tt(t._tTime,h)&&(o=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==o||L||i||t._zTime===X||!e&&t._zTime){if(!t._initted&&Ma(t,e,i,r,l))return;for(s=t._zTime,t._zTime=e||(r?X:0),r=r||e&&!s,t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=l,n=t._pt;n;)n.r(u,n.d),n=n._next;e<0&&Ca(t,e,0,!0),t._onUpdate&&!r&&At(t,"onUpdate"),l&&t._repeat&&!r&&t.parent&&At(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&za(t,1),r||L||(At(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),z.prototype.invalidate.call(this,t)},e.resetTo=function resetTo(t,e,r,i){d||Rt.wake(),this._ts||this.play();var n,a=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Gt(this,a),n=this._ease(a/this._dur),function _updatePropTweens(t,e,r,i,n,a,s){var o,u,h,l,f=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!f)for(f=t._ptCache[e]=[],h=t._ptLookup,l=t._targets.length;l--;){if((o=h[l][e])&&o.d&&o.d._pt)for(o=o.d._pt;o&&o.p!==e&&o.fp!==e;)o=o._next;if(!o)return Wt=1,t.vars[e]="+=0",Gt(t,s),Wt=0,1;f.push(o)}for(l=f.length;l--;)(o=(u=f[l])._pt||u).s=!i&&0!==i||n?o.s+(i||0)+a*o.c:i,o.c=r-o.s,u.e&&(u.e=ia(r)+Ya(u.e)),u.b&&(u.b=o.s+Ya(u.b))}(this,t,e,r,i,n,a)?this.resetTo(t,e,r,i):(Ia(this,0),this.parent||xa(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?tb(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Nt&&!0!==Nt.vars.overwrite)._first||tb(this),this.parent&&i!==this.timeline.totalDuration()&&Ra(this,this._dur*this.timeline._tDur/i,0,1),this}var n,a,s,o,u,h,l,f=this._targets,c=t?Ot(t):f,d=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,c))return"all"===e&&(this._pt=0),tb(this);for(n=this._op=this._op||[],"all"!==e&&(r(e)&&(u={},ha(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?fa(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=yt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~c.indexOf(f[l]))for(u in a=d[l],"all"===e?(n[l]=e,o=a,s={}):(s=n[l]=n[l]||{},o=e),o)(h=a&&a[u])&&("kill"in h.d&&!0!==h.d.kill(u)||ya(this,h,"_pt"),delete a[u]),"all"!==s&&(s[u]=1);return this._initted&&!this._pt&&p&&tb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Va(1,arguments)},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return Va(2,arguments)},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return I.killTweensOf(t,e,r)},Tween}(Ut);qa(Zt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ha("staggerTo,staggerFrom,staggerFromTo",function(r){Zt[r]=function(){var t=new Xt,e=Mt.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function oc(t,e,r){return t.setAttribute(e,r)}function wc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var $t=function _setterPlain(t,e,r){return t[e]=r},te=function _setterFunc(t,e,r){return t[e](r)},re=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},ne=function _getSetter(t,e){return s(t[e])?te:u(t[e])&&t.setAttribute?oc:$t},ae=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},se=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ue=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},he=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},fe=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},ce=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?ya(this,i,"_pt"):i.dep||(e=1),i=r;return!e},pe=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},_e=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=wc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||ae,this.d=s||this,this.set=o||$t,this.pr=u||0,(this._next=t)&&(t._prev=this)}ha(vt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ft[t]=1}),ot.TweenMax=ot.TweenLite=Zt,ot.TimelineLite=ot.TimelineMax=Xt,I=new Xt({sortChildren:!1,defaults:V,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),q.stringFilter=Fb;function Ec(t){return(ye[t]||Te).map(function(t){return t()})}function Fc(){var t=Date.now(),o=[];2<t-Me&&(Ec("matchMediaInit"),ge.forEach(function(t){var e,r,i,n,a=t.queries,s=t.conditions;for(r in a)(e=h.matchMedia(a[r]).matches)&&(i=1),e!==s[r]&&(s[r]=e,n=1);n&&(t.revert(),i&&o.push(t))}),Ec("matchMediaRevert"),o.forEach(function(t){return t.onMatch(t)}),Me=t,Ec("matchMedia"))}var me,ge=[],ye={},Te=[],Me=0,Oe=0,Pe=((me=Context.prototype).add=function add(t,i,n){function Ew(){var t,e=l,r=a.selector;return e&&e!==a&&e.data.push(a),n&&(a.selector=cb(n)),l=a,t=i.apply(a,arguments),s(t)&&a._r.push(t),l=e,a.selector=r,a.isReverted=!1,t}s(t)&&(n=i,i=t,t=s);var a=this;return a.last=Ew,t===s?Ew(a):t?a[t]=Ew:Ew},me.ignore=function ignore(t){var e=l;l=null,t(this),l=e},me.getTweens=function getTweens(){var e=[];return this.data.forEach(function(t){return t instanceof Context?e.push.apply(e,t.getTweens()):t instanceof Zt&&!(t.parent&&"nested"===t.parent.data)&&e.push(t)}),e},me.clear=function clear(){this._r.length=this.data.length=0},me.kill=function kill(e,t){var r=this;if(e){var i=this.getTweens();this.data.forEach(function(t){"isFlip"===t.data&&(t.revert(),t.getChildren(!0,!0,!1).forEach(function(t){return i.splice(i.indexOf(t),1)}))}),i.map(function(t){return{g:t.globalTime(0),t:t}}).sort(function(t,e){return e.g-t.g||-1/0}).forEach(function(t){return t.t.revert(e)}),this.data.forEach(function(t){return!(t instanceof Zt)&&t.revert&&t.revert(e)}),this._r.forEach(function(t){return t(e,r)}),this.isReverted=!0}else this.data.forEach(function(t){return t.kill&&t.kill()});if(this.clear(),t)for(var n=ge.length;n--;)ge[n].id===this.id&&ge.splice(n,1)},me.revert=function revert(t){this.kill(t||{})},Context);function Context(t,e){this.selector=e&&cb(e),this.data=[],this._r=[],this.isReverted=!1,this.id=Oe++,t&&this.add(t)}var Ae,Ce=((Ae=MatchMedia.prototype).add=function add(t,e,r){v(t)||(t={matches:t});var i,n,a,s=new Pe(0,r||this.scope),o=s.conditions={};for(n in l&&!s.selector&&(s.selector=l.selector),this.contexts.push(s),e=s.add("onMatch",e),s.queries=t)"all"===n?a=1:(i=h.matchMedia(t[n]))&&(ge.indexOf(s)<0&&ge.push(s),(o[n]=i.matches)&&(a=1),i.addListener?i.addListener(Fc):i.addEventListener("change",Fc));return a&&e(s),this},Ae.revert=function revert(t){this.kill(t||{})},Ae.kill=function kill(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},MatchMedia);function MatchMedia(t){this.contexts=[],this.scope=t}var Se={registerPlugin:function registerPlugin(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t){return wb(t)})},timeline:function timeline(t){return new Xt(t)},getTweensOf:function getTweensOf(t,e){return I.getTweensOf(t,e)},getProperty:function getProperty(i,t,e,n){r(i)&&(i=Ot(i)[0]);var a=fa(i||{}).get,s=e?pa:oa;return"native"===e&&(e=""),i?t?s((pt[t]&&pt[t].get||a)(i,t,e,n)):function(t,e,r){return s((pt[t]&&pt[t].get||a)(i,t,e,r))}:i},quickSetter:function quickSetter(r,e,i){if(1<(r=Ot(r)).length){var n=r.map(function(t){return Ee.quickSetter(t,e,i)}),a=n.length;return function(t){for(var e=a;e--;)n[e](t)}}r=r[0]||{};var s=pt[e],o=fa(r),u=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(t){var e=new s;c._pt=0,e.init(r,i?t+i:t,c,0,[r]),e.render(1,e),c._pt&&he(1,c)}:o.set(r,u);return s?h:function(t){return h(r,u,i?t+i:t,o,1)}},quickTo:function quickTo(t,i,e){function Wx(t,e,r){return n.resetTo(i,t,e,r)}var r,n=Ee.to(t,yt(((r={})[i]="+=0.1",r.paused=!0,r),e||{}));return Wx.tween=n,Wx},isTweening:function isTweening(t){return 0<I.getTweensOf(t,!0).length},defaults:function defaults(t){return t&&t.ease&&(t.ease=jt(t.ease,V.ease)),ta(V,t||{})},config:function config(t){return ta(q,t||{})},registerEffect:function registerEffect(t){var i=t.name,n=t.effect,e=t.plugins,a=t.defaults,r=t.extendTimeline;(e||"").split(",").forEach(function(t){return t&&!pt[t]&&!ot[t]&&R(i+" effect requires "+t+" plugin.")}),_t[i]=function(t,e,r){return n(Ot(t),qa(e||{},a),r)},r&&(Xt.prototype[i]=function(t,e,r){return this.add(_t[i](t,v(e)?e:(r=e)&&{},this),r)})},registerEase:function registerEase(t,e){Bt[t]=jt(e)},parseEase:function parseEase(t,e){return arguments.length?jt(t,e):Bt},getById:function getById(t){return I.getById(t)},exportRoot:function exportRoot(t,e){void 0===t&&(t={});var r,i,n=new Xt(t);for(n.smoothChildTiming=w(t.smoothChildTiming),I.remove(n),n._dp=0,n._time=n._tTime=I._time,r=I._first;r;)i=r._next,!e&&!r._dur&&r instanceof Zt&&r.vars.onComplete===r._targets[0]||Ka(n,r,r._start-r._delay),r=i;return Ka(I,n,0),n},context:function context(t,e){return t?new Pe(t,e):l},matchMedia:function matchMedia(t){return new Ce(t)},matchMediaRefresh:function matchMediaRefresh(){return ge.forEach(function(t){var e,r,i=t.conditions;for(r in i)i[r]&&(i[r]=!1,e=1);e&&t.revert()})||Fc()},addEventListener:function addEventListener(t,e){var r=ye[t]||(ye[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function removeEventListener(t,e){var r=ye[t],i=r&&r.indexOf(e);0<=i&&r.splice(i,1)},utils:{wrap:function wrap(e,t,r){var i=t-e;return $(e)?lb(e,wrap(0,e.length),t):Wa(r,function(t){return(i+(t-e)%i)%i+e})},wrapYoyo:function wrapYoyo(e,t,r){var i=t-e,n=2*i;return $(e)?lb(e,wrapYoyo(0,e.length-1),t):Wa(r,function(t){return e+(i<(t=(n+(t-e)%n)%n||0)?n-t:t)})},distribute:eb,random:hb,snap:gb,normalize:function normalize(t,e,r){return Pt(t,e,0,1,r)},getUnit:Ya,clamp:function clamp(e,r,t){return Wa(t,function(t){return kt(e,r,t)})},splitColor:Ab,toArray:Ot,selector:cb,mapRange:Pt,pipe:function pipe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce(function(t,e){return e(t)},t)}},unitize:function unitize(e,r){return function(t){return e(parseFloat(t))+(r||Ya(t))}},interpolate:function interpolate(e,i,t,n){var a=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!a){var s,o,u,h,l,f=r(e),c={};if(!0===t&&(n=1)&&(t=null),f)e={p:e},i={p:i};else if($(e)&&!$(i)){for(u=[],h=e.length,l=h-2,o=1;o<h;o++)u.push(interpolate(e[o-1],e[o]));h--,a=function func(t){t*=h;var e=Math.min(l,~~t);return u[e](t-e)},t=i}else n||(e=yt($(e)?[]:{},e));if(!u){for(s in i)Qt.call(c,e,s,"get",i[s]);a=function func(t){return he(t,c)||(f?e.p:e)}}}return Wa(t,a)},shuffle:db},install:P,effects:_t,ticker:Rt,updateRoot:Xt.updateRoot,plugins:pt,globalTimeline:I,core:{PropTween:_e,globals:S,Tween:Zt,Timeline:Xt,Animation:Ut,getCache:fa,_removeLinkedListItem:ya,reverting:function reverting(){return L},context:function context(t){return t&&l&&(l.data.push(t),t._ctx=l),l},suppressOverwrites:function suppressOverwrites(t){return B=t}}};ha("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Se[t]=Zt[t]}),Rt.add(Xt.updateRoot),c=Se.to({},{duration:0});function Jc(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r}function Lc(t,a){return{name:t,rawVars:1,init:function init(t,n,e){e._onInit=function(t){var e,i;if(r(n)&&(e={},ha(n,function(t){return e[t]=1}),n=e),a){for(i in e={},n)e[i]=a(n[i]);n=e}!function _addModifiers(t,e){var r,i,n,a=t._targets;for(r in e)for(i=a.length;i--;)(n=(n=t._ptLookup[i][r])&&n.d)&&(n._pt&&(n=Jc(n,r)),n&&n.modifier&&n.modifier(e[r],t,a[i],r))}(t,n)}}}}var Ee=Se.registerPlugin({name:"attr",init:function init(t,e,r,i,n){var a,s,o;for(a in this.tween=r,e)o=t.getAttribute(a)||"",(s=this.add(t,"setAttribute",(o||0)+"",e[a],i,n,0,0,a)).op=a,s.b=o,this._props.push(a)},render:function render(t,e){for(var r=e._pt;r;)L?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",init:function init(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},Lc("roundProps",fb),Lc("modifiers"),Lc("snap",gb))||Se;Zt.version=Xt.version=Ee.version="3.12.2",o=1,x()&&Ft();function vd(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function wd(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function xd(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function yd(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)}function zd(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)}function Ad(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)}function Bd(t,e,r){return t.style[e]=r}function Cd(t,e,r){return t.style.setProperty(e,r)}function Dd(t,e,r){return t._gsap[e]=r}function Ed(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r}function Fd(t,e,r,i,n){var a=t._gsap;a.scaleX=a.scaleY=r,a.renderTransform(n,a)}function Gd(t,e,r,i,n){var a=t._gsap;a[e]=r,a.renderTransform(n,a)}function Jd(t,e){var r=this,i=this.target,n=i.style;if(t in ar&&n){if(this.tfm=this.tfm||{},"transform"===t)return cr.transform.split(",").forEach(function(t){return Jd.call(r,t,e)});if(~(t=cr[t]||t).indexOf(",")?t.split(",").forEach(function(t){return r.tfm[t]=yr(i,t)}):this.tfm[t]=i._gsap.x?i._gsap[t]:yr(i,t),0<=this.props.indexOf(dr))return;i._gsap.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(pr,e,"")),t=dr}(n||e)&&this.props.push(t,e,n[t])}function Kd(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))}function Ld(){var t,e,r=this.props,i=this.target,n=i.style,a=i._gsap;for(t=0;t<r.length;t+=3)r[t+1]?i[r[t]]=r[t+2]:r[t+2]?n[r[t]]=r[t+2]:n.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(hr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)a[e]=this.tfm[e];a.svg&&(a.renderTransform(),i.setAttribute("data-svg-origin",this.svgo||"")),(t=Ie())&&t.isStart||n[dr]||(Kd(n),a.uncache=1)}}function Md(t,e){var r={target:t,props:[],revert:Ld,save:Jd};return t._gsap||Ee.core.getCache(t),e&&e.split(",").forEach(function(t){return r.save(t)}),r}function Od(t,e){var r=ze.createElementNS?ze.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):ze.createElement(t);return r.style?r:ze.createElement(t)}function Pd(t,e,r){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(hr,"-$1").toLowerCase())||i.getPropertyValue(e)||!r&&Pd(t,mr(e)||e,1)||""}function Sd(){(function _windowExists(){return"undefined"!=typeof window})()&&window.document&&(De=window,ze=De.document,Re=ze.documentElement,Be=Od("div")||{style:{}},Od("div"),dr=mr(dr),pr=dr+"Origin",Be.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ye=!!mr("perspective"),Ie=Ee.core.reverting,Fe=1)}function Td(t){var e,r=Od("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,n=this.nextSibling,a=this.style.cssText;if(Re.appendChild(r),r.appendChild(this),this.style.display="block",t)try{e=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=Td}catch(t){}else this._gsapBBox&&(e=this._gsapBBox());return i&&(n?i.insertBefore(this,n):i.appendChild(this)),Re.removeChild(r),this.style.cssText=a,e}function Ud(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])}function Vd(e){var r;try{r=e.getBBox()}catch(t){r=Td.call(e,!0)}return r&&(r.width||r.height)||e.getBBox===Td||(r=Td.call(e,!0)),!r||r.width||r.x||r.y?r:{x:+Ud(e,["x","cx","x1"])||0,y:+Ud(e,["y","cy","y1"])||0,width:0,height:0}}function Wd(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Vd(t))}function Xd(t,e){if(e){var r=t.style;e in ar&&e!==pr&&(e=dr),r.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),r.removeProperty(e.replace(hr,"-$1").toLowerCase())):r.removeAttribute(e)}}function Yd(t,e,r,i,n,a){var s=new _e(t._pt,e,r,0,1,a?Ad:zd);return(t._pt=s).b=i,s.e=n,t._props.push(r),s}function _d(t,e,r,i){var n,a,s,o,u=parseFloat(r)||0,h=(r+"").trim().substr((u+"").length)||"px",l=Be.style,f=lr.test(e),c="svg"===t.tagName.toLowerCase(),d=(c?"client":"offset")+(f?"Width":"Height"),p="px"===i,_="%"===i;return i===h||!u||gr[i]||gr[h]?u:("px"===h||p||(u=_d(t,e,r,"px")),o=t.getCTM&&Wd(t),!_&&"%"!==h||!ar[e]&&!~e.indexOf("adius")?(l[f?"width":"height"]=100+(p?h:i),a=~e.indexOf("adius")||"em"===i&&t.appendChild&&!c?t:t.parentNode,o&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==ze&&a.appendChild||(a=ze.body),(s=a._gsap)&&_&&s.width&&f&&s.time===Rt.time&&!s.uncache?ia(u/s.width*100):(!_&&"%"!==h||vr[Pd(a,"display")]||(l.position=Pd(t,"position")),a===t&&(l.position="static"),a.appendChild(Be),n=Be[d],a.removeChild(Be),l.position="absolute",f&&_&&((s=fa(a)).time=Rt.time,s.width=a[d]),ia(p?n*u/100:n&&u?100/n*u:0))):(n=o?t.getBBox()[f?"width":"height"]:t[d],ia(_?u/n*100:u/100*n)))}function be(t,e,r,i){if(!r||"none"===r){var n=mr(e,t,1),a=n&&Pd(t,n,1);a&&a!==r?(e=n,r=a):"borderColor"===e&&(r=Pd(t,"borderTopColor"))}var s,o,u,h,l,f,c,d,p,_,m,g=new _e(this._pt,t.style,e,0,1,ue),v=0,y=0;if(g.b=r,g.e=i,r+="","auto"===(i+="")&&(t.style[e]=i,i=Pd(t,e)||i,t.style[e]=r),Fb(s=[r,i]),i=s[1],u=(r=s[0]).match(rt)||[],(i.match(rt)||[]).length){for(;o=rt.exec(i);)c=o[0],p=i.substring(v,o.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),c!==(f=u[y++]||"")&&(h=parseFloat(f)||0,m=f.substr((h+"").length),"="===c.charAt(1)&&(c=ka(h,c)+m),d=parseFloat(c),_=c.substr((d+"").length),v=rt.lastIndex-_.length,_||(_=_||q.units[e]||m,v===i.length&&(i+=_,g.e+=_)),m!==_&&(h=_d(t,e,f,_)||0),g._pt={_next:g._pt,p:p||1===y?p:",",s:h,c:d-h,m:l&&l<4||"zIndex"===e?Math.round:0});g.c=v<i.length?i.substring(v,i.length):""}else g.r="display"===e&&"none"===i?Ad:zd;return nt.test(i)&&(g.e=0),this._pt=g}function de(t){var e=t.split(" "),r=e[0],i=e[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==i&&"right"!==i||(t=r,r=i,i=t),e[0]=Tr[r]||r,e[1]=Tr[i]||i,e.join(" ")}function ee(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,i,n,a=e.t,s=a.style,o=e.u,u=a._gsap;if("all"===o||!0===o)s.cssText="",i=1;else for(n=(o=o.split(",")).length;-1<--n;)r=o[n],ar[r]&&(i=1,r="transformOrigin"===r?pr:dr),Xd(a,r);i&&(Xd(a,dr),u&&(u.svg&&a.removeAttribute("transform"),kr(a,1),u.uncache=1,Kd(s)))}}function ie(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t}function je(t){var e=Pd(t,dr);return ie(e)?wr:e.substr(7).match(et).map(ia)}function ke(t,e){var r,i,n,a,s=t._gsap||fa(t),o=t.style,u=je(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(n=t.transform.baseVal.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]).join(",")?wr:u:(u!==wr||t.offsetParent||t===Re||s.svg||(n=o.display,o.display="block",(r=t.parentNode)&&t.offsetParent||(a=1,i=t.nextElementSibling,Re.appendChild(t)),u=je(t),n?o.display=n:Xd(t,"display"),a&&(i?r.insertBefore(t,i):r?r.appendChild(t):Re.removeChild(t))),e&&6<u.length?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)}function le(t,e,r,i,n,a){var s,o,u,h=t._gsap,l=n||ke(t,!0),f=h.xOrigin||0,c=h.yOrigin||0,d=h.xOffset||0,p=h.yOffset||0,_=l[0],m=l[1],g=l[2],v=l[3],y=l[4],T=l[5],b=e.split(" "),w=parseFloat(b[0])||0,x=parseFloat(b[1])||0;r?l!==wr&&(o=_*v-m*g)&&(u=w*(-m/o)+x*(_/o)-(_*T-m*y)/o,w=w*(v/o)+x*(-g/o)+(g*T-v*y)/o,x=u):(w=(s=Vd(t)).x+(~b[0].indexOf("%")?w/100*s.width:w),x=s.y+(~(b[1]||b[0]).indexOf("%")?x/100*s.height:x)),i||!1!==i&&h.smooth?(y=w-f,T=x-c,h.xOffset=d+(y*_+T*g)-y,h.yOffset=p+(y*m+T*v)-T):h.xOffset=h.yOffset=0,h.xOrigin=w,h.yOrigin=x,h.smooth=!!i,h.origin=e,h.originIsAbsolute=!!r,t.style[pr]="0px 0px",a&&(Yd(a,h,"xOrigin",f,w),Yd(a,h,"yOrigin",c,x),Yd(a,h,"xOffset",d,h.xOffset),Yd(a,h,"yOffset",p,h.yOffset)),t.setAttribute("data-svg-origin",w+" "+x)}function oe(t,e,r){var i=Ya(e);return ia(parseFloat(e)+parseFloat(_d(t,"x",r+"px",i)))+i}function ve(t,e,i,n,a){var s,o,u=360,h=r(a),l=parseFloat(a)*(h&&~a.indexOf("rad")?sr:1)-n,f=n+l+"deg";return h&&("short"===(s=a.split("_")[1])&&(l%=u)!==l%180&&(l+=l<0?u:-u),"cw"===s&&l<0?l=(l+36e9)%u-~~(l/u)*u:"ccw"===s&&0<l&&(l=(l-36e9)%u-~~(l/u)*u)),t._pt=o=new _e(t._pt,e,i,n,l,wd),o.e=f,o.u="deg",t._props.push(i),o}function we(t,e){for(var r in e)t[r]=e[r];return t}function xe(t,e,r){var i,n,a,s,o,u,h,l=we({},r._gsap),f=r.style;for(n in l.svg?(a=r.getAttribute("transform"),r.setAttribute("transform",""),f[dr]=e,i=kr(r,1),Xd(r,dr),r.setAttribute("transform",a)):(a=getComputedStyle(r)[dr],f[dr]=e,i=kr(r,1),f[dr]=a),ar)(a=l[n])!==(s=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=Ya(a)!==(h=Ya(s))?_d(r,n,a,h):parseFloat(a),u=parseFloat(s),t._pt=new _e(t._pt,i,n,o,u-o,vd),t._pt.u=h||0,t._props.push(n));we(i,l)}var De,ze,Re,Fe,Be,Le,Ie,Ye,qe=Bt.Power0,Ve=Bt.Power1,Ue=Bt.Power2,Xe=Bt.Power3,Ne=Bt.Power4,We=Bt.Linear,Qe=Bt.Quad,Ge=Bt.Cubic,Ke=Bt.Quart,Je=Bt.Quint,He=Bt.Strong,Ze=Bt.Elastic,$e=Bt.Back,tr=Bt.SteppedEase,er=Bt.Bounce,rr=Bt.Sine,ir=Bt.Expo,nr=Bt.Circ,ar={},sr=180/Math.PI,or=Math.PI/180,ur=Math.atan2,hr=/([A-Z])/g,lr=/(left|right|width|margin|padding|x)/i,fr=/[\s,\(]\S/,cr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},dr="transform",pr=dr+"Origin",_r="O,Moz,ms,Ms,Webkit".split(","),mr=function _checkPropPrefix(t,e,r){var i=(e||Be).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(_r[n]+t in i););return n<0?null:(3===n?"ms":0<=n?_r[n]:"")+t},gr={deg:1,rad:1,turn:1},vr={grid:1,flex:1},yr=function _get(t,e,r,i){var n;return Fe||Sd(),e in cr&&"transform"!==e&&~(e=cr[e]).indexOf(",")&&(e=e.split(",")[0]),ar[e]&&"transform"!==e?(n=kr(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:Mr(Pd(t,pr))+" "+n.zOrigin+"px"):(n=t.style[e])&&"auto"!==n&&!i&&!~(n+"").indexOf("calc(")||(n=br[e]&&br[e](t,e,r)||Pd(t,e)||ga(t,e)||("opacity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?_d(t,e,n,r)+r:n},Tr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},br={clearProps:function clearProps(t,e,r,i,n){if("isFromStart"!==n.data){var a=t._pt=new _e(t._pt,e,r,0,0,ee);return a.u=i,a.pr=-10,a.tween=n,t._props.push(r),1}}},wr=[1,0,0,1,0,0],xr={},kr=function _parseTransform(t,e){var r=t._gsap||new Vt(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,a,s,o,u,h,l,f,c,d,p,_,m,g,v,y,T,b,w,x,k,M,O,P,A,C,S,E,D,z,R,F=t.style,B=r.scaleX<0,L="deg",I=getComputedStyle(t),Y=Pd(t,pr)||"0";return i=n=a=u=h=l=f=c=d=0,s=o=1,r.svg=!(!t.getCTM||!Wd(t)),I.translate&&("none"===I.translate&&"none"===I.scale&&"none"===I.rotate||(F[dr]=("none"!==I.translate?"translate3d("+(I.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==I.rotate?"rotate("+I.rotate+") ":"")+("none"!==I.scale?"scale("+I.scale.split(" ").join(",")+") ":"")+("none"!==I[dr]?I[dr]:"")),F.scale=F.rotate=F.translate="none"),m=ke(t,r.svg),r.svg&&(O=r.uncache?(P=t.getBBox(),Y=r.xOrigin-P.x+"px "+(r.yOrigin-P.y)+"px",""):!e&&t.getAttribute("data-svg-origin"),le(t,O||Y,!!O||r.originIsAbsolute,!1!==r.smooth,m)),p=r.xOrigin||0,_=r.yOrigin||0,m!==wr&&(T=m[0],b=m[1],w=m[2],x=m[3],i=k=m[4],n=M=m[5],6===m.length?(s=Math.sqrt(T*T+b*b),o=Math.sqrt(x*x+w*w),u=T||b?ur(b,T)*sr:0,(f=w||x?ur(w,x)*sr+u:0)&&(o*=Math.abs(Math.cos(f*or))),r.svg&&(i-=p-(p*T+_*w),n-=_-(p*b+_*x))):(R=m[6],D=m[7],C=m[8],S=m[9],E=m[10],z=m[11],i=m[12],n=m[13],a=m[14],h=(g=ur(R,E))*sr,g&&(O=k*(v=Math.cos(-g))+C*(y=Math.sin(-g)),P=M*v+S*y,A=R*v+E*y,C=k*-y+C*v,S=M*-y+S*v,E=R*-y+E*v,z=D*-y+z*v,k=O,M=P,R=A),l=(g=ur(-w,E))*sr,g&&(v=Math.cos(-g),z=x*(y=Math.sin(-g))+z*v,T=O=T*v-C*y,b=P=b*v-S*y,w=A=w*v-E*y),u=(g=ur(b,T))*sr,g&&(O=T*(v=Math.cos(g))+b*(y=Math.sin(g)),P=k*v+M*y,b=b*v-T*y,M=M*v-k*y,T=O,k=P),h&&359.9<Math.abs(h)+Math.abs(u)&&(h=u=0,l=180-l),s=ia(Math.sqrt(T*T+b*b+w*w)),o=ia(Math.sqrt(M*M+R*R)),g=ur(k,M),f=2e-4<Math.abs(g)?g*sr:0,d=z?1/(z<0?-z:z):0),r.svg&&(O=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!ie(Pd(t,dr)),O&&t.setAttribute("transform",O))),90<Math.abs(f)&&Math.abs(f)<270&&(B?(s*=-1,f+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,f+=f<=0?180:-180)),e=e||r.uncache,r.x=i-((r.xPercent=i&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+"px",r.y=n-((r.yPercent=n&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-n)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+"px",r.z=a+"px",r.scaleX=ia(s),r.scaleY=ia(o),r.rotation=ia(u)+L,r.rotationX=ia(h)+L,r.rotationY=ia(l)+L,r.skewX=f+L,r.skewY=c+L,r.transformPerspective=d+"px",(r.zOrigin=parseFloat(Y.split(" ")[2])||0)&&(F[pr]=Mr(Y)),r.xOffset=r.yOffset=0,r.force3D=q.force3D,r.renderTransform=r.svg?Er:Ye?Sr:Or,r.uncache=0,r},Mr=function _firstTwoOnly(t){return(t=t.split(" "))[0]+" "+t[1]},Or=function _renderNon3DTransforms(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Sr(t,e)},Pr="0deg",Ar="0px",Cr=") ",Sr=function _renderCSSTransforms(t,e){var r=e||this,i=r.xPercent,n=r.yPercent,a=r.x,s=r.y,o=r.z,u=r.rotation,h=r.rotationY,l=r.rotationX,f=r.skewX,c=r.skewY,d=r.scaleX,p=r.scaleY,_=r.transformPerspective,m=r.force3D,g=r.target,v=r.zOrigin,y="",T="auto"===m&&t&&1!==t||!0===m;if(v&&(l!==Pr||h!==Pr)){var b,w=parseFloat(h)*or,x=Math.sin(w),k=Math.cos(w);w=parseFloat(l)*or,b=Math.cos(w),a=oe(g,a,x*b*-v),s=oe(g,s,-Math.sin(w)*-v),o=oe(g,o,k*b*-v+v)}_!==Ar&&(y+="perspective("+_+Cr),(i||n)&&(y+="translate("+i+"%, "+n+"%) "),!T&&a===Ar&&s===Ar&&o===Ar||(y+=o!==Ar||T?"translate3d("+a+", "+s+", "+o+") ":"translate("+a+", "+s+Cr),u!==Pr&&(y+="rotate("+u+Cr),h!==Pr&&(y+="rotateY("+h+Cr),l!==Pr&&(y+="rotateX("+l+Cr),f===Pr&&c===Pr||(y+="skew("+f+", "+c+Cr),1===d&&1===p||(y+="scale("+d+", "+p+Cr),g.style[dr]=y||"translate(0, 0)"},Er=function _renderSVGTransforms(t,e){var r,i,n,a,s,o=e||this,u=o.xPercent,h=o.yPercent,l=o.x,f=o.y,c=o.rotation,d=o.skewX,p=o.skewY,_=o.scaleX,m=o.scaleY,g=o.target,v=o.xOrigin,y=o.yOrigin,T=o.xOffset,b=o.yOffset,w=o.forceCSS,x=parseFloat(l),k=parseFloat(f);c=parseFloat(c),d=parseFloat(d),(p=parseFloat(p))&&(d+=p=parseFloat(p),c+=p),c||d?(c*=or,d*=or,r=Math.cos(c)*_,i=Math.sin(c)*_,n=Math.sin(c-d)*-m,a=Math.cos(c-d)*m,d&&(p*=or,s=Math.tan(d-p),n*=s=Math.sqrt(1+s*s),a*=s,p&&(s=Math.tan(p),r*=s=Math.sqrt(1+s*s),i*=s)),r=ia(r),i=ia(i),n=ia(n),a=ia(a)):(r=_,a=m,i=n=0),(x&&!~(l+"").indexOf("px")||k&&!~(f+"").indexOf("px"))&&(x=_d(g,"x",l,"px"),k=_d(g,"y",f,"px")),(v||y||T||b)&&(x=ia(x+v-(v*r+y*n)+T),k=ia(k+y-(v*i+y*a)+b)),(u||h)&&(s=g.getBBox(),x=ia(x+u/100*s.width),k=ia(k+h/100*s.height)),s="matrix("+r+","+i+","+n+","+a+","+x+","+k+")",g.setAttribute("transform",s),w&&(g.style[dr]=s)};ha("padding,margin,Width,Radius",function(e,r){var t="Right",i="Bottom",n="Left",o=(r<3?["Top",t,i,n]:["Top"+n,"Top"+t,i+t,i+n]).map(function(t){return r<2?e+t:"border"+t+e});br[1<r?"border"+e:e]=function(e,t,r,i,n){var a,s;if(arguments.length<4)return a=o.map(function(t){return yr(e,t,r)}),5===(s=a.join(" ")).split(a[0]).length?a[0]:s;a=(i+"").split(" "),s={},o.forEach(function(t,e){return s[t]=a[e]=a[e]||a[(e-1)/2|0]}),e.init(t,s,n)}});var Dr,zr,Rr,Fr={name:"css",register:Sd,targetTest:function targetTest(t){return t.style&&t.nodeType},init:function init(t,e,i,n,a){var s,o,u,h,l,f,c,d,p,_,m,g,v,y,T,b,w=this._props,x=t.style,k=i.vars.startAt;for(c in Fe||Sd(),this.styles=this.styles||Md(t),b=this.styles.props,this.tween=i,e)if("autoRound"!==c&&(o=e[c],!pt[c]||!ac(c,e,i,n,t,a)))if(l=typeof o,f=br[c],"function"===l&&(l=typeof(o=o.call(i,n,t,a))),"string"===l&&~o.indexOf("random(")&&(o=ob(o)),f)f(this,t,c,o,i)&&(T=1);else if("--"===c.substr(0,2))s=(getComputedStyle(t).getPropertyValue(c)+"").trim(),o+="",Dt.lastIndex=0,Dt.test(s)||(d=Ya(s),p=Ya(o)),p?d!==p&&(s=_d(t,c,s,p)+p):d&&(o+=d),this.add(x,"setProperty",s,o,n,a,0,0,c),w.push(c),b.push(c,0,x[c]);else if("undefined"!==l){if(k&&c in k?(s="function"==typeof k[c]?k[c].call(i,n,t,a):k[c],r(s)&&~s.indexOf("random(")&&(s=ob(s)),Ya(s+"")||(s+=q.units[c]||Ya(yr(t,c))||""),"="===(s+"").charAt(1)&&(s=yr(t,c))):s=yr(t,c),h=parseFloat(s),(_="string"===l&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),u=parseFloat(o),c in cr&&("autoAlpha"===c&&(1===h&&"hidden"===yr(t,"visibility")&&u&&(h=0),b.push("visibility",0,x.visibility),Yd(this,x,"visibility",h?"inherit":"hidden",u?"inherit":"hidden",!u)),"scale"!==c&&"transform"!==c&&~(c=cr[c]).indexOf(",")&&(c=c.split(",")[0])),m=c in ar)if(this.styles.save(c),g||((v=t._gsap).renderTransform&&!e.parseTransform||kr(t,e.parseTransform),y=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new _e(this._pt,x,dr,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===c)this._pt=new _e(this._pt,v,"scaleY",v.scaleY,(_?ka(v.scaleY,_+u):u)-v.scaleY||0,vd),this._pt.u=0,w.push("scaleY",c),c+="X";else{if("transformOrigin"===c){b.push(pr,0,x[pr]),o=de(o),v.svg?le(t,o,0,y,0,this):((p=parseFloat(o.split(" ")[2])||0)!==v.zOrigin&&Yd(this,v,"zOrigin",v.zOrigin,p),Yd(this,x,c,Mr(s),Mr(o)));continue}if("svgOrigin"===c){le(t,o,1,y,0,this);continue}if(c in xr){ve(this,v,c,h,_?ka(h,_+o):o);continue}if("smoothOrigin"===c){Yd(this,v,"smooth",v.smooth,o);continue}if("force3D"===c){v[c]=o;continue}if("transform"===c){xe(this,o,t);continue}}else c in x||(c=mr(c)||c);if(m||(u||0===u)&&(h||0===h)&&!fr.test(o)&&c in x)u=u||0,(d=(s+"").substr((h+"").length))!==(p=Ya(o)||(c in q.units?q.units[c]:d))&&(h=_d(t,c,s,p)),this._pt=new _e(this._pt,m?v:x,c,h,(_?ka(h,_+u):u)-h,m||"px"!==p&&"zIndex"!==c||!1===e.autoRound?vd:yd),this._pt.u=p||0,d!==p&&"%"!==p&&(this._pt.b=s,this._pt.r=xd);else if(c in x)be.call(this,t,c,s,_?_+o:o);else if(c in t)this.add(t,c,s||t[c],_?_+o:o,n,a);else if("parseTransform"!==c){Q(c,o);continue}m||(c in x?b.push(c,0,x[c]):b.push(c,1,s||t[c])),w.push(c)}T&&pe(this)},render:function render(t,e){if(e.tween._time||!Ie())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:yr,aliases:cr,getSetter:function getSetter(t,e,r){var i=cr[e];return i&&i.indexOf(",")<0&&(e=i),e in ar&&e!==pr&&(t._gsap.x||yr(t,"x"))?r&&Le===r?"scale"===e?Ed:Dd:(Le=r||{})&&("scale"===e?Fd:Gd):t.style&&!u(t.style[e])?Bd:~e.indexOf("-")?Cd:ne(t,e)},core:{_removeProperty:Xd,_getMatrix:ke}};Ee.utils.checkPrefix=mr,Ee.core.getStyleSaver=Md,Rr=ha((Dr="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(zr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){ar[t]=1}),ha(zr,function(t){q.units[t]="deg",xr[t]=1}),cr[Rr[13]]=Dr+","+zr,ha("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");cr[e[1]]=Rr[e[0]]}),ha("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){q.units[t]="px"}),Ee.registerPlugin(Fr);var Br=Ee.registerPlugin(Fr)||Ee,Lr=Br.core.Tween;e.Back=$e,e.Bounce=er,e.CSSPlugin=Fr,e.Circ=nr,e.Cubic=Ge,e.Elastic=Ze,e.Expo=ir,e.Linear=We,e.Power0=qe,e.Power1=Ve,e.Power2=Ue,e.Power3=Xe,e.Power4=Ne,e.Quad=Qe,e.Quart=Ke,e.Quint=Je,e.Sine=rr,e.SteppedEase=tr,e.Strong=He,e.TimelineLite=Xt,e.TimelineMax=Xt,e.TweenLite=Zt,e.TweenMax=Lr,e.default=Br,e.gsap=Br;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});
;
/*! ScrollMagic v2.0.7 | (c) 2019 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ScrollMagic=t()}(this,function(){"use strict";var _=function(){};_.version="2.0.7",window.addEventListener("mousewheel",function(){});var P="data-scrollmagic-pin-spacer";_.Controller=function(e){var n,r,i="REVERSE",t="PAUSED",o=z.defaults,s=this,a=R.extend({},o,e),l=[],c=!1,f=0,u=t,d=!0,h=0,p=!0,g=function(){0<a.refreshInterval&&(r=window.setTimeout(E,a.refreshInterval))},v=function(){return a.vertical?R.get.scrollTop(a.container):R.get.scrollLeft(a.container)},m=function(){return a.vertical?R.get.height(a.container):R.get.width(a.container)},w=this._setScrollPos=function(e){a.vertical?d?window.scrollTo(R.get.scrollLeft(),e):a.container.scrollTop=e:d?window.scrollTo(e,R.get.scrollTop()):a.container.scrollLeft=e},y=function(){if(p&&c){var e=R.type.Array(c)?c:l.slice(0);c=!1;var t=f,n=(f=s.scrollPos())-t;0!==n&&(u=0<n?"FORWARD":i),u===i&&e.reverse(),e.forEach(function(e,t){e.update(!0)})}},S=function(){n=R.rAF(y)},b=function(e){"resize"==e.type&&(h=m(),u=t),!0!==c&&(c=!0,S())},E=function(){if(!d&&h!=m()){var t;try{t=new Event("resize",{bubbles:!1,cancelable:!1})}catch(e){(t=document.createEvent("Event")).initEvent("resize",!1,!1)}a.container.dispatchEvent(t)}l.forEach(function(e,t){e.refresh()}),g()};this._options=a;var x=function(e){if(e.length<=1)return e;var t=e.slice(0);return t.sort(function(e,t){return e.scrollOffset()>t.scrollOffset()?1:-1}),t};return this.addScene=function(e){if(R.type.Array(e))e.forEach(function(e,t){s.addScene(e)});else if(e instanceof _.Scene)if(e.controller()!==s)e.addTo(s);else if(l.indexOf(e)<0)for(var t in l.push(e),l=x(l),e.on("shift.controller_sort",function(){l=x(l)}),a.globalSceneOptions)e[t]&&e[t].call(e,a.globalSceneOptions[t]);return s},this.removeScene=function(e){if(R.type.Array(e))e.forEach(function(e,t){s.removeScene(e)});else{var t=l.indexOf(e);-1<t&&(e.off("shift.controller_sort"),l.splice(t,1),e.remove())}return s},this.updateScene=function(e,n){return R.type.Array(e)?e.forEach(function(e,t){s.updateScene(e,n)}):n?e.update(!0):!0!==c&&e instanceof _.Scene&&(-1==(c=c||[]).indexOf(e)&&c.push(e),c=x(c),S()),s},this.update=function(e){return b({type:"resize"}),e&&y(),s},this.scrollTo=function(e,t){if(R.type.Number(e))w.call(a.container,e,t);else if(e instanceof _.Scene)e.controller()===s&&s.scrollTo(e.scrollOffset(),t);else if(R.type.Function(e))w=e;else{var n=R.get.elements(e)[0];if(n){for(;n.parentNode.hasAttribute(P);)n=n.parentNode;var r=a.vertical?"top":"left",i=R.get.offset(a.container),o=R.get.offset(n);d||(i[r]-=s.scrollPos()),s.scrollTo(o[r]-i[r],t)}}return s},this.scrollPos=function(e){return arguments.length?(R.type.Function(e)&&(v=e),s):v.call(s)},this.info=function(e){var t={size:h,vertical:a.vertical,scrollPos:f,scrollDirection:u,container:a.container,isDocument:d};return arguments.length?void 0!==t[e]?t[e]:void 0:t},this.loglevel=function(e){return s},this.enabled=function(e){return arguments.length?(p!=e&&(p=!!e,s.updateScene(l,!0)),s):p},this.destroy=function(e){window.clearTimeout(r);for(var t=l.length;t--;)l[t].destroy(e);return a.container.removeEventListener("resize",b),a.container.removeEventListener("scroll",b),R.cAF(n),null},function(){for(var e in a)o.hasOwnProperty(e)||delete a[e];if(a.container=R.get.elements(a.container)[0],!a.container)throw"ScrollMagic.Controller init failed.";(d=a.container===window||a.container===document.body||!document.body.contains(a.container))&&(a.container=window),h=m(),a.container.addEventListener("resize",b),a.container.addEventListener("scroll",b);var t=parseInt(a.refreshInterval,10);a.refreshInterval=R.type.Number(t)?t:o.refreshInterval,g()}(),s};var z={defaults:{container:window,vertical:!0,globalSceneOptions:{},loglevel:2,refreshInterval:100}};_.Controller.addOption=function(e,t){z.defaults[e]=t},_.Controller.extend=function(e){var t=this;_.Controller=function(){return t.apply(this,arguments),this.$super=R.extend({},this),e.apply(this,arguments)||this},R.extend(_.Controller,t),_.Controller.prototype=t.prototype,_.Controller.prototype.constructor=_.Controller},_.Scene=function(e){var n,l,c="BEFORE",f="DURING",u="AFTER",r=D.defaults,d=this,h=R.extend({},r,e),p=c,g=0,a={start:0,end:0},v=0,i=!0,s={};this.on=function(e,i){return R.type.Function(i)&&(e=e.trim().split(" ")).forEach(function(e){var t=e.split("."),n=t[0],r=t[1];"*"!=n&&(s[n]||(s[n]=[]),s[n].push({namespace:r||"",callback:i}))}),d},this.off=function(e,o){return e&&(e=e.trim().split(" ")).forEach(function(e,t){var n=e.split("."),r=n[0],i=n[1]||"";("*"===r?Object.keys(s):[r]).forEach(function(e){for(var t=s[e]||[],n=t.length;n--;){var r=t[n];!r||i!==r.namespace&&"*"!==i||o&&o!=r.callback||t.splice(n,1)}t.length||delete s[e]})}),d},this.trigger=function(e,n){if(e){var t=e.trim().split("."),r=t[0],i=t[1],o=s[r];o&&o.forEach(function(e,t){i&&i!==e.namespace||e.callback.call(d,new _.Event(r,e.namespace,d,n))})}return d},d.on("change.internal",function(e){"loglevel"!==e.what&&"tweenChanges"!==e.what&&("triggerElement"===e.what?y():"reverse"===e.what&&d.update())}).on("shift.internal",function(e){t(),d.update()}),this.addTo=function(e){return e instanceof _.Controller&&l!=e&&(l&&l.removeScene(d),l=e,E(),o(!0),y(!0),t(),l.info("container").addEventListener("resize",S),e.addScene(d),d.trigger("add",{controller:l}),d.update()),d},this.enabled=function(e){return arguments.length?(i!=e&&(i=!!e,d.update(!0)),d):i},this.remove=function(){if(l){l.info("container").removeEventListener("resize",S);var e=l;l=void 0,e.removeScene(d),d.trigger("remove")}return d},this.destroy=function(e){return d.trigger("destroy",{reset:e}),d.remove(),d.off("*.*"),null},this.update=function(e){if(l)if(e)if(l.enabled()&&i){var t,n=l.info("scrollPos");t=0<h.duration?(n-a.start)/(a.end-a.start):n>=a.start?1:0,d.trigger("update",{startPos:a.start,endPos:a.end,scrollPos:n}),d.progress(t)}else m&&p===f&&C(!0);else l.updateScene(d,!1);return d},this.refresh=function(){return o(),y(),d},this.progress=function(e){if(arguments.length){var t=!1,n=p,r=l?l.info("scrollDirection"):"PAUSED",i=h.reverse||g<=e;if(0===h.duration?(t=g!=e,p=0===(g=e<1&&i?0:1)?c:f):e<0&&p!==c&&i?(p=c,t=!(g=0)):0<=e&&e<1&&i?(g=e,p=f,t=!0):1<=e&&p!==u?(g=1,p=u,t=!0):p!==f||i||C(),t){var o={progress:g,state:p,scrollDirection:r},s=p!=n,a=function(e){d.trigger(e,o)};s&&n!==f&&(a("enter"),a(n===c?"start":"end")),a("progress"),s&&p!==f&&(a(p===c?"start":"end"),a("leave"))}return d}return g};var m,w,t=function(){a={start:v+h.offset},l&&h.triggerElement&&(a.start-=l.info("size")*h.triggerHook),a.end=a.start+h.duration},o=function(e){if(n){var t="duration";x(t,n.call(d))&&!e&&(d.trigger("change",{what:t,newval:h[t]}),d.trigger("shift",{reason:t}))}},y=function(e){var t=0,n=h.triggerElement;if(l&&(n||0<v)){if(n)if(n.parentNode){for(var r=l.info(),i=R.get.offset(r.container),o=r.vertical?"top":"left";n.parentNode.hasAttribute(P);)n=n.parentNode;var s=R.get.offset(n);r.isDocument||(i[o]-=l.scrollPos()),t=s[o]-i[o]}else d.triggerElement(void 0);var a=t!=v;v=t,a&&!e&&d.trigger("shift",{reason:"triggerElementPosition"})}},S=function(e){0<h.triggerHook&&d.trigger("shift",{reason:"containerResize"})},b=R.extend(D.validate,{duration:function(t){if(R.type.String(t)&&t.match(/^(\.|\d)*\d+%$/)){var e=parseFloat(t)/100;t=function(){return l?l.info("size")*e:0}}if(R.type.Function(t)){n=t;try{t=parseFloat(n.call(d))}catch(e){t=-1}}if(t=parseFloat(t),!R.type.Number(t)||t<0)throw n&&(n=void 0),0;return t}}),E=function(e){(e=arguments.length?[e]:Object.keys(b)).forEach(function(t,e){var n;if(b[t])try{n=b[t](h[t])}catch(e){n=r[t]}finally{h[t]=n}})},x=function(e,t){var n=!1,r=h[e];return h[e]!=t&&(h[e]=t,E(e),n=r!=h[e]),n},z=function(t){d[t]||(d[t]=function(e){return arguments.length?("duration"===t&&(n=void 0),x(t,e)&&(d.trigger("change",{what:t,newval:h[t]}),-1<D.shifts.indexOf(t)&&d.trigger("shift",{reason:t})),d):h[t]})};this.controller=function(){return l},this.state=function(){return p},this.scrollOffset=function(){return a.start},this.triggerPosition=function(){var e=h.offset;return l&&(h.triggerElement?e+=v:e+=l.info("size")*d.triggerHook()),e},d.on("shift.internal",function(e){var t="duration"===e.reason;(p===u&&t||p===f&&0===h.duration)&&C(),t&&F()}).on("progress.internal",function(e){C()}).on("add.internal",function(e){F()}).on("destroy.internal",function(e){d.removePin(e.reset)});var C=function(e){if(m&&l){var t=l.info(),n=w.spacer.firstChild;if(e||p!==f){var r={position:w.inFlow?"relative":"absolute",top:0,left:0},i=R.css(n,"position")!=r.position;w.pushFollowers?0<h.duration&&(p===u&&0===parseFloat(R.css(w.spacer,"padding-top"))?i=!0:p===c&&0===parseFloat(R.css(w.spacer,"padding-bottom"))&&(i=!0)):r[t.vertical?"top":"left"]=h.duration*g,R.css(n,r),i&&F()}else{"fixed"!=R.css(n,"position")&&(R.css(n,{position:"fixed"}),F());var o=R.get.offset(w.spacer,!0),s=h.reverse||0===h.duration?t.scrollPos-a.start:Math.round(g*h.duration*10)/10;o[t.vertical?"top":"left"]+=s,R.css(w.spacer.firstChild,{top:o.top,left:o.left})}}},F=function(){if(m&&l&&w.inFlow){var e=p===f,t=l.info("vertical"),n=w.spacer.firstChild,r=R.isMarginCollapseType(R.css(w.spacer,"display")),i={};w.relSize.width||w.relSize.autoFullWidth?e?R.css(m,{width:R.get.width(w.spacer)}):R.css(m,{width:"100%"}):(i["min-width"]=R.get.width(t?m:n,!0,!0),i.width=e?i["min-width"]:"auto"),w.relSize.height?e?R.css(m,{height:R.get.height(w.spacer)-(w.pushFollowers?h.duration:0)}):R.css(m,{height:"100%"}):(i["min-height"]=R.get.height(t?n:m,!0,!r),i.height=e?i["min-height"]:"auto"),w.pushFollowers&&(i["padding"+(t?"Top":"Left")]=h.duration*g,i["padding"+(t?"Bottom":"Right")]=h.duration*(1-g)),R.css(w.spacer,i)}},L=function(){l&&m&&p===f&&!l.info("isDocument")&&C()},T=function(){l&&m&&p===f&&((w.relSize.width||w.relSize.autoFullWidth)&&R.get.width(window)!=R.get.width(w.spacer.parentNode)||w.relSize.height&&R.get.height(window)!=R.get.height(w.spacer.parentNode))&&F()},A=function(e){l&&m&&p===f&&!l.info("isDocument")&&(e.preventDefault(),l._setScrollPos(l.info("scrollPos")-((e.wheelDelta||e[l.info("vertical")?"wheelDeltaY":"wheelDeltaX"])/3||30*-e.detail)))};this.setPin=function(e,t){if(t=R.extend({},{pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"},t),!(e=R.get.elements(e)[0]))return d;if("fixed"===R.css(e,"position"))return d;if(m){if(m===e)return d;d.removePin()}var n=(m=e).parentNode.style.display,r=["top","left","bottom","right","margin","marginLeft","marginRight","marginTop","marginBottom"];m.parentNode.style.display="none";var i="absolute"!=R.css(m,"position"),o=R.css(m,r.concat(["display"])),s=R.css(m,["width","height"]);m.parentNode.style.display=n,!i&&t.pushFollowers&&(t.pushFollowers=!1);var a=m.parentNode.insertBefore(document.createElement("div"),m),l=R.extend(o,{position:i?"relative":"absolute",boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"});if(i||R.extend(l,R.css(m,["width","height"])),R.css(a,l),a.setAttribute(P,""),R.addClass(a,t.spacerClass),w={spacer:a,relSize:{width:"%"===s.width.slice(-1),height:"%"===s.height.slice(-1),autoFullWidth:"auto"===s.width&&i&&R.isMarginCollapseType(o.display)},pushFollowers:t.pushFollowers,inFlow:i},!m.___origStyle){m.___origStyle={};var c=m.style;r.concat(["width","height","position","boxSizing","mozBoxSizing","webkitBoxSizing"]).forEach(function(e){m.___origStyle[e]=c[e]||""})}return w.relSize.width&&R.css(a,{width:s.width}),w.relSize.height&&R.css(a,{height:s.height}),a.appendChild(m),R.css(m,{position:i?"relative":"absolute",margin:"auto",top:"auto",left:"auto",bottom:"auto",right:"auto"}),(w.relSize.width||w.relSize.autoFullWidth)&&R.css(m,{boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"}),window.addEventListener("scroll",L),window.addEventListener("resize",L),window.addEventListener("resize",T),m.addEventListener("mousewheel",A),m.addEventListener("DOMMouseScroll",A),C(),d},this.removePin=function(e){if(m){if(p===f&&C(!0),e||!l){var t=w.spacer.firstChild;if(t.hasAttribute(P)){var n=w.spacer.style,r={};["margin","marginLeft","marginRight","marginTop","marginBottom"].forEach(function(e){r[e]=n[e]||""}),R.css(t,r)}w.spacer.parentNode.insertBefore(t,w.spacer),w.spacer.parentNode.removeChild(w.spacer),m.parentNode.hasAttribute(P)||(R.css(m,m.___origStyle),delete m.___origStyle)}window.removeEventListener("scroll",L),window.removeEventListener("resize",L),window.removeEventListener("resize",T),m.removeEventListener("mousewheel",A),m.removeEventListener("DOMMouseScroll",A),m=void 0}return d};var N,O=[];return d.on("destroy.internal",function(e){d.removeClassToggle(e.reset)}),this.setClassToggle=function(e,t){var n=R.get.elements(e);return 0!==n.length&&R.type.String(t)&&(0<O.length&&d.removeClassToggle(),N=t,O=n,d.on("enter.internal_class leave.internal_class",function(e){var n="enter"===e.type?R.addClass:R.removeClass;O.forEach(function(e,t){n(e,N)})})),d},this.removeClassToggle=function(e){return e&&O.forEach(function(e,t){R.removeClass(e,N)}),d.off("start.internal_class end.internal_class"),N=void 0,O=[],d},function(){for(var e in h)r.hasOwnProperty(e)||delete h[e];for(var t in r)z(t);E()}(),d};var D={defaults:{duration:0,offset:0,triggerElement:void 0,triggerHook:.5,reverse:!0,loglevel:2},validate:{offset:function(e){if(e=parseFloat(e),!R.type.Number(e))throw 0;return e},triggerElement:function(e){if(e=e||void 0){var t=R.get.elements(e)[0];if(!t||!t.parentNode)throw 0;e=t}return e},triggerHook:function(e){var t={onCenter:.5,onEnter:1,onLeave:0};if(R.type.Number(e))e=Math.max(0,Math.min(parseFloat(e),1));else{if(!(e in t))throw 0;e=t[e]}return e},reverse:function(e){return!!e}},shifts:["duration","offset","triggerHook"]};_.Scene.addOption=function(e,t,n,r){e in D.defaults||(D.defaults[e]=t,D.validate[e]=n,r&&D.shifts.push(e))},_.Scene.extend=function(e){var t=this;_.Scene=function(){return t.apply(this,arguments),this.$super=R.extend({},this),e.apply(this,arguments)||this},R.extend(_.Scene,t),_.Scene.prototype=t.prototype,_.Scene.prototype.constructor=_.Scene},_.Event=function(e,t,n,r){for(var i in r=r||{})this[i]=r[i];return this.type=e,this.target=this.currentTarget=n,this.namespace=t||"",this.timeStamp=this.timestamp=Date.now(),this};var R=_._util=function(s){var n,e={},a=function(e){return parseFloat(e)||0},l=function(e){return e.currentStyle?e.currentStyle:s.getComputedStyle(e)},r=function(e,t,n,r){if((t=t===document?s:t)===s)r=!1;else if(!u.DomElement(t))return 0;e=e.charAt(0).toUpperCase()+e.substr(1).toLowerCase();var i=(n?t["offset"+e]||t["outer"+e]:t["client"+e]||t["inner"+e])||0;if(n&&r){var o=l(t);i+="Height"===e?a(o.marginTop)+a(o.marginBottom):a(o.marginLeft)+a(o.marginRight)}return i},c=function(e){return e.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})};e.extend=function(e){for(e=e||{},n=1;n<arguments.length;n++)if(arguments[n])for(var t in arguments[n])arguments[n].hasOwnProperty(t)&&(e[t]=arguments[n][t]);return e},e.isMarginCollapseType=function(e){return-1<["block","flex","list-item","table","-webkit-box"].indexOf(e)};var i=0,t=["ms","moz","webkit","o"],o=s.requestAnimationFrame,f=s.cancelAnimationFrame;for(n=0;!o&&n<4;++n)o=s[t[n]+"RequestAnimationFrame"],f=s[t[n]+"CancelAnimationFrame"]||s[t[n]+"CancelRequestAnimationFrame"];o||(o=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-i)),r=s.setTimeout(function(){e(t+n)},n);return i=t+n,r}),f||(f=function(e){s.clearTimeout(e)}),e.rAF=o.bind(s),e.cAF=f.bind(s);var u=e.type=function(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};u.String=function(e){return"string"===u(e)},u.Function=function(e){return"function"===u(e)},u.Array=function(e){return Array.isArray(e)},u.Number=function(e){return!u.Array(e)&&0<=e-parseFloat(e)+1},u.DomElement=function(e){return"object"==typeof HTMLElement||"function"==typeof HTMLElement?e instanceof HTMLElement||e instanceof SVGElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var d=e.get={};return d.elements=function(e){var t=[];if(u.String(e))try{e=document.querySelectorAll(e)}catch(e){return t}if("nodelist"===u(e)||u.Array(e)||e instanceof NodeList)for(var n=0,r=t.length=e.length;n<r;n++){var i=e[n];t[n]=u.DomElement(i)?i:d.elements(i)}else(u.DomElement(e)||e===document||e===s)&&(t=[e]);return t},d.scrollTop=function(e){return e&&"number"==typeof e.scrollTop?e.scrollTop:s.pageYOffset||0},d.scrollLeft=function(e){return e&&"number"==typeof e.scrollLeft?e.scrollLeft:s.pageXOffset||0},d.width=function(e,t,n){return r("width",e,t,n)},d.height=function(e,t,n){return r("height",e,t,n)},d.offset=function(e,t){var n={top:0,left:0};if(e&&e.getBoundingClientRect){var r=e.getBoundingClientRect();n.top=r.top,n.left=r.left,t||(n.top+=d.scrollTop(),n.left+=d.scrollLeft())}return n},e.addClass=function(e,t){t&&(e.classList?e.classList.add(t):e.className+=" "+t)},e.removeClass=function(e,t){t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))},e.css=function(e,t){if(u.String(t))return l(e)[c(t)];if(u.Array(t)){var n={},r=l(e);return t.forEach(function(e,t){n[e]=r[c(e)]}),n}for(var i in t){var o=t[i];o==parseFloat(o)&&(o+="px"),e.style[c(i)]=o}},e}(window||{});return _});;
/*! jQuery Browser - v0.1.0 - 3/23/2012
* https://github.com/jquery/jquery-browser
* Copyright (c) 2012 John Resig; Licensed MIT */
/*
	THIS IS A STRIPPED VERSION OF THE ORIGINAL LIBRARY!
*/
/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
 * Build: http://www.modernizr.com/download/#-csstransforms3d-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes
 */
/*!
 * jQuery hashchange event - v1.3 - 7/21/2010
 * http://benalman.com/projects/jquery-hashchange-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
/*! Hammer.JS - v2.0.4 - 2015-10-30
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2015 Jorik Tangelder;
 * Licensed under the  license */
/*
 * @name wowBook
 *
 * @author Marcio Aguiar
 * @version 1.3.8
 * @requires jQuery v1.7.0+
 *
 * Copyright 2010 Marcio Aguiar. All rights reserved.
 *
 * To use this file you must to buy a license at http://codecanyon.net/user/maguiar01/portfolio
 *
 */
/*
 jQuery Browser - v0.1.0 - 3/23/2012
 https://github.com/jquery/jquery-browser
 Copyright (c) 2012 John Resig; Licensed MIT  jQuery hashchange event - v1.3 - 7/21/2010
 http://benalman.com/projects/jquery-hashchange-plugin/

 Copyright (c) 2010 "Cowboy" Ben Alman
 Dual licensed under the MIT and GPL licenses.
 http://benalman.com/about/license/
 Hammer.JS - v2.0.4 - 2015-10-30
 http://hammerjs.github.io/

 Copyright (c) 2015 Jorik Tangelder;
 Licensed under the  license  Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
 Licensed under the MIT License (LICENSE.txt).

 Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 Thanks to: Seamus Leahy for adding deltaX and deltaY

 Version: 3.0.6

 Requires: 1.2.2+
*/
(function(f){if(!f.browser){var H=navigator.userAgent||"";f.uaMatch=function(E){E=E.toLowerCase();E=/(edge)[ \/]([\w.]+)/.exec(E)||/(chrome)[ \/]([\w.]+)/.exec(E)||/(webkit)[ \/]([\w.]+)/.exec(E)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(E)||/(msie) ([\w.]+)/.exec(E)||0>E.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(E)||[];return{browser:E[1]||"",version:E[2]||"0"}};H=f.uaMatch(H);f.browser={};H.browser&&(f.browser[H.browser]=!0,f.browser.version=H.version);f.browser.webkit&&(f.browser.safari=
!0)}})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{easeOutCubic:function(f,H,E,J,B){return J*((H=H/B-1)*H*H+1)+E},easeOutExpo:function(f,H,E,J,B){return H==B?E+J:J*(-Math.pow(2,-10*H/B)+1)+E}});
window.Modernizr=function(f,H,E){function J(k,n){for(var p in k)if(M[k[p]]!==E)return"pfx"==n?k[p]:!0;return!1}function B(k,n,p){var r=k.charAt(0).toUpperCase()+k.substr(1),t=(k+" "+I.join(r+" ")+r).split(" ");if("string"===typeof n||"undefined"===typeof n)n=J(t,n);else a:{t=(k+" "+O.join(r+" ")+r).split(" "),k=t;for(var u in k)if(r=n[k[u]],r!==E){n=!1===p?k[u]:"function"===typeof r?r.bind(p||n):r;break a}n=!1}return n}var w={},K=H.documentElement,C=H.createElement("modernizr"),M=C.style;f=" -webkit- -moz- -o- -ms- ".split(" ");
var I=["Webkit","Moz","O","ms"],O=["webkit","moz","o","ms"];C={};var P=[],a=P.slice,b,c=function(k,n,p,r){var t,u,A=H.createElement("div"),D=H.body,F=D?D:H.createElement("body");if(parseInt(p,10))for(;p--;){var L=H.createElement("div");L.id=r?r[p]:"modernizr"+(p+1);A.appendChild(L)}return t=["­<style>",k,"</style>"].join(""),A.id="modernizr",(D?A:F).innerHTML+=t,F.appendChild(A),D||(F.style.background="",K.appendChild(F)),u=n(A,k),D?A.parentNode.removeChild(A):F.parentNode.removeChild(F),!!u},
d={}.hasOwnProperty,e;"undefined"===typeof d||"undefined"===typeof d.call?e=function(k,n){return n in k&&"undefined"===typeof k.constructor.prototype[n]}:e=function(k,n){return d.call(k,n)};Function.prototype.bind||(Function.prototype.bind=function(k){var n=this;if("function"!=typeof n)throw new TypeError;var p=a.call(arguments,1),r=function(){if(this instanceof r){var t=function(){};t.prototype=n.prototype;t=new t;var u=n.apply(t,p.concat(a.call(arguments)));return Object(u)===u?u:t}return n.apply(k,
p.concat(a.call(arguments)))};return r});(function(k,n){var p=k.join(""),r=n.length;c(p,function(t,u){for(var A=t.childNodes,D={};r--;)D[A[r].id]=A[r];w.csstransforms3d=9===(D.csstransforms3d&&D.csstransforms3d.offsetLeft)&&3===D.csstransforms3d.offsetHeight},r,n)})([,["@media (",f.join("transform-3d),("),"modernizr){#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join("")],[,"csstransforms3d"]);C.csstransforms3d=function(){var k=!!B("perspective");return k&&"webkitPerspective"in K.style&&
(k=w.csstransforms3d),k};for(var g in C)e(C,g)&&(b=g.toLowerCase(),w[b]=C[g](),P.push((w[b]?"":"no-")+b));M.cssText="";return C=null,w._version="2.5.3",w._prefixes=f,w._domPrefixes=O,w._cssomPrefixes=I,w.testProp=function(k){return J([k])},w.testAllProps=B,w.testStyles=c,w.prefixed=function(k,n,p){return n?B(k,n,p):B(k,"pfx")},w}(this,this.document);
(function(f,H,E){function J(I){I=I||location.href;return"#"+I.replace(/^[^#]*#?(.*)$/,"$1")}"$:nomunge";var B=document,w=f.event.special,K=B.documentMode,C="onhashchange"in H&&(K===E||7<K);f.fn.hashchange=function(I){return I?this.bind("hashchange",I):this.trigger("hashchange")};f.fn.hashchange.delay=50;w.hashchange=f.extend(w.hashchange,{setup:function(){if(C)return!1;f(M.start)},teardown:function(){if(C)return!1;f(M.stop)}});var M=function(){function I(){var e=J(),g=d(a);e!==a?(c(a=e,g),f(H).trigger("hashchange")):
g!==a&&(location.href=location.href.replace(/#.*/,"")+g);P=setTimeout(I,f.fn.hashchange.delay)}var O={},P,a=J(),b=function(e){return e},c=b,d=b;O.start=function(){P||I()};O.stop=function(){P&&clearTimeout(P);P=E};f.browser.msie&&!C&&function(){var e,g;O.start=function(){e||(g=(g=f.fn.hashchange.src)&&g+J(),e=f('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){g||c(J());I()}).attr("src",g||"javascript:0").insertAfter("body")[0].contentWindow,B.onpropertychange=function(){try{"title"===
event.propertyName&&(e.document.title=B.title)}catch(k){}})};O.stop=b;d=function(){return J(e.location.href)};c=function(k,n){var p=e.document,r=f.fn.hashchange.domain;k!==n&&(p.title=B.title,p.open(),r&&p.write('<script>document.domain="'+r+'"\x3c/script>'),p.close(),e.location.hash=k)}}();return O}()})(jQuery,this);
try{(function(f,H,E,J){function B(h,l,m){return setTimeout(O(h,m),l)}function w(h,l,m){return Array.isArray(h)?(K(h,m[l],m),!0):!1}function K(h,l,m){var q;if(h)if(h.forEach)h.forEach(l,m);else if(h.length!==J)for(q=0;q<h.length;)l.call(m,h[q],q,h),q++;else for(q in h)h.hasOwnProperty(q)&&l.call(m,h[q],q,h)}function C(h,l,m){for(var q=Object.keys(l),v=0;v<q.length;){if(!m||m&&h[q[v]]===J)h[q[v]]=l[q[v]];v++}return h}function M(h,l){return C(h,l,!0)}function I(h,l,m){l=l.prototype;var q=h.prototype=
Object.create(l);q.constructor=h;q._super=l;m&&C(q,m)}function O(h,l){return function(){return h.apply(l,arguments)}}function P(h,l){return"function"==typeof h?h.apply(l?l[0]||J:J,l):h}function a(h,l,m){K(d(l),function(q){h.addEventListener(q,m,!1)})}function b(h,l,m){K(d(l),function(q){h.removeEventListener(q,m,!1)})}function c(h,l){for(;h;){if(h==l)return!0;h=h.parentNode}return!1}function d(h){return h.trim().split(/\s+/g)}function e(h,l,m){if(h.indexOf&&!m)return h.indexOf(l);for(var q=0;q<h.length;){if(m&&
h[q][m]==l||!m&&h[q]===l)return q;q++}return-1}function g(h){return Array.prototype.slice.call(h,0)}function k(h,l,m){for(var q=[],v=[],z=0;z<h.length;){var G=l?h[z][l]:h[z];0>e(v,G)&&q.push(h[z]);v[z]=G;z++}m&&(q=l?q.sort(function(N,R){return N[l]>R[l]}):q.sort());return q}function n(h,l){for(var m,q=l[0].toUpperCase()+l.slice(1),v=0;v<oa.length;){m=(m=oa[v])?m+q:l;if(m in h)return m;v++}return J}function p(h){h=h.ownerDocument||h;return h.defaultView||h.parentWindow||f}function r(h,l){var m=this;
this.manager=h;this.callback=l;this.element=h.element;this.target=h.options.inputTarget;this.domHandler=function(q){P(h.options.enable,[h])&&m.handler(q)};this.init()}function t(h){var l=h.options.inputClass;return new (l?l:ya?V:za?W:pa?fa:S)(h,u)}function u(h,l,m){var q=m.pointers.length,v=m.changedPointers.length;var z=l&1&&0===q-v;m.isFirst=!!z;m.isFinal=!!(l&12&&0===q-v);z&&(h.session={});m.eventType=l;l=h.session;q=m.pointers;v=q.length;l.firstInput||(l.firstInput=A(m));1<v&&!l.firstMultiple?
l.firstMultiple=A(m):1===v&&(l.firstMultiple=!1);z=l.firstInput;var G=(v=l.firstMultiple)?v.center:z.center;var N=m.center=D(q);m.timeStamp=ha();m.deltaTime=m.timeStamp-z.timeStamp;m.angle=Q(G,N);m.distance=L(G,N);z=m.center;G=l.offsetDelta||{};N=l.prevDelta||{};var R=l.prevInput||{};if(1===m.eventType||4===R.eventType)N=l.prevDelta={x:R.deltaX||0,y:R.deltaY||0},G=l.offsetDelta={x:z.x,y:z.y};m.deltaX=N.x+(z.x-G.x);m.deltaY=N.y+(z.y-G.y);m.offsetDirection=F(m.deltaX,m.deltaY);G=m.deltaTime;z=m.deltaX/
G||0;G=m.deltaY/G||0;m.overallVelocityX=z;m.overallVelocityY=G;m.overallVelocity=Y(z)>Y(G)?z:G;v?(z=v.pointers,z=L(q[0],q[1],ba)/L(z[0],z[1],ba)):z=1;m.scale=z;v?(v=v.pointers,q=Q(q[1],q[0],ba)+Q(v[1],v[0],ba)):q=0;m.rotation=q;m.maxPointers=l.prevInput?m.pointers.length>l.prevInput.maxPointers?m.pointers.length:l.prevInput.maxPointers:m.pointers.length;G=l.lastInterval||m;q=m.timeStamp-G.timeStamp;8!=m.eventType&&(25<q||G.velocity===J)?(z=m.deltaX-G.deltaX,G=m.deltaY-G.deltaY,N=z/q||0,R=G/q||0,q=
N,v=R,N=Y(N)>Y(R)?N:R,z=F(z,G),l.lastInterval=m):(N=G.velocity,q=G.velocityX,v=G.velocityY,z=G.direction);m.velocity=N;m.velocityX=q;m.velocityY=v;m.direction=z;l=h.element;c(m.srcEvent.target,l)&&(l=m.srcEvent.target);m.target=l;h.emit("hammer.input",m);h.recognize(m);h.session.prevInput=m}function A(h){for(var l=[],m=0;m<h.pointers.length;)l[m]={clientX:aa(h.pointers[m].clientX),clientY:aa(h.pointers[m].clientY)},m++;return{timeStamp:ha(),pointers:l,center:D(l),deltaX:h.deltaX,deltaY:h.deltaY}}
function D(h){var l=h.length;if(1===l)return{x:aa(h[0].clientX),y:aa(h[0].clientY)};for(var m=0,q=0,v=0;v<l;)m+=h[v].clientX,q+=h[v].clientY,v++;return{x:aa(m/l),y:aa(q/l)}}function F(h,l){return h===l?1:Y(h)>=Y(l)?0>h?2:4:0>l?8:16}function L(h,l,m){m||(m=qa);var q=l[m[0]]-h[m[0]];h=l[m[1]]-h[m[1]];return Math.sqrt(q*q+h*h)}function Q(h,l,m){m||(m=qa);return 180*Math.atan2(l[m[1]]-h[m[1]],l[m[0]]-h[m[0]])/Math.PI}function S(){this.evEl=Aa;this.evWin=Ba;this.allow=!0;this.pressed=!1;r.apply(this,arguments)}
function V(){this.evEl=ra;this.evWin=sa;r.apply(this,arguments);this.store=this.manager.session.pointerEvents=[]}function Z(){this.evTarget="touchstart";this.evWin="touchstart touchmove touchend touchcancel";this.started=!1;r.apply(this,arguments)}function W(){this.evTarget=Ca;this.targetIds={};r.apply(this,arguments)}function Da(h,l){var m=g(h.touches),q=this.targetIds;if(l&3&&1===m.length)return q[m[0].identifier]=!0,[m,m];var v=g(h.changedTouches),z=[],G=this.target;var N=m.filter(function(R){return c(R.target,
G)});if(1===l)for(m=0;m<N.length;)q[N[m].identifier]=!0,m++;for(m=0;m<v.length;)q[v[m].identifier]&&z.push(v[m]),l&12&&delete q[v[m].identifier],m++;if(z.length)return[k(N.concat(z),"identifier",!0),z]}function fa(){r.apply(this,arguments);var h=O(this.handler,this);this.touch=new W(this.manager,h);this.mouse=new S(this.manager,h)}function ia(h,l){this.manager=h;this.set(l)}function Ea(h){if(-1<h.indexOf("none"))return"none";var l=-1<h.indexOf("pan-x"),m=-1<h.indexOf("pan-y");return l&&m?"none":l||
m?l?"pan-x":"pan-y":-1<h.indexOf("manipulation")?"manipulation":"auto"}function U(h){h=C({},h||{});this.id=Fa++;this.manager=null;this.options=M(h,this.defaults);h=this.options.enable;this.options.enable=h===J?!0:h;this.state=1;this.simultaneous={};this.requireFail=[]}function ta(h){return h&16?"cancel":h&8?"end":h&4?"move":h&2?"start":""}function ua(h){return 16==h?"down":8==h?"up":2==h?"left":4==h?"right":""}function ca(h,l){var m=l.manager;return m?m.get(h):h}function T(){U.apply(this,arguments)}
function da(){T.apply(this,arguments);this.pY=this.pX=null}function ja(){T.apply(this,arguments)}function ka(){U.apply(this,arguments);this._input=this._timer=null}function la(){T.apply(this,arguments)}function ma(){T.apply(this,arguments)}function ea(){U.apply(this,arguments);this.pCenter=this.pTime=!1;this._input=this._timer=null;this.count=0}function X(h,l){l=l||{};var m=l.recognizers;l.recognizers=m===J?X.defaults.preset:m;return new na(h,l)}function na(h,l){l=l||{};this.options=M(l,X.defaults);
this.options.inputTarget=this.options.inputTarget||h;this.handlers={};this.session={};this.recognizers=[];this.element=h;this.input=t(this);this.touchAction=new ia(this,this.options.touchAction);va(this,!0);K(l.recognizers,function(m){var q=this.add(new m[0](m[1]));m[2]&&q.recognizeWith(m[2]);m[3]&&q.requireFailure(m[3])},this)}function va(h,l){var m=h.element;m.style&&K(h.options.cssProps,function(q,v){m.style[n(m.style,v)]=l?q:""})}function Ga(h,l){var m=H.createEvent("Event");m.initEvent(h,!0,
!0);m.gesture=l;l.target.dispatchEvent(m)}var oa=" webkit moz MS ms o".split(" "),Ha=H.createElement("div"),aa=Math.round,Y=Math.abs,ha=Date.now,Fa=1,Ia=/mobile|tablet|ip(ad|hone|od)|android/i,pa="ontouchstart"in f,ya=n(f,"PointerEvent")!==J,za=pa&&Ia.test(navigator.userAgent),qa=["x","y"],ba=["clientX","clientY"];r.prototype={handler:function(){},init:function(){this.evEl&&a(this.element,this.evEl,this.domHandler);this.evTarget&&a(this.target,this.evTarget,this.domHandler);this.evWin&&a(p(this.element),
this.evWin,this.domHandler)},destroy:function(){this.evEl&&b(this.element,this.evEl,this.domHandler);this.evTarget&&b(this.target,this.evTarget,this.domHandler);this.evWin&&b(p(this.element),this.evWin,this.domHandler)}};var Ja={mousedown:1,mousemove:2,mouseup:4},Aa="mousedown",Ba="mousemove mouseup";I(S,r,{handler:function(h){var l=Ja[h.type];l&1&&0===h.button&&(this.pressed=!0);l&2&&1!==h.which&&(l=4);this.pressed&&this.allow&&(l&4&&(this.pressed=!1),this.callback(this.manager,l,{pointers:[h],changedPointers:[h],
pointerType:"mouse",srcEvent:h}))}});var Ka={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},La={2:"touch",3:"pen",4:"mouse",5:"kinect"},ra="pointerdown",sa="pointermove pointerup pointercancel";f.MSPointerEvent&&(ra="MSPointerDown",sa="MSPointerMove MSPointerUp MSPointerCancel");I(V,r,{handler:function(h){var l=this.store,m=!1,q=h.type.toLowerCase().replace("ms","");q=Ka[q];var v=La[h.pointerType]||h.pointerType,z="touch"==v,G=e(l,h.pointerId,"pointerId");q&1&&(0===h.button||
z)?0>G&&(l.push(h),G=l.length-1):q&12&&(m=!0);0>G||(l[G]=h,this.callback(this.manager,q,{pointers:l,changedPointers:[h],pointerType:v,srcEvent:h}),m&&l.splice(G,1))}});var Ma={touchstart:1,touchmove:2,touchend:4,touchcancel:8};I(Z,r,{handler:function(h){var l=Ma[h.type];1===l&&(this.started=!0);if(this.started){var m=g(h.touches);var q=g(h.changedTouches);l&12&&(m=k(m.concat(q),"identifier",!0));m=[m,q];l&12&&0===m[0].length-m[1].length&&(this.started=!1);this.callback(this.manager,l,{pointers:m[0],
changedPointers:m[1],pointerType:"touch",srcEvent:h})}}});var Na={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Ca="touchstart touchmove touchend touchcancel";I(W,r,{handler:function(h){var l=Na[h.type],m=Da.call(this,h,l);m&&this.callback(this.manager,l,{pointers:m[0],changedPointers:m[1],pointerType:"touch",srcEvent:h})}});I(fa,r,{handler:function(h,l,m){var q="mouse"==m.pointerType;if("touch"==m.pointerType)this.mouse.allow=!1;else if(q&&!this.mouse.allow)return;l&12&&(this.mouse.allow=!0);
this.callback(h,l,m)},destroy:function(){this.touch.destroy();this.mouse.destroy()}});var wa=n(Ha.style,"touchAction"),xa=wa!==J;ia.prototype={set:function(h){"compute"==h&&(h=this.compute());xa&&this.manager.element.style&&(this.manager.element.style[wa]=h);this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];K(this.manager.recognizers,function(l){P(l.options.enable,[l])&&(h=h.concat(l.getTouchAction()))});return Ea(h.join(" "))},
preventDefaults:function(h){if(!xa){var l=h.srcEvent,m=h.offsetDirection;if(this.manager.session.prevented)l.preventDefault();else{var q=this.actions,v=-1<q.indexOf("none"),z=-1<q.indexOf("pan-y");q=-1<q.indexOf("pan-x");if(v){var G=2>h.distance,N=250>h.deltaTime;if(1===h.pointers.length&&G&&N)return}if(!q||!z)if(v||z&&m&6||q&&m&24)return this.preventSrc(l)}}},preventSrc:function(h){this.manager.session.prevented=!0;h.preventDefault()}};U.prototype={defaults:{},set:function(h){C(this.options,h);this.manager&&
this.manager.touchAction.update();return this},recognizeWith:function(h){if(w(h,"recognizeWith",this))return this;var l=this.simultaneous;h=ca(h,this);l[h.id]||(l[h.id]=h,h.recognizeWith(this));return this},dropRecognizeWith:function(h){if(w(h,"dropRecognizeWith",this))return this;h=ca(h,this);delete this.simultaneous[h.id];return this},requireFailure:function(h){if(w(h,"requireFailure",this))return this;var l=this.requireFail;h=ca(h,this);-1===e(l,h)&&(l.push(h),h.requireFailure(this));return this},
dropRequireFailure:function(h){if(w(h,"dropRequireFailure",this))return this;h=ca(h,this);h=e(this.requireFail,h);-1<h&&this.requireFail.splice(h,1);return this},hasRequireFailures:function(){return 0<this.requireFail.length},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){function l(v){m.manager.emit(v,h)}var m=this,q=this.state;8>q&&l(m.options.event+ta(q));l(m.options.event);h.additionalEvent&&l(h.additionalEvent);8<=q&&l(m.options.event+ta(q))},tryEmit:function(h){if(this.canEmit())return this.emit(h);
this.state=32},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&33))return!1;h++}return!0},recognize:function(h){h=C({},h);P(this.options.enable,[this,h])?(this.state&56&&(this.state=1),this.state=this.process(h),this.state&30&&this.tryEmit(h)):(this.reset(),this.state=32)},process:function(h){},getTouchAction:function(){},reset:function(){}};I(T,U,{defaults:{pointers:1},attrTest:function(h){var l=this.options.pointers;return 0===l||h.pointers.length===l},
process:function(h){var l=this.state,m=h.eventType,q=l&6;h=this.attrTest(h);return q&&(m&8||!h)?l|16:q||h?m&4?l|8:l&2?l|4:2:32}});I(da,T,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var h=this.options.direction,l=[];h&6&&l.push("pan-y");h&24&&l.push("pan-x");return l},directionTest:function(h){var l=this.options,m=!0,q=h.distance,v=h.direction,z=h.deltaX,G=h.deltaY;v&l.direction||(l.direction&6?(v=0===z?1:0>z?2:4,m=z!=this.pX,q=Math.abs(h.deltaX)):(v=0===
G?1:0>G?8:16,m=G!=this.pY,q=Math.abs(h.deltaY)));h.direction=v;return m&&q>l.threshold&&v&l.direction},attrTest:function(h){return T.prototype.attrTest.call(this,h)&&(this.state&2||!(this.state&2)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX;this.pY=h.deltaY;var l=ua(h.direction);l&&(h.additionalEvent=this.options.event+l);this._super.emit.call(this,h)}});I(ja,T,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(h){return this._super.attrTest.call(this,
h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&2)},emit:function(h){1!==h.scale&&(h.additionalEvent=this.options.event+(1>h.scale?"in":"out"));this._super.emit.call(this,h)}});I(ka,U,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return["auto"]},process:function(h){var l=this.options,m=h.pointers.length===l.pointers,q=h.distance<l.threshold,v=h.deltaTime>l.time;this._input=h;if(!q||!m||h.eventType&12&&!v)this.reset();else if(h.eventType&1)this.reset(),
this._timer=B(function(){this.state=8;this.tryEmit()},l.time,this);else if(h.eventType&4)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(h){8===this.state&&(h&&h.eventType&4?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=ha(),this.manager.emit(this.options.event,this._input)))}});I(la,T,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>
this.options.threshold||this.state&2)}});I(ma,T,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:30,pointers:1},getTouchAction:function(){return da.prototype.getTouchAction.call(this)},attrTest:function(h){var l=this.options.direction;if(l&30)var m=h.overallVelocity;else l&6?m=h.overallVelocityX:l&24&&(m=h.overallVelocityY);return this._super.attrTest.call(this,h)&&l&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&Y(m)>this.options.velocity&&
h.eventType&4},emit:function(h){var l=ua(h.offsetDirection);l&&this.manager.emit(this.options.event+l,h);this.manager.emit(this.options.event,h)}});I(ea,U,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(h){var l=this.options,m=h.pointers.length===l.pointers,q=h.distance<l.threshold,v=h.deltaTime<l.time;this.reset();if(h.eventType&1&&0===this.count)return this.failTimeout();if(q&&v&&m){if(4!=
h.eventType)return this.failTimeout();m=this.pTime?h.timeStamp-this.pTime<l.interval:!0;q=!this.pCenter||L(this.pCenter,h.center)<l.posThreshold;this.pTime=h.timeStamp;this.pCenter=h.center;this.count=q&&m?this.count+1:1;this._input=h;if(0===this.count%l.taps)return this.hasRequireFailures()?(this._timer=B(function(){this.state=8;this.tryEmit()},l.interval,this),2):8}return 32},failTimeout:function(){this._timer=B(function(){this.state=32},this.options.interval,this);return 32},reset:function(){clearTimeout(this._timer)},
emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});X.VERSION="2.0.4";X.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[la,{enable:!1}],[ja,{enable:!1},["rotate"]],[ma,{direction:6}],[da,{direction:6},["swipe"]],[ea],[ea,{event:"doubletap",taps:2},["tap"]],[ka]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};
na.prototype={set:function(h){C(this.options,h);h.touchAction&&this.touchAction.update();h.inputTarget&&(this.input.destroy(),this.input.target=h.inputTarget,this.input.init());return this},stop:function(h){this.session.stopped=h?2:1},recognize:function(h){var l=this.session;if(!l.stopped){this.touchAction.preventDefaults(h);var m=this.recognizers,q=l.curRecognizer;if(!q||q&&q.state&8)q=l.curRecognizer=null;for(var v=0;v<m.length;){var z=m[v];2===l.stopped||q&&z!=q&&!z.canRecognizeWith(q)?z.reset():
z.recognize(h);!q&&z.state&14&&(q=l.curRecognizer=z);v++}}},get:function(h){if(h instanceof U)return h;for(var l=this.recognizers,m=0;m<l.length;m++)if(l[m].options.event==h)return l[m];return null},add:function(h){if(w(h,"add",this))return this;var l=this.get(h.options.event);l&&this.remove(l);this.recognizers.push(h);h.manager=this;this.touchAction.update();return h},remove:function(h){if(w(h,"remove",this))return this;var l=this.recognizers;h=this.get(h);l.splice(e(l,h),1);this.touchAction.update();
return this},on:function(h,l){var m=this.handlers;K(d(h),function(q){m[q]=m[q]||[];m[q].push(l)});return this},off:function(h,l){var m=this.handlers;K(d(h),function(q){l?m[q].splice(e(m[q],l),1):delete m[q]});return this},emit:function(h,l){this.options.domEvents&&Ga(h,l);var m=this.handlers[h]&&this.handlers[h].slice();if(m&&m.length){l.type=h;l.preventDefault=function(){l.srcEvent.preventDefault()};for(var q=0;q<m.length;)m[q](l),q++}},destroy:function(){this.element&&va(this,!1);this.handlers=
{};this.session={};this.input.destroy();this.element=null}};C(X,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:na,Input:r,TouchAction:ia,TouchInput:W,MouseInput:S,PointerEventInput:V,TouchMouseInput:fa,SingleTouchInput:Z,Recognizer:U,
AttrRecognizer:T,Tap:ea,Pan:da,Swipe:ma,Pinch:ja,Rotate:la,Press:ka,on:a,off:b,each:K,merge:M,extend:C,inherit:I,bindFn:O,prefixed:n});"function"==typeof define&&define.amd?define(function(){return X}):"undefined"!=typeof module&&module.exports?module.exports=X:f[E]=X})(window,document,"Hammer")}catch(f){console&&console.log&&console.log(f)}
(function(f){function H(a,b){a=f(a);var c=this;this.elem=a;this.id=a.attr("id");this.pages=[];this.opts=b;this.currentPage=null;this.pageWidth=b.width/2;this.pageHeight=b.height;this.startPage=b.startPage;this.onShowPage=b.onShowPage;this.slideShow=b.slideShow;this.slideShowDelay=b.slideShowDelay;this.pauseOnHover=b.pauseOnHover;this.turnPageDuration=b.turnPageDuration;this.foldGradient=b.foldGradient;this.foldGradientThreshold=b.foldGradientThreshold;this.shadows=b.shadows;this.shadowThreshold=b.shadowThreshold;
this.clipBoundaries=b.clipBoundaries;this.zoomLevel=1;this.zoomMax=Math.max(b.zoomMax,1);this.zoomMin=b.zoomMin;this.zoomBoundingBox=b.zoomBoundingBox;this.zoomStep=b.zoomStep;this.onZoom=b.onZoom;this.mouseWheel=b.mouseWheel;this.flipSound=b.flipSound;this.centeredWhenClosed=b.centeredWhenClosed;this.sectionDefinition=b.sections;this.rtl=!!b.rtl;this.closable=b.closable;f.wowBook.support.filters="filters"in a[0];this.opts.toolbarContainerPosition&&(this.opts.toolbarPosition=this.opts.toolbarContainerPosition);
this.opts.toolbarLightboxPosition&&(this.opts.toolbarPosition=this.opts.toolbarLightboxPosition);(this._isMobile=f.wowBook.utils.isMobile())&&this.mobileSetup();a.addClass("wowbook");"static"===a.css("position")&&a.css("position","relative");var d=a.children();if(d.length<b.pageCount){for(var e=b.pageCount-d.length;e--;)a.append("<div />");d=a.children()}e=this.pagesContainer=this.origin=f("<div class='wowbook-origin'></div>").css({position:"absolute"}).appendTo(a);c.bookShadow=f("<div class='wowbook-book-shadow'></div>").appendTo(a).css({top:0,
position:"absolute",display:"none",zIndex:0});this._controls={};this.controllify(this.opts.controls);this.insertPages(d,!0);e.append("<div class='wowbook-shadow-clipper'><div class='wowbook-shadow-container'><div class='wowbook-shadow-internal'></div></div></div>");c.shadowContainer=f(".wowbook-shadow-container",e);c.internalShadow=f(".wowbook-shadow-internal",e);c.shadowClipper=f(".wowbook-shadow-clipper",e).css({display:"none"});c.foldShadow=f("<div class='wowbook-shadow-fold'></div>").appendTo(c.shadowContainer);
c.foldGradientContainer=f("<div class='wowbook-fold-gradient-container'></div>").appendTo(c.shadowContainer);c.foldGradientElem=f("<div class='wowbook-fold-gradient'></div>").appendTo(c.foldGradientContainer);c.hardPageDropShadow=f("<div class='wowbook-hard-page-dropshadow'></div>").css({display:"none"}).appendTo(e);!f.support.opacity&&f.wowBook.support.filters&&f.wowBook.applyAlphaImageLoader(["wowbook-fold-gradient","wowbook-fold-gradient-flipped","wowbook-shadow-fold","wowbook-shadow-fold-flipped"]);
c.shadowContainer.css("position","relative");this.leftHandle=f("<div class='wowbook-handle wowbook-left'></div>").data("corner","l").appendTo(e);this.rightHandle=f("<div class='wowbook-handle wowbook-right'></div>").data("corner","r").appendTo(e);Modernizr.csstransforms3d&&(d=f("<div>").css("transform","perspective(1px)"),this.perspectiveUnit="none"!=d.css("transform")?"px":"",d=null);f.browser.msie&&f(".wowbook-handle",a).css({backgroundColor:"#fff",opacity:"0.01"});f(".wowbook-handle",e).bind("mousedown.wowbook",
function(r){return c.pageEdgeDragStart(r)});b.curl&&f(".wowbook-handle",e).hover(function(r){c.curlTimer||(c.curlTimer=setTimeout(function(){var t=r.target==c.leftHandle[0]?c.leftPage():c.rightPage();if(t){var u=t.offset();c.curl(t,r.pageY-u.top>c.pageHeight*c.currentScale*c._cssZoom/2)}},120))},function(){c.curlTimer=clearTimeout(c.curlTimer);c.uncurl()});var g,k;f(".wowbook-handle",e).on("mousedown.wowbook",function(){g=f.now();k=f(this).data("corner")}).on("mouseup.wowbook",function(){var r=f(this).data("corner");
if(!((new Date).getTime()-g>c.opts.handleClickDuration||r!=k)){c._cantStopAnimation||c.stopAnimation(!1);if("r"===r)c[c.rtl?"back":"advance"]();if("l"===r)c[c.rtl?"advance":"back"]();k=""}});var n=!1;a.hover(function(r){c.pauseOnHover&&(n=c.slideShowTimer,c.stopSlideShow(!0))},function(){c.pauseOnHover&&n&&c.startSlideShow()});this.clipBoundaries&&(this.origin.wrap("<div class='wowbook-clipper'><div class='wowbook-inner-clipper'></div></div>"),f(".wowbook-inner-clipper",a).css({position:"absolute",
width:"100%",overflow:"hidden"}),this.clipper=f(".wowbook-clipper",a).css({position:"absolute",left:0,top:0,width:"100%",overflow:"hidden",zIndex:1}));a.wrapInner("<div class='wowbook-zoomwindow'><div class='wowbook-zoomcontent'></div></div>");this.zoomWindow=f(".wowbook-zoomwindow",a);this.zoomContent=f(".wowbook-zoomcontent",a);f.browser.ie8mode&&this.zoomContent.wrapInner("<div class='IE8-zoom-helper'style='position:relative'></div>");this.zoomWindow.css({position:"absolute",top:0});this.zoomContent.css({position:"absolute",
left:0,top:0});this.zoomSetup();this.setDimensions(2*b.coverWidth||b.width,b.coverHeight||b.height);this.opts.container&&this.createContainer();this.singlePage(b.singlePage);b.responsiveSinglePage&&this.responsiveSinglePage();b.scaleToFit&&(this.scaleToFit(),this.responsive());this.fillToc();e=b.useTranslate3d;Modernizr.csstransforms3d&&e&&(f.wowBook.useTranslate3d=1==e||"mobile"==e&&f.wowBook.utils.isMobile());b.useScale3d=b.useScale3d&&Modernizr.csstransforms3d;if(b.deepLinking&&this.getLocationHash()){try{var p=
c.selectorToPage("#"+this.getLocationHash())}catch(r){}void 0===p&&(p=c.locationHashToPage());"number"===typeof p&&(c.startPage=p,b.moveToViewPort&&!J(c.elem)&&c.elem[0].scrollIntoView())}this.flipSound&&(this.audio=this.createAudioPlayer());this.opts.keyboardNavigation&&(p=f.wowBook.defaults.keyboardNavigation,this.rtl&&this.opts.keyboardNavigation==p&&(this.opts.keyboardNavigation={back:p.advance,advance:p.back}),f(document).on("keydown.wowbook",function(r){f(r.target).filter("input, textarea, select").length||
c.holdedPage||c.opts.lightbox&&!c.lightboxOn||(r.which===c.opts.keyboardNavigation.back&&c.back(),r.which===c.opts.keyboardNavigation.advance&&c.advance())}));f(window).on("hashchange.wowbook",function(){var r=window.location.hash;if(r===c.locationHashSetTo)c.locationHashSetTo=void 0;else{var t=(r=""===r&&!c.locationEndsInHash())?c.startPage:c.locationHashToPage();"number"===typeof t&&(c.gotoPage(t,!r),r||!b.moveToViewPort||J(c.elem)||c.elem[0].scrollIntoView())}});b.forceBasicPage&&(this.foldPage=
this.holdHardpage=this.foldPageBasic);f.wowBook.support.transform||(this.foldPage=this.foldPageBasic,f.wowBook.support.filters||(this.holdHardpage=this.foldPageBasic));this.mouseWheel&&("zoom"==c.mouseWheel&&a.bind("mousemove.wowbook mouseenter.wowbook",function(r){c._mousemoveEvent=r}),a.mousewheel(function(r,t){if(c.mouseWheel){if("zoom"===c.mouseWheel){var u=c.elem.offset(),A=c._mousemoveEvent,D=A.pageX-u.left;u=A.pageY-u.top;0<t&&c.zoomIn({x:D,y:u});0>t&&c.zoomOut({x:D,y:u})}else 0<t&&c.advance(),
0>t&&c.back();return!1}}));this.opts.touchEnabled&&this.touchSupport();b.toc&&(this.createToc(),b.displayToc&&this.showToc());this.opts.thumbnails&&this.createThumbnails();this.setupFullscreen();b.loadingIndicator&&(b.pdf||b.images||b.srcs)&&this.elem.addClass("wowbook-loading");this.showPage(this.startPage,!1);1!=this.opts.zoomLevel&&this.zoom(this.opts.zoomLevel,{duration:0});this.opts.pdf&&this.setPDF(this.opts.pdf);this.opts.lightbox&&this.lightbox(this.opts.lightbox);this.toolbars=[];this.opts.toolbar&&
(this.createToolbar(this.opts.toolbar),this.opts.responsiveToolbar&&(this.opts.lightbox||this.opts.container)&&this.setupResponsiveToolbar());this.setStyle(this.opts.styles||this.opts.style);this.opts.navControls&&this.createNavigationControls();this.showPage(this.startPage,!1);this.opts.container&&(this.updateContainer(),b.scaleToFit&&this.scaleToFit(),b.responsiveSinglePage&&this.responsiveSinglePage());1!=this.opts.zoomLevel&&this.zoom(this.opts.zoomLevel,{duration:0});this.opts.strings&&this.setStrings();
this.callRAFCallback=function(){c.rafCallback()};window.raf(this.callRAFCallback);b.slideShow&&this.startSlideShow()}function E(a,b){var c=Math.cos(b),d=Math.sin(b);return{x:c*a.x-d*a.y,y:d*a.x+c*a.y}}function J(a){var b=f(window).height(),c=a.offset(),d=f(window).scrollTop();return c.top>d&&c.top+a.height()<d+b}function B(a,b,c){var d;var e=d=0;if(!f.wowBook.support.boxSizing){var g;e="none"==a.css("borderTopStyle")?0:K[g=a.css("borderTopWidth")]||parseFloat(g);d="none"==a.css("borderRightStyle")?
0:K[g=a.css("borderRightWidth")]||parseFloat(g);var k="none"==a.css("borderBottomStyle")?0:K[g=a.css("borderBottomWidth")]||parseFloat(g);var n="none"==a.css("borderLeftStyle")?0:K[g=a.css("borderLeftWidth")]||parseFloat(g);d=parseFloat(a.css("paddingLeft"))+parseFloat(a.css("paddingRight"))+n+d;e=parseFloat(a.css("paddingTop"))+parseFloat(a.css("paddingBottom"))+e+k}a.css("width",b-d);a.css("height",c-e)}f.wowBook=function(a){return f(a).data("wowBook")};f.wowBook.version="1.3.8";f.wowBook.support=
{};f.fn.wowBook=function(a){if("string"===typeof a){var b=Array.prototype.slice.call(arguments,1);if("options"===a||"prop"===a){var c=f.wowBook(this[0]),d=b[0];return 1<b.length?c[d]=b[1]:c[d]}return this.each(function(){var g=f.wowBook(this);g[a].apply(g,b)})}var e=f.extend({},f.wowBook.defaults,a);return this.each(function(){if(f.wowBook(this))console.log("Error: the following element cannot be used twice by wowBook plugin: ",this);else{var g=new H(this,e);f(this).data("wowBook",g)}})};H.prototype=
{destroy:function(){this.callRAFCallback=f.noop;this.curlTimer=clearTimeout(this.curlTimer);this.stopSlideShow();f("*").add(document).add(window).off(".wowbook");this.destroyThumbnails();this.destroyToc();this.destroyToolbars();this.destroyLightbox();this.destroyContainer();this.stopAnimation(!1);this.clearLocationHash();this.elem.empty().removeData().off()},mobileSetup:function(){this.opts.hardPageShadow=!1},setDimensions:function(a,b){this.zoomed&&this.zoomReset(0);this.currentScale=1;var c=this.elem,
d=this.pageWidth;c.css({height:b,width:a});var e=c.parent(),g=e.css("display");0<=g.indexOf("flex")&&e.css("display","block");var k=c.height();this.pageWidth=c.width()/2;this.pageHeight=k;this._originalHeight||(this._originalHeight=this.pageHeight);this._originalWidth||(this._originalWidth=2*this.pageWidth);0<=g.indexOf("flex")&&e.css("display",g);e=this.origin.css({width:"100%",height:k});d&&this.centeredWhenClosed&&(g=parseFloat(e.css("left"),10),e.css("left",g/(d/this.pageWidth)));this.bookShadow.css({width:a,
height:b});this.setPagesDimension();this.positionBookShadow();this.shadowClipper.css({width:c.width(),height:k});this.hardPageDropShadow.css({width:this.pageWidth,height:this.pageHeight});this.opts.handleWidth&&f(".wowbook-handle",e).css("width",this.opts.handleWidth);this.rightHandle.css("left",a-this.rightHandle.width());if(this.clipBoundaries||this._restoreClipBoundaries)d=Math.ceil(Math.sqrt(this.pageWidth*this.pageWidth+this.pageHeight*this.pageHeight)),d=[this.pageHeight-d,c.width(),d,0],this.origin.css("top",
-d[0]),f(".wowbook-inner-clipper",c).css({width:"100%",height:d[2]-d[0],top:d[0]}),this.clipper.css({width:"100%",height:k});this.zoomWindow.css({width:2*this.pageWidth,height:k});this.zoomContent.css({width:2*this.pageWidth,height:k});this.corners={tl:[0,0],bl:[0,this.pageHeight],tr:[this.pageWidth,0],br:[this.pageWidth,this.pageHeight],l:[0,0],r:[this.pageWidth,0]};this.pdf&&this.pdfResetPages();this.thumbnails&&this.updateThumbnails()},setPagesDimension:function(){for(var a,b,c,d=0,e=this.pages.length;d<
e;d++)page=this.pages[d],b=page.isCover?this.pageWidth:this.opts.pageWidth||this.pageWidth,c=page.isCover?this.pageHeight:this.opts.pageHeight||this.pageHeight,page.pageWidth=b,page.pageHeight=c,page.css({width:b,height:c,left:page.onLeft?0:this.pageWidth}),a=f(".wowbook-page-content",page),B(a,b,c),this.setPageCorners(page);this.opts.gutterShadow&&f(".wowbook-gutter-shadow",this.elem).css("height",c)},setPageCorners:function(a){var b=0+a.pageWidth,c=0+a.pageHeight;a.corners={tl:[0,0],bl:[0,c],tr:[b,
0],br:[b,c],l:[0,0],r:[b,0]}},setPagePosition:function(a){a.left=a.onLeft?this.pageWidth-a.pageWidth:this.pageWidth;a.top=Math.floor((this.pageHeight-a.pageHeight)/2);a.css({left:a.left,top:a.top})},scale:function(a){if(f.wowBook.support.transform){this.zoomed&&this.zoom(1,0,{offset:{dx:0,dy:0}});this.currentScale=a;var b=this.zoomContent;this.opts.zoomUsingTransform?(b.css({transform:"scale("+a+")",transformOrigin:"0 0"}),this._cssZoom=1):(b.css("zoom",a),this._cssZoom=a*this.zoomLevel);this.elem.css({height:this._originalHeight*
a,width:this._originalWidth*a});this.zoomWindow.css({height:this._originalHeight*a,width:this._originalWidth*a});this.resizeHandles();if(this.opts.onResize)this.opts.onResize(this);this.pdfDoc&&this.pdfUpdateRender()}},scaleToFit:function(a,b){var c=a;if(!f.isNumeric(a)){var d=f(a||this.opts.scaleToFit);if(!d.length)throw"jQuery selector passed to wowbook.resize did not matched in any DOM element.";c=d.width();b=d.height()}this.opts.maxWidth&&c>this.opts.maxWidth&&(c=this.opts.maxWidth);this.opts.maxHeight&&
b>this.opts.maxHeight&&(b=this.opts.maxHeight);this._singlePage&&(c*=2);d=this._originalWidth/this._originalHeight;b*d<=c||(b=c/d);this.scale(b/this._originalHeight)},resize:function(a,b){this.setDimensions(a,b);if(this.opts.onResize)this.opts.onResize(this)},responsive:function(){var a=this;this._reponsiveApplied=!0;f(window).on("resize.wowbook",function(){a.responsiveResizeHandler()})},responsiveResizeHandler:function(){if(f.wowBook.utils.isIOS){var a=this.opts.container==window&&this.container||
this.lightboxOn&&this._lightboxElem,b=f(window);if(a&&(a.outerHeight()!=b.height()||a.outerWidth()!=b.width())&&(this.safariFixTotalDelayedTime||(this.safariFixTotalDelayedTime=0),800>(this.safariFixTotalDelayedTime||0))){var c=this;setTimeout(function(){c.safariFixTotalDelayedTime+=100;c.responsiveResizeHandler()},100);return}this.safariFixTotalDelayedTime=0}this.responsiveUpdater()},responsiveUpdater:function(){this.opts.container&&this.updateContainer();this.lightboxOn&&this.centerLightbox();this.responsiveSinglePage();
!0!==this.opts.container||this.opts.containerHeight?this.scaleToFit():(this.scaleToFit(this.containerBook.width(),1E4),this.containerBook.css("height","auto"),this.updateContainer());if((this.opts.container||this.lightboxOn)&&this._singlePage){var a=this.pageWidth*this.currentScale;this.elem.css("left",(this.opts.scaleToFit.width()-a)/2)}},responsiveSinglePage:function(a){if(a=void 0!=a?a:this.opts.responsiveSinglePage)f.isFunction(a)||(a=function(b){if(!this._isMobile)return!1;b=f(b.opts.scaleToFit);
var c=b.width();return b.height()>c}),this.singlePage(this.opts.singlePage||a.call(this,this))},resizeHandles:function(){if(this.opts.responsiveHandleWidth){var a=this.opts.responsiveHandleWidth/this.currentScale;f(".wowbook-handle").width(a);this.rightHandle.css("left",2*this.pageWidth-a)}},insertPages:function(a,b){for(var c=0,d=a.length;c<d;c++)this.insertPage(a[c],!0);this.updateBook(b)},insertPage:function(a,b){if(this.isDoublePage(a))this.insertDoublePage(a,b);else{a=f(a).addClass("wowbook-page-content");
var c=f("<div class='wowbook-page'></div>").css({width:this.pageWidth,height:this.pageHeight,display:"none",position:"absolute"}).appendTo(this.pagesContainer).append(a);f.wowBook.support.boxSizing&&a.css(f.wowBook.support.boxSizing,"border-box");B(a,this.pageWidth,this.pageHeight);c.hardPageSetByUser=a.hasClass("wowbook-hardpage");this.opts.gutterShadow&&this.upsertGutterShadowInPage(c);this.pages.push(c);b||this.updateBook();return c}},insertDoublePage:function(a,b){if(!this._insertingDoublePage){this._insertingDoublePage=
!0;var c=f(a),d=c.clone().insertAfter(c),e=c.add(d);c.css("left",0);d.css("right","100%");e.css({width:"200%",height:"100%",position:"relative"});e.css(f.wowBook.support.boxSizing+"","border-box").wrap("<div class='wowbook-double-page'></div>");c.parent().data("src",c.data("src"));d.parent().data("src",d.data("src"));c.parent().data("image",c.data("image"));d.parent().data("image",d.data("image"));if(this.rtl)g=this.insertPage(d.parent(),!0),e=this.insertPage(c.parent(),!0);else{e=this.insertPage(c.parent(),
!0);var g=this.insertPage(d.parent(),!0)}e&&(e.otherHalf=g);g&&(g.otherHalf=e);f.wowBook.support.boxSizing||(B(c,2*this.pageWidth,this.pageHeight),B(d,2*this.pageWidth,this.pageHeight));b||this.updateBook();this._insertingDoublePage=!1}},isDoublePage:function(a){a=f(a);return a.data("double")||a.is(this.opts.doublePages)},replaceNumberHolder:function(a,b){if(void 0==a)return a;b+="";return a.replace(/\{\{([^}]+)\}\}/g,function(c,d){if(b.length<d.length){var e=d.replace(/./g,"0");return(e+b).slice(-e.length)}return b})},
loadPage:function(a){"number"===typeof a&&(a=this.pages[a]);if(a&&!a.loaded&&!a.loading&&(a.src||a.image||a.cached||this.pdfDoc)){if(a.cached)return this.finishPageLoading(a,a.cache);a.loading=!0;this.opts.loadingIndicator&&a.addClass("wowbook-loading");var b=this;if(a.src)a.otherHalf&&a.otherHalf.loading||f.get(a.src,function(d){b.finishPageLoading(a,d);a.otherHalf&&b.finishPageLoading(a.otherHalf,d)});else if(a.image){var c=new Image;c.onload=function(){b.finishPageLoading(a,this)};f(c).addClass("wowbook-lazy");
c.src=a.image}else this.pdfDoc&&b.pdfLoadPage(a.pageIndex)}},finishPageLoading:function(a,b){a.loading=!1;a.loaded=!0;var c=!a.cached;a.cached=!1;this.opts.loadingIndicator&&(a.removeClass("wowbook-loading"),this.elem.removeClass("wowbook-loading"));var d=a.find(".wowbook-page-content");c&&(a.image||a.src)&&this.isDoublePage(d.children().first())&&(d=d.children().first());d.append(b);this.upsertNumberInPage(a);this.opts.gutterShadow&&this.upsertGutterShadowInPage(a);if(this.opts.onLoadPage)this.opts.onLoadPage(this,
a,a.pageIndex);this.pdfDoc&&!this._onLoadPDFCalled&&(c=this.opts.onLoadPDF||this.opts.onLoadPdf)&&(c(this,a,a.pageIndex),this._onLoadPDFCalled=!0);this.updateThumbnail(a.pageIndex)},unloadPage:function(a){"number"===typeof a&&(a=this.pages[a]);if(a&&a.loaded&&!this.isPageToKeep(a)&&(a.cache=a.find(".wowbook-page-content").html(),a.find(".wowbook-page-content").empty(),a.cached=!0,a.loaded=!1,this.pdfDoc&&(a.cache=void 0,a.cached=!1,a.textLayer=null),this.opts.onUnloadPage))this.opts.onUnloadPage(this,
a,a.pageIndex)},isPageToKeep:function(a){if(!a.keep)var b=a.find(".wowbook-page-content");return a.keep||b.data("keep")||b.is(this.opts.pagesToKeep)},selectPagesToUnload:function(a){void 0==a&&(a=this.currentPage);var b=[],c=this.leftPageIndex(a);a=this.rightPageIndex(a);var d=this.pageBelow(c),e=this.pageBelow(a),g=this.backPage(c),k=this.backPage(a);g=g&&g.pageIndex;k=k&&k.pageIndex;for(var n=0,p=this.pages.length;n<p;n++){var r=this.pages[n];r.loaded&&n!=c&&n!=a&&n!=d&&n!=e&&n!=g&&n!=k&&!this.isPageToKeep(r)&&
b.push(n)}return b},loadedPages:function(){for(var a=[],b=0,c=this.pages.length;b<c;b++)this.pages[b].loaded&&a.push(b);return a},unloadUnusedPages:function(a){var b=this.loadedPages();if(!(b.length<=this.opts.pagesInMemory)){b=b.length-this.opts.pagesInMemory;a=this.selectPagesToUnload(a);for(var c=0;c<b;c++)this.unloadPage(a[c])}},removePages:function(a,b){arguments.length||(a=0,b=-1);this.holdedPage&&this.releasePage(this.holdedPage);var c=this.pages;b=(b||a)+1||c.length;var d=c.slice(a,b),e=c.slice(b);
c.length=0>a?c.length+a:a;c.push.apply(c,e);e=0;for(var g=d.length;e<g;e++)d[e].remove();this.updateBook();return c.length},updateBook:function(a){this.doPageNumbering();this.findPagesType();this.positionBookShadow();var b=this.rtl&&this.closable||!this.rtl&&!this.closable,c=this.opts.pageWidth||this.opts.pageHeight;this.differentPageSizes=c;for(var d=0,e=this.pages.length-1;d<=e;d++){var g=this.pages[d].toggleClass("wowbook-left",b).toggleClass("wowbook-right",!b).data({pageIndex:d,holded:!1});g.pageIndex=
d;g.cover=!1;g.insideCover=!1;g.isCover=c&&(0==d||d==e||this.closable&&1==d||d==e-1&&!this.otherPage(e));var k=f(".wowbook-page-content",g);g.src=this.replaceNumberHolder(k.data("src")||this.opts.srcs,d);g.image=this.replaceNumberHolder(k.data("image")||this.opts.images,d);1!=g.loaded&&(g.loaded=!g.src&&!g.image&&!g.cached);!g.loaded&&this.opts.loadingIndicator&&g.addClass("wowbook-loading");g.onLeft=b;g.onRight=!b;b=!b;g.thickness=this.opts.pageThickness;c&&(g.thickness=g.isCover?this.opts.pageThickness:
"1px")}this.setCovers();this.setPagesDimension();this.findSections();this.opts.currentPageControlWidth||this.setCurrentPageControlWidth();a?this.updateCurrentPageControl():this.showPage(this.currentPage)},setCovers:function(){function a(k){if(0==k||k==b){var n=c.pages[k];if(n){var p=c.backPage(k);c.otherPage(k)?p||(n.cover=!1,n.insideCover=!0):(n.cover=!0,n.insideCover=!1,p&&!p.cover&&(p.insideCover=!0))}}}var b=this.pages.length-1,c=this;a(0);a(b);c.insideCoverLeft=null;c.insideCoverRight=null;for(var d=
0,e=this.pages.length-1;d<=e;d++){var g=c.pages[d];g.insideCover&&(g.onLeft?c.insideCoverLeft=g:c.insideCoverRight=g,c.differentPageSizes&&(g.keep=!0))}},singlePage:function(a){if(void 0!==a){(this._singlePage=!!a)?this.clipBoundaries&&(this.clipBoundaries=!1,this._restoreClipBoundaries=!0,this.clipper.css("overflow","visible"),this.clipper.children(".wowbook-inner-clipper").css("overflow","visible"),this.container&&this.container.css("overflow","hidden")):this._restoreClipBoundaries&&(this._restoreClipBoundaries=
!1,this.clipBoundaries=!0,this.clipper.css("overflow","hidden"),this.clipper.children(".wowbook-inner-clipper").css("overflow","visible"));a=0;var b=this.pageWidth;if(this._singlePage)a=this.pageIsOnTheRight(this.currentPage)?-b:0;else if(this.centeredWhenClosed){a=!!this.leftPage(this.currentPage);var c=this.rightPage(this.currentPage);a=a&&c?0:a?b/2:-b/2}this.origin.css("left",a);this.positionBookShadow()}return this._singlePage},doPageNumbering:function(){var a=this.opts;if(a.pageNumbers&&this.pages.length){var b=
a.numberedPages;a=this.pages.length-1;var c=this.pageIsOnTheLeft(a);"all"==b&&(b=[0,-1]);b||(b=this.closable?[2,c?-3:-2]:[0,-1]);var d=b[0];b=b[1];0>d&&(d=a+d+1);0>d&&(d=0);d>this.pages.length-1&&(d=a);0>b&&(b=a+b+1);0>b&&(b=0);b>this.pages.length-1&&(b=a);var e=this.opts.firstPageNumber;for(c=0;c<a;c++)delete this.pages[c].number;for(c=0;c<d;c++)f(".wowbook-page-number",this.pages[c]).remove();for(c=b+1;c<a;c++)f(".wowbook-page-number",this.pages[c]).remove();for(c=d;c<=b;c++)this.pages[c].number=
e,a=f(".wowbook-page-number",this.pages[c]),a.length||(a=f(".wowbook-page-content",this.pages[c]),a=f('<div class="wowbook-page-number"></div>').appendTo(a)),a.html(e++)}},upsertNumberInPage:function(a){"number"===typeof a&&(a=this.pages[a]);if(a.number||0===a.number){var b=f(".wowbook-page-number",a);b.length||(content=f(".wowbook-page-content",a),b=f('<div class="wowbook-page-number"></div>').appendTo(content));b.html(a.number)}},upsertGutterShadowInPage:function(a){"number"===typeof a&&(a=this.pages[a]);
a.find(".wowbook-gutter-shadow").length||(a=a.find(".wowbook-page-content"),f("<div class='wowbook-gutter-shadow'>").css("height",this.pageHeight).appendTo(a))},findPagesType:function(){var a=this.opts,b={},c;var d=a.hardPages||[];var e=!0===d;if(!e)for(a.hardcovers&&(d.push(0,-1),this.closable&&d.push(1),this.otherPage(this.pages.length-1)||d.push(-2)),a=0,c=d.length;a<c;a++){var g=d[a];0>g&&(g=this.pages.length+g);0<=g&&g<this.pages.length&&(b[g]=!0)}for(a=this.pages.length;a--;)d=e||b[a]||this.pages[a].hardPageSetByUser,
this.pages[a].toggleClass("wowbook-hardpage",d).isHardPage=d},showPage:function(a,b){0>a&&(a=0);a>this.pages.length-1&&(a=this.pages.length-1);var c=this.leftPageIndex(a),d=this.rightPageIndex(a),e=this.pageBelow(c),g=this.pageBelow(d),k=this.pageWidth,n=this.pages.length-1;this.loadPage(c);this.loadPage(d);this.loadPage(e);this.loadPage(g);this.loadPage(this.backPage(c));this.loadPage(this.backPage(d));this.differentPageSizes&&(null!==e&&this.loadPage(this.insideCoverLeft),null!==g&&this.loadPage(this.insideCoverRight));
this.opts.pagesInMemory&&this.unloadUnusedPages(a);for(var p=0;p<=n;p++){var r=this.pages[p].onLeft!=this.rtl?p:n-p;var t=p===e||p===c||p===d||p===g?"block":"none";this.pages[p].data("zIndex",r).css({display:t,left:this.pages[p].onLeft?0:k,top:0,zIndex:r});this.setPagePosition(this.pages[p])}this.differentPageSizes&&(null!==e&&this.insideCoverLeft.css("display","block"),null!==g&&this.insideCoverRight.css("display","block"));e=0==a||!this.closable&&1==a;n=a==n||a==this.otherPage(n);this.leftHandle.toggleClass("wowbook-disabled",
!this.backPage(c));this.rightHandle.toggleClass("wowbook-disabled",!this.backPage(d));this.toggleControl("back",e);this.toggleControl("next",n);this.toggleControl("first",e);this.toggleControl("last",n);c=!this.pages.length;this.toggleControl("left",c||(this.rtl?n:e));this.toggleControl("lastLeft",c||(this.rtl?n:e));this.toggleControl("right",c||(this.rtl?e:n));this.toggleControl("lastRight",c||(this.rtl?e:n));(c=this.onShowPage)&&f.isFunction(c)&&!this.isOnPage(a)&&(this.currentPage=a,c(this,this.pages[a],
a),(d=this.otherPage(a))&&c(this,this.pages[d],d));this.currentPage=a;this.pdf&&this.pdfUpdateRender();this._controls.currentpage&&this.updateCurrentPageControl();this._sliding||(c=this._singlePage&&this.pageIsOnTheRight(a)?-k:0,this.origin.css("left",c),this.origin.css("transform",""));this.centeredWhenClosed&&!this._singlePage&&(c=!!this.leftPage(a),d=this.rightPage(a),this.origin.css("left",c&&d?0:c?k/2:-k/2));this.positionBookShadow();!1!==b&&this.opts.updateBrowserURL&&this.locationHashToPage()!=
a&&(this.locationHashSetTo=window.location.hash=this.pageToLocationHash(a));this.showThumbnail()},slideX:function(a,b){var c=parseFloat(this.origin.css("left")),d=a-c;this.origin.css("left",0);var e=this;this._move=0;this._sliding=!0;f(this).animate({_move:1},{duration:this.opts.turnPageDuration,easing:"easeOutCubic",complete:function(){this._sliding=!1;this.origin.css("transform","");this.origin.css("left",a);this.positionBookShadow();f.isFunction(b)&&b()},step:function(g,k){e.translate(this.origin,
c+g*d);this.positionBookShadow()}})},holdPage:function(a,b,c,d,e){"number"===typeof a&&(a=this.pages[a]);if(a){var g=a.pageIndex,k=this.pages.length-1,n=!this.otherPage(k);if(!d)d=this.pageIsOnTheLeft(g)?"l":"r";else if(!this.corners[d]||(this.pageIsOnTheLeft(g)?/r/:/l/).test(d))return;void 0===e&&(e=this.backPage(g));if(e){var p=e.pageIndex;a.data("holded_info",[b,c,d]);if(!this._singlePage&&this.centeredWhenClosed&&(0===g||0===p||n&&(p===k||g===k))){var r=0,t=!this.rtl,u=this.pageWidth;if(t?0===
g:g===k&&n){var A=-u/2;var D=-u/4;var F=0;var L=-u/2;var Q=-u;var S=D;var V=Q;var Z=b}if(t?g===k&&n:0===g)A=u,D=3*u/2,F=u/2,L=0,Q=u,S=2*u,V=b,Z=S;if(t?0===p:p===k&&n)A=u/2,D=g===(t?k:0)?u:3*u/2,F=g===(t?k:0)?u/2:0,L=-u/2,Q=A,S=2*u,V=b,Z=S;if(t?p===k&&n:0===p)A=g===(t?0:k)?0:-u/2,D=u/2,F=u/2,L=g===(t?0:k)?-u/2:0,Q=-u,S=D,V=Q,Z=b;if(b<A){r=F;var W=V}b>D&&(r=L,W=Z);b>=A&&b<=D&&(b=(b-A)/(D-A),r=F+b*(L-F),W=Q+b*(S-Q));b=W;this.origin.css("left",r);this.positionBookShadow()}this.zoomed||"basic"==this.pageType(a)||
"basic"==this.pageType(e)?this.foldPageBasic(a,b,c,d,e):a.isHardPage||e.isHardPage?this.holdHardpage(a,b,c,d,e):this.foldPage(a,b,c,d,e);if(!a.data("holded")&&(a.addClass("wowbook-page-holded"),e.addClass("wowbook-page-holded"),a.data("holded",!0),this.holdedPage=a,this.holdedPageBack=e,this.shadows&&this.shadowClipper.css("display","block"),this.clipBoundaries&&this.clipper.css("overflow","visible"),this.positionBookShadow(),this.opts.onHoldPage))this.opts.onHoldPage(this,g,a,e)}}},foldPage:function(a,
b,c,d,e){this._currentFlip||(this._currentFlip=this.foldPageStart(a,b,c,d,e));this._currentFlip.page==a&&(this._currentFlip.x=b,this._currentFlip.y=c,this._currentFlip.page.data("holdedAt",{x:b,y:c}),this._currentFlip.corner=d,this.foldPageStyles(this._currentFlip))},foldPageStart:function(a,b,c,d,e){var g={};"number"===typeof a&&(a=this.pages[a]);g.book=this;g.page=a;g.pageIndex=a.data("pageIndex");void 0===e&&(e=this.backPage(g.pageIndex));if(e&&e.length){g.back=e;g.pageContent=a.children().first();
g.backContent=e.children().first();var k=g.page.pageWidth,n=g.page.pageHeight;d||(d="tl");if("l"==d||"r"==d){var p={x:"l"==d?0:k,y:c};a.data("grabPoint",p);g.grabPoint=p;d=(c>=p.y?"t":"b")+d}g.page.data("holdedAt",{x:b,y:c});g.x=b;g.y=c;g.page.data("holdedCorner",d);g.corner=d;g.pageDiagonal=Math.sqrt(k*k+n*n);b=Math.ceil(g.pageDiagonal);b="rect(-"+b+"px "+b+"px "+b+"px 0px)";g.page.css("clip",b);g.pageLeft=parseFloat(a.css("left"));e.css({left:g.pageLeft+"px",zIndex:1E5,clip:b});g.shadowHeight=2*
Math.ceil(g.pageDiagonal);g.shadowTop=-(g.shadowHeight-n)/2;this.shadowClipper.css({top:g.page.top,left:a.onLeft?a.left:e.left,width:2*k,height:n});this.internalShadow.css({display:"block",height:g.shadowHeight});g.foldShadowWidth=this.foldShadow.width();this.foldShadow.css({display:"block",height:g.shadowHeight});this.foldGradientContainer.appendTo(g.backContent);g.foldGradientWidth=this.foldGradientElem.width();g.foldGradientHeight=2*Math.ceil(g.pageDiagonal);this.foldGradientElem.css("height",
g.foldGradientHeight);this.foldGradientContainer.css({position:"absolute",width:g.foldGradientWidth,height:g.foldGradientHeight,top:0,left:0,display:"none"});g.foldGradientVisible=!1;return g}},foldPageStyles:function(a){var b=a.page.pageWidth,c=a.page.pageHeight,d=b/2,e=c/2,g=f.wowBook.utils.translate,k=a.x,n=a.y,p=a.back,r=a.corner||"tl";if("l"==r||"r"==r){var t=a.page.data("grabPoint");t||(t={x:"l"==r?0:b,y:n},page.data("grabPoint",t));r=(n>=t.y?"t":"b")+(this.pageIsOnTheLeft(a.pageIndex)?"l":
"r");a.corner=r;a.page.data("holdedCorner",r);var u=k-t.x,A=n-t.y;u=Math.atan2(A,u);t={x:0,y:(n>=t.y?0:c)-t.y};t=E(t,2*u);k=t.x+k;n=t.y+n}a.page.data("holdedAt",{x:k,y:n});a.page.data("holdedCorner",r);t=a.page.corners[r];r=b-t[0];var D=t[1];u=k-r;A=n-D;var F=Math.sqrt(u*u+A*A);F>b&&(k=r+b*u/F,n=D+b*A/F);D=c-D;u=k-r;A=n-D;F=Math.sqrt(u*u+A*A);var L=a.pageDiagonal;F>L&&(k=r+L*u/F,n=D+L*A/F);r=t[0];t=t[1];t==n&&(n=t+.001);u=k-r;A=n-t;F=Math.sqrt(u*u+A*A);k=F/2;u=Math.atan2(A,u);A=Math.tan(u);n=u;u=
180*u/Math.PI;D={x:r-d,y:e-t};L=E(D,n);F=L.x+k+d+.5;a.pageContent.css("transform",g(-F,0)+" rotate("+(-u).toFixed(7)+"deg)");a.page.css("transform",g((Math.cos(n)*F).toFixed(5),(Math.sin(n)*F).toFixed(5))+" rotate("+u.toFixed(7)+"deg)");L=this.calculateOpacity(k,b,this.shadowThreshold,50);if(this.shadows&&0<L){var Q=a.shadowTop;this.internalShadow.css({transform:g(F+(a.page.onRight?a.page.pageWidth:0),Q)+" rotate("+u+"deg)",transformOrigin:d-F+"px "+(e+(a.shadowHeight-c)/2)+"px"});F-=a.foldShadowWidth;
this.foldShadow.css({transform:g(F+(a.page.onRight?a.page.pageWidth:0),Q)+" rotate("+u+"deg)",transformOrigin:d-F+"px "+(e+(a.shadowHeight-c)/2)+"px"});this.shadowContainer.css({opacity:L,display:"block"})}else this.shadowContainer.css("display","none");p.show();D.x=-D.x;L=E(D,-n);F=L.x-k+d-1;c={x:L.x-k,y:L.y+k*A};p={x:L.x-k,y:L.y-k/(0==A?1E-4:A)};c=E(c,-n);p=E(p,-n);p=-(p.x+d);c=-(c.y-e);a.backContent.css("transform",g(-F,0)+" rotate("+u+"deg)");a.back.css("transform",g((r+p+Math.cos(n)*F).toFixed(5),
(t-c+Math.sin(n)*F).toFixed(5))+" rotate("+u+"deg)");L=this.calculateOpacity(2*k,2*b,this.foldGradientThreshold,50);this.foldGradient&&0<L?(this.foldGradientContainer.css({opacity:L,display:"block",transform:g(b-r-a.foldGradientWidth/2,t-a.foldGradientHeight/2)+" rotate("+-u+"deg)"}),this.foldGradientElem.css("transform",g(-k+a.foldGradientWidth/2,0)),a.foldGradientVisible||(this.foldGradientContainer.css("display","block"),a.foldGradientVisible=!0)):a.foldGradientVisible&&(this.foldGradientContainer.css("display",
"none"),a.foldGradientVisible=!1)},holdHardpage:function(a,b,c,d,e){this._currentFlip||(this._currentFlip=this.flipHardPageStart(a,b,c,d,e));this._currentFlip.page==a&&(this._currentFlip.x=b,this._currentFlip.y=c,this._currentFlip.page.data("holdedAt",{x:b,y:c}),this._currentFlip.corner=d,this.flipHardPageStyles(this._currentFlip))},flipHardPageStart:function(a,b,c,d,e){this.clipBoundaries&&this.clipper.children(".wowbook-inner-clipper").css("overflow","visible");!this.border3D&&this.opts.pageThickness&&
this.opts.use3d&&Modernizr.csstransforms3d&&(this.border3D=f('<div class="wowbook-3d-border">'),this.border3D.css("background",this.opts.pageEdgeColor));this.opts.hardPageShadow&&!this.hardPageShadow&&(this.hardPageShadow=f('<div class="wowbook-hard-page-shadow">'));var g={};"number"===typeof a&&(a=this.pages[a]);g.book=this;g.page=a;g.pageIndex=a.data("pageIndex");void 0===e&&(e=this.backPage(g.pageIndex));if(e&&e.length){g.back=e;var k=a.pageWidth;d||(d="tl");a.data("holdedAt",{x:b,y:c});a.data("holdedCorner",
d);a.css("zIndex",1E5);e.css("zIndex",1E5);this.opts.use3d&&Modernizr.csstransforms3d&&(a.css(Modernizr.prefixed("perspectiveOrigin"),"0 50%"),e.css(Modernizr.prefixed("perspectiveOrigin"),"0 50%"));b=a.onLeft?k:0;a.css("transformOrigin",b+"px 50%");e.css("transformOrigin",k-b+"px 50%");this.border3D&&this.border3D.css("width",a.thickness);this.shadows&&this.hardPageDropShadow.css({display:"block",width:a.pageWidth,height:a.pageHeight,top:a.top});return g}},flipHardPageStyles:function(a){var b=a.page,
c=a.back,d=a.x,e=a.y,g=this.pageIsOnTheRight(a.pageIndex),k=this.pageWidth,n=this.pageHeight;(a=a.corner)||(a="tl");b.data("holdedAt",{x:d,y:e});b.data("holdedCorner",a);e=g?k-d:d;a=g?0:k;var p;0>e&&(e=0);e=(p=e<k)?b:c;(p?c:b).css("display","none");g=g!=p;a=d-a;a>k&&(a=k);a<-k&&(a=-k);var r=-Math.sqrt(1600*(1-a*a/((k+15)*(k+15))));p=Math.abs(a/k);r=1==p?0:Math.atan2(r,a);if(this.opts.use3d&&Modernizr.csstransforms3d){var t=g?-this._calculateAngleFromX(-a,k):this._calculateAngleFromX(a,k);if(this.animating){var u=
this._animationData;if(this.curledPage||u.curled)u.curled=!0,u.angle||(r={from:t,to:0},u.angle=r,t=a+u.dx,r.to=g?-this._calculateAngleFromX(-t,k):this._calculateAngleFromX(t,k),Math.abs(a)==k&&(r.from=0),Math.abs(t)==k&&(r.to=0),r.delta=r.to-r.from),t=u.angle.from-u.angle.delta*(u.from.x-d)/u.dx}e.append(this.border3D);this.hardPageShadow&&(e.append(this.hardPageShadow),this.hardPageShadow.css("opacity",1-p));e.css({transform:"perspective("+this.opts.perspective+this.perspectiveUnit+") rotate3d(0, 1, 0, "+
t+"deg)",display:"block"})}else e.css({transform:"skewY("+r+"rad) scaleX("+p+")",display:"block"});!f.wowBook.support.transform&&f.wowBook.support.filters&&(e.css("filter","progid:DXImageTransform.Microsoft.Matrix(M11="+(p+", M12=0, M21="+Math.tan(r)*p+", M22=1, sizingMethod='auto expand')")),e.css({marginTop:n-e.height(),marginLeft:g?k-e.width():0}));this.shadows&&this.hardPageDropShadow.css({left:g?b.onLeft?b.left:c.left:k,opacity:Math.abs(a)<k/2?0:(Math.abs(a)-k/2)/k*.8})},_calculateAngleFromX:function(a,
b,c){var d=2*b/3;if(a>d){var e=this._calculateAngleFromX(d,b,c);return e+(a-d)/(b-d)*(0-e)}c=c||this.opts.perspective;d=180/Math.PI;e=b*b;c*=c;var g=a*a;a=Math.acos((b*c*a-Math.sqrt(e*e*c*g+e*e*g*g-e*c*g*g))/(e*c+e*g));return-a*d},foldPageBasic:function(a,b,c,d,e){this._currentFlip||(this._currentFlip=this.foldPageBasicStart(a,b,c,d,e));this._currentFlip&&this._currentFlip.page==a&&(this._currentFlip.x=b,this._currentFlip.y=c,this._currentFlip.page.data("holdedAt",{x:b,y:c}),this._currentFlip.corner=
d,this.foldPageBasicStyles(this._currentFlip))},foldPageBasicStart:function(a,b,c,d,e){var g={};"number"===typeof a&&(a=this.pages[a]);g.book=this;g.page=a;g.pageIndex=a.data("pageIndex");void 0===e&&(e=this.backPage(g.pageIndex));if(e&&e.length){g.back=e;var k=a.pageHeight;d||(d="tl");a.data("holdedAt",{x:b,y:c});a.data("holdedCorner",d);e.css("zIndex",1E5);a.data("foldPageBasic",!0);g.foldGradientWidth=this.foldGradientElem.width();g.foldShadowWidth=this.foldShadow.width();this.internalShadow.css("display",
"none");this.foldShadow.css({display:"none",height:k,transform:"",top:a.top}).toggleClass("wowbook-shadow-fold-flipped",a.onRight);this.shadowContainer.css("display","block");b=e.children().first();this.foldGradientContainer.appendTo(b).css({width:g.foldGradientWidth,height:k,top:0,transform:"",zIndex:1E9});this.foldGradientElem.css({left:0,height:k}).toggleClass("wowbook-fold-gradient-flipped",a.onRight);return g}},foldPageBasicStyles:function(a){var b=a.page,c=a.back;x=a.x;y=a.y;var d=b.pageWidth,
e=b.pageHeight,g=a.corner;g||(g="tl");b.data("holdedAt",{x:x,y:y});b.data("holdedCorner",g);var k=(g=this.pageIsOnTheLeft(a.pageIndex))?x:d-x;0>k&&(k=0);k>2*d&&(k=2*d);var n=k/2;if(g){var p="rect(-1000px "+d+"px "+e+"px "+n+"px)";e="rect(-1000px "+d+"px "+e+"px "+(d-n)+"px)";k=b.left+(k-d)}else p="rect(-1000px "+(d-n)+"px "+e+"px -1000px)",e="rect(-1000px "+n+"px "+e+"px -1000px)",k=c.left+(d-k+d);b.css("clip",p);c.css({clip:e,left:k,display:"block"});p=this.calculateOpacity(2*n,2*d,this.shadowThreshold,
50);this.shadows&&0<p?(b=g?b.left+n-a.foldShadowWidth:c.left+d-n+d,this.shadowContainer.css("opacity",p),this.foldShadow.css({left:b,display:"block"})):this.foldShadow.css("display","none");p=this.calculateOpacity(2*n,2*d,this.foldGradientThreshold,50);this.foldGradient&&0<p?(b=g?d-n:n-a.foldGradientWidth,this.foldGradientContainer.css({opacity:p,left:b,display:"block"})):this.foldGradientContainer.css("display","none")},stopAnimation:function(a){arguments.length||(a=!0);f(this).stop(!0,a);this.animating=
!1;this.currentFlip&&(this.currentFlip.finished=!0)},flip:function(a,b,c,d){d||(d=f.isPlainObject(a)?a:{});d.from||(d.from=[]);d.to||(d.to=[]);var e=this;if(!e.animating){e.animating=!0;c||(c=d.page||e.holdedPage);var g=c.data("holded_info");c.data("holdedAt");var k=d.corner||c.data("holdedCorner"),n=f.easing[d.easing]||d.easing||function(p){return 1==p?1:-Math.pow(2,-10*p)+1};a={page:c,back:d.back||e.holdedPageBack||e.backPage(c.pageIndex),initialX:void 0!=d.from[0]?d.from[0]:g[0],initialY:void 0!=
d.from[1]?d.from[1]:g[1],finalX:void 0!=d.to[0]?d.to[0]:a,finalY:void 0!=d.to[1]?d.to[1]:b,corner:k||g[2],duration:d.duration,complete:function(){e.animating=!1;f.isFunction(d.complete)&&d.complete()},easing:n,arc:d.arc,dragging:d.dragging,start:f.now(),finished:!1};a.deltaX=a.finalX-a.initialX;a.deltaY=a.finalY-a.initialY;this._animationData={from:{x:a.initialX,y:a.initialY},to:{x:a.finalX,y:a.finalY},dx:a.deltaX};void 0==a.duration&&(a.duration=this.turnPageDuration*Math.abs(a.deltaX)/(2*this.pageWidth));
a.duration<this.opts.turnPageDurationMin&&(a.duration=this.opts.turnPageDurationMin);!c.isHardPage&&.4<a.duration/this.turnPageDuration&&this.playFlipSound();this.currentFlip=a}},rafCallback:function(){window.raf(this.callRAFCallback);this._zoomUpdateOnRAF();if(this.currentFlip&&!this.currentFlip.finished){var a=this.currentFlip,b=(f.now()-a.start)/a.duration;1<=b&&(b=1);a.x=a.initialX+a.deltaX*a.easing(b,a.duration*b,0,1,a.duration);a.y=a.initialY+a.deltaY*a.easing(b,a.duration*b,0,1,a.duration);
a.arc&&(a.y-=(.5-Math.abs(.5-a.easing(b,a.duration*b,0,1)))*this.pageHeight/10);a.dragging&&(a.x=a.initialX+.2*a.deltaX,a.y=a.initialY+.2*a.deltaY,a.initialX=a.x,a.initialY=a.y,a.deltaX=a.finalX-a.initialX,a.deltaY=a.finalY-a.initialY,1>a.deltaX&&1>a.deltaY&&1==b);this.holdPage(a.page,a.x,a.y,a.corner,a.back);1==b&&(a.finished=!0,a.complete&&a.complete())}},releasePages:function(){for(var a=0,b=this.pages.length;a<b;a++)this.pages[a].data("holded")&&this.releasePage(a)},releasePage:function(a,b,c,
d){"number"===typeof a&&(a=this.pages[a]);var e=this,g=a.data("holdedAt"),k=a.data("holdedCorner");if(b&&g)this.flip({from:[g.x,g.y],to:a.corners[k],page:a,easing:"linear",duration:d,complete:function(){e.releasePage(a)}});else if(b=a.data("pageIndex"),void 0===c&&(c=this.holdedPageBack||this.backPage(b)),this.holdedPageBack=this.holdedPage=null,a.data({holded_info:null,holdedAt:null,holdedCorner:null,grabPoint:!1,foldPageBasic:null,holded:!1}),this.clipBoundaries&&!this.zoomed&&(this.clipper.css("overflow",
"hidden"),this.clipper.children(".wowbook-inner-clipper").css("overflow","hidden")),this.shadowClipper.css("display","none"),this.internalShadow.parent().hide(),this.foldGradientContainer.hide(),this.hardPageDropShadow.hide(),this.resetPage(a),c&&c.length&&(this.resetPage(c),c.hide()),this.foldShadow.removeClass("wowbook-shadow-fold-flipped").css({transform:"",left:""}),this.foldGradientElem.removeClass("wowbook-fold-gradient-flipped").css("transform",""),this.foldGradientContainer.css("transform",
"").appendTo(this.pagesContainer),this.positionBookShadow(),this.opts.onReleasePage)this.opts.onReleasePage(this,b,a,c)},resetPage:function(a){this._currentFlip=void 0;a.removeClass("wowbook-page-holded");this.resetCSS||(this.resetCSS={transform:"",transformOrigin:"",clip:"auto",marginLeft:0,marginTop:0,filter:""});var b=a.pageWidth,c=a.pageHeight;a.css(this.resetCSS).css({zIndex:a.data("zIndex"),width:b,height:c,left:a.onLeft?0:this.pageWidth});this.setPagePosition(a);f.browser.msie&&9>f.browser.version&&
a.attr("style",a.attr("style").replace(/clip: [^;]+;/i,""));a=f(".wowbook-page-content",a);a.css(this.resetCSS);B(a,b,c);this.hardPageShadow&&this.hardPageShadow.hide()},gotoPage:function(a,b){var c;if(!this.animating){"string"===typeof a&&"#"==a.charAt(0)&&(a=this.selectorToPage(a));0>a&&(a=0);a>this.pages.length-1&&(a=this.pages.length-1);if(this._singlePage){if(a==this.currentPage)return}else if(this.isOnPage(a))return;if(!this.elem.is(":visible"))return this.showPage(a,b),a;this._cantStopAnimation=
!0;var d=a<this.currentPage;var e=this.rtl?a>this.currentPage:d;var g=this,k=e?g.leftPage():g.rightPage();if(k){this.uncurl(!0);if(e){var n=this.leftPage(a);var p=this.rightPage(a)}else n=this.rightPage(a),p=this.leftPage(a);if(this.closable&&this.differentPageSizes&&k.isCover!=p.isCover&&k.pageIndex!==a){if(0==k.pageIndex||0==p.pageIndex)this.showPage(1,!1);else{var r=this.pages.length-1;this.otherPage(r)||k.pageIndex!=r&&p.pageIndex!=r||this.showPage(this.backPage(r).pageIndex,!1)}this.gotoPage(p.pageIndex)}else{var t=
p&&p.is(":visible");if(d)for(d=k.pageIndex-1;0<=d;d--)this.pages[d].css("display","none");else for(d=k.pageIndex+1,c=this.pages.length;d<c;d++)this.pages[d].css("display","none");n&&(n.css("display","block"),n.onLeft?this.insideCoverLeft.css("display","block"):this.insideCoverRight.css("display","block"));t&&p.css("display","block");var u=a;n=k.data("holdedAt");t=k.data("holdedAt");d=k.data("holdedCorner")||(e?"tl":"tr");e?(t=t||{x:0,y:0},e=2*g.pageWidth,c="bl"!=d?0:k.pageHeight):(t=t||{x:k.pageWidth,
y:0},e=-k.pageWidth,c="br"!=d?0:k.pageHeight);var A="linear";if(this.centeredWhenClosed&&!this._singlePage&&(k.isHardPage||p.isHardPage)){r=this.pages.length-1;var D=!this.rtl;A="easeOutCubic";this.pageIsOnTheRight(this.currentPage)&&!this.otherPage(this.currentPage)&&(e+=this.pageWidth/2,a!=(D?r:0)||this.otherPage(a)||(e+=this.pageWidth/2));this.pageIsOnTheLeft(this.currentPage)&&!this.otherPage(this.currentPage)&&(e-=this.pageWidth/2,a!=(D?0:r)||this.otherPage(a)||(e-=this.pageWidth/2))}if(this._singlePage){if(this.isOnPage(a))return this.animating=
!0,this.slideX(this.pageIsOnTheLeft(a)?0:-this.pageWidth,function(){g._cantStopAnimation=!1;g.animating=!1;g.showPage(u,b)}),a;this.slideX(this.pageIsOnTheLeft(a)?0:-this.pageWidth,function(){g.showPage(u,b)})}g.flip({from:[t.x,t.y],to:[e,c],easing:A,arc:!n,page:k,back:p,corner:d,complete:function(){g._cantStopAnimation=!1;g.releasePage(k,!1);g.showPage(u,b)}});return a}}}},gotoDirection:function(a,b){void 0==b&&(b=this.currentPage);"left"==a&&(a=-1);"right"==a&&(a=1);var c=a*(this._singlePage?1:
2);this.rtl&&(c=-c);return this.gotoPage(b+c)},gotoLeft:function(a){return this.gotoDirection("left",a)},gotoRight:function(a){return this.gotoDirection("right",a)},gotoLastLeft:function(a){return this.gotoPage(this.rtl?this.pages.length:0)},gotoLastRight:function(a){return this.gotoPage(this.rtl?0:this.pages.length)},back:function(){return this.gotoPage(this.currentPage-(this._singlePage?1:2))},advance:function(){return this.gotoPage(this.currentPage+(this._singlePage?1:2))},leftPage:function(a){void 0===
a&&(a=this.currentPage);return this.pages[this.leftPageIndex(a)]||null},leftPageIndex:function(a){if(null!=a){this.pageIsOnTheRight(a)&&(a+=this.rtl?1:-1);if(0>a||a>this.pages.length-1)a=null;return a}},rightPage:function(a){void 0===a&&(a=this.currentPage);return this.pages[this.rightPageIndex(a)]||null},rightPageIndex:function(a){if(null!=a){this.pageIsOnTheLeft(a)&&(a+=this.rtl?-1:1);if(0>a||a>this.pages.length-1)a=null;return a}},pageIsOnTheRight:function(a){return!this.pageIsOnTheLeft(a)},pageIsOnTheLeft:function(a){a=
!(a%2);this.closable&&(a=!a);this.rtl&&(a=!a);return a},otherPage:function(a){var b=this.pageIsOnTheLeft(a)?1:-1;this.rtl&&(b=-b);a+=b;if(0>a||a>this.pages.length-1)a=null;return a},isOnPage:function(a){return"number"===typeof a&&(a===this.currentPage||a===this.otherPage(this.currentPage))},backPage:function(a){if(!this.pages[a])return null;var b=a%2?1:-1;a+=this.closable?-b:b;return this.pages[a]},pageBelow:function(a){a=parseInt(a,10);if(a!=a)return null;a+=this.pageIsOnTheLeft(a)!=this.rtl?-2:
2;if(0>a||a>this.pages.length-1)a=null;return a},pageType:function(a){a="number"===typeof a?this.pages[a]:a;return a.isHardPage?"hard":a.find(".wowbook-page-content.wowbook-basic-page").length?"basic":"soft"},calculateOpacity:function(a,b,c,d){if(a<=c||a>=b-c)return 0;if(a>=d&&a<=b-d)return 1;a>d&&(a=b-a);return(a-c)/(d-c)},startSlideShow:function(){this.slideShowRunning=!0;this.advanceAfterTimeout(this.slideShowDelay);this.toggleControl("slideshow",!0)},advanceAfterTimeout:function(a){var b=this;
this.slideShowTimer=setTimeout(function(){if(b.animating||b.holdedPage)b.advanceAfterTimeout(100);else{var c=b.isOnPage(b.pages.length-1);b.opts.slideShowLoop&&c?b.gotoPage(0):b.advance();b.opts.slideShowLoop||!c?b.advanceAfterTimeout(b.slideShowDelay+b.turnPageDuration):b.stopSlideShow()}},a)},stopSlideShow:function(a){clearTimeout(this.slideShowTimer);this.slideShowTimer=void 0;this.slideShowRunning=!1;a||this.toggleControl("slideshow",!1)},toggleSlideShow:function(){this.slideShowRunning?this.stopSlideShow():
this.startSlideShow()},findSections:function(a){a&&(this.sectionDefinition=a);var b=this.sectionDefinition;a=[];if("string"===typeof b){var c=b;b=[];f(c,this.elem).each(function(g,k){b.push(["#"+k.id,f(k).html()])})}if(f.isArray(b)){for(var d=0,e=b.length;d<e;d++){c=b[d];if("string"===typeof c)try{c=[c,f(c,this.elem).html()]}catch(g){continue}try{c[2]=this.selectorToPage(c[0])}catch(g){continue}void 0!==c[2]&&a.push({id:c[0],title:c[1],page:c[2]})}a=a.sort(function(g,k){return g.page-k.page})}return this.sections=
a},pageToSection:function(a){for(var b=this.sections,c,d=0,e=b.length;d<e&&!(b[d].page>a);d++)c=b[d];return c},currentSection:function(){return this.pageToSection(this.currentPage)},fillToc:function(a,b){var c=f(a||this.opts.toc),d="";if(0!==c.length){var e=this.sections;"undefined"===typeof b&&(b=this.opts.tocTemplate);b||(d=c.is("UL, OL")?"<li>":"<div>",b='${section}');for(var g=0,k=e.length;g<k;g++){var n=e[g];n=b.replace(/\$\{link\}/g,"#"+this.id+"/"+n.id.substr(1)).replace(/\$\{section\}/g,
n.title).replace(/\$\{page\}/g,n.page);f(n).appendTo(c).wrap(d)}}},createToc:function(a){a=this.opts.toc||a||[];var b=this.tocContainer=f("<div class='wowbook-toc' style='display:none'>").prependTo(f(this.opts.tocParent||"body"));b.append("<h1><span class='wowbook-toc-header-text'>"+this.opts.tocHeader+"</span><button class='wowbook-close'>✕</button></h1>");this.controllify({toc:b.find(".wowbook-close")});b=f("<ul class='wowbook-toc-items'>").appendTo(b);this.createTocItemList(a,b);b.on("click",
".wowbook-toc-item-toggle",function(){f(this).parent().toggleClass("wowbook-collapsed")});this.setStyle(this.opts.styles||this.opts.style)},createTocItemList:function(a,b){for(var c=this,d,e,g=0,k=a.length;g<k;g++){d=a[g];e=this.createTocItem(d[0],d[1]).appendTo(b);if(d[3])e.find("a").on("click",{dest:d[3]},function(n){n.preventDefault();c.pdfNavigateTo(n.data.dest)});if(d[2]&&d[2].length){if(null===d[1]&&null===d[3])e.find("a").on("click",function(n){f(this).parent().find(".wowbook-toc-item-toggle").trigger("click");
n.preventDefault()});e.addClass("wowbook-collapsed");f("<span class='wowbook-toc-item-toggle'></span>").prependTo(e);e=f("<ul class='wowbook-toc-items'>").appendTo(e);this.createTocItemList(d[2],e)}}},createTocItem:function(a,b){var c=this.opts.tocItemTemplate||'<li class="wowbook-toc-item"><a href="${link}">${title}<span class="page">${page}</span></a></li>',d="";f.isNumeric(b)&&(d=b,b=this.pageToLocationHash(b));if(null===b||void 0===b)b="";c=c.replace(/\$\{link\}/g,b).replace(/\$\{title\}/g,a).replace(/\$\{page\}/g,
d);return f(c)},destroyToc:function(){this.tocContainer&&this.tocContainer.remove();this.tocContainer=null},showToc:function(a){this.tocContainer&&this.tocContainer.length||this.createToc();this.tocContainer.fadeIn(a)},hideToc:function(a){this.tocContainer.fadeOut(a)},toggleToc:function(a){f(this.tocContainer).is(":visible")?this.hideToc(a):this.showToc(a)},locationHashToPage:function(a,b){void 0===a&&(a=window.location.hash);if(a=="#"+this.id+"/")return 0;a=a.slice(1).split("/");if(a[0]===this.id){if(1===
a.length)return 0;var c=parseInt(a[1]);if(!isNaN(c))return Math.max(c-1,0);c=this.selectorToPage("#"+a[1]);if(void 0===c)return 0;isNaN(a[2])||(c+=Math.max(parseInt(a[2])-1,0));return+c}},pageToLocationHash:function(a){a=parseInt(a,10);var b="",c=a+1;if(a=this.pageToSection(a))b+="/"+a.id.replace("#",""),c-=a.page;1<c&&(b+="/"+c);return"#"+this.id+(b||"/")},clearLocationHash:function(){(new RegExp("^#"+this.id+"/?")).exec(window.location.hash)&&(window.location.hash="")},selectorToPage:function(a){a=
f(a,this.elem).closest(".wowbook-page");if(a.length)return+a.data("pageIndex")},getLocationHash:function(){return window.location.hash.slice(1)},locationEndsInHash:function(a){void 0===a&&(a=window.location.href);return a.lastIndexOf("#")==a.length-1},zoomSetup:function(){this._zoomOffset={dx:0,dy:0};this._cssZoom=this._cssZoom||1;this.zoomLevel=1;this.detectBestZoomMethod();this.zoomTouchSupport();this.toggleControl("zoomIn",this.zoomLevel==this.zoomMax);this.toggleControl("zoomOut",this.zoomLevel==
this.zoomMin);this.toggleControl("zoomReset",1==this.zoomLevel);if(this.opts.doubleClickToZoom){var a=this;this.elem.on("dblclick",function(b){var c=a.elem.offset(),d=b.pageX-c.left;b=b.pageY-c.top;a.zoomed?a.zoomReset():a.zoomIn(1,{x:d,y:b})})}},_zoomUpdateOnRAF:function(){if(this._zoomDataRAF){var a=f.extend({},this._zoomDataRAF.options),b=this._zoomDataRAF.options.offset;if(b){var c=this._zoomOffset,d=b.dx-c.dx,e=b.dy-c.dy;a.offset={dx:c.dx+.2*d,dy:c.dy+.2*e}}c=this._zoomDataRAF.level||this.zoomLevel;
c!=this.zoomLevel&&(c=this.zoomLevel+.2*(c-this.zoomLevel));a.transform=!0;this._zoom(c,a);b&&1>Math.abs(d)&&1>Math.abs(e)&&1>Math.abs(this.zoomLevel-c)&&(this._zoomDataRAF.callback&&this._zoomDataRAF.callback.call(this),this._zoomDataRAF=null)}},_zoom:function(a,b){b||(b={});var c=void 0!=b.x?b.x:this.pageWidth*this.currentScale,d=b.y||0;this._zoomOffset=b.offset||this.zoomFocusOffset(a,c,d);this.zoomLevel=a;c=b.transform||this.opts.zoomUsingTransform;var e=a*this.currentScale;d=f.browser.ie7?1:
c?this._cssZoom:e;var g=this.zoomWindow,k=this.zoomContent,n=f(this.zoomBoundingBox),p=n.outerWidth(),r=n.outerHeight(),t=g.offset();g.position();n=n[0]!==window?n.offset():{left:n.scrollLeft(),top:n.scrollTop()};g.css({width:p,height:r});p=n.left-t.left;t=n.top-t.top;p&&(p+=parseFloat(g.css("marginLeft")),g.css("marginLeft",p),k.marginLeft=p);t&&(t+=parseFloat(g.css("marginTop")),g.css("marginTop",t),k.marginTop=t);g="";t=this._zoomOffset.dx/d;p=this._zoomOffset.dy/d;f.wowBook.support.transform&&
(t||p)?g=f.wowBook.utils.translate(t,p):k.css({left:t,top:p});c?(e/=d,g+=this.opts.useScale3d?"scale3d("+e+","+e+",1)":"scale("+e+")"):(this._cssZoom=e,k.css("zoom",e),k.css("marginLeft",-k.marginLeft/d),k.css("marginTop",-k.marginTop/d));f.wowBook.support.transform&&k.css("transform",g);1!==this.zoomLevel?this.zoomed||(k.css("marginLeft",-k.marginLeft/d),k.css("marginTop",-k.marginTop/d),c&&k.css("transformOrigin","0 0"),this.elem.find("img").each(function(){var u=f(this);u.data("wowbook-draggable-before-zoom",
u.attr("draggable"));u.attr("draggable",!1)})):this.zoomFinished();this.zoomed=1!==a;k.toggleClass("wowbook-draggable",this.zoomed);this.toggleControl("zoomIn",this.zoomLevel==this.zoomMax);this.toggleControl("zoomOut",this.zoomLevel==this.zoomMin);this.toggleControl("zoomReset",1==this.zoomLevel)},zoom:function(a,b,c){this.uncurl(!0);for(var d=0,e=this.pages.length;d<e;d++)if(this.pages[d].data("holdedAt"))return;f.isPlainObject(b)&&(c=b,b=c.duration);c||(c={});if(a<=this.zoomMin&&!c.resetting)return this.zoomReset(b,
c);a>this.zoomMax&&(a=this.zoomMax);if(a!==this.zoomLevel||c.force)if(void 0==b&&(b=this.opts.zoomDuration),0==b){if(this._zoom(a,c),c.callback&&c.callback.apply(this),this.pdf&&this.pdfUpdateRender(),this.onZoom)this.onZoom(this)}else{d=!this.opts.zoomUsingTransform&&f.wowBook.support.transform;this._zoomAnimating&&(f(this).stop(),d&&this.zoomContent.css("transform",""));this._zoomAnimating=this.zoomLevel;var g=this;e=c.x;var k=c.y;void 0==e&&(e=this.pageWidth*(this._singlePage?1:2)*this.currentScale*
this.opts.zoomFocusX);void 0==k&&(k=this.pageHeight*this.currentScale*this.opts.zoomFocusY);var n={x:e,y:k,offset:{dx:0,dy:0}},p=f.extend({dx:0,dy:0},this._zoomOffset);e=c.offset||this.zoomFocusOffset(a,e,k);var r=e.dx-p.dx,t=e.dy-p.dy;d&&(n.transform=!0,this._isMobile&&(this.leftPage()&&this.leftPage().css("-webkit-transform","translateZ(0)"),this.rightPage()&&this.rightPage().css("-webkit-transform","translateZ(0)")));f(this).animate({_zoomAnimating:a},{duration:b,easing:c.easing||this.opts.zoomEasing,
complete:function(){g._zoomAnimating=!1;g._zoom(a);c.callback&&c.callback.apply(this);this.pdf&&this.pdfUpdateRender();if(g.onZoom)g.onZoom(g)},step:function(u,A){n.offset.dx=p.dx+r*A.pos;n.offset.dy=p.dy+t*A.pos;g._zoom(u,n)}})}},zoomFinished:function(){this.zoomWindow.css({overflow:"visible",width:this.zoomContent.width()*this.currentScale,height:this.zoomContent.height()*this.currentScale,marginLeft:0,marginTop:0});this.zoomContent.css({left:0,top:0,marginLeft:0,marginTop:0});this._zoomOffset=
{dx:0,dy:0};this.elem.find("img").each(function(){var a=f(this);void 0==a.data("wowbook-draggable-before-zoom")?a.removeAttr("draggable"):a.attr("draggable",a.data("wowbook-draggable-before-zoom"))})},zoomReset:function(a,b){f.isPlainObject(a)&&(b=a,a=b.duration);b||(b={});this._zoomDataRAF=null;b.offset={dx:0,dy:0};b.resetting=!0;b.force=!0;b.callback=function(){this.zoomContent.css({left:0,top:0});this.zoomed=!1};this.zoom(1,a,b)},zoomIn:function(a,b){f.isPlainObject(a)&&(b=a,a=void 0);this.zoom(this.zoomLevel+
(a||this.zoomStep),b)},zoomOut:function(a,b){f.isPlainObject(a)&&(b=a,a=void 0);this.zoom(this.zoomLevel-(a||this.zoomStep),b)},zoomFocusOffset:function(a,b,c,d,e){d||(d=this._zoomOffset||{dx:0,dy:0});d=f.extend({dx:0,dy:0},d);var g=d.dx||0,k=d.dy||0;e=a/(e||this.zoomLevel);b-=g;c-=k;a=b*e;e*=c;d.dx=g-(a-b);d.dy=k-(e-c);return{dx:g-(a-b),dy:k-(e-c)}},zoomTouchSupport:function(){if(this.opts.touchEnabled){if(f.browser.ie8mode||f.browser.ie7)return this.zoomDragSupportForIE();var a=this,b,c,d;a._hammer=
new Hammer(a.zoomContent[0],a.opts.touch);var e=a._hammer;e.on("panstart pinchstart",function(g){a.zoomContent.addClass("wowbook-dragging")});e.on("hammer.input",function(g){if(a.zoomContent.hasClass("wowbook-draggable")&&(f(g.target).is("img")&&"mousedown"==g.srcEvent.type&&g.preventDefault(),g.isFinal&&a.zoomContent.hasClass("wowbook-dragging"))){c=d=null;a.zoomContent.removeClass("wowbook-dragging");g=a.zoomLevel;var k=a._zoomDataRAF,n=k?k.level:g;n<a.zoomMin||n==a.zoomMin&&(a._zoomOffset.dx||
a._zoomOffset.dy)?k?k.callback=function(){a.zoomReset()}:a.zoomReset():(a._zoom(g,{force:!0,offset:a._zoomOffset}),a.pdf&&a.pdfUpdateRender())}});e.on("panstart panmove",function(g){a.zoomed&&(g.preventDefault(),d=null,c||(c={offset:f.extend({},a._zoomOffset),pageX:g.center.x,pageY:g.center.y}),a._zoomDataRAF={level:a.zoomLevel,options:{force:!0,offset:{dx:c.offset.dx+(g.center.x-c.pageX),dy:c.offset.dy+(g.center.y-c.pageY)}}})});e.on("pinchmove pinchstart",function(g){g.preventDefault();c=null;var k=
g.center.x,n=g.center.y;if(!d){if(a.currentFlip&&!a.currentFlip.finished)return;b=a.elem.offset();d={level:a.zoomLevel,pageX:k,pageY:n,x:k-(b.left-f(window).scrollLeft()),y:n-(b.top-f(window).scrollTop()),offset:f.extend({},a._zoomOffset),useTransform:a.opts.zoomUsingTransform}}g=d.level*g.scale;g>a.zoomMax&&(g=a.zoomMax);var p=a.zoomFocusOffset(g,d.x,d.y,d.offset,d.level);p.dx+=k-d.pageX;p.dy+=n-d.pageY;a._zoomDataRAF={level:g,options:{force:!0,offset:p}}});a.opts.pinchToZoom&&(e.get("pinch").set({enable:!0}),
e.get("pinch").recognizeWith("pan"));this.opts.doubleClickToZoom&&(e.get("doubletap").set({posThreshold:50}),e.on("doubletap",function(g){g.preventDefault();var k=a.elem.offset(),n=g.center.x-k.left;g=g.center.y-k.top;a.zoomed?a.zoomReset():a.zoomIn(1,{x:n,y:g})}))}},zoomDragSupportForIE:function(){var a=this,b,c=function(e){a._zoomDataRAF={level:a.zoomLevel,options:{force:!0,offset:{dx:b.offset.dx+(e.pageX-b.pageX),dy:b.offset.dy+(e.pageY-b.pageY)}}};return!1},d=function(e){e=a.zoomLevel;(e<a.zoomMin||
e==a.zoomMin&&(a._zoomOffset.dx||a._zoomOffset.dy))&&a.zoomReset();f(document).unbind("mousemove.wowbook",c);f(document).unbind("mouseup.wowbook",d)};a.zoomContent.bind("mousedown.wowbook",function(e){if(a.zoomed)return b={offset:f.extend({},a._zoomOffset),pageX:e.pageX,pageY:e.pageY},f(document).bind("mousemove.wowbook",c).bind("mouseup.wowbook",d),!1})},detectBestZoomMethod:function(a,b,c){if(void 0!=this.opts.zoomUsingTransform)return this.opts.zoomUsingTransform?"transform":"zoom";void 0===a&&
(a=f.wowBook.support.transform);void 0===c&&(c=f.browser.ie8mode);a=f.browser.chrome||f.browser.webkit||f.browser.safari||f.browser.opera||c||!a;this.opts.zoomUsingTransform=!a;return a?"zoom":"transform"},setupFullscreen:function(){if(I){var a=this,b="fullscreenerror mozfullscreenerror webkitfullscreenerror MSFullscreenError ";var c="fullscreenchange mozfullscreenchange webkitfullscreenchange MSFullscreenChange ".replace(/ /g,".wowbook ");b=b.replace(/ /g,".wowbook ");this._fullscreenChangeHandler=
function(){var d=!!P();f(a.opts.fullscreenElement).toggleClass("fullscreen wowbook-fullscreen-fix",d);a.elem.toggleClass("fullscreen",d);a.toggleControl("fullscreen",d);a.elem.trigger("resize")};f(document).on(c,this._fullscreenChangeHandler);this._fullscreenErrorHandler=function(){var d;a.opts.onFullscreenError&&(d=a.opts.onFullscreenError.apply(this,arguments));!1!==d&&("string"==typeof d?alert(d):a.opts.onFullscreenErrorMessage&&alert(a.opts.onFullscreenErrorMessage))};f(document).on(b,this._fullscreenErrorHandler)}else f("html").addClass("no-fullscreen")},
enterFullscreen:function(a){a=f(a||this.opts.fullscreenElement)[0];I.call(a||M)},exitFullscreen:function(){O.call(C)},toggleFullscreen:function(){P()?this.exitFullscreen():this.enterFullscreen()},positionBookShadow:function(){var a=this.pages.length,b=!(!this.opts.bookShadow||!a||3>a&&this.holdedPage);this.bookShadow.toggle(b);if(b){b=this.pageWidth;var c=this.holdedPageBack,d=!!c&&c.onRight&&c.pageIndex==(this.rtl?a-1:0);c=!!c&&c.onLeft&&c.pageIndex==(this.rtl?0:a-1);a=!this.leftPage()||d;c=!this.rightPage()||
c;d=a!=c;if(a&&c)this.bookShadow.hide();else{c=this.opts.zoomUsingTransform?this.currentScale*this.zoomLevel:1;var e=this.elem.is(":visible")?this.pagesContainer.position().left:parseFloat(this.pagesContainer.css("left"))||0;this.translate(this.bookShadow,(a?b:0)+e/c,0);this.bookShadow.css({width:d?b:2*b})}}},playFlipSound:function(){if(this.flipSound){var a=this.opts.onPlayFlipSound;f.isFunction(a)&&!1===a(this)||(this.audio||(this.audio=this.createAudioPlayer()),this.audio&&this.audio.play&&this.audio.play())}},
toggleFlipSound:function(a){arguments.length||(a=!this.flipSound);this.flipSound=a;this.toggleControl("flipSound",!a)},createAudioPlayer:function(a,b){a||(a=this.opts.flipSoundPath);b||(b=this.opts.flipSoundFile);for(var c=[],d=0,e=b.length;d<e;d++)c.push('<source src="'+a+b[d]+'">');return f("<audio preload>"+c.join("")+"</audio>")[0]},_untouch:function(a){return a.originalEvent.touches&&a.originalEvent.touches[0]||a},touchSupport:function(){var a=this;a.elem.bind("touchstart.wowbook",function(b){var c=
b.originalEvent.touches;1<c.length||(a._touchStarted={x:c[0].pageX,y:c[0].pageY,timestamp:b.originalEvent.timeStamp,inHandle:f(b.target).hasClass("wowbook-handle")},a._touchStarted.inHandle&&a.pageEdgeDragStart(a._untouch(b)))});f(document).on("touchmove.wowbook",function(b){if(a._touchStarted){var c=b.originalEvent.touches;a._touchEnded={x:c[0].pageX,y:c[0].pageY,timestamp:b.originalEvent.timeStamp};if(a._touchStarted.inHandle)return a.pageEdgeDrag(a._untouch(b));a.opts.allowDragBrowserPageZoom&&
1!=document.documentElement.clientWidth/window.innerWidth||b.preventDefault()}});f(document).on("touchend.wowbook touchcancel.wowbook",function(b){if(a._touchStarted){!a._touchEnded&&f(b.target).hasClass("wowbook-handle")&&(b=f(b.target).data("corner"),"r"===b&&a.gotoRight(),"l"===b&&a.gotoLeft());b=a._touchStarted;var c=a._touchEnded||a._touchStarted;a._touchStarted=null;a._touchEnded=null;if(!a.zoomed){if(b.inHandle)return a.pageEdgeDragStop({pageX:c.x}),!1;var d=c.x-b.x,e=c.timestamp-b.timestamp;
if(!(20>Math.abs(d)||e>a.opts.swipeDuration)&&Math.abs(d)>Math.abs(c.y-b.y))return 0>d?a.gotoRight():a.gotoLeft(),!1}}})},pageEdgeDragStart:function(a){if(!this.zoomed){if(this.animating&&!this.curledPage||!f(a.target).hasClass("wowbook-handle"))return!1;var b=this,c=b.origin.offset();this.opts.zoomUsingTransform||(c.left*=this.currentScale);b.elem.addClass("wowbook-unselectable");b.mouseDownAtLeft=(a.pageX-c.left)/this.currentScale<b.pageWidth;b.pageGrabbed=b.mouseDownAtLeft?b.leftPage():b.rightPage();
if(!b.pageGrabbed)return!1;this.uncurl(!0);b.pageGrabbedOffset=b.pageGrabbed.offset();b._dragging=!0;this.opts.zoomUsingTransform&&(b.pageGrabbedOffset.left/=this.currentScale,b.pageGrabbedOffset.top/=this.currentScale);c=a.pageX/this.currentScale-this.pageGrabbedOffset.left;a=a.pageY/this.currentScale-this.pageGrabbedOffset.top;this.stopAnimation(!1);var d=b.mouseDownAtLeft?"l":"r";this.holdPage(this.pageGrabbed,c,a);this.flip(c,a,this.pageGrabbed,{corner:d});f(document).bind("mousemove.wowbook",
function(e){return b.pageEdgeDrag(e)}).bind("mouseup.wowbook",function(e){return b.pageEdgeDragStop(e)});return!1}},pageEdgeDrag:function(a){if(!this._dragging)return!1;var b=a.pageX/this.currentScale-this.pageGrabbedOffset.left;a=a.pageY/this.currentScale-this.pageGrabbedOffset.top;var c=this.mouseDownAtLeft?"l":"r";this.stopAnimation(!1);this.flip(b,a,this.pageGrabbed,{corner:c,dragging:!0});return!1},pageEdgeDragStop:function(a){if(!this._dragging)return!1;var b=this.origin.offset();this.opts.zoomUsingTransform||
(b.left*=this.currentScale);var c=(a.pageX-b.left)/this.currentScale;a=(a.pageX-b.left)/this.currentScale<this.pageWidth;this.elem.removeClass("wowbook-unselectable");this._cantStopAnimation||this.stopAnimation(!1);this._singlePage?this.pageGrabbed.onLeft?c>this.pageWidth/2?this.pageGrabbed.pageIndex==this.currentPage?this.rtl?this.advance():this.back():(c=this.pageGrabbed.pageIndex+(this.rtl?1:-1),this.gotoPage(c)):this.releasePage(this.pageGrabbed,!0):c<this.pageWidth+this.pageWidth/2?this.pageGrabbed.pageIndex==
this.currentPage?this.rtl?this.back():this.advance():(c=this.pageGrabbed.pageIndex+(this.rtl?-1:1),this.gotoPage(c)):this.releasePage(this.pageGrabbed,!0):this.mouseDownAtLeft&&!a?this.rtl?this.advance():this.back():!this.mouseDownAtLeft&&a?this.rtl?this.back():this.advance():this.releasePage(this.pageGrabbed,!0);this._dragging=!1;f(document).unbind("mousemove.wowbook mouseup.wowbook")},curl:function(a,b){if(!(this.curledPage||this.holdedPage||this.zoomed)){void 0==a&&(a=this.currentPage);if("number"==
typeof a||"string"==typeof a)a=this.pages[+a];if(a&&!a.isCurled){a.isCurled=!0;this.curledPage=a;var c=this.pageIsOnTheLeft(a.pageIndex),d=c?0:a.pageWidth||this.pageWidth,e=b?(a.pageHeight||this.pageHeight)-1:2;this.flip({from:[d,e],to:[d+this.opts.curlSize*(c?1:-1),e+this.opts.curlSize*(b?-1:1)],corner:(b?"b":"t")+(c?"l":"r"),page:a,duration:400})}}},uncurl:function(a,b){if(this.curledPage){1==a&&(b=!0,a=void 0);void 0==a&&(a=this.curledPage||this.currentPage);if("number"==typeof a||"string"==typeof a)a=
this.pages[+a];a.isCurled&&(this.stopAnimation(!1),this.releasePage(a,!b,void 0,400),a.isCurled=!1,this.curledPage=null)}},initThumbnails:function(){var a=this.opts;this.thumbnails=[];var b=this.thumbnailsContainer=f("<div class='wowbook-thumbnails'>").append("<div class='wowbook-wrapper'><a class='wowbook-back wowbook-button wowbook-control wowbook-control-back'></a><div class='wowbook-clipper'><ul></ul></div><a class='wowbook-next wowbook-button wowbook-control wowbook-control-next'></a></div>").css("display",
"none").css("transform","translateZ(0)").appendTo(f(a.thumbnailsParent));this.thumbnailsList=b.find("ul");this.thumbnailsClipper=b.find(".wowbook-clipper");a.thumbnailsContainerWidth&&b.width(a.thumbnailsContainerWidth);a.thumbnailsContainerHeight&&b.height(a.thumbnailsContainerHeight);var c=a.thumbnailsPosition;if("left"==c||"right"==c)a.thumbnailsVertical=!0,"right"==c&&b.css({position:"absolute",left:"auto",right:"0px"});if("top"==c||"bottom"==c)a.thumbnailsVertical=!1,"bottom"==c&&b.css({position:"absolute",
top:"auto",bottom:"0px"});b.addClass(a.thumbnailsVertical?"wowbook-vertical":"wowbook-horizontal");b.toggleClass("wowbook-closable",this.closable);var d=this,e=a.thumbnailsVertical?"height":"width";this.thumbnailsBackButton=b.find(".wowbook-back.wowbook-button").on("click",function(){d._moveThumbnailsList(d.thumbnailsClipper[e]())});this.thumbnailsNextButton=b.find(".wowbook-next.wowbook-button").on("click",function(){d._moveThumbnailsList(-d.thumbnailsClipper[e]())});this.thumbnailsClipper.css("transform",
"translateZ(0)");0==this.scrollBarWidth()&&this.thumbnailsClipper.css("overflow","auto");this._scrollDebounceTimeout=null;this.thumbnailsClipper.on("scroll",function(){d._scrollDebounceTimeout&&clearTimeout(d._scrollDebounceTimeout);d._scrollDebounceTimeout=setTimeout(function(){d.updateVisibleThumbnails()},d.opts.thumbnailsScrollDebounceWait)})},destroyThumbnails:function(){this._scrollDebounceTimeout&&clearTimeout(this._scrollDebounceTimeout);this.thumbnailsContainer&&this.thumbnailsContainer.remove();
this.thumbnails=this._thumbnailsPos=this.thumbnailsContainer=null},scrollBarWidth:function(){var a=f("<div style='width:50px;height:60px;overflow-y:auto;display:inline-block;position: absolute;left:-1000px;'></div>").appendTo("body"),b=a.width(),c=f("<div style='width:100%;height:100px;display:inline-block;'>Hi!<br/>He<br/>llo!</div>").appendTo(a).width();a.remove();return b-c},createThumbnails:function(){this.thumbnails||this.initThumbnails();var a=this.thumbnailConfig();this.thumbnails=[];this._customThumbnail=
!1;for(var b=0,c=this.pages.length;b<c;b++){var d=this.createThumbnail(b,a);d.src&&(this._customThumbnail=!0);this.thumbnailsList.append(d);this.thumbnails.push(d)}if(this.rtl)for(d=this.thumbnailsList.children(),d.eq(0).addClass("wowbook-right").removeClass("wowbook-left"),b=1,c=d.length;b<c;b+=2)d.eq(b).insertAfter(d.eq(b+1));this._setThumbnailsContainerWidth();this.setStyle(this.opts.styles||this.opts.style)},_setThumbnailsContainerWidth:function(){var a=this.thumbnailsContainer;this.opts.thumbnailsContainerHeight&&
a.height(this.opts.thumbnailsContainerHeight);if(this.opts.thumbnailsContainerWidth)a.width(this.opts.thumbnailsContainerWidth);else if(this.opts.thumbnailsVertical){var b=this.thumbnailConfig();a.width(2*b.width)}},thumbnailConfig:function(){var a={},b=f('<div class="wowbook-thumbnail" style="display:none;position:absolute;line-height:0px;font-size:0px;">').prependTo(this.thumbnailsContainer),c=this.opts.thumbnailHeight||(2>=b.height()?0:b.height()),d=this.opts.thumbnailWidth||b.width(),e=d/this.pageWidth||
c/this.pageHeight||this.opts.thumbnailScale;b.remove();this.thumbnailScale=e;a.width=d||Math.floor(this.pageWidth*e);a.height=c||Math.floor(this.pageHeight*e);a.cloneCSS={display:"block",left:0,top:0,position:"relative",transformOrigin:"0 0"};f.wowBook.support.transform?a.cloneCSS.transform="scale("+e+")":a.cloneCSS.zoom=e;this.differentPageSizes&&(b=this.opts.pageWidth?e*this.pageWidth/this.opts.pageWidth:this.opts.pageHeight?e*this.pageHeight/this.opts.pageHeight:this.opts.thumbnailScale,a.scaleInternalPage=
f.wowBook.support.transform?{transform:"scale("+b+")"}:{zoom:b});return a},createThumbnail:function(a,b){var c=this.pages[a];if(c){b||(b=this.thumbnailConfig());var d=f('<li class="wowbook-thumbnail"><div class="wowbook-overlay">').addClass(this.pageIsOnTheLeft(a)?"wowbook-left":"wowbook-right").css({width:b.width,height:b.height});if(this.opts.thumbnailNumber||this.opts.thumbnailsNumber){var e=this.opts.onThumbnailNumberString?this.opts.onThumbnailNumberString(this,c,a):a+1;d.find(".wowbook-overlay").append('<div class="wowbook-thumbnail-number">'+
e+"</div>")}e=c.find(".wowbook-page-content");(e=e.data("thumb")||e.data("thumbnail"))?(d.addClass("wowbook-thumbnail-custom"),d.src=e):this.opts.thumbnailsSprite?d.css("background",'url("'+this.opts.thumbnailsSprite+'") no-repeat 0px -'+a*b.height+"px"):this.opts.thumbnailsImages?d.addClass("wowbook-thumbnail-custom"):(e=c.clone(),e.hasClass("wowbook-page-holded")&&(this.resetPage(e),e.find(".wowbook-fold-gradient-container").remove()),e.css(b.cloneCSS),b.scaleInternalPage&&!c.isCover&&e.css(b.scaleInternalPage),
d.prepend(e));var g=this;d.on("click",function(){g.gotoPage(a);g.opts.thumbnailsHideOnClick&&g.hideThumbnails()});return d}},updateThumbnail:function(a,b){if(this.thumbnails){var c=this.thumbnails[a];if(c){var d=this.createThumbnail(a,b);if(d){c.width(d.width());c.height(d.height());if(!this.opts.thumbnailsSprite)if(this.opts.thumbnailsImages||c.src){var e=c.src||this.thumbnailImageSrc(a);if(c.loadedImage!=e){c.addClass("wowbook-loading");var g=new Image;g.onload=function(){c.removeClass("wowbook-loading");
c.css("background-image",'url("'+e+'")');c.loadedImage=e};g.src=e}}else this.pdfDoc?this.pdfRenderThumbnail(a,c,b):c.children(":not(.wowbook-overlay)").replaceWith(d.children(":not(.wowbook-overlay)"));c.width(d.width());c.height(d.height())}}}},updateThumbnails:function(){if(this.thumbnails){for(var a=this.thumbnailConfig(),b=0,c=this.pages.length;b<c;b++)this.updateThumbnail(b,a);this._setThumbnailsContainerWidth();this.thumbnailsContainer.toggleClass("wowbook-closable",this.closable)}else this.createThumbnails()},
thumbnailImageSrc:function(a){if(!(0>a||a>this.pages.length-1))return this.replaceNumberHolder(this.opts.thumbnailsImages,a)},_moveThumbnailsList:function(a,b){var c=this.thumbnailsList.position()[this.opts.thumbnailsVertical?"top":"left"];this._setThumbnailsListPosition(c+a,b)},_setThumbnailsListPosition:function(a,b){var c=this.opts.thumbnailsVertical,d=c?"height":"width",e=this.thumbnailsClipper[d]();d=-this.thumbnailsList[d]()+e;a<d&&(a=d);0<a&&(a=0);this.thumbnailsBackButton.toggleClass("wowbook-disabled",
0==a||0<d);this.thumbnailsNextButton.toggleClass("wowbook-disabled",a==d||0<d);void 0==b&&(b=f.extend({},this.opts.thumbnailsAnimOptions));var g=this;f.isNumeric(b)&&(b={duration:b});b.step=c?function(k){g.thumbnailsClipper.scrollTop(k)}:function(k){g.thumbnailsClipper.scrollLeft(k)};b.complete=function(){(g.pdfDoc||g.opts.thumbnailsImages||g._customThumbnail)&&g.updateVisibleThumbnails()};this._tb=this.thumbnailsClipper[c?"scrollTop":"scrollLeft"]();f(this).stop();f(this).animate({_tb:-a},b)},updateVisibleThumbnails:function(){if(this.thumbnails){var a=
this.opts.thumbnailsVertical,b=a?"top":"left",c=a?"height":"width";if(!this._thumbnailsPos)for(this._thumbnailsPos=[],a=0;a<this.thumbnails.length;a++)this._thumbnailsPos[a]=this.thumbnails[a].position()[b];var d=this._thumbnailsPos;b=-this.thumbnailsList.position()[b];c=b+this.thumbnailsClipper[c]();var e,g;for(a=0;a<this.thumbnails.length;a++)void 0==e&&d[a]>b&&(e=a),void 0==g&&d[a]>c&&(g=a);e||(e=0);g||(g=this.thumbnails.length-1);this.pdfDoc&&(this.pdfCancelRenderThumbnail(0,e),this.pdfCancelRenderThumbnail(g,
this.thumbnails.length));for(a=e-2;a<=g;a++)this.updateThumbnail(a)}},showThumbnail:function(a,b){if(this.thumbnails&&this.thumbnailsContainer.is(":visible")){void 0==a&&(a=this.currentPage);0<a&&this.pageIsOnTheRight(a)&&a--;var c=this.opts.thumbnailsVertical,d=c?"top":"left",e=c?"height":"width",g=this.thumbnails[a],k=this.thumbnailsClipper;c=k[e]()/2-g[e]()/(c?2:1);d=g.offset()[d]-k.offset()[d];this._moveThumbnailsList(c-d,b)}},showThumbnails:function(a){this.thumbnails&&this.thumbnails.length||
this.createThumbnails();this.thumbnailsContainer.fadeIn(void 0!=a?a:this.opts.thumbnailsAnimOptions);this.showThumbnail(void 0,0)},hideThumbnails:function(a){this.thumbnailsContainer.fadeOut(void 0!=a?a:this.opts.thumbnailsAnimOptions)},toggleThumbnails:function(a){f(this.thumbnailsContainer).is(":visible")?this.hideThumbnails(a):this.showThumbnails(a)},setPDF:function(a){this.pdf=a;this.pdfRenderQueue=[];this.pdfPageRendering=!1;this.opts.zoomUsingTransform=!0;this.zoomContent.css("zoom",1);1!=this.currentScale&&
this.scale(this.currentScale);this.elem.addClass("wowbook-pdf");this.removePages();null==this.opts.pagesInMemory&&(this.opts.pagesInMemory=6);var b=this;this.pdfCSS_UNITS=96/72;b.opts.pdfTextSelectable&&this.zoomContent.css("-webkit-user-select","text");PDFJS.cMapPacked=this.opts.pdfcMapPacked;PDFJS.cMapUrl=this.opts.pdfcMapUrl;PDFJS.getDocument(a,null,null,this.opts.onPDFLoadProgress).then(function(c){b.pdfDoc=c;b.currentPage=b.startPage;c.getPage(1).then(function(d){for(var e=0;e<c.numPages;e++)b.insertPage("<div>",
!0);b.opts.pdfFind&&b.pdfFindSetup();b.pdfBuildLinkService();b._pdfFindController&&b._pdfFindController.resolveFirstPage();b.opts.toc||b.pdfOutline();b.updateBook(!0);d=d.getViewport(1*b.pdfCSS_UNITS*b.opts.pdfScale);b.pdfHeight=d.height;b.pdfWidth=d.width;b.pdfViewport=d;b._originalHeight=null;b._originalWidth=null;b.setDimensions(2*b.pdfWidth,b.pdfHeight);1!=b.opts.zoomLevel&&b.zoom(b.opts.zoomLevel,{duration:0})})},b.opts.onPDFLoadError||function(c){f(b.pages[0]||b.elem).html("Error: "+c.message);
"file:"==location.protocol&&(this.pdfLocalErrorMsg||(this.pdfLocalErrorMsg="<p>Note: error messages about the browser not being able to fecth the PDF file usually happens when you are trying to open the html file directly from the local file system.<br/>To load the pdf file, PDFjs (the library used by Wowbook) uses ajax requests, and the browser can't do ajax requests to the local filesystem. Browsers blocks them for security reasons. You must use a local webserver or you can try to run your browser using a configuration option to allow this behaviour. (something like https://stackoverflow.com/questions/38344612/ajax-request-to-local-file-system-not-working-in-chrome/38344639#38344639 ).</p>"),
f(b.pages[0]||b.elem).append(this.pdfLocalErrorMsg));console&&console.log&&console.log(c)})},pdfBuildLinkService:function(){var a=this;this.pdfLinkService={navigateTo:function(){a.pdfNavigateTo.apply(a,arguments)},getDestinationHash:function(b){return this.getAnchorUrl("")},getAnchorUrl:function(b){return b}};return this._pdfLinkService},pdfResetPages:function(){this.updateBook(!0);for(var a=0;a<this.pages.length;a++)this.unloadPage(this.pages[a]);a=this.opts.pdfUpdateRender;this.opts.pdfUpdateRender=
!1;this._reponsiveApplied?this.elem.trigger("resize"):this.opts.scaleToFit&&this.scaleToFit();this.showPage(this.currentPage);this.opts.pdfUpdateRender=a;this.positionBookShadow()},pdfLoadPage:function(a,b){var c=f("<canvas>");this.opts.pdfProgressiveRender&&c.appendTo(this.pages[a].find(".wowbook-page-content"));this.pdfRenderPage(a,c[0],this.finishPageLoading)},pdfRenderPage:function(a,b,c,d,e){if(this.pdfPageRendering)this.pdfQueueRenderPage(a,b,c,d,e);else{this.pdfPageRendering=!0;var g=this;
this.pdfDoc.getPage(a+1).then(function(k){d||(d=g.pdfFindScaleToFit());var n=k.getViewport(d*g.pdfCSS_UNITS*g.opts.pdfScale),p=g.pages[a],r=!1,t=!1;if(g.opts.pdfUpdateRender&&"thumb"!=e){var u=g.currentScale*g.zoomLevel*g.opts.pdfPixelRatio;n=p.pageWidth*u;g.opts.pdfRoundWidth&&.5<=n%1&&(n=Math.round(n));var A=k.getViewport(1);n=k.getViewport(n/A.width);b?f(b).addClass("wowbook-pdf-zoom-"+u).css({transform:"scale("+1/u+")","transform-origin":"0 0 0"}):(b=p.find(".wowbook-pdf-zoom-"+u),t=b.length,
b.length||(b=f("<canvas>").addClass("wowbook-pdf-zoom-"+u),b.css({transform:"scale("+1/u+")","transform-origin":"0 0 0"}),r=!0),b=b[0])}t||(b.height=Math.ceil(n.height),b.width=Math.ceil(n.width));u={canvasContext:b.getContext("2d"),viewport:n};n=function(){r&&!f(b).parent().length&&f(b).appendTo(p.find(".wowbook-page-content"));c&&c.call(g,g.pages[a],b);if("thumb"!=e){p.find("canvas").not(b).remove();var D=k.getViewport(1*g.pdfCSS_UNITS*g.opts.pdfScale);D=k.getViewport(g.pdfWidth/D.width*g.pdfCSS_UNITS*
g.opts.pdfScale);if(!p.find(".wowbook-pdf-annotations").length){var F=f('<div class="wowbook-pdf-annotations">').appendTo(p.find(".wowbook-page-content"));g.pdfAnnotations(k,D,F)}g.opts.pdfTextSelectable&&!p.textLayer&&"thumb"!=e&&g.pdfTextLayer(k,a,D)}g.pdfPageRendering=!1;g.pdfDequeueRenderPage()};t?n():k.render(u).then(n,function(){})})}},pdfUpdateRender:function(a){if(this.opts.pdfUpdateRender){var b=this.pages[this.currentPage],c=this.otherPage(this.currentPage);b&&this.pdfRenderPage(b.pageIndex,
void 0,a);void 0!=c&&this.pdfRenderPage(c,void 0,a)}},pdfAnnotations:function(a,b,c){var d=this;a.getAnnotations().then(function(e){b=b.clone({dontFlip:!0});PDFJS.AnnotationLayer.render({viewport:b,div:c[0],annotations:e,page:a,linkService:d.pdfLinkService});c.find("a").attr("target","_blank")})},pdfTextLayer:function(a,b,c,d){if(!d){var e=this.pages[b];d=e.find(".wowbook-pdf-text");d.length||(d=f('<div class="wowbook-pdf-text">').appendTo(e.find(".wowbook-page-content")))}var g=new PDFJS.TextLayerBuilder({textLayerDiv:d[0],
pageIndex:b,viewport:c,findController:this._pdfFindController});e.textLayer=g;a.getTextContent({normalizeWhitespace:!0}).then(function(k){g.setTextContent(k);g.render(PDFJS.TextLayerBuilder.TEXT_LAYER_RENDER_DELAY)})},pdfNavigateTo:function(a){var b=this;b.pagesRefMap||(b.pagesRefMap={});var c=function(d){var e=d instanceof Object?b.pagesRefMap[d.num+" "+d.gen+" R"]:d+1;e?b.gotoPage(e-1):b.pdfDoc.getPageIndex(d).then(function(g){b.pagesRefMap[d.num+" "+d.gen+" R"]=g+1;c(d)})};("string"==typeof a?
this.pdfDoc.getDestination(a):Promise.resolve(a)).then(function(d){d instanceof Array&&c(d[0])})},pdfRenderThumbnail:function(a,b,c){this.thumbnailsContainer.addClass("wowbook-pdf");if((c=this.pages[a])&&!c.loading&&!b.pdf&&!b.rendering){b.rendering=!0;var d=b.find("canvas");d.length||(d=f("<canvas>").appendTo(b.find(".wowbook-page-content")));d.css("transform","");this.opts.pdfProgressiveRender||d.css("display","none");b.find(".wowbook-page").css({width:b.width(),height:b.height(),zoom:1,transform:"scale(1)"});
this.pdfRenderPage(a,d[0],function(e,g){d.css("display","block");b.rendering=!1;b.pdf=!0;b.find(".wowbook-pdf-text, .wowbook-pdf-annotations").remove()},this.thumbnailScale*this.opts.pdfScale,"thumb")}},pdfCancelRenderThumbnail:function(a,b){for(var c=this.pdfRenderQueue,d=0;d<c.length;){var e=c[d][0];e>=a&&e<=b&&"thumb"==c[d][4]?(this.thumbnails[e].rendering=!1,c.splice(d,1)):d++}},pdfQueueRenderPage:function(a,b,c,d,e){this.pdfRenderQueue.push([].slice.call(arguments))},pdfDequeueRenderPage:function(){var a=
this.pdfRenderQueue.shift();a&&this.pdfRenderPage.apply(this,a)},pdfFindScaleToFit:function(){var a=this.pageWidth,b=this.pageHeight,c=this.pdfWidth/this.pdfHeight;b*c>a&&(b=a/c);return b/this.pdfHeight},pdfOutline:function(){var a=this;this.pdfDoc.getOutline().then(function(b){function c(d){for(var e=[],g=0,k=d.length;g<k;g++){var n=[];n[0]=PDFJS.removeNullCharacters(d[g].title);n[1]=d[g].url;d[g].items&&d[g].items.length&&(n[2]=c(d[g].items));n[3]=d[g].dest;e.push(n)}return e}b&&(a.opts.toc=c(b),
a.opts.displayToc&&a.showToc())})},pdfFindSetup:function(){this._pdfFindController||(this.opts.pdfTextSelectable=!0,this.createFindBar(),this.pdfCreateFindController(),this.setStrings())},pdfFind:function(){this.pdfSearch.apply(this,arguments)},pdfFindNext:function(){var a=Array.prototype.slice.call(arguments);a[3]=!1;a[4]="again";this.pdfSearch.apply(this,a)},pdfFindPrevious:function(){var a=Array.prototype.slice.call(arguments);a[3]=!0;a[4]="again";this.pdfSearch.apply(this,a)},createFindControl:function(a,
b){b||(b=this.opts);var c=this;f(a).addClass("wowbook-control-find").on("click.wowbook",function(d){if(!f(d.target).closest(".wowbook-findbar").length)return c.toggleFindBar(),!1})},toggleFindBar:function(a){a||(a=f(this._pdfFindBar));a.hasClass("wowbook-hidden")?(a.css("opacity",0).removeClass("wowbook-hidden"),J(a)||a.toggleClass("wowbook-up"),a.css("opacity",1),a.find(".wowbook-find-text").focus()):a.addClass("wowbook-hidden")},createFindBar:function(){var a=f('<div id="findbar" class="wowbook-findbar wowbook-hidden"><label style="display:none">Find: </label><div class="wowbook-find-text-container"><input class="wowbook-find-text" placeholder="Text to find"><span class="wowbook-find-count"></span></div><a title="Find the previous occurrence of the phrase" class="wowbook-find-previous wowbook-control-back"><i></i><span>Previous</span></a><a title="Find the next occurrence of the phrase" class="wowbook-find-next wowbook-control-next"><i></i><span>Next</span></a><label style="display:none"><input type="checkbox" class="wowbook-find-highlight-all" checked="1"> Highlight all</label><label><input type="checkbox" class="wowbook-find-match-case"> <span>Match case</span></label><a class="wowbook-close"><i></i></a></div>').appendTo(f(this.toolbars[0]).find(".wowbook-controls"));
this._pdfFindBar=a;this.setFindBarEventHandlers(a);this.pdfFindBarMethods(a);return a},setFindBarEventHandlers:function(a){var b=this,c=function(d){d=d.data||{};var e=a.find(".wowbook-find-text").val(),g=a.find(".wowbook-find-match-case").prop("checked"),k=a.find(".wowbook-find-highlight-all").prop("checked");b.pdfSearch(e,k,g,d.previous,d.next||d.previous?"again":"")};a.find(".wowbook-find-text").on("input",c);a.find(".wowbook-find-match-case, .wowbook-find-highlight-all").on("click",c);a.find(".wowbook-find-previous").on("click",
{previous:!0},c);a.find(".wowbook-find-next").on("click",{next:!0},c);a.find(".wowbook-close").on("click",function(){b.toggleFindBar(a)});a.find(".wowbook-find-count").on("click",function(){a.find(".wowbook-find-text").focus()})},createContainer:function(a){a=this.container=f("<div class='wowbook-container'>");var b=this.opts,c=f.wowBook.defaults;a.prependTo(this.elem.parent());this.containerBook=f("<div class='wowbook-book-container'>").appendTo(a).append(this.elem);this.containerToolbar=f("<div class='wowbook-toolbar-container'>").appendTo(a);
b.containerWidth&&a.css("width",b.containerWidth);b.containerHeight&&a.css("height",b.containerHeight);b.containerBackground&&a.css("background",b.containerBackground);b.containerPadding&&this.containerBook.css("padding",b.containerPadding);b.thumbnailsParent==c.thumbnailsParent&&(b.thumbnailsParent=a);b.tocParent==c.tocParent&&(b.tocParent=a);b.fullscreenElement==c.fullscreenElement&&(b.fullscreenElement=a);b.scaleToFit||(b.scaleToFit=this.containerBook);"window"!=b.container&&b.container!=window||
a.addClass("wowbook-container-full");b.toolbar&&(b.toolbarParent==c.toolbarParent&&(b.toolbarParent=this.containerToolbar),this._isMobile&&(b.toolbarPosition="bottom"));this._isMobile&&a.addClass("wowbook-mobile")},destroyContainer:function(){this.container&&(this.container.replaceWith(this.elem),this.container=void 0)},updateContainer:function(){var a=this.opts,b=0;this.opts.responsiveToolbar&&this.updateResponsiveToolbar();a.toolbarParent==this.containerToolbar&&((b="top"==a.toolbarPosition)&&!this.containerToolbar.is(".wowbook-top")&&
this.containerToolbar.insertBefore(this.containerBook),!b&&this.containerToolbar.is(".wowbook-top")&&this.containerToolbar.insertAfter(this.containerBook),this.containerToolbar.toggleClass("wowbook-top",b),b=f(this.toolbars[0]).outerHeight(!0));b=this.container.height()-b;this.containerBook.outerHeight(b);if(!a.conteinerHeight){this.elem.css("top",this.elem.css("top"));var c=this;setTimeout(function(){c.elem.css("top","")},0)}f.wowBook.support.transform||this.elem.css("top","auto");this.mobileToolbar&&
this.updateMobileToolbar()},lightbox:function(a){this._lightboxElem=f("<div class='wowbook-lightbox'>").appendTo("body").addClass(this.opts.lightboxClass);this._lightboxBookContainer=f("<div class='wowbook-book-container'>").appendTo(this._lightboxElem);this._lightboxOverlay=this.opts.lightboxOverlay?f("<div class='wowbook-lightbox-overlay'>").appendTo("body"):f();this.opts.thumbnailsParent=this._lightboxElem;this.opts.tocParent=this._lightboxElem;this.opts.fullscreenElement=this._lightboxElem;this.opts.lightboxResponsive&&
(this.opts.scaleToFit=this._lightboxBookContainer,this.responsive());this._isMobile&&this._lightboxElem.addClass("wowbook-mobile");this.opts.lightboxBackground&&this._lightboxElem.css("background",this.opts.lightboxBackground);this.opts.lightboxColor&&this._lightboxElem.css("backgroundColor",this.opts.lightboxColor);this.opts.lightboxOverlayColor&&this._lightboxOverlay.css("backgroundColor",this.opts.lightboxOverlayColor);this._lightboxElem.css({width:this.opts.lightboxWidth,height:this.opts.lightboxHeight});
this.elem.appendTo(this._lightboxBookContainer);this.opts.toolbar&&(this.opts.toolbarParent=this._lightboxElem,this._isMobile&&(this.opts.toolbarPosition="bottom"));var b=this;f(a).on("click.wowbook",function(){b.showLightbox()});f("<button class='wowbook-close'>\u2715</button>").appendTo(this._lightboxElem).on("click.wowbook",function(){b.hideLightbox()});f(document).on("keydown.wowbook.lightbox",function(c){b.lightboxOn&&(f(c.target).filter("input, textarea, select").length||27===c.which&&b.hideLightbox())})},
destroyLightbox:function(a){this.lightboxOn&&this.hideLightbox();f(this._lightboxElem).remove();f(this._lightboxOverlay).remove()},showLightbox:function(){this.thumbnailsContainer&&this.thumbnailsContainer.parent()[0]!=this._lightboxElem&&this.thumbnailsContainer.appendTo(this._lightboxElem);this.elem.parent()[0]!=this._lightboxBookContainer&&this.elem.appendTo(this._lightboxBookContainer);this.tocContainer&&this.tocContainer.parent()[0]!=this._lightboxElem&&this.tocContainer.appendTo(this._lightboxElem);
this.lightboxOn=!0;f("body").addClass("wowbook-lightbox-on");f.wowBook.utils.isIOS&&f("html").addClass("wowbook-lightbox-ios");this._lightboxElem.fadeIn();this.centerLightbox();this.setCurrentPageControlWidth();this._lightboxOverlay.fadeIn();this.positionBookShadow();this.opts.responsiveToolbar&&this.updateResponsiveToolbar();if(this.opts.toolbarParent==this._lightboxElem){var a=f(this.toolbars[0]).outerHeight(!0),b="top"==this.opts.toolbarPosition?"top":"bottom";this._lightboxBookContainer.css(b,
a);f(this.toolbars[0]).css(b,0)}this.opts.lightboxResponsive&&this.responsiveUpdater();this.mobileToolbar&&this.updateMobileToolbar();if(this.opts.onShowLightbox)this.opts.onShowLightbox(this,this.pages[this.currentPage],this.currentPage)},hideLightbox:function(){this.lightboxOn=!1;this._lightboxElem.fadeOut();this._lightboxOverlay.fadeOut();f("body").removeClass("wowbook-lightbox-on");f("body").removeClass("wowbook-lightbox-ios");P()&&this.exitFullscreen();if(this.opts.onHideLightbox)this.opts.onHideLightbox(this,
this.pages[this.currentPage],this.currentPage)},centerLightbox:function(){var a=f(window).width(),b=f(window).height();(f.browser.chrome||f.browser.webkit||f.browser.safari||f.browser.opera)&&window.innerHeight>b&&(b=window.innerHeight);this._lightboxElem.css("left",(a-this._lightboxElem.outerWidth())/2);this._lightboxElem.css("top",(b-this._lightboxElem.outerHeight())/2);this.opts.toolbarParent==this._lightboxElem&&(this.opts.responsiveToolbar&&this.updateResponsiveToolbar(),a=f(this.toolbars[0]).outerHeight(!0),
this._lightboxBookContainer.css("height",this._lightboxElem.outerHeight()-a))},setStyle:function(a){"string"==typeof a&&(this._customCSSClass=a);f.isPlainObject(a)&&(this._customCSSClass||(this._customCSSClass=this.generateCSSClassName()),a=this.generateCSSClass(a,this._customCSSClass),f("body").append("<style>"+a+"</style>"));a=this._customCSSClass;f(this.toolbars).addClass(a).find(".wowbook-controls").addClass(a).find(".wowbook-share-buttons").addClass(a);f(this.tocContainer).addClass(a);f(this.thumbnailsContainer).addClass(a);
f(this.thumbnailsContainer).find(".wowbook-control").addClass(a);f(this.elem).find(".wowbook-page-number").addClass(a);f(this._lightboxElem).find(".wowbook-close").addClass(a);f(this._navControls).addClass(a)},generateCSSClassName:function(){f.wowBook.utils._cssClassCounter=(f.wowBook.utils._cssClassCounter||0)+1;return"wowbook-cs-"+f.wowBook.utils._cssClassCounter},generateCSSClass:function(a,b){function c(g,k){var n=[];n.push(g+" {");for(var p in k)n.push("\t"+p+" : "+k[p]+" !important;");n.push("}");
n=n.join("\n");e.push(n);return n}function d(g,k,n){g[k]&&(c(n,g[k]),delete g[k])}if(!a||!b)return"";a=f.extend({},a);var e=[];a.hover&&c("."+b+" .wowbook-close:hover",{color:a.hover.color});d(a,"hover","."+b+" a:hover, ."+b+".wowbook-control:hover");d(a,"active","."+b+" a:active, ."+b+".wowbook-control:active");d(a,"disabled","."+b+" a.wowbook-disabled, ."+b+".wowbook-control.wowbook-disabled");a.separator&&(a.separator=a.separator.split(","),c("."+b+" a",{"border-color":a.separator[0],"box-shadow":"0 1px 0 "+
(a.separator[1]||"transparent")+" inset"}),delete a.separator);c("."+b+".wowbook-page-number",{background:"transparent"});a.pageNumber&&(c("."+b+".wowbook-page-number",{color:a.pageNumber}),delete a.pageNumber);c("."+b+" .wowbook-control",a);c("."+b+" .wowbook-control.remove-sticky-hover-style:hover",a);c("."+b,a);return e.join("\n")},controllify:function(a){var b=this,c=this.opts;f(a.zoomIn||a.zoomin).on("click.wowbook",function(){b.zoomIn({});return!1});f(a.zoomOut||a.zoomout).on("click.wowbook",
function(){b.zoomOut({});return!1});f(a.zoomReset||a.zoomreset).on("click.wowbook",function(){b.zoomReset({});return!1});f(a.next).on("click.wowbook",function(){b.advance();return!1});f(a.back).on("click.wowbook",function(){b.back();return!1});f(a.first).on("click.wowbook",function(){b.gotoPage(0);return!1});f(a.last).on("click.wowbook",function(){b.gotoPage(b.pages.length-1);return!1});f(a.left).on("click.wowbook",function(){b.gotoLeft();return!1});f(a.right).on("click.wowbook",function(){b.gotoRight();
return!1});f(a.lastLeft||a.lastleft).on("click.wowbook",function(){b.gotoLastLeft();return!1});f(a.lastRight||a.lastright).on("click.wowbook",function(){b.gotoLastRight();return!1});f(a.slideShow||a.slideshow).on("click.wowbook",function(){b.toggleSlideShow();return!1});f(a.flipSound||a.flipsound).on("click.wowbook",function(){b.toggleFlipSound();return!1});f(a.thumbnails).on("click.wowbook",function(){b.toggleThumbnails();return!1});f(a.fullscreen).on("click.wowbook",function(){b.toggleFullscreen();
return!1});f(a.toc).on("click.wowbook",function(){b.toggleToc();return!1});f(a.find).length&&this.createFindControl(f(a.find));f(a.fullscreen).length&&!I&&f(a.fullscreen).hide();var d=c.downloadURL||c.downloadurl||c.downloadUrl||(f.isPlainObject(c.pdf)?c.pdf.url:c.pdf);d&&f(a.download).attr("href",d).attr("download",d);(c=c.homeURL||c.homeurl||c.homeUrl)&&f(a.home).attr("href",c);f(a.share).length&&this.createShareControl(f(a.share));a.currentPage&&this.createCurrentPageControl(a.currentPage);c="zoomIn zoomOut zoomReset left lastLeft right lastRight next back first last slideShow flipSound thumbnails fullscreen toc currentPage download find home".split(" ");
for(var e=0,g=c.length;e<g;e++)d=c[e].toLowerCase(),this._controls[d]=f(this._controls[d]).add(a[c[e]]||a[d]);this.setStrings()},toggleControl:function(a,b){(a=this._controls[a.toLowerCase()])&&f(a).toggleClass("wowbook-disabled",b)},createNavigationControls:function(a){if(!this._isMobile||!this.opts.responsiveNavControls)if(a||(a=this.opts.navControls),"parent"===a&&(a=this.elem.parent()),!0===a&&(a=this.containerBook||this._lightboxBookContainer),a){"string"==typeof a&&(a=f(a));var b=f("<button class='wowbook-nav wowbook-nav-left wowbook-disabled'><i></i></button>").appendTo(a);
a=f("<button class='wowbook-nav wowbook-nav-right wowbook-disabled'><i></i></button>").appendTo(a);this.controllify({left:b,right:a});this._navControls=f(b).add(a);this.opts.toolbarIcons&&this._navControls.addClass("wowbook-"+this.opts.toolbarIcons)}},shareControlButtons:{twitter:['<a href="http://twitter.com/share" target="_blank"><i class="fa-twitter"></i></a>',{text:"text",via:"via",url:"url"}],googleplus:['<a href="https://plus.google.com/share" target="_blank" ><i class="fa-google-plus"></i></a>',
{url:"url"}],facebook:['<a href="http://www.facebook.com/sharer/sharer.php" target="_blank" ><i class="fa-facebook"></i></a>',{u:"url"}],stumbleupon:['<a href="http://www.stumbleupon.com/submit" target="_blank"><i class="fa fa-stumbleupon"></i></a>',{url:"url",title:"title"}],reddit:['<a href="http://reddit.com/submit" target="_blank"><i class="fa fa-reddit"></i></a>',{url:"url",title:"title"}],linkedin:['<a href="http://www.linkedin.com/shareArticle" target="_blank"><i class="fa fa-linkedin"></i></a>',
{url:"url",title:"title",summary:"summary",source:"source_url"}]},createShareControl:function(a,b){b||(b=this.opts);for(var c=f.extend({},this.shareControlButtons,b.shareButtons),d,e=b.share.split(/\s*,\s*|\s+/),g=f("<div class='wowbook-share-buttons wowbook-hidden'>"),k=0,n=e.length;k<n;k++)(d=c[e[k]])&&f(d[0]).appendTo(g).addClass("wowbook-control wowbook-share-button").data("params",d[1]);c=f(a).addClass("wowbook-control-share").append(g);var p=this;c.on("click",function(r){p.toggleShareButtons(r.target)});
c.on("click",".wowbook-share-button",function(){var r=p.opts.shareButtonCallback;if(!f.isFunction(r)||!1!==r(p,this)){r=f.extend({},f(this).data("params"));var t=f.extend(f.wowBook.defaults.shareParams,p.opts.shareParams);"_current_"==t.url&&(t.url=window.location.href);for(paramName in r){var u=r[paramName];void 0!=t[u]?r[paramName]=t[u]:delete r[paramName]}this.search=f.param(r);window.open(this.href,"_blank");p.toggleShareButtons(this);return!1}})},toggleShareButtons:function(a){a=f(a).closest(".wowbook-control-share");
a=a.find(".wowbook-share-buttons");a.hasClass("wowbook-hidden")?(a.css("opacity",0).removeClass("wowbook-hidden"),J(a)||a.toggleClass("wowbook-up"),a.css("opacity",1)):a.addClass("wowbook-hidden")},createCurrentPageControl:function(a){a=f(a);if(a.length){a.append("<input class='wowbook-input-page' /><span class='wowbook-current-page'></span>");var b=this,c=a.find(".wowbook-input-page"),d=a.find(".wowbook-current-page");c.hide();a.on("click.wowbook",function(){d.hide();c.show().focus()});c.on("keypress.wowbook",
function(e){var g="8,9,13,35,36,37,39".match(new RegExp(e.which));!e.which||49<=e.which&&57>=e.which||48==e.which&&f(this).val()||g||e.preventDefault()});c.on("focusin.wowbook",function(){var e=b.currentPage+1;f(this).val(e).data("value",e).select()});c.on("focusout.wowbook",function(){f(this).hide();d.show()});c.on("change.wowbook",function(){var e=f(this),g=e.data("value"),k=parseInt(this.value);1<=k&&k<=b.pages.length?b.gotoPage(k-1):e.val(g);e.hide();d.show()});this.setCurrentPageControlWidth(a)}},
updateCurrentPageControl:function(a){!a&&this._controls&&(a=this._controls.currentpage);if(a&&a.length){var b=this.currentPage+1;b+="/"+this.pages.length;a.find(".wowbook-current-page").text(b);b=a.find(".wowbook-input-page");b.outerHeight()&&b.css("top",(a.height()-b.outerHeight())/2)}},setCurrentPageControlWidth:function(a,b){a||(a=this._controls&&this._controls.currentpage);if(a&&a.length){2>arguments.length&&(b=this.opts.CurrentPageControlWidth);if(!b){var c=a.find(".wowbook-current-page"),d=
c.text(),e=(""+this.pages.length).replace(/./g,"0");c.css("width","auto");c.css("visibility","hidden").text(e+"/"+e);b=c.width();c.text(d).css("visibility","visible").css("width","100%");c=a.find(".wowbook-input-page");c.outerHeight()&&c.css("top",(a.height()-c.outerHeight())/2)}a.width(b)}},setStrings:function(a){function b(e,g){var k=a[e];void 0!=k&&c[g]&&c[g].attr("title",k)}a||(a=this.opts.strings||{});a.tocHeader&&(this.opts.tocHeader=a.tocHeader,this.tocContainer&&this.tocContainer.find("h1 > .wowbook-toc-header-text").text(a.tocHeader));
if(this._controls){var c=this._controls;b("findTooltip","find");if(this._pdfFindBar){var d=this._pdfFindBar;d.find(".wowbook-find-text").attr("placeholder",a.findInputPlaceHolder);d.find(".wowbook-find-previous").attr("title",a.findPreviousTooltip);d.find(".wowbook-find-next").attr("title",a.findNextTooltip);d.find(".wowbook-find-match-case").parent().find("span").text(a.findMatchCase)}b("lastLeftTooltip","lastLeft");b("leftTooltip","left");b("rightTooltip","right");b("lastRightTooltip","lastRight");
b("firstTooltip","first");b("backTooltip","back");b("nextTooltip","next");b("lastTooltip","last");b("zoominTooltip","zoomin");b("zoomoutTooltip","zoomout");b("slideshowTooltip","slideshow");b("flipsoundTooltip","flipsound");b("fullscreenTooltip","fullscreen");b("thumbnailsTooltip","thumbnails");b("tocTooltip","toc");b("downloadTooltip","download");b("shareTooltip","share");b("homeTooltip","home")}},toolbarControls:{_default:"<a href='#'><i></i></a>",lastLeft:"<a><i></i></a>",left:"<a><i></i></a>",
right:"<a><i></i></a>",lastRight:"<a><i></i></a>",first:"<a title='go to first page'><i></i></a>",back:"<a title='go back one page'><i></i></a>",next:"<a title='go foward one page'><i></i></a>",last:"<a title='go to last page'><i></i></a>",zoomin:"<a title='zoom in'><i></i></a>",zoomout:"<a title='zoom out'><i></i></a>",slideshow:"<a title='start slideshow'><i></i></a>",flipsound:"<a title='flip sound on/off'><i></i></a>",fullscreen:"<a title='fullscreen on/off'><i></i></a>",thumbnails:"<a title='thumbnails on/off'><i></i></a>",
toc:"<a title='table of contents on/off'><i></i></a>",download:"<a title='download'><i></i></a>",home:"<a title=''><i></i></a>",find:"<a title='find'><i></i></a>",share:"<a title='share'><i></i></a>",currentPage:"<span></span>"},createToolbar:function(a,b){if(a&&(b=f(b||this.opts.toolbarParent||this.elem.parent()))&&b.length){var c=f('<div class="wowbook-toolbar">'),d=f('<div class="wowbook-controls">').appendTo(c);this.opts.toolbarIcons&&c.addClass("wowbook-"+this.opts.toolbarIcons);a=a.trim().split(/\s*,\s*/);
for(var e={},g,k=0;k<a.length;k+=1)g=this.createToolbarControl(a[k]),e[a[k]]=g,d.append(g);this.opts.removeStickyHoverStyle&&(c.on("touchstart",".wowbook-control",function(){f(this).removeClass("remove-sticky-hover-style")}),c.on("touchend",".wowbook-control",function(){f(".remove-sticky-hover-style").removeClass("remove-sticky-hover-style");f(this).addClass("remove-sticky-hover-style")}));b.prepend(c);this.controllify(e);this.toolbars.push(c[0]);this.setStyle(this.opts.styles||this.opts.style);return c}},
destroyToolbars:function(){this.toolbars&&f(this.toolbars).remove();this.toolbars=null},createToolbarControl:function(a){this._avoidLoopControl||(this._avoidLoopControl={});var b=a;if(f.isPlainObject(a)){var c=a;a=f(this.toolbarControls._default);for(prop in c)if(jQuery.isFunction(a[prop]))a[prop](c[prop]);else a.attr(prop,c[prop])}if("string"==typeof a)if("<"==a.charAt(0))a=f(a);else{a=this.toolbarControls[a]||this.toolbarControls[a.toLowerCase()]||this.toolbarControls._default;if(this._avoidLoopControl[b])return"Error CreateToolbarControl in loop";
this._avoidLoopControl[b]=1;a=this.createToolbarControl(a);this._avoidLoopControl[b]=0;a=f(a).addClass("wowbook-control-"+b)}a.addClass("wowbook-control");return a},setupMobileToolbar:function(){this.opts.toolbarPosition="bottom";this.mobileToolbar=f(this.toolbars[0]);this.mobileToolbar.find(".wowbook-controls").css({position:"absolute",left:0});this.createMobileToolbarToggle();this.slideDownMobileToolbar(0);this.updateMobileToolbar()},toolbarIsExpandable:function(a){return 1.1*a.height()<a.find(".wowbook-controls").height()},
updateMobileToolbar:function(){this.mobileToolbarToggle.toggleClass("wowbook-collapsed",!this._mobileToolbarExpanded);this.mobileToolbarToggle.toggle(this.toolbarIsExpandable(this.mobileToolbar))},createMobileToolbarToggle:function(){this.mobileToolbarToggle=f("<a class='wowbook-control wowbook-control-toggle-toolbar'><i></i></a>").prependTo(this.mobileToolbar.find(".wowbook-controls"));var a=this;this.mobileToolbarToggle.on("click",function(){a.toogleMobileToolbar()});f(window).on("resize.wowbook",
function(){a.mobileToolbarToggle&&a.mobileToolbar&&a.updateMobileToolbar()})},slideUpMobileToolbar:function(a){var b=this.mobileToolbar.find(".wowbook-controls"),c=this.mobileToolbar.children().height()-this.mobileToolbar.height();b.css({bottom:-c}).animate({bottom:0},a);this._mobileToolbarExpanded=!0;this.updateMobileToolbar()},slideDownMobileToolbar:function(a){var b=this.mobileToolbar.find(".wowbook-controls"),c=this.mobileToolbar.children().height()-this.mobileToolbar.height();b.animate({bottom:-c},
{duration:a,complete:function(){f(this).css("bottom","")}});this._mobileToolbarExpanded=!1;this.updateMobileToolbar()},toogleMobileToolbar:function(){this._mobileToolbarExpanded?this.slideDownMobileToolbar():this.slideUpMobileToolbar()},setupResponsiveToolbar:function(){this.responsiveToolbar=f(this.toolbars[0]);this.createResponsiveToolbarToggle();this.updateResponsiveToolbar()},makeToolbarExpandable:function(a){this._responsiveToolbarExpandable||(this._responsiveToolbarExpandable=!0,this._originalToolbarPosition||
(this._originalToolbarPosition=this.opts.toolbarPosition),this.opts.toolbarPosition="bottom",this.responsiveToolbar.find(".wowbook-controls").css({position:"absolute",left:0}),this.container&&"hidden"!=this.container.css("overflow")&&(this.container.data("originalOverflow",this.container.css("overflow")),this.container.css("overflow","hidden")),this.slideDownResponsiveToolbar(0))},unmakeToolbarExpandable:function(){this._responsiveToolbarExpandable&&(this._responsiveToolbarExpandable=!1,this._originalToolbarPosition&&
(this.opts.toolbarPosition=this._originalToolbarPosition),this.responsiveToolbar.find(".wowbook-controls").css({bottom:"",position:"",left:""}),this.container&&this.container.data("originalOverflow")&&(this.container.css("overflow",this.container.data("originalOverflow")),this.container.data("originalOverflow","")))},updateResponsiveToolbar:function(){if(this.responsiveToolbar){this.responsiveToolbar.toggleClass("wowbook-small",480>this.responsiveToolbar.width());var a=this.toolbarIsExpandable(this.responsiveToolbar);
a?this.makeToolbarExpandable():this.unmakeToolbarExpandable();this.responsiveToolbar.toggleClass("wowbook-collapsable",a);this.responsiveToolbarToggle.toggleClass("wowbook-collapsed",!this._responsiveToolbarExpanded);this.responsiveToolbarToggle.toggle(a)}},createResponsiveToolbarToggle:function(){this.responsiveToolbarToggle=f("<a class='wowbook-control wowbook-control-toggle-toolbar'><i></i></a>").prependTo(this.responsiveToolbar.find(".wowbook-controls"));var a=this;this.responsiveToolbarToggle.on("click",
function(){a.toogleResponsiveToolbar()});f(window).on("resize.wowbook",function(){a.responsiveToolbarToggle&&a.responsiveToolbar&&a.updateResponsiveToolbar()})},slideUpResponsiveToolbar:function(a){var b=this.responsiveToolbar.find(".wowbook-controls"),c=this.responsiveToolbar.children().height()-this.responsiveToolbar.height();b.css({bottom:-c}).animate({bottom:0},a);this._responsiveToolbarExpanded=!0;this.updateResponsiveToolbar()},slideDownResponsiveToolbar:function(a){var b=this.responsiveToolbar.find(".wowbook-controls"),
c=this.responsiveToolbar.children().height()-this.responsiveToolbar.height();b.animate({bottom:-c},{duration:a,complete:function(){f(this).css("bottom","")}});this._responsiveToolbarExpanded=!1;this.updateResponsiveToolbar()},toogleResponsiveToolbar:function(){this._responsiveToolbarExpanded?this.slideDownResponsiveToolbar():this.slideUpResponsiveToolbar()},translate:function(a,b,c,d){f.wowBook.support.transform&&!1!==d?a.css("transform",f.wowBook.useTranslate3d?"translate3d("+(b||0)+"px, "+(c||0)+
"px, 0px)":"translate("+(b||0)+"px, "+(c||0)+"px) "):(void 0!==b&&a.css({left:b}),void 0!==c&&a.css({top:c}))}};f.wowBook.defaults={width:500,height:300,pageWidth:void 0,pageHeight:void 0,coverWidth:void 0,coverHeight:void 0,startPage:0,hardcovers:!1,hardPages:!1,closable:!0,centeredWhenClosed:!1,doublePages:".double",container:!1,containerWidth:void 0,containerHeight:void 0,containerPadding:void 0,containerBackground:void 0,toolbarContainerPosition:"",rtl:!1,responsive:!1,scaleToFit:"",maxWidth:void 0,
maxHeight:void 0,onResize:null,responsiveHandleWidth:void 0,singlePage:!1,responsiveSinglePage:!0,fullscreenElement:document.documentElement,onFullscreenError:null,onFullscreenErrorMessage:"Cannot enter fullscreen mode.",use3d:!0,perspective:2E3,useTranslate3d:"mobile",useScale3d:!0,pageThickness:0,pageEdgeColor:null,hardPageShadow:!0,style:null,bookShadow:!0,gutterShadow:!0,shadowThreshold:20,shadows:!0,foldGradient:!0,foldGradientThreshold:20,pageNumbers:!0,firstPageNumber:1,numberedPages:!1,deepLinking:!0,
updateBrowserURL:!0,moveToViewPort:!1,curl:!0,curlSize:40,slideShow:!1,slideShowDelay:1E3,slideShowLoop:!1,pauseOnHover:!0,touchEnabled:!0,swipeDuration:200,mouseWheel:!1,handleWidth:!1,handleClickDuration:300,turnPageDuration:1E3,turnPageDurationMin:300,forceBasicPage:!1,sections:".wowbook-section",images:void 0,srcs:void 0,loadingIndicator:!0,pdf:null,pdfScale:1,pdfProgressiveRender:!1,pdfTextSelectable:!1,pdfFind:!1,pdfUpdateRender:!0,onPDFLoadError:null,onPDFLoadProgress:null,onLoadPdf:null,pdfPixelRatio:Math.min(window.devicePixelRatio||
1,2),pdfRoundWidth:!0,pdfcMapPacked:!0,pdfcMapUrl:"wow_book/cmaps/",zoomLevel:1,zoomMax:2,zoomMin:1,zoomBoundingBox:window,zoomStep:.25,zoomDuration:200,zoomEasing:"linear",onZoom:null,pinchToZoom:!0,doubleClickToZoom:!1,zoomFocusX:.5,zoomFocusY:.5,allowDragBrowserPageZoom:!1,flipSound:!0,flipSoundFile:["page-flip.mp3","page-flip.ogg"],flipSoundPath:"./wow_book/sound/",onPlayFlipSound:null,keyboardNavigation:{back:37,advance:39},clipBoundaries:!0,onShowPage:null,onHoldPage:null,onReleasePage:null,
pagesInMemory:null,pagesToKeep:null,onLoadPage:null,onUnloadPage:null,lightbox:null,lightboxColor:null,lightboxOverlay:!1,lightboxOverlayColor:null,lightboxWidth:"100%",lightboxHeight:"100%",lightboxResponsive:!0,onShowLightbox:void 0,onHideLightbox:void 0,toc:void 0,tocParent:"body",tocHeader:"Table of contents",tocItemTemplate:void 0,toolbarLightboxPosition:"",displayToc:!1,controls:{},navControls:!1,responsiveNavControls:!0,downloadURL:null,homeURL:null,currentPageControlWidth:void 0,toolbar:!1,
toolbarParent:"body",toolbarIcons:"fontawesome",responsiveToolbar:!0,toolbarPosition:"bottom",removeStickyHoverStyle:!0,share:"twitter, googleplus, facebook, stumbleupon, reddit, linkedin",shareParams:{url:"_current_",text:void 0,via:void 0,title:void 0,summary:void 0,source_url:void 0},thumbnails:!1,thumbnailsParent:"body",thumbnailScale:.2,thumbnailWidth:null,thumbnailHeight:null,thumbnailNumber:!1,onThumbnailNumberString:null,thumbnailsPosition:null,thumbnailsVertical:!0,thumbnailsContainerWidth:null,
thumbnailsContainerHeight:null,thumbnailsSprite:null,thumbnailsImages:null,thumbnailsHideOnClick:!0,thumbnailsScrollDebounceWait:300,thumbnailsAnimOptions:{}};f.wowBook.wowBookConstructor=H;window.raf=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();f.browser.ie8mode=f.browser.msie&&8==document.documentMode;f.browser.ie7=f.browser.msie&&(7==f.browser.version||7==document.documentMode);var w=
f.browser.msie&&9>f.browser.version?1:0,K={thin:2-w,medium:4-w,thick:6-w},C=window.document,M=C.documentElement,I=M.requestFullscreen||M.mozRequestFullScreen||M.msRequestFullscreen||M.webkitRequestFullscreen||M.webkitRequestFullScreen,O=C.exitFullscreen||C.mozCancelFullScreen||C.msExitFullscreen||C.webkitExitFullscreen||C.webkitCancelFullScreen,P=function(){return C.fullscreenElement||C.mozFullScreenElement||C.msFullscreenElement||C.webkitFullscreenElement||C.webkitCurrentFullScreenElement};f.wowBook.utils=
{translate:function(a,b,c){return f.wowBook.useTranslate3d?"translate3d("+a+"px, "+b+"px, "+(c||0)+"px) ":"translate("+a+"px, "+b+"px) "},isMobile:function(){return 480>=f(window).width()||480>=f(window).height()},isIOS:/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}})(jQuery);
(function(f){function H(B){var w=B||window.event,K=[].slice.call(arguments,1),C=0,M=0;B=f.event.fix(w);B.type="mousewheel";w.wheelDelta&&(C=w.wheelDelta/120);w.detail&&(C=-w.detail/3);var I=C;void 0!==w.axis&&w.axis===w.HORIZONTAL_AXIS&&(I=0,M=-1*C);void 0!==w.wheelDeltaY&&(I=w.wheelDeltaY/120);void 0!==w.wheelDeltaX&&(M=-1*w.wheelDeltaX/120);K.unshift(B,C,M,I);return(f.event.dispatch||f.event.handle).apply(this,K)}var E=["DOMMouseScroll","mousewheel"];if(f.event.fixHooks)for(var J=E.length;J;)f.event.fixHooks[E[--J]]=
f.event.mouseHooks;f.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var B=E.length;B;)this.addEventListener(E[--B],H,!1);else this.onmousewheel=H},teardown:function(){if(this.removeEventListener)for(var B=E.length;B;)this.removeEventListener(E[--B],H,!1);else this.onmousewheel=null}};f.fn.extend({mousewheel:function(B){return B?this.bind("mousewheel",B):this.trigger("mousewheel")},unmousewheel:function(B){return this.unbind("mousewheel",B)}})})(jQuery);
(function(f){function H(B){if(B in E.style)return f.wowBook.support[B]=B;for(var w=J.length,K,C=B.charAt(0).toUpperCase()+B.substr(1);w--;)if(K=J[w]+C,K in E.style)return f.wowBook.support[B]=K}if(f.cssHooks){var E=document.createElement("div"),J=["O","ms","Webkit","Moz"];H("transform");H("transformOrigin");H("boxSizing");H("zoom");f.wowBook.support.boxSizing&&8>document.documentMode&&(f.wowBook.support.boxSizing=!1);E=null;f.each(["transform","transformOrigin"],function(B,w){f.wowBook.support[w]&&
f.wowBook.support[w]!==w&&!f.cssHooks[w]&&(f.cssHooks[w]={get:function(K,C,M){return f.css(K,f.wowBook.support[w])},set:function(K,C){K.style[f.wowBook.support[w]]=C}})});f.wowBook.applyAlphaImageLoader=function(B){var w,K,C="",M=f("<div style='display:none'></div>").appendTo("body");var I=0;for(K=B.length;I<K;I++){var O=B[I];M.addClass(O);if(w=M.css("background-image").match(/^url\("(.*)"\)$/))C+="."+O+"{background:none; filter : progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+w[1]+"', sizingMethod='scale'); } ",
M.removeClass(O)}f("body").append("<style>"+C+"</style>")}}else alert("jQuery 1.4.3+ is needed for this plugin to work")})(jQuery);;
document.addEventListener("DOMContentLoaded", function() {
    const controls = [
        // 'play-large',
        'play',
        'mute',
        'progress',
        'current-time',
        'duration',
        'fullscreen',
    ];
    const player = new Plyr('.intro__plyr', {
        controls,
        muted: true,
        autoplay: true,
    });
});;
$(document).ready(function() {
    const mainElement = document.querySelector('main');
    const directoryUri = mainElement.getAttribute('data-directory-uri');

    var bookOptions = {
        height: 772,
        width: 1000,
        centeredWhenClosed: true,
        hardcovers: true,
        toolbar: 'lastLeft, left, currentPage, right, lastRight, zoomin, zoomout,  fullscreen, download, share',
        downloadURL: `${directoryUri}/calliefirst/media/book/issue-one/NASA_FirstWoman_GraphicNovel.pdf`,
        thumbnailsPosition: 'left',
        responsiveHandleWidth: 50,
        containerPadding: '200px',
        containerHeight: '500px',
        lightbox: '.js-show-book',
        lightboxColor: '#17171B',
        zoomMax: 3.5,
        zoomStep: 0.5,
        toolbarPosition: 'bottom',
        pageNumbers: false,
        flipSound: false,
        displayToc: false,
        share: 'twitter, facebook, linkedin',
    }

    function generateBookContent(containerId, path, language, quanityPages) {
        var container = document.getElementById(containerId);

        for (let n = 1; n <= 2; n++) {
            createPage(container, `${directoryUri}/calliefirst/media/book/` + path + '/NASA_FirstWoman_COVERS_' + n + '.jpg');
        }
        for (let n = 1; n <= quanityPages; n++) {
            createPage(container, `${directoryUri}/calliefirst/media/book/` + path + '/NASA_FirstWoman_' + (language === 'spanish' ? 'Spanish_' : '' ) + 'GraphicNovel_Page_' + n + '.jpg');
        }
        for (let n = 1; n <= 2; n++) {
            createPage(container, `${directoryUri}/calliefirst/media/book/` + path + '/NASA_FirstWoman_COVERS_' + (n + 2) + '.jpg');
        }
    }

    // Function to create a page
    function createPage(container, imagePath) {
        var page = document.createElement('div');
        page.classList.add('page');
        page.setAttribute('data-image', imagePath);
        container.appendChild(page);
    }

    generateBookContent('book', 'issue-one/english', 'english', 40);
    generateBookContent('laprimeramujer', 'issue-one/spanish', 'spanish', 40);
    generateBookContent('expanding', 'issue-two/english', 'english', 48);
    generateBookContent('laexpansion', 'issue-two/spanish', 'spanish', 48);


    window.$('#book').wowBook(bookOptions);
    window.$('#laprimeramujer').wowBook(Object.assign(bookOptions, {
        lightbox: '.js-show-laprimeramujer',
        downloadURL: `${directoryUri}/calliefirst/media/book/issue-one/nia21_nasa_spanishoption_graphicnovel.pdf`,
    }));
    window.$('#expanding').wowBook(Object.assign(bookOptions, {
        lightbox: '.js-show-expanding',
        downloadURL: `${directoryUri}/calliefirst/media/book/issue-two/NASA_FirstWoman_GraphicNovel.pdf`,
    }));
    window.$('#laexpansion').wowBook(Object.assign(bookOptions, {
        lightbox: '.js-show-laexpansion',
        downloadURL: `${directoryUri}/calliefirst/media/book/issue-two/nia21_nasa_spanishoption_graphicnovel.pdf`,
    }));

    $(document).on('click touchstart', function(e) {
        if ($(e.target).is('.wowbook-control-share') === false) {
            $('.wowbook-share-buttons').addClass('wowbook-hidden')
        }
    })

    $('.wowbook-control').on('click', function(e) {
        if ($(e.target).is('.wowbook-control-share') === false) {
            $('.wowbook-share-buttons').addClass('wowbook-hidden')
        }
    })

    function triggerClickEvent(elements) {
        for (var i = 0; i < elements.length; i++) {
            elements[i].click();
        }
    }

    // phpcs:ignore WordPressVIPMinimum.JS.Window.location
    if (typeof window.location.hash !== 'undefined') {

        const sanitizedHash = getSanitizeHash(window.location.hash);

        if (sanitizedHash) {
            const params = sanitizedHash.split('/');
            if (params[0] === 'book') {
                const bookButtons = document.getElementsByClassName('js-show-book');
                triggerClickEvent(bookButtons);
            } else if (params[0] === 'laprimeramujer') {
                const laprimeramujerButtons = document.getElementsByClassName('js-show-laprimeramujer');
                triggerClickEvent(laprimeramujerButtons);
            } if (params[0] === 'expanding') {
                const expandingButtons = document.getElementsByClassName('js-show-expanding');
                triggerClickEvent(expandingButtons);
            } else if (params[0] === 'laexpansion') {
                const laexpansionButtons = document.getElementsByClassName('js-show-laexpansion');
                triggerClickEvent(laexpansionButtons);
            }
        }
    }

    function getSanitizeHash(hash) {
        return hash.substring(1).replace(/[^\w-]/g, '');
    }

    // Get the close buttons
    var bookCloseButtons = document.getElementsByClassName('wowbook-close');

    for (var i = 0; i < bookCloseButtons.length; i++) {
        bookCloseButtons[i].addEventListener('click', function() {
            var uri = window.location.toString();
            if (uri.indexOf("#") > 0) {
                var clean_uri = uri.substring(0, uri.indexOf("#"));
                window.history.replaceState({}, document.title, clean_uri);
                window.location.hash = '';
            }

            const targetBlock = document.getElementById('graphic-novel');

            if (targetBlock) {
                targetBlock.scrollIntoView({ behavior: 'smooth' });
            }
        });
    }
});;