var n,t,page=1,elementsIndexes=[];function docReady(e){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(e,1):document.addEventListener("DOMContentLoaded",e)}async function sendByAction(e,t,i=null,n=null){let s="";return"GET"==e||"get"==e?(n.action=t,s=await fetch(apiUrl+"?"+new URLSearchParams(n)).then((function(e){return e.text()}))):"POST"!=e&&"post"!=e||(i.append("action",t),s=await fetch(apiUrl,{method:e,body:i}).then((function(e){return e.text()}))),s}function r(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Jt(e,t,i){t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1})}
/*!
* Splide.js
* Version : 4.1.2
* License : MIT
* Copyright: 2022 Naotoshi Fujita
*/docReady((function(){let e=document.querySelectorAll(".podcast-select");null!=e&&e.length>0&&e.forEach((e=>{e.addEventListener("change",(function(){null!=this.value&&""!=this.value&&(window.location.href=this.value)}))}));let t=document.getElementById("podcastLoadMore");if(null!=t&&t.addEventListener("click",(function(e){e.preventDefault(),t.innerHTML='<div class="loader"><div class="lds-dual-ring"></div></div>',page++,fetch(siteUrl+"/wp-json/wp/v2/posts?page="+page+"&category_slug=podcast&per_page=14",{method:"GET"}).then((function(e){return e.text()})).then((function(e){JSON.parse(e).forEach(((e,i)=>{if(2!=page||0!=i){let t=document.createElement("div");t.classList.add("podcast-item");let i=null!=e.metadata.podcast_mp3_thumb&&""!=e.metadata.podcast_mp3_thumb?e.metadata.podcast_mp3_thumb:null!=e.metadata.one_podcast_cover_url&&""!=e.metadata.one_podcast_cover_url?e.metadata.one_podcast_cover_url:null!=e.metadata.episode_cover&&""!=e.metadata.episode_cover?e.metadata.episode_cover:null!=e.featured_image_url&&""!=e.featured_image_url?e.featured_image_url:themeDirUrl+"/assets/img/default-image.png",n=document.createElement("a");n.classList.add("podcast-ep"),n.setAttribute("title",e.title.rendered),n.setAttribute("href",e.link),n.style.backgroundImage="url("+i+")",t.appendChild(n),document.querySelector("#podcastList").appendChild(t)}t.innerHTML="Carregar mais"}))}))})),document.getElementById("highlights")){let e=document.querySelector(".highlight-container");document.getElementById("hlLeftBtn").addEventListener("click",(function(){e.scrollLeft-=500})),document.getElementById("hlRightBtn").addEventListener("click",(function(){e.scrollLeft+=500}))}let i=document.querySelectorAll(".wp-block-gallery");null!=i&&i.length>0&&i.forEach((e=>{e.querySelectorAll(".wp-block-image").forEach((e=>{e.classList.add("splide__slide")})),e.classList.add("splide__list");let t=document.createElement("div");t.classList.add("splide__track"),t.innerHTML=e.outerHTML;let i=document.createElement("div");i.classList.add("splide"),i.appendChild(t),e.replaceWith(i),new Splide(i).mount()})),elementsIndexes=Array.from(document.querySelectorAll("[lazy-load-background]"));let n=function(){let e=document.scrollingElement.scrollTop;elementsIndexes.forEach(((t,i)=>{if(e>t.getBoundingClientRect().top-250){let e=t.getAttribute("lazy-load-background");t.style.backgroundImage="url('"+e+"')",elementsIndexes.splice(i,1),t.removeAttribute("lazy-load-background")}}))};null!==elementsIndexes&&elementsIndexes.length>0&&(n(),window.addEventListener("scroll",(function(e){null!==elementsIndexes&&elementsIndexes.length>0&&n()}),!1));let s=document.getElementById("player");if(s){new Plyr(s,{controls:"true"==s.getAttribute("hide-controls")?["play","progress","mute","settings"]:["play","progress","current-time","mute","settings"]})}document.querySelectorAll(".splide .wp-block-image").forEach((e=>{e.addEventListener("click",(function(){let t=document.getElementById("image_show");t.querySelector("img").setAttribute("src",e.querySelector("img").getAttribute("src")),t.classList.add("show")}))})),document.getElementById("image_show").addEventListener("click",(function(){this.classList.remove("show"),this.querySelector("img").setAttribute("src","")}))})),"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 n=i.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);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 n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}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 n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?n(Object(s),!0).forEach((function(t){i(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var r={addCSS:!0,thumbWidth:15,watch:!0},o=function(e){return null!=e?e.constructor:null},a=function(e,t){return!!(e&&t&&e instanceof t)},l=function(e){return null==e},c=function(e){return o(e)===Object},u=function(e){return o(e)===String},d=function(e){return Array.isArray(e)},h=function(e){return a(e,NodeList)},m={nullOrUndefined:l,object:c,number:function(e){return o(e)===Number&&!Number.isNaN(e)},string:u,boolean:function(e){return o(e)===Boolean},function:function(e){return o(e)===Function},array:d,nodeList:h,element:function(e){return a(e,Element)},event:function(e){return a(e,Event)},empty:function(e){return l(e)||(u(e)||d(e)||h(e))&&!e.length||c(e)&&!Object.keys(e).length}};var p=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=s({},r,{},i),this.init())}return function(e,i,n){i&&t(e.prototype,i),n&&t(e,n)}(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,n=t.target,s=t.changedTouches[0],r=parseFloat(n.getAttribute("min"))||0,o=parseFloat(n.getAttribute("max"))||100,a=parseFloat(n.getAttribute("step"))||1,l=n.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(s.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),r+function(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}(i/100*(o-r),a)}},{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]:{},n=null;if(m.empty(t)||m.string(t)?n=Array.from(document.querySelectorAll(m.string(t)?t:'input[type="range"]')):m.element(t)?n=[t]:m.nodeList(t)?n=Array.from(t):m.array(t)&&(n=t.filter(m.element)),m.empty(n))return null;var o=s({},r,{},i);if(m.string(t)&&o.watch){var a=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,o)}))}))}));a.observe(document.body,{childList:!0,subtree:!0})}return n.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const g=e=>null!=e?e.constructor:null,f=(e,t)=>Boolean(e&&t&&e instanceof t),y=e=>null==e,b=e=>g(e)===Object,v=e=>g(e)===String,w=e=>"function"==typeof e,k=e=>Array.isArray(e),T=e=>f(e,NodeList),E=e=>y(e)||(v(e)||k(e)||T(e))&&!e.length||b(e)&&!Object.keys(e).length;var S={nullOrUndefined:y,object:b,number:e=>g(e)===Number&&!Number.isNaN(e),string:v,boolean:e=>g(e)===Boolean,function:w,array:k,weakMap:e=>f(e,WeakMap),nodeList:T,element:e=>null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument,textNode:e=>g(e)===Text,event:e=>f(e,Event),keyboardEvent:e=>f(e,KeyboardEvent),cue:e=>f(e,window.TextTrackCue)||f(e,window.VTTCue),track:e=>f(e,TextTrack)||!y(e)&&v(e.kind),promise:e=>f(e,Promise)&&w(e.then),url:e=>{if(f(e,window.URL))return!0;if(!v(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!E(new URL(t).hostname)}catch(e){return!1}},empty:E};const C=(()=>{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 A(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}var P={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 x(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function M(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]:{}}),M(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),M(e,...t)):e}function L(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const n=i>0?t.cloneNode(!0):t,s=e.parentNode,r=e.nextSibling;n.appendChild(e),r?s.insertBefore(n,r):s.appendChild(n)}))}function N(e,t){S.element(e)&&!S.empty(t)&&Object.entries(t).filter((([,e])=>!S.nullOrUndefined(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function I(e,t,i){const n=document.createElement(e);return S.object(t)&&N(n,t),S.string(i)&&(n.innerText=i),n}function _(e,t,i,n){S.element(t)&&t.appendChild(I(e,i,n))}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 $(e){if(!S.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function j(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={},n=M({},t);return e.split(",").forEach((e=>{const t=e.trim(),s=t.replace(".",""),r=t.replace(/[[\]]/g,"").split("="),[o]=r,a=r.length>1?r[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":S.string(n.class)?i.class=`${n.class} ${s}`:i.class=s;break;case"#":i.id=t.replace("#","");break;case"[":i[o]=a}})),M(n,i)}function q(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 n="toggle";return void 0!==i&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function H(e,t){return S.element(e)&&e.classList.contains(t)}function F(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 V(e){return this.elements.container.querySelectorAll(e)}function B(e){return this.elements.container.querySelector(e)}function U(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"},W={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=W[e]||"html5"!==t;return{api:i,ui:i&&W.rangeInput}},pip:!(P.isIPhone||!S.function(I("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||I("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!==C,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},K=(()=>{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 Y(e,t,i,n=!1,s=!0,r=!1){if(!e||!("addEventListener"in e)||S.empty(t)||!S.function(i))return;const o=t.split(" ");let a=r;K&&(a={passive:s,capture:r}),o.forEach((t=>{this&&this.eventListeners&&n&&this.eventListeners.push({element:e,type:t,callback:i,options:a}),e[n?"addEventListener":"removeEventListener"](t,i,a)}))}function X(e,t="",i,n=!0,s=!1){Y.call(this,e,t,i,!0,n,s)}function G(e,t="",i,n=!0,s=!1){Y.call(this,e,t,i,!1,n,s)}function J(e,t="",i,n=!0,s=!1){const r=(...o)=>{G(e,t,r,n,s),i.apply(this,o)};Y.call(this,e,t,r,!0,n,s)}function Q(e,t="",i=!1,n={}){if(!S.element(e)||S.empty(t))return;const s=new CustomEvent(t,{bubbles:i,detail:{...n,plyr:this}});e.dispatchEvent(s)}function Z(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:n,options:s}=e;t.removeEventListener(i,n,s)})),this.eventListeners=[])}function ee(){return new Promise((e=>this.ready?setTimeout(e,0):X.call(this,this.elements.container,"ready",e))).then((()=>{}))}function te(e){S.promise(e)&&e.then(null,(()=>{}))}function ie(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 se(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const re=[[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 oe(e){return!!(S.array(e)||S.string(e)&&e.includes(":"))&&(S.array(e)?e:e.split(":")).map(Number).every(S.number)}function ae(e){if(!S.array(e)||!e.every(S.number))return null;const[t,i]=e,n=(e,t)=>0===t?e:n(t,e%t),s=n(t,i);return[t/s,i/s]}function le(e){const t=e=>oe(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 ae(i)}function ce(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=le.call(this,e);if(!S.array(i))return{};const[n,s]=ae(i),r=100/n*s;if(se(`aspect-ratio: ${n}/${s}`)?t.style.aspectRatio=`${n}/${s}`:t.style.paddingBottom=`${r}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-r)/(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:r,ratio:i}}function ue(e,t,i=.05){const n=e/t,s=ne(Object.keys(re),n);return Math.abs(s-n)<=i?re[s]:[e,t]}const de={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!S.empty(t)||W.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)||ce.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:n,paused:s,preload:r,readyState:o,playbackRate:a}=e.media;e.media.src=i.getAttribute("src"),("none"!==r||o)&&(e.once("loadedmetadata",(()=>{e.speed=a,e.currentTime=n,s||te(e.play())})),e.media.load())}Q.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 he(e,...t){return S.empty(e)?e:e.toString().replace(/{(\d+)}/g,((e,i)=>t[i].toString()))}const me=(e="",t="",i="")=>e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString()),pe=(e="")=>e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));function ge(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const fe={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},ye={get(e="",t={}){if(S.empty(e)||S.empty(t))return"";let i=x(t.i18n,e);if(S.empty(i))return Object.keys(fe).includes(e)?fe[e]:"";const n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach((([e,t])=>{i=me(i,e,t)})),i}};class be{constructor(t){e(this,"get",(e=>{if(!be.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(!be.supported||!this.enabled)return;if(!S.object(e))return;let t=this.get();S.empty(t)&&(t={}),M(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 ve(e,t="text"){return new Promise(((i,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;n.addEventListener("load",(()=>{if("text"===t)try{i(JSON.parse(n.responseText))}catch(e){i(n.responseText)}else i(n.response)})),n.addEventListener("error",(()=>{throw new Error(n.status)})),n.open("GET",e,!0),n.responseType=t,n.send()}catch(e){n(e)}}))}function we(e,t){if(!S.string(e))return;const i="cache",n=S.string(t);let s=!1;const r=()=>null!==document.getElementById(t),o=(e,t)=>{e.innerHTML=t,n&&r()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!r()){const r=be.supported,a=document.createElement("div");if(a.setAttribute("hidden",""),n&&a.setAttribute("id",t),r){const e=window.localStorage.getItem(`${i}-${t}`);if(s=null!==e,s){const t=JSON.parse(e);o(a,t.content)}}ve(e).then((e=>{if(!S.empty(e)){if(r)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:e}))}catch(e){}o(a,e)}})).catch((()=>{}))}}const ke=e=>Math.trunc(e/60/60%60,10);function Te(e=0,t=!1,i=!1){if(!S.number(e))return Te(void 0,t,i);const n=e=>`0${e}`.slice(-2);let s=ke(e);const r=(e=>Math.trunc(e/60%60,10))(e),o=(e=>Math.trunc(e%60,10))(e);return s=t||s>0?`${s}:`:"",`${i&&e>0?"-":""}${s}${n(r)}:${n(o)}`}const Ee={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||P.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:V.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",n=Ee.getIconUrl.call(this),s=`${n.cors?"":n.url}#${this.config.iconPrefix}`,r=document.createElementNS(i,"svg");N(r,M(t,{"aria-hidden":"true",focusable:"false"}));const o=document.createElementNS(i,"use"),a=`${s}-${e}`;return"href"in o&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",a),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),r.appendChild(o),r},createLabel(e,t={}){const i=ye.get(e,this.config);return I("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(S.empty(e))return null;const t=I("span",{class:this.config.classNames.menu.value});return t.appendChild(I("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=M({},t);let n=function(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=me(t,"-"," "),t=me(t,"_"," "),t=pe(t),me(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}(e);const s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(s[e]=i[e],delete i[e])})),"button"!==s.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((e=>e===this.config.classNames.control))||M(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":s.toggle=!0,s.label="play",s.labelPressed="pause",s.icon="play",s.iconPressed="pause";break;case"mute":s.toggle=!0,s.label="mute",s.labelPressed="unmute",s.icon="volume",s.iconPressed="muted";break;case"captions":s.toggle=!0,s.label="enableCaptions",s.labelPressed="disableCaptions",s.icon="captions-off",s.iconPressed="captions-on";break;case"fullscreen":s.toggle=!0,s.label="enterFullscreen",s.labelPressed="exitFullscreen",s.icon="enter-fullscreen",s.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,n="play",s.label="play",s.icon="play";break;default:S.empty(s.label)&&(s.label=n),S.empty(s.icon)&&(s.icon=e)}const r=I(s.element);return s.toggle?(r.appendChild(Ee.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),r.appendChild(Ee.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),r.appendChild(Ee.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),r.appendChild(Ee.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(r.appendChild(Ee.createIcon.call(this,s.icon)),r.appendChild(Ee.createLabel.call(this,s.label))),M(i,D(this.config.selectors.buttons[n],i)),N(r,i),"play"===n?(S.array(this.elements.buttons[n])||(this.elements.buttons[n]=[]),this.elements.buttons[n].push(r)):this.elements.buttons[n]=r,r},createRange(e,t){const i=I("input",M(D(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":ye.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Ee.updateRangeFill.call(this,i),p.setup(i),i},createProgress(e,t){const i=I("progress",M(D(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(I("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],n=t?ye.get(t,this.config):"";i.innerText=`% ${n.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=D(this.config.selectors.display[e],t),n=I("div",M(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":ye.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=n,n},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 n=F(e,'[role="menuitemradio"]');if(!n&&[" ","ArrowRight"].includes(i.key))Ee.showMenuPanel.call(this,t,!0);else{let t;" "!==i.key&&("ArrowDown"===i.key||n&&"ArrowRight"===i.key?(t=e.nextElementSibling,S.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,S.element(t)||(t=e.parentNode.lastElementChild)),U.call(this,t,!0))}}),!1),X.call(this,e,"keyup",(e=>{"Return"===e.key&&Ee.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:n,badge:s=null,checked:r=!1}){const o=D(this.config.selectors.inputs[i]),a=I("button",M(o,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${o.class?o.class:""}`.trim(),"aria-checked":r,value:e})),l=I("span");l.innerHTML=n,S.element(s)&&l.appendChild(s),a.appendChild(l),Object.defineProperty(a,"checked",{enumerable:!0,get:()=>"true"===a.getAttribute("aria-checked"),set(e){e&&Array.from(a.parentNode.children).filter((e=>F(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),a.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(a,"click keyup",(t=>{if(!S.keyboardEvent(t)||" "===t.key){switch(t.preventDefault(),t.stopPropagation(),a.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}Ee.showMenuPanel.call(this,"home",S.keyboardEvent(t))}}),i,!1),Ee.bindMenuItemShortcuts.call(this,a,i),t.appendChild(a)},formatTime(e=0,t=!1){return S.number(e)?Te(e,ke(this.duration)>0,t):e},updateTimeDisplay(e=null,t=0,i=!1){S.element(e)&&S.number(t)&&(e.innerText=Ee.formatTime(t,i))},updateVolume(){this.supported.ui&&(S.element(this.elements.inputs.volume)&&Ee.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,Ee.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,n=S.element(e)?e:this.elements.display.buffer;if(S.element(n)){n.value=i;const e=n.getElementsByTagName("span")[0];S.element(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,s=this.duration,t=0===n||0===s||Number.isNaN(n)||Number.isNaN(s)?0:(n/s*100).toFixed(2),"timeupdate"===e.type&&Ee.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var n,s},updateRangeFill(e){const t=S.event(e)?e.target:e;if(S.element(t)&&"range"===t.getAttribute("type")){if(F(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=Ee.formatTime(this.currentTime),i=Ee.formatTime(this.duration),n=ye.get("seekLabel",this.config);t.setAttribute("aria-valuetext",n.replace("{currentTime}",e).replace("{duration}",i))}else if(F(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);(P.isWebKit||P.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 n=this.elements.display.seekTooltip,s=`${this.config.classNames.tooltip}--visible`,r=e=>R(n,s,e);if(this.touch)return void r(!1);let o=0;const a=this.elements.progress.getBoundingClientRect();if(S.event(e))o=100/a.width*(e.pageX-a.left);else{if(!H(n,s))return;o=parseFloat(n.style.left,10)}o<0?o=0:o>100&&(o=100);const l=this.duration/100*o;n.innerText=Ee.formatTime(l);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(l)));c&&n.insertAdjacentHTML("afterbegin",`${c.label}<br>`),n.style.left=`${o}%`,S.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&r("mouseenter"===e.type)},timeUpdate(e){const t=!S.element(this.elements.display.duration)&&this.config.invertTime;Ee.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Ee.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return q(this.elements.display.currentTime,!0),void q(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&&Ee.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Ee.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Ee.setMarkers.call(this),Ee.updateSeekTooltip.call(this)},toggleMenuButton(e,t){q(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const n=this.elements.settings.panels[e];let s=null,r=t;if("captions"===e)s=this.currentTrack;else{if(s=S.empty(i)?this[e]:i,S.empty(s)&&(s=this.config[e].default),!S.empty(this.options[e])&&!this.options[e].includes(s))return void this.debug.warn(`Unsupported value of '${s}' for ${e}`);if(!this.config[e].options.includes(s))return void this.debug.warn(`Disabled value of '${s}' for ${e}`)}if(S.element(r)||(r=n&&n.querySelector('[role="menu"]')),!S.element(r))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Ee.getLabel.call(this,e,s);const o=r&&r.querySelector(`[value="${s}"]`);S.element(o)&&(o.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?ye.get("normal",this.config):`${t}×`;case"quality":if(S.number(t)){const e=ye.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return pe(t);case"captions":return Ae.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=ie(e).filter((e=>this.config.quality.options.includes(e))));const n=!S.empty(this.options.quality)&&this.options.quality.length>1;if(Ee.toggleMenuButton.call(this,t,n),$(i),Ee.checkMenu.call(this),!n)return;const s=e=>{const t=ye.get(`qualityBadge.${e}`,this.config);return t.length?Ee.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=>{Ee.createMenuItem.call(this,{value:e,list:i,type:t,title:Ee.getLabel.call(this,"quality",e),badge:s(e)})})),Ee.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=Ae.getTracks.call(this),n=Boolean(i.length);if(Ee.toggleMenuButton.call(this,e,n),$(t),Ee.checkMenu.call(this),!n)return;const s=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:Ae.getLabel.call(this,e),badge:e.language&&Ee.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));s.unshift({value:-1,checked:!this.captions.toggled,title:ye.get("disabled",this.config),list:t,type:"language"}),s.forEach(Ee.createMenuItem.bind(this)),Ee.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;Ee.toggleMenuButton.call(this,e,i),$(t),Ee.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{Ee.createMenuItem.call(this,{value:i,list:t,type:e,title:Ee.getLabel.call(this,"speed",i)})})),Ee.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!S.empty(e)&&Object.values(e).some((e=>!e.hidden));q(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 n=i.querySelector('[role^="menuitem"]');U.call(this,n,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!S.element(t)||!S.element(i))return;const{hidden:n}=t;let s=n;if(S.boolean(e))s=e;else if(S.keyboardEvent(e)&&"Escape"===e.key)s=!1;else if(S.event(e)){const n=S.function(e.composedPath)?e.composedPath()[0]:e.target,r=t.contains(n);if(r||!r&&e.target!==i&&s)return}i.setAttribute("aria-expanded",s),q(t,!s),R(this.elements.container,this.config.classNames.menu.open,s),s&&S.keyboardEvent(e)?Ee.focusFirstMenuItem.call(this,null,!0):s||n||U.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,n=t.scrollHeight;return O(t),{width:i,height:n}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!S.element(i))return;const n=i.parentNode,s=Array.from(n.children).find((e=>!e.hidden));if(W.transitions&&!W.reducedMotion){n.style.width=`${s.scrollWidth}px`,n.style.height=`${s.scrollHeight}px`;const e=Ee.getMenuSize.call(this,i),t=e=>{e.target===n&&["width","height"].includes(e.propertyName)&&(n.style.width="",n.style.height="",G.call(this,n,C,t))};X.call(this,n,C,t),n.style.width=`${e.width}px`,n.style.height=`${e.height}px`}q(s,!0),q(i,!1),Ee.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:n,createRange:s,createTime:r,setQualityMenu:o,setSpeedMenu:a,showMenuPanel:l}=Ee;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=I("div",D(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return ie(S.array(this.config.controls)?this.config.controls:[]).forEach((o=>{if("restart"===o&&c.appendChild(i.call(this,"restart",u)),"rewind"===o&&c.appendChild(i.call(this,"rewind",u)),"play"===o&&c.appendChild(i.call(this,"play",u)),"fast-forward"===o&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===o){const t=I("div",{class:`${u.class} plyr__progress__container`}),i=I("div",D(this.config.selectors.progress));if(i.appendChild(s.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(n.call(this,"buffer")),this.config.tooltips.seek){const e=I("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"===o&&c.appendChild(r.call(this,"currentTime",u)),"duration"===o&&c.appendChild(r.call(this,"duration",u)),"mute"===o||"volume"===o){let{volume:t}=this.elements;if(S.element(t)&&c.contains(t)||(t=I("div",M({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===o&&t.appendChild(i.call(this,"mute")),"volume"===o&&!P.isIos&&!P.isIPadOS){const i={max:1,step:.05,value:this.config.volume};t.appendChild(s.call(this,"volume",M(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===o&&c.appendChild(i.call(this,"captions",u)),"settings"===o&&!S.empty(this.config.settings)){const n=I("div",M({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));n.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const s=I("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),r=I("div"),o=I("div",{id:`plyr-settings-${e.id}-home`}),a=I("div",{role:"menu"});o.appendChild(a),r.appendChild(o),this.elements.settings.panels.home=o,this.config.settings.forEach((i=>{const n=I("button",M(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,n,i),X.call(this,n,"click",(()=>{l.call(this,i,!1)}));const s=I("span",null,ye.get(i,this.config)),o=I("span",{class:this.config.classNames.menu.value});o.innerHTML=e[i],s.appendChild(o),n.appendChild(s),a.appendChild(n);const c=I("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=I("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(I("span",{"aria-hidden":!0},ye.get(i,this.config))),u.appendChild(I("span",{class:this.config.classNames.hidden},ye.get("menuBack",this.config))),X.call(this,c,"keydown",(e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))}),!1),X.call(this,u,"click",(()=>{l.call(this,"home",!1)})),c.appendChild(u),c.appendChild(I("div",{role:"menu"})),r.appendChild(c),this.elements.settings.buttons[i]=n,this.elements.settings.panels[i]=c})),s.appendChild(r),n.appendChild(s),c.appendChild(n),this.elements.settings.popup=s,this.elements.settings.menu=n}if("pip"===o&&W.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===o&&W.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===o){const e=M({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!S.url(t)&&this.isEmbed&&M(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===o&&c.appendChild(i.call(this,"fullscreen",u))})),this.isHTML5&&o.call(this,de.getQualityOptions.call(this)),a.call(this),c},inject(){if(this.config.loadSprite){const e=Ee.getIconUrl.call(this);e.cors&&we(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,n=!0;if(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=Ee.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ae.getLabel.call(this)}),n=!1),n&&S.string(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=me(i,`{${e}}`,t)})),i})(e)),S.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),S.element(i)||(i=this.elements.container),i[S.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),S.element(this.elements.controls)||Ee.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:()=>H(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(P.isEdge&&A(i),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,n=V.call(this,i);Array.from(n).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 n=document.createDocumentFragment(),s=document.createDocumentFragment();let r=null;const o=`${this.config.classNames.tooltip}--visible`,a=e=>R(r,o,e);i.forEach((e=>{const t=I("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";r&&(t.addEventListener("mouseenter",(()=>{e.label||(r.style.left=i,r.innerHTML=e.label,a(!0))})),t.addEventListener("mouseleave",(()=>{a(!1)}))),t.addEventListener("click",(()=>{this.currentTime=e.time})),t.style.left=i,s.appendChild(t)})),n.appendChild(s),this.config.tooltips.seek||(r=I("span",{class:this.config.classNames.tooltip},""),n.appendChild(r)),this.elements.markers={points:s,tip:r},this.elements.progress.appendChild(n)}};function Se(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 Ce(e){const t=new URLSearchParams;return S.object(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const Ae={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!W.textTracks)return void(S.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ee.setCaptionsMenu.call(this));var e,t;if(S.element(this.elements.captions)||(this.elements.captions=I("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)),P.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=Se(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&ve(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{O(e)}))}))}const i=ie((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===n&&([n]=i);let s=this.storage.get("captions");if(S.boolean(s)||({active:s}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:s,language:n,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";X.call(this,this.media.textTracks,e,Ae.update.bind(this))}setTimeout(Ae.update.bind(this),0)},update(){const e=Ae.getTracks.call(this,!0),{active:t,language:i,meta:n,currentTrackNode:s}=this.captions,r=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!n.get(e))).forEach((e=>{this.debug.log("Track added",e),n.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),X.call(this,e,"cuechange",(()=>Ae.updateCues.call(this)))})),(r&&this.language!==i||!e.includes(s))&&(Ae.setLanguage.call(this,i),Ae.toggle.call(this,t&&r)),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")&&Ee.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,n=this.config.classNames.captions.active,s=S.nullOrUndefined(e)?!i:e;if(s!==i){if(t||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!t){const e=Ae.getTracks.call(this),t=Ae.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void Ae.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),R(this.elements.container,n,s),this.captions.toggled=s,Ee.updateSetting.call(this,"captions"),Q.call(this,this.media,s?"captionsenabled":"captionsdisabled")}setTimeout((()=>{s&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=Ae.getTracks.call(this);if(-1!==e)if(S.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const n=i[e],{language:s}=n||{};this.captions.currentTrackNode=n,Ee.updateSetting.call(this,"captions"),t||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s),Q.call(this,this.media,"languagechange")}Ae.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ae.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Ae.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 n=Ae.getTracks.call(this),s=Ae.findTrack.call(this,[i]);Ae.set.call(this,n.indexOf(s),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=Ae.getTracks.call(this),n=e=>Number((this.captions.meta.get(e)||{}).default),s=Array.from(i).sort(((e,t)=>n(t)-n(e)));let r;return e.every((e=>(r=s.find((t=>t.language===e)),!r))),r||(t?s[0]:void 0)},getCurrentTrack(){return Ae.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!S.track(t)&&W.textTracks&&this.captions.toggled&&(t=Ae.getCurrentTrack.call(this)),S.track(t)?S.empty(t.label)?S.empty(t.language)?ye.get("enabled",this.config):e.language.toUpperCase():t.label:ye.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=Ae.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map(ge)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){$(this.elements.captions);const e=I("span",D(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),Q.call(this,this.media,"cuechange")}}},Pe={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:[]}},xe="picture-in-picture",Me={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Le="video",Ne=()=>{};class Ie{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):Ne}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):Ne}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):Ne}}class _e{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;Q.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),P.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const n=S.string(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!n,n||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),e(this,"trapFocus",(e=>{if(P.isIos||P.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=V.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[n]=i,s=i[i.length-1];t!==s||e.shiftKey?t===n&&e.shiftKey&&(s.focus(),e.preventDefault()):(n.focus(),e.preventDefault())})),e(this,"update",(()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":_e.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&&(P.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!_e.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(P.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),te(this.player.play());else if(!_e.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=_e.prefix,this.property=_e.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(F.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 _e.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,_e.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||_e.nativeSupported||!P.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!_e.nativeSupported||this.forceFallback)return H(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 P.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}}function Oe(e,t=1){return new Promise(((i,n)=>{const s=new Image,r=()=>{delete s.onload,delete s.onerror,(s.naturalWidth>=t?i:n)(s)};Object.assign(s,{onload:r,onerror:r,src:e})}))}const $e={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 $e.toggleNativeControls.call(this,!0);S.element(this.elements.controls)||(Ee.inject.call(this),this.listeners.controls()),$e.toggleNativeControls.call(this),this.isHTML5&&Ae.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Ee.updateVolume.call(this),Ee.timeUpdate.call(this),Ee.durationUpdate.call(this),$e.checkPlaying.call(this),R(this.elements.container,this.config.classNames.pip.supported,W.pip&&this.isHTML5&&this.isVideo),R(this.elements.container,this.config.classNames.airplay.supported,W.airplay&&this.isHTML5),R(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{Q.call(this,this.media,"ready")}),0),$e.setTitle.call(this),this.poster&&$e.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&Ee.durationUpdate.call(this),this.config.mediaMetadata&&Ee.setMediaMetadata.call(this)},setTitle(){let e=ye.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=ye.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"),ee.call(this).then((()=>Oe(e))).catch((t=>{throw e===this.poster&&$e.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:""}),$e.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",ye.get(this.playing?"pause":"play",this.config))})),S.event(e)&&"timeupdate"===e.type||$e.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),$e.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 je{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&&Y.call(t,window,"keydown keyup",this.handleKey,e,!1),Y.call(t,document.body,"click",this.toggleMenu,e),J.call(t,document.body,"touchstart",this.firstTouch)})),e(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:n}=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:s}=i;s&&"enterfullscreen"===t.type&&(s.pressed=!1,s.hover=!1);let r=0;["touchstart","touchmove","mousemove"].includes(t.type)&&($e.toggleControls.call(e,!0),r=e.touch?3e3:2e3),clearTimeout(n.controls),n.controls=setTimeout((()=>$e.toggleControls.call(e,!1)),r)}));const s=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:n}=e.fullscreen,[s,r]=le.call(e),o=se(`aspect-ratio: ${s} / ${r}`);if(!n)return void(o?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[a,l]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=a/l>s/r;o?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/r*s+"px":null,t.style.margin=c?"0 auto":null)},r=()=>{clearTimeout(n.resized),n.resized=setTimeout(s,50)};X.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:n}=e.fullscreen;n===i.container&&(!e.isEmbed&&S.empty(e.config.ratio)||(s(),("enterfullscreen"===t.type?X:G).call(e,window,"resize",r)))}))})),e(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(X.call(e,e.media,"timeupdate seeking seeked",(t=>Ee.timeUpdate.call(e,t))),X.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>Ee.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=>Ee.updateProgress.call(e,t))),X.call(e,e.media,"volumechange",(t=>Ee.updateVolume.call(e,t))),X.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>$e.checkPlaying.call(e,t))),X.call(e,e.media,"waiting canplay seeked playing",(t=>$e.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",(n=>{([t.container,i].includes(n.target)||i.contains(n.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(n,e.restart,"restart"),this.proxy(n,(()=>{te(e.play())}),"play")):this.proxy(n,(()=>{te(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",(()=>{Ee.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),X.call(e,e.media,"qualitychange",(t=>{Ee.updateSetting.call(e,"quality",null,t.detail.quality)})),X.call(e,e.media,"ready qualitychange",(()=>{Ee.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");X.call(e,e.media,i,(i=>{let{detail:n={}}=i;"error"===i.type&&(n=e.media.error),Q.call(e,t.container,i.type,!0,n)}))})),e(this,"proxy",((e,t,i)=>{const{player:n}=this,s=n.config.listeners[i];let r=!0;S.function(s)&&(r=s.call(n,e)),!1!==r&&S.function(t)&&t.call(n,e)})),e(this,"bind",((e,t,i,n,s=!0)=>{const{player:r}=this,o=r.config.listeners[n],a=S.function(o);X.call(r,e,t,(e=>this.proxy(e,i,n)),s&&!a)})),e(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=P.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{te(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",(()=>{Q.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(),Ee.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),Ee.toggleMenu.call(e,t)):Ee.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{"Escape"===t.key&&Ee.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),n=100/i.width*(e.pageX-i.left);e.currentTarget.setAttribute("seek-value",n)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,n="play-on-seeked";if(S.keyboardEvent(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const s=i.hasAttribute(n),r=["mouseup","touchend","keyup"].includes(t.type);s&&r?(i.removeAttribute(n),te(e.play())):!r&&e.playing&&(i.setAttribute(n,""),e.pause())})),P.isIos){const t=V.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>A(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let n=i.getAttribute("seek-value");S.empty(n)&&(n=i.value),i.removeAttribute("seek-value"),e.currentTime=n/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>Ee.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)})),P.isWebKit&&Array.from(V.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>Ee.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,Ee.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:n}=e;R(t.controls,i.classNames.noTransition,!0),$e.toggleControls.call(e,!0),setTimeout((()=>{R(t.controls,i.classNames.noTransition,!1)}),0);const s=this.touch?3e3:4e3;clearTimeout(n.controls),n.controls=setTimeout((()=>$e.toggleControls.call(e,!1)),s)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[n,s]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),r=Math.sign(Math.abs(n)>Math.abs(s)?n:s);e.increaseVolume(r/50);const{volume:o}=e.media;(1===r&&o<1||-1===r&&o>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:n,type:s,altKey:r,ctrlKey:o,metaKey:a,shiftKey:l}=e,c="keydown"===s,u=c&&n===this.lastKey;var d;if(!(r||o||a||l)&&n)if(c){const s=document.activeElement;if(S.element(s)){const{editable:n}=t.config.selectors,{seek:r}=i.inputs;if(s!==r&&F(s,n))return;if(" "===e.key&&F(s,'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(n)&&(e.preventDefault(),e.stopPropagation()),n){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(d=parseInt(n,10),t.currentTime=t.duration/10*d);break;case" ":case"k":u||te(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"===n&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null}toggleMenu(e){Ee.toggleMenu.call(this.player,e)}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var De=function(e,t){return function(e,t){e.exports=function(){var e=function(){},t={},i={},n={};function s(e,t){e=e.push?e:[e];var s,r,o,a=[],l=e.length,c=l;for(s=function(e,i){i.length&&a.push(e),--c||t(a)};l--;)r=e[l],(o=i[r])?s(r,o):(n[r]=n[r]||[]).push(s)}function r(e,t){if(e){var s=n[e];if(i[e]=t,s)for(;s.length;)s[0](e,t),s.splice(0,1)}}function o(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function a(t,i,n,s){var r,o,l=document,c=n.async,u=(n.numRetries||0)+1,d=n.before||e,h=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img)!/,"");s=s||0,/(^css!|\.css$)/.test(h)?((o=l.createElement("link")).rel="stylesheet",o.href=m,(r="hideFocus"in o)&&o.relList&&(r=0,o.rel="preload",o.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)?(o=l.createElement("img")).src=m:((o=l.createElement("script")).src=t,o.async=void 0===c||c),o.onload=o.onerror=o.onbeforeload=function(e){var l=e.type[0];if(r)try{o.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((s+=1)<u)return a(t,i,n,s)}else if("preload"==o.rel&&"style"==o.as)return o.rel="stylesheet";i(t,l,e.defaultPrevented)},!1!==d(t,o)&&l.head.appendChild(o)}function l(e,t,i){var n,s,r=(e=e.push?e:[e]).length,o=r,l=[];for(n=function(e,i,n){if("e"==i&&l.push(e),"b"==i){if(!n)return;l.push(e)}--r||t(l)},s=0;s<o;s++)a(e[s],n,i)}function c(e,i,n){var s,a;if(i&&i.trim&&(s=i),a=(s?n:i)||{},s){if(s in t)throw"LoadJS";t[s]=!0}function c(t,i){l(e,(function(e){o(a,e),t&&o({success:t,error:i},e),r(s,e)}),a)}if(a.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return s(e,(function(e){o(t,e)})),c},c.done=function(e){r(e,[])},c.reset=function(){t={},i={},n={}},c.isDefined=function(e){return e in t},c}()}(t={exports:{}}),t.exports}();function qe(e){return new Promise(((t,i)=>{De(e,{success:t,error:i})}))}function Re(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Q.call(this,this.media,e?"play":"pause"))}const He={setup(){const e=this;R(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,ce.call(e),S.object(window.Vimeo)?He.ready.call(e):qe(e.config.urls.vimeo.sdk).then((()=>{He.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:n,...s}=t;let r=e.media.getAttribute("src"),o="";S.empty(r)?(r=e.media.getAttribute(e.config.attributes.embed.id),o=e.media.getAttribute(e.config.attributes.embed.hash)):o=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(r);const a=o?{h:o}:{};i&&Object.assign(s,{controls:!1,sidedock:!1});const l=Ce({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...a,...s}),c=(u=r,S.empty(u)?null:S.number(Number(u))?u:u.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:u);var u;const d=I("iframe"),h=he(e.config.urls.vimeo.iframe,c,l);if(d.setAttribute("src",h),d.setAttribute("allowfullscreen",""),d.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),S.empty(n)||d.setAttribute("referrerPolicy",n),i||!t.customControls)d.setAttribute("data-poster",e.poster),e.media=j(d,e.media);else{const t=I("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(d),e.media=j(t,e.media)}t.customControls||ve(he(e.config.urls.vimeo.api,h)).then((t=>{!S.empty(t)&&t.thumbnail_url&&$e.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(d,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Re.call(e,!0),e.embed.play()),e.media.pause=()=>(Re.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:n,paused:s,volume:r}=e,o=s&&!i.hasPlayed;n.seeking=!0,Q.call(e,n,"seeking"),Promise.resolve(o&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>o&&i.pause())).then((()=>o&&i.setVolume(r))).catch((()=>{}))}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>p,set(t){e.embed.setPlaybackRate(t).then((()=>{p=t,Q.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,Q.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,Q.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,Ee.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,n]=t;e.embed.ratio=ue(i,n),ce.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,$e.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{m=t,Q.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,Q.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,Ae.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)));Ae.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{e.embed.getPaused().then((t=>{Re.call(e,!t),t||Q.call(e,e.media,"playing")})),S.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)})),e.embed.on("bufferstart",(()=>{Q.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{Q.call(e,e.media,"playing")})),e.embed.on("play",(()=>{Re.call(e,!0),Q.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{Re.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,m=t.seconds,Q.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,Q.call(e,e.media,"progress"),1===parseInt(t.percent,10)&&Q.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,Q.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,Q.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,Q.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,Q.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>$e.build.call(e)),0)}};function Fe(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Q.call(this,this.media,e?"play":"pause"))}function Ve(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const Be={setup(){if(R(this.elements.wrapper,this.config.classNames.embed,!0),S.object(window.YT)&&S.function(window.YT.Player))Be.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{S.function(e)&&e(),Be.ready.call(this)},qe(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){ve(he(this.config.urls.youtube.api,e)).then((e=>{if(S.object(e)){const{title:t,height:i,width:n}=e;this.config.title=t,$e.setTitle.call(this),this.embed.ratio=ue(n,i)}ce.call(this)})).catch((()=>{ce.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 n=e.media.getAttribute("src");S.empty(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));const s=(r=n,S.empty(r)?null:r.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:r);var r;const o=I("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=j(o,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${s}/${e}default.jpg`;Oe(t("maxres"),121).catch((()=>Oe(t("sd"),121))).catch((()=>Oe(t("hq")))).then((t=>$e.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:s,host:Ve(t),playerVars:M({},{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,n={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:n},Q.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),Q.call(e,e.media,"ratechange")},onReady(i){if(S.function(e.media.play))return;const n=i.target;Be.getTitle.call(e,s),e.media.play=()=>{Fe.call(e,!0),n.playVideo()},e.media.pause=()=>{Fe.call(e,!1),n.pauseVideo()},e.media.stop=()=>{n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(n.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Q.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>n.getPlaybackRate(),set(e){n.setPlaybackRate(e)}});let{volume:r}=e.config;Object.defineProperty(e.media,"volume",{get:()=>r,set(t){r=t,n.setVolume(100*r),Q.call(e,e.media,"volumechange")}});let{muted:o}=e.config;Object.defineProperty(e.media,"muted",{get:()=>o,set(t){const i=S.boolean(t)?t:o;o=i,n[i?"mute":"unMute"](),n.setVolume(100*r),Q.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>n.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const a=n.getAvailablePlaybackRates();e.options.speed=a.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),Q.call(e,e.media,"timeupdate"),Q.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Q.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Q.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((()=>$e.build.call(e)),50)},onStateChange(i){const n=i.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,Q.call(e,e.media,"seeked")),i.data){case-1:Q.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),Q.call(e,e.media,"progress");break;case 0:Fe.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):Q.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Fe.call(e,!0),Q.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{Q.call(e,e.media,"timeupdate")}),50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),Q.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),Fe.call(e,!1);break;case 3:Q.call(e,e.media,"waiting")}Q.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},Ue={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=I("div",{class:this.config.classNames.video}),L(this.media,this.elements.wrapper),this.elements.poster=I("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?de.setup.call(this):this.isYouTube?Be.setup.call(this):this.isVimeo&&He.setup.call(this)):this.debug.warn("No media element found!")}};class ze{constructor(t){e(this,"load",(()=>{this.enabled&&(S.object(window.google)&&S.object(window.google.ima)?this.ready():qe(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=I("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=Te(Math.max(this.manager.getRemainingTime(),0)),t=`${ye.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,n=I("span",{class:this.player.config.classNames.cues});n.style.left=`${i.toString()}%`,t.appendChild(n)}}}))})),e(this,"onAdEvent",(e=>{const{container:t}=this.player.elements,i=e.getAd(),n=e.getAdData();switch((e=>{Q.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:n.adError&&this.player.debug.warn(`Non-fatal ad error: ${n.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,n)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(n,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,te(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;return S.url(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${Ce({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 We(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}const Ke=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},Ye=(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 Xe{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=>{ve(e).then((i=>{const n={frames:Ke(i),height:null,urlPrefix:""};n.frames[0].text.startsWith("/")||n.frames[0].text.startsWith("http://")||n.frames[0].text.startsWith("https://")||(n.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const s=new Image;s.onload=()=>{n.height=s.naturalHeight,n.width=s.naturalWidth,this.thumbnails.push(n),t()},s.src=n.urlPrefix+n.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 n=this.player.elements.progress.getBoundingClientRect(),s=100/n.width*(e.pageX-n.left);this.seekTime=this.player.media.duration*(s/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=Te(this.seekTime);const r=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)));r&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${r.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):J.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=I("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=I("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=I("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=I("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=I("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,n)=>{this.loadedImages.includes(t.frames[e].text)&&(i=n)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),e(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:n}=i,s=i.frames[t],r=i.frames[t].text,o=n+r;if(this.currentImageElement&&this.currentImageElement.dataset.filename===r)this.showImage(this.currentImageElement,s,e,t,r,!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=o,i.dataset.index=t,i.dataset.filename=r,this.showingThumbFilename=r,this.player.debug.log(`Loading image: ${o}`),i.onload=()=>this.showImage(i,s,e,t,r,!0),this.loadingImage=i,this.removeOldImages(i)}})),e(this,"showImage",((e,t,i,n,s,r=!0)=>{this.player.debug.log(`Showing thumb: ${s}. num: ${n}. qual: ${i}. newimg: ${r}`),this.setImageSizeAndOffset(e,t),r&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(s)||this.loadedImages.push(s)),this.preloadNearby(n,!0).then(this.preloadNearby(n,!1)).then(this.getHigherQuality(i,e,t,s))})),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 n=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===n){let s;s=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let r=!1;s.forEach((e=>{const t=e.text;if(t!==n&&!this.loadedImages.includes(t)){r=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],n=e+t,s=new Image;s.src=n,s.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),r||i()}}),300)})))),e(this,"getHigherQuality",((e,t,i,n)=>{if(e<this.thumbnails.length-1){let s=t.naturalHeight;this.usingSprites&&(s=i.h),s<this.thumbContainerHeight&&setTimeout((()=>{this.showingThumbFilename===n&&(this.player.debug.log(`Showing higher quality thumb for: ${n}`),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,n=t.left-e.left+10,s=t.right-e.left-i.clientWidth-10,r=this.mousePosX-e.left-i.clientWidth/2,o=We(r,n,s);i.style.left=`${o}px`,i.style.setProperty("--preview-arrow-offset",r-o+"px")})),e(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=Ye(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}=Ye(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 Ge={insertElements(e,t){S.string(t)?_(e,this.media,{src:t}):S.array(t)&&t.forEach((t=>{_(e,this.media,t)}))},change(e){x(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:n=Me.html5,src:s}]=t,r="html5"===n?i:"div",o="html5"===n?{}:{src:s};Object.assign(this,{provider:n,type:i,supported:W.check(i,n,this.config.playsinline),media:I(r,o)}),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","")),$e.addStyleHook.call(this),this.isHTML5&&Ge.insertElements.call(this,"source",t),this.config.title=e.title,Ue.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Ge.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&$e.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 Xe(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class Je{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((()=>te(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",(()=>{W.airplay&&this.media.webkitShowPlaybackTargetPicker()})),e(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=H(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,n=R(this.elements.container,this.config.classNames.hideControls,i);if(n&&S.array(this.config.controls)&&this.config.controls.includes("settings")&&!S.empty(this.config.settings)&&Ee.toggleMenu.call(this,!1),n!==t){const e=n?"controlshidden":"controlsshown";Q.call(this,this.media,e)}return!n}return!1})),e(this,"on",((e,t)=>{X.call(this,this.elements.container,e,t)})),e(this,"once",((e,t)=>{J.call(this,this.elements.container,e,t)})),e(this,"off",((e,t)=>{G(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()):(Z.call(this),de.cancelRequests.call(this),j(this.elements.original,this.elements.container),Q.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?($e.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=>W.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=W.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=M({},Pe,Je.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 Ie(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",W),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(!W.check().api)return void this.debug.error("Setup failed: no support");const n=this.media.cloneNode(!0);n.autoplay=!1,this.elements.original=n;const s=this.media.tagName.toLowerCase();let r=null,o=null;switch(s){case"div":if(r=this.media.querySelector("iframe"),S.element(r)){if(o=Se(r.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Me.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Me.vimeo:null}(o.toString()),this.elements.container=this.media,this.media=r,this.elements.container.className="",o.search.length){const e=["1","true"];e.includes(o.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(o.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(o.searchParams.get("playsinline")),this.config.youtube.hl=o.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(Me).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Le;break;case"video":case"audio":this.type=s,this.provider=Me.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=W.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new je(this),this.storage=new be(this),this.media.plyr=this,S.element(this.elements.container)||(this.elements.container=I("div"),L(this.media,this.elements.container)),$e.migrateStyles.call(this),$e.addStyleHook.call(this),Ue.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 _e(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&$e.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ze(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>te(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Xe(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Me.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Me.youtube}get isVimeo(){return this.provider===Me.vimeo}get isVideo(){return this.type===Le}get isAudio(){return"audio"===this.type}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:n}=this;t=We(t,i,n),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 n=[!S.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(S.number),s=!0;if(!i.includes(n)){const e=ne(i,n);this.debug.warn(`Unsupported quality option: ${n}, using ${e} instead`),n=e,s=!1}t.selected=n,this.media.quality=n,s&&this.storage.set({quality:n})}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){Ge.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,Ee.setDownloadUrl.call(this))}set poster(e){this.isVideo?$e.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=ae(le.call(this));return S.array(e)?e.join(":"):e}set ratio(e){this.isVideo?S.string(e)&&oe(e)?(this.config.ratio=ae(e),ce.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){Ae.toggle.call(this,e,!1)}set currentTrack(e){Ae.set.call(this,e,!1),Ae.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){Ae.setLanguage.call(this,e,!1)}get language(){return(Ae.getCurrentTrack.call(this)||{}).language}set pip(e){if(!W.pip)return;const t=S.boolean(e)?e:!this.pip;S.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?xe:"inline"),S.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return W.pip?S.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===xe: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 Xe(this))}static supported(e,t){return W.check(e,t)}static loadSprite(e,t){return we(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 Je(e,t)))}}var Qe;return Je.defaults=(Qe=Pe,JSON.parse(JSON.stringify(Qe))),Je})),n=this,t=function(){"use strict";var e="(prefers-reduced-motion: reduce)",t={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function i(e){e.length=0}function n(e,t,i){return Array.prototype.slice.call(e,t,i)}function s(e){return e.bind.apply(e,[null].concat(n(arguments,1)))}function r(){}var o=setTimeout;function a(e){return requestAnimationFrame(e)}function l(e,t){return typeof t===e}function c(e){return!p(e)&&l("object",e)}var u=Array.isArray,d=s(l,"function"),h=s(l,"string"),m=s(l,"undefined");function p(e){return null===e}function g(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch(e){return!1}}function f(e){return u(e)?e:[e]}function y(e,t){f(e).forEach(t)}function b(e,t){return-1<e.indexOf(t)}function v(e,t){return e.push.apply(e,f(t)),e}function w(e,t,i){e&&y(t,(function(t){t&&e.classList[i?"add":"remove"](t)}))}function k(e,t){w(e,h(t)?t.split(" "):t,!0)}function T(e,t){y(t,e.appendChild.bind(e))}function E(e,t){y(e,(function(e){var i=(t||e).parentNode;i&&i.insertBefore(e,t)}))}function S(e,t){return g(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function C(e,t){return e=e?n(e.children):[],t?e.filter((function(e){return S(e,t)})):e}function A(e,t){return t?C(e,t)[0]:e.firstElementChild}var P=Object.keys;function x(e,t,i){e&&(i?P(e).reverse():P(e)).forEach((function(i){"__proto__"!==i&&t(e[i],i)}))}function M(e){return n(arguments,1).forEach((function(t){x(t,(function(i,n){e[n]=t[n]}))})),e}function L(e){return n(arguments,1).forEach((function(t){x(t,(function(t,i){u(t)?e[i]=t.slice():c(t)?e[i]=L({},c(e[i])?e[i]:{},t):e[i]=t}))})),e}function N(e,t){y(t||P(e),(function(t){delete e[t]}))}function I(e,t){y(e,(function(e){y(t,(function(t){e&&e.removeAttribute(t)}))}))}function _(e,t,i){c(t)?x(t,(function(t,i){_(e,i,t)})):y(e,(function(e){p(i)||""===i?I(e,t):e.setAttribute(t,String(i))}))}function O(e,t,i){return e=document.createElement(e),t&&(h(t)?k:_)(e,t),i&&T(i,e),e}function $(e,t,i){if(m(i))return getComputedStyle(e)[t];p(i)||(e.style[t]=""+i)}function j(e,t){$(e,"display",t)}function D(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function q(e,t){return e.getAttribute(t)}function R(e,t){return e&&e.classList.contains(t)}function H(e){return e.getBoundingClientRect()}function F(e){y(e,(function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}))}function V(e){return A((new DOMParser).parseFromString(e,"text/html").body)}function B(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function U(e,t){return e&&e.querySelector(t)}function z(e,t){return t?n(e.querySelectorAll(t)):[]}function W(e,t){w(e,t,!1)}function K(e){return e.timeStamp}function Y(e){return h(e)?e:e?e+"px":""}var X="splide",G="data-"+X;function J(e,t){if(!e)throw new Error("["+X+"] "+(t||""))}var Q=Math.min,Z=Math.max,ee=Math.floor,te=Math.ceil,ie=Math.abs;function ne(e,t,i){return ie(e-t)<i}function se(e,t,i,n){var s=Q(t,i);t=Z(t,i);return n?s<e&&e<t:s<=e&&e<=t}function re(e,t,i){var n=Q(t,i);t=Z(t,i);return Q(Z(n,e),t)}function oe(e){return(0<e)-(e<0)}function ae(e,t){return y(t,(function(t){e=e.replace("%s",""+t)})),e}function le(e){return e<10?"0"+e:""+e}var ce={};function ue(){var e=[];function t(e,t,i){y(e,(function(e){e&&y(t,(function(t){t.split(" ").forEach((function(t){t=t.split("."),i(e,t[0],t[1])}))}))}))}return{bind:function(i,n,s,r){t(i,n,(function(t,i,n){var o="addEventListener"in t,a=o?t.removeEventListener.bind(t,i,s,r):t.removeListener.bind(t,s);o?t.addEventListener(i,s,r):t.addListener(s),e.push([t,i,n,s,a])}))},unbind:function(i,n,s){t(i,n,(function(t,i,n){e=e.filter((function(e){return!!(e[0]!==t||e[1]!==i||e[2]!==n||s&&e[3]!==s)||(e[4](),!1)}))}))},dispatch:function(e,t,i){var n;return"function"==typeof CustomEvent?n=new CustomEvent(t,{bubbles:!0,detail:i}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!1,i),e.dispatchEvent(n),n},destroy:function(){e.forEach((function(e){e[4]()})),i(e)}}}var de="mounted",he="move",me="moved",pe="click",ge="refresh",fe="updated",ye="resize",be="resized",ve="scroll",we="scrolled",ke="destroy",Te="navigation:mounted",Ee="autoplay:play",Se="autoplay:pause",Ce="lazyload:loaded";function Ae(e){var t=e?e.event.bus:document.createDocumentFragment(),i=ue();return e&&e.event.on(ke,i.destroy),M(i,{bus:t,on:function(e,n){i.bind(t,f(e).join(" "),(function(e){n.apply(n,u(e.detail)?e.detail:[])}))},off:s(i.unbind,t),emit:function(e){i.dispatch(t,e,n(arguments,1))}})}function Pe(e,t,i,n){var s,r,o=Date.now,l=0,c=!0,u=0;function d(){if(!c){if(l=e?Q((o()-s)/e,1):1,i&&i(l),1<=l&&(t(),s=o(),n&&++u>=n))return h();r=a(d)}}function h(){c=!0}function m(){r&&cancelAnimationFrame(r),c=!(r=l=0)}return{start:function(t){t||m(),s=o()-(t?l*e:0),c=!1,r=a(d)},rewind:function(){s=o(),l=0,i&&i(l)},pause:h,cancel:m,set:function(t){e=t},isPaused:function(){return c}}}var xe,Me,Le=(xe="Arrow")+"Left",Ne=xe+"Right",Ie=xe+"Up",_e="ttb",Oe={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ie,Ne],ArrowRight:[xe=xe+"Down",Le]},$e="role",je="tabindex",De=(Me="aria-")+"controls",qe=Me+"current",Re=Me+"selected",He=Me+"label",Fe=Me+"labelledby",Ve=Me+"hidden",Be=Me+"orientation",Ue=Me+"roledescription",ze=Me+"live",We=Me+"busy",Ke=Me+"atomic",Ye=[$e,je,"disabled",De,qe,He,Fe,Ve,Be,Ue],Xe=X,Ge=(Me=X+"__")+"track",Je=Me+"list",Qe=Me+"slide",Ze=Qe+"--clone",et=Qe+"__container",tt=Me+"arrows",it=Me+"arrow",nt=it+"--prev",st=it+"--next",rt=Me+"pagination",ot=rt+"__page",at=Me+"progress__bar",lt=Me+"toggle",ct=Me+"sr",ut="is-active",dt="is-prev",ht="is-next",mt="is-visible",pt="is-loading",gt="is-focus-in",ft="is-overflow",yt=[ut,mt,dt,ht,pt,gt,ft],bt="touchstart mousedown",vt="touchmove mousemove",wt="touchend touchcancel mouseup click",kt="slide",Tt="loop",Et="fade";var St=G+"-interval",Ct={passive:!1,capture:!0},At={Spacebar:" ",Right:Ne,Left:Le,Up:Ie,Down:xe};function Pt(e){return e=h(e)?e:e.key,At[e]||e}var xt="keydown",Mt=G+"-lazy",Lt=Mt+"-srcset",Nt="["+Mt+"], ["+Lt+"]",It=[" ","Enter"],_t=Object.freeze({__proto__:null,Media:function(t,i,n){var s=t.state,r=n.breakpoints||{},o=n.reducedMotion||{},a=ue(),l=[];function c(e){e&&a.destroy()}function u(e,t){t=matchMedia(t),a.bind(t,"change",d),l.push([e,t])}function d(){var e=s.is(7),i=n.direction,r=l.reduce((function(e,t){return L(e,t[1].matches?t[0]:{})}),{});N(n),h(r),n.destroy?t.destroy("completely"===n.destroy):e?(c(!0),t.mount()):i!==n.direction&&t.refresh()}function h(e,i,r){L(n,e),i&&L(Object.getPrototypeOf(n),e),!r&&s.is(1)||t.emit(fe,n)}return{setup:function(){var t="min"===n.mediaQuery;P(r).sort((function(e,i){return t?+e-+i:+i-+e})).forEach((function(e){u(r[e],"("+(t?"min":"max")+"-width:"+e+"px)")})),u(o,e),d()},destroy:c,reduce:function(t){matchMedia(e).matches&&(t?L(n,o):N(n,P(o)))},set:h}},Direction:function(e,t,i){return{resolve:function(e,t,n){var s="rtl"!==(n=n||i.direction)||t?n===_e?0:-1:1;return Oe[e]&&Oe[e][s]||e.replace(/width|left|right/i,(function(e,t){return e=Oe[e.toLowerCase()][s]||e,0<t?e.charAt(0).toUpperCase()+e.slice(1):e}))},orient:function(e){return e*("rtl"===i.direction?1:-1)}}},Elements:function(e,t,n){var s,r,o,a=Ae(e),l=a.on,c=a.bind,u=e.root,h=n.i18n,m={},p=[],g=[],f=[];function y(){s=E("."+Ge),r=A(s,"."+Je),J(s&&r,"A track/list element is missing."),v(p,C(r,"."+Qe+":not(."+Ze+")")),x({arrows:tt,pagination:rt,prev:nt,next:st,bar:at,toggle:lt},(function(e,t){m[t]=E("."+e)})),M(m,{root:u,track:s,list:r,slides:p});var e=u.id||function(e){return""+e+le(ce[e]=(ce[e]||0)+1)}(X),t=n.role;u.id=e,s.id=s.id||e+"-track",r.id=r.id||e+"-list",!q(u,$e)&&"SECTION"!==u.tagName&&t&&_(u,$e,t),_(u,Ue,h.carousel),_(r,$e,"presentation"),T()}function b(e){var t=Ye.concat("style");i(p),W(u,g),W(s,f),I([s,r],t),I(u,e?t:["style",Ue])}function T(){W(u,g),W(s,f),g=P(Xe),f=P(Ge),k(u,g),k(s,f),_(u,He,n.label),_(u,Fe,n.labelledby)}function E(e){return(e=U(u,e))&&function(e,t){if(d(e.closest))return e.closest(t);for(var i=e;i&&1===i.nodeType&&!S(i,t);)i=i.parentElement;return i}(e,"."+Xe)===u?e:void 0}function P(e){return[e+"--"+n.type,e+"--"+n.direction,n.drag&&e+"--draggable",n.isNavigation&&e+"--nav",e===Xe&&ut]}return M(m,{setup:y,mount:function(){l(ge,b),l(ge,y),l(fe,T),c(document,bt+" keydown",(function(e){o="keydown"===e.type}),{capture:!0}),c(u,"focusin",(function(){w(u,gt,!!o)}))},destroy:b})},Slides:function(e,t,n){var r=Ae(e),o=r.on,a=r.emit,l=r.bind,c=(r=t.Elements).slides,u=r.list,m=[];function p(){c.forEach((function(e,t){C(e,t,-1)}))}function v(){x((function(e){e.destroy()})),i(m)}function C(t,i,n){i=function(e,t,i,n){var r,o=Ae(e),a=o.on,l=o.emit,c=o.bind,u=e.Components,d=e.root,h=e.options,m=h.isNavigation,p=h.updateOnMove,g=h.i18n,f=h.pagination,y=h.slideFocus,b=u.Direction.resolve,v=q(n,"style"),k=q(n,He),T=-1<i,E=A(n,"."+et);function S(){var s=e.splides.map((function(e){return(e=e.splide.Components.Slides.getAt(t))?e.slide.id:""})).join(" ");_(n,He,ae(g.slideX,(T?i:t)+1)),_(n,De,s),_(n,$e,y?"button":""),y&&I(n,Ue)}function C(){r||P()}function P(){var i,s,o;r||(i=e.index,(o=x())!==R(n,ut)&&(w(n,ut,o),_(n,qe,m&&o||""),l(o?"active":"inactive",M)),o=function(){if(e.is(Et))return x();var t=H(u.Elements.track),i=H(n),s=b("left",!0),r=b("right",!0);return ee(t[s])<=te(i[s])&&ee(i[r])<=te(t[r])}(),s=!o&&(!x()||T),e.state.is([4,5])||_(n,Ve,s||""),_(z(n,h.focusableNodes||""),je,s?-1:""),y&&_(n,je,s?-1:0),o!==R(n,mt)&&(w(n,mt,o),l(o?"visible":"hidden",M)),o||document.activeElement!==n||(s=u.Slides.getAt(e.index))&&D(s.slide),w(n,dt,t===i-1),w(n,ht,t===i+1))}function x(){var n=e.index;return n===t||h.cloneStatus&&n===i}var M={index:t,slideIndex:i,slide:n,container:E,isClone:T,mount:function(){T||(n.id=d.id+"-slide"+le(t+1),_(n,$e,f?"tabpanel":"group"),_(n,Ue,g.slide),_(n,He,k||ae(g.slideLabel,[t+1,e.length]))),c(n,"click",s(l,pe,M)),c(n,"keydown",s(l,"sk",M)),a([me,"sh",we],P),a(Te,S),p&&a(he,C)},destroy:function(){r=!0,o.destroy(),W(n,yt),I(n,Ye),_(n,"style",v),_(n,He,k||"")},update:P,style:function(e,t,i){$(i&&E||n,e,t)},isWithin:function(i,n){return i=ie(i-t),(i=T||!h.rewind&&!e.is(Tt)?i:Q(i,e.length-i))<=n}};return M}(e,i,n,t),i.mount(),m.push(i),m.sort((function(e,t){return e.index-t.index}))}function P(e){return e?M((function(e){return!e.isClone})):m}function x(e,t){P(t).forEach(e)}function M(e){return m.filter(d(e)?e:function(t){return h(e)?S(t.slide,e):b(f(e),t.index)})}return{mount:function(){p(),o(ge,v),o(ge,p)},destroy:v,update:function(){x((function(e){e.update()}))},register:C,get:P,getIn:function(e){var i=t.Controller,s=i.toIndex(e),r=i.hasFocus()?1:n.perPage;return M((function(e){return se(e.index,s,s+r-1)}))},getAt:function(e){return M(e)[0]},add:function(e,t){y(e,(function(e){var i,r,o;g(e=h(e)?V(e):e)&&((i=c[t])?E(e,i):T(u,e),k(e,n.classes.slide),i=e,r=s(a,ye),i=z(i,"img"),(o=i.length)?i.forEach((function(e){l(e,"load error",(function(){--o||r()}))})):r())})),a(ge)},remove:function(e){F(M(e).map((function(e){return e.slide}))),a(ge)},forEach:x,filter:M,style:function(e,t,i){x((function(n){n.style(e,t,i)}))},getLength:function(e){return(e?c:m).length},isEnough:function(){return m.length>n.perPage}}},Layout:function(e,t,i){var n,r,o,a=(d=Ae(e)).on,l=d.bind,u=d.emit,d=t.Slides,h=t.Direction.resolve,m=(t=t.Elements).root,p=t.track,g=t.list,f=d.getAt,y=d.style;function b(){n=i.direction===_e,$(m,"maxWidth",Y(i.width)),$(p,h("paddingLeft"),k(!1)),$(p,h("paddingRight"),k(!0)),v(!0)}function v(e){var t=H(m);!e&&r.width===t.width&&r.height===t.height||($(p,"height",function(){var e="";return n&&(J(e=T(),"height or heightRatio is missing."),e="calc("+e+" - "+k(!1)+" - "+k(!0)+")"),e}()),y(h("marginRight"),Y(i.gap)),y("width",i.autoWidth?null:Y(i.fixedWidth)||(n?"":E())),y("height",Y(i.fixedHeight)||(n?i.autoHeight?null:E():T()),!0),r=t,u(be),o!==(o=M())&&(w(m,ft,o),u("overflow",o)))}function k(e){var t=i.padding;e=h(e?"right":"left");return t&&Y(t[e]||(c(t)?0:t))||"0px"}function T(){return Y(i.height||H(g).width*i.heightRatio)}function E(){var e=Y(i.gap);return"calc((100%"+(e&&" + "+e)+")/"+(i.perPage||1)+(e&&" - "+e)+")"}function S(){return H(g)[h("width")]}function C(e,t){return(e=f(e||0))?H(e.slide)[h("width")]+(t?0:x()):0}function A(e,t){var i;return(e=f(e))?(e=H(e.slide)[h("right")],i=H(g)[h("left")],ie(e-i)+(t?0:x())):0}function P(t){return A(e.length-1)-A(0)+C(0,t)}function x(){var e=f(0);return e&&parseFloat($(e.slide,h("marginRight")))||0}function M(){return e.is(Et)||P(!0)>S()}return{mount:function(){var e,t;b(),l(window,"resize load",(e=s(u,ye),t=Pe(0,e,null,1),function(){t.isPaused()&&t.start()})),a([fe,ge],b),a(ye,v)},resize:v,listSize:S,slideSize:C,sliderSize:P,totalSize:A,getPadding:function(e){return parseFloat($(p,h("padding"+(e?"Right":"Left"))))||0},isOverflow:M}},Clones:function(e,t,n){var s,r=Ae(e),o=r.on,a=t.Elements,l=t.Slides,c=t.Direction.resolve,u=[];function d(){if(o(ge,h),o([fe,ye],g),s=f()){var i=s,r=l.get().slice(),c=r.length;if(c){for(;r.length<i;)v(r,r);v(r.slice(-i),r.slice(0,i)).forEach((function(t,s){var o=s<i,d=function(t,i){return k(t=t.cloneNode(!0),n.classes.clone),t.id=e.root.id+"-clone"+le(i+1),t}(t.slide,s);o?E(d,r[0].slide):T(a.list,d),v(u,d),l.register(d,s-i+(o?0:c),t.index)}))}t.Layout.resize(!0)}}function h(){p(),d()}function p(){F(u),i(u),r.destroy()}function g(){var e=f();s!==e&&(s<e||!e)&&r.emit(ge)}function f(){var i,s=n.clones;return e.is(Tt)?m(s)&&(s=(i=n[c("fixedWidth")]&&t.Layout.slideSize(0))&&te(H(a.track)[c("width")]/i)||n[c("autoWidth")]&&e.length||2*n.perPage):s=0,s}return{mount:d,destroy:p}},Move:function(e,t,i){var n,s=Ae(e),r=s.on,o=s.emit,a=e.state.set,l=(s=t.Layout).slideSize,c=s.getPadding,u=s.totalSize,d=s.listSize,h=s.sliderSize,p=(s=t.Direction).resolve,g=s.orient,f=(s=t.Elements).list,y=s.track;function b(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function v(e){w(S(e,!0))}function w(i,n){e.is(Et)||(n=n?i:function(i){var n,s;return e.is(Tt)&&(s=(n=E(i))>t.Controller.getEnd(),(n<0||s)&&(i=k(i,s))),i}(i),$(f,"transform","translate"+p("X")+"("+n+"px)"),i!==n&&o("sh"))}function k(e,t){var i=e-A(t),n=h();return e-g(n*(te(ie(i)/n)||1))*(t?1:-1)}function T(){w(C(),!0),n.cancel()}function E(e){for(var i=t.Slides.get(),n=0,s=1/0,r=0;r<i.length;r++){var o=i[r].index,a=ie(S(o,!0)-e);if(!(a<=s))break;s=a,n=o}return n}function S(t,n){var s=g(u(t-1)-("center"===(s=i.focus)?(d()-l(t,!0))/2:+s*l(t)||0));return n?(t=s,t=i.trimSpace&&e.is(kt)?re(t,0,g(h(!0)-d())):t):s}function C(){var e=p("left");return H(f)[e]-H(y)[e]+g(c(!1))}function A(e){return S(e?t.Controller.getEnd():0,!!i.trimSpace)}return{mount:function(){n=t.Transition,r([de,be,fe,ge],b)},move:function(e,t,i,s){var r,l;e!==t&&(r=i<e,l=g(k(C(),r)),r?0<=l:l<=f[p("scrollWidth")]-H(y)[p("width")])&&(T(),w(k(C(),i<e),!0)),a(4),o(he,t,i,e),n.start(t,(function(){a(3),o(me,t,i,e),s&&s()}))},jump:v,translate:w,shift:k,cancel:T,toIndex:E,toPosition:S,getPosition:C,getLimit:A,exceededLimit:function(e,t){t=m(t)?C():t;var i=!0!==e&&g(t)<g(A(!1));e=!1!==e&&g(t)>g(A(!0));return i||e},reposition:b}},Controller:function(e,t,i){var n,r,o,a,l=Ae(e),c=l.on,u=l.emit,d=t.Move,p=d.getPosition,g=d.getLimit,f=d.toPosition,y=(l=t.Slides).isEnough,b=l.getLength,v=i.omitEnd,w=e.is(Tt),k=e.is(kt),T=s(x,!1),E=s(x,!0),S=i.start||0,C=S;function A(){r=b(!0),o=i.perMove,a=i.perPage,n=N();var e=re(S,0,v?n:r-1);e!==S&&(S=e,d.reposition())}function P(){n!==N()&&u("ei")}function x(e,t){var i=o||($()?1:a);return-1===(i=M(S+i*(e?-1:1),S,!(o||$())))&&k&&!ne(p(),g(!e),1)?e?0:n:t?i:L(i)}function M(t,s,l){var c;return y()||$()?((c=function(t){if(k&&"move"===i.trimSpace&&t!==S)for(var n=p();n===f(t,!0)&&se(t,0,e.length-1,!i.rewind);)t<S?--t:++t;return t}(t))!==t&&(s=t,t=c,l=!1),t<0||n<t?t=o||!se(0,t,s,!0)&&!se(n,s,t,!0)?w?l?t<0?-(r%a||a):r:t:i.rewind?t<0?n:0:-1:I(_(t)):l&&t!==s&&(t=I(_(s)+(t<s?-1:1)))):t=-1,t}function L(e){return w?(e+r)%r||0:e}function N(){for(var e=r-($()||w&&o?1:a);v&&0<e--;)if(f(r-1,!0)!==f(e,!0)){e++;break}return re(e,0,r-1)}function I(e){return re($()?e:a*e,0,n)}function _(e){return $()?Q(e,n):ee((n<=e?r-1:e)/a)}function O(e){e!==S&&(C=S,S=e)}function $(){return!m(i.focus)||i.isNavigation}function j(){return e.state.is([4,5])&&!!i.waitForTransition}return{mount:function(){A(),c([fe,ge,"ei"],A),c(be,P)},go:function(e,t,i){var s;j()||-1<(s=L(e=function(e){var t,i,s=S;return h(e)?(t=(i=e.match(/([+\-<>])(\d+)?/)||[])[1],i=i[2],"+"===t||"-"===t?s=M(S+ +(""+t+(+i||1)),S):">"===t?s=i?I(+i):T(!0):"<"===t&&(s=E(!0))):s=w?e:re(e,0,n),s}(e)))&&(t||s!==S)&&(O(s),d.move(e,s,C,i))},scroll:function(e,i,s,r){t.Scroll.scroll(e,i,s,(function(){var e=L(d.toIndex(p()));O(v?Q(e,n):e),r&&r()}))},getNext:T,getPrev:E,getAdjacent:x,getEnd:N,setIndex:O,getIndex:function(e){return e?C:S},toIndex:I,toPage:_,toDest:function(e){return e=d.toIndex(e),k?re(e,0,n):e},hasFocus:$,isBusy:j}},Arrows:function(e,t,i){var n,r,o=Ae(e),a=o.on,l=o.bind,c=o.emit,u=i.classes,d=i.i18n,h=t.Elements,m=t.Controller,p=h.arrows,g=h.track,f=p,y=h.prev,b=h.next,v={};function w(){var e=i.arrows;!e||y&&b||(f=p||O("div",u.arrows),y=P(!0),b=P(!1),n=!0,T(f,[y,b]),p||E(f,g)),y&&b&&(M(v,{prev:y,next:b}),j(f,e?"":"none"),k(f,r=tt+"--"+i.direction),e&&(a([de,me,ge,we,"ei"],x),l(b,"click",s(A,">")),l(y,"click",s(A,"<")),x(),_([y,b],De,g.id),c("arrows:mounted",y,b))),a(fe,S)}function S(){C(),w()}function C(){o.destroy(),W(f,r),n?(F(p?[y,b]:f),y=b=null):I([y,b],Ye)}function A(e){m.go(e,!0)}function P(e){return V('<button class="'+u.arrow+" "+(e?u.prev:u.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(i.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function x(){var t,i,n,s;y&&b&&(s=e.index,t=m.getPrev(),i=m.getNext(),n=-1<t&&s<t?d.last:d.prev,s=-1<i&&i<s?d.first:d.next,y.disabled=t<0,b.disabled=i<0,_(y,He,n),_(b,He,s),c("arrows:updated",y,b,t,i))}return{arrows:v,mount:w,destroy:C,update:x}},Autoplay:function(e,t,i){var n,s,r=Ae(e),o=r.on,a=r.bind,l=r.emit,c=Pe(i.interval,e.go.bind(e,">"),(function(e){var t=d.bar;t&&$(t,"width",100*e+"%"),l("autoplay:playing",e)})),u=c.isPaused,d=t.Elements,h=(r=t.Elements).root,m=r.toggle,p=i.autoplay,g="pause"===p;function f(){u()&&t.Slides.isEnough()&&(c.start(!i.resetProgress),s=n=g=!1,v(),l(Ee))}function y(e){g=!!(e=void 0===e||e),v(),u()||(c.pause(),l(Se))}function b(){g||(n||s?y(!1):f())}function v(){m&&(w(m,ut,!g),_(m,He,i.i18n[g?"play":"pause"]))}function k(e){e=t.Slides.getAt(e),c.set(e&&+q(e.slide,St)||i.interval)}return{mount:function(){p&&(i.pauseOnHover&&a(h,"mouseenter mouseleave",(function(e){n="mouseenter"===e.type,b()})),i.pauseOnFocus&&a(h,"focusin focusout",(function(e){s="focusin"===e.type,b()})),m&&a(m,"click",(function(){g?f():y(!0)})),o([he,ve,ge],c.rewind),o(he,k),m&&_(m,De,d.track.id),g||f(),v())},destroy:c.cancel,play:f,pause:y,isPaused:u}},Cover:function(e,t,i){var n=Ae(e).on;function r(e){t.Slides.forEach((function(t){var i=A(t.container||t.slide,"img");i&&i.src&&o(e,i,t)}))}function o(e,t,i){i.style("background",e?'center/cover no-repeat url("'+t.src+'")':"",!0),j(t,e?"none":"")}return{mount:function(){i.cover&&(n(Ce,s(o,!0)),n([de,fe,ge],s(r,!0)))},destroy:s(r,!1)}},Scroll:function(e,t,i){var n,r,o=Ae(e),a=o.on,l=o.emit,c=e.state.set,u=t.Move,d=u.getPosition,h=u.getLimit,m=u.exceededLimit,p=u.translate,g=e.is(kt),f=1;function y(e,i,o,a,h){var p,y=d();w(),!o||g&&m()||(o=t.Layout.sliderSize(),p=oe(e)*o*ee(ie(e)/o)||0,e=u.toPosition(t.Controller.toDest(e%o))+p),o=ne(y,e,1);f=1,i=o?0:i||Z(ie(e-y)/1.5,800),r=a,n=Pe(i,b,s(v,y,e,h),1),c(5),l(ve),n.start()}function b(){c(3),r&&r(),l(we)}function v(e,t,n,s){var o=d();s=(e+(t-e)*(t=s,(e=i.easingFunc)?e(t):1-Math.pow(1-t,4))-o)*f;p(o+s),g&&!n&&m()&&(f*=.6,ie(s)<10&&y(h(m(!0)),600,!1,r,!0))}function w(){n&&n.cancel()}function k(){n&&!n.isPaused()&&(w(),b())}return{mount:function(){a(he,w),a([fe,ge],k)},destroy:w,scroll:y,cancel:k}},Drag:function(e,t,i){var n,s,o,a,l,u,d,h,m=Ae(e),p=m.on,g=m.emit,f=m.bind,y=m.unbind,b=e.state,v=t.Move,w=t.Scroll,k=t.Controller,T=t.Elements.track,E=t.Media.reduce,C=(m=t.Direction).resolve,A=m.orient,P=v.getPosition,x=v.exceededLimit,M=!1;function L(){var e=i.drag;F(!e),a="free"===e}function N(e){var t,n,s;u=!1,d||(t=H(e),n=e.target,s=i.noDrag,S(n,"."+ot+", ."+it)||s&&S(n,s)||!t&&e.button||(k.isBusy()?B(e,!0):(h=t?T:window,l=b.is([4,5]),o=null,f(h,vt,I,Ct),f(h,wt,_,Ct),v.cancel(),w.cancel(),$(e))))}function I(t){var s,r,o,a,d;b.is(6)||(b.set(6),g("drag")),t.cancelable&&(l?(v.translate(n+j(t)/(M&&e.is(kt)?5:1)),d=200<D(t),s=M!==(M=x()),(d||s)&&$(t),u=!0,g("dragging"),B(t)):ie(j(d=t))>ie(j(d,!0))&&(s=t,a=(o=c(r=i.dragMinThreshold))&&r.mouse||0,o=(o?r.touch:+r)||10,l=ie(j(s))>(H(s)?o:a),B(t)))}function _(n){var s,r,o;b.is(6)&&(b.set(3),g("dragged")),l&&(r=function(e){return P()+oe(e)*Q(ie(e)*(i.flickPower||600),a?1/0:t.Layout.listSize()*(i.flickMaxPages||1))}(s=function(t){if(e.is(Tt)||!M){var i=D(t);if(i&&i<200)return j(t)/i}return 0}(s=n)),o=i.rewind&&i.rewindByDrag,E(!1),a?k.scroll(r,0,i.snap):e.is(Et)?k.go(A(oe(s))<0?o?"<":"-":o?">":"+"):e.is(kt)&&M&&o?k.go(x(!0)?">":"<"):k.go(k.toDest(r),!0),E(!0),B(n)),y(h,vt,I),y(h,wt,_),l=!1}function O(e){!d&&u&&B(e,!0)}function $(e){o=s,s=e,n=P()}function j(e,t){return R(e,t)-R(q(e),t)}function D(e){return K(e)-K(q(e))}function q(e){return s===e&&o||s}function R(e,t){return(H(e)?e.changedTouches[0]:e)["page"+C(t?"Y":"X")]}function H(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function F(e){d=e}return{mount:function(){f(T,vt,r,Ct),f(T,wt,r,Ct),f(T,bt,N,Ct),f(T,"click",O,{capture:!0}),f(T,"dragstart",B),p([de,fe],L)},disable:F,isDragging:function(){return l}}},Keyboard:function(e,t,i){var n,s,r=Ae(e),a=r.on,l=r.bind,c=r.unbind,u=e.root,d=t.Direction.resolve;function h(){var e=i.keyboard;e&&(n="global"===e?window:u,l(n,xt,g))}function m(){c(n,xt)}function p(){var e=s;s=!0,o((function(){s=e}))}function g(t){s||((t=Pt(t))===d(Le)?e.go("<"):t===d(Ne)&&e.go(">"))}return{mount:function(){h(),a(fe,m),a(fe,h),a(he,p)},destroy:m,disable:function(e){s=e}}},LazyLoad:function(e,t,n){var r=Ae(e),o=r.on,a=r.off,l=r.bind,c=r.emit,u="sequential"===n.lazyLoad,d=[me,we],h=[];function m(){i(h),t.Slides.forEach((function(e){z(e.slide,Nt).forEach((function(t){var i=q(t,Mt),s=q(t,Lt);i===t.src&&s===t.srcset||(i=n.classes.spinner,i=A(s=t.parentElement,"."+i)||O("span",i,s),h.push([t,e,i]),t.src||j(t,"none"))}))})),(u?y:(a(d),o(d,p),p))()}function p(){(h=h.filter((function(t){var i=n.perPage*((n.preloadPages||1)+1)-1;return!t[1].isWithin(e.index,i)||g(t)}))).length||a(d)}function g(e){var t=e[0];k(e[1].slide,pt),l(t,"load error",s(f,e)),_(t,"src",q(t,Mt)),_(t,"srcset",q(t,Lt)),I(t,Mt),I(t,Lt)}function f(e,t){var i=e[0],n=e[1];W(n.slide,pt),"error"!==t.type&&(F(e[2]),j(i,""),c(Ce,i,n),c(ye)),u&&y()}function y(){h.length&&g(h.shift())}return{mount:function(){n.lazyLoad&&(m(),o(ge,m))},destroy:s(i,h),check:p}},Pagination:function(e,t,r){var o,a,l=Ae(e),c=l.on,u=l.emit,d=l.bind,h=t.Slides,m=t.Elements,p=t.Controller,g=p.hasFocus,f=p.getIndex,y=p.go,b=t.Direction.resolve,v=m.pagination,w=[];function T(){o&&(F(v?n(o.children):o),W(o,a),i(w),o=null),l.destroy()}function E(e){y(">"+e,!0)}function S(e,t){var i=w.length,n=Pt(t),s=C(),r=-1;(s=(n===b(Ne,!1,s)?r=++e%i:n===b(Le,!1,s)?r=(--e+i)%i:"Home"===n?r=0:"End"===n&&(r=i-1),w[r]))&&(D(s.button),y(">"+r),B(t,!0))}function C(){return r.paginationDirection||r.direction}function A(e){return w[p.toPage(e)]}function P(){var e,t=A(f(!0)),i=A(f());t&&(W(e=t.button,ut),I(e,Re),_(e,je,-1)),i&&(k(e=i.button,ut),_(e,Re,!0),_(e,je,"")),u("pagination:updated",{list:o,items:w},t,i)}return{items:w,mount:function t(){T(),c([fe,ge,"ei"],t);var i=r.pagination;if(v&&j(v,i?"":"none"),i){c([he,ve,we],P);i=e.length;var n=r.classes,l=r.i18n,f=r.perPage,y=g()?p.getEnd()+1:te(i/f);k(o=v||O("ul",n.pagination,m.track.parentElement),a=rt+"--"+C()),_(o,$e,"tablist"),_(o,He,l.select),_(o,Be,C()===_e?"vertical":"");for(var b=0;b<y;b++){var x=O("li",null,o),M=O("button",{class:n.page,type:"button"},x),L=h.getIn(b).map((function(e){return e.slide.id})),N=!g()&&1<f?l.pageX:l.slideX;d(M,"click",s(E,b)),r.paginationKeyboard&&d(M,"keydown",s(S,b)),_(x,$e,"presentation"),_(M,$e,"tab"),_(M,De,L.join(" ")),_(M,He,ae(N,b+1)),_(M,je,-1),w.push({li:x,button:M,page:b})}P(),u("pagination:mounted",{list:o,items:w},A(e.index))}},destroy:T,getAt:A,update:P}},Sync:function(e,t,n){var r=n.isNavigation,o=n.slideFocus,a=[];function l(){var t,i;e.splides.forEach((function(t){t.isParent||(u(e,t.splide),u(t.splide,e))})),r&&((i=(t=Ae(e)).on)(pe,h),i("sk",p),i([de,fe],d),a.push(t),t.emit(Te,e.splides))}function c(){a.forEach((function(e){e.destroy()})),i(a)}function u(e,t){(e=Ae(e)).on(he,(function(e,i,n){t.go(t.is(Tt)?n:e)})),a.push(e)}function d(){_(t.Elements.list,Be,n.direction===_e?"vertical":"")}function h(t){e.go(t.index)}function p(e,t){b(It,Pt(t))&&(h(e),B(t))}return{setup:s(t.Media.set,{slideFocus:m(o)?r:o},!0),mount:l,destroy:c,remount:function(){c(),l()}}},Wheel:function(e,t,i){var n=Ae(e).bind,s=0;function r(n){var r,o,a,l,c;n.cancelable&&(r=(c=n.deltaY)<0,o=K(n),a=i.wheelMinThreshold||0,l=i.wheelSleep||0,ie(c)>a&&l<o-s&&(e.go(r?"<":">"),s=o),c=r,i.releaseWheel&&!e.state.is(4)&&-1===t.Controller.getAdjacent(c)||B(n))}return{mount:function(){i.wheel&&n(t.Elements.track,"wheel",r,Ct)}}},Live:function(e,t,i){var n=Ae(e).on,r=t.Elements.track,o=i.live&&!i.isNavigation,a=O("span",ct),l=Pe(90,s(c,!1));function c(e){_(r,We,e),e?(T(r,a),l.start()):(F(a),l.cancel())}function u(e){o&&_(r,ze,e?"off":"polite")}return{mount:function(){o&&(u(!t.Autoplay.isPaused()),_(r,Ke,!0),a.textContent="?",n(Ee,s(u,!0)),n(Se,s(u,!1)),n([me,we],s(c,!0)))},disable:u,destroy:function(){I(r,[ze,Ke,We]),F(a)}}}}),Ot={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:{slide:Qe,clone:Ze,arrows:tt,arrow:it,prev:nt,next:st,pagination:rt,page:ot,spinner:Me+"spinner"},i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function $t(e,t,i){var n=t.Slides;function s(){n.forEach((function(e){e.style("transform","translateX(-"+100*e.index+"%)")}))}return{mount:function(){Ae(e).on([de,ge],s)},start:function(e,t){n.style("transition","opacity "+i.speed+"ms "+i.easing),o(t)},cancel:r}}function jt(e,t,i){var n,r=t.Move,o=t.Controller,a=t.Scroll,l=t.Elements.list,c=s($,l,"transition");function u(){c(""),a.cancel()}return{mount:function(){Ae(e).bind(l,"transitionend",(function(e){e.target===l&&n&&(u(),n())}))},start:function(t,s){var l=r.toPosition(t,!0),u=r.getPosition(),d=function(t){var n=i.rewindSpeed;if(e.is(kt)&&n){var s=o.getIndex(!0),r=o.getEnd();if(0===s&&r<=t||r<=s&&0===t)return n}return i.speed}(t);1<=ie(l-u)&&1<=d?i.useScroll?a.scroll(l,d,!1,s):(c("transform "+d+"ms "+i.easing),r.translate(l,!0),n=s):(r.jump(t),s())},cancel:u}}return Ie=function(){function e(t,i){this.event=Ae(),this.Components={},this.state=function(e){var t=e;return{set:function(e){t=e},is:function(e){return b(f(e),t)}}}(1),this.splides=[],this.n={},this.t={},J(t=h(t)?U(document,t):t,t+" is invalid."),i=L({label:q(this.root=t,He)||"",labelledby:q(t,Fe)||""},Ot,e.defaults,i||{});try{L(i,JSON.parse(q(t,G)))}catch(t){J(!1,"Invalid JSON")}this.n=Object.create(L({},i))}var t=e.prototype;return t.mount=function(e,t){var i=this,n=this.state,s=this.Components;return J(n.is([1,7]),"Already mounted!"),n.set(1),this.i=s,this.r=t||this.r||(this.is(Et)?$t:jt),this.t=e||this.t,x(M({},_t,this.t,{Transition:this.r}),(function(e,t){e=e(i,s,i.n),(s[t]=e).setup&&e.setup()})),x(s,(function(e){e.mount&&e.mount()})),this.emit(de),k(this.root,"is-initialized"),n.set(3),this.emit("ready"),this},t.sync=function(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this.i.Sync.remount(),e.Components.Sync.remount()),this},t.go=function(e){return this.i.Controller.go(e),this},t.on=function(e,t){return this.event.on(e,t),this},t.off=function(e){return this.event.off(e),this},t.emit=function(e){var t;return(t=this.event).emit.apply(t,[e].concat(n(arguments,1))),this},t.add=function(e,t){return this.i.Slides.add(e,t),this},t.remove=function(e){return this.i.Slides.remove(e),this},t.is=function(e){return this.n.type===e},t.refresh=function(){return this.emit(ge),this},t.destroy=function(e){void 0===e&&(e=!0);var t=this.event,n=this.state;return n.is(1)?Ae(this).on("ready",this.destroy.bind(this,e)):(x(this.i,(function(t){t.destroy&&t.destroy(e)}),!0),t.emit(ke),t.destroy(),e&&i(this.splides),n.set(7)),this},Jt(e,[{key:"options",get:function(){return this.n},set:function(e){this.i.Media.set(e,!0,!0)}},{key:"length",get:function(){return this.i.Slides.getLength(!0)}},{key:"index",get:function(){return this.i.Controller.getIndex()}}]),e}(),Ie.defaults={},Ie.STATES=t,Ie},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).Splide=t();
|