diff --git a/.idea/aws.xml b/.idea/aws.xml new file mode 100755 index 0000000..ec328d0 --- /dev/null +++ b/.idea/aws.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100755 index 0000000..3cdc6ae --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100755 index 0000000..4daf1b2 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml new file mode 100755 index 0000000..550267d --- /dev/null +++ b/.idea/dbnavigator.xml @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7024d9b..e879144 100644 --- a/package-lock.json +++ b/package-lock.json @@ -96,6 +96,9 @@ }, "engines": { "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^2.3.4" } }, "node_modules/@rollup/plugin-commonjs/node_modules/estree-walker": { @@ -120,6 +123,9 @@ }, "engines": { "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" } }, "node_modules/@rollup/pluginutils": { @@ -134,6 +140,9 @@ }, "engines": { "node": ">= 8.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0" } }, "node_modules/@rollup/pluginutils/node_modules/estree-walker": { @@ -290,7 +299,10 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", - "dev": true + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0" + } }, "node_modules/aes-decrypter": { "version": "3.0.0", @@ -331,6 +343,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-escapes/node_modules/type-fest": { @@ -340,6 +355,9 @@ "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-regex": { @@ -486,6 +504,10 @@ }, "engines": { "node": ">=6.0.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" } }, "node_modules/aws-sign2": { @@ -699,7 +721,21 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/browserslist": { "version": "4.12.0", @@ -714,6 +750,10 @@ }, "bin": { "browserslist": "cli.js" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" } }, "node_modules/buffer-es6": { @@ -1147,6 +1187,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", "dev": true, "dependencies": { "ms": "^2.1.1" @@ -1374,13 +1415,20 @@ }, "engines": { "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-plugin-svelte3": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/eslint-plugin-svelte3/-/eslint-plugin-svelte3-2.7.3.tgz", "integrity": "sha512-p6HhxyICX9x/x+8WSy6AVk2bmv9ayoznoTSyCvK47th/k/07ksuJixMwbGX9qxJVAmPBaYMjEIMSEZtJHPIN7w==", - "dev": true + "dev": true, + "peerDependencies": { + "eslint": ">=6.0.0", + "svelte": "^3.2.0" + } }, "node_modules/eslint-scope": { "version": "5.0.0", @@ -1427,6 +1475,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/eslint/node_modules/chalk": { @@ -1440,6 +1491,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/eslint/node_modules/color-convert": { @@ -1639,6 +1693,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/file-entry-cache": { @@ -1733,7 +1790,9 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "deprecated": "\"Please update to latest v2.3 or v2.2\"", "dev": true, + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -1910,6 +1969,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { @@ -1943,6 +2005,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globule": { @@ -1975,6 +2040,7 @@ "version": "5.1.3", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "deprecated": "this library is no longer supported", "dependencies": { "ajv": "^6.5.5", "har-schema": "^2.0.0" @@ -2048,7 +2114,21 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/hash.js": { "version": "1.1.7", @@ -2221,6 +2301,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/inquirer/node_modules/chalk": { @@ -2328,6 +2411,9 @@ "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", "engines": { "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-fullwidth-code-point": { @@ -3314,6 +3400,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.2.0.tgz", "integrity": "sha1-zd7AKZiwkb5CvxA1rjLknxy26mc=", + "deprecated": "Please update to the latest object-keys", "dev": true, "dependencies": { "foreach": "~2.0.1", @@ -3412,6 +3499,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { @@ -3544,6 +3634,9 @@ "dev": true, "engines": { "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pify": { @@ -3685,6 +3778,10 @@ }, "engines": { "node": ">=6.0.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" } }, "node_modules/postcss-value-parser": { @@ -3902,6 +3999,9 @@ "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, "node_modules/repeating": { @@ -3919,6 +4019,7 @@ "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -3970,6 +4071,9 @@ "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dependencies": { "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { @@ -4096,6 +4200,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.2.0.tgz", "integrity": "sha512-/5bxtUPkDHyBJAKketb4NfaeZjL5yLZdeUihSfbF2PQMz+rSTEb8ARKoOl3UBT4m7/X+QOXJo3sLTcq+yMMYTA==", + "deprecated": "This module has moved and is now available at @rollup/plugin-replace. Please update your dependencies. This version is no longer maintained.", "dependencies": { "magic-string": "^0.25.2", "rollup-pluginutils": "^2.6.0" @@ -4110,6 +4215,10 @@ "require-relative": "^0.8.7", "rollup-pluginutils": "^2.8.2", "sourcemap-codec": "^1.4.8" + }, + "peerDependencies": { + "rollup": ">=0.60.0", + "svelte": "*" } }, "node_modules/rollup-plugin-terser": { @@ -4122,6 +4231,9 @@ "jest-worker": "^26.0.0", "serialize-javascript": "^3.0.0", "terser": "^4.7.0" + }, + "peerDependencies": { + "rollup": "^2.0.0" } }, "node_modules/rollup-pluginutils": { @@ -4199,6 +4311,9 @@ "lodash": "^4.0.0", "scss-tokenizer": "^0.2.3", "yargs": "^13.3.2" + }, + "bin": { + "sassgraph": "bin/sassgraph" } }, "node_modules/scss-tokenizer": { @@ -4414,6 +4529,11 @@ "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, "engines": { "node": ">=0.10.0" } @@ -4552,6 +4672,54 @@ }, "engines": { "node": ">= 7.6.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.4", + "coffeescript": "^2.5.1", + "less": "^3.10.3", + "node-sass": "^4.13.1", + "postcss": "^7.0.26", + "postcss-load-config": "^2.1.0", + "pug": "^2.0.4", + "sass": "^1.26.3", + "stylus": "^0.54.7", + "svelte": "^3.18.1", + "typescript": "^3.7.5" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "coffeescript": { + "optional": true + }, + "less": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "postcss": { + "optional": true + }, + "postcss-load-config": { + "optional": true + }, + "pug": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "svelte": { + "optional": true + }, + "typescript": { + "optional": true + } } }, "node_modules/table": { @@ -4602,6 +4770,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "deprecated": "This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.", "dependencies": { "block-stream": "*", "fstream": "^1.0.12", @@ -4785,6 +4954,7 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "bin": { "uuid": "bin/uuid" } @@ -4859,6 +5029,9 @@ "integrity": "sha512-qvwrkgXixbX8xzdkBa7o5r9KUITRISAy4bbyrpBgub3m0mhwz6WLXDIwJZ6/w4Z/JijWjLQqlg8W1jYhCEgHZw==", "dependencies": { "video.js": "^5.6.0 || ^6.2.8 || ^7.0.2" + }, + "peerDependencies": { + "video.js": "5.x || 6.x || 7.x" } }, "node_modules/vlq": { @@ -5008,6 +5181,7 @@ "version": "0.1.31", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", + "deprecated": "Deprecated due to CVE-2021-21366 resolved in 0.5.0", "engines": { "node": ">=0.1" } @@ -5338,7 +5512,8 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", - "dev": true + "dev": true, + "requires": {} }, "aes-decrypter": { "version": "3.0.0", @@ -6359,7 +6534,8 @@ "version": "2.7.3", "resolved": "https://registry.npmjs.org/eslint-plugin-svelte3/-/eslint-plugin-svelte3-2.7.3.tgz", "integrity": "sha512-p6HhxyICX9x/x+8WSy6AVk2bmv9ayoznoTSyCvK47th/k/07ksuJixMwbGX9qxJVAmPBaYMjEIMSEZtJHPIN7w==", - "dev": true + "dev": true, + "requires": {} }, "eslint-scope": { "version": "5.0.0", diff --git a/public/build/bundle.js b/public/build/bundle.js index 9fa66e0..1db81dd 100644 --- a/public/build/bundle.js +++ b/public/build/bundle.js @@ -1,21 +1,59587 @@ -var app=function(){"use strict";function e(){}function t(e){return e()}function i(){return Object.create(null)}function n(e){e.forEach(t)}function r(e){return"function"==typeof e}function s(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(t,i,n){t.$$.on_destroy.push(function(t,...i){if(null==t)return e;const n=t.subscribe(...i);return n.unsubscribe?()=>n.unsubscribe():n}(i,n))}function o(e,t){e.appendChild(t)}function u(e,t,i){e.insertBefore(t,i||null)}function l(e){e.parentNode.removeChild(e)}function c(e){return document.createElement(e)}function h(e){return document.createTextNode(e)}function d(){return h(" ")}function p(e,t,i,n){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i,n)}function f(e,t,i){null==i?e.removeAttribute(t):e.getAttribute(t)!==i&&e.setAttribute(t,i)}function m(e){return Array.from(e.childNodes)}function g(e,t,i,n){for(let n=0;n{N.delete(e),n&&(i&&e.d(1),n())}),e.o(t)}}function M(e){e&&e.c()}function B(e,t){e&&e.l(t)}function j(e,i,s){const{fragment:a,on_mount:o,on_destroy:u,after_update:l}=e.$$;a&&a.m(i,s),I(()=>{const i=o.map(t).filter(r);u?u.push(...i):n(i),e.$$.on_mount=[]}),l.forEach(I)}function F(e,t){const i=e.$$;null!==i.fragment&&(n(i.on_destroy),i.fragment&&i.fragment.d(t),i.on_destroy=i.fragment=null,i.ctx=[])}function V(e,t){-1===e.$$.dirty[0]&&(k.push(e),A||(A=!0,x.then(O)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const r=n.length?n[0]:i;return p.ctx&&o(p.ctx[e],p.ctx[e]=r)&&(p.bound[e]&&p.bound[e](r),f&&V(t,e)),i}):[],p.update(),f=!0,n(p.before_update),p.fragment=!!a&&a(p.ctx),r.target){if(r.hydrate){const e=m(r.target);p.fragment&&p.fragment.l(e),e.forEach(l)}else p.fragment&&p.fragment.c();r.intro&&R(t.$$.fragment),j(t,r.target,r.anchor),O()}T(h)}class q{$destroy(){F(this,1),this.$destroy=e}$on(e,t){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}$set(){}}const W=[];const z=function(t,i=e){let n;const r=[];function a(e){if(s(t,e)&&(t=e,n)){const e=!W.length;for(let e=0;e{const e=r.indexOf(u);-1!==e&&r.splice(e,1),0===r.length&&(n(),n=null)}}}}(""),$={setPlaying(e){console.log(">> setPlaying",e),z.update(t=>t===e?"":e)}};function G(t){let i,n,r,s,a,b,T,S,k,C,w,E,x;return{c(){i=c("div"),n=c("div"),r=c("div"),s=c("div"),a=d(),b=c("div"),T=h(t[1]),S=d(),k=c("iframe"),this.h()},l(e){i=g(e,"DIV",{class:!0});var o=m(i);n=g(o,"DIV",{class:!0});var u=m(n);r=g(u,"DIV",{class:!0,"data-youtube-id":!0});var c=m(r);s=g(c,"DIV",{class:!0}),m(s).forEach(l),a=y(c),b=g(c,"DIV",{class:!0});var h=m(b);T=v(h,t[1]),h.forEach(l),S=y(c),k=g(c,"IFRAME",{allow:!0,title:!0,id:!0,type:!0,frameborder:!0,width:!0,height:!0,src:!0}),m(k).forEach(l),c.forEach(l),u.forEach(l),o.forEach(l),this.h()},h(){f(s,"class","overlay"),f(b,"class","title"),f(k,"allow","autoplay"),f(k,"title",t[1]),f(k,"id",t[2]),f(k,"type","text/html"),f(k,"frameborder","0"),f(k,"width","100%"),f(k,"height","100%"),k.src!==(C=t[0])&&f(k,"src",C),f(r,"class",w="stream live youtube "+t[3]),f(r,"data-youtube-id",t[2]),f(n,"class","wrapper"),f(i,"class","quarter")},m(e,l){u(e,i,l),o(i,n),o(n,r),o(r,s),o(r,a),o(r,b),o(b,T),o(r,S),o(r,k),E||(x=p(i,"click",t[4]),E=!0)},p(e,[t]){2&t&&_(T,e[1]),2&t&&f(k,"title",e[1]),4&t&&f(k,"id",e[2]),1&t&&k.src!==(C=e[0])&&f(k,"src",C),8&t&&w!==(w="stream live youtube "+e[3])&&f(r,"class",w),4&t&&f(r,"data-youtube-id",e[2])},i:e,o:e,d(e){e&&l(i),E=!1,x()}}}function X(e,t,i){let n,r,{id:s}=t,{src:a}=t,{title:o}=t,u="";return z.subscribe(e=>{void 0!==n&&(i(3,u=""!==n&&e===n?"active":""),r&&(console.log(n+" - mute"),r.mute(),u&&(console.log(n+" - unmute"),r.unMute())))}),S(async()=>{setTimeout(async()=>{await async function(){console.log(n+" createPlayer");try{r=new YT.Player(n,{events:{onReady(e){console.log("READY!!"),e.target.mute()}}})}catch(e){console.log(e)}}()},1500)}),e.$set=e=>{"id"in e&&i(5,s=e.id),"src"in e&&i(0,a=e.src),"title"in e&&i(1,o=e.title)},e.$$.update=()=>{32&e.$$.dirty&&i(2,n=s+"-youtube")},[a,o,n,u,function(){$.setPlaying(n)},s]}class K extends q{constructor(e){super(),H(this,e,X,G,s,{id:5,src:0,title:1})}}var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Q(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&i.path)}},i.exports),i.exports}var J,Z,ee="undefined"!=typeof window?window:void 0!==Y?Y:"undefined"!=typeof self?self:{},te=(J=Object.freeze({__proto__:null,default:{}}))&&J.default||J,ie=void 0!==Y?Y:"undefined"!=typeof window?window:{};"undefined"!=typeof document?Z=document:(Z=ie["__GLOBAL_DOCUMENT_CACHE@4"])||(Z=ie["__GLOBAL_DOCUMENT_CACHE@4"]=te);var ne=Z,re=Q((function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t unsub.unsubscribe() : unsub; + } + function component_subscribe(component, store, callback) { + component.$$.on_destroy.push(subscribe(store, callback)); + } + + function append(target, node) { + target.appendChild(node); + } + function insert(target, node, anchor) { + target.insertBefore(node, anchor || null); + } + function detach(node) { + node.parentNode.removeChild(node); + } + function element(name) { + return document.createElement(name); + } + function svg_element(name) { + return document.createElementNS('http://www.w3.org/2000/svg', name); + } + function text(data) { + return document.createTextNode(data); + } + function space() { + return text(' '); + } + function listen(node, event, handler, options) { + node.addEventListener(event, handler, options); + return () => node.removeEventListener(event, handler, options); + } + function attr(node, attribute, value) { + if (value == null) + node.removeAttribute(attribute); + else if (node.getAttribute(attribute) !== value) + node.setAttribute(attribute, value); + } + function children(element) { + return Array.from(element.childNodes); + } + function claim_element(nodes, name, attributes, svg) { + for (let i = 0; i < nodes.length; i += 1) { + const node = nodes[i]; + if (node.nodeName === name) { + let j = 0; + while (j < node.attributes.length) { + const attribute = node.attributes[j]; + if (attributes[attribute.name]) { + j++; + } + else { + node.removeAttribute(attribute.name); + } + } + return nodes.splice(i, 1)[0]; + } + } + return svg ? svg_element(name) : element(name); + } + function claim_text(nodes, data) { + for (let i = 0; i < nodes.length; i += 1) { + const node = nodes[i]; + if (node.nodeType === 3) { + node.data = '' + data; + return nodes.splice(i, 1)[0]; + } + } + return text(data); + } + function claim_space(nodes) { + return claim_text(nodes, ' '); + } + function custom_event(type, detail) { + const e = document.createEvent('CustomEvent'); + e.initCustomEvent(type, false, false, detail); + return e; + } + + let current_component; + function set_current_component(component) { + current_component = component; + } + function get_current_component() { + if (!current_component) + throw new Error(`Function called outside component initialization`); + return current_component; + } + function onMount(fn) { + get_current_component().$$.on_mount.push(fn); + } + + const dirty_components = []; + const binding_callbacks = []; + const render_callbacks = []; + const flush_callbacks = []; + const resolved_promise = Promise.resolve(); + let update_scheduled = false; + function schedule_update() { + if (!update_scheduled) { + update_scheduled = true; + resolved_promise.then(flush); + } + } + function add_render_callback(fn) { + render_callbacks.push(fn); + } + let flushing = false; + const seen_callbacks = new Set(); + function flush() { + if (flushing) + return; + flushing = true; + do { + // first, call beforeUpdate functions + // and update components + for (let i = 0; i < dirty_components.length; i += 1) { + const component = dirty_components[i]; + set_current_component(component); + update(component.$$); + } + dirty_components.length = 0; + while (binding_callbacks.length) + binding_callbacks.pop()(); + // then, once components are updated, call + // afterUpdate functions. This may cause + // subsequent updates... + for (let i = 0; i < render_callbacks.length; i += 1) { + const callback = render_callbacks[i]; + if (!seen_callbacks.has(callback)) { + // ...so guard against infinite loops + seen_callbacks.add(callback); + callback(); + } + } + render_callbacks.length = 0; + } while (dirty_components.length); + while (flush_callbacks.length) { + flush_callbacks.pop()(); + } + update_scheduled = false; + flushing = false; + seen_callbacks.clear(); + } + function update($$) { + if ($$.fragment !== null) { + $$.update(); + run_all($$.before_update); + const dirty = $$.dirty; + $$.dirty = [-1]; + $$.fragment && $$.fragment.p($$.ctx, dirty); + $$.after_update.forEach(add_render_callback); + } + } + const outroing = new Set(); + let outros; + function transition_in(block, local) { + if (block && block.i) { + outroing.delete(block); + block.i(local); + } + } + function transition_out(block, local, detach, callback) { + if (block && block.o) { + if (outroing.has(block)) + return; + outroing.add(block); + outros.c.push(() => { + outroing.delete(block); + if (callback) { + if (detach) + block.d(1); + callback(); + } + }); + block.o(local); + } + } + + const globals = (typeof window !== 'undefined' + ? window + : typeof globalThis !== 'undefined' + ? globalThis + : global); + function create_component(block) { + block && block.c(); + } + function claim_component(block, parent_nodes) { + block && block.l(parent_nodes); + } + function mount_component(component, target, anchor) { + const { fragment, on_mount, on_destroy, after_update } = component.$$; + fragment && fragment.m(target, anchor); + // onMount happens before the initial afterUpdate + add_render_callback(() => { + const new_on_destroy = on_mount.map(run).filter(is_function); + if (on_destroy) { + on_destroy.push(...new_on_destroy); + } + else { + // Edge case - component was destroyed immediately, + // most likely as a result of a binding initialising + run_all(new_on_destroy); + } + component.$$.on_mount = []; + }); + after_update.forEach(add_render_callback); + } + function destroy_component(component, detaching) { + const $$ = component.$$; + if ($$.fragment !== null) { + run_all($$.on_destroy); + $$.fragment && $$.fragment.d(detaching); + // TODO null out other refs, including component.$$ (but need to + // preserve final state?) + $$.on_destroy = $$.fragment = null; + $$.ctx = []; + } + } + function make_dirty(component, i) { + if (component.$$.dirty[0] === -1) { + dirty_components.push(component); + schedule_update(); + component.$$.dirty.fill(0); + } + component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); + } + function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { + const parent_component = current_component; + set_current_component(component); + const prop_values = options.props || {}; + const $$ = component.$$ = { + fragment: null, + ctx: null, + // state + props, + update: noop, + not_equal, + bound: blank_object(), + // lifecycle + on_mount: [], + on_destroy: [], + before_update: [], + after_update: [], + context: new Map(parent_component ? parent_component.$$.context : []), + // everything else + callbacks: blank_object(), + dirty + }; + let ready = false; + $$.ctx = instance + ? instance(component, prop_values, (i, ret, ...rest) => { + const value = rest.length ? rest[0] : ret; + if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { + if ($$.bound[i]) + $$.bound[i](value); + if (ready) + make_dirty(component, i); + } + return ret; + }) + : []; + $$.update(); + ready = true; + run_all($$.before_update); + // `false` as a special case of no DOM component + $$.fragment = create_fragment ? create_fragment($$.ctx) : false; + if (options.target) { + if (options.hydrate) { + const nodes = children(options.target); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment && $$.fragment.l(nodes); + nodes.forEach(detach); + } + else { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment && $$.fragment.c(); + } + if (options.intro) + transition_in(component.$$.fragment); + mount_component(component, options.target, options.anchor); + flush(); + } + set_current_component(parent_component); + } + class SvelteComponent { + $destroy() { + destroy_component(this, 1); + this.$destroy = noop; + } + $on(type, callback) { + const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); + callbacks.push(callback); + return () => { + const index = callbacks.indexOf(callback); + if (index !== -1) + callbacks.splice(index, 1); + }; + } + $set() { + // overridden by instance, if it has props + } + } + + function dispatch_dev(type, detail) { + document.dispatchEvent(custom_event(type, Object.assign({ version: '3.23.0' }, detail))); + } + function append_dev(target, node) { + dispatch_dev("SvelteDOMInsert", { target, node }); + append(target, node); + } + function insert_dev(target, node, anchor) { + dispatch_dev("SvelteDOMInsert", { target, node, anchor }); + insert(target, node, anchor); + } + function detach_dev(node) { + dispatch_dev("SvelteDOMRemove", { node }); + detach(node); + } + function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) { + const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : []; + if (has_prevent_default) + modifiers.push('preventDefault'); + if (has_stop_propagation) + modifiers.push('stopPropagation'); + dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers }); + const dispose = listen(node, event, handler, options); + return () => { + dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers }); + dispose(); + }; + } + function attr_dev(node, attribute, value) { + attr(node, attribute, value); + if (value == null) + dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute }); + else + dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value }); + } + function set_data_dev(text, data) { + data = '' + data; + if (text.data === data) + return; + dispatch_dev("SvelteDOMSetData", { node: text, data }); + text.data = data; + } + function validate_slots(name, slot, keys) { + for (const slot_key of Object.keys(slot)) { + if (!~keys.indexOf(slot_key)) { + console.warn(`<${name}> received an unexpected slot "${slot_key}".`); + } + } + } + class SvelteComponentDev extends SvelteComponent { + constructor(options) { + if (!options || (!options.target && !options.$$inline)) { + throw new Error(`'target' is a required option`); + } + super(); + } + $destroy() { + super.$destroy(); + this.$destroy = () => { + console.warn(`Component was already destroyed`); // eslint-disable-line no-console + }; + } + $capture_state() { } + $inject_state() { } + } + + const subscriber_queue = []; + /** + * Create a `Writable` store that allows both updating and reading by subscription. + * @param {*=}value initial value + * @param {StartStopNotifier=}start start and stop notifications for subscriptions + */ + function writable(value, start = noop) { + let stop; + const subscribers = []; + function set(new_value) { + if (safe_not_equal(value, new_value)) { + value = new_value; + if (stop) { // store is ready + const run_queue = !subscriber_queue.length; + for (let i = 0; i < subscribers.length; i += 1) { + const s = subscribers[i]; + s[1](); + subscriber_queue.push(s, value); + } + if (run_queue) { + for (let i = 0; i < subscriber_queue.length; i += 2) { + subscriber_queue[i][0](subscriber_queue[i + 1]); + } + subscriber_queue.length = 0; + } + } + } + } + function update(fn) { + set(fn(value)); + } + function subscribe(run, invalidate = noop) { + const subscriber = [run, invalidate]; + subscribers.push(subscriber); + if (subscribers.length === 1) { + stop = start(set) || noop; + } + run(value); + return () => { + const index = subscribers.indexOf(subscriber); + if (index !== -1) { + subscribers.splice(index, 1); + } + if (subscribers.length === 0) { + stop(); + stop = null; + } + }; + } + return { set, update, subscribe }; + } + + /** + * Created by WebStorm. + * User: martin + * Date: 27/05/2020 + * Time: 10:04 + + */ + + const Playing = writable(''); + + const actions = { + setPlaying(id) { + console.log('>> setPlaying', id); + + Playing.update((v) => { + return (v === id) ? '' : id; + }); + } + + }; + + /* src/components/Youtube.svelte generated by Svelte v3.23.0 */ + + const { console: console_1 } = globals; + const file = "src/components/Youtube.svelte"; + + function create_fragment(ctx) { + let div4; + let div3; + let div2; + let div0; + let t0; + let div1; + let t1; + let t2; + let iframe; + let iframe_src_value; + let div2_class_value; + let mounted; + let dispose; + + const block = { + c: function create() { + div4 = element("div"); + div3 = element("div"); + div2 = element("div"); + div0 = element("div"); + t0 = space(); + div1 = element("div"); + t1 = text(/*title*/ ctx[1]); + t2 = space(); + iframe = element("iframe"); + this.h(); + }, + l: function claim(nodes) { + div4 = claim_element(nodes, "DIV", { class: true }); + var div4_nodes = children(div4); + div3 = claim_element(div4_nodes, "DIV", { class: true }); + var div3_nodes = children(div3); + div2 = claim_element(div3_nodes, "DIV", { class: true, "data-youtube-id": true }); + var div2_nodes = children(div2); + div0 = claim_element(div2_nodes, "DIV", { class: true }); + children(div0).forEach(detach_dev); + t0 = claim_space(div2_nodes); + div1 = claim_element(div2_nodes, "DIV", { class: true }); + var div1_nodes = children(div1); + t1 = claim_text(div1_nodes, /*title*/ ctx[1]); + div1_nodes.forEach(detach_dev); + t2 = claim_space(div2_nodes); + + iframe = claim_element(div2_nodes, "IFRAME", { + allow: true, + title: true, + id: true, + type: true, + frameborder: true, + width: true, + height: true, + src: true + }); + + children(iframe).forEach(detach_dev); + div2_nodes.forEach(detach_dev); + div3_nodes.forEach(detach_dev); + div4_nodes.forEach(detach_dev); + this.h(); + }, + h: function hydrate() { + attr_dev(div0, "class", "overlay"); + add_location(div0, file, 81, 6, 1622); + attr_dev(div1, "class", "title"); + add_location(div1, file, 82, 6, 1656); + attr_dev(iframe, "allow", "autoplay"); + attr_dev(iframe, "title", /*title*/ ctx[1]); + attr_dev(iframe, "id", /*fullId*/ ctx[2]); + attr_dev(iframe, "type", "text/html"); + attr_dev(iframe, "frameborder", "0"); + attr_dev(iframe, "width", "100%"); + attr_dev(iframe, "height", "100%"); + if (iframe.src !== (iframe_src_value = /*src*/ ctx[0])) attr_dev(iframe, "src", iframe_src_value); + add_location(iframe, file, 86, 6, 1841); + attr_dev(div2, "class", div2_class_value = "stream live youtube " + /*active*/ ctx[3]); + attr_dev(div2, "data-youtube-id", /*fullId*/ ctx[2]); + add_location(div2, file, 80, 4, 1548); + attr_dev(div3, "class", "wrapper"); + add_location(div3, file, 79, 2, 1522); + attr_dev(div4, "class", "quarter"); + add_location(div4, file, 78, 0, 1475); + }, + m: function mount(target, anchor) { + insert_dev(target, div4, anchor); + append_dev(div4, div3); + append_dev(div3, div2); + append_dev(div2, div0); + append_dev(div2, t0); + append_dev(div2, div1); + append_dev(div1, t1); + append_dev(div2, t2); + append_dev(div2, iframe); + + if (!mounted) { + dispose = listen_dev(div4, "click", /*handleClick*/ ctx[4], false, false, false); + mounted = true; + } + }, + p: function update(ctx, [dirty]) { + if (dirty & /*title*/ 2) set_data_dev(t1, /*title*/ ctx[1]); + + if (dirty & /*title*/ 2) { + attr_dev(iframe, "title", /*title*/ ctx[1]); + } + + if (dirty & /*fullId*/ 4) { + attr_dev(iframe, "id", /*fullId*/ ctx[2]); + } + + if (dirty & /*src*/ 1 && iframe.src !== (iframe_src_value = /*src*/ ctx[0])) { + attr_dev(iframe, "src", iframe_src_value); + } + + if (dirty & /*active*/ 8 && div2_class_value !== (div2_class_value = "stream live youtube " + /*active*/ ctx[3])) { + attr_dev(div2, "class", div2_class_value); + } + + if (dirty & /*fullId*/ 4) { + attr_dev(div2, "data-youtube-id", /*fullId*/ ctx[2]); + } + }, + i: noop, + o: noop, + d: function destroy(detaching) { + if (detaching) detach_dev(div4); + mounted = false; + dispose(); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function instance($$self, $$props, $$invalidate) { + let { id } = $$props; + let { src } = $$props; + let { title } = $$props; + let fullId; + let active = ""; + let player; + + function mute() { + console.log(`${fullId} - mute`); + player.mute(); + } + + function unMute() { + console.log(`${fullId} - unmute`); + player.unMute(); + } + + Playing.subscribe(v => { + if (typeof fullId !== "undefined") { + // console.log(`${fullId} playing`, v); + $$invalidate(3, active = fullId !== "" && v === fullId ? "active" : ""); + + if (player) { + mute(); + + if (active) { + unMute(); + } + } + } + }); + + function handleClick() { + actions.setPlaying(fullId); + } + + async function createPlayer() { + console.log(`${fullId} createPlayer`); + + try { + player = new YT.Player(fullId, + { + "events": { + "onReady"(event) { + console.log("READY!!"); // mute(); + event.target.mute(); + }, // mute(); + + } + }); + } catch(e) { + console.log(e); // console.log(`${fullId} Player`, player); + } + } + + onMount(async () => { + setTimeout( + async () => { + await createPlayer(); + }, + 1500 + ); + }); + + const writable_props = ["id", "src", "title"]; + + Object.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1.warn(` was created with unknown prop '${key}'`); + }); + + let { $$slots = {}, $$scope } = $$props; + validate_slots("Youtube", $$slots, []); + + $$self.$set = $$props => { + if ("id" in $$props) $$invalidate(5, id = $$props.id); + if ("src" in $$props) $$invalidate(0, src = $$props.src); + if ("title" in $$props) $$invalidate(1, title = $$props.title); + }; + + $$self.$capture_state = () => ({ + onMount, + Playing, + actions, + id, + src, + title, + fullId, + active, + player, + mute, + unMute, + handleClick, + createPlayer + }); + + $$self.$inject_state = $$props => { + if ("id" in $$props) $$invalidate(5, id = $$props.id); + if ("src" in $$props) $$invalidate(0, src = $$props.src); + if ("title" in $$props) $$invalidate(1, title = $$props.title); + if ("fullId" in $$props) $$invalidate(2, fullId = $$props.fullId); + if ("active" in $$props) $$invalidate(3, active = $$props.active); + if ("player" in $$props) player = $$props.player; + }; + + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*id*/ 32) { + $$invalidate(2, fullId = `${id}-youtube`); + } + }; + + return [src, title, fullId, active, handleClick, id]; + } + + class Youtube extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance, create_fragment, safe_not_equal, { id: 5, src: 0, title: 1 }); + + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "Youtube", + options, + id: create_fragment.name + }); + + const { ctx } = this.$$; + const props = options.props || {}; + + if (/*id*/ ctx[5] === undefined && !("id" in props)) { + console_1.warn(" was created without expected prop 'id'"); + } + + if (/*src*/ ctx[0] === undefined && !("src" in props)) { + console_1.warn(" was created without expected prop 'src'"); + } + + if (/*title*/ ctx[1] === undefined && !("title" in props)) { + console_1.warn(" was created without expected prop 'title'"); + } + } + + get id() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set id(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get src() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set src(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get title() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set title(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + } + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, basedir, module) { + return module = { + path: basedir, + exports: {}, + require: function (path, base) { + return commonjsRequire(path, (base === undefined || base === null) ? module.path : base); + } + }, fn(module, module.exports), module.exports; + } + + function getCjsExportFromNamespace (n) { + return n && n['default'] || n; + } + + function commonjsRequire () { + throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); + } + + var win; + + if (typeof window !== "undefined") { + win = window; + } else if (typeof commonjsGlobal !== "undefined") { + win = commonjsGlobal; + } else if (typeof self !== "undefined"){ + win = self; + } else { + win = {}; + } + + var window_1 = win; + + var _nodeResolve_empty = {}; + + var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': _nodeResolve_empty + }); + + var minDoc = getCjsExportFromNamespace(_nodeResolve_empty$1); + + var topLevel = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : + typeof window !== 'undefined' ? window : {}; + + + var doccy; + + if (typeof document !== 'undefined') { + doccy = document; + } else { + doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; + + if (!doccy) { + doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; + } + } + + var document_1 = doccy; + + var _extends_1 = createCommonjsModule(function (module) { + function _extends() { + module.exports = _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); + } + + module.exports = _extends; + }); + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + var assertThisInitialized = _assertThisInitialized; + + var _typeof_1 = createCommonjsModule(function (module) { + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + module.exports = _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); + } + + module.exports = _typeof; + }); + + var getPrototypeOf = createCommonjsModule(function (module) { + function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + + module.exports = _getPrototypeOf; + }); + + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + + var inheritsLoose = _inheritsLoose; + + var tuple = SafeParseTuple; + + function SafeParseTuple(obj, reviver) { + var json; + var error = null; + + try { + json = JSON.parse(obj, reviver); + } catch (err) { + error = err; + } + + return [error, json] + } + + var keycode = createCommonjsModule(function (module, exports) { + // Source: http://jsfiddle.net/vWx8V/ + // http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes + + /** + * Conenience method returns corresponding value for given keyName or keyCode. + * + * @param {Mixed} keyCode {Number} or keyName {String} + * @return {Mixed} + * @api public + */ + + function keyCode(searchInput) { + // Keyboard Events + if (searchInput && 'object' === typeof searchInput) { + var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode; + if (hasKeyCode) searchInput = hasKeyCode; + } + + // Numbers + if ('number' === typeof searchInput) return names[searchInput] + + // Everything else (cast to string) + var search = String(searchInput); + + // check codes + var foundNamedKey = codes[search.toLowerCase()]; + if (foundNamedKey) return foundNamedKey + + // check aliases + var foundNamedKey = aliases[search.toLowerCase()]; + if (foundNamedKey) return foundNamedKey + + // weird character? + if (search.length === 1) return search.charCodeAt(0) + + return undefined + } + + /** + * Compares a keyboard event with a given keyCode or keyName. + * + * @param {Event} event Keyboard event that should be tested + * @param {Mixed} keyCode {Number} or keyName {String} + * @return {Boolean} + * @api public + */ + keyCode.isEventKey = function isEventKey(event, nameOrCode) { + if (event && 'object' === typeof event) { + var keyCode = event.which || event.keyCode || event.charCode; + if (keyCode === null || keyCode === undefined) { return false; } + if (typeof nameOrCode === 'string') { + // check codes + var foundNamedKey = codes[nameOrCode.toLowerCase()]; + if (foundNamedKey) { return foundNamedKey === keyCode; } + + // check aliases + var foundNamedKey = aliases[nameOrCode.toLowerCase()]; + if (foundNamedKey) { return foundNamedKey === keyCode; } + } else if (typeof nameOrCode === 'number') { + return nameOrCode === keyCode; + } + return false; + } + }; + + exports = module.exports = keyCode; + + /** + * Get by name + * + * exports.code['enter'] // => 13 + */ + + var codes = exports.code = exports.codes = { + 'backspace': 8, + 'tab': 9, + 'enter': 13, + 'shift': 16, + 'ctrl': 17, + 'alt': 18, + 'pause/break': 19, + 'caps lock': 20, + 'esc': 27, + 'space': 32, + 'page up': 33, + 'page down': 34, + 'end': 35, + 'home': 36, + 'left': 37, + 'up': 38, + 'right': 39, + 'down': 40, + 'insert': 45, + 'delete': 46, + 'command': 91, + 'left command': 91, + 'right command': 93, + 'numpad *': 106, + 'numpad +': 107, + 'numpad -': 109, + 'numpad .': 110, + 'numpad /': 111, + 'num lock': 144, + 'scroll lock': 145, + 'my computer': 182, + 'my calculator': 183, + ';': 186, + '=': 187, + ',': 188, + '-': 189, + '.': 190, + '/': 191, + '`': 192, + '[': 219, + '\\': 220, + ']': 221, + "'": 222 + }; + + // Helper aliases + + var aliases = exports.aliases = { + 'windows': 91, + '⇧': 16, + '⌥': 18, + '⌃': 17, + '⌘': 91, + 'ctl': 17, + 'control': 17, + 'option': 18, + 'pause': 19, + 'break': 19, + 'caps': 20, + 'return': 13, + 'escape': 27, + 'spc': 32, + 'spacebar': 32, + 'pgup': 33, + 'pgdn': 34, + 'ins': 45, + 'del': 46, + 'cmd': 91 + }; + + /*! * Programatically add the following */ -for(s=97;s<123;s++)n[String.fromCharCode(s)]=s-32;for(var s=48;s<58;s++)n[s-48]=s;for(s=1;s<13;s++)n["f"+s]=s+111;for(s=0;s<10;s++)n["numpad "+s]=s+96;var a=t.names=t.title={};for(s in n)a[n[s]]=s;for(var o in r)n[o]=r[o]})),le=(ue.code,ue.codes,ue.aliases,ue.names,ue.title,"undefined"!=typeof window?window:void 0!==Y?Y:"undefined"!=typeof self?self:{}),ce=function(e){if(!e)return!1;var t=he.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)} -/** + + // lower case chars + for (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32; + + // numbers + for (var i = 48; i < 58; i++) codes[i - 48] = i; + + // function keys + for (i = 1; i < 13; i++) codes['f'+i] = i + 111; + + // numpad keys + for (i = 0; i < 10; i++) codes['numpad '+i] = i + 96; + + /** + * Get by code + * + * exports.name[13] // => 'Enter' + */ + + var names = exports.names = exports.title = {}; // title for backward compat + + // Create reverse mapping + for (i in codes) names[codes[i]] = i; + + // Add aliases + for (var alias in aliases) { + codes[alias] = aliases[alias]; + } + }); + var keycode_1 = keycode.code; + var keycode_2 = keycode.codes; + var keycode_3 = keycode.aliases; + var keycode_4 = keycode.names; + var keycode_5 = keycode.title; + + var win$1; + + if (typeof window !== "undefined") { + win$1 = window; + } else if (typeof commonjsGlobal !== "undefined") { + win$1 = commonjsGlobal; + } else if (typeof self !== "undefined"){ + win$1 = self; + } else { + win$1 = {}; + } + + var window_1$1 = win$1; + + var isFunction_1 = isFunction; + + var toString = Object.prototype.toString; + + function isFunction (fn) { + if (!fn) { + return false + } + var string = toString.call(fn); + return string === '[object Function]' || + (typeof fn === 'function' && string !== '[object RegExp]') || + (typeof window !== 'undefined' && + // IE8 and below + (fn === window.setTimeout || + fn === window.alert || + fn === window.confirm || + fn === window.prompt)) + } + + /** * @license * slighly modified parse-headers 2.0.2 * Copyright (c) 2014 David Björklund * Available under the MIT license * - */,he=Object.prototype.toString;var de=me,pe=me;function fe(e,t,i){var n=e;return ce(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=re({},t,{uri:e}),n.callback=i,n}function me(e,t,i){return ge(t=fe(e,t,i))}function ge(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){var e=void 0;if(e=u.response?u.response:u.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(u),m)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(l),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,g)}function s(){if(!o){var t;clearTimeout(l),t=e.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var r=g,s=null;return 0!==t?(r={body:n(),statusCode:t,method:h,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(r.headers=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();void 0===t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t}(u.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),i(s,r,r.body)}}var a,o,u=e.xhr||null;u||(u=e.cors||e.useXDR?new me.XDomainRequest:new me.XMLHttpRequest);var l,c=u.url=e.uri||e.url,h=u.method=e.method||"GET",d=e.body||e.data,p=u.headers=e.headers||{},f=!!e.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:h,url:c,rawRequest:u};if("json"in e&&!1!==e.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),d=JSON.stringify(!0===e.json?d:e.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(s,0)},u.onload=s,u.onerror=r,u.onprogress=function(){},u.onabort=function(){o=!0},u.ontimeout=r,u.open(h,c,!f,e.username,e.password),f||(u.withCredentials=!!e.withCredentials),!f&&e.timeout>0&&(l=setTimeout((function(){if(!o){o=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),u.setRequestHeader)for(a in p)p.hasOwnProperty(a)&&u.setRequestHeader(a,p[a]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(d||null),u}me.XMLHttpRequest=le.XMLHttpRequest||function(){},me.XDomainRequest="withCredentials"in new me.XMLHttpRequest?me.XMLHttpRequest:le.XDomainRequest,function(e,t){for(var i=0;i59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function be(){this.values=ve(null)}function Te(e,t,i,n){var r=n?e.split(n):[e];for(var s in r)if("string"==typeof r[s]){var a=r[s].split(i);if(2===a.length)t(a[0],a[1])}}function Se(e,t,i){var n=e;function r(){var t=_e(e);if(null===t)throw new ye(ye.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=r(),s(),"--\x3e"!==e.substr(0,3))throw new ye(ye.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),s(),t.endTime=r(),s(),function(e,t){var n=new be;Te(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),a=s[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===s.length&&n.alt("lineAlign",s[1],["start","center","end"]);break;case"position":s=t.split(","),n.percent(e,s[0]),2===s.length&&n.alt("positionAlign",s[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}ye.prototype=ve(Error.prototype),ye.prototype.constructor=ye,ye.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},be.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var ke=ne.createElement("textarea"),Ce={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},we={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},Ee={v:"title",lang:"lang"},xe={rt:"ruby"};function Ae(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!xe[t.localName]||xe[t.localName]===e.localName}function r(t,i){var n=Ce[t];if(!n)return null;var r=e.document.createElement(n),s=Ee[t];return s&&i&&(r[s]=i.trim()),r}for(var s,a,o=e.document.createElement("div"),u=o,l=[];null!==(s=i());)if("<"!==s[0])u.appendChild(e.document.createTextNode((a=s,ke.innerHTML=a,a=ke.textContent,ke.textContent="",a)));else{if("/"===s[1]){l.length&&l[l.length-1]===s.substr(2).replace(">","")&&(l.pop(),u=u.parentNode);continue}var c,h=_e(s.substr(1,s.length-2));if(h){c=e.document.createProcessingInstruction("timestamp",h),u.appendChild(c);continue}var d=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!d)continue;if(!(c=r(d[1],d[3])))continue;if(!n(u,c))continue;if(d[2]){var p=d[2].split(".");p.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(we.hasOwnProperty(i)){var n=t?"background-color":"color",r=we[i];c.style[n]=r}})),c.className=p.join(" ")}l.push(d[1]),u.appendChild(c),u=c}return o}var Ie=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function Pe(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function Le(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var s=i.match(/^.*(\n|\r)/);return s?(e.length=0,s[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var s=0;s=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),a<0&&(c+=""===s.vertical?i.height:i.width,o=o.reverse()),r.move(d,c)}else{var p=r.lineHeight/i.height*100;switch(s.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],r=new Ne(t)}var f=function(e,t){for(var r,s=new Ne(e),a=1,o=0;ou&&(r=new Ne(e),a=u),e=new Ne(s)}return r||s}(r,o);t.move(f.toCSSCompatValues(i))}function Ue(){}Oe.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},Oe.prototype.formatStyle=function(e,t){return 0===e?0:e+t},De.prototype=ve(Oe.prototype),De.prototype.constructor=De,Ne.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},Ne.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},Ne.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Ne.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Ne.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Ne.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Ne.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},Ue.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Ue.convertCueToDOMTree=function(e,t){return e&&t?Ae(e,t):null};Ue.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=Fe(e);t?(f=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=Fe(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}Ve.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var He=Ve,qe={"":!0,up:!0};function We(e){return"number"==typeof e&&e>=0&&e<=100}var ze=function(){var e=100,t=3,i=0,n=100,r=0,s=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!We(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!We(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!We(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!We(e))throw new Error("ViewportAnchorY must be between 0 and 100.");s=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!We(e))throw new Error("ViewportAnchorX must be between 0 and 100.");r=e}},scroll:{enumerable:!0,get:function(){return a},set:function(e){var t=function(e){return"string"==typeof e&&(!!qe[e.toLowerCase()]&&e.toLowerCase())}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):a=t}}})},$e=Q((function(e){var t=e.exports={WebVTT:Me,VTTCue:He,VTTRegion:ze};ee.vttjs=t,ee.WebVTT=t.WebVTT;var i=t.VTTCue,n=t.VTTRegion,r=ee.VTTCue,s=ee.VTTRegion;t.shim=function(){ee.VTTCue=i,ee.VTTRegion=n},t.restore=function(){ee.VTTCue=r,ee.VTTRegion=s},ee.VTTCue||t.shim()})),Ge=($e.WebVTT,$e.VTTCue,$e.VTTRegion,Q((function(e){function t(i,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(i,n)}e.exports=t})));var Xe=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}},Ke=Q((function(e){function t(i,n,r){return Xe()?e.exports=t=Reflect.construct:e.exports=t=function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&Ge(r,i.prototype),r},t.apply(null,arguments)}e.exports=t}));var Ye=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ge(e,t)},Qe=Q((function(e,t){!function(t){var i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return i.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=n.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(l.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,h=c.substring(0,c.lastIndexOf("/")+1)+s.path;l.path=a.normalizePath(h)}else l.path=o.path,s.params||(l.params=o.params,s.query||(l.query=o.query));return null===l.path&&(l.path=i.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(l)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(s,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=a}()})); -/*! @name m3u8-parser @version 4.4.0 @license Apache-2.0 */ -function Je(){return(Je=Object.assign||function(e){for(var t=1;t-1},t.trigger=function(e){var t,i,n,r=this.listeners[e];if(r)if(2===arguments.length)for(i=r.length,t=0;t-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(et),it=function(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},nt=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}Ze(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,i){var n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((function(e){for(var r=0;r0&&(a.duration=e.duration),0===e.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?void(this.manifest.contentProtection={"com.widevine.alpha":{attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:rt(e.attributes.URI.split(",")[1])}}):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,l=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes?(a.attributes||(a.attributes={}),Je(a.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],(c={default:/yes/i.test(e.attributes.DEFAULT)}).default?c.autoselect=!0:c.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(c.language=e.attributes.LANGUAGE),e.attributes.URI&&(c.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(c.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(c.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(c.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=c}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){l+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),a.dateTimeString=e.dateTimeString,a.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=e.data},"cue-out-cont":function(){a.cueOutCont=e.data},"cue-in":function(){a.cueIn=e.data}}[e.tagType]||o).call(r)},uri:function(){a.uri=e.uri,s.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),n&&(a.key=n),a.timeline=l,i&&(a.map=i),a={}},comment:function(){},custom:function(){e.segment?(a.custom=a.custom||{},a.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)})),t}Ze(t,e);var i=t.prototype;return i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push("\n")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(et);function at(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var ot=at(Qe),ut=at(ee),lt=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=ot.buildAbsoluteURL(ut.location&&ut.location.href||"",e)),ot.buildAbsoluteURL(e,t))};var ct,ht=(ct=ee)&&"object"==typeof ct&&"default"in ct?ct.default:ct;var dt=function(e){for(var t,i=(t=e,ht.atob?ht.atob(t):Buffer.from(t,"base64").toString("binary")),n=new Uint8Array(i.length),r=0;r":switch(u){case 0:i.setTagName(e.slice(t,o));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=e.slice(t,o)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case 2:2===u&&(c=a),4==u?(s.warning('attribute "'+c+'" missed quot(")!!'),i.add(a,c.replace(/&#?\w+;/g,r),t)):("http://www.w3.org/1999/xhtml"===n[""]&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),i.add(c,c,t));break;case 3:throw new Error("attribute value missed!!")}return o;case"€":l=" ";default:if(l<=" ")switch(u){case 0:i.setTagName(e.slice(t,o)),u=6;break;case 1:a=e.slice(t,o),u=2;break;case 4:var c=e.slice(t,o).replace(/&#?\w+;/g,r);s.warning('attribute "'+c+'" missed quot(")!!'),i.add(a,c,t);case 5:u=6}else switch(u){case 2:i.tagName;"http://www.w3.org/1999/xhtml"===n[""]&&a.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),i.add(a,a,t),t=o,u=1;break;case 5:s.warning('attribute space is required"'+a+'"!!');case 6:u=1,t=o;break;case 3:u=4,t=o;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}o++}}function _t(e,t,i){for(var n=e.tagName,r=null,s=e.length;s--;){var a=e[s],o=a.qName,u=a.value;if((d=o.indexOf(":"))>0)var l=a.prefix=o.slice(0,d),c=o.slice(d+1),h="xmlns"===l&&c;else c=o,l=null,h="xmlns"===o&&"";a.localName=c,!1!==h&&(null==r&&(r={},St(i,i={})),i[h]=r[h]=u,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(h,u))}for(s=e.length;s--;){(l=(a=e[s]).prefix)&&("xml"===l&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(a.uri=i[l||""]))}var d;(d=n.indexOf(":"))>0?(l=e.prefix=n.slice(0,d),c=e.localName=n.slice(d+1)):(l=null,c=e.localName=n);var p=e.uri=i[l||""];if(t.startElement(p,c,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(p,c,n),r)for(l in r)t.endPrefixMapping(l)}function bt(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=e.indexOf("",t),a=e.substring(t+1,s);if(/[&<]/.test(a))return/^script$/i.test(i)?(r.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,n),r.characters(a,0,a.length),s)}return t+1}function Tt(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf(""))t?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var s=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var o=s[1][0],u=a>3&&/^public$/i.test(s[2][0])&&s[3][0],l=a>4&&s[4][0],c=s[a-1];return i.startDTD(o,u&&u.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),i.endDTD(),c.index+c[0].length}}return-1}function Ct(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return i.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function wt(e){}function Et(e,t){return e.__proto__=t,e}gt.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),St(t,t={}),function(e,t,i,n,r){function s(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function a(t){if(t>f){var i=e.substring(f,t).replace(/&#?\w+;/g,s);h&&o(f),n.characters(i,0,t-f),f=t}}function o(t,i){for(;t>=l&&(i=c.exec(e));)u=i.index,l=u+i[0].length,h.lineNumber++;h.columnNumber=t-u+1}var u=0,l=0,c=/.*(?:\r\n?|\n)|.*$/g,h=n.locator,d=[{currentNSMap:t}],p={},f=0;for(;;){try{var m=e.indexOf("<",f);if(m<0){if(!e.substr(f).match(/^\s*$/)){var g=n.doc,v=g.createTextNode(e.substr(f));g.appendChild(v),n.currentElement=v}return}switch(m>f&&a(m),e.charAt(m+1)){case"/":var y=e.indexOf(">",m+3),_=e.substring(m+2,y),b=d.pop();y<0?(_=e.substring(m+2).replace(/[\s<].*/,""),r.error("end tag name: "+_+" is not complete:"+b.tagName),y=m+1+_.length):_.match(/\sf?f=y:a(Math.max(m,f)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},wt.prototype={setTagName:function(e){if(!mt.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,i){if(!mt.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},Et({},Et.prototype)instanceof Et||(Et=function(e,t){function i(){}for(t in i.prototype=t,i=new i,e)i[t]=e[t];return i});var xt={XMLReader:gt};function At(e,t){for(var i in e)t[i]=e[i]}function It(e,t){var i=e.prototype;if(Object.create){var n=Object.create(t.prototype);i.__proto__=n}if(!(i instanceof t)){function r(){}r.prototype=t.prototype,At(i,r=new r),e.prototype=i=r}i.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),i.constructor=e)}var Pt={},Lt=Pt.ELEMENT_NODE=1,Ot=Pt.ATTRIBUTE_NODE=2,Dt=Pt.TEXT_NODE=3,Nt=Pt.CDATA_SECTION_NODE=4,Rt=Pt.ENTITY_REFERENCE_NODE=5,Ut=Pt.ENTITY_NODE=6,Mt=Pt.PROCESSING_INSTRUCTION_NODE=7,Bt=Pt.COMMENT_NODE=8,jt=Pt.DOCUMENT_NODE=9,Ft=Pt.DOCUMENT_TYPE_NODE=10,Vt=Pt.DOCUMENT_FRAGMENT_NODE=11,Ht=Pt.NOTATION_NODE=12,qt={},Wt={},zt=(qt.INDEX_SIZE_ERR=(Wt[1]="Index size error",1),qt.DOMSTRING_SIZE_ERR=(Wt[2]="DOMString size error",2),qt.HIERARCHY_REQUEST_ERR=(Wt[3]="Hierarchy request error",3)),$t=(qt.WRONG_DOCUMENT_ERR=(Wt[4]="Wrong document",4),qt.INVALID_CHARACTER_ERR=(Wt[5]="Invalid character",5),qt.NO_DATA_ALLOWED_ERR=(Wt[6]="No data allowed",6),qt.NO_MODIFICATION_ALLOWED_ERR=(Wt[7]="No modification allowed",7),qt.NOT_FOUND_ERR=(Wt[8]="Not found",8)),Gt=(qt.NOT_SUPPORTED_ERR=(Wt[9]="Not supported",9),qt.INUSE_ATTRIBUTE_ERR=(Wt[10]="Attribute in use",10));qt.INVALID_STATE_ERR=(Wt[11]="Invalid state",11),qt.SYNTAX_ERR=(Wt[12]="Syntax error",12),qt.INVALID_MODIFICATION_ERR=(Wt[13]="Invalid modification",13),qt.NAMESPACE_ERR=(Wt[14]="Invalid namespace",14),qt.INVALID_ACCESS_ERR=(Wt[15]="Invalid access",15);function Xt(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,Wt[e]),this.message=Wt[e],Error.captureStackTrace&&Error.captureStackTrace(this,Xt);return i.code=e,t&&(this.message=this.message+": "+t),i}function Kt(){}function Yt(e,t){this._node=e,this._refresh=t,Qt(this)}function Qt(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var i=e._refresh(e._node);xi(e,"length",i.length),At(i,e),e._inc=t}}function Jt(){}function Zt(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function ei(e,t,i,n){if(n?t[Zt(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&oi(r,e,n),function(e,t,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(r,e,i))}}function ti(e,t,i){var n=Zt(t,i);if(!(n>=0))throw Xt($t,new Error(e.tagName+"@"+i));for(var r=t.length-1;n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function si(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(si(e,t))return!0}while(e=e.nextSibling)}function ai(){}function oi(e,t,i,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&delete t._nsMap[i.prefix?i.localName:""]}function ui(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,s=0;r;)n[s++]=r,r=r.nextSibling;n.length=s}}}function li(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,ui(e.ownerDocument,e),t}function ci(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===Vt){var r=t.firstChild;if(null==r)return t;var s=t.lastChild}else r=s=t;var a=i?i.previousSibling:e.lastChild;r.previousSibling=a,s.nextSibling=i,a?a.nextSibling=r:e.firstChild=r,null==i?e.lastChild=s:i.previousSibling=s;do{r.parentNode=e}while(r!==s&&(r=r.nextSibling));return ui(e.ownerDocument||e,e),t.nodeType==Vt&&(t.firstChild=t.lastChild=null),t}function hi(){this._nsMap={}}function di(){}function pi(){}function fi(){}function mi(){}function gi(){}function vi(){}function yi(){}function _i(){}function bi(){}function Ti(){}function Si(){}function ki(){}function Ci(e,t){var i=[],n=9==this.nodeType?this.documentElement:this,r=n.prefix,s=n.namespaceURI;if(s&&null==r&&null==(r=n.lookupPrefix(s)))var a=[{namespace:s,prefix:null}];return Ei(this,i,e,t,a),i.join("")}function wi(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(!n&&!r)return!1;if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r)return!1;for(var s=i.length;s--;){var a=i[s];if(a.prefix==n)return a.namespace!=r}return!0}function Ei(e,t,i,n,r){if(n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case Lt:r||(r=[]);r.length;var s=e.attributes,a=s.length,o=e.firstChild,u=e.tagName;i="http://www.w3.org/1999/xhtml"===e.namespaceURI||i,t.push("<",u);for(var l=0;l"),i&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):Ei(o,t,i,n,r),o=o.nextSibling;else for(;o;)Ei(o,t,i,n,r),o=o.nextSibling;t.push("")}else t.push("/>");return;case jt:case Vt:for(o=e.firstChild;o;)Ei(o,t,i,n,r),o=o.nextSibling;return;case Ot:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,ri),'"');case Dt:return t.push(e.data.replace(/[<&]/g,ri));case Nt:return t.push("");case Bt:return t.push("\x3c!--",e.data,"--\x3e");case Ft:var f=e.publicId,m=e.systemId;if(t.push("');else if(m&&"."!=m)t.push(' SYSTEM "',m,'">');else{var g=e.internalSubset;g&&t.push(" [",g,"]"),t.push(">")}return;case Mt:return t.push("");case Rt:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function xi(e,t,i){e[t]=i}Xt.prototype=Error.prototype,At(qt,Xt),Kt.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==Ot?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==Ot?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},At(Pt,ni),At(Pt,ni.prototype),ai.prototype={nodeName:"#document",nodeType:jt,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==Vt){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return null==this.documentElement&&e.nodeType==Lt&&(this.documentElement=e),ci(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),li(this,e)},importNode:function(e,t){return function e(t,i,n){var r;switch(i.nodeType){case Lt:(r=i.cloneNode(!1)).ownerDocument=t;case Vt:break;case Ot:n=!0}r||(r=i.cloneNode(!1));if(r.ownerDocument=t,r.parentNode=null,n)for(var s=i.firstChild;s;)r.appendChild(e(t,s,n)),s=s.nextSibling;return r}(this,e,t)},getElementById:function(e){var t=null;return si(this.documentElement,(function(i){if(i.nodeType==Lt&&i.getAttribute("id")==e)return t=i,!0})),t},createElement:function(e){var t=new hi;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new Kt,(t.attributes=new Jt)._ownerElement=t,t},createDocumentFragment:function(){var e=new Ti;return e.ownerDocument=this,e.childNodes=new Kt,e},createTextNode:function(e){var t=new fi;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new mi;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new gi;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new Si;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new di;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new bi;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new hi,n=t.split(":"),r=i.attributes=new Jt;return i.childNodes=new Kt,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new di,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},It(ai,ni),hi.prototype={nodeType:Lt,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===Vt?this.insertBefore(e,null):function(e,t){var i=t.parentNode;if(i){var n=e.lastChild;i.removeChild(t);n=e.lastChild}return n=e.lastChild,t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,ui(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new Yt(this,(function(t){var i=[];return si(t,(function(n){n===t||n.nodeType!=Lt||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new Yt(this,(function(i){var n=[];return si(i,(function(r){r===i||r.nodeType!==Lt||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},ai.prototype.getElementsByTagName=hi.prototype.getElementsByTagName,ai.prototype.getElementsByTagNameNS=hi.prototype.getElementsByTagNameNS,It(hi,ni),di.prototype.nodeType=Ot,It(di,ni),pi.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(Wt[zt])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},It(pi,ni),fi.prototype={nodeName:"#text",nodeType:Dt,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},It(fi,pi),mi.prototype={nodeName:"#comment",nodeType:Bt},It(mi,pi),gi.prototype={nodeName:"#cdata-section",nodeType:Nt},It(gi,pi),vi.prototype.nodeType=Ft,It(vi,ni),yi.prototype.nodeType=Ht,It(yi,ni),_i.prototype.nodeType=Ut,It(_i,ni),bi.prototype.nodeType=Rt,It(bi,ni),Ti.prototype.nodeName="#document-fragment",Ti.prototype.nodeType=Vt,It(Ti,ni),Si.prototype.nodeType=Mt,It(Si,ni),ki.prototype.serializeToString=function(e,t,i){return Ci.call(e,t,i)},ni.prototype.toString=Ci;try{if(Object.defineProperty){Object.defineProperty(Yt.prototype,"length",{get:function(){return Qt(this),this.$$length}}),Object.defineProperty(ni.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case Lt:case Vt:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case Lt:case Vt:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),xi=function(e,t,i){e["$$"+t]=i}}}catch(e){}var Ai,Ii,Pi,Li,Oi,Di,Ni,Ri={DOMImplementation:ii,XMLSerializer:ki},Ui=Q((function(e,t){function i(e){this.options=e||{locator:{}}}function n(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function s(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function a(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function o(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}i.prototype.parseFromString=function(e,t){var i=this.options,r=new u,a=i.domBuilder||new n,o=i.errorHandler,l=i.locator,c=i.xmlns||{},h={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return l&&a.setDocumentLocator(l),r.errorHandler=function(e,t,i){if(!e){if(t instanceof n)return t;e=t}var r={},a=e instanceof Function;function o(t){var n=e[t];!n&&a&&(n=2==e.length?function(i){e(t,i)}:e),r[t]=n&&function(e){n("[xmldom "+t+"]\t"+e+s(i))}||function(){}}return i=i||{},o("warning"),o("error"),o("fatalError"),r}(o,a,l),r.domBuilder=i.domBuilder||a,/\/x?html?$/.test(t)&&(h.nbsp=" ",h.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",e?r.parse(e,c,h):r.errorHandler.error("invalid doc source"),a.doc},n.prototype={startDocument:function(){this.doc=(new l).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var s=this.doc,a=s.createElementNS(e,i||t),u=n.length;o(this,a),this.currentElement=a,this.locator&&r(this.locator,a);for(var l=0;ln.attributes.bandwidth||(e[a]={language:s,autoselect:!0,default:"main"===r,playlists:en([tn(n)],t),uri:""},void 0===i&&"main"===r&&((i=n).default=!0)),e}),{});i||(n[Object.keys(n)[0]].default=!0);return n}(h,t)),d.length&&(p.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,i){var n,r,s,a,o=i.attributes.lang||"text";return e[o]||(e[o]={language:o,default:!1,autoselect:!1,playlists:en([(n=i,s=n.attributes,a=n.segments,void 0===a&&(a=[{uri:s.baseUrl,timeline:s.periodIndex,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration),{attributes:(r={NAME:s.id,BANDWIDTH:s.bandwidth},r["PROGRAM-ID"]=1,r),uri:"",endList:"static"===(s.type||"static"),timeline:s.periodIndex,resolvedUri:s.baseUrl||"",targetDuration:s.duration,segments:a,mediaSequence:a.length?a[0].number:1})],t),uri:""}),e}),{})}(d,t)),p},sn=function(e,t,i){var n=e.NOW,r=e.clientOffset,s=e.availabilityStartTime,a=e.timescale,o=void 0===a?1:a,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,h=(n+r)/1e3+(void 0===c?0:c)-(s+l);return Math.ceil((h*o-t)/i)},an=function(e,t){for(var i=e.type,n=void 0===i?"static":i,r=e.minimumUpdatePeriod,s=void 0===r?0:r,a=e.media,o=void 0===a?"":a,u=e.sourceDuration,l=e.timescale,c=void 0===l?1:l,h=e.startNumber,d=void 0===h?1:h,p=e.periodIndex,f=[],m=-1,g=0;gm&&(m=b);var T=void 0;if(_<0){var S=g+1;T=S===t.length?"dynamic"===n&&s>0&&o.indexOf("$Number$")>0?sn(e,m,y):(u*c-m)/y:(t[S].t-m)/y}else T=_+1;for(var k=d+f.length+T,C=d+f.length;C=r?s:""+new Array(r-s.length+1).join("0")+s)}}(t))},ln=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,s=Xi({baseUrl:e.baseUrl,source:un(r.sourceURL,i),range:r.range});return function(e,t){return e.duration||t?e.duration?Yi(e):an(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t).map((function(t){i.Number=t.number,i.Time=t.time;var n=un(e.media||"",i);return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:lt(e.baseUrl||"",n),map:s,number:t.number}}))},cn=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!i&&!t||i&&t)throw new Error($i);var s,a=r.map((function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,s=Xi({baseUrl:i,source:r.sourceURL,range:r.range}),a=Xi({baseUrl:i,source:t.media,range:t.mediaRange});return a.map=s,a}(e,t)}));return i&&(s=Yi(e)),t&&(s=an(e,t)),s.map((function(e,t){if(a[t]){var i=a[t];return i.timeline=e.timeline,i.duration=e.duration,i.number=e.number,i}})).filter((function(e){return e}))},hn=function(e){var t,i,n=e.attributes,r=e.segmentInfo;r.template?(i=ln,t=ji(n,r.template)):r.base?(i=Qi,t=ji(n,r.base)):r.list&&(i=cn,t=ji(n,r.list));var s={attributes:n};if(!i)return s;var a=i(t,r.timeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/c}else a.length?t.duration=a.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return s.attributes=t,s.segments=a,r.base&&t.indexRange&&(s.sidx=a[0],s.segments=[]),s},dn=function(e,t){return Vi(e.childNodes).filter((function(e){return e.tagName===t}))},pn=function(e){return e.textContent.trim()},fn=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var i=t.slice(1),n=i[0],r=i[1],s=i[2],a=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(s||0)+3600*parseFloat(a||0)+60*parseFloat(o||0)+parseFloat(u||0)},mn={mediaPresentationDuration:function(e){return fn(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return fn(e)},suggestedPresentationDelay:function(e){return fn(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return fn(e)},start:function(e){return fn(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?fn(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},gn=function(e){return e&&e.attributes?Vi(e.attributes).reduce((function(e,t){var i=mn[t.name]||mn.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}},vn={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},yn=function(e,t){return t.length?Fi(e.map((function(e){return t.map((function(t){return lt(e,pn(t))}))}))):e},_n=function(e){var t=dn(e,"SegmentTemplate")[0],i=dn(e,"SegmentList")[0],n=i&&dn(i,"SegmentURL").map((function(e){return ji({tag:"SegmentURL"},gn(e))})),r=dn(e,"SegmentBase")[0],s=i||t,a=s&&dn(s,"SegmentTimeline")[0],o=i||r||t,u=o&&dn(o,"Initialization")[0],l=t&&gn(t);l&&u?l.initialization=u&&gn(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:a&&dn(a,"S").map((function(e){return gn(e)})),list:i&&ji(gn(i),{segmentUrls:n,initialization:gn(u)}),base:r&&ji(gn(r),{initialization:gn(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},bn=function(e,t,i){return function(n){var r=gn(n),s=yn(t,dn(n,"BaseURL")),a=dn(n,"Role")[0],o={role:gn(a)},u=ji(e,r,o),l=dn(n,"ContentProtection").reduce((function(e,t){var i=gn(t),n=vn[i.schemeIdUri];if(n){e[n]={attributes:i};var r=dn(t,"cenc:pssh")[0];if(r){var s=pn(r),a=s&&dt(s);e[n].pssh=a}}return e}),{});Object.keys(l).length&&(u=ji(u,{contentProtection:l}));var c=_n(n),h=dn(n,"Representation"),d=ji(i,c);return Fi(h.map(function(e,t,i){return function(n){var r=dn(n,"BaseURL"),s=yn(t,r),a=ji(e,gn(n)),o=_n(n);return s.map((function(e){return{segmentInfo:ji(i,o),attributes:ji(a,{baseUrl:e})}}))}}(u,s,d)))}},Tn=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,s=i.NOW,a=void 0===s?Date.now():s,o=i.clientOffset,u=void 0===o?0:o,l=dn(e,"Period");if(!l.length)throw new Error(Hi);var c=gn(e),h=yn([r],dn(e,"BaseURL"));return c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=a,c.clientOffset=u,Fi(l.map(function(e,t){return function(i,n){var r=yn(t,dn(i,"BaseURL")),s=gn(i),a=parseInt(s.id,10),o=ee.isNaN(a)?n:a,u=ji(e,{periodIndex:o}),l=dn(i,"AdaptationSet"),c=_n(i);return Fi(l.map(bn(u,r,c)))}}(c,h)))},Sn=function(e){if(""===e)throw new Error(qi);var t=(new Mi).parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null;if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(Wi);return i},kn=function(e,t){return void 0===t&&(t={}),rn(Tn(Sn(e),t).map(hn),t.sidxMapping)},Cn=function(e){return function(e){var t=dn(e,"UTCTiming")[0];if(!t)return null;var i=gn(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Gi)}return i}(Sn(e))},wn=function(e){return e>>>0},En=function(e){return("00"+e.toString(16)).slice(-2)},xn=wn,An=function(e){return new Date(1e3*e-20828448e5)},In=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Pn=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Ln=function(e,t){var i,n,r,s,a,o=[];if(!t.length)return null;for(i=0;i1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,s)):(a=Ln(e.subarray(i+8,s),t.slice(1))).length&&(o=o.concat(a))),i=s;return o},On=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4MALFORMED DATA");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},Dn={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:Ai(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,r,s=new DataView(e.buffer,e.byteOffset,e.byteLength),a={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,r=0;r>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:Pn(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:Ai(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:Ai(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=Ai(e.subarray(28))[0]),i},moof:function(e){return{boxes:Ai(e)}},moov:function(e){return{boxes:Ai(e)}},mvex:function(e){return{boxes:Ai(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=An(t.getUint32(i)),i+=8,n.modificationTime=An(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=An(t.getUint32(i)),i+=4,n.modificationTime=An(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:Ai(e)}},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(t=8;r;t+=4,r--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:Ai(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),s&&c&&(t={flags:In(e.subarray(h,h+4))},h+=4,a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);c--;)t={},a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(t.flags=In(e.subarray(h,h+4)),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}},Nn={inspect:Ai=function(e){for(var t,i,n,r,s,a=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c1?a+i:e.byteLength,(s=(Dn[n]||function(e){return{data:e}})(e.subarray(a+8,r))).size=i,s.type=n,o.push(s),a=r;return o},textify:Ii=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map((function(e,n){return i+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var n=i+" "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var s=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return s?1===s.length?n+"<"+s.join("").slice(1)+">":n+"<\n"+s.map((function(e){return i+" "+e})).join("\n")+"\n"+i+" >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map((function(e,t){return 0===t?e:i+" "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+Ii(e.boxes,t+1):"")})).join("\n")},parseType:Pn,findBox:Ln,parseTraf:Dn.traf,parseTfdt:Dn.tfdt,parseHdlr:Dn.hdlr,parseTfhd:Dn.tfhd,parseTrun:Dn.trun,parseSidx:Dn.sidx},Rn=wn,Un=En;Pi=function(e){return Nn.findBox(e,["moov","trak"]).reduce((function(e,t){var i,n,r,s,a;return(i=Nn.findBox(t,["tkhd"])[0])?(n=i[0],s=Rn(i[r=0===n?12:20]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),(a=Nn.findBox(t,["mdia","mdhd"])[0])?(r=0===(n=a[0])?12:20,e[s]=Rn(a[r]<<24|a[r+1]<<16|a[r+2]<<8|a[r+3]),e):null):null}),{})},Li=function(e,t){var i,n,r;return i=Nn.findBox(t,["moof","traf"]),n=[].concat.apply([],i.map((function(t){return Nn.findBox(t,["tfhd"]).map((function(i){var n,r;return n=Rn(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,(Nn.findBox(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=Rn(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Rn(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0]||1/0)/r}))}))),r=Math.min.apply(null,n),isFinite(r)?r:0},Oi=function(e,t){var i,n=Nn.findBox(t,["moof","traf"]),r=0,s=0;if(n&&n.length)for(var a=Nn.parseTraf(n[0]),o=0;o11?(r.codec+=".",r.codec+=Un(c[9]),r.codec+=Un(c[10]),r.codec+=Un(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)&&(c=h.subarray(28),"esds"===Nn.parseType(c.subarray(4,8))&&c.length>20&&0!==c[19]?(r.codec+="."+Un(c[19]),r.codec+="."+Un(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"))}var d=Nn.findBox(e,["mdia","mdhd"])[0];if(d&&s){var p=0===n?12:20;r.timescale=Rn(d[p]<<24|d[p+1]<<16|d[p+2]<<8|d[p+3])}i.push(r)})),i};var Mn={findBox:Nn.findBox,parseType:Nn.parseType,timescale:Pi,startTime:Li,compositionStartTime:Oi,videoTrackIds:Di,tracks:Ni},Bn=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t-1)},this.trigger=function(t){var i,n,r,s;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Kn();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Kn();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Kn()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))s=Gn((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),s=Gn((n=(3&n)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var a=Xn.indexOf(7968&t);"rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),s=Gn(n),s+=Gn(r),this[this.mode_](e.pts,s),this.column_+=s.length)}else this.lastControlCode_=null}};Yn.prototype=new Wn,Yn.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return console.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Yn.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Kn(),this.nonDisplayed_=Kn(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Yn.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Yn.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Yn.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Yn.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Yn.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Yn.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},Yn.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Yn.prototype.isNormalChar=function(e){return e>=32&&e<=127},Yn.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Kn(),this.displayed_=Kn()),void 0!==t&&t!==this.row_)for(var i=0;i"}),"");this[this.mode_](e,i)},Yn.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+""}),"");this.formatting_=[],this[this.mode_](e,t)}},Yn.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},Yn.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},Yn.prototype.shiftRowsUp_=function(){var e;for(e=0;e0?Nn.parseTfdt(l[0]).baseMediaDecodeTime:0,h=Mn.findBox(s,["trun"]);t===u&&h.length>0&&(i=function(e,t,i){var n,r,s,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(r=0;r+40;){var u=t.shift();this.parse(u,s,a)}return null!==(o=function(e,t,i){return null===t?null:{seiNals:er(e,t)[t],timescale:i}}(e,i,n))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;s?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},ir=27,nr=15,rr=21,sr=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},ar=function(e){var t,i;ar.prototype.init.call(this),this.type_=e||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=sr(e.dts,i),e.pts=sr(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ar.prototype=new Wn;var or,ur,lr,cr,hr=function(e){var t=31&e[1];return t<<=8,t|=e[2]},dr=function(e){return!!(64&e[1])},pr=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},fr=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},mr={parseType:function(e,t){var i=hr(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=dr(e),i=4+pr(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=dr(e),n=4+pr(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var s=12+((15&e[n+10])<<8|e[n+11]);s=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+pr(e),i=e.subarray(t),n=0,r=0,s=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===fr(31&i[r+3])&&(s=!0),s}},gr=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],vr=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},yr={isLikelyAacData:function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},parseId3TagSize:function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=vr(e.subarray(10,14)));do{if((i=vr(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return a*=4,a+=3&s[7]}break}}t+=10,t+=i}while(t=0;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(n=e.subarray(o,u),Tr.ts.parseType(n,t.pid)){case"pes":r=Tr.ts.parsePesType(n,t.table),s=Tr.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(a=Tr.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),l=!0)}if(l)break;o-=188,u-=188}},Cr=function(e,t,i){for(var n,r,s,a,o,u,l,c=0,h=188,d=!1,p={data:[],size:0};h=0;)if(71!==e[c]||71!==e[h])c--,h--;else{switch(n=e.subarray(c,h),Tr.ts.parseType(n,t.pid)){case"pes":r=Tr.ts.parsePesType(n,t.table),s=Tr.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(a=Tr.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),d=!0)}if(d)break;c-=188,h-=188}},wr=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=188;r=3;){switch(Tr.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=Tr.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=Tr.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=Tr.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=Tr.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===r||null===s)return null;var u=Sr/r;return{audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*n*u,pts:s+1024*n*u}]}}(e):wr(e))&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;void 0===i&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=br(e.dts,i),e.pts=br(e.pts,i),e.dtsTime=e.dts/Sr,e.ptsTime=e.pts/Sr}))}if(e.video&&e.video.length){var n=t;if(void 0===n&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=br(e.dts,n),e.pts=br(e.pts,n),e.dtsTime=e.dts/Sr,e.ptsTime=e.pts/Sr})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=br(r.dts,n),r.pts=br(r.pts,n),r.dtsTime=r.dts/Sr,r.ptsTime=r.dts/Sr}}}(i,t),i):null};var xr=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ar=function(){function e(e,t){for(var i=0;i>7))^s]=s;for(a=o=0;!n[a];a^=c||1,o=l[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[a]=d,r[d]=a,f=16843009*u[h=u[c=u[a]]]^65537*h^257*c^16843008*a,p=257*u[d]^16843008*d,s=0;s<4;s++)t[s][a]=p=p<<24^p>>>8,i[s][d]=f=f<<24^f>>>8;for(s=0;s<5;s++)t[s]=t[s].slice(0),i[s]=i[s].slice(0);return e}()),this._tables=[[Ir[0][0].slice(),Ir[0][1].slice(),Ir[0][2].slice(),Ir[0][3].slice(),Ir[0][4].slice()],[Ir[1][0].slice(),Ir[1][1].slice(),Ir[1][2].slice(),Ir[1][3].slice(),Ir[1][4].slice()]];var i=void 0,n=void 0,r=void 0,s=void 0,a=void 0,o=this._tables[0][4],u=this._tables[1],l=t.length,c=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");for(s=t.slice(0),a=[],this._key=[s,a],i=l;i<4*l+28;i++)r=s[i-1],(i%l==0||8===l&&i%l==4)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],i%l==0&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7))),s[i]=s[i-l]^r;for(n=0;i;n++,i--)r=s[3&n?i:i-4],a[n]=i<=4||n<4?r:u[0][o[r>>>24]]^u[1][o[r>>16&255]]^u[2][o[r>>8&255]]^u[3][o[255&r]]}return e.prototype.decrypt=function(e,t,i,n,r,s){var a=this._key[1],o=e^a[0],u=n^a[1],l=i^a[2],c=t^a[3],h=void 0,d=void 0,p=void 0,f=a.length/4-2,m=void 0,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],T=v[3],S=v[4];for(m=0;m>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^a[g],d=y[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^a[g+1],p=y[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^a[g+2],c=y[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^a[g+3],g+=4,o=h,u=d,l=p;for(m=0;m<4;m++)r[(3&-m)+s]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^a[g++],h=o,o=u,u=l,l=c,c=h},e}(),Lr=function(){function e(){xr(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},e.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n>8|e>>>24},Nr=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new Pr(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),a=new Int32Array(s.buffer),o=void 0,u=void 0,l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0;for(o=i[0],u=i[1],l=i[2],c=i[3],m=0;m0?o:0)}if(ee.console){var u=ee.console[i];u||"debug"!==i||(u=ee.console.info||ee.console.log),u&&s&&a.test(i)&&u[Array.isArray(r)?"apply":"call"](ee.console,r)}}}(t,r),r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return Ur?[].concat(Ur):[]}).filter=function(e){return(Ur||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},r.history.clear=function(){Ur&&(Ur.length=0)},r.history.disable=function(){null!==Ur&&(Ur.length=0,Ur=null)},r.history.enable=function(){null===Ur&&(Ur=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters")}function Xr(){return ne===ee.document}function Kr(e){return qr(e)&&1===e.nodeType}function Yr(){try{return ee.parent!==ee.self}catch(e){return!0}}function Qr(e){return function(t,i){if(!$r(t))return ne[e](null);$r(i)&&(i=ne.querySelector(i));var n=Kr(i)?i:ne;return n[e]&&n[e](t)}}function Jr(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=ne.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Mr.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?Zr(r,i):r[e]!==i&&(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&ys(r,n),r}function Zr(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function es(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ts(e,t){return Gr(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function is(e,t){return e.classList?e.classList.add(t):ts(e,t)||(e.className=(e.className+" "+t).trim()),e}function ns(e,t){return e.classList?e.classList.remove(t):(Gr(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function rs(e,t,i){var n=ts(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?is(e,t):ns(e,t),e}function ss(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function as(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var s=n[r].name,a=n[r].value;"boolean"!=typeof e[s]&&-1===i.indexOf(","+s+",")||(a=null!==a),t[s]=a}return t}function os(e,t){return e.getAttribute(t)}function us(e,t,i){e.setAttribute(t,i)}function ls(e,t){e.removeAttribute(t)}function cs(){ne.body.focus(),ne.onselectstart=function(){return!1}}function hs(){ne.onselectstart=function(){return!0}}function ds(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(zr(e,"height"))),i.width||(i.width=parseFloat(zr(e,"width"))),i}}function ps(e){var t;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=ne.documentElement,n=ne.body,r=i.clientLeft||n.clientLeft||0,s=ee.pageXOffset||n.scrollLeft,a=t.left+s-r,o=i.clientTop||n.clientTop||0,u=ee.pageYOffset||n.scrollTop,l=t.top+u-o;return{left:Math.round(a),top:Math.round(l)}}function fs(e,t){var i={},n=ps(e),r=e.offsetWidth,s=e.offsetHeight,a=n.top,o=n.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(a-u+s)/s)),i.x=Math.max(0,Math.min(1,(l-o)/r)),i}function ms(e){return qr(e)&&3===e.nodeType}function gs(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function vs(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),Kr(e)||ms(e)?e:"string"==typeof e&&/\S/.test(e)?ne.createTextNode(e):void 0})).filter((function(e){return e}))}function ys(e,t){return vs(t).forEach((function(t){return e.appendChild(t)})),e}function _s(e,t){return ys(gs(e),t)}function bs(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}var Ts,Ss=Qr("querySelector"),ks=Qr("querySelectorAll"),Cs=Object.freeze({__proto__:null,isReal:Xr,isEl:Kr,isInFrame:Yr,createEl:Jr,textContent:Zr,prependTo:es,hasClass:ts,addClass:is,removeClass:ns,toggleClass:rs,setAttributes:ss,getAttributes:as,getAttribute:os,setAttribute:us,removeAttribute:ls,blockTextSelection:cs,unblockTextSelection:hs,getBoundingClientRect:ds,findPosition:ps,getPointerPosition:fs,isTextNode:ms,emptyEl:gs,normalizeContent:vs,appendContent:ys,insertContent:_s,isSingleLeftClick:bs,$:Ss,$$:ks}),ws=!1,Es=function(){if(Xr()&&!1!==Ts.options.autoSetup){var e=Array.prototype.slice.call(ne.getElementsByTagName("video")),t=Array.prototype.slice.call(ne.getElementsByTagName("audio")),i=Array.prototype.slice.call(ne.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,s=n.length;r-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function Vs(e,t,i){if(Rs.has(e)){var n=Rs.get(e);if(n.handlers){if(Array.isArray(t))return Ms(Vs,e,t,i);var r=function(e,t){n.handlers[t]=[],Us(e,t)};if(void 0!==t){var s=n.handlers[t];if(s)if(i){if(i.guid)for(var a=0;a=t&&(e.apply(void 0,arguments),i=n)}},Ks=function(){};Ks.prototype.allowedEvents_={},Ks.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Fs(this,e,t),this.addEventListener=i},Ks.prototype.addEventListener=Ks.prototype.on,Ks.prototype.off=function(e,t){Vs(this,e,t)},Ks.prototype.removeEventListener=Ks.prototype.off,Ks.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},qs(this,e,t),this.addEventListener=i},Ks.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Ws(this,e,t),this.addEventListener=i},Ks.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Bs(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Hs(this,e)},Ks.prototype.dispatchEvent=Ks.prototype.trigger,Ks.prototype.queueTrigger=function(e){var t=this;zs||(zs=new Map);var i=e.type||e,n=zs.get(this);n||(n=new Map,zs.set(this,n));var r=n.get(i);n.delete(i),ee.clearTimeout(r);var s=ee.setTimeout((function(){0===n.size&&(n=null,zs.delete(t)),t.trigger(e)}),0);n.set(i,s)};var Ys=function(e){return e instanceof Ks||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},Qs=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Js=function(e){if(!e.nodeName&&!Ys(e))throw new Error("Invalid target; must be a DOM node or evented object.")},Zs=function(e){if(!Qs(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ea=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},ta=function(e,t){var i,n,r,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(i=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],r=t[1]):(i=t[0],n=t[1],r=t[2]),Js(i),Zs(n),ea(r),{isTargetingSelf:s,target:i,type:n,listener:r=Gs(e,r)}},ia=function(e,t,i,n){Js(e),e.nodeName?$s[t](e,i,n):e[t](i,n)},na={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Rs.has(this.el_)&&Rs.delete(this.el_),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=la(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return Jr(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],a=n&&n.split("-")[0],o=r&&r[a],u=i;return s&&s[e]?u=s[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r}))),u},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[ua(e.name())]=null,this.childNameIndex_[oa(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,s=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||ua(t.name));return i&&!s.isTech(i)})).forEach((function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var s=t.addChild(i,n);s&&(t[i]=s)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return Ss(e,t||this.contentEl())},t.$$=function(e,t){return ks(e,t||this.contentEl())},t.hasClass=function(e){return ts(this.el_,e)},t.addClass=function(e){is(this.el_,e)},t.removeClass=function(e){ns(this.el_,e)},t.toggleClass=function(e,t){rs(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return os(this.el_,e)},t.setAttribute=function(e,t){us(this.el_,e,t)},t.removeAttribute=function(e){ls(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+ua(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=zr(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var i="offset"+ua(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=ee.performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}}));var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){(i=null,!0===e)&&(ee.performance.now()-t<200&&(n.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Gs(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n=this;return e=Gs(this,e),this.clearTimersOnDispose_(),i=ee.setTimeout((function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),ee.clearTimeout(e)),e},t.setInterval=function(e,t){e=Gs(this,e),this.clearTimersOnDispose_();var i=ee.setInterval(e,t);return this.setIntervalIds_.add(i),i},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),ee.clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=Gs(this,e),t=ee.requestAnimationFrame((function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),ee.cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var i=t[0],n=t[1];e[i].forEach(e[n],e)})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),s=r&&r.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(s||!a)throw n=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=ua(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[oa(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();ca.prototype.supportsRaf_="function"==typeof ee.requestAnimationFrame&&"function"==typeof ee.cancelAnimationFrame,ca.registerComponent("Component",ca);var ha,da=ee.navigator&&ee.navigator.userAgent||"",pa=/AppleWebKit\/([\d.]+)/i.exec(da),fa=pa?parseFloat(pa.pop()):null,ma=/iPod/i.test(da),ga=(ha=da.match(/OS (\d+)_/i))&&ha[1]?ha[1]:null,va=/Android/i.test(da),ya=function(){var e=da.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),_a=va&&ya<5&&fa<537,ba=/Firefox/i.test(da),Ta=/Edg/i.test(da),Sa=!Ta&&(/Chrome/i.test(da)||/CriOS/i.test(da)),ka=function(){var e=da.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Ca=function(){var e=/MSIE\s(\d+)\.\d/.exec(da),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(da)&&/rv:11.0/.test(da)&&(t=11),t}(),wa=/Safari/i.test(da)&&!Sa&&!va&&!Ta,Ea=/Windows/i.test(da),xa=Xr()&&("ontouchstart"in ee||ee.navigator.maxTouchPoints||ee.DocumentTouch&&ee.document instanceof ee.DocumentTouch),Aa=/iPad/i.test(da)||wa&&xa&&!/iPhone/i.test(da),Ia=/iPhone/i.test(da)&&!Aa,Pa=Ia||Aa||ma,La=(wa||Pa)&&!Sa,Oa=Object.freeze({__proto__:null,IS_IPOD:ma,IOS_VERSION:ga,IS_ANDROID:va,ANDROID_VERSION:ya,IS_NATIVE_ANDROID:_a,IS_FIREFOX:ba,IS_EDGE:Ta,IS_CHROME:Sa,CHROME_VERSION:ka,IE_VERSION:Ca,IS_SAFARI:wa,IS_WINDOWS:Ea,TOUCH_ENABLED:xa,IS_IPAD:Aa,IS_IPHONE:Ia,IS_IOS:Pa,IS_ANY_SAFARI:La});function Da(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function Na(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Da.bind(null,"start",0,e),end:Da.bind(null,"end",1,e)}}function Ra(e,t){return Array.isArray(e)?Na(e):void 0===e||void 0===t?Na():Na([[e,t]])}function Ua(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=Ra(0,0));for(var s=0;st&&(n=t),r+=n-i;return r/t}for(var Ma,Ba={prefixed:!0},ja=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],Fa=ja[0],Va=0;Va=0;n--)if(t[n].enabled){Za(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}ae(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&Za(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,Za(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(Qa),to=function(e,t){for(var i=0;i=0;n--)if(t[n].selected){to(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(se(i),"selectedIndex",{get:function(){for(var e=0;e',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),ne.body.appendChild(n));for(var s={},a=0;ax',e=t.firstChild.href}return e},fo=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},mo=function(e,t){void 0===t&&(t=ee.location);var i=ho(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},go=Object.freeze({__proto__:null,parseUrl:ho,getAbsoluteURL:po,getFileExtension:fo,isCrossOrigin:mo}),vo=function(e,t){var i=new ee.WebVTT.Parser(ee,ee.vttjs,ee.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(ee.console&&ee.console.groupCollapsed&&ee.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return Mr.error(e)})),ee.console&&ee.console.groupEnd&&ee.console.groupEnd()),i.flush()},yo=function(e,t){var i={uri:e},n=mo(e);n&&(i.cors=n),de(i,Gs(this,(function(e,i,n){if(e)return Mr.error(e,i);t.loaded_=!0,"function"!=typeof ee.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return vo(n,t);Mr.error("vttjs failed to load, stopping trying to process "+t.src)})):vo(n,t)})))},_o=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=la(t,{kind:uo[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=lo[n.mode]||"disabled",s=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var a=new so(i.cues_),o=new so(i.activeCues_),u=!1,l=Gs(se(i),(function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)}));return"disabled"!==r&&i.tech_.ready((function(){i.tech_.on("timeupdate",l)}),!0),Object.defineProperties(se(i),{default:{get:function(){return s},set:function(){}},mode:{get:function(){return r},set:function(e){var t=this;lo[e]&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||yo(this.src,this),"disabled"!==r?this.tech_.ready((function(){t.tech_.on("timeupdate",l)}),!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?a:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var s=0;s0)return void this.trigger("vttjsloaded");var t=ne.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),ee.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var s=function(){return e.trigger("texttrackchange")},a=function(){s();for(var e=0;e=0;r--){var s=e[r];s[t]&&s[t](n,i)}}(e,i,o,a),o}var Oo={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1},Do={setCurrentTime:1,setMuted:1,setVolume:1},No={play:1,pause:1};function Ro(e){return function(t,i){return t===Io?Io:i[e]?i[e](t):t}}var Uo={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Mo=function(e){void 0===e&&(e="");var t=fo(e);return Uo[t.toLowerCase()]||""};function Bo(e){if(!e.type){var t=Mo(e.src);t&&(e.type=t)}return e}var jo=function(e){function t(t,i,n){var r,s=la({createEl:!1},i);if(r=e.call(this,t,s,n)||this,i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var a=0,o=i.playerOptions.techOrder;a