plyr/demo/dist/demo.min.js
2019-02-23 13:14:01 +11:00

3 lines
154 KiB
JavaScript

"object"==typeof navigator&&function(){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],i=!0,r=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,a=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c=t(function(e,t){function n(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}function i(e,t){var i=[],r=[];return null==t&&(t=function(e,t){return i[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n(i,t)).join(".")+"]"}),function(a,s){if(i.length>0){var o=n(i,this);~o?i.splice(o+1):i.push(this),~o?r.splice(o,1/0,a):r.push(a),~n(i,s)&&(s=t.call(this,a,s))}else i.push(s);return null==e?s instanceof Error?function(e){var t={stack:e.stack,message:e.message,name:e.name};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(s):s:e.call(this,a,s)}}(e.exports=function(e,t,n,r){return JSON.stringify(e,i(t,r),n)}).getSerialize=i}),u=(c.getSerialize,"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{});function d(e){return void 0===e}function h(e){return"[object Object]"===Object.prototype.toString.call(e)}function p(e){return"[object String]"===Object.prototype.toString.call(e)}function m(e){return"[object Array]"===Object.prototype.toString.call(e)}function f(){if(!("fetch"in u))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function g(e,t){var n,i;if(d(e.length))for(n in e)v(e,n)&&t.call(null,n,e[n]);else if(i=e.length)for(n=0;n<i;n++)t.call(null,n,e[n])}function y(e,t){if("number"!=typeof t)throw new Error("2nd argument to `truncate` function should be a number");return"string"!=typeof e||0===t?e:e.length<=t?e:e.substr(0,t)+"…"}function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function b(e){for(var t,n=[],i=0,r=e.length;i<r;i++)p(t=e[i])?n.push(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):t&&t.source&&n.push(t.source);return new RegExp(n.join("|"),"i")}function k(e){var t,n,i,r,a,s=[];if(!e||!e.tagName)return"";if(s.push(e.tagName.toLowerCase()),e.id&&s.push("#"+e.id),(t=e.className)&&p(t))for(n=t.split(/\s+/),a=0;a<n.length;a++)s.push("."+n[a]);var o=["type","name","title","alt"];for(a=0;a<o.length;a++)i=o[a],(r=e.getAttribute(i))&&s.push("["+i+'="'+r+'"]');return s.join("")}function w(e,t){return!!(!!e^!!t)}function _(e,t){if(w(e,t))return!1;var n,i,r=e.frames,a=t.frames;if(void 0===r||void 0===a)return!1;if(r.length!==a.length)return!1;for(var s=0;s<r.length;s++)if(n=r[s],i=a[s],n.filename!==i.filename||n.lineno!==i.lineno||n.colno!==i.colno||n.function!==i.function)return!1;return!0}var T=3,E=51200,S=40;function C(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function x(e){if("string"==typeof e){return y(e,40)}if("number"==typeof e||"boolean"==typeof e||void 0===e)return e;var t=Object.prototype.toString.call(e);return"[object Object]"===t?"[Object]":"[object Array]"===t?"[Array]":"[object Function]"===t?e.name?"[Function: "+e.name+"]":"[Function]":e}var A={isObject:function(e){return"object"===n(e)&&null!==e},isError:function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}},isErrorEvent:function(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)},isDOMError:function(e){return"[object DOMError]"===Object.prototype.toString.call(e)},isDOMException:function(e){return"[object DOMException]"===Object.prototype.toString.call(e)},isUndefined:d,isFunction:function(e){return"function"==typeof e},isPlainObject:h,isString:p,isArray:m,isEmptyObject:function(e){if(!h(e))return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},supportsErrorEvent:function(){try{return new ErrorEvent(""),!0}catch(e){return!1}},supportsDOMError:function(){try{return new DOMError(""),!0}catch(e){return!1}},supportsDOMException:function(){try{return new DOMException(""),!0}catch(e){return!1}},supportsFetch:f,supportsReferrerPolicy:function(){if(!f())return!1;try{return new Request("pickleRick",{referrerPolicy:"origin"}),!0}catch(e){return!1}},supportsPromiseRejectionEvent:function(){return"function"==typeof PromiseRejectionEvent},wrappedCallback:function(e){return function(t,n){var i=e(t)||t;return n&&n(i)||i}},each:g,objectMerge:function(e,t){return t?(g(t,function(t,n){e[t]=n}),e):e},truncate:y,objectFrozen:function(e){return!!Object.isFrozen&&Object.isFrozen(e)},hasKey:v,joinRegExp:b,urlencode:function(e){var t=[];return g(e,function(e,n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}),t.join("&")},uuid4:function(){var e=u.crypto||u.msCrypto;if(!d(e)&&e.getRandomValues){var t=new Uint16Array(8);e.getRandomValues(t),t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;var n=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return n(t[0])+n(t[1])+n(t[2])+n(t[3])+n(t[4])+n(t[5])+n(t[6])+n(t[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},htmlTreeAsString:function(e){for(var t,n=[],i=0,r=0,a=" > ".length;e&&i++<5&&!("html"===(t=k(e))||i>1&&r+n.length*a+t.length>=80);)n.push(t),r+=t.length,e=e.parentNode;return n.reverse().join(" > ")},htmlElementAsString:k,isSameException:function(e,t){return!w(e,t)&&(e=e.values[0],t=t.values[0],e.type===t.type&&e.value===t.value&&(n=e.stacktrace,i=t.stacktrace,(!d(n)||!d(i))&&_(e.stacktrace,t.stacktrace)));var n,i},isSameStacktrace:_,parseUrl:function(e){if("string"!=typeof e)return{};var t=e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/),n=t[6]||"",i=t[8]||"";return{protocol:t[2],host:t[4],path:t[5],relative:t[5]+n+i}},fill:function(e,t,n,i){if(null!=e){var r=e[t];e[t]=n(r),e[t].__raven__=!0,e[t].__orig__=r,i&&i.push([e,t,r])}},safeJoin:function(e,t){if(!m(e))return"";for(var n=[],i=0;i<e.length;i++)try{n.push(String(e[i]))}catch(e){n.push("[value cannot be serialized]")}return n.join(t)},serializeException:function e(t,n,i){if(!h(t))return t;i="number"!=typeof(n="number"!=typeof n?T:n)?E:i;var r=function e(t,n){return 0===n?x(t):h(t)?Object.keys(t).reduce(function(i,r){return i[r]=e(t[r],n-1),i},{}):Array.isArray(t)?t.map(function(t){return e(t,n-1)}):x(t)}(t,n);return C(c(r))>i?e(t,n-1):r},serializeKeysForMessage:function(e,t){if("number"==typeof e||"string"==typeof e)return e.toString();if(!Array.isArray(e))return"";if(0===(e=e.filter(function(e){return"string"==typeof e})).length)return"[object has no keys]";if(t="number"!=typeof t?S:t,e[0].length>=t)return e[0];for(var n=e.length;n>0;n--){var i=e.slice(0,n).join(", ");if(!(i.length>t))return n===e.length?i:i+"…"}return""},sanitize:function(e,t){if(!m(t)||m(t)&&0===t.length)return e;var n,i=b(t),r="********";try{n=JSON.parse(c(e))}catch(t){return e}return function e(t){return m(t)?t.map(function(t){return e(t)}):h(t)?Object.keys(t).reduce(function(n,a){return i.test(a)?n[a]=r:n[a]=e(t[a]),n},{}):t}(n)}},P={collectWindowErrors:!0,debug:!1},O="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},M=[].slice,N="?",L=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function I(){return"undefined"==typeof document||null==document.location?"":document.location.href}P.report=function(){var e,t,n=[],i=null,r=null,a=null;function s(e,t){var i=null;if(!t||P.collectWindowErrors){for(var r in n)if(n.hasOwnProperty(r))try{n[r].apply(null,[e].concat(M.call(arguments,2)))}catch(e){i=e}if(i)throw i}}function o(t,n,i,r,o){var c=A.isErrorEvent(o)?o.error:o,u=A.isErrorEvent(t)?t.message:t;if(a)P.computeStackTrace.augmentStackTraceWithInitialElement(a,n,i,u),l();else if(c&&A.isError(c))s(P.computeStackTrace(c),!0);else{var d,h={url:n,line:i,column:r},p=void 0;if("[object String]"==={}.toString.call(u))(d=u.match(L))&&(p=d[1],u=d[2]);h.func=N,s({name:p,message:u,url:I(),stack:[h]},!0)}return!!e&&e.apply(this,arguments)}function l(){var e=a,t=i;i=null,a=null,r=null,s.apply(null,[e,!1].concat(t))}function c(e,t){var n=M.call(arguments,1);if(a){if(r===e)return;l()}var s=P.computeStackTrace(e);if(a=s,r=e,i=n,setTimeout(function(){r===e&&l()},s.incomplete?2e3:0),!1!==t)throw e}return c.subscribe=function(i){t||(e=O.onerror,O.onerror=o,t=!0),n.push(i)},c.unsubscribe=function(e){for(var t=n.length-1;t>=0;--t)n[t]===e&&n.splice(t,1)},c.uninstall=function(){t&&(O.onerror=e,t=!1,e=void 0),n=[]},c}(),P.computeStackTrace=function(){function e(e){if(void 0!==e.stack&&e.stack){for(var t,n,i,r=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx(?:-web)|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,o=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,l=/\((\S*)(?::(\d+))(?::(\d+))\)/,c=e.stack.split("\n"),u=[],d=(/^(.*) is undefined$/.exec(e.message),0),h=c.length;d<h;++d){if(n=r.exec(c[d])){var p=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(t=l.exec(n[2]))&&(n[2]=t[1],n[3]=t[2],n[4]=t[3]),i={url:p?null:n[2],func:n[1]||N,args:p?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=a.exec(c[d]))i={url:n[2],func:n[1]||N,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=s.exec(c[d])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(t=o.exec(n[3]))?(n[3]=t[1],n[4]=t[2],n[5]=null):0!==d||n[5]||void 0===e.columnNumber||(u[0].column=e.columnNumber+1),i={url:n[3],func:n[1]||N,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}if(!i.func&&i.line&&(i.func=N),i.url&&"blob:"===i.url.substr(0,5)){var m=new XMLHttpRequest;if(m.open("GET",i.url,!1),m.send(null),200===m.status){var f=m.responseText||"",g=(f=f.slice(-300)).match(/\/\/# sourceMappingURL=(.*)$/);if(g){var y=g[1];"~"===y.charAt(0)&&(y=("undefined"==typeof document||null==document.location?"":document.location.origin?document.location.origin:document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:""))+y.slice(1)),i.url=y.slice(0,-4)}}}u.push(i)}return u.length?{name:e.name,message:e.message,url:I(),stack:u}:null}}function t(e,t,n,i){var r={url:t,line:n};if(r.url&&r.line){if(e.incomplete=!1,r.func||(r.func=N),e.stack.length>0&&e.stack[0].url===r.url){if(e.stack[0].line===r.line)return!1;if(!e.stack[0].line&&e.stack[0].func===r.func)return e.stack[0].line=r.line,!1}return e.stack.unshift(r),e.partial=!0,!0}return e.incomplete=!0,!1}function n(e,r){for(var a,s,o=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,l=[],c={},u=!1,d=n.caller;d&&!u;d=d.caller)if(d!==i&&d!==P.report){if(s={url:null,func:N,line:null,column:null},d.name?s.func=d.name:(a=o.exec(d.toString()))&&(s.func=a[1]),void 0===s.func)try{s.func=a.input.substring(0,a.input.indexOf("{"))}catch(e){}c[""+d]?u=!0:c[""+d]=!0,l.push(s)}r&&l.splice(0,r);var h={name:e.name,message:e.message,url:I(),stack:l};return t(h,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),h}function i(t,i){var r=null;i=null==i?0:+i;try{if(r=e(t))return r}catch(e){if(P.debug)throw e}try{if(r=n(t,i+1))return r}catch(e){if(P.debug)throw e}return{name:t.name,message:t.message,url:I()}}return i.augmentStackTraceWithInitialElement=t,i.computeStackTraceFromStackProp=e,i}();var j=P;function R(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function D(e,t,n,i,r,a){return R((s=R(R(t,e),R(i,a)))<<(o=r)|s>>>32-o,n);var s,o}function F(e,t,n,i,r,a,s){return D(t&n|~t&i,e,t,r,a,s)}function B(e,t,n,i,r,a,s){return D(t&i|n&~i,e,t,r,a,s)}function H(e,t,n,i,r,a,s){return D(t^n^i,e,t,r,a,s)}function q(e,t,n,i,r,a,s){return D(n^(t|~i),e,t,r,a,s)}function U(e,t){var n,i,r,a,s;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var o=1732584193,l=-271733879,c=-1732584194,u=271733878;for(n=0;n<e.length;n+=16)i=o,r=l,a=c,s=u,o=F(o,l,c,u,e[n],7,-680876936),u=F(u,o,l,c,e[n+1],12,-389564586),c=F(c,u,o,l,e[n+2],17,606105819),l=F(l,c,u,o,e[n+3],22,-1044525330),o=F(o,l,c,u,e[n+4],7,-176418897),u=F(u,o,l,c,e[n+5],12,1200080426),c=F(c,u,o,l,e[n+6],17,-1473231341),l=F(l,c,u,o,e[n+7],22,-45705983),o=F(o,l,c,u,e[n+8],7,1770035416),u=F(u,o,l,c,e[n+9],12,-1958414417),c=F(c,u,o,l,e[n+10],17,-42063),l=F(l,c,u,o,e[n+11],22,-1990404162),o=F(o,l,c,u,e[n+12],7,1804603682),u=F(u,o,l,c,e[n+13],12,-40341101),c=F(c,u,o,l,e[n+14],17,-1502002290),o=B(o,l=F(l,c,u,o,e[n+15],22,1236535329),c,u,e[n+1],5,-165796510),u=B(u,o,l,c,e[n+6],9,-1069501632),c=B(c,u,o,l,e[n+11],14,643717713),l=B(l,c,u,o,e[n],20,-373897302),o=B(o,l,c,u,e[n+5],5,-701558691),u=B(u,o,l,c,e[n+10],9,38016083),c=B(c,u,o,l,e[n+15],14,-660478335),l=B(l,c,u,o,e[n+4],20,-405537848),o=B(o,l,c,u,e[n+9],5,568446438),u=B(u,o,l,c,e[n+14],9,-1019803690),c=B(c,u,o,l,e[n+3],14,-187363961),l=B(l,c,u,o,e[n+8],20,1163531501),o=B(o,l,c,u,e[n+13],5,-1444681467),u=B(u,o,l,c,e[n+2],9,-51403784),c=B(c,u,o,l,e[n+7],14,1735328473),o=H(o,l=B(l,c,u,o,e[n+12],20,-1926607734),c,u,e[n+5],4,-378558),u=H(u,o,l,c,e[n+8],11,-2022574463),c=H(c,u,o,l,e[n+11],16,1839030562),l=H(l,c,u,o,e[n+14],23,-35309556),o=H(o,l,c,u,e[n+1],4,-1530992060),u=H(u,o,l,c,e[n+4],11,1272893353),c=H(c,u,o,l,e[n+7],16,-155497632),l=H(l,c,u,o,e[n+10],23,-1094730640),o=H(o,l,c,u,e[n+13],4,681279174),u=H(u,o,l,c,e[n],11,-358537222),c=H(c,u,o,l,e[n+3],16,-722521979),l=H(l,c,u,o,e[n+6],23,76029189),o=H(o,l,c,u,e[n+9],4,-640364487),u=H(u,o,l,c,e[n+12],11,-421815835),c=H(c,u,o,l,e[n+15],16,530742520),o=q(o,l=H(l,c,u,o,e[n+2],23,-995338651),c,u,e[n],6,-198630844),u=q(u,o,l,c,e[n+7],10,1126891415),c=q(c,u,o,l,e[n+14],15,-1416354905),l=q(l,c,u,o,e[n+5],21,-57434055),o=q(o,l,c,u,e[n+12],6,1700485571),u=q(u,o,l,c,e[n+3],10,-1894986606),c=q(c,u,o,l,e[n+10],15,-1051523),l=q(l,c,u,o,e[n+1],21,-2054922799),o=q(o,l,c,u,e[n+8],6,1873313359),u=q(u,o,l,c,e[n+15],10,-30611744),c=q(c,u,o,l,e[n+6],15,-1560198380),l=q(l,c,u,o,e[n+13],21,1309151649),o=q(o,l,c,u,e[n+4],6,-145523070),u=q(u,o,l,c,e[n+11],10,-1120210379),c=q(c,u,o,l,e[n+2],15,718787259),l=q(l,c,u,o,e[n+9],21,-343485551),o=R(o,i),l=R(l,r),c=R(c,a),u=R(u,s);return[o,l,c,u]}function V(e){var t,n="",i=32*e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function z(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8*e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function W(e){var t,n,i="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),i+="0123456789abcdef".charAt(t>>>4&15)+"0123456789abcdef".charAt(15&t);return i}function K(e){return unescape(encodeURIComponent(e))}function X(e){return function(e){return V(U(z(e),8*e.length))}(K(e))}function J(e,t){return function(e,t){var n,i,r=z(e),a=[],s=[];for(a[15]=s[15]=void 0,r.length>16&&(r=U(r,8*e.length)),n=0;n<16;n+=1)a[n]=909522486^r[n],s[n]=1549556828^r[n];return i=U(a.concat(z(t)),512+8*t.length),V(U(s.concat(i),640))}(K(e),K(t))}var Y=function(e,t,n){return t?n?J(t,e):W(J(t,e)):n?X(e):W(X(e))};function $(e){this.name="RavenConfigError",this.message=e}$.prototype=new Error,$.prototype.constructor=$;var G=$,Q=function(e,t,n){var i=e[t],r=e;if(t in e){var a="warn"===t?"warning":t;e[t]=function(){var e=[].slice.call(arguments),s=A.safeJoin(e," "),o={level:a,logger:"console",extra:{arguments:e}};"assert"===t?!1===e[0]&&(s="Assertion failed: "+(A.safeJoin(e.slice(1)," ")||"console.assert"),o.extra.arguments=e.slice(1),n&&n(s,o)):n&&n(s,o),i&&Function.prototype.apply.call(i,r,e)}}},Z=A.isErrorEvent,ee=A.isDOMError,te=A.isDOMException,ne=A.isError,ie=A.isObject,re=A.isPlainObject,ae=A.isUndefined,se=A.isFunction,oe=A.isString,le=A.isArray,ce=A.isEmptyObject,ue=A.each,de=A.objectMerge,he=A.truncate,pe=A.objectFrozen,me=A.hasKey,fe=A.joinRegExp,ge=A.urlencode,ye=A.uuid4,ve=A.htmlTreeAsString,be=A.isSameException,ke=A.isSameStacktrace,we=A.parseUrl,_e=A.fill,Te=A.supportsFetch,Ee=A.supportsReferrerPolicy,Se=A.serializeKeysForMessage,Ce=A.serializeException,xe=A.sanitize,Ae=Q,Pe="source protocol user pass host port path".split(" "),Oe=/^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;function Me(){return+new Date}var Ne="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},Le=Ne.document,Ie=Ne.navigator;function je(e,t){return se(t)?function(n){return t(n,e)}:t}function Re(){for(var e in this._hasJSON=!("object"!==("undefined"==typeof JSON?"undefined":n(JSON))||!JSON.stringify),this._hasDocument=!ae(Le),this._hasNavigator=!ae(Ie),this._lastCapturedException=null,this._lastData=null,this._lastEventId=null,this._globalServer=null,this._globalKey=null,this._globalProject=null,this._globalContext={},this._globalOptions={release:Ne.SENTRY_RELEASE&&Ne.SENTRY_RELEASE.id,logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],headers:null,collectWindowErrors:!0,captureUnhandledRejections:!0,maxMessageLength:0,maxUrlLength:250,stackTraceLimit:50,autoBreadcrumbs:!0,instrument:!0,sampleRate:1,sanitizeKeys:[]},this._fetchDefaults={method:"POST",referrerPolicy:Ee()?"origin":""},this._ignoreOnError=0,this._isRavenInstalled=!1,this._originalErrorStackTraceLimit=Error.stackTraceLimit,this._originalConsole=Ne.console||{},this._originalConsoleMethods={},this._plugins=[],this._startTime=Me(),this._wrappedBuiltIns=[],this._breadcrumbs=[],this._lastCapturedEvent=null,this._keypressTimeout,this._location=Ne.location,this._lastHref=this._location&&this._location.href,this._resetBackoff(),this._originalConsole)this._originalConsoleMethods[e]=this._originalConsole[e]}Re.prototype={VERSION:"3.27.0",debug:!1,TraceKit:j,config:function(e,t){var n=this;if(n._globalServer)return this._logDebug("error","Error: Raven has already been configured"),n;if(!e)return n;var i=n._globalOptions;t&&ue(t,function(e,t){"tags"===e||"extra"===e||"user"===e?n._globalContext[e]=t:i[e]=t}),n.setDSN(e),i.ignoreErrors.push(/^Script error\.?$/),i.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/),i.ignoreErrors=fe(i.ignoreErrors),i.ignoreUrls=!!i.ignoreUrls.length&&fe(i.ignoreUrls),i.whitelistUrls=!!i.whitelistUrls.length&&fe(i.whitelistUrls),i.includePaths=fe(i.includePaths),i.maxBreadcrumbs=Math.max(0,Math.min(i.maxBreadcrumbs||100,100));var r={xhr:!0,console:!0,dom:!0,location:!0,sentry:!0},a=i.autoBreadcrumbs;"[object Object]"==={}.toString.call(a)?a=de(r,a):!1!==a&&(a=r),i.autoBreadcrumbs=a;var s={tryCatch:!0},o=i.instrument;return"[object Object]"==={}.toString.call(o)?o=de(s,o):!1!==o&&(o=s),i.instrument=o,j.collectWindowErrors=!!i.collectWindowErrors,n},install:function(){var e=this;return e.isSetup()&&!e._isRavenInstalled&&(j.report.subscribe(function(){e._handleOnErrorStackInfo.apply(e,arguments)}),e._globalOptions.captureUnhandledRejections&&e._attachPromiseRejectionHandler(),e._patchFunctionToString(),e._globalOptions.instrument&&e._globalOptions.instrument.tryCatch&&e._instrumentTryCatch(),e._globalOptions.autoBreadcrumbs&&e._instrumentBreadcrumbs(),e._drainPlugins(),e._isRavenInstalled=!0),Error.stackTraceLimit=e._globalOptions.stackTraceLimit,this},setDSN:function(e){var t=this._parseDSN(e),n=t.path.lastIndexOf("/"),i=t.path.substr(1,n);this._dsn=e,this._globalKey=t.user,this._globalSecret=t.pass&&t.pass.substr(1),this._globalProject=t.path.substr(n+1),this._globalServer=this._getGlobalServer(t),this._globalEndpoint=this._globalServer+"/"+i+"api/"+this._globalProject+"/store/",this._resetBackoff()},context:function(e,t,n){return se(e)&&(n=t||[],t=e,e={}),this.wrap(e,t).apply(this,n)},wrap:function(e,t,n){var i=this;if(ae(t)&&!se(e))return e;if(se(e)&&(t=e,e=void 0),!se(t))return t;try{if(t.__raven__)return t;if(t.__raven_wrapper__)return t.__raven_wrapper__}catch(e){return t}function r(){var r=[],a=arguments.length,s=!e||e&&!1!==e.deep;for(n&&se(n)&&n.apply(this,arguments);a--;)r[a]=s?i.wrap(e,arguments[a]):arguments[a];try{return t.apply(this,r)}catch(t){throw i._ignoreNextOnError(),i.captureException(t,e),t}}for(var a in t)me(t,a)&&(r[a]=t[a]);return r.prototype=t.prototype,t.__raven_wrapper__=r,r.__raven__=!0,r.__orig__=t,r},uninstall:function(){return j.report.uninstall(),this._detachPromiseRejectionHandler(),this._unpatchFunctionToString(),this._restoreBuiltIns(),this._restoreConsole(),Error.stackTraceLimit=this._originalErrorStackTraceLimit,this._isRavenInstalled=!1,this},_promiseRejectionHandler:function(e){this._logDebug("debug","Raven caught unhandled promise rejection:",e),this.captureException(e.reason,{mechanism:{type:"onunhandledrejection",handled:!1}})},_attachPromiseRejectionHandler:function(){return this._promiseRejectionHandler=this._promiseRejectionHandler.bind(this),Ne.addEventListener&&Ne.addEventListener("unhandledrejection",this._promiseRejectionHandler),this},_detachPromiseRejectionHandler:function(){return Ne.removeEventListener&&Ne.removeEventListener("unhandledrejection",this._promiseRejectionHandler),this},captureException:function(e,t){if(t=de({trimHeadFrames:0},t||{}),Z(e)&&e.error)e=e.error;else{if(ee(e)||te(e)){var n=e.name||(ee(e)?"DOMError":"DOMException"),i=e.message?n+": "+e.message:n;return this.captureMessage(i,de(t,{stacktrace:!0,trimHeadFrames:t.trimHeadFrames+1}))}if(ne(e))e=e;else{if(!re(e))return this.captureMessage(e,de(t,{stacktrace:!0,trimHeadFrames:t.trimHeadFrames+1}));t=this._getCaptureExceptionOptionsFromPlainObject(t,e),e=new Error(t.message)}}this._lastCapturedException=e;try{var r=j.computeStackTrace(e);this._handleStackInfo(r,t)}catch(t){if(e!==t)throw t}return this},_getCaptureExceptionOptionsFromPlainObject:function(e,t){var n=Object.keys(t).sort(),i=de(e,{message:"Non-Error exception captured with keys: "+Se(n),fingerprint:[Y(n)],extra:e.extra||{}});return i.extra.__serialized__=Ce(t),i},captureMessage:function(e,t){if(!this._globalOptions.ignoreErrors.test||!this._globalOptions.ignoreErrors.test(e)){var n,i=de({message:e+=""},t=t||{});try{throw new Error(e)}catch(e){n=e}n.name=null;var r=j.computeStackTrace(n),a=le(r.stack)&&r.stack[1];a&&"Raven.captureException"===a.func&&(a=r.stack[2]);var s=a&&a.url||"";if((!this._globalOptions.ignoreUrls.test||!this._globalOptions.ignoreUrls.test(s))&&(!this._globalOptions.whitelistUrls.test||this._globalOptions.whitelistUrls.test(s))){if(this._globalOptions.stacktrace||t.stacktrace||""===i.message){i.fingerprint=null==i.fingerprint?e:i.fingerprint,(t=de({trimHeadFrames:0},t)).trimHeadFrames+=1;var o=this._prepareFrames(r,t);i.stacktrace={frames:o.reverse()}}return i.fingerprint&&(i.fingerprint=le(i.fingerprint)?i.fingerprint:[i.fingerprint]),this._send(i),this}}},captureBreadcrumb:function(e){var t=de({timestamp:Me()/1e3},e);if(se(this._globalOptions.breadcrumbCallback)){var n=this._globalOptions.breadcrumbCallback(t);if(ie(n)&&!ce(n))t=n;else if(!1===n)return this}return this._breadcrumbs.push(t),this._breadcrumbs.length>this._globalOptions.maxBreadcrumbs&&this._breadcrumbs.shift(),this},addPlugin:function(e){var t=[].slice.call(arguments,1);return this._plugins.push([e,t]),this._isRavenInstalled&&this._drainPlugins(),this},setUserContext:function(e){return this._globalContext.user=e,this},setExtraContext:function(e){return this._mergeContext("extra",e),this},setTagsContext:function(e){return this._mergeContext("tags",e),this},clearContext:function(){return this._globalContext={},this},getContext:function(){return JSON.parse(c(this._globalContext))},setEnvironment:function(e){return this._globalOptions.environment=e,this},setRelease:function(e){return this._globalOptions.release=e,this},setDataCallback:function(e){var t=this._globalOptions.dataCallback;return this._globalOptions.dataCallback=je(t,e),this},setBreadcrumbCallback:function(e){var t=this._globalOptions.breadcrumbCallback;return this._globalOptions.breadcrumbCallback=je(t,e),this},setShouldSendCallback:function(e){var t=this._globalOptions.shouldSendCallback;return this._globalOptions.shouldSendCallback=je(t,e),this},setTransport:function(e){return this._globalOptions.transport=e,this},lastException:function(){return this._lastCapturedException},lastEventId:function(){return this._lastEventId},isSetup:function(){return!!this._hasJSON&&(!!this._globalServer||(this.ravenNotConfiguredError||(this.ravenNotConfiguredError=!0,this._logDebug("error","Error: Raven has not been configured.")),!1))},afterLoad:function(){var e=Ne.RavenConfig;e&&this.config(e.dsn,e.config).install()},showReportDialog:function(e){if(Le){if(!(e=de({eventId:this.lastEventId(),dsn:this._dsn,user:this._globalContext.user||{}},e)).eventId)throw new G("Missing eventId");if(!e.dsn)throw new G("Missing DSN");var t=encodeURIComponent,n=[];for(var i in e)if("user"===i){var r=e.user;r.name&&n.push("name="+t(r.name)),r.email&&n.push("email="+t(r.email))}else n.push(t(i)+"="+t(e[i]));var a=this._getGlobalServer(this._parseDSN(e.dsn)),s=Le.createElement("script");s.async=!0,s.src=a+"/api/embed/error-page/?"+n.join("&"),(Le.head||Le.body).appendChild(s)}},_ignoreNextOnError:function(){var e=this;this._ignoreOnError+=1,setTimeout(function(){e._ignoreOnError-=1})},_triggerEvent:function(e,t){var n,i;if(this._hasDocument){for(i in t=t||{},e="raven"+e.substr(0,1).toUpperCase()+e.substr(1),Le.createEvent?(n=Le.createEvent("HTMLEvents")).initEvent(e,!0,!0):(n=Le.createEventObject()).eventType=e,t)me(t,i)&&(n[i]=t[i]);if(Le.createEvent)Le.dispatchEvent(n);else try{Le.fireEvent("on"+n.eventType.toLowerCase(),n)}catch(e){}}},_breadcrumbEventHandler:function(e){var t=this;return function(n){if(t._keypressTimeout=null,t._lastCapturedEvent!==n){var i;t._lastCapturedEvent=n;try{i=ve(n.target)}catch(e){i="<unknown>"}t.captureBreadcrumb({category:"ui."+e,message:i})}}},_keypressEventHandler:function(){var e=this;return function(t){var n;try{n=t.target}catch(e){return}var i=n&&n.tagName;if(i&&("INPUT"===i||"TEXTAREA"===i||n.isContentEditable)){var r=e._keypressTimeout;r||e._breadcrumbEventHandler("input")(t),clearTimeout(r),e._keypressTimeout=setTimeout(function(){e._keypressTimeout=null},1e3)}}},_captureUrlChange:function(e,t){var n=we(this._location.href),i=we(t),r=we(e);this._lastHref=t,n.protocol===i.protocol&&n.host===i.host&&(t=i.relative),n.protocol===r.protocol&&n.host===r.host&&(e=r.relative),this.captureBreadcrumb({category:"navigation",data:{to:t,from:e}})},_patchFunctionToString:function(){var e=this;e._originalFunctionToString=Function.prototype.toString,Function.prototype.toString=function(){return"function"==typeof this&&this.__raven__?e._originalFunctionToString.apply(this.__orig__,arguments):e._originalFunctionToString.apply(this,arguments)}},_unpatchFunctionToString:function(){this._originalFunctionToString&&(Function.prototype.toString=this._originalFunctionToString)},_instrumentTryCatch:function(){var e=this,t=e._wrappedBuiltIns;function n(t){return function(n,i){for(var r=new Array(arguments.length),a=0;a<r.length;++a)r[a]=arguments[a];var s=r[0];return se(s)&&(r[0]=e.wrap({mechanism:{type:"instrument",data:{function:t.name||"<anonymous>"}}},s)),t.apply?t.apply(this,r):t(r[0],r[1])}}var i=this._globalOptions.autoBreadcrumbs;function r(n){var r=Ne[n]&&Ne[n].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(_e(r,"addEventListener",function(t){return function(r,a,s,o){try{a&&a.handleEvent&&(a.handleEvent=e.wrap({mechanism:{type:"instrument",data:{target:n,function:"handleEvent",handler:a&&a.name||"<anonymous>"}}},a.handleEvent))}catch(e){}var l,c,u;return i&&i.dom&&("EventTarget"===n||"Node"===n)&&(c=e._breadcrumbEventHandler("click"),u=e._keypressEventHandler(),l=function(e){if(e){var t;try{t=e.type}catch(e){return}return"click"===t?c(e):"keypress"===t?u(e):void 0}}),t.call(this,r,e.wrap({mechanism:{type:"instrument",data:{target:n,function:"addEventListener",handler:a&&a.name||"<anonymous>"}}},a,l),s,o)}},t),_e(r,"removeEventListener",function(e){return function(t,n,i,r){try{n=n&&(n.__raven_wrapper__?n.__raven_wrapper__:n)}catch(e){}return e.call(this,t,n,i,r)}},t))}_e(Ne,"setTimeout",n,t),_e(Ne,"setInterval",n,t),Ne.requestAnimationFrame&&_e(Ne,"requestAnimationFrame",function(t){return function(n){return t(e.wrap({mechanism:{type:"instrument",data:{function:"requestAnimationFrame",handler:t&&t.name||"<anonymous>"}}},n))}},t);for(var a=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],s=0;s<a.length;s++)r(a[s])},_instrumentBreadcrumbs:function(){var e=this,t=this._globalOptions.autoBreadcrumbs,n=e._wrappedBuiltIns;function i(t,n){t in n&&se(n[t])&&_e(n,t,function(n){return e.wrap({mechanism:{type:"instrument",data:{function:t,handler:n&&n.name||"<anonymous>"}}},n)})}if(t.xhr&&"XMLHttpRequest"in Ne){var r=Ne.XMLHttpRequest&&Ne.XMLHttpRequest.prototype;_e(r,"open",function(t){return function(n,i){return oe(i)&&-1===i.indexOf(e._globalKey)&&(this.__raven_xhr={method:n,url:i,status_code:null}),t.apply(this,arguments)}},n),_e(r,"send",function(t){return function(){var n=this;function r(){if(n.__raven_xhr&&4===n.readyState){try{n.__raven_xhr.status_code=n.status}catch(e){}e.captureBreadcrumb({type:"http",category:"xhr",data:n.__raven_xhr})}}for(var a=["onload","onerror","onprogress"],s=0;s<a.length;s++)i(a[s],n);return"onreadystatechange"in n&&se(n.onreadystatechange)?_e(n,"onreadystatechange",function(t){return e.wrap({mechanism:{type:"instrument",data:{function:"onreadystatechange",handler:t&&t.name||"<anonymous>"}}},t,r)}):n.onreadystatechange=r,t.apply(this,arguments)}},n)}t.xhr&&Te()&&_e(Ne,"fetch",function(t){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;++i)n[i]=arguments[i];var r,a=n[0],s="GET";if("string"==typeof a?r=a:"Request"in Ne&&a instanceof Ne.Request?(r=a.url,a.method&&(s=a.method)):r=""+a,-1!==r.indexOf(e._globalKey))return t.apply(this,n);n[1]&&n[1].method&&(s=n[1].method);var o={method:s,url:r,status_code:null};return t.apply(this,n).then(function(t){return o.status_code=t.status,e.captureBreadcrumb({type:"http",category:"fetch",data:o}),t}).catch(function(t){throw e.captureBreadcrumb({type:"http",category:"fetch",data:o,level:"error"}),t})}},n),t.dom&&this._hasDocument&&(Le.addEventListener?(Le.addEventListener("click",e._breadcrumbEventHandler("click"),!1),Le.addEventListener("keypress",e._keypressEventHandler(),!1)):Le.attachEvent&&(Le.attachEvent("onclick",e._breadcrumbEventHandler("click")),Le.attachEvent("onkeypress",e._keypressEventHandler())));var a=Ne.chrome,s=!(a&&a.app&&a.app.runtime)&&Ne.history&&Ne.history.pushState&&Ne.history.replaceState;if(t.location&&s){var o=Ne.onpopstate;Ne.onpopstate=function(){var t=e._location.href;if(e._captureUrlChange(e._lastHref,t),o)return o.apply(this,arguments)};var l=function(t){return function(){var n=arguments.length>2?arguments[2]:void 0;return n&&e._captureUrlChange(e._lastHref,n+""),t.apply(this,arguments)}};_e(Ne.history,"pushState",l,n),_e(Ne.history,"replaceState",l,n)}if(t.console&&"console"in Ne&&console.log){var c=function(t,n){e.captureBreadcrumb({message:t,level:n.level,category:"console"})};ue(["debug","info","warn","error","log"],function(e,t){Ae(console,t,c)})}},_restoreBuiltIns:function(){for(var e;this._wrappedBuiltIns.length;){var t=(e=this._wrappedBuiltIns.shift())[0],n=e[1],i=e[2];t[n]=i}},_restoreConsole:function(){for(var e in this._originalConsoleMethods)this._originalConsole[e]=this._originalConsoleMethods[e]},_drainPlugins:function(){var e=this;ue(this._plugins,function(t,n){var i=n[0],r=n[1];i.apply(e,[e].concat(r))})},_parseDSN:function(e){var t=Oe.exec(e),n={},i=7;try{for(;i--;)n[Pe[i]]=t[i]||""}catch(t){throw new G("Invalid DSN: "+e)}if(n.pass&&!this._globalOptions.allowSecretKey)throw new G("Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key");return n},_getGlobalServer:function(e){var t="//"+e.host+(e.port?":"+e.port:"");return e.protocol&&(t=e.protocol+":"+t),t},_handleOnErrorStackInfo:function(e,t){(t=t||{}).mechanism=t.mechanism||{type:"onerror",handled:!1},this._ignoreOnError||this._handleStackInfo(e,t)},_handleStackInfo:function(e,t){var n=this._prepareFrames(e,t);this._triggerEvent("handle",{stackInfo:e,options:t}),this._processException(e.name,e.message,e.url,e.lineno,n,t)},_prepareFrames:function(e,t){var n=this,i=[];if(e.stack&&e.stack.length&&(ue(e.stack,function(t,r){var a=n._normalizeFrame(r,e.url);a&&i.push(a)}),t&&t.trimHeadFrames))for(var r=0;r<t.trimHeadFrames&&r<i.length;r++)i[r].in_app=!1;return i=i.slice(0,this._globalOptions.stackTraceLimit)},_normalizeFrame:function(e,t){var n={filename:e.url,lineno:e.line,colno:e.column,function:e.func||"?"};return e.url||(n.filename=t),n.in_app=!(this._globalOptions.includePaths.test&&!this._globalOptions.includePaths.test(n.filename)||/(Raven|TraceKit)\./.test(n.function)||/raven\.(min\.)?js$/.test(n.filename)),n},_processException:function(e,t,n,i,r,a){var s,o=(e?e+": ":"")+(t||"");if((!this._globalOptions.ignoreErrors.test||!this._globalOptions.ignoreErrors.test(t)&&!this._globalOptions.ignoreErrors.test(o))&&(r&&r.length?(n=r[0].filename||n,r.reverse(),s={frames:r}):n&&(s={frames:[{filename:n,lineno:i,in_app:!0}]}),(!this._globalOptions.ignoreUrls.test||!this._globalOptions.ignoreUrls.test(n))&&(!this._globalOptions.whitelistUrls.test||this._globalOptions.whitelistUrls.test(n)))){var l=de({exception:{values:[{type:e,value:t,stacktrace:s}]},transaction:n},a),c=l.exception.values[0];null==c.type&&""===c.value&&(c.value="Unrecoverable error caught"),!l.exception.mechanism&&l.mechanism&&(l.exception.mechanism=l.mechanism,delete l.mechanism),l.exception.mechanism=de({type:"generic",handled:!0},l.exception.mechanism||{}),this._send(l)}},_trimPacket:function(e){var t=this._globalOptions.maxMessageLength;if(e.message&&(e.message=he(e.message,t)),e.exception){var n=e.exception.values[0];n.value=he(n.value,t)}var i=e.request;return i&&(i.url&&(i.url=he(i.url,this._globalOptions.maxUrlLength)),i.Referer&&(i.Referer=he(i.Referer,this._globalOptions.maxUrlLength))),e.breadcrumbs&&e.breadcrumbs.values&&this._trimBreadcrumbs(e.breadcrumbs),e},_trimBreadcrumbs:function(e){for(var t,n,i,r=["to","from","url"],a=0;a<e.values.length;++a)if((n=e.values[a]).hasOwnProperty("data")&&ie(n.data)&&!pe(n.data)){i=de({},n.data);for(var s=0;s<r.length;++s)t=r[s],i.hasOwnProperty(t)&&i[t]&&(i[t]=he(i[t],this._globalOptions.maxUrlLength));e.values[a].data=i}},_getHttpData:function(){if(this._hasNavigator||this._hasDocument){var e={};return this._hasNavigator&&Ie.userAgent&&(e.headers={"User-Agent":Ie.userAgent}),Ne.location&&Ne.location.href&&(e.url=Ne.location.href),this._hasDocument&&Le.referrer&&(e.headers||(e.headers={}),e.headers.Referer=Le.referrer),e}},_resetBackoff:function(){this._backoffDuration=0,this._backoffStart=null},_shouldBackoff:function(){return this._backoffDuration&&Me()-this._backoffStart<this._backoffDuration},_isRepeatData:function(e){var t=this._lastData;return!(!t||e.message!==t.message||e.transaction!==t.transaction)&&(e.stacktrace||t.stacktrace?ke(e.stacktrace,t.stacktrace):!e.exception&&!t.exception||be(e.exception,t.exception))},_setBackoffState:function(e){if(!this._shouldBackoff()){var t=e.status;if(400===t||401===t||429===t){var n;try{n=Te()?e.headers.get("Retry-After"):e.getResponseHeader("Retry-After"),n=1e3*parseInt(n,10)}catch(e){}this._backoffDuration=n||(2*this._backoffDuration||1e3),this._backoffStart=Me()}}},_send:function(e){var t=this._globalOptions,n={project:this._globalProject,logger:t.logger,platform:"javascript"},i=this._getHttpData();i&&(n.request=i),e.trimHeadFrames&&delete e.trimHeadFrames,(e=de(n,e)).tags=de(de({},this._globalContext.tags),e.tags),e.extra=de(de({},this._globalContext.extra),e.extra),e.extra["session:duration"]=Me()-this._startTime,this._breadcrumbs&&this._breadcrumbs.length>0&&(e.breadcrumbs={values:[].slice.call(this._breadcrumbs,0)}),this._globalContext.user&&(e.user=this._globalContext.user),t.environment&&(e.environment=t.environment),t.release&&(e.release=t.release),t.serverName&&(e.server_name=t.serverName),e=this._sanitizeData(e),Object.keys(e).forEach(function(t){(null==e[t]||""===e[t]||ce(e[t]))&&delete e[t]}),se(t.dataCallback)&&(e=t.dataCallback(e)||e),e&&!ce(e)&&(se(t.shouldSendCallback)&&!t.shouldSendCallback(e)||(this._shouldBackoff()?this._logDebug("warn","Raven dropped error due to backoff: ",e):"number"==typeof t.sampleRate?Math.random()<t.sampleRate&&this._sendProcessedPayload(e):this._sendProcessedPayload(e)))},_sanitizeData:function(e){return xe(e,this._globalOptions.sanitizeKeys)},_getUuid:function(){return ye()},_sendProcessedPayload:function(e,t){var n=this,i=this._globalOptions;if(this.isSetup())if(e=this._trimPacket(e),this._globalOptions.allowDuplicates||!this._isRepeatData(e)){this._lastEventId=e.event_id||(e.event_id=this._getUuid()),this._lastData=e,this._logDebug("debug","Raven about to send:",e);var r={sentry_version:"7",sentry_client:"raven-js/"+this.VERSION,sentry_key:this._globalKey};this._globalSecret&&(r.sentry_secret=this._globalSecret);var a=e.exception&&e.exception.values[0];this._globalOptions.autoBreadcrumbs&&this._globalOptions.autoBreadcrumbs.sentry&&this.captureBreadcrumb({category:"sentry",message:a?(a.type?a.type+": ":"")+a.value:e.message,event_id:e.event_id,level:e.level||"error"});var s=this._globalEndpoint;(i.transport||this._makeRequest).call(this,{url:s,auth:r,data:e,options:i,onSuccess:function(){n._resetBackoff(),n._triggerEvent("success",{data:e,src:s}),t&&t()},onError:function(i){n._logDebug("error","Raven transport failed to send: ",i),i.request&&n._setBackoffState(i.request),n._triggerEvent("failure",{data:e,src:s}),i=i||new Error("Raven send failed (no additional details provided)"),t&&t(i)}})}else this._logDebug("warn","Raven dropped repeat event: ",e)},_makeRequest:function(e){var t=e.url+"?"+ge(e.auth),n=null,i={};if(e.options.headers&&(n=this._evaluateHash(e.options.headers)),e.options.fetchParameters&&(i=this._evaluateHash(e.options.fetchParameters)),Te()){i.body=c(e.data);var r=de({},this._fetchDefaults),a=de(r,i);return n&&(a.headers=n),Ne.fetch(t,a).then(function(t){if(t.ok)e.onSuccess&&e.onSuccess();else{var n=new Error("Sentry error code: "+t.status);n.request=t,e.onError&&e.onError(n)}}).catch(function(){e.onError&&e.onError(new Error("Sentry error code: network unavailable"))})}var s=Ne.XMLHttpRequest&&new Ne.XMLHttpRequest;s&&(("withCredentials"in s||"undefined"!=typeof XDomainRequest)&&("withCredentials"in s?s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)e.onSuccess&&e.onSuccess();else if(e.onError){var t=new Error("Sentry error code: "+s.status);t.request=s,e.onError(t)}}:(s=new XDomainRequest,t=t.replace(/^https?:/,""),e.onSuccess&&(s.onload=e.onSuccess),e.onError&&(s.onerror=function(){var t=new Error("Sentry error code: XDomainRequest");t.request=s,e.onError(t)})),s.open("POST",t),n&&ue(n,function(e,t){s.setRequestHeader(e,t)}),s.send(c(e.data))))},_evaluateHash:function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];t[n]="function"==typeof i?i():i}return t},_logDebug:function(e){this._originalConsoleMethods[e]&&(this.debug||this._globalOptions.debug)&&Function.prototype.apply.call(this._originalConsoleMethods[e],this._originalConsole,[].slice.call(arguments,1))},_mergeContext:function(e,t){ae(t)?delete this._globalContext[e]:this._globalContext[e]=de(this._globalContext[e]||{},t)}},Re.prototype.setUser=Re.prototype.setUserContext,Re.prototype.setReleaseContext=Re.prototype.setRelease;var De=Re,Fe="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},Be=Fe.Raven,He=new De;He.noConflict=function(){return Fe.Raven=Be,He},He.afterLoad();var qe=He,Ue=De;qe.Client=Ue;var Ve={addCSS:!0,thumbWidth:15,watch:!0};var ze=function(e){return null!=e?e.constructor:null},We=function(e,t){return Boolean(e&&t&&e instanceof t)},Ke=function(e){return null==e},Xe=function(e){return ze(e)===Object},Je=function(e){return ze(e)===String},Ye=function(e){return Array.isArray(e)},$e=function(e){return We(e,NodeList)},Ge={nullOrUndefined:Ke,object:Xe,number:function(e){return ze(e)===Number&&!Number.isNaN(e)},string:Je,boolean:function(e){return ze(e)===Boolean},function:function(e){return ze(e)===Function},array:Ye,nodeList:$e,element:function(e){return We(e,Element)},event:function(e){return We(e,Event)},empty:function(e){return Ke(e)||(Je(e)||Ye(e)||$e(e))&&!e.length||Xe(e)&&!Object.keys(e).length}};function Qe(e,t){if(t<1){var n=(i="".concat(t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/))?Math.max(0,(i[1]?i[1].length:0)-(i[2]?+i[2]:0)):0;return parseFloat(e.toFixed(n))}var i;return Math.round(e/t)*t}var Ze=function(){function e(t,n){i(this,e),Ge.element(t)?this.element=t:Ge.string(t)&&(this.element=document.querySelector(t)),Ge.element(this.element)&&Ge.empty(this.element.rangeTouch)&&(this.config=Object.assign({},Ve,n),this.init())}return a(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.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||!Ge.event(t))return null;var n,i=t.target,r=t.changedTouches[0],a=parseFloat(i.getAttribute("min"))||0,s=parseFloat(i.getAttribute("max"))||100,o=parseFloat(i.getAttribute("step"))||1,l=s-a,c=i.getBoundingClientRect(),u=100/c.width*(this.config.thumbWidth/2)/100;return(n=100/c.width*(r.clientX-c.left))<0?n=0:n>100&&(n=100),n<50?n-=(100-2*n)*u:n>50&&(n+=2*(n-50)*u),a+Qe(l*(n/100),o)}},{key:"set",value:function(t){e.enabled&&Ge.event(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var n=new Event(t);e.dispatchEvent(n)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;if(Ge.empty(t)||Ge.string(t)?i=Array.from(document.querySelectorAll(Ge.string(t)?t:'input[type="range"]')):Ge.element(t)?i=[t]:Ge.nodeList(t)?i=Array.from(t):Ge.array(t)&&(i=t.filter(Ge.element)),Ge.empty(i))return null;var r=Object.assign({},Ve,n);Ge.string(t)&&r.watch&&new MutationObserver(function(n){Array.from(n).forEach(function(n){Array.from(n.addedNodes).forEach(function(n){if(Ge.element(n)&&function(){return Array.from(document.querySelectorAll(i)).includes(this)}.call(n,i=t)){var i;new e(n,r)}})})}).observe(document.body,{childList:!0,subtree:!0});return i.map(function(t){return new e(t,n)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}(),et=function(e){return null!=e?e.constructor:null},tt=function(e,t){return Boolean(e&&t&&e instanceof t)},nt=function(e){return null==e},it=function(e){return et(e)===Object},rt=function(e){return et(e)===String},at=function(e){return Array.isArray(e)},st=function(e){return tt(e,NodeList)},ot=function(e){return nt(e)||(rt(e)||at(e)||st(e))&&!e.length||it(e)&&!Object.keys(e).length},lt={nullOrUndefined:nt,object:it,number:function(e){return et(e)===Number&&!Number.isNaN(e)},string:rt,boolean:function(e){return et(e)===Boolean},function:function(e){return et(e)===Function},array:at,weakMap:function(e){return tt(e,WeakMap)},nodeList:st,element:function(e){return tt(e,Element)},textNode:function(e){return et(e)===Text},event:function(e){return tt(e,Event)},keyboardEvent:function(e){return tt(e,KeyboardEvent)},cue:function(e){return tt(e,window.TextTrackCue)||tt(e,window.VTTCue)},track:function(e){return tt(e,TextTrack)||!nt(e)&&rt(e.kind)},promise:function(e){return tt(e,Promise)},url:function(e){if(tt(e,window.URL))return!0;if(!rt(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!ot(new URL(t).hostname)}catch(e){return!1}},empty:ot},ct=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 ut(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],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!lt.empty(t)&&lt.function(n)){var o=t.split(" "),l=s;ct&&(l={passive:a,capture:s}),o.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 dt(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];ut.call(this,e,t,n,!0,i,r)}function ht(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];ut.call(this,e,t,n,!1,i,r)}function pt(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];ut.call(this,e,n,function s(){ht(e,n,s,r,a);for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];i.apply(t,l)},!0,r,a)}function mt(e){var t=arguments.length>1&&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(lt.element(e)&&!lt.empty(t)){var r=new CustomEvent(t,{bubbles:n,detail:Object.assign({},i,{plyr:this})});e.dispatchEvent(r)}}function ft(e,t){var n=e.length?e:[e];Array.from(n).reverse().forEach(function(e,n){var i=n>0?t.cloneNode(!0):t,r=e.parentNode,a=e.nextSibling;i.appendChild(e),a?r.insertBefore(i,a):r.appendChild(i)})}function gt(e,t){lt.element(e)&&!lt.empty(t)&&Object.entries(t).filter(function(e){var t=o(e,2)[1];return!lt.nullOrUndefined(t)}).forEach(function(t){var n=o(t,2),i=n[0],r=n[1];return e.setAttribute(i,r)})}function yt(e,t,n){var i=document.createElement(e);return lt.object(t)&&gt(i,t),lt.string(n)&&(i.innerText=n),i}function vt(e,t,n,i){lt.element(t)&&t.appendChild(yt(e,n,i))}function bt(e){lt.nodeList(e)||lt.array(e)?Array.from(e).forEach(bt):lt.element(e)&&lt.element(e.parentNode)&&e.parentNode.removeChild(e)}function kt(e){if(lt.element(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function wt(e,t){return lt.element(t)&&lt.element(t.parentNode)&&lt.element(e)?(t.parentNode.replaceChild(e,t),e):null}function _t(e,t){if(!lt.string(e)||lt.empty(e))return{};var n={},i=t;return e.split(",").forEach(function(e){var t=e.trim(),r=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),s=a[0],o=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":lt.object(i)&&lt.string(i.class)&&(i.class+=" ".concat(r)),n.class=r;break;case"#":n.id=t.replace("#","");break;case"[":n[s]=o}}),n}function Tt(e,t){if(lt.element(e)){var n=t;lt.boolean(n)||(n=!e.hidden),n?e.setAttribute("hidden",""):e.removeAttribute("hidden")}}function Et(e,t,n){if(lt.nodeList(e))return Array.from(e).map(function(e){return Et(e,t,n)});if(lt.element(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function St(e,t){return lt.element(e)&&e.classList.contains(t)}function Ct(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}function xt(e){return this.elements.container.querySelectorAll(e)}function At(e){return this.elements.container.querySelector(e)}function Pt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];lt.element(e)&&(e.focus({preventScroll:!0}),t&&Et(e,this.config.classNames.tabFocus))}var Ot,Mt,Nt,Lt=(Ot=document.createElement("span"),Mt={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},Nt=Object.keys(Mt).find(function(e){return void 0!==Ot.style[e]}),!!lt.string(Nt)&&Mt[Nt]);function It(e){setTimeout(function(){try{Tt(e,!0),e.offsetHeight,Tt(e,!1)}catch(e){}},0)}var jt,Rt={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)},Dt={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Ft={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=Rt.isIPhone&&n&&Ft.playsinline,r=Ft[e]||"html5"!==t;return{api:r,ui:r&&Ft.rangeInput&&("video"!==e||!Rt.isIPhone||i)}},pip:!(Rt.isIPhone||!lt.function(yt("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||yt("video").disablePictureInPicture)),airplay:lt.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(lt.empty(e))return!1;var t=o(e.split("/"),1)[0],n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(Dt).includes(n)&&(n+='; codecs="'.concat(Dt[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(jt=document.createElement("input"),jt.type="range","range"===jt.type),touch:"ontouchstart"in document.documentElement,transitions:!1!==Lt,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Bt={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(function(t){var n=t.getAttribute("type");return!!lt.empty(n)||Ft.mime.call(e,n)}):[]},getQualityOptions:function(){return Bt.getSources.call(this).map(function(e){return Number(e.getAttribute("size"))}).filter(Boolean)},extend:function(){if(this.isHTML5){var e=this;Object.defineProperty(e.media,"quality",{get:function(){var t=Bt.getSources.call(e).find(function(t){return t.getAttribute("src")===e.source});return t&&Number(t.getAttribute("size"))},set:function(t){var n=Bt.getSources.call(e).find(function(e){return Number(e.getAttribute("size"))===t});if(n){var i=e.media,r=i.currentTime,a=i.paused,s=i.preload,o=i.readyState;e.media.src=n.getAttribute("src"),("none"!==s||o)&&(e.once("loadedmetadata",function(){e.currentTime=r,a||e.play()}),e.media.load()),mt.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(bt(Bt.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Ht(e){return lt.array(e)?e.filter(function(t,n){return e.indexOf(t)===n}):e}function qt(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)}function Ut(){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;i<t;i++)n[i-1]=arguments[i];if(!n.length)return e;var r=n.shift();return lt.object(r)?(Object.keys(r).forEach(function(t){lt.object(r[t])?(Object.keys(e).includes(t)||Object.assign(e,s({},t,{})),Ut(e[t],r[t])):Object.assign(e,s({},t,r[t]))}),Ut.apply(void 0,[e].concat(n))):e}function Vt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return lt.empty(e)?e:e.toString().replace(/{(\d+)}/g,function(e,t){return n[t].toString()})}function zt(){var e=arguments.length>0&&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())}function Wt(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}function Kt(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=zt(e,"-"," "),e=zt(e,"_"," "),zt(e=Wt(e)," ","")}(e)).charAt(0).toLowerCase()+e.slice(1)}function Xt(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var Jt={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Yt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(lt.empty(e)||lt.empty(t))return"";var n=qt(t.i18n,e);if(lt.empty(n))return Object.keys(Jt).includes(e)?Jt[e]:"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach(function(e){var t=o(e,2),i=t[0],r=t[1];n=zt(n,i,r)}),n},$t=function(){function e(t){i(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return a(e,[{key:"get",value:function(t){if(!e.supported||!this.enabled)return null;var n=window.localStorage.getItem(this.key);if(lt.empty(n))return null;var i=JSON.parse(n);return lt.string(t)&&t.length?i[t]:i}},{key:"set",value:function(t){if(e.supported&&this.enabled&&lt.object(t)){var n=this.get();lt.empty(n)&&(n={}),Ut(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 Gt(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 Qt(e,t){if(lt.string(e)){var n=lt.string(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=$t.supported,s=document.createElement("div");if(s.setAttribute("hidden",""),n&&s.setAttribute("id",t),a){var o=window.localStorage.getItem("".concat("cache","-").concat(t));if(null!==o){var l=JSON.parse(o);r(s,l.content)}}Gt(e).then(function(e){lt.empty(e)||(a&&window.localStorage.setItem("".concat("cache","-").concat(t),JSON.stringify({content:e})),r(s,e))}).catch(function(){})}}}var Zt=function(e){return Math.trunc(e/60/60%60,10)},en=function(e){return Math.trunc(e/60%60,10)},tn=function(e){return Math.trunc(e%60,10)};function nn(){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(!lt.number(e))return nn(null,t,n);var i=function(e){return"0".concat(e).slice(-2)},r=Zt(e),a=en(e),s=tn(e);return r=t||r>0?"".concat(r,":"):"","".concat(n&&e>0?"-":"").concat(r).concat(i(a),":").concat(i(s))}var rn={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location).host!==window.location.host||Rt.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=At.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:xt.call(this,this.config.selectors.buttons.play),pause:At.call(this,this.config.selectors.buttons.pause),restart:At.call(this,this.config.selectors.buttons.restart),rewind:At.call(this,this.config.selectors.buttons.rewind),fastForward:At.call(this,this.config.selectors.buttons.fastForward),mute:At.call(this,this.config.selectors.buttons.mute),pip:At.call(this,this.config.selectors.buttons.pip),airplay:At.call(this,this.config.selectors.buttons.airplay),settings:At.call(this,this.config.selectors.buttons.settings),captions:At.call(this,this.config.selectors.buttons.captions),fullscreen:At.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=At.call(this,this.config.selectors.progress),this.elements.inputs={seek:At.call(this,this.config.selectors.inputs.seek),volume:At.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:At.call(this,this.config.selectors.display.buffer),currentTime:At.call(this,this.config.selectors.display.currentTime),duration:At.call(this,this.config.selectors.display.duration)},lt.element(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=rn.getIconUrl.call(this),i="".concat(n.cors?"":n.url,"#").concat(this.config.iconPrefix),r=document.createElementNS("http://www.w3.org/2000/svg","svg");gt(r,Ut(t,{role:"presentation",focusable:"false"}));var a=document.createElementNS("http://www.w3.org/2000/svg","use"),s="".concat(i,"-").concat(e);return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",s),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),r.appendChild(a),r},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Yt(e,this.config);return yt("span",Object.assign({},t,{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),n)},createBadge:function(e){if(lt.empty(e))return null;var t=yt("span",{class:this.config.classNames.menu.value});return t.appendChild(yt("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=Object.assign({},t),i=Kt(e),r={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(function(e){Object.keys(n).includes(e)&&(r[e]=n[e],delete n[e])}),"button"!==r.element||Object.keys(n).includes("type")||(n.type="button"),Object.keys(n).includes("class")?n.class.includes(this.config.classNames.control)||(n.class+=" ".concat(this.config.classNames.control)):n.class=this.config.classNames.control,e){case"play":r.toggle=!0,r.label="play",r.labelPressed="pause",r.icon="play",r.iconPressed="pause";break;case"mute":r.toggle=!0,r.label="mute",r.labelPressed="unmute",r.icon="volume",r.iconPressed="muted";break;case"captions":r.toggle=!0,r.label="enableCaptions",r.labelPressed="disableCaptions",r.icon="captions-off",r.iconPressed="captions-on";break;case"fullscreen":r.toggle=!0,r.label="enterFullscreen",r.labelPressed="exitFullscreen",r.icon="enter-fullscreen",r.iconPressed="exit-fullscreen";break;case"play-large":n.class+=" ".concat(this.config.classNames.control,"--overlaid"),i="play",r.label="play",r.icon="play";break;default:lt.empty(r.label)&&(r.label=i),lt.empty(r.icon)&&(r.icon=e)}var a=yt(r.element);return r.toggle?(a.appendChild(rn.createIcon.call(this,r.iconPressed,{class:"icon--pressed"})),a.appendChild(rn.createIcon.call(this,r.icon,{class:"icon--not-pressed"})),a.appendChild(rn.createLabel.call(this,r.labelPressed,{class:"label--pressed"})),a.appendChild(rn.createLabel.call(this,r.label,{class:"label--not-pressed"}))):(a.appendChild(rn.createIcon.call(this,r.icon)),a.appendChild(rn.createLabel.call(this,r.label))),Ut(n,_t(this.config.selectors.buttons[i],n)),gt(a,n),"play"===i?(lt.array(this.elements.buttons[i])||(this.elements.buttons[i]=[]),this.elements.buttons[i].push(a)):this.elements.buttons[i]=a,a},createRange:function(e,t){var n=yt("input",Ut(_t(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Yt(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,rn.updateRangeFill.call(this,n),Ze.setup(n),n},createProgress:function(e,t){var n=yt("progress",Ut(_t(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){n.appendChild(yt("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],r=i?Yt(i,this.config):"";n.innerText="% ".concat(r.toLowerCase())}return this.elements.display[e]=n,n},createTime:function(e){var t=_t(this.config.selectors.display[e]),n=yt("div",Ut(t,{class:"".concat(this.config.classNames.display.time," ").concat(t.class?t.class:"").trim(),"aria-label":Yt(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts:function(e,t){var n=this;dt(e,"keydown keyup",function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var r,a=Ct(e,'[role="menuitemradio"]');if(!a&&[32,39].includes(i.which))rn.showMenuPanel.call(n,t,!0);else 32!==i.which&&(40===i.which||a&&39===i.which?(r=e.nextElementSibling,lt.element(r)||(r=e.parentNode.firstElementChild)):(r=e.previousElementSibling,lt.element(r)||(r=e.parentNode.lastElementChild)),Pt.call(n,r,!0))}},!1),dt(e,"keyup",function(e){13===e.which&&rn.focusFirstMenuItem.call(n,null,!0)})},createMenuItem:function(e){var t=this,n=e.value,i=e.list,r=e.type,a=e.title,s=e.badge,o=void 0===s?null:s,l=e.checked,c=void 0!==l&&l,u=_t(this.config.selectors.inputs[r]),d=yt("button",Ut(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:n})),h=yt("span");h.innerHTML=a,lt.element(o)&&h.appendChild(o),d.appendChild(h),Object.defineProperty(d,"checked",{enumerable:!0,get:function(){return"true"===d.getAttribute("aria-checked")},set:function(e){e&&Array.from(d.parentNode.children).filter(function(e){return Ct(e,'[role="menuitemradio"]')}).forEach(function(e){return e.setAttribute("aria-checked","false")}),d.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(d,"click keyup",function(e){if(!lt.keyboardEvent(e)||32===e.which){switch(e.preventDefault(),e.stopPropagation(),d.checked=!0,r){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}rn.showMenuPanel.call(t,"home",lt.keyboardEvent(e))}},r,!1),rn.bindMenuItemShortcuts.call(this,d,r),i.appendChild(d)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return lt.number(e)?nn(e,Zt(this.duration)>0,t):e},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];lt.element(e)&&lt.number(t)&&(e.innerText=rn.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(lt.element(this.elements.inputs.volume)&&rn.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),lt.element(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;lt.element(e)&&(e.value=t,rn.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&lt.event(e)){var n,i,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,i=this.duration,r=0===n||0===i||Number.isNaN(n)||Number.isNaN(i)?0:(n/i*100).toFixed(2),"timeupdate"===e.type&&rn.setRange.call(this,this.elements.inputs.seek,r);break;case"playing":case"progress":!function(e,n){var i=lt.number(n)?n:0,r=lt.element(e)?e:t.elements.display.buffer;if(lt.element(r)){r.value=i;var a=r.getElementsByTagName("span")[0];lt.element(a)&&(a.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=lt.event(e)?e.target:e;if(lt.element(t)&&"range"===t.getAttribute("type")){if(Ct(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=rn.formatTime(this.currentTime),i=rn.formatTime(this.duration),r=Yt("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",n).replace("{duration}",i))}else if(Ct(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);Rt.isWebkit&&t.style.setProperty("--value","".concat(t.value/t.max*100,"%"))}},updateSeekTooltip:function(e){var t=this;if(this.config.tooltips.seek&&lt.element(this.elements.inputs.seek)&&lt.element(this.elements.display.seekTooltip)&&0!==this.duration){var n=0,i=this.elements.progress.getBoundingClientRect(),r="".concat(this.config.classNames.tooltip,"--visible"),a=function(e){Et(t.elements.display.seekTooltip,r,e)};if(this.touch)a(!1);else{if(lt.event(e))n=100/i.width*(e.pageX-i.left);else{if(!St(this.elements.display.seekTooltip,r))return;n=parseFloat(this.elements.display.seekTooltip.style.left,10)}n<0?n=0:n>100&&(n=100),rn.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*n),this.elements.display.seekTooltip.style.left="".concat(n,"%"),lt.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!lt.element(this.elements.display.duration)&&this.config.invertTime;rn.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||rn.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return Tt(this.elements.display.currentTime,!0),void Tt(this.elements.progress,!0);lt.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=lt.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&rn.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&rn.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),rn.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){Tt(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=lt.empty(n)?this[e]:n,lt.empty(r)&&(r=this.config[e].default),!lt.empty(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(lt.element(a)||(a=i&&i.querySelector('[role="menu"]')),lt.element(a)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=rn.getLabel.call(this,e,r);var s=a&&a.querySelector('[value="'.concat(r,'"]'));lt.element(s)&&(s.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Yt("normal",this.config):"".concat(t,"&times;");case"quality":if(lt.number(t)){var n=Yt("qualityLabel.".concat(t),this.config);return n.length?n:"".concat(t,"p")}return Wt(t);case"captions":return on.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(lt.element(this.elements.settings.panels.quality)){var n=this.elements.settings.panels.quality.querySelector('[role="menu"]');lt.array(e)&&(this.options.quality=Ht(e).filter(function(e){return t.config.quality.options.includes(e)}));var i=!lt.empty(this.options.quality)&&this.options.quality.length>1;if(rn.toggleMenuButton.call(this,"quality",i),kt(n),rn.checkMenu.call(this),i){var r=function(e){var n=Yt("qualityBadge.".concat(e),t.config);return n.length?rn.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){rn.createMenuItem.call(t,{value:e,list:n,type:"quality",title:rn.getLabel.call(t,"quality",e),badge:r(e)})}),rn.updateSetting.call(this,"quality",n)}}},setCaptionsMenu:function(){var e=this;if(lt.element(this.elements.settings.panels.captions)){var t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=on.getTracks.call(this),i=Boolean(n.length);if(rn.toggleMenuButton.call(this,"captions",i),kt(t),rn.checkMenu.call(this),i){var r=n.map(function(n,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:on.getLabel.call(e,n),badge:n.language&&rn.createBadge.call(e,n.language.toUpperCase()),list:t,type:"language"}});r.unshift({value:-1,checked:!this.captions.toggled,title:Yt("disabled",this.config),list:t,type:"language"}),r.forEach(rn.createMenuItem.bind(this)),rn.updateSetting.call(this,"captions",t)}}},setSpeedMenu:function(e){var t=this;if(lt.element(this.elements.settings.panels.speed)){var n=this.elements.settings.panels.speed.querySelector('[role="menu"]');lt.array(e)?this.options.speed=e:(this.isHTML5||this.isVimeo)&&(this.options.speed=[.5,.75,1,1.25,1.5,1.75,2]),this.options.speed=this.options.speed.filter(function(e){return t.config.speed.options.includes(e)});var i=!lt.empty(this.options.speed)&&this.options.speed.length>1;rn.toggleMenuButton.call(this,"speed",i),kt(n),rn.checkMenu.call(this),i&&(this.options.speed.forEach(function(e){rn.createMenuItem.call(t,{value:e,list:n,type:"speed",title:rn.getLabel.call(t,"speed",e)})}),rn.updateSetting.call(this,"speed",n))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!lt.empty(e)&&Object.values(e).some(function(e){return!e.hidden});Tt(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;lt.element(n)||(n=Object.values(this.elements.settings.panels).find(function(e){return!e.hidden}));var i=n.querySelector('[role^="menuitem"]');Pt.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(lt.element(t)&&lt.element(n)){var i=t.hidden,r=i;if(lt.boolean(e))r=e;else if(lt.keyboardEvent(e)&&27===e.which)r=!1;else if(lt.event(e)){var a=t.contains(e.target);if(a||!a&&e.target!==n&&r)return}n.setAttribute("aria-expanded",r),Tt(t,!r),Et(this.elements.container,this.config.classNames.menu.open,r),r&&lt.keyboardEvent(e)?rn.focusFirstMenuItem.call(this,null,!0):r||i||Pt.call(this,n,lt.keyboardEvent(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 bt(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=document.getElementById("plyr-settings-".concat(this.id,"-").concat(t));if(lt.element(i)){var r=i.parentNode,a=Array.from(r.children).find(function(e){return!e.hidden});if(Ft.transitions&&!Ft.reducedMotion){r.style.width="".concat(a.scrollWidth,"px"),r.style.height="".concat(a.scrollHeight,"px");var s=rn.getMenuSize.call(this,i);dt.call(this,r,Lt,function t(n){n.target===r&&["width","height"].includes(n.propertyName)&&(r.style.width="",r.style.height="",ht.call(e,r,Lt,t))}),r.style.width="".concat(s.width,"px"),r.style.height="".concat(s.height,"px")}Tt(a,!0),Tt(i,!1),rn.focusFirstMenuItem.call(this,i,n)}},setDownloadLink:function(){var e=this.elements.buttons.download;lt.element(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,n=yt("div",_t(this.config.selectors.controls.wrapper));if(this.config.controls.includes("restart")&&n.appendChild(rn.createButton.call(this,"restart")),this.config.controls.includes("rewind")&&n.appendChild(rn.createButton.call(this,"rewind")),this.config.controls.includes("play")&&n.appendChild(rn.createButton.call(this,"play")),this.config.controls.includes("fast-forward")&&n.appendChild(rn.createButton.call(this,"fast-forward")),this.config.controls.includes("progress")){var i=yt("div",_t(this.config.selectors.progress));if(i.appendChild(rn.createRange.call(this,"seek",{id:"plyr-seek-".concat(e.id)})),i.appendChild(rn.createProgress.call(this,"buffer")),this.config.tooltips.seek){var r=yt("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(r),this.elements.display.seekTooltip=r}this.elements.progress=i,n.appendChild(this.elements.progress)}if(this.config.controls.includes("current-time")&&n.appendChild(rn.createTime.call(this,"currentTime")),this.config.controls.includes("duration")&&n.appendChild(rn.createTime.call(this,"duration")),this.config.controls.includes("mute")||this.config.controls.includes("volume")){var a=yt("div",{class:"plyr__volume"});if(this.config.controls.includes("mute")&&a.appendChild(rn.createButton.call(this,"mute")),this.config.controls.includes("volume")){var s={max:1,step:.05,value:this.config.volume};a.appendChild(rn.createRange.call(this,"volume",Ut(s,{id:"plyr-volume-".concat(e.id)}))),this.elements.volume=a}n.appendChild(a)}if(this.config.controls.includes("captions")&&n.appendChild(rn.createButton.call(this,"captions")),this.config.controls.includes("settings")&&!lt.empty(this.config.settings)){var o=yt("div",{class:"plyr__menu",hidden:""});o.appendChild(rn.createButton.call(this,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var l=yt("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),c=yt("div"),u=yt("div",{id:"plyr-settings-".concat(e.id,"-home")}),d=yt("div",{role:"menu"});u.appendChild(d),c.appendChild(u),this.elements.settings.panels.home=u,this.config.settings.forEach(function(n){var i=yt("button",Ut(_t(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:""}));rn.bindMenuItemShortcuts.call(t,i,n),dt(i,"click",function(){rn.showMenuPanel.call(t,n,!1)});var r=yt("span",null,Yt(n,t.config)),a=yt("span",{class:t.config.classNames.menu.value});a.innerHTML=e[n],r.appendChild(a),i.appendChild(r),d.appendChild(i);var s=yt("div",{id:"plyr-settings-".concat(e.id,"-").concat(n),hidden:""}),o=yt("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});o.appendChild(yt("span",{"aria-hidden":!0},Yt(n,t.config))),o.appendChild(yt("span",{class:t.config.classNames.hidden},Yt("menuBack",t.config))),dt(s,"keydown",function(e){37===e.which&&(e.preventDefault(),e.stopPropagation(),rn.showMenuPanel.call(t,"home",!0))},!1),dt(o,"click",function(){rn.showMenuPanel.call(t,"home",!1)}),s.appendChild(o),s.appendChild(yt("div",{role:"menu"})),c.appendChild(s),t.elements.settings.buttons[n]=i,t.elements.settings.panels[n]=s}),l.appendChild(c),o.appendChild(l),n.appendChild(o),this.elements.settings.popup=l,this.elements.settings.menu=o}if(this.config.controls.includes("pip")&&Ft.pip&&n.appendChild(rn.createButton.call(this,"pip")),this.config.controls.includes("airplay")&&Ft.airplay&&n.appendChild(rn.createButton.call(this,"airplay")),this.config.controls.includes("download")){var h={element:"a",href:this.download,target:"_blank"},p=this.config.urls.download;!lt.url(p)&&this.isEmbed&&Ut(h,{icon:"logo-".concat(this.provider),label:this.provider}),n.appendChild(rn.createButton.call(this,"download",h))}return this.config.controls.includes("fullscreen")&&n.appendChild(rn.createButton.call(this,"fullscreen")),this.config.controls.includes("play-large")&&this.elements.container.appendChild(rn.createButton.call(this,"play-large")),this.elements.controls=n,this.isHTML5&&rn.setQualityMenu.call(this,Bt.getQualityOptions.call(this)),rn.setSpeedMenu.call(this),n},inject:function(){var e=this;if(this.config.loadSprite){var t=rn.getIconUrl.call(this);t.cors&&Qt(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;lt.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),lt.element(this.config.controls)||lt.string(this.config.controls)?n=this.config.controls:(n=rn.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:on.getLabel.call(this)}),r=!1);var a,s=function(e){var t=e;return Object.entries(i).forEach(function(e){var n=o(e,2),i=n[0],r=n[1];t=zt(t,"{".concat(i,"}"),r)}),t};if(r&&(lt.string(this.config.controls)?n=s(n):lt.element(n)&&(n.innerHTML=s(n.innerHTML))),lt.string(this.config.selectors.controls.container)&&(a=document.querySelector(this.config.selectors.controls.container)),lt.element(a)||(a=this.elements.container),a[lt.element(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),lt.element(this.elements.controls)||rn.findElements.call(this),!lt.empty(this.elements.buttons)){var l=function(t){var n=e.config.classNames.controlPressed;Object.defineProperty(t,"pressed",{enumerable:!0,get:function(){return St(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Et(t,n,e)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(function(e){lt.array(e)||lt.nodeList(e)?Array.from(e).filter(Boolean).forEach(l):l(e)})}if(Rt.isEdge&&It(a),this.config.tooltips.controls){var c=this.config,u=c.classNames,d=c.selectors,h="".concat(d.controls.wrapper," ").concat(d.labels," .").concat(u.hidden),p=xt.call(this,h);Array.from(p).forEach(function(t){Et(t,e.config.classNames.hidden,!1),Et(t,e.config.classNames.tooltip,!0)})}}};function an(e){var t=e;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var n=document.createElement("a");n.href=t,t=n.href}try{return new URL(t)}catch(e){return null}}function sn(e){var t=new URLSearchParams;return lt.object(e)&&Object.entries(e).forEach(function(e){var n=o(e,2),i=n[0],r=n[1];t.set(i,r)}),t}var on={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!Ft.textTracks)lt.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&rn.setCaptionsMenu.call(this);else{var e,t;if(lt.element(this.elements.captions)||(this.elements.captions=yt("div",_t(this.config.selectors.captions)),e=this.elements.captions,t=this.elements.wrapper,lt.element(e)&&lt.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),Rt.isIE&&window.URL){var n=this.media.querySelectorAll("track");Array.from(n).forEach(function(e){var t=e.getAttribute("src"),n=an(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&Gt(t,"blob").then(function(t){e.setAttribute("src",window.URL.createObjectURL(t))}).catch(function(){bt(e)})})}var i=Ht((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(function(e){return e.split("-")[0]})),r=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();if("auto"===r)r=o(i,1)[0];var a=this.storage.get("captions");if(lt.boolean(a)||(a=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:a,language:r,languages:i}),this.isHTML5){var s=this.config.captions.update?"addtrack removetrack":"removetrack";dt.call(this,this.media.textTracks,s,on.update.bind(this))}setTimeout(on.update.bind(this),0)}},update:function(){var e=this,t=on.getTracks.call(this,!0),n=this.captions,i=n.active,r=n.language,a=n.meta,s=n.currentTrackNode,o=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}),t.mode="hidden",dt.call(e,t,"cuechange",function(){return on.updateCues.call(e)})}),(o&&this.language!==r||!t.includes(s))&&(on.setLanguage.call(this,r),on.toggle.call(this,i&&o)),Et(this.elements.container,this.config.classNames.captions.enabled,!lt.empty(t)),(this.config.controls||[]).includes("settings")&&this.config.settings.includes("captions")&&rn.setCaptionsMenu.call(this)},toggle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var n=this.captions.toggled,i=this.config.classNames.captions.active,r=lt.nullOrUndefined(e)?!n:e;if(r!==n){if(t||(this.captions.active=r,this.storage.set({captions:r})),!this.language&&r&&!t){var a=on.getTracks.call(this),s=on.findTrack.call(this,[this.captions.language].concat(l(this.captions.languages)),!0);return this.captions.language=s.language,void on.set.call(this,a.indexOf(s))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=r),Et(this.elements.container,i,r),this.captions.toggled=r,rn.updateSetting.call(this,"captions"),mt.call(this,this.media,r?"captionsenabled":"captionsdisabled")}}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=on.getTracks.call(this);if(-1!==e)if(lt.number(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],r=(i||{}).language;this.captions.currentTrackNode=i,rn.updateSetting.call(this,"captions"),t||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),mt.call(this,this.media,"languagechange")}on.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&on.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else on.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(lt.string(e)){var n=e.toLowerCase();this.captions.language=n;var i=on.getTracks.call(this),r=on.findTrack.call(this,[n]);on.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];return Array.from((this.media||{}).textTracks||[]).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=on.getTracks.call(this),a=function(e){return Number((n.captions.meta.get(e)||{}).default)},s=Array.from(r).sort(function(e,t){return a(t)-a(e)});return e.every(function(e){return!(t=s.find(function(t){return t.language===e}))}),t||(i?s[0]:void 0)},getCurrentTrack:function(){return on.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!lt.track(t)&&Ft.textTracks&&this.captions.toggled&&(t=on.getCurrentTrack.call(this)),lt.track(t)?lt.empty(t.label)?lt.empty(t.language)?Yt("enabled",this.config):e.language.toUpperCase():t.label:Yt("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(lt.element(this.elements.captions))if(lt.nullOrUndefined(e)||Array.isArray(e)){var t=e;if(!t){var n=on.getCurrentTrack.call(this);t=Array.from((n||{}).activeCues||[]).map(function(e){return e.getCueAsHTML()}).map(Xt)}var i=t.map(function(e){return e.trim()}).join("\n");if(i!==this.elements.captions.innerHTML){kt(this.elements.captions);var r=yt("span",_t(this.config.selectors.caption));r.innerHTML=i,this.elements.captions.appendChild(r),mt.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},ln={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:"16:9",clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.5.1/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240]},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2]},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",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://www.googleapis.com/youtube/v3/videos?id={0}&key={1}&fields=items(snippet(title))&part=snippet"},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",menu:{quality:".js-plyr__menu__list--quality"}},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",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"}},keys:{google:null},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1},youtube:{noCookie:!1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1}},cn="picture-in-picture",un="inline",dn={html5:"html5",youtube:"youtube",vimeo:"vimeo"},hn={audio:"audio",video:"video"};var pn=function(){},mn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];i(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return a(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):pn}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):pn}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):pn}}]),e}();function fn(){if(this.enabled){var e=this.player.elements.buttons.fullscreen;lt.element(e)&&(e.pressed=this.active),mt.call(this.player,this.target,this.active?"enterfullscreen":"exitfullscreen",!0),Rt.isIos||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(lt.element(e)){var n=xt.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),i=n[0],r=n[n.length-1];ut.call(this,this.elements.container,"keydown",function(e){if("Tab"===e.key&&9===e.keyCode){var t=document.activeElement;t!==r||e.shiftKey?t===i&&e.shiftKey&&(r.focus(),e.preventDefault()):(i.focus(),e.preventDefault())}},t,!1)}}.call(this.player,this.target,this.active)}}function gn(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",Et(this.target,this.player.config.classNames.fullscreen.fallback,t),Rt.isIos){var n=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";n||(n=document.createElement("meta")).setAttribute("name","viewport");var r=lt.string(n.content)&&n.content.includes(i);t?(this.cleanupViewport=!r,r||(n.content+=",".concat(i))):this.cleanupViewport&&(n.content=n.content.split(",").filter(function(e){return e.trim()!==i}).join(",")),setTimeout(function(){return It(e.target)},100)}fn.call(this)}var yn=function(){function e(t){var n=this;i(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,dt.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),function(){fn.call(n)}),dt.call(this.player,this.player.elements.container,"dblclick",function(e){lt.element(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.toggle()}),this.update()}return a(e,[{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");Et(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}},{key:"enter",value:function(){this.enabled&&(Rt.isIos&&this.player.config.fullscreen.iosNative?this.target.webkitEnterFullscreen():!e.native||this.forceFallback?gn.call(this,!0):this.prefix?lt.empty(this.prefix)||this.target["".concat(this.prefix,"Request").concat(this.property)]():this.target.requestFullscreen())}},{key:"exit",value:function(){if(this.enabled)if(Rt.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),this.player.play();else if(!e.native||this.forceFallback)gn.call(this,!1);else if(this.prefix){if(!lt.empty(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(){return!!this.enabled&&(!e.native||this.forceFallback?St(this.target,this.player.config.classNames.fullscreen.fallback):(this.prefix?document["".concat(this.prefix).concat(this.property,"Element")]:document.fullscreenElement)===this.target)}},{key:"target",get:function(){return Rt.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(lt.function(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some(function(t){return!(!lt.function(document["".concat(t,"ExitFullscreen")])&&!lt.function(document["".concat(t,"CancelFullScreen")]))&&(e=t,!0)}),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}();function vn(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})})}var bn={addStyleHook:function(){Et(this.elements.container,this.config.selectors.container.replace(".",""),!0),Et(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&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 bn.toggleNativeControls.call(this,!0);lt.element(this.elements.controls)||(rn.inject.call(this),this.listeners.controls()),bn.toggleNativeControls.call(this),this.isHTML5&&on.setup.call(this),this.volume=null,this.muted=null,this.speed=null,this.loop=null,this.quality=null,rn.updateVolume.call(this),rn.timeUpdate.call(this),bn.checkPlaying.call(this),Et(this.elements.container,this.config.classNames.pip.supported,Ft.pip&&this.isHTML5&&this.isVideo),Et(this.elements.container,this.config.classNames.airplay.supported,Ft.airplay&&this.isHTML5),Et(this.elements.container,this.config.classNames.isIos,Rt.isIos),Et(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(function(){mt.call(e,e.media,"ready")},0),bn.setTitle.call(this),this.poster&&bn.setPoster.call(this,this.poster,!1).catch(function(){}),this.config.duration&&rn.durationUpdate.call(this)},setTitle:function(){var e=Yt("play",this.config);if(lt.string(this.config.title)&&!lt.empty(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=At.call(this,"iframe");if(!lt.element(t))return;var n=lt.empty(this.config.title)?"video":this.config.title,i=Yt("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){Et(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this;return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]||!this.poster?(this.media.setAttribute("poster",e),function(){var e=this;return new Promise(function(t){return e.ready?setTimeout(t,0):dt.call(e,e.elements.container,"ready",t)}).then(function(){})}.call(this).then(function(){return vn(e)}).catch(function(n){throw e===t.poster&&bn.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:""}),bn.togglePoster.call(t,!0),e})):Promise.reject(new Error("Poster already set"))},checkPlaying:function(e){var t=this;Et(this.elements.container,this.config.classNames.playing,this.playing),Et(this.elements.container,this.config.classNames.paused,this.paused),Et(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(function(e){e.pressed=t.playing}),lt.event(e)&&"timeupdate"===e.type||bn.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(){Et(t.elements.container,t.config.classNames.loading,t.loading),bn.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))}}};function kn(e){var t=e;lt.string(t)||lt.nullOrUndefined(this.embed)||(t=this.embed.ratio),lt.string(t)||(t=this.config.ratio);var n=o(t.split(":").map(Number),2),i=100/n[0]*n[1];if(this.elements.wrapper.style.paddingBottom="".concat(i,"%"),this.isVimeo&&this.supported.ui){var r=(240-i)/4.8;this.media.style.transform="translateY(-".concat(r,"%)")}return{padding:i,ratio:t}}var wn=function(){function e(t){i(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 a(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)&&lt.number(i)){if(r){var s=document.activeElement;if(lt.element(s)){var o=t.config.selectors.editable;if(s!==n.inputs.seek&&Ct(s,o))return;if(32===e.which&&Ct(s,'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||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){rn.toggleMenu.call(this.player,e)}},{key:"firstTouch",value:function(){var e=this.player,t=e.elements;e.touch=!0,Et(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,Et(xt.call(t,".".concat(i)),i,!1),this.focusTimer=setTimeout(function(){var e=document.activeElement;n.container.contains(e)&&Et(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&&ut.call(t,window,"keydown keyup",this.handleKey,e,!1),ut.call(t,document.body,"click",this.toggleMenu,e),pt.call(t,document.body,"touchstart",this.firstTouch),ut.call(t,document.body,"keydown focus blur",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&&dt.call(e,n.container,"keydown keyup",this.handleKey,!1),dt.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)&&(bn.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(i.controls),i.controls=setTimeout(function(){return bn.toggleControls.call(e,!1)},a)});var r=function(t){if(!t)return kn.call(e);var i=n.container.getBoundingClientRect(),r=i.width,a=i.height;return kn.call(e,"".concat(r,":").concat(a))},a=function(){window.clearTimeout(i.resized),i.resized=window.setTimeout(r,50)};dt.call(e,n.container,"enterfullscreen exitfullscreen",function(t){var i=e.fullscreen,s=i.target,l=i.usingNative;if(e.isEmbed&&s===n.container){var c="enterfullscreen"===t.type,u=r(c);u.padding;!function(t,n,i){if(e.isVimeo){var r=e.elements.wrapper.firstChild,a=o(t.split(":").map(Number),2)[1],s=o(e.embed.ratio.split(":").map(Number),2),l=s[0],c=s[1];r.style.maxWidth=i?"".concat(a/c*l,"px"):null,r.style.margin=i?"0 auto":null}}(u.ratio,0,c),l||(c?dt.call(e,window,"resize",a):ht.call(e,window,"resize",a))}})}},{key:"media",value:function(){var e=this,t=this.player,n=t.elements;if(dt.call(t,t.media,"timeupdate seeking seeked",function(e){return rn.timeUpdate.call(t,e)}),dt.call(t,t.media,"durationchange loadeddata loadedmetadata",function(e){return rn.durationUpdate.call(t,e)}),dt.call(t,t.media,"canplay loadeddata",function(){Tt(n.volume,!t.hasAudio),Tt(n.buttons.mute,!t.hasAudio)}),dt.call(t,t.media,"ended",function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&t.restart()}),dt.call(t,t.media,"progress playing seeking seeked",function(e){return rn.updateProgress.call(t,e)}),dt.call(t,t.media,"volumechange",function(e){return rn.updateVolume.call(t,e)}),dt.call(t,t.media,"playing play pause ended emptied timeupdate",function(e){return bn.checkPlaying.call(t,e)}),dt.call(t,t.media,"waiting canplay seeked playing",function(e){return bn.checkLoading.call(t,e)}),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=At.call(t,".".concat(t.config.classNames.video));if(!lt.element(i))return;dt.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,t.play,"play")):e.proxy(r,t.togglePlay,"play")))})}t.supported.ui&&t.config.disableContextMenu&&dt.call(t,n.wrapper,"contextmenu",function(e){e.preventDefault()},!1),dt.call(t,t.media,"volumechange",function(){t.storage.set({volume:t.volume,muted:t.muted})}),dt.call(t,t.media,"ratechange",function(){rn.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),dt.call(t,t.media,"qualitychange",function(e){rn.updateSetting.call(t,"quality",null,e.detail.quality)}),dt.call(t,t.media,"ready qualitychange",function(){rn.setDownloadLink.call(t)});var r=t.config.events.concat(["keyup","keydown"]).join(" ");dt.call(t,t.media,r,function(e){var i=e.detail,r=void 0===i?{}:i;"error"===e.type&&(r=t.media.error),mt.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;lt.function(r)&&(a=r.call(i,e)),a&&lt.function(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],s=this.player,o=s.config.listeners[i],l=lt.function(o);dt.call(s,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=Rt.isIE?"change":"input";if(n.buttons.play&&Array.from(n.buttons.play).forEach(function(n){e.bind(n,"click",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(){mt.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(),rn.toggleMenu.call(t,e)}),this.bind(n.buttons.settings,"keyup",function(e){var n=e.which;[13,32].includes(n)&&(13!==n?(e.preventDefault(),e.stopPropagation(),rn.toggleMenu.call(t,e)):rn.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(n.settings.menu,"keydown",function(e){27===e.which&&rn.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(!lt.keyboardEvent(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"),t.play()):!a&&t.playing&&(n.setAttribute("play-on-seeked",""),t.pause())}}),Rt.isIos){var r=xt.call(t,'input[type="range"]');Array.from(r).forEach(function(t){return e.bind(t,i,function(e){return It(e.target)})})}this.bind(n.inputs.seek,i,function(e){var n=e.currentTarget,i=n.getAttribute("seek-value");lt.empty(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 rn.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 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)}),Rt.isWebkit&&Array.from(xt.call(t,'input[type="range"]')).forEach(function(n){e.bind(n,"input",function(e){return rn.updateRangeFill.call(t,e.target)})}),t.config.toggleInvert&&!lt.element(n.display.duration)&&this.bind(n.display.currentTime,"click",function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,rn.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}),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 n=t.config,i=t.elements,r=t.timers;Et(i.controls,n.classNames.noTransition,!0),bn.toggleControls.call(t,!0),setTimeout(function(){Et(i.controls,n.classNames.noTransition,!1)},0);var a=e.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout(function(){return bn.toggleControls.call(t,!1)},a)}),this.bind(n.inputs.volume,"wheel",function(e){var n=e.webkitDirectionInvertedFromDevice,i=o([e.deltaX,-e.deltaY].map(function(e){return n?-e:e}),2),r=i[0],a=i[1],s=Math.sign(Math.abs(r)>Math.abs(a)?r:a);t.increaseVolume(s/50);var l=t.media.volume;(1===s&&l<1||-1===s&&l>0)&&e.preventDefault()},"volume",!1)}}]),e}(),_n=t(function(e,t){e.exports=function(){var e=function(){},t={},n={},i={};function r(e,t){if(e){var r=i[e];if(n[e]=t,r)for(;r.length;)r[0](e,t),r.splice(0,1)}}function a(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function s(t,n,i,r){var a,o,l=document,c=i.async,u=(i.numRetries||0)+1,d=i.before||e,h=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(t)?(a=!0,(o=l.createElement("link")).rel="stylesheet",o.href=h):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(o=l.createElement("img")).src=h:((o=l.createElement("script")).src=t,o.async=void 0===c||c),o.onload=o.onerror=o.onbeforeload=function(e){var l=e.type[0];if(a&&"hideFocus"in o)try{o.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l&&(r+=1)<u)return s(t,n,i,r);n(t,l,e.defaultPrevented)},!1!==d(t,o)&&l.head.appendChild(o)}function o(e,n,i){var o,l;if(n&&n.trim&&(o=n),l=(o?i:n)||{},o){if(o in t)throw"LoadJS";t[o]=!0}!function(e,t,n){var i,r,a=(e=e.push?e:[e]).length,o=a,l=[];for(i=function(e,n,i){if("e"==n&&l.push(e),"b"==n){if(!i)return;l.push(e)}--a||t(l)},r=0;r<o;r++)s(e[r],i,n)}(e,function(e){a(l,e),r(o,e)},l)}return o.ready=function(e,t){return function(e,t){e=e.push?e:[e];var r,a,s,o=[],l=e.length,c=l;for(r=function(e,n){n.length&&o.push(e),--c||t(o)};l--;)a=e[l],(s=n[a])?r(a,s):(i[a]=i[a]||[]).push(r)}(e,function(e){a(t,e)}),o},o.done=function(e){r(e,[])},o.reset=function(){t={},n={},i={}},o.isDefined=function(e){return e in t},o}()});function Tn(e){return new Promise(function(t,n){_n(e,{success:t,error:n})})}function En(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,mt.call(this,this.media,e?"play":"pause"))}var Sn={setup:function(){var e=this;Et(this.elements.wrapper,this.config.classNames.embed,!0),kn.call(this),lt.object(window.Vimeo)?Sn.ready.call(this):Tn(this.config.urls.vimeo.sdk).then(function(){Sn.ready.call(e)}).catch(function(t){e.debug.warn("Vimeo API failed to load",t)})},ready:function(){var e=this,t=this,n=t.config.vimeo,i=sn(Ut({},{loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},n)),r=t.media.getAttribute("src");lt.empty(r)&&(r=t.media.getAttribute(t.config.attributes.embed.id));var a,s=(a=r,lt.empty(a)?null:lt.number(Number(a))?a:a.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:a),l=yt("iframe"),c=Vt(t.config.urls.vimeo.iframe,s,i);l.setAttribute("src",c),l.setAttribute("allowfullscreen",""),l.setAttribute("allowtransparency",""),l.setAttribute("allow","autoplay");var u=yt("div",{poster:t.poster,class:t.config.classNames.embedContainer});u.appendChild(l),t.media=wt(u,t.media),Gt(Vt(t.config.urls.vimeo.api,s),"json").then(function(e){if(!lt.empty(e)){var n=new URL(e[0].thumbnail_large);n.pathname="".concat(n.pathname.split("_")[0],".jpg"),bn.setPoster.call(t,n.href).catch(function(){})}}),t.embed=new window.Vimeo.Player(l,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return En.call(t,!0),t.embed.play()},t.media.pause=function(){return En.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var d=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return d},set:function(e){var n=t.embed,i=t.media,r=t.paused,a=t.volume,s=r&&!n.hasPlayed;i.seeking=!0,mt.call(t,i,"seeking"),Promise.resolve(s&&n.setVolume(0)).then(function(){return n.setCurrentTime(e)}).then(function(){return s&&n.pause()}).then(function(){return s&&n.setVolume(a)}).catch(function(){})}});var h=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return h},set:function(e){t.embed.setPlaybackRate(e).then(function(){h=e,mt.call(t,t.media,"ratechange")}).catch(function(e){"Error"===e.name&&rn.setSpeedMenu.call(t,[])})}});var p=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return p},set:function(e){t.embed.setVolume(e).then(function(){p=e,mt.call(t,t.media,"volumechange")})}});var m=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return m},set:function(e){var n=!!lt.boolean(e)&&e;t.embed.setVolume(n?0:t.config.volume).then(function(){m=n,mt.call(t,t.media,"volumechange")})}});var f,g=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return g},set:function(e){var n=lt.boolean(e)?e:t.config.loop.active;t.embed.setLoop(n).then(function(){g=n})}}),t.embed.getVideoUrl().then(function(e){f=e,rn.setDownloadLink.call(t)}).catch(function(t){e.debug.warn(t)}),Object.defineProperty(t.media,"currentSrc",{get:function(){return f}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then(function(n){var i=o(n,2),r=i[0],a=i[1];t.embed.ratio="".concat(r,":").concat(a),kn.call(e,t.embed.ratio)}),t.embed.setAutopause(t.config.autopause).then(function(e){t.config.autopause=e}),t.embed.getVideoTitle().then(function(n){t.config.title=n,bn.setTitle.call(e)}),t.embed.getCurrentTime().then(function(e){d=e,mt.call(t,t.media,"timeupdate")}),t.embed.getDuration().then(function(e){t.media.duration=e,mt.call(t,t.media,"durationchange")}),t.embed.getTextTracks().then(function(e){t.media.textTracks=e,on.setup.call(t)}),t.embed.on("cuechange",function(e){var n=e.cues,i=(void 0===n?[]:n).map(function(e){return t=e.text,n=document.createDocumentFragment(),i=document.createElement("div"),n.appendChild(i),i.innerHTML=t,n.firstChild.innerText;var t,n,i});on.updateCues.call(t,i)}),t.embed.on("loaded",function(){(t.embed.getPaused().then(function(e){En.call(t,!e),e||mt.call(t,t.media,"playing")}),lt.element(t.embed.element)&&t.supported.ui)&&t.embed.element.setAttribute("tabindex",-1)}),t.embed.on("play",function(){En.call(t,!0),mt.call(t,t.media,"playing")}),t.embed.on("pause",function(){En.call(t,!1)}),t.embed.on("timeupdate",function(e){t.media.seeking=!1,d=e.seconds,mt.call(t,t.media,"timeupdate")}),t.embed.on("progress",function(e){t.media.buffered=e.percent,mt.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&mt.call(t,t.media,"canplaythrough"),t.embed.getDuration().then(function(e){e!==t.media.duration&&(t.media.duration=e,mt.call(t,t.media,"durationchange"))})}),t.embed.on("seeked",function(){t.media.seeking=!1,mt.call(t,t.media,"seeked")}),t.embed.on("ended",function(){t.media.paused=!0,mt.call(t,t.media,"ended")}),t.embed.on("error",function(e){t.media.error=e,mt.call(t,t.media,"error")}),setTimeout(function(){return bn.build.call(t)},0)}};function Cn(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,mt.call(this,this.media,e?"play":"pause"))}var xn,An,Pn,On={setup:function(){var e=this;Et(this.elements.wrapper,this.config.classNames.embed,!0),kn.call(this),lt.object(window.YT)&&lt.function(window.YT.Player)?On.ready.call(this):(Tn(this.config.urls.youtube.sdk).catch(function(t){e.debug.warn("YouTube API failed to load",t)}),window.onYouTubeReadyCallbacks=window.onYouTubeReadyCallbacks||[],window.onYouTubeReadyCallbacks.push(function(){On.ready.call(e)}),window.onYouTubeIframeAPIReady=function(){window.onYouTubeReadyCallbacks.forEach(function(e){e()})})},getTitle:function(e){var t=this;if(lt.function(this.embed.getVideoData)){var n=this.embed.getVideoData().title;if(lt.empty(n))return this.config.title=n,void bn.setTitle.call(this)}var i=this.config.keys.google;lt.string(i)&&!lt.empty(i)&&Gt(Vt(this.config.urls.youtube.api,e,i)).then(function(e){lt.object(e)&&(t.config.title=e.items[0].snippet.title,bn.setTitle.call(t))}).catch(function(){})},ready:function(){var e=this,t=e.media.getAttribute("id");if(lt.empty(t)||!t.startsWith("youtube-")){var n=e.media.getAttribute("src");lt.empty(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));var i,r,a=(i=n,lt.empty(i)?null:i.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:i),s=(r=e.provider,"".concat(r,"-").concat(Math.floor(1e4*Math.random()))),o=yt("div",{id:s,poster:e.poster});e.media=wt(o,e.media);var l=function(e){return"https://img.youtube.com/vi/".concat(a,"/").concat(e,"default.jpg")};vn(l("maxres"),121).catch(function(){return vn(l("sd"),121)}).catch(function(){return vn(l("hq"))}).then(function(t){return bn.setPoster.call(e,t.src)}).then(function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(function(){});var c=e.config.youtube;e.embed=new window.YT.Player(s,{videoId:a,host:c.noCookie?"https://www.youtube-nocookie.com":void 0,playerVars:Ut({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},c),events:{onError:function(t){if(!e.media.error){var n=t.data,i={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[n]||"An unknown error occured";e.media.error={code:n,message:i},mt.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var n=t.target;e.media.playbackRate=n.getPlaybackRate(),mt.call(e,e.media,"ratechange")},onReady:function(t){if(!lt.function(e.media.play)){var n=t.target;On.getTitle.call(e,a),e.media.play=function(){Cn.call(e,!0),n.playVideo()},e.media.pause=function(){Cn.call(e,!1),n.pauseVideo()},e.media.stop=function(){n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(n.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,mt.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return n.getPlaybackRate()},set:function(e){n.setPlaybackRate(e)}});var i=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return i},set:function(t){i=t,n.setVolume(100*i),mt.call(e,e.media,"volumechange")}});var r=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return r},set:function(t){var i=lt.boolean(t)?t:r;r=i,n[i?"mute":"unMute"](),mt.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return n.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}}),e.options.speed=n.getAvailablePlaybackRates(),e.supported.ui&&e.media.setAttribute("tabindex",-1),mt.call(e,e.media,"timeupdate"),mt.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(function(){e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&mt.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),mt.call(e,e.media,"canplaythrough"))},200),setTimeout(function(){return bn.build.call(e)},50)}},onStateChange:function(t){var n=t.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(t.data)&&(e.media.seeking=!1,mt.call(e,e.media,"seeked")),t.data){case-1:mt.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),mt.call(e,e.media,"progress");break;case 0:Cn.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):mt.call(e,e.media,"ended");break;case 1:e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Cn.call(e,!0),mt.call(e,e.media,"playing"),e.timers.playing=setInterval(function(){mt.call(e,e.media,"timeupdate")},50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),mt.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),Cn.call(e,!1)}mt.call(e,e.elements.container,"statechange",!1,{code:t.data})}}})}}},Mn={setup:function(){this.media?(Et(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Et(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Et(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=yt("div",{class:this.config.classNames.video}),ft(this.media,this.elements.wrapper),this.elements.poster=yt("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Bt.extend.call(this):this.isYouTube?On.setup.call(this):this.isVimeo&&Sn.setup.call(this)):this.debug.warn("No media element found!")}},Nn=function(){function e(t){var n=this;i(this,e),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(function(e,t){n.on("loaded",e),n.on("error",t)}),this.load()}return a(e,[{key:"load",value:function(){var e=this;this.enabled&&(lt.object(window.google)&&lt.object(window.google.ima)?this.ready():Tn(this.player.config.urls.googleIMA.sdk).then(function(){e.ready()}).catch(function(){e.trigger("error",new Error("Google IMA SDK failed to load"))}))}},{key:"ready",value:function(){var e=this;this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(function(){e.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}},{key:"setupIMA",value:function(){this.elements.container=yt("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.requestAds()}},{key:"requestAds",value:function(){var e=this,t=this.player.elements.container;try{this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(t){return e.onAdsManagerLoaded(t)},!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,function(t){return e.onAdError(t)},!1);var n=new google.ima.AdsRequest;n.adTagUrl=this.tagUrl,n.linearAdSlotWidth=t.offsetWidth,n.linearAdSlotHeight=t.offsetHeight,n.nonLinearAdSlotWidth=t.offsetWidth,n.nonLinearAdSlotHeight=t.offsetHeight,n.forceNonLinearFullSlot=!1,n.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(n)}catch(e){this.onAdError(e)}}},{key:"pollCountdown",value:function(){var e=this;if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(function(){var t=nn(Math.max(e.manager.getRemainingTime(),0)),n="".concat(Yt("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",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.setVolume(this.player.volume),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;lt.empty(this.cuePoints)||this.cuePoints.forEach(function(t){if(0!==t&&-1!==t&&t<e.player.duration){var n=e.player.elements.progress;if(lt.element(n)){var i=100/e.player.duration*t,r=yt("span",{class:e.player.config.classNames.cues});r.style.left="".concat(i.toString(),"%"),n.appendChild(r)}}})}},{key:"onAdEvent",value:function(e){var t=this,n=this.player.elements.container,i=e.getAd(),r=e.getAdData(),a=function(e){var n="ads".concat(e.replace(/_/g,"").toLowerCase());mt.call(t.player,t.player.media,n)};switch(e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),a(e.type),this.pollCountdown(!0),i.isLinear()||(i.width=n.offsetWidth,i.height=n.offsetHeight);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:a(e.type),this.loadAds();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:a(e.type),this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:a(e.type),this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.STARTED:case google.ima.AdEvent.Type.MIDPOINT:case google.ima.AdEvent.Type.COMPLETE:case google.ima.AdEvent.Type.IMPRESSION:case google.ima.AdEvent.Type.CLICK:a(e.type);break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn("Non-fatal ad error: ".concat(r.adError.getMessage()))}}},{key:"onAdError",value:function(e){this.cancel(),this.player.debug.warn("Ads error",e)}},{key:"listeners",value:function(){var e,t=this,n=this.player.elements.container;this.player.on("canplay",function(){t.addCuePoints()}),this.player.on("ended",function(){t.loader.contentComplete()}),this.player.on("timeupdate",function(){e=t.player.currentTime}),this.player.on("seeked",function(){var n=t.player.currentTime;lt.empty(t.cuePoints)||t.cuePoints.forEach(function(i,r){e<i&&i<n&&(t.manager.discardAdBreak(),t.cuePoints.splice(r,1))})}),window.addEventListener("resize",function(){t.manager&&t.manager.resize(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL)})}},{key:"play",value:function(){var e=this,t=this.player.elements.container;this.managerPromise||this.resumeContent(),this.managerPromise.then(function(){e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}}).catch(function(){})}},{key:"resumeContent",value:function(){this.elements.container.style.zIndex="",this.playing=!1,this.player.media.play()}},{key:"pauseContent",value:function(){this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}},{key:"cancel",value:function(){this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}},{key:"loadAds",value:function(){var e=this;this.managerPromise.then(function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise(function(t){e.on("loaded",t),e.player.debug.log(e.manager)}),e.requestAds()}).catch(function(){})}},{key:"trigger",value:function(e){for(var t=this,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a=this.events[e];lt.array(a)&&a.forEach(function(e){lt.function(e)&&e.apply(t,i)})}},{key:"on",value:function(e,t){return lt.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this}},{key:"startSafetyTimer",value:function(e,t){var n=this;this.player.debug.log("Safety timer invoked from: ".concat(t)),this.safetyTimer=setTimeout(function(){n.cancel(),n.clearSafetyTimer("startSafetyTimer()")},e)}},{key:"clearSafetyTimer",value:function(e){lt.nullOrUndefined(this.safetyTimer)||(this.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(this.safetyTimer),this.safetyTimer=null)}},{key:"enabled",get:function(){var e=this.config;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!lt.empty(e.publisherId)||lt.url(e.tagUrl))}},{key:"tagUrl",get:function(){var e=this.config;if(lt.url(e.tagUrl))return e.tagUrl;var t={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:this.publisherId};return"".concat("https://go.aniview.com/api/adserver6/vast/","?").concat(sn(t))}}]),e}(),Ln=function(){function e(t){i(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 a(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.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(lt.empty(n))throw new Error("Missing previewThumbnails.src config attribute");var i=(lt.string(n)?[n]:n).map(function(t){return e.getThumbnail(t)});Promise.all(i).then(function(){e.thumbnails.sort(function(e,t){return e.height-t.height}),e.player.debug.log("Preview thumbnails",e.thumbnails),t()})})}},{key:"getThumbnail",value:function(e){var t=this;return new Promise(function(n){Gt(e).then(function(i){var r,a,s={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(lt.number(t.startTime)){if(!lt.empty(e.trim())&&lt.empty(t.text)){var n=e.trim().split("#xywh="),i=o(n,1);if(t.text=i[0],n[1]){var r=o(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])*60+60*Number(a[2])+Number(a[3])+Number("0.".concat(a[4])),t.endTime=60*Number(a[6])*60+60*Number(a[7])+Number(a[8])+Number("0.".concat(a[9])))}}),t.text&&a.push(t)}),a),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var l=new Image;l.onload=function(){s.height=l.naturalHeight,s.width=l.naturalWidth,t.thumbnails.push(s),n()},l.src=s.urlPrefix+s.frames[0].text})})}},{key:"startMove",value:function(e){if(this.loaded&&lt.event(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t=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=nn(this.seekTime)}this.showImageAtCurrentTime()}}},{key:"endMove",value:function(){this.toggleThumbContainer(!1,!0)}},{key:"startScrubbing",value:function(e){!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):pt.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=yt("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=yt("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);var e=yt("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=yt("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(e),this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=yt("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}},{key:"showImageAtCurrentTime",value:function(){var e=this;this.mouseDown?this.setScrubbingContainerSize():(this.toggleThumbContainer(!0),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.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],s=i.frames[n].text,o=r+s;if(this.currentImageElement&&this.currentImageElement.dataset.filename===s)this.showImage(this.currentImageElement,a,t,n,s,!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=o,l.dataset.index=n,l.dataset.filename=s,this.showingThumbFilename=s,this.player.debug.log("Loading image: ".concat(o)),l.onload=function(){return e.showImage(l,a,t,n,s,!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 s=!1;a.forEach(function(e){var n=e.text;if(n!==r&&!t.loadedImages.includes(n)){s=!0,t.player.debug.log("Preloading thumb filename: ".concat(n));var a=t.thumbnails[0].urlPrefix+n,o=new Image;o.src=a,o.onload=function(){t.player.debug.log("Preloaded thumb filename: ".concat(n)),t.loadedImages.includes(n)||t.loadedImages.push(n),i()}}}),s||i()}},300)})}},{key:"getHigherQuality",value:function(e,t,n,i){var r=this;if(e<this.thumbnails.length-1){var a=t.naturalHeight;this.usingSprites&&(a=n.h),a<this.thumbContainerHeight&&setTimeout(function(){r.showingThumbFilename===i&&(r.player.debug.log("Showing higher quality thumb for: ".concat(i)),r.loadImage(e+1))},300)}}},{key:"toggleThumbContainer",value:function(){var e=arguments.length>0&&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.sizeSpecifiedInCSS=!0)}},{key:"setThumbContainerSizeAndPos",value:function(){if(!this.sizeSpecifiedInCSS){var e=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height="".concat(this.thumbContainerHeight,"px"),this.elements.thumb.imageContainer.style.width="".concat(e,"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;a<i&&(a=i),a>r&&(a=r),n.style.left="".concat(a,"px")}},{key:"setScrubbingContainerSize",value:function(){this.elements.scrubbing.container.style.width="".concat(this.player.media.clientWidth,"px"),this.elements.scrubbing.container.style.height="".concat(this.player.media.clientWidth/this.thumbAspectRatio,"px")}},{key:"setImageSizeAndOffset",value:function(e,t){if(this.usingSprites){var n=this.thumbContainerHeight/t.h;e.style.height="".concat(Math.floor(e.naturalHeight*n),"px"),e.style.width="".concat(Math.floor(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?Math.floor(this.player.media.clientWidth/this.thumbAspectRatio):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}(),In={insertElements:function(e,t){var n=this;lt.string(t)?vt(e,this.media,{src:t}):lt.array(t)&&t.forEach(function(t){vt(e,n.media,t)})},change:function(e){var t=this;qt(e,"sources.length")?(Bt.cancelRequests.call(this),this.destroy.call(this,function(){t.options.quality=[],bt(t.media),t.media=null,lt.element(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,r=o(n,1)[0],a=r.provider,s=void 0===a?dn.html5:a,l=r.src,c="html5"===s?i:"div",u="html5"===s?{}:{src:l};Object.assign(t,{provider:s,type:i,supported:Ft.check(i,s,t.config.playsinline),media:yt(c,u)}),t.elements.container.appendChild(t.media),lt.boolean(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),lt.empty(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","")),bn.addStyleHook.call(t),t.isHTML5&&In.insertElements.call(t,"source",n),t.config.title=e.title,Mn.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&In.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&bn.build.call(t),t.isHTML5&&t.media.load(),t.previewThumbnails&&t.previewThumbnails.load(),t.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}},jn=function(){function e(t,n){var r=this;if(i(this,e),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Ft.touch,this.media=t,lt.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||lt.nodeList(this.media)||lt.array(this.media))&&(this.media=this.media[0]),this.config=Ut({},ln,e.defaults,n||{},function(){try{return JSON.parse(r.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container: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 mn(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Ft),!lt.nullOrUndefined(this.media)&&lt.element(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(Ft.check().api){var a=this.media.cloneNode(!0);a.autoplay=!1,this.elements.original=a;var s=this.media.tagName.toLowerCase(),o=null,l=null;switch(s){case"div":if(o=this.media.querySelector("iframe"),lt.element(o)){if(l=an(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?dn.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?dn.vimeo:null}(l.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",l.search.length){var c=["1","true"];c.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),c.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=c.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(lt.empty(this.provider)||!Object.keys(dn).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=hn.video;break;case"video":case"audio":this.type=s,this.provider=dn.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=Ft.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new wn(this),this.storage=new $t(this),this.media.plyr=this,lt.element(this.elements.container)||(this.elements.container=yt("div",{tabindex:0}),ft(this.media,this.elements.container)),bn.addStyleHook.call(this),Mn.setup.call(this),this.config.debug&&dt.call(this,this.elements.container,this.config.events.join(" "),function(e){r.debug.log("event: ".concat(e.type))}),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&bn.build.call(this),this.listeners.container(),this.listeners.global(),this.fullscreen=new yn(this),this.config.ads.enabled&&(this.ads=new Nn(this)),this.config.autoplay&&this.play(),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ln(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 a(e,[{key:"play",value:function(){var e=this;return lt.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(function(){return e.ads.play()}).catch(function(){return e.media.play()}),this.media.play()):null}},{key:"pause",value:function(){this.playing&&lt.function(this.media.pause)&&this.media.pause()}},{key:"togglePlay",value:function(e){(lt.boolean(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.isHTML5?(this.pause(),this.restart()):lt.function(this.media.stop)&&this.media.stop()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime=this.currentTime-(lt.number(e)?e:this.config.seekTime)}},{key:"forward",value:function(e){this.currentTime=this.currentTime+(lt.number(e)?e:this.config.seekTime)}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(lt.number(e)?e:0)}},{key:"decreaseVolume",value:function(e){this.increaseVolume(-e)}},{key:"toggleCaptions",value:function(e){on.toggle.call(this,e,!1)}},{key:"airplay",value:function(){Ft.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){if(this.supported.ui&&!this.isAudio){var t=St(this.elements.container,this.config.classNames.hideControls),n=void 0===e?void 0:!e,i=Et(this.elements.container,this.config.classNames.hideControls,n);if(i&&this.config.controls.includes("settings")&&!lt.empty(this.config.settings)&&rn.toggleMenu.call(this,!1),i!==t){var r=i?"controlshidden":"controlsshown";mt.call(this,this.media,r)}return!i}return!1}},{key:"on",value:function(e,t){dt.call(this,this.elements.container,e,t)}},{key:"once",value:function(e,t){pt.call(this,this.elements.container,e,t)}},{key:"off",value:function(e,t){ht(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&&(bt(t.elements.buttons.play),bt(t.elements.captions),bt(t.elements.controls),bt(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),lt.function(e)&&e()):(function(){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=[])}.call(t),wt(t.elements.original,t.elements.container),mt.call(t,t.elements.original,"destroyed",!0),lt.function(e)&&e.call(t.elements.original),t.ready=!1,setTimeout(function(){t.elements=null,t.media=null},200))};this.stop(),this.isHTML5?(clearTimeout(this.timers.loading),bn.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&lt.function(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 Ft.mime.call(this,e)}},{key:"isHTML5",get:function(){return Boolean(this.provider===dn.html5)}},{key:"isEmbed",get:function(){return Boolean(this.isYouTube||this.isVimeo)}},{key:"isYouTube",get:function(){return Boolean(this.provider===dn.youtube)}},{key:"isVimeo",get:function(){return Boolean(this.provider===dn.vimeo)}},{key:"isVideo",get:function(){return Boolean(this.type===hn.video)}},{key:"isAudio",get:function(){return Boolean(this.type===hn.audio)}},{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=lt.number(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 lt.number(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=lt.number(t)&&t!==1/0?t:0;return e||n}},{key:"volume",set:function(e){var t=e;lt.string(t)&&(t=Number(t)),lt.number(t)||(t=this.storage.get("volume")),lt.number(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!lt.empty(e)&&this.muted&&t>0&&(this.muted=!1)},get:function(){return Number(this.media.volume)}},{key:"muted",set:function(e){var t=e;lt.boolean(t)||(t=this.storage.get("muted")),lt.boolean(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=null;lt.number(e)&&(t=e),lt.number(t)||(t=this.storage.get("speed")),lt.number(t)||(t=this.config.speed.selected),t<.1&&(t=.1),t>2&&(t=2),this.config.speed.options.includes(t)?(this.config.speed.selected=t,this.media.playbackRate=t):this.debug.warn("Unsupported speed (".concat(t,")"))},get:function(){return Number(this.media.playbackRate)}},{key:"quality",set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!lt.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(lt.number),r=!0;if(!n.includes(i)){var a=function(e,t){return lt.array(e)&&e.length?e.reduce(function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}):null}(n,i);this.debug.warn("Unsupported quality option: ".concat(i,", using ").concat(a," instead")),i=a,r=!1}t.selected=i,this.media.quality=i,r&&this.storage.set({quality:i})}},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=lt.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return Boolean(this.media.loop)}},{key:"source",set:function(e){In.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"download",get:function(){var e=this.config.urls.download;return lt.url(e)?e:this.source}},{key:"poster",set:function(e){this.isVideo?bn.setPoster.call(this,e,!1).catch(function(){}):this.debug.warn("Poster can only be set for video")},get:function(){return this.isVideo?this.media.getAttribute("poster"):null}},{key:"autoplay",set:function(e){var t=lt.boolean(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return Boolean(this.config.autoplay)}},{key:"currentTrack",set:function(e){on.set.call(this,e,!1)},get:function(){var e=this.captions,t=e.toggled,n=e.currentTrack;return t?n:-1}},{key:"language",set:function(e){on.setLanguage.call(this,e,!1)},get:function(){return(on.getCurrentTrack.call(this)||{}).language}},{key:"pip",set:function(e){if(Ft.pip){var t=lt.boolean(e)?e:!this.pip;lt.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?cn:un),lt.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}},get:function(){return Ft.pip?lt.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===cn:null}}],[{key:"supported",value:function(e,t,n){return Ft.check(e,t,n)}},{key:"loadSprite",value:function(e,t){return Qt(e,t)}},{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return lt.string(t)?i=Array.from(document.querySelectorAll(t)):lt.nodeList(t)?i=Array.from(t):lt.array(t)&&(i=t.filter(lt.element)),lt.empty(i)?null:i.map(function(t){return new e(t,n)})}}]),e}();jn.defaults=(xn=ln,JSON.parse(JSON.stringify(xn))),An=window.location.host,Pn={prod:"plyr.io"===An,dev:"dev.plyr.io"===An},document.addEventListener("DOMContentLoaded",function(){qe.context(function(){var e=document.getElementById("container");window.Shr&&window.Shr.setup(".js-shr-button",{count:{classname:"button__count"}}),document.addEventListener("focusout",function(t){t.target.classList&&!e.contains(t.target)&&t.target.classList.remove("tab-focus")}),document.addEventListener("keydown",function(t){9===t.keyCode&&setTimeout(function(){var t=document.activeElement;t&&t.classList&&!e.contains(t)&&t.classList.add("tab-focus")},10)});var t=new jn("#player",{debug:!0,title:"View From A Blue Moon",iconUrl:"dist/demo.svg",keyboard:{global:!0},tooltips:{controls:!0},captions:{active:!0},keys:{google:"AIzaSyDrNwtN3nLH_8rjCmu5Wq3ZCm4MNAVdc0c"},ads:{enabled:Pn.prod||Pn.dev,publisherId:"918848828995742"},previewThumbnails:{enabled:!0,src:["https://cdn.plyr.io/static/demo/thumbs/100p.vtt","https://cdn.plyr.io/static/demo/thumbs/240p.vtt"]}});window.player=t;var n=document.querySelectorAll("[data-source]"),i={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},r=window.location.hash.replace("#",""),a=window.history&&window.history.pushState;function s(e,t,n){e&&e.classList[n?"add":"remove"](t)}function o(e,a){if(e in i&&(a||e!==r)&&(r.length||e!==i.video)){switch(e){case i.video:t.source={type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-576p.mp4",type:"video/mp4",size:576},{src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4",type:"video/mp4",size:720},{src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1080p.mp4",type:"video/mp4",size:1080},{src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1440p.mp4",type:"video/mp4",size:1440}],poster:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt",default:!0},{kind:"captions",label:"French",srclang:"fr",src:"https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.fr.vtt"}]};break;case i.audio:t.source={type:"audio",title:"Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;",sources:[{src:"https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]};break;case i.youtube:t.source={type:"video",sources:[{src:"https://youtube.com/watch?v=bTqVqk7FSmY",provider:"youtube"}]};break;case i.vimeo:t.source={type:"video",sources:[{src:"https://vimeo.com/76979871",provider:"vimeo"}]}}r=e,Array.from(n).forEach(function(e){return s(e.parentElement,"active",!1)}),s(document.querySelector('[data-source="'.concat(e,'"]')),"active",!0),Array.from(document.querySelectorAll(".plyr__cite")).forEach(function(e){e.setAttribute("hidden","")}),document.querySelector(".plyr__cite--".concat(e)).removeAttribute("hidden")}}if(Array.from(n).forEach(function(e){e.addEventListener("click",function(){var t=e.getAttribute("data-source");o(t),a&&window.history.pushState({type:t},"","#".concat(t))})}),window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&o(e.state.type)}),a){var l=!r.length;l&&(r=i.video),r in i&&window.history.replaceState({type:r},"",l?"":"#".concat(r)),r!==i.video&&o(r,!0)}})}),Pn.prod&&qe.config("https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555").install()}();
//# sourceMappingURL=demo.min.js.map