2147483647)throw RangeError(yr);if(n==a){for(var f=o,d=36;;d+=36){var p=d<=s?1:d>=s+26?26:d-s;if(f0?arguments[0]:void 0,u=this,h=[];if(Or(u,{type:"URLSearchParams",entries:h,updateURL:function(){},updateSearchParams:Br}),void 0!==c)if(g(c))if("function"==typeof(e=pr(c)))for(n=(t=e.call(c)).next;!(i=n.call(t)).done;){if((o=(a=(r=Ar(P(i.value))).next).call(r)).done||(s=a.call(r)).done||!a.call(r).done)throw TypeError("Expected sequence with length 2");h.push({key:o.value+"",value:s.value+""})}else for(l in c)b(c,l)&&h.push({key:l,value:c[l]+""});else Hr(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},Kr=Wr.prototype;Er(Kr,{append:function(e,t){Vr(arguments.length,2);var n=Ir(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){Vr(arguments.length,1);for(var t=Ir(this),n=t.entries,i=e+"",r=0;re.key){r.splice(t,0,e);break}t===n&&r.push(e)}i.updateURL()},forEach:function(e){for(var t,n=Ir(this).entries,i=rt(e,arguments.length>1?arguments[1]:void 0,3),r=0;r1&&(t=arguments[1],g(t)&&(n=t.body,"URLSearchParams"===ni(n)&&((i=t.headers?new xr(t.headers):new xr).has("content-type")||i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Be(t,{body:c(0,String(n)),headers:c(0,i)}))),r.push(t)),Pr.apply(this,r)}});var $r,Yr={URLSearchParams:Wr,getState:Ir},Gr=bi.codeAt,Xr=i.URL,Qr=Yr.URLSearchParams,Jr=Yr.getState,Zr=Z.set,ea=Z.getterFor("URL"),ta=Math.floor,na=Math.pow,ia=/[A-Za-z]/,ra=/[\d+-.A-Za-z]/,aa=/\d/,oa=/^(0x|0X)/,sa=/^[0-7]+$/,la=/^\d+$/,ca=/^[\dA-Fa-f]+$/,ua=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,ha=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,fa=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,da=/[\u0009\u000A\u000D]/g,pa=function(e,t){var n,i,r;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=ga(t.slice(1,-1))))return"Invalid host";e.host=n}else if(Ea(e)){if(t=function(e){var t,n,i=[],r=e.toLowerCase().replace(vr,".").split(".");for(t=0;t4)return e;for(n=[],i=0;i1&&"0"==r.charAt(0)&&(a=oa.test(r)?16:8,r=r.slice(8==a?1:2)),""===r)o=0;else{if(!(10==a?la:8==a?sa:ca).test(r))return e;o=parseInt(r,a)}n.push(o)}for(i=0;i=na(256,5-t))return null}else if(o>255)return null;for(s=n.pop(),i=0;i6)return;for(i=0;f();){if(r=null,i>0){if(!("."==f()&&i<4))return;h++}if(!aa.test(f()))return;for(;aa.test(f());){if(a=parseInt(f(),10),null===r)r=a;else{if(0==r)return;r=10*r+a}if(r>255)return;h++}l[c]=256*l[c]+r,2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(o=c-u,c=7;0!=c&&o>0;)s=l[c],l[c--]=l[u+o-1],l[u+--o]=s;else if(8!=c)return;return l},va=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=ta(e/256);return t.join(".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,a=0;a<8;a++)0!==e[a]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=a),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},ya={},ba=lr({},ya,{" ":1,'"':1,"<":1,""+">":1,"`":1}),wa=lr({},ba,{"#":1,"?":1,"{":1,"}":1}),ka=lr({},wa,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ta=function(e,t){var n=Gr(e,0);return n>32&&n<127&&!b(t,e)?e:encodeURIComponent(e)},Sa={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ea=function(e){return b(Sa,e.scheme)},Aa=function(e){return""!=e.username||""!=e.password},Pa=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},xa=function(e,t){var n;return 2==e.length&&ia.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},Ca=function(e){var t;return e.length>1&&xa(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},Oa=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&xa(t[0],!0)||t.pop()},Ia=function(e){return"."===e||"%2e"===e.toLowerCase()},La={},ja={},Na={},Ra={},Ma={},_a={},Ua={},Da={},Fa={},qa={},Ha={},Ba={},Va={},za={},Wa={},Ka={},$a={},Ya={},Ga={},Xa={},Qa={},Ja=function(e,t,n,i){var r,a,o,s,l,c=n||La,u=0,h="",f=!1,d=!1,p=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(fa,"")),t=t.replace(da,""),r=mr(t);u<=r.length;){switch(a=r[u],c){case La:if(!a||!ia.test(a)){if(n)return"Invalid scheme";c=Na;continue}h+=a.toLowerCase(),c=ja;break;case ja:if(a&&(ra.test(a)||"+"==a||"-"==a||"."==a))h+=a.toLowerCase();else{if(":"!=a){if(n)return"Invalid scheme";h="",c=Na,u=0;continue}if(n&&(Ea(e)!=b(Sa,h)||"file"==h&&(Aa(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=h,n)return void(Ea(e)&&Sa[e.scheme]==e.port&&(e.port=null));h="","file"==e.scheme?c=za:Ea(e)&&i&&i.scheme==e.scheme?c=Ra:Ea(e)?c=Da:"/"==r[u+1]?(c=Ma,u++):(e.cannotBeABaseURL=!0,e.path.push(""),c=Ga)}break;case Na:if(!i||i.cannotBeABaseURL&&"#"!=a)return"Invalid scheme";if(i.cannotBeABaseURL&&"#"==a){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,c=Qa;break}c="file"==i.scheme?za:_a;continue;case Ra:if("/"!=a||"/"!=r[u+1]){c=_a;continue}c=Fa,u++;break;case Ma:if("/"==a){c=qa;break}c=Ya;continue;case _a:if(e.scheme=i.scheme,a==$r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==a||"\\"==a&&Ea(e))c=Ua;else if("?"==a)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",c=Xa;else{if("#"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),c=Ya;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=Qa}break;case Ua:if(!Ea(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,c=Ya;continue}c=qa}else c=Fa;break;case Da:if(c=Fa,"/"!=a||"/"!=h.charAt(u+1))continue;u++;break;case Fa:if("/"!=a&&"\\"!=a){c=qa;continue}break;case qa:if("@"==a){f&&(h="%40"+h),f=!0,o=mr(h);for(var m=0;m65535)return"Invalid port";e.port=Ea(e)&&y===Sa[e.scheme]?null:y,h=""}if(n)return;c=$a;continue}return"Invalid port"}h+=a;break;case za:if(e.scheme="file","/"==a||"\\"==a)c=Wa;else{if(!i||"file"!=i.scheme){c=Ya;continue}if(a==$r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==a)e.host=i.host,e.path=i.path.slice(),e.query="",c=Xa;else{if("#"!=a){Ca(r.slice(u).join(""))||(e.host=i.host,e.path=i.path.slice(),Oa(e)),c=Ya;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=Qa}}break;case Wa:if("/"==a||"\\"==a){c=Ka;break}i&&"file"==i.scheme&&!Ca(r.slice(u).join(""))&&(xa(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),c=Ya;continue;case Ka:if(a==$r||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&xa(h))c=Ya;else if(""==h){if(e.host="",n)return;c=$a}else{if(s=pa(e,h))return s;if("localhost"==e.host&&(e.host=""),n)return;h="",c=$a}continue}h+=a;break;case $a:if(Ea(e)){if(c=Ya,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=$r&&(c=Ya,"/"!=a))continue}else e.fragment="",c=Qa;else e.query="",c=Xa;break;case Ya:if(a==$r||"/"==a||"\\"==a&&Ea(e)||!n&&("?"==a||"#"==a)){if(".."===(l=(l=h).toLowerCase())||"%2e."===l||".%2e"===l||"%2e%2e"===l?(Oa(e),"/"==a||"\\"==a&&Ea(e)||e.path.push("")):Ia(h)?"/"==a||"\\"==a&&Ea(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&xa(h)&&(e.host&&(e.host=""),h=h.charAt(0)+":"),e.path.push(h)),h="","file"==e.scheme&&(a==$r||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",c=Xa):"#"==a&&(e.fragment="",c=Qa)}else h+=Ta(a,wa);break;case Ga:"?"==a?(e.query="",c=Xa):"#"==a?(e.fragment="",c=Qa):a!=$r&&(e.path[0]+=Ta(a,ya));break;case Xa:n||"#"!=a?a!=$r&&("'"==a&&Ea(e)?e.query+="%27":e.query+="#"==a?"%23":Ta(a,ya)):(e.fragment="",c=Qa);break;case Qa:a!=$r&&(e.fragment+=Ta(a,ba))}u++}},Za=function(e){var t,n,i=ar(this,Za,"URL"),r=arguments.length>1?arguments[1]:void 0,o=String(e),s=Zr(i,{type:"URL"});if(void 0!==r)if(r instanceof Za)t=ea(r);else if(n=Ja(t={},String(r)))throw TypeError(n);if(n=Ja(s,o,null,t))throw TypeError(n);var l=s.searchParams=new Qr,c=Jr(l);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(l)||null},a||(i.href=to.call(i),i.origin=no.call(i),i.protocol=io.call(i),i.username=ro.call(i),i.password=ao.call(i),i.host=oo.call(i),i.hostname=so.call(i),i.port=lo.call(i),i.pathname=co.call(i),i.search=uo.call(i),i.searchParams=ho.call(i),i.hash=fo.call(i))},eo=Za.prototype,to=function(){var e=ea(this),t=e.scheme,n=e.username,i=e.password,r=e.host,a=e.port,o=e.path,s=e.query,l=e.fragment,c=t+":";return null!==r?(c+="//",Aa(e)&&(c+=n+(i?":"+i:"")+"@"),c+=va(r),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},no=function(){var e=ea(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Ea(e)?t+"://"+va(e.host)+(null!==n?":"+n:""):"null"},io=function(){return ea(this).scheme+":"},ro=function(){return ea(this).username},ao=function(){return ea(this).password},oo=function(){var e=ea(this),t=e.host,n=e.port;return null===t?"":null===n?va(t):va(t)+":"+n},so=function(){var e=ea(this).host;return null===e?"":va(e)},lo=function(){var e=ea(this).port;return null===e?"":String(e)},co=function(){var e=ea(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},uo=function(){var e=ea(this).query;return e?"?"+e:""},ho=function(){return ea(this).searchParams},fo=function(){var e=ea(this).fragment;return e?"#"+e:""},po=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(a&&_e(eo,{href:po(to,(function(e){var t=ea(this),n=String(e),i=Ja(t,n);if(i)throw TypeError(i);Jr(t.searchParams).updateSearchParams(t.query)})),origin:po(no),protocol:po(io,(function(e){var t=ea(this);Ja(t,String(e)+":",La)})),username:po(ro,(function(e){var t=ea(this),n=mr(String(e));if(!Pa(t)){t.username="";for(var i=0;i=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ao(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw a}}return n}(e,t)||xo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Po(e){return function(e){if(Array.isArray(e))return Co(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||xo(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xo(e,t){if(e){if("string"==typeof e)return Co(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Co(e,t):void 0}}function Co(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);nt[0]?1:0})),e._entries&&(e._entries={});for(var n=0;n1?r(i[1]):"")}})}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e),function(e){if(function(){try{var t=new e.URL("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href&&t.searchParams}catch(e){return!1}}()||function(){var t=e.URL,n=function(t,n){"string"!=typeof t&&(t=String(t));var i,r=document;if(n&&(void 0===e.location||n!==e.location.href)){(i=(r=document.implementation.createHTMLDocument("")).createElement("base")).href=n,r.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(e){throw new Error("URL unable to set base "+n+" due to "+e)}}var a=r.createElement("a");if(a.href=t,i&&(r.body.appendChild(a),a.href=a.href),":"===a.protocol||!/:/.test(a.href))throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:a});var o=new e.URLSearchParams(this.search),s=!0,l=!0,c=this;["append","delete","set"].forEach((function(e){var t=o[e];o[e]=function(){t.apply(o,arguments),s&&(l=!1,c.search=o.toString(),l=!0)}})),Object.defineProperty(this,"searchParams",{value:o,enumerable:!0});var u=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==u&&(u=this.search,l&&(s=!1,this.searchParams._fromString(this.search),s=!0))}})},i=n.prototype;["hash","host","hostname","port","protocol"].forEach((function(e){!function(e){Object.defineProperty(i,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)})),Object.defineProperty(i,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),n.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},n.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=n}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}catch(n){setInterval((function(){e.location.origin=t()}),100)}}}(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:e);var Oo=Xe("isConcatSpreadable"),Io=zn>=51||!r((function(){var e=[];return e[Oo]=!1,e.concat()[0]!==e})),Lo=Kn("concat"),jo=function(e){if(!g(e))return!1;var t=e[Oo];return void 0!==t?!!t:Ne(e)};Ie({target:"Array",proto:!0,forced:!Io||!Lo},{concat:function(e){var t,n,i,r,a,o=Re(this),s=ot(o,0),l=0;for(t=-1,i=arguments.length;t9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n=9007199254740991)throw TypeError("Maximum allowed index exceeded");Fn(s,l++,a)}return s.length=l,s}});var No=ct.filter,Ro=Kn("filter"),Mo=Qt("filter");Ie({target:"Array",proto:!0,forced:!Ro||!Mo},{filter:function(e){return No(this,e,arguments.length>1?arguments[1]:void 0)}});var _o=ct.find,Uo=!0,Do=Qt("find");"find"in[]&&Array(1).find((function(){Uo=!1})),Ie({target:"Array",proto:!0,forced:Uo||!Do},{find:function(e){return _o(this,e,arguments.length>1?arguments[1]:void 0)}}),dn("find");var Fo=Xe("iterator"),qo=!1;try{var Ho=0,Bo={next:function(){return{done:!!Ho++}},return:function(){qo=!0}};Bo[Fo]=function(){return this},Array.from(Bo,(function(){throw 2}))}catch(e){}var Vo=function(e,t){if(!t&&!qo)return!1;var n=!1;try{var i={};i[Fo]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},zo=!Vo((function(e){Array.from(e)}));Ie({target:"Array",stat:!0,forced:zo},{from:mr});var Wo=de.includes,Ko=Qt("indexOf",{ACCESSORS:!0,1:0});Ie({target:"Array",proto:!0,forced:!Ko},{includes:function(e){return Wo(this,e,arguments.length>1?arguments[1]:void 0)}}),dn("includes");var $o=ct.map,Yo=Kn("map"),Go=Qt("map");Ie({target:"Array",proto:!0,forced:!Yo||!Go},{map:function(e){return $o(this,e,arguments.length>1?arguments[1]:void 0)}});var Xo=function(e,t,n){var i,r;return An&&"function"==typeof(i=t.constructor)&&i!==n&&g(r=i.prototype)&&r!==n.prototype&&An(e,r),e},Qo="\t\n\v\f\r \u2028\u2029\ufeff",Jo="["+Qo+"]",Zo=RegExp("^"+Jo+Jo+"*"),es=RegExp(Jo+Jo+"*$"),ts=function(e){return function(t){var n=String(p(t));return 1&e&&(n=n.replace(Zo,"")),2&e&&(n=n.replace(es,"")),n}},ns={start:ts(1),end:ts(2),trim:ts(3)},is=ye.f,rs=A.f,as=C.f,os=ns.trim,ss=i.Number,ls=ss.prototype,cs="Number"==h(Be(ls)),us=function(e){var t,n,i,r,a,o,s,l,c=v(e,!1);if("string"==typeof c&&c.length>2)if(43===(t=(c=os(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+c}for(o=(a=c.slice(2)).length,s=0;sr)return NaN;return parseInt(a,i)}return+c};if(Ce("Number",!ss(" 0o1")||!ss("0b1")||ss("+0x1"))){for(var hs,fs=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof fs&&(cs?r((function(){ls.valueOf.call(n)})):"Number"!=h(n))?Xo(new ss(us(t)),n,fs):us(t)},ds=a?is(ss):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),ps=0;ds.length>ps;ps++)b(ss,hs=ds[ps])&&!b(fs,hs)&&as(fs,hs,rs(ss,hs));fs.prototype=ls,ls.constructor=fs,ee(i,"Number",fs)}var ms=r((function(){Me(1)}));Ie({target:"Object",stat:!0,forced:ms},{keys:function(e){return Me(Re(e))}});var gs=function(e){if(qi(e))throw TypeError("The method doesn't accept regular expressions");return e},vs=Xe("match"),ys=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[vs]=!1,"/./"[e](t)}catch(e){}}return!1};Ie({target:"String",proto:!0,forced:!ys("includes")},{includes:function(e){return!!~String(p(this)).indexOf(gs(e),arguments.length>1?arguments[1]:void 0)}});var bs=!r((function(){return Object.isExtensible(Object.preventExtensions({}))})),ws=t((function(e){var t=C.f,n=B("meta"),i=0,r=Object.isExtensible||function(){return!0},a=function(e){t(e,n,{value:{objectID:"O"+ ++i,weakData:{}}})},o=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!g(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!b(e,n)){if(!r(e))return"F";if(!t)return"E";a(e)}return e[n].objectID},getWeakData:function(e,t){if(!b(e,n)){if(!r(e))return!0;if(!t)return!1;a(e)}return e[n].weakData},onFreeze:function(e){return bs&&o.REQUIRED&&r(e)&&!b(e,n)&&a(e),e}};W[n]=!0})),ks=(ws.REQUIRED,ws.fastKey,ws.getWeakData,ws.onFreeze,t((function(e){var t=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,n,i,r,a){var o,s,l,c,u,h,f,d=rt(n,i,r?2:1);if(a)o=e;else{if("function"!=typeof(s=pr(e)))throw TypeError("Target is not iterable");if(fr(s)){for(l=0,c=le(e.length);c>l;l++)if((u=r?d(P(f=e[l])[0],f[1]):d(e[l]))&&u instanceof t)return u;return new t(!1)}o=s.call(e)}for(h=o.next;!(f=h.call(o)).done;)if("object"==typeof(u=cr(o,d,f.value,r))&&u&&u instanceof t)return u;return new t(!1)}).stop=function(e){return new t(!0,e)}}))),Ts=ws.getWeakData,Ss=Z.set,Es=Z.getterFor,As=ct.find,Ps=ct.findIndex,xs=0,Cs=function(e){return e.frozen||(e.frozen=new Os)},Os=function(){this.entries=[]},Is=function(e,t){return As(e.entries,(function(e){return e[0]===t}))};Os.prototype={get:function(e){var t=Is(this,e);if(t)return t[1]},has:function(e){return!!Is(this,e)},set:function(e,t){var n=Is(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=Ps(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}};var Ls={getConstructor:function(e,t,n,i){var r=e((function(e,a){ar(e,r,t),Ss(e,{type:t,id:xs++,frozen:void 0}),null!=a&&ks(a,e[i],e,n)})),a=Es(t),o=function(e,t,n){var i=a(e),r=Ts(P(t),!0);return!0===r?Cs(i).set(t,n):r[i.id]=n,e};return Er(r.prototype,{delete:function(e){var t=a(this);if(!g(e))return!1;var n=Ts(e);return!0===n?Cs(t).delete(e):n&&b(n,t.id)&&delete n[t.id]},has:function(e){var t=a(this);if(!g(e))return!1;var n=Ts(e);return!0===n?Cs(t).has(e):n&&b(n,t.id)}}),Er(r.prototype,n?{get:function(e){var t=a(this);if(g(e)){var n=Ts(e);return!0===n?Cs(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return o(this,e,t)}}:{add:function(e){return o(this,e,!0)}}),r}},js=(t((function(e){var t,n=Z.enforce,a=!i.ActiveXObject&&"ActiveXObject"in i,o=Object.isExtensible,s=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},l=e.exports=function(e,t,n){var a=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),s=a?"set":"add",l=i[e],c=l&&l.prototype,u=l,h={},f=function(e){var t=c[e];ee(c,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(o&&!g(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return o&&!g(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(o&&!g(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(Ce(e,"function"!=typeof l||!(o||c.forEach&&!r((function(){(new l).entries().next()})))))u=n.getConstructor(t,e,a,s),ws.REQUIRED=!0;else if(Ce(e,!0)){var d=new u,p=d[s](o?{}:-0,1)!=d,m=r((function(){d.has(1)})),v=Vo((function(e){new l(e)})),y=!o&&r((function(){for(var e=new l,t=5;t--;)e[s](t,t);return!e.has(-0)}));v||((u=t((function(t,n){ar(t,u,e);var i=Xo(new l,t,u);return null!=n&&ks(n,i[s],i,a),i}))).prototype=c,c.constructor=u),(m||y)&&(f("delete"),f("has"),a&&f("get")),(y||p)&&f(s),o&&c.clear&&delete c.clear}return h[e]=u,Ie({global:!0,forced:u!=l},h),nt(u,e),o||n.setStrong(u,e,a),u}("WeakMap",s,Ls);if(D&&a){t=Ls.getConstructor(s,"WeakMap",!0),ws.REQUIRED=!0;var c=l.prototype,u=c.delete,h=c.has,f=c.get,d=c.set;Er(c,{delete:function(e){if(g(e)&&!o(e)){var i=n(this);return i.frozen||(i.frozen=new t),u.call(this,e)||i.frozen.delete(e)}return u.call(this,e)},has:function(e){if(g(e)&&!o(e)){var i=n(this);return i.frozen||(i.frozen=new t),h.call(this,e)||i.frozen.has(e)}return h.call(this,e)},get:function(e){if(g(e)&&!o(e)){var i=n(this);return i.frozen||(i.frozen=new t),h.call(this,e)?f.call(this,e):i.frozen.get(e)}return f.call(this,e)},set:function(e,i){if(g(e)&&!o(e)){var r=n(this);r.frozen||(r.frozen=new t),h.call(this,e)?d.call(this,e,i):r.frozen.set(e,i)}else d.call(this,e,i);return this}})}})),ct.every),Ns=$t("every"),Rs=Qt("every");Ie({target:"Array",proto:!0,forced:!Ns||!Rs},{every:function(e){return js(this,e,arguments.length>1?arguments[1]:void 0)}}),Ie({target:"Object",stat:!0,forced:Object.assign!==lr},{assign:lr});var Ms=ns.trim;Ie({target:"String",proto:!0,forced:function(e){return r((function(){return!!Qo[e]()||"
"!="
"[e]()||Qo[e].name!==e}))}("trim")},{trim:function(){return Ms(this)}});var _s=ct.some,Us=$t("some"),Ds=Qt("some");Ie({target:"Array",proto:!0,forced:!Us||!Ds},{some:function(e){return _s(this,e,arguments.length>1?arguments[1]:void 0)}});var Fs="".repeat||function(e){var t=String(p(this)),n="",i=oe(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},qs=1..toFixed,Hs=Math.floor,Bs=function(e,t,n){return 0===t?n:t%2==1?Bs(e,t-1,n*e):Bs(e*e,t/2,n)},Vs=qs&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r((function(){qs.call({})}));Ie({target:"Number",proto:!0,forced:Vs},{toFixed:function(e){var t,n,i,r,a=function(e){if("number"!=typeof e&&"Number"!=h(e))throw TypeError("Incorrect invocation");return+e}(this),o=oe(e),s=[0,0,0,0,0,0],l="",c="0",u=function(e,t){for(var n=-1,i=t;++n<6;)i+=e*s[n],s[n]=i%1e7,i=Hs(i/1e7)},f=function(e){for(var t=6,n=0;--t>=0;)n+=s[t],s[t]=Hs(n/e),n=n%e*1e7},d=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==s[e]){var n=String(s[e]);t=""===t?n:t+Fs.call("0",7-n.length)+n}return t};if(o<0||o>20)throw RangeError("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return String(a);if(a<0&&(l="-",a=-a),a>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(a*Bs(2,69,1))-69)<0?a*Bs(2,-t,1):a/Bs(2,t,1),n*=4503599627370496,(t=52-t)>0){for(u(0,n),i=o;i>=7;)u(1e7,0),i-=7;for(u(Bs(10,i,1),0),i=t-1;i>=23;)f(1<<23),i-=23;f(1<0?l+((r=c.length)<=o?"0."+Fs.call("0",o-r)+c:c.slice(0,r-o)+"."+c.slice(r-o)):l+c}});var zs=l.f,Ws=function(e){return function(t){for(var n,i=m(t),r=Me(i),o=r.length,s=0,l=[];o>s;)n=r[s++],a&&!zs.call(i,n)||l.push(e?[n,i[n]]:i[n]);return l}},Ks={entries:Ws(!0),values:Ws(!1)},$s=Ks.entries;Ie({target:"Object",stat:!0},{entries:function(e){return $s(e)}});var Ys=Ks.values;Ie({target:"Object",stat:!0},{values:function(e){return Ys(e)}}),Ie({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Gs=A.f,Xs=r((function(){Gs(1)}));function Qs(e,t){for(var n=0;ns;)void 0!==(n=r(i,t=a[s++]))&&Fn(o,t,n);return o}}),Oi("match",1,(function(e,t,n){return[function(t){var n=p(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var r=P(e),a=String(this);if(!r.global)return ji(r,a);var o=r.unicode;r.lastIndex=0;for(var s,l=[],c=0;null!==(s=ji(r,a));){var u=String(s[0]);l[c]=u,""===u&&(r.lastIndex=Li(a,le(r.lastIndex),o)),c++}return 0===c?null:l}]}));var tl={addCSS:!0,thumbWidth:15,watch:!0};function nl(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var il=function(e){return null!=e?e.constructor:null},rl=function(e,t){return!!(e&&t&&e instanceof t)},al=function(e){return null==e},ol=function(e){return il(e)===Object},sl=function(e){return il(e)===String},ll=function(e){return Array.isArray(e)},cl=function(e){return rl(e,NodeList)},ul=sl,hl=ll,fl=cl,dl=function(e){return rl(e,Element)},pl=function(e){return rl(e,Event)},ml=function(e){return al(e)||(sl(e)||ll(e)||cl(e))&&!e.length||ol(e)&&!Object.keys(e).length};function gl(e,t){if(1>t){var n=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(n))}return Math.round(e/t)*t}var vl,yl,bl,wl=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),dl(t)?this.element=t:ul(t)&&(this.element=document.querySelector(t)),dl(this.element)&&ml(this.element.rangeTouch)&&(this.config=el({},tl,{},n),this.init())}return function(e,t,n){t&&Qs(e.prototype,t),n&&Qs(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,n=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[n](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!pl(t))return null;var n,i=t.target,r=t.changedTouches[0],a=parseFloat(i.getAttribute("min"))||0,o=parseFloat(i.getAttribute("max"))||100,s=parseFloat(i.getAttribute("step"))||1,l=i.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(n=100/l.width*(r.clientX-l.left))?n=0:100n?n-=(100-2*n)*c:50n;)t.push(arguments[n++]);return jl[++Ll]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},vl(Ll),Ll},xl=function(e){delete jl[e]},"process"==h(Cl)?vl=function(e){Cl.nextTick(Rl(e))}:Il&&Il.now?vl=function(e){Il.now(Rl(e))}:Ol&&!El?(bl=(yl=new Ol).port2,yl.port1.onmessage=Ml,vl=rt(bl.postMessage,bl,1)):!i.addEventListener||"function"!=typeof postMessage||i.importScripts||r(_l)||"file:"===Al.protocol?vl="onreadystatechange"in T("script")?function(e){Ue.appendChild(T("script")).onreadystatechange=function(){Ue.removeChild(this),Nl(e)}}:function(e){setTimeout(Rl(e),0)}:(vl=_l,i.addEventListener("message",Ml,!1)));var Ul,Dl,Fl,ql,Hl,Bl,Vl,zl,Wl={set:Pl,clear:xl},Kl=A.f,$l=Wl.set,Yl=i.MutationObserver||i.WebKitMutationObserver,Gl=i.process,Xl=i.Promise,Ql="process"==h(Gl),Jl=Kl(i,"queueMicrotask"),Zl=Jl&&Jl.value;Zl||(Ul=function(){var e,t;for(Ql&&(e=Gl.domain)&&e.exit();Dl;){t=Dl.fn,Dl=Dl.next;try{t()}catch(e){throw Dl?ql():Fl=void 0,e}}Fl=void 0,e&&e.enter()},Ql?ql=function(){Gl.nextTick(Ul)}:Yl&&!El?(Hl=!0,Bl=document.createTextNode(""),new Yl(Ul).observe(Bl,{characterData:!0}),ql=function(){Bl.data=Hl=!Hl}):Xl&&Xl.resolve?(Vl=Xl.resolve(void 0),zl=Vl.then,ql=function(){zl.call(Vl,Ul)}):ql=function(){$l.call(i,Ul)});var ec,tc,nc,ic,rc=Zl||function(e){var t={fn:e,next:void 0};Fl&&(Fl.next=t),Dl||(Dl=t,ql()),Fl=t},ac=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i})),this.resolve=it(t),this.reject=it(n)},oc={f:function(e){return new ac(e)}},sc=function(e,t){if(P(e),g(t)&&t.constructor===e)return t;var n=oc.f(e);return(0,n.resolve)(t),n.promise},lc=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},cc=Wl.set,uc=Xe("species"),hc="Promise",fc=Z.get,dc=Z.set,pc=Z.getterFor(hc),mc=kl,gc=i.TypeError,vc=i.document,yc=i.process,bc=ie("fetch"),wc=oc.f,kc=wc,Tc="process"==h(yc),Sc=!!(vc&&vc.createEvent&&i.dispatchEvent),Ec=Ce(hc,(function(){if(!(_(mc)!==String(mc))){if(66===zn)return!0;if(!Tc&&"function"!=typeof PromiseRejectionEvent)return!0}if(zn>=51&&/native code/.test(mc))return!1;var e=mc.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[uc]=t,!(e.then((function(){}))instanceof t)})),Ac=Ec||!Vo((function(e){mc.all(e).catch((function(){}))})),Pc=function(e){var t;return!(!g(e)||"function"!=typeof(t=e.then))&&t},xc=function(e,t,n){if(!t.notified){t.notified=!0;var i=t.reactions;rc((function(){for(var r=t.value,a=1==t.state,o=0;i.length>o;){var s,l,c,u=i[o++],h=a?u.ok:u.fail,f=u.resolve,d=u.reject,p=u.domain;try{h?(a||(2===t.rejection&&Lc(e,t),t.rejection=1),!0===h?s=r:(p&&p.enter(),s=h(r),p&&(p.exit(),c=!0)),s===u.promise?d(gc("Promise-chain cycle")):(l=Pc(s))?l.call(s,f,d):f(s)):d(r)}catch(e){p&&!c&&p.exit(),d(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Oc(e,t)}))}},Cc=function(e,t,n){var r,a;Sc?((r=vc.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),i.dispatchEvent(r)):r={promise:t,reason:n},(a=i["on"+e])?a(r):"unhandledrejection"===e&&function(e,t){var n=i.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Oc=function(e,t){cc.call(i,(function(){var n,i=t.value;if(Ic(t)&&(n=lc((function(){Tc?yc.emit("unhandledRejection",i,e):Cc("unhandledrejection",e,i)})),t.rejection=Tc||Ic(t)?2:1,n.error))throw n.value}))},Ic=function(e){return 1!==e.rejection&&!e.parent},Lc=function(e,t){cc.call(i,(function(){Tc?yc.emit("rejectionHandled",e):Cc("rejectionhandled",e,t.value)}))},jc=function(e,t,n,i){return function(r){e(t,n,r,i)}},Nc=function(e,t,n,i){t.done||(t.done=!0,i&&(t=i),t.value=n,t.state=2,xc(e,t,!0))},Rc=function(e,t,n,i){if(!t.done){t.done=!0,i&&(t=i);try{if(e===n)throw gc("Promise can't be resolved itself");var r=Pc(n);r?rc((function(){var i={done:!1};try{r.call(n,jc(Rc,e,i,t),jc(Nc,e,i,t))}catch(n){Nc(e,i,n,t)}})):(t.value=n,t.state=1,xc(e,t,!1))}catch(n){Nc(e,{done:!1},n,t)}}};Ec&&(mc=function(e){ar(this,mc,hc),it(e),ec.call(this);var t=fc(this);try{e(jc(Rc,this,t),jc(Nc,this,t))}catch(e){Nc(this,t,e)}},(ec=function(e){dc(this,{type:hc,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Er(mc.prototype,{then:function(e,t){var n=pc(this),i=wc(Bi(this,mc));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=Tc?yc.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&xc(this,n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),tc=function(){var e=new ec,t=fc(e);this.promise=e,this.resolve=jc(Rc,e,t),this.reject=jc(Nc,e,t)},oc.f=wc=function(e){return e===mc||e===nc?new tc(e):kc(e)},"function"==typeof kl&&(ic=kl.prototype.then,ee(kl.prototype,"then",(function(e,t){var n=this;return new mc((function(e,t){ic.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof bc&&Ie({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return sc(mc,bc.apply(i,arguments))}}))),Ie({global:!0,wrap:!0,forced:Ec},{Promise:mc}),nt(mc,hc,!1),Sl(hc),nc=ie(hc),Ie({target:hc,stat:!0,forced:Ec},{reject:function(e){var t=wc(this);return t.reject.call(void 0,e),t.promise}}),Ie({target:hc,stat:!0,forced:Ec},{resolve:function(e){return sc(this,e)}}),Ie({target:hc,stat:!0,forced:Ac},{all:function(e){var t=this,n=wc(t),i=n.resolve,r=n.reject,a=lc((function(){var n=it(t.resolve),a=[],o=0,s=1;ks(e,(function(e){var l=o++,c=!1;a.push(void 0),s++,n.call(t,e).then((function(e){c||(c=!0,a[l]=e,--s||i(a))}),r)})),--s||i(a)}));return a.error&&r(a.value),n.promise},race:function(e){var t=this,n=wc(t),i=n.reject,r=lc((function(){var r=it(t.resolve);ks(e,(function(e){r.call(t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var Mc,_c=A.f,Uc="".startsWith,Dc=Math.min,Fc=ys("startsWith"),qc=!(Fc||(Mc=_c(String.prototype,"startsWith"),!Mc||Mc.writable));Ie({target:"String",proto:!0,forced:!qc&&!Fc},{startsWith:function(e){var t=String(p(this));gs(e);var n=le(Dc(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return Uc?Uc.call(t,i,n):t.slice(n,n+i.length)===i}});var Hc,Bc,Vc,zc=function(e){return null!=e?e.constructor:null},Wc=function(e,t){return Boolean(e&&t&&e instanceof t)},Kc=function(e){return null==e},$c=function(e){return zc(e)===Object},Yc=function(e){return zc(e)===String},Gc=function(e){return zc(e)===Function},Xc=function(e){return Array.isArray(e)},Qc=function(e){return Wc(e,NodeList)},Jc=function(e){return Kc(e)||(Yc(e)||Xc(e)||Qc(e))&&!e.length||$c(e)&&!Object.keys(e).length},Zc=Kc,eu=$c,tu=function(e){return zc(e)===Number&&!Number.isNaN(e)},nu=Yc,iu=function(e){return zc(e)===Boolean},ru=Gc,au=Xc,ou=Qc,su=function(e){return Wc(e,Element)},lu=function(e){return Wc(e,Event)},cu=function(e){return Wc(e,KeyboardEvent)},uu=function(e){return Wc(e,TextTrack)||!Kc(e)&&Yc(e.kind)},hu=function(e){return Wc(e,Promise)&&Gc(e.then)},fu=function(e){if(Wc(e,window.URL))return!0;if(!Yc(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!Jc(new URL(t).hostname)}catch(e){return!1}},du=Jc,pu=(Hc=document.createElement("span"),Bc={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},Vc=Object.keys(Bc).find((function(e){return void 0!==Hc.style[e]})),!!nu(Vc)&&Bc[Vc]);function mu(e,t){setTimeout((function(){try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}var gu={isIE:!!document.documentMode,isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)},vu=function(e){return function(t,n,i,r){it(n);var a=Re(t),o=d(a),s=le(a.length),l=e?s-1:0,c=e?-1:1;if(i<2)for(;;){if(l in o){r=o[l],l+=c;break}if(l+=c,e?l<0:s<=l)throw TypeError("Reduce of empty array with no initial value")}for(;e?l>=0:s>l;l+=c)l in o&&(r=n(r,o[l],l,a));return r}},yu={left:vu(!1),right:vu(!0)}.left,bu=$t("reduce"),wu=Qt("reduce",{1:0});function ku(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function Tu(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0?t.cloneNode(!0):t,r=e.parentNode,a=e.nextSibling;i.appendChild(e),a?r.insertBefore(i,a):r.appendChild(i)}))}function Eu(e,t){su(e)&&!du(t)&&Object.entries(t).filter((function(e){var t=Ao(e,2)[1];return!Zc(t)})).forEach((function(t){var n=Ao(t,2),i=n[0],r=n[1];return e.setAttribute(i,r)}))}function Au(e,t,n){var i=document.createElement(e);return eu(t)&&Eu(i,t),nu(n)&&(i.innerText=n),i}function Pu(e,t,n,i){su(t)&&t.appendChild(Au(e,n,i))}function xu(e){ou(e)||au(e)?Array.from(e).forEach(xu):su(e)&&su(e.parentNode)&&e.parentNode.removeChild(e)}function Cu(e){if(su(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function Ou(e,t){return su(t)&&su(t.parentNode)&&su(e)?(t.parentNode.replaceChild(e,t),e):null}function Iu(e,t){if(!nu(e)||du(e))return{};var n={},i=Tu({},t);return e.split(",").forEach((function(e){var t=e.trim(),r=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),o=Ao(a,1)[0],s=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":nu(i.class)?n.class="".concat(i.class," ").concat(r):n.class=r;break;case"#":n.id=t.replace("#","");break;case"[":n[o]=s}})),Tu(i,n)}function Lu(e,t){if(su(e)){var n=t;iu(n)||(n=!e.hidden),e.hidden=n}}function ju(e,t,n){if(ou(e))return Array.from(e).map((function(e){return ju(e,t,n)}));if(su(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function Nu(e,t){return su(e)&&e.classList.contains(t)}function Ru(e,t){var n=Element.prototype;return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function Mu(e){return this.elements.container.querySelectorAll(e)}function _u(e){return this.elements.container.querySelector(e)}function Uu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];su(e)&&(e.focus({preventScroll:!0}),t&&ju(e,this.config.classNames.tabFocus))}Ie({target:"Array",proto:!0,forced:!bu||!wu},{reduce:function(e){return yu(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Du,Fu={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},qu={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=gu.isIPhone&&n&&qu.playsinline,r=qu[e]||"html5"!==t;return{api:r,ui:r&&qu.rangeInput&&("video"!==e||!gu.isIPhone||i)}},pip:!(gu.isIPhone||!ru(Au("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Au("video").disablePictureInPicture)),airplay:ru(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(du(e))return!1;var t=Ao(e.split("/"),1)[0],n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(Fu).includes(n)&&(n+='; codecs="'.concat(Fu[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(Du=document.createElement("input"),Du.type="range","range"===Du.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==pu,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Hu=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function Bu(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!du(t)&&ru(n)){var s=t.split(" "),l=o;Hu&&(l={passive:a,capture:o}),s.forEach((function(t){i&&i.eventListeners&&r&&i.eventListeners.push({element:e,type:t,callback:n,options:l}),e[r?"addEventListener":"removeEventListener"](t,n,l)}))}}function Vu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Bu.call(this,e,t,n,!0,i,r)}function zu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Bu.call(this,e,t,n,!1,i,r)}function Wu(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=function o(){zu(e,n,o,r,a);for(var s=arguments.length,l=new Array(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(su(e)&&!du(t)){var r=new CustomEvent(t,{bubbles:n,detail:So(So({},i),{},{plyr:this})});e.dispatchEvent(r)}}function $u(){this&&this.eventListeners&&(this.eventListeners.forEach((function(e){var t=e.element,n=e.type,i=e.callback,r=e.options;t.removeEventListener(n,i,r)})),this.eventListeners=[])}function Yu(){var e=this;return new Promise((function(t){return e.ready?setTimeout(t,0):Vu.call(e,e.elements.container,"ready",t)})).then((function(){}))}function Gu(e){hu(e)&&e.then(null,(function(){}))}function Xu(e){return!!(au(e)||nu(e)&&e.includes(":"))&&(au(e)?e:e.split(":")).map(Number).every(tu)}function Qu(e){if(!au(e)||!e.every(tu))return null;var t=Ao(e,2),n=t[0],i=t[1],r=function e(t,n){return 0===n?t:e(n,t%n)}(n,i);return[n/r,i/r]}function Ju(e){var t=function(e){return Xu(e)?e.split(":").map(Number):null},n=t(e);if(null===n&&(n=t(this.config.ratio)),null===n&&!du(this.embed)&&au(this.embed.ratio)&&(n=this.embed.ratio),null===n&&this.isHTML5){var i=this.media;n=Qu([i.videoWidth,i.videoHeight])}return n}function Zu(e){if(!this.isVideo)return{};var t=this.elements.wrapper,n=Ju.call(this,e),i=Ao(au(n)?n:[0,0],2),r=100/i[0]*i[1];if(t.style.paddingBottom="".concat(r,"%"),this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){var a=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),o=(a-r)/(a/50);this.media.style.transform="translateY(-".concat(o,"%)")}else this.isHTML5&&t.classList.toggle(this.config.classNames.videoFixedRatio,null!==n);return{padding:r,ratio:n}}var eh={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(t){var n=t.getAttribute("type");return!!du(n)||qu.mime.call(e,n)})):[]},getQualityOptions:function(){return this.config.quality.forced?this.config.quality.options:eh.getSources.call(this).map((function(e){return Number(e.getAttribute("size"))})).filter(Boolean)},setup:function(){if(this.isHTML5){var e=this;e.options.speed=e.config.speed.options,du(this.config.ratio)||Zu.call(e),Object.defineProperty(e.media,"quality",{get:function(){var t=eh.getSources.call(e).find((function(t){return t.getAttribute("src")===e.source}));return t&&Number(t.getAttribute("size"))},set:function(t){if(e.quality!==t){if(e.config.quality.forced&&ru(e.config.quality.onChange))e.config.quality.onChange(t);else{var n=eh.getSources.call(e).find((function(e){return Number(e.getAttribute("size"))===t}));if(!n)return;var i=e.media,r=i.currentTime,a=i.paused,o=i.preload,s=i.readyState,l=i.playbackRate;e.media.src=n.getAttribute("src"),("none"!==o||s)&&(e.once("loadedmetadata",(function(){e.speed=l,e.currentTime=r,a||Gu(e.play())})),e.media.load())}Ku.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(xu(eh.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function th(e){return au(e)?e.filter((function(t,n){return e.indexOf(t)===n})):e}var nh=C.f,ih=ye.f,rh=Z.set,ah=Xe("match"),oh=i.RegExp,sh=oh.prototype,lh=/a/g,ch=/a/g,uh=new oh(lh)!==lh,hh=oi.UNSUPPORTED_Y;if(a&&Ce("RegExp",!uh||hh||r((function(){return ch[ah]=!1,oh(lh)!=lh||oh(ch)==ch||"/a/i"!=oh(lh,"i")})))){for(var fh=function(e,t){var n,i=this instanceof fh,r=qi(e),a=void 0===t;if(!i&&r&&e.constructor===fh&&a)return e;uh?r&&!a&&(e=e.source):e instanceof fh&&(a&&(t=ri.call(e)),e=e.source),hh&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var o=Xo(uh?new oh(e,t):oh(e,t),i?this:sh,fh);return hh&&n&&rh(o,{sticky:n}),o},dh=function(e){e in fh||nh(fh,e,{configurable:!0,get:function(){return oh[e]},set:function(t){oh[e]=t}})},ph=ih(oh),mh=0;ph.length>mh;)dh(ph[mh++]);sh.constructor=fh,fh.prototype=sh,ee(i,"RegExp",fh)}function gh(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),n.toString())},yh=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))};function bh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toString();return t=vh(t,"-"," "),t=vh(t,"_"," "),t=yh(t),vh(t," ","")}function wh(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var kh={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Th=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(du(e)||du(t))return"";var n=ku(t.i18n,e);if(du(n))return Object.keys(kh).includes(e)?kh[e]:"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach((function(e){var t=Ao(e,2),i=t[0],r=t[1];n=vh(n,i,r)})),n},Sh=function(){function e(t){yo(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return wo(e,[{key:"get",value:function(t){if(!e.supported||!this.enabled)return null;var n=window.localStorage.getItem(this.key);if(du(n))return null;var i=JSON.parse(n);return nu(t)&&t.length?i[t]:i}},{key:"set",value:function(t){if(e.supported&&this.enabled&&eu(t)){var n=this.get();du(n)&&(n={}),Tu(n,t),window.localStorage.setItem(this.key,JSON.stringify(n))}}}],[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),e}();function Eh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise((function(n,i){try{var r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",(function(){if("text"===t)try{n(JSON.parse(r.responseText))}catch(e){n(r.responseText)}else n(r.response)})),r.addEventListener("error",(function(){throw new Error(r.status)})),r.open("GET",e,!0),r.responseType=t,r.send()}catch(e){i(e)}}))}function Ah(e,t){if(nu(e)){var n=nu(t),i=function(){return null!==document.getElementById(t)},r=function(e,t){e.innerHTML=t,n&&i()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!i()){var a=Sh.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),n&&o.setAttribute("id",t),a){var s=window.localStorage.getItem("".concat("cache","-").concat(t));if(null!==s){var l=JSON.parse(s);r(o,l.content)}}Eh(e).then((function(e){du(e)||(a&&window.localStorage.setItem("".concat("cache","-").concat(t),JSON.stringify({content:e})),r(o,e))})).catch((function(){}))}}}var Ph=Math.ceil,xh=Math.floor;Ie({target:"Math",stat:!0},{trunc:function(e){return(e>0?xh:Ph)(e)}});var Ch=function(e){return Math.trunc(e/60/60%60,10)},Oh=function(e){return Math.trunc(e/60%60,10)},Ih=function(e){return Math.trunc(e%60,10)};function Lh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!tu(e))return Lh(void 0,t,n);var i=function(e){return"0".concat(e).slice(-2)},r=Ch(e),a=Oh(e),o=Ih(e);return r=t||r>0?"".concat(r,":"):"","".concat(n&&e>0?"-":"").concat(r).concat(i(a),":").concat(i(o))}var jh={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||gu.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=_u.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Mu.call(this,this.config.selectors.buttons.play),pause:_u.call(this,this.config.selectors.buttons.pause),restart:_u.call(this,this.config.selectors.buttons.restart),rewind:_u.call(this,this.config.selectors.buttons.rewind),fastForward:_u.call(this,this.config.selectors.buttons.fastForward),mute:_u.call(this,this.config.selectors.buttons.mute),pip:_u.call(this,this.config.selectors.buttons.pip),airplay:_u.call(this,this.config.selectors.buttons.airplay),settings:_u.call(this,this.config.selectors.buttons.settings),captions:_u.call(this,this.config.selectors.buttons.captions),fullscreen:_u.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=_u.call(this,this.config.selectors.progress),this.elements.inputs={seek:_u.call(this,this.config.selectors.inputs.seek),volume:_u.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:_u.call(this,this.config.selectors.display.buffer),currentTime:_u.call(this,this.config.selectors.display.currentTime),duration:_u.call(this,this.config.selectors.display.duration)},su(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(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:function(e,t){var n=jh.getIconUrl.call(this),i="".concat(n.cors?"":n.url,"#").concat(this.config.iconPrefix),r=document.createElementNS("http://www.w3.org/2000/svg","svg");Eu(r,Tu(t,{"aria-hidden":"true",focusable:"false"}));var a=document.createElementNS("http://www.w3.org/2000/svg","use"),o="".concat(i,"-").concat(e);return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),r.appendChild(a),r},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Th(e,this.config),i=So(So({},t),{},{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")});return Au("span",i,n)},createBadge:function(e){if(du(e))return null;var t=Au("span",{class:this.config.classNames.menu.value});return t.appendChild(Au("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=this,i=Tu({},t),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toString();return(t=bh(t)).charAt(0).toLowerCase()+t.slice(1)}(e),a={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(e){Object.keys(i).includes(e)&&(a[e]=i[e],delete i[e])})),"button"!==a.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((function(e){return e===n.config.classNames.control}))||Tu(i,{class:"".concat(i.class," ").concat(this.config.classNames.control)}):i.class=this.config.classNames.control,e){case"play":a.toggle=!0,a.label="play",a.labelPressed="pause",a.icon="play",a.iconPressed="pause";break;case"mute":a.toggle=!0,a.label="mute",a.labelPressed="unmute",a.icon="volume",a.iconPressed="muted";break;case"captions":a.toggle=!0,a.label="enableCaptions",a.labelPressed="disableCaptions",a.icon="captions-off",a.iconPressed="captions-on";break;case"fullscreen":a.toggle=!0,a.label="enterFullscreen",a.labelPressed="exitFullscreen",a.icon="enter-fullscreen",a.iconPressed="exit-fullscreen";break;case"play-large":i.class+=" ".concat(this.config.classNames.control,"--overlaid"),r="play",a.label="play",a.icon="play";break;default:du(a.label)&&(a.label=r),du(a.icon)&&(a.icon=e)}var o=Au(a.element);return a.toggle?(o.appendChild(jh.createIcon.call(this,a.iconPressed,{class:"icon--pressed"})),o.appendChild(jh.createIcon.call(this,a.icon,{class:"icon--not-pressed"})),o.appendChild(jh.createLabel.call(this,a.labelPressed,{class:"label--pressed"})),o.appendChild(jh.createLabel.call(this,a.label,{class:"label--not-pressed"}))):(o.appendChild(jh.createIcon.call(this,a.icon)),o.appendChild(jh.createLabel.call(this,a.label))),Tu(i,Iu(this.config.selectors.buttons[r],i)),Eu(o,i),"play"===r?(au(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(o)):this.elements.buttons[r]=o,o},createRange:function(e,t){var n=Au("input",Tu(Iu(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Th(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,jh.updateRangeFill.call(this,n),wl.setup(n),n},createProgress:function(e,t){var n=Au("progress",Tu(Iu(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){n.appendChild(Au("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],r=i?Th(i,this.config):"";n.innerText="% ".concat(r.toLowerCase())}return this.elements.display[e]=n,n},createTime:function(e,t){var n=Iu(this.config.selectors.display[e],t),i=Au("div",Tu(n,{class:"".concat(n.class?n.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":Th(e,this.config)}),"00:00");return this.elements.display[e]=i,i},bindMenuItemShortcuts:function(e,t){var n=this;Vu.call(this,e,"keydown keyup",(function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var r,a=Ru(e,'[role="menuitemradio"]');if(!a&&[32,39].includes(i.which))jh.showMenuPanel.call(n,t,!0);else 32!==i.which&&(40===i.which||a&&39===i.which?(r=e.nextElementSibling,su(r)||(r=e.parentNode.firstElementChild)):(r=e.previousElementSibling,su(r)||(r=e.parentNode.lastElementChild)),Uu.call(n,r,!0))}}),!1),Vu.call(this,e,"keyup",(function(e){13===e.which&&jh.focusFirstMenuItem.call(n,null,!0)}))},createMenuItem:function(e){var t=this,n=e.value,i=e.list,r=e.type,a=e.title,o=e.badge,s=void 0===o?null:o,l=e.checked,c=void 0!==l&&l,u=Iu(this.config.selectors.inputs[r]),h=Au("button",Tu(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:n})),f=Au("span");f.innerHTML=a,su(s)&&f.appendChild(s),h.appendChild(f),Object.defineProperty(h,"checked",{enumerable:!0,get:function(){return"true"===h.getAttribute("aria-checked")},set:function(e){e&&Array.from(h.parentNode.children).filter((function(e){return Ru(e,'[role="menuitemradio"]')})).forEach((function(e){return e.setAttribute("aria-checked","false")})),h.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(h,"click keyup",(function(e){if(!cu(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),h.checked=!0,r){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}jh.showMenuPanel.call(t,"home",cu(e))}}),r,!1),jh.bindMenuItemShortcuts.call(this,h,r),i.appendChild(h)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!tu(e))return e;var n=Ch(this.duration)>0;return Lh(e,n,t)},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];su(e)&&tu(t)&&(e.innerText=jh.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(su(this.elements.inputs.volume)&&jh.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),su(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;su(e)&&(e.value=t,jh.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&lu(e)){var n=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=function(e,t){return 0===e||0===t||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}(this.currentTime,this.duration),"timeupdate"===e.type&&jh.setRange.call(this,this.elements.inputs.seek,n);break;case"playing":case"progress":!function(e,n){var i=tu(n)?n:0,r=su(e)?e:t.elements.display.buffer;if(su(r)){r.value=i;var a=r.getElementsByTagName("span")[0];su(a)&&(a.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=lu(e)?e.target:e;if(su(t)&&"range"===t.getAttribute("type")){if(Ru(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=jh.formatTime(this.currentTime),i=jh.formatTime(this.duration),r=Th("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",n).replace("{duration}",i))}else if(Ru(t,this.config.selectors.inputs.volume)){var a=100*t.value;t.setAttribute("aria-valuenow",a),t.setAttribute("aria-valuetext","".concat(a.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);gu.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&su(this.elements.inputs.seek)&&su(this.elements.display.seekTooltip)&&0!==this.duration){var n="".concat(this.config.classNames.tooltip,"--visible"),i=function(e){return ju(t.elements.display.seekTooltip,n,e)};if(this.touch)i(!1);else{var r=0,a=this.elements.progress.getBoundingClientRect();if(lu(e))r=100/a.width*(e.pageX-a.left);else{if(!Nu(this.elements.display.seekTooltip,n))return;r=parseFloat(this.elements.display.seekTooltip.style.left,10)}r<0?r=0:r>100&&(r=100),jh.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*r),this.elements.display.seekTooltip.style.left="".concat(r,"%"),lu(e)&&["mouseenter","mouseleave"].includes(e.type)&&i("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!su(this.elements.display.duration)&&this.config.invertTime;jh.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||jh.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return Lu(this.elements.display.currentTime,!0),void Lu(this.elements.progress,!0);su(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=su(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&jh.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&jh.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),jh.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){Lu(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,n){var i=this.elements.settings.panels[e],r=null,a=t;if("captions"===e)r=this.currentTrack;else{if(r=du(n)?this[e]:n,du(r)&&(r=this.config[e].default),!du(this.options[e])&&!this.options[e].includes(r))return void this.debug.warn("Unsupported value of '".concat(r,"' for ").concat(e));if(!this.config[e].options.includes(r))return void this.debug.warn("Disabled value of '".concat(r,"' for ").concat(e))}if(su(a)||(a=i&&i.querySelector('[role="menu"]')),su(a)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=jh.getLabel.call(this,e,r);var o=a&&a.querySelector('[value="'.concat(r,'"]'));su(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Th("normal",this.config):"".concat(t,"×");case"quality":if(tu(t)){var n=Th("qualityLabel.".concat(t),this.config);return n.length?n:"".concat(t,"p")}return yh(t);case"captions":return Mh.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(su(this.elements.settings.panels.quality)){var n=this.elements.settings.panels.quality.querySelector('[role="menu"]');au(e)&&(this.options.quality=th(e).filter((function(e){return t.config.quality.options.includes(e)})));var i=!du(this.options.quality)&&this.options.quality.length>1;if(jh.toggleMenuButton.call(this,"quality",i),Cu(n),jh.checkMenu.call(this),i){var r=function(e){var n=Th("qualityBadge.".concat(e),t.config);return n.length?jh.createBadge.call(t,n):null};this.options.quality.sort((function(e,n){var i=t.config.quality.options;return i.indexOf(e)>i.indexOf(n)?1:-1})).forEach((function(e){jh.createMenuItem.call(t,{value:e,list:n,type:"quality",title:jh.getLabel.call(t,"quality",e),badge:r(e)})})),jh.updateSetting.call(this,"quality",n)}}},setCaptionsMenu:function(){var e=this;if(su(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=Mh.getTracks.call(this),i=Boolean(n.length);if(jh.toggleMenuButton.call(this,"captions",i),Cu(t),jh.checkMenu.call(this),i){var r=n.map((function(n,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:Mh.getLabel.call(e,n),badge:n.language&&jh.createBadge.call(e,n.language.toUpperCase()),list:t,type:"language"}}));r.unshift({value:-1,checked:!this.captions.toggled,title:Th("disabled",this.config),list:t,type:"language"}),r.forEach(jh.createMenuItem.bind(this)),jh.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(){var e=this;if(su(this.elements.settings.panels.speed)){var t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((function(t){return t>=e.minimumSpeed&&t<=e.maximumSpeed}));var n=!du(this.options.speed)&&this.options.speed.length>1;jh.toggleMenuButton.call(this,"speed",n),Cu(t),jh.checkMenu.call(this),n&&(this.options.speed.forEach((function(n){jh.createMenuItem.call(e,{value:n,list:t,type:"speed",title:jh.getLabel.call(e,"speed",n)})})),jh.updateSetting.call(this,"speed",t))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!du(e)&&Object.values(e).some((function(e){return!e.hidden}));Lu(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var n=e;su(n)||(n=Object.values(this.elements.settings.panels).find((function(e){return!e.hidden})));var i=n.querySelector('[role^="menuitem"]');Uu.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(su(t)&&su(n)){var i=t.hidden,r=i;if(iu(e))r=e;else if(cu(e)&&27===e.which)r=!1;else if(lu(e)){var a=ru(e.composedPath)?e.composedPath()[0]:e.target,o=t.contains(a);if(o||!o&&e.target!==n&&r)return}n.setAttribute("aria-expanded",r),Lu(t,!r),ju(this.elements.container,this.config.classNames.menu.open,r),r&&cu(e)?jh.focusFirstMenuItem.call(this,null,!0):r||i||Uu.call(this,n,cu(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var n=t.scrollWidth,i=t.scrollHeight;return xu(t),{width:n,height:i}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(t));if(su(i)){var r=i.parentNode,a=Array.from(r.children).find((function(e){return!e.hidden}));if(qu.transitions&&!qu.reducedMotion){r.style.width="".concat(a.scrollWidth,"px"),r.style.height="".concat(a.scrollHeight,"px");var o=jh.getMenuSize.call(this,i),s=function t(n){n.target===r&&["width","height"].includes(n.propertyName)&&(r.style.width="",r.style.height="",zu.call(e,r,pu,t))};Vu.call(this,r,pu,s),r.style.width="".concat(o.width,"px"),r.style.height="".concat(o.height,"px")}Lu(a,!0),Lu(i,!1),jh.focusFirstMenuItem.call(this,i,n)}},setDownloadUrl:function(){var e=this.elements.buttons.download;su(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,n=jh.bindMenuItemShortcuts,i=jh.createButton,r=jh.createProgress,a=jh.createRange,o=jh.createTime,s=jh.setQualityMenu,l=jh.setSpeedMenu,c=jh.showMenuPanel;this.elements.controls=null,au(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));var u=Au("div",Iu(this.config.selectors.controls.wrapper));this.elements.controls=u;var h={class:"plyr__controls__item"};return th(au(this.config.controls)?this.config.controls:[]).forEach((function(s){if("restart"===s&&u.appendChild(i.call(t,"restart",h)),"rewind"===s&&u.appendChild(i.call(t,"rewind",h)),"play"===s&&u.appendChild(i.call(t,"play",h)),"fast-forward"===s&&u.appendChild(i.call(t,"fast-forward",h)),"progress"===s){var l=Au("div",{class:"".concat(h.class," plyr__progress__container")}),f=Au("div",Iu(t.config.selectors.progress));if(f.appendChild(a.call(t,"seek",{id:"plyr-seek-".concat(e.id)})),f.appendChild(r.call(t,"buffer")),t.config.tooltips.seek){var d=Au("span",{class:t.config.classNames.tooltip},"00:00");f.appendChild(d),t.elements.display.seekTooltip=d}t.elements.progress=f,l.appendChild(t.elements.progress),u.appendChild(l)}if("current-time"===s&&u.appendChild(o.call(t,"currentTime",h)),"duration"===s&&u.appendChild(o.call(t,"duration",h)),"mute"===s||"volume"===s){var p=t.elements.volume;if(su(p)&&u.contains(p)||(p=Au("div",Tu({},h,{class:"".concat(h.class," plyr__volume").trim()})),t.elements.volume=p,u.appendChild(p)),"mute"===s&&p.appendChild(i.call(t,"mute")),"volume"===s&&!gu.isIos){var m={max:1,step:.05,value:t.config.volume};p.appendChild(a.call(t,"volume",Tu(m,{id:"plyr-volume-".concat(e.id)})))}}if("captions"===s&&u.appendChild(i.call(t,"captions",h)),"settings"===s&&!du(t.config.settings)){var g=Au("div",Tu({},h,{class:"".concat(h.class," plyr__menu").trim(),hidden:""}));g.appendChild(i.call(t,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var v=Au("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),y=Au("div"),b=Au("div",{id:"plyr-settings-".concat(e.id,"-home")}),w=Au("div",{role:"menu"});b.appendChild(w),y.appendChild(b),t.elements.settings.panels.home=b,t.config.settings.forEach((function(i){var r=Au("button",Tu(Iu(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));n.call(t,r,i),Vu.call(t,r,"click",(function(){c.call(t,i,!1)}));var a=Au("span",null,Th(i,t.config)),o=Au("span",{class:t.config.classNames.menu.value});o.innerHTML=e[i],a.appendChild(o),r.appendChild(a),w.appendChild(r);var s=Au("div",{id:"plyr-settings-".concat(e.id,"-").concat(i),hidden:""}),l=Au("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});l.appendChild(Au("span",{"aria-hidden":!0},Th(i,t.config))),l.appendChild(Au("span",{class:t.config.classNames.hidden},Th("menuBack",t.config))),Vu.call(t,s,"keydown",(function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),c.call(t,"home",!0))}),!1),Vu.call(t,l,"click",(function(){c.call(t,"home",!1)})),s.appendChild(l),s.appendChild(Au("div",{role:"menu"})),y.appendChild(s),t.elements.settings.buttons[i]=r,t.elements.settings.panels[i]=s})),v.appendChild(y),g.appendChild(v),u.appendChild(g),t.elements.settings.popup=v,t.elements.settings.menu=g}if("pip"===s&&qu.pip&&u.appendChild(i.call(t,"pip",h)),"airplay"===s&&qu.airplay&&u.appendChild(i.call(t,"airplay",h)),"download"===s){var k=Tu({},h,{element:"a",href:t.download,target:"_blank"});t.isHTML5&&(k.download="");var T=t.config.urls.download;!fu(T)&&t.isEmbed&&Tu(k,{icon:"logo-".concat(t.provider),label:t.provider}),u.appendChild(i.call(t,"download",k))}"fullscreen"===s&&u.appendChild(i.call(t,"fullscreen",h))})),this.isHTML5&&s.call(this,eh.getQualityOptions.call(this)),l.call(this),u},inject:function(){var e=this;if(this.config.loadSprite){var t=jh.getIconUrl.call(this);t.cors&&Ah(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var n=null;this.elements.controls=null;var i={id:this.id,seektime:this.config.seekTime,title:this.config.title},r=!0;ru(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),su(this.config.controls)||nu(this.config.controls)?n=this.config.controls:(n=jh.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Mh.getLabel.call(this)}),r=!1);var a,o;if(r&&nu(this.config.controls)&&(a=n,Object.entries(i).forEach((function(e){var t=Ao(e,2),n=t[0],i=t[1];a=vh(a,"{".concat(n,"}"),i)})),n=a),nu(this.config.selectors.controls.container)&&(o=document.querySelector(this.config.selectors.controls.container)),su(o)||(o=this.elements.container),o[su(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),su(this.elements.controls)||jh.findElements.call(this),!du(this.elements.buttons)){var s=function(t){var n=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return Nu(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ju(t,n,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(e){au(e)||ou(e)?Array.from(e).filter(Boolean).forEach(s):s(e)}))}if(gu.isEdge&&mu(o),this.config.tooltips.controls){var l=this.config,c=l.classNames,u=l.selectors,h="".concat(u.controls.wrapper," ").concat(u.labels," .").concat(c.hidden),f=Mu.call(this,h);Array.from(f).forEach((function(t){ju(t,e.config.classNames.hidden,!1),ju(t,e.config.classNames.tooltip,!0)}))}}};function Nh(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e;if(t){var i=document.createElement("a");i.href=n,n=i.href}try{return new URL(n)}catch(e){return null}}function Rh(e){var t=new URLSearchParams;return eu(e)&&Object.entries(e).forEach((function(e){var n=Ao(e,2),i=n[0],r=n[1];t.set(i,r)})),t}var Mh={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!qu.textTracks)au(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&jh.setCaptionsMenu.call(this);else{if(su(this.elements.captions)||(this.elements.captions=Au("div",Iu(this.config.selectors.captions)),function(e,t){su(e)&&su(t)&&t.parentNode.insertBefore(e,t.nextSibling)}(this.elements.captions,this.elements.wrapper)),gu.isIE&&window.URL){var e=this.media.querySelectorAll("track");Array.from(e).forEach((function(e){var t=e.getAttribute("src"),n=Nh(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&Eh(t,"blob").then((function(t){e.setAttribute("src",window.URL.createObjectURL(t))})).catch((function(){xu(e)}))}))}var t=th((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(e){return e.split("-")[0]}))),n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===n)n=Ao(t,1)[0];var i=this.storage.get("captions");if(iu(i)||(i=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:i,language:n,languages:t}),this.isHTML5){var r=this.config.captions.update?"addtrack removetrack":"removetrack";Vu.call(this,this.media.textTracks,r,Mh.update.bind(this))}setTimeout(Mh.update.bind(this),0)}},update:function(){var e=this,t=Mh.getTracks.call(this,!0),n=this.captions,i=n.active,r=n.language,a=n.meta,o=n.currentTrackNode,s=Boolean(t.find((function(e){return e.language===r})));this.isHTML5&&this.isVideo&&t.filter((function(e){return!a.get(e)})).forEach((function(t){e.debug.log("Track added",t),a.set(t,{default:"showing"===t.mode}),"showing"===t.mode&&(t.mode="hidden"),Vu.call(e,t,"cuechange",(function(){return Mh.updateCues.call(e)}))})),(s&&this.language!==r||!t.includes(o))&&(Mh.setLanguage.call(this,r),Mh.toggle.call(this,i&&s)),ju(this.elements.container,this.config.classNames.captions.enabled,!du(t)),au(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&jh.setCaptionsMenu.call(this)},toggle:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var i=this.captions.toggled,r=this.config.classNames.captions.active,a=Zc(e)?!i:e;if(a!==i){if(n||(this.captions.active=a,this.storage.set({captions:a})),!this.language&&a&&!n){var o=Mh.getTracks.call(this),s=Mh.findTrack.call(this,[this.captions.language].concat(Po(this.captions.languages)),!0);return this.captions.language=s.language,void Mh.set.call(this,o.indexOf(s))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=a),ju(this.elements.container,r,a),this.captions.toggled=a,jh.updateSetting.call(this,"captions"),Ku.call(this,this.media,a?"captionsenabled":"captionsdisabled")}setTimeout((function(){a&&t.captions.toggled&&(t.captions.currentTrackNode.mode="hidden")}))}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Mh.getTracks.call(this);if(-1!==e)if(tu(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],r=i||{},a=r.language;this.captions.currentTrackNode=i,jh.updateSetting.call(this,"captions"),t||(this.captions.language=a,this.storage.set({language:a})),this.isVimeo&&this.embed.enableTextTrack(a),Ku.call(this,this.media,"languagechange")}Mh.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Mh.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Mh.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(nu(e)){var n=e.toLowerCase();this.captions.language=n;var i=Mh.getTracks.call(this),r=Mh.findTrack.call(this,[n]);Mh.set.call(this,i.indexOf(r),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Array.from((this.media||{}).textTracks||[]);return n.filter((function(n){return!e.isHTML5||t||e.captions.meta.has(n)})).filter((function(e){return["captions","subtitles"].includes(e.kind)}))},findTrack:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Mh.getTracks.call(this),a=function(e){return Number((n.captions.meta.get(e)||{}).default)},o=Array.from(r).sort((function(e,t){return a(t)-a(e)}));return e.every((function(e){return!(t=o.find((function(t){return t.language===e})))})),t||(i?o[0]:void 0)},getCurrentTrack:function(){return Mh.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!uu(t)&&qu.textTracks&&this.captions.toggled&&(t=Mh.getCurrentTrack.call(this)),uu(t)?du(t.label)?du(t.language)?Th("enabled",this.config):e.language.toUpperCase():t.label:Th("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(su(this.elements.captions))if(Zc(e)||Array.isArray(e)){var t=e;if(!t){var n=Mh.getCurrentTrack.call(this);t=Array.from((n||{}).activeCues||[]).map((function(e){return e.getCueAsHTML()})).map(wh)}var i=t.map((function(e){return e.trim()})).join("\n");if(i!==this.elements.captions.innerHTML){Cu(this.elements.captions);var r=Au("span",Iu(this.config.selectors.caption));r.innerHTML=i,this.elements.captions.appendChild(r),Ku.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},_h={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.6.2/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/v2/video/{0}.json"},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",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",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"},tabFocus:"plyr__tab-focus",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"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,premium:!1,referrerPolicy:null},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1}},Uh="picture-in-picture",Dh="inline",Fh={html5:"html5",youtube:"youtube",vimeo:"vimeo"},qh="audio",Hh="video";var Bh=function(){},Vh=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];yo(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return wo(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):Bh}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):Bh}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):Bh}}]),e}(),zh=function(){function e(t){var n=this;yo(this,e),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){return(Element.prototype.closest||function(){var e=this;do{if(Ru.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),Vu.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){n.onChange()})),Vu.call(this.player,this.player.elements.container,"dblclick",(function(e){su(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()})),Vu.call(this,this.player.elements.container,"keydown",(function(e){return n.trapFocus(e)})),this.update()}return wo(e,[{key:"onChange",value:function(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;su(e)&&(e.pressed=this.active),Ku.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0)}}},{key:"toggleFallback",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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":"",ju(this.target,this.player.config.classNames.fullscreen.fallback,e),gu.isIos){var t=document.head.querySelector('meta[name="viewport"]'),n="viewport-fit=cover";t||(t=document.createElement("meta")).setAttribute("name","viewport");var i=nu(t.content)&&t.content.includes(n);e?(this.cleanupViewport=!i,i||(t.content+=",".concat(n))):this.cleanupViewport&&(t.content=t.content.split(",").filter((function(e){return e.trim()!==n})).join(","))}this.onChange()}},{key:"trapFocus",value:function(e){if(!gu.isIos&&this.active&&"Tab"===e.key&&9===e.keyCode){var t=document.activeElement,n=Mu.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),i=Ao(n,1)[0],r=n[n.length-1];t!==r||e.shiftKey?t===i&&e.shiftKey&&(r.focus(),e.preventDefault()):(i.focus(),e.preventDefault())}}},{key:"update",value:function(){var t;this.enabled?(t=this.forceFallback?"Fallback (forced)":e.native?"Native":"Fallback",this.player.debug.log("".concat(t," fullscreen enabled"))):this.player.debug.log("Fullscreen not supported and fallback disabled");ju(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(gu.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():!e.native||this.forceFallback?this.toggleFallback(!0):this.prefix?du(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen({navigationUI:"hide"}))}},{key:"exit",value:function(){if(this.enabled)if(gu.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),Gu(this.player.play());else if(!e.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!du(this.prefix)){var t="moz"===this.prefix?"Cancel":"Exit";document["".concat(this.prefix).concat(t).concat(this.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}},{key:"toggle",value:function(){this.active?this.exit():this.enter()}},{key:"usingNative",get:function(){return e.native&&!this.forceFallback}},{key:"enabled",get:function(){return(e.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){if(!this.enabled)return!1;if(!e.native||this.forceFallback)return Nu(this.target,this.player.config.classNames.fullscreen.fallback);var t=this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement;return t&&t.shadowRoot?t===this.target.getRootNode().host:t===this.target}},{key:"target",get:function(){return gu.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(ru(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some((function(t){return!(!ru(document["".concat(t,"ExitFullscreen")])&&!ru(document["".concat(t,"CancelFullScreen")]))&&(e=t,!0)})),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}(),Wh=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1};function Kh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(n,i){var r=new Image,a=function(){delete r.onload,delete r.onerror,(r.naturalWidth>=t?n:i)(r)};Object.assign(r,{onload:a,onerror:a,src:e})}))}Ie({target:"Math",stat:!0},{sign:Wh});var $h={addStyleHook:function(){ju(this.elements.container,this.config.selectors.container.replace(".",""),!0),ju(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void $h.toggleNativeControls.call(this,!0);su(this.elements.controls)||(jh.inject.call(this),this.listeners.controls()),$h.toggleNativeControls.call(this),this.isHTML5&&Mh.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,jh.updateVolume.call(this),jh.timeUpdate.call(this),$h.checkPlaying.call(this),ju(this.elements.container,this.config.classNames.pip.supported,qu.pip&&this.isHTML5&&this.isVideo),ju(this.elements.container,this.config.classNames.airplay.supported,qu.airplay&&this.isHTML5),ju(this.elements.container,this.config.classNames.isIos,gu.isIos),ju(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){Ku.call(e,e.media,"ready")}),0),$h.setTitle.call(this),this.poster&&$h.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&jh.durationUpdate.call(this)},setTitle:function(){var e=Th("play",this.config);if(nu(this.config.title)&&!du(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach((function(t){t.setAttribute("aria-label",e)})),this.isEmbed){var t=_u.call(this,"iframe");if(!su(t))return;var n=du(this.config.title)?"video":this.config.title,i=Th("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){ju(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),Yu.call(this).then((function(){return Kh(e)})).catch((function(n){throw e===t.poster&&$h.togglePoster.call(t,!1),n})).then((function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),$h.togglePoster.call(t,!0),e})))},checkPlaying:function(e){var t=this;ju(this.elements.container,this.config.classNames.playing,this.playing),ju(this.elements.container,this.config.classNames.paused,this.paused),ju(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(e){Object.assign(e,{pressed:t.playing}),e.setAttribute("aria-label",Th(t.playing?"pause":"play",t.config))})),lu(e)&&"timeupdate"===e.type||$h.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((function(){ju(t.elements.container,t.config.classNames.loading,t.loading),$h.toggleControls.call(t)}),this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||n))}},migrateStyles:function(){var e=this;Object.values(So({},this.media.style)).filter((function(e){return!du(e)&&e.startsWith("--plyr")})).forEach((function(t){e.elements.container.style.setProperty(t,e.media.style.getPropertyValue(t)),e.media.style.removeProperty(t)})),du(this.media.style)&&this.media.removeAttribute("style")}},Yh=function(){function e(t){yo(this,e),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.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return wo(e,[{key:"handleKey",value:function(e){var t=this.player,n=t.elements,i=e.keyCode?e.keyCode:e.which,r="keydown"===e.type,a=r&&i===this.lastKey;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&tu(i)){if(r){var o=document.activeElement;if(su(o)){var s=t.config.selectors.editable;if(o!==n.inputs.seek&&Ru(o,s))return;if(32===e.which&&Ru(o,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(i)&&(e.preventDefault(),e.stopPropagation()),i){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a||(t.currentTime=t.duration/10*(i-48));break;case 32:case 75:a||Gu(t.togglePlay());break;case 38:t.increaseVolume(.1);break;case 40:t.decreaseVolume(.1);break;case 77:a||(t.muted=!t.muted);break;case 39:t.forward();break;case 37:t.rewind();break;case 70:t.fullscreen.toggle();break;case 67:a||t.toggleCaptions();break;case 76:t.loop=!t.loop}27===i&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}}},{key:"toggleMenu",value:function(e){jh.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,ju(t.container,e.config.classNames.isTouch,!0)}},{key:"setTabFocus",value:function(e){var t=this.player,n=t.elements;if(clearTimeout(this.focusTimer),"keydown"!==e.type||9===e.which){"keydown"===e.type&&(this.lastKeyDown=e.timeStamp);var i,r=e.timeStamp-this.lastKeyDown<=20;if("focus"!==e.type||r)i=t.config.classNames.tabFocus,ju(Mu.call(t,".".concat(i)),i,!1),"focusout"!==e.type&&(this.focusTimer=setTimeout((function(){var e=document.activeElement;n.container.contains(e)&&ju(document.activeElement,t.config.classNames.tabFocus,!0)}),10))}}},{key:"global",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.player;t.config.keyboard.global&&Bu.call(t,window,"keydown keyup",this.handleKey,e,!1),Bu.call(t,document.body,"click",this.toggleMenu,e),Wu.call(t,document.body,"touchstart",this.firstTouch),Bu.call(t,document.body,"keydown focus blur focusout",this.setTabFocus,e,!1,!0)}},{key:"container",value:function(){var e=this.player,t=e.config,n=e.elements,i=e.timers;!t.keyboard.global&&t.keyboard.focused&&Vu.call(e,n.container,"keydown keyup",this.handleKey,!1),Vu.call(e,n.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(function(t){var r=n.controls;r&&"enterfullscreen"===t.type&&(r.pressed=!1,r.hover=!1);var a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&($h.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(i.controls),i.controls=setTimeout((function(){return $h.toggleControls.call(e,!1)}),a)}));var r=function(t){if(!t)return Zu.call(e);var i=n.container.getBoundingClientRect(),r=i.width,a=i.height;return Zu.call(e,"".concat(r,":").concat(a))},a=function(){clearTimeout(i.resized),i.resized=setTimeout(r,50)};Vu.call(e,n.container,"enterfullscreen exitfullscreen",(function(t){var i=e.fullscreen,o=i.target,s=i.usingNative;if(o===n.container&&(e.isEmbed||!du(e.config.ratio))){var l="enterfullscreen"===t.type,c=r(l);c.padding;!function(t,n,i){if(e.isVimeo&&!e.config.vimeo.premium){var r=e.elements.wrapper.firstChild,a=Ao(t,2)[1],o=Ao(Ju.call(e),2),s=o[0],l=o[1];r.style.maxWidth=i?"".concat(a/l*s,"px"):null,r.style.margin=i?"0 auto":null}}(c.ratio,0,l),s||(l?Vu.call(e,window,"resize",a):zu.call(e,window,"resize",a))}}))}},{key:"media",value:function(){var e=this,t=this.player,n=t.elements;if(Vu.call(t,t.media,"timeupdate seeking seeked",(function(e){return jh.timeUpdate.call(t,e)})),Vu.call(t,t.media,"durationchange loadeddata loadedmetadata",(function(e){return jh.durationUpdate.call(t,e)})),Vu.call(t,t.media,"ended",(function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())})),Vu.call(t,t.media,"progress playing seeking seeked",(function(e){return jh.updateProgress.call(t,e)})),Vu.call(t,t.media,"volumechange",(function(e){return jh.updateVolume.call(t,e)})),Vu.call(t,t.media,"playing play pause ended emptied timeupdate",(function(e){return $h.checkPlaying.call(t,e)})),Vu.call(t,t.media,"waiting canplay seeked playing",(function(e){return $h.checkLoading.call(t,e)})),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=_u.call(t,".".concat(t.config.classNames.video));if(!su(i))return;Vu.call(t,n.container,"click",(function(r){([n.container,i].includes(r.target)||i.contains(r.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(r,t.restart,"restart"),e.proxy(r,(function(){Gu(t.play())}),"play")):e.proxy(r,(function(){Gu(t.togglePlay())}),"play")))}))}t.supported.ui&&t.config.disableContextMenu&&Vu.call(t,n.wrapper,"contextmenu",(function(e){e.preventDefault()}),!1),Vu.call(t,t.media,"volumechange",(function(){t.storage.set({volume:t.volume,muted:t.muted})})),Vu.call(t,t.media,"ratechange",(function(){jh.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})})),Vu.call(t,t.media,"qualitychange",(function(e){jh.updateSetting.call(t,"quality",null,e.detail.quality)})),Vu.call(t,t.media,"ready qualitychange",(function(){jh.setDownloadUrl.call(t)}));var r=t.config.events.concat(["keyup","keydown"]).join(" ");Vu.call(t,t.media,r,(function(e){var i=e.detail,r=void 0===i?{}:i;"error"===e.type&&(r=t.media.error),Ku.call(t,n.container,e.type,!0,r)}))}},{key:"proxy",value:function(e,t,n){var i=this.player,r=i.config.listeners[n],a=!0;ru(r)&&(a=r.call(i,e)),!1!==a&&ru(t)&&t.call(i,e)}},{key:"bind",value:function(e,t,n,i){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.player,s=o.config.listeners[i],l=ru(s);Vu.call(o,e,t,(function(e){return r.proxy(e,n,i)}),a&&!l)}},{key:"controls",value:function(){var e=this,t=this.player,n=t.elements,i=gu.isIE?"change":"input";if(n.buttons.play&&Array.from(n.buttons.play).forEach((function(n){e.bind(n,"click",(function(){Gu(t.togglePlay())}),"play")})),this.bind(n.buttons.restart,"click",t.restart,"restart"),this.bind(n.buttons.rewind,"click",t.rewind,"rewind"),this.bind(n.buttons.fastForward,"click",t.forward,"fastForward"),this.bind(n.buttons.mute,"click",(function(){t.muted=!t.muted}),"mute"),this.bind(n.buttons.captions,"click",(function(){return t.toggleCaptions()})),this.bind(n.buttons.download,"click",(function(){Ku.call(t,t.media,"download")}),"download"),this.bind(n.buttons.fullscreen,"click",(function(){t.fullscreen.toggle()}),"fullscreen"),this.bind(n.buttons.pip,"click",(function(){t.pip="toggle"}),"pip"),this.bind(n.buttons.airplay,"click",t.airplay,"airplay"),this.bind(n.buttons.settings,"click",(function(e){e.stopPropagation(),e.preventDefault(),jh.toggleMenu.call(t,e)}),null,!1),this.bind(n.buttons.settings,"keyup",(function(e){var n=e.which;[13,32].includes(n)&&(13!==n?(e.preventDefault(),e.stopPropagation(),jh.toggleMenu.call(t,e)):jh.focusFirstMenuItem.call(t,null,!0))}),null,!1),this.bind(n.settings.menu,"keydown",(function(e){27===e.which&&jh.toggleMenu.call(t,e)})),this.bind(n.inputs.seek,"mousedown mousemove",(function(e){var t=n.progress.getBoundingClientRect(),i=100/t.width*(e.pageX-t.left);e.currentTarget.setAttribute("seek-value",i)})),this.bind(n.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(function(e){var n=e.currentTarget,i=e.keyCode?e.keyCode:e.which;if(!cu(e)||39===i||37===i){t.lastSeekTime=Date.now();var r=n.hasAttribute("play-on-seeked"),a=["mouseup","touchend","keyup"].includes(e.type);r&&a?(n.removeAttribute("play-on-seeked"),Gu(t.play())):!a&&t.playing&&(n.setAttribute("play-on-seeked",""),t.pause())}})),gu.isIos){var r=Mu.call(t,'input[type="range"]');Array.from(r).forEach((function(t){return e.bind(t,i,(function(e){return mu(e.target)}))}))}this.bind(n.inputs.seek,i,(function(e){var n=e.currentTarget,i=n.getAttribute("seek-value");du(i)&&(i=n.value),n.removeAttribute("seek-value"),t.currentTime=i/n.max*t.duration}),"seek"),this.bind(n.progress,"mouseenter mouseleave mousemove",(function(e){return jh.updateSeekTooltip.call(t,e)})),this.bind(n.progress,"mousemove touchmove",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.startMove(e)})),this.bind(n.progress,"mouseleave touchend click",(function(){var e=t.previewThumbnails;e&&e.loaded&&e.endMove(!1,!0)})),this.bind(n.progress,"mousedown touchstart",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.startScrubbing(e)})),this.bind(n.progress,"mouseup touchend",(function(e){var n=t.previewThumbnails;n&&n.loaded&&n.endScrubbing(e)})),gu.isWebkit&&Array.from(Mu.call(t,'input[type="range"]')).forEach((function(n){e.bind(n,"input",(function(e){return jh.updateRangeFill.call(t,e.target)}))})),t.config.toggleInvert&&!su(n.display.duration)&&this.bind(n.display.currentTime,"click",(function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,jh.timeUpdate.call(t))})),this.bind(n.inputs.volume,i,(function(e){t.volume=e.target.value}),"volume"),this.bind(n.controls,"mouseenter mouseleave",(function(e){n.controls.hover=!t.touch&&"mouseenter"===e.type})),n.fullscreen&&Array.from(n.fullscreen.children).filter((function(e){return!e.contains(n.container)})).forEach((function(i){e.bind(i,"mouseenter mouseleave",(function(e){n.controls.hover=!t.touch&&"mouseenter"===e.type}))})),this.bind(n.controls,"mousedown mouseup touchstart touchend touchcancel",(function(e){n.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(n.controls,"focusin",(function(){var i=t.config,r=t.timers;ju(n.controls,i.classNames.noTransition,!0),$h.toggleControls.call(t,!0),setTimeout((function(){ju(n.controls,i.classNames.noTransition,!1)}),0);var a=e.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout((function(){return $h.toggleControls.call(t,!1)}),a)})),this.bind(n.inputs.volume,"wheel",(function(e){var n=e.webkitDirectionInvertedFromDevice,i=Ao([e.deltaX,-e.deltaY].map((function(e){return n?-e:e})),2),r=i[0],a=i[1],o=Math.sign(Math.abs(r)>Math.abs(a)?r:a);t.increaseVolume(o/50);var s=t.media.volume;(1===o&&s<1||-1===o&&s>0)&&e.preventDefault()}),"volume",!1)}}]),e}(),Gh=Kn("splice"),Xh=Qt("splice",{ACCESSORS:!0,0:0,1:2}),Qh=Math.max,Jh=Math.min;Ie({target:"Array",proto:!0,forced:!Gh||!Xh},{splice:function(e,t){var n,i,r,a,o,s,l=Re(this),c=le(l.length),u=he(e,c),h=arguments.length;if(0===h?n=i=0:1===h?(n=0,i=c-u):(n=h-2,i=Jh(Qh(oe(t),0),c-u)),c+n-i>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(r=ot(l,i),a=0;ac-i+n;a--)delete l[a-1]}else if(n>i)for(a=c-i;a>u;a--)s=a+n-1,(o=a+i-1)in l?l[s]=l[o]:delete l[s];for(a=0;a0&&void 0!==arguments[0]&&arguments[0];if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");var n=function(){var t=Lh(Math.max(e.manager.getRemainingTime(),0)),n="".concat(Th("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",n)};this.countdownTimer=setInterval(n,100)}},{key:"onAdsManagerLoaded",value:function(e){var t=this;if(this.enabled){var n=new google.ima.AdsRenderingSettings;n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.enablePreloading=!0,this.manager=e.getAdsManager(this.player,n),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return t.onAdError(e)})),Object.keys(google.ima.AdEvent.Type).forEach((function(e){t.manager.addEventListener(google.ima.AdEvent.Type[e],(function(e){return t.onAdEvent(e)}))})),this.trigger("loaded")}}},{key:"addCuePoints",value:function(){var e=this;du(this.cuePoints)||this.cuePoints.forEach((function(t){if(0!==t&&-1!==t&&t1?n-1:0),r=1;r1?arguments[1]:void 0)}}),dn("findIndex");var ff=Math.min,df=[].lastIndexOf,pf=!!df&&1/[1].lastIndexOf(1,-0)<0,mf=$t("lastIndexOf"),gf=Qt("indexOf",{ACCESSORS:!0,1:0}),vf=pf||!mf||!gf?function(e){if(pf)return df.apply(this,arguments)||0;var t=m(this),n=le(t.length),i=n-1;for(arguments.length>1&&(i=ff(i,oe(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:df;Ie({target:"Array",proto:!0,forced:vf!==[].lastIndexOf},{lastIndexOf:vf});var yf=function(e,t){var n={};return e>t.width/t.height?(n.width=t.width,n.height=1/e*t.width):(n.height=t.height,n.width=e*t.height),n},bf=function(){function e(t){yo(this,e),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return wo(e,[{key:"load",value:function(){var e=this;this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((function(){e.enabled&&(e.render(),e.determineContainerAutoSizing(),e.loaded=!0)}))}},{key:"getThumbnails",value:function(){var e=this;return new Promise((function(t){var n=e.player.config.previewThumbnails.src;if(du(n))throw new Error("Missing previewThumbnails.src config attribute");var i=function(){e.thumbnails.sort((function(e,t){return e.height-t.height})),e.player.debug.log("Preview thumbnails",e.thumbnails),t()};if(ru(n))n((function(t){e.thumbnails=t,i()}));else{var r=(nu(n)?[n]:n).map((function(t){return e.getThumbnail(t)}));Promise.all(r).then(i)}}))}},{key:"getThumbnail",value:function(e){var t=this;return new Promise((function(n){Eh(e).then((function(i){var r,a,o={frames:(r=i,a=[],r.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(e){var t={};e.split(/\r\n|\n|\r/).forEach((function(e){if(tu(t.startTime)){if(!du(e.trim())&&du(t.text)){var n=e.trim().split("#xywh="),i=Ao(n,1);if(t.text=i[0],n[1]){var r=Ao(n[1].split(","),4);t.x=r[0],t.y=r[1],t.w=r[2],t.h=r[3]}}}else{var a=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})/);a&&(t.startTime=60*Number(a[1]||0)*60+60*Number(a[2])+Number(a[3])+Number("0.".concat(a[4])),t.endTime=60*Number(a[6]||0)*60+60*Number(a[7])+Number(a[8])+Number("0.".concat(a[9])))}})),t.text&&a.push(t)})),a),height:null,urlPrefix:""};o.frames[0].text.startsWith("/")||o.frames[0].text.startsWith("http://")||o.frames[0].text.startsWith("https://")||(o.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var s=new Image;s.onload=function(){o.height=s.naturalHeight,o.width=s.naturalWidth,t.thumbnails.push(o),n()},s.src=o.urlPrefix+o.frames[0].text}))}))}},{key:"startMove",value:function(e){if(this.loaded&&lu(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=this.player.elements.progress.getBoundingClientRect(),n=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Lh(this.seekTime)}this.showImageAtCurrentTime()}}},{key:"endMove",value:function(){this.toggleThumbContainer(!1,!0)}},{key:"startScrubbing",value:function(e){(Zc(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}},{key:"endScrubbing",value:function(){var e=this;this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Wu.call(this.player,this.player.media,"timeupdate",(function(){e.mouseDown||e.toggleScrubbingContainer(!1)}))}},{key:"listeners",value:function(){var e=this;this.player.on("play",(function(){e.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(function(){e.toggleThumbContainer(!1)})),this.player.on("timeupdate",(function(){e.lastTime=e.player.media.currentTime}))}},{key:"render",value:function(){this.elements.thumb.container=Au("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Au("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);var e=Au("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Au("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),su(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Au("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}},{key:"destroy",value:function(){this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();var t=this.thumbnails[0].frames.findIndex((function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime})),n=t>=0,i=0;this.mouseDown||this.toggleThumbContainer(n),n&&(this.thumbnails.forEach((function(n,r){e.loadedImages.includes(n.frames[t].text)&&(i=r)})),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(i)))}},{key:"loadImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=this.showingThumb,i=this.thumbnails[t],r=i.urlPrefix,a=i.frames[n],o=i.frames[n].text,s=r+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,a,t,n,o,!1),this.currentImageElement.dataset.index=n,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);var l=new Image;l.src=s,l.dataset.index=n,l.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log("Loading image: ".concat(s)),l.onload=function(){return e.showImage(l,a,t,n,o,!0)},this.loadingImage=l,this.removeOldImages(l)}}},{key:"showImage",value:function(e,t,n,i,r){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];this.player.debug.log("Showing thumb: ".concat(r,". num: ").concat(i,". qual: ").concat(n,". newimg: ").concat(a)),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(r)||this.loadedImages.push(r)),this.preloadNearby(i,!0).then(this.preloadNearby(i,!1)).then(this.getHigherQuality(n,e,t,r))}},{key:"removeOldImages",value:function(e){var t=this;Array.from(this.currentImageContainer.children).forEach((function(n){if("img"===n.tagName.toLowerCase()){var i=t.usingSprites?500:1e3;if(n.dataset.index!==e.dataset.index&&!n.dataset.deleting){n.dataset.deleting=!0;var r=t.currentImageContainer;setTimeout((function(){r.removeChild(n),t.player.debug.log("Removing thumb: ".concat(n.dataset.filename))}),i)}}}))}},{key:"preloadNearby",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(i){setTimeout((function(){var r=t.thumbnails[0].frames[e].text;if(t.showingThumbFilename===r){var a;a=n?t.thumbnails[0].frames.slice(e):t.thumbnails[0].frames.slice(0,e).reverse();var o=!1;a.forEach((function(e){var n=e.text;if(n!==r&&!t.loadedImages.includes(n)){o=!0,t.player.debug.log("Preloading thumb filename: ".concat(n));var a=t.thumbnails[0].urlPrefix+n,s=new Image;s.src=a,s.onload=function(){t.player.debug.log("Preloaded thumb filename: ".concat(n)),t.loadedImages.includes(n)||t.loadedImages.push(n),i()}}})),o||i()}}),300)}))}},{key:"getHigherQuality",value:function(e,t,n,i){var r=this;if(e0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"toggleScrubbingContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}},{key:"determineContainerAutoSizing",value:function(){(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(this.sizeSpecifiedInCSS){if(this.elements.thumb.imageContainer.clientHeight>20&&this.elements.thumb.imageContainer.clientWidth<20){var e=Math.floor(this.elements.thumb.imageContainer.clientHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.width="".concat(e,"px")}else if(this.elements.thumb.imageContainer.clientHeight<20&&this.elements.thumb.imageContainer.clientWidth>20){var t=Math.floor(this.elements.thumb.imageContainer.clientWidth/this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(t,"px")}}else{var n=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.elements.thumb.imageContainer.style.width="".concat(n,"px")}this.setThumbContainerPos()}},{key:"setThumbContainerPos",value:function(){var e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),n=this.elements.thumb.container,i=t.left-e.left+10,r=t.right-e.left-n.clientWidth-10,a=this.mousePosX-e.left-n.clientWidth/2;ar&&(a=r),n.style.left="".concat(a,"px")}},{key:"setScrubbingContainerSize",value:function(){var e=yf(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}),t=e.width,n=e.height;this.elements.scrubbing.container.style.width="".concat(t,"px"),this.elements.scrubbing.container.style.height="".concat(n,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingSprites){var n=this.thumbContainerHeight/t.h;e.style.height="".concat(e.naturalHeight*n,"px"),e.style.width="".concat(e.naturalWidth*n,"px"),e.style.left="-".concat(t.x*n,"px"),e.style.top="-".concat(t.y*n,"px")}}},{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?yf(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}).height:this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),e}(),wf={insertElements:function(e,t){var n=this;nu(t)?Pu(e,this.media,{src:t}):au(t)&&t.forEach((function(t){Pu(e,n.media,t)}))},change:function(e){var t=this;ku(e,"sources.length")?(eh.cancelRequests.call(this),this.destroy.call(this,(function(){t.options.quality=[],xu(t.media),t.media=null,su(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,r=Ao(n,1)[0],a=r.provider,o=void 0===a?Fh.html5:a,s=r.src,l="html5"===o?i:"div",c="html5"===o?{}:{src:s};Object.assign(t,{provider:o,type:i,supported:qu.check(i,o,t.config.playsinline),media:Au(l,c)}),t.elements.container.appendChild(t.media),iu(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),du(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),$h.addStyleHook.call(t),t.isHTML5&&wf.insertElements.call(t,"source",n),t.config.title=e.title,sf.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&wf.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&$h.build.call(t),t.isHTML5&&t.media.load(),du(e.previewThumbnails)||(Object.assign(t.config.previewThumbnails,e.previewThumbnails),t.previewThumbnails&&t.previewThumbnails.loaded&&(t.previewThumbnails.destroy(),t.previewThumbnails=null),t.config.previewThumbnails.enabled&&(t.previewThumbnails=new bf(t))),t.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};var kf,Tf=function(){function e(t,n){var i=this;if(yo(this,e),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=qu.touch,this.media=t,nu(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||ou(this.media)||au(this.media))&&(this.media=this.media[0]),this.config=Tu({},_h,e.defaults,n||{},function(){try{return JSON.parse(i.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 Vh(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",qu),!Zc(this.media)&&su(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(qu.check().api){var r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;var a=this.media.tagName.toLowerCase(),o=null,s=null;switch(a){case"div":if(o=this.media.querySelector("iframe"),su(o)){if(s=Nh(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Fh.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Fh.vimeo:null}(s.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",s.search.length){var l=["1","true"];l.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(s.searchParams.get("playsinline")),this.config.youtube.hl=s.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(du(this.provider)||!Object.keys(Fh).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Hh;break;case"video":case"audio":this.type=a,this.provider=Fh.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=qu.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new Yh(this),this.storage=new Sh(this),this.media.plyr=this,su(this.elements.container)||(this.elements.container=Au("div",{tabindex:0}),Su(this.media,this.elements.container)),$h.migrateStyles.call(this),$h.addStyleHook.call(this),sf.setup.call(this),this.config.debug&&Vu.call(this,this.elements.container,this.config.events.join(" "),(function(e){i.debug.log("event: ".concat(e.type))})),this.fullscreen=new zh(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&$h.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new lf(this)),this.isHTML5&&this.config.autoplay&&setTimeout((function(){return Gu(i.play())}),10),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new bf(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return wo(e,[{key:"play",value:function(){var e=this;return ru(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((function(){return e.ads.play()})).catch((function(){return Gu(e.media.play())})),this.media.play()):null}},{key:"pause",value:function(){return this.playing&&ru(this.media.pause)?this.media.pause():null}},{key:"togglePlay",value:function(e){return(iu(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):ru(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime-=tu(e)?e:this.config.seekTime}},{key:"forward",value:function(e){this.currentTime+=tu(e)?e:this.config.seekTime}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(tu(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){Mh.toggle.call(this,e,!1)}},{key:"airplay",value:function(){qu.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=Nu(this.elements.container,this.config.classNames.hideControls),n=void 0===e?void 0:!e,i=ju(this.elements.container,this.config.classNames.hideControls,n);if(i&&au(this.config.controls)&&this.config.controls.includes("settings")&&!du(this.config.settings)&&jh.toggleMenu.call(this,!1),i!==t){var r=i?"controlshidden":"controlsshown";Ku.call(this,this.media,r)}return!i}return!1}},{key:"on",value:function(e,t){Vu.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){Wu.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){zu(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ready){var i=function(){document.body.style.overflow="",t.embed=null,n?(Object.keys(t.elements).length&&(xu(t.elements.buttons.play),xu(t.elements.captions),xu(t.elements.controls),xu(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),ru(e)&&e()):($u.call(t),Ou(t.elements.original,t.elements.container),Ku.call(t,t.elements.original,"destroyed",!0),ru(e)&&e.call(t.elements.original),t.ready=!1,setTimeout((function(){t.elements=null,t.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?($h.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&ru(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}}},{key:"supports",value:function(e){return qu.mime.call(this,e)}},{key:"isHTML5",get:function(){return this.provider===Fh.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===Fh.youtube}},{key:"isVimeo",get:function(){return this.provider===Fh.vimeo}},{key:"isVideo",get:function(){return this.type===Hh}},{key:"isAudio",get:function(){return this.type===qh}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",set:function(e){if(this.duration){var t=tu(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}},get:function(){return Number(this.media.currentTime)}},{key:"buffered",get:function(){var e=this.media.buffered;return tu(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,n=tu(t)&&t!==1/0?t:0;return e||n}},{key:"volume",set:function(e){var t=e;nu(t)&&(t=Number(t)),tu(t)||(t=this.storage.get("volume")),tu(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!du(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;iu(t)||(t=this.storage.get("muted")),iu(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return Boolean(this.media.muted)}},{key:"hasAudio",get:function(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}},{key:"speed",set:function(e){var t=this,n=null;tu(e)&&(n=e),tu(n)||(n=this.storage.get("speed")),tu(n)||(n=this.config.speed.selected);var i=this.minimumSpeed,r=this.maximumSpeed;n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(e,t),n)}(n,i,r),this.config.speed.selected=n,setTimeout((function(){t.media.playbackRate=n}),0)},get:function(){return Number(this.media.playbackRate)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,Po(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,Po(this.options.speed)):this.isVimeo?2:16}},{key:"quality",set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!du(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(tu),r=!0;if(!n.includes(i)){var a=function(e,t){return au(e)&&e.length?e.reduce((function(e,n){return Math.abs(n-t)1&&void 0!==arguments[1]?arguments[1]:{},i=null;return nu(t)?i=Array.from(document.querySelectorAll(t)):ou(t)?i=Array.from(t):au(t)&&(i=t.filter(su)),du(i)?null:i.map((function(t){return new e(t,n)}))}}]),e}();return Tf.defaults=(kf=_h,JSON.parse(JSON.stringify(kf))),Tf}))