From ff380b704fdfefe0b4aab356181c0c5ee2dcd4dd Mon Sep 17 00:00:00 2001 From: Will Kelly Date: Tue, 23 Jan 2024 16:33:04 -0600 Subject: [PATCH] adjust resource idenitfier for app and add distinct player for app --- android/app/build.gradle | 4 +- .../main/java/com/slbible/MainActivity.java | 2 +- android/app/src/main/res/values/strings.xml | 8 +- biome.json | 8 +- capacitor.config.ts | 4 +- index.html | 4 +- ios/App/App.xcodeproj/project.pbxproj | 4 +- ios/App/App/Info.plist | 2 +- package.json | 2 +- public/brightcove/dotPlayer.js | 120 ++++++++++++++++++ public/brightcove/willPlayer.js | 114 ----------------- src/pages/Playlist.tsx | 4 +- 12 files changed, 145 insertions(+), 131 deletions(-) create mode 100644 public/brightcove/dotPlayer.js delete mode 100644 public/brightcove/willPlayer.js diff --git a/android/app/build.gradle b/android/app/build.gradle index c5656c2..91088f2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,10 +1,10 @@ apply plugin: 'com.android.application' android { - namespace "com.slbible" + namespace "com.slbible.dotapp" compileSdkVersion rootProject.ext.compileSdkVersion defaultConfig { - applicationId "com.slbible" + applicationId "com.slbible.dotapp" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 diff --git a/android/app/src/main/java/com/slbible/MainActivity.java b/android/app/src/main/java/com/slbible/MainActivity.java index 6032755..e1852a0 100644 --- a/android/app/src/main/java/com/slbible/MainActivity.java +++ b/android/app/src/main/java/com/slbible/MainActivity.java @@ -1,4 +1,4 @@ -package com.slbible; +package com.slbible.dotapp; import com.getcapacitor.BridgeActivity; diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 8fed4c9..23a8a51 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ - WA Sign Bibles - WA Sign Bibles - com.slbible - com.slbible + Sign Language Bibles + Sign Language Bibles + com.slbible.dotapp + com.slbible.dotapp diff --git a/biome.json b/biome.json index 6ff3623..1729069 100644 --- a/biome.json +++ b/biome.json @@ -13,7 +13,13 @@ }, "files": { "include": ["src/**/*"], - "ignore": ["node_modules", "bcApi.ts", "tests", "playwright.config.ts"] + "ignore": [ + "node_modules", + "bcApi.ts", + "tests", + "playwright.config.ts", + "dotPlayer.js" + ] }, "linter": { "enabled": true, diff --git a/capacitor.config.ts b/capacitor.config.ts index 2617f01..0936e90 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -1,8 +1,8 @@ import { CapacitorConfig } from "@capacitor/cli"; const config: CapacitorConfig = { - appId: "com.slbible", - appName: "WA Sign Bibles", + appId: "com.slbible.dotapp", + appName: "Sign Language Bibles", webDir: "dist", server: { androidScheme: "https", diff --git a/index.html b/index.html index 347f157..6a9e770 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - WA Sign Bibles + Sign Language Bibles @@ -33,7 +33,7 @@
- + diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index ef8e52e..5ca8331 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -367,7 +367,7 @@ ); MARKETING_VERSION = 1.0; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; - PRODUCT_BUNDLE_IDENTIFIER = com.slbible; + PRODUCT_BUNDLE_IDENTIFIER = com.slbible.dotapp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 5.0; @@ -391,7 +391,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.slbible; + PRODUCT_BUNDLE_IDENTIFIER = com.slbible.dotapp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; SWIFT_VERSION = 5.0; diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist index 0b23738..2927ca3 100644 --- a/ios/App/App/Info.plist +++ b/ios/App/App/Info.plist @@ -6,7 +6,7 @@ CFBundleDevelopmentRegion en CFBundleDisplayName - WA Sign Bibles + Sign Language Bibles CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/package.json b/package.json index c735e65..d5372e9 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "vitest": "^0.34.6" }, "lint-staged": { - "*": "biome check --apply" + "*": "biome check --apply --verbose src/**/* src/" }, "description": "WA Sign language bibles app" } diff --git a/public/brightcove/dotPlayer.js b/public/brightcove/dotPlayer.js new file mode 100644 index 0000000..70ec4aa --- /dev/null +++ b/public/brightcove/dotPlayer.js @@ -0,0 +1,120 @@ +(function(t,i){if(typeof define==="function"&&define.amd){define("bc",[],function(){var e=i.apply(this,arguments);t.videojs.log.warn("DEPRECATION: Using the default named RequireJS module in the Brightcove Player is deprecated. See: https://support.brightcove.com/requirejs-and-brightcove-player#Future_implementation");return e})}else if(typeof exports==="object"){module.exports=i()}else{t.bc=i(t)}})(this,function(e){var t='.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-control:focus .vjs-svg-icon,.vjs-svg-icon:hover{filter:drop-shadow(0 0 .25em #fff)}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABUgAAsAAAAAItAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV33Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADwwAABdk9R/WHmhlYWQAABGcAAAAKwAAADYn8kSnaGhlYQAAEcgAAAAdAAAAJA+RCL1obXR4AAAR6AAAABMAAAC8Q44AAGxvY2EAABH8AAAAYAAAAGB7SIHGbWF4cAAAElwAAAAfAAAAIAFAAI9uYW1lAAASfAAAASUAAAIK1cf1oHBvc3QAABOkAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7xDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADbZCycAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1gUV5auc6urCmxEGrq6VRD6ATQP5dHPKK8GRIyoKApoEBUDAiGzGmdUfKNRM4qLZrUZdGKcGN/GZJKd0SyOWTbfbmZ2NxqzM5IxRtNZd78vwYlJdtREoO7sudVNq6PmmxmKqrqPU+eee173P80Bh39Cu9DOEY4DHZBK3i20D/QRLcfxbE5sEVtwLpZzclw4ibFIkSCJUcZ4MBpMnnzwuKNsGWBL5i3qy6kO2dVpvUpKbkAP9fq62rdeGJ+TM/7C1nbIutfuWrWk5ci4zMxxR1qW/N+9JsmCGXj9VKWhFx/6tr/nz78INDm2C9yPF/fDcxLuyKxLBZ1ZBz2QTi+RSkiH5RrDQJ/GgGQadX9m0YSURs7GpSG905Zsk41uj14yul1OtieZ7QUk5GRG/YiS7PYYPSAZNRed9sq3+bOpz00rKb7pe/ZEZvbALxZAHT3AFoH8GXP3rt67QFn40kt8W13FjLTDb48c+fSi5/7h0P4dL5yz7DPtbmgmYxfQA9RL2+EOfTcvdp+1vmuBpvOll1As1S6ak0IvJzC7sKWJFtJgBd2uWcg+0Zyg7dzQfhcjXRgXGZRf5/a4A58IDU777Nl252AUk4m2ByRRjqTNqIDCEJeAnU3iCFwrkrNwXEzg4yFevBwypzxkcX+AIfk3VEKl3XmWbT8788SzvpvFJaiOezL6QyuSr9VNf97csNu0z3LuhR0wATUxZAfVBwVOy+nQFhxYdWaXlXe4HC4zWGWzzsrLDtmhI9pOWOHv7PTT7XybH1Z0+v2d5Abd3kmG+TsH23CS/KwTxx/JkzEwx6jcQOUc42LLwHJ/J93uZ9ygh3HuZGwqsY9dWDHQ58dxNqyqKRQTYdxwTubiOSs3FiMDkq0WSZQgCT0GBDOg2lxOAd1FlPVGs4AKBAcYHHaP2wPkHaivmLF5zYqnIZrvcHx5gN4k/6tchNW1DtdgNL2KrxEkS/kfnIHoVnp1VjmjpTf5r0lTzLj0mdS28tX+XGorU364eMPmnWVl8J36nlKGw3CZhjEiuMw8h8mKvhGD+4/lElBWjAhLJMg6fTw4zPZ8cOmcGQBm2Qxml1nAm13CpYGq1JKUlJJUzQn1PTAO0mgv6VMMpA/DuRfSWEu4lDIxdbAtdWIKvnn2Vk766CWfz9fpY0sH/UpdP50rfszaVpdVRmvIejEdLMk45s4Bu0EWHjeOySmFyZSiMahvZdNSn29peoI/YexYfKQTLeurTXXwEVLeSfInTWHkkMaeUx7sBvOCSTSj3AlcKjfueyS36tCrXDlgRtF0etFq9jhc1kfKuBT/OwMr0F4UUTTh1AN0g20+H/ScPcsIEsYu9d/zN5PmjprPtNwI1ZZcDK6iC97Mcjp2y2aX36f+QbpGHrgRuHlXJ+Zf6PFRL2uQSp8vxHeF2IoRb8Rd2rhMzsNxSRmEuKK4JFnkojhMcx6jzqHzGMGFcW+MhBj0bhf6cowN+45I4LHvwT6fteu7M42wGRI/pxcg6/MZdEvt1U1XaulHFXuLmqov/MukvRVL35/b3ODM1+4aPjtzeK7zmUkV2h3DN54HaQ9GzJvxHRb6Ks2gB81fwqraT+A7GvZJrRLRofU6G0urNL+zFw3v0FaVDFxsKEZW56F31r6ip6vOL+FCObBPuIMRiXld9RaMdLzRIOGhPey2T9vA/35DmZPK9IWaT9d/WgOGMieYqJ/dzjLIhZU118gbysxrNUGefxD6UO/hyNNllpFTOIbx32kSFQctnweV5PxTMHLjRqiAN+fQE9gL+Xy5WB6MOS4GJJuYbDUHhcKDhHGRbLzOpjsjdM1+iwAZLGeieehACX2hhI7SjK/ZUTNrvVje31TxJiFBGYViWFkCn9PMeX9fS6qVbzfCj4fOCTzDnuWy2c4xA7mdNkA3RS9FH2VeqzdCBlixxbzXjvkHU1I8BOYFb1pZvPIHSSIj4svT8xpzcxtXN+ZKyjdDvbz08niiF3PqV9Tn5NST8vg48MTaY8E5xqSSIsWoWHo+LtAzxdH/GDUyp37CBEYfso04F/NlMTcDJUTpECLY0HFGQHImE8xsEUdgnrQlixIvGhJA1BvxpDHGxEMBYFeNOHcBJlSjwe2JcSfbBEsGOPPBHg/6SBBOCsLLw0SpUxod0Z1bFMfLkbQ3UiZxEyd0Dx8t+SRBu18Q9msFbI4e3p1THEfkSEh7kEJ5orR10qTWDvbgPWn5aWvCYyOAjwgXyjJi34uMjo58L25cmRAeQZWI2PA1QQLsPESAH8WGFwZZ4SPoR73BHPzIPMJj9AreBzKUmrH4todT18ANvi1oc3YGjUT/0j+ExUwq8PI9BLaCQIpvewwYu2evAG/Vo/5avPdY7o+BemLLXw3y+AdkzP9bpIxB1wm5EYq8fesHbPEPtm6HrHvtx4jcGPR8fDDpkZBefIjB46QnlUNRltv4Z/pO/J6dxEjhYAtmoMeq+GozvUVvNYOW3m6GCIhoprcfr97B8AcIQYsfD8ljUvGNjvkrpj0ETA48ZMIxCeqsRIsQALE0gi2GB+glSOfbOjW3GSBM9yPq8/rpJXrJDz0BPxV6xdN4uiCGDQed3WhgFkBUZEFsmeyyBpzXrm7UGTBZG8Lh5aubFufk5eUsbrrFGr7McYdbltxa0nKYqRKbQjvikXYkTGM0f2xuyM3Ly21oXnWfvf6I1BmZwfh7EWWIYsg2nHhsDhOnczhJcmI6eBAmy3jZ3RiJmKQR/JA99FcwsfaVbNDDyi1rL9NPj9hfo61wjM6BjzOLijLpeTgk/pL+ip6tfYWupzeOgPny2tcUu9J/9mhxJlgyi985NFRbvCVewXUNXLJaW0RxZqtRYtnfYdcYomXQWdnJHQA3jiEEkeTQWcWxdDP9IvvVWvo2TK553XEMEq+s69/QDU1Q7p0zxwsm9qS379whr8NI2PJqLUyGyfNeX3eFfnJU2U+uHR9cVV1IqgurqwuV44XVp0h2qN55X5XJwtk59yP0IZuHrqBOBIuIYhkcoT6Kx79Pu2HS/IPZIMOqLWs/pteOOk4NPgEb6QAIdAPsyZk5Mwd+wVaHMexJv719W7xCu2l37UG6lvYdBcvHa08p89741zd63phTRGqL5ggo6SlvdbWXzCqsPq78NnSu7wnKy2HNZbVoRCI7UJEOyRj+sPE002tOOY7Qa5fXboFWkLNeqYUSZRocp9XwSUZxcQZ9Hw6LV2pOoVmvHQEDbGIENEG5i6bLgMSM4n8+FNLTtAds99DaWEvgcf4o5SyYe9x+kF6/tGoTPAdRmS/XQIEy//QxKC2oqioAI3tS5auvxCtzT6y6RK8fhChYcwCJaMJhxc0vqSxQ/qmgsrKAlBZUHlauheTpvd9uj5DnLzJct6qfq5fXbYHVIGcfrIVJihbaVLu1wW7Vbs8zK0A8e9Jvb91S9cVMjPrazD6gpfeZTXzYbCFMcppVRsGMpp55OWgx1/3JeAxW1Y7AORgM/m3rWrsdLkQVmEVSU16cX/e7uvkvpqRiQsG06XJ0t64Tf+l0nG1dt025gyOIZlvq5u9KSU1N2TW/rsWnnMRPyTDkctbhvIcNvYIXWyLzdwYLoYesUbaQG4iK2cWO2gdpeUYLqDD0MUTOPhDIGnZEs58yArR86FznuWEsU4YDi2x26dA4klkn8Qa6vhk2QUfX4Jxm/ngX9r7ogn1dmlmwqZmuhxtdg9XN/DEcUgqb+9hMyNansfaQET2mcROCmGEMVqxm5u+h6kN2MOwgqykV2wH9yQG9DvVFU38Pogaf4FVuE62KI/oJ02RDdWW2w5dqQwU/8+N1q1DlvsL863u61KLE7x/o8w0VJQM/Y/SQ3unIrqxueEa1BqT5VFNsO7p39/UC771a77RowpaKe9nvJQIT1Pog5LGx8XblBKmCNGTf3xMogAQvPnz9PYKX/08sVDTG1OKUlOLUgS/UaZtm1NAaYTsl7i9ZQ+L6O4Rl0OGa577LuWvc+C+x96/vYh0lLBuM+7XwI/dTLtdT7v4d6rRTWDnku0IBrqFnZ5bVIqKP8lasJlithWnaLhTsr8qFJBulF/70p4undou36HeTJ5+jv1fCybeQ8nH3+Xv6aENczmOFlab+hqMDg1rLOt12A+tiUFrYDwQ6c3RUJp601nzegTNX6WlYAI2zSUV945F6zU56ZmZVQaWspWcIADxJ9GmljQUnL2p2Dpr5T8H+5KJFu+vqBq8qvyHRzStLHPEO5SPYCV9nZe0yZT2RcH0oHvegSzNEJ0oGWU8iQWM12dgPEugngVceGIwZgPFp0BiT1a0a3R5Rcot7ihfA1J/20v96jX7zmTX9s583H0kwx6WnLd09cXrR9LGroOa9sHNbdyz8wcKk5lqhaVFJZNwmqtw884MXNdvJujpBa3xzuSaZH9sxa06Z7x+HJSduPbdYHv/DgmEhfbehvlmGN7JUkcG78GDM12CeyFFTPNqVeNxC1gzjz+c2nVo63Xxs8rKJWXoBJM0tmEbfGm4qzpoOH3xpzQfyxLzW1gnE9NHo6tol1eMEic4ZVPrjnVi0kqAe2sQ2bgqupScaq8WGlUWgWHI51SKJl/UYT6zccNsCSkBtiVZLsiefuFSDYT3Fi8Zk7EUnmjTRYtsFeuDDJS05MW79M3mr3mla+d8dzac31KTPmBYfFiYSUef48PhPjm9ryZsSGZZkdNvzq0Y9rdNcwDq5Dg5C3QW+7UN64IKptvS3tvHbvu5c9pv1Exau21rc9LIpwpQwUjTq8576yeVDz5+4WZ1nXT43wV60rPLJbDp/UksNrP3iQ2SA63Pst058gOYDbhRnRUw8l/sRt4HbxPzO4WYpInCpuVgSbVh6JXuwnnJngKTTCwaPWmG5Xbhpm1U0Yt3FyBGpGYemPM77p2TD904JjgJ2QFpFLeYpGx8X15Qx1Zk31p5ki9ZLUuXE0lmuJlcakJMVLeFS1iIvrB8drY0aloilakqCZwzwRORtxlgwxS4IThggJd4TDxoiaAIT80fFPGrCPPru+puFn504P/ybr4ihA/6dKASLshEJic7xE8tmzu3KzA7TABBe8y5fNbWo3ilQn/SuFKM16b2l5bOeayqfGhYmhIulU+fVNDdWVv4NMzX10MBHyPR5uhWUu8D9P1VnIMt4nGNgZGBgAOJ/1bf64vltvjJwszOAwAOlmqvINEc/WJyDgQlEAQA+dgnjAHicY2BkYGBnAAGOPgaG//85+hkYGVCBPgBGJwNkAAAAeJxjYGBgYB/EmKMPtxwAhg4B0gAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAe4CLgKKAtAC/ANiA4wDqAPgBDAEsATaBQgFWgXABggGLgZwBqwG9gdOB4oH0ggqCHAIhgicCMgJJAlWCYgJrAnyCkAKdgrkC7J4nGNgZGBg0GdoZmBnAAEmIOYCQgaG/2A+AwAaqwHQAHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkXlT2zAQxf1C4thJAwRajt4HRy8VMwwfSJHXsQZZcnUQ+PYoTtwpM+wf2t9brWZ2n5JBsol58nJcYYAdDDFCijEy5JhgileYYRd72MccBzjEa7zBEY5xglO8xTu8xwd8xCd8xhd8xTec4RwXuMR3/MBP/MJvMPzBFYpk2Cr+OF0fTEgrFI1aHhxN740KDbEmeJpsWZlVj40s+45aLuv9KijlhCXSjLQnu/d/4UH6sWul1mRzFxZeekUuE7z10mg3qMtM1FGQddPSrLQyvJR6OaukItYXDp6pCJrmz0umqkau5pZ2hFmm7m+ImG5W2t0kZoJXUtPhVnYTbbdOBdeCVGqpJe7XKTqSbRK7zbdwXfR0U+SVsStuS3Y76em6+Ic3xYiHUppc04Nn0lMzay3dSxNcp8auDlWlaCi48yetFD7Y9USsx87G45cuop1ZxQUtjLnL4j53FO0a+5X08UXqQ7NQNo92R0XOz7sxWEnxN2TneJI8Acttu4Q=) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\\f109"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\\f10a"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\\f10b"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\\f10c"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\\f10e"}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:"\\f10f"}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:"\\f110"}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:"\\f111"}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:"\\f112"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\\f113"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\\f114"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\\f115"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\\f116"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\\f117"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\\f118"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\\f119"}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:"\\f11a"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\\f11b"}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.vjs-icon-replay-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.vjs-icon-replay-5:before{content:"\\f11c"}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.vjs-icon-replay-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.vjs-icon-replay-10:before{content:"\\f11d"}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.vjs-icon-replay-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.vjs-icon-replay-30:before{content:"\\f11e"}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.vjs-icon-forward-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.vjs-icon-forward-5:before{content:"\\f11f"}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.vjs-icon-forward-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.vjs-icon-forward-10:before{content:"\\f120"}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.vjs-icon-forward-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.vjs-icon-forward-30:before{content:"\\f121"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\\f122"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\\f123"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\\f124"}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:"\\f125"}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:"\\f126"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\\f127"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\\f128"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\\f129"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\\f12a"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\\f12b"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\\f12c"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\\f12d"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\\f12e"}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:rgba(0,0,0,.7);padding:.5em;text-align:center;width:100%}.vjs-layout-small.vjs-pip-container .vjs-pip-text,.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon,.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translateX(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\\f10c";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \\f12e";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-description,.vjs-title-bar-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5{cursor:pointer}.video-js .vjs-skip-forward-10{cursor:pointer}.video-js .vjs-skip-forward-30{cursor:pointer}.video-js .vjs-skip-backward-5{cursor:pointer}.video-js .vjs-skip-backward-10{cursor:pointer}.video-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0}',i='.bc-player-f6v2FpKyM_default *,.bc-player-f6v2FpKyM_default :after,.bc-player-f6v2FpKyM_default :before{box-sizing:inherit;font-size:inherit;color:inherit;line-height:inherit}.bc-player-f6v2FpKyM_default{width:300px;height:150px;font-size:14px;overflow:hidden}.bc-player-f6v2FpKyM_default.vjs-fluid.vjs-16-9:not(.vjs-audio-only-mode),.bc-player-f6v2FpKyM_default.vjs-fluid:not(.vjs-audio-only-mode){padding-top:56.25%}.bc-player-f6v2FpKyM_default.vjs-fluid.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.bc-player-f6v2FpKyM_default.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.bc-iframe,.bc-iframe body,.bc-player-f6v2FpKyM_default,.bc-player-f6v2FpKyM_default .vjs-poster{background-color:#151b17}.bc-iframe,.bc-iframe .bc-player-f6v2FpKyM_default,.bc-iframe body{margin:0;width:100%;height:100%;overflow:hidden}.bc-player-f6v2FpKyM_default.vjs-fullscreen,.bc-player-f6v2FpKyM_default.vjs-fullscreen .vjs-tech{width:100%!important;height:100%!important}.bc-player-f6v2FpKyM_default .vjs-track-setting select{color:#000;background-color:#fff}.bc-player-f6v2FpKyM_default .vjs-audio-button .vjs-menu-item,.bc-player-f6v2FpKyM_default .vjs-chapters-button .vjs-menu-item,.bc-player-f6v2FpKyM_default .vjs-descriptions-button .vjs-menu-item,.bc-player-f6v2FpKyM_default .vjs-subs-caps-button .vjs-menu-item{text-transform:none}.bc-player-f6v2FpKyM_default.vjs-waiting-for-autoplay .vjs-big-play-button{opacity:0}.bc-player-f6v2FpKyM_default .vjs-progress-control .vjs-mouse-display{z-index:2}/*! @name @brightcove/player-core @version 2.5.0 @license UNLICENSED */.vjs-download-button{cursor:pointer}.vjs-download-button.has-icon-downloading{cursor:wait}.vjs-download-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-download-button.has-icon-file-download .vjs-icon-placeholder:before{content:"\\f110"}.vjs-download-button.has-icon-downloading .vjs-icon-placeholder:before{content:"\\f10f"}.vjs-download-button.has-icon-file-download-off .vjs-icon-placeholder:before{content:"\\f112"}.vjs-modal-dialog.vjs-player-info-modal{background:rgba(0,0,0,.9)}.vjs-modal-dialog.vjs-player-info-modal .vjs-modal-dialog-content{overflow:auto;display:grid;grid-template-columns:1fr 1fr;grid-gap:1em}@media screen and (max-width:640px){.vjs-modal-dialog.vjs-player-info-modal .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-modal-dialog.vjs-player-info-modal h2{font-size:1.1667em;margin:0 0 .4286em}.vjs-modal-dialog.vjs-player-info-modal table{border-bottom:1px solid #333;border-collapse:collapse;border-top:1px solid #333;margin-bottom:1.5em;width:100%}.vjs-modal-dialog.vjs-player-info-modal table.vjs-two td,.vjs-modal-dialog.vjs-player-info-modal table.vjs-two th{width:50%}.vjs-modal-dialog.vjs-player-info-modal table.vjs-three td,.vjs-modal-dialog.vjs-player-info-modal table.vjs-three th{width:33.333%}.vjs-modal-dialog.vjs-player-info-modal th{font-weight:400;text-align:left}.vjs-modal-dialog.vjs-player-info-modal td{border-bottom:1px solid #333;opacity:.5}.vjs-modal-dialog.vjs-player-info-modal tr:last-child td{border-bottom:0}.vjs-modal-dialog.vjs-player-info-modal tr:hover td{opacity:1}/*! @name videojs-contextmenu-ui @version 7.0.0 @license Apache-2.0 */.vjs-contextmenu-ui-menu{position:absolute}.vjs-contextmenu-ui-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;padding:.25em}.vjs-contextmenu-ui-menu .vjs-menu-item{border-radius:.3em;cursor:pointer;margin:0 0 1px;padding:.5em 1em;font-size:1em;line-height:1.2;text-transform:none}.vjs-contextmenu-ui-menu .vjs-menu-item:active,.vjs-contextmenu-ui-menu .vjs-menu-item:hover{background-color:rgba(0,0,0,.5);text-shadow:0 0 1em #fff}/*! @name videojs-errors @version 6.1.0 @license Apache-2.0 */.vjs-error-display{color:#fff;display:none;font-family:Helvetica,Arial,sans serif;font-size:16px;line-height:1.428}.vjs-error .vjs-error-display{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5)}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:14px}.vjs-errors-dialog{text-align:left;border:1px #999 solid;overflow:hidden;position:absolute;top:2%;bottom:2%;left:5%;right:5%;padding-left:1%;padding-right:1%;background:rgba(24,24,24,.8)}.vjs-errors-details{margin-top:15px}.vjs-errors-message{border:1px #999 solid;background-color:#2c2c2c;overflow:auto;margin-top:15px;padding:15px}.vjs-errors-ok-button-container{display:block;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-ok-button,.vjs-errors-timeout-button-container button{display:block;height:36px;background-color:#000;border:1px #999 solid;border-radius:5px;color:#999;font-size:14px;cursor:pointer}.vjs-errors-ok-button{margin:0 auto;width:80px}.vjs-errors-ok-button:hover,.vjs-errors-timeout-button-container button:hover{border:1px #fff solid;color:#ccc}.vjs-errors-timeout-button-container{display:flex;flex-direction:row;justify-content:center;gap:10px;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-timeout-button-container button{width:120px}.vjs-errors-content-container{overflow:auto;position:absolute;padding-bottom:15px;top:0;left:15px;right:15px;bottom:61px}.vjs-errors-headline{font-size:14px;font-weight:700;padding-right:3em}.vjs-errors-dialog .vjs-control.vjs-close-button{width:3em;height:3em;top:0}.vjs-xs.vjs-error-display{font-size:14px;background-color:#000}.vjs-xs.vjs-error-display .vjs-errors-details,.vjs-xs.vjs-error-display .vjs-errors-message{display:none}.vjs-xs .vjs-errors-content-container{top:0}.vjs-xs .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-xs .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}@media (max-width:600px),(max-height:250px){.vjs-error-display{font-size:14px;background-color:#000}.vjs-error-display .vjs-errors-details,.vjs-error-display .vjs-errors-message{display:none}.vjs-error-display .vjs-errors-content-container{top:15px}.vjs-error-display .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-error-display .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}}.vjs-errors-ref-id{color:rgba(255,255,255,.5);font-size:.75em;margin:.5em 0 0}.bc-player-f6v2FpKyM_default .vjs-control-bar{background-color:rgba(0,0,0,.6);color:#fff}.bc-player-f6v2FpKyM_default .vjs-control{color:inherit}.bc-player-f6v2FpKyM_default .vjs-mouse-display:after,.bc-player-f6v2FpKyM_default .vjs-play-progress:after{border-radius:0}.bc-player-f6v2FpKyM_default .vjs-menu-button-inline:hover,.bc-player-f6v2FpKyM_default.vjs-no-flex .vjs-menu-button-inline{width:8.35em}.bc-player-f6v2FpKyM_default .vjs-control:focus:before,.bc-player-f6v2FpKyM_default .vjs-control:hover:before{text-shadow:0 0 1em #fff,0 0 1em #fff,0 0 1em #fff}.bc-player-f6v2FpKyM_default .vjs-spacer{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:1 1 auto;-moz-box-flex:1 1 auto;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.bc-player-f6v2FpKyM_default .vjs-time-control{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:0 1 auto;-moz-box-flex:0 1 auto;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;width:auto}.bc-player-f6v2FpKyM_default .vjs-time-control.vjs-time-divider{width:14px}.bc-player-f6v2FpKyM_default .vjs-time-control.vjs-time-divider div{width:100%;text-align:center}.bc-player-f6v2FpKyM_default .vjs-time-control.vjs-current-time{margin-left:1em}.bc-player-f6v2FpKyM_default .vjs-time-control .vjs-current-time-display,.bc-player-f6v2FpKyM_default .vjs-time-control .vjs-duration-display{width:100%}.bc-player-f6v2FpKyM_default .vjs-time-control .vjs-current-time-display{text-align:right}.bc-player-f6v2FpKyM_default .vjs-time-control .vjs-duration-display{text-align:left}.bc-player-f6v2FpKyM_default .vjs-remaining-time{display:none}.bc-player-f6v2FpKyM_default.vjs-no-flex .vjs-time-control.vjs-remaining-time{display:none}.bc-player-f6v2FpKyM_default.vjs-no-flex .vjs-time-control{display:table-cell;width:4em}.bc-player-f6v2FpKyM_default .vjs-play-progress,.bc-player-f6v2FpKyM_default .vjs-volume-level{background-color:#08088c}.bc-player-f6v2FpKyM_default.vjs-ad-playing .vjs-play-progress,.bc-player-f6v2FpKyM_default.vjs-ad-playing .vjs-volume-level{background-color:#ffe400}.bc-player-f6v2FpKyM_default .vjs-play-progress:before,.bc-player-f6v2FpKyM_default .vjs-volume-level:before{display:none}.bc-player-f6v2FpKyM_default .vjs-volume-level:after{display:none}.bc-player-f6v2FpKyM_default .vjs-progress-control{position:absolute;left:0;right:0;width:100%;height:1.5em;top:-1.5em}.bc-player-f6v2FpKyM_default .vjs-progress-control .vjs-load-progress,.bc-player-f6v2FpKyM_default .vjs-progress-control .vjs-play-progress,.bc-player-f6v2FpKyM_default .vjs-progress-control .vjs-progress-holder{height:100%}.bc-player-f6v2FpKyM_default .vjs-progress-control .vjs-progress-holder{margin:0}.bc-player-f6v2FpKyM_default .vjs-progress-control:hover{height:1.5em;top:-1.5em}.bc-player-f6v2FpKyM_default .vjs-control-bar:not(.vjs-focus-within){-webkit-transition:-webkit-transform .1s ease 0s;-moz-transition:-moz-transform .1s ease 0s;-ms-transition:-ms-transform .1s ease 0s;-o-transition:-o-transform .1s ease 0s;transition:transform .1s ease 0s}.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-control-bar,.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible){visibility:visible;opacity:1;-webkit-backface-visibility:hidden;-webkit-transform:translateY(3em);-moz-transform:translateY(3em);-ms-transform:translateY(3em);-o-transform:translateY(3em);transform:translateY(3em);-webkit-transition:-webkit-transform 1s ease 0s;-moz-transition:-moz-transform 1s ease 0s;-ms-transition:-ms-transform 1s ease 0s;-o-transition:-o-transform 1s ease 0s;transition:transform 1s ease 0s}.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control{height:.3em;top:-.3em;pointer-events:none;-webkit-transition:height 1s,top 1s;-moz-transition:height 1s,top 1s;-ms-transition:height 1s,top 1s;-o-transition:height 1s,top 1s;transition:height 1s,top 1s}.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active.vjs-fullscreen .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active.vjs-fullscreen .vjs-progress-control,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control{opacity:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;-ms-transition:opacity 1s;-o-transition:opacity 1s;transition:opacity 1s}.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-volume-vertical,.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-volume-vertical,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-volume-vertical,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-volume-vertical,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-volume-vertical,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-volume-vertical{opacity:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;-ms-transition:opacity 1s;-o-transition:opacity 1s;transition:opacity 1s}.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu-item,.bc-player-f6v2FpKyM_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar-visible .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar-visible .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar-visible .vjs-menu,.bc-player-f6v2FpKyM_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu{opacity:1}.bc-player-f6v2FpKyM_default.vjs-live .vjs-live-control{margin-left:1em}.bc-player-f6v2FpKyM_default.vjs-live .vjs-time-control.vjs-current-time,.bc-player-f6v2FpKyM_default.vjs-live .vjs-time-control.vjs-duration,.bc-player-f6v2FpKyM_default.vjs-live .vjs-time-control.vjs-time-divider{display:none}.bc-player-f6v2FpKyM_default .vjs-big-play-button{top:50%;left:50%;margin-left:-1em;margin-top:-1em;width:2em;height:2em;line-height:2em;border:none;border-radius:50%;font-size:3.5em;background-color:rgba(0,0,0,.45);color:#fff;-webkit-transition:border-color .4s,outline .4s,background-color .4s;-moz-transition:border-color .4s,outline .4s,background-color .4s;-ms-transition:border-color .4s,outline .4s,background-color .4s;-o-transition:border-color .4s,outline .4s,background-color .4s;transition:border-color .4s,outline .4s,background-color .4s}.bc-player-f6v2FpKyM_default .vjs-big-play-button:active,.bc-player-f6v2FpKyM_default .vjs-big-play-button:focus,.bc-player-f6v2FpKyM_default:active .vjs-big-play-button,.bc-player-f6v2FpKyM_default:hover .vjs-big-play-button{background-color:#08088c}.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu{left:-3em}.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-content{width:12em;left:-1em;padding:.2em .5em .5em;border-radius:.25em .25em 0 0}.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item,.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-title{background-color:#151b17;margin:.3em 0;padding:.5em;border-radius:.3em}.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item.vjs-selected{background-color:#08088c;color:#fff}.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:active,.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:focus,.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:hover{text-shadow:0 0 1em #fff,0 0 1em #fff,0 0 1em #fff;color:#fff}.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:focus:not(.vjs-selected){background-color:#151b17}.bc-player-f6v2FpKyM_default.vjs-ad-playing .vjs-mouse-display,.bc-player-f6v2FpKyM_default.vjs-ad-playing .vjs-mouse-display:after{display:none}.bc-player-f6v2FpKyM_default.vjs-ad-playing.vjs-ad-playing .vjs-progress-control:after{pointer-events:auto;width:100%;height:100%;position:absolute;left:0;bottom:0;content:" ";user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none}.bc-player-f6v2FpKyM_default.vjs-ad-playing .vjs-picture-in-picture-control{display:none}.bc-player-f6v2FpKyM_default.vjs-no-flex .vjs-spacer{display:table-cell}.bc-player-f6v2FpKyM_default.vjs-no-flex .vjs-time-control{display:table-cell;width:4em}.bc-player-f6v2FpKyM_default.vjs-no-flex .vjs-remaining-time{display:none}.vjs-mouse.bc-player-f6v2FpKyM_default .vjs-control-bar{font-size:10px}.vjs-mouse.bc-player-f6v2FpKyM_default .vjs-progress-control{height:.5em;top:-.5em}.vjs-mouse.bc-player-f6v2FpKyM_default .vjs-progress-control:hover{height:1.5em;top:-1.5em}.bc-player-f6v2FpKyM_default select{width:inherit}.bc-player-f6v2FpKyM_default.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-progress-control,.bc-player-f6v2FpKyM_default.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-progress-control{display:block}.bc-player-f6v2FpKyM_default .vjs-title-bar{line-height:1.5;padding-top:1em}.bc-player-f6v2FpKyM_default.video-js.vjs-play-button-hover-glow .vjs-big-play-button:active,.bc-player-f6v2FpKyM_default.video-js.vjs-play-button-hover-glow .vjs-big-play-button:focus,.bc-player-f6v2FpKyM_default.video-js.vjs-play-button-hover-glow:active .vjs-big-play-button,.bc-player-f6v2FpKyM_default.video-js.vjs-play-button-hover-glow:hover .vjs-big-play-button{box-shadow:0 0 15px 3px #fff;background-color:rgba(0,0,0,.45)}.bc-player-f6v2FpKyM_default.video-js.vjs-play-button-hover-darken .vjs-big-play-button:active,.bc-player-f6v2FpKyM_default.video-js.vjs-play-button-hover-darken .vjs-big-play-button:focus,.bc-player-f6v2FpKyM_default.video-js.vjs-play-button-hover-darken:active .vjs-big-play-button,.bc-player-f6v2FpKyM_default.video-js.vjs-play-button-hover-darken:hover .vjs-big-play-button{background-color:rgba(0,0,0,.85)}.bc-player-f6v2FpKyM_default.vjs-play-button-shape-square .vjs-big-play-button{border-radius:11px;height:2em;width:2em;margin-left:-1em;margin-top:-1em}.bc-player-f6v2FpKyM_default.vjs-play-button-shape-rectangle .vjs-big-play-button{border-radius:21px;height:2em;width:3em;margin-left:-1.5em;margin-top:-1em}.bc-player-f6v2FpKyM_default.vjs-play-button-position-top-left .vjs-big-play-button{margin:0;left:17px;top:17px}.bc-player-f6v2FpKyM_default.vjs-play-button-position-top-right .vjs-big-play-button{margin:0;right:17px;left:auto;top:17px}.bc-player-f6v2FpKyM_default .vjs-big-play-button,.bc-player-f6v2FpKyM_default .vjs-big-play-state.vjs-play-control.vjs-control,.bc-player-f6v2FpKyM_default .vjs-control-bar{background-color:#e5a837}.bc-player-f6v2FpKyM_default .vjs-big-play-button,.bc-player-f6v2FpKyM_default .vjs-big-play-state,.bc-player-f6v2FpKyM_default .vjs-control-bar{color:#fff}.bc-iframe .vjs-playlist-sidebar .vjs-playlist-show-hide button:hover,.bc-player-f6v2FpKyM_default .vjs-big-play-button:active,.bc-player-f6v2FpKyM_default .vjs-big-play-button:focus,.bc-player-f6v2FpKyM_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item.vjs-selected,.bc-player-f6v2FpKyM_default .vjs-play-progress,.bc-player-f6v2FpKyM_default .vjs-volume-level,.bc-player-f6v2FpKyM_default:active .vjs-big-play-button,.bc-player-f6v2FpKyM_default:hover .vjs-big-play-button{background-color:#ff4500}.bc-player-f6v2FpKyM_default.vjs-audio-mode.vjs-has-started.vjs-focus-within.video-js.video-js.video-js .vjs-control-bar,.bc-player-f6v2FpKyM_default.vjs-audio-mode.vjs-has-started.vjs-user-active.video-js.video-js.video-js .vjs-control-bar:not(.vjs-focus-within),.bc-player-f6v2FpKyM_default.vjs-audio-mode.vjs-has-started.vjs-user-inactive.video-js.video-js.video-js .vjs-control-bar{opacity:1;visibility:visible;transform:none}.bc-player-f6v2FpKyM_default.vjs-audio-only-mode .vjs-poster{display:none}.bc-player-f6v2FpKyM_default.vjs-audio-only-mode .vjs-progress-control{height:1.5em;top:-1.5em}.vjs-bumper-video .vjs-play-progress.vjs-play-progress-resetting{transition:width 0s linear}.vjs-bumper-video .vjs-dock-text{display:none}/*! @name @brightcove/videojs-thumbnails @version 2.0.0 @license UNLICENSED */.video-js.vjs-thumbnails{display:block}.video-js.vjs-thumbnails .remove-me,.video-js.vjs-thumbnails .remove-me-too,.video-js.vjs-thumbnails.finally-remove-me{color:red;font-size:504px}.video-js .vjs-thumbnail-display{display:none;position:absolute}.video-js .vjs-progress-control:hover .vjs-thumbnail-display{display:block;position:absolute;width:150px;height:84px;bottom:2.2em;box-shadow:1px 1px 5px rgba(0,0,0,.35);background-color:#000}.video-js.vjs-ad-playing .vjs-progress-control:hover .vjs-thumbnail-display{display:none}.video-js .vjs-progress-control .vjs-thumbnail-display .vjs-thumbnail-image{width:100%;height:100%}.video-js.vjs-user-inactive .vjs-progress-control .vjs-thumbnail-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-playlist{padding:0;background-color:#1a1a1a;color:#fff;list-style-type:none}.vjs-playlist img{display:block;height:auto;width:auto}.vjs-playlist .vjs-playlist-item-list{position:relative;margin:0;padding:0;list-style:none}.vjs-playlist .vjs-playlist-item{position:relative;cursor:pointer;overflow:hidden}.vjs-playlist .vjs-playlist-thumbnail-placeholder{background:#303030}.vjs-playlist .vjs-playlist-now-playing-text{display:none;position:absolute;top:0;left:0;padding-left:2px;margin:.8rem}.vjs-playlist .vjs-playlist-duration{position:absolute;top:.5rem;left:.5rem;padding:2px 5px 3px;margin-left:2px;background-color:rgba(26,26,26,.8)}.vjs-playlist .vjs-playlist-title-container{position:absolute;bottom:0;box-sizing:border-box;width:100%;padding:.5rem .8rem;text-shadow:1px 1px 2px #000,-1px 1px 2px #000,1px -1px 2px #000,-1px -1px 2px #000}.vjs-playlist .vjs-playlist-name{display:block;max-height:2.5em;padding:0 0 4px 2px;font-style:normal;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;line-height:20px}.vjs-playlist .vjs-playlist-description{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:block;font-size:14px;padding:0 0 0 2px}.vjs-playlist .vjs-up-next-text{display:none;padding:.1rem 2px;font-size:.8em;text-transform:uppercase}.vjs-playlist .vjs-up-next .vjs-up-next-text{display:block}.vjs-playlist .vjs-selected{background-color:#141a21}.vjs-playlist .vjs-selected img{opacity:.2}.vjs-playlist .vjs-selected .vjs-playlist-duration{display:none}.vjs-playlist .vjs-selected .vjs-playlist-now-playing-text{display:block}.vjs-playlist .vjs-selected .vjs-playlist-title-container{text-shadow:none}.vjs-playlist-vertical{overflow-x:hidden;overflow-y:auto}.vjs-playlist-vertical img{width:100%;min-height:54px}.vjs-playlist-vertical .vjs-playlist-item{margin-bottom:5px}.vjs-playlist-vertical .vjs-playlist-thumbnail{display:block;width:100%}.vjs-playlist-vertical .vjs-playlist-thumbnail-placeholder{height:100px}.vjs-playlist-horizontal{overflow-x:auto;overflow-y:hidden}.vjs-playlist-horizontal img{min-width:100px;height:100%}.vjs-playlist-horizontal .vjs-playlist-item-list{height:100%;white-space:nowrap}.vjs-playlist-horizontal .vjs-playlist-item{display:inline-block;height:100%;margin-right:5px}.vjs-playlist-horizontal .vjs-playlist-thumbnail{display:block;height:100%}.vjs-playlist-horizontal .vjs-playlist-thumbnail-placeholder{height:100%;width:180px}.vjs-playlist.vjs-ad-playing{overflow:hidden}.vjs-playlist.vjs-ad-playing.vjs-csspointerevents{pointer-events:none;overflow:auto}.vjs-playlist.vjs-ad-playing.vjs-csspointerevents .vjs-playlist-ad-overlay{pointer-events:auto}.vjs-playlist.vjs-ad-playing .vjs-playlist-ad-overlay{display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#1a1a1a;background-color:rgba(0,0,0,.5)}.vjs-playlist{font-size:14px}.vjs-playlist .vjs-playlist-description{height:28px;line-height:21px}.vjs-mouse.vjs-playlist{font-size:15px}.vjs-mouse.vjs-playlist .vjs-playlist-description{height:30px;line-height:23px}@media (min-width:600px){.vjs-mouse.vjs-playlist{font-size:17px}.vjs-mouse.vjs-playlist .vjs-playlist-description{height:34px;line-height:26px}.vjs-playlist .vjs-playlist-name{line-height:22px}}@media (max-width:520px){.vjs-playlist .vjs-selected .vjs-playlist-now-playing-text,.vjs-playlist .vjs-up-next .vjs-up-next-text{display:none}.vjs-mouse.vjs-playlist .vjs-selected .vjs-playlist-now-playing-text,.vjs-mouse.vjs-playlist .vjs-up-next .vjs-up-next-text{display:none}}@media (min-width:521px){.vjs-playlist img{min-height:85px}}@media (max-width:750px){.vjs-playlist .vjs-playlist-duration{display:none}}.vjs-next-endscreen,.vjs-next-overlay,.vjs-playlist{font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif}.vjs-playlist .vjs-selected,.vjs-playlist.vjs-mouse .vjs-selected{background-color:#0cc5d7}.vjs-next-button{cursor:pointer}.vjs-next-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-next-button .vjs-icon-placeholder:before{content:"\\f11f"}.vjs-next-endscreen{background:rgba(0,0,0,.8);cursor:pointer}.vjs-next-endscreen .vjs-modal-dialog-content{font-size:16px;line-height:1.5;text-align:center}.vjs-next-endscreen .vjs-next-endscreen-countdown,.vjs-next-endscreen .vjs-next-endscreen-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-next-endscreen .vjs-next-endscreen-countdown{font-size:12px}.vjs-next-endscreen .vjs-next-endscreen-thumbnail{position:relative}.vjs-next-endscreen .vjs-next-endscreen-thumbnail img{display:block;margin:1em auto;max-height:50%;max-width:50%}.vjs-next-endscreen .vjs-next-endscreen-thumbnail button{position:absolute;top:50%;left:50%;height:50px;width:50px;margin:-25px 0 0 -25px}.vjs-next-overlay{position:absolute;bottom:4.25em;right:1.25em;width:15em;max-width:25%;height:auto;max-height:50%;transition:transform 1s ease 0s;cursor:pointer}.vjs-has-started.not-hover .vjs-next-overlay{transform:translateY(3em)}.vjs-next-overlay .vjs-control.vjs-close-button{right:-.7em;top:.1em}.vjs-next-overlay .vjs-next-overlay-banner{background-color:#000;color:#fff;line-height:1.25;padding:.5em 2.5em .5em 1em}.vjs-next-overlay .vjs-next-overlay-countdown,.vjs-next-overlay .vjs-next-overlay-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-next-overlay .vjs-next-overlay-countdown{font-size:.7857em}.vjs-next-overlay img{width:100%}.vjs-playlist-player-container{position:relative}.vjs-playlist-player-container .vjs-playlist{box-sizing:border-box;height:100%}.vjs-playlist-player-container .vjs-playlist-enabled.vjs-fullscreen{width:100%!important}.vjs-playlist-player-container .vjs-playlist-show-hide{position:absolute;top:0;left:0;width:35px;height:100%;transition:opacity .2s}.vjs-playlist-player-container .vjs-playlist-show-hide button{width:100%;margin:0;padding:0 0 3px 4px;position:relative;top:50%;transform:translateY(-50%);font-family:"Trebuchet MS";font-size:48px;background:#1a1a1a;border-radius:10px 0 0 10px;border:none;cursor:pointer;color:#e1e1e1}.vjs-playlist-player-container .vjs-playlist-show-hide button:focus{border-style:solid none solid solid;border-color:#5c99ec;border-width:2px;outline:0}.vjs-playlist-player-container .vjs-playlist-show-hide button:hover{background:#d61a84}.vjs-playlist-player-container .vjs-playlist-sidebar-vertical{position:absolute;right:0;top:0;min-width:0;height:100%;width:40%;transition:width .1s}.vjs-playlist-player-container .vjs-playlist-sidebar-vertical.vjs-playlist-hidden{width:35px;top:15%;height:70%}.vjs-playlist-player-container .vjs-playlist-sidebar-vertical.vjs-playlist-hidden .vjs-playlist-item{opacity:0}.vjs-playlist-player-container .vjs-playlist-sidebar-vertical.vjs-playlist-show-hide-hidden .vjs-playlist-show-hide{opacity:0}.vjs-playlist-player-container .vjs-playlist-sidebar-vertical.vjs-playlist-show-hide-hidden.vjs-show-hide-focus .vjs-playlist-show-hide{opacity:1}.vjs-playlist-player-container .vjs-playlist-sidebar-vertical.vjs-playlist-animating .vjs-playlist-item{opacity:0}@media (min-width:380px){.vjs-playlist-player-container .vjs-playlist-sidebar-vertical .vjs-playlist-sidebar-vertical{height:100%;width:35%}}@media (min-width:640px){.vjs-playlist-player-container .vjs-playlist-sidebar-vertical .vjs-playlist-sidebar-vertical{height:100%;width:30%}}@media (min-width:920px){.vjs-playlist-player-container .vjs-playlist-sidebar-vertical .vjs-playlist-sidebar-vertical{width:25%;height:100%}}.vjs-playlist-player-container .vjs-playlist-vertical{margin:0 0 0 35px}.vjs-playlist-player-container .vjs-playlist-vertical .vjs-playlist-item{transition:opacity .1s}.vjs-playlist-player-container .vjs-playlist-sidebar-horizontal{position:relative;top:auto;right:auto;bottom:auto;left:auto;flex:1;max-height:20%;min-height:20%;width:100%;height:100%}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.vjs-playlist-player-container .vjs-playlist-horizontal img{width:100%}}@supports (-ms-ime-align:auto){.vjs-playlist-player-container .vjs-playlist-horizontal img{width:100%}}@supports (-moz-appearance:none){.vjs-playlist-player-container .vjs-playlist-horizontal img{width:100%}}.vjs-playlist-player-container .vjs-playlist-sidebar-horizontal .vjs-playlist img{min-height:0}.vjs-playlist-player-container.vjs-playlist-horizontal-enabled{display:flex;flex-direction:column}.vjs-playlist-player-container.vjs-playlist-horizontal-enabled .video-js{flex:1;height:auto}.video-js.vjs-quality-menu{display:block}.video-js.vjs-quality-menu .vjs-quality-menu-button:before{font-family:VideoJS;font-weight:400;font-style:normal;content:"\\f110"}.video-js.vjs-quality-menu.vjs-v6 .vjs-quality-menu-button,.video-js.vjs-quality-menu.vjs-v7 .vjs-quality-menu-button,.video-js.vjs-quality-menu.vjs-v8 .vjs-quality-menu-button{position:initial}.video-js.vjs-quality-menu.vjs-v6 .vjs-quality-menu-button:before,.video-js.vjs-quality-menu.vjs-v7 .vjs-quality-menu-button:before,.video-js.vjs-quality-menu.vjs-v8 .vjs-quality-menu-button:before{content:none}.video-js.vjs-quality-menu.vjs-v6 .vjs-quality-menu-button .vjs-icon-placeholder,.video-js.vjs-quality-menu.vjs-v7 .vjs-quality-menu-button .vjs-icon-placeholder,.video-js.vjs-quality-menu.vjs-v8 .vjs-quality-menu-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-quality-menu.vjs-v6 .vjs-quality-menu-button .vjs-icon-placeholder:before,.video-js.vjs-quality-menu.vjs-v7 .vjs-quality-menu-button .vjs-icon-placeholder:before,.video-js.vjs-quality-menu.vjs-v8 .vjs-quality-menu-button .vjs-icon-placeholder:before{content:"\\f110"}.video-js.vjs-quality-menu .vjs-quality-menu-button{position:relative}.video-js.vjs-quality-menu .vjs-quality-menu-button li{text-transform:none}.video-js.vjs-quality-menu .vjs-quality-menu-button.vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em;width:10em;left:0}.video-js.vjs-quality-menu .vjs-menu-item .vjs-control-text{position:absolute}.video-js.vjs-quality-menu .vjs-quality-menu-wrapper{position:relative}.video-js.vjs-quality-menu .vjs-quality-menu-wrapper li{text-transform:none}.video-js.vjs-quality-menu .vjs-quality-menu-wrapper.vjs-menu-wrapper-popup .vjs-menu .vjs-menu-content{max-height:25em;width:10em;left:0}.video-js.vjs-quality-menu .vjs-quality-menu-item-sub-label{font-size:75%;font-weight:700;position:absolute;right:0;text-align:center;width:4em}.video-js.vjs-quality-menu .vjs-quality-menu-button-use-resolution .vjs-quality-menu-item-sub-label{position:absolute;right:0;text-align:center;width:4em}.video-js.vjs-quality-menu .vjs-quality-menu-button-4K-flag:after,.video-js.vjs-quality-menu .vjs-quality-menu-button-HD-flag:after{background-color:#2b333f;color:inherit;content:"";font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:.7em;font-weight:300;height:2.2em;line-height:2.2em;padding:0;position:absolute;right:0;text-align:center;top:.5em;width:2.2em;border-radius:2em;letter-spacing:.1em}.video-js.vjs-quality-menu .vjs-quality-menu-button-HD-flag:after{content:"HD"}.video-js.vjs-quality-menu .vjs-quality-menu-button-4K-flag:after{content:"4K"}.video-js.vjs-quality-menu .vjs-quality-menu-button-waiting:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite}.vjs-social-overlay{font-family:\'Helvetica Neue\',Helvetica,Arial,sans-serif;font-size:10px;letter-spacing:1px}.vjs-social-overlay .vjs-icon-facebook{background-color:#3b5998}.vjs-social-overlay .vjs-icon-facebook:not(:focus-visible){background-color:#3b5998}.vjs-social-overlay .vjs-icon-gplus{background-color:#d53326}.vjs-social-overlay .vjs-icon-gplus:not(:focus-visible){background-color:#d53326}.vjs-social-overlay .vjs-icon-linkedin{background-color:#069}.vjs-social-overlay .vjs-icon-linkedin:not(:focus-visible){background-color:#069}.vjs-social-overlay .vjs-icon-twitter{background-color:#55acee}.vjs-social-overlay .vjs-icon-twitter:not(:focus-visible){background-color:#55acee}.vjs-social-overlay .vjs-icon-tumblr{background-color:#29364b}.vjs-social-overlay .vjs-icon-tumblr:not(:focus-visible){background-color:#29364b}.vjs-social-overlay .vjs-icon-pinterest{background-color:#c10218}.vjs-social-overlay .vjs-icon-pinterest:not(:focus-visible){background-color:#c10218}.vjs-social-overlay a{color:#fff}.vjs-social-overlay .vjs-social-description,.vjs-social-overlay .vjs-social-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-social-overlay .vjs-social-title{font-size:1.25em;font-weight:700;line-height:1.33333;margin-bottom:.33333em}.vjs-social-overlay .vjs-social-description{font-size:1em;font-weight:400;line-height:1.5;margin-bottom:1em}.vjs-social-overlay .vjs-social-share-links{margin:-.33333em 0 .66667em -.28333em;overflow:auto}.vjs-social-overlay .vjs-social-share-link{border-radius:2px;float:left;font-size:1.16667em;line-height:1.07143;margin:.33571em .28571em;padding:.42857em;text-decoration:none}.vjs-social-overlay .vjs-social-direct-link,.vjs-social-overlay .vjs-social-embed-code,.vjs-social-overlay .vjs-social-start-from{float:left;margin-bottom:.66667em}.vjs-social-overlay .vjs-social-direct-link .vjs-social-label-text,.vjs-social-overlay .vjs-social-embed-code .vjs-social-label-text,.vjs-social-overlay .vjs-social-start-from .vjs-social-label-text{display:block;margin-bottom:.16667em}.vjs-social-overlay .vjs-social-direct-link input,.vjs-social-overlay .vjs-social-embed-code input,.vjs-social-overlay .vjs-social-start-from input{border:0;color:#333;display:block;font-size:1em;padding:.5em .66667em;width:100%}.vjs-social-overlay .vjs-social-direct-link input.vjs-invalid,.vjs-social-overlay .vjs-social-embed-code input.vjs-invalid,.vjs-social-overlay .vjs-social-start-from input.vjs-invalid{background-color:red;color:#fff}.vjs-social-overlay .vjs-social-direct-link{padding-right:24px;width:80%}.vjs-social-overlay .vjs-social-start-from{width:20%}.vjs-social-overlay .vjs-social-embed-code{margin-bottom:.33333em;width:100%}.vjs-social-overlay.vjs-social-as-endscreen .vjs-restart{border:0;cursor:pointer;display:block;font-size:4em;margin:0 auto;outline:0;padding:0}.vjs-social-overlay.vjs-social-as-endscreen .vjs-restart:focus:before,.vjs-social-overlay.vjs-social-as-endscreen .vjs-restart:hover:before{text-shadow:1px -1px 20px #fff,-1px 1px 20px #fff}.vjs-social-overlay.vjs-social-as-endscreen.vjs-social-short-player .vjs-social-description{display:none}.vjs-social-overlay .vjs-control.vjs-close-button{height:4.5em;top:0;width:4.5em}.vjs-social-overlay .vjs-control.vjs-close-button .vjs-icon-placeholder:before{line-height:2.5}.vjs-title-bar .vjs-title-bar-description,.vjs-title-bar .vjs-title-bar-title{padding-right:25%}.vjs-button.vjs-share-control{cursor:pointer;font-weight:700}.vjs-button.vjs-share-control:hover{text-shadow:0 0 1em rgba(255,255,255,.5),0 0 1em rgba(255,255,255,.5),0 0 1em rgba(255,255,255,.5)}.vjs-title-bar .vjs-button.vjs-share-control{pointer-events:auto;position:absolute;right:0;top:0;padding:1em}.vjs-title-bar .vjs-button.vjs-share-control:before{vertical-align:top;font-family:VideoJS;font-weight:400;font-style:normal;content:"\\f10f"}.vjs-title-bar .vjs-button.vjs-share-control .vjs-icon-placeholder:before{content:none}.vjs-title-bar .vjs-button.vjs-share-control span{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;vertical-align:top;text-decoration:underline;margin-left:2px}.vjs-button.vjs-share-control:before{content:none}.vjs-button.vjs-share-control .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal;content:"\\f10f"}.vjs-v6 .vjs-button.vjs-share-control:before,.vjs-v7 .vjs-button.vjs-share-control:before{content:none}.vjs-v6 .vjs-button.vjs-share-control .vjs-icon-placeholder:before,.vjs-v7 .vjs-button.vjs-share-control .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal;content:"\\f10f"}.vjs-v6 .vjs-title-bar .vjs-button.vjs-share-control:before,.vjs-v7 .vjs-title-bar .vjs-button.vjs-share-control:before{content:"\\f10f"}.vjs-v6 .vjs-title-bar .vjs-button.vjs-share-control .vjs-icon-placeholder:before,.vjs-v7 .vjs-title-bar .vjs-button.vjs-share-control .vjs-icon-placeholder:before{content:none}.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-button.vjs-share-control,.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-button.vjs-share-control{display:none}.vjs-layout-small .vjs-social-overlay .vjs-social-direct-link,.vjs-layout-tiny .vjs-social-overlay .vjs-social-direct-link,.vjs-layout-x-small .vjs-social-overlay .vjs-social-direct-link,.vjs-social-small .vjs-social-overlay .vjs-social-direct-link{width:100%;padding-right:0}.vjs-layout-small .vjs-social-overlay .vjs-social-start-from,.vjs-layout-tiny .vjs-social-overlay .vjs-social-start-from,.vjs-layout-x-small .vjs-social-overlay .vjs-social-start-from,.vjs-social-small .vjs-social-overlay .vjs-social-start-from{width:100%}.vjs-layout-small .vjs-social-overlay .vjs-social-embed-code,.vjs-layout-tiny .vjs-social-overlay .vjs-social-embed-code,.vjs-layout-x-small .vjs-social-overlay .vjs-social-embed-code,.vjs-social-small .vjs-social-overlay .vjs-social-embed-code{margin-bottom:2em}',s="bc-style-f6v2FpKyM-default",n,r="bc-style-vjs",a,o,l,c,u,d=document.querySelector("head"),h=d.firstChild,f=function(e,t){var i=document.createElement("style");i.type="text/css";i.appendChild(document.createTextNode(e));if(t){d.insertBefore(i,t)}else{d.appendChild(i)}return i};l=function e(t){return Boolean(t.IE_VERSION)};try{o=function(tv,iv){var i=undefined;var e=tv.define;var t=tv.videojs;tv.VIDEOJS_NO_DYNAMIC_STYLE=true;var s=function(){"use strict";var E=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof tv!=="undefined"?tv:{};var c=[];var u=[];var k=typeof Uint8Array!=="undefined"?Uint8Array:Array;var j=false;function L(){j=true;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var t=0,i=e.length;t0){throw new Error("Invalid string. Length must be a multiple of 4")}r=e[o-2]==="="?2:e[o-1]==="="?1:0;a=new k(o*3/4-r);s=r>0?o-4:o;var l=0;for(t=0,i=0;t>16&255;a[l++]=n>>8&255;a[l++]=n&255}if(r===2){n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4;a[l++]=n&255}else if(r===1){n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2;a[l++]=n>>8&255;a[l++]=n&255}return a}function N(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[e&63]}function M(e,t,i){var s;var n=[];for(var r=t;rl?l:o+a))}if(s===1){t=e[i-1];n+=c[t>>2];n+=c[t<<4&63];n+="=="}else if(s===2){t=(e[i-2]<<8)+e[i-1];n+=c[t>>10];n+=c[t>>4&63];n+=c[t<<2&63];n+="="}r.push(n);return r.join("")}function B(e,t,i,s,n){var r,a;var o=n*8-s-1;var l=(1<>1;var u=-7;var d=i?n-1:0;var h=i?-1:1;var f=e[t+d];d+=h;r=f&(1<<-u)-1;f>>=-u;u+=o;for(;u>0;r=r*256+e[t+d],d+=h,u-=8){}a=r&(1<<-u)-1;r>>=-u;u+=s;for(;u>0;a=a*256+e[t+d],d+=h,u-=8){}if(r===0){r=1-c}else if(r===l){return a?NaN:(f?-1:1)*Infinity}else{a=a+Math.pow(2,s);r=r-c}return(f?-1:1)*a*Math.pow(2,r-s)}function F(e,t,i,s,n,r){var a,o,l;var c=r*8-n-1;var u=(1<>1;var h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var f=s?0:r-1;var p=s?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;a=u}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(l=Math.pow(2,-a))<1){a--;l*=2}if(a+d>=1){t+=h/l}else{t+=h*Math.pow(2,1-d)}if(t*l>=2){a++;l/=2}if(a+d>=u){o=0;a=u}else if(a+d>=1){o=(t*l-1)*Math.pow(2,n);a=a+d}else{o=t*Math.pow(2,d-1)*Math.pow(2,n);a=0}}for(;n>=8;e[i+f]=o&255,f+=p,o/=256,n-=8){}a=a<0;e[i+f]=a&255,f+=p,a/=256,c-=8){}e[i+f-p]|=m*128}var q={}.toString;var V=Array.isArray||function(e){return q.call(e)=="[object Array]"};var H=50;Zg.TYPED_ARRAY_SUPPORT=E.TYPED_ARRAY_SUPPORT!==undefined?E.TYPED_ARRAY_SUPPORT:true;$();function $(){return Zg.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(e,t){if($()=$()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+$().toString(16)+" bytes")}return e|0}Zg.isBuffer=Ne;function h(e){return!!(e!=null&&e._isBuffer)}Zg.compare=function e(t,i){if(!h(t)||!h(i)){throw new TypeError("Arguments must be Buffers")}if(t===i)return 0;var s=t.length;var n=i.length;for(var r=0,a=Math.min(s,n);r>>1;case"base64":return Pe(e).length;default:if(s)return Ae(e).length;t=(""+t).toLowerCase();s=true}}}Zg.byteLength=se;function ne(e,t,i){var s=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(i===undefined||i>this.length){i=this.length}if(i<=0){return""}i>>>=0;t>>>=0;if(i<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return be(this,t,i);case"utf8":case"utf-8":return pe(this,t,i);case"ascii":return ve(this,t,i);case"latin1":case"binary":return ye(this,t,i);case"base64":return fe(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,t,i);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();s=true}}}Zg.prototype._isBuffer=true;function s(e,t,i){var s=e[t];e[t]=e[i];e[i]=s}Zg.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;i0){t=this.toString("hex",0,i).match(/.{2}/g).join(" ");if(this.length>i)t+=" ... "}return""};Zg.prototype.compare=function e(t,i,s,n,r){if(!h(t)){throw new TypeError("Argument must be a Buffer")}if(i===undefined){i=0}if(s===undefined){s=t?t.length:0}if(n===undefined){n=0}if(r===undefined){r=this.length}if(i<0||s>t.length||n<0||r>this.length){throw new RangeError("out of range index")}if(n>=r&&i>=s){return 0}if(n>=r){return-1}if(i>=s){return 1}i>>>=0;s>>>=0;n>>>=0;r>>>=0;if(this===t)return 0;var a=r-n;var o=s-i;var l=Math.min(a,o);var c=this.slice(n,r);var u=t.slice(i,s);for(var d=0;d2147483647){i=2147483647}else if(i<-2147483648){i=-2147483648}i=+i;if(isNaN(i)){i=n?0:e.length-1}if(i<0)i=e.length+i;if(i>=e.length){if(n)return-1;else i=e.length-1}else if(i<0){if(n)i=0;else return-1}if(typeof t==="string"){t=Zg.from(t,s)}if(h(t)){if(t.length===0){return-1}return ae(e,t,i,s,n)}else if(typeof t==="number"){t=t&255;if(Zg.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(n){return Uint8Array.prototype.indexOf.call(e,t,i)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,i)}}return ae(e,[t],i,s,n)}throw new TypeError("val must be string, number or Buffer")}function ae(e,t,i,s,n){var r=1;var a=e.length;var o=t.length;if(s!==undefined){s=String(s).toLowerCase();if(s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le"){if(e.length<2||t.length<2){return-1}r=2;a/=2;o/=2;i/=2}}function l(e,t){if(r===1){return e[t]}else{return e.readUInt16BE(t*r)}}var c;if(n){var u=-1;for(c=i;ca)i=a-o;for(c=i;c>=0;c--){var d=true;for(var h=0;hn){s=n}}var r=t.length;if(r%2!==0)throw new TypeError("Invalid hex string");if(s>r/2){s=r/2}for(var a=0;ar)s=r;if(t.length>0&&(s<0||i<0)||i>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var a=false;for(;;){switch(n){case"hex":return oe(this,t,i,s);case"utf8":case"utf-8":return le(this,t,i,s);case"ascii":return ce(this,t,i,s);case"latin1":case"binary":return ue(this,t,i,s);case"base64":return de(this,t,i,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,t,i,s);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();a=true}}};Zg.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function fe(e,t,i){if(t===0&&i===e.length){return U(e)}else{return U(e.slice(t,i))}}function pe(e,t,i){i=Math.min(e.length,i);var s=[];var n=t;while(n239?4:r>223?3:r>191?2:1;if(n+o<=i){var l,c,u,d;switch(o){case 1:if(r<128){a=r}break;case 2:l=e[n+1];if((l&192)===128){d=(r&31)<<6|l&63;if(d>127){a=d}}break;case 3:l=e[n+1];c=e[n+2];if((l&192)===128&&(c&192)===128){d=(r&15)<<12|(l&63)<<6|c&63;if(d>2047&&(d<55296||d>57343)){a=d}}break;case 4:l=e[n+1];c=e[n+2];u=e[n+3];if((l&192)===128&&(c&192)===128&&(u&192)===128){d=(r&15)<<18|(l&63)<<12|(c&63)<<6|u&63;if(d>65535&&d<1114112){a=d}}}}if(a===null){a=65533;o=1}else if(a>65535){a-=65536;s.push(a>>>10&1023|55296);a=56320|a&1023}s.push(a);n+=o}return ge(s)}var me=4096;function ge(e){var t=e.length;if(t<=me){return String.fromCharCode.apply(String,e)}var i="";var s=0;while(ss)i=s;var n="";for(var r=t;rs){t=s}if(i<0){i+=s;if(i<0)i=0}else if(i>s){i=s}if(ii)throw new RangeError("Trying to access beyond buffer length")}Zg.prototype.readUIntLE=function e(t,i,s){t=t|0;i=i|0;if(!s)o(t,i,this.length);var n=this[t];var r=1;var a=0;while(++a0&&(r*=256)){n+=this[t+--i]*r}return n};Zg.prototype.readUInt8=function e(t,i){if(!i)o(t,1,this.length);return this[t]};Zg.prototype.readUInt16LE=function e(t,i){if(!i)o(t,2,this.length);return this[t]|this[t+1]<<8};Zg.prototype.readUInt16BE=function e(t,i){if(!i)o(t,2,this.length);return this[t]<<8|this[t+1]};Zg.prototype.readUInt32LE=function e(t,i){if(!i)o(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};Zg.prototype.readUInt32BE=function e(t,i){if(!i)o(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};Zg.prototype.readIntLE=function e(t,i,s){t=t|0;i=i|0;if(!s)o(t,i,this.length);var n=this[t];var r=1;var a=0;while(++a=r)n-=Math.pow(2,8*i);return n};Zg.prototype.readIntBE=function e(t,i,s){t=t|0;i=i|0;if(!s)o(t,i,this.length);var n=i;var r=1;var a=this[t+--n];while(n>0&&(r*=256)){a+=this[t+--n]*r}r*=128;if(a>=r)a-=Math.pow(2,8*i);return a};Zg.prototype.readInt8=function e(t,i){if(!i)o(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};Zg.prototype.readInt16LE=function e(t,i){if(!i)o(t,2,this.length);var s=this[t]|this[t+1]<<8;return s&32768?s|4294901760:s};Zg.prototype.readInt16BE=function e(t,i){if(!i)o(t,2,this.length);var s=this[t+1]|this[t]<<8;return s&32768?s|4294901760:s};Zg.prototype.readInt32LE=function e(t,i){if(!i)o(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};Zg.prototype.readInt32BE=function e(t,i){if(!i)o(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};Zg.prototype.readFloatLE=function e(t,i){if(!i)o(t,4,this.length);return B(this,t,true,23,4)};Zg.prototype.readFloatBE=function e(t,i){if(!i)o(t,4,this.length);return B(this,t,false,23,4)};Zg.prototype.readDoubleLE=function e(t,i){if(!i)o(t,8,this.length);return B(this,t,true,52,8)};Zg.prototype.readDoubleBE=function e(t,i){if(!i)o(t,8,this.length);return B(this,t,false,52,8)};function d(e,t,i,s,n,r){if(!h(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}Zg.prototype.writeUIntLE=function e(t,i,s,n){t=+t;i=i|0;s=s|0;if(!n){var r=Math.pow(2,8*s)-1;d(this,t,i,s,r,0)}var a=1;var o=0;this[i]=t&255;while(++o=0&&(o*=256)){this[i+a]=t/o&255}return i+s};Zg.prototype.writeUInt8=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,1,255,0);if(!Zg.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[i]=t&255;return i+1};function Te(e,t,i,s){if(t<0)t=65535+t+1;for(var n=0,r=Math.min(e.length-i,2);n>>(s?n:1-n)*8}}Zg.prototype.writeUInt16LE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,2,65535,0);if(Zg.TYPED_ARRAY_SUPPORT){this[i]=t&255;this[i+1]=t>>>8}else{Te(this,t,i,true)}return i+2};Zg.prototype.writeUInt16BE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,2,65535,0);if(Zg.TYPED_ARRAY_SUPPORT){this[i]=t>>>8;this[i+1]=t&255}else{Te(this,t,i,false)}return i+2};function Se(e,t,i,s){if(t<0)t=4294967295+t+1;for(var n=0,r=Math.min(e.length-i,4);n>>(s?n:3-n)*8&255}}Zg.prototype.writeUInt32LE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,4,4294967295,0);if(Zg.TYPED_ARRAY_SUPPORT){this[i+3]=t>>>24;this[i+2]=t>>>16;this[i+1]=t>>>8;this[i]=t&255}else{Se(this,t,i,true)}return i+4};Zg.prototype.writeUInt32BE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,4,4294967295,0);if(Zg.TYPED_ARRAY_SUPPORT){this[i]=t>>>24;this[i+1]=t>>>16;this[i+2]=t>>>8;this[i+3]=t&255}else{Se(this,t,i,false)}return i+4};Zg.prototype.writeIntLE=function e(t,i,s,n){t=+t;i=i|0;if(!n){var r=Math.pow(2,8*s-1);d(this,t,i,s,r-1,-r)}var a=0;var o=1;var l=0;this[i]=t&255;while(++a>0)-l&255}return i+s};Zg.prototype.writeIntBE=function e(t,i,s,n){t=+t;i=i|0;if(!n){var r=Math.pow(2,8*s-1);d(this,t,i,s,r-1,-r)}var a=s-1;var o=1;var l=0;this[i+a]=t&255;while(--a>=0&&(o*=256)){if(t<0&&l===0&&this[i+a+1]!==0){l=1}this[i+a]=(t/o>>0)-l&255}return i+s};Zg.prototype.writeInt8=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,1,127,-128);if(!Zg.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[i]=t&255;return i+1};Zg.prototype.writeInt16LE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,2,32767,-32768);if(Zg.TYPED_ARRAY_SUPPORT){this[i]=t&255;this[i+1]=t>>>8}else{Te(this,t,i,true)}return i+2};Zg.prototype.writeInt16BE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,2,32767,-32768);if(Zg.TYPED_ARRAY_SUPPORT){this[i]=t>>>8;this[i+1]=t&255}else{Te(this,t,i,false)}return i+2};Zg.prototype.writeInt32LE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,4,2147483647,-2147483648);if(Zg.TYPED_ARRAY_SUPPORT){this[i]=t&255;this[i+1]=t>>>8;this[i+2]=t>>>16;this[i+3]=t>>>24}else{Se(this,t,i,true)}return i+4};Zg.prototype.writeInt32BE=function e(t,i,s){t=+t;i=i|0;if(!s)d(this,t,i,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(Zg.TYPED_ARRAY_SUPPORT){this[i]=t>>>24;this[i+1]=t>>>16;this[i+2]=t>>>8;this[i+3]=t&255}else{Se(this,t,i,false)}return i+4};function Ee(e,t,i,s,n,r){if(i+s>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function we(e,t,i,s,n){if(!n){Ee(e,t,i,4)}F(e,t,i,s,23,4);return i+4}Zg.prototype.writeFloatLE=function e(t,i,s){return we(this,t,i,true,s)};Zg.prototype.writeFloatBE=function e(t,i,s){return we(this,t,i,false,s)};function ke(e,t,i,s,n){if(!n){Ee(e,t,i,8)}F(e,t,i,s,52,8);return i+8}Zg.prototype.writeDoubleLE=function e(t,i,s){return ke(this,t,i,true,s)};Zg.prototype.writeDoubleBE=function e(t,i,s){return ke(this,t,i,false,s)};Zg.prototype.copy=function e(t,i,s,n){if(!s)s=0;if(!n&&n!==0)n=this.length;if(i>=t.length)i=t.length;if(!i)i=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(t.length-i=0;--a){t[a+i]=this[a+s]}}else if(r<1e3||!Zg.TYPED_ARRAY_SUPPORT){for(a=0;a>>0;s=s===undefined?this.length:s>>>0;if(!t)t=0;var a;if(typeof t==="number"){for(a=i;a55295&&i<57344){if(!n){if(i>56319){if((t-=3)>-1)r.push(239,191,189);continue}else if(a+1===s){if((t-=3)>-1)r.push(239,191,189);continue}n=i;continue}if(i<56320){if((t-=3)>-1)r.push(239,191,189);n=i;continue}i=(n-55296<<10|i-56320)+65536}else if(n){if((t-=3)>-1)r.push(239,191,189)}n=null;if(i<128){if((t-=1)<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,i&63|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else{throw new Error("Invalid code point")}}return r}function De(e){var t=[];for(var i=0;i>8;n=i%256;r.push(n);r.push(s)}return r}function Pe(e){return R(Ce(e))}function Le(e,t,i,s){for(var n=0;n=t.length||n>=e.length)break;t[n+i]=e[n]}return n}function Re(e){return e!==e}function Ne(e){return e!=null&&(!!e._isBuffer||Me(e)||Ue(e))}function Me(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function Ue(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&Me(e.slice(0,0))}var ev=typeof globalThis!=="undefined"?globalThis:typeof tv!=="undefined"?tv:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function Be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var Fe={exports:{}};(function(i,e){(function(e,t){i.exports=t()})(ev,function(){var N="8.9.0";const M={};const U=function(e,t){M[e]=M[e]||[];if(t){M[e]=M[e].concat(t)}return M[e]};const B=function(e,t){U(e,t)};const F=function(e,t){const i=U(e).indexOf(t);if(i<=-1){return false}M[e]=M[e].slice();M[e].splice(i,1);return true};const q=function(s,e){U(s,[].concat(e).map(t=>{const i=(...e)=>{F(s,i);return t(...e)};return i}))};const V={prefixed:true};const H=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]];const $=H[0];let z;for(let e=0;e(e,t,i)=>{const s=l.levels[t];const n=new RegExp(`^(${s})$`);let r=o;if(e!=="log"){i.unshift(e.toUpperCase()+":")}if(c){r=`%c${o}`;i.unshift(c)}i.unshift(r+":");if(u){u.push([].concat(i));const e=u.length-1e3;u.splice(0,e>0?e:0)}if(!tv.console){return}let a=tv.console[e];if(!a&&e==="debug"){a=tv.console.info||tv.console.log}if(!a||!s||!n.test(e)){return}a[Array.isArray(i)?"apply":"call"](tv.console,i)};function K(a,o=":",l=""){let t="info";let i;const s=function(...e){i("log",t,e)};i=G(a,s,l);s.createLogger=(e,t,i)=>{const s=t!==undefined?t:o;const n=i!==undefined?i:l;const r=`${a} ${s} ${e}`;return K(r,s,n)};s.createNewLogger=(e,t,i)=>{return K(e,t,i)};s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t};s.level=e=>{if(typeof e==="string"){if(!s.levels.hasOwnProperty(e)){throw new Error(`"${e}" in not a valid log level`)}t=e}return t};s.history=()=>u?[].concat(u):[];s.history.filter=t=>{return(u||[]).filter(e=>{return new RegExp(`.*${t}.*`).test(e[0])})};s.history.clear=()=>{if(u){u.length=0}};s.history.disable=()=>{if(u!==null){u.length=0;u=null}};s.history.enable=()=>{if(u===null){u=[]}};s.error=(...e)=>i("error",t,e);s.warn=(...e)=>i("warn",t,e);s.debug=(...e)=>i("debug",t,e);return s}const d=K("VIDEOJS");const W=d.createLogger;const Y=Object.prototype.toString;const X=function(e){return Z(e)?Object.keys(e):[]};function Q(t,i){X(t).forEach(e=>i(t[e],e))}function J(i,s,e=0){return X(i).reduce((e,t)=>s(e,i[t],t),e)}function Z(e){return!!e&&typeof e==="object"}function ee(e){return Z(e)&&Y.call(e)==="[object Object]"&&e.constructor===Object}function h(...e){const i={};e.forEach(e=>{if(!e){return}Q(e,(e,t)=>{if(!ee(e)){i[t]=e;return}if(!ee(i[t])){i[t]={}}i[t]=h(i[t],e)})});return i}function te(e={}){const t=[];for(const i in e){if(e.hasOwnProperty(i)){const s=e[i];t.push(s)}}return t}function ie(t,i,s,e=true){const n=e=>Object.defineProperty(t,i,{value:e,enumerable:true,writable:true});const r={configurable:true,enumerable:true,get(){const e=s();n(e);return e}};if(e){r.set=n}return Object.defineProperty(t,i,r)}var se=Object.freeze({__proto__:null,each:Q,reduce:J,isObject:Z,isPlain:ee,merge:h,values:te,defineLazyProperty:ie});let ne=false;let re=null;let ae=false;let oe;let le=false;let ce=false;let ue=false;let de=false;let he=null;let fe=null;let pe=null;let me=false;let ge=false;let ve=false;let ye=false;const be=Boolean(ke()&&("ontouchstart"in tv||tv.navigator.maxTouchPoints||tv.DocumentTouch&&tv.document instanceof tv.DocumentTouch));const _e=tv.navigator&&tv.navigator.userAgentData;if(_e&&_e.platform&&_e.brands){ae=_e.platform==="Android";ce=Boolean(_e.brands.find(e=>e.brand==="Microsoft Edge"));ue=Boolean(_e.brands.find(e=>e.brand==="Chromium"));de=!ce&&ue;he=fe=(_e.brands.find(e=>e.brand==="Chromium")||{}).version||null;ge=_e.platform==="Windows"}if(!ue){const R=tv.navigator&&tv.navigator.userAgent||"";ne=/iPod/i.test(R);re=function(){const e=R.match(/OS (\d+)_/i);if(e&&e[1]){return e[1]}return null}();ae=/Android/i.test(R);oe=function(){const e=R.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e){return null}const t=e[1]&&parseFloat(e[1]);const i=e[2]&&parseFloat(e[2]);if(t&&i){return parseFloat(e[1]+"."+e[2])}else if(t){return t}return null}();le=/Firefox/i.test(R);ce=/Edg/i.test(R);ue=/Chrome/i.test(R)||/CriOS/i.test(R);de=!ce&&ue;he=fe=function(){const e=R.match(/(Chrome|CriOS)\/(\d+)/);if(e&&e[2]){return parseFloat(e[2])}return null}();pe=function(){const e=/MSIE\s(\d+)\.\d/.exec(R);let t=e&&parseFloat(e[1]);if(!t&&/Trident\/7.0/i.test(R)&&/rv:11.0/.test(R)){t=11}return t}();me=/Safari/i.test(R)&&!de&&!ae&&!ce;ge=/Windows/i.test(R);ve=/iPad/i.test(R)||me&&be&&!/iPhone/i.test(R);ye=/iPhone/i.test(R)&&!ve}const f=ye||ve||ne;const Te=(me||f)&&!de;var Se=Object.freeze({__proto__:null,get IS_IPOD(){return ne},get IOS_VERSION(){return re},get IS_ANDROID(){return ae},get ANDROID_VERSION(){return oe},get IS_FIREFOX(){return le},get IS_EDGE(){return ce},get IS_CHROMIUM(){return ue},get IS_CHROME(){return de},get CHROMIUM_VERSION(){return he},get CHROME_VERSION(){return fe},get IE_VERSION(){return pe},get IS_SAFARI(){return me},get IS_WINDOWS(){return ge},get IS_IPAD(){return ve},get IS_IPHONE(){return ye},TOUCH_ENABLED:be,IS_IOS:f,IS_ANY_SAFARI:Te});function Ee(e){return typeof e==="string"&&Boolean(e.trim())}function we(e){if(e.indexOf(" ")>=0){throw new Error("class has illegal whitespace characters")}}function ke(){return iv===tv.document}function je(e){return Z(e)&&e.nodeType===1}function Ce(){try{return tv.parent!==tv.self}catch(e){return true}}function Ie(s){return function(e,t){if(!Ee(e)){return iv[s](null)}if(Ee(t)){t=iv.querySelector(t)}const i=je(t)?t:iv;return i[s]&&i[s](e)}}function l(e="div",i={},t={},s){const n=iv.createElement(e);Object.getOwnPropertyNames(i).forEach(function(e){const t=i[e];if(e==="textContent"){xe(n,t)}else if(n[e]!==t||e==="tabIndex"){n[e]=t}});Object.getOwnPropertyNames(t).forEach(function(e){n.setAttribute(e,t[e])});if(s){We(n,s)}return n}function xe(e,t){if(typeof e.textContent==="undefined"){e.innerText=t}else{e.textContent=t}return e}function Ae(e,t){if(t.firstChild){t.insertBefore(e,t.firstChild)}else{t.appendChild(e)}}function De(e,t){we(t);return e.classList.contains(t)}function Oe(e,...t){e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[]));return e}function Pe(e,...t){if(!e){d.warn("removeClass was called with an element that doesn't exist");return null}e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[]));return e}function Le(t,e,i){if(typeof i==="function"){i=i(t,e)}if(typeof i!=="boolean"){i=undefined}e.split(/\s+/).forEach(e=>t.classList.toggle(e,i));return t}function Re(i,s){Object.getOwnPropertyNames(s).forEach(function(e){const t=s[e];if(t===null||typeof t==="undefined"||t===false){i.removeAttribute(e)}else{i.setAttribute(e,t===true?"":t)}})}function Ne(e){const i={};const s=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const n=e.attributes;for(let t=n.length-1;t>=0;t--){const r=n[t].name;let e=n[t].value;if(s.includes(r)){e=e!==null?true:false}i[r]=e}}return i}function Me(e,t){return e.getAttribute(t)}function Ue(e,t,i){e.setAttribute(t,i)}function Be(e,t){e.removeAttribute(t)}function Fe(){iv.body.focus();iv.onselectstart=function(){return false}}function qe(){iv.onselectstart=function(){return true}}function Ve(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect();const i={};["bottom","height","left","right","top","width"].forEach(e=>{if(t[e]!==undefined){i[e]=t[e]}});if(!i.height){i.height=parseFloat(Ze(e,"height"))}if(!i.width){i.width=parseFloat(Ze(e,"width"))}return i}}function He(e){if(!e||e&&!e.offsetParent){return{left:0,top:0,width:0,height:0}}const t=e.offsetWidth;const i=e.offsetHeight;let s=0;let n=0;while(e.offsetParent&&e!==iv[V.fullscreenElement]){s+=e.offsetLeft;n+=e.offsetTop;e=e.offsetParent}return{left:s,top:n,width:t,height:i}}function $e(t,e){const i={x:0,y:0};if(f){let e=t;while(e&&e.nodeName.toLowerCase()!=="html"){const t=Ze(e,"transform");if(/^matrix/.test(t)){const e=t.slice(7,-1).split(/,\s/).map(Number);i.x+=e[4];i.y+=e[5]}else if(/^matrix3d/.test(t)){const e=t.slice(9,-1).split(/,\s/).map(Number);i.x+=e[12];i.y+=e[13]}e=e.parentNode}}const s={};const n=He(e.target);const r=He(t);const a=r.width;const o=r.height;let l=e.offsetY-(r.top-n.top);let c=e.offsetX-(r.left-n.left);if(e.changedTouches){c=e.changedTouches[0].pageX-r.left;l=e.changedTouches[0].pageY+r.top;if(f){c-=i.x;l-=i.y}}s.y=1-Math.max(0,Math.min(1,l/o));s.x=Math.max(0,Math.min(1,c/a));return s}function ze(e){return Z(e)&&e.nodeType===3}function Ge(e){while(e.firstChild){e.removeChild(e.firstChild)}return e}function Ke(e){if(typeof e==="function"){e=e()}return(Array.isArray(e)?e:[e]).map(e=>{if(typeof e==="function"){e=e()}if(je(e)||ze(e)){return e}if(typeof e==="string"&&/\S/.test(e)){return iv.createTextNode(e)}}).filter(e=>e)}function We(t,e){Ke(e).forEach(e=>t.appendChild(e));return t}function Ye(e,t){return We(Ge(e),t)}function Xe(e){if(e.button===undefined&&e.buttons===undefined){return true}if(e.button===0&&e.buttons===undefined){return true}if(e.type==="mouseup"&&e.button===0&&e.buttons===0){return true}if(e.button!==0||e.buttons!==1){return false}return true}const Qe=Ie("querySelector");const Je=Ie("querySelectorAll");function Ze(t,i){if(!t||!i){return""}if(typeof tv.getComputedStyle==="function"){let e;try{e=tv.getComputedStyle(t)}catch(e){return""}return e?e.getPropertyValue(i)||e[i]:""}return""}function et(n){[...iv.styleSheets].forEach(t=>{try{const e=[...t.cssRules].map(e=>e.cssText).join("");const i=iv.createElement("style");i.textContent=e;n.document.head.appendChild(i)}catch(e){const s=iv.createElement("link");s.rel="stylesheet";s.type=t.type;s.media=t.media.mediaText;s.href=t.href;n.document.head.appendChild(s)}})}var tt=Object.freeze({__proto__:null,isReal:ke,isEl:je,isInFrame:Ce,createEl:l,textContent:xe,prependTo:Ae,hasClass:De,addClass:Oe,removeClass:Pe,toggleClass:Le,setAttributes:Re,getAttributes:Ne,getAttribute:Me,setAttribute:Ue,removeAttribute:Be,blockTextSelection:Fe,unblockTextSelection:qe,getBoundingClientRect:Ve,findPosition:He,getPointerPosition:$e,isTextNode:ze,emptyEl:Ge,normalizeContent:Ke,appendContent:We,insertContent:Ye,isSingleLeftClick:Xe,$:Qe,$$:Je,computedStyle:Ze,copyStyleSheetsToWindow:et});let it=false;let st;const nt=function(){if(st.options.autoSetup===false){return}const e=Array.prototype.slice.call(iv.getElementsByTagName("video"));const t=Array.prototype.slice.call(iv.getElementsByTagName("audio"));const i=Array.prototype.slice.call(iv.getElementsByTagName("video-js"));const s=e.concat(t,i);if(s&&s.length>0){for(let e=0,t=s.length;e-1){e={passive:true}}r.addEventListener(t,a.dispatcher,e)}else if(r.attachEvent){r.attachEvent("on"+t,a.dispatcher)}}}function c(e,t,i){if(!o.has(e)){return}const s=o.get(e);if(!s.handlers){return}if(Array.isArray(t)){return ft(c,e,t,i)}const n=function(e,t){s.handlers[t]=[];ht(e,t)};if(t===undefined){for(const a in s.handlers){if(Object.prototype.hasOwnProperty.call(s.handlers||{},a)){n(e,a)}}return}const r=s.handlers[t];if(!r){return}if(!i){n(e,t);return}if(i.guid){for(let e=0;e=s){i(...e);n=t}};return e};const kt=function(s,n,r,a=tv){let o;const e=()=>{a.clearTimeout(o);o=null};const t=function(){const e=this;const t=arguments;let i=function(){o=null;i=null;if(!r){s.apply(e,t)}};if(!o&&r){s.apply(e,t)}a.clearTimeout(o);o=a.setTimeout(i,n)};t.cancel=e;return t};var jt=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Et,bind_:p,throttle:wt,debounce:kt});let Ct;class It{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{};yt(this,e,t);this.addEventListener=i}off(e,t){c(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{};_t(this,e,t);this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{};Tt(this,e,t);this.addEventListener=i}trigger(e){const t=e.type||e;if(typeof e==="string"){e={type:t}}e=pt(e);if(this.allowedEvents_[t]&&this["on"+t]){this["on"+t](e)}bt(this,e)}queueTrigger(e){if(!Ct){Ct=new Map}const t=e.type||e;let i=Ct.get(this);if(!i){i=new Map;Ct.set(this,i)}const s=i.get(t);i.delete(t);tv.clearTimeout(s);const n=tv.setTimeout(()=>{i.delete(t);if(i.size===0){i=null;Ct.delete(this)}this.trigger(e)},0);i.set(t,n)}}It.prototype.allowedEvents_={};It.prototype.addEventListener=It.prototype.on;It.prototype.removeEventListener=It.prototype.off;It.prototype.dispatchEvent=It.prototype.trigger;const xt=e=>{if(typeof e.name==="function"){return e.name()}if(typeof e.name==="string"){return e.name}if(e.name_){return e.name_}if(e.constructor&&e.constructor.name){return e.constructor.name}return typeof e};const At=t=>t instanceof It||!!t.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof t[e]==="function");const Dt=(e,t)=>{if(At(e)){t()}else{if(!e.eventedCallbacks){e.eventedCallbacks=[]}e.eventedCallbacks.push(t)}};const Ot=e=>typeof e==="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length;const Pt=(e,t,i)=>{if(!e||!e.nodeName&&!At(e)){throw new Error(`Invalid target for ${xt(t)}#${i}; must be a DOM node or evented object.`)}};const Lt=(e,t,i)=>{if(!Ot(e)){throw new Error(`Invalid event type for ${xt(t)}#${i}; must be a non-empty string or array.`)}};const Rt=(e,t,i)=>{if(typeof e!=="function"){throw new Error(`Invalid listener for ${xt(t)}#${i}; must be a function.`)}};const Nt=(e,t,i)=>{const s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let n;let r;let a;if(s){n=e.eventBusEl_;if(t.length>=3){t.shift()}[r,a]=t}else{[n,r,a]=t}Pt(n,e,i);Lt(r,e,i);Rt(a,e,i);a=p(e,a);return{isTargetingSelf:s,target:n,type:r,listener:a}};const Mt=(e,t,i,s)=>{Pt(e,e,t);if(e.nodeName){St[t](e,i,s)}else{e[t](i,s)}};const Ut={on(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=Nt(this,e,"on");Mt(i,"on",s,n);if(!t){const r=()=>this.off(i,s,n);r.guid=n.guid;const a=()=>this.off("dispose",r);a.guid=n.guid;Mt(this,"on","dispose",r);Mt(i,"on","dispose",a)}},one(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=Nt(this,e,"one");if(t){Mt(i,"one",s,n)}else{const r=(...e)=>{this.off(i,s,r);n.apply(null,e)};r.guid=n.guid;Mt(i,"one",s,r)}},any(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=Nt(this,e,"any");if(t){Mt(i,"any",s,n)}else{const r=(...e)=>{this.off(i,s,r);n.apply(null,e)};r.guid=n.guid;Mt(i,"any",s,r)}},off(e,t,i){if(!e||Ot(e)){c(this.eventBusEl_,e,t)}else{const s=e;const n=t;Pt(s,this,"off");Lt(n,this,"off");Rt(i,this,"off");i=p(this,i);this.off("dispose",i);if(s.nodeName){c(s,n,i);c(s,"dispose",i)}else if(At(s)){s.off(n,i);s.off("dispose",i)}}},trigger(e,t){Pt(this.eventBusEl_,this,"trigger");const i=e&&typeof e!=="string"?e.type:e;if(!Ot(i)){throw new Error(`Invalid event type for ${xt(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.")}return bt(this.eventBusEl_,e,t)}};function Bt(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName){throw new Error(`The eventBusKey "${i}" does not refer to an element.`)}e.eventBusEl_=e[i]}else{e.eventBusEl_=l("span",{className:"vjs-event-bus"})}Object.assign(e,Ut);if(e.eventedCallbacks){e.eventedCallbacks.forEach(e=>{e()})}e.on("dispose",()=>{e.off();[e,e.el_,e.eventBusEl_].forEach(function(e){if(e&&o.has(e)){o.delete(e)}});tv.setTimeout(()=>{e.eventBusEl_=null},0)});return e}const Ft={state:{},setState(e){if(typeof e==="function"){e=e()}let i;Q(e,(e,t)=>{if(this.state[t]!==e){i=i||{};i[t]={from:this.state[t],to:e}}this.state[t]=e});if(i&&At(this)){this.trigger({changes:i,type:"statechanged"})}return i}};function qt(e,t){Object.assign(e,Ft);e.state=Object.assign({},e.state,t);if(typeof e.handleStateChanged==="function"&&At(e)){e.on("statechanged",e.handleStateChanged)}return e}const Vt=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toLowerCase())};const m=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toUpperCase())};const Ht=function(e,t){return m(e)===m(t)};var $t=Object.freeze({__proto__:null,toLowerCase:Vt,toTitleCase:m,titleCaseEquals:Ht});var zt=typeof globalThis!=="undefined"?globalThis:typeof tv!=="undefined"?tv:typeof ev!=="undefined"?ev:typeof self!=="undefined"?self:{};function Gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function Kt(e,t){return t={exports:{}},e(t,t.exports),t.exports}var a=Kt(function(e,t){function i(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;if(t)e=t}if("number"===typeof e)return n[e];var i=String(e);var s=r[i.toLowerCase()];if(s)return s;var s=a[i.toLowerCase()];if(s)return s;if(i.length===1)return i.charCodeAt(0);return undefined}i.isEventKey=function e(t,i){if(t&&"object"===typeof t){var s=t.which||t.keyCode||t.charCode;if(s===null||s===undefined){return false}if(typeof i==="string"){var n=r[i.toLowerCase()];if(n){return n===s}var n=a[i.toLowerCase()];if(n){return n===s}}else if(typeof i==="number"){return i===s}return false}};t=e.exports=i;var r=t.code=t.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};var a=t.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":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};for(s=97;s<123;s++)r[String.fromCharCode(s)]=s-32;for(var s=48;s<58;s++)r[s-48]=s;for(s=1;s<13;s++)r["f"+s]=s+111;for(s=0;s<10;s++)r["numpad "+s]=s+96;var n=t.names=t.title={};for(s in r)n[r[s]]=s;for(var o in a){r[o]=a[o]}});a.code;a.codes;a.aliases;a.names;a.title;class g{constructor(e,t,i){if(!e&&this.play){this.player_=e=this}else{this.player_=e}this.isDisposed_=false;this.parentComponent_=null;this.options_=h({},this.options_);t=this.options_=h(this.options_,t);this.id_=t.id||t.el&&t.el.id;if(!this.id_){const s=e&&e.id&&e.id()||"no_player";this.id_=`${s}_component_${dt()}`}this.name_=t.name||null;if(t.el){this.el_=t.el}else if(t.createEl!==false){this.el_=this.createEl()}if(t.className&&this.el_){t.className.split(" ").forEach(e=>this.addClass(e))}["on","off","one","any","trigger"].forEach(e=>{this[e]=undefined});if(t.evented!==false){Bt(this,{eventBusKey:this.el_?"el_":null});this.handleLanguagechange=this.handleLanguagechange.bind(this);this.on(this.player_,"languagechange",this.handleLanguagechange)}qt(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};this.setTimeoutIds_=new Set;this.setIntervalIds_=new Set;this.rafIds_=new Set;this.namedRafs_=new Map;this.clearingTimersOnDispose_=false;if(t.initChildren!==false){this.initChildren()}this.ready(i);if(t.reportTouchActivity!==false){this.enableTouchActivity()}}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(this.isDisposed_){return}if(this.readyQueue_){this.readyQueue_.length=0}this.trigger({type:"dispose",bubbles:false});this.isDisposed_=true;if(this.children_){for(let e=this.children_.length-1;e>=0;e--){if(this.children_[e].dispose){this.children_[e].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){if(e.restoreEl){this.el_.parentNode.replaceChild(e.restoreEl,this.el_)}else{this.el_.parentNode.removeChild(this.el_)}}this.el_=null}this.player_=null}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){if(!e){return this.options_}this.options_=h(this.options_,e);return this.options_}el(){return this.el_}createEl(e,t,i){return l(e,t,i)}localize(e,n,t=e){const i=this.player_.language&&this.player_.language();const s=this.player_.languages&&this.player_.languages();const r=s&&s[i];const a=i&&i.split("-")[0];const o=s&&s[a];let l=t;if(r&&r[e]){l=r[e]}else if(o&&o[e]){l=o[e]}if(n){l=l.replace(/\{(\d+)\}/g,function(e,t){const i=n[t-1];let s=i;if(typeof i==="undefined"){s=e}return s})}return l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(!e){return}return this.childNameIndex_[e]}getDescendant(...t){t=t.reduce((e,t)=>e.concat(t),[]);let i=this;for(let e=0;e=0;e--){if(this.children_[e]===t){i=true;this.children_.splice(e,1);break}}if(!i){return}t.parentComponent_=null;this.childIndex_[t.id()]=null;this.childNameIndex_[m(t.name())]=null;this.childNameIndex_[Vt(t.name())]=null;const e=t.el();if(e&&e.parentNode===this.contentEl()){this.contentEl().removeChild(t.el())}}initChildren(){const s=this.options_.children;if(s){const n=this.options_;const t=e=>{const t=e.name;let i=e.opts;if(n[t]!==undefined){i=n[t]}if(i===false){return}if(i===true){i={}}i.playerOptions=this.options_.playerOptions;const s=this.addChild(t,i);if(s){this[t]=s}};let e;const i=g.getComponent("Tech");if(Array.isArray(s)){e=s}else{e=Object.keys(s)}e.concat(Object.keys(this.options_).filter(function(t){return!e.some(function(e){if(typeof e==="string"){return t===e}return t===e.name})})).map(e=>{let t;let i;if(typeof e==="string"){t=e;i=s[t]||this.options_[t]||{}}else{t=e.name;i=e}return{name:t,opts:i}}).filter(e=>{const t=g.getComponent(e.opts.componentClass||m(e.name));return t&&!i.isTech(t)}).forEach(t)}}buildCSSClass(){return""}ready(e,t=false){if(!e){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(e);return}if(t){e.call(this)}else{this.setTimeout(e,1)}}triggerReady(){this.isReady_=true;this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[];if(e&&e.length>0){e.forEach(function(e){e.call(this)},this)}this.trigger("ready")},1)}$(e,t){return Qe(e,t||this.contentEl())}$$(e,t){return Je(e,t||this.contentEl())}hasClass(e){return De(this.el_,e)}addClass(...e){Oe(this.el_,...e)}removeClass(...e){Pe(this.el_,...e)}toggleClass(e,t){Le(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return Me(this.el_,e)}setAttribute(e,t){Ue(this.el_,e,t)}removeAttribute(e){Be(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,true);this.height(t)}dimension(e,t,i){if(t!==undefined){if(t===null||t!==t){t=0}if((""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1){this.el_.style[e]=t}else if(t==="auto"){this.el_.style[e]=""}else{this.el_.style[e]=t+"px"}if(!i){this.trigger("componentresize")}return}if(!this.el_){return 0}const s=this.el_.style[e];const n=s.indexOf("px");if(n!==-1){return parseInt(s.slice(0,n),10)}return parseInt(this.el_["offset"+m(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height"){throw new Error("currentDimension only accepts width or height value")}t=Ze(this.el_,e);t=parseFloat(t);if(t===0||isNaN(t)){const i=`offset${m(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){if(this.player_){if(!a.isEventKey(e,"Tab")){e.stopPropagation()}this.player_.handleKeyDown(e)}}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let i=0;let n=null;const r=10;const s=200;let a;this.on("touchstart",function(e){if(e.touches.length===1){n={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY};i=tv.performance.now();a=true}});this.on("touchmove",function(e){if(e.touches.length>1){a=false}else if(n){const t=e.touches[0].pageX-n.pageX;const i=e.touches[0].pageY-n.pageY;const s=Math.sqrt(t*t+i*i);if(s>r){a=false}}});const e=function(){a=false};this.on("touchleave",e);this.on("touchcancel",e);this.on("touchend",function(e){n=null;if(a===true){const t=tv.performance.now()-i;if(t{if(this.setTimeoutIds_.has(i)){this.setTimeoutIds_.delete(i)}e()},t);this.setTimeoutIds_.add(i);return i}clearTimeout(e){if(this.setTimeoutIds_.has(e)){this.setTimeoutIds_.delete(e);tv.clearTimeout(e)}return e}setInterval(e,t){e=p(this,e);this.clearTimersOnDispose_();const i=tv.setInterval(e,t);this.setIntervalIds_.add(i);return i}clearInterval(e){if(this.setIntervalIds_.has(e)){this.setIntervalIds_.delete(e);tv.clearInterval(e)}return e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;e=p(this,e);t=tv.requestAnimationFrame(()=>{if(this.rafIds_.has(t)){this.rafIds_.delete(t)}e()});this.rafIds_.add(t);return t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e)){return}this.clearTimersOnDispose_();t=p(this,t);const i=this.requestAnimationFrame(()=>{t();if(this.namedRafs_.has(e)){this.namedRafs_.delete(e)}});this.namedRafs_.set(e,i);return e}cancelNamedAnimationFrame(e){if(!this.namedRafs_.has(e)){return}this.cancelAnimationFrame(this.namedRafs_.get(e));this.namedRafs_.delete(e)}cancelAnimationFrame(e){if(this.rafIds_.has(e)){this.rafIds_.delete(e);tv.cancelAnimationFrame(e)}return e}clearTimersOnDispose_(){if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=true;this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,i])=>{this[e].forEach((e,t)=>this[i](t))});this.clearingTimersOnDispose_=false})}static registerComponent(t,e){if(typeof t!=="string"||!t){throw new Error(`Illegal component name, "${t}"; must be a non-empty string.`)}const i=g.getComponent("Tech");const s=i&&i.isTech(e);const n=g===e||g.prototype.isPrototypeOf(e.prototype);if(s||!n){let e;if(s){e="techs must be registered using Tech.registerTech()"}else{e="must be a Component subclass"}throw new Error(`Illegal component, "${t}"; ${e}.`)}t=m(t);if(!g.components_){g.components_={}}const r=g.getComponent("Player");if(t==="Player"&&r&&r.players){const a=r.players;const o=Object.keys(a);if(a&&o.length>0&&o.map(e=>a[e]).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}g.components_[t]=e;g.components_[Vt(t)]=e;return e}static getComponent(e){if(!e||!g.components_){return}return g.components_[e]}}g.registerComponent("Component",g);function Wt(e,t,i){if(typeof t!=="number"||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}).`)}}function Yt(e,t,i,s){Wt(e,s,i.length-1);return i[s][t]}function Xt(e){let t;if(e===undefined||e.length===0){t={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}}else{t={length:e.length,start:Yt.bind(null,"start",0,e),end:Yt.bind(null,"end",1,e)}}if(tv.Symbol&&tv.Symbol.iterator){t[tv.Symbol.iterator]=()=>(e||[]).values()}return t}function Qt(e,t){if(Array.isArray(e)){return Xt(e)}else if(e===undefined||t===undefined){return Xt()}return Xt([[e,t]])}const Jt=function(e,t){e=e<0?0:e;let i=Math.floor(e%60);let s=Math.floor(e/60%60);let n=Math.floor(e/3600);const r=Math.floor(t/60%60);const a=Math.floor(t/3600);if(isNaN(e)||e===Infinity){n=s=i="-"}n=n>0||a>0?n+":":"";s=((n||r>=10)&&s<10?"0"+s:s)+":";i=i<10?"0"+i:i;return n+s+i};let Zt=Jt;function ei(e){Zt=e}function ti(){Zt=Jt}function ii(e,t=e){return Zt(e,t)}var si=Object.freeze({__proto__:null,createTimeRanges:Qt,createTimeRange:Qt,setFormatTime:ei,resetFormatTime:ti,formatTime:ii});function ni(t,i){let s=0;let n;let r;if(!i){return 0}if(!t||!t.length){t=Qt(0,0)}for(let e=0;ei){r=i}s+=r-n}return s/i}function t(e){if(e instanceof t){return e}if(typeof e==="number"){this.code=e}else if(typeof e==="string"){this.message=e}else if(Z(e)){if(typeof e.code==="number"){this.code=e.code}Object.assign(this,e)}if(!this.message){this.message=t.defaultMessages[this.code]||""}}t.prototype.code=0;t.prototype.message="";t.prototype.status=null;t.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];t.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let e=0;e{})}}const ci=function(s){const e=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>{if(s[t]){e[t]=s[t]}return e},{cues:s.cues&&Array.prototype.map.call(s.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})});return e};const ui=function(e){const t=e.$$("track");const i=Array.prototype.map.call(t,e=>e.track);const s=Array.prototype.map.call(t,function(e){const t=ci(e.track);if(e.src){t.src=e.src}return t});return s.concat(Array.prototype.filter.call(e.textTracks(),function(e){return i.indexOf(e)===-1}).map(ci))};const di=function(e,i){e.forEach(function(e){const t=i.addRemoteTextTrack(e).track;if(!e.src&&e.cues){e.cues.forEach(e=>t.addCue(e))}});return i.textTracks()};var hi={textTracksToJson:ui,jsonToTextTracks:di,trackToJson_:ci};const fi="vjs-modal-dialog";class pi extends g{constructor(e,t){super(e,t);this.handleKeyDown_=e=>this.handleKeyDown(e);this.close_=e=>this.close(e);this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=false;this.closeable(!this.options_.uncloseable);this.content(this.options_.content);this.contentEl_=l("div",{className:`${fi}-content`},{role:"document"});this.descEl_=l("p",{className:`${fi}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")});xe(this.descEl_,this.description());this.el_.appendChild(this.descEl_);this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog"})}dispose(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;super.dispose()}buildCSSClass(){return`${fi} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return e}open(){if(!this.opened_){const e=this.player();this.trigger("beforemodalopen");this.opened_=true;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!e.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){e.pause()}this.on("keydown",this.handleKeyDown_);this.hadControls_=e.controls();e.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=true}}opened(e){if(typeof e==="boolean"){this[e?"open":"close"]()}return this.opened_}close(){if(!this.opened_){return}const e=this.player();this.trigger("beforemodalclose");this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){e.play()}this.off("keydown",this.handleKeyDown_);if(this.hadControls_){e.controls(true)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();if(this.options_.temporary){this.dispose()}}closeable(t){if(typeof t==="boolean"){const i=this.closeable_=!!t;let e=this.getChild("closeButton");if(i&&!e){const s=this.contentEl_;this.contentEl_=this.el_;e=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=s;this.on(e,"close",this.close_)}if(!i&&e){this.off(e,"close",this.close_);this.removeChild(e);e.dispose()}}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl();const i=t.parentNode;const s=t.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=true;i.removeChild(t);this.empty();Ye(t,e);this.trigger("modalfill");if(s){i.insertBefore(t,s)}else{i.appendChild(t)}const n=this.getChild("closeButton");if(n){i.appendChild(n.el_)}}empty(){this.trigger("beforemodalempty");Ge(this.contentEl());this.trigger("modalempty")}content(e){if(typeof e!=="undefined"){this.content_=e}return this.content_}conditionalFocus_(){const e=iv.activeElement;const t=this.player_.el_;this.previouslyActiveEl_=null;if(t.contains(e)||t===e){this.previouslyActiveEl_=e;this.focus()}}conditionalBlur_(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}}handleKeyDown(e){e.stopPropagation();if(a.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault();this.close();return}if(!a.isEventKey(e,"Tab")){return}const t=this.focusableEls_();const i=this.el_.querySelector(":focus");let s;for(let e=0;e{return(e instanceof tv.HTMLAnchorElement||e instanceof tv.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof tv.HTMLInputElement||e instanceof tv.HTMLSelectElement||e instanceof tv.HTMLTextAreaElement||e instanceof tv.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof tv.HTMLIFrameElement||e instanceof tv.HTMLObjectElement||e instanceof tv.HTMLEmbedElement||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!==-1||e.hasAttribute("contenteditable")})}}pi.prototype.options_={pauseOnOpen:true,temporary:true};g.registerComponent("ModalDialog",pi);class mi extends It{constructor(t=[]){super();this.tracks_=[];Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let e=0;e{this.trigger({track:e,type:"labelchange",target:this})};if(At(e)){e.addEventListener("labelchange",e.labelchange_)}}removeTrack(i){let s;for(let e=0,t=this.length;e=0;e--){if(t[e].enabled){gi(t,t[e]);break}}super(t);this.changing_=false}addTrack(e){if(e.enabled){gi(this,e)}super.addTrack(e);if(!e.addEventListener){return}e.enabledChange_=()=>{if(this.changing_){return}this.changing_=true;gi(this,e);this.changing_=false;this.trigger("change")};e.addEventListener("enabledchange",e.enabledChange_)}removeTrack(e){super.removeTrack(e);if(e.removeEventListener&&e.enabledChange_){e.removeEventListener("enabledchange",e.enabledChange_);e.enabledChange_=null}}}const yi=function(t,i){for(let e=0;e=0;e--){if(t[e].selected){yi(t,t[e]);break}}super(t);this.changing_=false;Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e{if(this.changing_){return}this.changing_=true;yi(this,e);this.changing_=false;this.trigger("change")};e.addEventListener("selectedchange",e.selectedChange_)}removeTrack(e){super.removeTrack(e);if(e.removeEventListener&&e.selectedChange_){e.removeEventListener("selectedchange",e.selectedChange_);e.selectedChange_=null}}}class _i extends mi{addTrack(e){super.addTrack(e);if(!this.queueChange_){this.queueChange_=()=>this.queueTrigger("change")}if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")}e.addEventListener("modechange",this.queueChange_);const t=["metadata","chapters"];if(t.indexOf(e.kind)===-1){e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}}removeTrack(e){super.removeTrack(e);if(e.removeEventListener){if(this.queueChange_){e.removeEventListener("modechange",this.queueChange_)}if(this.selectedlanguagechange_){e.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}}}class Ti{constructor(i=[]){this.trackElements_=[];Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let e=0,t=i.length;e=400&&t.statusCode<=599){var s=i;if(a){if(Li.TextDecoder){var n=qi(t.headers&&t.headers["content-type"]);try{s=new TextDecoder(n).decode(i)}catch(e){}}else{s=String.fromCharCode.apply(null,new Uint8Array(i))}}r({cause:s});return}r(null,i)}};function qi(e){if(e===void 0){e=""}return e.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),s=i[0],n=i[1];if(s.trim()==="charset"){return n.trim()}return e},"utf-8")}var Vi=Fi;Yi.httpHandler=Vi;var Hi=function e(t){var n={};if(!t){return n}t.trim().split("\n").forEach(function(e){var t=e.indexOf(":");var i=e.slice(0,t).trim().toLowerCase();var s=e.slice(t+1).trim();if(typeof n[i]==="undefined"){n[i]=s}else if(Array.isArray(n[i])){n[i].push(s)}else{n[i]=[n[i],s]}});return n};var $i=Yi;var zi=Yi;Yi.XMLHttpRequest=Li.XMLHttpRequest||Ji;Yi.XDomainRequest="withCredentials"in new Yi.XMLHttpRequest?Yi.XMLHttpRequest:Li.XDomainRequest;Gi(["get","put","post","patch","head","delete"],function(s){Yi[s==="delete"?"del":s]=function(e,t,i){t=Wi(e,t,i);t.method=s.toUpperCase();return Xi(t)}});function Gi(e,t){for(var i=0;i0){g=setTimeout(function(){if(c)return;c=true;o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";t(e)},n.timeout)}if(o.setRequestHeader){for(l in f){if(f.hasOwnProperty(l)){o.setRequestHeader(l,f[l])}}}else if(n.headers&&!Ki(n.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in n){o.responseType=n.responseType}if("beforeSend"in n&&typeof n.beforeSend==="function"){n.beforeSend(o)}o.send(h||null);return o}function Qi(e){try{if(e.responseType==="document"){return e.responseXML}var t=e.responseXML&&e.responseXML.documentElement.nodeName==="parsererror";if(e.responseType===""&&!t){return e.responseXML}}catch(e){}return null}function Ji(){}$i.default=zi;const Zi=function(e,t){const i=new tv.WebVTT.Parser(tv,tv.vttjs,tv.WebVTT.StringDecoder());const s=[];i.oncue=function(e){t.addCue(e)};i.onparsingerror=function(e){s.push(e)};i.onflush=function(){t.trigger({type:"loadeddata",target:t})};i.parse(e);if(s.length>0){if(tv.console&&tv.console.groupCollapsed){tv.console.groupCollapsed(`Text Track parsing errors for ${t.src}`)}s.forEach(e=>d.error(e));if(tv.console&&tv.console.groupEnd){tv.console.groupEnd()}}i.flush()};const es=function(e,s){const t={uri:e};const i=Di(e);if(i){t.cors=i}const n=s.tech_.crossOrigin()==="use-credentials";if(n){t.withCredentials=n}$i(t,p(this,function(e,t,i){if(e){return d.error(e,t)}s.loaded_=true;if(typeof tv.WebVTT!=="function"){if(s.tech_){s.tech_.any(["vttjsloaded","vttjserror"],e=>{if(e.type==="vttjserror"){d.error(`vttjs failed to load, stopping trying to process ${s.src}`);return}return Zi(i,s)})}}else{Zi(i,s)}}))};class ts extends Ci{constructor(e={}){if(!e.tech){throw new Error("A tech was not provided.")}const t=h(e,{kind:ki[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=ji[t.mode]||"disabled";const s=t.default;if(t.kind==="metadata"||t.kind==="chapters"){i="hidden"}super(t);this.tech_=t.tech;this.cues_=[];this.activeCues_=[];this.preload_=this.tech_.preloadTextTracks!==false;const n=new Si(this.cues_);const r=new Si(this.activeCues_);let a=false;this.timeupdateHandler=p(this,function(e={}){if(this.tech_.isDisposed()){return}if(!this.tech_.isReady_){if(e.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}return}this.activeCues=this.activeCues;if(a){this.trigger("cuechange");a=false}if(e.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}});const o=()=>{this.stopTracking()};this.tech_.one("dispose",o);if(i!=="disabled"){this.startTracking()}Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return i},set(e){if(!ji[e]){return}if(i===e){return}i=e;if(!this.preload_&&i!=="disabled"&&this.cues.length===0){es(this.src,this)}this.stopTracking();if(i!=="disabled"){this.startTracking()}this.trigger("modechange")}},cues:{get(){if(!this.loaded_){return null}return n},set(){}},activeCues:{get(){if(!this.loaded_){return null}if(this.cues.length===0){return r}const i=this.tech_.currentTime();const s=[];for(let e=0,t=this.cues.length;e=i){s.push(n)}}a=false;if(s.length!==this.activeCues_.length){a=true}else{for(let e=0;e{t=ns.LOADED;this.trigger({type:"load",target:this})})}}ns.prototype.allowedEvents_={load:"load"};ns.NONE=0;ns.LOADING=1;ns.LOADED=2;ns.ERROR=3;const rs={audio:{ListClass:vi,TrackClass:is,capitalName:"Audio"},video:{ListClass:bi,TrackClass:ss,capitalName:"Video"},text:{ListClass:_i,TrackClass:ts,capitalName:"Text"}};Object.keys(rs).forEach(function(e){rs[e].getterName=`${e}Tracks`;rs[e].privateName=`${e}Tracks_`});const as={remoteText:{ListClass:_i,TrackClass:ts,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Ti,TrackClass:ns,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}};const v=Object.assign({},rs,as);as.names=Object.keys(as);rs.names=Object.keys(rs);v.names=[].concat(as.names).concat(rs.names);var os={};var ls=typeof zt!=="undefined"?zt:typeof tv!=="undefined"?tv:{};var cs;if(typeof iv!=="undefined"){cs=iv}else{cs=ls["__GLOBAL_DOCUMENT_CACHE@4"];if(!cs){cs=ls["__GLOBAL_DOCUMENT_CACHE@4"]=os}}var us=cs;var ds=Object.create||function(){function t(){}return function(e){if(arguments.length!==1){throw new Error("Object.create shim only accepts one parameter.")}t.prototype=e;return new t}}();function hs(e,t){this.name="ParsingError";this.code=e.code;this.message=t||e.message}hs.prototype=ds(Error.prototype);hs.prototype.constructor=hs;hs.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function fs(e){function t(e,t,i,s){return(e|0)*3600+(t|0)*60+(i|0)+(s|0)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!i){return null}if(i[3]){return t(i[1],i[2],i[3].replace(":",""),i[4])}else if(i[1]>59){return t(i[1],i[2],0,i[4])}else{return t(0,i[1],i[2],i[4])}}function ps(){this.values=ds(null)}ps.prototype={set:function(e,t){if(!this.get(e)&&t!==""){this.values[e]=t}},get:function(e,t,i){if(i){return this.has(e)?this.values[e]:t[i]}return this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var s=0;s=0&&t<=100){this.set(e,t);return true}}return false}};function ms(e,t,i,s){var n=s?e.split(s):[e];for(var r in n){if(typeof n[r]!=="string"){continue}var a=n[r].split(i);if(a.length!==2){continue}var o=a[0].trim();var l=a[1].trim();t(o,l)}}function gs(t,e,a){var i=t;function s(){var e=fs(t);if(e===null){throw new hs(hs.Errors.BadTimeStamp,"Malformed timestamp: "+i)}t=t.replace(/^[^\sa-zA-Z-]+/,"");return e}function n(e,t){var r=new ps;ms(e,function(e,t){switch(e){case"region":for(var i=a.length-1;i>=0;i--){if(a[i].id===t){r.set(e,a[i].region);break}}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),n=s[0];r.integer(e,n);r.percent(e,n)?r.set("snapToLines",false):null;r.alt(e,n,["auto"]);if(s.length===2){r.alt("lineAlign",s[1],["start","center","end"])}break;case"position":s=t.split(",");r.percent(e,s[0]);if(s.length===2){r.alt("positionAlign",s[1],["start","center","end"])}break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","center","end","left","right"]);break}},/:/,/\s/);t.region=r.get("region",null);t.vertical=r.get("vertical","");try{t.line=r.get("line","auto")}catch(e){}t.lineAlign=r.get("lineAlign","start");t.snapToLines=r.get("snapToLines",true);t.size=r.get("size",100);try{t.align=r.get("align","center")}catch(e){t.align=r.get("align","middle")}try{t.position=r.get("position","auto")}catch(e){t.position=r.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=r.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}function r(){t=t.replace(/^\s+/,"")}r();e.startTime=s();r();if(t.substr(0,3)!=="--\x3e"){throw new hs(hs.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+i)}t=t.substr(3);r();e.endTime=s();r();n(t,e)}var vs=us.createElement&&us.createElement("textarea");var ys={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var bs={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)"};var _s={v:"title",lang:"lang"};var Ts={rt:"ruby"};function Ss(r,i){function e(){if(!i){return null}function e(e){i=i.substr(e.length);return e}var t=i.match(/^([^<]*)(<[^>]*>?)?/);return e(t[1]?t[1]:t[2])}function t(e){vs.innerHTML=e;e=vs.textContent;vs.textContent="";return e}function s(e,t){return!Ts[t.localName]||Ts[t.localName]===e.localName}function n(e,t){var i=ys[e];if(!i){return null}var s=r.document.createElement(i);var n=_s[e];if(n&&t){s[n]=t.trim()}return s}var a=r.document.createElement("div"),o=a,l,c=[];while((l=e())!==null){if(l[0]==="<"){if(l[1]==="/"){if(c.length&&c[c.length-1]===l.substr(2).replace(">","")){c.pop();o=o.parentNode}continue}var u=fs(l.substr(1,l.length-2));var d;if(u){d=r.document.createProcessingInstruction("timestamp",u);o.appendChild(d);continue}var h=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h){continue}d=n(h[1],h[3]);if(!d){continue}if(!s(o,d)){continue}if(h[2]){var f=h[2].split(".");f.forEach(function(e){var t=/^bg_/.test(e);var i=t?e.slice(3):e;if(bs.hasOwnProperty(i)){var s=t?"background-color":"color";var n=bs[i];d.style[s]=n}});d.className=f.join(" ")}c.push(h[1]);o.appendChild(d);o=d;continue}o.appendChild(r.document.createTextNode(t(l)))}return a}var Es=[[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 ws(e){for(var t=0;t=i[0]&&e<=i[1]){return true}}return false}function ks(e){var t=[],i="",s;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)/);if(s){e.length=0;return s[0]}return i}if(t.tagName==="ruby"){return r(e)}if(t.childNodes){n(e,t);return r(e)}}n(t,e);while(i=r(t)){for(var a=0;a=0&&e.line<=100)){return e.line}if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement){return-1}var t=e.track,i=t.textTrackList,s=0;for(var n=0;ne.left&&this.tope.top};y.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right};y.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}};y.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),s=t*i;return s/(this.height*this.width)};y.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}};y.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0;var i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0;var s=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var n={left:e.left,right:e.right,top:e.top||s,height:e.height||t,bottom:e.bottom||s+(e.height||t),width:e.width||i};return n};function xs(e,t,o,l){function i(e,t){var i,s=new y(e),n=1;for(var r=0;ra){i=new y(e);n=a}e=new y(s)}return i||s}var s=new y(t),n=t.cue,r=js(n),a=[];if(n.snapToLines){var c;switch(n.vertical){case"":a=["+y","-y"];c="height";break;case"rl":a=["+x","-x"];c="width";break;case"lr":a=["-x","+x"];c="width";break}var u=s.lineHeight,d=u*Math.round(r),h=o[c]+u,f=a[0];if(Math.abs(d)>h){d=d<0?-1:1;d*=Math.ceil(h/u)*u}if(r<0){d+=n.vertical===""?o.height:o.width;a=a.reverse()}s.move(f,d)}else{var p=s.lineHeight/o.height*100;switch(n.lineAlign){case"center":r-=p/2;break;case"end":r-=p;break}switch(n.vertical){case"":t.applyStyles({top:t.formatStyle(r,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(r,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(r,"%")});break}a=["+y","-x","+x","-y"];s=new y(t)}var m=i(s,a);t.move(m.toCSSCompatValues(o))}function As(){}As.StringDecoder=function(){return{decode:function(e){if(!e){return""}if(typeof e!=="string"){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(e))}}};As.convertCueToDOMTree=function(e,t){if(!e||!t){return null}return Ss(e,t)};var Ds=.05;var Os="sans-serif";var Ps="1.5%";As.processCues=function(s,n,e){if(!s||!n||!e){return null}while(e.firstChild){e.removeChild(e.firstChild)}var r=s.document.createElement("div");r.style.position="absolute";r.style.left="0";r.style.right="0";r.style.top="0";r.style.bottom="0";r.style.margin=Ps;e.appendChild(r);function t(e){for(var t=0;t100){throw new Error("Position must be between 0 and 100.")}f=e;this.hasBeenReset=true}},positionAlign:{enumerable:true,get:function(){return p},set:function(e){var t=Bs(e);if(!t){console.warn("positionAlign: an invalid or illegal string was specified.")}else{p=t;this.hasBeenReset=true}}},size:{enumerable:true,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=true}},align:{enumerable:true,get:function(){return g},set:function(e){var t=Bs(e);if(!t){throw new SyntaxError("align: an invalid or illegal alignment string was specified.")}g=t;this.hasBeenReset=true}}});this.displayState=undefined}Fs.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(tv,this.text)};var qs=Fs;var Vs={"":true,up:true};function Hs(e){if(typeof e!=="string"){return false}var t=Vs[e.toLowerCase()];return t?e.toLowerCase():false}function $s(e){return typeof e==="number"&&e>=0&&e<=100}function zs(){var t=100;var i=3;var s=0;var n=100;var r=0;var a=100;var o="";Object.defineProperties(this,{width:{enumerable:true,get:function(){return t},set:function(e){if(!$s(e)){throw new Error("Width must be between 0 and 100.")}t=e}},lines:{enumerable:true,get:function(){return i},set:function(e){if(typeof e!=="number"){throw new TypeError("Lines must be set to a number.")}i=e}},regionAnchorY:{enumerable:true,get:function(){return n},set:function(e){if(!$s(e)){throw new Error("RegionAnchorX must be between 0 and 100.")}n=e}},regionAnchorX:{enumerable:true,get:function(){return s},set:function(e){if(!$s(e)){throw new Error("RegionAnchorY must be between 0 and 100.")}s=e}},viewportAnchorY:{enumerable:true,get:function(){return a},set:function(e){if(!$s(e)){throw new Error("ViewportAnchorY must be between 0 and 100.")}a=e}},viewportAnchorX:{enumerable:true,get:function(){return r},set:function(e){if(!$s(e)){throw new Error("ViewportAnchorX must be between 0 and 100.")}r=e}},scroll:{enumerable:true,get:function(){return o},set:function(e){var t=Hs(e);if(t===false){console.warn("Scroll: an invalid or illegal string was specified.")}else{o=t}}}})}var Gs=zs;var Ks=Kt(function(e){var t=e.exports={WebVTT:Ls,VTTCue:qs,VTTRegion:Gs};Li.vttjs=t;Li.WebVTT=t.WebVTT;var i=t.VTTCue;var s=t.VTTRegion;var n=Li.VTTCue;var r=Li.VTTRegion;t.shim=function(){Li.VTTCue=i;Li.VTTRegion=s};t.restore=function(){Li.VTTCue=n;Li.VTTRegion=r};if(!Li.VTTCue){t.shim()}});Ks.WebVTT;Ks.VTTCue;Ks.VTTRegion;function Ws(e,t,i,s,n={}){const r=e.textTracks();n.kind=t;if(i){n.label=i}if(s){n.language=s}n.tech=e;const a=new v.text.TrackClass(n);r.addTrack(a);return a}class b extends g{constructor(i={},e=function(){}){i.reportTouchActivity=false;super(null,i,e);this.onDurationChange_=e=>this.onDurationChange(e);this.trackProgress_=e=>this.trackProgress(e);this.trackCurrentTime_=e=>this.trackCurrentTime(e);this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e);this.disposeSourceHandler_=e=>this.disposeSourceHandler(e);this.queuedHanders_=new Set;this.hasStarted_=false;this.on("playing",function(){this.hasStarted_=true});this.on("loadstart",function(){this.hasStarted_=false});v.names.forEach(e=>{const t=v[e];if(i&&i[t.getterName]){this[t.privateName]=i[t.getterName]}});if(!this.featuresProgressEvents){this.manualProgressOn()}if(!this.featuresTimeupdateEvents){this.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(e=>{if(i[`native${e}Tracks`]===false){this[`featuresNative${e}Tracks`]=false}});if(i.nativeCaptions===false||i.nativeTextTracks===false){this.featuresNativeTextTracks=false}else if(i.nativeCaptions===true||i.nativeTextTracks===true){this.featuresNativeTextTracks=true}if(!this.featuresNativeTextTracks){this.emulateTextTracks()}this.preloadTextTracks=i.preloadTextTracks!==false;this.autoRemoteTextTracks_=new v.text.ListClass;this.initTrackListeners();if(!i.nativeControlsForTouch){this.emitTapEvents()}if(this.constructor){this.name_=this.constructor.name||"Unknown Tech"}}triggerSourceset(e){if(!this.isReady_){this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1))}this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_);this.manualProgress=true;this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress();this.progressInterval=this.setInterval(p(this,function(){const e=this.bufferedPercent();if(this.bufferedPercent_!==e){this.trigger("progress")}this.bufferedPercent_=e;if(e===1){this.stopTrackingProgress()}}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Qt(0,0)}bufferedPercent(){return ni(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on("play",this.trackCurrentTime_);this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime_);this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}dispose(){this.clearTracks(rs.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}super.dispose()}clearTracks(e){e=[].concat(e);e.forEach(e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;while(i--){const s=t[i];if(e==="text"){this.removeRemoteTextTrack(s)}t.removeTrack(s)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;while(t--){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){if(e!==undefined){this.error_=new t(e);this.trigger("error")}return this.error_}played(){if(this.hasStarted_){return Qt(0,0)}return Qt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}}initTrackListeners(){rs.names.forEach(e=>{const t=rs[e];const i=()=>{this.trigger(`${e}trackchange`)};const s=this[t.getterName]();s.addEventListener("removetrack",i);s.addEventListener("addtrack",i);this.on("dispose",()=>{s.removeEventListener("removetrack",i);s.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(tv.WebVTT){return}if(iv.body.contains(this.el())){if(!this.options_["vtt.js"]&&ee(Ks)&&Object.keys(Ks).length>0){this.trigger("vttjsloaded");return}const e=iv.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";e.onload=()=>{this.trigger("vttjsloaded")};e.onerror=()=>{this.trigger("vttjserror")};this.on("dispose",()=>{e.onload=null;e.onerror=null});tv.WebVTT=true;this.el().parentNode.appendChild(e)}else{this.ready(this.addWebVttScript_)}}emulateTextTracks(){const i=this.textTracks();const e=this.remoteTextTracks();const s=e=>i.addTrack(e.track);const n=e=>i.removeTrack(e.track);e.on("addtrack",s);e.on("removetrack",n);this.addWebVttScript_();const r=()=>this.trigger("texttrackchange");const a=()=>{r();for(let e=0;ethis.autoRemoteTextTracks_.addTrack(i.track))}return i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t);this.remoteTextTracks().removeTrack(e);this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return true}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=dt();if(!this.isReady_||this.paused()){this.queuedHanders_.add(t);this.one("playing",()=>{if(this.queuedHanders_.has(t)){this.queuedHanders_.delete(t);e()}})}else{this.requestNamedAnimationFrame(t,e)}return t}cancelVideoFrameCallback(e){if(this.queuedHanders_.has(e)){this.queuedHanders_.delete(e)}else{this.cancelNamedAnimationFrame(e)}}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return b.canPlayType(e.type)}static isTech(e){return e.prototype instanceof b||e instanceof b||e===b}static registerTech(e,t){if(!b.techs_){b.techs_={}}if(!b.isTech(t)){throw new Error(`Tech ${e} must be a Tech`)}if(!b.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!b.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}e=m(e);b.techs_[e]=t;b.techs_[Vt(e)]=t;if(e!=="Tech"){b.defaultTechOrder_.push(e)}return t}static getTech(e){if(!e){return}if(b.techs_&&b.techs_[e]){return b.techs_[e]}e=m(e);if(tv&&tv.videojs&&tv.videojs[e]){d.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);return tv.videojs[e]}}}v.names.forEach(function(e){const t=v[e];b.prototype[t.getterName]=function(){this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});b.prototype.featuresVolumeControl=true;b.prototype.featuresMuteControl=true;b.prototype.featuresFullscreenResize=false;b.prototype.featuresPlaybackRate=false;b.prototype.featuresProgressEvents=false;b.prototype.featuresSourceset=false;b.prototype.featuresTimeupdateEvents=false;b.prototype.featuresNativeTextTracks=false;b.prototype.featuresVideoFrameCallback=false;b.withSourceHandlers=function(r){r.registerSourceHandler=function(e,t){let i=r.sourceHandlers;if(!i){i=r.sourceHandlers=[]}if(t===undefined){t=i.length}i.splice(t,0,e)};r.canPlayType=function(t){const i=r.sourceHandlers||[];let s;for(let e=0;ehn(t,Ys[t.type],i,e),1)}function en(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}function tn(e,t,i){return e.reduceRight(ln(i),t[i]())}function sn(e,t,i,s){return t[i](e.reduce(ln(i),s))}function nn(e,t,i,s=null){const n="call"+m(i);const r=e.reduce(ln(n),s);const a=r===Qs;const o=a?null:t[i](r);cn(e,i,o,a);return o}const rn={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1};const an={setCurrentTime:1,setMuted:1,setVolume:1};const on={play:1,pause:1};function ln(i){return(e,t)=>{if(e===Qs){return Qs}if(t[i]){return t[i](e)}return e}}function cn(t,i,s,n){for(let e=t.length-1;e>=0;e--){const r=t[e];if(r[i]){r[i](n,s)}}}function un(e){Xs[e.id()]=null}function dn(e,t){const i=Xs[e.id()];let s=null;if(i===undefined||i===null){s=t(e);Xs[e.id()]=[[t,s]];return s}for(let e=0;e{if(!t){return""}if(e.cache_.source.src===t&&e.cache_.source.type){return e.cache_.source.type}const i=e.cache_.sources.filter(e=>e.src===t);if(i.length){return i[0].type}const s=e.$$("source");for(let e=0;ethis.handleMouseOver(e);this.handleMouseOut_=e=>this.handleMouseOut(e);this.handleClick_=e=>this.handleClick(e);this.handleKeyDown_=e=>this.handleKeyDown(e);this.emitTapEvents();this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t);if(e==="button"){d.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`)}i=Object.assign({role:"button"},i);this.tabIndex_=t.tabIndex;const s=l(e,t,i);if(!this.player_.options_.experimentalSvgIcons){s.appendChild(l("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}this.createControlTextEl(s);return s}dispose(){this.controlTextEl_=null;super.dispose()}createControlTextEl(e){this.controlTextEl_=l("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(e){e.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,e);return this.controlTextEl_}controlText(e,t=this.el()){if(e===undefined){return this.controlText_||"Need Text"}const i=this.localize(e);this.controlText_=e;xe(this.controlTextEl_,i);if(!this.nonIconControl&&!this.player_.options_.noUITitleAttributes){t.setAttribute("title",i)}}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){if(!this.enabled_){this.enabled_=true;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if(typeof this.tabIndex_!=="undefined"){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick_);this.on("keydown",this.handleKeyDown_)}}disable(){this.enabled_=false;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if(typeof this.tabIndex_!=="undefined"){this.el_.removeAttribute("tabIndex")}this.off("mouseover",this.handleMouseOver_);this.off("mouseout",this.handleMouseOut_);this.off(["tap","click"],this.handleClick_);this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments)}}handleKeyDown(e){if(a.isEventKey(e,"Space")||a.isEventKey(e,"Enter")){e.preventDefault();e.stopPropagation();this.trigger("click")}else{super.handleKeyDown(e)}}}g.registerComponent("ClickableComponent",_n);class Tn extends _n{constructor(e,t){super(e,t);this.update();this.update_=e=>this.update(e);e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_);super.dispose()}createEl(){return l("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e==="undefined"){if(this.$("img")){return this.$("img").crossOrigin}else if(this.player_.tech_&&this.player_.tech_.isReady_){return this.player_.crossOrigin()}return this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null}if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}if(this.$("img")){this.$("img").crossOrigin=e}return}update(e){const t=this.player().poster();this.setSrc(t);if(t){this.show()}else{this.hide()}}setSrc(e){if(!e){this.el_.textContent="";return}if(!this.$("img")){this.el_.appendChild(l("picture",{className:"vjs-poster",tabIndex:-1},{},l("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""})))}this.$("img").src=e}handleClick(e){if(!this.player_.controls()){return}if(this.player_.tech(true)){this.player_.tech(true).focus()}if(this.player_.paused()){li(this.player_.play())}else{this.player_.pause()}}}Tn.prototype.crossorigin=Tn.prototype.crossOrigin;g.registerComponent("PosterImage",Tn);const Sn="#222";const En="#ccc";const wn={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function kn(e,t){let i;if(e.length===4){i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]}else if(e.length===7){i=e.slice(1)}else{throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.")}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function jn(e,t,i){try{e.style[t]=i}catch(e){return}}function Cn(e){return e?`${e}px`:""}class In extends g{constructor(s,e,t){super(s,e,t);const i=e=>this.updateDisplay(e);const n=e=>{this.updateDisplayOverlay();this.updateDisplay(e)};s.on("loadstart",e=>this.toggleDisplay(e));s.on("texttrackchange",i);s.on("loadedmetadata",e=>{this.updateDisplayOverlay();this.preselectTrack(e)});s.ready(p(this,function(){if(s.tech_&&s.tech_.featuresNativeTextTracks){this.hide();return}s.on("fullscreenchange",n);s.on("playerresize",n);const e=tv.screen.orientation||tv;const t=tv.screen.orientation?"change":"orientationchange";e.addEventListener(t,n);s.on("dispose",()=>e.removeEventListener(t,n));const i=this.options_.playerOptions.tracks||[];for(let e=0;e.1){if(i>s){n=Math.round((e-t*s)/2)}else{r=Math.round((t-e/s)/2)}}jn(this.el_,"insetInline",Cn(n));jn(this.el_,"insetBlock",Cn(r))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues();const i=e.activeCues;let s=i.length;while(s--){const n=i[s];if(!n){continue}const r=n.displayState;if(t.color){r.firstChild.style.color=t.color}if(t.textOpacity){jn(r.firstChild,"color",kn(t.color||"#fff",t.textOpacity))}if(t.backgroundColor){r.firstChild.style.backgroundColor=t.backgroundColor}if(t.backgroundOpacity){jn(r.firstChild,"backgroundColor",kn(t.backgroundColor||"#000",t.backgroundOpacity))}if(t.windowColor){if(t.windowOpacity){jn(r,"backgroundColor",kn(t.windowColor,t.windowOpacity))}else{r.style.backgroundColor=t.windowColor}}if(t.edgeStyle){if(t.edgeStyle==="dropshadow"){r.firstChild.style.textShadow=`2px 2px 3px ${Sn}, 2px 2px 4px ${Sn}, 2px 2px 5px ${Sn}`}else if(t.edgeStyle==="raised"){r.firstChild.style.textShadow=`1px 1px ${Sn}, 2px 2px ${Sn}, 3px 3px ${Sn}`}else if(t.edgeStyle==="depressed"){r.firstChild.style.textShadow=`1px 1px ${En}, 0 1px ${En}, -1px -1px ${Sn}, 0 -1px ${Sn}`}else if(t.edgeStyle==="uniform"){r.firstChild.style.textShadow=`0 0 4px ${Sn}, 0 0 4px ${Sn}, 0 0 4px ${Sn}, 0 0 4px ${Sn}`}}if(t.fontPercent&&t.fontPercent!==1){const a=tv.parseFloat(r.style.fontSize);r.style.fontSize=a*t.fontPercent+"px";r.style.height="auto";r.style.top="auto"}if(t.fontFamily&&t.fontFamily!=="default"){if(t.fontFamily==="small-caps"){r.firstChild.style.fontVariant="small-caps"}else{r.firstChild.style.fontFamily=wn[t.fontFamily]}}}}updateForTrack(i){if(!Array.isArray(i)){i=[i]}if(typeof tv.WebVTT!=="function"||i.every(e=>{return!e.activeCues})){return}const t=[];for(let e=0;ethis.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){li(t);if(this.player_.tech(true)){this.player_.tech(true).focus()}return}const i=this.player_.getChild("controlBar");const s=i&&i.getChild("playToggle");if(!s){this.player_.tech(true).focus();return}const n=()=>s.focus();if(oi(t)){t.then(n,()=>{})}else{this.setTimeout(n,1)}}handleKeyDown(e){this.mouseused_=false;super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=true}}Dn.prototype.controlText_="Play Video";g.registerComponent("BigPlayButton",Dn);class On extends An{constructor(e,t){super(e,t);this.setIcon("cancel");this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:false})}handleKeyDown(e){if(a.isEventKey(e,"Esc")){e.preventDefault();e.stopPropagation();this.trigger("click")}else{super.handleKeyDown(e)}}}g.registerComponent("CloseButton",On);class Pn extends An{constructor(e,t={}){super(e,t);t.replay=t.replay===undefined||t.replay;this.setIcon("play");this.on(e,"play",e=>this.handlePlay(e));this.on(e,"pause",e=>this.handlePause(e));if(t.replay){this.on(e,"ended",e=>this.handleEnded(e))}}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){if(this.player_.paused()){li(this.player_.play())}else{this.player_.pause()}}handleSeeked(e){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(e)}else{this.handlePlay(e)}}handlePlay(e){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.setIcon("pause");this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.setIcon("play");this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.setIcon("replay");this.controlText("Replay");this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}Pn.prototype.controlText_="Play";g.registerComponent("PlayToggle",Pn);class Ln extends g{constructor(e,t){super(e,t);this.on(e,["timeupdate","ended","seeking"],e=>this.update(e));this.updateTextNode_()}createEl(){const e=this.buildCSSClass();const t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`});const i=l("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\u00a0`},{role:"presentation"});t.appendChild(i);this.contentEl_=l("span",{className:`${e}-display`},{role:"presentation"});t.appendChild(this.contentEl_);return t}dispose(){this.contentEl_=null;this.textNode_=null;super.dispose()}update(e){if(!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"){return}this.updateContent(e)}updateTextNode_(e=0){e=ii(e);if(this.formattedTime_===e){return}this.formattedTime_=e;this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_){return}let e=this.textNode_;if(e&&this.contentEl_.firstChild!==e){e=null;d.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")}this.textNode_=iv.createTextNode(this.formattedTime_);if(!this.textNode_){return}if(e){this.contentEl_.replaceChild(this.textNode_,e)}else{this.contentEl_.appendChild(this.textNode_)}})}updateContent(e){}}Ln.prototype.labelText_="Time";Ln.prototype.controlText_="Time";g.registerComponent("TimeDisplay",Ln);class Rn extends Ln{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;if(this.player_.ended()){t=this.player_.duration()}else{t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}this.updateTextNode_(t)}}Rn.prototype.labelText_="Current Time";Rn.prototype.controlText_="Current Time";g.registerComponent("CurrentTimeDisplay",Rn);class Nn extends Ln{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i);this.on(e,"loadstart",i);this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Nn.prototype.labelText_="Duration";Nn.prototype.controlText_="Duration";g.registerComponent("DurationDisplay",Nn);class Mn extends g{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":true});const t=super.createEl("div");const i=super.createEl("span",{textContent:"/"});t.appendChild(i);e.appendChild(t);return e}}g.registerComponent("TimeDivider",Mn);class Un extends Ln{constructor(e,t){super(e,t);this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();if(this.options_.displayNegative!==false){e.insertBefore(l("span",{},{"aria-hidden":true},"-"),this.contentEl_)}return e}updateContent(e){if(typeof this.player_.duration()!=="number"){return}let t;if(this.player_.ended()){t=0}else if(this.player_.remainingTimeDisplay){t=this.player_.remainingTimeDisplay()}else{t=this.player_.remainingTime()}this.updateTextNode_(t)}}Un.prototype.labelText_="Remaining Time";Un.prototype.controlText_="Remaining Time";g.registerComponent("RemainingTimeDisplay",Un);class Bn extends g{constructor(e,t){super(e,t);this.updateShowing();this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});this.contentEl_=l("div",{className:"vjs-live-display"},{"aria-live":"off"});this.contentEl_.appendChild(l("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\u00a0`}));this.contentEl_.appendChild(iv.createTextNode(this.localize("LIVE")));e.appendChild(this.contentEl_);return e}dispose(){this.contentEl_=null;super.dispose()}updateShowing(e){if(this.player().duration()===Infinity){this.show()}else{this.hide()}}}g.registerComponent("LiveDisplay",Bn);class Fn extends An{constructor(e,t){super(e,t);this.updateLiveEdgeStatus();if(this.player_.liveTracker){this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e);this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});this.setIcon("circle",e);this.textEl_=l("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"});e.appendChild(this.textEl_);return e}updateLiveEdgeStatus(){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute("aria-disabled",true);this.addClass("vjs-at-live-edge");this.controlText("Seek to live, currently playing live")}else{this.setAttribute("aria-disabled",false);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}this.textEl_=null;super.dispose()}}Fn.prototype.controlText_="Seek to live, currently playing live";g.registerComponent("SeekToLive",Fn);function qn(e,t,i){e=Number(e);return Math.min(i,Math.max(t,isNaN(e)?t:e))}var Vn=Object.freeze({__proto__:null,clamp:qn});class Hn extends g{constructor(e,t){super(e,t);this.handleMouseDown_=e=>this.handleMouseDown(e);this.handleMouseUp_=e=>this.handleMouseUp(e);this.handleKeyDown_=e=>this.handleKeyDown(e);this.handleClick_=e=>this.handleClick(e);this.handleMouseMove_=e=>this.handleMouseMove(e);this.update_=e=>this.update(e);this.bar=this.getChild(this.options_.barName);this.vertical(!!this.options_.vertical);this.enable()}enabled(){return this.enabled_}enable(){if(this.enabled()){return}this.on("mousedown",this.handleMouseDown_);this.on("touchstart",this.handleMouseDown_);this.on("keydown",this.handleKeyDown_);this.on("click",this.handleClick_);this.on(this.player_,"controlsvisible",this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=true}disable(){if(!this.enabled()){return}const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_);this.off("touchstart",this.handleMouseDown_);this.off("keydown",this.handleKeyDown_);this.off("click",this.handleClick_);this.off(this.player_,"controlsvisible",this.update_);this.off(e,"mousemove",this.handleMouseMove_);this.off(e,"mouseup",this.handleMouseUp_);this.off(e,"touchmove",this.handleMouseMove_);this.off(e,"touchend",this.handleMouseUp_);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=false}createEl(e,t={},i={}){t.className=t.className+" vjs-slider";t=Object.assign({tabIndex:0},t);i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i);return super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;if(e.type==="mousedown"){e.preventDefault()}if(e.type==="touchstart"&&!de){e.preventDefault()}Fe();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(t,"mousemove",this.handleMouseMove_);this.on(t,"mouseup",this.handleMouseUp_);this.on(t,"touchmove",this.handleMouseMove_);this.on(t,"touchend",this.handleMouseUp_);this.handleMouseMove(e,true)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;qe();this.removeClass("vjs-sliding");this.trigger("sliderinactive");this.off(t,"mousemove",this.handleMouseMove_);this.off(t,"mouseup",this.handleMouseUp_);this.off(t,"touchmove",this.handleMouseMove_);this.off(t,"touchend",this.handleMouseUp_);this.update()}update(){if(!this.el_||!this.bar){return}const t=this.getProgress();if(t===this.progress_){return t}this.progress_=t;this.requestNamedAnimationFrame("Slider#update",()=>{const e=this.vertical()?"height":"width";this.bar.el().style[e]=(t*100).toFixed(2)+"%"});return t}getProgress(){return Number(qn(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=$e(this.el_,e);if(this.vertical()){return t.y}return t.x}handleKeyDown(e){if(a.isEventKey(e,"Left")||a.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepBack()}else if(a.isEventKey(e,"Right")||a.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepForward()}else{super.handleKeyDown(e)}}handleClick(e){e.stopPropagation();e.preventDefault()}vertical(e){if(e===undefined){return this.vertical_||false}this.vertical_=!!e;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}}}g.registerComponent("Slider",Hn);const $n=(e,t)=>qn(e/t*100,0,100).toFixed(2)+"%";class zn extends g{constructor(e,t){super(e,t);this.partEls_=[];this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"});const t=l("span",{className:"vjs-control-text"});const i=l("span",{textContent:this.localize("Loaded")});const s=iv.createTextNode(": ");this.percentageEl_=l("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"});e.appendChild(t);t.appendChild(i);t.appendChild(s);t.appendChild(this.percentageEl_);return e}dispose(){this.partEls_=null;this.percentageEl_=null;super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const e=this.player_.liveTracker;const i=this.player_.buffered();const t=e&&e.isLive()?e.seekableEnd():this.player_.duration();const s=this.player_.bufferedEnd();const n=this.partEls_;const r=$n(s,t);if(this.percent_!==r){this.el_.style.width=r;xe(this.percentageEl_,r);this.percent_=r}for(let t=0;ti.length;e--){this.el_.removeChild(n[e-1])}n.length=i.length})}}g.registerComponent("LoadProgressBar",zn);class Gn extends g{constructor(e,t){super(e,t);this.update=wt(p(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const s=He(this.el_);const n=Ve(this.player_.el());const r=e.width*t;if(!n||!s){return}const a=e.left-n.left+r;const o=e.width-r+(n.right-e.right);let l=s.width/2;if(as.width){l=s.width}l=Math.round(l);this.el_.style.right=`-${l}px`;this.write(i)}write(e){xe(this.el_,e)}updateTime(n,r,a,o){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let e;const t=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const i=this.player_.liveTracker.liveWindow();const s=i-r*i;e=(s<1?"":"-")+ii(s,i)}else{e=ii(a,t)}this.update(n,r,e);if(o){o()}})}}g.registerComponent("TimeTooltip",Gn);class Kn extends g{constructor(e,t){super(e,t);this.setIcon("circle");this.update=wt(p(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i){return}const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,s)}}Kn.prototype.options_={children:[]};if(!f&&!ae){Kn.prototype.options_.children.push("timeTooltip")}g.registerComponent("PlayProgressBar",Kn);class Wn extends g{constructor(e,t){super(e,t);this.update=wt(p(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}Wn.prototype.options_={children:["timeTooltip"]};g.registerComponent("MouseTimeDisplay",Wn);const Yn=5;const Xn=12;class Qn extends Hn{constructor(e,t){super(e,t);this.setEventHandlers_()}setEventHandlers_(){this.update_=p(this,this.update);this.update=wt(this.update_,Et);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.enableIntervalHandler_=e=>this.enableInterval_(e);this.disableIntervalHandler_=e=>this.disableInterval_(e);this.on(this.player_,["playing"],this.enableIntervalHandler_);this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in iv&&"visibilityState"in iv){this.on(iv,"visibilitychange",this.toggleVisibility_)}}toggleVisibility_(e){if(iv.visibilityState==="hidden"){this.cancelNamedAnimationFrame("SeekBar#update");this.cancelNamedAnimationFrame("Slider#update");this.disableInterval_(e)}else{if(!this.player_.ended()&&!this.player_.paused()){this.enableInterval_()}this.update()}}enableInterval_(){if(this.updateInterval){return}this.updateInterval=this.setInterval(this.update,Et)}disableInterval_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"){return}if(!this.updateInterval){return}this.clearInterval(this.updateInterval);this.updateInterval=null}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(iv.visibilityState==="hidden"){return}const s=super.update();this.requestNamedAnimationFrame("SeekBar#update",()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_();const t=this.player_.liveTracker;let i=this.player_.duration();if(t&&t.isLive()){i=this.player_.liveTracker.liveCurrentTime()}if(this.percent_!==s){this.el_.setAttribute("aria-valuenow",(s*100).toFixed(2));this.percent_=s}if(this.currentTime_!==e||this.duration_!==i){this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ii(e,i),ii(i,i)],"{1} of {2}"));this.currentTime_=e;this.duration_=i}if(this.bar){this.bar.update(Ve(this.el()),this.getProgress())}});return s}userSeek_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){this.player_.liveTracker.nextSeekedFromUser()}this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;if(i&&i.isLive()){t=(e-i.seekableStart())/i.liveWindow();if(i.atLiveEdge()){t=1}}else{t=e/this.player_.duration()}return t}handleMouseDown(e){if(!Xe(e)){return}e.stopPropagation();this.videoWasPlaying=!this.player_.paused();this.player_.pause();super.handleMouseDown(e)}handleMouseMove(e,t=false){if(!Xe(e)||isNaN(this.player_.duration())){return}if(!t&&!this.player_.scrubbing()){this.player_.scrubbing(true)}let i;const s=this.calculateDistance(e);const n=this.player_.liveTracker;if(!n||!n.isLive()){i=s*this.player_.duration();if(i===this.player_.duration()){i=i-.1}}else{if(s>=.99){n.seekToLiveEdge();return}const r=n.seekableStart();const a=n.liveCurrentTime();i=r+s*n.liveWindow();if(i>=a){i=a}if(i<=r){i=r+.1}if(i===Infinity){return}}this.userSeek_(i);if(this.player_.options_.enableSmoothSeeking){this.update()}}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");if(!e){return}e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");if(!e){return}e.hide()}handleMouseUp(e){super.handleMouseUp(e);if(e){e.stopPropagation()}this.player_.scrubbing(false);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:true});if(this.videoWasPlaying){li(this.player_.play())}else{this.update_()}}stepForward(){this.userSeek_(this.player_.currentTime()+Yn)}stepBack(){this.userSeek_(this.player_.currentTime()-Yn)}handleAction(e){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}}handleKeyDown(e){const t=this.player_.liveTracker;if(a.isEventKey(e,"Space")||a.isEventKey(e,"Enter")){e.preventDefault();e.stopPropagation();this.handleAction(e)}else if(a.isEventKey(e,"Home")){e.preventDefault();e.stopPropagation();this.userSeek_(0)}else if(a.isEventKey(e,"End")){e.preventDefault();e.stopPropagation();if(t&&t.isLive()){this.userSeek_(t.liveCurrentTime())}else{this.userSeek_(this.player_.duration())}}else if(/^[0-9]$/.test(a(e))){e.preventDefault();e.stopPropagation();const i=(a.codes[a(e)]-a.codes["0"])*10/100;if(t&&t.isLive()){this.userSeek_(t.seekableStart()+t.liveWindow()*i)}else{this.userSeek_(this.player_.duration()*i)}}else if(a.isEventKey(e,"PgDn")){e.preventDefault();e.stopPropagation();this.userSeek_(this.player_.currentTime()-Yn*Xn)}else if(a.isEventKey(e,"PgUp")){e.preventDefault();e.stopPropagation();this.userSeek_(this.player_.currentTime()+Yn*Xn)}else{super.handleKeyDown(e)}}dispose(){this.disableInterval_();this.off(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.update)}this.off(this.player_,["playing"],this.enableIntervalHandler_);this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in iv&&"visibilityState"in iv){this.off(iv,"visibilitychange",this.toggleVisibility_)}super.dispose()}}Qn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!f&&!ae){Qn.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}g.registerComponent("SeekBar",Qn);class Jn extends g{constructor(e,t){super(e,t);this.handleMouseMove=wt(p(this,this.handleMouseMove),Et);this.throttledHandleMouseSeek=wt(p(this,this.handleMouseSeek),Et);this.handleMouseUpHandler_=e=>this.handleMouseUp(e);this.handleMouseDownHandler_=e=>this.handleMouseDown(e);this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t){return}const i=t.getChild("playProgressBar");const s=t.getChild("mouseTimeDisplay");if(!i&&!s){return}const n=t.el();const r=He(n);let a=$e(n,e).x;a=qn(a,0,1);if(s){s.update(r,a)}if(i){i.update(r,t.getProgress())}}handleMouseSeek(e){const t=this.getChild("seekBar");if(t){t.handleMouseMove(e)}}enabled(){return this.enabled_}disable(){this.children().forEach(e=>e.disable&&e.disable());if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDownHandler_);this.off(this.el_,"mousemove",this.handleMouseMove);this.removeListenersAddedOnMousedownAndTouchstart();this.addClass("disabled");this.enabled_=false;if(this.player_.scrubbing()){const e=this.getChild("seekBar");this.player_.scrubbing(false);if(e.videoWasPlaying){li(this.player_.play())}}}enable(){this.children().forEach(e=>e.enable&&e.enable());if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDownHandler_);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=true}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek);this.off(e,"touchmove",this.throttledHandleMouseSeek);this.off(e,"mouseup",this.handleMouseUpHandler_);this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument;const i=this.getChild("seekBar");if(i){i.handleMouseDown(e)}this.on(t,"mousemove",this.throttledHandleMouseSeek);this.on(t,"touchmove",this.throttledHandleMouseSeek);this.on(t,"mouseup",this.handleMouseUpHandler_);this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");if(t){t.handleMouseUp(e)}this.removeListenersAddedOnMousedownAndTouchstart()}}Jn.prototype.options_={children:["seekBar"]};g.registerComponent("ProgressControl",Jn);class Zn extends An{constructor(e,t){super(e,t);this.setIcon("picture-in-picture-enter");this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e));this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e));this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange());this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){const e=this.player_.currentType().substring(0,5)==="audio";const t=e||this.player_.audioPosterMode()||this.player_.audioOnlyMode();if(!t){this.show();return}if(this.player_.isInPictureInPicture()){this.player_.exitPictureInPicture()}this.hide()}handlePictureInPictureEnabledChange(){if(iv.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===false||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in tv){this.enable()}else{this.disable()}}handlePictureInPictureChange(e){if(this.player_.isInPictureInPicture()){this.setIcon("picture-in-picture-exit");this.controlText("Exit Picture-in-Picture")}else{this.setIcon("picture-in-picture-enter");this.controlText("Picture-in-Picture")}this.handlePictureInPictureEnabledChange()}handleClick(e){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}}show(){if(typeof iv.exitPictureInPicture!=="function"){return}super.show()}}Zn.prototype.controlText_="Picture-in-Picture";g.registerComponent("PictureInPictureToggle",Zn);class er extends An{constructor(e,t){super(e,t);this.setIcon("fullscreen-enter");this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e));if(iv[e.fsApi_.fullscreenEnabled]===false){this.disable()}}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){if(this.player_.isFullscreen()){this.controlText("Exit Fullscreen");this.setIcon("fullscreen-exit")}else{this.controlText("Fullscreen");this.setIcon("fullscreen-enter")}}handleClick(e){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}}}er.prototype.controlText_="Fullscreen";g.registerComponent("FullscreenToggle",er);const tr=function(e,t){if(t.tech_&&!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})};class ir extends g{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});this.setIcon("circle",e);e.appendChild(super.createEl("span",{className:"vjs-control-text"}));return e}}g.registerComponent("VolumeLevel",ir);class sr extends g{constructor(e,t){super(e,t);this.update=wt(p(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(t,i,e,s){if(!e){const n=Ve(this.el_);const r=Ve(this.player_.el());const a=t.width*i;if(!r||!n){return}const o=t.left-r.left+a;const l=t.width-a+(r.right-t.right);let e=n.width/2;if(on.width){e=n.width}this.el_.style.right=`-${e}px`}this.write(`${s}%`)}write(e){xe(this.el_,e)}updateVolume(e,t,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,s.toFixed(0));if(n){n()}})}}g.registerComponent("VolumeLevelTooltip",sr);class nr extends g{constructor(e,t){super(e,t);this.update=wt(p(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,s,()=>{if(i){this.el_.style.bottom=`${e.height*t}px`}else{this.el_.style.left=`${e.width*t}px`}})}}nr.prototype.options_={children:["volumeLevelTooltip"]};g.registerComponent("MouseVolumeLevelDisplay",nr);class rr extends Hn{constructor(e,t){super(e,t);this.on("slideractive",e=>this.updateLastVolume_(e));this.on(e,"volumechange",e=>this.updateARIAAttributes(e));e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){if(!Xe(e)){return}super.handleMouseDown(e)}handleMouseMove(t){const i=this.getChild("mouseVolumeLevelDisplay");if(i){const s=this.el();const n=Ve(s);const r=this.vertical();let e=$e(s,t);e=r?e.y:e.x;e=qn(e,0,1);i.update(n,e,r)}if(!Xe(t)){return}this.checkMuted();this.player_.volume(this.calculateDistance(t))}checkMuted(){if(this.player_.muted()){this.player_.muted(false)}}getPercent(){if(this.player_.muted()){return 0}return this.player_.volume()}stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t);this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{if(this.player_.volume()===0){this.player_.lastVolume_(e)}})}}rr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};if(!f&&!ae){rr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay")}rr.prototype.playerEvent="volumechange";g.registerComponent("VolumeBar",rr);class ar extends g{constructor(e,t={}){t.vertical=t.vertical||false;if(typeof t.volumeBar==="undefined"||ee(t.volumeBar)){t.volumeBar=t.volumeBar||{};t.volumeBar.vertical=t.vertical}super(e,t);tr(this,e);this.throttledHandleMouseMove=wt(p(this,this.handleMouseMove),Et);this.handleMouseUpHandler_=e=>this.handleMouseUp(e);this.on("mousedown",e=>this.handleMouseDown(e));this.on("touchstart",e=>this.handleMouseDown(e));this.on("mousemove",e=>this.handleMouseMove(e));this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active");this.addClass("vjs-slider-active");this.trigger("slideractive")});this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active");this.removeClass("vjs-slider-active");this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";if(this.options_.vertical){e="vjs-volume-vertical"}return super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove);this.on(t,"touchmove",this.throttledHandleMouseMove);this.on(t,"mouseup",this.handleMouseUpHandler_);this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove);this.off(t,"touchmove",this.throttledHandleMouseMove);this.off(t,"mouseup",this.handleMouseUpHandler_);this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}ar.prototype.options_={children:["volumeBar"]};g.registerComponent("VolumeControl",ar);const or=function(e,t){if(t.tech_&&!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})};class lr extends An{constructor(e,t){super(e,t);or(this,e);this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume();const i=this.player_.lastVolume_();if(t===0){const s=i<.1?.1:i;this.player_.volume(s);this.player_.muted(false)}else{this.player_.muted(this.player_.muted()?false:true)}}update(e){this.updateIcon_();this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high");if(f&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(e===0||this.player_.muted()){this.setIcon("volume-mute");t=0}else if(e<.33){this.setIcon("volume-low");t=1}else if(e<.67){this.setIcon("volume-medium");t=2}Pe(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,""));Oe(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0;const t=e?"Unmute":"Mute";if(this.controlText()!==t){this.controlText(t)}}}lr.prototype.controlText_="Mute";g.registerComponent("MuteToggle",lr);class cr extends g{constructor(e,t={}){if(typeof t.inline!=="undefined"){t.inline=t.inline}else{t.inline=true}if(typeof t.volumeControl==="undefined"||ee(t.volumeControl)){t.volumeControl=t.volumeControl||{};t.volumeControl.vertical=!t.inline}super(e,t);this.handleKeyPressHandler_=e=>this.handleKeyPress(e);this.on(e,["loadstart"],e=>this.volumePanelState_(e));this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e));this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e));this.on("keydown",e=>this.handleKeyPress(e));this.on("mouseover",e=>this.handleMouseOver(e));this.on("mouseout",e=>this.handleMouseOut(e));this.on(this.volumeControl,["slideractive"],this.sliderActive_);this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}}createEl(){let e="vjs-volume-panel-horizontal";if(!this.options_.inline){e="vjs-volume-panel-vertical"}return super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut();super.dispose()}handleVolumeControlKeyUp(e){if(a.isEventKey(e,"Esc")){this.muteToggle.focus()}}handleMouseOver(e){this.addClass("vjs-hover");yt(iv,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover");c(iv,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){if(a.isEventKey(e,"Esc")){this.handleMouseOut()}}}cr.prototype.options_={children:["muteToggle","volumeControl"]};g.registerComponent("VolumePanel",cr);class ur extends An{constructor(e,t){super(e,t);this.validOptions=[5,10,30];this.skipTime=this.getSkipForwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.setIcon(`forward-${this.skipTime}`);this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]));this.show()}else{this.hide()}}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration())){return}const t=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;if(t+this.skipTime<=s){n=t+this.skipTime}else{n=s}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}ur.prototype.controlText_="Skip Forward";g.registerComponent("SkipForward",ur);class dr extends An{constructor(e,t){super(e,t);this.validOptions=[5,10,30];this.skipTime=this.getSkipBackwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.setIcon(`replay-${this.skipTime}`);this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]));this.show()}else{this.hide()}}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()&&i.seekableStart();let n;if(s&&t-this.skipTime<=s){n=s}else if(t>=this.skipTime){n=t-this.skipTime}else{n=0}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}dr.prototype.controlText_="Skip Backward";g.registerComponent("SkipBackward",dr);class hr extends g{constructor(e,t){super(e,t);if(t){this.menuButton_=t.menuButton}this.focusedChild_=-1;this.on("keydown",e=>this.handleKeyDown(e));this.boundHandleBlur_=e=>this.handleBlur(e);this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){if(!(e instanceof g)){return}this.on(e,"blur",this.boundHandleBlur_);this.on(e,["tap","click"],this.boundHandleTapClick_)}removeEventListenerForItem(e){if(!(e instanceof g)){return}this.off(e,"blur",this.boundHandleBlur_);this.off(e,["tap","click"],this.boundHandleTapClick_)}removeChild(e){if(typeof e==="string"){e=this.getChild(e)}this.removeEventListenerForItem(e);super.removeChild(e)}addItem(e){const t=this.addChild(e);if(t){this.addEventListenerForItem(t)}}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=l(e,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});t.appendChild(this.contentEl_);yt(t,"click",function(e){e.preventDefault();e.stopImmediatePropagation()});return t}dispose(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;super.dispose()}handleBlur(e){const t=e.relatedTarget||iv.activeElement;if(!this.children().some(e=>{return e.el()===t})){const i=this.menuButton_;if(i&&i.buttonPressed_&&t!==i.el().firstChild){i.unpressButton()}}}handleTapClick(t){if(this.menuButton_){this.menuButton_.unpressButton();const e=this.children();if(!Array.isArray(e)){return}const i=e.filter(e=>e.el()===t.target)[0];if(!i){return}if(i.name()!=="CaptionSettingsMenuItem"){this.menuButton_.focus()}}}handleKeyDown(e){if(a.isEventKey(e,"Left")||a.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepForward()}else if(a.isEventKey(e,"Right")||a.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepBack()}}stepForward(){let e=0;if(this.focusedChild_!==undefined){e=this.focusedChild_+1}this.focus(e)}stepBack(){let e=0;if(this.focusedChild_!==undefined){e=this.focusedChild_-1}this.focus(e)}focus(e=0){const t=this.children().slice();const i=t.length&&t[0].hasClass("vjs-menu-title");if(i){t.shift()}if(t.length>0){if(e<0){e=0}else if(e>=t.length){e=t.length-1}this.focusedChild_=e;t[e].el_.focus()}}}g.registerComponent("Menu",hr);class fr extends g{constructor(e,t={}){super(e,t);this.menuButton_=new An(e,t);this.menuButton_.controlText(this.controlText_);this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=An.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i;this.menuButton_.removeClass("vjs-control");this.addChild(this.menuButton_);this.update();this.enabled_=true;const s=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e);this.on(this.menuButton_,"tap",s);this.on(this.menuButton_,"click",s);this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e));this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover");this.menu.show();yt(iv,"keyup",this.handleMenuKeyUp_)});this.on("mouseleave",e=>this.handleMouseLeave(e));this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){const e=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=e;this.addChild(e);this.buttonPressed_=false;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide();this.menu.contentEl_.removeAttribute("role")}else{this.show();this.menu.contentEl_.setAttribute("role","menu")}}createMenu(){const t=new hr(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){const e=l("li",{className:"vjs-menu-title",textContent:m(this.options_.title),tabIndex:-1});const i=new g(this.player_,{el:e});t.addItem(i)}this.items=this.createItems();if(this.items){for(let e=0;ea.isEventKey(t,e))){super.handleKeyDown(t)}}handleClick(e){this.selected(true)}selected(e){if(this.selectable){if(e){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=true}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=false}}}}g.registerComponent("MenuItem",gr);class vr extends gr{constructor(e,t){const i=t.track;const s=e.textTracks();t.label=i.label||i.language||"Unknown";t.selected=i.mode==="showing";super(e,t);this.track=i;this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...e)=>{this.handleTracksChange.apply(this,e)};const r=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};e.on(["loadstart","texttrackchange"],n);s.addEventListener("change",n);s.addEventListener("selectedlanguagechange",r);this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n);s.removeEventListener("change",n);s.removeEventListener("selectedlanguagechange",r)});if(s.onchange===undefined){let e;this.on(["tap","click"],function(){if(typeof tv.Event!=="object"){try{e=new tv.Event("change")}catch(e){}}if(!e){e=iv.createEvent("Event");e.initEvent("change",true,true)}s.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){const t=this.track;const i=this.player_.textTracks();super.handleClick(e);if(!i){return}for(let e=0;e-1&&n.mode==="showing"){s=false;break}}if(s!==this.isSelected_){this.selected(s)}}handleSelectedLanguageChange(e){const i=this.player().textTracks();let s=true;for(let e=0,t=i.length;e-1&&n.mode==="showing"){s=false;break}}if(s){this.player_.cache_.selectedLanguage={enabled:false}}}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label);super.handleLanguagechange()}}g.registerComponent("OffTextTrackMenuItem",yr);class br extends pr{constructor(e,t={}){t.tracks=e.textTracks();super(e,t)}createItems(t=[],i=vr){let e;if(this.label_){e=`${this.label_} off`}t.push(new yr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:e}));this.hideThreshold_+=1;const s=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(let e=0;e-1){const r=new i(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:true,multiSelectable:false});r.addClass(`vjs-${n.kind}-menu-item`);t.push(r)}}return t}}g.registerComponent("TextTrackButton",br);class _r extends gr{constructor(e,t){const i=t.track;const s=t.cue;const n=e.currentTime();t.selectable=true;t.multiSelectable=false;t.label=s.text;t.selected=s.startTime<=n&&n{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters"){return}const t=this.findChaptersTrack();if(t!==this.track_){this.setTrack(t);super.update()}else if(!this.items||t&&t.cues&&t.cues.length!==this.items.length){super.update()}}setTrack(e){if(this.track_===e){return}if(!this.updateHandler_){this.updateHandler_=this.update.bind(this)}if(this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.removeEventListener("load",this.updateHandler_)}this.track_.removeEventListener("cuechange",this.selectCurrentItem_);this.track_=null}this.track_=e;if(this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.addEventListener("load",this.updateHandler_)}this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}findChaptersTrack(){const t=this.player_.textTracks()||[];for(let e=t.length-1;e>=0;e--){const i=t[e];if(i.kind===this.kind_){return i}}}getMenuCaption(){if(this.track_&&this.track_.label){return this.track_.label}return this.localize(m(this.kind_))}createMenu(){this.options_.title=this.getMenuCaption();return super.createMenu()}createItems(){const i=[];if(!this.track_){return i}const s=this.track_.cues;if(!s){return i}for(let e=0,t=s.length;e-1){this.label_="captions";this.setIcon("captions")}this.menuButton_.controlText(m(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){e.push(new wr(this.player_,{kind:this.label_}));this.hideThreshold_+=1}e=super.createItems(e,jr);return e}}Cr.prototype.kinds_=["captions","subtitles"];Cr.prototype.controlText_="Subtitles";g.registerComponent("SubsCapsButton",Cr);class Ir extends gr{constructor(e,t){const i=t.track;const s=e.audioTracks();t.label=i.label||i.language||"Unknown";t.selected=i.enabled;super(e,t);this.track=i;this.addClass(`vjs-${i.kind}-menu-item`);const n=(...e)=>{this.handleTracksChange.apply(this,e)};s.addEventListener("change",n);this.on("dispose",()=>{s.removeEventListener("change",n)})}createEl(e,t,i){const s=super.createEl(e,t,i);const n=s.querySelector(".vjs-menu-item-text");if(["main-desc","description"].indexOf(this.options_.track.kind)>=0){n.appendChild(l("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));n.appendChild(l("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))}return s}handleClick(e){super.handleClick(e);this.track.enabled=true;if(this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let e=0;ethis.update(e))}handleClick(e){super.handleClick();this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Ar.prototype.contentElType="button";g.registerComponent("PlaybackRateMenuItem",Ar);class Dr extends fr{constructor(e,t){super(e,t);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_);this.updateVisibility();this.updateLabel();this.on(e,"loadstart",e=>this.updateVisibility(e));this.on(e,"ratechange",e=>this.updateLabel(e));this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();this.labelElId_="vjs-playback-rate-value-label-"+this.id_;this.labelEl_=l("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"});e.appendChild(this.labelEl_);return e}dispose(){this.labelEl_=null;super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const t=this.playbackRates();const i=[];for(let e=t.length-1;e>=0;e--){i.push(new Ar(this.player(),{rate:t[e]+"x"}))}return i}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){if(this.playbackRateSupported()){this.removeClass("vjs-hidden")}else{this.addClass("vjs-hidden")}}updateLabel(e){if(this.playbackRateSupported()){this.labelEl_.textContent=this.player().playbackRate()+"x"}}}Dr.prototype.controlText_="Playback Rate";g.registerComponent("PlaybackRateMenuButton",Dr);class Or extends g{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){if(!t.className){t.className=this.buildCSSClass()}return super.createEl(e,t,i)}}g.registerComponent("Spacer",Or);class Pr extends Or{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"})}}g.registerComponent("CustomControlSpacer",Pr);class Lr extends g{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Lr.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};g.registerComponent("ControlBar",Lr);class Rr extends pi{constructor(e,t){super(e,t);this.on(e,"error",e=>{this.close();this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Rr.prototype.options_=Object.assign({},pi.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});g.registerComponent("ErrorDisplay",Rr);const Nr="vjs-text-track-settings";const Mr=["#000","Black"];const Ur=["#00F","Blue"];const Br=["#0FF","Cyan"];const Fr=["#0F0","Green"];const qr=["#F0F","Magenta"];const Vr=["#F00","Red"];const Hr=["#FFF","White"];const $r=["#FF0","Yellow"];const zr=["1","Opaque"];const Gr=["0.5","Semi-Transparent"];const Kr=["0","Transparent"];const Wr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Mr,Hr,Vr,Fr,Ur,$r,qr,Br]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[zr,Gr,Kr]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Hr,Mr,Vr,Fr,Ur,$r,qr,Br]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>e==="1.00"?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[zr,Gr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Kr,Gr,zr]}};Wr.windowColor.options=Wr.backgroundColor.options;function Yr(e,t){if(t){e=t(e)}if(e&&e!=="none"){return e}}function Xr(e,t){const i=e.options[e.options.selectedIndex].value;return Yr(i,t)}function Qr(t,i,s){if(!i){return}for(let e=0;e{this.saveSettings();this.close()});this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults();this.updateDisplay()});Q(Wr,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)});if(this.options_.persistTextTrackSettings){this.restoreSettings()}}dispose(){this.endDialog=null;super.dispose()}createElSelect_(e,t="",i="label"){const s=Wr[e];const n=s.id.replace("%s",this.id_);const r=[t,n].join(" ").trim();return[`<${i} id="${n}" class="${i==="label"?"vjs-label":""}">`,this.localize(s.label),``,`").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['
',``,this.localize("Text"),"",'',this.createElSelect_("color",e),"",'',this.createElSelect_("textOpacity",e),"","
"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['
',``,this.localize("Text Background"),"",'',this.createElSelect_("backgroundColor",e),"",'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['
',``,this.localize("Caption Area Background"),"",'',this.createElSelect_("windowColor",e),"",'',this.createElSelect_("windowOpacity",e),"","
"].join("")}createElColors_(){return l("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return l("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return l("div",{className:"vjs-track-settings-controls",innerHTML:[`",``].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return J(Wr,(e,t,i)=>{const s=Xr(this.$(t.selector),t.parser);if(s!==undefined){e[i]=s}return e},{})}setValues(i){Q(Wr,(e,t)=>{Qr(this.$(e.selector),i[t],e.parser)})}setDefaults(){Q(Wr,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(tv.localStorage.getItem(Nr))}catch(e){d.warn(e)}if(e){this.setValues(e)}}saveSettings(){if(!this.options_.persistTextTrackSettings){return}const e=this.getValues();try{if(Object.keys(e).length){tv.localStorage.setItem(Nr,JSON.stringify(e))}else{tv.localStorage.removeItem(Nr)}}catch(e){d.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");if(e){e.updateDisplay()}}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar;const t=e&&e.subsCapsButton;const i=e&&e.captionsButton;if(t){t.focus()}else if(i){i.focus()}}handleLanguagechange(){this.fill()}}g.registerComponent("TextTrackSettings",Jr);class Zr extends g{constructor(e,t){let i=t.ResizeObserver||tv.ResizeObserver;if(t.ResizeObserver===null){i=false}const s=h({createEl:!i,reportTouchActivity:false},t);super(e,s);this.ResizeObserver=t.ResizeObserver||tv.ResizeObserver;this.loadListener_=null;this.resizeObserver_=null;this.debouncedHandler_=kt(()=>{this.resizeHandler()},100,false,this);if(i){this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_);this.resizeObserver_.observe(e.el())}else{this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow){return}const e=this.debouncedHandler_;let t=this.unloadListener_=function(){c(this,"resize",e);c(this,"unload",t);t=null};yt(this.el_.contentWindow,"unload",t);yt(this.el_.contentWindow,"resize",e)};this.one("load",this.loadListener_)}}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")}dispose(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(this.el_&&this.el_.contentWindow&&this.unloadListener_){this.unloadListener_.call(this.el_.contentWindow)}this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;super.dispose()}}g.registerComponent("ResizeManager",Zr);const ea={trackingThreshold:20,liveTolerance:15};class ta extends g{constructor(e,t){const i=h(ea,t,{createEl:false});super(e,i);this.trackLiveHandler_=()=>this.trackLive_();this.handlePlay_=e=>this.handlePlay(e);this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e);this.handleSeeked_=e=>this.handleSeeked(e);this.seekToLiveEdge_=e=>this.seekToLiveEdge(e);this.reset_();this.on(this.player_,"durationchange",e=>this.handleDurationchange(e));this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length){return}const t=Number(tv.performance.now().toFixed(4));const i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t;this.pastSeekEnd_=this.pastSeekEnd()+i;const s=this.liveCurrentTime();const n=this.player_.currentTime();let r=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-n)>this.options_.liveTolerance;if(!this.timeupdateSeen_||s===Infinity){r=false}if(r!==this.behindLiveEdge_){this.behindLiveEdge_=r;this.trigger("liveedgechange")}}handleDurationchange(){this.toggleTracking()}toggleTracking(){if(this.player_.duration()===Infinity&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui){this.player_.addClass("vjs-liveui")}this.startTracking()}else{this.player_.removeClass("vjs-liveui");this.stopTracking()}}startTracking(){if(this.isTracking()){return}if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted()}this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Et);this.trackLive_();this.on(this.player_,["play","pause"],this.trackLiveHandler_);if(!this.timeupdateSeen_){this.one(this.player_,"play",this.handlePlay_);this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)}else{this.on(this.player_,"seeked",this.handleSeeked_)}}handleFirstTimeupdate(){this.timeupdateSeen_=true;this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2;this.nextSeekedFromUser_=false;this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1;this.pastSeekEnd_=0;this.lastSeekEnd_=-1;this.behindLiveEdge_=true;this.timeupdateSeen_=false;this.seekedBehindLive_=false;this.nextSeekedFromUser_=false;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.off(this.player_,["play","pause"],this.trackLiveHandler_);this.off(this.player_,"seeked",this.handleSeeked_);this.off(this.player_,"play",this.handlePlay_);this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_);this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=true}stopTracking(){if(!this.isTracking()){return}this.reset_();this.trigger("liveedgechange")}seekableEnd(){const e=this.player_.seekable();const t=[];let i=e?e.length:0;while(i--){t.push(e.end(i))}return t.length?t.sort()[t.length-1]:Infinity}seekableStart(){const e=this.player_.seekable();const t=[];let i=e?e.length:0;while(i--){t.push(e.start(i))}return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();if(e===Infinity){return 0}return e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();if(this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_){this.pastSeekEnd_=0}this.lastSeekEnd_=e;return this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_==="number"}seekToLiveEdge(){this.seekedBehindLive_=false;if(this.atLiveEdge()){return}this.nextSeekedFromUser_=false;this.player_.currentTime(this.liveCurrentTime())}dispose(){this.stopTracking();super.dispose()}}g.registerComponent("LiveTracker",ta);class ia extends g{constructor(e,t){super(e,t);this.on("statechanged",e=>this.updateDom_());this.updateDom_()}createEl(){this.els={title:l("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${dt()}`}),description:l("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${dt()}`})};return l("div",{className:"vjs-title-bar"},{},te(this.els))}updateDom_(){const e=this.player_.tech_;const n=e&&e.el_;const r={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const t=this.state[e];const i=this.els[e];const s=r[e];Ge(i);if(t){xe(i,t)}if(n){n.removeAttribute(s);if(t){n.setAttribute(s,i.id)}}});if(this.state.title||this.state.description){this.show()}else{this.hide()}}update(e){this.setState(e)}dispose(){const e=this.player_.tech_;const t=e&&e.el_;if(t){t.removeAttribute("aria-labelledby");t.removeAttribute("aria-describedby")}super.dispose();this.els=null}}g.registerComponent("TitleBar",ia);const sa=e=>{const t=e.el();if(t.hasAttribute("src")){e.triggerSourceset(t.src);return true}const i=e.$$("source");const s=[];let n="";if(!i.length){return false}for(let e=0;e{let s={};for(let e=0;era([e.el(),tv.HTMLMediaElement.prototype,tv.Element.prototype,na],"innerHTML");const oa=function(s){const n=s.el();if(n.resetSourceWatch_){return}const t={};const e=aa(s);const i=i=>(...e)=>{const t=i.apply(n,e);sa(s);return t};["append","appendChild","insertAdjacentHTML"].forEach(e=>{if(!n[e]){return}t[e]=n[e];n[e]=i(t[e])});Object.defineProperty(n,"innerHTML",h(e,{set:i(e.set)}));n.resetSourceWatch_=()=>{n.resetSourceWatch_=null;Object.keys(t).forEach(e=>{n[e]=t[e]});Object.defineProperty(n,"innerHTML",e)};s.one("sourceset",n.resetSourceWatch_)};const la=Object.defineProperty({},"src",{get(){if(this.hasAttribute("src")){return xi(tv.Element.prototype.getAttribute.call(this,"src"))}return""},set(e){tv.Element.prototype.setAttribute.call(this,"src",e);return e}});const ca=e=>ra([e.el(),tv.HTMLMediaElement.prototype,la],"src");const ua=function(s){if(!s.featuresSourceset){return}const n=s.el();if(n.resetSourceset_){return}const i=ca(s);const r=n.setAttribute;const t=n.load;Object.defineProperty(n,"src",h(i,{set:e=>{const t=i.set.call(n,e);s.triggerSourceset(n.src);return t}}));n.setAttribute=(e,t)=>{const i=r.call(n,e,t);if(/src/i.test(e)){s.triggerSourceset(n.src)}return i};n.load=()=>{const e=t.call(n);if(!sa(s)){s.triggerSourceset("");oa(s)}return e};if(n.currentSrc){s.triggerSourceset(n.currentSrc)}else if(!sa(s)){oa(s)}n.resetSourceset_=()=>{n.resetSourceset_=null;n.load=t;n.setAttribute=r;Object.defineProperty(n,"src",i);if(n.resetSourceWatch_){n.resetSourceWatch_()}}};class _ extends b{constructor(e,t){super(e,t);const i=e.source;let s=false;this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO";if(i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)){this.setSource(i)}else{this.handleLateInit_(this.el_)}if(e.enableSourceset){this.setupSourcesetHandling_()}this.isScrubbing_=false;if(this.el_.hasChildNodes()){const n=this.el_.childNodes;let e=n.length;const r=[];while(e--){const a=n[e];const o=a.nodeName.toLowerCase();if(o==="track"){if(!this.featuresNativeTextTracks){r.push(a)}else{this.remoteTextTrackEls().addTrackElement_(a);this.remoteTextTracks().addTrack(a.track);this.textTracks().addTrack(a.track);if(!s&&!this.el_.hasAttribute("crossorigin")&&Di(a.src)){s=true}}}}for(let e=0;e{s=[];for(let e=0;ei.removeEventListener("change",e));const n=()=>{for(let e=0;e{i.removeEventListener("change",e);i.removeEventListener("change",n);i.addEventListener("change",n)});this.on("webkitendfullscreen",()=>{i.removeEventListener("change",e);i.addEventListener("change",e);i.removeEventListener("change",n)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`]){return}const i=e.toLowerCase();if(this[`${i}TracksListeners_`]){Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{const t=this.el()[`${i}Tracks`];t.removeEventListener(e,this[`${i}TracksListeners_`][e])})}this[`featuresNative${e}Tracks`]=!t;this[`${i}TracksListeners_`]=null;this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(i){const e=rs[i];const s=this.el()[e.getterName];const n=this[e.getterName]();if(!this[`featuresNative${e.capitalName}Tracks`]||!s||!s.addEventListener){return}const r={change:e=>{const t={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(t);if(i==="text"){this[as.remoteText.getterName]().trigger(t)}},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}};const t=function(){const e=[];for(let i=0;i{const i=r[t];s.addEventListener(t,i);this.on("dispose",e=>s.removeEventListener(t,i))});this.on("loadstart",t);this.on("dispose",e=>this.off("loadstart",t))}proxyNativeTracks_(){rs.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let t=this.options_.tag;if(!t||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(t){const e=t.cloneNode(true);if(t.parentNode){t.parentNode.insertBefore(e,t)}_.disposeMediaElement(t);t=e}else{t=iv.createElement("video");const s=this.options_.tag&&Ne(this.options_.tag);const n=h({},s);if(!be||this.options_.nativeControlsForTouch!==true){delete n.controls}Re(t,Object.assign(n,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}if(typeof this.options_.preload!=="undefined"){Ue(t,"preload",this.options_.preload)}if(this.options_.disablePictureInPicture!==undefined){t.disablePictureInPicture=this.options_.disablePictureInPicture}const i=["loop","muted","playsinline","autoplay"];for(let e=0;e=2){t.push("loadeddata")}if(e.readyState>=3){t.push("canplay")}if(e.readyState>=4){t.push("canplaythrough")}this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{if(this.isScrubbing_&&this.el_.fastSeek&&Te){this.el_.fastSeek(e)}else{this.el_.currentTime=e}}catch(e){d(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===Infinity&&ae&&de&&this.el_.currentTime===0){const e=()=>{if(this.el_.currentTime>0){if(this.el_.duration===Infinity){this.trigger("durationchange")}this.off("timeupdate",e)}};this.on("timeupdate",e);return NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_)){return}const e=function(){this.trigger("fullscreenchange",{isFullscreen:false});if(this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()){this.el_.controls=false}};const t=function(){if("webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"){this.one("webkitendfullscreen",e);this.trigger("fullscreenchange",{isFullscreen:true,nativeIOSFullscreen:true})}};this.on("webkitbeginfullscreen",t);this.on("dispose",()=>{this.off("webkitbeginfullscreen",t);this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen==="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA){li(this.el_.play());this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0)}else{try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){return this.el_.requestVideoFrameCallback(e)}return super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){this.el_.cancelVideoFrameCallback(e)}else{super.cancelVideoFrameCallback(e)}}src(e){if(e===undefined){return this.el_.src}this.setSrc(e)}reset(){_.resetMediaElement(this.el_)}currentSrc(){if(this.currentSource_){return this.currentSource_.src}return this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){if(!this.featuresNativeTextTracks){return super.addTextTrack(e,t,i)}return this.el_.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks){return super.createRemoteTextTrack(e)}const t=iv.createElement("track");if(e.kind){t.kind=e.kind}if(e.label){t.label=e.label}if(e.language||e.srclang){t.srclang=e.language||e.srclang}if(e.default){t.default=e.default}if(e.id){t.id=e.id}if(e.src){t.src=e.src}return t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);if(this.featuresNativeTextTracks){this.el().appendChild(i)}return i}removeRemoteTextTrack(t){super.removeRemoteTextTrack(t);if(this.featuresNativeTextTracks){const i=this.$$("track");let e=i.length;while(e--){if(t===i[e]||t===i[e].track){this.el().removeChild(i[e])}}}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==="function"){return this.el().getVideoPlaybackQuality()}const e={};if(typeof this.el().webkitDroppedFrameCount!=="undefined"&&typeof this.el().webkitDecodedFrameCount!=="undefined"){e.droppedVideoFrames=this.el().webkitDroppedFrameCount;e.totalVideoFrames=this.el().webkitDecodedFrameCount}if(tv.performance){e.creationTime=tv.performance.now()}return e}}ie(_,"TEST_VID",function(){if(!ke()){return}const e=iv.createElement("video");const t=iv.createElement("track");t.kind="captions";t.srclang="en";t.label="English";e.appendChild(t);return e});_.isSupported=function(){try{_.TEST_VID.volume=.5}catch(e){return false}return!!(_.TEST_VID&&_.TEST_VID.canPlayType)};_.canPlayType=function(e){return _.TEST_VID.canPlayType(e)};_.canPlaySource=function(e,t){return _.canPlayType(e.type)};_.canControlVolume=function(){try{const e=_.TEST_VID.volume;_.TEST_VID.volume=e/2+.1;const t=e!==_.TEST_VID.volume;if(t&&f){tv.setTimeout(()=>{if(_&&_.prototype){_.prototype.featuresVolumeControl=e!==_.TEST_VID.volume}});return false}return t}catch(e){return false}};_.canMuteVolume=function(){try{const e=_.TEST_VID.muted;_.TEST_VID.muted=!e;if(_.TEST_VID.muted){Ue(_.TEST_VID,"muted","muted")}else{Be(_.TEST_VID,"muted","muted")}return e!==_.TEST_VID.muted}catch(e){return false}};_.canControlPlaybackRate=function(){if(ae&&de&&fe<58){return false}try{const e=_.TEST_VID.playbackRate;_.TEST_VID.playbackRate=e/2+.1;return e!==_.TEST_VID.playbackRate}catch(e){return false}};_.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(iv.createElement("video"),"src",{get:e,set:e});Object.defineProperty(iv.createElement("audio"),"src",{get:e,set:e});Object.defineProperty(iv.createElement("video"),"innerHTML",{get:e,set:e});Object.defineProperty(iv.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return false}return true};_.supportsNativeTextTracks=function(){return Te||f&&de};_.supportsNativeVideoTracks=function(){return!!(_.TEST_VID&&_.TEST_VID.videoTracks)};_.supportsNativeAudioTracks=function(){return!!(_.TEST_VID&&_.TEST_VID.audioTracks)};_.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){ie(_.prototype,e,()=>_[t](),true)});_.prototype.featuresVolumeControl=_.canControlVolume();_.prototype.movingMediaElementInDOM=!f;_.prototype.featuresFullscreenResize=true;_.prototype.featuresProgressEvents=true;_.prototype.featuresTimeupdateEvents=true;_.prototype.featuresVideoFrameCallback=!!(_.TEST_VID&&_.TEST_VID.requestVideoFrameCallback);_.disposeMediaElement=function(e){if(!e){return}if(e.parentNode){e.parentNode.removeChild(e)}while(e.hasChildNodes()){e.removeChild(e.firstChild)}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};_.resetMediaElement=function(e){if(!e){return}const t=e.querySelectorAll("source");let i=t.length;while(i--){e.removeChild(t[i])}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){_.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){_.prototype["set"+m(t)]=function(e){this.el_[t]=e;if(e){this.el_.setAttribute(t,t)}else{this.el_.removeAttribute(t)}}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){_.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){_.prototype["set"+m(t)]=function(e){this.el_[t]=e}});["pause","load","play"].forEach(function(e){_.prototype[e]=function(){return this.el_[e]()}});b.withSourceHandlers(_);_.nativeSourceHandler={};_.nativeSourceHandler.canPlayType=function(e){try{return _.TEST_VID.canPlayType(e)}catch(e){return""}};_.nativeSourceHandler.canHandleSource=function(e,t){if(e.type){return _.nativeSourceHandler.canPlayType(e.type)}else if(e.src){const i=Ai(e.src);return _.nativeSourceHandler.canPlayType(`video/${i}`)}return""};_.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)};_.nativeSourceHandler.dispose=function(){};_.registerSourceHandler(_.nativeSourceHandler);b.registerTech("Html5",_);const da=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"];const ha={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"};const fa=["tiny","xsmall","small","medium","large","xlarge","huge"];const pa={};fa.forEach(e=>{const t=e.charAt(0)==="x"?`x-${e.substring(1)}`:e;pa[e]=`vjs-layout-${t}`});const ma={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};class T extends g{constructor(e,t,i){e.id=e.id||t.id||`vjs_video_${dt()}`;t=Object.assign(T.getTagSettings(e),t);t.initChildren=false;t.createEl=false;t.evented=false;t.reportTouchActivity=false;if(!t.language){const r=e.closest("[lang]");if(r){t.language=r.getAttribute("lang")}}super(null,t,i);this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e);this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e);this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e);this.boundApplyInitTime_=e=>this.applyInitTime_(e);this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e);this.boundHandleTechClick_=e=>this.handleTechClick_(e);this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e);this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e);this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e);this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e);this.boundHandleTechTap_=e=>this.handleTechTap_(e);this.isFullscreen_=false;this.log=W(this.id_);this.fsApi_=V;this.isPosterFromTech_=false;this.queuedCallbacks_=[];this.isReady_=false;this.hasStarted_=false;this.userActive_=false;this.debugEnabled_=false;this.audioOnlyMode_=false;this.audioPosterMode_=false;this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]};if(!this.options_||!this.options_.techOrder||!this.options_.techOrder.length){throw new Error("No techOrder specified. Did you overwrite "+"videojs.options instead of just changing the "+"properties you want to override?")}this.tag=e;this.tagAttributes=e&&Ne(e);this.language(this.options_.language);if(t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(e){a[e.toLowerCase()]=t.languages[e]});this.languages_=a}else{this.languages_=T.prototype.options_.languages}this.resetCache_();this.poster_=t.poster||"";this.controls_=!!t.controls;e.controls=false;e.removeAttribute("controls");this.changingSrc_=false;this.playCallbacks_=[];this.playTerminatedQueue_=[];if(e.hasAttribute("autoplay")){this.autoplay(true)}else{this.autoplay(this.options_.autoplay)}if(t.plugins){Object.keys(t.plugins).forEach(e=>{if(typeof this[e]!=="function"){throw new Error(`plugin "${e}" does not exist`)}})}this.scrubbing_=false;this.el_=this.createEl();Bt(this,{eventBusKey:"el_"});if(this.fsApi_.requestFullscreen){yt(iv,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)}if(this.fluid_){this.on(["playerreset","resize"],this.boundUpdateStyleEl_)}const s=h(this.options_);if(t.plugins){Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])})}if(t.debug){this.debug(true)}this.options_.playerOptions=s;this.middleware_=[];this.playbackRates(t.playbackRates);if(t.experimentalSvgIcons){const o=new tv.DOMParser;const l=o.parseFromString(yn,"image/svg+xml");const c=l.querySelector("parsererror");if(c){d.warn("Failed to load SVG Icons. Falling back to Font Icons.");this.options_.experimentalSvgIcons=null}else{const u=l.documentElement;u.style.display="none";this.el_.appendChild(u);this.addClass("vjs-svg-icons-enabled")}}this.initChildren();this.isAudio(e.nodeName.toLowerCase()==="audio");if(this.controls()){this.addClass("vjs-controls-enabled")}else{this.addClass("vjs-controls-disabled")}this.el_.setAttribute("role","region");if(this.isAudio()){this.el_.setAttribute("aria-label",this.localize("Audio Player"))}else{this.el_.setAttribute("aria-label",this.localize("Video Player"))}if(this.isAudio()){this.addClass("vjs-audio")}if(be){this.addClass("vjs-touch-enabled")}if(!f){this.addClass("vjs-workinghover")}T.players[this.id_]=this;const n=N.split(".")[0];this.addClass(`vjs-v${n}`);this.userActive(true);this.reportUserActivity();this.one("play",e=>this.listenForUserActivity_(e));this.on("keydown",e=>this.handleKeyDown(e));this.on("languagechange",e=>this.handleLanguagechange(e));this.breakpoints(this.options_.breakpoints);this.responsive(this.options_.responsive);this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode);this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose");this.off("dispose");c(iv,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);c(iv,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}T.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=false;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}un(this);v.names.forEach(e=>{const t=v[e];const i=this[t.getterName]();if(i&&i.off){i.off()}});super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let t=this.tag;let i;let e=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const s=this.tag.tagName.toLowerCase()==="video-js";if(e){i=this.el_=t.parentNode}else if(!s){i=this.el_=super.createEl("div")}const n=Ne(t);if(s){i=this.el_=t;t=this.tag=iv.createElement("video");while(i.children.length){t.appendChild(i.firstChild)}if(!De(i,"video-js")){Oe(i,"video-js")}i.appendChild(t);e=this.playerElIngest_=i;Object.keys(i).forEach(e=>{try{t[e]=i[e]}catch(e){}})}t.setAttribute("tabindex","-1");n.tabindex="-1";if(de&&ge){t.setAttribute("role","application");n.role="application"}t.removeAttribute("width");t.removeAttribute("height");if("width"in n){delete n.width}if("height"in n){delete n.height}Object.getOwnPropertyNames(n).forEach(function(e){if(!(s&&e==="class")){i.setAttribute(e,n[e])}if(s){t.setAttribute(e,n[e])}});t.playerId=t.id;t.id+="_html5_api";t.className="vjs-tech";t.player=i.player=this;this.addClass("vjs-paused");if(tv.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=ot("vjs-styles-dimensions");const a=Qe(".vjs-styles-defaults");const e=Qe("head");e.insertBefore(this.styleEl_,a?a.nextSibling:e.firstChild)}this.fill_=false;this.fluid_=false;this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const r=t.getElementsByTagName("a");for(let e=0;e{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})}else{this.removeClass("vjs-fluid")}this.updateStyleEl_()}fill(e){if(e===undefined){return!!this.fill_}this.fill_=!!e;if(e){this.addClass("vjs-fill");this.fluid(false)}else{this.removeClass("vjs-fill")}}aspectRatio(e){if(e===undefined){return this.aspectRatio_}if(!/^\d+\:\d+$/.test(e)){throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.")}this.aspectRatio_=e;this.fluid(true);this.updateStyleEl_()}updateStyleEl_(){if(tv.VIDEOJS_NO_DYNAMIC_STYLE===true){const e=typeof this.width_==="number"?this.width_:this.options_.width;const t=typeof this.height_==="number"?this.height_:this.options_.height;const a=this.tech_&&this.tech_.el();if(a){if(e>=0){a.width=e}if(t>=0){a.height=t}}return}let e;let t;let i;let s;if(this.aspectRatio_!==undefined&&this.aspectRatio_!=="auto"){i=this.aspectRatio_}else if(this.videoWidth()>0){i=this.videoWidth()+":"+this.videoHeight()}else{i="16:9"}const n=i.split(":");const r=n[1]/n[0];if(this.width_!==undefined){e=this.width_}else if(this.height_!==undefined){e=this.height_/r}else{e=this.videoWidth()||300}if(this.height_!==undefined){t=this.height_}else{t=e*r}if(/^[^a-zA-Z]/.test(this.id())){s="dimensions-"+this.id()}else{s=this.id()+"-dimensions"}this.addClass(s);lt(this.styleEl_,` + .${s} { + width: ${e}px; + height: ${t}px; + } + + .${s}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${r*100}%; + } + `)}loadTech_(e,t){if(this.tech_){this.unloadTech_()}const i=m(e);const s=e.charAt(0).toLowerCase()+e.slice(1);if(i!=="Html5"&&this.tag){b.getTech("Html5").disposeMediaElement(this.tag);this.tag.player=null;this.tag=null}this.techName_=i;this.isReady_=false;let n=this.autoplay();if(typeof this.autoplay()==="string"||this.autoplay()===true&&this.options_.normalizeAutoplay){n=false}const r={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||false,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};v.names.forEach(e=>{const t=v[e];r[t.getterName]=this[t.privateName]});Object.assign(r,this.options_[i]);Object.assign(r,this.options_[s]);Object.assign(r,this.options_[e.toLowerCase()]);if(this.tag){r.tag=this.tag}if(t&&t.src===this.cache_.src&&this.cache_.currentTime>0){r.startTime=this.cache_.currentTime}const a=b.getTech(e);if(!a){throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`)}this.tech_=new a(r);this.tech_.ready(p(this,this.handleTechReady_),true);hi.jsonToTextTracks(this.textTracksJson_||[],this.tech_);da.forEach(t=>{this.on(this.tech_,t,e=>this[`handleTech${m(t)}_`](e))});Object.keys(ha).forEach(t=>{this.on(this.tech_,t,e=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${ha[t]}_`].bind(this),event:e});return}this[`handleTech${ha[t]}_`](e)})});this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e));this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e));this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e));this.on(this.tech_,"ended",e=>this.handleTechEnded_(e));this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e));this.on(this.tech_,"play",e=>this.handleTechPlay_(e));this.on(this.tech_,"pause",e=>this.handleTechPause_(e));this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e));this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t));this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t));this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e));this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e));this.on(this.tech_,"error",e=>this.handleTechError_(e));this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e));this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e));this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e));this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_);this.usingNativeControls(this.techGet_("controls"));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_()}if(this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)){Ae(this.tech_.el(),this.el())}if(this.tag){this.tag.player=null;this.tag=null}}unloadTech_(){v.names.forEach(e=>{const t=v[e];this[t.privateName]=this[t.getterName]()});this.textTracksJson_=hi.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_="";this.trigger("posterchange")}this.isPosterFromTech_=false}tech(e){if(e===undefined){d.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\n"+"See https://github.com/videojs/video.js/issues/2617 for more info.\n")}return this.tech_}addTechControlsListeners_(){this.removeTechControlsListeners_();this.on(this.tech_,"click",this.boundHandleTechClick_);this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_);this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_);this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_);this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_);this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_);this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_);this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_);this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_);this.off(this.tech_,"click",this.boundHandleTechClick_);this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady();if(this.cache_.volume){this.techCall_("setVolume",this.cache_.volume)}this.handleTechPosterChange_();this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking");this.error(null);this.handleTechDurationChange_();if(!this.paused()){this.trigger("loadstart")}else{this.hasStarted(false);this.trigger("loadstart")}this.manualAutoplay_(this.autoplay()===true&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!=="string"){return}const t=()=>{const e=this.muted();this.muted(true);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(!oi(i)){return}return i.catch(e=>{t();throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${e?e:""}`)})};let i;if(e==="any"&&!this.muted()){i=this.play();if(oi(i)){i=i.catch(t)}}else if(e==="muted"&&!this.muted()){i=t()}else{i=this.play()}if(!oi(i)){return}return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e;let i="";if(typeof t!=="string"){t=e.src;i=e.type}this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(t&&!i){i=mn(this,t)}this.cache_.source=h({},e,{src:t,type:i});const s=this.cache_.sources.filter(e=>e.src&&e.src===t);const n=[];const r=this.$$("source");const a=[];for(let e=0;ethis.updateSourceCaches_(e);const i=this.currentSource().src;const s=t.src;if(i&&!/^blob:/.test(i)&&/^blob:/.test(s)){if(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i){e=()=>{}}}e(s);if(!t.src){this.tech_.any(["sourceset","loadstart"],e=>{if(e.type==="sourceset"){return}const t=this.techGet_("currentSrc");this.lastSource_.tech=t;this.updateSourceCaches_(t)})}}this.lastSource_={player:this.currentSource().src,tech:t.src};this.trigger({src:t.src,type:"sourceset"})}hasStarted(e){if(e===undefined){return this.hasStarted_}if(e===this.hasStarted_){return}this.hasStarted_=e;if(this.hasStarted_){this.addClass("vjs-has-started")}else{this.removeClass("vjs-has-started")}}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.hasStarted(true);this.trigger("play")}handleTechRateChange_(){if(this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0){this.queuedCallbacks_.forEach(e=>e.callback(e.event));this.queuedCallbacks_=[]}this.cache_.lastPlaybackRate=this.tech_.playbackRate();this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting");this.trigger("waiting");const e=this.currentTime();const t=()=>{if(e!==this.currentTime()){this.removeClass("vjs-waiting");this.off("timeupdate",t)}};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting");this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting");this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting");this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking");this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended");this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended");this.removeClass("vjs-waiting");if(this.options_.loop){this.currentTime(0);this.play()}else if(!this.paused()){this.pause()}this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){if(!this.controls_){return}if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.click===undefined||this.options_.userActions.click!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.click==="function"){this.options_.userActions.click.call(this,e)}else if(this.paused()){li(this.play())}else{this.pause()}}}handleTechDoubleClick_(t){if(!this.controls_){return}const e=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),e=>e.contains(t.target));if(!e){if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.doubleClick===undefined||this.options_.userActions.doubleClick!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.doubleClick==="function"){this.options_.userActions.doubleClick.call(this,t)}else if(this.isFullscreen()){this.exitFullscreen()}else{this.requestFullscreen()}}}}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){if(this.userWasActive){this.reportUserActivity()}}handleTechTouchEnd_(e){if(e.cancelable){e.preventDefault()}}toggleFullscreenClass_(){if(this.isFullscreen()){this.addClass("vjs-fullscreen")}else{this.removeClass("vjs-fullscreen")}}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this){return}const i=this.el();let s=iv[this.fsApi_.fullscreenElement]===i;if(!s&&i.matches){s=i.matches(":"+this.fsApi_.fullscreen)}this.isFullscreen(s)}handleTechFullscreenChange_(e,t){if(t){if(t.nativeIOSFullscreen){this.addClass("vjs-ios-native-fs");this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})}this.isFullscreen(t.isFullscreen)}}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){if(this.isInPictureInPicture()){this.addClass("vjs-picture-in-picture")}else{this.removeClass("vjs-picture-in-picture")}}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(true)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(false)}handleTechError_(){const e=this.tech_.error();if(e){this.error(e)}}handleTechTextData_(){let e=null;if(arguments.length>1){e=arguments[1]}this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in an){return sn(this.middleware_,this.tech_,e,t)}else if(e in on){return nn(this.middleware_,this.tech_,e,t)}try{if(this.tech_){this.tech_[e](t)}}catch(e){d(e);throw e}},true)}techGet_(t){if(!this.tech_||!this.tech_.isReady_){return}if(t in rn){return tn(this.middleware_,this.tech_,t)}else if(t in on){return nn(this.middleware_,this.tech_,t)}try{return this.tech_[t]()}catch(e){if(this.tech_[t]===undefined){d(`Video.js: ${t} method not defined for ${this.techName_} playback technology.`,e);throw e}if(e.name==="TypeError"){d(`Video.js: ${t} unavailable on ${this.techName_} playback technology element.`,e);this.tech_.isReady_=false;throw e}d(e);throw e}}play(){return new Promise(e=>{this.play_(e)})}play_(e=li){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));const i=Boolean(Te||f);if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_);this.waitToPlay_=null}if(!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()};this.one(["ready","loadstart"],this.waitToPlay_);if(!t&&i){this.load()}return}const s=this.techGet_("play");const n=i&&this.hasClass("vjs-ended");if(n){this.resetProgressBar_()}if(s===null){this.runPlayTerminatedQueue_()}else{this.runPlayCallbacks_(s)}}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];e.forEach(function(e){e()})}runPlayCallbacks_(t){const e=this.playCallbacks_.slice(0);this.playCallbacks_=[];this.playTerminatedQueue_=[];e.forEach(function(e){e(t)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")===false?false:true}played(){return this.techGet_("played")||Qt(0,0)}scrubbing(e){if(typeof e==="undefined"){return this.scrubbing_}this.scrubbing_=!!e;this.techCall_("setScrubbing",this.scrubbing_);if(e){this.addClass("vjs-scrubbing")}else{this.removeClass("vjs-scrubbing")}}currentTime(e){if(e===undefined){this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime}if(e<0){e=0}if(!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e;this.off("canplay",this.boundApplyInitTime_);this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e);this.cache_.initTime=0;if(isFinite(e)){this.cache_.currentTime=Number(e)}}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===undefined){return this.cache_.duration!==undefined?this.cache_.duration:NaN}e=parseFloat(e);if(e<0){e=Infinity}if(e!==this.cache_.duration){this.cache_.duration=e;if(e===Infinity){this.addClass("vjs-live")}else{this.removeClass("vjs-live")}if(!isNaN(e)){this.trigger("durationchange")}}}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");if(!e||!e.length){e=Qt(0,0)}return e}seekable(){let e=this.techGet_("seekable");if(!e||!e.length){e=Qt(0,0)}return e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return ni(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered();const t=this.duration();let i=e.end(e.length-1);if(i>t){i=t}return i}volume(e){let t;if(e!==undefined){t=Math.max(0,Math.min(1,e));this.cache_.volume=t;this.techCall_("setVolume",t);if(t>0){this.lastVolume_(t)}return}t=parseFloat(this.techGet_("volume"));return isNaN(t)?1:t}muted(e){if(e!==undefined){this.techCall_("setMuted",e);return}return this.techGet_("muted")||false}defaultMuted(e){if(e!==undefined){this.techCall_("setDefaultMuted",e)}return this.techGet_("defaultMuted")||false}lastVolume_(e){if(e!==undefined&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||false}isFullscreen(e){if(e!==undefined){const t=this.isFullscreen_;this.isFullscreen_=Boolean(e);if(this.isFullscreen_!==t&&this.fsApi_.prefixed){this.trigger("fullscreenchange")}this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(a){if(this.isInPictureInPicture()){this.exitPictureInPicture()}const o=this;return new Promise((e,i)=>{function s(){o.off("fullscreenerror",n);o.off("fullscreenchange",t)}function t(){s();e()}function n(e,t){s();i(t)}o.one("fullscreenchange",t);o.one("fullscreenerror",n);const r=o.requestFullscreenHelper_(a);if(r){r.then(s,s);r.then(e,i)}})}requestFullscreenHelper_(e){let t;if(!this.fsApi_.prefixed){t=this.options_.fullscreen&&this.options_.fullscreen.options||{};if(e!==undefined){t=e}}if(this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);if(i){i.then(()=>this.isFullscreen(true),()=>this.isFullscreen(false))}return i}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("enterFullScreen")}else{this.enterFullWindow()}}exitFullscreen(){const a=this;return new Promise((e,i)=>{function s(){a.off("fullscreenerror",n);a.off("fullscreenchange",t)}function t(){s();e()}function n(e,t){s();i(t)}a.one("fullscreenchange",t);a.one("fullscreenerror",n);const r=a.exitFullscreenHelper_();if(r){r.then(s,s);r.then(e,i)}})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=iv[this.fsApi_.exitFullscreen]();if(e){li(e.then(()=>this.isFullscreen(false)))}return e}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("exitFullScreen")}else{this.exitFullWindow()}}enterFullWindow(){this.isFullscreen(true);this.isFullWindow=true;this.docOrigOverflow=iv.documentElement.style.overflow;yt(iv,"keydown",this.boundFullWindowOnEscKey_);iv.documentElement.style.overflow="hidden";Oe(iv.body,"vjs-full-window");this.trigger("enterFullWindow")}fullWindowOnEscKey(e){if(a.isEventKey(e,"Esc")){if(this.isFullscreen()===true){if(!this.isFullWindow){this.exitFullscreen()}else{this.exitFullWindow()}}}}exitFullWindow(){this.isFullscreen(false);this.isFullWindow=false;c(iv,"keydown",this.boundFullWindowOnEscKey_);iv.documentElement.style.overflow=this.docOrigOverflow;Pe(iv.body,"vjs-full-window");this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===undefined){return this.techGet_("disablePictureInPicture")}this.techCall_("setDisablePictureInPicture",e);this.options_.disablePictureInPicture=e;this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==undefined){this.isInPictureInPicture_=!!e;this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&tv.documentPictureInPicture){const i=iv.createElement(this.el().tagName);i.classList=this.el().classList;i.classList.add("vjs-pip-container");if(this.posterImage){i.appendChild(this.posterImage.el().cloneNode(true))}if(this.titleBar){i.appendChild(this.titleBar.el().cloneNode(true))}i.appendChild(l("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture")));return tv.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(e=>{et(e);this.el_.parentNode.insertBefore(i,this.el_);e.document.body.appendChild(this.el_);e.document.body.classList.add("vjs-pip-window");this.player_.isInPictureInPicture(true);this.player_.trigger("enterpictureinpicture");e.addEventListener("pagehide",e=>{const t=e.target.querySelector(".video-js");i.parentNode.replaceChild(t,i);this.player_.isInPictureInPicture(false);this.player_.trigger("leavepictureinpicture")});return e})}if("pictureInPictureEnabled"in iv&&this.disablePictureInPicture()===false){return this.techGet_("requestPictureInPicture")}return Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(tv.documentPictureInPicture&&tv.documentPictureInPicture.window){tv.documentPictureInPicture.window.close();return Promise.resolve()}if("pictureInPictureEnabled"in iv){return iv.exitPictureInPicture()}}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys){return}const i=e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable){return true}const i=["button","checkbox","hidden","radio","reset","submit"];if(t==="input"){return i.indexOf(e.type)===-1}const s=["textarea"];return s.indexOf(t)!==-1};if(i(this.el_.ownerDocument.activeElement)){return}if(typeof t.hotkeys==="function"){t.hotkeys.call(this,e)}else{this.handleHotkeys(e)}}handleHotkeys(t){const e=this.options_.userActions?this.options_.userActions.hotkeys:{};const{fullscreenKey:i=e=>a.isEventKey(e,"f"),muteKey:s=e=>a.isEventKey(e,"m"),playPauseKey:n=e=>a.isEventKey(e,"k")||a.isEventKey(e,"Space")}=e;if(i.call(this,t)){t.preventDefault();t.stopPropagation();const r=g.getComponent("FullscreenToggle");if(iv[this.fsApi_.fullscreenEnabled]!==false){r.prototype.handleClick.call(this,t)}}else if(s.call(this,t)){t.preventDefault();t.stopPropagation();const e=g.getComponent("MuteToggle");e.prototype.handleClick.call(this,t)}else if(n.call(this,t)){t.preventDefault();t.stopPropagation();const e=g.getComponent("PlayToggle");e.prototype.handleClick.call(this,t)}}canPlayType(s){let n;for(let t=0,i=this.options_.techOrder;t{return[e,b.getTech(e)]}).filter(([e,t])=>{if(t){return t.isSupported()}d.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`);return false});const i=function(e,i,s){let n;e.some(t=>{return i.some(e=>{n=s(t,e);if(n){return true}})});return n};let s;const n=i=>(e,t)=>i(t,e);const r=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()])){return{source:i,tech:e}}};if(this.options_.sourceOrder){s=i(e,t,n(r))}else{s=i(t,e,r)}return s||false}handleSrc_(e,s){if(typeof e==="undefined"){return this.cache_.src||""}if(this.resetRetryOnError_){this.resetRetryOnError_()}const n=gn(e);if(!n.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}this.changingSrc_=true;if(!s){this.cache_.sources=n}this.updateSourceCaches_(n[0]);Zs(this,n[0],(e,t)=>{this.middleware_=t;if(!s){this.cache_.sources=n}this.updateSourceCaches_(e);const i=this.src_(e);if(i){if(n.length>1){return this.handleSrc_(n.slice(1))}this.changingSrc_=false;this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);this.triggerReady();return}en(t,this.tech_)});if(n.length>1){const t=()=>{this.error(null);this.handleSrc_(n.slice(1),true)};const i=()=>{this.off("error",t)};this.one("error",t);this.one("playing",i);this.resetRetryOnError_=()=>{this.off("error",t);this.off("playing",i)}}}src(e){return this.handleSrc_(e,false)}src_(e){const t=this.selectSource([e]);if(!t){return true}if(!Ht(t.tech,this.techName_)){this.changingSrc_=true;this.loadTech_(t.tech,t.source);this.tech_.ready(()=>{this.changingSrc_=false});return false}this.ready(function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource")){this.techCall_("setSource",e)}else{this.techCall_("src",e.src)}this.changingSrc_=false},true);return false}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused()){this.doReset_()}else{const e=this.play();li(e.then(()=>this.doReset_()))}}doReset_(){if(this.tech_){this.tech_.clearTracks("text")}this.removeClass("vjs-playing");this.addClass("vjs-paused");this.resetCache_();this.poster("");this.loadTech_(this.options_.techOrder[0],null);this.techCall_("reset");this.resetControlBarUI_();this.error(null);if(this.titleBar){this.titleBar.update({title:undefined,description:undefined})}if(At(this)){this.trigger("playerreset")}}resetControlBarUI_(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{};const{seekBar:n}=i||{};if(e){e.updateContent()}if(t){t.updateContent()}if(s){s.updateContent()}if(n){n.update();if(n.loadProgressBar){n.loadProgressBar.update()}}}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1);this.trigger("volumechange")}currentSources(){const e=this.currentSource();const t=[];if(Object.keys(e).length!==0){t.push(e)}return this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==undefined){this.techCall_("setPreload",e);this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===undefined){return this.options_.autoplay||false}let t;if(typeof e==="string"&&/(any|play|muted)/.test(e)||e===true&&this.options_.normalizeAutoplay){this.options_.autoplay=e;this.manualAutoplay_(typeof e==="string"?e:"play");t=false}else if(!e){this.options_.autoplay=false}else{this.options_.autoplay=true}t=typeof t==="undefined"?this.options_.autoplay:t;if(this.tech_){this.techCall_("setAutoplay",t)}}playsinline(e){if(e!==undefined){this.techCall_("setPlaysinline",e);this.options_.playsinline=e}return this.techGet_("playsinline")}loop(e){if(e!==undefined){this.techCall_("setLoop",e);this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===undefined){return this.poster_}if(!e){e=""}if(e===this.poster_){return}this.poster_=e;this.techCall_("setPoster",e);this.isPosterFromTech_=false;this.trigger("posterchange")}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";if(e!==this.poster_){this.poster_=e;this.isPosterFromTech_=true;this.trigger("posterchange")}}}controls(e){if(e===undefined){return!!this.controls_}e=!!e;if(this.controls_===e){return}this.controls_=e;if(this.usingNativeControls()){this.techCall_("setControls",e)}if(this.controls_){this.removeClass("vjs-controls-disabled");this.addClass("vjs-controls-enabled");this.trigger("controlsenabled");if(!this.usingNativeControls()){this.addTechControlsListeners_()}}else{this.removeClass("vjs-controls-enabled");this.addClass("vjs-controls-disabled");this.trigger("controlsdisabled");if(!this.usingNativeControls()){this.removeTechControlsListeners_()}}}usingNativeControls(e){if(e===undefined){return!!this.usingNativeControls_}e=!!e;if(this.usingNativeControls_===e){return}this.usingNativeControls_=e;if(this.usingNativeControls_){this.addClass("vjs-using-native-controls");this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls");this.trigger("usingcustomcontrols")}}error(i){if(i===undefined){return this.error_||null}U("beforeerror").forEach(e=>{const t=e(this,i);if(!(Z(t)&&!Array.isArray(t)||typeof t==="string"||typeof t==="number"||t===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}i=t});if(this.options_.suppressNotSupportedError&&i&&i.code===4){const e=function(){this.error(i)};this.options_.suppressNotSupportedError=false;this.any(["click","touchstart"],e);this.one("loadstart",function(){this.off(["click","touchstart"],e)});return}if(i===null){this.error_=null;this.removeClass("vjs-error");if(this.errorDisplay){this.errorDisplay.close()}return}this.error_=new t(i);this.addClass("vjs-error");d.error(`(CODE:${this.error_.code} ${t.errorTypes[this.error_.code]})`,this.error_.message,this.error_);this.trigger("error");U("error").forEach(e=>e(this,this.error_));return}reportUserActivity(e){this.userActivity_=true}userActive(e){if(e===undefined){return this.userActive_}e=!!e;if(e===this.userActive_){return}this.userActive_=e;if(this.userActive_){this.userActivity_=true;this.removeClass("vjs-user-inactive");this.addClass("vjs-user-active");this.trigger("useractive");return}if(this.tech_){this.tech_.one("mousemove",function(e){e.stopPropagation();e.preventDefault()})}this.userActivity_=false;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")}listenForUserActivity_(){let t;let i;let s;const n=p(this,this.reportUserActivity);const e=function(e){if(e.screenX!==i||e.screenY!==s){i=e.screenX;s=e.screenY;n()}};const r=function(){n();this.clearInterval(t);t=this.setInterval(n,250)};const a=function(e){n();this.clearInterval(t)};this.on("mousedown",r);this.on("mousemove",e);this.on("mouseup",a);this.on("mouseleave",a);const o=this.getChild("controlBar");if(o&&!f&&!ae){o.on("mouseenter",function(e){if(this.player().options_.inactivityTimeout!==0){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout}this.player().options_.inactivityTimeout=0});o.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}this.on("keydown",n);this.on("keyup",n);let l;const c=function(){if(!this.userActivity_){return}this.userActivity_=false;this.userActive(true);this.clearTimeout(l);const e=this.options_.inactivityTimeout;if(e<=0){return}l=this.setTimeout(function(){if(!this.userActivity_){this.userActive(false)}},e)};this.setInterval(c,250)}playbackRate(e){if(e!==undefined){this.techCall_("setPlaybackRate",e);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1}defaultPlaybackRate(e){if(e!==undefined){return this.techCall_("setDefaultPlaybackRate",e)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1}isAudio(e){if(e!==undefined){this.isAudio_=!!e;return}return!!this.isAudio_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children();const t=this.getChild("ControlBar");const i=t&&t.currentHeight();e.forEach(e=>{if(e===t){return}if(e.el_&&!e.hasClass("vjs-hidden")){e.hide();this.audioOnlyCache_.hiddenChildren.push(e)}});this.audioOnlyCache_.playerHeight=this.currentHeight();this.height(i);this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode");this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show());this.height(this.audioOnlyCache_.playerHeight);this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!=="boolean"||e===this.audioOnlyMode_){return this.audioOnlyMode_}this.audioOnlyMode_=e;if(e){const t=[];if(this.isInPictureInPicture()){t.push(this.exitPictureInPicture())}if(this.isFullscreen()){t.push(this.exitFullscreen())}if(this.audioPosterMode()){t.push(this.audioPosterMode(false))}return Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){const e=this.tech_&&this.tech_;e.hide();this.addClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}disablePosterModeUI_(){const e=this.tech_&&this.tech_;e.show();this.removeClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}audioPosterMode(e){if(typeof e!=="boolean"||e===this.audioPosterMode_){return this.audioPosterMode_}this.audioPosterMode_=e;if(e){if(this.audioOnlyMode()){const t=this.audioOnlyMode(false);return t.then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_){return this.tech_.addTextTrack(e,t,i)}}addRemoteTextTrack(e,t){if(this.tech_){return this.tech_.addRemoteTextTrack(e,t)}}removeRemoteTextTrack(e={}){let{track:t}=e;if(!t){t=e}if(this.tech_){return this.tech_.removeRemoteTextTrack(t)}}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===undefined){return this.language_}if(this.language_!==String(e).toLowerCase()){this.language_=String(e).toLowerCase();if(At(this)){this.trigger("languagechange")}}}languages(){return h(T.prototype.options_.languages,this.languages_)}toJSON(){const i=h(this.options_);const s=i.tracks;i.tracks=[];for(let t=0;t{this.removeChild(i)});i.open();return i}updateCurrentBreakpoint_(){if(!this.responsive()){return}const t=this.currentBreakpoint();const i=this.currentWidth();for(let e=0;ethis.addRemoteTextTrack(e,false))}if(this.titleBar){this.titleBar.update({title:c,description:r||s||""})}this.ready(t)}getMedia(){if(!this.cache_.media){const t=this.poster();const i=this.currentSources();const s=Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}));const e={src:i,textTracks:s};if(t){e.poster=t;e.artwork=[{src:e.poster,type:pn(e.poster)}]}return e}return h(this.cache_.media)}static getTagSettings(e){const i={sources:[],tracks:[]};const t=Ne(e);const s=t["data-setup"];if(De(e,"vjs-fill")){t.fill=true}if(De(e,"vjs-fluid")){t.fluid=true}if(s!==null){const[n,r]=ri(s||"{}");if(n){d.error(n)}Object.assign(t,r)}Object.assign(i,t);if(e.hasChildNodes()){const a=e.childNodes;for(let e=0,t=a.length;etypeof e==="number")){return}this.cache_.playbackRates=e;this.trigger("playbackrateschange")}}v.names.forEach(function(e){const t=v[e];T.prototype[t.getterName]=function(){if(this.tech_){return this.tech_[t.getterName]()}this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});T.prototype.crossorigin=T.prototype.crossOrigin;T.players={};const ga=tv.navigator;T.prototype.options_={techOrder:b.defaultTechOrder_,html5:{},enableSourceset:true,inactivityTimeout:2e3,playbackRates:[],liveui:false,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ga&&(ga.languages&&ga.languages[0]||ga.userLanguage||ga.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:false,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:false,audioOnlyMode:false,audioPosterMode:false,enableSmoothSeeking:false};da.forEach(function(e){T.prototype[`handleTech${m(e)}_`]=function(){return this.trigger(e)}});g.registerComponent("Player",T);const va="plugin";const ya="activePlugins_";const ba={};const _a=e=>ba.hasOwnProperty(e);const Ta=e=>_a(e)?ba[e]:undefined;const Sa=(e,t)=>{e[ya]=e[ya]||{};e[ya][t]=true};const Ea=(e,t,i)=>{const s=(i?"before":"")+"pluginsetup";e.trigger(s,t);e.trigger(s+":"+t.name,t)};const wa=function(t,i){const s=function(){Ea(this,{name:t,plugin:i,instance:null},true);const e=i.apply(this,arguments);Sa(this,t);Ea(this,{name:t,plugin:i,instance:e});return e};Object.keys(i).forEach(function(e){s[e]=i[e]});return s};const ka=(i,s)=>{s.prototype.name=i;return function(...e){Ea(this,{name:i,plugin:s,instance:null},true);const t=new s(...[this,...e]);this[i]=()=>t;Ea(this,t.getEventHash());return t}};class ja{constructor(e){if(this.constructor===ja){throw new Error("Plugin must be sub-classed; not directly instantiated.")}this.player=e;if(!this.log){this.log=this.player.log.createLogger(this.name)}Bt(this);delete this.trigger;qt(this,this.constructor.defaultState);Sa(e,this.name);this.dispose=this.dispose.bind(this);e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){e.name=this.name;e.plugin=this.constructor;e.instance=this;return e}trigger(e,t={}){return bt(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose");this.off();t.off("dispose",this.dispose);t[ya][e]=false;this.player=this.state=null;t[e]=ka(e,ba[e])}static isBasic(e){const t=typeof e==="string"?Ta(e):e;return typeof t==="function"&&!ja.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!=="string"){throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`)}if(_a(e)){d.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`)}else if(T.prototype.hasOwnProperty(e)){throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`)}if(typeof t!=="function"){throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`)}ba[e]=t;if(e!==va){if(ja.isBasic(t)){T.prototype[e]=wa(e,t)}else{T.prototype[e]=ka(e,t)}}return t}static deregisterPlugin(e){if(e===va){throw new Error("Cannot de-register base plugin.")}if(_a(e)){delete ba[e];delete T.prototype[e]}}static getPlugins(e=Object.keys(ba)){let i;e.forEach(e=>{const t=Ta(e);if(t){i=i||{};i[e]=t}});return i}static getPluginVersion(e){const t=Ta(e);return t&&t.VERSION||""}}ja.getPlugin=Ta;ja.BASE_PLUGIN_NAME=va;ja.registerPlugin(va,ja);T.prototype.usingPlugin=function(e){return!!this[ya]&&this[ya][e]===true};T.prototype.hasPlugin=function(e){return!!_a(e)};function Ca(t,i){let s=false;return function(...e){if(!s){d.warn(t)}s=true;return i.apply(this,e)}}function Ia(e,t,i,s){return Ca(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,s)}const xa=e=>e.indexOf("#")===0?e.slice(1):e;function S(e,i,t){let s=S.getPlayer(e);if(s){if(i){d.warn(`Player "${e}" is already initialised. Options will not be applied.`)}if(t){s.ready(t)}return s}const n=typeof e==="string"?Qe("#"+xa(e)):e;if(!je(n)){throw new TypeError("The element or ID supplied is not valid. (videojs)")}const r="getRootNode"in n?n.getRootNode()instanceof tv.ShadowRoot:false;const a=r?n.getRootNode():n.ownerDocument.body;if(!n.ownerDocument.defaultView||!a.contains(n)){d.warn("The element supplied is not included in the DOM")}i=i||{};if(i.restoreEl===true){i.restoreEl=(n.parentNode&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(true)}U("beforesetup").forEach(e=>{const t=e(n,h(i));if(!Z(t)||Array.isArray(t)){d.error("please return an object in beforesetup hooks");return}i=h(i,t)});const o=g.getComponent("Player");s=new o(n,i,t);U("setup").forEach(e=>e(s));return s}S.hooks_=M;S.hooks=U;S.hook=B;S.hookOnce=q;S.removeHook=F;if(tv.VIDEOJS_NO_DYNAMIC_STYLE!==true&&ke()){let t=Qe(".vjs-styles-defaults");if(!t){t=ot("vjs-styles-defaults");const e=Qe("head");if(e){e.insertBefore(t,e.firstChild)}lt(t,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}rt(1,S);S.VERSION=N;S.options=T.prototype.options_;S.getPlayers=()=>T.players;S.getPlayer=e=>{const t=T.players;let i;if(typeof e==="string"){const s=xa(e);const n=t[s];if(n){return n}i=Qe("#"+s)}else{i=e}if(je(i)){const{player:n,playerId:e}=i;if(n||t[e]){return n||t[e]}}};S.getAllPlayers=()=>Object.keys(T.players).map(e=>T.players[e]).filter(Boolean);S.players=T.players;S.getComponent=g.getComponent;S.registerComponent=(e,t)=>{if(b.isTech(t)){d.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`)}return g.registerComponent.call(g,e,t)};S.getTech=b.getTech;S.registerTech=b.registerTech;S.use=Js;Object.defineProperty(S,"middleware",{value:{},writeable:false,enumerable:true});Object.defineProperty(S.middleware,"TERMINATOR",{value:Qs,writeable:false,enumerable:true});S.browser=Se;S.obj=se;S.mergeOptions=Ia(9,"videojs.mergeOptions","videojs.obj.merge",h);S.defineLazyProperty=Ia(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",ie);S.bind=Ia(9,"videojs.bind","native Function.prototype.bind",p);S.registerPlugin=ja.registerPlugin;S.deregisterPlugin=ja.deregisterPlugin;S.plugin=(e,t)=>{d.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return ja.registerPlugin(e,t)};S.getPlugins=ja.getPlugins;S.getPlugin=ja.getPlugin;S.getPluginVersion=ja.getPluginVersion;S.addLanguage=function(e,t){e=(""+e).toLowerCase();S.options.languages=h(S.options.languages,{[e]:t});return S.options.languages[e]};S.log=d;S.createLogger=W;S.time=si;S.createTimeRange=Ia(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Qt);S.createTimeRanges=Ia(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Qt);S.formatTime=Ia(9,"videojs.formatTime","videojs.time.formatTime",ii);S.setFormatTime=Ia(9,"videojs.setFormatTime","videojs.time.setFormatTime",ei);S.resetFormatTime=Ia(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ti);S.parseUrl=Ia(9,"videojs.parseUrl","videojs.url.parseUrl",Ii);S.isCrossOrigin=Ia(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Di);S.EventTarget=It;S.any=Tt;S.on=yt;S.one=_t;S.off=c;S.trigger=bt;S.xhr=$i;S.TextTrack=ts;S.AudioTrack=is;S.VideoTrack=ss;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{S[e]=function(){d.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`);return tt[e].apply(null,arguments)}});S.computedStyle=Ia(9,"videojs.computedStyle","videojs.dom.computedStyle",Ze);S.dom=tt;S.fn=jt;S.num=Vn;S.str=$t;S.url=Oi;Kt(function(i,e){(function(e,t){i.exports=t(S)})(zt,function(e){function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var i=t(e);class s{constructor(e){let t=this;t.id=e.id;t.label=t.id;t.width=e.width;t.height=e.height;t.bitrate=e.bandwidth;t.frameRate=e.frameRate;t.enabled_=e.enabled;Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(e){t.enabled_(e)}});return t}}class r extends i["default"].EventTarget{constructor(){super();let e=this;e.levels_=[];e.selectedIndex_=-1;Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}});Object.defineProperty(e,"length",{get(){return e.levels_.length}});e[Symbol.iterator]=()=>e.levels_.values();return e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t){return t}const i=this.levels_.length;t=new s(e);if(!(""+i in this)){Object.defineProperty(this,i,{get(){return this.levels_[i]}})}this.levels_.push(t);this.trigger({qualityLevel:t,type:"addqualitylevel"});return t}removeQualityLevel(i){let s=null;for(let e=0,t=this.length;ee){this.selectedIndex_--}break}}if(s){this.trigger({qualityLevel:i,type:"removequalitylevel"})}return s}getQualityLevelById(i){for(let e=0,t=this.length;es;e.qualityLevels.VERSION=a;return s};const o=function(e){return n(this,i["default"].obj.merge({},e))};i["default"].registerPlugin("qualityLevels",o);o.VERSION=a;return o})});var Aa=Kt(function(n,e){(function(e){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;var u=/^(?=([^\/?#]*))\1([^]*)$/;var t=/(?:\/|^)\.(?=\/)/g;var s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;var d={buildAbsoluteURL:function(e,t,i){i=i||{};e=e.trim();t=t.trim();if(!t){if(!i.alwaysNormalize){return e}var s=d.parseURL(e);if(!s){throw new Error("Error trying to parse base URL.")}s.path=d.normalizePath(s.path);return d.buildURLFromParts(s)}var n=d.parseURL(t);if(!n){throw new Error("Error trying to parse relative URL.")}if(n.scheme){if(!i.alwaysNormalize){return t}n.path=d.normalizePath(n.path);return d.buildURLFromParts(n)}var r=d.parseURL(e);if(!r){throw new Error("Error trying to parse base URL.")}if(!r.netLoc&&r.path&&r.path[0]!=="/"){var a=u.exec(r.path);r.netLoc=a[1];r.path=a[2]}if(r.netLoc&&!r.path){r.path="/"}var o={scheme:r.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc){o.netLoc=r.netLoc;if(n.path[0]!=="/"){if(!n.path){o.path=r.path;if(!n.params){o.params=r.params;if(!n.query){o.query=r.query}}}else{var l=r.path;var c=l.substring(0,l.lastIndexOf("/")+1)+n.path;o.path=d.normalizePath(c)}}}if(o.path===null){o.path=i.alwaysNormalize?d.normalizePath(n.path):n.path}return d.buildURLFromParts(o)},parseURL:function(e){var t=i.exec(e);if(!t){return null}return{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}},normalizePath:function(e){e=e.split("").reverse().join("").replace(t,"");while(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}};n.exports=d})()});var Da="http://example.com";var Oa=function e(t,i){if(/^[a-z]+:/i.test(i)){return i}if(/^data:/.test(t)){t=tv.location&&tv.location.href||""}var s=typeof tv.URL==="function";var n=/^\/\//.test(t);var r=!tv.location&&!/\/\//i.test(t);if(s){t=new tv.URL(t,tv.location||Da)}else if(!/\/\//i.test(t)){t=Aa.buildAbsoluteURL(tv.location&&tv.location.href||"",t)}if(s){var a=new URL(i,t);if(r){return a.href.slice(Da.length)}else if(n){return a.href.slice(a.protocol.length)}return a.href}return Aa.buildAbsoluteURL(t,i)};var Pa=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n-1;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}}}const Ma=String.fromCharCode(9);const Ua=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");const i={};if(t[1]){i.length=parseInt(t[1],10)}if(t[2]){i.offset=parseInt(t[2],10)}return i};const Ba=function(){const e="[^=]*";const t='"[^"]*"|[^,]*';const i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")};const Fa=function(e){const t={};if(!e){return t}const i=e.split(Ba());let s=i.length;let n;while(s--){if(i[s]===""){continue}n=/([^=]*)=(.*)/.exec(i[s]).slice(1);n[0]=n[0].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1");t[n[0]]=n[1]}return t};class qa extends Pa{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(s){let o;let l;s=s.trim();if(s.length===0){return}if(s[0]!=="#"){this.trigger("data",{type:"uri",uri:s});return}const e=this.tagMappers.reduce((e,t)=>{const i=t(s);if(i===s){return e}return e.concat([i])},[s]);e.forEach(t=>{for(let e=0;ee}this.customParsers.push(e=>{const t=i.exec(e);if(t){this.trigger("data",{type:"custom",data:n(e),customType:s,segment:r});return true}})}addTagMapper({expression:t,map:i}){const e=e=>{if(t.test(e)){return i(e)}return e};this.tagMappers.push(e)}}const Va=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase());const Ha=function(t){const i={};Object.keys(t).forEach(function(e){i[Va(e)]=t[e]});return i};const $a=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:s}=e;if(!t){return}const n="#EXT-X-SERVER-CONTROL";const r="holdBack";const a="partHoldBack";const o=i&&i*3;const l=s&&s*2;if(i&&!t.hasOwnProperty(r)){t[r]=o;this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})}if(o&&t[r]{if(r.uri||!r.parts&&!r.preloadHints){return}if(!r.map&&n){r.map=n}if(!r.key&&a){r.key=a}if(!r.timeline&&typeof h==="number"){r.timeline=h}this.manifest.preloadSegment=r});this.parseStream.on("data",function(o){let t;let i;({tag(){({version(){if(o.version){this.manifest.version=o.version}},"allow-cache"(){this.manifest.allowCache=o.allowed;if(!("allowed"in o)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in o){r.byterange=e;e.length=o.length;if(!("offset"in o)){o.offset=f}}if("offset"in o){r.byterange=e;e.offset=o.offset}f=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(o.title){r.title=o.title}if(o.duration>0){r.duration=o.duration}if(o.duration===0){r.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=s},key(){if(!o.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(o.attributes.METHOD==="NONE"){a=null;return}if(!o.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(o.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:o.attributes};return}if(o.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:o.attributes.URI};return}if(o.attributes.KEYFORMAT===d){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(o.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(o.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(o.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(o.attributes.KEYID&&o.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:o.attributes.KEYFORMAT,keyId:o.attributes.KEYID.substring(2)},pssh:Ra(o.attributes.URI.split(",")[1])};return}if(!o.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}a={method:o.attributes.METHOD||"AES-128",uri:o.attributes.URI};if(typeof o.attributes.IV!=="undefined"){a.iv=o.attributes.IV}},"media-sequence"(){if(!isFinite(o.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+o.number});return}this.manifest.mediaSequence=o.number},"discontinuity-sequence"(){if(!isFinite(o.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+o.number});return}this.manifest.discontinuitySequence=o.number;h=o.number},"playlist-type"(){if(!/VOD|EVENT/.test(o.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+o.playlist});return}this.manifest.playlistType=o.playlistType},map(){n={};if(o.uri){n.uri=o.uri}if(o.byterange){n.byterange=o.byterange}if(a){n.key=a}},"stream-inf"(){this.manifest.playlists=s;this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!o.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!r.attributes){r.attributes={}}Ni(r.attributes,o.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!(o.attributes&&o.attributes.TYPE&&o.attributes["GROUP-ID"]&&o.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[o.attributes.TYPE];e[o.attributes["GROUP-ID"]]=e[o.attributes["GROUP-ID"]]||{};t=e[o.attributes["GROUP-ID"]];i={default:/yes/i.test(o.attributes.DEFAULT)};if(i.default){i.autoselect=true}else{i.autoselect=/yes/i.test(o.attributes.AUTOSELECT)}if(o.attributes.LANGUAGE){i.language=o.attributes.LANGUAGE}if(o.attributes.URI){i.uri=o.attributes.URI}if(o.attributes["INSTREAM-ID"]){i.instreamId=o.attributes["INSTREAM-ID"]}if(o.attributes.CHARACTERISTICS){i.characteristics=o.attributes.CHARACTERISTICS}if(o.attributes.FORCED){i.forced=/yes/i.test(o.attributes.FORCED)}t[o.attributes.NAME]=i},discontinuity(){h+=1;r.discontinuity=true;this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=o.dateTimeString;this.manifest.dateTimeObject=o.dateTimeObject}r.dateTimeString=o.dateTimeString;r.dateTimeObject=o.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(o.dateTimeString).getTime();if(e===null){this.manifest.segments.reduceRight((e,t)=>{t.programDateTime=e-t.duration*1e3;return t.programDateTime},this.lastProgramDateTime)}},targetduration(){if(!isFinite(o.duration)||o.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+o.duration});return}this.manifest.targetDuration=o.duration;$a.call(this,this.manifest)},start(){if(!o.attributes||isNaN(o.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:o.attributes["TIME-OFFSET"],precise:o.attributes.PRECISE}},"cue-out"(){r.cueOut=o.data},"cue-out-cont"(){r.cueOutCont=o.data},"cue-in"(){r.cueIn=o.data},skip(){this.manifest.skip=Ha(o.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",o.attributes,["SKIPPED-SEGMENTS"])},part(){l=true;const e=this.manifest.segments.length;const t=Ha(o.attributes);r.parts=r.parts||[];r.parts.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=p}p=t.byterange.offset+t.byterange.length}const i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,o.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach((e,t)=>{if(!e.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}})}},"server-control"(){const e=this.manifest.serverControl=Ha(o.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}$a.call(this,this.manifest);if(e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")){this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})}},"preload-hint"(){const t=this.manifest.segments.length;const i=Ha(o.attributes);const e=i.type&&i.type==="PART";r.preloadHints=r.preloadHints||[];r.preloadHints.push(i);if(i.byterange){if(!i.byterange.hasOwnProperty("offset")){i.byterange.offset=e?p:0;if(e){p=i.byterange.offset+i.byterange.length}}}const s=r.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,o.attributes,["TYPE","URI"]);if(!i.type){return}for(let e=0;ee.id===t.id);this.manifest.dateRanges[r]=Ni(this.manifest.dateRanges[r],t);m[t.id]=Ni(m[t.id],t);this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=true},"content-steering"(){this.manifest.contentSteering=Ha(o.attributes);this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",o.attributes,["SERVER-URI"])}}[o.tagType]||c).call(e)},uri(){r.uri=o.uri;s.push(r);if(this.manifest.targetDuration&&!("duration"in r)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});r.duration=this.manifest.targetDuration}if(a){r.key=a}r.timeline=h;if(n){r.map=n}p=0;if(this.lastProgramDateTime!==null){r.programDateTime=this.lastProgramDateTime;this.lastProgramDateTime+=r.duration*1e3}r={}},comment(){},custom(){if(o.segment){r.custom=r.custom||{};r.custom[o.customType]=o.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[o.customType]=o.data}}})[o.type].call(e)})}warnOnMissingAttributes_(e,t,i){const s=[];i.forEach(function(e){if(!t.hasOwnProperty(e)){s.push(e)}});if(s.length){this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n");if(this.manifest.dateRanges.length&&this.lastProgramDateTime===null){this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"})}this.lastProgramDateTime=null;this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var Ga={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/};var Ka=["video","audio","text"];var Wa=["Video","Audio","Text"];var Ya=function e(t){if(!t){return t}return t.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){var s=("00"+Number(t).toString(16)).slice(-2);var n=("00"+Number(i).toString(16)).slice(-2);return"avc1."+s+"00"+n})};var Xa=function e(t){if(t===void 0){t=""}var i=t.split(",");var a=[];i.forEach(function(n){n=n.trim();var r;Ka.forEach(function(e){var t=Ga[e].exec(n.toLowerCase());if(!t||t.length<=1){return}r=e;var i=n.substring(0,t[1].length);var s=n.replace(i,"");a.push({type:i,details:s,mediaType:e})});if(!r){a.push({type:n,details:"",mediaType:"unknown"})}});return a};var Qa=function e(t,i){if(!t.mediaGroups.AUDIO||!i){return null}var s=t.mediaGroups.AUDIO[i];if(!s){return null}for(var n in s){var r=s[n];if(r.default&&r.playlists){return Xa(r.playlists[0].attributes.CODECS)}}return null};var Ja=function e(t){if(t===void 0){t=""}return Ga.audio.test(t.trim().toLowerCase())};var Za=function e(t){if(t===void 0){t=""}return Ga.text.test(t.trim().toLowerCase())};var eo=function e(t){if(!t||typeof t!=="string"){return}var i=t.toLowerCase().split(",").map(function(e){return Ya(e.trim())});var s="video";if(i.length===1&&Ja(i[0])){s="audio"}else if(i.length===1&&Za(i[0])){s="application"}var n="mp4";if(i.every(function(e){return Ga.mp4.test(e)})){n="mp4"}else if(i.every(function(e){return Ga.webm.test(e)})){n="webm"}else if(i.every(function(e){return Ga.ogg.test(e)})){n="ogg"}return s+"/"+n+';codecs="'+t+'"'};var to=function e(t){if(t===void 0){t=""}return tv.MediaSource&&tv.MediaSource.isTypeSupported&&tv.MediaSource.isTypeSupported(eo(t))||false};var io=function e(t){if(t===void 0){t=""}return t.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;td){u-=d;u-=d;u-=w(2)}}return Number(u)};var mo=function e(t,i){var s=i===void 0?{}:i,n=s.le,r=n===void 0?false:n;if(typeof t!=="bigint"&&typeof t!=="number"||typeof t==="number"&&t!==t){t=0}t=w(t);var a=co(t);var o=new Uint8Array(new ArrayBuffer(a));for(var l=0;l=t.length&&c.call(t,function(e,t){var i=l[t]?l[t]&s[a+t]:s[a+t];return e===i})};var yo=function e(n,t,r){t.forEach(function(e){for(var t in n.mediaGroups[e]){for(var i in n.mediaGroups[e][t]){var s=n.mediaGroups[e][t][i];r(s,e,t,i)}}})};var bo=function e(t){return tv.atob?tv.atob(t):Zg.from(t,"base64").toString("binary")};function _o(e){var t=bo(e);var i=new Uint8Array(t.length);for(var s=0;s=0&&e=0){var n=t.length-1;while(s0},lookupPrefix:function(e){var t=this;while(t){var i=t._nsMap;if(i){for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===e){return s}}}t=t.nodeType==qo?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){var t=this;while(t){var i=t._nsMap;if(i){if(Object.prototype.hasOwnProperty.call(i,e)){return i[e]}}t=t.nodeType==qo?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function cl(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}Bo(i,C);Bo(i,C.prototype);function ul(e,t){if(t(e)){return true}if(e=e.firstChild){do{if(ul(e,t)){return true}}while(e=e.nextSibling)}}function dl(){this.ownerDocument=this}function hl(e,t,i){e&&e._inc++;var s=i.namespaceURI;if(s===Po.XMLNS){t._nsMap[i.prefix?i.localName:""]=i.value}}function fl(e,t,i,s){e&&e._inc++;var n=i.namespaceURI;if(n===Po.XMLNS){delete t._nsMap[i.prefix?i.localName:""]}}function pl(e,t,i){if(e&&e._inc){e._inc++;var s=t.childNodes;if(i){s[s.length++]=i}else{var n=t.firstChild;var r=0;while(n){s[r++]=n;n=n.nextSibling}s.length=r;delete s[s.length]}}}function ml(e,t){var i=t.previousSibling;var s=t.nextSibling;if(i){i.nextSibling=s}else{e.firstChild=s}if(s){s.previousSibling=i}else{e.lastChild=i}t.parentNode=null;t.previousSibling=null;t.nextSibling=null;pl(e.ownerDocument,e);return t}function gl(e){return e&&(e.nodeType===C.DOCUMENT_NODE||e.nodeType===C.DOCUMENT_FRAGMENT_NODE||e.nodeType===C.ELEMENT_NODE)}function vl(e){return e&&(bl(e)||_l(e)||yl(e)||e.nodeType===C.DOCUMENT_FRAGMENT_NODE||e.nodeType===C.COMMENT_NODE||e.nodeType===C.PROCESSING_INSTRUCTION_NODE)}function yl(e){return e&&e.nodeType===C.DOCUMENT_TYPE_NODE}function bl(e){return e&&e.nodeType===C.ELEMENT_NODE}function _l(e){return e&&e.nodeType===C.TEXT_NODE}function Tl(e,t){var i=e.childNodes||[];if(Oo(i,bl)||yl(t)){return false}var s=Oo(i,yl);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function Sl(e,t){var i=e.childNodes||[];function s(e){return bl(e)&&e!==t}if(Oo(i,s)){return false}var n=Oo(i,yl);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function El(e,t,i){if(!gl(e)){throw new j(Jo,"Unexpected parent node type "+e.nodeType)}if(i&&i.parentNode!==e){throw new j(Zo,"child not in parent")}if(!vl(t)||yl(t)&&e.nodeType!==C.DOCUMENT_NODE){throw new j(Jo,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}}function wl(e,t,i){var s=e.childNodes||[];var n=t.childNodes||[];if(t.nodeType===C.DOCUMENT_FRAGMENT_NODE){var r=n.filter(bl);if(r.length>1||Oo(n,_l)){throw new j(Jo,"More than one element or text in fragment")}if(r.length===1&&!Tl(e,i)){throw new j(Jo,"Element in fragment can not be inserted before doctype")}}if(bl(t)){if(!Tl(e,i)){throw new j(Jo,"Only one element can be added and only after doctype")}}if(yl(t)){if(Oo(s,yl)){throw new j(Jo,"Only one doctype is allowed")}var a=Oo(s,bl);if(i&&s.indexOf(a)1||Oo(n,_l)){throw new j(Jo,"More than one element or text in fragment")}if(r.length===1&&!Sl(e,i)){throw new j(Jo,"Element in fragment can not be inserted before doctype")}}if(bl(t)){if(!Sl(e,i)){throw new j(Jo,"Only one element can be added and only after doctype")}}if(yl(t)){function a(e){return yl(e)&&e!==i}if(Oo(s,a)){throw new j(Jo,"Only one doctype is allowed")}var o=Oo(s,bl);if(i&&s.indexOf(o)0){ul(n.documentElement,function(e){if(e!==n&&e.nodeType===Fo){var t=e.getAttribute("class");if(t){var i=a===t;if(!i){var s=Mo(t);i=o.every(Uo(s))}if(i){r.push(e)}}}})}return r})},createElement:function(e){var t=new Il;t.ownerDocument=this;t.nodeName=e;t.tagName=e;t.localName=e;t.childNodes=new tl;var i=t.attributes=new nl;i._ownerElement=t;return t},createDocumentFragment:function(){var e=new Ul;e.ownerDocument=this;e.childNodes=new tl;return e},createTextNode:function(e){var t=new Dl;t.ownerDocument=this;t.appendData(e);return t},createComment:function(e){var t=new Ol;t.ownerDocument=this;t.appendData(e);return t},createCDATASection:function(e){var t=new Pl;t.ownerDocument=this;t.appendData(e);return t},createProcessingInstruction:function(e,t){var i=new Bl;i.ownerDocument=this;i.tagName=i.nodeName=i.target=e;i.nodeValue=i.data=t;return i},createAttribute:function(e){var t=new xl;t.ownerDocument=this;t.name=e;t.nodeName=e;t.localName=e;t.specified=true;return t},createEntityReference:function(e){var t=new Ml;t.ownerDocument=this;t.nodeName=e;return t},createElementNS:function(e,t){var i=new Il;var s=t.split(":");var n=i.attributes=new nl;i.childNodes=new tl;i.ownerDocument=this;i.nodeName=t;i.tagName=t;i.namespaceURI=e;if(s.length==2){i.prefix=s[0];i.localName=s[1]}else{i.localName=t}n._ownerElement=i;return i},createAttributeNS:function(e,t){var i=new xl;var s=t.split(":");i.ownerDocument=this;i.nodeName=t;i.name=t;i.namespaceURI=e;i.specified=true;if(s.length==2){i.prefix=s[0];i.localName=s[1]}else{i.localName=t}return i}};e(dl,C);function Il(){this._nsMap={}}Il.prototype={nodeType:Fo,hasAttribute:function(e){return this.getAttributeNode(e)!=null},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){if(e.nodeType===Xo){return this.insertBefore(e,null)}else{return Cl(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 this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var s=this.ownerDocument.createAttributeNS(e,t);s.value=s.nodeValue=""+i;this.setAttributeNode(s)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(s){return new il(this,function(t){var i=[];ul(t,function(e){if(e!==t&&e.nodeType==Fo&&(s==="*"||e.tagName==s)){i.push(e)}});return i})},getElementsByTagNameNS:function(s,n){return new il(this,function(t){var i=[];ul(t,function(e){if(e!==t&&e.nodeType===Fo&&(s==="*"||e.namespaceURI===s)&&(n==="*"||e.localName==n)){i.push(e)}});return i})}};dl.prototype.getElementsByTagName=Il.prototype.getElementsByTagName;dl.prototype.getElementsByTagNameNS=Il.prototype.getElementsByTagNameNS;e(Il,C);function xl(){}xl.prototype.nodeType=qo;e(xl,C);function Al(){}Al.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(n[Jo])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var s=this.data.substring(0,e);var n=this.data.substring(e+t);i=s+i+n;this.nodeValue=this.data=i;this.length=i.length}};e(Al,C);function Dl(){}Dl.prototype={nodeName:"#text",nodeType:Vo,splitText:function(e){var t=this.data;var i=t.substring(e);t=t.substring(0,e);this.data=this.nodeValue=t;this.length=t.length;var s=this.ownerDocument.createTextNode(i);if(this.parentNode){this.parentNode.insertBefore(s,this.nextSibling)}return s}};e(Dl,Al);function Ol(){}Ol.prototype={nodeName:"#comment",nodeType:Ko};e(Ol,Al);function Pl(){}Pl.prototype={nodeName:"#cdata-section",nodeType:Ho};e(Pl,Al);function Ll(){}Ll.prototype.nodeType=Yo;e(Ll,C);function Rl(){}Rl.prototype.nodeType=Qo;e(Rl,C);function Nl(){}Nl.prototype.nodeType=zo;e(Nl,C);function Ml(){}Ml.prototype.nodeType=$o;e(Ml,C);function Ul(){}Ul.prototype.nodeName="#document-fragment";Ul.prototype.nodeType=Xo;e(Ul,C);function Bl(){}Bl.prototype.nodeType=Go;e(Bl,C);function Fl(){}Fl.prototype.serializeToString=function(e,t,i){return ql.call(e,t,i)};C.prototype.toString=ql;function ql(e,t){var i=[];var s=this.nodeType==9&&this.documentElement||this;var n=s.prefix;var r=s.namespaceURI;if(r&&n==null){var n=s.lookupPrefix(r);if(n==null){var a=[{namespace:r,prefix:null}]}}$l(this,i,e,t,a);return i.join("")}function Vl(e,t,i){var s=e.prefix||"";var n=e.namespaceURI;if(!n){return false}if(s==="xml"&&n===Po.XML||n===Po.XMLNS){return false}var r=i.length;while(r--){var a=i[r];if(a.prefix===s){return a.namespace!==n}}return true}function Hl(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,cl),'"')}function $l(e,t,i,s,n){if(!n){n=[]}if(s){e=s(e);if(e){if(typeof e=="string"){t.push(e);return}}else{return}}switch(e.nodeType){case Fo:var r=e.attributes;var a=r.length;var o=e.firstChild;var l=e.tagName;i=Po.isHTML(e.namespaceURI)||i;var c=l;if(!i&&!e.prefix&&e.namespaceURI){var u;for(var d=0;d=0;h--){var f=n[h];if(f.prefix===""&&f.namespace===e.namespaceURI){u=f.namespace;break}}}if(u!==e.namespaceURI){for(var h=n.length-1;h>=0;h--){var f=n[h];if(f.namespace===e.namespaceURI){if(f.prefix){c=f.prefix+":"+l}break}}}}t.push("<",c);for(var p=0;p");if(i&&/^script$/i.test(l)){while(o){if(o.data){t.push(o.data)}else{$l(o,t,i,s,n.slice())}o=o.nextSibling}}else{while(o){$l(o,t,i,s,n.slice());o=o.nextSibling}}t.push("")}else{t.push("/>")}return;case Wo:case Xo:var o=e.firstChild;while(o){$l(o,t,i,s,n.slice());o=o.nextSibling}return;case qo:return Hl(t,e.name,e.value);case Vo:return t.push(e.data.replace(/[<&>]/g,cl));case Ho:return t.push("");case Ko:return t.push("\x3c!--",e.data,"--\x3e");case Yo:var y=e.publicId;var b=e.systemId;t.push("")}else if(b&&b!="."){t.push(" SYSTEM ",b,">")}else{var _=e.internalSubset;if(_){t.push(" [",_,"]")}t.push(">")}return;case Go:return t.push("");case $o:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function zl(e,t,i){var s;switch(t.nodeType){case Fo:s=t.cloneNode(false);s.ownerDocument=e;case Xo:break;case qo:i=true;break}if(!s){s=t.cloneNode(false)}s.ownerDocument=e;s.parentNode=null;if(i){var n=t.firstChild;while(n){s.appendChild(zl(e,n,i));n=n.nextSibling}}return s}function Gl(e,t,i){var s=new t.constructor;for(var n in t){if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(typeof r!="object"){if(r!=s[n]){s[n]=r}}}}if(t.childNodes){s.childNodes=new tl}s.ownerDocument=e;switch(s.nodeType){case Fo:var a=t.attributes;var o=s.attributes=new nl;var l=a.length;o._ownerElement=s;for(var c=0;c",lt:"<",quot:'"'});t.HTML_ENTITIES=i({Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",AMP:"&",amp:"&",And:"\u2a53",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",ap:"\u2248",apacir:"\u2a6f",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250c",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252c",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxUL:"\u255d",boxUl:"\u255c",boxuL:"\u255b",boxul:"\u2518",boxUR:"\u255a",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256c",boxVh:"\u256b",boxvH:"\u256a",boxvh:"\u253c",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255f",boxvR:"\u255e",boxvr:"\u251c",bprime:"\u2035",Breve:"\u02d8",breve:"\u02d8",brvbar:"\xa6",Bscr:"\u212c",bscr:"\ud835\udcb7",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22d2",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",CenterDot:"\xb7",centerdot:"\xb7",Cfr:"\u212d",cfr:"\ud835\udd20",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",cir:"\u25cb",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",Conint:"\u222f",conint:"\u222e",ContourIntegral:"\u222e",Copf:"\u2102",copf:"\ud835\udd54",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xa9",copy:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",Cross:"\u2a2f",cross:"\u2717",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",Cup:"\u22d3",cup:"\u222a",cupbrcap:"\u2a48",CupCap:"\u224d",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21a1",dArr:"\u21d3",darr:"\u2193",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",Diamond:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21d3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",ecir:"\u2256",Ecirc:"\xca",ecirc:"\xea",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212f",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",ForAll:"\u2200",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\ud835\udcbb",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",Gg:"\u22d9",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2aa5",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gnE:"\u2269",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",Gt:"\u226b",GT:">",gt:">",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",hArr:"\u21d4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",Hfr:"\u210c",hfr:"\ud835\udd25",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",Hopf:"\u210d",hopf:"\ud835\udd59",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210b",hscr:"\ud835\udcbd",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",Ifr:"\u2111",ifr:"\ud835\udd26",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",Int:"\u222c",int:"\u222b",intcal:"\u22ba",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",Iscr:"\u2110",iscr:"\ud835\udcbe",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",Lang:"\u27ea",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",Larr:"\u219e",lArr:"\u21d0",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",lAtail:"\u291b",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lBarr:"\u290e",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",Leftarrow:"\u21d0",leftarrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22d8",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lnE:"\u2268",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftarrow:"\u27f5",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\ud835\udcc1",Lsh:"\u21b0",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226a",LT:"<",lt:"<",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\xb7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",Mscr:"\u2133",mscr:"\ud835\udcc2",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21d7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlArr:"\u21cd",nlarr:"\u219a",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21cd",nleftarrow:"\u219a",nLeftrightarrow:"\u21ce",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",Nopf:"\u2115",nopf:"\ud835\udd5f",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf",nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nRightarrow:"\u21cf",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nVDash:"\u22af",nVdash:"\u22ae",nvDash:"\u22ad",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwArr:"\u21d6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",ocir:"\u229a",Ocirc:"\xd4",ocirc:"\xf4",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",Or:"\u2a54",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",Otimes:"\u2a37",otimes:"\u2297",otimesas:"\u2a36",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",par:"\u2225",para:"\xb6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",Popf:"\u2119",popf:"\ud835\udd61",pound:"\xa3",Pr:"\u2abb",pr:"\u227a",prap:"\u2ab7",prcue:"\u227c",prE:"\u2ab3",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportion:"\u2237",Proportional:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",Qopf:"\u211a",qopf:"\ud835\udd62",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",QUOT:'"',quot:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",Rang:"\u27eb",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",Rarr:"\u21a0",rArr:"\u21d2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",rAtail:"\u291c",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",RBarr:"\u2910",rBarr:"\u290f",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",Re:"\u211c",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",REG:"\xae",reg:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",Rfr:"\u211c",rfr:"\ud835\udd2f",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",Rightarrow:"\u21d2",rightarrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",Ropf:"\u211d",ropf:"\ud835\udd63",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",Rscr:"\u211b",rscr:"\ud835\udcc7",Rsh:"\u21b1",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",Sc:"\u2abc",sc:"\u227b",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227d",scE:"\u2ab4",sce:"\u2ab0",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",searhk:"\u2925",seArr:"\u21d8",searr:"\u2198",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",Square:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",Sub:"\u22d0",sub:"\u2282",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",Subset:"\u22d0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",Sum:"\u2211",sum:"\u2211",sung:"\u266a",Sup:"\u22d1",sup:"\u2283",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",Supset:"\u22d1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swArr:"\u21d9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",Tilde:"\u223c",tilde:"\u02dc",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xd7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",Uarr:"\u219f",uArr:"\u21d1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrow:"\u2191",Uparrow:"\u21d1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",Updownarrow:"\u21d5",updownarrow:"\u2195",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",upsi:"\u03c5",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTee:"\u22a5",UpTeeArrow:"\u21a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",vArr:"\u21d5",varr:"\u2195",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",Vbar:"\u2aeb",vBar:"\u2ae8",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22ab",Vdash:"\u22a9",vDash:"\u22a8",vdash:"\u22a2",Vdashl:"\u2ae6",Vee:"\u22c1",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",Wedge:"\u22c0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xhArr:"\u27fa",xharr:"\u27f7",Xi:"\u039e",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",Yuml:"\u0178",yuml:"\xff",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",Zfr:"\u2128",zfr:"\ud835\udd37",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",Zopf:"\u2124",zopf:"\ud835\udd6b",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"});t.entityMap=t.HTML_ENTITIES});sc.XML_ENTITIES;sc.HTML_ENTITIES;sc.entityMap;var nc=Do.NAMESPACE;var rc=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var ac=new RegExp("[\\-\\.0-9"+rc.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var oc=new RegExp("^"+rc.source+ac.source+"*(?::"+rc.source+ac.source+"*)?$");var lc=0;var cc=1;var uc=2;var dc=3;var hc=4;var fc=5;var pc=6;var mc=7;function gc(e,t){this.message=e;this.locator=t;if(Error.captureStackTrace)Error.captureStackTrace(this,gc)}gc.prototype=new Error;gc.prototype.name=gc.name;function vc(){}vc.prototype={parse:function(e,t,i){var s=this.domBuilder;s.startDocument();wc(t,t={});yc(e,t,i,s,this.errorHandler);s.endDocument()}};function yc(i,e,s,n,r){function a(e){if(e>65535){e-=65536;var t=55296+(e>>10),i=56320+(e&1023);return String.fromCharCode(t,i)}else{return String.fromCharCode(e)}}function o(e){var t=e.slice(1,-1);if(Object.hasOwnProperty.call(s,t)){return s[t]}else if(t.charAt(0)==="#"){return a(parseInt(t.substr(1).replace("x","0x")))}else{r.error("entity not found:"+e);return e}}function t(e){if(e>m){var t=i.substring(m,e).replace(/&#?\w+;/g,o);h&&l(m);n.characters(t,0,e-m);m=e}}function l(e,t){while(e>=u&&(t=d.exec(i))){c=t.index;u=c+t[0].length;h.lineNumber++}h.columnNumber=e-c+1}var c=0;var u=0;var d=/.*(?:\r\n?|\n)|.*$/g;var h=n.locator;var f=[{currentNSMap:e}];var p={};var m=0;while(true){try{var g=i.indexOf("<",m);if(g<0){if(!i.substr(m).match(/^\s*$/)){var v=n.doc;var y=v.createTextNode(i.substr(m));v.appendChild(y);n.currentElement=y}return}if(g>m){t(g)}switch(i.charAt(g+1)){case"/":var b=i.indexOf(">",g+3);var _=i.substring(g+2,b).replace(/[ \t\n\r]+$/g,"");var T=f.pop();if(b<0){_=i.substring(g+2).replace(/[\s<].*/,"");r.error("end tag name: "+_+" is not complete:"+T.tagName);b=g+1+_.length}else if(_.match(/\sm){m=b}else{t(Math.max(g,m)+1)}}}function bc(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber;return t}function _c(e,t,s,i,n,r){function a(e,t,i){if(s.attributeNames.hasOwnProperty(e)){r.fatalError("Attribute "+e+" redefined")}s.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),i)}var o;var l;var c=++t;var u=lc;while(true){var d=e.charAt(c);switch(d){case"=":if(u===cc){o=e.slice(t,c);u=dc}else if(u===uc){u=dc}else{throw new Error("attribute equal must after attrName")}break;case"'":case'"':if(u===dc||u===cc){if(u===cc){r.warning('attribute value must after "="');o=e.slice(t,c)}t=c+1;c=e.indexOf(d,t);if(c>0){l=e.slice(t,c);a(o,l,t-1);u=fc}else{throw new Error("attribute value no end '"+d+"' match")}}else if(u==hc){l=e.slice(t,c);a(o,l,t);r.warning('attribute "'+o+'" missed start quot('+d+")!!");t=c+1;u=fc}else{throw new Error('attribute value must after "="')}break;case"/":switch(u){case lc:s.setTagName(e.slice(t,c));case fc:case pc:case mc:u=mc;s.closed=true;case hc:case cc:break;case uc:s.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case"":r.error("unexpected end of input");if(u==lc){s.setTagName(e.slice(t,c))}return c;case">":switch(u){case lc:s.setTagName(e.slice(t,c));case fc:case pc:case mc:break;case hc:case cc:l=e.slice(t,c);if(l.slice(-1)==="/"){s.closed=true;l=l.slice(0,-1)}case uc:if(u===uc){l=o}if(u==hc){r.warning('attribute "'+l+'" missed quot(")!');a(o,l,t)}else{if(!nc.isHTML(i[""])||!l.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!')}a(l,l,t)}break;case dc:throw new Error("attribute value missed!!")}return c;case"\x80":d=" ";default:if(d<=" "){switch(u){case lc:s.setTagName(e.slice(t,c));u=pc;break;case cc:o=e.slice(t,c);u=uc;break;case hc:var l=e.slice(t,c);r.warning('attribute "'+l+'" missed quot(")!!');a(o,l,t);case fc:u=pc;break}}else{switch(u){case uc:s.tagName;if(!nc.isHTML(i[""])||!o.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!')}a(o,o,t);t=c;u=cc;break;case fc:r.warning('attribute space is required"'+o+'"!!');case pc:u=cc;t=c;break;case dc:u=hc;t=c;break;case mc:throw new Error("elements closed character '/' and '>' must be connected to")}}}c++}}function Tc(e,t,i){var s=e.tagName;var n=null;var r=e.length;while(r--){var a=e[r];var o=a.qName;var l=a.value;var c=o.indexOf(":");if(c>0){var u=a.prefix=o.slice(0,c);var d=o.slice(c+1);var h=u==="xmlns"&&d}else{d=o;u=null;h=o==="xmlns"&&""}a.localName=d;if(h!==false){if(n==null){n={};wc(i,i={})}i[h]=n[h]=l;a.uri=nc.XMLNS;t.startPrefixMapping(h,l)}}var r=e.length;while(r--){a=e[r];var u=a.prefix;if(u){if(u==="xml"){a.uri=nc.XML}if(u!=="xmlns"){a.uri=i[u||""]}}}var c=s.indexOf(":");if(c>0){u=e.prefix=s.slice(0,c);d=e.localName=s.slice(c+1)}else{u=null;d=e.localName=s}var f=e.uri=i[u||""];t.startElement(f,d,s,e);if(e.closed){t.endElement(f,d,s);if(n){for(u in n){if(Object.prototype.hasOwnProperty.call(n,u)){t.endPrefixMapping(u)}}}}else{e.currentNSMap=i;e.localNSMap=n;return true}}function Sc(e,t,i,s,n){if(/^(?:script|textarea)$/i.test(i)){var r=e.indexOf("",t);var a=e.substring(t+1,r);if(/[&<]/.test(a)){if(/^script$/i.test(i)){n.characters(a,0,a.length);return r}a=a.replace(/&#?\w+;/g,s);n.characters(a,0,a.length);return r}}return t+1}function Ec(e,t,i,s){var n=s[i];if(n==null){n=e.lastIndexOf("");if(nt){i.comment(e,t+4,r-t-4);return r+3}else{s.error("Unclosed comment");return-1}}else{return-1}default:if(e.substr(t+3,6)=="CDATA["){var r=e.indexOf("]]>",t+9);i.startCDATA();i.characters(e,t+9,r-t-9);i.endCDATA();return r+3}var a=Ic(e,t);var o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0];var c=false;var u=false;if(o>3){if(/^public$/i.test(a[2][0])){c=a[3][0];u=o>4&&a[4][0]}else if(/^system$/i.test(a[2][0])){u=a[3][0]}}var d=a[o-1];i.startDTD(l,c,u);i.endDTD();return d.index+d[0].length}}return-1}function jc(e,t,i){var s=e.indexOf("?>",t);if(s){var n=e.substring(t,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(n){n[0].length;i.processingInstruction(n[1],n[2]);return s+2}else{return-1}}return-1}function Cc(){this.attributeNames={}}Cc.prototype={setTagName:function(e){if(!oc.test(e)){throw new Error("invalid tagName:"+e)}this.tagName=e},addValue:function(e,t,i){if(!oc.test(e)){throw new Error("invalid attribute:"+e)}this.attributeNames[e]=this.length;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}};function Ic(e,t){var i;var s=[];var n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;n.lastIndex=t;n.exec(e);while(i=n.exec(e)){s.push(i);if(i[1])return s}}var xc=vc;var Ac=gc;var Dc={XMLReader:xc,ParseError:Ac};var Oc=ic.DOMImplementation;var Pc=Do.NAMESPACE;var Lc=Dc.ParseError;var Rc=Dc.XMLReader;function Nc(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Mc(e){this.options=e||{locator:{}}}Mc.prototype.parseFromString=function(e,t){var i=this.options;var s=new Rc;var n=i.domBuilder||new Bc;var r=i.errorHandler;var a=i.locator;var o=i.xmlns||{};var l=/\/x?html?$/.test(t);var c=l?sc.HTML_ENTITIES:sc.XML_ENTITIES;if(a){n.setDocumentLocator(a)}s.errorHandler=Uc(r,n,a);s.domBuilder=i.domBuilder||n;if(l){o[""]=Pc.HTML}o.xml=o.xml||Pc.XML;var u=i.normalizeLineEndings||Nc;if(e&&typeof e==="string"){s.parse(u(e),o,c)}else{s.errorHandler.error("invalid doc source")}return n.doc};function Uc(s,e,n){if(!s){if(e instanceof Bc){return e}s=e}var r={};var a=s instanceof Function;n=n||{};function t(t){var i=s[t];if(!i&&a){i=s.length==2?function(e){s(t,e)}:s}r[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+qc(n))}||function(){}}t("warning");t("error");t("fatalError");return r}function Bc(){this.cdata=false}function Fc(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber}Bc.prototype={startDocument:function(){this.doc=(new Oc).createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(e,t,i,s){var n=this.doc;var r=n.createElementNS(e,i||t);var a=s.length;Hc(this,r);this.currentElement=r;this.locator&&Fc(this.locator,r);for(var o=0;o=t+i||t){return new java.lang.String(e,t,i)+""}return e}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){Bc.prototype[e]=function(){return null}});function Hc(e,t){if(!e.currentElement){e.doc.appendChild(t)}else{e.currentElement.appendChild(t)}}var $c=Bc;var zc=Nc;var Gc=Mc;var Kc={__DOMHandler:$c,normalizeLineEndings:zc,DOMParser:Gc};var Wc=Kc.DOMParser;const Yc=e=>{return!!e&&typeof e==="object"};const I=(...e)=>{return e.reduce((t,i)=>{if(typeof i!=="object"){return t}Object.keys(i).forEach(e=>{if(Array.isArray(t[e])&&Array.isArray(i[e])){t[e]=t[e].concat(i[e])}else if(Yc(t[e])&&Yc(i[e])){t[e]=I(t[e],i[e])}else{t[e]=i[e]}});return t},{})};const Xc=t=>Object.keys(t).map(e=>t[e]);const Qc=(t,i)=>{const s=[];for(let e=t;ee.reduce((e,t)=>e.concat(t),[]);const Zc=t=>{if(!t.length){return[]}const i=[];for(let e=0;ee.reduce((e,t,i)=>{if(t[s]){e.push(i)}return e},[]);const tu=(e,i)=>{return Xc(e.reduce((t,e)=>{e.forEach(e=>{t[i(e)]=e});return t},{}))};var iu={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const su=({baseUrl:e="",source:t="",range:s="",indexRange:n=""})=>{const r={uri:t,resolvedUri:Oa(e||"",t)};if(s||n){const a=s?s:n;const o=a.split("-");let e=tv.BigInt?tv.BigInt(o[0]):parseInt(o[0],10);let t=tv.BigInt?tv.BigInt(o[1]):parseInt(o[1],10);if(e{let t;if(typeof e.offset==="bigint"||typeof e.length==="bigint"){t=tv.BigInt(e.offset)+tv.BigInt(e.length)-tv.BigInt(1)}else{t=e.offset+e.length-1}return`${e.offset}-${t}`};const ru=e=>{if(e&&typeof e!=="number"){e=parseInt(e,10)}if(isNaN(e)){return null}return e};const au={static(e){const{duration:t,timescale:i=1,sourceDuration:s,periodDuration:n}=e;const r=ru(e.endNumber);const a=t/i;if(typeof r==="number"){return{start:0,end:r}}if(typeof n==="number"){return{start:0,end:n/a}}return{start:0,end:s/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:s,timescale:n=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=Infinity}=e;const c=ru(e.endNumber);const u=(t+i)/1e3;const d=s+a;const h=u+o;const f=h-d;const p=Math.ceil(f*n/r);const m=Math.floor((u-d-l)*n/r);const g=Math.floor((u-d)*n/r);return{start:Math.max(0,m),end:typeof c==="number"?c:Math.min(p,g)}}};const ou=r=>e=>{const{duration:t,timescale:i=1,periodStart:s,startNumber:n=1}=r;return{number:n+e,duration:t/i,timeline:s,time:e*t}};const lu=e=>{const{type:t,duration:i,timescale:s=1,periodDuration:n,sourceDuration:r}=e;const{start:a,end:o}=au[t](e);const l=Qc(a,o).map(ou(e));if(t==="static"){const e=l.length-1;const c=typeof n==="number"?n:r;l[e].duration=c-i/s*e}return l};const cu=e=>{const{baseUrl:t,initialization:i={},sourceDuration:s,indexRange:n="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(!t){throw new Error(iu.NO_BASE_URL)}const c=su({baseUrl:t,source:i.sourceURL,range:i.range});const u=su({baseUrl:t,source:t,indexRange:n});u.map=c;if(l){const d=lu(e);if(d.length){u.duration=d[0].duration;u.timeline=d[0].timeline}}else if(s){u.duration=s;u.timeline=r}u.presentationTime=a||r;u.number=o;return[u]};const uu=(e,s,n)=>{const r=e.sidx.map?e.sidx.map:null;const a=e.sidx.duration;const o=e.timeline||0;const t=e.sidx.byterange;const i=t.offset+t.length;const l=s.timescale;const c=s.references.filter(e=>e.referenceType!==1);const u=[];const d=e.endList?"static":"dynamic";const h=e.sidx.timeline;let f=h;let p=e.mediaSequence||0;let m;if(typeof s.firstOffset==="bigint"){m=tv.BigInt(i)+s.firstOffset}else{m=i+s.firstOffset}for(let i=0;i{return tu(e,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1)};const pu=(t,i)=>{for(let e=0;e{let n=[];yo(e,du,(e,t,i,s)=>{n=n.concat(e.playlists||[])});return n};const gu=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e;i.segments.forEach((e,t)=>{e.number=i.mediaSequence+t})};const vu=({oldPlaylists:r,newPlaylists:e,timelineStarts:a})=>{e.forEach(t=>{t.discontinuitySequence=a.findIndex(function({timeline:e}){return e===t.timeline});const e=pu(r,t.attributes.NAME);if(!e){return}if(t.sidx){return}const i=t.segments[0];const s=e.segments.findIndex(function(e){return Math.abs(e.presentationTime-i.presentationTime)e.timeline||e.segments.length&&t.timeline>e.segments[e.segments.length-1].timeline){t.discontinuitySequence--}return}const n=e.segments[s];if(n.discontinuity&&!i.discontinuity){i.discontinuity=true;t.discontinuityStarts.unshift(0);t.discontinuitySequence--}gu({playlist:t,mediaSequence:e.segments[s].number})})};const yu=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(mu(e));const s=t.playlists.concat(mu(t));t.timelineStarts=fu([e.timelineStarts,t.timelineStarts]);vu({oldPlaylists:i,newPlaylists:s,timelineStarts:t.timelineStarts});return t};const bu=e=>e&&e.uri+"-"+nu(e.byterange);const _u=e=>{const t=e.reduce(function(e,t){if(!e[t.attributes.baseUrl]){e[t.attributes.baseUrl]=[]}e[t.attributes.baseUrl].push(t);return e},{});let i=[];Object.values(t).forEach(e=>{const t=Xc(e.reduce((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");if(!e[i]){e[i]=t;e[i].attributes.timelineStarts=[]}else{if(t.segments){if(t.segments[0]){t.segments[0].discontinuity=true}e[i].segments.push(...t.segments)}if(t.attributes.contentProtection){e[i].attributes.contentProtection=t.attributes.contentProtection}}e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart});return e},{}));i=i.concat(t)});return i.map(e=>{e.discontinuityStarts=eu(e.segments||[],"discontinuity");return e})};const Tu=(e,t)=>{const i=bu(e.sidx);const s=i&&t[i]&&t[i].sidx;if(s){uu(e,s,e.sidx.resolvedUri)}return e};const Su=(t,i={})=>{if(!Object.keys(i).length){return t}for(const e in t){t[e]=Tu(t[e],i)}return t};const Eu=({attributes:e,segments:t,sidx:i,mediaSequence:s,discontinuitySequence:n,discontinuityStarts:r},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,["PROGRAM-ID"]:1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:n,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:s,segments:t};if(e.contentProtection){o.contentProtection=e.contentProtection}if(e.serviceLocation){o.attributes.serviceLocation=e.serviceLocation}if(i){o.sidx=i}if(a){o.attributes.AUDIO="audio";o.attributes.SUBTITLES="subs"}return o};const wu=({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:s,discontinuitySequence:n})=>{if(typeof t==="undefined"){t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}];e.duration=e.sourceDuration}const r={NAME:e.id,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1};if(e.codecs){r.CODECS=e.codecs}const a={attributes:r,uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:i,segments:t};if(e.serviceLocation){a.attributes.serviceLocation=e.serviceLocation}return a};const ku=(e,o={},l=false)=>{let c;const t=e.reduce((e,t)=>{const i=t.attributes.role&&t.attributes.role.value||"";const s=t.attributes.lang||"";let n=t.attributes.label||"main";if(s&&!t.attributes.label){const a=i?` (${i})`:"";n=`${t.attributes.lang}${a}`}if(!e[n]){e[n]={language:s,autoselect:true,default:i==="main",playlists:[],uri:""}}const r=Tu(Eu(t,l),o);e[n].playlists.push(r);if(typeof c==="undefined"&&i==="main"){c=t;c.default=true}return e},{});if(!c){const i=Object.keys(t)[0];t[i].default=true}return t};const ju=(e,s={})=>{return e.reduce((e,t)=>{const i=t.attributes.label||t.attributes.lang||"text";if(!e[i]){e[i]={language:i,default:false,autoselect:false,playlists:[],uri:""}}e[i].playlists.push(Tu(wu(t),s));return e},{})};const Cu=e=>e.reduce((s,e)=>{if(!e){return s}e.forEach(e=>{const{channel:t,language:i}=e;s[i]={autoselect:false,default:false,instreamId:t,language:i};if(e.hasOwnProperty("aspectRatio")){s[i].aspectRatio=e.aspectRatio}if(e.hasOwnProperty("easyReader")){s[i].easyReader=e.easyReader}if(e.hasOwnProperty("3D")){s[i]["3D"]=e["3D"]}});return s},{});const Iu=({attributes:e,segments:t,sidx:i,discontinuityStarts:s})=>{const n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:s,timelineStarts:e.timelineStarts,segments:t};if(e.frameRate){n.attributes["FRAME-RATE"]=e.frameRate}if(e.contentProtection){n.contentProtection=e.contentProtection}if(e.serviceLocation){n.attributes.serviceLocation=e.serviceLocation}if(i){n.sidx=i}return n};const xu=({attributes:e})=>e.mimeType==="video/mp4"||e.mimeType==="video/webm"||e.contentType==="video";const Au=({attributes:e})=>e.mimeType==="audio/mp4"||e.mimeType==="audio/webm"||e.contentType==="audio";const Du=({attributes:e})=>e.mimeType==="text/vtt"||e.contentType==="text";const Ou=(e,i)=>{e.forEach(t=>{t.mediaSequence=0;t.discontinuitySequence=i.findIndex(function({timeline:e}){return e===t.timeline});if(!t.segments){return}t.segments.forEach((e,t)=>{e.number=t})})};const Pu=s=>{if(!s){return[]}return Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[])};const Lu=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:s={},previousManifest:n,eventStream:r})=>{if(!e.length){return{}}const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:c}=e[0].attributes;const u=_u(e.filter(xu)).map(Iu);const d=_u(e.filter(Au));const h=_u(e.filter(Du));const f=e.map(e=>e.attributes.captionServices).filter(Boolean);const p={allowCache:true,discontinuityStarts:[],segments:[],endList:true,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:a,playlists:Su(u,s)};if(c>=0){p.minimumUpdatePeriod=c*1e3}if(t){p.locations=t}if(i){p.contentSteering=i}if(o==="dynamic"){p.suggestedPresentationDelay=l}if(r&&r.length>0){p.eventStream=r}const m=p.playlists.length===0;const g=d.length?ku(d,s,m):null;const v=h.length?ju(h,s):null;const y=u.concat(Pu(g),Pu(v));const b=y.map(({timelineStarts:e})=>e);p.timelineStarts=fu(b);Ou(y,p.timelineStarts);if(g){p.mediaGroups.AUDIO.audio=g}if(v){p.mediaGroups.SUBTITLES.subs=v}if(f.length){p.mediaGroups["CLOSED-CAPTIONS"].cc=Cu(f)}if(n){return yu({oldManifest:n,newManifest:p})}return p};const Ru=(e,t,i)=>{const{NOW:s,clientOffset:n,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e;const c=(s+n)/1e3;const u=r+o;const d=c+l;const h=d-u;return Math.ceil((h*a-t)/i)};const Nu=(n,r)=>{const{type:a,minimumUpdatePeriod:o=0,media:l="",sourceDuration:c,timescale:u=1,startNumber:d=1,periodStart:h}=n;const f=[];let p=-1;for(let s=0;sp){p=v}let t;if(g<0){const b=s+1;if(b===r.length){if(a==="dynamic"&&o>0&&l.indexOf("$Number$")>0){t=Ru(n,p,e)}else{t=(c*u-p)/e}}else{t=(r[b].t-p)/e}}else{t=g+1}const y=d+f.length+t;let i=d+f.length;while(i(e,t,i,s)=>{if(e==="$$"){return"$"}if(typeof r[t]==="undefined"){return e}const n=""+r[t];if(t==="RepresentationID"){return n}if(!i){s=1}else{s=parseInt(s,10)}if(n.length>=s){return n}return`${new Array(s-n.length+1).join("0")}${n}`};const Bu=(e,t)=>e.replace(Mu,Uu(t));const Fu=(e,t)=>{if(!e.duration&&!t){return[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}if(e.duration){return lu(e)}return Nu(e,t)};const qu=(a,e)=>{const o={RepresentationID:a.id,Bandwidth:a.bandwidth||0};const{initialization:t={sourceURL:"",range:""}}=a;const l=su({baseUrl:a.baseUrl,source:Bu(t.sourceURL,o),range:t.range});const i=Fu(a,e);return i.map(e=>{o.Number=e.number;o.Time=e.time;const t=Bu(a.media||"",o);const i=a.timescale||1;const s=a.presentationTimeOffset||0;const n=a.periodStart+(e.time-s)/i;const r={uri:t,timeline:e.timeline,duration:e.duration,resolvedUri:Oa(a.baseUrl||"",t),map:l,number:e.number,presentationTime:n};return r})};const Vu=(e,t)=>{const{baseUrl:i,initialization:s={}}=e;const n=su({baseUrl:i,source:s.sourceURL,range:s.range});const r=su({baseUrl:i,source:t.media,range:t.mediaRange});r.map=n;return r};const Hu=(r,e)=>{const{duration:t,segmentUrls:i=[],periodStart:a}=r;if(!t&&!e||t&&e){throw new Error(iu.SEGMENT_TIME_UNSPECIFIED)}const o=i.map(e=>Vu(r,e));let s;if(t){s=lu(r)}if(e){s=Nu(r,e)}const n=s.map((e,t)=>{if(o[t]){const i=o[t];const s=r.timescale||1;const n=r.presentationTimeOffset||0;i.timeline=e.timeline;i.duration=e.duration;i.number=e.number;i.presentationTime=a+(e.time-n)/s;return i}}).filter(e=>e);return n};const $u=({attributes:e,segmentInfo:t})=>{let i;let s;if(t.template){s=qu;i=I(e,t.template)}else if(t.base){s=cu;i=I(e,t.base)}else if(t.list){s=Hu;i=I(e,t.list)}const n={attributes:e};if(!s){return n}const r=s(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:a=1}=i;i.duration=e/a}else if(r.length){i.duration=r.reduce((e,t)=>{return Math.max(e,Math.ceil(t.duration))},0)}else{i.duration=0}n.attributes=i;n.segments=r;if(t.base&&i.indexRange){n.sidx=r[0];n.segments=[]}return n};const zu=e=>e.map($u);const x=(e,t)=>Zc(e.childNodes).filter(({tagName:e})=>e===t);const Gu=e=>e.textContent.trim();const Ku=e=>{return parseFloat(e.split("/").reduce((e,t)=>e/t))};const Wu=e=>{const t=365*24*60*60;const i=30*24*60*60;const s=24*60*60;const n=60*60;const r=60;const a=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;const o=a.exec(e);if(!o){return 0}const[l,c,u,d,h,f]=o.slice(1);return parseFloat(l||0)*t+parseFloat(c||0)*i+parseFloat(u||0)*s+parseFloat(d||0)*n+parseFloat(h||0)*r+parseFloat(f||0)};const Yu=e=>{const t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(t.test(e)){e+="Z"}return Date.parse(e)};const Xu={mediaPresentationDuration(e){return Wu(e)},availabilityStartTime(e){return Yu(e)/1e3},minimumUpdatePeriod(e){return Wu(e)},suggestedPresentationDelay(e){return Wu(e)},type(e){return e},timeShiftBufferDepth(e){return Wu(e)},start(e){return Wu(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return Ku(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){const t=parseInt(e,10);if(isNaN(t)){return Wu(e)}return t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},DEFAULT(e){return e}};const A=e=>{if(!(e&&e.attributes)){return{}}return Zc(e.attributes).reduce((e,t)=>{const i=Xu[t.name]||Xu.DEFAULT;e[t.name]=i(t.value);return e},{})};const Qu={"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","urn:mpeg:dash:mp4protection:2011":"mp4protection"};const Ju=(e,t)=>{if(!t.length){return e}return Jc(e.map(function(n){return t.map(function(e){const t=Gu(e);const i=Oa(n.baseUrl,t);const s=I(A(e),{baseUrl:i});if(i!==t&&!s.serviceLocation&&n.serviceLocation){s.serviceLocation=n.serviceLocation}return s})}))};const Zu=e=>{const t=x(e,"SegmentTemplate")[0];const i=x(e,"SegmentList")[0];const s=i&&x(i,"SegmentURL").map(e=>I({tag:"SegmentURL"},A(e)));const n=x(e,"SegmentBase")[0];const r=i||t;const a=r&&x(r,"SegmentTimeline")[0];const o=i||n||t;const l=o&&x(o,"Initialization")[0];const c=t&&A(t);if(c&&l){c.initialization=l&&A(l)}else if(c&&c.initialization){c.initialization={sourceURL:c.initialization}}const u={template:c,segmentTimeline:a&&x(a,"S").map(e=>A(e)),list:i&&I(A(i),{segmentUrls:s,initialization:A(l)}),base:n&&I(A(n),{initialization:A(l)})};Object.keys(u).forEach(e=>{if(!u[e]){delete u[e]}});return u};const ed=(r,a,o)=>e=>{const t=x(e,"BaseURL");const i=Ju(a,t);const s=I(r,A(e));const n=Zu(e);return i.map(e=>{return{segmentInfo:I(o,n),attributes:I(s,e)}})};const td=e=>{return e.reduce((e,t)=>{const i=A(t);if(i.schemeIdUri){i.schemeIdUri=i.schemeIdUri.toLowerCase()}const s=Qu[i.schemeIdUri];if(s){e[s]={attributes:i};const n=x(t,"cenc:pssh")[0];if(n){const r=Gu(n);e[s].pssh=r&&_o(r)}}return e},{})};const id=t=>{if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map(e=>{let t;let i;i=e;if(/^CC\d=/.test(e)){[t,i]=e.split("=")}else if(/^CC\d$/.test(e)){t=e}return{channel:t,language:i}})}else if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map(e=>{const s={channel:undefined,language:undefined,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[t,i=""]=e.split("=");s.channel=t;s.language=e;i.split(",").forEach(e=>{const[t,i]=e.split(":");if(t==="lang"){s.language=i}else if(t==="er"){s.easyReader=Number(i)}else if(t==="war"){s.aspectRatio=Number(i)}else if(t==="3D"){s["3D"]=Number(i)}})}else{s.language=e}if(s.channel){s.channel="SERVICE"+s.channel}return s})}};const sd=l=>{return Jc(x(l.node,"EventStream").map(e=>{const a=A(e);const o=a.schemeIdUri;return x(e,"Event").map(e=>{const t=A(e);const i=t.presentationTime||0;const s=a.timescale||1;const n=t.duration||0;const r=i/s+l.attributes.start;return{schemeIdUri:o,value:a.value,id:t.id,start:r,end:r+n/s,messageData:Gu(e)||t.messageData,contentEncoding:a.contentEncoding,presentationTimeOffset:a.presentationTimeOffset||0}})}))};const nd=(p,m,g)=>e=>{const t=A(e);const i=Ju(m,x(e,"BaseURL"));const s=x(e,"Role")[0];const n={role:A(s)};let r=I(p,t,n);const a=x(e,"Accessibility")[0];const o=id(A(a));if(o){r=I(r,{captionServices:o})}const l=x(e,"Label")[0];if(l&&l.childNodes.length){const f=l.childNodes[0].nodeValue.trim();r=I(r,{label:f})}const c=td(x(e,"ContentProtection"));if(Object.keys(c).length){r=I(r,{contentProtection:c})}const u=Zu(e);const d=x(e,"Representation");const h=I(g,u);return Jc(d.map(ed(r,i,h)))};const rd=(a,o)=>(e,t)=>{const i=Ju(o,x(e.node,"BaseURL"));const s=I(a,{periodStart:e.attributes.start});if(typeof e.attributes.duration==="number"){s.periodDuration=e.attributes.duration}const n=x(e.node,"AdaptationSet");const r=Zu(e.node);return Jc(n.map(nd(s,i,r)))};const ad=(e,t)=>{if(e.length>1){t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"})}if(!e.length){return null}const i=I({serverURL:Gu(e[0])},A(e[0]));i.queryBeforeStart=i.queryBeforeStart==="true";return i};const od=({attributes:e,priorPeriodAttributes:t,mpdType:i})=>{if(typeof e.start==="number"){return e.start}if(t&&typeof t.start==="number"&&typeof t.duration==="number"){return t.start+t.duration}if(!t&&i==="static"){return 0}return null};const ld=(e,t={})=>{const{manifestUri:i="",NOW:s=Date.now(),clientOffset:n=0,eventHandler:r=function(){}}=t;const a=x(e,"Period");if(!a.length){throw new Error(iu.INVALID_NUMBER_OF_PERIOD)}const o=x(e,"Location");const l=A(e);const c=Ju([{baseUrl:i}],x(e,"BaseURL"));const u=x(e,"ContentSteering");l.type=l.type||"static";l.sourceDuration=l.mediaPresentationDuration||0;l.NOW=s;l.clientOffset=n;if(o.length){l.locations=o.map(Gu)}const d=[];a.forEach((e,t)=>{const i=A(e);const s=d[t-1];i.start=od({attributes:i,priorPeriodAttributes:s?s.attributes:null,mpdType:l.type});d.push({node:e,attributes:i})});return{locations:l.locations,contentSteeringInfo:ad(u,r),representationInfo:Jc(d.map(rd(l,c))),eventStream:Jc(d.map(sd))}};const cd=e=>{if(e===""){throw new Error(iu.DASH_EMPTY_MANIFEST)}const t=new Wc;let i;let s;try{i=t.parseFromString(e,"application/xml");s=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch(e){}if(!s||s&&s.getElementsByTagName("parsererror").length>0){throw new Error(iu.DASH_INVALID_XML)}return s};const ud=e=>{const t=x(e,"UTCTiming")[0];if(!t){return null}const i=A(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(iu.UNSUPPORTED_UTC_TIMING_SCHEME)}return i};const dd=(e,t={})=>{const i=ld(cd(e),t);const s=zu(i.representationInfo);return Lu({dashPlaylists:s,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})};const hd=e=>ud(cd(e));var fd=Math.pow(2,32);var pd=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);var i;if(t.getBigUint64){i=t.getBigUint64(0);if(i0;s+=12,n--){i.references.push({referenceType:(e[s]&128)>>>7,referencedSize:t.getUint32(s)&2147483647,subsegmentDuration:t.getUint32(s+4),startsWithSap:!!(e[s+8]&128),sapType:(e[s+8]&112)>>>4,sapDeltaTime:t.getUint32(s+8)&268435455})}return i};var yd=vd;var bd=E([73,68,51]);var _d=function e(t,i){if(i===void 0){i=0}t=E(t);var s=t[i+5];var n=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9];var r=(s&16)>>4;if(r){return n+20}return n+10};var Td=function e(t,i){if(i===void 0){i=0}t=E(t);if(t.length-i<10||!k(t,bd,{offset:i})){return i}i+=_d(t,i);return e(t,i)};var Sd=function e(t){if(typeof t==="string"){return go(t)}if(typeof t==="number"){return t}return t};var Ed=function e(t){if(!Array.isArray(t)){return[Sd(t)]}return t.map(function(e){return Sd(e)})};var wd=function e(t,i,s){if(s===void 0){s=false}i=Ed(i);t=E(t);var n=[];if(!i.length){return n}var r=0;while(r>>0;var o=t.subarray(r+4,r+8);if(a===0){break}var l=r+a;if(l>t.length){if(s){break}l=t.length}var c=t.subarray(r+8,l);if(k(o,i[0])){if(i.length===1){n.push(c)}else{n.push.apply(n,e(c,i.slice(1),s))}}r=l}return n};var kd={EBML:E([26,69,223,163]),DocType:E([66,130]),Segment:E([24,83,128,103]),SegmentInfo:E([21,73,169,102]),Tracks:E([22,84,174,107]),Track:E([174]),TrackNumber:E([215]),DefaultDuration:E([35,227,131]),TrackEntry:E([174]),TrackType:E([131]),FlagDefault:E([136]),CodecID:E([134]),CodecPrivate:E([99,162]),VideoTrack:E([224]),AudioTrack:E([225]),Cluster:E([31,67,182,117]),Timestamp:E([231]),TimestampScale:E([42,215,177]),BlockGroup:E([160]),BlockDuration:E([155]),Block:E([161]),SimpleBlock:E([163])};var jd=[128,64,32,16,8,4,2,1];var Cd=function e(t){var i=1;for(var s=0;s=i.length){return i.length}var n=Id(i,s,false);if(k(t.bytes,n.bytes)){return s}var r=Id(i,s+n.length);return e(t,i,s+r.length+r.value+n.length)};var Od=function e(t,i){i=Ad(i);t=E(t);var s=[];if(!i.length){return s}var n=0;while(nt.length?t.length:o+a.value;var c=t.subarray(o,l);if(k(i[0],r.bytes)){if(i.length===1){s.push(c)}else{s=s.concat(e(c,i.slice(1)))}}var u=r.length+a.length+c.length;n+=u}return s};var Pd=E([0,0,0,1]);var Ld=E([0,0,1]);var Rd=E([0,0,3]);var Nd=function e(t){var i=[];var s=1;while(s>1&63}if(s.indexOf(c)!==-1){a=r+l}r+=l+(i==="h264"?1:2)}return t.subarray(0,0)};var Ud=function e(t,i,s){return Md(t,"h264",i,s)};var Bd=function e(t,i,s){return Md(t,"h265",i,s)};var r={webm:E([119,101,98,109]),matroska:E([109,97,116,114,111,115,107,97]),flac:E([102,76,97,67]),ogg:E([79,103,103,83]),ac3:E([11,119]),riff:E([82,73,70,70]),avi:E([65,86,73]),wav:E([87,65,86,69]),"3gp":E([102,116,121,112,51,103]),mp4:E([102,116,121,112]),fmp4:E([115,116,121,112]),mov:E([102,116,121,112,113,116]),moov:E([109,111,111,118]),moof:E([109,111,111,102])};var Fd={aac:function e(t){var i=Td(t);return k(t,[255,16],{offset:i,mask:[255,22]})},mp3:function e(t){var i=Td(t);return k(t,[255,2],{offset:i,mask:[255,6]})},webm:function e(t){var i=Od(t,[kd.EBML,kd.DocType])[0];return k(i,r.webm)},mkv:function e(t){var i=Od(t,[kd.EBML,kd.DocType])[0];return k(i,r.matroska)},mp4:function e(t){if(Fd["3gp"](t)||Fd.mov(t)){return false}if(k(t,r.mp4,{offset:4})||k(t,r.fmp4,{offset:4})){return true}if(k(t,r.moof,{offset:4})||k(t,r.moov,{offset:4})){return true}},mov:function e(t){return k(t,r.mov,{offset:4})},"3gp":function e(t){return k(t,r["3gp"],{offset:4})},ac3:function e(t){var i=Td(t);return k(t,r.ac3,{offset:i})},ts:function e(t){if(t.length<189&&t.length>=1){return t[0]===71}var i=0;while(i+1880};var zd=9e4,Gd,Kd,Wd,Yd,Xd,Qd,Jd;Gd=function(e){return e*zd};Kd=function(e,t){return e*t};Wd=function(e){return e/zd};Yd=function(e,t){return e/t};Xd=function(e,t){return Gd(Yd(e,t))};Qd=function(e,t){return Kd(Wd(e),t)};Jd=function(e,t,i){return Wd(i?e:e-t)};var Zd={ONE_SECOND_IN_TS:zd,secondsToVideoTs:Gd,secondsToAudioTs:Kd,videoTsToSeconds:Wd,audioTsToSeconds:Yd,audioTsToVideoTs:Xd,videoTsToAudioTs:Qd,metadataTsToSeconds:Jd};var eh=Zd.ONE_SECOND_IN_TS;const th=Oa;const ih=(e,t)=>{if(t&&t.responseURL&&e!==t.responseURL){return t.responseURL}return e};const sh=e=>{if(S.log.debug){return S.log.debug.bind(S,"VHS:",`${e} >`)}return function(){}};function L(...e){const t=S.obj||S;const i=t.merge||t.mergeOptions;return i.apply(t,e)}function D(...e){const t=S.time||S;const i=t.createTimeRanges||t.createTimeRanges;return i.apply(t,e)}const nh=1/30;const rh=nh*3;const ah=function(e,t){const i=[];let s;if(e&&e.length){for(s=0;s=i})};const lh=function(e,t){return ah(e,function(e){return e-nh>=t})};const ch=function(t){if(t.length<2){return D()}const i=[];for(let e=1;e{const i=[];if(!t||!t.length){return""}for(let e=0;e "+t.end(e))}return i.join(", ")};const hh=function(e,t,i=1){const s=e.length?e.end(e.length-1):0;return(s-t)/i};const fh=t=>{const i=[];for(let e=0;er){continue}if(i>n&&i<=r){s+=r-i;continue}s+=r-n}return s};const vh=(t,e)=>{if(!e.preload){return e.duration}let i=0;(e.parts||[]).forEach(function(e){i+=e.duration});(e.preloadHints||[]).forEach(function(e){if(e.type==="PART"){i+=t.partTargetDuration}});return i};const yh=e=>(e.segments||[]).reduce((i,s,n)=>{if(s.parts){s.parts.forEach(function(e,t){i.push({duration:e.duration,segmentIndex:n,partIndex:t,part:e,segment:s})})}else{i.push({duration:s.duration,segmentIndex:n,partIndex:null,segment:s,part:null})}return i},[]);const bh=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]};const _h=({preloadSegment:e})=>{if(!e){return}const{parts:t,preloadHints:i}=e;let s=(i||[]).reduce((e,t)=>e+(t.type==="PART"?1:0),0);s+=t&&t.length?t.length:0;return s};const Th=(e,t)=>{if(t.endList){return 0}if(e&&e.suggestedPresentationDelay){return e.suggestedPresentationDelay}const i=bh(t).length>0;if(i&&t.serverControl&&t.serverControl.partHoldBack){return t.serverControl.partHoldBack}else if(i&&t.partTargetDuration){return t.partTargetDuration*3}else if(t.serverControl&&t.serverControl.holdBack){return t.serverControl.holdBack}else if(t.targetDuration){return t.targetDuration*3}return 0};const Sh=function(e,t){let i=0;let s=t-e.mediaSequence;let n=e.segments[s];if(n){if(typeof n.start!=="undefined"){return{result:n.start,precise:true}}if(typeof n.end!=="undefined"){return{result:n.end-n.duration,precise:true}}}while(s--){n=e.segments[s];if(typeof n.end!=="undefined"){return{result:i+n.end,precise:true}}i+=vh(e,n);if(typeof n.start!=="undefined"){return{result:i+n.start,precise:true}}}return{result:i,precise:false}};const Eh=function(e,t){let i=0;let s;let n=t-e.mediaSequence;for(;nn){[s,n]=[n,s]}if(s<0){for(let e=s;e0){for(let e=c-1;e>=0;e--){const u=l[e];o+=u.duration;if(a){if(o<0){continue}}else if(o+nh<=0){continue}return{partIndex:u.partIndex,segmentIndex:u.segmentIndex,startTime:r-jh({defaultDuration:t.targetDuration,durationList:l,startIndex:c,endIndex:e})}}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}if(c<0){for(let e=c;e<0;e++){o-=t.targetDuration;if(o<0){return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}}c=0}for(let e=c;enh;const h=o===0;const f=d&&o+nh>=0;if(h||f){if(e!==l.length-1){continue}}if(a){if(o>0){continue}}else if(o-nh>=0){continue}return{partIndex:u.partIndex,segmentIndex:u.segmentIndex,startTime:r+jh({defaultDuration:t.targetDuration,durationList:l,startIndex:c,endIndex:e})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:i}};const Ah=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()};const Dh=function(e){return e.excludeUntil&&e.excludeUntil===Infinity};const Oh=function(e){const t=Ah(e);return!e.disabled&&!t};const Ph=function(e){return e.disabled};const Lh=function(t){for(let e=0;e{if(e.playlists.length===1){return true}const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(e=>{if(!Oh(e)){return false}return(e.attributes.BANDWIDTH||0){if(!e&&!t||!e&&t||e&&!t){return false}if(e===t){return true}if(e.id&&t.id&&e.id===t.id){return true}if(e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri){return true}if(e.uri&&t.uri&&e.uri===t.uri){return true}return false};const Bh=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let s=false;for(const n in i){for(const r in i[n]){s=t(i[n][r]);if(s){break}}if(s){break}}return!!s};const Fh=t=>{if(!t||!t.playlists||!t.playlists.length){const i=Bh(t,e=>e.playlists&&e.playlists.length||e.uri);return i}for(let e=0;eJa(e))){continue}const i=Bh(t,e=>Uh(s,e));if(i){continue}return false}return true};var qh={liveEdgeDelay:Th,duration:kh,seekable:Ih,getMediaInfoForTime:xh,isEnabled:Oh,isDisabled:Ph,isExcluded:Ah,isIncompatible:Dh,playlistEnd:Ch,isAes:Lh,hasAttribute:Rh,estimateSegmentRequestTime:Nh,isLowestEnabledRendition:Mh,isAudioOnly:Fh,playlistMatch:Uh,segmentDurationWithParts:vh};const{log:Vh}=S;const Hh=(e,t)=>{return`${e}-${t}`};const $h=(e,t,i)=>{return`placeholder-uri-${e}-${t}-${i}`};const zh=({onwarn:t,oninfo:e,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const a=new za;if(t){a.on("warn",t)}if(e){a.on("info",e)}s.forEach(e=>a.addParser(e));n.forEach(e=>a.addTagMapper(e));a.push(i);a.end();const o=a.manifest;if(!r){["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){if(o.hasOwnProperty(e)){delete o[e]}});if(o.segments){o.segments.forEach(function(t){["parts","preloadHints"].forEach(function(e){if(t.hasOwnProperty(e)){delete t[e]}})})}}if(!o.targetDuration){let e=10;if(o.segments&&o.segments.length){e=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)}if(t){t({message:`manifest has no targetDuration defaulting to ${e}`})}o.targetDuration=e}const l=bh(o);if(l.length&&!o.partTargetDuration){const c=l.reduce((e,t)=>Math.max(e,t.duration),0);if(t){t({message:`manifest has no partTargetDuration defaulting to ${c}`});Vh.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")}o.partTargetDuration=c}return o};const Gh=(n,r)=>{if(!n.mediaGroups){return}["AUDIO","SUBTITLES"].forEach(e=>{if(!n.mediaGroups[e]){return}for(const t in n.mediaGroups[e]){for(const i in n.mediaGroups[e][t]){const s=n.mediaGroups[e][t][i];r(s,e,t,i)}}})};const Kh=({playlist:e,uri:t,id:i})=>{e.id=i;e.playlistErrors_=0;if(t){e.uri=t}e.attributes=e.attributes||{}};const Wh=e=>{let t=e.playlists.length;while(t--){const i=e.playlists[t];Kh({playlist:i,id:Hh(t,i.uri)});i.resolvedUri=th(e.uri,i.uri);e.playlists[i.id]=i;e.playlists[i.uri]=i;if(!i.attributes.BANDWIDTH){Vh.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}};const Yh=t=>{Gh(t,e=>{if(e.uri){e.resolvedUri=th(t.uri,e.uri)}})};const Xh=(e,t)=>{const i=Hh(0,t);const s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:tv.location.href,resolvedUri:tv.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};s.playlists[i]=s.playlists[0];s.playlists[t]=s.playlists[0];return s};const Qh=(o,e,l=$h)=>{o.uri=e;for(let e=0;e{if(!e.playlists||!e.playlists.length){if(i&&n==="AUDIO"&&!e.uri){for(let e=0;e{e.set(t.id,t);return e},new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id);this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null){return[]}const s={};const n=[];this.pendingDateRanges_.forEach((e,t)=>{if(this.processedDateRanges_.has(t)){return}e.startTime=e.startDate.getTime()/1e3-this.offset_;e.processDateRange=()=>this.processDateRange(e);n.push(e);if(!e.class){return}if(s[e.class]){const i=s[e.class].push(e);e.classListIndex=i-1}else{s[e.class]=[e];e.classListIndex=0}});for(const e of n){const t=s[e.class]||[];if(e.endDate){e.endTime=e.endDate.getTime()/1e3-this.offset_}else if(e.endOnNext&&t[e.classListIndex+1]){e.endTime=t[e.classListIndex+1].startTime}else if(e.duration){e.endTime=e.startTime+e.duration}else if(e.plannedDuration){e.endTime=e.startTime+e.plannedDuration}else{e.endTime=e.startTime}}return n}trimProcessedDateRanges_(i){const e=new Map(this.processedDateRanges_);e.forEach((e,t)=>{if(e.startDate.getTime(){if(t.endList||!t.serverControl){return e}const i={};if(t.serverControl.canBlockReload){const{preloadSegment:s}=t;let e=t.mediaSequence+t.segments.length;if(s){const n=s.parts||[];const r=_h(t)-1;if(r>-1&&r!==n.length-1){i._HLS_part=r}if(r>-1||n.length){e--}}i._HLS_msn=e}if(t.serverControl&&t.serverControl.canSkipUntil){i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"}if(Object.keys(i).length){const a=new tv.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){if(!i.hasOwnProperty(e)){return}a.searchParams.set(e,i[e])});e=a.toString()}return e};const tf=(t,i)=>{if(!t){return i}const s=L(t,i);if(t.preloadHints&&!i.preloadHints){delete s.preloadHints}if(t.parts&&!i.parts){delete s.parts}else if(t.parts&&i.parts){for(let e=0;e{const s=e.slice();const n=t.slice();i=i||0;const r=[];let a;for(let e=0;e{if(!e.resolvedUri&&e.uri){e.resolvedUri=th(t,e.uri)}if(e.key&&!e.key.resolvedUri){e.key.resolvedUri=th(t,e.key.uri)}if(e.map&&!e.map.resolvedUri){e.map.resolvedUri=th(t,e.map.uri)}if(e.map&&e.map.key&&!e.map.key.resolvedUri){e.map.key.resolvedUri=th(t,e.map.key.uri)}if(e.parts&&e.parts.length){e.parts.forEach(e=>{if(e.resolvedUri){return}e.resolvedUri=th(t,e.uri)})}if(e.preloadHints&&e.preloadHints.length){e.preloadHints.forEach(e=>{if(e.resolvedUri){return}e.resolvedUri=th(t,e.uri)})}};const rf=function(e){const t=e.segments||[];const i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let e=0;ee===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment;const of=(e,n,t=af)=>{const i=L(e,{});const s=i.playlists[n.id];if(!s){return null}if(t(s,n)){return null}n.segments=rf(n);const r=L(s,n);if(r.preloadSegment&&!n.preloadSegment){delete r.preloadSegment}if(s.segments){if(n.skip){n.segments=n.segments||[];for(let e=0;e{nf(e,r.resolvedUri)});for(let e=0;e{if(!t.playlists){return}for(let e=0;e{const i=e.segments||[];const s=i[i.length-1];const n=s&&s.parts&&s.parts[s.parts.length-1];const r=n&&n.duration||s&&s.duration;if(t&&r){return r*1e3}return(e.partTargetDuration||e.targetDuration||10)*500};class cf extends Zh{constructor(e,t,i={}){super();if(!e){throw new Error("A non-empty playlist URL or object is required")}this.logger_=sh("PlaylistLoader");const{withCredentials:s=false}=i;this.src=e;this.vhs_=t;this.withCredentials=s;this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[];this.customTagMappers=n&&n.customTagMappers||[];this.llhls=n&&n.llhls;this.dateRangesStorage_=new Jh;this.state="HAVE_NOTHING";this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this);this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_);this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e){return}this.dateRangesStorage_.setOffset(e.segments);this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();if(!t.length||!this.addDateRangesToTextTrack_){return}this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA"){return}const e=this.media();let t=th(this.main.uri,e.uri);if(this.llhls){t=ef(t,e)}this.state="HAVE_CURRENT_METADATA";this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}if(e){return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA")}this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:s,id:n}=t;this.request=null;if(i){this.state=i}this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2};this.trigger("error")}parseManifest_({url:t,manifestString:e}){return zh({onwarn:({message:e})=>this.logger_(`m3u8-parser warn for ${t}: ${e}`),oninfo:({message:e})=>this.logger_(`m3u8-parser info for ${t}: ${e}`),manifestString:e,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null;this.state="HAVE_METADATA";const n=t||this.parseManifest_({url:i,manifestString:e});n.lastRequest=Date.now();Kh({playlist:n,uri:i,id:s});const r=of(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration;this.pendingMedia_=null;if(r){this.main=r;this.media_=this.main.playlists[s]}else{this.trigger("playlistunchanged")}this.updateMediaUpdateTimeout_(lf(this.media(),!!r));this.trigger("loadedplaylist")}dispose(){this.trigger("dispose");this.stopRequest();tv.clearTimeout(this.mediaUpdateTimeout);tv.clearTimeout(this.finalRenditionTimeout);this.dateRangesStorage_=new Jh;this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}media(i,e){if(!i){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}if(typeof i==="string"){if(!this.main.playlists[i]){throw new Error("Unknown playlist URI: "+i)}i=this.main.playlists[i]}tv.clearTimeout(this.finalRenditionTimeout);if(e){const r=(i.partTargetDuration||i.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=tv.setTimeout(this.media.bind(this,i,false),r);return}const s=this.state;const t=!this.media_||i.id!==this.media_.id;const n=this.main.playlists[i.id];if(n&&n.endList||i.endList&&i.segments.length){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=i;if(t){this.trigger("mediachanging");if(s==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}return}this.updateMediaUpdateTimeout_(lf(i,true));if(!t){return}this.state="SWITCHING_MEDIA";if(this.request){if(i.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.pendingMedia_=i;this.request=this.vhs_.xhr({uri:i.resolvedUri,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}i.lastRequest=Date.now();i.resolvedUri=ih(i.resolvedUri,t);if(e){return this.playlistRequestError(this.request,i,s)}this.haveMetadata({playlistString:t.responseText,url:i.uri,id:i.id});if(s==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}})}pause(){if(this.mediaUpdateTimeout){tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}this.stopRequest();if(this.state==="HAVE_NOTHING"){this.started=false}if(this.state==="SWITCHING_MEDIA"){if(this.media_){this.state="HAVE_METADATA"}else{this.state="HAVE_MAIN_MANIFEST"}}else if(this.state==="HAVE_CURRENT_METADATA"){this.state="HAVE_METADATA"}}load(e){if(this.mediaUpdateTimeout){tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=tv.setTimeout(()=>{this.mediaUpdateTimeout=null;this.load()},i);return}if(!this.started){this.start();return}if(t&&!t.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}updateMediaUpdateTimeout_(e){if(this.mediaUpdateTimeout){tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}if(!this.media()||this.media().endList){return}this.mediaUpdateTimeout=tv.setTimeout(()=>{this.mediaUpdateTimeout=null;this.trigger("mediaupdatetimeout");this.updateMediaUpdateTimeout_(e)},e)}start(){this.started=true;if(typeof this.src==="object"){if(!this.src.uri){this.src.uri=tv.location.href}this.src.resolvedUri=this.src.uri;setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}this.request=null;if(e){this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2};if(this.state==="HAVE_NOTHING"){this.started=false}return this.trigger("error")}this.src=ih(this.src,t);const i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i)})}srcUri(){return typeof this.src==="string"?this.src:this.src.uri}setupInitialPlaylist(e){this.state="HAVE_MAIN_MANIFEST";if(e.playlists){this.main=e;Qh(this.main,this.srcUri());e.playlists.forEach(t=>{t.segments=rf(t);t.segments.forEach(e=>{nf(e,t.resolvedUri)})});this.trigger("loadedplaylist");if(!this.request){this.media(this.main.playlists[0])}return}const t=this.srcUri()||tv.location.href;this.main=Xh(e,t);this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id});this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main;const s=e.ID;let n=i.playlists.length;while(n--){const r=i.playlists[n];if(r.attributes["PATHWAY-ID"]===s){const a=r.resolvedUri;const o=r.id;if(t){const l=this.createCloneURI_(r.resolvedUri,e);const c=Hh(s,l);const u=this.createCloneAttributes_(s,r.attributes);const d=this.createClonePlaylist_(r,c,e,u);i.playlists[n]=d;i.playlists[c]=d;i.playlists[l]=d}else{i.playlists.splice(n,1)}delete i.playlists[o];delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const r=this.main;const n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(!r.mediaGroups[e]||!r.mediaGroups[e][n]){return}for(const t in r.mediaGroups[e]){if(t===n){for(const i in r.mediaGroups[e][t]){const s=r.mediaGroups[e][t][i];s.playlists.forEach((e,t)=>{const i=r.playlists[e.id];const s=i.id;const n=i.resolvedUri;delete r.playlists[s];delete r.playlists[n]})}delete r.mediaGroups[e][t]}}});if(t){this.createClonedMediaGroups_(e)}}addClonePathway(e,t={}){const i=this.main;const s=i.playlists.length;const n=this.createCloneURI_(t.resolvedUri,e);const r=Hh(e.ID,n);const a=this.createCloneAttributes_(e.ID,t.attributes);const o=this.createClonePlaylist_(t,r,e,a);i.playlists[s]=o;i.playlists[r]=o;i.playlists[n]=o;this.createClonedMediaGroups_(e)}createClonedMediaGroups_(u){const d=u.ID;const s=u["BASE-ID"];const h=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(o=>{if(!h.mediaGroups[o]||h.mediaGroups[o][d]){return}for(const e in h.mediaGroups[o]){if(e===s){h.mediaGroups[o][d]={}}else{continue}for(const l in h.mediaGroups[o][e]){const t=h.mediaGroups[o][e][l];h.mediaGroups[o][d][l]=Ni({},t);const c=h.mediaGroups[o][d][l];const i=this.createCloneURI_(t.resolvedUri,u);c.resolvedUri=i;c.uri=i;c.playlists=[];t.playlists.forEach((e,t)=>{const i=h.playlists[e.id];const s=$h(o,d,l);const n=Hh(d,s);if(i&&!h.playlists[n]){const r=this.createClonePlaylist_(i,n,u);const a=r.resolvedUri;h.playlists[n]=r;h.playlists[a]=r}c.playlists[t]=this.createClonePlaylist_(e,n,u)})}}})}createClonePlaylist_(e,t,i,s){const n=this.createCloneURI_(e.resolvedUri,i);const r={resolvedUri:n,uri:n,id:t};if(e.segments){r.segments=[]}if(s){r.attributes=s}return L(e,r)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const s=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(s)){i.searchParams.set(n,s[n])}return i.href}createCloneAttributes_(t,i){const s={["PATHWAY-ID"]:t};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i[e]){s[e]=t}});return s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const s=e.contentProtection[i].attributes.keyId;if(s){t.add(s.toLowerCase())}}return t}}}const{xhr:uf}=S;const df=function(e,t,i,s){const n=e.responseType==="arraybuffer"?e.response:e.responseText;if(!t&&n){e.responseTime=Date.now();e.roundTripTime=e.responseTime-e.requestTime;e.bytesReceived=n.byteLength||n.length;if(!e.bandwidth){e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3)}}if(i.headers){e.responseHeaders=i.headers}if(t&&t.code==="ETIMEDOUT"){e.timedout=true}if(!t&&!e.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0){t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))}s(t,e)};const hf=(e,t)=>{if(!e||!e.size){return}let i=t;e.forEach(e=>{i=e(i)});return i};const ff=(e,t,i,s)=>{if(!e||!e.size){return}e.forEach(e=>{e(t,i,s)})};const pf=function(){const e=function e(t,i){t=L({timeout:45e3},t);const s=e.beforeRequest||S.Vhs.xhr.beforeRequest;const n=e._requestCallbackSet||S.Vhs.xhr._requestCallbackSet||new Set;const r=e._responseCallbackSet||S.Vhs.xhr._responseCallbackSet;if(s&&typeof s==="function"){S.log.warn("beforeRequest is deprecated, use onRequest instead.");n.add(s)}const a=S.Vhs.xhr.original===true?uf:S.Vhs.xhr;const o=hf(n,t);n.delete(s);const l=a(o||t,function(e,t){ff(r,l,e,t);return df(l,e,t,i)});const c=l.abort;l.abort=function(){l.aborted=true;return c.apply(l,arguments)};l.uri=t.uri;l.requestTime=Date.now();return l};e.original=true;return e};const mf=function(e){let t;const i=e.offset;if(typeof e.offset==="bigint"||typeof e.length==="bigint"){t=tv.BigInt(e.offset)+tv.BigInt(e.length)-tv.BigInt(1)}else{t=e.offset+e.length-1}return"bytes="+i+"-"+t};const gf=function(e){const t={};if(e.byterange){t.Range=mf(e.byterange)}return t};const vf=function(e,t){return e.start(t)+"-"+e.end(t)};const yf=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")};const bf=function(e){if(e>=32&&e<126){return String.fromCharCode(e)}return"."};const _f=function(i){const s={};Object.keys(i).forEach(e=>{const t=i[e];if(uo(t)){s[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}}else{s[e]=t}});return s};const Tf=function(e){const t=e.byterange||{length:Infinity,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")};const Sf=function(e){return e.resolvedUri};const Ef=e=>{const t=Array.prototype.slice.call(e);const i=16;let s="";let n;let r;for(let e=0;eEf(e);const kf=e=>{let t="";let i;for(i=0;i{if(!t.dateTimeObject){return null}const i=t.videoTimingInfo.transmuxerPrependedSeconds;const s=t.videoTimingInfo.transmuxedPresentationStart;const n=s+i;const r=e-n;return new Date(t.dateTimeObject.getTime()+r*1e3)};const xf=e=>{return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds};const Af=(e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||t.segments.length===0){return null}let s=t.segments[0];if(io){return null}if(i>new Date(r)){s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:qh.duration(t,t.mediaSequence+t.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"}};const Df=(t,i)=>{if(!i||!i.segments||i.segments.length===0){return null}let s=0;let n;for(let e=0;es){if(t>s+e.duration*Cf){return null}n=e}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:s-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}};const Of=(e,t)=>{let i;let s;try{i=new Date(e);s=new Date(t)}catch(e){}const n=i.getTime();const r=s.getTime();return(r-n)/1e3};const Pf=t=>{if(!t.segments||t.segments.length===0){return false}for(let e=0;e{if(!i){throw new Error("getProgramTime: callback must be provided")}if(!e||t===undefined){return i({message:"getProgramTime: playlist and time must be provided"})}const s=Df(t,e);if(!s){return i({message:"valid programTime was not found"})}if(s.type==="estimate"){return i({message:"Accurate programTime could not be determined."+" Please seek to e.seekTime and try again",seekTime:s.estimatedStart})}const n={mediaSeconds:t};const r=If(t,s.segment);if(r){n.programDateTime=r.toISOString()}return i(null,n)};const Rf=({programTime:e,playlist:t,retryCount:i=2,seekTo:s,pauseAfterSeek:n=true,tech:r,callback:a})=>{if(!a){throw new Error("seekToProgramTime: callback must be provided")}if(typeof e==="undefined"||!t||!s){return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!t.endList&&!r.hasStarted_){return a({message:"player must be playing a live stream to start buffering"})}if(!Pf(t)){return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri})}const o=Af(e,t);if(!o){return a({message:`${e} was not found in the stream`})}const l=o.segment;const c=Of(l.dateTimeObject,e);if(o.type==="estimate"){if(i===0){return a({message:`${e} is not buffered yet. Try again`})}s(o.estimatedStart+c);r.one("seeked",()=>{Rf({programTime:e,playlist:t,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:a})});return}const u=l.start+c;const d=()=>{return a(null,r.currentTime())};r.one("seeked",d);if(n){r.pause()}s(u)};const Nf=(e,t)=>{if(e.readyState===4){return t()}return};const Mf=(e,t,n)=>{let r=[];let a;let o=false;const l=function(e,t,i,s){t.abort();o=true;return n(e,t,i,s)};const s=function(e,t){if(o){return}if(e){return l(e,t,"",r)}const i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);r=vo(r,go(i,true));a=a||Td(r);if(r.length<10||a&&r.lengthl(e,t,"",r))}const s=Hd(r);if(s==="ts"&&r.length<188){return Nf(t,()=>l(e,t,"",r))}if(!s&&r.length<376){return Nf(t,()=>l(e,t,"",r))}return l(null,t,s,r)};const i={uri:e,beforeSend(i){i.overrideMimeType("text/plain; charset=x-user-defined");i.addEventListener("progress",function({total:e,loaded:t}){return df(i,null,{statusCode:i.status},s)})}};const c=t(i,function(e,t){return df(c,e,t,s)});return c};const{EventTarget:Uf}=S;const Bf=function(t,i){if(!af(t,i)){return false}if(t.sidx&&i.sidx&&(t.sidx.offset!==i.sidx.offset||t.sidx.length!==i.sidx.length)){return false}else if(!t.sidx&&i.sidx||t.sidx&&!i.sidx){return false}if(t.segments&&!i.segments||!t.segments&&i.segments){return false}if(!t.segments&&!i.segments){return true}for(let e=0;e{const n=s.attributes.NAME||i;return`placeholder-uri-${e}-${t}-${n}`};const qf=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=dd(e,{manifestUri:t,clientOffset:i,sidxMapping:s,previousManifest:n});Qh(r,t,Ff);return r};const Vf=(n,r)=>{Gh(n,(e,t,i,s)=>{if(!(s in r.mediaGroups[t][i])){delete n.mediaGroups[t][i][s]}})};const Hf=(e,t,i)=>{let a=true;let o=L(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e{if(t.playlists&&t.playlists.length){const r=t.playlists[0].id;const e=of(o,t.playlists[0],Bf);if(e){o=e;if(!(n in o.mediaGroups[i][s])){o.mediaGroups[i][s][n]=t}o.mediaGroups[i][s][n].playlists[0]=o.playlists[r];a=false}}});Vf(o,t);if(t.minimumUpdatePeriod!==e.minimumUpdatePeriod){a=false}if(a){return null}return o};const $f=(e,t)=>{const i=Boolean(!e.map&&!t.map);const s=i||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return s&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length};const zf=(e,t)=>{const i={};for(const s in e){const n=e[s];const r=n.sidx;if(r){const a=bu(r);if(!t[a]){break}const o=t[a].sidxInfo;if($f(o,r)){i[a]=t[a]}}}return i};const Gf=(e,r)=>{const t=zf(e.playlists,r);let a=t;Gh(e,(e,t,i,s)=>{if(e.playlists&&e.playlists.length){const n=e.playlists;a=L(a,zf(n,r))}});return a};class Kf extends Uf{constructor(e,t,i={},s){super();this.mainPlaylistLoader_=s||this;if(!s){this.isMain_=true}const{withCredentials:n=false}=i;this.vhs_=t;this.withCredentials=n;this.addMetadataToTextTrack=i.addMetadataToTextTrack;if(!e){throw new Error("A non-empty playlist URL or object is required")}this.on("minimumUpdatePeriod",()=>{this.refreshXml_()});this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)});this.state="HAVE_NOTHING";this.loadedPlaylists_={};this.logger_=sh("DashPlaylistLoader");if(this.isMain_){this.mainPlaylistLoader_.srcUrl=e;this.mainPlaylistLoader_.sidxMapping_={}}else{this.childPlaylist_=e}}requestErrored_(e,t,i){if(!this.request){return true}this.request=null;if(e){this.error=typeof e==="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2};if(i){this.state=i}this.trigger("error");return true}}addSidxSegments_(a,n,r){const o=a.sidx&&bu(a.sidx);if(!a.sidx||!o||this.mainPlaylistLoader_.sidxMapping_[o]){this.mediaRequest_=tv.setTimeout(()=>r(false),0);return}const l=ih(a.sidx.resolvedUri);const c=(e,t)=>{if(this.requestErrored_(e,t,n)){return}const i=this.mainPlaylistLoader_.sidxMapping_;let s;try{s=yd(E(t.response).subarray(8))}catch(e){this.requestErrored_(e,t,n);return}i[o]={sidxInfo:a.sidx,sidx:s};uu(a,s,a.sidx.resolvedUri);return r(true)};this.request=Mf(l,this.vhs_.xhr,(e,t,i,s)=>{if(e){return c(e,t)}if(!i||i!=="mp4"){return c({status:t.status,message:`Unsupported ${i||"unknown"} container type for sidx segment at URL: ${l}`,response:"",playlist:a,internal:true,playlistExclusionDuration:Infinity,code:2},t)}const{offset:n,length:r}=a.sidx.byterange;if(s.length>=r+n){return c(e,{response:s.subarray(n,n+r),status:t.status,uri:t.uri})}this.request=this.vhs_.xhr({uri:l,responseType:"arraybuffer",headers:gf({byterange:a.sidx.byterange})},c)})}dispose(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};tv.clearTimeout(this.minimumUpdatePeriodTimeout_);tv.clearTimeout(this.mediaRequest_);tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;this.mediaRequest_=null;this.minimumUpdatePeriodTimeout_=null;if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}media(t){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}const i=this.state;if(typeof t==="string"){if(!this.mainPlaylistLoader_.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.mainPlaylistLoader_.main.playlists[t]}const e=!this.media_||t.id!==this.media_.id;if(e&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList){this.state="HAVE_METADATA";this.media_=t;if(e){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!e){return}if(this.media_){this.trigger("mediachanging")}this.addSidxSegments_(t,i,e=>{this.haveMetadata({startingState:i,playlist:t})})}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA";this.loadedPlaylists_[t.id]=t;this.mediaRequest_=null;this.refreshMedia_(t.id);if(e==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}pause(){if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.stopRequest();tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;if(this.isMain_){tv.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null}if(this.state==="HAVE_NOTHING"){this.started=false}}load(e){tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=tv.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}if(t&&!t.endList){if(this.isMain_&&!this.minimumUpdatePeriodTimeout_){this.trigger("minimumUpdatePeriod");this.updateMinimumUpdatePeriodTimeout_()}this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}start(){this.started=true;if(!this.isMain_){this.mediaRequest_=tv.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.mainPlaylistLoader_.main.playlists[0])}})}requestMain_(s){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(e,t)=>{if(this.requestErrored_(e,t)){if(this.state==="HAVE_NOTHING"){this.started=false}return}const i=t.responseText!==this.mainPlaylistLoader_.mainXml_;this.mainPlaylistLoader_.mainXml_=t.responseText;if(t.responseHeaders&&t.responseHeaders.date){this.mainLoaded_=Date.parse(t.responseHeaders.date)}else{this.mainLoaded_=Date.now()}this.mainPlaylistLoader_.srcUrl=ih(this.mainPlaylistLoader_.srcUrl,t);if(i){this.handleMain_();this.syncClientServerClock_(()=>{return s(t,i)});return}return s(t,i)})}syncClientServerClock_(s){const n=hd(this.mainPlaylistLoader_.mainXml_);if(n===null){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return s()}if(n.method==="DIRECT"){this.mainPlaylistLoader_.clientOffset_=n.value-Date.now();return s()}this.request=this.vhs_.xhr({uri:th(this.mainPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}if(e){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return s()}let i;if(n.method==="HEAD"){if(!t.responseHeaders||!t.responseHeaders.date){i=this.mainLoaded_}else{i=Date.parse(t.responseHeaders.date)}}else{i=Date.parse(t.responseText)}this.mainPlaylistLoader_.clientOffset_=i-Date.now();s()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST";if(this.isMain_){this.trigger("loadedplaylist")}else if(!this.media_){this.media(this.childPlaylist_)}}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=qf({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});if(e){t=Hf(e,t,this.mainPlaylistLoader_.sidxMapping_)}this.mainPlaylistLoader_.main=t?t:e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(i&&i!==this.mainPlaylistLoader_.srcUrl){this.mainPlaylistLoader_.srcUrl=i}if(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod){this.updateMinimumUpdatePeriodTimeout_()}this.addEventStreamToMetadataTrack_(t);return Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;if(e.createMupOnMedia_){e.off("loadedmetadata",e.createMupOnMedia_);e.createMupOnMedia_=null}if(e.minimumUpdatePeriodTimeout_){tv.clearTimeout(e.minimumUpdatePeriodTimeout_);e.minimumUpdatePeriodTimeout_=null}let t=e.main&&e.main.minimumUpdatePeriod;if(t===0){if(e.media()){t=e.media().targetDuration*1e3}else{e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_;e.one("loadedmetadata",e.createMupOnMedia_)}}if(typeof t!=="number"||t<=0){if(t<0){this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`)}return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=tv.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null;t.trigger("minimumUpdatePeriod");t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{if(!t){return}if(this.media_){this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]}this.mainPlaylistLoader_.sidxMapping_=Gf(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_);this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)})})}refreshMedia_(e){if(!e){throw new Error("refreshMedia_ must take a media id")}if(this.media_&&this.isMain_){this.handleMain_()}const t=this.mainPlaylistLoader_.main.playlists;const i=!this.media_||this.media_!==t[e];if(i){this.media_=t[e]}else{this.trigger("playlistunchanged")}if(!this.mediaUpdateTimeout){const s=()=>{if(this.media().endList){return}this.mediaUpdateTimeout=tv.setTimeout(()=>{this.trigger("mediaupdatetimeout");s()},lf(this.media(),Boolean(i)))};s()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(e=>{return{cueTime:e.start,frames:[{data:e.messageData}]}});this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const s=e.contentProtection[i].attributes["cenc:default_KID"];if(s){t.add(s.replace(/-/g,"").toLowerCase())}}return t}}}var O={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Wf=t=>{const i=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e-1};this.trigger=function(e){var t,i,s,n;t=r[e];if(!t){return}if(arguments.length===2){s=t.length;for(i=0;i>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))};H=function(){return c(u.ftyp,le,ce,le,ue)};te=function(e){return c(u.hdlr,fe[e])};$=function(e){return c(u.mdat,e)};ee=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,e.duration&255,85,196,0,0]);if(e.samplerate){t[12]=e.samplerate>>>24&255;t[13]=e.samplerate>>>16&255;t[14]=e.samplerate>>>8&255;t[15]=e.samplerate&255}return c(u.mdhd,t)};Z=function(e){return c(u.mdia,ee(e),te(e.type),G(e))};z=function(e){return c(u.mfhd,new Uint8Array([0,0,0,0,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255]))};G=function(e){return c(u.minf,e.type==="video"?c(u.vmhd,pe):c(u.smhd,me),q(),se(e))};K=function(e,t){var i=[],s=t.length;while(s--){i[s]=re(t[s])}return c.apply(null,[u.moof,z(e)].concat(i))};W=function(e){var t=e.length,i=[];while(t--){i[t]=Q(e[t])}return c.apply(null,[u.moov,X(4294967295)].concat(i).concat(Y(e)))};Y=function(e){var t=e.length,i=[];while(t--){i[t]=ae(e[t])}return c.apply(null,[u.mvex].concat(i))};X=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return c(u.mvhd,t)};ie=function(e){var t=e.samples||[],i=new Uint8Array(4+t.length),s,n;for(n=0;n>>8);s.push(t[r].byteLength&255);s=s.concat(Array.prototype.slice.call(t[r]))}for(r=0;r>>8);n.push(i[r].byteLength&255);n=n.concat(Array.prototype.slice.call(i[r]))}a=[u.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(e.width&65280)>>8,e.width&255,(e.height&65280)>>8,e.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c(u.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([t.length],s,[i.length],n))),c(u.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(e.sarRatio){var o=e.sarRatio[0],l=e.sarRatio[1];a.push(c(u.pasp,new Uint8Array([(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255])))}return c.apply(null,a)};i=function(e){return c(u.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(e.channelcount&65280)>>8,e.channelcount&255,(e.samplesize&65280)>>8,e.samplesize&255,0,0,0,0,(e.samplerate&65280)>>8,e.samplerate&255,0,0]),V(e))}})();J=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,0,(e.duration&4278190080)>>24,(e.duration&16711680)>>16,(e.duration&65280)>>8,e.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(e.width&65280)>>8,e.width&255,0,0,(e.height&65280)>>8,e.height&255,0,0]);return c(u.tkhd,t)};re=function(e){var t,i,s,n,r,a,o;t=c(u.tfhd,new Uint8Array([0,0,0,58,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));a=Math.floor(e.baseMediaDecodeTime/F);o=Math.floor(e.baseMediaDecodeTime%F);i=c(u.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,a&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255]));r=32+20+8+16+8+8;if(e.type==="audio"){s=oe(e,r);return c(u.traf,t,i,s)}n=ie(e);s=oe(e,n.length+r);return c(u.traf,t,i,s,n)};Q=function(e){e.duration=e.duration||4294967295;return c(u.trak,J(e),Z(e))};ae=function(e){var t=new Uint8Array([0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(e.type!=="video"){t[t.length-1]=0}return c(u.trex,t)};(function(){var i,s,l;l=function(e,t){var i=0,s=0,n=0,r=0;if(e.length){if(e[0].duration!==undefined){i=1}if(e[0].size!==undefined){s=2}if(e[0].flags!==undefined){n=4}if(e[0].compositionTimeOffset!==undefined){r=8}}return[0,0,i|s|n|r,1,(e.length&4278190080)>>>24,(e.length&16711680)>>>16,(e.length&65280)>>>8,e.length&255,(t&4278190080)>>>24,(t&16711680)>>>16,(t&65280)>>>8,t&255]};s=function(e,t){var i,s,n,r,a,o;r=e.samples||[];t+=8+12+16*r.length;n=l(r,t);s=new Uint8Array(n.length+r.length*16);s.set(n);i=n.length;for(o=0;o>>24;s[i++]=(a.duration&16711680)>>>16;s[i++]=(a.duration&65280)>>>8;s[i++]=a.duration&255;s[i++]=(a.size&4278190080)>>>24;s[i++]=(a.size&16711680)>>>16;s[i++]=(a.size&65280)>>>8;s[i++]=a.size&255;s[i++]=a.flags.isLeading<<2|a.flags.dependsOn;s[i++]=a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample;s[i++]=a.flags.degradationPriority&240<<8;s[i++]=a.flags.degradationPriority&15;s[i++]=(a.compositionTimeOffset&4278190080)>>>24;s[i++]=(a.compositionTimeOffset&16711680)>>>16;s[i++]=(a.compositionTimeOffset&65280)>>>8;s[i++]=a.compositionTimeOffset&255}return c(u.trun,s)};i=function(e,t){var i,s,n,r,a,o;r=e.samples||[];t+=8+12+8*r.length;n=l(r,t);i=new Uint8Array(n.length+r.length*8);i.set(n);s=n.length;for(o=0;o>>24;i[s++]=(a.duration&16711680)>>>16;i[s++]=(a.duration&65280)>>>8;i[s++]=a.duration&255;i[s++]=(a.size&4278190080)>>>24;i[s++]=(a.size&16711680)>>>16;i[s++]=(a.size&65280)>>>8;i[s++]=a.size&255}return c(u.trun,i)};oe=function(e,t){if(e.type==="audio"){return i(e,t)}return s(e,t)}})();var Te={ftyp:H,mdat:$,moof:K,moov:W,initSegment:function(e){var t=H(),i=W(e),s;s=new Uint8Array(t.byteLength+i.byteLength);s.set(t);s.set(i,t.byteLength);return s}};var Se=function(e){var t,i,s=[],n=[];n.byteLength=0;n.nalCount=0;n.duration=0;s.byteLength=0;for(t=0;t1){t=e.shift();e.byteLength-=t.byteLength;e.nalCount-=t.nalCount;e[0][0].dts=t.dts;e[0][0].pts=t.pts;e[0][0].duration+=t.duration}return e};var ke=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var je=function(e,t){var i=ke();i.dataOffset=t;i.compositionTimeOffset=e.pts-e.dts;i.duration=e.duration;i.size=4*e.length;i.size+=e.byteLength;if(e.keyFrame){i.flags.dependsOn=2;i.flags.isNonSyncSample=0}return i};var Ce=function(e,t){var i,s,n,r,a,o=t||0,l=[];for(i=0;ize.ONE_SECOND_IN_TS/2){return}c=$e()[e.samplerate];if(!c){c=t[0].data}for(u=0;u=i){return e}t.minSegmentDts=Infinity;return e.filter(function(e){if(e.dts>=i){t.minSegmentDts=Math.min(t.minSegmentDts,e.dts);t.minSegmentPts=t.minSegmentDts;return true}return false})};var Ye=function(e){var t,i,s=[];for(t=0;t=this.virtualRowCount&&typeof this.beforeRowOverflow==="function"){this.beforeRowOverflow(e)}if(this.rows.length>0){this.rows.push("");this.rowIdx++}while(this.rows.length>this.virtualRowCount){this.rows.shift();this.rowIdx--}};a.prototype.isEmpty=function(){if(this.rows.length===0){return true}else if(this.rows.length===1){return this.rows[0]===""}return false};a.prototype.addText=function(e){this.rows[this.rowIdx]+=e};a.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var mt=function(e,t,i){this.serviceNum=e;this.text="";this.currentWindow=new a(-1);this.windows=[];this.stream=i;if(typeof t==="string"){this.createTextDecoder(t)}};mt.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++){this.windows[i]=new a(i);if(typeof t==="function"){this.windows[i].beforeRowOverflow=t}}};mt.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]};mt.prototype.createTextDecoder=function(t){if(typeof TextDecoder==="undefined"){this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"})}else{try{this.textDecoder_=new TextDecoder(t)}catch(e){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+t+" encoding. "+e})}}};var o=function(e){e=e||{};o.prototype.init.call(this);var t=this;var i=e.captionServices||{};var s={};var n;Object.keys(i).forEach(e=>{n=i[e];if(/^SERVICE/.test(e)){s[e]=n.encoding}});this.serviceEncodings=s;this.current708Packet=null;this.services={};this.push=function(e){if(e.type===3){t.new708Packet();t.add708Bytes(e)}else{if(t.current708Packet===null){t.new708Packet()}t.add708Bytes(e)}}};o.prototype=new ut;o.prototype.new708Packet=function(){if(this.current708Packet!==null){this.push708Packet()}this.current708Packet={data:[],ptsVals:[]}};o.prototype.add708Bytes=function(e){var t=e.ccData;var i=t>>>8;var s=t&255;this.current708Packet.ptsVals.push(e.pts);this.current708Packet.data.push(i);this.current708Packet.data.push(s)};o.prototype.push708Packet=function(){var e=this.current708Packet;var t=e.data;var i=null;var s=null;var n=0;var r=t[n++];e.seq=r>>6;e.sizeCode=r&63;for(;n>5;s=r&31;if(i===7&&s>0){r=t[n++];i=r}this.pushServiceBlock(i,n,s);if(s>0){n+=s-1}}};o.prototype.pushServiceBlock=function(e,t,i){var s;var n=t;var r=this.current708Packet.data;var a=this.services[e];if(!a){a=this.initService(e,n)}for(;n{return("0"+(e&255).toString(16)).slice(-2)}).join("")}if(n){d=[o,l];e++}else{d=[o]}if(t.textDecoder_&&!s){u=t.textDecoder_.decode(new Uint8Array(d))}else{if(n){const f=h(d);u=String.fromCharCode(parseInt(f,16))}else{u=ft(a|o)}}if(c.pendingNewLine&&!c.isEmpty()){c.newLine(this.getPts(e))}c.pendingNewLine=false;c.addText(u);return e};o.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data;var s=i[e+1];var n=i[e+2];if(pt(s)&&pt(n)){e=this.handleText(++e,t,{isMultiByte:true})}return e};o.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=s&7;t.setCurrentWindow(n);return e};o.prototype.defineWindow=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=s&7;t.setCurrentWindow(n);var r=t.currentWindow;s=i[++e];r.visible=(s&32)>>5;r.rowLock=(s&16)>>4;r.columnLock=(s&8)>>3;r.priority=s&7;s=i[++e];r.relativePositioning=(s&128)>>7;r.anchorVertical=s&127;s=i[++e];r.anchorHorizontal=s;s=i[++e];r.anchorPoint=(s&240)>>4;r.rowCount=s&15;s=i[++e];r.columnCount=s&63;s=i[++e];r.windowStyle=(s&56)>>3;r.penStyle=s&7;r.virtualRowCount=r.rowCount+1;return e};o.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.winAttr;s=i[++e];n.fillOpacity=(s&192)>>6;n.fillRed=(s&48)>>4;n.fillGreen=(s&12)>>2;n.fillBlue=s&3;s=i[++e];n.borderType=(s&192)>>6;n.borderRed=(s&48)>>4;n.borderGreen=(s&12)>>2;n.borderBlue=s&3;s=i[++e];n.borderType+=(s&128)>>5;n.wordWrap=(s&64)>>6;n.printDirection=(s&48)>>4;n.scrollDirection=(s&12)>>2;n.justify=s&3;s=i[++e];n.effectSpeed=(s&240)>>4;n.effectDirection=(s&12)>>2;n.displayEffect=s&3;return e};o.prototype.flushDisplayed=function(e,t){var i=[];for(var s=0;s<8;s++){if(t.windows[s].visible&&!t.windows[s].isEmpty()){i.push(t.windows[s].getText())}}t.endPts=e;t.text=i.join("\n\n");this.pushCaption(t);t.startPts=e};o.prototype.pushCaption=function(e){if(e.text!==""){this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum});e.text="";e.startPts=e.endPts}};o.prototype.displayWindows=function(e,t){var i=this.current708Packet.data;var s=i[++e];var n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){if(s&1<>4;n.offset=(s&12)>>2;n.penSize=s&3;s=i[++e];n.italics=(s&128)>>7;n.underline=(s&64)>>6;n.edgeType=(s&56)>>3;n.fontStyle=s&7;return e};o.prototype.setPenColor=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.penColor;s=i[++e];n.fgOpacity=(s&192)>>6;n.fgRed=(s&48)>>4;n.fgGreen=(s&12)>>2;n.fgBlue=s&3;s=i[++e];n.bgOpacity=(s&192)>>6;n.bgRed=(s&48)>>4;n.bgGreen=(s&12)>>2;n.bgBlue=s&3;s=i[++e];n.edgeRed=(s&48)>>4;n.edgeGreen=(s&12)>>2;n.edgeBlue=s&3;return e};o.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data;var s=i[e];var n=t.currentWindow.penLoc;t.currentWindow.pendingNewLine=true;s=i[++e];n.row=s&15;s=i[++e];n.column=s&63;return e};o.prototype.reset=function(e,t){var i=this.getPts(e);this.flushDisplayed(i,t);return this.initService(t.serviceNum,e)};var gt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496};var vt=function(e){if(e===null){return""}e=gt[e]||e;return String.fromCharCode(e)};var yt=14;var bt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var d=function(){var e=[],t=yt+1;while(t--){e.push({text:"",indent:0,offset:0})}return e};var l=function(e,t){l.prototype.init.call(this);this.field_=e||0;this.dataChannel_=t||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,i,s,n,r;t=e.ccData&32639;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if((t&61440)===4096){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}s=t>>>8;n=t&255;if(t===this.PADDING_){return}else 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_){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=d()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=d()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(e.pts);this.displayed_=d()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(s,n)){s=(s&3)<<8;r=vt(s|n);this[this.mode_](e.pts,r);this.column_++}else if(this.isExtCharacter(s,n)){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}s=(s&3)<<8;r=vt(s|n);this[this.mode_](e.pts,r);this.column_++}else if(this.isMidRowCode(s,n)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if((n&14)===14){this.addFormatting(e.pts,["i"])}if((n&1)===1){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(s,n)){const o=n&3;this.nonDisplayed_[this.row_].offset=o;this.column_+=o}else if(this.isPAC(s,n)){var a=bt.indexOf(t&7968);if(this.mode_==="rollUp"){if(a-this.rollUpRows_+1<0){a=this.rollUpRows_-1}this.setRollUp(e.pts,a)}if(a!==this.row_){this.clearFormatting(e.pts);this.row_=a}if(n&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(e.pts,["u"])}if((t&16)===16){const l=(t&14)>>1;this.column_=l*4;this.nonDisplayed_[this.row_].indent+=l}if(this.isColorPAC(n)){if((n&14)===14){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(s)){if(n===0){n=null}r=vt(s);r+=vt(n);this[this.mode_](e.pts,r);this.column_+=r.length}}};l.prototype=new ut;l.prototype.flushDisplayed=function(e){const i=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})};const s=[];this.displayed_.forEach((e,t)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){i(t)}if(e.text.length){s.push({text:e.text,line:t+1,position:10+Math.min(70,e.indent*10)+e.offset*2.5})}}else if(e===undefined||e===null){i(t)}});if(s.length){this.trigger("data",{startPts:this.startPts_,endPts:e,content:s,stream:this.name_})}};l.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=d();this.nonDisplayed_=d();this.lastControlCode_=null;this.column_=0;this.row_=yt;this.rollUpRows_=2;this.formatting_=[]};l.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(this.dataChannel_===1){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=this.CONTROL_|32;this.END_OF_CAPTION_=this.CONTROL_|47;this.ROLL_UP_2_ROWS_=this.CONTROL_|37;this.ROLL_UP_3_ROWS_=this.CONTROL_|38;this.ROLL_UP_4_ROWS_=this.CONTROL_|39;this.CARRIAGE_RETURN_=this.CONTROL_|45;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41;this.BACKSPACE_=this.CONTROL_|33;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46};l.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63};l.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63};l.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47};l.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35};l.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127};l.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127};l.prototype.isNormalChar=function(e){return e>=32&&e<=127};l.prototype.setRollUp=function(e,t){if(this.mode_!=="rollUp"){this.row_=yt;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=d();this.displayed_=d()}if(t!==undefined&&t!==this.row_){for(var i=0;i"},"");this[this.mode_](e,i)};l.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[];this[this.mode_](e,t)};l.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t;this.nonDisplayed_[this.row_].text=i};l.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t;this.displayed_[this.row_].text=i};l.prototype.shiftRowsUp_=function(){var e;for(e=0;et){i=-1}while(Math.abs(t-e)>wt){e+=i*Et}return e};var Ct=function(e){var t,i;Ct.prototype.init.call(this);this.type_=e||kt;this.push=function(e){if(e.type==="metadata"){this.trigger("data",e);return}if(this.type_!==kt&&e.type!==this.type_){return}if(i===undefined){i=e.dts}e.dts=jt(e.dts,i);e.pts=jt(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")}};Ct.prototype=new St;var It={TimestampRolloverStream:Ct,handleRollover:jt};var xt=(e,t,i)=>{if(!e){return-1}var s=i;for(;s>>2;l*=4;l+=o[7]&3;n.timeStamp=l;if(t.pts===undefined&&t.dts===undefined){t.pts=n.timeStamp;t.dts=n.timeStamp}this.trigger("timestamp",n)}t.frames.push(n);i+=10;i+=s}while(i>>4>1){i+=e[i]+1}if(t.pid===0){t.type="pat";s(e.subarray(i),t);this.trigger("data",t)}else if(t.pid===this.pmtPid){t.type="pmt";s(e.subarray(i),t);this.trigger("data",t);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([e,i,t])}else{this.processPes_(e,i,t)}};this.processPes_=function(e,t,i){if(i.pid===this.programMapTable.video){i.streamType=v.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=v.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=e.subarray(t);this.trigger("data",i)}};y.prototype=new Ft;y.STREAM_TYPES={h264:27,adts:15};$t=function(){var c=this,t=false,s={data:[],size:0},n={data:[],size:0},r={data:[],size:0},a,u=function(e,t){var i;const s=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array;if(s!==1){return}t.packetLength=6+(e[4]<<8|e[5]);t.dataAlignmentIndicator=(e[6]&4)!==0;i=e[7];if(i&192){t.pts=(e[9]&14)<<27|(e[10]&255)<<20|(e[11]&254)<<12|(e[12]&255)<<5|(e[13]&254)>>>3;t.pts*=4;t.pts+=(e[13]&6)>>>1;t.dts=t.pts;if(i&64){t.dts=(e[14]&14)<<27|(e[15]&255)<<20|(e[16]&254)<<12|(e[17]&255)<<5|(e[18]&254)>>>3;t.dts*=4;t.dts+=(e[18]&6)>>>1}}t.data=e.subarray(9+e[8])},o=function(e,t,i){var s=new Uint8Array(e.size),n={type:t},r=0,a=0,o=false,l;if(!e.data.length||e.size<9){return}n.trackId=e.data[0].pid;for(r=0;r>5;r=((c[t+6]&3)+1)*1024;a=r*Xt/Jt[(c[t+2]&60)>>>2];if(c.byteLength-t>>6&3)+1,channelcount:(c[t+2]&1)<<2|(c[t+3]&192)>>>6,samplerate:Jt[(c[t+2]&60)>>>2],samplingfrequencyindex:(c[t+2]&60)>>>2,samplesize:16,data:c.subarray(t+7+s,t+i)});u++;t+=i}if(typeof o==="number"){this.skipWarn_(o,t);o=null}c=c.subarray(t)};this.flush=function(){u=0;this.trigger("done")};this.reset=function(){c=void 0;this.trigger("reset")};this.endTimeline=function(){c=void 0;this.trigger("endedtimeline")}};Qt.prototype=new Yt;var Zt=Qt;var ei;ei=function(s){var n=s.byteLength,r=0,a=0;this.length=function(){return 8*n};this.bitsAvailable=function(){return 8*n+a};this.loadWord=function(){var e=s.byteLength-n,t=new Uint8Array(4),i=Math.min(4,n);if(i===0){throw new Error("no bytes available")}t.set(s.subarray(e,e+i));r=new DataView(t.buffer).getUint32(0);a=i*8;n-=i};this.skipBits=function(e){var t;if(a>e){r<<=e;a-=e}else{e-=a;t=Math.floor(e/8);e-=t*8;n-=t;this.loadWord();r<<=e;a-=e}};this.readBits=function(e){var t=Math.min(a,e),i=r>>>32-t;a-=t;if(a>0){r<<=t}else if(n>0){this.loadWord()}t=e-t;if(t>0){return i<>>e)!==0){r<<=e;a-=e;return e}}this.loadWord();return e+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1};this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var ti=ei;var ii=t;var si=ti;var ni,_;var ri;_=function(){var s=0,n,r;_.prototype.init.call(this);this.push=function(e){var t;if(!r){r=e.data}else{t=new Uint8Array(r.byteLength+e.data.byteLength);t.set(r);t.set(e.data,r.byteLength);r=t}var i=r.byteLength;for(;s3){this.trigger("data",r.subarray(s+3))}r=null;s=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};_.prototype=new ii;ri={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};ni=function(){var t=new _,i,s,n,r,a,o,b;ni.prototype.init.call(this);i=this;this.push=function(e){if(e.type!=="video"){return}s=e.trackId;n=e.pts;r=e.dts;t.push(e)};t.on("data",function(e){var t={trackId:s,pts:n,dts:r,data:e,nalUnitTypeCode:e[0]&31};switch(t.nalUnitTypeCode){case 5:t.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:t.nalUnitType="sei_rbsp";t.escapedRBSP=a(e.subarray(1));break;case 7:t.nalUnitType="seq_parameter_set_rbsp";t.escapedRBSP=a(e.subarray(1));t.config=o(t.escapedRBSP);break;case 8:t.nalUnitType="pic_parameter_set_rbsp";break;case 9:t.nalUnitType="access_unit_delimiter_rbsp";break}i.trigger("data",t)});t.on("done",function(){i.trigger("done")});t.on("partialdone",function(){i.trigger("partialdone")});t.on("reset",function(){i.trigger("reset")});t.on("endedtimeline",function(){i.trigger("endedtimeline")});this.flush=function(){t.flush()};this.partialFlush=function(){t.partialFlush()};this.reset=function(){t.reset()};this.endTimeline=function(){t.endTimeline()};b=function(e,t){var i=8,s=8,n,r;for(n=0;n>4;i=i>=0?i:0;if(n){return i+20}return i+10};var ci=function(e,t){if(e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)){return t}t+=li(e,t);return ci(e,t)};var ui=function(e){var t=ci(e,0);return e.length>=t+2&&(e[t]&255)===255&&(e[t+1]&240)===240&&(e[t+1]&22)===16};var di=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]};var hi=function(e,t,i){var s,n="";for(s=t;s>5,s=e[t+4]<<3,n=e[t+3]&3<<11;return n|s|i};var mi=function(e,t){if(e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(e[t]&255===255&&(e[t+1]&240)===240){return"audio"}return null};var gi=function(e){var t=0;while(t+5>>2]}return null};var vi=function(e){var t,i,s,n;t=10;if(e[5]&64){t+=4;t+=di(e.subarray(10,14))}do{i=di(e.subarray(t+4,t+8));if(i<1){return null}n=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if(n==="PRIV"){s=e.subarray(t+10,t+i+10);for(var r=0;r>>2;l*=4;l+=o[7]&3;return l}break}}}t+=10;t+=i}while(t=3){if(o[i]==="I".charCodeAt(0)&&o[i+1]==="D".charCodeAt(0)&&o[i+2]==="3".charCodeAt(0)){if(o.length-i<10){break}t=_i.parseId3TagSize(o,i);if(i+t>o.length){break}n={type:"timed-metadata",data:o.subarray(i,i+t)};this.trigger("data",n);i+=t;continue}else if((o[i]&255)===255&&(o[i+1]&240)===240){if(o.length-i<7){break}t=_i.parseAdtsSize(o,i);if(i+t>o.length){break}r={type:"audio",data:o.subarray(i,i+t),pts:l,dts:l};this.trigger("data",r);i+=t;continue}i++}s=o.length-i;if(s>0){o=o.subarray(i)}else{o=new Uint8Array}};this.reset=function(){o=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){o=new Uint8Array;this.trigger("endedtimeline")}};Ti.prototype=new bi;var Si=Ti;var Ei=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var wi=Ei;var ki=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];var ji=ki;var Ci=t;var T=Te;var S=De;var Ii=Qe;var E=it;var w=Wt;var xi=r;var Ai=Zt;var Di=ai.H264Stream;var Oi=Si;var Pi=yi.isLikelyAacData;var Li=r.ONE_SECOND_IN_TS;var Ri=wi;var Ni=ji;var k,j,Mi,C;var Ui=function(e,t){t.stream=e;this.trigger("log",t)};var Bi=function(e,t){var i=Object.keys(t);for(var s=0;s=-i&&n<=t){if(!r||s>n){r=o;s=n}}}if(r){return r.gop}return null};this.alignGopsAtStart_=function(e){var t,i,s,n,r,a,o,l;r=e.byteLength;a=e.nalCount;o=e.duration;t=i=0;while(ts.pts){t++;continue}i++;r-=n.byteLength;a-=n.nalCount;o-=n.duration}if(i===0){return e}if(i===e.length){return null}l=e.slice(i);l.byteLength=r;l.duration=o;l.nalCount=a;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsAtEnd_=function(e){var t,i,s,n,r,a;t=p.length-1;i=e.length-1;r=null;a=false;while(t>=0&&i>=0){s=p[t];n=e[i];if(s.pts===n.pts){a=true;break}if(s.pts>n.pts){t--;continue}if(t===p.length-1){r=i}i--}if(!a&&r===null){return null}var o;if(a){o=i}else{o=r}if(o===0){return e}var l=e.slice(o);var c=l.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});l.byteLength=c.byteLength;l.duration=c.duration;l.nalCount=c.nalCount;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsWith=function(e){p=e}};k.prototype=new Ci;C=function(e,t){this.numberOfTracks=0;this.metadataStream=t;e=e||{};if(typeof e.remux!=="undefined"){this.remuxTracks=!!e.remux}else{this.remuxTracks=true}if(typeof e.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=e.keepOriginalTimestamps}else{this.keepOriginalTimestamps=false}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;C.prototype.init.call(this);this.push=function(e){if(e.content||e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBytes+=e.boxes.byteLength;if(e.track.type==="video"){this.videoTrack=e.track;this.pendingBoxes.push(e.boxes)}if(e.track.type==="audio"){this.audioTrack=e.track;this.pendingBoxes.unshift(e.boxes)}}};C.prototype=new Ci;C.prototype.flush=function(e){var t=0,i={captions:[],captionStreams:{},metadata:[],info:{}},s,n,r,a=0,o;if(this.pendingTracks.length=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){a=this.videoTrack.timelineStartInfo.pts;Ni.forEach(function(e){i.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){a=this.audioTrack.timelineStartInfo.pts;Ri.forEach(function(e){i.info[e]=this.audioTrack[e]},this)}if(this.videoTrack||this.audioTrack){if(this.pendingTracks.length===1){i.type=this.pendingTracks[0].type}else{i.type="combined"}this.emittedTracks+=this.pendingTracks.length;r=T.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(r.byteLength);i.initSegment.set(r);i.data=new Uint8Array(this.pendingBytes);for(o=0;o=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};C.prototype.setRemux=function(e){this.remuxTracks=e};Mi=function(s){var n=this,i=true,r,a;Mi.prototype.init.call(this);s=s||{};this.baseMediaDecodeTime=s.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t;t.type="aac";t.metadataStream=new w.MetadataStream;t.aacStream=new Oi;t.audioTimestampRolloverStream=new w.TimestampRolloverStream("audio");t.timedMetadataTimestampRolloverStream=new w.TimestampRolloverStream("timed-metadata");t.adtsStream=new Ai;t.coalesceStream=new C(s,t.metadataStream);t.headOfPipeline=t.aacStream;t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream);t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream);t.metadataStream.on("timestamp",function(e){t.aacStream.setTimestamp(e.timeStamp)});t.aacStream.on("data",function(e){if(e.type!=="timed-metadata"&&e.type!=="audio"||t.audioSegmentStream){return}a=a||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"};t.coalesceStream.numberOfTracks++;t.audioSegmentStream=new j(a,s);t.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream"));t.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo"));t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream);n.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!r})});t.coalesceStream.on("data",this.trigger.bind(this,"data"));t.coalesceStream.on("done",this.trigger.bind(this,"done"));Bi(this,t)};this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="ts";i.metadataStream=new w.MetadataStream;i.packetStream=new w.TransportPacketStream;i.parseStream=new w.TransportParseStream;i.elementaryStream=new w.ElementaryStream;i.timestampRolloverStream=new w.TimestampRolloverStream;i.adtsStream=new Ai;i.h264Stream=new Di;i.captionStream=new w.CaptionStream(s);i.coalesceStream=new C(s,i.metadataStream);i.headOfPipeline=i.packetStream;i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream);i.timestampRolloverStream.pipe(i.h264Stream);i.timestampRolloverStream.pipe(i.adtsStream);i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream);i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream);i.elementaryStream.on("data",function(e){var t;if(e.type==="metadata"){t=e.tracks.length;while(t--){if(!r&&e.tracks[t].type==="video"){r=e.tracks[t];r.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime}else if(!a&&e.tracks[t].type==="audio"){a=e.tracks[t];a.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime}}if(r&&!i.videoSegmentStream){i.coalesceStream.numberOfTracks++;i.videoSegmentStream=new k(r,s);i.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream"));i.videoSegmentStream.on("timelineStartInfo",function(e){if(a&&!s.keepOriginalTimestamps){a.timelineStartInfo=e;i.audioSegmentStream.setEarliestDts(e.dts-n.baseMediaDecodeTime)}});i.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo"));i.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo"));i.videoSegmentStream.on("baseMediaDecodeTime",function(e){if(a){i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}});i.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo"));i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)}if(a&&!i.audioSegmentStream){i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new j(a,s);i.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo"));i.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)}n.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!r})}});i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("id3Frame",function(e){e.dispatchType=i.metadataStream.dispatchType;n.trigger("id3Frame",e)});i.coalesceStream.on("caption",this.trigger.bind(this,"caption"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));Bi(this,i)};this.setBaseMediaDecodeTime=function(e){var t=this.transmuxPipeline_;if(!s.keepOriginalTimestamps){this.baseMediaDecodeTime=e}if(a){a.timelineStartInfo.dts=undefined;a.timelineStartInfo.pts=undefined;E.clearDtsInfo(a);if(t.audioTimestampRolloverStream){t.audioTimestampRolloverStream.discontinuity()}}if(r){if(t.videoSegmentStream){t.videoSegmentStream.gopCache_=[]}r.timelineStartInfo.dts=undefined;r.timelineStartInfo.pts=undefined;E.clearDtsInfo(r);t.captionStream.reset()}if(t.timestampRolloverStream){t.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(a){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.setRemux=function(e){var t=this.transmuxPipeline_;s.remux=e;if(t&&t.coalesceStream){t.coalesceStream.setRemux(e)}};this.alignGopsWith=function(e){if(r&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.getLogTrigger_=function(t){var i=this;return function(e){e.stream=t;i.trigger("log",e)}};this.push=function(e){if(i){var t=Pi(e);if(t&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!t&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}i=false}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){i=true;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};Mi.prototype=new Ci;var Vi={Transmuxer:Mi,VideoSegmentStream:k,AudioSegmentStream:j,AUDIO_PROPERTIES:Ri,VIDEO_PROPERTIES:Ni,generateSegmentTimingInfo:qi};var Hi=function(e){return e>>>0};var $i=function(e){return("00"+e.toString(16)).slice(-2)};var zi={toUnsigned:Hi,toHexString:$i};var Gi=function(e){var t="";t+=String.fromCharCode(e[0]);t+=String.fromCharCode(e[1]);t+=String.fromCharCode(e[2]);t+=String.fromCharCode(e[3]);return t};var Ki=Gi;var Wi=zi.toUnsigned;var Yi=Ki;var Xi=function(e,t){var i=[],s,n,r,a,o;if(!t.length){return null}for(s=0;s1?s+n:e.byteLength;if(r===t[0]){if(t.length===1){i.push(e.subarray(s+8,a))}else{o=Xi(e.subarray(s+8,a),t.slice(1));if(o.length){i=i.concat(o)}}}s=a}return i};var Qi=Xi;var Ji=zi.toUnsigned;var Zi=B.getUint64;var es=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};if(t.version===1){t.baseMediaDecodeTime=Zi(e.subarray(4))}else{t.baseMediaDecodeTime=Ji(e[4]<<24|e[5]<<16|e[6]<<8|e[7])}return t};var ts=es;var is=function(e){return{isLeading:(e[0]&12)>>>2,dependsOn:e[0]&3,isDependedOn:(e[1]&192)>>>6,hasRedundancy:(e[1]&48)>>>4,paddingValue:(e[1]&14)>>>1,isNonSyncSample:e[1]&1,degradationPriority:e[2]<<8|e[3]}};var ss=is;var ns=ss;var rs=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),s=t.flags[2]&1,n=t.flags[2]&4,r=t.flags[1]&1,a=t.flags[1]&2,o=t.flags[1]&4,l=t.flags[1]&8,c=i.getUint32(4),u=8,d;if(s){t.dataOffset=i.getInt32(u);u+=4}if(n&&c){d={flags:ns(e.subarray(u,u+4))};u+=4;if(r){d.duration=i.getUint32(u);u+=4}if(a){d.size=i.getUint32(u);u+=4}if(l){if(t.version===1){d.compositionTimeOffset=i.getInt32(u)}else{d.compositionTimeOffset=i.getUint32(u)}u+=4}t.samples.push(d);c--}while(c--){d={};if(r){d.duration=i.getUint32(u);u+=4}if(a){d.size=i.getUint32(u);u+=4}if(o){d.flags=ns(e.subarray(u,u+4));u+=4}if(l){if(t.version===1){d.compositionTimeOffset=i.getInt32(u)}else{d.compositionTimeOffset=i.getUint32(u)}u+=4}t.samples.push(d)}return t};var as=rs;var os=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},s=i.flags[2]&1,n=i.flags[2]&2,r=i.flags[2]&8,a=i.flags[2]&16,o=i.flags[2]&32,l=i.flags[0]&65536,c=i.flags[0]&131072,u;u=8;if(s){u+=4;i.baseDataOffset=t.getUint32(12);u+=4}if(n){i.sampleDescriptionIndex=t.getUint32(u);u+=4}if(r){i.defaultSampleDuration=t.getUint32(u);u+=4}if(a){i.defaultSampleSize=t.getUint32(u);u+=4}if(o){i.defaultSampleFlags=t.getUint32(u)}if(l){i.durationIsEmpty=true}if(!s&&c){i.baseDataOffsetIsMoof=true}return i};var ls=os;var I;if(typeof tv!=="undefined"){I=tv}else if(typeof N!=="undefined"){I=N}else if(typeof self!=="undefined"){I=self}else{I={}}var cs=I;var us=ct.discardEmulationPreventionBytes;var ds=_t.CaptionStream;var hs=Qi;var fs=ts;var ps=as;var ms=ls;var gs=cs;var vs=function(e,t){var i=e;for(var s=0;s0?fs(a[0]).baseMediaDecodeTime:0;var l=hs(i,["trun"]);var c;var u;if(d===r&&l.length>0){c=bs(l,o,n);u=ys(t,c,r);if(!h[r]){h[r]={seiNals:[],logs:[]}}h[r].seiNals=h[r].seiNals.concat(u.seiNals);h[r].logs=h[r].logs.concat(u.logs)}});return h};var Ts=function(e,t,i){var s;if(t===null){return null}s=_s(e,t);var n=s[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}};var Ss=function(){var t=false;var i;var r;var a;var o;var l;var s;this.isInitialized=function(){return t};this.init=function(e){i=new ds;t=true;s=e?e.isPartial:false;i.on("data",function(e){e.startTime=e.startPts/o;e.endTime=e.endPts/o;l.captions.push(e);l.captionStreams[e.stream]=true});i.on("log",function(e){l.logs.push(e)})};this.isNewInit=function(e,t){if(e&&e.length===0||t&&typeof t==="object"&&Object.keys(t).length===0){return false}return a!==e[0]||o!==t[a]};this.parse=function(e,t,i){var s;if(!this.isInitialized()){return null}else if(!t||!i){return null}else if(this.isNewInit(t,i)){a=t[0];o=i[a]}else if(a===null||!o){r.push(e);return null}while(r.length>0){var n=r.shift();this.parse(n,t,i)}s=Ts(e,a,o);if(s&&s.logs){l.logs=l.logs.concat(s.logs)}if(s===null||!s.seiNals){if(l.logs.length){return{logs:l.logs,captions:[],captionStreams:[]}}return null}this.pushNals(s.seiNals);this.flushStream();return l};this.pushNals=function(e){if(!this.isInitialized()||!e||e.length===0){return null}e.forEach(function(e){i.push(e)})};this.flushStream=function(){if(!this.isInitialized()){return null}if(!s){i.flush()}else{i.partialFlush()}};this.clearParsedCaptions=function(){l.captions=[];l.captionStreams={};l.logs=[]};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}i.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){r=[];a=null;o=null;if(!l){l={captions:[],captionStreams:{},logs:[]}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var Es=Ss;var ws=function(e){var t=0;var i=String.fromCharCode(e[t]);var s="";while(i!=="\0"){s+=i;t++;i=String.fromCharCode(e[t])}s+=i;return s};var ks={uint8ToCString:ws};var js=ks.uint8ToCString;var Cs=B.getUint64;var Is=function(e){var t=4;var i=e[0];var s,n,r,a,o,l,c,u;if(i===0){s=js(e.subarray(t));t+=s.length;n=js(e.subarray(t));t+=n.length;var d=new DataView(e.buffer);r=d.getUint32(t);t+=4;o=d.getUint32(t);t+=4;l=d.getUint32(t);t+=4;c=d.getUint32(t);t+=4}else if(i===1){var d=new DataView(e.buffer);r=d.getUint32(t);t+=4;a=Cs(e.subarray(t));t+=8;l=d.getUint32(t);t+=4;c=d.getUint32(t);t+=4;s=js(e.subarray(t));t+=s.length;n=js(e.subarray(t));t+=n.length}u=new Uint8Array(e.subarray(t,e.byteLength));var h={scheme_id_uri:s,value:n,timescale:r?r:1,presentation_time:a,presentation_time_delta:o,event_duration:l,id:c,message_data:u};return As(i,h)?h:undefined};var xs=function(e,t,i,s){return e||e===0?e/t:s+i/t};var As=function(e,t){var i=t.scheme_id_uri!=="\0";var s=e===0&&Ds(t.presentation_time_delta)&&i;var n=e===1&&Ds(t.presentation_time)&&i;return!(e>1)&&s||n};var Ds=function(e){return e!==undefined||e!==null};var Os={parseEmsgBox:Is,scaleTime:xs};var Ps=zi.toUnsigned;var Ls=zi.toHexString;var x=Qi;var A=Ki;var Rs=Os;var Ns=ls;var Ms=as;var Us=ts;var Bs=B.getUint64;var Fs,qs,Vs,Hs,$s,zs,Gs;var Ks=cs;var Ws=Rt.parseId3Frames;Fs=function(e){var t={},i=x(e,["moov","trak"]);return i.reduce(function(e,t){var i,s,n,r,a;i=x(t,["tkhd"])[0];if(!i){return null}s=i[0];n=s===0?12:20;r=Ps(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]);a=x(t,["mdia","mdhd"])[0];if(!a){return null}s=a[0];n=s===0?12:20;e[r]=Ps(a[n]<<24|a[n+1]<<16|a[n+2]<<8|a[n+3]);return e},t)};qs=function(c,e){var t;t=x(e,["moof","traf"]);var i=t.reduce(function(e,t){var i=x(t,["tfhd"])[0];var s=Ps(i[4]<<24|i[5]<<16|i[6]<<8|i[7]);var n=c[s]||9e4;var r=x(t,["tfdt"])[0];var a=new DataView(r.buffer,r.byteOffset,r.byteLength);var o;if(r[0]===1){o=Bs(r.subarray(4,12))}else{o=a.getUint32(4)}let l;if(typeof o==="bigint"){l=o/Ks.BigInt(n)}else if(typeof o==="number"&&!isNaN(o)){l=o/n}if(l11){t.codec+=".";t.codec+=Ls(u[9]);t.codec+=Ls(u[10]);t.codec+=Ls(u[11])}else{t.codec="avc1.4d400d"}}else if(/^mp4[a,v]$/i.test(t.codec)){u=c.subarray(28);d=A(u.subarray(4,8));if(d==="esds"&&u.length>20&&u[19]!==0){t.codec+="."+Ls(u[19]);t.codec+="."+Ls(u[20]>>>2&63).replace(/^0/,"")}else{t.codec="mp4a.40.2"}}else{t.codec=t.codec.toLowerCase()}}}var h=x(e,["mdia","mdhd"])[0];if(h){t.timescale=zs(h)}f.push(t)});return f};Gs=function(e,s=0){var t=x(e,["emsg"]);return t.map(e=>{var t=Rs.parseEmsgBox(new Uint8Array(e));var i=Ws(t.message_data);return{cueTime:Rs.scaleTime(t.presentation_time,t.timescale,t.presentation_time_delta,s),duration:Rs.scaleTime(t.event_duration,t.timescale),frames:i}})};var Ys={findBox:x,parseType:A,timescale:Fs,startTime:qs,compositionStartTime:Vs,videoTrackIds:Hs,tracks:$s,getTimescaleFromMediaHeader:zs,getEmsgID3:Gs};var Xs=Tt;var Qs=function(e){var t=e[1]&31;t<<=8;t|=e[2];return t};var Js=function(e){return!!(e[1]&64)};var Zs=function(e){var t=0;if((e[3]&48)>>>4>1){t+=e[4]+1}return t};var en=function(e,t){var i=Qs(e);if(i===0){return"pat"}else if(i===t){return"pmt"}else if(t){return"pes"}return null};var tn=function(e){var t=Js(e);var i=4+Zs(e);if(t){i+=e[i]+1}return(e[i+10]&31)<<8|e[i+11]};var sn=function(e){var t={};var i=Js(e);var s=4+Zs(e);if(i){s+=e[s]+1}if(!(e[s+5]&1)){return}var n,r,a;n=(e[s+1]&15)<<8|e[s+2];r=3+n-4;a=(e[s+10]&15)<<8|e[s+11];var o=12+a;while(o=e.byteLength){return null}var s=null;var n;n=e[i+7];if(n&192){s={};s.pts=(e[i+9]&14)<<27|(e[i+10]&255)<<20|(e[i+11]&254)<<12|(e[i+12]&255)<<5|(e[i+13]&254)>>>3;s.pts*=4;s.pts+=(e[i+13]&6)>>>1;s.dts=s.pts;if(n&64){s.dts=(e[i+14]&14)<<27|(e[i+15]&255)<<20|(e[i+16]&254)<<12|(e[i+17]&255)<<5|(e[i+18]&254)>>>3;s.dts*=4;s.dts+=(e[i+18]&6)>>>1}}return s};var an=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}};var on=function(e){var t=4+Zs(e);var i=e.subarray(t);var s=0;var n=0;var r=false;var a;for(;n3){a=an(i[n+3]&31);if(a==="slice_layer_without_partitioning_rbsp_idr"){r=true}}return r};var ln={parseType:en,parsePat:tn,parsePmt:sn,parsePayloadUnitStartIndicator:Js,parsePesType:nn,parsePesTime:rn,videoPacketContainsKeyFrame:on};var cn=Tt;var D=It.handleRollover;var O={};O.ts=ln;O.aac=yi;var P=r.ONE_SECOND_IN_TS;var L=188,R=71;var un=function(e,t){var i=0,s=L,n,r;while(s=0){if(e[s]===R&&(e[n]===R||n===e.byteLength)){r=e.subarray(s,n);a=O.ts.parseType(r,t.pid);switch(a){case"pes":o=O.ts.parsePesType(r,t.table);l=O.ts.parsePayloadUnitStartIndicator(r);if(o==="audio"&&l){c=O.ts.parsePesTime(r);if(c){c.type="audio";i.audio.push(c);u=true}}break}if(u){break}s-=L;n-=L;continue}s--;n--}};var hn=function(e,t,i){var s=0,n=L,r,a,o,l,c,u,d,h;var f=false;var p={data:[],size:0};while(n=0){if(e[s]===R&&e[n]===R){r=e.subarray(s,n);a=O.ts.parseType(r,t.pid);switch(a){case"pes":o=O.ts.parsePesType(r,t.table);l=O.ts.parsePayloadUnitStartIndicator(r);if(o==="video"&&l){c=O.ts.parsePesTime(r);if(c){c.type="video";i.video.push(c);f=true}}break}if(f){break}s-=L;n-=L;continue}s--;n--}};var fn=function(e,t){if(e.audio&&e.audio.length){var i=t;if(typeof i==="undefined"||isNaN(i)){i=e.audio[0].dts}e.audio.forEach(function(e){e.dts=D(e.dts,i);e.pts=D(e.pts,i);e.dtsTime=e.dts/P;e.ptsTime=e.pts/P})}if(e.video&&e.video.length){var s=t;if(typeof s==="undefined"||isNaN(s)){s=e.video[0].dts}e.video.forEach(function(e){e.dts=D(e.dts,s);e.pts=D(e.pts,s);e.dtsTime=e.dts/P;e.ptsTime=e.pts/P});if(e.firstKeyFrame){var n=e.firstKeyFrame;n.dts=D(n.dts,s);n.pts=D(n.pts,s);n.dtsTime=n.dts/P;n.ptsTime=n.pts/P}}};var pn=function(e){var t=false,i=0,s=null,n=null,r=0,a=0,o;while(e.length-a>=3){var l=O.aac.parseType(e,a);switch(l){case"timed-metadata":if(e.length-a<10){t=true;break}r=O.aac.parseId3TagSize(e,a);if(r>e.length){t=true;break}if(n===null){o=e.subarray(a,a+r);n=O.aac.parseAacTimestamp(o)}a+=r;break;case"audio":if(e.length-a<7){t=true;break}r=O.aac.parseAdtsSize(e,a);if(r>e.length){t=true;break}if(s===null){o=e.subarray(a,a+r);s=O.aac.parseSampleRate(o)}i++;a+=r;break;default:a++;break}if(t){return null}}if(s===null||n===null){return null}var c=P/s;var u={audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+i*1024*c,pts:n+i*1024*c}]};return u};var mn=function(e){var t={pid:null,table:null};var i={};un(e,t);for(var s in t.table){if(t.table.hasOwnProperty(s)){var n=t.table[s];switch(n){case cn.H264_STREAM_TYPE:i.video=[];hn(e,t,i);if(i.video.length===0){delete i.video}break;case cn.ADTS_STREAM_TYPE:i.audio=[];dn(e,t,i);if(i.audio.length===0){delete i.audio}break}}}return i};var gn=function(e,t){var i=O.aac.isLikelyAacData(e);var s;if(i){s=pn(e)}else{s=mn(e)}if(!s||!s.audio&&!s.video){return null}fn(s,t);return s};var vn={inspect:gn,parseAudioPes_:dn};const yn=function(s,e){e.on("data",function(e){const t=e.initSegment;e.initSegment={data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength};const i=e.data;e.data=i.buffer;s.postMessage({action:"data",segment:e,byteOffset:i.byteOffset,byteLength:i.byteLength},[e.data])});e.on("done",function(e){s.postMessage({action:"done"})});e.on("gopInfo",function(e){s.postMessage({action:"gopInfo",gopInfo:e})});e.on("videoSegmentTimingInfo",function(e){const t={start:{decode:r.videoTsToSeconds(e.start.dts),presentation:r.videoTsToSeconds(e.start.pts)},end:{decode:r.videoTsToSeconds(e.end.dts),presentation:r.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:r.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){t.prependedContentDuration=r.videoTsToSeconds(e.prependedContentDuration)}s.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})});e.on("audioSegmentTimingInfo",function(e){const t={start:{decode:r.videoTsToSeconds(e.start.dts),presentation:r.videoTsToSeconds(e.start.pts)},end:{decode:r.videoTsToSeconds(e.end.dts),presentation:r.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:r.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){t.prependedContentDuration=r.videoTsToSeconds(e.prependedContentDuration)}s.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:t})});e.on("id3Frame",function(e){s.postMessage({action:"id3Frame",id3Frame:e})});e.on("caption",function(e){s.postMessage({action:"caption",caption:e})});e.on("trackinfo",function(e){s.postMessage({action:"trackinfo",trackInfo:e})});e.on("audioTimingInfo",function(e){s.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:r.videoTsToSeconds(e.start),end:r.videoTsToSeconds(e.end)}})});e.on("videoTimingInfo",function(e){s.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:r.videoTsToSeconds(e.start),end:r.videoTsToSeconds(e.end)}})});e.on("log",function(e){s.postMessage({action:"log",log:e})})};class bn{constructor(e,t){this.options=t||{};this.self=e;this.init()}init(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new Vi.Transmuxer(this.options);yn(this.self,this.transmuxer)}pushMp4Captions(e){if(!this.captionParser){this.captionParser=new Es;this.captionParser.init()}const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);const i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Ys.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Ys.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=Ys.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i=typeof t==="number"&&!isNaN(t)?t*r.ONE_SECOND_IN_TS:void 0;const s=vn.inspect(e,i);let n=null;if(s){n={hasVideo:s.video&&s.video.length===2||false,hasAudio:s.audio&&s.audio.length===2||false};if(n.hasVideo){n.videoStart=s.video[0].ptsTime}if(n.hasAudio){n.audioStart=s.audio[0].ptsTime}}this.self.postMessage({action:"probeTs",result:n,data:e},[e.buffer])}clearAllMp4Captions(){if(this.captionParser){this.captionParser.clearAllCaptions()}}clearParsedMp4Captions(){if(this.captionParser){this.captionParser.clearParsedCaptions()}}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(r.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(r.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush();self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline();self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){if(e.data.action==="init"&&e.data.options){this.messageHandlers=new bn(self,e.data.options);return}if(!this.messageHandlers){this.messageHandlers=new bn(self)}if(e.data&&e.data.action&&e.data.action!=="init"){if(this.messageHandlers[e.data.action]){this.messageHandlers[e.data.action](e.data)}}}}));var tp=Qf(ep);const ip=(e,t,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:c}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const u=e.data.segment.boxes||{data:e.data.segment.data};const d={type:s,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};if(typeof l!=="undefined"){d.videoFrameDtsTime=l}if(typeof c!=="undefined"){d.videoFramePtsTime=c}i(d)};const sp=({transmuxedData:e,callback:t})=>{e.buffer=[];t(e)};const np=(e,t)=>{t.gopInfo=e.data.gopInfo};const rp=t=>{const{transmuxer:i,bytes:e,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:c,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:d,onId3:h,onCaptions:f,onDone:p,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:v}=t;const y={buffer:[]};let b=v;const _=e=>{if(i.currentTransmux!==t){return}if(e.data.action==="data"){ip(e,y,a)}if(e.data.action==="trackinfo"){o(e.data.trackInfo)}if(e.data.action==="gopInfo"){np(e,y)}if(e.data.action==="audioTimingInfo"){l(e.data.audioTimingInfo)}if(e.data.action==="videoTimingInfo"){c(e.data.videoTimingInfo)}if(e.data.action==="videoSegmentTimingInfo"){u(e.data.videoSegmentTimingInfo)}if(e.data.action==="audioSegmentTimingInfo"){d(e.data.audioSegmentTimingInfo)}if(e.data.action==="id3Frame"){h([e.data.id3Frame],e.data.id3Frame.dispatchType)}if(e.data.action==="caption"){f(e.data.caption)}if(e.data.action==="endedtimeline"){b=false;m()}if(e.data.action==="log"){g(e.data.log)}if(e.data.type!=="transmuxed"){return}if(b){return}i.onmessage=null;sp({transmuxedData:y,callback:p});ap(i)};i.onmessage=_;if(s){i.postMessage({action:"setAudioAppendStart",appendStart:s})}if(Array.isArray(n)){i.postMessage({action:"alignGopsWith",gopsToAlignWith:n})}if(typeof r!=="undefined"){i.postMessage({action:"setRemux",remux:r})}if(e.byteLength){const T=e instanceof ArrayBuffer?e:e.buffer;const S=e instanceof ArrayBuffer?0:e.byteOffset;i.postMessage({action:"push",data:T,byteOffset:S,byteLength:e.byteLength},[T])}if(v){i.postMessage({action:"endTimeline"})}i.postMessage({action:"flush"})};const ap=e=>{e.currentTransmux=null;if(e.transmuxQueue.length){e.currentTransmux=e.transmuxQueue.shift();if(typeof e.currentTransmux==="function"){e.currentTransmux()}else{rp(e.currentTransmux)}}};const op=(e,t)=>{e.postMessage({action:t});ap(e)};const lp=(e,t)=>{if(!t.currentTransmux){t.currentTransmux=e;op(t,e);return}t.transmuxQueue.push(op.bind(null,t,e))};const cp=e=>{lp("reset",e)};const up=e=>{lp("endTimeline",e)};const dp=e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e;rp(e);return}e.transmuxer.transmuxQueue.push(e)};const hp=e=>{const t=new tp;t.currentTransmux=null;t.transmuxQueue=[];const i=t.terminate;t.terminate=()=>{t.currentTransmux=null;t.transmuxQueue.length=0;return i.call(t)};t.postMessage({action:"init",options:e});return t};var fp={reset:cp,endTimeline:up,transmux:dp,createTransmuxer:hp};const pp=function(t){const i=t.transmuxer;const s=t.endAction||t.action;const n=t.callback;const e=Ni({},t,{endAction:null,transmuxer:null,callback:null});const r=e=>{if(e.data.action!==s){return}i.removeEventListener("message",r);if(e.data.data){e.data.data=new Uint8Array(e.data.data,t.byteOffset||0,t.byteLength||e.data.data.byteLength);if(t.data){t.data=e.data.data}}n(e.data)};i.addEventListener("message",r);if(t.data){const a=t.data instanceof ArrayBuffer;e.byteOffset=a?0:t.data.byteOffset;e.byteLength=t.data.byteLength;const o=[a?t.data:t.data.buffer];i.postMessage(e,o)}else{i.postMessage(e)}};const mp={FAILURE:2,TIMEOUT:-101,ABORTED:-102};const gp=e=>{e.forEach(e=>{e.abort()})};const vp=e=>{return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}};const yp=e=>{const t=e.target;const i=Date.now()-t.requestTime;const s={bandwidth:Infinity,bytesReceived:0,roundTripTime:i||0};s.bytesReceived=e.loaded;s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3);return s};const bp=(e,t)=>{if(t.timedout){return{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:mp.TIMEOUT,xhr:t}}if(t.aborted){return{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:mp.ABORTED,xhr:t}}if(e){return{status:t.status,message:"HLS request errored at URL: "+t.uri,code:mp.FAILURE,xhr:t}}if(t.responseType==="arraybuffer"&&t.response.byteLength===0){return{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:mp.FAILURE,xhr:t}}return null};const _p=(a,o,l)=>(e,t)=>{const i=t.response;const s=bp(e,t);if(s){return l(s,a)}if(i.byteLength!==16){return l({status:t.status,message:"Invalid HLS key at URL: "+t.uri,code:mp.FAILURE,xhr:t},a)}const n=new DataView(i);const r=new Uint32Array([n.getUint32(0),n.getUint32(4),n.getUint32(8),n.getUint32(12)]);for(let e=0;e{const e=Hd(i.map.bytes);if(e!=="mp4"){const t=i.map.resolvedUri||i.map.uri;return s({internal:true,message:`Found unsupported ${e||"unknown"} container for initialization segment at URL: ${t}`,code:mp.FAILURE})}pp({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:e,data:t})=>{i.map.bytes=t;e.forEach(function(e){i.map.tracks=i.map.tracks||{};if(i.map.tracks[e.type]){return}i.map.tracks[e.type]=e;if(typeof e.id==="number"&&e.timescale){i.map.timescales=i.map.timescales||{};i.map.timescales[e.id]=e.timescale}});return s(null)}})};const Sp=({segment:n,finishProcessingFn:r})=>(e,t)=>{const i=bp(e,t);if(i){return r(i,n)}const s=new Uint8Array(t.response);if(n.map.key){n.map.encryptedBytes=s;return r(null,n)}n.map.bytes=s;Tp(n,function(e){if(e){e.xhr=t;e.status=t.status;return r(e,n)}r(null,n)})};const Ep=({segment:n,finishProcessingFn:r,responseType:a})=>(e,t)=>{const i=bp(e,t);if(i){return r(i,n)}const s=a==="arraybuffer"||!t.responseText?t.response:Wf(t.responseText.substring(n.lastReachedChar||0));n.stats=vp(t);if(n.key){n.encryptedBytes=new Uint8Array(s)}else{n.bytes=new Uint8Array(s)}return r(null,n)};const wp=({segment:i,bytes:s,trackInfoFn:n,timingInfoFn:e,videoSegmentTimingInfoFn:t,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h})=>{const f=i.map&&i.map.tracks||{};const p=Boolean(f.audio&&f.video);let m=e.bind(null,i,"audio","start");const g=e.bind(null,i,"audio","end");let v=e.bind(null,i,"video","start");const y=e.bind(null,i,"video","end");const b=()=>dp({bytes:s,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:p,onData:e=>{e.type=e.type==="combined"?"video":e.type;u(i,e)},onTrackInfo:e=>{if(n){if(p){e.isMuxed=true}n(i,e)}},onAudioTimingInfo:e=>{if(m&&typeof e.start!=="undefined"){m(e.start);m=null}if(g&&typeof e.end!=="undefined"){g(e.end)}},onVideoTimingInfo:e=>{if(v&&typeof e.start!=="undefined"){v(e.start);v=null}if(y&&typeof e.end!=="undefined"){y(e.end)}},onVideoSegmentTimingInfo:e=>{t(e)},onAudioSegmentTimingInfo:e=>{r(e)},onId3:(e,t)=>{a(i,e,t)},onCaptions:e=>{o(i,[e])},isEndOfTimeline:l,onEndedTimeline:()=>{c()},onTransmuxerLog:h,onDone:e=>{if(!d){return}e.type=e.type==="combined"?"video":e.type;d(null,i,e)}});pp({action:"probeTs",transmuxer:i.transmuxer,data:s,baseStartTime:i.baseStartTime,callback:e=>{i.bytes=s=e.data;const t=e.result;if(t){n(i,{hasAudio:t.hasAudio,hasVideo:t.hasVideo,isMuxed:p});n=null}b()}})};const kp=({segment:i,bytes:s,trackInfoFn:e,timingInfoFn:n,videoSegmentTimingInfoFn:t,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h})=>{let f=new Uint8Array(s);if($d(f)){i.isFmp4=true;const{tracks:p}=i.map;const m={isFmp4:true,hasVideo:!!p.video,hasAudio:!!p.audio};if(p.audio&&p.audio.codec&&p.audio.codec!=="enca"){m.audioCodec=p.audio.codec}if(p.video&&p.video.codec&&p.video.codec!=="encv"){m.videoCodec=p.video.codec}if(p.video&&p.audio){m.isMuxed=true}e(i,m);const g=(e,t)=>{u(i,{data:f,type:m.hasAudio&&!m.isMuxed?"audio":"video"});if(t&&t.length){a(i,t)}if(e&&e.length){o(i,e)}d(null,i,{})};pp({action:"probeMp4StartTime",timescales:i.map.timescales,data:f,transmuxer:i.transmuxer,callback:({data:e,startTime:t})=>{s=e.buffer;i.bytes=f=e;if(m.hasAudio&&!m.isMuxed){n(i,"audio","start",t)}if(m.hasVideo){n(i,"video","start",t)}pp({action:"probeEmsgID3",data:f,transmuxer:i.transmuxer,offset:t,callback:({emsgData:e,id3Frames:t})=>{s=e.buffer;i.bytes=f=e;if(!p.video||!e.byteLength||!i.transmuxer){g(undefined,t);return}pp({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:f,timescales:i.map.timescales,trackIds:[p.video.id],callback:e=>{s=e.data.buffer;i.bytes=f=e.data;e.logs.forEach(function(e){h(L(e,{stream:"mp4CaptionParser"}))});g(e.captions,t)}})}})}});return}if(!i.transmuxer){d(null,i,{});return}if(typeof i.container==="undefined"){i.container=Hd(f)}if(i.container!=="ts"&&i.container!=="aac"){e(i,{hasAudio:false,hasVideo:false});d(null,i,{});return}wp({segment:i,bytes:s,trackInfoFn:e,timingInfoFn:n,videoSegmentTimingInfoFn:t,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h})};const jp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s},n){const r=e=>{if(e.data.source===i){s.removeEventListener("message",r);const t=e.data.decrypted;n(new Uint8Array(t.bytes,t.byteOffset,t.byteLength))}};s.addEventListener("message",r);let a;if(e.bytes.slice){a=e.bytes.slice()}else{a=new Uint32Array(Array.prototype.slice.call(e.bytes))}s.postMessage(_f({source:i,encrypted:t,key:a,iv:e.iv}),[t.buffer,a.buffer])};const Cp=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h})=>{jp({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},e=>{t.bytes=e;kp({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:d,onTransmuxerLog:h})})};const Ip=({activeXhrs:s,decryptionWorker:n,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m})=>{let g=0;let v=false;return(e,t)=>{if(v){return}if(e){v=true;gp(s);return p(e,t)}g+=1;if(g===s.length){const i=function(){if(t.encryptedBytes){return Cp({decryptionWorker:n,segment:t,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m})}kp({segment:t,bytes:t.bytes,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:u,isEndOfTimeline:d,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m})};t.endOfAllRequests=Date.now();if(t.map&&t.map.encryptedBytes&&!t.map.bytes){return jp({decryptionWorker:n,id:t.requestId+"-init",encryptedBytes:t.map.encryptedBytes,key:t.map.key},e=>{t.map.bytes=e;Tp(t,e=>{if(e){gp(s);return p(e,t)}i()})})}i()}}};const xp=({loadendState:i,abortFn:s})=>e=>{const t=e.target;if(t.aborted&&s&&!i.calledAbortFn){s();i.calledAbortFn=true}};const Ap=({segment:i,progressFn:s,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u})=>e=>{const t=e.target;if(t.aborted){return}i.stats=L(i.stats,yp(e));if(!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived){i.stats.firstBytesReceivedAt=Date.now()}return s(e,i)};const Dp=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p,doneFn:m,onTransmuxerLog:g})=>{const v=[];const y=Ip({activeXhrs:v,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p,doneFn:m,onTransmuxerLog:g});if(s.key&&!s.key.bytes){const E=[s.key];if(s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri){E.push(s.map.key)}const w=L(t,{uri:s.key.resolvedUri,responseType:"arraybuffer"});const k=_p(s,E,y);const j=e(w,k);v.push(j)}if(s.map&&!s.map.bytes){const C=s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri);if(C){const D=L(t,{uri:s.map.key.resolvedUri,responseType:"arraybuffer"});const O=_p(s,[s.map.key],y);const P=e(D,O);v.push(P)}const I=L(t,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:gf(s.map)});const x=Sp({segment:s,finishProcessingFn:y});const A=e(I,x);v.push(A)}const b=L(t,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:gf(s)});const _=Ep({segment:s,finishProcessingFn:y,responseType:b.responseType});const T=e(b,_);T.addEventListener("progress",Ap({segment:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:d,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p}));v.push(T);const S={};v.forEach(e=>{e.addEventListener("loadend",xp({loadendState:S,abortFn:n}))});return()=>gp(v)};const Op=sh("CodecUtils");const Pp=function(e){const t=e.attributes||{};if(t.CODECS){return Xa(t.CODECS)}};const Lp=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]};const Rp=(e,t)=>{if(!Lp(e,t)){return true}const i=t.attributes||{};const s=e.mediaGroups.AUDIO[i.AUDIO];for(const n in s){if(!s[n].uri&&!s[n].playlists){return true}}return false};const Np=function(e){const s={};e.forEach(({mediaType:e,type:t,details:i})=>{s[e]=s[e]||[];s[e].push(Ya(`${t}${i}`))});Object.keys(s).forEach(function(e){if(s[e].length>1){Op(`multiple ${e} codecs found as attributes: ${s[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);s[e]=null;return}s[e]=s[e][0]});return s};const Mp=function(e){let t=0;if(e.audio){t++}if(e.video){t++}return t};const Up=function(e,t){const i=t.attributes||{};const s=Np(Pp(t)||[]);if(Lp(e,t)&&!s.audio){if(!Rp(e,t)){const n=Np(Qa(e,i.AUDIO)||[]);if(n.audio){s.audio=n.audio}}}return s};const Bp=sh("PlaylistSelector");const Fp=function(e){if(!e||!e.playlist){return}const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})};const qp=function(e,t){if(!e){return""}const i=tv.getComputedStyle(e);if(!i){return""}return i[t]};const Vp=function(e,s){const n=e.slice();e.sort(function(e,t){const i=s(e,t);if(i===0){return n.indexOf(e)-n.indexOf(t)}return i})};const Hp=function(e,t){let i;let s;if(e.attributes.BANDWIDTH){i=e.attributes.BANDWIDTH}i=i||tv.Number.MAX_VALUE;if(t.attributes.BANDWIDTH){s=t.attributes.BANDWIDTH}s=s||tv.Number.MAX_VALUE;return i-s};const $p=function(e,t){let i;let s;if(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width){i=e.attributes.RESOLUTION.width}i=i||tv.Number.MAX_VALUE;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){s=t.attributes.RESOLUTION.width}s=s||tv.Number.MAX_VALUE;if(i===s&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH){return e.attributes.BANDWIDTH-t.attributes.BANDWIDTH}return i-s};let zp=function(e,t,i,s,n,r){if(!e){return}const a={bandwidth:t,width:i,height:s,limitRenditionByPlayerDimensions:n};let o=e.playlists;if(qh.isAudioOnly(e)){o=r.getAudioTrackPlaylists_();a.audioOnly=true}let l=o.map(e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width;const s=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;t=e.attributes&&e.attributes.BANDWIDTH;t=t||tv.Number.MAX_VALUE;return{bandwidth:t,width:i,height:s,playlist:e}});Vp(l,(e,t)=>e.bandwidth-t.bandwidth);l=l.filter(e=>!qh.isIncompatible(e.playlist));let c=l.filter(e=>qh.isEnabled(e.playlist));if(!c.length){c=l.filter(e=>!qh.isDisabled(e.playlist))}const u=c.filter(e=>e.bandwidth*O.BANDWIDTH_VARIANCEe.bandwidth===d.bandwidth)[0];if(n===false){const _=h||c[0]||l[0];if(_&&_.playlist){let e="sortedPlaylistReps";if(h){e="bandwidthBestRep"}if(c[0]){e="enabledPlaylistReps"}Bp(`choosing ${Fp(_)} using ${e} with options`,a);return _.playlist}Bp("could not choose a playlist with options",a);return null}const f=u.filter(e=>e.width&&e.height);Vp(f,(e,t)=>e.width-t.width);const p=f.filter(e=>e.width===i&&e.height===s);d=p[p.length-1];const m=p.filter(e=>e.bandwidth===d.bandwidth)[0];let g;let v;let y;if(!m){g=f.filter(e=>e.width>i||e.height>s);v=g.filter(e=>e.width===g[0].width&&e.height===g[0].height);d=v[v.length-1];y=v.filter(e=>e.bandwidth===d.bandwidth)[0]}let b;if(r.leastPixelDiffSelector){const T=f.map(e=>{e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-s);return e});Vp(T,(e,t)=>{if(e.pixelDiff===t.pixelDiff){return t.bandwidth-e.bandwidth}return e.pixelDiff-t.pixelDiff});b=T[0]}const _=b||y||m||h||c[0]||l[0];if(_&&_.playlist){let e="sortedPlaylistReps";if(b){e="leastPixelDiffRep"}else if(y){e="resolutionPlusOneRep"}else if(m){e="resolutionBestRep"}else if(h){e="bandwidthBestRep"}else if(c[0]){e="enabledPlaylistReps"}Bp(`choosing ${Fp(_)} using ${e} with options`,a);return _.playlist}Bp("could not choose a playlist with options",a);return null};const Gp=function(){const e=this.useDevicePixelRatio?tv.devicePixelRatio||1:1;return zp(this.playlists.main,this.systemBandwidth,parseInt(qp(this.tech_.el(),"width"),10)*e,parseInt(qp(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)};const Kp=function(t){let i=-1;let s=-1;if(t<0||t>1){throw new Error("Moving average bandwidth decay must be between 0 and 1.")}return function(){const e=this.useDevicePixelRatio?tv.devicePixelRatio||1:1;if(i<0){i=this.systemBandwidth;s=this.systemBandwidth}if(this.systemBandwidth>0&&this.systemBandwidth!==s){i=t*this.systemBandwidth+(1-t)*i;s=this.systemBandwidth}return zp(this.playlists.main,i,parseInt(qp(this.tech_.el(),"width"),10)*e,parseInt(qp(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)}};const Wp=function(e){const{main:t,currentTime:r,bandwidth:a,duration:o,segmentDuration:l,timeUntilRebuffer:c,currentTimeline:u,syncController:d}=e;const i=t.playlists.filter(e=>!qh.isIncompatible(e));let s=i.filter(qh.isEnabled);if(!s.length){s=i.filter(e=>!qh.isDisabled(e))}const n=s.filter(qh.hasAttribute.bind(null,"BANDWIDTH"));const h=n.map(e=>{const t=d.getSyncPoint(e,o,u,r);const i=t?1:2;const s=qh.estimateSegmentRequestTime(l,a,e);const n=s*i-c;return{playlist:e,rebufferingImpact:n}});const f=h.filter(e=>e.rebufferingImpact<=0);Vp(f,(e,t)=>Hp(t.playlist,e.playlist));if(f.length){return f[0]}Vp(h,(e,t)=>e.rebufferingImpact-t.rebufferingImpact);return h[0]||null};const Yp=function(){const e=this.playlists.main.playlists.filter(qh.isEnabled);Vp(e,(e,t)=>Hp(e,t));const t=e.filter(e=>!!Up(this.playlists.main,e).video);return t[0]||null};const Xp=e=>{let t=0;let i;if(e.bytes){i=new Uint8Array(e.bytes);e.segments.forEach(e=>{i.set(e,t);t+=e.byteLength})}return i};const Qp=function(n,r,a){if(!n[a]){r.trigger({type:"usage",name:"vhs-608"});let s=a;if(/^cc708_/.test(a)){s="SERVICE"+a.split("_")[1]}const e=r.textTracks().getTrackById(s);if(e){n[a]=e}else{const o=r.options_.vhs&&r.options_.vhs.captionServices||{};let e=a;let t=a;let i=false;const l=o[s];if(l){e=l.label;t=l.language;i=l.default}n[a]=r.addRemoteTextTrack({kind:"captions",id:s,default:i,label:e,language:t},false).track}}};const Jp=function({inbandTextTracks:n,captionArray:e,timestampOffset:r}){if(!e){return}const a=tv.WebKitDataCue||tv.VTTCue;e.forEach(i=>{const s=i.stream;if(i.content){i.content.forEach(e=>{const t=new a(i.startTime+r,i.endTime+r,e.text);t.line=e.line;t.align="left";t.position=e.position;t.positionAlign="line-left";n[s].addCue(t)})}else{n[s].addCue(new a(i.startTime+r,i.endTime+r,i.text))}})};const Zp=function(e){Object.defineProperties(e.frame,{id:{get(){S.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return e.value.key}},value:{get(){S.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return e.value.data}},privateData:{get(){S.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return e.value.data}}})};const em=({inbandTextTracks:e,metadataArray:t,timestampOffset:s,videoDuration:r})=>{if(!t){return}const n=tv.WebKitDataCue||tv.VTTCue;const a=e.metadataTrack_;if(!a){return}t.forEach(e=>{const i=e.cueTime+s;if(typeof i!=="number"||tv.isNaN(i)||i<0||!(i{const t=new n(i,i,e.value||e.url||e.data||"");t.frame=e;t.value=e;Zp(t);a.addCue(t)})});if(!a.cues||!a.cues.length){return}const i=a.cues;const o=[];for(let e=0;e{const i=e[t.startTime]||[];i.push(t);e[t.startTime]=i;return e},{});const c=Object.keys(l).sort((e,t)=>Number(e)-Number(t));c.forEach((e,t)=>{const i=l[e];const s=isFinite(r)?r:e;const n=Number(c[t+1])||s;i.forEach(e=>{e.endTime=n})})};const tm={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"};const im=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]);const sm=({inbandTextTracks:e,dateRanges:t})=>{const s=e.metadataTrack_;if(!s){return}const n=tv.WebKitDataCue||tv.VTTCue;t.forEach(e=>{for(const t of Object.keys(e)){if(im.has(t)){continue}const i=new n(e.startTime,e.endTime,"");i.id=e.id;i.type="com.apple.quicktime.HLS";i.value={key:tm[t],data:e[t]};if(t==="scte35Out"||t==="scte35In"){i.value.data=new Uint8Array(i.value.data.match(/[\da-f]{2}/gi)).buffer}s.addCue(i)}e.processDateRange()})};const nm=(e,t,i)=>{if(e.metadataTrack_){return}e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},false).track;if(!S.browser.IS_ANY_SAFARI){e.metadataTrack_.inBandMetadataTrackDispatchType=t}};const rm=function(e,t,i){let s;let n;if(!i){return}if(!i.cues){return}s=i.cues.length;while(s--){n=i.cues[s];if(n.startTime>=e&&n.endTime<=t){i.removeCue(n)}}};const am=function(t){const i=t.cues;if(!i){return}const s={};for(let e=i.length-1;e>=0;e--){const n=i[e];const r=`${n.startTime}-${n.endTime}-${n.text}`;if(s[r]){t.removeCue(n)}else{s[r]=n}}};const om=(e,t,i)=>{if(typeof t==="undefined"||t===null||!e.length){return[]}const s=Math.ceil((t-i+3)*eh);let n;for(n=0;ns){break}}return e.slice(n)};const lm=(e,t,i)=>{if(!t.length){return e}if(i){return t.slice()}const s=t[0].pts;let n=0;for(n;n=s){break}}return e.slice(0,n).concat(t)};const cm=(e,t,i,s)=>{const n=Math.ceil((t-s)*eh);const r=Math.ceil((i-s)*eh);const a=e.slice();let o=e.length;while(o--){if(e[o].pts<=r){break}}if(o===-1){return a}let l=o+1;while(l--){if(e[l].pts<=n){break}}l=Math.max(l,0);a.splice(l,o-l+1);return a};const um=function(t,i){if(!t&&!i||!t&&i||t&&!i){return false}if(t===i){return true}const s=Object.keys(t).sort();const n=Object.keys(i).sort();if(s.length!==n.length){return false}for(let e=0;es){return e}}}if(n.length===0){return 0}return n[n.length-1]};const fm=1;const pm=500;const mm=e=>typeof e==="number"&&isFinite(e);const gm=1/60;const vm=(e,t,i)=>{if(e!=="main"||!t||!i){return null}if(!i.hasAudio&&!i.hasVideo){return"Neither audio nor video found in segment."}if(t.hasVideo&&!i.hasVideo){return"Only audio found in segment when we expected video."+" We can't switch to audio only from a stream that had video."+" To get rid of this message, please add codec information to the manifest."}if(!t.hasVideo&&i.hasVideo){return"Video found in segment when we expected only audio."+" We can't switch to a stream with video from an audio only stream."+" To get rid of this message, please add codec information to the manifest."}return null};const ym=(e,t,i)=>{let s=t-O.BACK_BUFFER_LENGTH;if(e.length){s=Math.max(s,e.start(0))}const n=t-i;return Math.min(n,s)};const bm=e=>{const{startOfSegment:t,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:c,timeline:u}=e;const d=o.length-1;let h="mediaIndex/partIndex increment";if(e.getMediaInfoForTime){h=`getMediaInfoForTime (${e.getMediaInfoForTime})`}else if(e.isSyncRequest){h="getSyncSegmentCandidate (isSyncRequest)"}if(e.independent){h+=` with independent ${e.independent}`}const f=typeof c==="number";const p=e.segment.uri?"segment":"pre-segment";const m=f?_h({preloadSegment:s})-1:0;return`${p} [${r+l}/${r+d}]`+(f?` part [${c}/${m}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(f?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${h}]`+` playlist [${a}]`};const _m=e=>`${e}TimingInfo`;const Tm=({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:s,overrideCheck:n})=>{if(!n&&e===t){return null}if(e{if(t===i){return false}if(s==="audio"){const r=e.lastTimelineChange({type:"main"});return!r||r.to!==i}if(s==="main"&&n){const a=e.pendingTimelineChange({type:"audio"});if(a&&a.to===i){return false}return true}return false};const Em=r=>{let a=0;["video","audio"].forEach(function(e){const t=r[`${e}TimingInfo`];if(!t){return}const{start:i,end:s}=t;let n;if(typeof i==="bigint"||typeof s==="bigint"){n=tv.BigInt(s)-tv.BigInt(i)}else if(typeof i==="number"&&typeof s==="number"){n=s-i}if(typeof n!=="undefined"&&n>a){a=n}});if(typeof a==="bigint"&&a{if(!e){return false}return Math.round(e)>t+nh};const km=(e,t)=>{if(t!=="hls"){return null}const i=Em({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i){return null}const s=e.playlist.targetDuration;const n=wm({segmentDuration:i,maxDuration:s*2});const r=wm({segmentDuration:i,maxDuration:s});const a=`Segment with index ${e.mediaIndex} `+`from playlist ${e.playlist.id} `+`has a duration of ${i} `+`when the reported duration is ${e.duration} `+`and the target duration is ${s}. `+"For HLS content, a duration in excess of the target duration may result in "+"playback issues. See the HLS specification section on EXT-X-TARGETDURATION for "+"more details: "+"https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";if(n||r){return{severity:n?"warn":"info",message:a}}return null};class jm extends S.EventTarget{constructor(e,t={}){super();if(!e){throw new TypeError("Initialization settings are required")}if(typeof e.currentTime!=="function"){throw new TypeError("No currentTime getter specified")}if(!e.mediaSource){throw new TypeError("No MediaSource specified")}this.bandwidth=e.bandwidth;this.throughput={rate:0,count:0};this.roundTrip=NaN;this.resetStats_();this.mediaIndex=null;this.partIndex=null;this.hasPlayed_=e.hasPlayed;this.currentTime_=e.currentTime;this.seekable_=e.seekable;this.seeking_=e.seeking;this.duration_=e.duration;this.mediaSource_=e.mediaSource;this.vhs_=e.vhs;this.loaderType_=e.loaderType;this.currentMediaInfo_=void 0;this.startingMediaInfo_=void 0;this.segmentMetadataTrack_=e.segmentMetadataTrack;this.goalBufferLength_=e.goalBufferLength;this.sourceType_=e.sourceType;this.sourceUpdater_=e.sourceUpdater;this.inbandTextTracks_=e.inbandTextTracks;this.state_="INIT";this.timelineChangeController_=e.timelineChangeController;this.shouldSaveSegmentTimingInfo_=true;this.parse708captions_=e.parse708captions;this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset;this.captionServices_=e.captionServices;this.exactManifestTimings=e.exactManifestTimings;this.addMetadataToTextTrack=e.addMetadataToTextTrack;this.checkBufferTimeout_=null;this.error_=void 0;this.currentTimeline_=-1;this.shouldForceTimestampOffsetAfterResync_=false;this.pendingSegment_=null;this.xhrOptions_=null;this.pendingSegments_=[];this.audioDisabled_=false;this.isPendingTimestampOffset_=false;this.gopBuffer_=[];this.timeMapping_=0;this.safeAppend_=false;this.appendInitSegment_={audio:true,video:true};this.playlistOfLastInitSegment_={audio:null,video:null};this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_={id3:[],caption:[]};this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=null;this.activeInitSegmentId_=null;this.initSegments_={};this.cacheEncryptionKeys_=e.cacheEncryptionKeys;this.keyCache_={};this.decrypter_=e.decrypter;this.syncController_=e.syncController;this.syncPoint_={segmentIndex:0,time:0};this.transmuxer_=this.createTransmuxer_();this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate");this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_);this.mediaSource_.addEventListener("sourceopen",()=>{if(!this.isEndOfStream_()){this.ended_=false}});this.fetchAtBuffer_=false;this.logger_=sh(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,"state",{get(){return this.state_},set(e){if(e!==this.state_){this.logger_(`${this.state_} -> ${e}`);this.state_=e;this.trigger("statechange")}}});this.sourceUpdater_.on("ready",()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}});if(this.loaderType_==="main"){this.timelineChangeController_.on("pendingtimelinechange",()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}})}if(this.loaderType_==="audio"){this.timelineChangeController_.on("timelinechange",()=>{if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_()}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}})}}createTransmuxer_(){return fp.createTransmuxer({remux:false,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:true,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0;this.mediaAppends=0}dispose(){this.trigger("dispose");this.state="DISPOSED";this.pause();this.abort_();if(this.transmuxer_){this.transmuxer_.terminate()}this.resetStats_();if(this.checkBufferTimeout_){tv.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}setAudio(e){this.audioDisabled_=!e;if(e){this.appendInitSegment_.audio=true}else{this.sourceUpdater_.removeAudio(0,this.duration_())}}abort(){if(this.state!=="WAITING"){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}abort_(){if(this.pendingSegment_&&this.pendingSegment_.abortRequests){this.pendingSegment_.abortRequests()}this.pendingSegment_=null;this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.waitingOnRemove_=false;tv.clearTimeout(this.quotaExceededErrorRetryTimeout_);this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){if(this.state==="APPENDING"&&!this.pendingSegment_){this.state="READY";return true}if(!this.pendingSegment_||this.pendingSegment_.requestId!==e){return true}return false}error(e){if(typeof e!=="undefined"){this.logger_("error occurred:",e);this.error_=e}this.pendingSegment_=null;return this.error_}endOfStream(){this.ended_=true;if(this.transmuxer_){fp.reset(this.transmuxer_)}this.gopBuffer_.length=0;this.pause();this.trigger("ended")}buffered_(){const t=this.getMediaInfo_();if(!this.sourceUpdater_||!t){return D()}if(this.loaderType_==="main"){const{hasAudio:i,hasVideo:s,isMuxed:e}=t;if(s&&i&&!this.audioDisabled_&&!e){return this.sourceUpdater_.buffered()}if(s){return this.sourceUpdater_.videoBuffered()}}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=false){if(!e){return null}const i=Tf(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}}return s||e}segmentKey(e,t=false){if(!e){return null}const i=Sf(e);let s=this.keyCache_[i];if(this.cacheEncryptionKeys_&&t&&!s&&e.bytes){this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes}}const n={resolvedUri:(s||e).resolvedUri};if(s){n.bytes=s.bytes}return n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){this.monitorBuffer_();if(!this.playlist_){return}if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"){return}this.state="READY"}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}playlist(e,t={}){if(!e){return}const i=this.playlist_;const s=this.pendingSegment_;this.playlist_=e;this.xhrOptions_=t;if(this.state==="INIT"){e.syncInfo={mediaSequence:e.mediaSequence,time:0};if(this.loaderType_==="main"){this.syncController_.setDateTimeMappingForStart(e)}}let n=null;if(i){if(i.id){n=i.id}else if(i.uri){n=i.uri}}this.logger_(`playlist update [${n} => ${e.id||e.uri}]`);this.syncController_.updateMediaSequenceMap(e,this.currentTime_(),this.loaderType_);this.trigger("syncinfoupdate");if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!i||i.uri!==e.uri){if(this.mediaIndex!==null){const a=!e.endList&&typeof e.partTargetDuration==="number";if(a){this.resetLoader()}else{this.resyncLoader()}}this.currentMediaInfo_=void 0;this.trigger("playlistupdate");return}const r=e.mediaSequence-i.mediaSequence;this.logger_(`live window shift [${r}]`);if(this.mediaIndex!==null){this.mediaIndex-=r;if(this.mediaIndex<0){this.mediaIndex=null;this.partIndex=null}else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);this.resetLoader();this.mediaIndex=l}}}if(s){s.mediaIndex-=r;if(s.mediaIndex<0){s.mediaIndex=null;s.partIndex=null}else{if(s.mediaIndex>=0){s.segment=e.segments[s.mediaIndex]}if(s.partIndex>=0&&s.segment.parts){s.part=s.segment.parts[s.partIndex]}}}this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){if(this.checkBufferTimeout_){tv.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=false;this.activeInitSegmentId_=null;this.appendInitSegment_={audio:true,video:true};this.resetLoader();this.remove(0,Infinity,e);if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"});this.transmuxer_.postMessage({action:"reset"})}}resetLoader(){this.fetchAtBuffer_=false;this.resyncLoader()}resyncLoader(){if(this.transmuxer_){fp.reset(this.transmuxer_)}this.mediaIndex=null;this.partIndex=null;this.syncPoint_=null;this.isPendingTimestampOffset_=false;this.shouldForceTimestampOffsetAfterResync_=true;this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.abort();if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}remove(e,t,i=()=>{},s=false){if(t===Infinity){t=this.duration_()}if(t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const r=()=>{n--;if(n===0){i()}};if(s||!this.audioDisabled_){n++;this.sourceUpdater_.removeAudio(e,t,r)}if(s||this.loaderType_==="main"){this.gopBuffer_=cm(this.gopBuffer_,e,t,this.timeMapping_);n++;this.sourceUpdater_.removeVideo(e,t,r)}for(const a in this.inbandTextTracks_){rm(e,t,this.inbandTextTracks_[a])}rm(e,t,this.segmentMetadataTrack_);r()}monitorBuffer_(){if(this.checkBufferTimeout_){tv.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=tv.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){if(this.state==="READY"){this.fillBuffer_()}if(this.checkBufferTimeout_){tv.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=tv.setTimeout(this.monitorBufferTick_.bind(this),pm)}fillBuffer_(){if(this.sourceUpdater_.updating()){return}const e=this.chooseNextRequest_();if(!e){return}if(typeof e.timestampOffset==="number"){this.isPendingTimestampOffset_=false;this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})}this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_){return false}const s=typeof e==="number"&&t.segments[e];const n=e+1===t.segments.length;const r=!s||!s.parts||i+1===s.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&r}chooseNextRequest_(){const e=this.buffered_();const t=mh(e)||0;const i=gh(e,this.currentTime_());const s=!this.hasPlayed_()&&i>=1;const n=i>=this.goalBufferLength_();const r=this.playlist_.segments;if(!r.length||s||n){return null}this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest){a.mediaIndex=hm(this.currentTimeline_,r,t);this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`)}else if(this.mediaIndex!==null){const d=r[this.mediaIndex];const h=typeof this.partIndex==="number"?this.partIndex:-1;a.startOfSegment=d.end?d.end:t;if(d.parts&&d.parts[h+1]){a.mediaIndex=this.mediaIndex;a.partIndex=h+1}else{a.mediaIndex=this.mediaIndex+1}}else{const{segmentIndex:f,startTime:p,partIndex:h}=qh.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`;a.mediaIndex=f;a.startOfSegment=p;a.partIndex=h;this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=r[a.mediaIndex];let l=o&&typeof a.partIndex==="number"&&o.parts&&o.parts[a.partIndex];if(!o||typeof a.partIndex==="number"&&!l){return null}if(typeof a.partIndex!=="number"&&o.parts){a.partIndex=0;l=o.parts[0]}const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!c&&!l.independent){if(a.partIndex===0){const m=r[a.mediaIndex-1];const g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];if(g&&g.independent){a.mediaIndex-=1;a.partIndex=m.parts.length-1;a.independent="previous segment"}}else if(o.parts[a.partIndex-1].independent){a.partIndex-=1;a.independent="previous part"}}const u=this.mediaSource_&&this.mediaSource_.readyState==="ended";if(a.mediaIndex>=r.length-1&&u&&!this.seeking_()){return null}if(this.shouldForceTimestampOffsetAfterResync_){this.shouldForceTimestampOffsetAfterResync_=false;a.forceTimestampOffset=true;this.logger_("choose next request. Force timestamp offset after loader resync")}return this.generateSegmentInfo_(a)}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e;const c=i.segments[s];const u=typeof a==="number"&&c.parts[a];const d={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||c.resolvedUri,mediaIndex:s,partIndex:u?a:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:u&&u.duration||c.duration,segment:c,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t};const h=typeof o!=="undefined"?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:h});const f=mh(this.sourceUpdater_.audioBuffered());if(typeof f==="number"){d.audioAppendStart=f-this.sourceUpdater_.audioTimestampOffset()}if(this.sourceUpdater_.videoBuffered().length){d.gopsToAlignWith=om(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)}return d}timestampOffsetForSegment_(e){return Tm(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return}if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3){return}const t=this.currentTime_();const i=e.bandwidth;const s=this.pendingSegment_.duration;const n=qh.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived);const r=hh(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=r){return}const a=Wp({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a){return}const o=n-r;const l=o-a.rebufferingImpact;let c=.5;if(r<=nh){c=1}if(!a.playlist||a.playlist.uri===this.playlist_.uri||l{a[e.stream]=a[e.stream]||{startTime:Infinity,captions:[],endTime:0};const t=a[e.stream];t.startTime=Math.min(t.startTime,e.startTime+r);t.endTime=Math.max(t.endTime,e.endTime+r);t.captions.push(e)});Object.keys(a).forEach(e=>{const{startTime:t,endTime:i,captions:s}=a[e];const n=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`);Qp(n,this.vhs_.tech_,e);rm(t,i,n[e]);Jp({captionArray:s,inbandTextTracks:n,timestampOffset:r})});if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}const s=this.pendingSegment_;if(!s.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e());this.metadataQueue_.caption.forEach(e=>e());this.metadataQueue_.id3=[];this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[];e.forEach(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[];e.forEach(e=>e())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio"){return true}const e=this.pendingSegment_;if(!e){return false}if(!this.getCurrentMediaInfo_()){return true}if(Sm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()){return false}if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_){return false}const e=this.pendingSegment_;const t=this.getCurrentMediaInfo_();if(!e||!t){return false}const{hasAudio:i,hasVideo:s,isMuxed:n}=t;if(s&&!e.videoTimingInfo){return false}if(i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo){return false}if(Sm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}handleData_(e,t){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;this.setTimeMapping_(i.timeline);this.updateMediaSecondsLoaded_(i.part||i.segment);if(this.mediaSource_.readyState==="closed"){return}if(e.map){e.map=this.initSegmentForMap(e.map,true);i.segment.map=e.map}if(e.key){this.segmentKey(e.key,true)}i.isFmp4=e.isFmp4;i.timingInfo=i.timingInfo||{};if(i.isFmp4){this.trigger("fmp4");i.timingInfo.start=i[_m(t.type)].start}else{const s=this.getCurrentMediaInfo_();const n=this.loaderType_==="main"&&s&&s.hasVideo;let e;if(n){e=i.videoTimingInfo.start}i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:e,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}this.updateAppendInitSegmentStatus(i,t.type);this.updateSourceBufferTimestampOffset_(i);if(i.isSyncRequest){this.updateTimingInfoEnd_(i);this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=true;this.processMetadataQueue_();this.appendData_(i,t)}updateAppendInitSegmentStatus(e,t){if(this.loaderType_==="main"&&typeof e.timestampOffset==="number"&&!e.changedTimestampOffset){this.appendInitSegment_={audio:true,video:true}}if(this.playlistOfLastInitSegment_[t]!==e.playlist){this.appendInitSegment_[t]=true}}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:s}){if(i){const n=Tf(i);if(this.activeInitSegmentId_===n){return null}t=this.initSegmentForMap(i,true).bytes;this.activeInitSegmentId_=n}if(t&&this.appendInitSegment_[e]){this.playlistOfLastInitSegment_[e]=s;this.appendInitSegment_[e]=false;this.activeInitSegmentId_=null;return t}return null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},s){const n=this.sourceUpdater_.audioBuffered();const r=this.sourceUpdater_.videoBuffered();if(n.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+fh(n).join(", "))}if(r.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+fh(r).join(", "))}const a=n.length?n.start(0):0;const o=n.length?n.end(n.length-1):0;const l=r.length?r.start(0):0;const c=r.length?r.end(r.length-1):0;if(o-a<=fm&&c-l<=fm){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to "+"buffer, triggering an error. "+`Appended byte length: ${i.byteLength}, `+`audio buffer: ${fh(n).join(", ")}, `+`video buffer: ${fh(r).join(", ")}, `);this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:Infinity});this.trigger("error");return}this.waitingOnRemove_=true;this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const u=this.currentTime_();const d=u-fm;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`);this.remove(0,d,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${fm}s`);this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=tv.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");this.quotaExceededErrorRetryTimeout_=null;this.processCallQueue_()},fm*1e3)},true)}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){if(!s){return}if(s.code===dm){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s);this.error(`${t} append of ${i.length}b failed for segment `+`#${e.mediaIndex} in playlist ${e.playlist.id}`);this.trigger("appenderror")}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:n}){if(!n){const r=[s];let e=s.byteLength;if(i){r.unshift(i);e+=i.byteLength}n=Xp({bytes:e,segments:r})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId){return}const s=this.pendingSegment_.segment;const n=`${e}TimingInfo`;if(!s[n]){s[n]={}}s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0;s[n].transmuxedPresentationStart=i.start.presentation;s[n].transmuxedDecodeStart=i.start.decode;s[n].transmuxedPresentationEnd=i.end.presentation;s[n].transmuxedDecodeEnd=i.end.decode;s[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:s}=t;if(!s||!s.byteLength){return}if(i==="audio"&&this.audioDisabled_){return}const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:s})}loadSegment_(t){this.state="WAITING";this.pendingSegment_=t;this.trimBackBuffer_(t);if(typeof t.timestampOffset==="number"){if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"})}}if(!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{const e=Ni({},t,{forceTimestampOffset:true});Ni(t,this.generateSegmentInfo_(e));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(t)});return}this.updateTransmuxerAndRequestSegment_(t)}updateTransmuxerAndRequestSegment_(s){if(this.shouldUpdateTransmuxerTimestampOffset_(s.timestampOffset)){this.gopBuffer_.length=0;s.gopsToAlignWith=[];this.timeMapping_=0;this.transmuxer_.postMessage({action:"reset"});this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:s.timestampOffset})}const e=this.createSimplifiedSegmentObj_(s);const t=this.isEndOfStream_(s.mediaIndex,s.playlist,s.partIndex);const i=this.mediaIndex!==null;const n=s.timeline!==this.currentTimeline_&&s.timeline>0;const r=t||i&&n;this.logger_(`Requesting ${bm(s)}`);if(e.map&&!e.map.bytes){this.logger_("going to request init segment.");this.appendInitSegment_={video:true,audio:true}}s.abortRequests=Dp({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:e,abortFn:this.handleAbort_.bind(this,s),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",s.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",s.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:e,level:t,stream:i})=>{this.logger_(`${bm(s)} logged from transmuxer stream ${i} as a ${t}: ${e}`)}})}trimBackBuffer_(e){const t=ym(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(t>0){this.remove(0,t)}}createSimplifiedSegmentObj_(e){const t=e.segment;const i=e.part;const s={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part};const n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline){if(n.videoTimingInfo){s.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd}else if(n.audioTimingInfo){s.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd}}if(t.key){const r=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key);s.key.iv=r}if(t.map){s.map=this.initSegmentForMap(t.map)}return s}saveTransferStats_(e){this.mediaRequests+=1;if(e){this.mediaBytesTransferred+=e.bytesReceived;this.mediaTransferDuration+=e.roundTripTime}}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived;if(ee.playlist.targetDuration*3;const r=s&&s.end&&this.currentTime_()-s.end>e.playlist.partTargetDuration*3;if(n||r){this.logger_(`bad ${n?"segment":"part"} ${bm(e)}`);this.resetEverything();return}const a=this.mediaIndex!==null;if(a){this.trigger("bandwidthupdate")}this.trigger("progress");this.mediaIndex=e.mediaIndex;this.partIndex=e.partIndex;if(this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)){this.endOfStream()}this.trigger("appended");if(e.hasAppendedData_){this.mediaAppends++}if(!this.paused()){this.monitorBuffer_()}}recordThroughput_(e){if(e.duratione.toUpperCase())};const xm=["video","audio"];const Am=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]};const Dm=(t,i)=>{for(let e=0;e{if(t.queue.length===0){return}let i=0;let s=t.queue[i];if(s.type==="mediaSource"){if(!t.updating()&&t.mediaSource.readyState!=="closed"){t.queue.shift();s.action(t);if(s.doneFn){s.doneFn()}Om("audio",t);Om("video",t)}return}if(e==="mediaSource"){return}if(!t.ready()||t.mediaSource.readyState==="closed"||Am(e,t)){return}if(s.type!==e){i=Dm(e,t.queue);if(i===null){return}s=t.queue[i]}t.queue.splice(i,1);t.queuePending[e]=s;s.action(e,t);if(!s.doneFn){t.queuePending[e]=null;Om(e,t);return}};const Pm=(e,t)=>{const i=t[`${e}Buffer`];const s=Im(e);if(!i){return}i.removeEventListener("updateend",t[`on${s}UpdateEnd_`]);i.removeEventListener("error",t[`on${s}Error_`]);t.codecs[e]=null;t[`${e}Buffer`]=null};const Lm=(e,t)=>e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1;const Rm={appendBuffer:(s,n,r)=>(t,i)=>{const e=i[`${t}Buffer`];if(!Lm(i.mediaSource,e)){return}i.logger_(`Appending segment ${n.mediaIndex}'s ${s.length} bytes to ${t}Buffer`);try{e.appendBuffer(s)}catch(e){i.logger_(`Error with code ${e.code} `+(e.code===dm?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${n.mediaIndex} to ${t}Buffer`);i.queuePending[t]=null;r(e)}},remove:(s,n)=>(t,i)=>{const e=i[`${t}Buffer`];if(!Lm(i.mediaSource,e)){return}i.logger_(`Removing ${s} to ${n} from ${t}Buffer`);try{e.remove(s,n)}catch(e){i.logger_(`Remove ${s} to ${n} from ${t}Buffer failed`)}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];if(!Lm(t.mediaSource,i)){return}t.logger_(`Setting ${e}timestampOffset to ${s}`);i.timestampOffset=s},callback:i=>(e,t)=>{i()},endOfStream:t=>e=>{if(e.mediaSource.readyState!=="open"){return}e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(e){S.log.warn("Failed to call media source endOfStream",e)}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(e){S.log.warn("Failed to set media source duration",e)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open"){return}const i=e[`${t}Buffer`];if(!Lm(e.mediaSource,i)){return}e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(e){S.log.warn(`Failed to abort on ${t}Buffer`,e)}},addSourceBuffer:(n,r)=>e=>{const t=Im(n);const i=eo(r);e.logger_(`Adding ${n}Buffer with codec ${r} to mediaSource`);const s=e.mediaSource.addSourceBuffer(i);s.addEventListener("updateend",e[`on${t}UpdateEnd_`]);s.addEventListener("error",e[`on${t}Error_`]);e.codecs[n]=r;e[`${n}Buffer`]=s},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];Pm(i,e);if(!Lm(e.mediaSource,t)){return}e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(e){S.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,e)}},changeType:n=>(e,t)=>{const i=t[`${e}Buffer`];const s=eo(n);if(!Lm(t.mediaSource,i)){return}if(t.codecs[e]===n){return}t.logger_(`changing ${e}Buffer codec from ${t.codecs[e]} to ${n}`);i.changeType(s);t.codecs[e]=n}};const Nm=({type:e,sourceUpdater:t,action:i,doneFn:s,name:n})=>{t.queue.push({type:e,action:i,doneFn:s,name:n});Om(e,t)};const Mm=(i,s)=>e=>{if(s.queuePending[i]){const t=s.queuePending[i].doneFn;s.queuePending[i]=null;if(t){t(s[`${i}Error_`])}}Om(i,s)};class Um extends S.EventTarget{constructor(e){super();this.mediaSource=e;this.sourceopenListener_=()=>Om("mediaSource",this);this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_);this.logger_=sh("SourceUpdater");this.audioTimestampOffset_=0;this.videoTimestampOffset_=0;this.queue=[];this.queuePending={audio:null,video:null};this.delayedAudioAppendQueue_=[];this.videoAppendQueued_=false;this.codecs={};this.onVideoUpdateEnd_=Mm("video",this);this.onAudioUpdateEnd_=Mm("audio",this);this.onVideoError_=e=>{this.videoError_=e};this.onAudioError_=e=>{this.audioError_=e};this.createdSourceBuffers_=false;this.initializedEme_=false;this.triggeredReady_=false}initializedEme(){this.initializedEme_=true;this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){if(this.hasCreatedSourceBuffers()){return}this.addOrChangeSourceBuffers(e);this.createdSourceBuffers_=true;this.trigger("createdsourcebuffers");this.triggerReady()}triggerReady(){if(this.ready()&&!this.triggeredReady_){this.triggeredReady_=true;this.trigger("ready")}}addSourceBuffer(e,t){Nm({type:"mediaSource",sourceUpdater:this,action:Rm.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Nm({type:e,sourceUpdater:this,action:Rm.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){S.log.error("removeSourceBuffer is not supported!");return}Nm({type:"mediaSource",sourceUpdater:this,action:Rm.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!S.browser.IS_FIREFOX&&tv.MediaSource&&tv.MediaSource.prototype&&typeof tv.MediaSource.prototype.removeSourceBuffer==="function"}static canChangeType(){return tv.SourceBuffer&&tv.SourceBuffer.prototype&&typeof tv.SourceBuffer.prototype.changeType==="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){S.log.error("changeType is not supported!");return}Nm({type:e,sourceUpdater:this,action:Rm.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(i){if(!i||typeof i!=="object"||Object.keys(i).length===0){throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs")}Object.keys(i).forEach(e=>{const t=i[e];if(!this.hasCreatedSourceBuffers()){return this.addSourceBuffer(e,t)}if(this.canChangeType()){this.changeType(e,t)}})}appendBuffer(e,t){const{segmentInfo:i,type:s,bytes:n}=e;this.processedAppend_=true;if(s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]);this.logger_(`delayed audio append of ${n.length} until video append`);return}const r=t;Nm({type:s,sourceUpdater:this,action:Rm.appendBuffer(n,i||{mediaIndex:-1},r),doneFn:t,name:"appendBuffer"});if(s==="video"){this.videoAppendQueued_=true;if(!this.delayedAudioAppendQueue_.length){return}const a=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${a.length} appendBuffers`);this.delayedAudioAppendQueue_.length=0;a.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){if(!Lm(this.mediaSource,this.audioBuffer)){return D()}return this.audioBuffer.buffered?this.audioBuffer.buffered:D()}videoBuffered(){if(!Lm(this.mediaSource,this.videoBuffer)){return D()}return this.videoBuffer.buffered?this.videoBuffer.buffered:D()}buffered(){const e=Lm(this.mediaSource,this.videoBuffer)?this.videoBuffer:null;const t=Lm(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(t&&!e){return this.audioBuffered()}if(e&&!t){return this.videoBuffered()}return uh(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Cm){Nm({type:"mediaSource",sourceUpdater:this,action:Rm.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Cm){if(typeof e!=="string"){e=undefined}Nm({type:"mediaSource",sourceUpdater:this,action:Rm.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=Cm){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}Nm({type:"audio",sourceUpdater:this,action:Rm.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=Cm){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}Nm({type:"video",sourceUpdater:this,action:Rm.remove(e,t),doneFn:i,name:"remove"})}updating(){if(Am("audio",this)||Am("video",this)){return true}return false}audioTimestampOffset(e){if(typeof e!=="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==e){Nm({type:"audio",sourceUpdater:this,action:Rm.timestampOffset(e),name:"timestampOffset"});this.audioTimestampOffset_=e}return this.audioTimestampOffset_}videoTimestampOffset(e){if(typeof e!=="undefined"&&this.videoBuffer&&this.videoTimestampOffset!==e){Nm({type:"video",sourceUpdater:this,action:Rm.timestampOffset(e),name:"timestampOffset"});this.videoTimestampOffset_=e}return this.videoTimestampOffset_}audioQueueCallback(e){if(!this.audioBuffer){return}Nm({type:"audio",sourceUpdater:this,action:Rm.callback(e),name:"callback"})}videoQueueCallback(e){if(!this.videoBuffer){return}Nm({type:"video",sourceUpdater:this,action:Rm.callback(e),name:"callback"})}dispose(){this.trigger("dispose");xm.forEach(e=>{this.abort(e);if(this.canRemoveSourceBuffer()){this.removeSourceBuffer(e)}else{this[`${e}QueueCallback`](()=>Pm(e,this))}});this.videoAppendQueued_=false;this.delayedAudioAppendQueue_.length=0;if(this.sourceopenListener_){this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_)}this.off()}}const Bm=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e)));const Fm=e=>{const t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")};const qm=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class Vm extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Hm extends jm{constructor(e,t={}){super(e,t);this.mediaSource_=null;this.subtitlesTrack_=null;this.loaderType_="subtitle";this.featuresNativeTextTracks_=e.featuresNativeTextTracks;this.loadVttJs=e.loadVttJs;this.shouldSaveSegmentTimingInfo_=false}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length){return D()}const e=this.subtitlesTrack_.cues;const t=e[0].startTime;const i=e[e.length-1].startTime;return D([[t,i]])}initSegmentForMap(e,t=false){if(!e){return null}const i=Tf(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){const n=qm.byteLength+e.bytes.byteLength;const r=new Uint8Array(n);r.set(e.bytes);r.set(qm,e.bytes.byteLength);this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:r}}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}track(e){if(typeof e==="undefined"){return this.subtitlesTrack_}this.subtitlesTrack_=e;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}remove(e,t){rm(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(!e){return}if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY";if(!this.paused()){this.monitorBuffer_()}};this.syncController_.one("timestampoffset",t);this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){while(e&&e.segment.empty){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e);this.state="READY";this.pause();this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}this.saveTransferStats_(t.stats);if(!this.pendingSegment_){this.state="READY";this.mediaRequestsAborted+=1;return}if(e){if(e.code===mp.TIMEOUT){this.handleTimeout_()}if(e.code===mp.ABORTED){this.mediaRequestsAborted+=1}else{this.mediaRequestsErrored+=1}this.stopForError(e);return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats);if(t.key){this.segmentKey(t.key,true)}this.state="APPENDING";this.trigger("appending");const n=s.segment;if(n.map){n.map.bytes=t.map.bytes}s.bytes=t.bytes;if(typeof tv.WebVTT!=="function"&&typeof this.loadVttJs==="function"){this.state="WAITING_ON_VTTJS";this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=true;try{this.parseVTTCues_(s)}catch(e){this.stopForError({message:e.message});return}this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_);if(s.cues.length){s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}}else{s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration}}if(s.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}s.byteLength=s.bytes.byteLength;this.mediaSecondsLoaded+=n.duration;s.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new tv.VTTCue(e.startTime,e.endTime,e.text):e)});am(this.subtitlesTrack_);this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(t){let e;let i=false;if(typeof tv.WebVTT!=="function"){throw new Vm}if(typeof tv.TextDecoder==="function"){e=new tv.TextDecoder("utf8")}else{e=tv.WebVTT.StringDecoder();i=true}const s=new tv.WebVTT.Parser(tv,tv.vttjs,e);t.cues=[];t.timestampmap={MPEGTS:0,LOCAL:0};s.oncue=t.cues.push.bind(t.cues);s.ontimestampmap=e=>{t.timestampmap=e};s.onparsingerror=e=>{S.log.warn("Error encountered when parsing cues: "+e.message)};if(t.segment.map){let e=t.segment.map.bytes;if(i){e=Bm(e)}s.parse(e)}let n=t.bytes;if(i){n=Bm(n)}s.parse(n);s.flush()}updateTimeMapping_(e,t,i){const s=e.segment;if(!t){return}if(!e.cues.length){s.empty=true;return}const n=e.timestampmap;const r=n.MPEGTS/eh-n.LOCAL+t.mapping;e.cues.forEach(e=>{e.startTime+=r;e.endTime+=r});if(!i.syncInfo){const a=e.cues[0].startTime;const o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(a,o-s.duration)}}}}const $m=function(e,t){const i=e.cues;for(let e=0;e=s.adStartTime&&t<=s.adEndTime){return s}}return null};const zm=function(t,i,e=0){if(!t.segments){return}let s=e;let n;for(let e=0;e{if(i!==Infinity){const r={time:0,segmentIndex:0,partIndex:null};return r}return null}},{name:"MediaSequence",run:(e,t,i,s,n,r)=>{if(!r){return null}const a=e.getMediaSequenceMap(r);if(!a||a.size===0){return null}if(t.mediaSequence===undefined||!Array.isArray(t.segments)||!t.segments.length){return null}let o=t.mediaSequence;let l=0;for(const c of t.segments){const i=a.get(o);if(!i){break}if(n>=i.start&&n=d&&n{if(!Object.keys(s.timelineToDatetimeMappings).length){return null}let a=null;let o=null;const l=yh(n);r=r||0;for(let i=0;i{let r=null;let a=null;n=n||0;const o=yh(i);for(let t=0;t=d){a=d;r={time:u,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}}return r}},{name:"Discontinuity",run:(i,s,e,t,n)=>{let r=null;n=n||0;if(s.discontinuityStarts&&s.discontinuityStarts.length){let t=null;for(let e=0;e=c){t=c;r={time:l.time,segmentIndex:a,partIndex:null}}}}}return r}},{name:"Playlist",run:(e,t,i,s,n)=>{if(t.syncInfo){const r={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return r}return null}}];class Wm extends S.EventTarget{constructor(e={}){super();this.timelines=[];this.discontinuities=[];this.timelineToDatetimeMappings={};this.mediaSequenceStorage_=new Map;this.logger_=sh("SyncController")}getMediaSequenceMap(e){return this.mediaSequenceStorage_.get(e)}updateMediaSequenceMap(e,t,i){if(e.mediaSequence===undefined||!Array.isArray(e.segments)||!e.segments.length){return}const s=this.getMediaSequenceMap(i);const n=new Map;let r=e.mediaSequence;let a;if(!s){a=0}else if(s.has(e.mediaSequence)){a=s.get(e.mediaSequence).start}else{this.logger_(`MediaSequence sync for ${i} segment loader - received a gap between playlists. +Fallback base time to: ${t}. +Received media sequence: ${r}. +Current map: `,s);a=t}this.logger_(`MediaSequence sync for ${i} segment loader. +Received media sequence: ${r}. +base time is ${a} +Current map: `,s);e.segments.forEach(e=>{const t=a;const i=t+e.duration;const s={start:t,end:i};n.set(r,s);r++;a=i});this.mediaSequenceStorage_.set(i,n)}getSyncPoint(e,t,i,s,n){if(t!==Infinity){const a=Km.find(({name:e})=>e==="VOD");return a.run(this,e,t)}const r=this.runStrategies_(e,t,i,s,n);if(!r.length){return null}for(const o of r){const{syncPoint:l,strategy:c}=o;const{segmentIndex:u,time:d}=l;if(u<0){continue}const h=e.segments[u];const f=d;const p=f+h.duration;this.logger_(`Strategy: ${c}. Current time: ${s}. selected segment: ${u}. Time: [${f} -> ${p}]}`);if(s>=f&&s0){s.time*=-1}return Math.abs(s.time+jh({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(t,i,s,n,r){const a=[];for(let e=0;eGm){S.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let e=s-1;e>=0;e--){const n=t.segments[e];if(n&&typeof n.start!=="undefined"){i.syncInfo={mediaSequence:t.mediaSequence+e,time:n.start};this.logger_(`playlist refresh sync: [time:${i.syncInfo.time},`+` mediaSequence: ${i.syncInfo.mediaSequence}]`);this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){this.timelineToDatetimeMappings={};if(e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0];const i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t);const s=e.segment;if(i){this.saveDiscontinuitySyncInfo_(e);if(!e.playlist.syncInfo){e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}}}const n=s.dateTimeObject;if(s.discontinuity&&t&&n){this.timelineToDatetimeMappings[s.timeline]=-(n.getTime()/1e3)}}timestampOffsetForTimeline(e){if(typeof this.timelines[e]==="undefined"){return null}return this.timelines[e].time}mappingForTimeline(e){if(typeof this.timelines[e]==="undefined"){return null}return this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const s=e.segment;const n=e.part;let r=this.timelines[e.timeline];let a;let o;if(typeof e.timestampOffset==="number"){r={time:e.startOfSegment,mapping:e.startOfSegment-t.start};if(i){this.timelines[e.timeline]=r;this.trigger("timestampoffset");this.logger_(`time mapping for timeline ${e.timeline}: `+`[time: ${r.time}] [mapping: ${r.mapping}]`)}a=e.startOfSegment;o=t.end+r.mapping}else if(r){a=t.start+r.mapping;o=t.end+r.mapping}else{return false}if(n){n.start=a;n.end=o}if(!s.start||ao){let e;if(a<0){e=s.start-jh({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:t.mediaIndex,endIndex:n})}else{e=s.end+jh({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:t.mediaIndex+1,endIndex:n})}this.discontinuities[r]={time:e,accuracy:o}}}}}dispose(){this.trigger("dispose");this.off()}}class Ym extends S.EventTarget{constructor(){super();this.pendingTimelineChanges_={};this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null;this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){if(typeof t==="number"&&typeof i==="number"){this.pendingTimelineChanges_[e]={type:e,from:t,to:i};this.trigger("pendingtimelinechange")}return this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t==="number"&&typeof i==="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i};delete this.pendingTimelineChanges_[e];this.trigger("timelinechange")}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose");this.pendingTimelineChanges_={};this.lastTimelineChanges_={};this.off()}}const Xm=Jf(Zf(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n>7)*283)^r]=r}for(a=o=0;!s[a];a^=u||1,o=c[o]||1){f=o^o<<1^o<<2^o<<3^o<<4;f=f>>8^f&255^99;s[a]=f;n[f]=a;h=l[d=l[u=l[a]]];m=h*16843009^d*65537^u*257^a*16843008;p=l[f]*257^f*16843008;for(r=0;r<4;r++){t[r][a]=p=p<<24^p>>>8;i[r][f]=m=m<<24^m>>>8}}for(r=0;r<5;r++){t[r]=t[r].slice(0);i[r]=i[r].slice(0)}return e};let d=null;class g{constructor(e){if(!d){d=u()}this._tables=[[d[0][0].slice(),d[0][1].slice(),d[0][2].slice(),d[0][3].slice(),d[0][4].slice()],[d[1][0].slice(),d[1][1].slice(),d[1][2].slice(),d[1][3].slice(),d[1][4].slice()]];let t;let i;let s;const n=this._tables[0][4];const r=this._tables[1];const a=e.length;let o=1;if(a!==4&&a!==6&&a!==8){throw new Error("Invalid aes key size")}const l=e.slice(0);const c=[];this._key=[l,c];for(t=a;t<4*a+28;t++){s=l[t-1];if(t%a===0||a===8&&t%a===4){s=n[s>>>24]<<24^n[s>>16&255]<<16^n[s>>8&255]<<8^n[s&255];if(t%a===0){s=s<<8^s>>>24^o<<24;o=o<<1^(o>>7)*283}}l[t]=l[t-a]^s}for(i=0;t;i++,t--){s=l[i&3?t:t-4];if(t<=4||i<4){c[i]=s}else{c[i]=r[0][n[s>>>24]]^r[1][n[s>>16&255]]^r[2][n[s>>8&255]]^r[3][n[s&255]]}}}decrypt(e,t,i,s,n,r){const a=this._key[1];let o=e^a[0];let l=s^a[1];let c=i^a[2];let u=t^a[3];let d;let h;let f;const p=a.length/4-2;let m;let g=4;const v=this._tables[1];const y=v[0];const b=v[1];const _=v[2];const T=v[3];const S=v[4];for(m=0;m>>24]^b[l>>16&255]^_[c>>8&255]^T[u&255]^a[g];h=y[l>>>24]^b[c>>16&255]^_[u>>8&255]^T[o&255]^a[g+1];f=y[c>>>24]^b[u>>16&255]^_[o>>8&255]^T[l&255]^a[g+2];u=y[u>>>24]^b[o>>16&255]^_[l>>8&255]^T[c&255]^a[g+3];g+=4;o=d;l=h;c=f}for(m=0;m<4;m++){n[(3&-m)+r]=S[o>>>24]<<24^S[l>>16&255]<<16^S[c>>8&255]<<8^S[u&255]^a[g++];d=o;o=l;l=c;c=u;u=d}}}class c extends e{constructor(){super(e);this.jobs=[];this.delay=1;this.timeout_=null}processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}}push(e){this.jobs.push(e);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}}const v=function(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24};const r=function(e,t,i){const s=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2);const n=new g(Array.prototype.slice.call(t));const r=new Uint8Array(e.byteLength);const a=new Int32Array(r.buffer);let o;let l;let c;let u;let d;let h;let f;let p;let m;o=i[0];l=i[1];c=i[2];u=i[3];for(m=0;m{const t=i[e];if(n(t)){s[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}}else{s[e]=t}});return s};self.onmessage=function(e){const i=e.data;const t=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength);const s=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4);const n=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new h(t,s,n,function(e,t){self.postMessage(o({source:i.source,decrypted:t}),[t.buffer])})}}));var Qm=Qf(Xm);const Jm=e=>{let t=e.default?"main":"alternative";if(e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0){t="main-desc"}return t};const Zm=(e,t)=>{e.abort();e.pause();if(t&&t.activePlaylistLoader){t.activePlaylistLoader.pause();t.activePlaylistLoader=null}};const eg=(e,t)=>{t.activePlaylistLoader=e;e.load()};const tg=(o,l)=>()=>{const{segmentLoaders:{[o]:e,main:t},mediaTypes:{[o]:i}}=l;const s=i.activeTrack();const n=i.getActiveGroup();const r=i.activePlaylistLoader;const a=i.lastGroup_;if(n&&a&&n.id===a.id){return}i.lastGroup_=n;i.lastTrack_=s;Zm(e,i);if(!n||n.isMainPlaylist){return}if(!n.playlistLoader){if(r){t.resetEverything()}return}e.resyncLoader();eg(n.playlistLoader,i)};const ig=(i,s)=>()=>{const{segmentLoaders:{[i]:e},mediaTypes:{[i]:t}}=s;t.lastGroup_=null;e.abort();e.pause()};const sg=(u,d)=>()=>{const{mainPlaylistLoader:e,segmentLoaders:{[u]:t,main:i},mediaTypes:{[u]:s}}=d;const n=s.activeTrack();const r=s.getActiveGroup();const a=s.activePlaylistLoader;const o=s.lastTrack_;if(o&&n&&o.id===n.id){return}s.lastGroup_=r;s.lastTrack_=n;Zm(t,s);if(!r){return}if(r.isMainPlaylist){if(!n||!o||n.id===o.id){return}const l=d.vhs.playlistController_;const c=l.selectPlaylist();if(l.media()===c){return}s.logger_(`track change. Switching main audio from ${o.id} to ${n.id}`);e.pause();i.resetEverything();l.fastQualityChange_(c);return}if(u==="AUDIO"){if(!r.playlistLoader){i.setAudio(true);i.resetEverything();return}t.setAudio(true);i.setAudio(false)}if(a===r.playlistLoader){eg(r.playlistLoader,s);return}if(t.track){t.track(n)}t.resetEverything();eg(r.playlistLoader,s)};const ng={AUDIO:(o,l)=>()=>{const{mediaTypes:{[o]:e},excludePlaylist:t}=l;const i=e.activeTrack();const s=e.activeGroup();const n=(s.filter(e=>e.default)[0]||s[0]).id;const r=e.tracks[n];if(i===r){t({error:{message:"Problem encountered loading the default audio track."}});return}S.log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(const a in e.tracks){e.tracks[a].enabled=e.tracks[a]===r}e.onTrackChanged()},SUBTITLES:(i,s)=>()=>{const{mediaTypes:{[i]:e}}=s;S.log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");const t=e.activeTrack();if(t){t.mode="disabled"}e.onTrackChanged()}};const rg={AUDIO:(e,t,i)=>{if(!t){return}const{tech:s,requestOptions:n,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,n);if(!s.paused()||e.endList&&s.preload()!=="none"){r.load()}});t.on("loadedplaylist",()=>{r.playlist(t.media(),n);if(!s.paused()){r.load()}});t.on("error",ng[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,n);r.track(a.activeTrack());if(!s.paused()||e.endList&&s.preload()!=="none"){r.load()}});t.on("loadedplaylist",()=>{r.playlist(t.media(),n);if(!s.paused()){r.load()}});t.on("error",ng[e](e,i))}};const ag={AUDIO:(i,s)=>{const{vhs:n,sourceType:r,segmentLoaders:{[i]:e},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:c,logger_:u}},mainPlaylistLoader:d}=s;const h=Fh(d.main);if(!o[i]||Object.keys(o[i]).length===0){o[i]={main:{default:{default:true}}};if(h){o[i].main.default.playlists=d.main.playlists}}for(const f in o[i]){if(!l[f]){l[f]=[]}for(const p in o[i][f]){let e=o[i][f][p];let t;if(h){u(`AUDIO group '${f}' label '${p}' is a main playlist`);e.isMainPlaylist=true;t=null}else if(r==="vhs-json"&&e.playlists){t=new cf(e.playlists[0],n,a)}else if(e.resolvedUri){t=new cf(e.resolvedUri,n,a)}else if(e.playlists&&r==="dash"){t=new Kf(e.playlists[0],n,a,d)}else{t=null}e=L({id:p,playlistLoader:t},e);rg[i](i,e.playlistLoader,s);l[f].push(e);if(typeof c[p]==="undefined"){const m=new S.AudioTrack({id:p,kind:Jm(e),enabled:false,language:e.language,default:e.default,label:p});c[p]=m}}}e.on("error",ng[i](i,s))},SUBTITLES:(i,s)=>{const{tech:n,vhs:r,sourceType:a,segmentLoaders:{[i]:e},requestOptions:o,main:{mediaGroups:l},mediaTypes:{[i]:{groups:c,tracks:u}},mainPlaylistLoader:d}=s;for(const h in l[i]){if(!c[h]){c[h]=[]}for(const f in l[i][h]){if(!r.options_.useForcedSubtitles&&l[i][h][f].forced){continue}let e=l[i][h][f];let t;if(a==="hls"){t=new cf(e.resolvedUri,r,o)}else if(a==="dash"){const p=e.playlists.filter(e=>e.excludeUntil!==Infinity);if(!p.length){return}t=new Kf(e.playlists[0],r,o,d)}else if(a==="vhs-json"){t=new cf(e.playlists?e.playlists[0]:e.resolvedUri,r,o)}e=L({id:f,playlistLoader:t},e);rg[i](i,e.playlistLoader,s);c[h].push(e);if(typeof u[f]==="undefined"){const m=n.addRemoteTextTrack({id:f,kind:"subtitles",default:e.default&&e.autoselect,language:e.language,label:f},false).track;u[f]=m}}}e.on("error",ng[i](i,s))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[t]:{groups:n,tracks:r}}}=e;for(const a in s[t]){if(!n[a]){n[a]=[]}for(const o in s[t][a]){const l=s[t][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId)){continue}const c=i.options_.vhs&&i.options_.vhs.captionServices||{};let e={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[e.instreamId]){e=L(e,c[e.instreamId])}if(e.default===undefined){delete e.default}n[a].push(L({id:o},l));if(typeof r[o]==="undefined"){const u=i.addRemoteTextTrack({id:e.instreamId,kind:"captions",default:e.default,language:e.language,label:e.label},false).track;r[o]=u}}}}};const og=(t,i)=>{for(let e=0;et=>{const{mainPlaylistLoader:e,mediaTypes:{[o]:{groups:i}}}=l;const s=e.media();if(!s){return null}let n=null;if(s.attributes[o]){n=i[s.attributes[o]]}const r=Object.keys(i);if(!n){if(o==="AUDIO"&&r.length>1&&Fh(l.main)){for(let e=0;ee.id===t.id)[0]||null};const cg={AUDIO:(i,s)=>()=>{const{mediaTypes:{[i]:{tracks:e}}}=s;for(const t in e){if(e[t].enabled){return e[t]}}return null},SUBTITLES:(i,s)=>()=>{const{mediaTypes:{[i]:{tracks:e}}}=s;for(const t in e){if(e[t].mode==="showing"||e[t].mode==="hidden"){return e[t]}}return null}};const ug=(t,{mediaTypes:i})=>()=>{const e=i[t].activeTrack();if(!e){return null}return i[t].activeGroup(e)};const dg=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{ag[e](e,t)});const{mediaTypes:i,mainPlaylistLoader:e,tech:s,vhs:n,segmentLoaders:{["AUDIO"]:r,main:a}}=t;["AUDIO","SUBTITLES"].forEach(e=>{i[e].activeGroup=lg(e,t);i[e].activeTrack=cg[e](e,t);i[e].onGroupChanged=tg(e,t);i[e].onGroupChanging=ig(e,t);i[e].onTrackChanged=sg(e,t);i[e].getActiveGroup=ug(e,t)});const o=i.AUDIO.activeGroup();if(o){const c=(o.filter(e=>e.default)[0]||o[0]).id;i.AUDIO.tracks[c].enabled=true;i.AUDIO.onGroupChanged();i.AUDIO.onTrackChanged();const u=i.AUDIO.getActiveGroup();if(!u.playlistLoader){a.setAudio(true)}else{a.setAudio(false);r.setAudio(true)}}e.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>i[e].onGroupChanged())});e.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>i[e].onGroupChanging())});const l=()=>{i.AUDIO.onTrackChanged();s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l);s.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged);n.on("dispose",()=>{s.audioTracks().removeEventListener("change",l);s.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)});s.clearTracks("audio");for(const d in i.AUDIO.tracks){s.audioTracks().addTrack(i.AUDIO.tracks[d])}};const hg=()=>{const t={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Cm,activeTrack:Cm,getActiveGroup:Cm,onGroupChanged:Cm,onTrackChanged:Cm,lastTrack_:null,logger_:sh(`MediaGroups[${e}]`)}});return t};class fg{constructor(){this.priority_=[];this.pathwayClones_=new Map}set version(e){if(e===1){this.version_=e}}set ttl(e){this.ttl_=e||300}set reloadUri(e){if(e){this.reloadUri_=th(this.reloadUri_,e)}}set priority(e){if(e&&e.length){this.priority_=e}}set pathwayClones(e){if(e&&e.length){this.pathwayClones_=new Map(e.map(e=>[e.ID,e]))}}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class pg extends S.EventTarget{constructor(e,t){super();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=false;this.availablePathways_=new Set;this.steeringManifest=new fg;this.proxyServerUrl_=null;this.manifestType_=null;this.ttlTimeout_=null;this.request_=null;this.currentPathwayClones=new Map;this.nextPathwayClones=new Map;this.excludedSteeringManifestURLs=new Set;this.logger_=sh("Content Steering");this.xhr_=e;this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`);this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=th(e,i);this.defaultPathway=t.pathwayId||t.defaultServiceLocation;this.queryBeforeStart=t.queryBeforeStart;this.proxyServerUrl_=t.proxyServerURL;if(this.defaultPathway&&!this.queryBeforeStart){this.trigger("content-steering")}}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t){return}const n=e?t:this.getRequestURI(t);if(!n){this.logger_("No valid content steering manifest URIs. Stopping content steering.");this.trigger("error");this.dispose();return}this.request_=this.xhr_({uri:n},(e,t)=>{if(e){if(t.status===410){this.logger_(`manifest request 410 ${e}.`);this.logger_(`There will be no more content steering requests to ${n} this session.`);this.excludedSteeringManifestURLs.add(n);return}if(t.status===429){const s=t.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${e}.`);this.logger_(`content steering will retry in ${s} seconds.`);this.startTTLTimeout_(parseInt(s,10));return}this.logger_(`manifest failed to load ${e}.`);this.startTTLTimeout_();return}const i=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(i);this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new tv.URL(e);const i=new tv.URL(this.proxyServerUrl_);i.searchParams.set("url",encodeURI(t.toString()));return this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(tv.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new tv.URL(e);const i=this.getPathway();const s=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(s){const r=`_${this.manifestType_}_throughput`;t.searchParams.set(r,s)}return t.toString()}assignSteeringProperties_(e){this.steeringManifest.version=e.VERSION;if(!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`);this.trigger("error");return}this.steeringManifest.ttl=e.TTL;this.steeringManifest.reloadUri=e["RELOAD-URI"];this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"];this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"];this.nextPathwayClones=this.steeringManifest.pathwayClones;if(!this.availablePathways_.size){this.logger_("There are no available pathways for content steering. Ending content steering.");this.trigger("error");this.dispose()}const t=e=>{for(const t of e){if(this.availablePathways_.has(t)){return t}}return[...this.availablePathways_][0]};const i=t(this.steeringManifest.priority);if(this.currentPathway!==i){this.currentPathway=i;this.trigger("content-steering")}}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e){return null}const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const s=this.setProxyServerUrl_(e);if(!t(s)){return s}}const i=this.setSteeringParams_(e);if(!t(i)){return i}return null}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=tv.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){tv.clearTimeout(this.ttlTimeout_);this.ttlTimeout_=null}abort(){if(this.request_){this.request_.abort()}this.request_=null}dispose(){this.off("content-steering");this.off("error");this.abort();this.clearTTLTimeout_();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=null;this.proxyServerUrl_=null;this.manifestType_=null;this.ttlTimeout_=null;this.request_=null;this.excludedSteeringManifestURLs=new Set;this.availablePathways_=new Set;this.steeringManifest=new fg}addAvailablePathway(e){if(e){this.availablePathways_.add(e)}}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(th(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const mg=10;let gg;const vg=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"];const yg=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};const bg=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}){if(!s){S.log.warn("We received no playlist to switch to. Please check your stream.");return false}const c=`allowing switch ${e&&e.id||"null"} -> ${s.id}`;if(!e){l(`${c} as current playlist is not set`);return true}if(s.id===e.id){return false}const u=Boolean(oh(t,i).length);if(!e.endList){if(!u&&typeof e.partTargetDuration==="number"){l(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`);return false}l(`${c} as current playlist is live`);return true}const d=gh(t,i);const h=o?O.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:O.MAX_BUFFER_LOW_WATER_LINE;if(ap)&&d>=n){let e=`${c} as forwardBuffer >= bufferLowWaterLine (${d} >= ${n})`;if(o){e+=` and next bandwidth > current bandwidth (${f} > ${p})`}l(e);return true}l(`not ${c} as no switching criteria met`);return false};class _g extends S.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:n,bandwidth:s,externVhs:r,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:c,cacheEncryptionKeys:u,bufferBasedABR:d,leastPixelDiffSelector:h,captionServices:f}=e;if(!t){throw new Error("A non-empty playlist URL or JSON manifest string is required")}let{maxPlaylistRetries:p}=e;if(p===null||typeof p==="undefined"){p=Infinity}gg=r;this.bufferBasedABR=Boolean(d);this.leastPixelDiffSelector=Boolean(h);this.withCredentials=i;this.tech_=n;this.vhs_=n.vhs;this.sourceType_=c;this.useCueTags_=a;this.playlistExclusionDuration=o;this.maxPlaylistRetries=p;this.enableLowInitialPlaylist=l;if(this.useCueTags_){this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues");this.cueTagsTrack_.inBandMetadataTrackDispatchType=""}this.requestOptions_={withCredentials:i,maxPlaylistRetries:p,timeout:null};this.on("error",this.pauseLoading);this.mediaTypes_=hg();this.mediaSource=new tv.MediaSource;this.handleDurationChange_=this.handleDurationChange_.bind(this);this.handleSourceOpen_=this.handleSourceOpen_.bind(this);this.handleSourceEnded_=this.handleSourceEnded_.bind(this);this.mediaSource.addEventListener("durationchange",this.handleDurationChange_);this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_);this.seekable_=D();this.hasPlayed_=false;this.syncController_=new Wm(e);this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;this.decrypter_=new Qm;this.sourceUpdater_=new Um(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new Ym;this.keyStatusMap_=new Map;const m={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:u,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Kf(t,this.vhs_,L(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new cf(t,this.vhs_,L(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)}));this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new jm(L(m,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e);this.audioSegmentLoader_=new jm(L(m,{loaderType:"audio"}),e);this.subtitleSegmentLoader_=new Hm(L(m,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){n.off("vttjserror",s);e()}function s(){n.off("vttjsloaded",i);t()}n.one("vttjsloaded",i);n.one("vttjserror",s);n.addWebVttScript_()})}),e);const g=()=>{return this.mainSegmentLoader_.bandwidth};this.contentSteeringController_=new pg(this.vhs_.xhr,g);this.setupSegmentLoaderListeners_();if(this.bufferBasedABR){this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_());this.tech_.on("pause",()=>this.stopABRTimer_());this.tech_.on("play",()=>this.startABRTimer_())}vg.forEach(e=>{this[e+"_"]=yg.bind(this,e)});this.logger_=sh("pc");this.triggeredFmp4Usage=false;if(this.tech_.preload()==="none"){this.loadOnPlay_=()=>{this.loadOnPlay_=null;this.mainPlaylistLoader_.load()};this.tech_.one("play",this.loadOnPlay_)}else{this.mainPlaylistLoader_.load()}this.timeToLoadedData__=-1;this.mainAppendsToLoadedData__=-1;this.audioAppendsToLoadedData__=-1;const v=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(v,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_();const t=this.audioAppendsToLoadedData_();if(e===-1||t===-1){return-1}return e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();if(t&&this.shouldSwitchToMedia_(t)){this.switchMedia_(t,e)}}switchMedia_(e,t,i){const s=this.media();const n=s&&(s.id||s.uri);const r=e&&(e.id||e.uri);if(n&&n!==r){this.logger_(`switch media ${n} -> ${r} from ${t}`);this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e];const i=t?t.activeGroup():null;const s=this.contentSteeringController_.getPathway();if(i&&s){const n=i.length?i[0].playlists:i.playlists;const r=n.filter(e=>e.attributes.serviceLocation===s);if(r.length){this.mediaTypes_[e].activePlaylistLoader.media(r[0])}}})}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=tv.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing()){return}tv.clearInterval(this.abrTimer_);this.abrTimer_=null}getAudioTrackPlaylists_(){const t=this.main();const e=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO){return e}const i=t.mediaGroups.AUDIO;const s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length){n=this.mediaTypes_.AUDIO.activeTrack()}else{const a=i.main||s.length&&i[s[0]];for(const o in a){if(a[o].default){n={label:o};break}}}if(!n){return e}const r=[];for(const l in i){if(i[l][n.label]){const c=i[l][n.label];if(c.playlists&&c.playlists.length){r.push.apply(r,c.playlists)}else if(c.uri){r.push(c)}else if(t.playlists.length){for(let e=0;e{const e=this.mainPlaylistLoader_.media();const t=e.targetDuration*1.5*1e3;if(Mh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=t}if(e.endList&&this.tech_.preload()!=="none"){this.mainSegmentLoader_.playlist(e,this.requestOptions_);this.mainSegmentLoader_.load()}dg({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)});this.triggerPresenceUsage_(this.main(),e);this.setupFirstPlay();if(!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()){this.trigger("selectedinitialmedia")}else{this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}});this.mainPlaylistLoader_.on("loadedplaylist",()=>{if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_();this.initContentSteeringController_();this.excludeUnsupportedVariants_();let e;if(this.enableLowInitialPlaylist){e=this.selectInitialPlaylist()}if(!e){e=this.selectPlaylist()}if(!e||!this.shouldSwitchToMedia_(e)){return}this.initialMedia_=e;this.switchMedia_(this.initialMedia_,"initial");const i=this.sourceType_==="vhs-json"&&this.initialMedia_.segments;if(!i){return}t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)});this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})});this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort();this.mainSegmentLoader_.pause()});this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media();const t=e.targetDuration*1.5*1e3;if(Mh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=t}if(this.sourceType_==="dash"){this.mainPlaylistLoader_.load()}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(e,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}else{this.mainSegmentLoader_.load()}this.tech_.trigger({type:"mediachange",bubbles:true})});this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged"){return}const t=this.stuckAtPlaylistEnd_(e);if(t){this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}});this.tech_.trigger("playliststuck")}});this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})});this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){if(this.useCueTags_){this.updateAdCues_(e)}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(e,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}this.updateDuration(!e.endList);if(!this.tech_.paused()){this.mainSegmentLoader_.load();if(this.audioSegmentLoader_){this.audioSegmentLoader_.load()}}}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let s=true;const n=Object.keys(i.AUDIO);for(const r in i.AUDIO){for(const a in i.AUDIO[r]){const o=i.AUDIO[r][a];if(!o.uri){s=false}}}if(s){this.tech_.trigger({type:"usage",name:"vhs-demuxed"})}if(Object.keys(i.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"vhs-webvtt"})}if(gg.Playlist.isAes(t)){this.tech_.trigger({type:"usage",name:"vhs-aes"})}if(n.length&&Object.keys(i.AUDIO[n[0]]).length>1){this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_;const i=this.tech_.currentTime();const s=this.bufferLowWaterLine();const n=this.bufferHighWaterLine();const r=this.tech_.buffered();return bg({buffered:r,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate");this.tech_.trigger("bandwidthupdate")});this.mainSegmentLoader_.on("timeout",()=>{if(this.bufferBasedABR){this.mainSegmentLoader_.load()}});if(!this.bufferBasedABR){this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")})}this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})});this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended");this.onEndOfStream()});this.mainSegmentLoader_.on("earlyabort",e=>{if(this.bufferBasedABR){return}this.delegateLoaders_("all",["abort"]);this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete "+"the request without rebuffering."},playlistExclusionDuration:mg})});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_()}const e=this.getCodecsOrExclude_();if(!e){return}this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e);this.audioSegmentLoader_.on("trackinfo",e);this.mainSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}});this.audioSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}});this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended");this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality");this.waitingForFastQualityPlaylistReceived_=true}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=false;this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.tech_.setCurrentTime(0)}if(this.hasPlayed_){this.load()}const e=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime(){})}}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_){return}const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length){return}const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===Infinity?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();if(!t||t.hasVideo){e=e&&this.audioSegmentLoader_.ended_}else{e=this.audioSegmentLoader_.ended_}}if(!e){return}this.stopABRTimer_();this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(e){const t=this.seekable();if(!t.length){return false}const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return false}const s=gg.Playlist.playlistEnd(e,i);const n=this.tech_.currentTime();const r=this.tech_.buffered();if(!r.length){return s-n<=rh}const a=r.end(r.length-1);return a-n<=rh&&s-a<=rh}excludePlaylist({playlistToExclude:s=this.mainPlaylistLoader_.media(),error:e={},playlistExclusionDuration:t}){s=s||this.mainPlaylistLoader_.media();t=t||e.playlistExclusionDuration||this.playlistExclusionDuration;if(!s){this.error=e;if(this.mediaSource.readyState!=="open"){this.trigger("error")}else{this.sourceUpdater_.endOfStream("network")}return}s.playlistErrors_++;const n=this.mainPlaylistLoader_.main.playlists;const i=n.filter(Oh);const r=i.length===1&&i[0]===s;if(n.length===1&&t!==Infinity){S.log.warn(`Problem encountered with playlist ${s.id}. `+"Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.mainPlaylistLoader_.load(r)}if(r){if(this.main().contentSteering){const h=this.pathwayAttribute_(s);const f=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(h);this.excludeThenChangePathway_();setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(h)},f);return}let i=false;n.forEach(e=>{if(e===s){return}const t=e.excludeUntil;if(typeof t!=="undefined"&&t!==Infinity){i=true;delete e.excludeUntil}});if(i){S.log.warn("Removing other playlists from the exclusion list because the last "+"rendition is about to be excluded.");this.tech_.trigger("retryplaylist")}}let a;if(s.playlistErrors_>this.maxPlaylistRetries){a=Infinity}else{a=Date.now()+t*1e3}s.excludeUntil=a;if(e.reason){s.lastExcludeReason_=e.reason}this.tech_.trigger("excludeplaylist");this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o){this.error="Playback cannot continue. No available working or supported playlists.";this.trigger("error");return}const l=e.internal?this.logger_:S.log.warn;const c=e.message?" "+e.message:"";l(`${e.internal?"Internal problem":"Problem"} encountered with playlist ${s.id}.`+`${c} Switching to playlist ${o.id}.`);if(o.attributes.AUDIO!==s.attributes.AUDIO){this.delegateLoaders_("audio",["abort","pause"])}if(o.attributes.SUBTITLES!==s.attributes.SUBTITLES){this.delegateLoaders_("subtitle",["abort","pause"])}this.delegateLoaders_("main",["abort","pause"]);const u=o.targetDuration/2*1e3||5*1e3;const d=typeof o.lastRequest==="number"&&Date.now()-o.lastRequest<=u;return this.switchMedia_(o,"exclude",r||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(i,e){const s=[];const t=i==="all";if(t||i==="main"){s.push(this.mainPlaylistLoader_)}const n=[];if(t||i==="audio"){n.push("AUDIO")}if(t||i==="subtitle"){n.push("CLOSED-CAPTIONS");n.push("SUBTITLES")}n.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;if(t){s.push(t)}});["main","audio","subtitle"].forEach(e=>{const t=this[`${e}SegmentLoader_`];if(t&&(i===e||i==="all")){s.push(t)}});s.forEach(t=>e.forEach(e=>{if(typeof t[e]==="function"){t[e]()}}))}setCurrentTime(e){const t=oh(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())){return 0}if(!this.mainPlaylistLoader_.media().segments){return 0}if(t&&t.length){return e}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.pause();this.audioSegmentLoader_.resetEverything()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.pause();this.subtitleSegmentLoader_.resetEverything()}this.load()}duration(){if(!this.mainPlaylistLoader_){return 0}const e=this.mainPlaylistLoader_.media();if(!e){return 0}if(!e.endList){return Infinity}if(this.mediaSource){return this.mediaSource.duration}return gg.Playlist.duration(e)}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_){return}let t=this.mainPlaylistLoader_.media();if(!t){return}let i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return}const s=this.mainPlaylistLoader_.main;const n=gg.Playlist.seekable(t,i,gg.Playlist.liveEdgeDelay(s,t));if(n.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){t=this.mediaTypes_.AUDIO.activePlaylistLoader.media();i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return}e=gg.Playlist.seekable(t,i,gg.Playlist.liveEdgeDelay(s,t));if(e.length===0){return}}let r;let a;if(this.seekable_&&this.seekable_.length){r=this.seekable_.end(0);a=this.seekable_.start(0)}if(!e){this.seekable_=n}else if(e.start(0)>n.end(0)||n.start(0)>e.end(0)){this.seekable_=n}else{this.seekable_=D([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0){i=Math.max(i,t.end(t.length-1))}if(this.mediaSource.duration!==i){this.sourceUpdater_.setDuration(i)}}dispose(){this.trigger("dispose");this.decrypter_.terminate();this.mainPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();this.contentSteeringController_.dispose();this.keyStatusMap_.clear();if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t){t[i].forEach(e=>{if(e.playlistLoader){e.playlistLoader.dispose()}})}});this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.sourceUpdater_.dispose();this.timelineChangeController_.dispose();this.stopABRTimer_();if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_)}this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_);this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_);this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader;const t=!!this.mainSegmentLoader_.getCurrentMediaInfo_();const i=!e?true:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!t||!i){return false}return true}getCodecsOrExclude_(){const i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};const s=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();i.video=i.main;const e=Up(this.main(),s);const n={};const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo){n.video=e.video||i.main.videoCodec||no}if(i.main.isMuxed){n.video+=`,${e.audio||i.main.audioCodec||so}`}if(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||t){n.audio=e.audio||i.main.audioCodec||i.audio.audioCodec||so;i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4}if(!n.audio&&!n.video){this.excludePlaylist({playlistToExclude:s,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity});return}const r=(e,t)=>e?to(t):io(t);const a={};let o;["video","audio"].forEach(function(e){if(n.hasOwnProperty(e)&&!r(i[e].isFmp4,n[e])){const t=i[e].isFmp4?"browser":"muxer";a[t]=a[t]||[];a[t].push(n[e]);if(e==="audio"){o=t}}});if(t&&o&&s.attributes.AUDIO){const l=s.attributes.AUDIO;this.main().playlists.forEach(e=>{const t=e.attributes&&e.attributes.AUDIO;if(t===l&&e!==s){e.excludeUntil=Infinity}});this.logger_(`excluding audio group ${l} as ${o} does not support codec(s): "${n.audio}"`)}if(Object.keys(a).length){const c=Object.keys(a).reduce((e,t)=>{if(e){e+=", "}e+=`${t} does not support codec(s): "${a[t].join(",")}"`;return e},"")+".";this.excludePlaylist({playlistToExclude:s,error:{internal:true,message:c},playlistExclusionDuration:Infinity});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];["video","audio"].forEach(e=>{const t=(Xa(this.sourceUpdater_.codecs[e]||"")[0]||{}).type;const i=(Xa(n[e]||"")[0]||{}).type;if(t&&i&&t.toLowerCase()!==i.toLowerCase()){u.push(`"${this.sourceUpdater_.codecs[e]}" -> "${n[e]}"`)}});if(u.length){this.excludePlaylist({playlistToExclude:s,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:true},playlistExclusionDuration:Infinity});return}}return n}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()){return}if(!this.areMediaTypesKnown_()){return}const e=this.getCodecsOrExclude_();if(!e){return}this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const n=this.main().playlists;const r=[];Object.keys(n).forEach(e=>{const t=n[e];if(r.indexOf(t.id)!==-1){return}r.push(t.id);const i=Up(this.main,t);const s=[];if(i.audio&&!io(i.audio)&&!to(i.audio)){s.push(`audio codec ${i.audio}`)}if(i.video&&!io(i.video)&&!to(i.video)){s.push(`video codec ${i.video}`)}if(i.text&&i.text==="stpp.ttml.im1t"){s.push(`text codec ${i.text}`)}if(s.length){t.excludeUntil=Infinity;this.logger_(`excluding ${t.id} for unsupported: ${s.join(", ")}`)}})}excludeIncompatibleVariants_(e){const o=[];const l=this.main().playlists;const t=Np(Xa(e));const c=Mp(t);const u=t.video&&Xa(t.video)[0]||null;const d=t.audio&&Xa(t.audio)[0]||null;Object.keys(l).forEach(e=>{const t=l[e];if(o.indexOf(t.id)!==-1||t.excludeUntil===Infinity){return}o.push(t.id);const i=[];const s=Up(this.mainPlaylistLoader_.main,t);const n=Mp(s);if(!s.audio&&!s.video){return}if(n!==c){i.push(`codec count "${n}" !== "${c}"`)}if(!this.sourceUpdater_.canChangeType()){const r=s.video&&Xa(s.video)[0]||null;const a=s.audio&&Xa(s.audio)[0]||null;if(r&&u&&r.type.toLowerCase()!==u.type.toLowerCase()){i.push(`video codec "${r.type}" !== "${u.type}"`)}if(a&&d&&a.type.toLowerCase()!==d.type.toLowerCase()){i.push(`audio codec "${a.type}" !== "${d.type}"`)}}if(i.length){t.excludeUntil=Infinity;this.logger_(`excluding ${t.id}: ${i.join(" && ")}`)}})}updateAdCues_(e){let t=0;const i=this.seekable();if(i.length){t=i.start(0)}zm(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime();const t=O.GOAL_BUFFER_LENGTH;const i=O.GOAL_BUFFER_LENGTH_RATE;const s=Math.max(t,O.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s)}bufferLowWaterLine(){const e=this.tech_.currentTime();const t=O.BUFFER_LOW_WATER_LINE;const i=O.BUFFER_LOW_WATER_LINE_RATE;const s=Math.max(t,O.MAX_BUFFER_LOW_WATER_LINE);const n=Math.max(t,O.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return O.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){nm(this.inbandTextTracks_,"com.apple.streaming",this.tech_);sm({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();nm(this.inbandTextTracks_,e,this.tech_);em({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(!e.contentSteering){return}for(const t of e.playlists){this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t))}this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering);if(this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(true);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways();this.contentSteeringController_.dispose();this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));if(this.sourceType_==="dash"){this.mainPlaylistLoader_.on("loadedplaylist",()=>{const n=this.main();const e=this.contentSteeringController_.didDASHTagChange(n.uri,n.contentSteering);const t=()=>{const e=this.contentSteeringController_.getAvailablePathways();const t=[];for(const i of n.playlists){const s=i.attributes.serviceLocation;if(s){t.push(s);if(!e.has(s)){return true}}}if(!t.length&&e.size){return true}return false};if(e||t()){this.resetContentSteeringController_()}})}}excludeThenChangePathway_(){const o=this.contentSteeringController_.getPathway();if(!o){return}this.handlePathwayClones_();const e=this.main();const l=e.playlists;const c=new Set;let u=false;Object.keys(l).forEach(e=>{const t=l[e];const i=this.pathwayAttribute_(t);const s=i&&o!==i;const n=t.excludeUntil===Infinity&&t.lastExcludeReason_==="content-steering";if(n&&!s){delete t.excludeUntil;delete t.lastExcludeReason_;u=true}const r=!t.excludeUntil&&t.excludeUntil!==Infinity;const a=!c.has(t.id)&&s&&r;if(!a){return}c.add(t.id);t.excludeUntil=Infinity;t.lastExcludeReason_="content-steering";this.logger_(`excluding ${t.id} for ${t.lastExcludeReason_}`)});if(this.contentSteeringController_.manifestType_==="DASH"){Object.keys(this.mediaTypes_).forEach(e=>{const t=this.mediaTypes_[e];if(t.activePlaylistLoader){const i=t.activePlaylistLoader.media_;if(i&&i.attributes.serviceLocation!==o){u=true}}})}if(u){this.changeSegmentPathway_()}}handlePathwayClones_(){const e=this.main();const t=e.playlists;const i=this.contentSteeringController_.currentPathwayClones;const s=this.contentSteeringController_.nextPathwayClones;const n=i&&i.size||s&&s.size;if(!n){return}for(const[r,a]of i.entries()){const o=s.get(r);if(!o){this.mainPlaylistLoader_.updateOrDeleteClone(a);this.contentSteeringController_.excludePathway(r)}}for(const[r,a]of s.entries()){const l=i.get(r);if(!l){const c=t.filter(e=>{return e.attributes["PATHWAY-ID"]===a["BASE-ID"]});c.forEach(e=>{this.mainPlaylistLoader_.addClonePathway(a,e)});this.contentSteeringController_.addAvailablePathway(r);continue}if(this.equalPathwayClones_(l,a)){continue}this.mainPlaylistLoader_.updateOrDeleteClone(a,true);this.contentSteeringController_.addAvailablePathway(r)}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...s])))}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST){return false}const i=e["URI-REPLACEMENT"].PARAMS;const s=t["URI-REPLACEMENT"].PARAMS;for(const n in i){if(i[n]!==s[n]){return false}}for(const n in s){if(i[n]!==s[n]){return false}}return true}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading();if(this.contentSteeringController_.manifestType_==="DASH"){this.switchMediaForDASHContentSteering_()}this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main){return}let r=0;const a="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(n=>{const e=this.mainPlaylistLoader_.getKeyIdSet(n);if(!e||!e.size){return}e.forEach(e=>{const t="usable";const i=this.keyStatusMap_.has(e)&&this.keyStatusMap_.get(e)===t;const s=n.lastExcludeReason_===a&&n.excludeUntil===Infinity;if(!i){if(n.excludeUntil!==Infinity&&n.lastExcludeReason_!==a){n.excludeUntil=Infinity;n.lastExcludeReason_=a;this.logger_(`excluding playlist ${n.id} because the key ID ${e} doesn't exist in the keyStatusMap or is not ${t}`)}r++}else if(i&&s){delete n.excludeUntil;delete n.lastExcludeReason_;this.logger_(`enabling playlist ${n.id} because key ID ${e} is ${t}`)}})});if(r>=this.mainPlaylistLoader_.main.playlists.length){this.mainPlaylistLoader_.main.playlists.forEach(e=>{const t=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720;const i=e.excludeUntil===Infinity&&e.lastExcludeReason_===a;if(t&&i){delete e.excludeUntil;S.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${a} key IDs`)}})}}addKeyStatus_(e,t){const i=typeof e==="string";const s=i?e:Fm(e);const n=s.slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`);this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t);if(!this.waitingForFastQualityPlaylistReceived_){this.excludeNonUsableThenChangePlaylist_()}this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this));this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_();this.fastQualityChange_()}}const Tg=(n,r,a)=>e=>{const t=n.main.playlists[r];const i=Dh(t);const s=Oh(t);if(typeof e==="undefined"){return s}if(e){delete t.disabled}else{t.disabled=true}if(e!==s&&!i){a();if(e){n.trigger("renditionenabled")}else{n.trigger("renditiondisabled")}}return e};class Sg{constructor(e,t,i){const{playlistController_:s}=e;const n=s.fastQualityChange_.bind(s);if(t.attributes){const r=t.attributes.RESOLUTION;this.width=r&&r.width;this.height=r&&r.height;this.bandwidth=t.attributes.BANDWIDTH;this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Up(s.main(),t);this.playlist=t;this.id=i;this.enabled=Tg(e.playlists,t.id,n)}}const Eg=function(i){i.representations=()=>{const e=i.playlistController_.main();const t=Fh(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;if(!t){return[]}return t.filter(e=>!Dh(e)).map((e,t)=>new Sg(i,e,e.id))}};const wg=["seeking","seeked","pause","playing","error"];class kg{constructor(e){this.playlistController_=e.playlistController;this.tech_=e.tech;this.seekable=e.seekable;this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow;this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta;this.media=e.media;this.consecutiveUpdates=0;this.lastRecordedTime=null;this.checkCurrentTimeTimeout_=null;this.logger_=sh("PlaybackWatcher");this.logger_("initialize");const t=()=>this.monitorCurrentTime_();const i=()=>this.monitorCurrentTime_();const s=()=>this.techWaiting_();const n=()=>this.resetTimeUpdate_();const r=this.playlistController_;const a=["main","subtitle","audio"];const o={};a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)};r[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend);r[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset);this.tech_.on(["seeked","seeking"],o[e].reset)});const l=t=>{["main","audio"].forEach(e=>{r[`${e}SegmentLoader_`][t]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{if(this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();l("off")}};this.clearSeekingAppendCheck_=()=>l("off");this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_();l("on")};this.tech_.on("seeked",this.clearSeekingAppendCheck_);this.tech_.on("seeking",this.watchForBadSeeking_);this.tech_.on("waiting",s);this.tech_.on(wg,n);this.tech_.on("canplay",i);this.tech_.one("play",t);this.dispose=()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",s);this.tech_.off(wg,n);this.tech_.off("canplay",i);this.tech_.off("play",t);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);a.forEach(e=>{r[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend);r[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset);this.tech_.off(["seeked","seeking"],o[e].reset)});if(this.checkCurrentTimeTimeout_){tv.clearTimeout(this.checkCurrentTimeTimeout_)}this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){tv.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=tv.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];if(this[`${e}StalledDownloads_`]>0){this.logger_(`resetting possible stalled download count for ${e} loader`)}this[`${e}StalledDownloads_`]=0;this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_;const i=t[`${e}SegmentLoader_`];const s=i.buffered_();const n=ph(this[`${e}Buffered_`],s);this[`${e}Buffered_`]=s;if(n){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++;this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:fh(s)});if(this[`${e}StalledDownloads_`]<10){return}this.logger_(`${e} loader stalled download exclusion`);this.resetSegmentDownloads_(e);this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`});if(e==="subtitle"){return}t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:Infinity})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking()){return}const e=this.tech_.currentTime();const t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+rh>=t.end(t.length-1))){return this.techWaiting_()}if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(e===this.lastRecordedTime){this.consecutiveUpdates++}else{this.consecutiveUpdates=0;this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const e=this.tech_.seeking();if(!e){return false}const t=this.seekable();const i=this.tech_.currentTime();const s=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(s){const f=t.end(t.length-1);n=f}if(this.beforeSeekableWindow_(t,i)){const p=t.start(0);n=p+(p===t.end(0)?0:rh)}if(typeof n!=="undefined"){this.logger_(`Trying to seek outside of seekable at time ${i} with `+`seekable range ${dh(t)}. Seeking to `+`${n}.`);this.tech_.setCurrentTime(n);return true}const r=this.playlistController_.sourceUpdater_;const a=this.tech_.buffered();const o=r.audioBuffer?r.audioBuffered():null;const l=r.videoBuffer?r.videoBuffered():null;const c=this.media();const u=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-nh)*2;const d=[o,l];for(let e=0;e ${i.end(0)}]. Attempting to resume `+"playback by seeking to the current time.");this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable();const t=this.tech_.currentTime();if(this.tech_.seeking()){return true}if(this.beforeSeekableWindow_(e,t)){const a=e.end(e.length-1);this.logger_(`Fell out of live window at time ${t}. Seeking to `+`live point (seekable end) ${a}`);this.resetTimeUpdate_();this.tech_.setCurrentTime(a);this.tech_.trigger({type:"usage",name:"vhs-live-resync"});return true}const i=this.tech_.vhs.playlistController_.sourceUpdater_;const s=this.tech_.buffered();const n=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t});if(n){this.resetTimeUpdate_();this.tech_.setCurrentTime(t);this.tech_.trigger({type:"usage",name:"vhs-video-underflow"});return true}const r=lh(s,t);if(r.length>0){this.logger_(`Stopped at ${t} and seeking to ${r.start(0)}`);this.resetTimeUpdate_();this.skipTheGap_(t);return true}return false}afterSeekableWindow_(e,t,i,s=false){if(!e.length){return false}let n=e.end(e.length-1)+rh;const r=!i.endList;const a=typeof i.partTargetDuration==="number";if(r&&(a||s)){n=e.end(e.length-1)+i.targetDuration*3}if(t>n){return true}return false}beforeSeekableWindow_(e,t){if(e.length&&e.start(0)>0&&t2){return{start:s,end:n}}}return null}}const jg={errorInterval:30,getSource(e){const t=this.tech({IWillNotUseThisInPlugins:true});const i=t.currentSource_||this.currentSource();return e(i)}};const Cg=function(t,e){let i=0;let s=0;const n=L(jg,e);t.ready(()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const r=function(){if(s){t.currentTime(s)}};const a=function(e){if(e===null||e===undefined){return}s=t.duration()!==Infinity&&t.currentTime()||0;t.one("loadedmetadata",r);t.src(e);t.trigger({type:"usage",name:"vhs-error-reload"});t.play()};const o=function(){if(Date.now()-i{Object.defineProperty(P,t,{get(){S.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);return O[t]},set(e){S.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);if(typeof e!=="number"||e<0){S.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}O[t]=e}})});const Lg="videojs-vhs";const Rg=function(t,e){const i=e.media();let s=-1;for(let e=0;e{t.addQualityLevel(e)});Rg(t,e.playlists)};P.canPlaySource=function(){return S.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const Mg=(e,t,i)=>{if(!e){return e}let s={};if(t&&t.attributes&&t.attributes.CODECS){s=Np(Xa(t.attributes.CODECS))}if(i&&i.attributes&&i.attributes.CODECS){s.audio=i.attributes.CODECS}const n=eo(s.video);const r=eo(s.audio);const a={};for(const o in e){a[o]={};if(r){a[o].audioContentType=r}if(n){a[o].videoContentType=n}if(t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh){a[o].pssh=t.contentProtection[o].pssh}if(typeof e[o]==="string"){a[o].url=e[o]}}return L(e,a)};const Ug=(e,i)=>{return e.reduce((e,s)=>{if(!s.contentProtection){return e}const t=i.reduce((e,t)=>{const i=s.contentProtection[t];if(i&&i.pssh){e[t]={pssh:i.pssh}}return e},{});if(Object.keys(t).length){e.push(t)}return e},[])};const Bg=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys){return Promise.resolve()}const n=t?i.concat([t]):i;const r=Ug(n,Object.keys(e));const a=[];const o=[];r.forEach(e=>{o.push(new Promise((e,t)=>{s.tech_.one("keysessioncreated",e)}));a.push(new Promise((t,i)=>{s.eme.initializeMediaKeys({keySystems:e},e=>{if(e){i(e);return}t()})}))});return Promise.race([Promise.all(a),Promise.race(o)])};const Fg=({player:e,sourceKeySystems:t,media:i,audioMedia:s})=>{const n=Mg(t,i,s);if(!n){return false}e.currentSource().keySystems=n;if(n&&!e.eme){S.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");return false}return true};const qg=()=>{if(!tv.localStorage){return null}const e=tv.localStorage.getItem(Lg);if(!e){return null}try{return JSON.parse(e)}catch(e){return null}};const Vg=e=>{if(!tv.localStorage){return false}let t=qg();t=t?L(t,e):e;try{tv.localStorage.setItem(Lg,JSON.stringify(t))}catch(e){return false}return t};const Hg=e=>{if(e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0){return JSON.parse(e.substring(e.indexOf(",")+1))}return e};const $g=(e,t)=>{if(!e._requestCallbackSet){e._requestCallbackSet=new Set}e._requestCallbackSet.add(t)};const zg=(e,t)=>{if(!e._responseCallbackSet){e._responseCallbackSet=new Set}e._responseCallbackSet.add(t)};const Gg=(e,t)=>{if(!e._requestCallbackSet){return}e._requestCallbackSet.delete(t);if(!e._requestCallbackSet.size){delete e._requestCallbackSet}};const Kg=(e,t)=>{if(!e._responseCallbackSet){return}e._responseCallbackSet.delete(t);if(!e._responseCallbackSet.size){delete e._responseCallbackSet}};P.supportsNativeHls=function(){if(!iv||!iv.createElement){return false}const t=iv.createElement("video");if(!S.getTech("Html5").isSupported()){return false}const e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some(function(e){return/maybe|probably/i.test(t.canPlayType(e))})}();P.supportsNativeDash=function(){if(!iv||!iv.createElement||!S.getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(iv.createElement("video").canPlayType("application/dash+xml"))}();P.supportsTypeNatively=e=>{if(e==="hls"){return P.supportsNativeHls}if(e==="dash"){return P.supportsNativeDash}return false};P.isSupported=function(){return S.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};P.xhr.onRequest=function(e){$g(P.xhr,e)};P.xhr.onResponse=function(e){zg(P.xhr,e)};P.xhr.offRequest=function(e){Gg(P.xhr,e)};P.xhr.offResponse=function(e){Kg(P.xhr,e)};const Wg=S.getComponent("Component");class Yg extends Wg{constructor(e,t,i){super(t,i.vhs);if(typeof i.initialBandwidth==="number"){this.options_.bandwidth=i.initialBandwidth}this.logger_=sh("VhsHandler");if(t.options_&&t.options_.playerId){const s=S.getPlayer(t.options_.playerId);this.player_=s}this.tech_=t;this.source_=e;this.stats={};this.ignoreNextSeekingEvent_=false;this.setOptions_();if(this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks){t.overrideNativeAudioTracks(true);t.overrideNativeVideoTracks(true)}else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks)){throw new Error("Overriding native VHS requires emulated tracks. "+"See https://git.io/vMpjB")}this.on(iv,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=iv.fullscreenElement||iv.webkitFullscreenElement||iv.mozFullScreenElement||iv.msFullscreenElement;if(t&&t.contains(this.tech_.el())){this.playlistController_.fastQualityChange_()}else{this.playlistController_.checkABR_()}});this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=false;return}this.setCurrentTime(this.tech_.currentTime())});this.on(this.tech_,"error",function(){if(this.tech_.error()&&this.playlistController_){this.playlistController_.pauseLoading()}});this.on(this.tech_,"play",this.play)}setOptions_(e={}){this.options_=L(this.options_,e);this.options_.withCredentials=this.options_.withCredentials||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||false;this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||false;this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||false;this.options_.llhls=this.options_.llhls===false?false:true;this.options_.bufferBasedABR=this.options_.bufferBasedABR||false;if(typeof this.options_.playlistExclusionDuration!=="number"){this.options_.playlistExclusionDuration=60}if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){const t=qg();if(t&&t.bandwidth){this.options_.bandwidth=t.bandwidth;this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})}if(t&&t.throughput){this.options_.throughput=t.throughput;this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=O.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===O.INITIAL_BANDWIDTH;["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{if(typeof this.source_[e]!=="undefined"){this.options_[e]=this.source_[e]}});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e){return}this.setOptions_();this.options_.src=Hg(this.source_.src);this.options_.tech=this.tech_;this.options_.externVhs=P;this.options_.sourceType=oo(t);this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)};this.playlistController_=new _g(this.options_);const i=L({liveRangeSafeTimeDelta:rh},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new kg(i);this.playlistController_.on("error",()=>{const e=S.players[this.tech_.options_.playerId];let t=this.playlistController_.error;if(typeof t==="object"&&!t.code){t.code=3}else if(typeof t==="string"){t={message:t,code:3}}e.error(t)});const s=this.options_.bufferBasedABR?P.movingAverageBandwidthSelector(.55):P.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this);this.playlistController_.selectInitialPlaylist=P.INITIAL_PLAYLIST_SELECTOR.bind(this);this.playlists=this.playlistController_.mainPlaylistLoader_;this.mediaSource=this.playlistController_.mediaSource;Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=tv.navigator.connection||tv.navigator.mozConnection||tv.navigator.webkitConnection;const i=1e7;if(this.options_.useNetworkInformationApi&&t){const s=t.downlink*1e3*1e3;if(s>=i&&e>=i){e=Math.max(e,s)}else{e=s}}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;if(this.throughput>0){t=1/this.throughput}else{t=0}const i=Math.floor(1/(e+t));return i},set(){S.log.error('The "systemBandwidth" property is read-only')}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:true},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:true},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:true},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:true},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:true},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:true},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:true},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:true},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:true},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:true},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:true},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:true},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:true},buffered:{get:()=>fh(this.tech_.buffered()),enumerable:true},currentTime:{get:()=>this.tech_.currentTime(),enumerable:true},currentSource:{get:()=>this.tech_.currentSource_,enumerable:true},currentTech:{get:()=>this.tech_.name_,enumerable:true},duration:{get:()=>this.tech_.duration(),enumerable:true},main:{get:()=>this.playlists.main,enumerable:true},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:true},seekable:{get:()=>fh(this.tech_.seekable()),enumerable:true},timestamp:{get:()=>Date.now(),enumerable:true},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:true}});this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_));this.tech_.on("bandwidthupdate",()=>{if(this.options_.useBandwidthFromLocalStorage){Vg({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}});this.playlistController_.on("selectedinitialmedia",()=>{Eg(this)});this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()});this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")});this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=true});this.setupQualityLevels_();if(!this.tech_.el()){return}this.mediaSourceUrl_=tv.URL.createObjectURL(this.playlistController_.mediaSource);this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");Bg({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session");this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e);this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions");this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;const t=Fg({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)});this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this);this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_);if(!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=S.players[this.tech_.options_.playerId];if(!e||!e.qualityLevels||this.qualityLevels_){return}this.qualityLevels_=e.qualityLevels();this.playlistController_.on("selectedinitialmedia",()=>{Ng(this.qualityLevels_,this)});this.playlists.on("mediachange",()=>{Rg(this.qualityLevels_,this.playlists)})}static version(){return{"@videojs/http-streaming":xg,"mux.js":Ag,"mpd-parser":Dg,"m3u8-parser":Og,"aes-decrypter":Pg}}version(){return this.constructor.version()}canChangeType(){return Um.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.playlistController_){this.playlistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.tech_&&this.tech_.vhs){delete this.tech_.vhs}if(this.mediaSourceUrl_&&tv.URL.revokeObjectURL){tv.URL.revokeObjectURL(this.mediaSourceUrl_);this.mediaSourceUrl_=null}if(this.tech_){this.tech_.off("waitingforkey",this.handleWaitingForKey_)}super.dispose()}convertToProgramTime(e,t){return Lf({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=true,s=2){return Rf({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{$g(this.xhr,e)};this.xhr.onResponse=e=>{zg(this.xhr,e)};this.xhr.offRequest=e=>{Gg(this.xhr,e)};this.xhr.offResponse=e=>{Kg(this.xhr,e)};this.player_.trigger("xhr-hooks-ready")}}const Xg={name:"videojs-http-streaming",VERSION:xg,canHandleSource(e,t={}){const i=L(S.options,t);return Xg.canPlayType(e.type,i)},handleSource(e,t,i={}){const s=L(S.options,i);t.vhs=new Yg(e,t,s);t.vhs.xhr=pf();t.vhs.setupXhrHooks_();t.vhs.src(e.src,e.type);return t.vhs},canPlayType(e,t){const i=oo(e);if(!i){return""}const s=Xg.getOverrideNative(t);const n=P.supportsTypeNatively(i);const r=!n||s;return r?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e;const i=!(S.browser.IS_ANY_SAFARI||S.browser.IS_IOS);const{overrideNative:s=i}=t;return s}};const Qg=()=>{return to("avc1.4d400d,mp4a.40.2")};if(Qg()){S.getTech("Html5").registerSourceHandler(Xg,0)}S.VhsHandler=Yg;S.VhsSourceHandler=Xg;S.Vhs=P;if(!S.use){S.registerComponent("Vhs",P)}S.options.vhs=S.options.vhs||{};if(!S.getPlugin||!S.getPlugin("reloadSourceOnError")){S.registerPlugin("reloadSourceOnError",Ig)}return S})})(Fe);var qe=Fe.exports;var f=Be(qe);var I="2.5.0";function w(){w=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==undefined?arguments[1]:null;a.remove();a.srcObject=null;clearTimeout(c);s({result:t,error:i})};if(l!==undefined){l.then(function(){return u(true)}).catch(function(e){return u(false,e)})}else{u(true)}})}function Ge(e){e=$e(e);return ze(e,function(){return{element:iv.createElement("video"),source:URL.createObjectURL(He)}})}function Ke(e){e=$e(e);return ze(e,function(){return{element:iv.createElement("audio"),source:URL.createObjectURL(Ve)}})}var We={audio:Ke,video:Ge};const Ye=[{inline:false,muted:false},{inline:true,muted:false},{inline:false,muted:true},{inline:true,muted:true}];function Xe(e){const t=e.filter(e=>e.passed)[0];if(!t){return{always:false,sometimes:false,never:true,inline:false,muted:false}}const{inline:i,muted:s}=t;const n=!i&&!s;return{always:n,sometimes:!n,never:false,inline:i,muted:s}}function Qe(e){let t;if(tv.cast&&tv.cast.receiver){t={always:true,sometimes:false,never:false,inline:false,muted:false}}if(e.ANDROID_VERSION||e.IS_IOS){t={always:false,sometimes:true,never:false,inline:false,muted:true};if(e.IS_IPHONE){t.inline=true}}if(t){return Promise.resolve(t)}}function Je(e,t){if(e!=="video"&&e!=="audio"){throw new Error(`invalid autoplay type: ${e}`)}const i=Qe(t.browser);if(i){return i}const s=Ye.map(t=>{return We[e](t).then(({result:e})=>{return w({passed:e},t)})});return Promise.all(s).then(e=>{return Xe(e)})}const Ze=tv.performance;const et={};["memory","navigation","timing"].forEach(e=>{et[e]=Ze&&Ze[e]||{}});["clearMarks","clearMeasures","clearResourceTimings","getEntries","getEntriesByName","getEntriesByType","mark","measure","now","setResourceTimingBufferSize","toJSON"].forEach(t=>{et[t]=(...e)=>{if(Ze&&Ze[t]){return Ze[t](...e)}}});function tt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var it=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function st(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function nt(i,s,n,e){s=s||"&";n=n||"=";if(i===null){i=undefined}if(typeof i==="object"){return rt(at(i),function(e){var t=encodeURIComponent(st(e))+n;if(it(i[e])){return rt(i[e],function(e){return t+encodeURIComponent(st(e))}).join(s)}else{return t+encodeURIComponent(st(i[e]))}}).join(s)}if(!e)return"";return encodeURIComponent(st(e))+n+encodeURIComponent(st(i))}function rt(e,t){if(e.map)return e.map(t);var i=[];for(var s=0;s0&&o>a){o=a}for(var l=0;l=0){d=c.substr(0,u);h=c.substr(u+1)}else{d=c;h=""}f=decodeURIComponent(d);p=decodeURIComponent(h);if(!tt(n,f)){n[f]=p}else if(it(n[f])){n[f].push(p)}else{n[f]=[n[f],p]}}return n}var lt={encode:nt,stringify:nt,decode:ot,parse:ot};function ct(e=tv&&tv.location||{}){let t;let i;try{t=lt.parse((e.hash||"#").substr(1))}catch(e){t={}}try{i=lt.parse((e.search||"?").substr(1))}catch(e){i={}}return w({hash:t,search:i},lt)}const ut={isArr(e){return Array.isArray(e)},isFn(e){return typeof e==="function"},isNil(e){return e===null||e===undefined},isNum(e){return typeof e==="number"&&e===e},isNonEmptyStr(e){return typeof e==="string"&&/\S/.test(e)},isObj(e){return Object.prototype.toString.call(e)==="[object Object]"}};const dt=(e,t)=>{if(e){const i=Number(e.substring(0,e.indexOf(".")));if(i){return i>=t}f.log.warn("Plugin VERSION string format does not conform to semantic versioning standards and cannot be checked.")}return false};const ht=e=>{return e==="application/vnd.apple.mpegurl"||e==="application/x-mpegURL"};const ft=(e,t)=>{const i=e&&e.encryption&&e.encryption.method;if(typeof i==="string"){return i.toLowerCase()==="aes-128"}const s=t.url.parseUrl(e.src);return s.hostname.indexOf("boltdns.net")!==-1&&s.pathname.indexOf("/aes128/")!==-1};const pt=(t,e)=>{const i=["audio","video"];let s;for(let e=0;e{const{mediainfo:t,liveTracker:i}=e;const s=t&&t.duration||e.duration();return i&&i.isLive()||s===Infinity};var vt={isLive:gt};const yt=()=>{const e=tv.GestureEvent;return!!(e&&tv.WebKitMediaKeys&&tv.WebKitMediaKeys.isTypeSupported("com.apple.fps.1_0","video/mp4"))};const bt=e=>{return e.browser.IS_EDGE&&/Chrome/i.test(tv.navigator.userAgent)};const _t=e=>{return tv.navigator.requestMediaKeySystemAccess&&!e.browser.IS_IOS&&(e.browser.IS_FIREFOX||e.browser.IS_CHROME||bt(e))};const Tt=e=>{return tv.SourceBuffer&&tv.SourceBuffer.prototype&&typeof tv.SourceBuffer.prototype.changeType==="function"};const St=()=>{return tv.MediaSource&&tv.MediaSource.isTypeSupported&&tv.MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.90"')};const Et=e=>{return e.isSecureContext||!/^http:/.test(e.location.href)};let n;const wt=()=>{n=undefined};const kt=e=>{if(n!==undefined){return n}const t=iv.createElement("video");const i=e.options.hls&&e.options.hls.overrideNative;if(t&&t.canPlayType){n=!i&&/probably|maybe/i.test(t.canPlayType("application/vnd.apple.mpegurl"))}else{n=false}return n};var jt={isSafariWithFairplaySupport:yt,isChromiumEdge:bt,isBrowserWithWidevineSupport:_t,isCodecSwitchingSupported:Tt,isHevcSupported:St,preferHttps:Et,isNativeHlsSupported:kt,clearCachedIsNativeHlsSupported:wt};var Ct=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var s=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(s,1);return s>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n-1;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}}}const Dt=String.fromCharCode(9);const Ot=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");const i={};if(t[1]){i.length=parseInt(t[1],10)}if(t[2]){i.offset=parseInt(t[2],10)}return i};const Pt=function(){const e="[^=]*";const t='"[^"]*"|[^,]*';const i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")};const p=function(e){const t={};if(!e){return t}const i=e.split(Pt());let s=i.length;let n;while(s--){if(i[s]===""){continue}n=/([^=]*)=(.*)/.exec(i[s]).slice(1);n[0]=n[0].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^\s+|\s+$/g,"");n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1");t[n[0]]=n[1]}return t};class Lt extends Ct{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(s){let l;let c;s=s.trim();if(s.length===0){return}if(s[0]!=="#"){this.trigger("data",{type:"uri",uri:s});return}const e=this.tagMappers.reduce((e,t)=>{const i=t(s);if(i===s){return e}return e.concat([i])},[s]);e.forEach(t=>{for(let e=0;ee}this.customParsers.push(e=>{const t=i.exec(e);if(t){this.trigger("data",{type:"custom",data:n(e),customType:s,segment:r});return true}})}addTagMapper({expression:t,map:i}){const e=e=>{if(t.test(e)){return i(e)}return e};this.tagMappers.push(e)}}const Rt=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase());const g=function(t){const i={};Object.keys(t).forEach(function(e){i[Rt(e)]=t[e]});return i};const Nt=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:s}=e;if(!t){return}const n="#EXT-X-SERVER-CONTROL";const r="holdBack";const a="partHoldBack";const o=i&&i*3;const l=s&&s*2;if(i&&!t.hasOwnProperty(r)){t[r]=o;this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})}if(o&&t[r]{if(r.uri||!r.parts&&!r.preloadHints){return}if(!r.map&&n){r.map=n}if(!r.key&&o){r.key=o}if(!r.timeline&&typeof h==="number"){r.timeline=h}this.manifest.preloadSegment=r});this.parseStream.on("data",function(a){let t;let i;({tag(){({version(){if(a.version){this.manifest.version=a.version}},"allow-cache"(){this.manifest.allowCache=a.allowed;if(!("allowed"in a)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in a){r.byterange=e;e.length=a.length;if(!("offset"in a)){a.offset=f}}if("offset"in a){r.byterange=e;e.offset=a.offset}f=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(a.duration>0){r.duration=a.duration}if(a.duration===0){r.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=s},key(){if(!a.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(a.attributes.METHOD==="NONE"){o=null;return}if(!a.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(a.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:a.attributes};return}if(a.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:a.attributes.URI};return}if(a.attributes.KEYFORMAT===d){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(a.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(a.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(a.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(a.attributes.KEYID&&a.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:a.attributes.KEYFORMAT,keyId:a.attributes.KEYID.substring(2)},pssh:xt(a.attributes.URI.split(",")[1])};return}if(!a.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}o={method:a.attributes.METHOD||"AES-128",uri:a.attributes.URI};if(typeof a.attributes.IV!=="undefined"){o.iv=a.attributes.IV}},"media-sequence"(){if(!isFinite(a.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+a.number});return}this.manifest.mediaSequence=a.number},"discontinuity-sequence"(){if(!isFinite(a.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+a.number});return}this.manifest.discontinuitySequence=a.number;h=a.number},"playlist-type"(){if(!/VOD|EVENT/.test(a.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+a.playlist});return}this.manifest.playlistType=a.playlistType},map(){n={};if(a.uri){n.uri=a.uri}if(a.byterange){n.byterange=a.byterange}if(o){n.key=o}},"stream-inf"(){this.manifest.playlists=s;this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!a.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!r.attributes){r.attributes={}}w(r.attributes,a.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!(a.attributes&&a.attributes.TYPE&&a.attributes["GROUP-ID"]&&a.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[a.attributes.TYPE];e[a.attributes["GROUP-ID"]]=e[a.attributes["GROUP-ID"]]||{};t=e[a.attributes["GROUP-ID"]];i={default:/yes/i.test(a.attributes.DEFAULT)};if(i.default){i.autoselect=true}else{i.autoselect=/yes/i.test(a.attributes.AUTOSELECT)}if(a.attributes.LANGUAGE){i.language=a.attributes.LANGUAGE}if(a.attributes.URI){i.uri=a.attributes.URI}if(a.attributes["INSTREAM-ID"]){i.instreamId=a.attributes["INSTREAM-ID"]}if(a.attributes.CHARACTERISTICS){i.characteristics=a.attributes.CHARACTERISTICS}if(a.attributes.FORCED){i.forced=/yes/i.test(a.attributes.FORCED)}t[a.attributes.NAME]=i},discontinuity(){h+=1;r.discontinuity=true;this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=a.dateTimeString;this.manifest.dateTimeObject=a.dateTimeObject}r.dateTimeString=a.dateTimeString;r.dateTimeObject=a.dateTimeObject},targetduration(){if(!isFinite(a.duration)||a.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+a.duration});return}this.manifest.targetDuration=a.duration;Nt.call(this,this.manifest)},start(){if(!a.attributes||isNaN(a.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:a.attributes["TIME-OFFSET"],precise:a.attributes.PRECISE}},"cue-out"(){r.cueOut=a.data},"cue-out-cont"(){r.cueOutCont=a.data},"cue-in"(){r.cueIn=a.data},skip(){this.manifest.skip=g(a.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",a.attributes,["SKIPPED-SEGMENTS"])},part(){l=true;const e=this.manifest.segments.length;const t=g(a.attributes);r.parts=r.parts||[];r.parts.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=p}p=t.byterange.offset+t.byterange.length}const i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,a.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach((e,t)=>{if(!e.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}})}},"server-control"(){const e=this.manifest.serverControl=g(a.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}Nt.call(this,this.manifest);if(e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")){this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})}},"preload-hint"(){const t=this.manifest.segments.length;const i=g(a.attributes);const e=i.type&&i.type==="PART";r.preloadHints=r.preloadHints||[];r.preloadHints.push(i);if(i.byterange){if(!i.byterange.hasOwnProperty("offset")){i.byterange.offset=e?p:0;if(e){p=i.byterange.offset+i.byterange.length}}}const s=r.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,a.attributes,["TYPE","URI"]);if(!i.type){return}for(let e=0;e{e(o,(e,t)=>{if(e||t.statusCode!==200||!t.body){const i=t.statusCode||"";const s=e&&e.message?e.message:"";const n=new Error(`downloadManifest: xhr for manifest at ${o} failed ${i?"with status: "+i:""} ${s}.`);return a(n)}r(t.body)})})}function Bt(e){const t=new Mt;t.push(e);t.end();return t.manifest}var Ft={downloadManifest:Ut,parseHlsManifest:Bt};function qt(e,a){const o={};class t{constructor(){Object.values(o).forEach(e=>{this.manageProperty(e)})}reset(){Object.getOwnPropertyNames(o).forEach(e=>{o[e].value.set(this,undefined)})}manageProperty(e){const t=e&&e.name;const i=e&&e.validation;const s=i&&i.validator;const n=i&&i.message;let r;if(!t||!i||!s||!n){throw new Error("unable to add managed property",e)}if(o.hasOwnProperty(t)&&typeof Object.getOwnPropertyDescriptor(this,t)!=="undefined"){f.log.warn(`property ${t} is already managed`);return}if(typeof o[t]==="undefined"){o[t]=w(e,{value:new WeakMap})}if(this.hasOwnProperty(t)){r=this[t];delete this[t]}Object.defineProperty(this,t,{get:()=>o[t].value.get(this),set:e=>{if(s(e)){o[t].value.set(this,e);return}throw new Error(`could not set ${t} to ${e}: ${n}`)},enumerable:true});if(a){Object.defineProperty(this,`${a}${t}`,{get:()=>this[t],enumerable:true})}if(typeof r!=="undefined"){this[t]=r}}}if(!Array.isArray(e)||!e.length){throw new Error("ManagedDataStore needs to be initialised with properties to manage")}e.forEach(e=>{o[e.name]=w(e,{value:new WeakMap})});return new t}var Vt={managedDataStore:qt};const G={perf:et,qs:ct,isValidVersion:dt,assign(...e){return w(...e)},get(e,t,i){let s=e;const n=t.split(".");if(!s){return i}for(let e=0;e!ut.isNil(e)).map(G.withoutNilValues)}else if(ut.isObj(t)){i={};Object.keys(t).forEach(e=>{if(!ut.isNil(t[e])){i[e]=G.withoutNilValues(t[e])}})}return i},debounce(s,n,r,a=tv){let o;return function(){const e=this;const t=arguments;let i=function(){o=null;i=null;if(!r){s.apply(e,t)}};if(!o&&r){s.apply(e,t)}a.clearTimeout(o);o=a.setTimeout(i,n)}},throttle(i,s){let n=Date.now();return function(...e){const t=Date.now();if(t-n>=s){i(...e);n=t}}}};G.assign(G,ut,mt,vt,jt,Ft,Vt);G.VERSION="n/a";const Ht="bc-style-vjs";function $t(e,t,i){const{classNames:s}=e;if(!t&&!i&&t!==0&&i!==0){return}let n=iv.querySelector("."+s.playerInstanceDimensions);if(!n){n=iv.createElement("style");n.className=s.playerInstanceDimensions;const d=iv.querySelector("."+s.playerStyle)||iv.querySelector("."+Ht);if(d){d.parentNode.insertBefore(n,d.nextSibling)}else{iv.head.appendChild(n)}}else if(n.innerText){if(!t&&t!==0){const h=/width:(\d+)px;/g.exec(n.innerText);if(h&&h[1]){t=tv.parseInt(h[1],10)}}else if(!i&&i!==0){const h=/height:(\d+)px;/g.exec(n.innerText);if(h&&h[1]){i=tv.parseInt(h[1],10)}}}let r;let a;let o="";let l="";let c="";if(t||t===0){r=tv.parseInt(t,10);o=`width:${r}px;`}if(i||i===0){a=tv.parseInt(i,10);l=`height:${a}px;`}const u=o||l?`.${s.playerInstance}{${o}${l}}`:"";if(t&&i){const f=".vjs-fluid:not(.vjs-audio-only-mode)";const p=`padding-top:${a/r*100}%;`;c=`.${s.playerInstance}${f}{${p}}`}n.innerText=`${u}${c}`}const zt=3;const Gt=50;const Kt=t=>{const i=iv.body;const s=iv.createElement("div");s.className="ads ad adsbox doubleclick ad-placement carbon-ads adglare pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text_ads_2 text-ads text-ad-links";s.innerHTML=" ";s.setAttribute("style","height:10px!important;font-size:20px;color:transparent;position:fixed;bottom:0;left:-10000px");let n=0;const r=()=>{n++;const e=s.offsetHeight===0||!i.contains(s)||s.style.display==="none"||s.style.visibility==="hidden";if(e||n===zt){if(s.parentNode){s.parentNode.removeChild(s)}return t(e)}tv.setTimeout(r,Gt)};i.appendChild(s);r()};let Wt=null;let Yt;function K(e){if(e||!Yt){Yt=new Promise(e=>{if(iv.readyState==="complete"||iv.readyState!=="loading"&&!iv.documentElement.doScroll){Kt(e)}else{iv.addEventListener("DOMContentLoaded",()=>{Kt(e)})}})}return Yt.then(e=>{Wt=e;return e})}Object.defineProperties(K,{VERSION:{enumerable:true,value:"n/a"},lastResult:{enumerable:true,get(){return Wt}},mightBe:{enumerable:true,get(){return Wt!==false}},mightNotBe:{enumerable:true,get(){return Wt!==true}}});const Xt="vjs-waiting-for-autoplay";function Qt(e,t,i,s){return e.hasAttribute("data-debug")||t.debug!==undefined||i.debug||s.debug}function Jt(t,e,i,s){const{settings:n,environment:r}=e;const{embedId:a,playerId:o}=n;const{isInBcFrame:l,queryString:c,urlHash:u}=r;const d=`bc-player-${o}_${a}`;const h=`${d}-index-${n.playerIndex}`;G.perf.mark("bcInitStart");n.classNames={player:d,playerStyle:`bc-style-${o}-${a}`,playerInstance:h,playerInstanceDimensions:`${h}-video-dimensions`};n.embedState={controls:i.hasAttribute("controls")||i.hasAttribute("data-controls"),loop:i.hasAttribute("loop"),muted:i.hasAttribute("muted"),playsinline:i.hasAttribute("playsinline"),poster:i.hasAttribute("poster"),sources:!!i.querySelector("source"),tracks:!!i.querySelector("track")};s.debug=Qt(i,c,s,n);if(i.hasAttribute("data-vttjs")&&G.isNonEmptyStr(i.getAttribute("data-vttjs"))){s["vtt.js"]=i.getAttribute("data-vttjs")}else if(c.vttjs&&G.isNonEmptyStr(c.vttjs)){s["vtt.js"]=c.vttjs}else if(s.hasOwnProperty("vtt.js")||s.hasOwnProperty("vttjs")){s["vtt.js"]=s["vtt.js"]||s.vttjs}else if(n["vtt.js"]||n.vttjs){s["vtt.js"]=n["vtt.js"]||n.vttjs}else{s["vtt.js"]="https://players.brightcove.net/videojs-vtt.js/0.15.4/vtt.global.min.js"}if(n.playButton){const{hover:k,shape:j,position:C}=n.playButton;if(k==="glow"){t.dom.addClass(i,"vjs-play-button-hover-glow")}else if(k==="darken"){t.dom.addClass(i,"vjs-play-button-hover-darken")}if(j==="square"){t.dom.addClass(i,"vjs-play-button-shape-square")}else if(j==="rectangle"){t.dom.addClass(i,"vjs-play-button-shape-rectangle")}if(C==="topRight"){t.dom.addClass(i,"vjs-play-button-position-top-right")}else if(C==="topLeft"){t.dom.addClass(i,"vjs-play-button-position-top-left")}}if(c.crossorigin!==undefined||n.media&&n.media.tracks&&t.browser.IS_ANY_SAFARI){n.crossorigin=true}if(n.crossorigin){i.setAttribute("crossorigin","anonymous")}if(n.audioPosterMode){s.audioPosterMode=n.audioPosterMode}if(n.audioOnlyMode){s.audioOnlyMode=n.audioOnlyMode}const f=u.t||c.t||i.getAttribute("data-start-time");if(/^[\d]+$/.test(f)){n.startTime=Number(f)}else if(/^(\d+h)?(\d+m)?(\d+s)?$/.test(f)){n.startTime=f}const p=c.adConfigId;const m=i.getAttribute("data-ad-config-id");if(G.isNonEmptyStr(p)){n.adConfigId=p}else if(G.isNonEmptyStr(m)){n.adConfigId=m}if(typeof n.adConfigId==="string"){n.adConfigId=n.adConfigId.trim()}if(!G.isNonEmptyStr(n.adConfigId)){n.adConfigId=null}if(n.usingAdFailover&&!K.mightBe){n.adConfigId=null}const g=c.deliveryConfigId;const v=i.getAttribute("data-delivery-config-id");if(G.isNonEmptyStr(g)){n.deliveryConfigId=g}else if(G.isNonEmptyStr(v)){n.deliveryConfigId=v}if(typeof n.deliveryConfigId==="string"){n.deliveryConfigId=n.deliveryConfigId.trim()}if(!G.isNonEmptyStr(n.deliveryConfigId)){n.deliveryConfigId=null}n.applicationId=c.applicationId||i.getAttribute("data-application-id")||n.applicationId;const y=G.qs();if(i.hasAttribute("autoplay")){s.autoplay=true}else if(l&&y.search.hasOwnProperty("autoplay")){if(y.search.autoplay==="true"||!y.search.autoplay){s.autoplay=true}else if(y.search.autoplay==="false"){s.autoplay=false}else{s.autoplay=y.search.autoplay}}else if(!s.hasOwnProperty("autoplay")){s.autoplay=n.autoplay||false}if(s.autoplay){t.dom.addClass(i,Xt)}if(c.preload){s.preload=c.preload}else if(!s.hasOwnProperty("preload")&&n.preload){s.preload=n.preload}s.height=i.getAttribute("height")||undefined;s.width=i.getAttribute("width")||undefined;if(!l&&i&&(s.width||s.height)){$t(n,s.width,s.height)}["loop","muted","playsinline"].forEach(function(e){if(c[e]!==undefined&&c[e]!=="false"||n[e]||n.embedState[e]||s[e]){s[e]=true}else{s[e]=false}});if(s.autoplay){s.playsinline=true}if(s.playsinline){i.setAttribute("playsinline","playsinline")}if(s.muted){i.setAttribute("muted","muted");i.muted=true}if(l){if(c.language){s.language=c.language}else if(G.isNonEmptyStr(iv.documentElement.lang)){s.language=iv.documentElement.lang}else{s.language=tv.navigator.language}iv.documentElement.lang=s.language}else if(i.hasAttribute("language")){s.language=i.getAttribute("language");t.log.warn("Use of the language attribute on the video embed is invalid. Please use the lang attribute instead.")}else if(!s.hasOwnProperty("language")&&G.isNonEmptyStr(n.language)){s.language=n.language}const b=i.getAttribute("data-bumper-id");const _=c.bumperId;const T=n.videoCloud?n.videoCloud.bumper:undefined;if(b||_||T){n.videoCloud=n.videoCloud||{};n.videoCloud.bumper=T&&typeof T==="object"?T:{};const I=b||_||T.id||T;if(typeof I==="string"){n.videoCloud.bumper.id=I}else{t.log.error("Bumper id must be a string")}}const{media:S}=n;if(S&&S.poster&&S.poster.highres&&!i.poster){if(/(https?:)?\/\//.test(S.poster.highres)){s.poster=S.poster.highres}else{s.poster=e.environment.scriptBaseUrl+"/"+S.poster.highres}if(t.browser.IS_IPHONE){i.poster=s.poster}}if(S&&S.tracks){S.tracks.forEach(function(e){i.appendChild(t.dom.createEl("track",{},{default:e.default?e.default:"",label:e.label?e.label:"",kind:"captions",src:e.src,srclang:e.srclang}))})}if(S&&S.src){s.sources=[S.src]}else if(S&&S.sources){s.sources=S.sources}s.runtime_=e;s.html5=s.html5||{};if(!(t.browser.IS_ANY_SAFARI||t.browser.IS_IOS)){s.html5.nativeCaptions=false}t.options.vhs=t.options.vhs||{};s.html5=s.html5||{};s.html5.vhs=s.html5.vhs||{};if(n.vhs&&typeof n.vhs==="object"){s.html5.vhs=n.vhs}if(t.browser.IS_ANDROID&&t.options.vhs.enableLowInitialPlaylist===undefined&&s.html5.vhs.enableLowInitialPlaylist===undefined){s.html5.vhs.enableLowInitialPlaylist=true}if(!(t.browser.IS_ANY_SAFARI||t.browser.IS_IOS)&&t.options.vhs.overrideNative===undefined&&s.html5.vhs.overrideNative===undefined){s.html5.vhs.overrideNative=true}if(t.options.vhs.experimentalLLHLS===undefined&&s.html5.vhs.experimentalLLHLS===undefined){s.html5.vhs.experimentalLLHLS=true}if(t.options.vhs.experimentalBufferBasedABR===undefined&&s.html5.vhs.experimentalBufferBasedABR===undefined){s.html5.vhs.experimentalBufferBasedABR=true}s.html5.initialBandwidth=typeof s.html5.initialBandwidth==="number"?s.html5.initialBandwidth:n.initialBandwidth;s.inactivityTimeout=5e3;s.controls=l?true:n.embedState.controls;s.persistTextTrackSettings=true;s.sourceOrder=true;s.userActions={hotkeys:{}};if(n.fullscreenControl===false){s.userActions.doubleClick=false}const E=e.environment.userAgent.match(/applewebkit\/(\d*).*Version\/(\d*.\d*)/i);s.nativeControlsForTouch=t.browser.IS_ANDROID&&t.browser.ANDROID_VERSION<5&&E&&E[2]>0;const w=t.getPluginVersion("ima3");s.normalizeAutoplay=w?G.isValidVersion(w,4):true;["controlBar","liveui","playbackRates","responsive","suppressNotSupportedError","techOrder"].forEach(e=>{if(n.hasOwnProperty(e)){s[e]=n[e]}});return s}const Zt=f.getComponent("MenuItem");class ei extends Zt{handleClick(e){super.handleClick();this.options_.listener();tv.setTimeout(()=>{this.player().contextmenuUI.menu.dispose()},1)}}const ti=f.getComponent("Menu");const ii=f.dom||f;class si extends ti{constructor(i,e){super(i,e);this.dispose=this.dispose.bind(this);e.content.forEach(e=>{let t=function(){};if(typeof e.listener==="function"){t=e.listener}else if(typeof e.href==="string"){t=()=>tv.open(e.href)}this.addItem(new ei(i,{label:e.label,listener:t.bind(i)}))})}createEl(){const e=super.createEl();ii.addClass(e,"vjs-contextmenu-ui-menu");e.style.left=this.options_.position.left+"px";e.style.top=this.options_.position.top+"px";return e}}function ni(e){let t;if(e.getBoundingClientRect&&e.parentNode){t=e.getBoundingClientRect()}if(!t){return{left:0,top:0}}const i=iv.documentElement;const s=iv.body;const n=i.clientLeft||s.clientLeft||0;const r=tv.pageXOffset||s.scrollLeft;const a=t.left+r-n;const o=i.clientTop||s.clientTop||0;const l=tv.pageYOffset||s.scrollTop;const c=t.top+l-o;return{left:Math.round(a),top:Math.round(c)}}function ri(e,t){const i={};const s=ni(e);const n=e.offsetWidth;const r=e.offsetHeight;const a=s.top;const o=s.left;let l=t.pageY;let c=t.pageX;if(t.changedTouches){c=t.changedTouches[0].pageX;l=t.changedTouches[0].pageY}i.y=Math.max(0,Math.min(1,(a-l+r)/r));i.x=Math.max(0,Math.min(1,(c-o)/n));return i}var ai="7.0.0";function oi(e){return e.hasOwnProperty("contextmenuUI")&&e.contextmenuUI.hasOwnProperty("menu")&&e.contextmenuUI.menu.el()}function li(e){const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"}function ci(e,t){return{left:Math.round(t.width*e.x),top:Math.round(t.height-t.height*e.y)}}function ui(e){if(oi(this)){this.contextmenuUI.menu.dispose();return}if(this.contextmenuUI.options_.excludeElements(e.target)){return}const t=ri(this.el(),e);const i=this.el().getBoundingClientRect();const s=ci(t,i);const n=f.browser.IS_FIREFOX?iv.documentElement:iv;e.preventDefault();const r=this.contextmenuUI.menu=new si(this,{content:this.contextmenuUI.content,position:s});this.contextmenuUI.closeMenu=()=>{f.log.warn("player.contextmenuUI.closeMenu() is deprecated, please use player.contextmenuUI.menu.dispose() instead!");r.dispose()};r.on("dispose",()=>{f.off(n,["click","tap"],r.dispose);this.removeChild(r);delete this.contextmenuUI.menu});this.addChild(r);const a=r.el_.getBoundingClientRect();const o=iv.body.getBoundingClientRect();if(this.contextmenuUI.keepInside||a.right>o.width||a.bottom>o.height){r.el_.style.left=Math.floor(Math.min(s.left,this.player_.currentWidth()-r.currentWidth()))+"px";r.el_.style.top=Math.floor(Math.min(s.top,this.player_.currentHeight()-r.currentHeight()))+"px"}f.on(n,["click","tap"],r.dispose)}function di(e){const t={keepInside:true,excludeElements:li};e=f.obj.merge(t,e);if(!Array.isArray(e.content)){throw new Error('"content" required')}if(oi(this)){this.contextmenuUI.menu.dispose();this.off("contextmenu",this.contextmenuUI.onContextMenu);delete this.contextmenuUI}const i=this.contextmenuUI=function(){di.apply(this,arguments)};i.onContextMenu=ui.bind(this);i.content=e.content;i.keepInside=e.keepInside;i.options_=e;i.VERSION=ai;this.on("contextmenu",i.onContextMenu);this.ready(()=>this.addClass("vjs-contextmenu-ui"))}f.registerPlugin("contextmenuUI",di);di.VERSION=ai;const hi=function(e){e.registerPlugin("urlparams",function(r){r=r||{};var e=function(e){var t=0,i;e=(e||"").replace(/^\s+|\s+$/g,"");if(!e||!/^(\d+h)?(\d+m)?(\d+s)?$/.test(e)){return-1}i=e.match(/^(\d+)h/);if(i){t+=parseFloat(i[1])*3600;e=e.replace(/^(\d+)h/,"")}i=e.match(/^(\d+)m/);if(i){t+=parseFloat(i[1])*60;e=e.replace(/^(\d+)m/,"")}i=e.match(/^(\d+)s/);if(i){t+=parseFloat(i[1])}return t},s=.9,a=function(e,t){var i=e-t;if(isNaN(i)){return false}return Math.abs(i)0){(function(){var e=r.delay||250,t,i=false,s=function(){if(i||a(l.currentTime(),c)){i=true;n()}else{l.one("canplay",function(){l.currentTime(c)});t=l.setTimeout(s,e)}},n=function(){l.clearTimeout(t);l.off("timeupdate",n);if(!i){l.currentTime(c)}};l.on("timeupdate",n);o(s)})()}})};var fi=(t,e,i={})=>{e.forEach(e=>{if(t[e]!==undefined){i[e]=t[e]}});return i};const pi=r=>{const a=(i,s=[])=>{let n={};Object.keys(i).forEach(e=>{const t=i[e];s.push(e);if(G.isObj(t)){n=r.obj.merge(n,a(t,s))}else{n[s.join(".")]=t}s.pop()});return n};return a};const mi=e=>e.charAt(0).toUpperCase()+e.slice(1);const gi=(e,t)=>`${e}x${t}`;const vi={memory:["jsHeapSizeLimit","usedJSHeapSize","totalJSHeapSize"],navigation:["redirectCount","type","directedMigration"],timing:["loadEventEnd","loadEventStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","responseEnd","responseStart","requestStart","secureConnectionStart","connectEnd","connectStart","domainLookupEnd","domainLookupStart","fetchStart","redirectEnd","redirectStart","unloadEventEnd","unloadEventStart","navigationStart"]};const yi={bitrate:"bitrates",event:"events"};const bi=n=>{const t=pi(n);class e{constructor(){this.data_={bitrates:{bitrates:[],playlists:[],rendered:[],throughput:[]},events:[],mr:0,locked:0,performance:{},content:{},player:{dimensions:[],pixelratio:[],screendimensions:[]},frames:{}}}keys(){return Object.keys(this.data_)}append(e,...t){e=yi.hasOwnProperty(e)?yi[e]:e;if(!this.data_.hasOwnProperty(e)){throw new Error(`"${e}" is not a known QosBuffer key`)}this[`append${mi(e)}_`](...t)}flush(...t){if(!t.length){t=this.keys()}for(let e=0;ethis[`flush${mi(e)}_`]());const i=n.obj.merge(...e);const s=G.qs().stringify(i).length;if(s>3e3&&i["qos.bitrates"]){i["qos.bitrates"]=JSON.stringify({bitrates:[],playlists:[],rendered:[],throughput:[]})}return i}appendBitrates_(t){if(typeof t.playlists!=="undefined"){this.data_.bitrates.playlists.push([Date.now(),t.bitrates,t.playlists]);delete t.bitrates;delete t.playlists}Object.keys(t).forEach(e=>{this.data_.bitrates[e].push([Date.now(),t[e]])})}appendMr_(e){this.data_.mr=e?1:null}appendLocked_(e){this.data_.locked=e?1:null}appendPerformance_(e){const i=tv.performance;if(G.isNil(i)){return}Object.keys(vi).forEach(e=>{if(!G.isNil(i[e])){this.data_.performance[e]=fi(i[e],vi[e])}});if(G.isFn(i.measure)){["bcParse","bcInit"].forEach(t=>{i.getEntriesByName(t,"measure").forEach(e=>{this.data_.performance[t]=e.duration})})}if(this.data_.performance.navigation){this.data_.performance.navigation.directedMigration=e?G.qs().parse(e).directedMigration==="true":false}}appendFrames_(e){this.data_.frames={dropped:e.droppedVideoFrames,corrupted:e.corruptedVideoFrames,total:e.totalVideoFrames}}appendPlayer_(e,t=Date.now()){this.data_.player.dimensions.push([t,gi(e.width,e.height),gi(e.computedWidth,e.computedHeight)]);this.data_.player.pixelratio.push([t,tv.devicePixelRatio]);this.data_.player.screendimensions.push([t,gi(tv.screen.width,tv.screen.height)])}appendEvents_(...e){this.data_.events.push({type:e.join("."),time:Date.now()})}appendContent_(e){this.data_.content={sourceMimeType:e.sourceMimeType}}flushBitrates_(){const e=this.data_.bitrates;const t={};if(e.bitrates.length||e.playlists.length||e.rendered.length||e.throughput.length){t["qos.bitrates"]=JSON.stringify(e)}e.bitrates.length=0;e.playlists.length=0;e.rendered.length=0;e.throughput.length=0;return t}flushEvents_(){const e=this.data_.events;const n={};e.forEach(e=>{const{time:t,type:i}=e;const s=`qos.events.${i}`;if(Array.isArray(n[s])){n[s].push(t)}else if(n.hasOwnProperty(s)){n[s]=[n[s],t]}else{n[s]=t}});Object.keys(n).forEach(e=>{if(Array.isArray(n[e])){n[e]=JSON.stringify(n[e])}});e.length=0;return n}flushMr_(){return{"qos.mr":this.data_.mr}}flushLocked_(){return{"qos.locked":this.data_.locked}}flushFrames_(){const e=t(this.data_.frames,["qos","frames"]);this.data_.frames={};return e}flushPerformance_(){return t(this.data_.performance,["qos","performance"])}flushPlayer_(){const i=this.data_.player;const s={};Object.keys(i).forEach(e=>{const t=i[e];if(t.length){s[`qos.player.${e}`]=JSON.stringify(t);t.length=0}});return s}flushContent_(){return t(this.data_.content,["qos","content"])}}return e};const _i=["ad-playback","ads-ready?","postroll?","preroll?"];const Ti=e=>e.usingPlugin("ads")?e.ads.state:undefined;const Si=e=>e.usingPlugin("ads")&&!!e.adonly;const Ei=e=>_i.indexOf(e)>-1;const wi=e=>e.usingPlugin("ads")&&G.isFn(e.ads.inAdBreak);const x=e=>{if(!e.usingPlugin("ads")){return false}if(Si(e)){return true}if(wi(e)){return e.ads.isInAdMode()}return Ei(e.ads.state)};const ki=e=>{if(!e.usingPlugin("ads")){return false}return e.ads.isContentResuming()&&!e.ads.isWaitingForAdBreak()};const ji=(e,t)=>{if(wi(t)&&e&&e.type==="loadstart"){return true}return!x(t)};const Ci=e=>{const t={};if(e.ima3){const i=e.ima3.currentAdEventInfo;t.plugin="ima3";if(G.isFn(e.ima3)){return t}t.pluginVersion=e.ima3.VERSION||e.ima3.version;t.adTech=e.ima3.adTech;t.requestMode=e.ima3.settings.requestMode;t.timeout=e.ima3.settings.timeout;if(i){fi(i,["adType","adPodLength","adPodId","creativeFormat","creativeLength","creativeId","creativeIndex","advertiserName","wrapperCreativeIds","dealId","adId","adTitle","adSystem","creativeAdId"],t);const s=i.creativeIndex;if(s&&s.length){t.firstPlayedAdIndex=s[0]}t.startedInAdPod=i.started;t.completedInAdPod=i.completed}}else if(e.FreeWheelPlugin){t.plugin="freewheel";if(G.isFn(e.FreeWheelPlugin)){return t}t.pluginVersion=e.FreeWheelPlugin.VERSION||e.FreeWheelPlugin.getVersion()}return t};const Ii=e=>{e.adBreakIndex=null;e.hasAdBreakStarted=false;e["ads-request"]=null;e["ads-response-received"]=null;e["ads-loading"]=[];e["ads-ad-started"]=[];e["ads-ad-ended"]=[]};const xi=()=>{const e={};Ii(e);return e};const Ai=(e,t,i)=>{const s=e.currentAdSequence_;const n=["ads-loading","ads-ad-started","ads-ad-ended"];if(t==="ads-request"){Ii(s)}else if(t==="adstart"||t==="ads-loading"){if(!s.hasAdBreakStarted){if(s.adBreakIndex===null){s.adBreakIndex=0}else{s.adBreakIndex++}s.hasAdBreakStarted=true;n.forEach(e=>{s[e].push([])})}}else if(t==="adend"){s.hasAdBreakStarted=false}if(n.indexOf(t)>-1){s[t][s.adBreakIndex].push(i)}else if(t==="ads-request"||t==="ads-response-received"){s[t]=i}};const e={NUMBER_GTE_0:{validator:e=>typeof e==="number"&&e>=0,message:"must be a number equal or greater than 0"},NON_EMPTY_STRING:{validator:G.isNonEmptyStr,message:"must be a non-empty string"},NUMERIC_BOOL:{validator:e=>e===0||e===1,message:"must be 0 or 1"}};const Di=[{name:"index",validation:e.NUMBER_GTE_0},{name:"deal_id",validation:e.NON_EMPTY_STRING},{name:"wrapper_systems",validation:e.NON_EMPTY_STRING},{name:"system",validation:e.NON_EMPTY_STRING},{name:"skip_time_offset",validation:e.NUMBER_GTE_0},{name:"start_ms",validation:e.NUMBER_GTE_0},{name:"advertiser",validation:e.NON_EMPTY_STRING},{name:"content_type",validation:e.NON_EMPTY_STRING},{name:"isci",validation:e.NON_EMPTY_STRING},{name:"creative_id",validation:e.NON_EMPTY_STRING},{name:"duration",validation:e.NUMBER_GTE_0},{name:"title",validation:e.NON_EMPTY_STRING},{name:"media_url_domain",validation:e.NON_EMPTY_STRING},{name:"audible_duration",validation:e.NUMBER_GTE_0},{name:"play_duration",validation:e.NUMBER_GTE_0},{name:"skipped",validation:e.NUMERIC_BOOL},{name:"interaction",validation:e.NUMERIC_BOOL}];const Oi=[{name:"index",validation:{validator:e=>typeof e==="number"&&(e>=0||e===-1),message:"must be a number equal or greater than 0 or exactly -1"}},{name:"ad_count",validation:e.NUMBER_GTE_0},{name:"duration",validation:e.NUMBER_GTE_0},{name:"host",validation:e.NON_EMPTY_STRING},{name:"type",validation:{validator:e=>e==="pre"||e==="mid"||e==="post",message:'must be one of "pre"|"mid"|"post"'}},{name:"request_mode",validation:{validator:e=>e==="onload"||e==="onplay"||e==="ondemand"||e==="oncue",message:'must be one of "onload"|"onplay"|"ondemand"|"oncue"'}},{name:"time_offset",validation:e.NUMBER_GTE_0},{name:"request_ms",validation:e.NUMBER_GTE_0}];const Pi=G.managedDataStore(Di,"ads_ad_");const Li=G.managedDataStore(Oi,"ads_pod_");const Ri=["progress","seeking","suspend","timeupdate"];const Ni=["seek","stable","unstable"];const Mi=["adend","adscanceled","adserror","adskip","adsready","adstart","adtimeout","contentplayback","contentupdate","nopostroll","nopreroll","readyforpreroll"];const Ui=e=>{return[].concat(e.getTech("Html5").Events)};const Bi=e=>{return Ui(e).filter(e=>Ri.indexOf(e)===-1)};const Fi=["ads-request","ads-response-received","adstart","ads-loading","ads-ad-started","ads-ad-ended","adend"];const qi=["ad_begin","ad_complete","ad_hard_timeout","ad_mode_begin","ad_mode_complete","ad_timeout","ad_viewable_impression","catalog_request","catalog_request_error","catalog_response","error","play_request","player_init","player_load","video_complete","video_engagement","video_impression","video_resumed","video_view"];const Vi=["catalog_request","catalog_request_error","catalog_response"];const Hi="sendBeacon"in tv.navigator;const{Set:$i}=tv;const zi="lbu";const Gi=4e3;const Ki=new $i(["account","domain","event","player"]);const Wi=new $i(["account","delivery_type","destination","domain","dropped_frames","error_code","event","feature","file_size_bytes","forward_buffer_seconds","load_time_ms","measured_bps","media_type","platform","platform_version","player","player_height","player_name","player_width","range","rebuffering_count","rebuffering_seconds","rendition_height","rendition_indicated_bps","rendition_mime_type","rendition_width","response_time_ms","session","start_time_ms","source","time","video","video_duration","video_name","video_seconds_viewed"]);const Yi=(e,t)=>{const i=G.qs();Object.keys(t).forEach(e=>{if(G.isNil(t[e])){delete t[e]}});let s=e+"?"+i.stringify(t);if(s.length<=Gi){return s}Object.keys(t).forEach(e=>{if(!Wi.has(e)){delete t[e]}});t.usage=zi;s=e+"?"+i.stringify(t);return s};const Xi=t=>{Ki.forEach(e=>{if(G.isNil(t[e])){throw new Error(`the "${e}" param is required`)}})};const Qi=a=>{const o=bi(a);class e{constructor(e,t,i,s,n={}){this.baseUrl_=i;this.log=s.createLogger("Client");this.stateAgent_=t;this.player_=e;this.currentAdSequence_=xi();this.beacons_=[];this.beaconsUnsent_=[];this.playerId=n.playerId;this.embedId=n.embedId;this.applicationId=n.applicationId;this.playerUrl_=null;this.user(n.user||null);this.device(n.device||null);const r=e.options_&&e.options_.runtime_||{};const a=r.environment&&r.environment.queryString||{};if(n.requiresConsent){if(typeof tv.BC_ANALYTICS_CONSENT==="boolean"){this.setConsent(tv.BC_ANALYTICS_CONSENT,{silent:true});this.disableSetConsent()}else if(a.hasOwnProperty("analyticsConsent")||e.el().hasAttribute("data-analytics-consent")){this.setConsent(true,{silent:true});this.disableSetConsent()}else{this.setConsent(false,{silent:true})}}else{this.setConsent(true,{silent:true});this.disableSetConsent()}if(n.corpCommsApp){this.log.warn("The `corpCommsApp` option is deprecated. Please use `application` instead.")}this.application(n.application||n.corpCommsApp||null);this.defaultParams_={domain:"videocloud",platform:"video-js",session:""};for(let e=0;e<3;e++){this.defaultParams_.session+=(Math.random()*4294967295>>>0).toString(16)}this.qos=new o(this);this.stateAgent_.resetTimesOf();this.subscribeToAnalyticsEvents_(e)}beacons(){return this.beacons_.map(a.obj.merge)}defaultParams(e){if(e){if(e.player){this.playerUrl_=e.player}e=G.isFn(e)?e():e;this.defaultParams_=a.obj.merge(this.defaultParams_,e)}return this.defaultParams_}getSession(){return this.defaultParams_.session}user(e){if(e!==undefined){if(e===null||G.isNonEmptyStr(e)||G.isNum(e)){this.user_=e}else{this.log.warn("user() must be given a non-empty string, number, or null")}if(this.player_.usingPlugin("chinaMetrics")){this.log.warn("user() cannot be set when using China Delivery");this.user_=null}}return this.user_}setUser(e){this.log.warn("setUser(id) is deprecated, use user(id) instead");this.user(e)}getUser(){this.log.warn("getUser() is deprecated, use user() instead");return this.user()}setConsent(e,t={}){if(typeof e==="boolean"&&this.consent_!==e){this.consent_=e;if(!t.silent){this.player_.trigger({consent:e,type:"analytics-consent-changed"})}}}disableSetConsent(){Object.defineProperty(this,"setConsent",{value:()=>{},configurable:false,enumerable:true,writable:false})}getConsent(){return this.consent_}application(e){if(e===null||G.isNonEmptyStr(e)||G.isNum(e)){this.application_=e}return this.application_}corpCommsApp(e){if(e===null||G.isNonEmptyStr(e)||G.isNum(e)){this.application_=e;this.log.warn("The corpCommsApp() method is deprecated. Please use application() instead.")}return this.application_}device(e){if(e===null||G.isNonEmptyStr(e)||G.isNum(e)){this.device_=e}return this.device_}player(e){if(e===null||G.isNonEmptyStr(e)){this.defaultParams_.player=e;this.playerUrl_=e}return this.playerUrl_||this.defaultParams_.player}subscribeToAnalyticsEvents_(){this.player_.on("analytics-beacon",({params:e})=>{this.send(e)})}send(e={}){const{event:t}=e;if(!qi.includes(t)){return null}const i=this.stateAgent_.getOptions(t);const s=this.sendRequest_(e,i);const n={video_view:"timeOfView",video_impression:"timeOfImpression"};if(s&&n.hasOwnProperty(t)){this.stateAgent_.state[n[t]]=Number(s.params.time)}return s}sendRequest_(e,t={}){if(this.getConsent()){const i=e.analyticsBcovAuthToken;delete e.analyticsBcovAuthToken;const s=Yi(this.baseUrl_,e);if(qi.indexOf(e.event)>-1){if(t.useSendBeaconOnly){if(Hi){tv.navigator.sendBeacon(s)}else{return null}}else if(!!i&&e.event==="video_view"){const n={};n.Authorization="Bearer "+i;a.xhr({method:"GET",headers:n,url:s},function(e,t,i){if(e){a.log.debug("Problem sending video_view beacon",e)}})}else{const r=iv.createElement("img");r.src=s}}return{params:e,url:s}}this.beaconsUnsent_.push({params:e,options:t});return null}sendAllUnsent(){const e=this.beaconsUnsent_.slice();this.beaconsUnsent_=[];return e.map(({params:e,options:t})=>{return this.sendRequest_(e,t)})}}return e};const Ji=(e,t)=>Math.floor(e)+".."+(Math.floor(t)-1);const Zi=(e,t,i,s)=>{let n=`players.brightcove.com/${e}/${t}_${i}`;if(s){n+=`/${s}`}return n};const es=e=>{let t=e.preload();if(typeof t!=="string"){t=e.el().getAttribute("preload")}if(typeof t==="string"&&t.length===0){t="auto"}if(t){return t}};const ts=(e,t,i,s,n)=>{let r=t-e;if(n!==undefined&&nt){s=t}r-=s-i}return r};const is=(e,t,...i)=>{const s=e.obj.merge(t.params||{},...i);delete t.params;return s};const ss=(e,t)=>{const i=e.mediainfo;const s=i&&i.duration||e.duration();if(i){if(t.video===undefined){t.video=i.id}if(t.video_name===undefined){t.video_name=i.name}if(t.reference_id===undefined){t.reference_id=i.referenceId}if(t.custom_fields===undefined){t.custom_fields=i.customFields}if(t.video_data===undefined){t.video_data=i}if(t.video_ads_supported===undefined){t.video_ads_supported=i.economics==="AD_SUPPORTED"}if(t.tags===undefined){t.tags=i.tags}}if(G.isNum(s)&&t.video_duration===undefined){t.video_duration=Math.floor(s);if(t.video_duration<1||t.video_duration===Infinity){t.video_duration=null}}t.media_url=e.currentSrc();return t};const a=["ads_ad_index","ads_ad_deal_id","ads_ad_wrapper_systems","ads_ad_system","ads_ad_skip_time_offset","ads_ad_start_ms","ads_ad_advertiser","ads_ad_content_type","ads_ad_isci","ads_ad_creative_id","ads_ad_duration","ads_ad_title","ads_ad_media_url_domain","ads_pod_index"];const ns=["ads_ad_audible_duration","ads_ad_play_duration","ads_ad_skipped","ads_ad_interaction"];const rs=["ads_pod_ad_count","ads_pod_duration","ads_pod_host","ads_pod_type","ads_pod_request_ms","ads_pod_request_mode","ads_pod_time_offset"];const as=["ad_mode_begin","ad_mode_complete"];const os=(e,t={})=>{const i={};for(const s of e){if(t[s]!==undefined){i[s]=t[s]}}return i};const ls={triggerAdBegin:{event:"ad_begin",params:a},triggerAdComplete:{event:"ad_complete",params:[...a,...ns]},triggerAdModeBegin:{event:"ad_mode_begin",params:[...a,...rs]},triggerAdModeComplete:{event:"ad_mode_complete",params:[...a,...rs]},triggerVideoResumed:{event:"video_resumed"},triggerAdViewableImpression:{event:"ad_viewable_impression",params:a}};function cs(e){return{adBegin:()=>{e.triggerAdBegin()},adComplete:()=>{e.triggerAdComplete()},adModeBegin:()=>{e.triggerAdModeBegin()},adModeComplete:()=>{e.triggerAdModeComplete()},videoResumed:()=>{e.triggerVideoResumed()},adViewableImpression:()=>{e.triggerAdViewableImpression()}}}const us=o=>{class e{constructor(e,t,i,s,n){this.player_=e;this.client_=t;this.history_=i;this.stateAgent_=s;this.log=n.createLogger("Emitter");this.eventCount_=0;this.streamCount_=-1;this.addInsightsTriggers()}addInsightsTriggers(){Object.keys(ls).forEach(e=>{const t=ls[e].event;const i=ls[e].params;const s=Object.getPrototypeOf(this);s[e]=this.createInsightsTrigger(t,i)})}createInsightsTrigger(r,a){return(e={})=>{let t={event:r};if(a&&this.player_.ads&&this.player_.ads.ad){const{ad:i,pod:s}=this.player_.ads;const{merge:e}=o.obj;const n=as.includes(r)&&s?e(i,s):i;t=e(t,os(a,n))}this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,t))}}emitAnalyticsEvents_(e,t){e.trigger({params:t,type:"analytics-beacon"});const i=String(t.event).replace(/\_/g,"-");e.trigger({params:t,type:`analytics-beacon-${i}`})}refineClientParams_(t,e){if(this.client_.user()){t.user=this.client_.user()}if(this.client_.application()){t.application=this.client_.application();t.user=this.client_.user()||this.client_.device()}if(G.isNil(t.time)){t.time=Date.now()}t.autoplay=this.player_.autoplay();e.qos=Array.isArray(e.qos)?e.qos:[];e.qos.push("mr");e.qos.push("locked");t=o.obj.merge(this.client_.defaultParams_,t,this.client_.qos.flush(...e.qos));t.seq=""+this.eventCount_;if(qi.indexOf(t.event)>-1){this.eventCount_++}if("streamCount"in e){t.seq+="_"+e.streamCount}if(typeof this.player_.getAccountId==="function"){const i=this.player_.getAccountId();const s=t.account;let e="";if(G.isNonEmptyStr(i)){e=i}else if(G.isNonEmptyStr(s)){e=s}t.account=e;t.player=this.client_.playerUrl_||Zi(t.account,this.client_.playerId,this.client_.embedId,this.client_.applicationId)}if(t.event&&t.event.startsWith("ad_")){if(this.player_.ads&&this.player_.ads.pod){const n=this.player_.ads.pod.index;if(n!==undefined){t.ads_pod_index=n}}}Xi(t);return{params:t,options:e}}resolveData_(e,t){const i=["player_init","player_load",...Vi];const{params:s,options:n}=this.refineClientParams_(i.includes(t.event)?is(o,e,t):ss(this.player_,is(o,e,t)),e);if(Vi.includes(t.event)){const{error:r,xhr:a}=n;if(r){s.error=JSON.stringify(a?w(r,{status:a.status}):r)}}this.client_.beacons_.push(s);this.log.debug(s.event,s);this.stateAgent_.setOptions(s.event,n);return s}triggerAdError(e={}){const t=this.player_.ads&&this.player_.ads.ad;const i=o.obj.merge({event:"ad_error"},os(a,t));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,i))}triggerFullscreenEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"fullscreen_enabled"}))}triggerFullscreenDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"fullscreen_disabled"}))}triggerShareOverlay(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_overlay"}))}triggerShareSocialClicked(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_social_clicked"}))}triggerShareLinkCopied(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_link_copied"}))}triggerShareEmbedCopied(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_embed_copied"}))}triggerEnterPIP(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pip_enabled"}))}triggerLeavePIP(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pip_disabled"}))}triggerMuteEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"mute_enabled"}))}triggerMuteDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"mute_disabled"}))}triggerVolumeChange(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"volume_change"}))}triggerVideoPause(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"video_pause"}))}triggerVideoResume(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"video_resume"}))}triggerTextTrackEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"text_track_enabled"}))}triggerTextTrackDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"text_track_disabled"}))}triggerVideoImpression(e={}){const t=G.isNonEmptyStr(this.player_.currentSrc());if(!t||this.stateAgent_.state.timeOfImpression){this.log.debug("skipped video_impression",{reason:!t&&"there is no source"||`already sent at ${this.stateAgent_.state.timeOfImpression}`});return}this.streamCount_++;e.streamCount=this.streamCount_;const i=this.player_.currentType();if(G.isNonEmptyStr(i)){this.client_.qos.append("content",{sourceMimeType:i});e.qos=e.qos||["content"];const a=this.player_.audioOnlyMode_||this.player_.audioPosterMode_||this.player_.isAudio_;this.client_.defaultParams({media_type:G.getSimpleType(i,a)})}const s=this.resolveData_(e,{event:"video_impression"});const n=Ci(this.player_);const r=es(this.player_);if(Object.keys(n).length>0){s.web_ad_info=JSON.stringify(n)}if(r){s.preload=r}this.emitAnalyticsEvents_(this.player_,s)}triggerVideoView(e={}){const t=G.isNonEmptyStr(this.player_.currentSrc());const{timeOfView:i,timeOfImpression:s}=this.stateAgent_.state;if(!t||i||!s){this.log.debug("skipped video_view",{reason:!t&&"there is no source"||i&&`already sent at ${i}`||'"video_impression" not sent'});return}e.streamCount=this.streamCount_;const n=this.resolveData_(e,{event:"video_view"});const r=this.history_;const a=r.first("canplay");const o=r.first("loadstart");const l=r.first("play",true);if(a){n.load_time_ms=a-s}n.start_time_ms=ts(l||o,n.time,r.first("adstart",true),r.first("adend",true),r.first("adtimeout",true));if(this.player_.usingPlugin("pluginDev")){n.feature="iris"}this.emitAnalyticsEvents_(this.player_,n)}triggerVideoEngagement(t,e,i={}){const{buffered:s,duration:n,playbackEndTime:r,height:a,mediainfo:o,rebufferingCount:l,rendition:c,renditionWidth:u,renditionHeight:d,playbackStartTime:h,rangeStart:f,rangeEnd:p,rebuffering:m,rebufferingTime:g,rebufferingStart:v,stats:y,width:b}=e;const _=r-h;i.qos=i.qos||["bitrates","events","player","frames"];i.streamCount=this.streamCount_;t.length=t.end-t.start;this.log.debug("video_engagement requested",{rawOptions:i,period:t,playbackStartTime:h,playbackLength:_,playbackEndTime:r});let T=g;if(m&&v>0){const w=(Date.now()-v)/1e3;T=parseFloat(g+w).toFixed(1)}if(_<1&&T<=0){this.log.debug("video_engagement skipped; no rebuffering detected and playback duration too short");return null}const S=this.resolveData_(i,{event:"video_engagement"});S.player_height=a;S.player_width=b;S.video_duration=n;S.rendition_width=u;S.rendition_height=d;if(o){S.video=o.id;S.video_name=o.name}if(c){S.rendition_url=c.url;S.rendition_indicated_bps=c.indicatedBPS;S.rendition_mime_type=c.mimeType;S.rendition_height=c.height;S.rendition_width=c.width}if(y){if(!G.isNil(y.mediaRequests)){S.media_requests=y.mediaRequests}if(!G.isNil(y.mediaTransferDuration)){S.media_transfer_duration=y.mediaTransferDuration}if(!G.isNil(y.mediaBytesTransferred)){S.media_bytes_transferred=y.mediaBytesTransferred}if(!G.isNil(y.bandwidth)){S.measured_bps=y.bandwidth}if(!G.isNil(y.mediaSecondsLoaded)){S.media_seconds_loaded=y.mediaSecondsLoaded}}if(l>0){S.rebuffering_count=l}if(T>0){S.rebuffering_seconds=T}if(s){let t=0;for(let e=0;e=k&&r<=j){t=j-r;break}}S.forward_buffer_seconds=t}const E=this.history_.filter(e=>e.name==="licenserequestattempted"&&e.time>=t.start&&e.time=1){S["qos.derived_range"]=Ji(h,r);S.range=`${f}..${p}`}this.emitAnalyticsEvents_(this.player_,S);return S}sendError(e={}){const t=this.player_.error();if(!t){this.log.debug("skipped error event emission because there was no player error");return}e.streamCount=this.streamCount_;const i=this.resolveData_(e,{event:"error"});const s=G.isFn(this.player_.errors)&&G.isFn(this.player_.errors.getAll)&&this.player_.errors.getAll()||{unknown:{type:"MEDIA_ERR_UNKNOWN"}};if(t&&s.hasOwnProperty(String(t.code))){i.error_code=s[String(t.code)].type}else if(t.type!==undefined){i.error_code=t.type}else{i.error_code=s.unknown.type}this.emitAnalyticsEvents_(this.player_,i)}triggerCatalogRequest(e,t={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(t,{event:"catalog_request",url:e}))}triggerCatalogRequestError(e,t={}){if(t.error){t.error=fi(t.error,["code","message","type"])}const i=this.resolveData_(t,{event:"catalog_request_error",url:e});this.emitAnalyticsEvents_(this.player_,i)}triggerCatalogResponse(e,t={}){const i=this.resolveData_(t,{event:"catalog_response",url:e});i.response_time_ms=i.time-this.history_.last("catalog_request");this.emitAnalyticsEvents_(this.player_,i)}triggerAdHardTimeout(e={}){e.streamCount=this.streamCount_;this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_hard_timeout"}))}triggerAdModeBegin(e={}){const t=this.player_.ads&&this.player_.ads.pod;const i=o.obj.merge({event:"ad_mode_begin"},os(rs,t));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,i))}triggerAdModeComplete(e={}){const t=this.player_.ads&&this.player_.ads.pod;const i=o.obj.merge({event:"ad_mode_complete"},os(rs,t));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,i))}triggerAdTimeout(e={}){e.streamCount=this.streamCount_;this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_timeout"}))}triggerPlayRequest(e={}){if(this.stateAgent_.state.timeOfPlayRequest){return}this.client_.defaultParams({delivery_type:G.isLive(this.player_)?"live":"ondemand"});e.streamCount=this.streamCount_;const t=this.resolveData_(e,{event:"play_request"});this.emitAnalyticsEvents_(this.player_,t);this.stateAgent_.state.timeOfPlayRequest=Number(t.time)}triggerPlayerInit(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"player_init"}))}triggerPlayerLoad(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"player_load"}))}}return e};class ds{constructor(){this.optionsQueue_=[];this.state={};this.resetTimesOf()}setOptions(e,t){this.optionsQueue_.push({event:e,options:t})}getOptions(t){const e=this.optionsQueue_.findIndex(({event:e})=>e===t);if(e>-1){const{options:i}=this.optionsQueue_[e];this.optionsQueue_.splice(e,1);return i}}resetTimesOf(){this.state.timeOfImpression=null;this.state.timeOfView=null;this.state.timeOfPlayRequest=null}}const hs=e=>typeof e==="number"&&!isNaN(e)&&e>=0&&ee.map(e=>Math.floor(e)).reduce((e,t)=>{const i=e[e.length-1];if(t!==i){e.push(t)}return e},[]);const ps=e=>e.reduce((e,t)=>{const i=e[e.length-1];if(i){if(i.end+1===t){i.end=t}else{e.push({start:t,end:t})}}else{e.push({start:t,end:t})}return e},[]);const ms=e=>e.map(e=>{const{start:t,end:i}=e;const s=i-t;if(s>0){return{start:t,end:i-1,remainder:i}}return{start:t,end:i,remainder:i}});const gs=t=>{const i=[];let{start:s,end:n,remainder:r}=t.shift()||{};while(hs(s)&&hs(n)&&hs(r)&&s===n&&s===r){({start:s,end:n,remainder:r}=t.shift()||{})}if(t.length===0){i.push(r)}for(let e=0;egs(ms(ps(fs(e))));let ys=1;function bs(){return ys++}const l=[];const _s=function(t,e,i,s,n=true){const r=[].concat(i).sort();if(e!=="removeEventListener"){t.off(r,s)}else{r.forEach(function(e){t.removeEventListener(e,s)})}if(!n){return}let a=l.length;while(a--){const o=l[a];if(o.context===t&&(o.fn.guid===s.guid||o.fn===s)&&r.every((e,t)=>o.events[t])){l.splice(a,1);break}}};const Ts=function(){let e=l.length;while(e--){const{context:t,mode:i,events:s,fn:n}=l.shift();let e="off";if(i==="addEventListener"){e="removeEventListener"}_s(t,e,s,n,false)}};const A=function(e,t,i,s){const n=[].concat(i).sort();const r={events:n,fn:s,mode:t,context:e};if(t==="one"||t==="onePerSrc"){r.fn=function(...e){let t="off";if(r.mode==="addEventListener"){t="removeEventListener"}_s(r.context,t,r.events,r.fn);return s.apply(this,e)};if(!s.guid){s.guid=bs()}r.fn.guid=s.guid}l.push(r);if(t==="addEventListener"){r.events.forEach(e=>{r.context.addEventListener(e,r.fn)})}else{r.context[r.mode](r.events,r.fn)}};const Ss=function(){const e=l.slice(0);Ts();e.forEach(({context:e,mode:t,events:i,fn:s})=>{A(e,t,i,s)})};const Es=1e4;const ws=e=>Boolean(e.onceux&&e.onceux.currentTime&&e.onceux.timeline);const ks=g=>{class e extends g.EventTarget{constructor(e,t){super();this.player_=e;this.log=t.createLogger("Engager");this.stateBySrc_={};this.lastStateRecord_=0;this.disposed_=false}stateBySrc(e=this.player_.currentSrc()){if(!this.stateBySrc_.hasOwnProperty(e)){this.stateBySrc_[e]={buffered:null,duration:0,end:0,height:0,mediainfo:null,playbackRate:1,rebufferingCount:0,src:e,start:0,width:0,playbackStartTime:0,playbackEndTime:0,stats:null,rebuffering:false,rebufferingEnd:0,rebufferingTime:0,rebufferingStart:0,rendition:null,videoPlaybackQuality:null,times:[]}}const t=this.player_.tech_&&this.player_.tech_.vhs;this.stateBySrc_[e].stats=t&&t.stats||null;return this.stateBySrc_[e]}clearStateBySrc(e=this.player_.currentSrc()){this.log.debug("cleared",this.stateBySrc_[e]);delete this.stateBySrc_[e]}updateState(e=this.player_.currentSrc(),t){const{isObj:i}=G;if(!i(t)){g.log.warn("Engager.updateState: requires update arg to be an object");return this.stateBySrc(e)}const s=g.obj.merge(this.stateBySrc(e),t);this.stateBySrc_[e]=s;return s}recordState(){const e=this.player_;const t=this.stateBySrc();t.mediainfo=e.mediainfo;t.playbackEndTime=e.currentTime();t.times.push(t.playbackEndTime);if(ws(e)){t.duration=e.onceux.timeline.contentDuration}else{t.duration=e.duration()}t.buffered=e.buffered();t.playbackRate=e.playbackRate()}isTracking(){return!!this.timerId_}start(e={}){if(this.disposed_){return}let{reason:t,src:i}=e;if(!i){i=this.player_.currentSrc()}const s=this.stateBySrc(i);s.playbackStartTime=s.playbackEndTime=this.player_.currentTime();if(ws(this.player_)){s.duration=this.player_.onceux.timeline.contentDuration}else{s.duration=this.player_.duration()}s.rebufferingCount=0;s.rebufferingEnd=0;s.rebufferingTime=0;if(e.isRebuffering){s.rebuffering=true;s.rebufferingStart=Date.now()}else{s.rebufferingStart=0}this.player_.clearTimeout(this.timerId_);this.timerCreatedAt_=Date.now();this.timerId_=this.player_.setTimeout(()=>this.stop({src:i,reason:"engagement timer fired"}),Es);this.log.debug("started",{reason:t,time:this.timerCreatedAt_});return this}prepareState_(e){const t=this.player_;const i=this.stateBySrc(e);const{isNativeHlsSupported:s}=G;const n=t.currentType();i.height=Math.round(t.currentHeight());i.width=Math.round(t.currentWidth());const r=t.tech_&&t.tech_.vhs;if(r&&r.playlists&&r.playlists.media()){const e=r.playlists.media();const u=i.rendition={url:e.resolvedUri,mimeType:n};if(e.attributes){u.indicatedBPS=e.attributes.BANDWIDTH;if(e.attributes.RESOLUTION){u.height=e.attributes.RESOLUTION.height;u.width=e.attributes.RESOLUTION.width}}}if(s(g)&&n==="application/vnd.apple.mpegurl"){const d=this.stateBySrc_[this.player_.currentSrc()].parsedManifest||{playlists:[]};const{playlists:h}=d;const f=this.inferRenditions_(h);const p=()=>{if(!f.length){return{url:null,bandwidth:null}}if(f.length>1){return{url:"multiple",bandwidth:"multiple"}}return{url:f[0].uri,bandwidth:f[0].attributes.BANDWIDTH}};const m=p();i.rendition=g.obj.merge(i.rendition,{mimeType:"application/x-mpegurl",height:Math.round(t.videoHeight()),width:Math.round(t.videoWidth()),url:m.url,indicatedBPS:m.bandwidth})}i.videoPlaybackQuality=t.getVideoPlaybackQuality();i.times.push(t.currentTime());const{start:a,end:o,remainders:l,ranges:c}=vs(i.times);i.times=l;return g.obj.merge({rangeExtras:c,rangeStart:a,rangeEnd:o},i)}inferRenditions_(e){if(!e||!Array.isArray(e)||!e.length){return[]}const c=this.player_.videoWidth();const u=new Set(e.map(e=>e.attributes.RESOLUTION.width).sort((e,t)=>e-t));const d=(e=c,t=Array.from(u))=>{const i=Math.floor((t.length-1)/2);const s=t.slice(0,i+1);const n=t.slice(i+1);const r=s[s.length-1];const a=n[0];if(r===e||a===e){return[e]}if(t.length===1){return t}if(re){const o=Math.abs(r-e);const l=Math.abs(a-e);if(o===l){return[r,a]}return Math.min(o,l)===o?[r]:[a]}if(r>e){return d(e,s)}if(a{i=[...i,...e.filter(e=>e.attributes.RESOLUTION.width===t)]});return i}stop(e={}){if(!e.src){e.src=this.player_.currentSrc()}if(this.isTracking()){this.player_.clearTimeout(this.timerId_);this.timerId_=null;const t=this.stateBySrc(e.src);const i=(t.duration-t.playbackEndTime)*1e3;if(!this.player_.ended()&&i>0&&i<1500){this.timerId_=true;this.log.debug("delayed",{msFromEnd:i});A(this.player_,"one","ended",()=>{this.recordState();this.stop({reason:"content ended after we delayed the engager"})});return this}e.state=this.prepareState_(e.src);e.period=e.period||{};e.period.start=e.period.start||this.timerCreatedAt_;e.period.end=e.period.end||Date.now();this.log.debug("stopped",e);this.trigger({type:"engagement",engagement:e})}return this}dispose(){this.disposed_=true;this.stop({ignoreAdState:true,reason:"player disposed"});this.off();return this}}return e};const js=n=>{class e{constructor(e,t){this.log=t;this.player_=e;this.events_=[]}add(e,t=Date.now(),i){const s=n.obj.merge(i,{name:e,time:t});this.events_.push(s);this.log.debug(`saw "${e}" at`,t,i);return t}record(e){const t=Date.now();this.add(e,t,{adState:Ti(this.player_),isInAdState:x(this.player_)});return t}reset(){this.events_.length=0}filter(t){if(!G.isFn(t)){return this.events_.filter(e=>e.name===t)}return this.events_.filter(t)}map(e){return this.events_.map(e)}names(){return this.map(e=>e.name)}first(t,i){for(let e=0;e=this.visThreshold}_createVisibilityChangeHandler(){const e=function(e){if(this._isConsideredVisible(e)){if(!this.timeout){this._startTimeout()}}else if(this.timeout){this._stopTimeout()}};return e.bind(this)}_startTimeout(){this.timeout=this.player.setTimeout(()=>{this.callback();this.shutdown()},this.duration)}_stopTimeout(){tv.clearTimeout(this.timeout);this.timeout=null}initialize(){if(this._isConsideredVisible(this._getVisState())){this._startTimeout()}this._startListening()}shutdown(){this._stopTimeout();this._stopListening()}}const As=/["'&<>]/;const Ds=e=>{const t=""+e;const i=As.exec(t);if(!i){return t}let s;let n="";let r=0;let a=0;for(r=i.index;r{Object.keys(s).forEach(e=>{i[e]=String(i[e]||"");if(e==="accountId"&&!G.isNonEmptyStr(i[e])){i[e]=String(i.account||"")}if(!G.isNonEmptyStr(i[e])){i[e]=t.getAttribute(`data-${s[e]}`)||""}});return i};const Ls=(e,t)=>{const{accountId:i,applicationId:s,embedId:n,playerId:r}=Ps(e.el(),t,{accountId:"account",applicationId:"application-id",embedId:"embed",playerId:"player",playerName:"name",usage:"usage"});if(!G.isNonEmptyStr(t.player)){if(tv.location.hostname==="players.api.brightcove.com"){t.player=`players.api.brightcove.com/${r}_${n}`;return}t.player=Zi(i,r,n);if(s){t.player+="/"+s}}if(s){if(G.isNonEmptyStr(t.playerName)){t.playerName+=" - "+s}else{t.playerName=s}}};const Rs=e=>({computedHeight:e.currentHeight(),computedWidth:e.currentWidth(),height:e.height(),width:e.width()});const Ns=(e,t)=>{if(typeof e==="boolean"){t.warn("The __iframe__ option should only be used in tests!");return e}try{return tv.parent!==tv.self}catch(e){return true}};const Ms=S=>{const E=Bi(S);const w=Qi(S);const k=us(S);const j=ks(S);const C=js(S);const e=function(d={}){let r=false;let a=false;const o={};let e;d=S.obj.merge(d);d.env=Os.hasOwnProperty(d.env)?d.env:"production";Ls(this,d);const l=this.log.createLogger("analytics");const h=new j(this,l);const c=new C(this,l);const u=new ds;const f=new Cs;const t=G.isNonEmptyStr(d.usage)?d.usage.split(","):[];t.forEach(function(e){f.put(e)});const p=new w(this,u,G.isNonEmptyStr(d.analyticsUrl)?d.analyticsUrl:Os[d.env],l,{user:d.user,corpCommsApp:d.corpCommsApp,application:d.application,device:d.device,playerId:d.playerId,embedId:d.embedId,applicationId:d.applicationId,requiresConsent:d.requiresConsent});const m=new k(this,p,c,u,l);const i=cs(m);p.defaultParams(()=>{const t={account:d.accountId||null,destination:tv.location.href,platform_version:d.platformVersion,player:d.player,player_name:d.playerName,source:iv.referrer};if(Ns(d.__iframe__,l)){t.destination=iv.referrer;if(G.isNonEmptyStr(d.referrer)){t.source=d.referrer}else{try{t.source=tv.parent.document.referrer}catch(e){t.source=null}}}return t});A(this,"on","pluginsetup:ads",Ss);const s=t=>{[l,p.log,h.log,c.log,m.log].forEach(e=>{if(t){e.level("debug");e.history.enable()}else{e.level("warn");e.history.disable()}})};d.debug=Boolean(d.debug);s(d.debug);this.on("debugon",()=>s(true));this.on("debugoff",()=>s(false));const n=e=>{if(e!==null&&!G.isNonEmptyStr(e)){S.log.warn("Authorization Token must be a valid string or null");return}this.analyticsBcovAuthToken_=e};const g=e=>{if(!G.isNonEmptyStr(e)){S.log.warn("Player name must be a valid string");return}e=Ds(e);p.defaultParams({player_name:Ds(e)})};const v=e=>{if(!G.isNonEmptyStr(e)){S.log.warn("Application ID must be a valid string");return}e=Ds(e);p.applicationId=e};const y=e=>{if(!G.isNonEmptyStr(e)){S.log.warn("Viewer ID must be a string");return}p.user(e)};this.bcAnalytics={client:p,emitter:m,engager:h,history:c,setBcovAuthToken:n,setPlayerName:g,setApplicationId:v,setViewerId:y,settings:d,insightsBeacons:i,VERSION:I};A(this,"on","usage",e=>{if(!e.name){return l.warn("Ignored usage event without a `name` parameter")}f.put(e.name)});const b=function(){f.put("pagehide");h.stop({fromUnload:true,ignoreAdState:true,reason:"pagehide called"})};A(tv,"addEventListener","pagehide",b);const _=e=>{if(!e.usingPlugin("bcAirplay")){return false}if(e.isConnectingToAirplay){e.isConnectingToAirplay=false;return true}};const T=e=>{l.debug(e?`workflow saw "${e.type}"`:"workflow called manually");if(!ji(e,this)){l.debug("workflow bailing because player is in an ad state");return}let t=c.first("loadstart",wi(this));let i=c.first("play");let s=c.last("playing");l.debug("workflow checking history",{loadstart:t,play:i,playing:s});if(e&&e.type==="playing"&&c.last("pause")){m.triggerVideoResume()}if((i||s)&&!h.isTracking()&&!this.paused()){h.start({period:{start:i||s},reason:"workflow detected that it is playing",isRebuffering:h.stateBySrc().rebuffering})}if(u.state.timeOfImpression&&u.state.timeOfView){return}o.workflow=o.workflow||this.setTimeout(()=>{o.workflow=null;t=c.first("loadstart",wi(this));i=c.first("play");s=c.last("playing");if((t||i)&&!u.state.timeOfImpression){m.triggerVideoImpression({params:{time:Math.min(t||Infinity,i||Infinity)}})}if(t&&s&&!u.state.timeOfView){l.debug("workflow complete",{order:c.names()});m.triggerVideoView({params:{time:s,analyticsBcovAuthToken:this.analyticsBcovAuthToken_}})}},1)};if(typeof this.ads==="function"){this.adDataStore={adData:Pi,podData:Li}}h.on("engagement",e=>{const{fromUnload:t,ignoreAdState:i,period:s,restartAlways:n,state:r}=e.engagement;const a=x(this);const o={useSendBeaconOnly:t,params:{time:s.end}};if(r.rangeExtras>=2){f.put("disco-engmnt")}const l=f.peek();if(l&&l.length){o.params.usage=l.map(tv.encodeURIComponent).sort().join(",")}if(!a||i){p.qos.append("frames",r.videoPlaybackQuality);const c=m.triggerVideoEngagement(s,r,o);if(n||c&&!this.paused()){if(a){return}f.flush();h.start({reason:"sent engagement and still playing",isRebuffering:h.stateBySrc().rebuffering})}}});A(this,"on","dispose",()=>{Ts();f.put("disposed");h.dispose()});A(this,"on",E.concat(Mi,Ni).concat("sourceunstable"),e=>{c.record(e.type)});A(this,"on",E.concat("ads-ad-started"),e=>{p.qos.append("event",x(this)?"ad":"content",e.type)});A(this,"on",["loadedmetadata","resize"],()=>{p.qos.append("player",Rs(this))});A(this,"on","fullscreenchange",()=>{const e=Date.now();o.fullscreen=this.setTimeout(()=>{o.fullscreen=null;if(this.isFullscreen()){m.triggerFullscreenEnabled()}else{m.triggerFullscreenDisabled()}p.qos.append("player",Rs(this),e)},500)});A(this,"on","mediachange",()=>{if(this.tech_.vhs){const e=this.tech_.vhs.playlists.media();p.qos.append("bitrate",{bitrates:this.tech_.vhs.bandwidth,playlists:e&&e.attributes&&e.attributes.BANDWIDTH})}});A(this,"on","ratechange",()=>{const e=this.playbackRate().toFixed(2);f.put("pr:"+e)});A(this,"on","pipactive",()=>{m.triggerEnterPIP()});A(this,"on","pipinactive",()=>{m.triggerLeavePIP()});A(this,"on","texttrackchange",t=>{const i=this.textTracks();if(c.last(t.type)){const e=c.filter(t.type);const s=e[e.length-1].text_track_index;m.triggerTextTrackDisabled({params:{text_track_kind:i[s].kind,text_track_language:i[s].language}})}for(let e=0;e{if(this.muted()&&!e){e=true;m.triggerMuteEnabled()}if(!this.muted()&&e){e=false;m.triggerMuteDisabled()}if(!this.muted()){m.triggerVolumeChange({params:{volume:this.volume()}})}});A(this,"on","ready",()=>{e=this.muted();A(this.tech_,"on","usage",e=>{if(!e.name){return l.warn("Ignored usage event without a `name` parameter")}f.put(e.name)});A(this.tech_,"on","bandwidthupdate",()=>{p.qos.append("bitrate",{bitrates:this.tech_.vhs.bandwidth,throughput:Math.round(this.tech_.vhs.throughput)})});A(this.tech_,"on","liveresync",()=>{this.trigger({type:"usage",name:"hls-live-resync"})});A(this.tech_,"on","videounderflow",()=>{this.trigger({type:"usage",name:"hls-video-underflow"})});A(this.tech_,"on","licenserequestattempted",()=>{c.add("licenserequestattempted")});A(this,"on","loadedmetadata",()=>{const s=this.player_.currentSrc();const e=S.url.parseUrl(s);const t=e.hostname.indexOf("boltdns.net")===-1;const i=Boolean(h.stateBySrc(s)&&h.stateBySrc(s).parsedManifest);const n=this.currentType();const{isHlsType:r,isNativeHlsSupported:a}=G;const o=typeof d.nativeQoe==="boolean"?d.nativeQoe:!t;if(a(S)&&r(n)&&o&&!i){const{downloadManifest:e,parseHlsManifest:i}=G;const c=e(s);c.then(e=>{const t=i(e);h.updateState(s,{parsedManifest:t})},e=>{S.log.error(e)})}const l=this.textTracks();for(let e=0;e{const e=u.activeCues[0];if(e){const t=this.tech_.vhs.playlists.main.playlists[e.value.playlist];if(i!==t.uri){if(t.attributes&&t.attributes.BANDWIDTH){p.qos.append("bitrate",{rendered:t.attributes.BANDWIDTH})}if(i!==undefined){h.stop({reason:"rendition on screen changed",restartAlways:true})}}i=t.uri}})}}if(this.usingPlugin("social")){A(this.socialButton,"on","click",()=>{m.triggerShareOverlay()});A(this.socialOverlay,"on","click",e=>{if(e.target.classList.contains("vjs-social-share-link")){m.triggerShareSocialClicked({params:{share_network:e.target.getAttribute("title").toLowerCase()}})}});A(this.socialOverlay,"on","copy",e=>{if(e.target.parentElement.classList.contains("vjs-social-direct-link")){m.triggerShareLinkCopied({params:{link_url:this.socialOverlay.getDirectLink()}})}else if(e.target.parentElement.classList.contains("vjs-social-embed-code")){m.triggerShareEmbedCopied({params:{embed_code:this.socialOverlay.getEmbedCode()}})}})}if(G.isLive(this.player_)&&this.player_.liveTracker){A(this.player_.liveTracker,"on","liveedgechange",()=>{p.defaultParams({delivery_type:this.player_.liveTracker.behindLiveEdge()?"dvr":"live"})})}})});A(this,"on","waiting",e=>{const t=this.currentTime()===0&&!this.paused();if(!a&&!t&&!x(this)&&!h.stateBySrc().rebuffering){h.stateBySrc().rebuffering=true;h.stateBySrc().rebufferingCount++;h.stateBySrc().rebufferingStart=Date.now()}A(this,"one",["playing","pause"],()=>{if(h.stateBySrc().rebuffering){h.stateBySrc().rebufferingEnd=Date.now();const e=(h.stateBySrc().rebufferingEnd-h.stateBySrc().rebufferingStart)/1e3;const t=h.stateBySrc().rebufferingTime+e;const i=parseFloat(t.toFixed(1));h.stateBySrc().rebufferingTime=i;h.stateBySrc().rebuffering=false}})});A(this,"on","sourcechanged",(e,t)=>{const i=t.interimEvents;const s=i[0].event;const n=()=>{if(!a&&!x(this)){h.recordState()}};l.debug("sourcechanged",{by:s.type,interim:i.map(e=>e.event.type),from:t.from,to:t.to});if(t.from){h.stop({reason:"changing sources",period:{end:i[0].time},ignoreAdState:true,src:t.from});h.clearStateBySrc(t.from)}r=false;a=false;u.resetTimesOf();c.reset();i.forEach(e=>c.add(e.event.type,e.time));T();A(this,"onPerSrc","timeupdate",n);A(this,"onePerSrc","sourceunstable",()=>{if(Ti(this)==="content-resuming"){return}const e=this.currentSrc();h.stop({ignoreAdState:true,reason:"sourceunstable",src:e});if(!x(this)){_s(this,"off","timeupdate",n)}});A(this,"onPerSrc",["loadstart","play","playing"],T);A(this,"onPerSrc",["pause","ratechange"],e=>{if(e.type==="pause"){c.record(e.type);m.triggerVideoPause()}if(!a&&!x(this)&&!this.ended()){h.stop({reason:`saw "${e.type}"`});if(this.paused()){A(this,"onePerSrc","playing",()=>{h.start({reason:"playback began after a pause",isRebuffering:h.stateBySrc().rebuffering})})}else if(e.type==="ratechange"){o.ratechange=this.setTimeout(()=>{o.ratechange=null;h.start({reason:"the playback rate changed",isRebuffering:h.stateBySrc().rebuffering})},1)}}});A(this,"onPerSrc","unstable",()=>{if(!a&&!x(this)){a=true;h.stop({reason:"seeking"})}});A(this,"onPerSrc","seek",()=>{if(a&&!x(this)){a=false;h.start({reason:"stopped seeking",isRebuffering:h.stateBySrc().rebuffering})}});A(this,"onePerSrc","adstart",()=>{if(!Si(this)){m.triggerVideoImpression({params:{time:c.last("adstart",true)-100}})}});A(this,"onPerSrc","adstart",()=>{r=this.ended();h.stop({ignoreAdState:true,period:{end:c.last("adstart",true)},reason:"saw adstart"})});A(this,"onePerSrc","adend",()=>{if(!this.paused()&&!this.ended()){T()}});A(this,"onPerSrc","adend",()=>{if(!r){h.start({reason:'saw "adend"'})}})});A(this,"on","catalog_request",e=>{c.record(e.type);m.triggerCatalogRequest(e.url)});A(this,"on","catalog_request_error",e=>{c.record(e.type);m.triggerCatalogRequestError(e.url,{error:e.error,xhr:e.response})});A(this,"on","catalog_response",e=>{c.record(e.type);m.triggerCatalogResponse(e.url,{xhr:e.response})});A(this,"on","play",e=>{if(ki(this)||_(this)||c.first("play")!==c.last("play")){return}const t={params:{time:Date.now()}};if(this.perSourceBehaviors.isSrcStable()){m.triggerPlayRequest(t)}else{A(this,"one","sourcechanged",()=>{m.triggerPlayRequest(t)})}});A(this,"on","error",()=>{if(!x(this)){m.sendError()}});A(this,"on","adstart",()=>{m.triggerAdModeBegin();o.perSrcDisable=this.setTimeout(()=>{o.perSrcDisable=null;this.perSourceBehaviors.disable()},1);this.one("playing",function(){const e=c.filter(e=>e.name==="playing").length;if(e>1){m.triggerVideoResumed()}})});A(this,"on","adend",()=>{m.triggerAdModeComplete();if(o.perSrcDisable){this.clearTimeout(o.perSrcDisable)}else{this.perSourceBehaviors.enable()}});A(this,"on","adserror",e=>{m.triggerAdError({params:{ad_error:e.errorCode}})});A(this,"on","adtimeout",()=>{m.triggerAdTimeout()});A(this,"on","ad-hard-timeout",()=>{m.triggerAdHardTimeout()});A(this,"on",Fi,e=>{Ai(p,e.type,Date.now())});A(this,"on","ads-ad-started",e=>{const t=new xs({player:this,visThreshold:.5,duration:2e3,callback:()=>{this.bcAnalytics.insightsBeacons.adViewableImpression()}});t.initialize();this.any(["ads-ad-ended","adend","adtimeout","adserror"],()=>{t.shutdown()})});p.qos.append("mr",d.mr);p.qos.append("locked",d.playerVersionLocked);if(G.isFn(d.beforeFirstBeacon)){d.beforeFirstBeacon(this)}m.triggerPlayerInit();m.sendError();A(this,"on","ready",()=>{p.defaultParams({feature:Si(this)?"adonly":null,autoplay:this.autoplay(),ads_enabled:this.ads!==undefined});p.qos.append("performance",(tv.location.href||"").split("?")[1]);p.qos.append("player",Rs(this));if("hidden"in iv&&"visibilityState"in iv){if(iv.hidden){this.trigger({type:"usage",name:"document-hidden"})}const e=()=>{this.trigger({type:"usage",name:"document-"+iv.visibilityState})};A(iv,"addEventListener","visibilitychange",e)}if(iv.querySelector(".bc-iframe")){this.trigger({type:"usage",name:"iframe-embed"})}else{this.trigger({type:"usage",name:"inpage-embed"})}m.triggerPlayerLoad({qos:p.qos.keys(),params:{usage:f.flush()}})})};e.VERSION=I;S.registerPlugin("bcAnalytics",e);return e};const C="video";const D="playlist";const O="search";const Us="lazySequence";const Bs="related";const Fs=[{attr:"data-video-id",query:"videoId",config:"videoId",type:C},{attr:"data-playlist-id",query:"playlistId",config:"playlistId",type:D},{attr:"data-catalog-search",query:"catalogSearch",config:"search",type:O},{attr:"data-catalog-sequence",query:"catalogSequence",config:"sequence",type:Us}];const qs=(t,i,s)=>{for(let e=0;e{const e=(s,e,t)=>{const i=e.options_;const n=Boolean(e.el().ownerDocument.querySelector(".bc-iframe"));const r=G.qs();t=t?r.parse(t):r.search;Fs.concat({query:"playlistVideoId"}).forEach(({query:e})=>{if(Array.isArray(t[e])){t[e]=t[e].pop()}});if(Fs.filter(e=>!!s[e.config]).length>1||Fs.filter(e=>!!i[e.attr]).length>1){e.error({headline:"Bad Request: Multiple catalog media queries provided. Please only provide one",type:"PLAYER_ERR_CONFLICTING_DATA",code:-3,message:"Too many catalog media parameters were provided in this player. "+"Please use only one of the following: videoId, playlistId, catalogSequence, or catalogSearch."});return}const a=n&&qs("query",t,t.playlistVideoId)||qs("attr",i,i["data-playlist-video-id"]||t.playlistVideoId)||qs("config",s,t.playlistVideoId||s.playlistVideoId);if(!a){return}if(typeof a.id==="string"&&(a.type===O||a.type===Us)){const o=a.id;try{a.id=JSON.parse(o)}catch(e){if(a.type===Us){l.log.error("sequence must be valid JSON or an object",e);return}}if(!G.isObj(a.id)&&!Array.isArray(a.id)){a.id=o}}["adConfigId","deliveryConfigId","bumper"].forEach(t=>{const i=t==="bumper"?s[t]&&s[t].id:s[t];if(!G.isNonEmptyStr(i)){return}if(G.isObj(a.id)){a.id[t]=i}else if(Array.isArray(a.id)){a.id.forEach(e=>{e[t]=i})}else{a[t]=s[t]}});return a};return e};const v={VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND:{headline:"The Video Cloud account was not found."},VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND:{headline:"The Video Cloud resource was not found."},VIDEO_CLOUD_ERR_NOT_PLAYABLE:{headline:"The Video Cloud video is not playable."},VIDEO_CLOUD_ERR_AD_CONFIG_ID_NOT_FOUND:{headline:"The Video Cloud SSAI ad config id was not found."},VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND:{headline:"The Video Cloud video was not found."},VIDEO_CLOUD_ERR_DUPLICATE_PARAMETERS:{headline:"Invalid Request: Duplicate Parameter",message:"The same parameter name was provided more than once in the request."},VIDEO_CLOUD_ERR_TOKEN_REQUIRED:{headline:"Access Denied: Missing Token",message:"Video cannot be played without a token."},VIDEO_CLOUD_ERR_TOKEN_INVALID:{headline:"Access Denied: Invalid Token",message:"Video cannot be played without a valid token."},VIDEO_CLOUD_ERR_UNKNOWN:{headline:"The Playback API request failed for an unknown reason",message:"Unknown catalog request error."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"Playback Denied: Domain Restricted",message:"Video is not playable on this domain."},PLAYER_ERR_IP_RESTRICTED:{headline:"Playback Denied: IP",message:"Your IP address does not have access to this video."},PLAYER_ERR_GEO_RESTRICTED:{headline:"Playback Denied: Location",message:"Video is unavailable from your current location."},PLAYER_ERR_OFFER_RESTRICTED:{headline:"Playback Denied: Offer Restricted",message:"Video is not playable with your entitlements."},PLAYER_ERR_TAG_RESTRICTED:{headline:"Playback Denied: Tags",message:"Video does not have tags required for playback."},PLAYER_ERR_ACCOUNT_ID:{headline:"Playback Denied: Account ID",message:"Account ID missing or invalid."},PLAYER_ERR_DEVICE_RESTRICTED:{headline:"Playback Denied: Device",message:"Device does not have access to this resource."},VIDEO_CLOUD_ERR_VIDEO_NOT_PLAYABLE:{headline:"Playback Denied: Unavailable",message:"Video is not currently available for playback."},VIDEO_CLOUD_ERR_PLAYLIST_NOT_PLAYABLE:{headline:"Playback Denied: Unavailable",message:"Playlist is not currently available for playback."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE:{code:"DENIED_BY_STREAM_LIMIT_CREATE",headline:"Stream Limiting: New Viewers",message:"Limited stream has reached the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW:{code:"DENIED_BY_STREAM_LIMIT_RENEW",headline:"Stream Limiting: Existing Viewers",message:"Limited stream is already being watched by the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING:{code:"DENIED_BY_STREAM_LIMITING",headline:"Stream Limiting: New Viewers",message:"Limited stream has reached the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING:{code:"DENIED_BY_DEVICE_LIMITING",headline:"Device Limiting: New Viewers",message:"Maximum number of streams has been reached on this device."},VIDEO_CLOUD_ERR_PLAYLIST_NOT_FOUND:{headline:"Playlist Unavailable: Not Found",message:"Playlist cannot be found."},VIDEO_CLOUD_ERR_METHOD_NOT_ALLOWED:{headline:"API: Method not allowed."},VIDEO_CLOUD_ERR_SERVER:{headline:"Server: Internal server error",message:"An internal server error prevented playback."},VIDEO_CLOUD_ERR_VIDEO_RETRIEVE_FAILURE:{headline:"Server Error: Video",message:"Video unavailable."},VIDEO_CLOUD_ERR_ACCOUNT_RETRIEVE_FAILURE:{headline:"Server Error: Account",message:"Account unavailable."},VIDEO_CLOUD_ERR_VIDEO_URLS_RETRIEVE_FAILURE:{headline:"Server Error: Video URLs",message:"Stream URLs unavailable."},VIDEO_CLOUD_ERR_PLAYLIST_RETRIEVE_FAILURE:{headline:"Server Error: Playlist",message:"Video playlist unavailable."},VIDEO_CLOUD_ERR_PLAYBACK_RIGHT_RETRIEVE_FAILURE:{headline:"Server Error: Playback Rights",message:"Entitlements unavailable."},VIDEO_CLOUD_ERR_PLAYLIST_VIDEOS_RETRIEVE_FAILURE:{headline:"Server Error: Playlist Videos",message:"Playlist videos unavailable."},VIDEO_CLOUD_ERR_LICENSE_RETRIEVE_FAILURE:{headline:"Server Error: License",message:"Stream license unavailable."},VIDEO_CLOUD_ERR_OFFERS_RETRIEVE_FAILURE:{headline:"Server Error: Offers",message:"Stream offers unavailable."},VIDEO_CLOUD_ERR_RIGHTS_RETRIEVE_FAILURE:{headline:"Server Error: Rights",message:"Stream rights unavailable."},VIDEO_CLOUD_ERR_SERVICE_UNAVAILABLE:{headline:"Server Error: Unavailable",message:"The server is currently unavailable. Please try again later."},VIDEO_CLOUD_ERR_SERVICE_TIMEOUT:{headline:"Server Error: Timeout",message:"Recevied a timeout from the server. Please try again later."},GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING:{headline:"Session Limiting: New Sessions",message:"Maximum number of sessions have been reached for this video",dismiss:false},GSC_TOKEN_REQUIRED:{headline:"Invalid Request: JWT is required",message:"Please provide a valid token",dismiss:false},GSC_INVALID_TOKEN:{headline:"Invalid Request: Invalid JWT",message:"Please provide a valid token",dismiss:false},GSC_MISSING_FIELD_ACCOUNT_ID:{headline:"Invalid Request: AccountID is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_UID:{headline:"Invalid Request: UID in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_SESSION_ID:{headline:"Invalid Request: SID in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_CLIMIT:{headline:"Invalid Request: CLIMIT in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_VIDEO_ID:{headline:"Invalid Request: videoId is required",message:"Please provide required information",dismiss:false},GSC_SESSION_STOPPED:{headline:"Stream Limiting: Session stopped",message:"Stream session no longer available",dismiss:false},GSC_SESSION_EXPIRED:{headline:"Stream Limiting: Session expired",message:"Stream session no longer available",dismiss:false},GSC_PLAYBACK_RESTRICTIONS:{headline:"Playback Restrictions: Not Met",message:"Playback restrictions requirements have not been met",dismiss:false},GSC_SESSION_NOT_FOUND:{headline:"Not found",message:"Playback session not found",dismiss:false},GSC_VIDEO_NOT_FOUND:{headline:"Not found",message:"Video cannot be found or does not exist",dismiss:false}};const Hs=(e,t)=>{const i=e.error();if(t===null&&i&&(i.headline===v.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE.headline||i.headline===v.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW.headline||i.headline===v.VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING.headline||i.headline===v.VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING.headline||i.headline===v.GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING.headline)){return i}if(t&&t.code===5&&/Denied by stream limiting \(create\)/.test(t.cause)){return v.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE}if(t&&t.code===5&&/Denied by stream limiting \(renew\)/.test(t.cause)){return v.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW}if(t&&t.code===5&&/Denied by stream limiting/.test(t.cause)){return v.VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING}if(t&&t.code===5&&/Denied by device limiting: [1-9] devices in use/.test(t.cause)){return v.VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING}return t};const $s=e=>{const t=()=>e.errors.extend(v);const i=G.isFn(e.usingPlugin)?e.usingPlugin("errors"):G.isFn(e.errors)&&G.isFn(e.errors.extend);if(!i){e.on("pluginsetup:errors",t);e.on("dispose",()=>{e.off("pluginsetup:errors",t)});return}t()};const zs={400:{AD_CONFIG_NOT_FOUND:"VIDEO_CLOUD_ERR_AD_CONFIG_ID_NOT_FOUND",DUPLICATE_PARAMETERS:"VIDEO_CLOUD_ERR_DUPLICATE_PARAMETERS"},401:{TOKEN_REQUIRED:"VIDEO_CLOUD_ERR_TOKEN_REQUIRED",TOKEN_VALIDATION:"VIDEO_CLOUD_ERR_TOKEN_INVALID"},403:{ACCESS_DENIED:{DOMAIN:"PLAYER_ERR_DOMAIN_RESTRICTED",CLIENT_IP:"PLAYER_ERR_IP_RESTRICTED",CLIENT_GEO:"PLAYER_ERR_GEO_RESTRICTED",OFFERS:"PLAYER_ERR_OFFER_RESTRICTED",TAGS:"PLAYER_ERR_TAG_RESTRICTED",ACCOUNT_ID:"PLAYER_ERR_ACCOUNT_ID",DEVICE:"PLAYER_ERR_DEVICE_RESTRICTED"},VIDEO_NOT_PLAYABLE:"VIDEO_CLOUD_ERR_VIDEO_NOT_PLAYABLE",PLAYLIST_NOT_PLAYABLE:"VIDEO_CLOUD_ERR_PLAYLIST_NOT_PLAYABLE",DENIED_BY_STREAM_LIMITING_CREATE:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE",DENIED_BY_STREAM_LIMITING_RENEW:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW",DENIED_BY_STREAM_LIMITING:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING",DENIED_BY_DEVICE_LIMITING:"VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING"},404:{ACCOUNT_NOT_FOUND:"VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND",RESOURCE_NOT_FOUND:"VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND",VIDEO_NOT_FOUND:"VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND",PLAYLIST_NOT_FOUND:"VIDEO_CLOUD_ERR_PLAYLIST_NOT_FOUND"},405:{METHOD_NOT_ALLOWED:"VIDEO_CLOUD_ERR_METHOD_NOT_ALLOWED"},500:{SERVER_ERROR:"VIDEO_CLOUD_ERR_SERVER"},502:{VIDEO_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_VIDEO_RETRIEVE_FAILURE",VIDEO_URLS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_VIDEO_URLS_RETRIEVE_FAILURE",PLAYLIST_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYLIST_RETRIEVE_FAILURE",PLAYLIST_VIDEOS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYLIST_VIDEOS_RETRIEVE_FAILURE",ACCOUNT_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_ACCOUNT_RETRIEVE_FAILURE",PLAYBACK_RIGHT_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYBACK_RIGHT_RETRIEVE_FAILURE",LICENSE_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_LICENSE_RETRIEVE_FAILURE",OFFERS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_OFFERS_RETRIEVE_FAILURE",RIGHTS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_RIGHTS_RETRIEVE_FAILURE"},503:{SERVICE_UNAVAILABLE:"VIDEO_CLOUD_ERR_SERVICE_UNAVAILABLE"},504:{SERVER_TIMEOUT:"VIDEO_CLOUD_ERR_SERVICE_TIMEOUT"}};const Gs=(e,t)=>{const i=t.shift();if(G.isNonEmptyStr(e[i])){return e[i]}if(!i||!e[i]){return"VIDEO_CLOUD_ERR_UNKNOWN"}return Gs(e[i],t)};const Ks=(e,t)=>{t=Array.isArray(t)?t[0]:t||{};return{code:Gs(zs,[e,t.error_code,t.error_subcode])}};const Ws=(i,s)=>{return(e,t)=>{if(e){e.data=t;i.catalog.error=e;i.error(Ks(e.status,t));return i.trigger("bc-catalog-error")}i.ready(()=>i.catalog.load(s(t)))}};const Ys=a=>{const o=(e,t,i)=>{if(i.embedHasPoster){e.poster=t.options_.poster}if(i.embedHasSources){e.sources=t.options_.sources}if(i.embedHasTracks){e.textTracks=t.options_.tracks}if(e.textTracks&&e.textTracks.length>0&&a.browser.IS_ANY_SAFARI){t.$(".vjs-tech").setAttribute("crossorigin","anonymous")}return e};const e=(s,n,r)=>{if(s===C){return Ws(n,e=>o(e,n,r))}return Ws(n,t=>{const e=o({},n,r);if(Array.isArray(t.videos)){const i=t.videos[0]||{};t.videos[0]=a.obj.merge(i,e,{rawItem:i})}else{t.videos=[e]}if(r.playlistVideoId&&s===D){for(let e=0;eNumber.MAX_SAFE_INTEGER||Math.pow(2,53)-2;const Qs=(e,t)=>{const i=e.cuePoints;const s=i[t];let n;for(t++;ts.time){n=i[t];break}}const r=isFinite(e.duration)?e.duration:Xs();s.startTime=s.time;if(n&&n.time{const i=t.remoteTextTracks();if(i){let e=i.length;while(e--){t.removeRemoteTextTrack(i[e])}}const s=t.textTracks();if(s){let e=s.length;while(e--){const n=s[e];if(n.kind==="metadata"&&n.cues){let e=n.cues.length;while(e--){n.removeCue(n.cues[e])}}n.mode="disabled"}}};const Zs=(e,t)=>{Js(e);if(!t.cuePoints){return}const i=e.mediaCuePointsTrack();const s=tv.VTTCue||tv.vttjs&&tv.vttjs.VTTCue||tv.TextTrackCue;for(let e=0;e0){return en(e,i,e[0]).src}}tn.windowLocationProtocol=function(){return tv.location.protocol};const sn=(e,t)=>`https://${e}.api.${t?t+".":""}brightcove.com/playback/v1/`;const nn={production:{papi:sn("edge"),epa:sn("edge-auth")},qa:{papi:sn("edge","qa"),epa:sn("edge-auth","qa")},staging:{papi:sn("edge","staging"),epa:sn("edge-auth","staging")}};const rn=e=>tv.encodeURIComponent(e);const an=e=>typeof e==="string"&&/^BCpk/.test(e);const on=i=>{const s={ad_config_id:"adConfigId",config_id:"deliveryConfigId"};const e=["ad_config_id","config_id","tveToken"];if(i.type!==C){e.push("limit");e.push("offset")}if(i.type===O){e.push("q");e.push("sort")}const n={};e.forEach(e=>{const t=s[e]||e;if(i[t]){n[e]=i[t]}});const t=G.qs().stringify(n);return t?"?"+t:""};const ln=(e,t)=>{let{env:i,type:s}=t;if(!i){i="production"}let n;if(G.isNonEmptyStr(t.baseUrl)){n=t.baseUrl}else if(an(t.policyKey)){n=nn[i].papi}else{n=nn[i].epa}if(n.slice(-1)==="/"){n=n.slice(0,-1)}let r;r=`${n}/accounts/${rn(e)}/${s===D?"playlists":"videos"}`;if(s!==O){r+="/"+rn(t.id)}if(s===Bs){r+="/related"}r+=on(t);return r};const cn=v=>{const e=function(i,s,e,n=()=>{}){const{deliveryConfigId:r,adConfigId:a,id:o,bcovAuthToken:t,policyKey:l,q:c,type:u}=e;if(!s||!u){return n(new Error("accountId and type are required"))}if(u===O&&!c){return n(new Error("q is required when performing a search"))}else if(u!==O&&!o){return n(new Error("id is required when getting a video or playlist"))}const d=ln(s,e);const h=(e,t)=>{i.trigger(G.assign({type:`catalog_${e}`,accountId:s,deliveryConfigId:r,adConfigId:a,playlistId:u===D?o:undefined,related:u===Bs?o:undefined,search:u===O?c:undefined,url:d,videoId:u===C?o:undefined},t))};const f=(e,t,i)=>h("request_error",{error:e,response:t,body:i});h("request");const p={};if(an(l)){p.Accept="application/json;pk="+l}else if(t){p.Authorization="Bearer "+t}const m=v.xhr({headers:p,json:true,url:d},(e,t,i)=>{if(e){f(e,m,i);return n(e,i)}if(m.status>=400){f(new Error("Request Failed"),m,i);return n(m,i)}h("response",{response:m});n(null,i)});const g=m.onabort.bind(m);m.onabort=()=>{const e=new Error("Request Aborted");g();f(e,m,null);return n(e,null)};return m};return e};const un="https://fps.brightcove.com/v1/application_certificate";const dn="com.apple.fps.1_0";const hn=e=>{return tv.btoa(String.fromCharCode.apply(null,e))};const fn=e=>{return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};const pn=({source:e,publisherId:t,applicationId:i})=>{const s=e.key_systems[dn].certificate_url;if(s){return s}if(i&&t){return`${un}/${t}/${i}`}return null};const mn=s=>{const e=(e,i)=>{const t=pn({source:e.source,publisherId:e.publisherId,applicationId:e.applicationId});s.xhr({uri:t,responseType:"arraybuffer"},s.xhr.httpHandler((e,t)=>{if(e){i(e);return}i(null,new Uint8Array(t))}))};return e};const gn=(e,t)=>{if(typeof t==="string"){return t.split("//")[1]}return fn(t).split("//")[1]};const vn=c=>{const e=(o,l)=>{return(e,t,i,s)=>{const n=t.split("&").filter(e=>/^renditionType/.test(e))[0]||"";const r=n.split("=")[1];const a={"Content-Type":"application/json",Accept:"application/octet-stream"};if(e.emeHeaders&&e.emeHeaders["BCOV-Auth"]){a["BCOV-Auth"]=e.emeHeaders["BCOV-Auth"]}if(r&&l){o=l[r]}c.xhr({uri:o,method:"POST",responseType:"arraybuffer",json:{publisher_id:e.publisherId,application_id:e.applicationId,key_id:t.split("/")[3],server_playback_context:hn(i)},headers:a},c.xhr.httpHandler(s,true))}};return e};var y={getCertificateUri:pn,initGetCertificate:mn,getContentId:gn,initCreateGetLicenseFunc:vn,base64EncodeUint8Array:hn,FAIRPLAY_KEY_SYSTEM:dn};const yn=(e=[])=>e.filter(e=>e.keySystems&&e.keySystems[y.FAIRPLAY_KEY_SYSTEM]);const bn=(e,t,n)=>{const i=yn(t);if(!i.length||!e.eme){n();return}const s=e.eme.options||{};let r=0;const a=[];const o={};for(let e=0;e{if(e){a.push({message:"Unable to resolve FairPlay certificate",error:e})}else{const t=o[c];for(let e=0;e{t(null,i)}}}r--;if(!r){if(a.length){n(a);return}n()}})}};const _n=(e,t)=>{const i=y.initCreateGetLicenseFunc(t);const s=y.initGetCertificate(t);if(!G.isHlsType(e.type)||!e.key_systems||!e.key_systems[y.FAIRPLAY_KEY_SYSTEM]){return null}const n=e.key_systems[y.FAIRPLAY_KEY_SYSTEM];const r=n.key_request_url;const a={};a[y.FAIRPLAY_KEY_SYSTEM]={getCertificate:s,getLicense:i(r,n.key_request_urls),getContentId:y.getContentId};return a};const Tn=t=>{const e=e=>{return _n(e,t)};return e};var Sn={initGetKeySystemOptions:Tn,getFairPlaySources:yn,resolveFairPlayCertificates:bn};const En=(e,t)=>{t=t||e&&e.mediainfo||{};return e&&e.hasPlugin&&e.hasPlugin("vr")&&t&&t.projection};const wn=50*1024*1024;const kn=3*1024*1024;const jn=.5*1024*1024;const Cn={http:{nativeHls:{http:{"application/vnd.apple.mpegurl":1,"video/mp4":5,"application/dash+xml":3},https:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":4}},noNativeHls:{http:{"application/vnd.apple.mpegurl":1,"video/mp4":5,"application/dash+xml":3},https:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":4}},preferMp4:{http:{"application/vnd.apple.mpegurl":3,"video/mp4":1,"application/dash+xml":5},https:{"application/vnd.apple.mpegurl":4,"video/mp4":2,"application/dash+xml":6}}},https:{nativeHls:{http:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":5},https:{"application/vnd.apple.mpegurl":1,"video/mp4":4,"application/dash+xml":3}},noNativeHls:{http:{"application/vnd.apple.mpegurl":5,"video/mp4":4,"application/dash+xml":6},https:{"application/vnd.apple.mpegurl":1,"video/mp4":3,"application/dash+xml":2}},preferMp4:{http:{"application/vnd.apple.mpegurl":5,"video/mp4":4,"application/dash+xml":6},https:{"application/vnd.apple.mpegurl":2,"video/mp4":1,"application/dash+xml":3}}},codecs:{switching:{hevc:{combined:1,hevc:2,avc:3},nohevc:{combined:5,hevc:6,avc:4}},noswitching:{hevc:{combined:3,hevc:5,avc:2},nohevc:{combined:4,hevc:6,avc:1}}}};const In={1:3,2:3.2,3:4.2,4:5,5:6,6:7,7:8};const xn=(e,t)=>{return t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&G.isSafariWithFairplaySupport()&&e.eme&&e.eme.options};const An=(e,t,i)=>{return t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&G.isBrowserWithWidevineSupport(i)&&e.eme&&e.eme.options};const Dn=function(e,t,i,s,n){t.priority=9999;if(!t.src){return 9999}if(t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&(t.key_systems["com.apple.fps.1_0"]&&!xn(i,t)||t.key_systems["com.widevine.alpha"]&&!An(i,t,n))){return 9999}if(t.profiles&&t.profiles.match(/hbbtv/i)){return 9999}if(n.browser.IS_IOS&&t.type==="application/vnd.apple.mpegurl"&&In[t.ext_x_version]>parseFloat(n.browser.IOS_VERSION)){return 9999}e=e[/^[^:]*/.exec(t.src)];if(!e){return 9999}if(e[t.type]){t.priority=e[t.type]}const r=t.codecs&&t.codecs.indexOf("avc1")!==-1;const a=t.codecs&&t.codecs.indexOf("hvc1")!==-1;const o=r&&a;let l;if(o){l=s.combined}else if(a){l=s.hevc}else if(r){l=s.avc}else{l=0}return t.priority+l};const P=g=>{const v=function(e,t,i,s,n){let r=P.preferHttps()?Cn.https:Cn.http;let a;if(En(e,t)){a=wn}else if(g.browser.IS_IOS||g.browser.IS_ANDROID){a=jn}else{a=kn}if(P.preferMp4(e,t)){r=r.preferMp4}else if(P.supportsNativeHls()){r=r.nativeHls}else{r=r.noNativeHls}let o=Dn(r,s,e,i,g)-Dn(r,n,e,i,g);const l=s.type==="application/vnd.apple.mpegurl"&&s.codecs&&s.ext_x_version||n.type==="application/vnd.apple.mpegurl"&&n.codecs&&n.ext_x_version;const c=s.codecs&&n.codecs?false:true;if(l&&c){o=s.priority-n.priority}delete s.priority;delete n.priority;if(o){return o}if(s.type==="video/mp4"&&n.type==="video/mp4"){if(s.avg_bitrate&&n.avg_bitrate){return Math.abs(s.avg_bitrate-a)-Math.abs(n.avg_bitrate-a)}if(s.avg_bitrate||n.avg_bitrate){o=s.avg_bitrate?-1:1}}if(s.type==="application/vnd.apple.mpegurl"&&n.type==="application/vnd.apple.mpegurl"){if(s.ext_x_version&&n.ext_x_version){return n.ext_x_version-s.ext_x_version}if(s.ext_x_version||n.ext_x_version){o=s.ext_x_version?-1:1}}return o};function e(t,e,i={}){const s=Sn.initGetKeySystemOptions(g);const n=e.sources||[];const r=[];let{bcovAuthToken:a,policyKey:o,watermarkingToken:l,allowPlayreadyInChromiumEdge:c}=i;const u=!!a&&o===null;if(a&&!G.isNonEmptyStr(a)){g.log.error("The bcovAuthToken catalog property must be a string");a=null}if(l&&!G.isNonEmptyStr(l)){g.log.error("The watermarking token catalog property must be a string");l=null}for(let e=0;e1){delete p.key_systems["com.microsoft.playready"]}else{n.splice(e,1);e--;continue}}if(a&&p.key_systems){p.emeHeaders={"BCOV-Auth":a}}if(l){p.src=p.src.replace("{WMT}",l)}if(p.src&&p.container==="MP4"){p.type="video/mp4"}else if(p.src&&(p.container==="M2TS"||G.isHlsType(p.type))){p.type="application/vnd.apple.mpegurl";if(xn(t,p)){p.keySystems=s(p)}if(G.isEncryptedHls(p,g)&&a){if(p.vmap&&t.hasPlugin("ssai")){p.bcovAuthToken=a}else{const m=g.url.parseUrl(p.src);let e="bcov_auth="+a;if(!m.search){e="?"+e}else if(!(m.search[m.search.length-1]==="&")){e="&"+e}p.src+=e}}}r.push(p)}const d=P.supportsSwitchingCodecs(t)?"switching":"noswitching";const h=P.supportsHEVC()?"hevc":"nohevc";const f=Cn.codecs[d][h];return r.sort(v.bind(null,t,e,f))}P.supportsNativeHls=function(){return G.isNativeHlsSupported(g)};P.preferHttps=function(){return G.preferHttps(tv)};P.supportsHEVC=function(){return G.isHevcSupported()};P.supportsSwitchingCodecs=function(e){return G.isCodecSwitchingSupported(e)};P.preferMp4=function(e,t){return g.browser.IS_ANDROID&&g.browser.ANDROID_VERSION<5||En(e,t)};return e};class On{constructor(){this.defaults_={}}normalize(e,t,i){const s=G.assign({},this.defaults_);if(e&&!G.isObj(e)){s.id=e}else{G.assign(s,e);if(G.isObj(e.id)){G.assign(s,e.id);if(!e.id.hasOwnProperty("id")){delete s.id}}}if(typeof t==="string"){s.type=t}if(s.type===O){if(!s.q){s.q=s.id}delete s.id}if(typeof e.deliveryConfigId==="string"){s.deliveryConfigId=e.deliveryConfigId}if(typeof i==="string"){s.adConfigId=i}if((s.type===D||s.type===O)&&s.limit===undefined){s.limit="100"}return s}setDefaults(e){if(e===null){this.defaults_={}}else{G.assign(this.defaults_,e)}}getDefault(e){return G.isObj(this.defaults_)&&this.defaults_[e]||undefined}getDefaults(){return G.isObj(this.defaults_)&&G.assign({},this.defaults_)||{}}}function Pn(d){const e=d.options_.runtime_.settings;const h=e.videoCloud&&e.videoCloud.bumper;let f=false;let p;return{setSource(e,t){const s=d.usingPlugin("playlist")&&d.playlist().length>0;const n=s&&d.playlist.currentItem()>-1?d.playlist()[d.playlist.currentItem()]:d.mediainfo;const i=d.bcPlaylistUi&&d.bcPlaylistUi().options.autoadvance;const r=n.id;const a=n.manifestExpiresAt;d.catalog.isCurrentSourceBumper_=h&&(h.id===n.id||h.id===`ref:${n.referenceId}`);const o=()=>{const e=d.paused();d.catalog.get({id:r,type:"video"}).then(i=>{d.catalog.load(i);if(s){n.manifestExpiresAt=i.manifestExpiresAt;n.sources.forEach((e,t)=>{e.src=i.sources[t].src})}d.one("canplay",()=>{if(!e){d.play()}})}).catch(e=>{d.log.warn(e)})};if(Date.now()>a){o();return}d.one("play",()=>{if(Date.now()>a){o();return}});const l=()=>{d.one("play",()=>d.trigger("bumper-play"));d.one("ended",()=>{d.trigger("bumper-ended");f=true})};const c=()=>{d.one("bumper-ended",()=>{d.bigPlayButton.hide();d.posterImage.hide();if(p){p.poster="";d.catalog.load(p);if(i){d.playlist.autoadvance(i)}}})};if(h){if(d.catalog.isCurrentSourceBumper_);else{p=s?n:p||d.mediainfo}if(!f&&!d.catalog.isCurrentSourceBumper_){const u=s&&d.playlist.currentItem()>0?true:false;d.catalog.get({id:h.id,type:"video"}).then(e=>{e.economics="FREE";e.poster=p.poster;d.catalog.bumper_=w(h,{video:e});d.catalog.load(e)});if(u){d.one("loadedmetadata",()=>{d.play()})}}else if(!f&&d.catalog.isCurrentSourceBumper_){l();c()}else if(f&&!d.catalog.isCurrentSourceBumper_){d.one("loadedmetadata",()=>{d.play();if(s){f=false}})}}t(null,e)}}}const Ln={production:"https://edge-gsc.api.brightcove.com",staging:"https://edge-gsc.api.staging.brightcove.com",qa:"https://edge-gsc.api.qa.brightcove.com"};const Rn={maxRetry:3,intervalRetry:6e4,interval:null};const b={MAX_CONCURRENCY:"MAX_CONCURRENCY",TOKEN_REQUIRED:"TOKEN_REQUIRED",INVALID_TOKEN:"INVALID_TOKEN",ACCOUNT_ID:"ACCOUNT_ID",UID:"UID",SESSION_ID:"SESSION_ID",CLIMIT:"CLIMIT",VIDEO_ID:"VIDEO_ID",SESSION_STOPPED:"SESSION_STOPPED",SESSION_EXPIRED:"SESSION_EXPIRED",PLAYBACK_RESTRICTIONS:"PLAYBACK_RESTRICTIONS",TOKEN_VALIDATION:"TOKEN_VALIDATION",SESSION_NOT_FOUND:"SESSION_NOT_FOUND",VIDEO_NOT_FOUND:"VIDEO_NOT_FOUND"};const Nn=(e,t)=>{if(!t){t="production"}return`${Ln[t]}/api/v1/accounts/${e}/sessions`};const Mn=(e,t)=>{const{statusCode:i,body:s}=e;let n=null;if(i<400||i>499){return n}const{error:r}=s;const a=r.sub_code||r.code;switch(a){case b.MAX_CONCURRENCY:n={code:"GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING"};t.log.error("GSC heartbeat max concurrency limit.",e);break;case b.TOKEN_REQUIRED:n={code:"GSC_TOKEN_REQUIRED"};t.log.error("GSC JWT is required.",e);break;case b.INVALID_TOKEN:n={code:"GSC_INVALID_TOKEN"};t.log.error("GSC JWT is required.",e);break;case b.ACCOUNT_ID:n={code:"GSC_MISSING_FIELD_ACCOUNT_ID"};t.log.error("GSC AccountID is required.",e);break;case b.UID:n={code:"GSC_MISSING_FIELD_UID"};t.log.error("GSC UID is required in JWT.",e);break;case b.SESSION_ID:n={code:"GSC_MISSING_FIELD_SESSION_ID"};t.log.error("GSC SID is required in JWT.",e);break;case b.CLIMIT:n={code:"GSC_MISSING_FIELD_CLIMIT"};t.log.error("GSC CLIMIT is required in JWT.",e);break;case b.VIDEO_ID:n={code:"GSC_MISSING_FIELD_VIDEO_ID"};t.log.error("GSC videoId is required.",e);break;case b.SESSION_STOPPED:n={code:"GSC_SESSION_STOPPED"};t.log.error("GSC session stopped.",e);break;case b.SESSION_EXPIRED:n={code:"GSC_SESSION_EXPIRED"};t.log.error("GSC session expired.",e);break;case b.PLAYBACK_RESTRICTIONS:n={code:"GSC_PLAYBACK_RESTRICTIONS"};t.log.error("GSC playback restrictions not met.",e);break;case b.SESSION_NOT_FOUND:n={code:"GSC_SESSION_NOT_FOUND"};t.log.error("GSC session not found.",e);break;case b.VIDEO_NOT_FOUND:n={code:"GSC_VIDEO_NOT_FOUND"};t.log.error("GSC video not found",e);break}return n};const Un=c=>{class e{constructor(e,t={}){this.player=e;this.timerId=null;this.interval=null;this.sid=null;this.retryCount=0;this.options=c.obj.merge(Rn,t);this.shouldReInit=true;this.player.on("ended",()=>this.stop());this.player.on("dispose",()=>this.stop(null,true));this.player.on("play",()=>{if(this.shouldReInit){return this.init()}})}init(){this.onTimerTick()}onTimerTick(){this.send(e=>{const{statusCode:t,body:i}=e;if(t>=500){this.player.log.error("GSC Heartbeat failed to contact server");this.retry();return}if(t===204){this.player.log.warn("Stream Concurrency feature has not been enabled for this account");return}const s=Mn(e,c);if(s){return this.terminatePlayback(s)}this.interval=i.heartbeat_interval;if(!this.timerId){this.timerId=this.player.setInterval(()=>this.onTimerTick(),this.interval);this.retryCount=0}this.shouldReInit=false;this.sid=i.sid})}terminatePlayback(e){this.clear();this.player.one("playerreset",()=>this.player.error(e));this.player.reset()}retry(){const{maxRetry:e,intervalRetry:t}=this.options;if(this.retryCount>=e){this.terminatePlayback({code:"GSC_SESSION_STOPPED"});return}this.clear();this.retryCount++;this.player.setTimeout(()=>this.onTimerTick(),t)}send(i){const{catalog:e}=this.player;const t=e.getCatalogParamDefault_("accountId");const s=e.getCatalogParamDefault_("bcovAuthToken");const n=e.getCatalogParamDefault_("env");const r={Authorization:"Bearer "+s};const a={url:Nn(t,n),method:"POST",json:true,headers:r,body:{video:this.player.mediainfo?this.player.mediainfo.id||"":""}};c.xhr(a,(e,t)=>{if(e){c.log.error("GSC Heartbeat failed to perform request.",e);this.retry();return}i(t)})}clear(){if(!this.timerId){return}this.player.clearInterval(this.timerId);this.timerId=null;this.interval=null;this.sid=null}stop(n=false,r=false){this.isCasting=n;c.log.debug("GSC: about to stop and clear heartbeat");const{catalog:e}=this.player;const t=e.getCatalogParamDefault_("accountId");const i=e.getCatalogParamDefault_("bcovAuthToken");const s=e.getCatalogParamDefault_("env");const a=Nn(t,s);const o={Authorization:"Bearer "+i};const l={url:a,method:"DELETE",json:true,headers:o};this.clear();c.xhr(l,(e,t,i)=>{if(e){c.log.error("GSC failed request for stop session.",e)}if(r){return}const s=Mn(t,c);if(s){this.player.error(s)}if(!n){this.player.one("play",()=>this.init())}})}destroy(){this.player.off("ended",()=>this.stop());this.player.off("dispose",()=>this.stop(null,true));this.player.off("play",()=>{if(this.shouldReInit){return this.init()}});this.stop(null,true)}getSessionId(){return this.sid||""}setOptions(e){this.retryCount=0;this.options=c.obj.merge(Rn,e)}}return e};const Bn=/([A-Za-z0-9])_([A-Za-z0-9])/g;const Fn=e=>e.replace(Bn,(e,t,i)=>t+i.toUpperCase());const qn=(e,t)=>{return(e.type==="application/vnd.apple.mpegurl"||e.type==="application/dash+xml")&&t.toLowerCase()==="html5"};const Vn=(e,t)=>{if(!t){return e}let i=e;if(t.preferMp4){i=e.filter(e=>e.container&&e.container.toLowerCase()==="mp4");if(Array.isArray(t.preferMp4)){const[n,r]=t.preferMp4;i=i.sort((e,t)=>{const i=e.hasOwnProperty(n)?e[n]:null;const s=t.hasOwnProperty(n)?t[n]:null;if(i===null||s===null||!G.isNum(i)||!G.isNum(s)){return 0}if(G.isNonEmptyStr(r)&&r.toLowerCase()==="asc"){return i-s}return s-i})}}return i};const Hn=y=>{const b=Vs(y);const _=Ys(y);const T=P(y);const S=cn(y);const E=Un(y);const w=e=>{const t=y.obj.merge(e);Object.keys(t).filter(e=>e.match(Bn)).forEach(e=>{t[Fn(e)]=t[e]});return t};const k=(e,t)=>{if(!t){return}e.mediainfo=w(t);const i=Boolean(e.el().ownerDocument.querySelector(".bc-iframe"));const s=e.mediainfo.name;if(i&&s){iv.title=s}};const j=(e,t)=>{if(!t){return}e.playlistinfo=w(t);delete e.playlistinfo.videos};function e(r){const c=this;const s=e=>{if(e&&e.accountId){c.trigger({type:"usage",name:"catalog-get-account-id"});return e.accountId}if(typeof c.getAccountId==="function"){return c.getAccountId()}return r.accountId||c.options_["data-account"]};const u=new On;let n={};let a;const i={policyKey:c.options_["data-policy-key"],bcovAuthToken:c.options_["data-bcov-auth-token"],watermarkingToken:c.options_["data-watermarking-token"]};const t=Object.keys(i).reduce((e,t)=>{if(i[t]){e[t]=i[t]}return e},{});["adConfigId","allowPlayreadyInChromiumEdge","baseUrl","bcovAuthToken","deliveryConfigId","env","policyKey","sourceSelectionRules","watermarkingToken","tveToken"].forEach(e=>{if(r.hasOwnProperty(e)){t[e]=r[e]}});let o=null;if(r.streamConcurrency){o=new E(c,r)}u.setDefaults(t);y.hook("beforeerror",Hs);$s(c);c.on("loadstart",()=>{if(!c.usingPlugin("playlist")||!c.playlist()||!c.playlist().length){return}k(c,c.playlist()[c.playlist.indexOf(c.currentSrc())])});c.on("dispose",()=>Js(c));const l=(e,t)=>{const i=Sn.getFairPlaySources(e);if(!i.length){t();return}Sn.resolveFairPlayCertificates(c,i,e=>{if(e){y.log("Unable to resolve FairPlay certificates",e)}t()})};const d=e=>{if(!c.hasPlugin||!c.hasPlugin("ssai")||!e){return e}return e.map(function(e){if(e.vmap){e.type=y.getPlugin("ssai").MIME_TYPE;e.originalHlsSource=e.src;e.src=e.vmap}return e})};const h=e=>{if(!e.variants){return e}const{name:t,description:i,longDescription:s,customFields:n}=e;const r=null;const a={name:t,description:i,longDescription:s,language:r};a.customFields=y.obj.merge(n);const o=e.variants.map(w);e.variants=[...o,a];return e};const f=e=>{if(!e){return}if(Array.isArray(e)){a=e.map(e=>h(w(e)))}else{a=h(w(e))}};const p=(e,t)=>{if(!e||!e.variants){return y.obj.merge(e)}let i=null;let s=null;if(typeof t==="string"){i=t.toLowerCase();s=i.split("-")[0]}const n=()=>e.variants.find(e=>typeof e.language==="string"&&e.language.toLowerCase()===i);const r=()=>e.variants.find(e=>typeof e.language==="string"&&e.language.toLowerCase()===s);const a=()=>e.variants.find(e=>e.language===null);const o=n()||r()||a();return y.obj.merge(e,o)};const m=a=>{const e=()=>{let t=false;k(c,a);f(a);if(En(c)){const e=c.el().querySelector("video");e.setAttribute("crossorigin","anonymous")}c.el().setAttribute("data-video-id",a.id);if(tv.bc&&!tv.bc.disposedAfterPreroll_){c.poster(a.poster)}if(a.sources){for(let e=0;e0&&y.browser.IS_ANY_SAFARI||y.browser.IS_IOS){c.crossOrigin("anonymous")}}};l(a.sources,e)};const g=i=>{if(!c.usingPlugin("playlist")){c.log.warn("A playlist was loaded from the Playback API, but this player is not using the playlist plugin. The first video in the playlist will be loaded instead!");m(i[0]);return}const e=()=>{c.on("beforeplaylistitem",(e,t)=>Zs(c,t));c.on("playlistchange",()=>f(c.playlist()));for(let e=0;e0){i[e].textTracks=t.filter(e=>e.label!=="thumbnails")}}const e=i.startingIndex||0;f(i);k(c,i[e]);j(c,c.catalog.data);if(En(c)){const e=c.el().querySelector("video");e.setAttribute("crossorigin","anonymous")}c.playlist(i,e)};const t=i.filter(e=>e.sources).reduce((e,t)=>e.concat(t.sources),[]);l(t,e)};const v=(e,t={})=>{let i;const s=w(e);if(s.sources){s.rawSources_=s.sources;s.sources=(r.getSources||T)(c,s,t);if(t.sourceSelectionRules){s.sources=Vn(s.sources,t.sourceSelectionRules)}i=c.selectSource(s.sources)}if(s.posterSources){s.poster=tn(s.posterSources)}if(s.thumbnailSources){s.thumbnail=tn(s.thumbnailSources)}if(s.textTracks){const n=i&&qn(i.source,i.tech);s.textTracks=s.textTracks.filter(e=>{return!(n&&e.in_band_metadata_track_dispatch_type!==undefined)}).map(e=>{if(e.sources){e.src=tn(e.sources)}return e})}if(s.duration){s.duration=s.duration*.001}if(s.cuePoints){for(let e=0;e{e=S(c,s(a),a,(e,t)=>{c.catalog.loading--;if(a.type===O&&t&&(!t.videos||!t.videos.length)){e=new Error("No videos returned from search")}if(e){e.data=t;c.catalog.error=e;return r(e)}if(!t){return n(null)}c.catalog.data=y.obj.merge({},t);if(a.adConfigId){c.catalog.data.adConfigId=a.adConfigId}const i=["allowPlayreadyInChromiumEdge","bcovAuthToken","policyKey","sourceSelectionRules"].reduce((e,t)=>{if(a.hasOwnProperty(t)){e[t]=a[t]}return e},{});if(a.watermarkingToken){i.watermarkingToken=a.watermarkingToken}if(a.tveToken){i.tveToken=a.tveToken}if(a.type===C){c.catalog.sources=t.sources;c.catalog.poster=t.poster;return n(v(t,i))}const s=t.videos.filter(e=>!e.hasOwnProperty("errors")).map(e=>v(e,i));if(s.length){return n(s)}return r(new Error("No videos returned from playlist"))})});if(!G.isFn(t)){return i}i.then(e=>{t(null,e)}).catch(e=>{t(e,e.data)});return e},getVideo(e,t=()=>{},i){return this.get(u.normalize(e,C,i),t)},getSequence(r,a=()=>{},e){if(!Array.isArray(r)){r=[r]}if(!c.usingPlugin("playlist")){throw new Error("getSequence requires the playlist plugin")}r=r.filter(e=>{if(!/^(search|video|playlist)$/i.test(e.type)){y.log.error("invalid sequence type, please use search, video, or playlist. for:",e);return false}return true});if(!r.length){a(new Error("No valid sequences"),null);return}let o=r.length;const l=new Array(r.length);return r.map((s,n)=>{return this.get(u.normalize(s,s.type,e),(e,t)=>{o--;if(e){y.log.error("failed to request sequence",s);y.log.error("with error",e)}else if(t){if(!Array.isArray(t)){t=[t]}l[n]=t}if(o===0){c.catalog.data=l;const i=l.reduce((e,t)=>t&&e.concat(t),[]);if(!i.length){a(new Error("No data was loaded for the sequence "+JSON.stringify(r),null))}else{a(null,i)}}},e)})},getLazySequence(s,e=()=>{},t){if(!Array.isArray(s)){s=[s]}if(!c.usingPlugin("playlist")){throw new Error("getLazySequence requires the playlist plugin")}const n=i=>{return this.getSequence(s.shift(),(e,t)=>{if((e||!t)&&s&&s.length){return n(i)}i(e,t)},t)};const r=()=>{if(!s.length){c.off("playlistitem",r);return}const e=c.playlist;const i=e.currentIndex&&e.currentIndex()||e.currentItem&&e.currentItem()||0;const t=e.lastIndex&&e.lastIndex()||e().length-1||0;if(i!==t){return}n((e,t)=>{if(e||!t){return}c.playlist(c.playlist().concat(t),i)})};c.on("playlistitem",r);return n(e)},getSearch(e,t=()=>{},i){return this.get(u.normalize(e,O,i),t)},getPlaylist(e,t=()=>{},i){return this.get(u.normalize(e,D,i),t)},load(e){if(Array.isArray(e)){g(e)}else{m(e)}},autoFindAndLoadMedia(e){const t=b(e,c);if(!t){return}e.playlistVideoId=t.playlistVideoId;const i=_(t.type,c,e);if(t.type===Us){this.getLazySequence(t.id,i)}else{this.get(u.normalize(t),i)}return t},setBcovAuthToken(e){if(e!==null&&!G.isNonEmptyStr(e)){y.log.warn("Authorization Token must be a valid string or null");return}u.setDefaults({bcovAuthToken:e})},setPolicyKey(e){if(e!==null&&!G.isNonEmptyStr(e)){y.log.warn("Policy key must be a valid string or null");return}u.setDefaults({policyKey:e})},setAdConfigId(e){if(e!==null&&!G.isNonEmptyStr(e)){y.log.warn("Ad Config ID must be a valid string or null");return}u.setDefaults({adConfigId:e})},setDeliveryConfigId(e){if(e!==null&&!G.isNonEmptyStr(e)){y.log.warn("Ad Config ID must be a valid string or null");return}u.setDefaults({deliveryConfigId:e})},setBaseUrl(e){if(e!==null&&!G.isNonEmptyStr(e)){y.log.warn("Catalog API base URL must be a valid string or null");return}u.setDefaults({baseUrl:e})},setWatermarkingToken(e){if(e!==null&&!G.isNonEmptyStr(e)){y.log.warn("Watermarking token must be a valid string or null");return}u.setDefaults({watermarkingToken:e})},setTVEToken(e){if(e!==null&&!G.isNonEmptyStr(e)){y.log.warn("TVE token must be a valid string or null");return}u.setDefaults({tveToken:e})},updateGSC(e){if(e.streamConcurrency){if(o){o.setOptions(e)}else{o=new E(c,e);if(c.currentTime()>0){o.init()}}}else if(o){o.destroy();o=null}},getWatermarkingToken(){return u.getDefault("watermarkingToken")},getTVEToken(){return u.getDefault("tveToken")},getCatalogParamDefault_(e){if(e==="accountId"){return s()}return u.getDefault(e)},getLastParams(){return y.obj.merge(n)},getLastData(){return y.obj.merge(c.catalog.data)},getMetadata(e){const{type:t,lang:i}=e?e:{};if(!a){y.log.debug("getMetadata() called with no cached metadata");return t===D?[]:{}}const s=c.usingPlugin("playlist")?c.playlist():[];if(t===D&&s.length){return a.map(e=>p(e,i))}if(s.length&&Array.isArray(a)){const n=c.playlist.indexOf(c.currentSrc());if(n===-1){return{}}return p(a[n],i)}return p(a,i)},getHeartbeat(){return o},bumper(){return this.bumper_||null},isCurrentSourceBumper(){return this.isCurrentSourceBumper_},loading:0}}if(!y.getPlugin("catalog")){y.use("*",Pn);y.registerPlugin("catalog",e);e.VERSION=I}};const $n={activeCues:null,cues:null,id:"",inBandMetadataTrackDispatchType:undefined,kind:"metadata",label:"",language:"",mode:"",oncuechange:undefined};const zn=["activeCues","cues","id","inBandMetadataTrackDispatchType","kind","label","language"];const Gn=["mode"];const Kn=function(e,t){if(e==="media"&&t.kind==="metadata"&&t.label==="media-cues"){return true}if(e==="id3"&&typeof t.inBandMetadataTrackDispatchType==="string"&&t.inBandMetadataTrackDispatchType.trim().length>0){return true}return false};const Wn=e=>{class t extends e.EventTarget{constructor(e,t,i=()=>{}){super();const s=this;s.player_=e;s.reTriggerEvent_=s.reTriggerEvent_.bind(s);s.update_=s.update_.bind(s);s.type_=t;s.logger_=i;zn.concat(Gn).forEach(t=>{const e={get:()=>s.track_&&s.track_[t]||$n[t],enumerable:true};if(Gn.indexOf(t)!==-1){e.set=function(e){if(!s.track_){return}s.track_[t]=e}}Object.defineProperty(s,t,e)});s.update_();const n=e.textTracks();const r=e=>{if(!s.track_){s.update_(e)}else if(s.track_.mode!=="hidden"){s.track_.mode="hidden";s.logger_(`timeupdate -> type:${s.type_}${s.track_?`,mode:${s.track_.mode}`:""} -> track was set to hidden`)}};["addtrack","removetrack"].forEach(e=>n.addEventListener(e,s.update_));s.player_.on("timeupdate",r);return s}addCue(){const e=arguments;if(!this.track_){this.one("trackexists",()=>this.addCue.apply(this,e));return}return this.track_.addCue.apply(this.track_,e)}removeCue(){const e=arguments;if(!this.track_){return this.one("trackexists",()=>this.removeCue.apply(this,e))}return this.track_.removeCue.apply(this.track_,e)}reTriggerEvent_(e){this.trigger(e)}update_(t={}){let i;if(t.type==="removetrack"&&t.track&&t.track===this.track_){i=null}else if(t.type==="addtrack"&&t.track&&!this.track_&&Kn(this.type_,t.track)){i=t.track}else{const s=this.player_.textTracks();let e=s.length;while(e--){if(Kn(this.type_,s[e])){i=s[e];break}}}const e=(...e)=>{if(t.type==="timeupdate"){return}this.logger_(...e)};e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> event:${t.type||"constructor"}`);if(this.track_===i){e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> ${i?"already proxied":"no track to proxy"}`);return}if(this.track_){this.track_.removeEventListener("cuechange",this.reTriggerEvent_)}this.track_=i;if(!this.track_){e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> track changed, but no new track exists`);return}if(this.track_.mode!=="hidden"){this.track_.mode="hidden"}this.track_.addEventListener("cuechange",this.reTriggerEvent_);this.trigger("trackexists");e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> track exists`)}}t.prototype.allowedEvents_={cuechange:"cuechange"};return t};const Yn=e=>{const i=Wn(e);const n={id3CuePointsTrack(e){let t=this.proxyTracks_.id3;if(!t){t=this.proxyTracks_.id3=new i(this,"id3",e)}return t},mediaCuePointsTrack(e){let t=this.proxyTracks_.media;if(t){return t}t=this.proxyTracks_.media=new i(this,"media",e);if(t.track_){return t}this.addTextTrack("metadata","media-cues");t.update_();return t}};function t(t={}){this.proxyTracks_={};let s=e.createLogger("proxyTracks");if(!t.debug){s=()=>{}}s("initialized");Object.keys(n).forEach(e=>{this[e]=()=>n[e].call(this,s)});this.ready(()=>{Object.keys(n).forEach(e=>{const i=this[e]();if(t.debug){i.on("cuechange",()=>{for(let e=0;e cuechange -> activeCues[${e}]: ${t.value&&t.value.key||t.frame&&t.frame.id}`)}})}})})}e.registerPlugin("proxyTracks",t);t.VERSION=I};const Xn=function(e,t){const i=e.encryptedWatcher().encryptedSeen();if(!t||!i||t.code!==-2||e.currentTime()>.1){return t}let s;const n=e.currentSource();if(!e.hasPlugin("eme")){s="DRM/EME plugin is not included!"}else if(e.hasPlugin("eme")&&!e.usingPlugin("eme")){s="DRM/EME plugin is included but not initialized!"}else if(!n.keySystems||!Object.keys(n.keySystems).length){s="DRM (keySystems) was not provided!"}if(s){return{code:5,message:`DRM configuration issue prevented playback: ${s}`}}return t};const Qn=e=>{const t=e.getPlugin("plugin");class i extends t{constructor(e,t){super(e,t);this.player_=e;this.reset();this.handleEncrypted_=this.handleEncrypted_.bind(this);this.reset=this.reset.bind(this);this.player_.ready(()=>{this.player_.tech_.on("encrypted",this.handleEncrypted_);this.player_.tech_.on("webkitneedkey",this.handleEncrypted_);this.player_.tech_.on("msneedkey",this.handleEncrypted_);this.player_.tech_.on("loadstart",this.reset)},true)}handleEncrypted_(){this.encryptedSeen_=true}encryptedSeen(){return this.encryptedSeen_}reset(){this.encryptedSeen_=false}dispose(){this.reset();this.player_.tech_.off("encrypted",this.handleEncrypted_);this.player_.tech_.off("webkitneedkey",this.handleEncrypted_);this.player_.tech_.off("msneedkey",this.handleEncrypted_);this.player_.tech_.off("loadstart",this.reset)}}const s=e.hooks("beforeerror");if(s.indexOf(Xn)===-1){e.hook("beforeerror",Xn)}e.registerPlugin("encryptedWatcher",i)};const Jn={verbose:false,maxSavedSeekEvents:10,debounceTimeout:1e3,playbackRateTolerance:1.5,stableTimeUpdateCount:3,minInterval:1};const Zn=function(e){if(e.isDisposed_){return}e.trigger("seek")};const er=function(_){const e=function(e){const t=_.obj.merge(Jn,e);let i;let s=false;let n;let r;let a;let o;let l=0;const c=[];let u=0;const d={};const h={};const f=t.verbose?(...e)=>_.log.call(_,"seek-events:",...e):()=>{};const p=function(){d.seek=this.seekEvents.last().seekEnd;s=false;f("event seekStart: ",this.seekEvents.last().seekStart);f("event seekEnd: ",this.seekEvents.last().seekEnd)};const m=function(){f("stable");this.seekEvents.stable=true};const g=function(){f("unstable");this.seekEvents.stable=false};const v=function(e){d.seek=this.currentTime();d.clock=e.timeStamp||Date.now();h.seek=d.seek;h.clock=d.clock};const y=G.debounce(Zn,t.debounceTimeout);const b=function(e){n=this.currentTime();r=e.timeStamp||+new Date;a=n-h.seek;if(r===h.clock||n===d.seek){return}o=Math.abs(a)/(Math.abs(r-h.clock)*.001);if(o/this.playbackRate()>this.seekEvents.playbackRateTolerance){if(Math.abs(n-d.seek)>=this.seekEvents.minInterval){this.trigger("unstable");l=0;if(!s){u=Number(d.seek)}c.push({timeStamp:r,seekStart:u,seekEnd:n,seekInterval:n-u});if(c.length>t.maxSavedSeekEvents){c.shift()}s=true;y(this)}}else{l++;if(l>=this.seekEvents.stableTimeUpdateCount&&!this.seekEvents.stable&&!s){this.trigger("stable")}d.seek=n}h.seek=n;h.clock=r};this.seekEvents={stableTimeUpdateCount:t.stableTimeUpdateCount,playbackRateTolerance:t.playbackRateTolerance,debounceTimeout:t.debounceTimeout,minInterval:t.minInterval,stable:false,enabled(){return i},enable:function(){if(i){return}i=true;d.seek=0;d.clock=Date.now();h.seek=0;h.clock=d.clock;this.on("seek",p);this.on("stable",m);this.on("unstable",g);this.on(["loadstart","playing","adplaying"],v);this.on(["timeupdate","adtimeupdate"],b)}.bind(this),disable:function(){if(!i){return}i=false;this.off("seek",p);this.off("stable",m);this.off("unstable",g);this.off(["loadstart","playing","adplaying"],v);this.off(["timeupdate","adtimeupdate"],b)}.bind(this),last(){return c[c.length-1]},all(){return c}};this.seekEvents.enable()};e.VERSION=I;_.registerPlugin("seekEvents",e)};const tr=function(e){e.registerPlugin("touchActive",function(){if(!e.browser.TOUCH_ENABLED){return}const t=this;let i=false;const s=function(){if(!i){t.userActive(false)}};t.one("play",function(){const e=t.options_.inactivityTimeout>0?t.options_.inactivityTimeout:5e3;t.el().className+=" vjs-user-active";t.one(["click","tap"],function(){i=true});t.setTimeout(s,e)})})};const ir={"com.widevine.alpha":"Widevine","com.microsoft.playready":"PlayReady","com.apple.fps":"FairPlay"};const sr={'video/ogg; codecs="theora"':"Ogg",'video/mp4; codecs="avc1.42E01E"':"H.264",'video/mp4; codecs="hvc1"':"HEVC",'video/webm; codecs="vp8, vorbis"':"WebM",'video/webm; codecs="vp9"':"VP9",'application/x-mpegURL; codecs="avc1.42E01E"':"HLS","application/dash+xml":"DASH",'video/mp4; codecs="mp4a.40.2"':"AAC",'video/mp4; codecs="mp4a.6B"':"MP3",'video/mp4; codecs="ac-3"':"Dolby Digital/AC-3",'video/mp4; codecs="mp4a.a6"':"Dolby Digital Plus/EC-3/E-AC-3"};let nr=iv.createElement("video");const rr={eme:Object.keys(ir).reduce((e,t)=>{e[t]={name:ir[t],persistentState:false,support:false};return e},{support:Boolean(tv.navigator.requestMediaKeySystemAccess||tv.MSMediaKeys&&tv.MSMediaKeys.isTypeSupported||tv.WebKitMediaKeys&&tv.WebKitMediaKeys.isTypeSupported)}),formats:Object.keys(sr).reduce((e,t)=>{const i=sr[t];let s=nr.canPlayType(t);if(s){s=s.charAt(0).toUpperCase()+s.slice(1)}else{s="Not supported"}e[i]=s;return e},{}),mse:"MediaSource"in tv};nr=null;if(!tv.navigator.requestMediaKeySystemAccess){const Bl=tv.MSMediaKeys&&tv.MSMediaKeys.isTypeSupported||tv.WebKitMediaKeys&&tv.WebKitMediaKeys.isTypeSupported||(()=>false);tv.navigator.requestMediaKeySystemAccess=function(i,t){let s;let n;tv.setTimeout(()=>{const e=t.some(e=>{let t=[];if(e.audioCapabilities){t=t.concat(e.audioCapabilities)}if(e.videoCapabilities){t=t.concat(e.videoCapabilities)}return t.some(e=>{return!Bl(i,e.contentType)})});if(e){n()}else{s()}});return{then(e){s=e;return this},catch(e){n=e;return this}}}}const ar={"com.widevine.alpha":{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"',robustness:"SW_SECURE_CRYPTO"}]},"com.microsoft.playready":{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]},"com.apple.fps":{initDataTypes:["sinf"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}};const or=(s,n={})=>{Object.keys(ar).forEach(t=>{const e=JSON.parse(JSON.stringify(ar[t]));if(n.persistentState){e.persistentState=n.persistentState}const i=e=>{rr.eme[t][s]=false};try{tv.navigator.requestMediaKeySystemAccess(t,[e]).then(()=>{rr.eme[t][s]=true}).catch(i)}catch(e){i()}})};or("support");or("persistentState",{persistentState:"required"});function lr(e){return e.obj.merge(rr)}const{get:_}=G;const T="unknown";const cr=c=>{const e=c.getComponent("ModalDialog");const{dom:u}=c;const s={adonly:"Ad-Only",ampSupport:"AMP Support",bcAa:"Adobe Analytics",bcGa:"Google Analytics",bcGtm:"Google Tag Manager",bcPlaylistUi:"Brightcove Playlist UI",bcTealium:"Tealium",chromecastReceiver:"Chromecast Receiver",customEndscreen:"Custom Endscreen",dash:"DASH",dvrux:"Live DVRUX",FreeWheelPlugin:"FreeWheel",ima3:"IMA3",kollective:"Kollective",onceux:"OnceUX",pip:"Picture-in-Picture",qualityMenu:"Quality Menu",social:"Social",ssai:"SSAI",thumbnails:"Thumbnails",vr:"VR"};const a=(e,t="vjs-two")=>{return u.createEl("table",{className:t},{},u.createEl("tbody",{},{},e))};const o=(...e)=>{const t=e.map(e=>u.createEl("td",{},{},String(e)));return u.createEl("tr",{},{},t)};class t extends e{buildCSSClass(){return`vjs-player-info-modal ${super.buildCSSClass()}`}dataForPlugins_(){return Object.keys(s).filter(c.getPlugin).sort().map(e=>{const t=this.player();let i=c.getPluginVersion(e)||_(t,`${e}.VERSION`,T);if(e==="eme"&&i===T&&c.drm&&c.drm.VERSION){i=c.drm.VERSION}return{active:t.usingPlugin(e),displayName:s[e],version:i}})}dataForSource_(){const e=this.player();const t=e.currentSource()||{};const i=e.tech(true);return{keySystem:i?i.el().keySystem:null,mediainfo:e.mediainfo,tech:e.techName_,type:t.type,url:t.src}}dataForVhs_(){const e=this.player();const t=e.tech(true);const i=t?t.vhs:null;if(!i){return null}const s={bandwidth:_(i,"stats.bandwidth",T),mediaBytesTransferred:_(i,"stats.mediaBytesTransferred",T),mediaTransferDuration:_(i,"stats.mediaTransferDuration",T),mediaRequests:_(i,"stats.mediaRequests",T),versions:i.version()};const n=_(i,"playlists",{media:()=>{}}).media();if(n){s.rendition={height:_(n,"attributes.RESOLUTION.height",T),width:_(n,"attributes.RESOLUTION.width",T)}}return s}data(){const e=this.player();const t=u.getAttributes(e.el());const i=this.player().bcAnalytics.client;const s=_(e,"bcinfo.accountId",_(t,"data-account",T));const n=_(e,"bcinfo.playerId",_(t,"data-player",T));const r=_(e,"bcinfo.embedId",_(t,"data-embed",T));const a=_(e,"bcinfo.applicationId",_(t,"data-application-id","-"));const o=_(tv,`bc.${n}_${r}.VERSION`,_(tv,"bc.VERSION",T));const l=_(tv,`bc.${n}_${r}.videojs.VERSION`,_(tv,"videojs.VERSION",T));return{capabilities:lr(c),player:{accountId:s,playerId:n,embedId:r,applicationId:a,playerVersion:o,videojsVersion:l,language:e.language(),viewerId:i.user()},plugins:this.dataForPlugins_(),source:this.dataForSource_(),vhs:this.dataForVhs_()}}contentForPlayer_(e){const{player:t}=e;const i=[o("Brightcove Player Version",t.playerVersion),o("Video.js Version",t.videojsVersion),o("Account ID",t.accountId),o("Player ID",t.playerId),o("Embed ID",t.embedId),o("Application ID",t.applicationId),o("Viewer ID",t.viewerId)];return a(i)}contentForPlugins_(e){const t=e.plugins.map(e=>{return o(e.displayName,e.version,e.active?"Yes":"No")});if(!t.length){t.push(u.createEl("tr",{innerHTML:'No plugins available.'}))}const i=a(t);const s=u.createEl("thead",{innerHTML:` + + Name + Version + Active? + + `.trim()});i.insertBefore(s,i.querySelector("tbody"));return i}contentForSource_(e){const{keySystem:t,mediainfo:i,type:s}=e.source;const n=[o("Current Media Type",s),o("DRM Key System",t||"n/a")];if(i){if(i.id){n.push(o("Video ID",i.id))}if(i.name){n.push(o("Video Name",i.name))}}return a(n)}contentForVhs_(e){const{vhs:t}=e;const i=[];if(t){if(G.isObj(t.versions)){i.push(u.createEl("tr",{innerHTML:'Library Versions'}));Object.keys(t.versions).forEach(e=>{i.push(o(e,t.versions[e]))})}i.push(u.createEl("tr",{innerHTML:'Statistics'}),o("Current Bandwidth",t.bandwidth),o("Media Bytes Transferred",t.mediaBytesTransferred),o("Media Requests",t.mediaRequests),o("Media Transfer Duration",t.mediaTransferDuration));if(t.rendition){i.push(o("Rendition Width",t.rendition.width),o("Rendition Height",t.rendition.height))}}else{i.push(u.createEl("tr",{innerHTML:'Using native playback engine.'}))}return a(i)}contentForCapabilities_(e){const{eme:n,mse:t}=e.capabilities;const r=[o("Media Source Extensions",t?"Yes":"No"),o("Encrypted Media Extensions",n.support?"Yes":"No")];Object.keys(n).forEach(e=>{if(e==="support"){return}const{name:t,persistentState:i,support:s}=n[e];r.push(o(t,s?"Yes":"No"));if(s){r.push(o(`${t} with persistentState`,i?"Yes":"No"))}});return a(r)}contentForFormats_(e){const{formats:t}=e.capabilities;const i=Object.keys(t).map(e=>{return o(e,t[e])});return a(i)}content(){const e=this.data();return[u.createEl("div",{className:"vjs-pi-section"},{},[u.createEl("h2",{},{},"Player Information"),this.contentForPlayer_(e),u.createEl("h2",{},{},"Media Information"),this.contentForSource_(e),u.createEl("h2",{},{},"Player Plugins"),this.contentForPlugins_(e)]),u.createEl("div",{className:"vjs-pi-section"},{},[u.createEl("h2",{},{},"Playback Engine"),this.contentForVhs_(e),u.createEl("h2",{},{},"Device Capabilities"),this.contentForCapabilities_(e),u.createEl("h2",{},{},"Device Format Support"),this.contentForFormats_(e)])]}}c.registerComponent("PlayerInfoModal",t);return t};const ur=e=>{cr(e);function t(){if(this.playerInfo.modal){this.playerInfo.modal.dispose()}this.playerInfo=function(){t.apply(this,arguments)};this.ready(()=>{this.addClass("vjs-player-info");this.playerInfo.modal=this.addChild("playerInfoModal",{fillAlways:true,label:this.localize("Player Information Dialog"),temporary:false});this.playerInfo.modal.on("dispose",()=>{delete this.playerInfo})})}e.registerPlugin("playerInfo",t);t.VERSION=I};const dr=e=>{const s=(e,t)=>{if(typeof e.usingPlugin==="function"){return e.usingPlugin(t)}return!!e[t]};const i=e=>{e.postrollFinished=false;e.postrollTimedOut=false;e.sawNoPostrollEvent=false};const n=e=>{if(!s(e,"ads")){return false}const t=e.endscreenState_;if(t.sawNoPostrollEvent){return false}return!t.postrollFinished&&!t.postrollTimedOut};const r=e=>{if(!s(e,"playlist")){return false}const t=e.playlist;const i=t();if(t.autoadvance_.delay!==0||!i.length){return false}return t.repeat()||t.currentItem()!==i.length-1};const t=function(){if(this.endscreenState_){return}const t=this.endscreenState_={};const e=()=>{this.trigger("endscreen")};i(t);this.on("adstart",()=>{const e=this.ended();if(this.ads.adType==="postroll"){t.isPostroll=true}t.postrollFinished=!e});this.on("adend",()=>{t.postrollFinished=this.ended()});this.on("adtimeout",()=>{t.postrollTimedOut=this.ended()});this.on(["endscreen","loadstart"],()=>{this.off("adend",e);i(t)});this.on("nopostroll",()=>{t.sawNoPostrollEvent=true});this.on("ended",()=>{if(r(this)){return}if(n(this)){this.one("adend",()=>{if(t.isPostroll){e()}});return}e()})};t.VERSION=I;if(!e.getPlugin("endscreen")){e.registerPlugin("endscreen",t)}};function hr(){hr=Object.assign||function(e){for(var t=1;t=400&&t.statusCode<=599){var s=i;if(r){s=String.fromCharCode.apply(null,new Uint8Array(i))}n({cause:s});return}n(null,i)}}}var Tr=function e(t){var i=String.fromCharCode.apply(null,new Uint16Array(t));var s=(new tv.DOMParser).parseFromString(i,"application/xml");var n=s.getElementsByTagName("HttpHeaders")[0];var r={};if(n){var a=n.getElementsByTagName("name");var o=n.getElementsByTagName("value");for(var l=0;l{const t=tv.atob(e);const i=new Uint8Array(t.length);for(let e=0;e{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="";let s;let n;let r;let a;let o;let l;let c;let u=0;while(u>2;o=(s&3)<<4|n>>4;l=(n&15)<<2|r>>6;c=r&63;if(isNaN(n)){l=c=64}else if(isNaN(r)){c=64}i+=t.charAt(a)+t.charAt(o)+t.charAt(l)+t.charAt(c)}return i};const sa=u=>(e,t,i)=>{if(e){return u(e)}const s=new tv.DOMParser;const n=s.parseFromString(i,"text/xml");if(t.statusCode>=400){const l=n.getElementsByTagName("Error");let e=`License call failed with status code ${t.statusCode}.`;if(l.length>0){const c=n.getElementsByTagName("Message");if(c.length>0){e+=" "+c[0].childNodes[0].nodeValue}}return u(e)}let r="";const a=n.getElementsByTagName("ckc");if(a.length>0){r=a[0].childNodes[0].nodeValue}const o=ta(r);u(null,o)};const na=o=>{return{"com.apple.fps.1_0":{overrideOptions:{getLicense:(e,t,i,s)=>{const n=e.keySystems["com.apple.fps.1_0"].licenseUri;const r=tv.btoa(String.fromCharCode.apply(null,i));const a=sa(s);o.xhr({uri:n,method:"POST",body:`spc=${r}`,headers:{"Content-type":"application/x-www-form-urlencoded"}},a)}}}}};const ra="utf-16";const aa="utf-8";const oa="http://schemas.xmlsoap.org/soap/envelope/";function la(e,t){const i=t===ra?new Uint16Array(e):new Uint8Array(e);const s=String.fromCharCode.apply(null,i);const n=new tv.DOMParser;const r=n.parseFromString(s,"application/xml");return r}function ca(e,t=aa){const i=la(e,t);let s="";let n="";let r="";let a=-1;let o=-1;const l=i?i.getElementsByTagNameNS(oa,"Envelope")[0]:null;const c=l?l.getElementsByTagNameNS(oa,"Body")[0]:null;const u=c?c.getElementsByTagNameNS(oa,"Fault")[0]:null;const d=u?u.getElementsByTagName("detail")[0]:null;const h=d?d.getElementsByTagName("Exception")[0]:null;let f=null;if(!u){return null}f=u.getElementsByTagName("faultstring")[0].firstChild;s=f?f.nodeValue:null;if(h!==null){f=h.getElementsByTagName("StatusCode")[0];n=f?f.firstChild.nodeValue:null;f=h.getElementsByTagName("Message")[0];r=f?f.firstChild.nodeValue:null;a=r?r.lastIndexOf("[")+1:-1;o=r?r.indexOf("]"):-1;r=r?r.substring(a,o):""}let p=`code: ${n}, name: ${s}`;if(r){p+=`, message: ${r}`}return p}function ua(e,t=ra){const i=la(e,t);const s={"Content-Type":`text/xml; charset=${t}`};let n=e;const r=i.querySelector("PlayReadyKeyMessage");if(!r){return{headers:s,body:n}}const a=r.querySelectorAll("name");const o=r.querySelectorAll("value");for(let e=0;eString.fromCharCode.apply(null,new Uint16Array(e));const va=s=>(e,t,i)=>{if(e){return s(e)}return s(null,new Uint8Array(i))};const ya=(e,t)=>{const i=t.buffer?t.buffer:t;const s=ga(i);const n="skd://drmtoday?";const r=s.indexOf(n);if(r>-1){return s.substring(r+n.length).replace(/assetid/gi,"assetId").replace(/variantid/gi,"variantId")}return""};const ba=e=>e.customDataIsB64?e.customData:tv.btoa(e.customData);const _a=(e,n)=>e.xhr.httpHandler((e,t)=>{if(e){return n(e)}let i=t.trim();if(i.substr(0,5)===""&&i.substr(-6)===""){i=i.slice(5,-6)}const s=ta(i);n(null,s)});const Ta=l=>{return{"com.apple.fps.1_0":{overrideOptions:{getCertificate:(e,t)=>{const i=va(t);const s=e.keySystems["com.apple.fps.1_0"];const{options:n}=s.vendor;l.xhr({uri:s.certificateUri||ma,method:"GET",responseType:"arraybuffer",headers:{"x-dt-auth-token":n.authToken,"x-dt-custom-data":ba(n),Pragma:"Cache-Control: no-cache","Cache-Control":"max-age=0"}},l.xhr.httpHandler(i))},getContentId:ya,getLicense:(e,t,i,s)=>{const n=_a(l,s);const r=encodeURIComponent(ia(i));const a=e.keySystems["com.apple.fps.1_0"];const{options:o}=a.vendor;l.xhr({uri:a.licenseUri||pa,method:"POST",responseType:"text",body:`spc=${r}&${t}`,headers:{"x-dt-auth-token":o.authToken,"x-dt-custom-data":ba(o),"Content-type":"application/x-www-form-urlencoded"}},n)}}},"com.widevine.alpha":{overrideOptions:{getLicense(e,t,n){const i=e.keySystems["com.widevine.alpha"];const{options:s}=i.vendor;l.xhr({uri:i.licenseUri||ha,method:"POST",responseType:"json",body:new Uint8Array(t),headers:{"x-dt-auth-token":s.authToken,"x-dt-custom-data":ba(s)}},l.xhr.httpHandler((e,t,i)=>{if(e){n(e);return}const s=ta(i.license);n(null,s)}))}}},"com.microsoft.playready":{overrideOptions:{getLicense(e,t,s){const i=e.keySystems["com.microsoft.playready"];const{options:n}=i.vendor;const r=ua(t);r.headers["x-dt-auth-token"]=n.authToken;r.headers["x-dt-custom-data"]=ba(n);l.xhr({uri:i.licenseUri||fa,method:"POST",body:r.body,headers:r.headers,responseType:"arraybuffer"},l.xhr.httpHandler((e,t,i)=>{e=e||ca(i);if(e){s(e);return}s(null,i)}))}}}}};const Sa=e=>{return{azure:na(e),castlabs:Ta(e)}};const Ea=(e,t,i)=>{const s=Sa(e);if(s[t]){const n=s[t][i];if(n){return n}}return null};const wa=(e,t,i,s)=>{const{getLicense:n,getContentId:r,getCertificate:a}=Ea(e,i,s).overrideOptions;if(!t.getLicense&&n){t.getLicense=n}if(!t.getContentId&&r){t.getContentId=r}if(!t.getCertificate&&a){t.getCertificate=a}return t};const ka=s=>{const e=function(i){const e=Object.keys(i);e.forEach(function(e){const t=i[e];if(t.vendor&&Ea(s,t.vendor.name,e)){i[e]=wa(s,i[e],t.vendor.name,e)}});return i};return e};const ja="CsECCAMSEBcFuRfMEgSGiwYzOi93KowYgrSCkgUijgIwggEKAoIBAQCZ7Vs7Mn2rXiTvw7YqlbWYUgrVvMs3UD4GRbgU2Ha430BRBEGtjOOtsRu4jE5yWl5KngeVKR1YWEAjp+GvDjipEnk5MAhhC28VjIeMfiG/+/7qd+EBnh5XgeikX0YmPRTmDoBYqGB63OBPrIRXsTeo1nzN6zNwXZg6IftO7L1KEMpHSQykfqpdQ4IY3brxyt4zkvE9b/tkQv0x4b9AsMYE0cS6TJUgpL+X7r1gkpr87vVbuvVk4tDnbNfFXHOggrmWEguDWe3OJHBwgmgNb2fG2CxKxfMTRJCnTuw3r0svAQxZ6ChD4lgvC2ufXbD8Xm7fZPvTCLRxG88SUAGcn1oJAgMBAAE6FGxpY2Vuc2Uud2lkZXZpbmUuY29tEoADrjRzFLWoNSl/JxOI+3u4y1J30kmCPN3R2jC5MzlRHrPMveoEuUS5J8EhNG79verJ1BORfm7BdqEEOEYKUDvBlSubpOTOD8S/wgqYCKqvS/zRnB3PzfV0zKwo0bQQQWz53ogEMBy9szTK/NDUCXhCOmQuVGE98K/PlspKkknYVeQrOnA+8XZ/apvTbWv4K+drvwy6T95Z0qvMdv62Qke4XEMfvKUiZrYZ/DaXlUP8qcu9u/r6DhpV51Wjx7zmVflkb1gquc9wqgi5efhn9joLK3/bNixbxOzVVdhbyqnFk8ODyFfUnaq3fkC3hR3f0kmYgI41sljnXXjqwMoW9wRzBMINk+3k6P8cbxfmJD4/Paj8FwmHDsRfuoI6Jj8M76H3CTsZCZKDJjM3BQQ6Kb2m+bQ0LMjfVDyxoRgvfF//M/EEkPrKWyU2C3YBXpxaBquO4C8A0ujVmGEEqsxN1HX9lu6c5OMm8huDxwWFd7OHMs3avGpr7RP7DUnTikXrh6X0";const Ca=ta(ja);const Ia=iv.createElement("video");const xa=tv.navigator.requestMediaKeySystemAccess||Ia.msSetMediaKeys;const Aa=e=>{return/manifest.prod.boltdns.net\/license/i.test(e)||/wvlic.brightcove.com\/proxy/i.test(e)};const Da=i=>{i=Object.keys(i).reduce(function(e,t){e[t]={url:i[t].license_url};return e},{});const e=i["com.widevine.alpha"];if(e&&Aa(e.url)){e.getCertificate=(e,t)=>{t(null,Ca)}}return i};const Oa=e=>{return e.reduce((e,t)=>{e[t.name]=t.options;const i=e[t.name].serverCertificate;if(i){e[t.name].getCertificate=(e,t)=>{t(null,ta(i))};delete e[t.name].serverCertificate}return e},{})};const Pa=s=>{const e=function(e){let t=e;if(!s.browser.IS_SAFARI){const i=!tv.shaka&&e.key_systems&&xa;if(i){t=s.obj.merge(e,{keySystems:Da(e.key_systems)});if(e.keySystemOptions){t=s.obj.merge(t,{keySystems:Oa(e.keySystemOptions)})}}if(!xa){let e="Cannot use keys for a DRM-protected source because the EME API is unavailable.";if(tv.isSecureContext===false){e+=" The player is not running in a secure context, e.g. an HTTPS domain."}s.log.warn(e)}}return t};return e};const La=e=>{const i=Pa(e);const s=ka(e);e.use("*",function(e){return{setSource(e,t){e=i(e);if(e.keySystems){e.keySystems=s(e.keySystems)}return t(null,e)}}})};const Ra=iv.documentElement;const Na=iv.body;const Ma=()=>{return{top:0,left:0,right:Ra.clientWidth||Na.clientWidth,width:Ra.clientWidth||Na.clientWidth,bottom:Ra.clientHeight||Na.clientHeight,height:Ra.clientHeight||Na.clientHeight}};const Ua=(e,t)=>{const i=Math.max(e.top,t.top);const s=Math.min(e.bottom,t.bottom);const n=Math.max(e.left,t.left);const r=Math.min(e.right,t.right);const a=r-n;const o=s-i;return a>=0&&o>=0&&{top:i,bottom:s,left:n,right:r,width:a,height:o}};const Ba=e=>{const t=f.dom.getBoundingClientRect(e);const i=Ma();const s=Ua(i,t);const n=t.width*t.height;const r=s.width*s.height;if(n){return r/n}return 0};class Fa{constructor(i,e,s,t){this.el_=i;this.callback_=s;this.supportsIO_=t;this.observing_=false;if(t===undefined){this.supportsIO_="IntersectionObserver"in tv&&"IntersectionObserverEntry"in tv&&"intersectionRatio"in tv.IntersectionObserverEntry.prototype}if(this.supportsIO_){this.io_=new tv.IntersectionObserver(t=>{for(let e=0;ethis.checkForIntersection_(e),500)}}observe(){if(this.observing_){return}this.observing_=true;if(this.supportsIO_){this.io_.observe(this.el_)}else{f.on(tv,"resize",this.boundCheckForIntersection_);f.on(iv,"scroll",this.boundCheckForIntersection_)}}unobserve(){if(!this.observing_){return}this.observing_=false;if(this.supportsIO_){this.io_.unobserve(this.el_)}else{f.off(tv,"resize",this.boundCheckForIntersection_);f.off(iv,"scroll",this.boundCheckForIntersection_)}}dispose(){this.unobserve();this.io_=null;this.el_=null;this.callback_=null}checkForIntersection_(){if(tv.getComputedStyle(this.el_).display==="none"){return}const e=Ba(this.el_);this.callback_(e)}}const qa={viewabilityThreshold:.6,minDurationForViewableImpression:2e3,thresholdPercentageIncrement:5,delayAutoplayIfNotViewable:false,delayAutoplayOnMobileOnly:false,pauseWhenNotViewable:false,useIntersectionObserver_:undefined,pauseInBackgroundTab:false};const Va=n=>{const e=n.getPlugin("plugin");class t extends e{constructor(e,t){super(e);this.options=n.obj.merge(qa,t);this.log=e.log.createLogger("viewability");this.log.level(this.options.debug?"debug":"off");this.log.debug("init",this.options);this.adImpressionTimeout_=null;this.player.ready(()=>{if(this.shouldDelayAutoplay_()){this.delayAutoplayIfNotViewable_()}else{this.pauseWhenNotViewable_()}this.player.addClass("vjs-viewability");if(this.player.usingPlugin("ads")){this.setupViewableAdImpression_()}if(this.options.pauseInBackgroundTab){this.enablePauseInBackgroundTab_()}this.observe_()});this.adImpressionViewabilityChangeHandler_=this.adImpressionViewabilityChangeHandler_.bind(this);this.onVisibilityChange_=this.onVisibilityChange_.bind(this);iv.addEventListener("visibilitychange",this.onVisibilityChange_)}shouldDelayAutoplay_(){const{delayAutoplayIfNotViewable:e,delayAutoplayOnMobileOnly:t}=this.options;const{IS_ANDROID:i,IS_IOS:s}=n.browser;if(!e||!this.player.autoplay()){return false}return!t||i||s}buildThresholdArray_(){let e=0;const t=[];while(e<100){t.push((e+=this.options.thresholdPercentageIncrement)/100)}return t}observe_(){const e=this.player.el();if(!this.vo_){this.vo_=new Fa(e,this.buildThresholdArray_(),e=>this.onViewableChange_(e),this.options.useIntersectionObserver_)}this.vo_.observe()}onViewableChange_(e){if(!this.state){return}const t=Math.ceil(e*100)/100;const i=t>=this.options.viewabilityThreshold;const s=this.state.viewable===undefined||this.state.viewable&&!i||!this.state.viewable&&i;if(s){const n=i?"viewable":"not-viewable";this.player.trigger({type:"usage",name:n});this.player.trigger({type:"usage",name:`${n}-${t}`})}this.setState({viewablePercent:t,viewable:i});this.log.debug("viewability changed",{viewable:i,viewablePercent:t});this.player.trigger({type:m,viewable:i,viewablePercent:t});if(s){this.player.trigger({type:Is,viewable:i,viewablePercent:t})}}delayAutoplayIfNotViewable_(){const e=this.options.delayAutoplayIfNotViewable;if(!e){return}this.log.debug("delaying autoplay until viewable");const t=this.player.autoplay();const i=e=>{if(e.viewable){this.player.addClass("vjs-waiting-for-autoplay");this.player.autoplay(t);this.player.off(m,i)}};this.player.autoplay(false);this.player.removeClass("vjs-waiting-for-autoplay");this.player.on(m,i);this.player.one("play",()=>{this.player.removeClass("vjs-ima3-not-playing-yet");this.player.off(m,i);this.pauseWhenNotViewable_()})}pauseWhenNotViewable_(){if(!this.options.pauseWhenNotViewable){return}this.autoPaused_=false;const e=e=>{const t=this.player.paused();if(e.viewable&&t&&this.autoPaused_){this.player.play()}else if(!e.viewable&&!t){this.player.pause();this.autoPaused_=true;this.player.one("play",()=>{this.autoPaused_=false})}};this.player.on(Is,e)}onVisibilityChange_(){const e=iv.visibilityState;if(e==="hidden"&&this.state&&this.state.viewablePercent!==0){this.viewablePercent=this.state.viewablePercent;this.onViewableChange_(0)}else if(e==="visible"&&this.viewablePercent!==undefined){this.onViewableChange_(this.viewablePercent)}}startAdImpressionTimeout_(){this.adImpressionTimeout_=this.player.setTimeout(()=>{this.player.trigger("viewable-ad-impression");this.log.debug("viewable-ad-impression");this.player.trigger({type:"usage",name:"viewable-ad-impression"});this.player.trigger({type:"usage",name:`viewable-ad-impression-${this.state.viewablePercent}`});this.adImpressionTimeout_=null;this.player.off(m,this.adImpressionViewabilityChangeHandler_)},this.options.minDurationForViewableImpression)}stopAdImpressionTimeout_(){tv.clearTimeout(this.adImpressionTimeout_);this.adImpressionTimeout_=null}adImpressionViewabilityChangeHandler_(e){if(e.viewable){if(!this.adImpressionTimeout_){this.startAdImpressionTimeout_()}}else if(this.adImpressionTimeout_){this.stopAdImpressionTimeout_()}}setupViewableAdImpression_(){this.player.on("ads-ad-started",()=>{if(this.state.viewable){this.startAdImpressionTimeout_()}this.player.on(m,this.adImpressionViewabilityChangeHandler_);this.player.any(["adend","adtimeout","adserror"],()=>{this.player.off(m,this.adImpressionViewabilityChangeHandler_)})})}enablePauseInBackgroundTab_(){this.pausedInBackground_=false;const e=()=>{const e=this.player.paused();const t=iv.visibilityState;if(t==="hidden"&&!e&&!this.pausedInBackground_){this.player.pause();this.pausedInBackground_=true}else if(t==="visible"&&e&&this.pausedInBackground_){this.player.play();this.pausedInBackground_=false}};this.player.on("VIEWABLE_CHANGE",e)}}t.defaultState={viewable:undefined,viewablePercent:undefined};n.registerPlugin("viewability",t)};const Ha={hidden:"hidden",off:"off",ready:"ready"};const $a=(e,t)=>{const i=e.name||e.id;if(!i){return t==="mp4"?"video":"videoTranscript"}return i.replace(/[^0-9a-z-A-Z]/g,"")};const za=(e,t,i)=>{const s=i==="mp4"?"mp4":"txt";const n=iv.createElement("a");n.href=e;n.target="_blank";n.download=`${t}.${s}`;iv.body.appendChild(n);n.click();iv.body.removeChild(n)};const Ga=(e,t,i)=>{t.removeClass("has-icon-downloading");t.addClass("has-icon-file-download");e.removeClass("vjs-video-downloading");const s=`Download ${i==="mp4"?"Video":"Transcript"}`;t.setAttribute("aria-label",t.localize(s));t.controlText(s)};const Ka=(i,s,e,n,r)=>{fetch(e).then(e=>e.blob()).then(e=>{const t=URL.createObjectURL(e);za(t,n,r);Ga(i,s,r);i.trigger({name:n,type:"download-finished"});URL.revokeObjectURL(t)}).catch(e=>{Ga(i,s,r);i.trigger({err:e,type:"download-failed"})})};const Wa=(e,t)=>{if(e.hasClass("vjs-video-downloading")){return}const i=t.options();const s=i.source;const n=i.type;const r=$a(e.mediainfo,n);e.addClass("vjs-video-downloading");t.removeClass("has-icon-file-download");t.addClass("has-icon-downloading");t.setAttribute("aria-label",t.localize("Downloading"));t.controlText("Downloading");e.trigger("download-started");Ka(e,t,s,r,n)};const Ya=f.getComponent("Button");class Xa extends Ya{constructor(e,t={}){super(e,t);const i={[Ha.hidden]:this.onHiddenState,[Ha.off]:this.onOffState,[Ha.ready]:this.onReadyState};const s=i[t.state];s.call(this,e,t.type)}onHiddenState(e){this.addClass("vjs-hidden");e.trigger("download-hidden")}onReadyState(e,t){const i=`Download ${t==="mp4"?"Video":"Transcript"}`;this.el_.setAttribute("aria-label",this.localize(i));this.controlText(i);this.addClass("has-icon-file-download");e.trigger("download-ready")}onOffState(e){this.el_.setAttribute("aria-label",this.localize("No downloadable item available"));this.controlText("No downloadable item available");this.addClass("has-icon-file-download-off");this.disable();e.trigger("download-disabled")}handleClick(){Wa(this.player(),this)}buildWrapperCSSClass(){return`vjs-download-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`vjs-download-button ${super.buildCSSClass()}`}}f.registerComponent("DownloadButton",Xa);function Qa(e){if(typeof e!=="string"){return false}let t={};try{t=new URL(e)}catch(e){}return t.protocol==="https:"}function Ja(){const t=G.preferHttps(tv);return e=>t?Qa(e.src):!Qa(e.src)}const Za=(e,t)=>{let i;const s=e.language()||"en";const n=t.filter(Ja());i=n.find(e=>e.src_lang===s);if(!i){i=n.find(e=>{return e.src_lang&&e.src_lang.slice(0,2)===s.slice(0,2)})}if(!i&&n.length){i=n[0]}return i};const eo=(e,t)=>{let i;let s;const n=e.mediainfo.sources||[];const r=e.mediainfo.transcripts||[];if(t==="mp4"){i=n.filter(Ja()).filter(e=>e.container==="MP4"&&e.hasOwnProperty("src")&&e.hasOwnProperty("size")).sort((e,t)=>t.size-e.size);s=i[0]&&i[0].src}if(t==="transcript"){const a=Za(e,r);s=a&&a.src}return s};const to=(e,t)=>{const i=eo(e,t.type);const s=Array.isArray(e.mediainfo.tags)&&e.mediainfo.tags.find(e=>e==="downloadable");if(!s){return Ha.hidden}if(!i){return Ha.off}return Ha.ready};const io=(e,t)=>{e.addClass("vjs-download-video");t.source=eo(e,t.type);t.state=to(e,t);const i=e.getChild("controlBar");const s=i.addChild("DownloadButton",t,i.children_.length-2);return function(){e.removeClass("vjs-download-video");i.removeChild(s);s.dispose()}};const so=e=>{function t(e={}){if(typeof this.downloadButton==="undefined"){return}let t=()=>{};this.ready(()=>{t=io(this,e);this.on("loadstart",()=>{t();t=io(this,e)});this.downloadButton=()=>{};this.downloadButton.source=e.source;this.downloadButton.state=e.state})}e.registerPlugin("downloadButton",t);t.VERSION=I};const no=new tv.Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});const ro=URL.createObjectURL(no);const ao=["perSourceBehaviors","contextmenu","contextmenuUI","bcAnalytics","errors","catalog","downloadButton","playerInfo","plugin","reloadSourceOnError","playlist","endscreen","proxyTracks","seekEvents","touchActive","urlparams","encryptedWatcher","viewability"];const oo=function(n,l,e){const i=e.settings;const t={};const s=Boolean(l.options_.debug);const r={chromecastReceiver:{debug:s},ima3:{debugContribAds:s},ssai:{debug:s},vr:{debug:s}};l.on("pluginsetup",(e,t)=>{const{name:i}=t;if(ao.indexOf(i)!==-1){return}l.trigger({type:"usage",name:`${i}!${n.getPluginVersion(i)}`})});const a=function(t,e={}){const i=r[t]||{};if(!l.hasPlugin(t)){n.log.error(`Plugin "${t}" is missing. Please check your player configuration.`);return}if(l.usingPlugin(t)){return}const s=n.obj.merge(i,e);try{l[t](s)}catch(e){n.log.error(`Unable to initialize "${t}" plugin:`,e)}};if(i.usingAdFailover&&i.usingIMAPrerollWithSSAI){n.log.warn("Ad failover is not compatible with SSAI and client-side preroll. "+"Please configure only one. This player will use ad failover behavior.");delete i.usingIMAPrerollWithSSAI}if(i.usingAdFailover){l.trigger({type:"usage",name:"ad-failover"});const{name:h,options:f}=l.usingAdBlocker.mightBe?i.serverSideAdPlugin:i.clientSideAdPlugin;a(h,f)}else if(i.usingIMAPrerollWithSSAI){if(tv.bc.disposedAfterPreroll_){const p=i.serverSideAdPlugin.name;const m=i.serverSideAdPlugin.options;const g=i.clientSideAdPlugin.name;n.deregisterPlugin(g);n.registerPlugin(p,tv.bc.ssaiPluginCache_);a(p,m)}else{l.trigger({type:"usage",name:"ssai-with-ima-preroll"});const g=i.clientSideAdPlugin.name;const v=i.clientSideAdPlugin.options;const p=i.serverSideAdPlugin.name;tv.bc.ssaiPluginCache_=n.getPlugin("ssai");n.deregisterPlugin(p);a(g,v);const y=l.tagAttributes;l.one(["adend","adtimeout","adserror"],function(o){l.one("playing",function(){let t=l.volume();let i=l.muted();if(o.type==="adend"){if(l.ima3&&l.ima3.adPlayer){t=l.ima3.adPlayer.volume();i=l.ima3.adPlayer.muted()}else{t=l.ima3.player.volume();i=l.ima3.player.muted()}}const e=l.el();const s=e.parentNode;const n=iv.createElement("div");s.replaceChild(n,e);l.dispose();tv.bc.disposedAfterPreroll_=true;const r=iv.createElement("video-js");Object.keys(y).forEach(e=>{r.setAttribute(e,y[e])});s.replaceChild(r,n);const a=tv.bc(y.id);a.bigPlayButton.hide();a.ready(function(){a.one("playing",()=>{tv.bc.disposedAfterPreroll_=false});const e=a.play();if(e.then){e.catch(()=>{a.bigPlayButton.show()})}a.volume(t);a.muted(i)})})})}}i.plugins.forEach(function({autoInit:e,name:t,options:s={}}){if(!e){return}const n=i.videoCloud&&i.videoCloud.bumper;if(t==="catalog"&&n&&n.id){let{showControls:e,progressBarColor:t,preventSeeking:i}=n;e=e&&Boolean(e)||true;i=Boolean(i);s.bumper=w(n,{showControls:e,progressBarColor:t,preventSeeking:i})}a(t,s)});const{media:o,videoCloud:c}=i;const u=o&&!!(o.sources||o.length&&o[0].sources);if(c&&c.policyKey&&!u){const b={embedHasPoster:i.embedState.poster,embedHasSources:i.embedState.sources,embedHasTracks:i.embedState.tracks,adConfigId:i.adConfigId,deliveryConfigId:i.deliveryConfigId,bumper:i.videoCloud&&i.videoCloud.bumper};if(c.playlist){l.trigger({type:"usage",name:"catalog-playlist"});b.playlistId=c.playlist}if(c.video){l.trigger({type:"usage",name:"catalog-video"});b.videoId=c.video}if(c.search){l.trigger({type:"usage",name:"catalog-search"});b.search=c.search}if(c.sequence){l.trigger({type:"usage",name:"catalog-sequence"});b.sequence=c.sequence}let e;if(i.usingIMAPrerollWithSSAI&&!tv.bc.disposedAfterPreroll_){l.src({src:ro,type:"video/mp4"})}else if(c.autoLoad!==false){e=t.catalogMedia=l.catalog.autoFindAndLoadMedia(b)}if(e&&e.type==="video"){if(/^[\d]+$/.test(e.id)){l.mediainfo.id=e.id}else{l.mediainfo.referenceId=l.mediainfo.reference_id=e.id}}l.on("loadstart",()=>{if(l.language()&&l.catalog.getMetadata({lang:l.language()})){l.trigger({type:"usage",name:"variant:"+l.language()})}})}if(l.usingPlugin("bcAnalytics")){const _=function(){return(new Date).toISOString().split("T")[0]+":"+l.bcAnalytics.client.getSession()};l.ready(function(){G.perf.mark("bcInitEnd");G.perf.measure("bcInit","bcInitStart","bcInitEnd");if(l.usingPlugin("playerInfo")){l.playerInfo.modal.on("modalfill",function(){const e=_();const t=l.playerInfo.modal.$(".vjs-pi-section tbody");if(!e||!t){return}const i=iv.createElement("tr");const s=iv.createElement("tr");i.innerHTML=""+l.localize("Session ID")+" "+e+"";t.appendChild(i);s.innerHTML=""+l.localize("Player Element ID")+" "+l.id()+"";t.appendChild(s)})}});if(l.usingPlugin("errors")){l.errorDisplay.on("modalfill",function(){const e=_();const t=l.errorDisplay.$(".vjs-errors-content-container");if(!e||!t){return}t.appendChild(n.dom.createEl("div",{className:"vjs-errors-ref-id",innerHTML:""+l.localize("Session ID:")+" "+e+" "+""+l.localize("Player Element ID:")+" "+l.id()}))})}}if(l.usingPlugin("playerInfo")){l.on("contextmenu",function(){if(l.playerInfo.modal){l.playerInfo.modal.close()}})}const d=l.getChild("TitleBar");if(d&&i.hasTitleBar!==false){const T=o&&(o[0]&&o[0].title||o.title)||"";const S=o&&(o[0]&&o[0].description||o.description)||"";const E=function(){if(l.controls()){const{mediainfo:t}=l;const i=l.language()||"";let e;if(l.usingPlugin("catalog")){e=l.catalog.getMetadata({lang:i})}d.update({title:e&&e.name||t&&t.name||T,description:e&&e.description||t&&t.description||S})}};E();l.on(["loadstart","loadedmetadata","languagechange"],E)}return t};const lo=(e,t)=>{let i;const s=iv.createElement("script");s.src=e;s.onload=function(){if(!i){i=true;t()}};s.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){if(!i){i=true;t()}}};const n=iv.getElementsByTagName("head")[0];if(n){n.appendChild(s)}};const co=()=>{try{return tv.location.hostname.split(".").pop().length}catch(e){return 3}};const uo=e=>{let i;if(e){const s=e.split("&");for(let e=0,t=s.length;e{const i=e+"=";const s=iv.cookie.split(";");for(let t=0,e=s.length;t{if(typeof e!=="string"){return null}const t=e.toLowerCase();return t==="production"||t==="qa"||t==="staging"?t:null};class po{constructor(e,t){this.runtime_=t;const i={};Object.keys(G).forEach(e=>{const t=G[e];Object.defineProperty(i,e,{enumerable:true,value:t,writable:false})});Object.defineProperty(this,"util",{enumerable:true,value:i,writable:false})}getRuntime(){return this.runtime_}}var mo="Expected a function";var go="__lodash_hash_undefined__";var vo=1/0;var yo="[object Function]",bo="[object GeneratorFunction]",_o="[object Symbol]";var To=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,So=/^\w*$/,Eo=/^\./,wo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var ko=/[\\^$.*+?()[\]{}|]/g;var jo=/\\(\\)?/g;var Co=/^\[object .+?Constructor\]$/;var Io=typeof ev=="object"&&ev&&ev.Object===Object&&ev;var xo=typeof self=="object"&&self&&self.Object===Object&&self;var Ao=Io||xo||Function("return this")();function Do(e,t){return e==null?undefined:e[t]}function Oo(e){var t=false;if(e!=null&&typeof e.toString!="function"){try{t=!!(e+"")}catch(e){}}return t}var Po=Array.prototype,Lo=Function.prototype,Ro=Object.prototype;var No=Ao["__core-js_shared__"];var Mo=function(){var e=/[^.]+$/.exec(No&&No.keys&&No.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var Uo=Lo.toString;var Bo=Ro.hasOwnProperty;var Fo=Ro.toString;var qo=RegExp("^"+Uo.call(Bo).replace(ko,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Vo=Ao.Symbol,Ho=Po.splice;var $o=gl(Ao,"Map"),zo=gl(Object,"create");var Go=Vo?Vo.prototype:undefined,Ko=Go?Go.toString:undefined;function t(e){var t=-1,i=e?e.length:0;this.clear();while(++t-1}function nl(e,t){var i=this.__data__,s=ul(i,e);if(s<0){i.push([e,t])}else{i[s][1]=t}return this}Zo.prototype.clear=el;Zo.prototype["delete"]=tl;Zo.prototype.get=il;Zo.prototype.has=sl;Zo.prototype.set=nl;function i(e){var t=-1,i=e?e.length:0;this.clear();while(++tt.getAutoplayConditions(e)});Object.defineProperty(a,"getAccountId",{enumerable:true,value(){return t.runtime.settings.accountId}});Object.defineProperty(a,"getApplicationId",{enumerable:true,value(){return t.runtime.settings.applicationId}});Object.defineProperty(a,"setAccountId",{enumerable:true,value(e){if(G.isNil(e)){s.log.warn("account ID must be a string or number");return}t.runtime.settings.accountId=e;this.bcinfo.accountId=e;this.mediainfo.accountId=this.mediainfo.account_id=e}});Object.defineProperty(a,"setApplicationId",{enumerable:true,value(e){if(!G.isNonEmptyStr(e)){s.log.warn("application ID must be a string");return}t.runtime.settings.applicationId=e;this.bcinfo.applicationId=e;if(a.bcAnalytics){a.bcAnalytics.setApplicationId(e)}}});K().then(function(e){if(e){a.trigger({type:"usage",name:"using-ad-blocker"})}});if(n.classNames&&n.classNames.player){a.addClass(n.classNames.player)}if(n.classNames&&n.classNames.playerInstance){a.addClass(n.classNames.playerInstance)}const F=a.dimension.bind(a);a.dimension=function(e,t){if(e==="width"){$t(n,t,null)}else if(e==="height"){$t(n,null,t)}return F(e,t)};a.ready(function(){if(!i.autoplay){return}function e(){a.removeClass(Ll)}if(!a.currentSrc()&&!y){e()}else{a.any(["autoplay-success","autoplay-failure","error"],e)}});if(!i.width&&!i.height){a.on("loadedmetadata",()=>{$t(n,a.tech_.width(),a.tech_.height())})}if(n.fullscreenControl===false&&a.controls()){a.on("canplay",function(){if(!a.controlBar){return}const t=a.controlBar.children();if(!t||!t.length){return}for(let e=t.length-1;e>0;e--){if(t[e].hasClass("vjs-menu-button-popup")&&!t[e].hasClass("vjs-hidden")){t[e].addClass("vjs-menu-popup-last-visible");break}}})}if(s.browser.IS_IPHONE){a.on("fullscreenchange",function(){const e=a.$(".vjs-tech");if(e.hasAttribute("controls")){e.removeAttribute("controls")}});if(n.embedState.playsinline&&n.embedState.muted){a.addClass("vjs-iphone")}}if(i.autoplay&&s.browser.IS_IOS&&s.browser.IS_ANY_SAFARI){const I=a.$(".vjs-tech");if(!I.autoplay){I.autoplay=true}}if(s.browser.IS_IOS&&n.embedState.muted){a.addClass("vjs-ios")}if(a.controls()){a.one("play",function(){if(!a.controlBar||!a.controls()){return}const t=a.controlBar.children();if(!t||!t.length){return}const i=["Enter","ArrowDown","ArrowUp","Up","Down"," ","Spacebar"];for(let e=0;e=0){a.controlBar.addClass("vjs-control-bar-visible")}})}}});if(a.controlBar){const x=a.controlBar.el();let t;const A=function(){const e=iv.activeElement;if(t!==e){t=e;a.controlBar.toggleClass("vjs-focus-within",x.contains(e))}};const D=function(){x.removeEventListener("focus",A,true);x.removeEventListener("blur",A,true)};x.addEventListener("focus",A,true);x.addEventListener("blur",A,true);a.on("dispose",D);a.controlBar.on("dispose",D)}}a.one("beforepluginsetup:ads",function(){const e=a.getChild("controlBar");if(e){e.removeChild("pictureInPictureToggle")}s.getComponent("Component").prototype.fsApi_=a.fsApi_});if(!s.browser.TOUCH_ENABLED){a.addClass("vjs-mouse");if(r.isInBcFrame){s.dom.addClass(iv.documentElement,"vjs-mouse")}}else if(s.browser.IS_IPHONE){a.addClass("vjs-native")}a.requestAnimationFrame(function(){const e=iv.querySelector(".bc-wrap");a.addClass("vjs-plugins-ready");if(e){e.style.opacity=0}});a.on(["mouseenter","ended","touchend"],function(){a.removeClass("vjs-hide-controls")});a.on("mouseleave",function(){a.addClass("vjs-hide-controls");if(!a.controlBar||!a.controlBar.el()){return}if(a.controlBar.hasClass("vjs-control-bar-visible")){a.controlBar.removeClass("vjs-control-bar-visible")}});if(!s.browser.IS_ANY_SAFARI&&!n.multilingualMetadataTracksDisabled){a.one("loadeddata",function(){if(a.language()!==undefined&&a.catalog&&a.catalog.getMetadata().variants!==undefined){const i=a.language()||"";const s=a.textTracks();if(s){const n=Array.prototype.filter.call(s,e=>(e.kind==="captions"||e.kind==="subtitles")&&e.mode==="showing");let e;let t;if(!n.length){for(t=0;t{if(e){a.addClass("vjs-audio-mode")}else{a.removeClass("vjs-audio-mode")}};const q=e=>{const i=a.getChild("PosterImage").el_.style;const t=()=>{const e=a.getChild("ControlBar");const t=e&&e.currentHeight();i.paddingBottom=`${t}px`;i.backgroundOrigin="content-box"};if(e){a.one("play",t)}else{a.off("play",t);i.paddingBottom="";i.backgroundOrigin=""}};a.on("loadedmetadata",()=>{const e=a.currentSource().type.includes("audio");const t=a.audioPosterMode();const i=a.audioOnlyMode();if(!n.audioPosterMode&&!n.audioOnlyMode&&e&&!b||!t&&!i&&e&&b){a.audioPosterMode(true)}else if(!e&&t&&b){a.audioPosterMode(false)}b=true});a.on("audiopostermodechange",()=>{const e=a.audioPosterMode();const t=a.audioOnlyMode();if(e){q(true);_(true)}else if(!t&&!e){q(false);_(false)}});a.on("audioonlymodechange",()=>{const e=a.audioPosterMode();const t=a.audioOnlyMode();if(t){const i=a.currentHeight();const s=a.getChild("ControlBar");const n=s&&s.getChild("ProgressControl");const r=n?n.currentHeight():0;_(true);a.height(i+r)}else if(!t&&!e){_(false)}});if(n.videoCloud&&n.videoCloud.bumper){const O=a.getChild("ControlBar");const P=O.getChild("ProgressControl");const L=n.videoCloud.bumper;a.on("bumper-play",()=>{if(L.preventSeeking){P.disable()}const e=O.getChild("NextButton");if(e){e.hide()}a.addClass("vjs-bumper-video")});a.on("bumper-ended",()=>{if(L.preventSeeking){P.enable()}const e=O.getChild("NextButton");if(e){e.show()}a.removeClass("vjs-bumper-video")})}const V=e.environment&&e.environment.queryString||{};let T;const H=i=>{if(n.viewerId){T=n.viewerId;i();return}if(n.viewerIdSource){const s=n.viewerIdSource;let e;let t;switch(s.source){case"eloqua":t=ho("ELOQUA");T=W.getEloquaGuid(t);if(!T){e=s.endpoint+"/visitor/v200/svrGP.aspx?pps=70&siteid="+s.site+"&ms="+(new Date).getMilliseconds();W.loadScript(e,()=>{if(typeof GetElqCustomerGUID==="function"){T=GetElqCustomerGUID();i()}})}else{i()}break;case"hubspot":if(tv._hsq){T=ho("hubspotutk");i()}else{e="//js.hs-scripts.com/"+s.accountId+".js";W.loadScript(e,()=>{T=ho("hubspotutk");i()})}break;case"marketo":e="//munchkin.marketo.net/munchkin.js";W.loadScript(e,()=>{if(tv.Munchkin&&typeof tv.Munchkin.init==="function"){tv.Munchkin.init(s.accountId,{domainLevel:W.getMarketoDomainLevel()});t=ho("_mkto_trk");T=t.split(":").pop();i()}});break;case"salesforce":T=Pl(tv,n.bcsfid);if(!T){T=G.qs().search.bcsfid||a.el().getAttribute("data-bc-sfid")}i();break;case"adobe":T=ho("s_vi");i();break;case"sailthru":e="//ak.sail-horizon.com/spm/spm.v1.min.js";W.loadScript(e,()=>{T=ho("sailthru_sid");i()});break;case"gtag":e=`https://www.googletagmanager.com/gtag/js?id=${s.tagId}`;W.loadScript(e,()=>{if(typeof tv.gtag==="function"){tv.gtag("get",s.tagId,"client_id",e=>{T=e;i()})}});break;case"braze":e="//js.appboycdn.com/web-sdk/5.0/braze.min.js";W.loadScript(e,()=>{if(typeof appboy.initialize==="function"){appboy.initialize(s.apiKey);T=appboy.getUser().getUserId();i()}});break}}};const{bcShimDestripeTime:S}=r;if(S!==undefined){if(S>1){a.trigger({type:"usage",name:"sdt-"+(Math.log(S)/Math.LN10).toFixed(1)})}else{a.trigger({type:"usage",name:"sdt-0.0"})}}a.ready(function(){if(a.bcinfo&&a.bcinfo.PLAYER_LOADER||r.brightcovePlayerLoader){a.trigger({type:"usage",name:"player-loader"})}if(a.bcinfo&&a.bcinfo.REACT_PLAYER_LOADER||r.BrightcoveReactPlayerLoader){a.trigger({type:"usage",name:"react-player-loader"})}});const{debug:E}=a.options_;if(E){a.log.level("debug");a.log.history.enable()}else{a.log.level("off");a.log.history.disable()}const w={accountId:o,applicationId:l,embedId:c,mr:Boolean(tv.bc_isManagedRelease),playerId:u,playerName:B,playerVersionLocked:U,platformVersion:M,verbose:Boolean(E)};if(f){w.analyticsUrl=`//${f}/v2/tracker`}if(v){w.env=v}if(h){if(h.analyticsUrl){w.analyticsUrl=h.analyticsUrl}if(h.env){w.env=h.env}if(h.hasOwnProperty("verbose")){w.verbose=Boolean(h.verbose)}if(h.requires_consent){w.requiresConsent=true}if(h.hasOwnProperty("native_qoe")){w.nativeQoe=Boolean(h.native_qoe)}}["referrer","usage","user"].forEach(e=>{if(V[e]){w[e]=V[e]}});const k={accountId:o,policyKey:d&&d.policyKey};if(d&&d.streamConcurrency){k.streamConcurrency=d.streamConcurrency;k.maxRetry=d.maxRetry;k.intervalRetry=d.intervalRetry}if(f){k.baseUrl=`//${f}/playback/v1`}else if(d&&d.baseUrl){k.baseUrl=d.baseUrl}if(v){k.env=v}if(d&&d.sourceSelectionRules){k.sourceSelectionRules=d&&d.sourceSelectionRules}if(m){k.watermarkingToken=m}if(g){k.tveToken=g}if(d&&typeof d.allowPlayreadyInChromiumEdge==="boolean"){k.allowPlayreadyInChromiumEdge=d.allowPlayreadyInChromiumEdge}const j=[{name:"bcAnalytics",register:Ms,opts:w},{name:"catalog",register:Hn,opts:k},{name:"proxyTracks",register:Yn,opts:{debug:E}},{name:"seekEvents",register:er,opts:{verbose:E}},{name:"touchActive",register:tr},{name:"urlparams",register:hi,opts:{iframe:r.isInBcFrame,time:n.startTime}},{name:"playerInfo",register:ur},{name:"endscreen",register:dr},{name:"encryptedWatcher",register:Qn}];const C=e.settings.contextMenu;if(C!==false){const R=[{label:a.localize("Player Information"),listener:()=>a.usingPlugin("playerInfo")&&a.playerInfo.modal.open()}];if(G.isObj(C)&&C.brightcoveBranding!==false){R.push({href:"https://www.brightcove.com/en/why-brightcove?utm_type=player",label:a.localize("About Brightcove")})}j.push({name:"contextmenuUI",opts:{content:R}})}if(p!==false){j.push({name:"viewability",register:Va,opts:p?p:{}})}const $=tv.cast&&tv.cast.receiver;const z=["mp4","transcript"].includes(n.downloadButton);if(z&&!$){j.push({name:"downloadButton",register:so,opts:{type:n.downloadButton}})}j.forEach(function({name:e,opts:t,register:i}){if(!a.hasPlugin(e)){i(s)}if(!a.usingPlugin(e)){a[e](t)}});La(s);a.eme();({catalogMedia:y}=oo(s,a,e));H(()=>{a.bcAnalytics.client.user(T);a.playerInfo()});a.on("dispose",()=>{a=i.runtime_=null;s.log.history.clear()})}function Nl(n,r,a){const{videojs:o}=n;let l=-1;return function e(t){const i=o.getPlayer(t);if(i){i.trigger({type:"usage",name:"bc-used-as-getter"});return i}l++;const s=n.getRuntime({playerIndex:l});o.hookOnce("beforesetup",(e,t)=>{t=Jt(o,s,e,t);if(G.isFn(r)){return r(o,s,e,t)}return t});o.hookOnce("setup",e=>{Rl(o,s,e,n);if(G.isFn(a)){a(o,s,e)}});return o(...arguments)}}const Ml={accountId:"",adConfigId:"",applicationId:"",playsinline:false,loop:false,muted:false,autoplay:false,crossorigin:false,css:{},plugins:[],debug:false,contextMenu:{},deliveryConfigId:"",embedId:"default",misconfiguredWithMultipleAdPlugins:false,playerId:"default",skin:"luna",usingAdFailover:false,usingIMAPrerollWithSSAI:false,version:"0.0.0",videoCloud:null,playerVersionLocked:false,multilingualMetadataTracksDisabled:false};const Ul={brightcovePlayerLoader:tv.brightcovePlayerLoader,BrightcoveReactPlayerLoader:tv.BrightcoveReactPlayerLoader,bcShimDestripeTime:tv.bcShimDestripeTime,userAgent:tv.navigator.userAgent};class S{constructor(e={},t={}){const{videojs:i}=S.shared;if(!i){throw new Error("missing videojs")}this.runtime={environment:i.obj.merge(Ul,t),settings:i.obj.merge(Ml,e)};if(this.runtime.settings.misconfiguredWithMultipleAdPlugins){i.log.warn('Brightcove Player "'+this.runtime.settings.playerId+'" is mis-configured with multiple ad plugins.')}this.videojs=i;this.util=G;i.bc_=G;this.detectRuntimeEnvironment();this.setupGlobalEnv();G.perf.mark("bcAdBlockDetectStart");K().then(function(e){G.perf.mark("bcAdBlockDetectEnd");G.perf.measure("bcAdBlockDetect","bcAdBlockDetectStart","bcAdBlockDetectEnd")})}getRuntime(e){return this.videojs.obj.merge(this.runtime,{settings:e})}getAutoplayConditions(t="video"){const{environment:i}=this.runtime;if(!i.autoplay){i.autoplay={}}return Je(t,this.videojs).then(e=>{i.autoplay[t]=e;return e})}detectRuntimeEnvironment(){const{dom:e}=this.videojs;const{environment:t}=this.runtime;const i=e.hasClass(iv.documentElement,"bc-iframe");const s=G.qs();t.usingRequireJs=G.isFn(tv.define)&&tv.define.amd&&G.isFn(tv.require&&tv.require.toUrl);t.isInAnyFrame=e.isInFrame();t.isInBcFrame=i;t.queryString=i?s.search:{};t.urlHash=i?s.hash:{};this.setScriptUrl();this.setScriptBaseUrl()}setScriptUrl(){const{environment:e}=this.runtime;if(e.isInBcFrame){e.scriptUrl=""}else if(e.usingRequireJs){e.scriptUrl=tv.require.toUrl("bc")}else if(iv.currentScript){e.scriptUrl=iv.currentScript.src}else{const t=iv.getElementsByTagName("script");e.scriptUrl=t.length&&t[t.length-1].src||""}}setScriptBaseUrl(){const{environment:e}=this.runtime;if(e.scriptUrl){e.scriptBaseUrl=e.scriptUrl.split("/").slice(0,-1).join("/")}else{e.scriptBaseUrl="."}}safeSetGlobal(e,t){if(!G.isNil(tv[e])){return this.videojs.log.warn("setting window."+e+" would overwrite an existing global, skipping")}tv[e]=t}setupGlobalEnv(){const{videojs:e}=this;const{environment:t}=this.runtime;const{queryStringToWindow:i}=t;if(!i||!t.isInBcFrame){return}const s=e.obj.merge(t.queryString);if(i.target){this.safeSetGlobal(i.target,s)}if(Array.isArray(i.globals)){i.globals.forEach(e=>{this.safeSetGlobal(e,s[e])})}}createInitializer(e,t){const{videojs:i}=this;const{bc:s}=tv;const{embedId:n,playerId:r,skin:a,version:o}=this.runtime.settings;const l=Nl(this,e,t);l.SKIN=a;l.VERSION=o;l.videojs=i;l[`${r}_${n}`]=l;if(s){Object.keys(s).forEach(e=>{const t=s[e];if(typeof t==="function"&&typeof t.videojs==="function"){l[e]=t;delete s[e]}})}Object.defineProperty(l,"usingAdBlocker",{enumerable:true,value:K});Object.defineProperty(l,"getAutoplayConditions",{enumerable:true,value:e=>this.getAutoplayConditions(e)});tv.bc=l;return l}static dedupeVideojs(t,e){let i=t;S.shared.firstVideojs=e||t;if(e&&e.VERSION===t.VERSION){i=e}else if(tv.bc){const s=Object.keys(tv.bc);for(let e=0;en.indexOf(e)>-1;const l=e=>e.usingPlugin("ads")&&typeof e.ads.inAdBreak==="function";const d=(e,t)=>{if(!e.usingPlugin("ads")){return false}if(l(e)){return e.ads.isInAdMode()&&t.type!=="loadstart"}return r(e.ads.state)};const h=function(){const l=[];let s;let t=false;let n;let r=true;const e=o=>{return function(e,t){if(this.perSourceBehaviors.disabled()){return}const i=arguments.length===2;const s=this.currentSrc();const n=[e];const r=c["default"].bind(i?this:e,arguments[arguments.length-1]);const a=(...e)=>{const t=this.currentSrc()!==s;if(this.perSourceBehaviors.disabled()){return}if(t||o){this.off(...n)}if(!t){r(...e)}};a.guid=r.guid;if(!i){n.push(t)}n.push(a);l.push(n);return this.on(...n)}};this.perSourceBehaviors={disable:c["default"].bind(this,function e(){this.clearTimeout(n);n=null;t=true;return t}),disabled(){return t},enable(){t=false;return t},enabled(){return!t},isSrcStable(){return r},VERSION:i};this.onPerSrc=e();this.onePerSrc=e(true);this.on("dispose",()=>{l.length=0});this.on(o,e=>{if(this.perSourceBehaviors.disabled()||n||d(this,e)){return}if(r&&u.indexOf(e.type)>-1){r=false;this.trigger("sourceunstable")}const t=[];const i=e=>t.push({time:Date.now(),event:e});i(e);this.on(a.Events,i);n=this.setTimeout(()=>{const e=this.currentSrc();r=true;n=null;this.off(a.Events,i);if(e&&e!==s){l.forEach(e=>this.off(...e));l.length=0;this.trigger("sourcechanged",{interimEvents:t,from:s,to:e});s=e}},1)})};h.VERSION=i;s("perSourceBehaviors",h);return h})})();(function(){if(n.getPlugin("errors")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsErrors=t(e.videojs))})(this,function(e){"use strict";function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var m=t(e);var g="6.1.0";const v=m["default"].obj&&m["default"].obj.merge||m["default"].merge;const i=!m["default"].browser.IS_IPHONE;const s=m["default"].registerPlugin||m["default"].plugin;const y={header:"",code:"",message:"",timeout:45*1e3,backgroundTimeout:300*1e3,dismiss:i,errors:{1:{type:"MEDIA_ERR_ABORTED",headline:"The video download was cancelled"},2:{type:"MEDIA_ERR_NETWORK",headline:"The video connection was lost, please confirm you are "+"connected to the internet"},3:{type:"MEDIA_ERR_DECODE",headline:"The video is bad or in a format that cannot be played on your browser"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED",headline:"This video is either unavailable or not supported in this browser"},5:{type:"MEDIA_ERR_ENCRYPTED",headline:"The video you are trying to watch is encrypted and we do not know how "+"to decrypt it"},unknown:{type:"MEDIA_ERR_UNKNOWN",headline:"An unanticipated problem was encountered, check back soon and try again"},"-1":{type:"PLAYER_ERR_NO_SRC",headline:"No video has been loaded"},"-2":{type:"PLAYER_ERR_TIMEOUT",headline:"It looks like you're having playback issues. Reloading the video may help."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"This video is restricted from playing on your current domain"},PLAYER_ERR_IP_RESTRICTED:{headline:"This video is restricted at your current IP address"},PLAYER_ERR_GEO_RESTRICTED:{headline:"This video is restricted from playing in your current geographic region"}}};const b=function(d,h){let i;let s;let n;const r=[];const t=function(e){h.errors=v(h.errors,e);Object.keys(h.errors).forEach(e=>{const t=h.errors[e];if(!t.type){t.type=e}})};t();const a=function(){if(d.error()&&d.error().code===-2){d.error(null)}d.clearTimeout(s);d.clearTimeout(i);if(n){n=false;d.removeClass("vjs-waiting")}const e=[Infinity,-1];const t=(e,t)=>e.indexOf(t)!==-1;if(iv.visibilityState==="hidden"&&(d.muted()||t(e,h.backgroundTimeout))||iv.visibilityState==="visible"&&t(e,h.timeout)){return}s=d.setTimeout(function(){if(d.error()||d.paused()||d.ended()){return}n=true;d.addClass("vjs-waiting")},1e3);i=d.setTimeout(function(){if(d.error()||d.paused()||d.ended()){return}d.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},iv.visibilityState==="hidden"?h.backgroundTimeout:h.timeout)};const e=function(){let e;while(r.length){e=r.shift();d.off(e[0],e[1])}d.clearTimeout(i);d.clearTimeout(s)};const o=function(e,t){const i=function(){if(!d.error()){if(d.paused()){return a()}if(d.ended()){return a()}}t.call(this)};d.on(e,i);r.push([e,i])};const f=function(){let t=0;e();a();o(["timeupdate","adtimeupdate"],function(){const e=d.currentTime();if(e!==t){t=e;a()}});d.off(iv,"visibilitychange",f);d.on(iv,"visibilitychange",f)};const l=function(){if(!d.currentSrc()){d.error({code:-1,type:"PLAYER_ERR_NO_SRC"})}};const c=function(){let e="";let t=d.error();const i=iv.createElement("div");let s="";if(!t){return}d.off(iv,"visibilitychange",f);t=m["default"].mergeOptions(t,h.errors[t.code||t.type||0]);if(t.message){e=`
${d.localize("Technical details")} + :
${d.localize(t.message)}
+
`}const n=d.getChild("errorDisplay");i.className="vjs-errors-dialog";const r=`
${this.localize("Error Code")}: ${t.type||t.code}
`;const a=t.code===-2;s=`
+

${this.localize(t.headline)}

+ ${a?"":r} + ${a?"":e} +
`;const o=n.closeable(!("dismiss"in t)||t.dismiss);if(a){s+=`
+ + +
`;i.innerHTML=s;n.fillWith(i);n.getChild("closeButton").hide();const l=n.el().querySelector(".vjs-errors-timeout-button-container > button:first-child");const c=n.el().querySelector(".vjs-errors-timeout-button-container > button:last-child");d.on(l,"click",function(){const e=d.currentSource();d.reset();d.src(e)});d.on(c,"click",function(){n.close()});n.one("modalclose",()=>{d.off(l);d.off(c)})}else if(o){s+=`
+ +
`;i.innerHTML=s;n.fillWith(i);n.contentEl().firstChild.appendChild(n.getChild("closeButton").el());const u=n.el().querySelector(".vjs-errors-ok-button");d.on(u,"click",function(){n.close()})}else{i.innerHTML=s;n.fillWith(i)}if(d.currentWidth()<=600||d.currentHeight()<=250){n.addClass("vjs-xs")}n.one("modalclose",()=>d.error(null))};const u=function(){e();d.removeClass("vjs-errors");d.off("play",f);d.off(iv,"visibilitychange",f);d.off("play",l);d.off("dispose",u);d.off(["aderror","error"],c)};const p=function(e){u();b(d,m["default"].mergeOptions(y,e))};p.extend=e=>t(e);p.getAll=()=>m["default"].mergeOptions(h.errors);p.timeout=function(e){if(typeof e==="undefined"){return h.timeout}if(e!==h.timeout){h.timeout=e;if(!d.paused()){f()}}};p.backgroundTimeout=function(e){if(typeof e==="undefined"){return h.backgroundTimeout}if(e!==h.backgroundTimeout){h.backgroundTimeout=e;if(!d.paused()){f()}}};p.disableProgress=()=>{};d.on("play",f);d.on("play",l);d.on("dispose",u);d.on(["aderror","contenterror","error"],c);d.ready(()=>{d.addClass("vjs-errors")});if(!d.paused()){f()}p.VERSION=g;d.errors=p};const n=function(e){b(this,m["default"].mergeOptions(y,e))};["extend","getAll"].forEach(e=>{n[e]=function(){m["default"].log.warn(`The errors.${e}() method is not available until the plugin has been initialized!`)}});n.VERSION=g;s("errors",n);return n})})();(function(){if(n.getPlugin("thumbnails")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsThumbnails=t(e.videojs))})(this,function(e){"use strict";function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var d=t(e);const i=d["default"].getComponent("Component");class s extends i{constructor(e,t){super(e,t);this.isImageLoading_=false}createEl(){const e=super.createEl("div",{className:"vjs-thumbnail-display"});this.imageEl_=d["default"].dom.createEl("img",{className:"vjs-thumbnail-image",style:"display: none;"});e.appendChild(this.imageEl_);return e}setThumbnailImage(e){if(!e||this.isImageLoading_){return}this.imageEl_.onload=()=>{this.isImageLoading_=false;if(!this.imageEl_.naturalWidth||!this.imageEl_.naturalHeight){this.imageEl_.style.display="none";return}const e=this.imageEl_.naturalWidth/this.imageEl_.naturalHeight;this.el_.style.height=`${Math.round(150/e)}px`;if(this.imageEl_.style.display==="none"){this.imageEl_.style.display="block"}};this.imageEl_.onerror=()=>{this.isImageLoading_=false;this.imageEl_.style.display="none"};this.imageEl_.src=e;this.isImageLoading_=true}updatePosition(e){const t=d["default"].dom.getBoundingClientRect(this.el_);const i=t.width/2;const s=this.player_.getChild("ControlBar");if(!s){return}const n=s.getChild("ProgressControl");if(!n){return}const r=n.getChild("seekBar");if(!r){return}const a=d["default"].dom.getBoundingClientRect(r.el());const o=a.width*e;const l=r.getChild("MouseTimeDisplay");if(!l){return}const c=d["default"].dom.getBoundingClientRect(l.el());const u=d["default"].dom.getBoundingClientRect(this.player_.el());if(c.left+i>=u.right-5){this.el_.style.left=`${u.width-t.width-2}px`;return}else if(c.right-i<=u.left+5){this.el_.style.left="2px";return}this.el_.style.left=`${o-Math.round(i)}px`}}i.registerComponent("ThumbnailDisplay",s);var n="2.0.0";const r=d["default"].getPlugin("plugin");const a=30;const o=function(i,s){let n=tv.performance.now();const e=function(...e){const t=tv.performance.now();if(t-n>=s){i(...e);n=t}};return e};const l={};class c extends r{constructor(e,t){super(e);this.options=d["default"].mergeOptions(l,t);this.metadataTrackEl_=null;this.thumbnailComponent_=null;this.currentThumbnail_=null;this.throttledHandleMouseMove=o(this.handleMouseMove.bind(this),30);this.player.ready(()=>{this.player.addClass("vjs-thumbnails");const n=this.player.textTracks();n.addEventListener("removetrack",()=>{if(!this.player){return}if(!this.metadataTrackEl_){return}for(let e=0;e{if(this.metadataTrackEl_){return}this.metadataTrackEl_=this.getThumbnailsTrackEl();if(!this.metadataTrackEl_){return}this.metadataTrackEl_.track.mode="hidden";this.metadataTrackEl_.addEventListener("load",()=>{if(!(this.metadataTrackEl_.track.cues&&this.metadataTrackEl_.track.cues.length)){d["default"].log.warn("Unable to parse cues out of thumbnail vtt file.");return}if(d["default"].browser.IS_IOS||d["default"].browser.IS_ANDROID){return}const e=this.player.options_.runtime_.settings;const t=e.videoCloud&&e.videoCloud.bumper;const i=this.player.mediainfo;if(t&&(t.id===i.id||t.id===`ref:${i.referenceId}`)){return}if(this.player.hasClass("vjs-ssai-enabled")){this.adjustCueTimingForSSAI(this.metadataTrackEl_.track.cues)}const s=()=>{this.filterThumbnailsBasedOnPlayerWidth(this.metadataTrackEl_.track);this.preloadThumbnailImages(this.metadataTrackEl_.track.cues);this.setupThumbnailScrubbing()};if(this.player.readyState()>=1){s()}else{this.player.one("loadedmetadata",s)}})})})}filterThumbnailsBasedOnPlayerWidth(i){const e=this.player.currentWidth()||640;const s=Math.round(e/a)||1;const n=Math.floor(i.cues.length/s)-1;if(n<1){return}for(let t=0;t0){if(i.cues.length>s&&i.cues[t+1]){i.removeCue(i.cues[t+1])}e--}}for(let e=0;e=i.startTime&&t<=i.endTime&&i.text!==this.currentThumbnail_){this.thumbnailComponent_.setThumbnailImage(i.text);this.currentThumbnail_=i.text;break}}this.thumbnailComponent_.updatePosition(e)}}}c.defaultState={};c.VERSION=n;d["default"].registerPlugin("thumbnails",c);return c})})();(function(){if(n.getPlugin("bcPlaylistUi")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js"),require("@brightcove/loscore")):typeof i==="function"&&i.amd?i(["video.js","@brightcove/loscore"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsBcPlaylistUi=t(e.videojs,e.videojs.bc_))})(this,function(e,t){"use strict";function i(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var m=i(e);var n=i(t);var s="4.0.1";const r=e=>typeof e==="number"&&!isNaN(e)&&e>=0&&e{const t=e.playlist.autoadvance_;if(t.timeout){e.clearTimeout(t.timeout)}if(t.trigger){e.off("ended",t.trigger)}t.timeout=null;t.trigger=null};const c=(t,i)=>{l(t);if(!r(i)){t.playlist.autoadvance_.delay=null;return}t.playlist.autoadvance_.delay=i;t.playlist.autoadvance_.trigger=function(){const e=()=>c(t,i);t.one("play",e);t.playlist.autoadvance_.timeout=t.setTimeout(()=>{l(t);t.off("play",e);t.playlist.next()},i*1e3)};t.one("ended",t.playlist.autoadvance_.trigger)};const a=e=>{const t=e.remoteTextTracks();let i=t&&t.length||0;while(i--){e.removeRemoteTextTrack(t[i])}};const u=(t,i)=>{const s=!t.paused()||t.ended();t.trigger("beforeplaylistitem",i.originalValue||i);if(i.playlistItemId_){t.playlist.currentPlaylistItemId_=i.playlistItemId_}t.poster(i.poster||"");t.src(i.sources);a(t);t.ready(()=>{(i.textTracks||[]).forEach(t.addRemoteTextTrack.bind(t));t.trigger("playlistitem",i.originalValue||i);if(s){const e=t.play();if(typeof e!=="undefined"&&typeof e.then==="function"){e.then(null,e=>{})}}c(t,t.playlist.autoadvance_.delay)});return t};const d=e=>{return!!e&&typeof e==="object"};const h=e=>{const t=[];let i;e.forEach(e=>{if(!d(e)){i=Object(e);i.originalValue=e}else{i=e}t.push(i)});return t};const f=e=>{let t=1;e.forEach(e=>{e.playlistItemId_=t++})};const N=(t,i)=>{for(let e=0;e{let i=e;let s=t;if(typeof e==="object"){i=e.src}if(typeof t==="object"){s=t.src}if(/^\/\//.test(i)){s=s.slice(s.indexOf("//"))}if(/^\/\//.test(s)){i=i.slice(i.indexOf("//"))}return i===s};const p=(e,i)=>{for(let t=0;t{let t=-1;const i=e.length-1;while(++t{if(a){throw new Error("do not call playlist() during a playlist change")}if(Array.isArray(e)){const i=Array.isArray(r)?r.slice():null;const s=e.slice();r=s.slice();if(r.filter(e=>d(e)).length!==r.length){r=h(r)}f(r);a=true;n.trigger({type:"duringplaylistchange",nextIndex:t,nextPlaylist:s,previousIndex:o.currentIndex_,previousPlaylist:i||[]});a=false;if(t!==-1){o.currentItem(t)}if(i){n.setTimeout(()=>{n.trigger("playlistchange")},0)}}return r.map(e=>e.originalValue||e).slice()};n.on("loadstart",()=>{if(o.currentItem()===-1){l(n)}});o.currentIndex_=-1;o.player_=n;o.autoadvance_={};o.repeat_=false;o.currentPlaylistItemId_=null;o.currentItem=e=>{if(a){return o.currentIndex_}if(typeof e==="number"&&o.currentIndex_!==e&&e>=0&&e0){n.poster("")}return o.currentIndex_}const t=o.player_.currentSrc()||"";if(o.currentPlaylistItemId_){const i=N(r,o.currentPlaylistItemId_);const s=r[i];if(s&&Array.isArray(s.sources)&&p([s],t)>-1){o.currentIndex_=i;return o.currentIndex_}o.currentPlaylistItemId_=null}o.currentIndex_=o.indexOf(t);return o.currentIndex_};o.contains=e=>{return o.indexOf(e)!==-1};o.indexOf=e=>{if(typeof e==="string"){return p(r,e)}const t=Array.isArray(e)?e:e.sources;for(let e=0;eo.currentItem();o.lastIndex=()=>r.length-1;o.nextIndex=()=>{const e=o.currentItem();if(e===-1){return-1}const t=o.lastIndex();if(o.repeat_&&e===t){return 0}return Math.min(e+1,t)};o.previousIndex=()=>{const e=o.currentItem();if(e===-1){return-1}if(o.repeat_&&e===0){return o.lastIndex()}return Math.max(e-1,0)};o.first=()=>{if(a){return}const e=o.currentItem(0);if(r.length){return r[e].originalValue||r[e]}o.currentIndex_=-1};o.last=()=>{if(a){return}const e=o.currentItem(o.lastIndex());if(r.length){return r[e].originalValue||r[e]}o.currentIndex_=-1};o.next=()=>{if(a){return}const e=o.nextIndex();if(e!==o.currentIndex_){const t=o.currentItem(e);return r[t].originalValue||r[t]}};o.previous=()=>{if(a){return}const e=o.previousIndex();if(e!==o.currentIndex_){const t=o.currentItem(e);return r[t].originalValue||r[t]}};o.autoadvance=e=>{c(o.player_,e)};o.repeat=e=>{if(e===undefined){return o.repeat_}if(typeof e!=="boolean"){m["default"].log.error("videojs-playlist: Invalid value for repeat",e);return}o.repeat_=!!e;return o.repeat_};o.sort=e=>{if(!r.length){return}r.sort(e);if(a){return}n.trigger("playlistsorted")};o.reverse=()=>{if(!r.length){return}r.reverse();if(a){return}n.trigger("playlistsorted")};o.shuffle=({rest:e}={})=>{let t=0;let i=r;if(e){t=o.currentIndex_+1;i=r.slice(t)}if(i.length<=1){return}U(i);if(e){r.splice(...[t,i.length].concat(i))}if(a){return}n.trigger("playlistsorted")};if(Array.isArray(e)){o(e.slice(),t)}else{r=[]}return o}var F="5.0.1";const q=m["default"].registerPlugin||m["default"].plugin;const o=function(e,t){B(this,e,t)};q("playlist",o);o.VERSION=F;var V="4.0.0";const g=m["default"].dom||m["default"];const H=m["default"].registerPlugin||m["default"].plugin;const $=function(i,s){for(let e=0,t=i.length;e{const e=iv.createElement("x");e.style.cssText="pointer-events:auto";return e.style.pointerEvents==="auto"})();const G={className:"vjs-playlist",playOnSelect:false,supportsCssPointerEvents:z};const v=function(e){e.addClass("vjs-selected")};const y=function(e){e.removeClass("vjs-selected");if(e.thumbnail){g.removeClass(e.thumbnail,"vjs-playlist-now-playing")}};const K=function(e){e.addClass("vjs-up-next")};const b=function(e){e.removeClass("vjs-up-next")};const W=function(t){if(!t){const e=iv.createElement("div");e.className="vjs-playlist-thumbnail vjs-playlist-thumbnail-placeholder";return e}const i=iv.createElement("picture");i.className="vjs-playlist-thumbnail";if(typeof t==="string"){const s=iv.createElement("img");s.src=t;s.alt="";i.appendChild(s)}else{for(let e=0;e{const t=s.data[e];i.dataset[e]=t})}i.className="vjs-playlist-item";i.setAttribute("tabIndex",0);this.thumbnail=W(s.thumbnail);i.appendChild(this.thumbnail);if(s.duration){const d=iv.createElement("time");const h=m["default"].formatTime(s.duration);d.className="vjs-playlist-duration";d.setAttribute("datetime","PT0H0M"+s.duration+"S");d.appendChild(iv.createTextNode(h));i.appendChild(d)}const t=iv.createElement("span");const n=this.localize("Now Playing");t.className="vjs-playlist-now-playing-text";t.appendChild(iv.createTextNode(n));t.setAttribute("title",n);this.thumbnail.appendChild(t);const r=iv.createElement("div");r.className="vjs-playlist-title-container";this.thumbnail.appendChild(r);const a=iv.createElement("span");const o=this.localize("Up Next");a.className="vjs-up-next-text";a.appendChild(iv.createTextNode(o));a.setAttribute("title",o);r.appendChild(a);const l=iv.createElement("cite");const c=s.name||this.localize("Untitled Video");l.className="vjs-playlist-name";l.appendChild(iv.createTextNode(c));l.setAttribute("title",c);r.appendChild(l);if(e){const f=iv.createElement("div");const p=s.description||"";f.className="vjs-playlist-description";f.appendChild(iv.createTextNode(p));f.setAttribute("title",p);r.appendChild(f)}return i}}class S extends _{constructor(e,t){if(!e.playlist){throw new Error("videojs-playlist is required for the playlist component")}super(e,t);this.items=[];if(t.horizontal){this.addClass("vjs-playlist-horizontal")}else{this.addClass("vjs-playlist-vertical")}if(t.supportsCssPointerEvents){this.addClass("vjs-csspointerevents")}this.createPlaylist_();if(!m["default"].browser.TOUCH_ENABLED){this.addClass("vjs-mouse")}this.on(e,["loadstart","playlistchange","playlistsorted"],e=>{this.update()});this.on(e,"adstart",()=>{this.addClass("vjs-ad-playing")});this.on(e,"adend",()=>{this.removeClass("vjs-ad-playing")});this.on("dispose",()=>{this.empty_();e.playlistMenu=null});this.on(e,"dispose",()=>{this.dispose()})}createEl(){return g.createEl("div",{className:this.options_.className})}empty_(){if(this.items&&this.items.length){this.items.forEach(e=>e.dispose());this.items.length=0}}createPlaylist_(){const t=this.player_.playlist()||[];let i=this.el_.querySelector(".vjs-playlist-item-list");let e=this.el_.querySelector(".vjs-playlist-ad-overlay");if(!i){i=iv.createElement("ol");i.className="vjs-playlist-item-list";this.el_.appendChild(i)}this.empty_();for(let e=0;e=0){v(this.items[s]);const r=this.items[s].$(".vjs-playlist-thumbnail");if(r){g.addClass(r,"vjs-playlist-now-playing")}}}update(){const t=this.player_.playlist();if(this.items.length!==t.length){this.createPlaylist_();return}for(let e=0;e{for(let e=0;e{const t=iv.querySelectorAll("."+e);let i;for(let e=0;e