/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
var aa,ca=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};function da(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var ea=da(this);
function fa(a,b){if(b)a:{var c=ea;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&b!=null&&ca(c,a,{configurable:!0,writable:!0,value:b})}}fa("Promise.withResolvers",function(a){return a?a:function(){var b,c;return{promise:new Promise(function(d,e){b=d;c=e}),resolve:b,reject:c}}});var ha=this||self;
function w(a,b){a=a.split(".");var c=ha;a[0]in c||typeof c.execScript=="undefined"||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||b===void 0?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
function ia(a){return a.h/(1-Math.pow(a.g,a.j))}var ja=class{constructor(a){this.i=Math.log(.5);this.g=Math.exp(this.i/a);this.j=this.h=0}sample(a,b){const c=Math.pow(this.g,a);b=b*(1-c)+c*this.h;isNaN(b)||(this.h=b,this.j+=a)}};var ka=class{constructor(){this.h=new ja(2);this.j=new ja(5);this.g=0;this.i=128E3;this.l=16E3}configure(a){this.i=a.minTotalBytes;this.l=a.minBytes;var b=this.h;b.g=Math.exp(b.i/a.fastHalfLife);b=this.j;b.g=Math.exp(b.i/a.slowHalfLife)}sample(a,b){if(!(b<this.l)){var c=8E3*b/a;a/=1E3;this.g+=b;this.h.sample(a,c);this.j.sample(a,c)}}getBandwidthEstimate(a){return this.g<this.i?a:Math.min(ia(this.h),ia(this.j))}};function la(){}function ma(){}function na(a,...b){oa.has(a)||(oa.add(a),ma(...b))}function pa(){}function qa(){}function ra(){}var oa=new Set;window.console&&((new Map).set(1,(...a)=>console.error(...a)).set(2,(...a)=>console.warn(...a)).set(3,(...a)=>console.info(...a)).set(4,(...a)=>console.log(...a)).set(5,(...a)=>console.debug(...a)).set(6,(...a)=>console.debug(...a)),ma=(...a)=>{console.warn(...a)},la=(...a)=>{console.error(...a)});function sa(a,b){return typeof a==="number"&&typeof b==="number"&&isNaN(a)&&isNaN(b)?!0:a===b}function ua(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1)}function va(a,b,c){c||=sa;if(a.length!=b.length)return!1;b=b.slice();for(const d of a){a=b.findIndex(e=>c(d,e));if(a==-1)return!1;b[a]=b[b.length-1];b.pop()}return b.length==0}function xa(a,b){const c=[],d=[];for(const e of a)b(e)?c.push(e):d.push(e);return[c,d]}function ya(a,b){let c=0,d=a.length;for(;c<d;){const e=c+d>>>1;b(a[e])?c=e+1:d=e}return c}
function za(a,b,c){if(a===b)return!0;if(!a||!b)return a==b;c||=sa;if(a.length!=b.length)return!1;for(let d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};var Aa=class{constructor(){this.g=new Map}push(a,b){this.g.getOrInsertComputed(a,()=>[]).push(b)}get(a){return this.g.has(a)?this.g.get(a).slice():null}remove(a,b){if(this.g.has(a)){var c=this.g.get(a).filter(d=>d!=b);this.g.set(a,c);c.length||this.g.delete(a)}}forEach(a){this.g.forEach((b,c)=>{a(c,b)})}size(){return this.g.size}keys(){return Array.from(this.g.keys())}};var Ca=class{constructor(){this.g=new Aa}release(){this.xa();this.g=null}F(a,b,c,d){this.g&&(a=new Ba(a,b,c,d),this.g.push(b,a))}na(a,b,c,d){const e=f=>{this.Ma(a,b,e);c(f)};this.F(a,b,e,d)}Pb(a,b,c,d){if(this.g)for(const e of b)this.F(a,e,c,d)}Fi(a,b,c,d){if(this.g){var e=!1,f=g=>{if(!e){e=!0;for(const h of b)this.Ma(a,h,f);c(g)}};for(const g of b)this.F(a,g,f,d)}}Ma(a,b,c){if(this.g){var d=this.g.get(b)||[];for(const e of d)e.target!=a||c!=e.listener&&c||(e.Ma(),this.g.remove(b,e))}}xa(){if(this.g){var a=
this.g;const b=[];for(const c of a.g.values())b.push(...c);a=b;for(const c of a)c.Ma();this.g.g.clear()}}};w("shaka.util.EventManager",Ca);Ca.prototype.removeAll=Ca.prototype.xa;Ca.prototype.unlisten=Ca.prototype.Ma;Ca.prototype.listenOnceMulti=Ca.prototype.Fi;Ca.prototype.listenMulti=Ca.prototype.Pb;Ca.prototype.listenOnce=Ca.prototype.na;Ca.prototype.listen=Ca.prototype.F;Ca.prototype.release=Ca.prototype.release;
function Da(a,b){if(b==void 0)return!1;if(typeof b=="boolean")return b;const c=new Set(["passive","capture"]);Object.keys(b).filter(d=>!c.has(d));return Ea(a)?b:b.capture||!1}function Ea(a){let b=Fa;if(b==void 0){b=!1;try{const d={};var c={get:()=>{b=!0;return!1}};Object.defineProperty(d,"passive",c);Object.defineProperty(d,"capture",c);c=()=>{};a.addEventListener("test",c,d);a.removeEventListener("test",c,d)}catch(d){b=!1}Fa=b}return b||!1}
var Ba=class{constructor(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=Da(a,d);this.target.addEventListener(b,c,this.g)}Ma(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1}},Fa=void 0;var Ga=class{constructor(a){this.h=a;this.g=void 0}value(){this.g===void 0&&(this.g=this.h());return this.g}};function A(){return Ha.value()}var Ja=null,Ka=null,Ha=new Ga(()=>{let a=void 0;Ja&&(a=Ja());!a&&Ka&&(a=Ka());return a});/*
 @license
 Copyright 2006 The Closure Library Authors
 SPDX-License-Identifier: Apache-2.0
*/
var La=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function Ma(a){var b;a instanceof Ma?(Na(this,a.Wb),this.Lc=a.Lc,Oa(this,a.wb),Pa(this,a.hd),this.Ub=a.Ub,Qa(this,a.g.clone()),this.Ac=a.Ac):a&&(b=String(a).match(La))?(Na(this,b[1]||"",!0),this.Lc=Ra(b[2]||""),Oa(this,b[3]||"",!0),Pa(this,b[4]),this.Ub=Ra(b[5]||"",!0),Qa(this,b[6]||"",!0),this.Ac=Ra(b[7]||"")):this.g=new Sa(null)}aa=Ma.prototype;aa.Wb="";aa.Lc="";aa.wb="";aa.hd=null;aa.Ub="";aa.Ac="";
aa.toString=function(){var a=[],b=this.Wb;b&&a.push(Ta(b,Ua,!0),":");if(b=this.wb){a.push("//");var c=this.Lc;c&&a.push(Ta(c,Ua,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.hd;b!=null&&a.push(":",String(b))}if(b=this.Ub)this.wb&&b.charAt(0)!="/"&&a.push("/"),a.push(Ta(b,b.charAt(0)=="/"?Va:Wa,!0));(b=this.g.toString())&&a.push("?",b);(b=this.Ac)&&a.push("#",Ta(b,Xa));return a.join("")};
aa.resolve=function(a){var b=this.clone();b.Wb==="data"&&(b=new Ma);var c=!!a.Wb;c?Na(b,a.Wb):c=!!a.Lc;c?b.Lc=a.Lc:c=!!a.wb;c?Oa(b,a.wb):c=a.hd!=null;var d=a.Ub;if(c)Pa(b,a.hd);else if(c=!!a.Ub){if(d.charAt(0)!="/")if(this.wb&&!this.Ub)d="/"+d;else{var e=b.Ub.lastIndexOf("/");e!=-1&&(d=b.Ub.substr(0,e+1)+d)}if(d==".."||d==".")d="";else if(d.indexOf("./")!=-1||d.indexOf("/.")!=-1){e=d.lastIndexOf("/",0)==0;d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];h=="."?e&&g==d.length&&f.push(""):
h==".."?((f.length>1||f.length==1&&f[0]!="")&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.Ub=d:c=a.g.toString()!=="";c?Qa(b,a.g.clone()):c=!!a.Ac;c&&(b.Ac=a.Ac);return b};aa.clone=function(){return new Ma(this)};function Na(a,b,c){a.Wb=c?Ra(b,!0):b;a.Wb&&(a.Wb=a.Wb.replace(/:$/,""))}function Oa(a,b,c){a.wb=c?Ra(b,!0):b}function Pa(a,b){if(b){b=Number(b);if(isNaN(b)||b<0)throw Error("Bad port number "+b);a.hd=b}else a.hd=null}
function Qa(a,b,c){b instanceof Sa?a.g=b:(c||(b=Ta(b,Ya)),a.g=new Sa(b))}function Ra(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Ta(a,b,c){return a!=null?(a=encodeURI(a).replace(b,Za),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Za(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Ua=/[#\/\?@]/g,Wa=/[#\?:]/g,Va=/[#\?]/g,Ya=/[#\?@]/g,Xa=/#/g;function Sa(a){this.g=a||null}
function $a(a){if(!a.Xa&&(a.Xa=new Map,a.sd=0,a.g))for(var b=a.g.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null;if(d>=0){var f=b[c].substring(0,d);e=b[c].substring(d+1)}else f=b[c];f=decodeURIComponent(f);e=e||"";a.add(f,decodeURIComponent(e))}}aa=Sa.prototype;aa.Xa=null;aa.sd=null;aa.add=function(a,b){$a(this);this.g=null;var c=this.Xa.has(a)?this.Xa.get(a):null;c||this.Xa.set(a,c=[]);c.push(b);this.sd++;return this};
aa.set=function(a,b){$a(this);this.g=null;this.Xa.has(a)?this.Xa.set(a,[b]):this.add(a,b);return this};aa.get=function(a){$a(this);return this.Xa.get(a)||[]};aa.toString=function(){if(this.g)return this.g;if(!this.Xa||!this.Xa.size)return"";var a=[];for(const f of this.Xa.keys())for(var b=encodeURIComponent(f),c=this.Xa.get(f),d=0;d<c.length;d++){var e=b;c[d]!==""&&(e+="="+encodeURIComponent(c[d]));a.push(e)}return this.g=a.join("&")};
aa.clone=function(){var a=new Sa;a.g=this.g;if(this.Xa){var b=new Map;for(const [c,d]of this.Xa)b.set(c,d.concat());a.Xa=b;a.sd=this.sd}return a};function ab(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if((ArrayBuffer.isView(a)?a.buffer:a)==(ArrayBuffer.isView(b)?b.buffer:b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;const c=G(a);b=G(b);for(let d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function G(a,b=0,c=Infinity){return bb(a,b,c,Uint8Array)}function cb(a){return ArrayBuffer.isView(a)?a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer:a}
function bb(a,b,c,d){const e=ArrayBuffer.isView(a)?a.buffer:a;let f=1;"BYTES_PER_ELEMENT"in d&&(f=d.BYTES_PER_ELEMENT);const g=((a.byteOffset||0)+a.byteLength)/f;a=Math.floor(Math.max(0,Math.min(((a.byteOffset||0)+b)/f,g)));return new d(e,a,Math.floor(Math.min(a+Math.max(c,0),g))-a)}function db(a,b=0,c=Infinity){return bb(a,b,c,Uint16Array)}function eb(a,b=0,c=Infinity){return bb(a,b,c,DataView)}var fb=class{};w("shaka.util.BufferUtils",fb);fb.toDataView=eb;fb.toUint16=db;fb.toUint8=G;
fb.toArrayBuffer=cb;fb.equal=ab;function gb(a,b){if(a===b||!a.length||!b.length)return!0;for(const c of a){if(hb(c))return!0;for(const d of b)if(c.keySystem===d.keySystem||hb(d))return!0}return!1}function hb(a){return(a=a.licenseServerUri)?a.startsWith("data:application/json;base64,"):!1}
function ib(a,b){if(!a.length)return b;if(!b.length)return a;const c=[];for(const e of a)for(const f of b)if(e.keySystem==f.keySystem){a=new Map;var d=(e.initData||[]).concat(f.initData||[]);for(const g of d)a.set(g.keyId,g);a=Array.from(a.values());d=e.keyIds&&f.keyIds?new Set([...e.keyIds,...f.keyIds]):e.keyIds||f.keyIds;c.push({keySystem:e.keySystem,licenseServerUri:e.licenseServerUri||f.licenseServerUri,distinctiveIdentifierRequired:e.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,
persistentStateRequired:e.persistentStateRequired||f.persistentStateRequired,videoRobustness:e.videoRobustness||f.videoRobustness,audioRobustness:e.audioRobustness||f.audioRobustness,serverCertificate:e.serverCertificate||f.serverCertificate,serverCertificateUri:e.serverCertificateUri||f.serverCertificateUri,initData:a,keyIds:d});break}else hb(e)?c.push(e):hb(f)&&c.push(f);return c}function jb(a){return a?a.keySystem:""}function kb(a){return a==="org.w3.clearkey"}
function lb(a){return a?!!a.match(/^com\.widevine\.alpha/):!1}function mb(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}function nb(a){return a?!!a.match(/^com\.apple\.fps/):!1}function ob(a,b,c,d){d=[...(new Set(d))].sort().join("#");return`${a}#${b}#${c}#${d}`}
function pb(a=!1,b=!1){const c={"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"};if(!a&&!b)return c;const d={};for(const e in c){const f=
c[e];let g=e;b?g="urn:uuid:"+e:a&&(g=e.replace(/-/g,""));d[g]=f}return d}var qb=new Ga(()=>cb(new Uint8Array([0]))),rb=new Map;function sb(a){const b=a.code;let c=a.msExtendedCode;c&&(c<0&&(c+=4294967296),c=c.toString(16));return{code:b,Nh:c,message:a.message}}var H=class{constructor(a,b,c,...d){this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1;this.message="Shaka Error "+this.code;if(tb)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}toString(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")}};w("shaka.util.Error",H);var tb=!0;H.Severity={RECOVERABLE:1,CRITICAL:2};
H.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
H.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,
CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,
WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,BUFFER_WRITE_OUT_OF_BOUNDS:3025,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,
DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,
DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,AES_128_INVALID_IV_LENGTH:4048,AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,
DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM:4055,WEBTRANSPORT_NOT_AVAILABLE:4056,WEBTRANSPORT_INITIALIZATION_FAILED:4057,MSF_VOD_CONTENT_NOT_SUPPORTED:4058,MSF_CATALOG_TIMEOUT:4058,HLS_INVALID_KEY_IV_FOR_GCM:4059,HLS_INVALID_GCM_SEGMENT:4060,DASH_INVALID_JSON:4061,MSF_NO_CATALOG:4062,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,
FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,MISSING_EME_SUPPORT:6020,
LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,
MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,SS_IMA_SDK_MISSING:10002,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,VAST_INVALID_XML:10007,CS_AD_CONTAINER_MISSING:10008,SS_AD_CONTAINER_MISSING:10009,
MEDIATAILOR_REQUEST_FAILED:10010};function ub(a){if(!a)return"";a=G(a);a[0]==239&&a[1]==187&&a[2]==191&&(a=a.subarray(3));if(window.TextDecoder&&!A().T())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&la('Decoded string contains an "unknown character" codepoint.  That probably means the UTF8 encoding was incorrect!'),a;let b="";for(let d=0;d<a.length;++d){var c=65533;(a[d]&128)==0?c=a[d]:a.length>=d+2&&(a[d]&224)==192&&(a[d+1]&192)==128?(c=(a[d]&31)<<6|a[d+1]&63,d+=1):a.length>=d+3&&(a[d]&240)==224&&(a[d+1]&192)==128&&
(a[d+2]&192)==128?(c=(a[d]&15)<<12|(a[d+1]&63)<<6|a[d+2]&63,d+=2):a.length>=d+4&&(a[d]&241)==240&&(a[d+1]&192)==128&&(a[d+2]&192)==128&&(a[d+3]&192)==128&&(c=(a[d]&7)<<18|(a[d+1]&63)<<12|(a[d+2]&63)<<6|a[d+3]&63,d+=3);if(c<=65535)b+=String.fromCharCode(c);else{c-=65536;const e=c&1023;b+=String.fromCharCode(55296+(c>>10));b+=String.fromCharCode(56320+e)}}return b}
function vb(a,b,c){if(!a)return"";if(!c&&a.byteLength%2!=0)throw new H(2,2,2004);c=Math.floor(a.byteLength/2);const d=new Uint16Array(c);a=eb(a);for(let e=0;e<c;e++)d[e]=a.getUint16(e*2,b);return wb.value()(d)}
function xb(a){if(!a)return"";const b=G(a);if(b[0]==239&&b[1]==187&&b[2]==191)return ub(b);if(b[0]==254&&b[1]==255)return vb(b.subarray(2),!1);if(b[0]==255&&b[1]==254)return vb(b.subarray(2),!0);const c=d=>b.byteLength<=d||b[d]>=9&&b[d]<=126;if(b[0]==0&&b[2]==0)return vb(a,!1);if(b[1]==0&&b[3]==0)return vb(a,!0);if(c(0)&&c(1)&&c(2)&&c(3))return ub(a);throw new H(2,2,2003);}
function yb(a){if(window.TextEncoder&&!A().T()){var b=new TextEncoder;return cb(b.encode(a))}a=encodeURIComponent(a);a=unescape(a);b=new Uint8Array(a.length);for(let c=0;c<a.length;c++)b[c]=a[c].charCodeAt(0);return cb(b)}function zb(a,b){const c=new ArrayBuffer(a.length*2),d=new DataView(c);for(let e=0;e<a.length;++e)d.setUint16(e*2,a.charCodeAt(e),b);return c}
function Ab(a){const b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":"\u00a0","&lrm;":"\u200e","&rlm;":"\u200f"},c=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,e=>e[1]=="#"?(e=e[2]=="x"||e[2]=="X"?parseInt(e.substring(3),16):parseInt(e.substring(2),10),e>=0&&e<=1114111?String.fromCodePoint(e):""):b[e]||"'"):a||""}var Bb=class{};w("shaka.util.StringUtils",Bb);Bb.resetFromCharCode=function(){wb.g=void 0};
Bb.toUTF16=zb;Bb.toUTF8=yb;Bb.fromBytesAutoDetect=xb;Bb.fromUTF16=vb;Bb.fromUTF8=ub;var wb=new Ga(()=>{const a=b=>{try{const c=new Uint8Array(b);return String.fromCharCode.apply(null,c).length>0}catch(c){return!1}};for(let b=65536;b>0;b/=2)if(a(b))return c=>{let d="";for(let e=0;e<c.length;e+=b)d+=String.fromCharCode.apply(null,c.subarray(e,e+b));return d};return null});function Cb(a){a=G(a);return Uint8Array.prototype.toBase64?a.toBase64({alphabet:"base64",omitPadding:!1}):(a=wb.value()(a),btoa(a))}function Db(a,b){b=b==void 0?!0:b;return Uint8Array.prototype.toBase64?G(a).toBase64({alphabet:"base64url",omitPadding:!b}):(a=Cb(a).replace(/\+/g,"-").replace(/\//g,"_"),b?a:a.replace(/[=]*$/,""))}
function Eb(a){if(!("fromBase64"in Uint8Array)){a=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));const b=new Uint8Array(a.length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}a=a.replace(/\s+/g,"");return Uint8Array.fromBase64(a,{alphabet:/[-_]/.test(a)?"base64url":"base64"})}function Fb(a){if(!("fromHex"in Uint8Array)){const b=a.length/2,c=new Uint8Array(b);for(let d=0;d<b;d++)c[d]=window.parseInt(a.substr(d*2,2),16);return c}return Uint8Array.fromHex(a)}
function Gb(a){a=G(a);if(!Uint8Array.prototype.toHex){let b="";for(let c of a)c=c.toString(16),c.length==1&&(c="0"+c),b+=c;return b}return a.toHex()}function Hb(...a){return Ib(a,0,a.length)}function Ib(a,b=0,c=a.length){var d=0;for(var e=b;e<c;++e)d+=a[e].byteLength;d=new Uint8Array(d);for(e=0;b<c;++b){const f=a[b];ArrayBuffer.isView(f)&&f.BYTES_PER_ELEMENT===1?d.set(f,e):d.set(G(f),e);e+=f.byteLength}return d}var Jb=class{};w("shaka.util.Uint8ArrayUtils",Jb);Jb.concat=Hb;Jb.toHex=Gb;
Jb.fromHex=Fb;Jb.fromBase64=Eb;Jb.toBase64=Db;Jb.toStandardBase64=Cb;function Kb(a,b,c=""){if(b.length==0)return a;if(a.length==1&&b.length==1){var d=new Ma(a[0]),e=new Ma(b[0]);d=d.resolve(e);c&&Qa(d,c);return[d.toString()]}b=b.map(g=>new Ma(g));const f=[];for(d of a){a=new Ma(d);for(e of b){const g=a.resolve(e);c&&Qa(g,c);f.push(g.toString())}}return f}
function Lb(a,b,c,d,e){b={keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set,mediaTypes:e};d&&(b.keySystemUris=new Set([d]));!c&&nb(a)&&b.initData.push({initDataType:"sinf",initData:new Uint8Array(0),keyId:null});return b}
function Mb(a,b="cenc"){const c=[],d=[],e=[];a.forEach((g,h)=>{let k=h;k.length!=22&&(k=Db(Fb(h),!1));let l=g;l.length!=22&&(l=Db(Fb(g),!1));g={kty:"oct",kid:k,k:l};c.push(g);d.push(g.kid);e.push(h)});a=JSON.stringify({keys:c});var f=JSON.stringify({kids:d});f=[{initData:G(yb(f)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",
videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:f,keyIds:new Set(e)}}function Nb(a,b){if(b.length==1)return b[0];a=Ob(a,b);if(a!=null)return a;throw new H(2,4,4025,b);}function Ob(a,b){const c=Pb.get(a);for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a==K?"":null}function Qb(a,b){const c=[];a=Pb.get(a);for(const d of a)for(const e of b)d.test(e.trim())&&c.push(e.trim());return c}
var K="text",Rb={Jk:"video",wj:"audio",vg:K,Uj:"image",vj:"application",Fj:"chapter"},Sb=1/15,Pb=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cehx]?$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^mp2v/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function Tb(a){return a&&typeof LCEVCdec!=="undefined"?a.codecs=="lvc1":!1}function Ub(a,b,c,d){d.type!=="video"||a.j&&!Tb(d)||a.g&&a.g.appendBuffer(b,"video",d.id,-c,!a.j)}function Vb(a){a.g&&a.i.classList.add("shaka-hidden")}
var Wb=class{constructor(a,b,c,d){this.g=null;this.l=a;this.i=b;this.m=c;this.j=d;typeof libDPIModule==="undefined"&&ma("Could not find LCEVC Library dependencies on this page");typeof LCEVCdec!=="undefined"?(this.h=LCEVCdec,typeof this.h.SupportObject==="undefined"?(ma("Could not find LCEVC Library on this page"),a=!1):(this.h.SupportObject.SupportStatus||ma(this.h.SupportObject.SupportError),a=typeof this.h!=="undefined"&&typeof libDPIModule!=="undefined"&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)):
(ma("Could not find LCEVC Library on this page"),a=!1);a&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=new this.h.LCEVCdec(this.l,this.i,this.m))}release(){this.g&&(this.g.close(),this.g=null)}};w("shaka.lcevc.Dec",Wb);Wb.prototype.release=Wb.prototype.release;function Xb(a,b){Yb.set(a,b)}function Zb(){const a={};A();if($b())for(var b of Yb.keys())a[b]=!0;b=["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","audio/x-mpegurl"];for(const c of b)a[c]=$b()?Yb.has(c):ac(c);return a}function bc(a,b){if(b){const c=Yb.get(b);if(c)return c}throw new H(2,4,4E3,a,b);}var cc=class{};w("shaka.media.ManifestParser",cc);cc.unregisterParserByMime=function(a){Yb.delete(a)};cc.registerParserByMime=Xb;
cc.AccessibilityPurpose={Kk:"visually impaired",Sj:"hard of hearing",rk:"spoken subtitles"};var Yb=new Map;var dc=class{extract(){}extractRaw608(){}decode(){return[]}clear(){}getStreams(){return[]}};var ec=class{init(){}parse(){return[]}};function fc(a){return hc.get(a)}function ic(a,b){hc.set(a,b)}function jc(a,b){b=a.j.parse(b);for(const c of b)if(b=G(c.packet),b.length>0)switch(c.format){case lc:a.g.extract(b,c.pts);break;case mc:a.g.extractRaw608(b,c.pts)}return a.g.decode()}
var oc=class{constructor(a){this.h=new Map;this.i=0;this.j=new ec;if(a=fc(a.toLowerCase()))this.j=a();this.g=new dc;if(a=nc)this.g=a(),this.h.set(this.i,this.g)}init(a,b=!1,c=-1){if(c!=-1&&this.i!=c)if(b=this.h.get(c),this.h.set(this.i,this.g),b)this.g=b;else{if(b=nc)this.g=b();this.h.set(c,this.g)}else b||this.g.clear();this.j.init(a);c!=-1&&(this.i=c)}remove(a=[]){a=new Set(a);for(const b of this.h.keys())if(!a.has(b)){let c=this.h.get(b);c&&c.clear();this.h.delete(b)}}};
w("shaka.media.ClosedCaptionParser",oc);oc.findDecoder=function(){return nc};oc.unregisterDecoder=function(){nc=null};oc.registerDecoder=function(a){nc=a};oc.findParser=fc;oc.unregisterParser=function(a){hc.delete(a)};oc.registerParser=ic;var hc=new Map,nc=null,lc="sei",mc="raw608";var rc=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=pc;this.scroll=qc}clone(){const a=new rc;a.id=this.id;a.viewportAnchorX=this.viewportAnchorX;a.viewportAnchorY=this.viewportAnchorY;a.regionAnchorX=this.regionAnchorX;a.regionAnchorY=this.regionAnchorY;a.width=this.width;a.height=this.height;a.heightUnits=this.heightUnits;a.widthUnits=this.widthUnits;
a.viewportAnchorUnits=this.viewportAnchorUnits;a.scroll=this.scroll;return a}};w("shaka.text.CueRegion",rc);rc.prototype.clone=rc.prototype.clone;var pc=1;rc.units={PX:0,PERCENTAGE:pc,LINES:2};var qc="";rc.scrollMode={NONE:qc,UP:"up"};function sc(a){return a?tc(new uc(a)):null}function tc(a){a=vc(a,wc);if(a==null)return null;const b=Number(a[2]),c=Number(a[3]);return b>59||c>59?null:(Number(a[6])||0)/1E3+c+b*60+(Number(a[1])||0)*3600}function xc(a){return a.g==a.h.length?null:(a=vc(a,/[^ \t\n]*/gm))?a[0]:null}function vc(a,b){b.lastIndex=a.g;b=b.exec(a.h);b=b==null?null:{position:b.index,length:b[0].length,results:b};if(a.g==a.h.length||b==null||b.position!=a.g)return null;a.g+=b.length;return b.results}
function yc(a){vc(a,/[ \t]+/gm)}var uc=class{constructor(a){this.h=a||"";this.g=0}},wc=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function zc(a){const b=new WeakSet,c=d=>{switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||ArrayBuffer.isView(d))return d;if(b.has(d))return null;const e=Array.isArray(d);if(d.constructor!=Object&&!e)return null;b.add(d);const f=e?[]:{};for(const g in d)f[g]=c(d[g]);e&&(f.length=d.length);return f}};return c(a)}function Ac(a){const b={};for(const c in a)b[c]=a[c];return b}
function Bc(a){if(Array.isArray(a)){var b=[];for(var c=0;c<a.length;c++){var d=c.toString(),e=a[c];e!==void 0&&(e=Bc(e))&&b.push(d+":"+e)}a="["+b.join(",")+"]"}else if(typeof a=="function")a="";else if(a instanceof Object){d=Object.keys(a);d.sort();b=[];for(c of d)d=JSON.stringify(c),e=a[c],e!==void 0&&(e=Bc(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a}var Dc=class{};w("shaka.util.ObjectUtils",Dc);Dc.alphabeticalKeyOrderStringify=Bc;Dc.shallowCloneObject=Ac;
Dc.cloneObject=zc;/*
 @license
 tXml
 Copyright 2015 Tobias Nickel
 SPDX-License-Identifier: MIT
*/
function Ec(a,b){a=xb(a);return Fc(a,b,!1)}function Fc(a,b,c=!1){a=Gc(a,c);if(!b&&a.length)return a[0];const d=b.split(",");return(b=a.find(e=>d.includes(e.tagName)))?b:null}
function Gc(a,b){function c(g,h=!1){const k=[];for(;a[e];)if(a.charCodeAt(e)==60){if(a.charCodeAt(e+1)===47){h=e+2;e=a.indexOf(">",e);h=a.substring(h,e);var l=h.indexOf(g);if(l==-1){var m=g.indexOf(".");m>0&&(l=h.indexOf(g.substring(0,m)))}if(l==-1)throw g=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(g.length-1)+"\nColumn: "+(g[g.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(a.charCodeAt(e+1)===33){if(a.charCodeAt(e+2)==45){for(;e!==-1&&(a.charCodeAt(e)!==62||
a.charCodeAt(e-1)!=45||a.charCodeAt(e-2)!=45||e==-1);)e=a.indexOf(">",e+1);e===-1&&(e=a.length)}else if(a.charCodeAt(e+2)===91&&a.charCodeAt(e+8)===91&&a.substr(e+3,5).toLowerCase()==="cdata"){l=a.indexOf("]]\x3e",e);l==-1?(k.push(a.substr(e+9)),e=a.length):(k.push(a.substring(e+9,l)),e=l+3);continue}e++;continue}if(f>512)throw Error("XML is too deeply nested");f++;a:{m=h;e++;var n=d(),p={};for(l=[];a.charCodeAt(e)!==62&&a[e];){var q=a.charCodeAt(e);if(q>64&&q<91||q>96&&q<123){q=d();for(var r=a.charCodeAt(e);r&&
r!==39&&r!==34&&!(r>64&&r<91||r>96&&r<123)&&r!==62;)e++,r=a.charCodeAt(e);var t=e+1;e=a.indexOf(a[e],t);t=(" "+a.slice(t,e)).slice(1);if(r===39||r===34){if(e===-1){m={tagName:n,attributes:p,children:l,parent:null};if(b)for(n=0;n<l.length;n++)typeof l[n]!=="string"&&(l[n].parent=m);l=m;break a}}else t=null,e--;if(q.startsWith("xmlns:")){r=t;var u=q.split(":")[1];Hc.set(r,u);Ic.set(u,r)}n==="tt"&&q==="xml:space"&&t==="preserve"&&(m=!0);p[q]=t}e++}a.charCodeAt(e-1)!==47?(e++,l=c(n,m)):e++;m={tagName:n,
attributes:p,children:l,parent:null};n=l.length;for(p=0;p<n;p++)q=l[p],typeof q!=="string"?b&&(q.parent=m):p==n-1&&q=="\n"&&l.pop();l=m}f--;k.push(l);if(typeof l==="string")break;l.tagName[0]==="?"&&l.children&&(k.push(...l.children),l.children=[])}else l=e,e=a.indexOf("<",e)-1,e===-2&&(e=a.length),l=(" "+a.slice(l,e+1)).slice(1),h?l.length>0&&k.push(l):k.length&&l.length==1&&l[0]=="\n"?k.push(l):l.trim().length>0&&k.push(l),e++;return k}function d(){const g=e;for(;"\r\n\t>/= ".indexOf(a[e])===-1&&
a[e];)e++;return(" "+a.slice(g,e)).slice(1)}let e=0,f=0;return c("")}function Jc(a){return Hc.has(a)?Hc.get(a):""}function Kc(a){return typeof a==="string"}function Lc(a){const b=[];if(!a.children)return[];for(const c of a.children)typeof c!=="string"&&b.push(c);return b}function Mc(a,b){const c=[];if(!a.children)return[];for(const d of a.children)d.tagName===b&&c.push(d);return c}
function Nc(a){if(typeof a==="string")return Ab(a);const b=[];for(const c of a.children)typeof c==="string"&&b.push(c);a=b.join("");return a===""?null:Ab(a)}function Oc(a){for(const b of a.children)if(typeof b!=="string")return null;(a=Nc(a))&&(a=a.trim());return a}function Pc(a,b,c=[]){a.tagName===b&&c.push(a);if(a.children)for(const d of a.children)Pc(d,b,c);return c}function Qc(a,b){a=Mc(a,b);return a.length!=1?null:a[0]}function Rc(a,b,c){a=Sc(a,b,c);return a.length!=1?null:a[0]}
function Sc(a,b,c){const d=Jc(b);b=[];if(a.children){c=d?`${d}:${c}`:c;for(const e of a.children)e&&e.tagName===c&&b.push(e)}return b}function N(a,b,c,d=null){let e=null;a=a.attributes[b];a==null||a===""&&d!==null||(e=c(a));return e==null?d:e}function Tc(a,b,c){b=Jc(b);return a.attributes[`${b}:${c}`]||null}function Uc(a,b,c){for(const d of b)if(b=Tc(a,d,c))return b;return null}
function Vc(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3}function Wc(a){if(!a)return null;a=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$","i").exec(a);if(!a)return null;a=31536E3*Number(a[1]||null)+2592E3*Number(a[2]||null)+86400*Number(a[3]||null)+3600*Number(a[4]||null)+60*Number(a[5]||null)+Number(a[6]||null);return isFinite(a)?a:null}
function Xc(a){var b=/([0-9]+)-([0-9]+)/.exec(a);if(!b)return null;a=Number(b[1]);if(!isFinite(a))return null;b=Number(b[2]);return isFinite(b)?{start:a,end:b}:null}function Yc(a){a=Number(a);return a%1===0?a:null}function Zc(a){a=Number(a);return a%1===0&&a>0?a:null}function $c(a){a=Number(a);return a%1===0&&a>=0?a:null}function ad(a){a=Number(a);return isNaN(a)?null:a}function bd(a){return a?a.toLowerCase()==="true":!1}
function cd(a){let b,c;c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c}
function dd(a){const b=[];a=Ab(a).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);for(const c of a)if(a=c.match(/^([\w]+)/)){const d=c.match(/(@id='(.*?)')/),e=c.match(/(@t='(\d+)')/),f=c.match(/(@n='(\d+)')/),g=c.match(/\[(\d+)\]/);b.push({name:a[0],id:d?d[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:e?Number(e[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:f?Number(f[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:g?Number(g[1])-1:null,nc:c.split("/@")[1]||null})}else c.startsWith("@")&&
b.length&&(b[b.length-1].nc=c.slice(1));return b}function ed(a,b){var c=dd(b.attributes.sel||"");if(c.length){var d=c[c.length-1],e=b.attributes.pos||null;c=d.position;c==null&&(d.t!==null&&(c=fd(a,"t",d.t)),d.n!==null&&(c=fd(a,"n",d.n)));c===null?c=e==="prepend"?0:a.length:e==="prepend"?--c:e==="after"&&++c;e=b.tagName;(d=d.nc)&&a[c]?gd(a[c],e,d,Oc(b)||""):(e!=="remove"&&e!=="replace"||a.splice(c,1),e!=="add"&&e!=="replace"||a.splice(c,0,...b.children))}}
function fd(a,b,c){let d=0;for(const e of a){if(Number(e.attributes[b])===c)return d;d++}return null}function gd(a,b,c,d){if(b==="remove")delete a.attributes[c];else if(b==="add"||b==="replace")a.attributes[c]=d}function hd(a){if(!a)return null;const b={tagName:a.tagName,attributes:Ac(a.attributes),children:[],parent:null};for(const c of a.children)typeof c==="string"?b.children.push(c):(a=hd(c),a.parent=b,b.children.push(a));return b}var Hc=new Map,Ic=new Map;function id(a,b){a=new jd(a,b,"");a.lineBreak=!0;return a}function kd(a,b){if(a.payload!=b.payload||!(Math.abs(a.startTime-b.startTime)<.001&&Math.abs(a.endTime-b.endTime)<.001))return!1;for(const c in a)if(c!="startTime"&&c!="endTime"&&c!="payload")if(c=="nestedCues"){if(!za(a.nestedCues,b.nestedCues,kd))return!1}else if(c=="region"||c=="cellResolution")for(const d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!za(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}
function ld(a,b=new Map){var c=a.payload;if(c.includes("<")){b.size===0&&md(b);var d=c;c=[];var e=-1;for(var f=0;f<d.length;f++)d[f]==="<"?e=f+1:d[f]===">"&&e>0&&(e=d.substr(e,f-e),e.match(nd)&&c.push(e),e=-1);for(var g of c)d=d.replace("<"+g+">",'<div time="'+g+'">'),d+="</div>";c=d;a:{d=c;f=[];e=-1;g="";c=!1;for(let m=0;m<d.length;m++)if(d[m]==="/"){var h=d.indexOf(">",m);if(h===-1){c=d;break a}h=d.substring(m+1,h);if(!h||h!="v"){g+=d[m];continue}c=!0;let n=null;f.length&&(n=f[f.length-1]);if(n){if(n===
h)g+="/"+h+">";else{if(!n.startsWith("v")){g+=d[m];continue}g+="/"+n+">"}m+=h.length+1}else g+=d[m]}else d[m]==="<"?(e=m+1,d[e]!="v"&&(e=-1)):d[m]===">"&&e>0&&(f.push(d.substr(e,m-e)),e=-1),g+=d[m];for(var k of f)d=k.replace(" ",".voice-"),g=g.replace(`<${k}>`,`<${d}>`),g=g.replace(`</${k}>`,`</${d}>`),c||(g+=`</${d}>`);c=g}c=od(c);a.payload="";k="<span>"+c.replace(/\n/g,"<br />")+"</span>";try{var l=Fc(k,"span")}catch(m){}if(l)if(l=l.children,l.length!=1||l[0].tagName)for(const m of l)pd(m,a,b);
else a.payload=Ab(c);else a.payload=Ab(c)}else a.payload=Ab(c)}function md(a){for(const [c,d]of Object.entries(qd)){var b=new jd(0,0,"");b.color=d;a.set("."+c,b)}for(const [c,d]of Object.entries(rd))b=new jd(0,0,""),b.backgroundColor=d,a.set("."+c,b)}function od(a){const b={"< ":""," >":" &gt;"},c=/(< +>|<\s|\s>)/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,e=>b[e]||""):a||""}
function pd(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new rc;d.position=null;d.size=0;d.textAlign=sd;if(a.tagName){var e=a.tagName.split(/(?=[ .])+/g);for(var f of e){var g=f;g.startsWith(".voice-")&&(e=g.split("-").pop(),g=`v[voice="${e}"]`,c.has(g)||(g=`v[voice=${e}]`));c.has(g)&&(e=d,g=c.get(g))&&(e.backgroundColor=td(g.backgroundColor,e.backgroundColor),e.color=td(g.color,e.color),e.fontFamily=td(g.fontFamily,e.fontFamily),e.fontSize=td(g.fontSize,e.fontSize),
e.textShadow=td(g.textShadow,e.textShadow),e.fontWeight=g.fontWeight,e.fontStyle=g.fontStyle,e.opacity=g.opacity,e.rubyTag=g.rubyTag,e.textCombineUpright=g.textCombineUpright,e.wrapLine=g.wrapLine);switch(f){case "br":d=id(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=ud;break;case "i":d.fontStyle=vd;break;case "u":d.textDecoration.push(wd);break;case "font":if(e=a.attributes.color)d.color=e;break;case "div":e=a.attributes.time;if(!e)break;if(e=sc(e))d.startTime=e;break;
case "ruby":case "rp":case "rt":d.rubyTag=f}}}f=a.children;if(Kc(a)||f.length==1&&Kc(f[0])){a=Nc(a).split("\n");c=!0;for(const h of a)c||(a=id(d.startTime,d.endTime),b.nestedCues.push(a)),h.length>0&&(a=d.clone(),a.payload=Ab(h),b.nestedCues.push(a)),c=!1}else{b.nestedCues.push(d);for(const h of f)pd(h,d,c)}}function td(a,b){return a&&a.length>0?a:b}
var jd=class{constructor(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new rc;this.position=null;this.positionAlign=xd;this.size=0;this.textAlign=sd;this.direction=yd;this.writingMode=zd;this.lineInterpretation=Ad;this.line=null;this.lineHeight="";this.lineAlign=Bd;this.displayAlign=Cd;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=Dd;this.fontStyle=Ed;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textCombineUpright=
"";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.rubyTag=null;this.cellResolution={columns:32,rows:15}}clone(){const a=new jd(0,0,""),b=c=>{if(c===null||typeof c!=="object")return c;if(Array.isArray(c))return c.map(b);if(c instanceof jd)return c.clone();if(c instanceof rc)return c.clone();const d={};for(const e in c)d[e]=b(c[e]);return d};for(const c in this)a[c]=b(this[c]);
return a}};w("shaka.text.Cue",jd);jd.parseCuePayload=ld;jd.equal=kd;jd.prototype.clone=jd.prototype.clone;var xd="auto";jd.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:xd};var sd="center",Fd={LEFT:"left",RIGHT:"right",CENTER:sd,START:"start",END:"end"};jd.textAlign=Fd;var Cd="after",Gd={BEFORE:"before",CENTER:"center",AFTER:Cd};jd.displayAlign=Gd;var yd="ltr";jd.direction={HORIZONTAL_LEFT_TO_RIGHT:yd,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var zd="horizontal-tb";
jd.writingMode={HORIZONTAL_TOP_TO_BOTTOM:zd,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var Ad=0;jd.lineInterpretation={LINE_NUMBER:Ad,PERCENTAGE:1};var Bd="start",Hd={CENTER:"center",START:Bd,END:"end"};jd.lineAlign=Hd;var qd={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};jd.defaultTextColor=qd;
var rd={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};jd.defaultTextBackgroundColor=rd;var Dd=400,ud=700;jd.fontWeight={NORMAL:Dd,BOLD:ud};var Ed="normal",vd="italic",Id={NORMAL:Ed,ITALIC:vd,OBLIQUE:"oblique"};jd.fontStyle=Id;var wd="underline";jd.textDecoration={UNDERLINE:wd,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var nd=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function Jd(a,b,c){Kd.set(a.toLowerCase().split(";")[0]+"-"+c,{priority:c,Ke:b})}function Ld(a,b){const c=a.toLowerCase().split(";")[0];var d=[Md,Nd,Od,Pd];for(const e of d)if(d=Kd.get(c+"-"+e)){const f=d.Ke(),g=f.isSupported(a,b);f.destroy();if(g)return d.Ke}return null}var Qd=class{destroy(){}};w("shaka.transmuxer.TransmuxerEngine",Qd);Qd.findTransmuxer=Ld;Qd.unregisterTransmuxer=function(a,b){Kd.delete(a.toLowerCase().split(";")[0]+"-"+b)};Qd.registerTransmuxer=Jd;Qd.prototype.destroy=Qd.prototype.destroy;
var Kd=new Map,Pd=1,Od=2,Nd=3,Md=4;Qd.PluginPriority={FALLBACK:Pd,PREFERRED_SECONDARY:Od,PREFERRED:Nd,APPLICATION:Md};function Rd(a,b){let c=a;b&&!Sd.includes(a)&&(c+='; codecs="'+b+'"');return c}function Td(a,b){b&&(a+='; codecs="'+b+'"');return a}function Ud(a,b,c){const d=Rd(a,b);b=Td(a,b);Ld(b)?(a=Ld(b))?(a=a(),c=a.convertCodecs(c,b),a.destroy()):c=b:c=a!="video/mp2t"&&c=="audio"?d.replace("video","audio"):d;return c}function Vd(a){return a.split(";")[0].split("/")[1]}
function Wd(a){var b=Xd(a);a=b[0].toLowerCase();b=b[1].toLowerCase();switch(!0){case a==="mp4a"&&b==="69":case a==="mp4a"&&b==="6b":case a==="mp4a"&&b==="40.34":return"mp3";case a==="mp4a"&&b==="66":case a==="mp4a"&&b==="67":case a==="mp4a"&&b==="68":case a==="mp4a"&&b==="40.2":case a==="mp4a"&&b==="40.02":case a==="mp4a"&&b==="40.5":case a==="mp4a"&&b==="40.05":case a==="mp4a"&&b==="40.29":case a==="mp4a"&&b==="40.42":return"aac";case a==="mp4a"&&b==="a5":case a==="ac3":case a==="ac-3":return"ac-3";
case a==="mp4a"&&b==="a6":case a==="eac3":case a==="ec-3":return"ec-3";case a==="ac-4":return"ac-4";case a==="mp4a"&&b==="b2":return"dtsx";case a==="mp4a"&&b==="a9":return"dtsc";case a==="vp09":case a==="vp9":return"vp9";case a==="avc1":case a==="avc3":return"avc";case a==="hvc1":case a==="hev1":return"hevc";case a==="vvc1":case a==="vvi1":return"vvc";case a==="dvh1":case a==="dvhe":return b&&b.startsWith("05")?"dovi-p5":"dovi-hevc";case a==="dvav":case a==="dva1":return"dovi-avc";case a==="dav1":return"dovi-av1";
case a==="dvc1":case a==="dvi1":return"dovi-vvc";case a==="lvc1":return"lcevc"}return a}function Xd(a){a=a.split(".");const b=a[0];a.shift();return[b,a.join(".")]}function Yd(a){const b=[];for(const c of a.split(","))a=Xd(c),b.push(a[0]);return b.sort().join(",")}function Zd(a){return a.split(";")[0]}function $d(a){a=a.split(/ *; */);a.shift();return(a=a.find(b=>b.startsWith("codecs=")))?a.split("=")[1].replace(/^"|"$/g,""):""}
function ae(a){return a==="application/x-mpegurl"||a==="application/vnd.apple.mpegurl"||a==="audio/x-mpegurl"}var be=class{};w("shaka.util.MimeUtils",be);be.getFullTypeWithAllCodecs=Td;be.getFullType=Rd;(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var Sd=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function ce(a,b){de.set(a,b)}function ee(a){return de.get(a)}function fe(a){return de.has(a)?!0:a=="application/cea-608"||a=="application/cea-708"?!!nc:!1}
async function ge(a,b,c,d,e,f=-1){if(a.B||a.o.has(f)){if(await Promise.resolve(),a.l&&a.j)if(c==null||d==null)a.l.parseInit(G(b));else{var g=a.B?0:a.o.get(f);f=a.H||a.B?c:a.o.get(f);f={periodStart:g,segmentStart:c,segmentEnd:d,vttOffset:f,isMpegTs:a.I};b=a.l.parseMedia(G(b),f,e,[]);for(var h of b)a.C(h,e||null,f);e=b.filter(k=>k.startTime>=a.u&&k.startTime<a.A);a.j.append(e);a.g==null&&(a.g=Math.max(c,a.u));a.h=Math.min(d,a.A)}}else h=a.i.get(f)||[],h.push({buffer:b,startTime:c,endTime:d,uri:e,Mh:f}),
a.i.set(f,h)}function he(a,b,c){for(const d of a.m.keys()){let e=a.m.get(d);e=e.filter(f=>f.startTime<b||f.endTime>=c);a.m.set(d,e)}}function ie(a){let b=Infinity,c=-Infinity;for(const d of a.m.values())for(const e of d)b=Math.min(b,e.startTime),c=Math.max(c,e.endTime);b!==Infinity&&c!==-Infinity&&(a.g=a.g==null?Math.max(b,a.u):Math.min(a.g,Math.max(b,a.u)),a.h=Math.max(a.h,Math.min(c,a.A)))}
function je(a,b,c=-1){(!a.o.has(c)||a.D!=="HLS"||a.D==="HLS"&&c===-1&&a.o.get(c)===0)&&a.o.set(c,b);b=a.i.get(c)||[];for(let d=0;d<b.length;d++){const {buffer:e,startTime:f,endTime:g,uri:h,Mh:k}=b[d];ge(a,e,f,g,h,k)}a.i.set(c,[])}function ke(a,b){a.I=b}function le(a,b,c){a.u=b;a.A=c}function me(a,b,c){a.G=b;if(b=a.m.get(b))b=b.filter(d=>d.endTime<=c),b.length&&a.j.append(b)}function ne(a,b,c){b.startTime+=c;b.endTime+=c;for(const d of b.nestedCues)ne(a,d,c)}
function oe(a,b,c){const d=new Map;for(const e of b){b=e.stream;const f=e.cue;d.getOrInsert(b,[]);ne(a,f,c);f.startTime>=a.u&&f.startTime<a.A&&(d.get(b).push(f),b==a.G&&a.j.append([f]))}for(const e of d.keys()){c=a.m.getOrInsertComputed(e,()=>[]);for(const f of d.get(e))c.push(f)}ie(a)}
var pe=class{constructor(a,b="UNKNOWN"){this.l=null;this.j=a;this.D=b;this.B=this.I=this.H=!1;this.o=new Map;this.i=new Map;this.u=0;this.A=Infinity;this.h=this.g=null;this.G="";this.C=()=>{};this.m=new Map}destroy(){this.j=this.l=null;this.o.clear();this.i.clear();this.m.clear();return Promise.resolve()}async remove(a,b,c=!1){await Promise.resolve();if(!(a>=b)){if(c&&(he(this,a,b),this.G===""))return;c=d=>d.startTime<b&&d.endTime>a;for(const d of this.i.keys()){const e=this.i.get(d),f=[];for(let g=
0;g<e.length;g++){const h=e[g];c(h)||f.push(h)}this.i.set(d,f)}this.j&&this.j.remove(a,b)&&this.g!=null&&(b<=this.g||a>=this.h||(a<=this.g&&b>=this.h?this.g=this.h=null:a<=this.g&&b<this.h?this.g=b:a>this.g&&b>=this.h&&(this.h=a)),ie(this))}}};w("shaka.text.TextEngine",pe);pe.prototype.destroy=pe.prototype.destroy;pe.findParser=ee;pe.unregisterParser=function(a){de.delete(a)};pe.registerParser=ce;var de=new Map;function qe(a,b,c){let d=!0,e=null;a.g=()=>{clearTimeout(e);d=!1};e=setTimeout(()=>{d&&b()},c*1E3)}function se(a,b){qe(a,()=>{se(a,b);a.h()},b)}var te=class{constructor(a){this.h=a;this.g=null}La(){this.stop();this.h();return this}ha(a){this.stop();qe(this,()=>{this.h()},a);return this}Aa(a){this.stop();se(this,a);return this}stop(){this.g?.();this.g=null}};w("shaka.util.Timer",te);te.prototype.stop=te.prototype.stop;te.prototype.tickEvery=te.prototype.Aa;te.prototype.tickAfter=te.prototype.ha;
te.prototype.tickNow=te.prototype.La;function ue(a){return a!=null}function ve(a,b){return Promise.race([b,new Promise((c,d)=>{(new te(d)).ha(a)})])}function we(a){return new Promise(b=>{(new te(b)).ha(a)})};function xe(a,b){a=ye(a);b=ye(b);return a.split("-")[0]==b.split("-")[0]}function ze(a,b){a=ye(a);b=ye(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&a.length==1&&b.length==2}function Ae(a,b){a=ye(a);b=ye(b);a=a.split("-");b=b.split("-");return a.length==2&&b.length==2&&a[0]==b[0]}function ye(a){const [b="",c=""]=a.split("-x-"),[d="",e=""]=b.split("-");a=c?`${"x-"}${c}`:"";let f=d.toLowerCase();f=Be.get(f)||f;const g=e.toUpperCase();return`${g?`${f}-${g}`:f}${a?`-${a}`:""}`}
function Ce(a,b){a=ye(a);b=ye(b);return b==a?4:ze(b,a)?3:Ae(b,a)?2:ze(a,b)?1:0}function De(a){const b=a.indexOf("-");a=b>=0?a.substring(0,b):a;a=a.toLowerCase();return a=Be.get(a)||a}function Ee(a){return a.language?ye(a.language):a.audio&&a.audio.language?ye(a.audio.language):a.video&&a.video.language?ye(a.video.language):"und"}
function Fe(a,b){a=ye(a);const c=new Set;for(const d of b)c.add(ye(d));for(const d of c)if(d==a)return d;for(const d of c)if(ze(d,a))return d;for(const d of c)if(Ae(d,a))return d;for(const d of c)if(ze(a,d))return d;return null}var Ge=class{};w("shaka.util.LanguageUtils",Ge);Ge.findClosestLocale=Fe;Ge.getLocaleForVariant=Ee;Ge.getLocaleForText=function(a){return ye(a.language||"und")};Ge.getBase=De;Ge.relatedness=Ce;Ge.areSiblings=function(a,b){const c=De(a),d=De(b);return a!=c&&b!=d&&c==d};
Ge.normalize=ye;Ge.isSiblingOf=Ae;Ge.isParentOf=ze;Ge.areLanguageCompatible=xe;Ge.areLocaleCompatible=function(a,b){a=ye(a);b=ye(b);return a==b};
var Be=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
"cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
"is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao",
"mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san",
"sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie",
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function He(a,b,c,d,e){if(e.length){var f=a.textStreams;for(const m of e)if(e=f.filter(n=>n.codecs.startsWith(m)||n.mimeType.startsWith(m)?!0:!1),e.length){f=e;break}a.textStreams=f}f=a.variants;if(b.length||c.length)f=Ie(f,b,c);if(d.length){b=new Aa;for(var g of f)b.push(String(g.video.width||0),g);const m=[];b.forEach((n,p)=>{n=0;let q=[];for(const r of p)p=d.filter(t=>r.decodingInfos[0][t]).length,p>n?(n=p,q=[r]):p==n&&q.push(r);m.push(...q)});f=m}g=new Set;for(var h of f)h.video&&g.add(h.video);
if(g.size){var k={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};b=Array.from(g).sort((m,n)=>m.bandwidth&&n.bandwidth&&m.bandwidth!=n.bandwidth?m.bandwidth-n.bandwidth:m.width!=n.width?m.width-n.width:m.codecs&&n.codecs?(m=Wd(m.codecs),n=Wd(n.codecs),(k[m]||1)-(k[n]||1)):0);var l=[];h=new Map;g=m=>{const n=[String(m.width||""),String(m.height||""),String(Math.round(m.frameRate||0)),m.hdr||"",m.fastSwitching];m.dependencyStream&&n.push(m.dependencyStream.baseOriginalId||
"");m.roles&&n.push(m.roles.sort().join("_"));return n.join(";")};for(const m of b){b=g(m);c=h.get(b)||[];if(c.length){e=Wd(c[c.length-1].codecs);const n=Wd(m.codecs);e==n&&(c.push(m),l.push(m.id))}else c.push(m),l.push(m.id);h.set(b,c)}a.variants=f.filter(m=>(m=m.video)&&!l.includes(m.id)?!1:!0)}else a.variants=f}
function Ie(a,b,c){for(const d of b)if(b=a.filter(e=>e.video&&e.video.codecs.startsWith(d)),b.length){a=b;break}for(const d of c)if(c=a.filter(e=>e.audio&&e.audio.codecs.startsWith(d)),c.length){a=c;break}return a}function Je(a,b){var c={width:Infinity,height:Infinity};a.variants=a.variants.filter(d=>Ke(d,b,c))}
function Ke(a,b,c){if(a&&a.video&&a.video.width&&a.video.height){var d=a.video.width;let e=a.video.height;e>d&&([d,e]=[e,d]);(c=!(d>=b.minWidth&&d<=Math.min(b.maxWidth,c.width))||!(e>=b.minHeight&&e<=Math.min(b.maxHeight,c.height)))||(d*=e,c=!(d>=b.minPixels&&d<=b.maxPixels));if(c)return!1}if(d=a&&a.video&&a.video.frameRate)d=a.video.frameRate,d=!(d>=b.minFrameRate&&d<=b.maxFrameRate);!d&&(d=a&&a.audio&&a.audio.channelsCount)&&(d=a.audio.channelsCount,d=!(d>=b.minChannelsCount&&d<=b.maxChannelsCount));
d||(a=a.bandwidth,d=!(a>=b.minBandwidth&&a<=b.maxBandwidth));return d?!1:!0}async function Le(a,b,c=[],d={}){await Me(a,b,b.offlineSessionIds.length>0,c,d);Ne(b);await Oe(b)}async function Me(a,b,c,d,e){A().sa()&&Pe(b.variants);await Qe(b.variants,c,!1,d);let f=null;a&&(a=a.g)&&(f=a.keySystem);b.variants=b.variants.filter(g=>{const h=Re(g,f,e);if(!h){const k=[];g.audio&&k.push(Se(g.audio));g.video&&k.push(Se(g.video))}return h})}
function Ne(a){a.textStreams=a.textStreams.filter(b=>{b=Rd(b.mimeType,b.codecs);return fe(b)})}async function Oe(a){const b=[];for(const d of a.imageStreams){let e=d.mimeType;e=="application/mp4"&&d.codecs=="mjpg"&&(e="image/jpg");if(!Te.has(e)){var c=Ue.get(e);c?(c=await Ve(c),Te.set(e,c)):Te.set(e,!1)}Te.get(e)&&b.push(d)}a.imageStreams=b}
function Pe(a){const b=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("dvi1","vvi1"),c=new Set;for(const d of a)d.video&&c.add(d.video);for(const d of c)for(const [e,f]of b)if(d.codecs.includes(e)){d.codecs=d.codecs.replace(e,f);break}}
async function Qe(a,b,c,d){if(!a.some(e=>e.decodingInfos.length)){for(const e of d){let f=!1;for(const g of a){const h=We(g,b,c).filter(k=>{k=k[0];k=k.keySystemConfiguration&&k.keySystemConfiguration.keySystem;return!k||k===e});for(const k of h)await Xe(g,k);g.decodingInfos.some(k=>k.supported)&&(f=!0)}if(f)return}for(const e of a){a=We(e,b,c).filter(f=>{f=f[0];f=f.keySystemConfiguration&&f.keySystemConfiguration.keySystem;return!f||!d.includes(f)});for(const f of a)await Xe(e,f)}}}
function Re(a,b,c){if(!a.decodingInfos.some(k=>!k.supported||b&&(k=k.keySystemAccess)&&(c[k.keySystem]||k.keySystem)!=b?!1:!0))return!1;var d=A(),e=d.m()==="Xbox";d=d.i()==="MOBILE"&&d.h()==="GECKO";const f=a.video,g=f&&f.width||0,h=f&&f.height||0;if(e&&f&&(g>1920||h>1080)&&(f.codecs.includes("avc1.")||f.codecs.includes("avc3."))||(e=f&&f.dependencyStream)&&!Tb(e))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")||a&&a.dependencyStream?!1:!0}
async function Xe(a,b){const c=(f,g)=>{if(f){const h=Ac(f);h.supported=f.supported&&g.supported;h.powerEfficient=f.powerEfficient&&g.powerEfficient;h.smooth=f.smooth&&g.smooth;g.keySystemAccess&&!h.keySystemAccess&&(h.keySystemAccess=g.keySystemAccess);return h}return g};let d=null;const e=[];for(const f of b){const g=Bc(f),h=Ye;h.has(g)?d=c(d,h.get(g)):e.push(Ze(f).then(k=>{let l=null;for(const m of k||[])l=c(l,m);l&&(h.set(g,l),d=c(d,l))}))}await Promise.all(e);d&&a.decodingInfos.push(d)}
function Ze(a){let b=[""];a.video&&(b=$d(a.video.contentType).split(","));let c=[""];a.audio&&(c=$d(a.audio.contentType).split(","));const d=[];for(const e of b)for(const f of c){const g=zc(a);a.video&&(g.video.contentType=Rd(Zd(g.video.contentType),e));a.audio&&(g.audio.contentType=Rd(Zd(g.audio.contentType),f));d.push(new Promise((h,k)=>{(A().i()=="MOBILE"?ve(5,navigator.mediaCapabilities.decodingInfo(g)):navigator.mediaCapabilities.decodingInfo(g)).then(l=>{h(l)}).catch(k)}))}return Promise.all(d).catch(()=>
{JSON.stringify(a);return null})}
function We(a,b,c){const d=a.audio,e=a.video;var f=[],g=[];if(e)for(var h of e.fullMimeTypes){var k=$d(h);if(k.includes(",")&&!d){var l=k.split(","),m=Zd(h);k=Nb("video",l);l=Nb("audio",l);l=$e(l,m);m=Ud(m,l,"audio");g.push({contentType:m,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}k=af(k);k={contentType:Ud(Zd(h),k,"video"),width:e.width||64,height:e.height||64,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||30};if(e.hdr)switch(e.hdr){case "PQ":k.transferFunction="pq";
break;case "HLG":k.transferFunction="hlg"}e.colorGamut&&(k.colorGamut=e.colorGamut);f.push(k)}if(d)for(var n of d.fullMimeTypes)h=Zd(n),k=$e($d(n),h),h=Ud(h,k,"audio"),g.push({contentType:h,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});n=[];f.length==0&&f.push(null);g.length==0&&g.push(null);for(var p of f)for(var q of g)f={type:c?"file":"media-source"},p&&(f.video=p),q&&(f.audio=q),n.push(f);g=(a.video?a.video.drmInfos:
[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[n];a=[];c=new Map;for(var r of g)c.get(r.keySystem)||c.set(r.keySystem,[]),c.get(r.keySystem).push(r);r=b?"required":"optional";b=b?["persistent-license"]:["temporary"];for(const t of c.keys()){p=c.get(t);g=new Map;for(const u of p)p=`${u.videoRobustness},${u.audioRobustness}`,g.get(p)||g.set(p,[]),g.get(p).push(u);for(const u of g.values()){g=[];for(const v of n){p=Object.assign({},v);q={keySystem:t,initDataType:"cenc",persistentState:r,
distinctiveIdentifier:"optional",sessionTypes:b};for(const x of u){if(x.initData&&x.initData.length){f=new Set;for(const y of x.initData)f.add(y.initDataType);q.initDataType=x.initData[0].initDataType}x.distinctiveIdentifierRequired&&(q.distinctiveIdentifier="required");x.persistentStateRequired&&(q.persistentState="required");x.sessionType&&(q.sessionTypes=[x.sessionType]);d&&(q.audio?(x.encryptionScheme&&(q.audio.encryptionScheme=q.audio.encryptionScheme||x.encryptionScheme),q.audio.robustness=
q.audio.robustness||x.audioRobustness):(q.audio={robustness:x.audioRobustness},x.encryptionScheme&&(q.audio.encryptionScheme=x.encryptionScheme)),q.audio.robustness==""&&delete q.audio.robustness);e&&(q.video?(x.encryptionScheme&&(q.video.encryptionScheme=q.video.encryptionScheme||x.encryptionScheme),q.video.robustness=q.video.robustness||x.videoRobustness):(q.video={robustness:x.videoRobustness},x.encryptionScheme&&(q.video.encryptionScheme=x.encryptionScheme)),q.video.robustness==""&&delete q.video.robustness)}p.keySystemConfiguration=
q;g.push(p)}a.push(g)}}return a}function $e(a,b){const c=A();return a.toLowerCase()=="flac"?c.h()!="WEBKIT"?"flac":"fLaC":a.toLowerCase()==="opus"?c.h()!="WEBKIT"?"opus":Vd(b)=="mp4"?"Opus":"opus":a.toLowerCase()=="ac-3"&&c.I()?"ec-3":a}function af(a){if(a.includes("avc1")){const b=a.split(".");if(b.length==3)return a=b.shift()+".",a+=parseInt(b.shift(),10).toString(16),a+=("000"+parseInt(b.shift(),10).toString(16)).slice(-4)}else if(a=="vp9")return"vp09.00.41.08";return a}
function Ve(a){return new Promise(b=>{const c=new Image;c.src=a;"decode"in c?c.decode().then(()=>{b(!0)}).catch(()=>{b(!1)}):c.onload=c.onerror=()=>{b(c.height===2)}})}
function bf(a){var b=a.audio;const c=a.video;var d=b?b.mimeType:null,e=c?c.mimeType:null;const f=b?b.codecs:null,g=c?c.codecs:null,h=b?b.groupId:null;var k=[];c&&k.push(c.mimeType);b&&k.push(b.mimeType);k=k[0]||null;var l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;const m=new Set;if(b)for(const n of b.roles)m.add(n);if(c)for(const n of c.roles)m.add(n);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,videoLabel:null,kind:l,width:null,height:null,frameRate:null,
pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:k,audioMimeType:d,videoMimeType:e,codecs:"",audioCodec:f,videoCodec:g,primary:a.primary,roles:Array.from(m),audioRoles:null,videoRoles:null,forced:!1,videoId:null,audioId:null,audioGroupId:h,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null};
if(c){a.videoId=c.id;a.originalVideoId=c.originalId;a.width=c.width||null;a.height=c.height||null;a.frameRate=c.frameRate||null;a.pixelAspectRatio=c.pixelAspectRatio||null;a.videoBandwidth=c.bandwidth||null;a.hdr=c.hdr||null;a.colorGamut=c.colorGamut||null;a.videoLayout=c.videoLayout||null;a.videoRoles=c.roles;a.videoLabel=c.label;if(d=c.dependencyStream)a.width=d.width||a.width,a.height=d.height||a.height,a.videoCodec=d.codecs||a.videoCodec,a.pixelAspectRatio=d.pixelAspectRatio||a.pixelAspectRatio,
a.videoBandwidth&&d.bandwidth&&(a.videoBandwidth+=d.bandwidth);if(g.includes(",")){a.channelsCount=c.channelsCount;a.audioSamplingRate=c.audioSamplingRate;a.spatialAudio=c.spatialAudio;a.originalLanguage=c.originalLanguage;a.audioMimeType=e;e=g.split(",");try{a.videoCodec=Nb("video",e),a.audioCodec=Nb("audio",e)}catch(n){}}}b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.spatialAudio=b.spatialAudio,
a.label=b.label,a.audioRoles=b.roles,a.accessibilityPurpose=b.accessibilityPurpose,a.originalLanguage=b.originalLanguage,e=b.dependencyStream)&&(a.audioCodec=e.codecs||a.audioCodec,a.audioBandwidth&&e.bandwidth&&(a.audioBandwidth+=e.bandwidth));c&&!a.videoBandwidth&&(b?a.audioBandwidth&&(a.videoBandwidth=a.bandwidth-a.audioBandwidth):a.videoBandwidth=a.bandwidth);b&&!a.audioBandwidth&&(c?a.videoBandwidth&&(a.audioBandwidth=a.bandwidth-a.videoBandwidth):a.audioBandwidth=a.bandwidth);b=[];a.videoCodec&&
b.push(a.videoCodec);a.audioCodec&&b.push(a.audioCodec);a.codecs=b.join(", ");return a}function cf(a){return{id:a.id,active:!1,type:K,bandwidth:a.bandwidth||0,language:a.language,label:a.label,kind:a.kind||null,mimeType:a.mimeType,codecs:a.codecs||null,primary:a.primary,roles:a.roles,accessibilityPurpose:a.accessibilityPurpose,forced:a.forced,originalTextId:a.originalId,originalLanguage:a.originalLanguage}}
function df(a){let b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=a.segmentIndex.xb());let e=a.tilesLayout;d&&(e=d.tilesLayout||e);e&&b!=null&&(b/=Number(e.split("x")[0]));e&&c!=null&&(c/=Number(e.split("x")[1]));return{id:a.id,type:"image",bandwidth:a.bandwidth||0,width:b,height:c,mimeType:a.mimeType,codecs:a.codecs||null,tilesLayout:e||null,originalImageId:a.originalId}}function ef(a){return{id:a.id,type:"chapter",bandwidth:a.bandwidth||0,language:a.language}}
function ff(a){a.__shaka_id==void 0&&(a.__shaka_id=gf++);return a.__shaka_id}function hf(a,b=!1){b={id:ff(a),active:b&&a.mode!="disabled",type:K,bandwidth:0,language:ye(a.language||"und"),label:a.label,kind:a.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:a.kind=="forced",originalTextId:a.id,originalLanguage:a.language};a.kind=="captions"&&(b.mimeType="unknown");a.kind=="subtitles"&&(b.mimeType="text/vtt");a.kind&&(b.roles=[a.kind]);return b}
function jf(a,b){var c=a?a.language:null;c={id:ff(a||b),active:a?a.enabled:b.selected,type:"variant",bandwidth:0,language:ye(c||"und"),label:a?a.label:null,videoLabel:null,kind:a?a.kind:null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:a?a.kind=="main":!1,roles:[],forced:!1,audioRoles:null,videoRoles:null,videoId:null,audioId:null,audioGroupId:null,
channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:b?b.id:null,originalAudioId:a?a.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:c};a&&a.kind&&(c.roles=[a.kind],c.audioRoles=[a.kind]);a&&a.configuration&&(a.configuration.codec&&(c.audioCodec=a.configuration.codec,c.codecs=c.audioCodec),a.configuration.bitrate&&(c.audioBandwidth=a.configuration.bitrate,c.bandwidth+=c.audioBandwidth),
a.configuration.sampleRate&&(c.audioSamplingRate=a.configuration.sampleRate),a.configuration.numberOfChannels&&(c.channelsCount=a.configuration.numberOfChannels));if(b&&b.configuration&&(b.configuration.codec&&(c.videoCodec=b.configuration.codec,c.codecs=c.codecs?c.codecs+(","+c.videoCodec):c.videoCodec),b.configuration.bitrate&&(c.videoBandwidth=b.configuration.bitrate,c.bandwidth+=c.videoBandwidth),b.configuration.framerate&&(c.frameRate=b.configuration.framerate),b.configuration.width&&(c.width=
b.configuration.width),b.configuration.height&&(c.height=b.configuration.height),b.configuration.colorSpace&&b.configuration.colorSpace.transfer))switch(b.configuration.colorSpace.transfer){case "pq":c.hdr="PQ";break;case "hlg":c.hdr="HLG";break;case "bt709":c.hdr="SDR"}return c}function kf(a){return a.allowedByApplication&&a.allowedByKeySystem&&a.disabledUntilTime==0}function lf(a){return a.filter(b=>kf(b))}
function mf(a,b,c,d){if(!b)return[];let e=a;const f=a.filter(h=>h.primary);f.length&&(e=f);const g=e.length?e[0].language:"";e=e.filter(h=>h.language==g);if(b){const h=Fe(ye(b),a.map(k=>k.language));if(h)e=a.filter(k=>ye(k.language)==h);else return[]}e=e.filter(h=>h.forced==d);if(c){if(a=nf(e,c),a.length)return a}else if(a=e.filter(h=>h.roles.length==0),a.length)return a;a=e.map(h=>h.roles).reduce((h,k)=>h.concat(k),[]);return a.length?nf(e,a[0]):e}
function nf(a,b){return a.filter(c=>c.roles.includes(b))}function of(a){const b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}function pf(a,b){b.length&&(b=b.filter(c=>Wd(a.codecs)==Wd(c.codecs)).sort((c,d)=>c.bandwidth&&d.bandwidth&&c.bandwidth!=d.bandwidth?c.bandwidth-d.bandwidth:(c.width||0)-(d.width||0)),a.trickModeVideo=b[0],b.length>1&&(b=b.find(c=>a.width==c.width&&a.height==c.height)))&&(a.trickModeVideo=b)}
function Se(a){return a.type=="audio"?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:a.type=="video"?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"}
function qf(a){const b={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};for(const c of a)a={id:0,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:null,mimeType:c?Zd(c):"",codecs:c?$d(c):"",supplementalCodecs:"",encrypted:!0,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"video",primary:!1,trickModeVideo:null,dependencyStream:null,
emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null},a.fullMimeTypes.add(Rd(a.mimeType,a.codecs)),c.startsWith("audio/")?(a.type="audio",b.audio=a):b.video=a;return b}var rf=class{};w("shaka.util.StreamUtils",rf);rf.meetsRestrictions=Ke;
var Ye=new Map,gf=0,Te=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Ue=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function sf(a){a.i.Ma(a.h,"resize");a.L?.stop();a.L=null}function tf(a,b,c,d,e){if(a.C){const f=a.C.Lg();f&&(c=c.filter(g=>g.bandwidth&&f?g.bandwidth<=f:!0))}b&&(c=c.filter(f=>Ke(f,b,{width:e,height:d})));return c.sort((f,g)=>f.bandwidth-g.bandwidth)}function uf(a){const b=[];for(const c of a){if(!c)continue;(a=c.video)&&a.height&&a.width&&b.push({height:a.height,width:a.width})}return b.sort((c,d)=>c.width-d.width)}
function vf(a){var b=a.h;a.g.droppedFrames&&b?.getVideoPlaybackQuality&&(b=b.getVideoPlaybackQuality(),a.I=b.droppedVideoFrames,a.J=b.totalVideoFrames)}function wf(a,b=!1){if(!b){if(!a.N){b=a.u;if(!(b.g>=b.i))return;a.N=!0;a.A-=(a.g.switchInterval-a.g.minTimeToSwitch)*1E3}if(Date.now()-a.A<a.g.switchInterval*1E3)return}b=a.chooseVariant();a.getBandwidthEstimate();b&&a.G&&(a.G(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch),vf(a))}
function xf(a){sf(a);const b=a.h;a.g.droppedFrames&&b?.getVideoPlaybackQuality&&(vf(a),yf(a),a.L=(new te(()=>{if(!a.h.paused&&a.o&&a.g.droppedFrames){var c=a.h.getVideoPlaybackQuality(),d=c.droppedVideoFrames;c=c.totalVideoFrames;if((isNaN(a.H)?1:Math.abs(a.H))>1||!c)a.I=d,a.J=c;else{var e=d-a.I,f=c-a.J;a.I=d;a.J=c;e/f>=a.g.advanced.droppedFramesThreshold&&a.K&&a.K("video",a.g.advanced.droppedFramesBanDuration)}}})).Aa(a.g.advanced.droppedFramesInterval))}
function yf(a){a.i.F(a.h,"resize",()=>{vf(a)})}
var Af=class{constructor(){this.K=this.G=null;this.o=!1;this.u=new ka;this.i=new Ca;navigator.connection&&navigator.connection.addEventListener&&this.i.F(navigator.connection,"change",()=>{this.g.useNetworkInformation&&navigator.onLine&&(this.u=new ka,this.g&&this.u.configure(this.g.advanced),this.trySuggestStreams())});this.m=[];this.H=1;this.N=!1;this.l=this.h=this.g=this.A=null;this.B=new te(()=>{if(this.o&&(this.g.restrictToElementSize||this.g.restrictToScreenSize)){const a=this.chooseVariant();
a&&this.G&&this.G(a,this.g.clearBufferSwitch,this.g.safeMarginSwitch)}});this.D=window;"documentPictureInPicture"in window&&this.i.F(window.documentPictureInPicture,"enter",()=>{this.D=window.documentPictureInPicture.window;this.B&&this.B.La();this.i.na(this.D,"pagehide",()=>{this.D=window;this.B&&this.B.La()})});this.L=this.C=this.j=null;this.J=this.I=0}stop(){this.G=null;this.o=!1;this.m=[];this.H=1;this.h=this.A=null;this.l?.disconnect();this.l=null;this.B?.stop();this.C=this.j=null;sf(this)}release(){this.stop();
this.i.release();this.B=null}init(a,b){this.G=a;this.K=b}chooseVariant(a=!1){var b=Infinity,c=Infinity;this.g.restrictToScreenSize&&(c=this.g.ignoreDevicePixelRatio?1:this.D.devicePixelRatio,b=this.D.screen.height*c,c*=this.D.screen.width);if(this.l&&this.g.restrictToElementSize){var d=this.g.ignoreDevicePixelRatio?1:this.D.devicePixelRatio,e=this.h.clientHeight,f=this.h.clientWidth;this.j&&document.pictureInPictureElement&&document.pictureInPictureElement==this.h&&(e=this.j.height,f=this.j.width);
b=Math.min(b,e*d);c=Math.min(c,f*d)}e=this.m.filter(h=>h&&!(h.audio&&h.audio.fastSwitching||h.video&&h.video.fastSwitching));e.length||(e=this.m);d=e;a&&e.length!=this.m.length&&(d=this.m.filter(h=>h&&(h.audio&&h.audio.fastSwitching||h.video&&h.video.fastSwitching?!0:!1)));a=tf(this,this.g.restrictions,d,Infinity,Infinity);if(b!=Infinity||c!=Infinity){a=uf(a);for(var g of a)if(g.height>=b&&g.width>=c){b=g.height;c=g.width;break}a=tf(this,this.g.restrictions,d,b,c)}b=this.getBandwidthEstimate();d.length&&
!a.length&&(a=tf(this,null,d,Infinity,Infinity),a=[a[0]]);g=a[0]||null;for(c=0;c<a.length;c++){d=a[c];f=isNaN(this.H)?1:Math.abs(this.H);e=f*d.bandwidth/this.g.bandwidthDowngradeTarget;let h={bandwidth:Infinity};for(let k=c+1;k<a.length;k++)if(d.bandwidth!=a[k].bandwidth){h=a[k];break}f=f*h.bandwidth/this.g.bandwidthUpgradeTarget;g&&d&&b>=e&&b<=f&&(g.bandwidth!=d.bandwidth||g.bandwidth==d.bandwidth&&g.video&&d.video&&(g.video.width<d.video.width||g.video.height<d.video.height))&&(g=d)}this.A=Date.now();
return g}enable(){this.o=!0;vf(this);this.m.length&&this.trySuggestStreams()}disable(){this.o=!1}segmentDownloaded(a,b,c){a>=this.g.cacheLoadThreshold&&this.u.sample(a,b);c&&this.A!=null&&this.o&&wf(this)}trySuggestStreams(){this.o&&(this.A=Date.now(),wf(this,!0))}getBandwidthEstimate(){var a=this.g.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(a=navigator.connection.downlink*1E6);if(navigator.connection&&navigator.connection.downlink&&
this.g.useNetworkInformation&&this.g.preferNetworkInformationBandwidth)return a;a=this.u.getBandwidthEstimate(a);return this.C?this.C.getBandwidthEstimate(a):a}setVariants(a){if(va(a,this.m))return!1;this.m=a;return!0}playbackRateChanged(a){this.H=a}setMediaElement(a){this.h=a;this.l&&(this.l.disconnect(),this.l=null);const b=()=>{this.B.ha(zf)};this.h&&"ResizeObserver"in window&&(this.l=new ResizeObserver(b),this.l.observe(this.h));this.i.F(a,"enterpictureinpicture",c=>{c.pictureInPictureWindow&&
(this.j=c.pictureInPictureWindow,this.i.F(this.j,"resize",b))});this.i.F(a,"leavepictureinpicture",()=>{this.j&&this.i.Ma(this.j,"resize",b);this.j=null});xf(this)}setCmsdManager(a){this.C=a}configure(a){this.g=a;this.u&&this.g&&this.u.configure(this.g.advanced);xf(this)}};w("shaka.abr.SimpleAbrManager",Af);Af.prototype.configure=Af.prototype.configure;Af.prototype.setCmsdManager=Af.prototype.setCmsdManager;Af.prototype.setMediaElement=Af.prototype.setMediaElement;
Af.prototype.playbackRateChanged=Af.prototype.playbackRateChanged;Af.prototype.setVariants=Af.prototype.setVariants;Af.prototype.getBandwidthEstimate=Af.prototype.getBandwidthEstimate;Af.prototype.trySuggestStreams=Af.prototype.trySuggestStreams;Af.prototype.segmentDownloaded=Af.prototype.segmentDownloaded;Af.prototype.disable=Af.prototype.disable;Af.prototype.enable=Af.prototype.enable;Af.prototype.chooseVariant=Af.prototype.chooseVariant;Af.prototype.init=Af.prototype.init;
Af.prototype.release=Af.prototype.release;Af.prototype.stop=Af.prototype.stop;var zf=1;var Bf=class{constructor(a=null){this.video=a}needsSkipUI(){return!0}isClientRendering(){return!0}hasCustomClick(){return!1}isUsingAnotherMediaElement(){return!1}getDuration(){return-1}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){return-1}isPaused(){return this.video?this.video.paused:!1}isSkippable(){return!1}getTimeUntilSkippable(){return 0}canSkipNow(){return!1}skip(){}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}getVolume(){return this.video?
this.video.volume:1}setVolume(a){this.video&&(this.video.volume=a)}isMuted(){return this.video?this.video.muted:!1}isLinear(){return!0}resize(){}setMuted(a){this.video&&(this.video.muted=a)}getSequenceLength(){return 1}getPositionInSequence(){return 1}getTitle(){return""}getDescription(){return""}getVastMediaBitrate(){return 0}getVastMediaHeight(){return 0}getVastMediaWidth(){return 0}getVastAdId(){return""}getAdId(){return""}getCreativeAdId(){return""}getAdvertiserName(){return""}getMediaUrl(){return null}getTimeOffset(){return 0}getPodIndex(){return 0}release(){this.video=
null}};w("shaka.ads.AbstractAd",Bf);var Cf=class{constructor(a,b){this.g=a;this.h=b}toString(){return"v"+this.g+"."+this.h}};var Gf=class{constructor(){var a=Df,b=Ef;this.g=Ff;this.i=a;this.h=b}};function Df(a,b,c,d){ma([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Ef(a,b,c,d){la([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(" "))}var Hf=null;function If(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}}
var Jf=class{constructor(a,b=!1){const c=If();this.l=a.maxAttempts==null?c.maxAttempts:a.maxAttempts;this.j=a.baseDelay==null?c.baseDelay:a.baseDelay;this.o=a.fuzzFactor==null?c.fuzzFactor:a.fuzzFactor;this.m=a.backoffFactor==null?c.backoffFactor:a.backoffFactor;this.g=0;this.h=this.j;if(this.i=b)this.g=1}async attempt(){if(this.g>=this.l)if(this.i)this.g=1,this.h=this.j;else throw new H(2,7,1010);const a=this.g;this.g++;if(a!=0){var b=this.h*(1+(Math.random()*2-1)*this.o);await new Promise(c=>{(new te(c)).ha(b/
1E3)});this.h*=this.m}}};function Kf(a){return new Lf(Promise.reject(a),()=>Promise.resolve())}function Mf(){const a=Promise.reject(new H(2,7,7001));a.catch(()=>{});return new Lf(a,()=>Promise.resolve())}function Nf(a){return new Lf(Promise.resolve(a),()=>Promise.resolve())}function Of(a){return new Lf(a,()=>a.catch(()=>{}))}function Rf(a){return new Lf(Promise.all(a.map(b=>b.promise)),()=>Promise.all(a.map(b=>b.abort())))}
function Sf(a,b,c){try{const d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),()=>d.abort();c.resolve(d);return()=>Promise.resolve(d).then(()=>{},()=>{})}catch(d){return c.reject(d),()=>Promise.resolve()}}
var Lf=class{constructor(a,b){this.promise=a;this.i=b;this.g=null}get aborted(){return this.g!==null}abort(){this.g||(this.g=this.i());return this.g}finally(a){this.promise.then(()=>a(!0),()=>a(!1));return this}Ra(a,b){const c=Promise.withResolvers();c.promise.catch(()=>{});const d=new H(2,7,7001);let e=()=>{c.reject(d);return this.abort()};const f=g=>h=>{if(this.g&&g)c.reject(d);else{var k=g?a:b;k?e=Sf(k,h,c):(g?c.resolve:c.reject)(h)}};this.promise.then(f(!0),f(!1));return new Lf(c.promise,()=>
e())}};w("shaka.util.AbortableOperation",Lf);Lf.prototype.chain=Lf.prototype.Ra;Lf.prototype["finally"]=Lf.prototype.finally;Lf.all=Rf;Lf.prototype.abort=Lf.prototype.abort;Lf.notAbortable=Of;Lf.completed=Nf;Lf.aborted=Mf;Lf.failed=Kf;function Tf(a){const b=new P(a.type);for(const c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}
var P=class{constructor(a,b){if(b)if(b instanceof Map)for(const c of b.keys())Object.defineProperty(this,c,{value:b.get(c),writable:!0,enumerable:!0});else for(const c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.g=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=
!0)}stopImmediatePropagation(){this.g=!0}stopPropagation(){}};w("shaka.util.FakeEvent",P);
var Uf={yj:"abrstatuschanged",zj:"adaptation",Aj:"audiotrackchanged",Bj:"audiotrackschanged",Cj:"boundarycrossed",Ej:"buffering",Dj:"bufferappending",Gj:"canupdatestarttime",Hj:"complete",Ij:"configurationchanged",Jj:"currentitemchanged",Kj:"downloadcompleted",Lj:"downloadfailed",Mj:"downloadheadersreceived",Nj:"drmsessionupdate",Oj:"emsg",Vj:"itemsinserted",Wj:"itemsremoved",lk:"prft",Error:"error",Pj:"expirationupdated",Qj:"firstquartile",Rj:"gapjumped",Xj:"keystatuschanged",$j:"loaded",bk:"loading",
dk:"manifestparsed",ek:"manifestupdated",fk:"mediaqualitychanged",gk:"mediasourcerecovered",hk:"metadataadded",Metadata:"metadata",ik:"midpoint",jk:"nospatialvideoinfo",kk:"onstatechange",nk:"programinformation",pk:"ratechange",tk:"segmentappended",vk:"sessiondata",wk:"spatialvideoinfo",xk:"stalldetected",yk:"started",zk:"statechanged",Ak:"streaming",Bk:"textchanged",Ck:"thirdquartile",Dk:"timelineregionadded",Ek:"timelineregionenter",Fk:"timelineregionexit",Gk:"trackschanged",Ik:"unloading",Lk:"variantchanged"};var Vf=class{constructor(){this.Ta=new Aa;this.Sd=this}addEventListener(a,b){this.Ta&&this.Ta.push(a,b)}removeEventListener(a,b){this.Ta&&this.Ta.remove(a,b)}dispatchEvent(a){if(!this.Ta)return!0;let b=this.Ta.get(a.type)||[];const c=this.Ta.get("All");c&&(b=b.concat(c));for(const d of b){a.target=this.Sd;a.currentTarget=this.Sd;try{d.handleEvent?d.handleEvent(a):d.call(this,a)}catch(e){}if(a.g)break}return a.defaultPrevented}release(){this.Ta=null}};function Wf(a,b){a.g.push(b.finally(()=>{ua(a.g,b)}))}var Xf=class{constructor(){this.g=[]}destroy(){const a=[];for(const b of this.g)b.promise.catch(()=>{}),a.push(b.abort());this.g=[];return Promise.all(a)}};function Yf(a,b,c,d=!1){c=c||Zf;const e=$f.get(a);(!e||c>=e.priority)&&$f.set(a,{priority:c,Ke:b,Ti:d})}function ag(a,b,c=null){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:c,attempt:0}}function bg(a,b){for(const c of a.g)b.g.add(c);for(const c of a.h)b.h.add(c)}
function cg(a,b,c,d){let e=Nf(void 0);for(const f of a.h)e=e.Ra(()=>{const g=c.response;g.data&&(g.data=cb(g.data));return f(b,g,d)});return e.Ra(()=>c,f=>{let g=2;if(f instanceof H){if(f.code==7001)throw f;g=f.severity}throw new H(g,1,1007,f);})}function dg(a){if(a){const b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.Hc)return!1}return!0}
function eg(a,b,c,d){let e=Nf(void 0);const f=g=>{e=e.Ra(()=>{c.body&&(c.body=cb(c.body));return g(b,c,d)})};a.D&&f(a.D);for(const g of a.g)f(g);return e.Ra(void 0,g=>{if(g instanceof H&&g.code==7001)throw g;throw new H(2,1,1006,g);})}
function fg(a,b,c,d,e,f,g){const h=c.attempt%c.uris.length,k=eg(a,b,c,d),l=Date.now();let m=0;k.promise.then(()=>{m=Date.now()-l},()=>{});a.i.forceHTTP&&(c.uris[h]=c.uris[h].replace("https://","http://"));a.i.forceHTTPS&&(c.uris[h]=c.uris[h].replace("http://","https://"));h>0&&a.G&&a.G(b,d,c.uris[h],c.uris[h-1]);var n=new Ma(c.uris[h]),p=n.Wb;let q=!1;p||(p=location.protocol,p=p.slice(0,-1),Na(n,p),c.uris[h]=n.toString());p=p.toLowerCase();const r=(p=$f.get(p))?p.Ke:null;if(!r)return Kf(new H(2,1,
1E3,n));const t=p.Ti;(n=a.l.get(n.wb))&&(c.headers[a.i.commonAccessTokenHeaderName]=n);let u=null,v=null,x=!1,y=!1,D;return k.Ra(()=>Of(e.attempt())).Ra(()=>{if(a.j)return Mf();D=Date.now();let z=0;c.requestStartTime=Date.now();const B=r(c.uris[h],c,b,(X,L,W)=>{u&&u.stop();v&&v.ha(J/1E3);a.o&&b==gg&&(z++,c.packetNumber=z,a.o(X,L,dg(d),c,d),q=!0,g.g=W)},X=>{y=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.m&&a.m(X,c,b)},{minBytesForProgressEvents:a.i.minBytesForProgressEvents});if(!t)return B;
const E=c.retryParameters.connectionTimeout;E&&(u=new te(()=>{x=!0;B.abort()}),u.ha(E/1E3));const J=c.retryParameters.stallTimeout;J&&(v=new te(()=>{x=!0;B.abort()}));return B}).Ra(z=>{u&&u.stop();v&&v.stop();z.timeMs==void 0&&(z.timeMs=Date.now()-D,z.timeMs+=m);var B=z.headers[a.i.commonAccessTokenHeaderName];if(B){const E=new Ma(z.uri);a.l.set(E.wb,B)}B={response:z,ui:q};!y&&a.m&&a.m(z.headers,c,b);a.A&&a.A(b,c,d,z);return B},z=>{u&&u.stop();v&&v.stop();if(a.B){var B=null;let E=0;z instanceof H&&
(B=z,z.code==1001&&(E=z.data[1]));a.B(b,c,d,B,E,x)}if(a.j)return Mf();x&&(z=new H(1,1,1003,c.uris[h],b));if(z instanceof H){if(z.code==7001)throw z;if(z.code==1010)throw f;if(z.severity==1){B=(new Map).set("error",z);B=new P("retry",B);B.cancelable=!0;a.dispatchEvent(B);if(B.defaultPrevented)throw z;++c.attempt;return fg(a,b,c,d,e,z,g)}}throw z;})}
var jg=class extends Vf{constructor(a,b,c,d,e,f,g){super();this.i=null;this.j=!1;this.u=new Xf;this.g=new Set;this.h=new Set;this.o=a||null;this.m=b||null;this.A=c||null;this.B=d||null;this.D=e||null;this.G=f||null;this.C=g||null;this.l=new Map}configure(a){this.i=a}Wi(a){this.g.add(a)}qj(a){this.g.delete(a)}Gh(){this.g.clear()}Xi(a){this.h.add(a)}rj(a){this.h.delete(a)}Hh(){this.h.clear()}Cg(){this.l.clear()}destroy(){this.j=!0;this.g.clear();this.h.clear();this.l.clear();super.release();return this.u.destroy()}request(a,
b,c){var d=new hg;if(this.j){var e=Promise.reject(new H(2,7,7001));e.catch(()=>{});return new ig(e,()=>Promise.resolve(),d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?zc(b.retryParameters):If();b.uris=zc(b.uris);b.attempt=0;e=fg(this,a,b,c,new Jf(b.retryParameters,!1),null,d);const f=e.Ra(k=>cg(this,a,k,c));let g=0;e.promise.then(()=>{g=Date.now()},()=>{});const h=f.Ra(k=>{const l=k.response;l.timeMs+=Date.now()-g;k.ui||!this.o||l.fromCache||b.method=="HEAD"||
a!=gg||this.o(l.timeMs,l.data.byteLength,dg(c),b,c);this.C&&this.C(a,l,c);return l},k=>{k&&(k.severity=2);throw k;});d=new ig(h.promise,()=>h.abort(),d);Wf(this.u,d);return d}};w("shaka.net.NetworkingEngine",jg);jg.prototype.request=jg.prototype.request;jg.prototype.destroy=jg.prototype.destroy;jg.makeRequest=ag;jg.defaultRetryParameters=function(){return If()};jg.prototype.clearCommonAccessTokenMap=jg.prototype.Cg;jg.prototype.clearAllResponseFilters=jg.prototype.Hh;
jg.prototype.unregisterResponseFilter=jg.prototype.rj;jg.prototype.registerResponseFilter=jg.prototype.Xi;jg.prototype.clearAllRequestFilters=jg.prototype.Gh;jg.prototype.unregisterRequestFilter=jg.prototype.qj;jg.prototype.registerRequestFilter=jg.prototype.Wi;jg.unregisterScheme=function(a){$f.delete(a)};jg.registerScheme=Yf;jg.prototype.configure=jg.prototype.configure;var hg=class{constructor(){this.g=0}};jg.NumBytesRemainingClass=hg;
var ig=class extends Lf{constructor(a,b,c){super(a,b);this.h=c}};jg.PendingRequest=ig;var gg=1;jg.RequestType={MANIFEST:0,SEGMENT:gg,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8,CMCD:9,SESSION_DATA:10,FINGERPRINT:11};
jg.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12,TRACKING_EVENT:13};var Zf=3;jg.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Zf};var $f=new Map;function kg(a,b){if(a.g){if(b instanceof H&&b.code==7003)throw b;throw new H(2,7,7003,b);}}var lg=class{constructor(a){this.g=!1;this.h=Promise.withResolvers();this.i=a}destroy(){if(this.g)return this.h.promise;this.g=!0;return this.i().then(()=>{this.h.resolve()},()=>{this.h.resolve()})}};function mg(a,b){const c=[];for(const d of a)c.push(b(d));return c}function ng(a,b){for(const c of a)if(!b(c))return!1;return!0};function og(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b}function pg(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};function qg(){return new H(2,3,3E3)}
var sg=class{constructor(a,b){this.h=eb(a);this.i=b==rg;this.g=0}Ha(){return this.g<this.h.byteLength}Na(){return this.g}mb(){return this.h.byteLength}Y(){try{const a=this.h.getUint8(this.g);this.g+=1;return a}catch(a){throw qg();}}Ca(){try{const a=this.h.getUint16(this.g,this.i);this.g+=2;return a}catch(a){throw qg();}}U(){try{const a=this.h.getUint32(this.g,this.i);this.g+=4;return a}catch(a){throw qg();}}Xf(){try{const a=this.h.getInt32(this.g,this.i);this.g+=4;return a}catch(a){throw qg();}}kd(){let a,
b;try{this.i?(a=this.h.getUint32(this.g,!0),b=this.h.getUint32(this.g+4,!0)):(b=this.h.getUint32(this.g,!1),a=this.h.getUint32(this.g+4,!1))}catch(c){throw qg();}if(b>2097151)throw new H(2,3,3001);this.g+=8;return b*4294967296+a}cb(a,b){if(this.g+a>this.h.byteLength)throw qg();const c=G(this.h,this.g,a);this.g+=a;return b?new Uint8Array(c):c}skip(a){if(this.g+a>this.h.byteLength)throw qg();this.g+=a}eh(a){if(this.g<a)throw qg();this.g-=a}seek(a){if(a<0||a>this.h.byteLength)throw qg();this.g=a}jd(){for(var a=
this.g;this.Ha()&&this.h.getUint8(this.g)!=0;)this.g+=1;a=G(this.h,a,this.g-a);this.g+=1;return ub(a)}};w("shaka.util.DataViewReader",sg);sg.prototype.readTerminatedString=sg.prototype.jd;sg.prototype.seek=sg.prototype.seek;sg.prototype.rewind=sg.prototype.eh;sg.prototype.skip=sg.prototype.skip;sg.prototype.readBytes=sg.prototype.cb;sg.prototype.readUint64=sg.prototype.kd;sg.prototype.readInt32=sg.prototype.Xf;sg.prototype.readUint32=sg.prototype.U;sg.prototype.readUint16=sg.prototype.Ca;
sg.prototype.readUint8=sg.prototype.Y;sg.prototype.getLength=sg.prototype.mb;sg.prototype.getPosition=sg.prototype.Na;sg.prototype.hasMoreData=sg.prototype.Ha;var rg=1;sg.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:rg};function tg(a){let b=0;for(const c of a)b=b<<8|c.charCodeAt(0);return b}function ug(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function vg(a){const b=wg(a);for(;a.reader.Ha()&&!a.parser.g;)a.parser.gd(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function wg(a){return 8+(a.has64BitSize?8:0)+(a.flags!=null?4:0)}function xg(a){const b=wg(a),c=a.reader.U();for(let d=0;d<c&&(a.parser.gd(a.start+b,a.reader,a.partialOkay,a.stopOnPartial),!a.parser.g);d++);}
function yg(a){const b=wg(a);for(a.reader.skip(78);a.reader.Ha()&&!a.parser.g;)a.parser.gd(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function zg(a){const b=wg(a);a.reader.skip(8);const c=a.reader.Ca();a.reader.skip(6);c==2?a.reader.skip(48):a.reader.skip(12);for(c==1&&a.reader.skip(16);a.reader.Ha()&&!a.parser.g;)a.parser.gd(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function Ag(a,b){return c=>{a(c.reader.cb(c.reader.mb()-c.reader.Na(),b))}}
var Dg=class{constructor(){this.i=new Map;this.h=new Map;this.g=!1}box(a,b){a=tg(a);this.i.set(a,Bg);this.h.set(a,b);return this}Ga(a,b){for(const c of a)this.box(c,b);return this}$(a,b){a=tg(a);this.i.set(a,Cg);this.h.set(a,b);return this}stop(){this.g=!0}parse(a,b,c){a=new sg(a,0);for(this.g=!1;a.Ha()&&!this.g;)this.gd(0,a,b,c)}gd(a,b,c,d){const e=b.Na();if(d&&e+8>b.mb())this.g=!0;else{var f=b.U(),g=b.U(),h=ug(g),k=!1;switch(f){case 0:f=b.mb()-e;break;case 1:if(d&&b.Na()+8>b.mb()){this.g=!0;return}f=
b.kd();k=!0}var l=this.h.get(g);if(l){let n=null;var m=null;if(this.i.get(g)==Cg){if(d&&b.Na()+4>b.mb()){this.g=!0;return}m=b.U();n=m>>>24;m&=16777215}g=e+f;c&&g>b.mb()&&(g=b.mb());d&&g>b.mb()?this.g=!0:(g-=b.Na(),b=g>0?b.cb(g,!1):new Uint8Array(0),b=new sg(b,0),l({name:h,parser:this,partialOkay:c||!1,stopOnPartial:d||!1,version:n,flags:m,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.min(e+f-b.Na(),b.mb()-b.Na()))}}};w("shaka.util.Mp4Parser",Dg);Dg.headerSize=wg;Dg.typeToString=ug;
Dg.allData=Ag;Dg.audioSampleEntry=zg;Dg.visualSampleEntry=yg;Dg.sampleDescription=xg;Dg.children=vg;Dg.prototype.parseNext=Dg.prototype.gd;Dg.prototype.parse=Dg.prototype.parse;Dg.prototype.stop=Dg.prototype.stop;Dg.prototype.fullBox=Dg.prototype.$;Dg.prototype.boxes=Dg.prototype.Ga;Dg.prototype.box=Dg.prototype.box;var Bg=0,Cg=1;function Eg(a,b,c,d){const e=a.length;let f=12+b.length+4+e;d>0&&(f+=4+16*c.size);const g=new Uint8Array(f),h=eb(g);let k=0;h.setUint32(k,f);k+=4;h.setUint32(k,1886614376);k+=4;d<1?h.setUint32(k,0):h.setUint32(k,16777216);k+=4;g.set(b,k);k+=b.length;if(d>0){h.setUint32(k,c.size);k+=4;for(const l of c)b=Fb(l),g.set(b,k),k+=b.length}h.setUint32(k,e);g.set(a,k+4);return g}
var Fg=class{constructor(a){this.g=[];this.data=[];(new Dg).Ga(["moov","moof"],vg).$("pssh",b=>{if(!(b.version>1)){var c=G(b.reader.h,-12,b.size);this.data.push(c);b=b.reader.cb(16,!1);this.g.push(Gb(b))}}).parse(a)}};function Gg(a,b){a=og(a);if(a.size!=0){a=Mb(a);for(const c of b)c.video&&(c.video.drmInfos=[a]),c.audio&&(c.audio.drmInfos=[a])}}function Hg(a,b){const c=[];b.forEach((d,e)=>{c.push({keySystem:e,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});for(const d of a)d.video&&(d.video.drmInfos=c),d.audio&&(d.audio.drmInfos=c)}
function Ig(a,b,c,d){const e=a.keySystem;if(e&&(!kb(e)||!a.licenseServerUri)){b.size&&b.get(e)&&(b=b.get(e),a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(e))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.serverCertificate||(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=
c.serverCertificateUri);d[e]&&(a.keySystem=d[e]);window.cast&&window.cast.__platform__&&e=="com.microsoft.playready"&&(a.keySystem="com.chromecast.playready")}}
async function Jg(){var a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");if(!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)){var b=
{};for(var c of a)b[c]=null;return b}const d="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");c=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];c={"com.widevine.alpha":c,"com.widevine.alpha.experiment":c,"com.microsoft.playready.recommendation":["150","2000","3000"]};const e={videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}],
initDataTypes:["cenc","sinf","skd","keyids"]},f=[null,"cenc","cbcs"],g=new Map,h=A(),k=async(n,p,q)=>{let r;try{r=await p.createMediaKeys()}catch(v){return}var t=p.getConfiguration().sessionTypes,u=t?t.includes("persistent-license"):!1;h.Z()&&(u=!1);t=p.getConfiguration().videoCapabilities;p=p.getConfiguration().audioCapabilities;u={persistentState:u,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]};g.get(n)?u=g.get(n):g.set(n,u);(n=t[0].encryptionScheme)&&
!u.encryptionSchemes.includes(n)&&u.encryptionSchemes.push(n);(n=t[0].robustness)&&!u.videoRobustnessLevels.includes(n)&&u.videoRobustnessLevels.push(n);(n=p[0].robustness)&&!u.audioRobustnessLevels.includes(n)&&u.audioRobustnessLevels.push(n);if(q&&"getStatusForPolicy"in r)for(const v of d)if(!u.minHdcpVersions.includes(v))if(await r.getStatusForPolicy({minHdcpVersion:v})=="usable")u.minHdcpVersions.includes(v)||u.minHdcpVersions.push(v);else break},l=async(n,p,q,r,t=!1)=>{try{const u=zc(e);for(const y of u.videoCapabilities)y.encryptionScheme=
p,y.robustness=q;for(const y of u.audioCapabilities)y.encryptionScheme=p,y.robustness=r;const v=zc(u);v.persistentState="required";v.sessionTypes=["persistent-license"];p=[v,u];let x;x=A().i()=="MOBILE"?await ve(5,navigator.requestMediaKeySystemAccess(n,p)):await navigator.requestMediaKeySystemAccess(n,p);await k(n,x,t)}catch(u){}},m=[];for(b of a){g.set(b,null);if(A().h()==="WEBKIT"&&kb(b))continue;a=!0;for(const n of f)m.push(l(b,n,"","",a)),a=!1;for(const n of c[b]||[])m.push(l(b,null,n,"")),m.push(l(b,
null,"",n))}await Promise.all(m);return pg(g)}
function Kg(a,b,c,d,e,f,g,h){var k=[];for(const m of a){b.includes(m.encryptionScheme)||b.push(m.encryptionScheme);kb(m.keySystem)&&m.licenseServerUri.startsWith("data:application/json;base64,")?k.includes(m.licenseServerUri)||k.push(m.licenseServerUri):c.includes(m.licenseServerUri)||c.push(m.licenseServerUri);e.includes(m.serverCertificateUri)||e.push(m.serverCertificateUri);m.serverCertificate&&(d.some(n=>ab(n,m.serverCertificate))||d.push(m.serverCertificate));if(m.initData)for(const n of m.initData)f.some(p=>
p.keyId&&p.keyId==n.keyId?!0:p.initDataType==n.initDataType&&ab(p.initData,n.initData))||f.push(n);if(m.keyIds)for(const n of m.keyIds)g.add(n);if(m.keySystemUris&&h)for(const n of m.keySystemUris)h.add(n)}if(k.length==1)c.push(k[0]);else if(k.length>0){a=[];for(var l of k)k=window.atob(l.split("data:application/json;base64,").pop()),k=JSON.parse(k),a.push(...k.keys);l=JSON.stringify({keys:a});c.push("data:application/json;base64,"+window.btoa(l))}}
function Lg(a){var b=a.X;const c=a.Z;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>d=="expired")&&a.m(new H(2,6,6014));a.D.Je(pg(c))}function Mg(a){const b=Date.now()/1E3;a.i.forEach((c,d)=>{var e=c.Sf;let f=d.expiration;isNaN(f)&&(f=Infinity);f!=e&&(a.D.onExpirationUpdated(d.sessionId,f),c.Sf=f);a.h.renewalIntervalSec>0&&(e=b-c.Dd,c.Dd>0&&e>=a.h.renewalIntervalSec&&Ng(a,d))})}
async function Og(a){a.B.release();a.B=null;a.l.reject();a.C.stop();a.C=null;a.K.stop();a.K=null;await Pg(a);if(a.o){try{await a.o.setMediaKeys(null)}catch(b){ma("DrmEngine.destroyNow_ exception",b)}a.o=null}a.g=null;a.u=null;a.A=new Map;a.h=null;a.m=()=>{};a.D=null;a.N=!1;a.H=null}
async function Pg(a){const b=Array.from(a.i.entries());a.i.clear();await Promise.all(b.map(async([c,d])=>{try{a.W||a.A.has(c.sessionId)||d.type!=="persistent-license"||a.h.persistentSessionOnlinePlayback?await Qg(a,c):await c.remove()}catch(e){}}))}
async function Rg(a,b,c){Gg(a.h.clearKeys,b);const d=b.some(k=>k.video&&k.video.drmInfos.length||k.audio&&k.audio.drmInfos.length?!0:!1),e=og(a.h.servers),f=og(a.h.advanced||{});!d&&c&&Hg(b,e);c=new WeakSet;for(var g of b){const k=(g.video?g.video.drmInfos:[]).concat(g.audio?g.audio.drmInfos:[]);for(var h of k)c.has(h)||(c.add(h),Ig(h,e,f,a.h.keySystemsMapping))}g=(k,l)=>{const m=[];for(const n of k)if(k=n[l]||f.has(n.keySystem)&&f.get(n.keySystem)[l]||"",k==""&&lb(n.keySystem)&&(l=="audioRobustness"?
k=[a.h.defaultAudioRobustnessForWidevine]:l=="videoRobustness"&&(k=[a.h.defaultVideoRobustnessForWidevine])),typeof k==="string")m.push(n);else if(Array.isArray(k)){k.length===0&&(k=[""]);for(const p of k)m.push(Object.assign({},n,{[l]:p}))}return m};h=new WeakSet;for(const k of b)k.video&&!h.has(k.video)&&(k.video.drmInfos=g(k.video.drmInfos,"videoRobustness"),k.video.drmInfos=g(k.video.drmInfos,"audioRobustness"),h.add(k.video)),k.audio&&!h.has(k.audio)&&(k.audio.drmInfos=g(k.audio.drmInfos,"videoRobustness"),
k.audio.drmInfos=g(k.audio.drmInfos,"audioRobustness"),h.add(k.audio));await Qe(b,a.O,a.N,a.h.preferredKeySystems);kg(a.j);if(!(d||e.size>0))return a.P=!0,Promise.resolve();b=Sg(a,b);return d?b:b.catch(()=>{})}function Tg(a,b,c){a.W=!0;a.A=new Map;a.O=c;return Rg(a,b,!1)}
function Ug(a,b,c,d=!0){a.A=new Map;for(const e of c)a.A.set(e,{initData:null,initDataType:null});for(const e of a.h.persistentSessionsMetadata)a.A.set(e.sessionId,{initData:e.initData,initDataType:e.initDataType});a.O=a.A.size>0;return Rg(a,b,d)}
async function Sg(a,b){const c=new Map;b=Vg(a,b,c);if(!b){if(!navigator.requestMediaKeySystemAccess)throw new H(2,6,6020);throw new H(2,6,6001);}kg(a.j);try{b.getConfiguration();const d=a.h.keySystemsMapping[b.keySystem]||b.keySystem;a.g=Wg(a,d,c.get(d));if(!a.g.licenseServerUri)throw new H(2,6,6012,a.g.keySystem);const e=await b.createMediaKeys();kg(a.j);a.u=e;if(a.h.minHdcpVersion!=""&&"getStatusForPolicy"in a.u)try{if(await a.u.getStatusForPolicy({minHdcpVersion:a.h.minHdcpVersion})!="usable")throw new H(2,
6,6018);kg(a.j)}catch(f){if(f instanceof H)throw f;throw new H(2,6,6019,f.message);}a.P=!0;a.C.Aa(a.h.updateExpirationTime);await Xg(a);kg(a.j)}catch(d){kg(a.j,d);a.g=null;if(d instanceof H)throw d;throw new H(2,6,6002,d.message);}}
async function Yg(a,b,c,d,e,f){var g=[];f.length&&g.push(f[0].contentType);e.length&&g.push(e[0].contentType);const h=k=>{k=Lb(b,k,null);k.licenseServerUri=c;k.serverCertificate=d;k.persistentStateRequired=!0;k.sessionType="persistent-license";return k};g=qf(g);g.video&&(f=h(f[0].encryptionScheme||""),g.video.drmInfos.push(f));g.audio&&(e=h(e[0].encryptionScheme||""),g.audio.drmInfos.push(e));await Qe([g],!0,a.N,[]);kg(a.j);return Sg(a,[g])}
async function Zg(a){if(!a.o.mediaKeys){if(a.H)await a.H;else try{a.H=a.o.setMediaKeys(a.u),await a.H}catch(b){a.m(new H(2,6,6003,b.message))}kg(a.j)}}
function $g(a,b,c){if(c.length){try{c=a.h.initDataTransform(c,b,a.g)}catch(d){b=d;d instanceof H||(b=new H(2,6,6016,d));a.m(b);return}if(a.h.ignoreDuplicateInitData){const d=a.i.values();for(const f of d)if(ab(c,f.initData))return;let e=!1;a.A.forEach(f=>{!e&&ab(c,f.initData)&&(e=!0)});if(e)return}a.J=!0;a.i.size>0&&ah(a)&&(a.l.resolve(),a.J=!1,a.l=Promise.withResolvers(),a.l.promise.catch(()=>{}));bh(a,b,c,a.g.sessionType)}}async function ch(a,b){await Zg(a);$g(a,b.initDataType,G(b.initData))}
async function dh(a){if(a.A.size){a.A.forEach((c,d)=>{eh(a,d,c)});await a.l.promise;if((a.g&&a.g.keyIds||new Set([])).size>0&&fh(a))return a.l.promise;a.J=!1;a.l=Promise.withResolvers();a.l.promise.catch(()=>{})}const b=(a.g?a.g.initData:[])||[];for(const c of b)$g(a,c.initDataType,c.initData);ah(a)&&a.l.resolve();return a.l.promise}
async function Xg(a){if(a.u&&a.g){if(a.g.serverCertificateUri&&(!a.g.serverCertificate||!a.g.serverCertificate.length)){const b=ag([a.g.serverCertificateUri],a.h.retryParameters);try{const c=await a.D.dc.request(5,b,{isPreload:a.S()}).promise;a.g.serverCertificate=G(c.data)}catch(c){throw new H(2,6,6017,c);}if(a.j.g)return}if(a.g.serverCertificate&&a.g.serverCertificate.length)try{await a.u.setServerCertificate(a.g.serverCertificate)}catch(b){throw new H(2,6,6004,b.message);}}}
async function eh(a,b,c){let d;try{d=a.u.createSession("persistent-license")}catch(e){return b=new H(2,6,6005,e.message),a.m(b),Promise.reject(b)}a.B.F(d,"message",e=>{gh(a)?a.L.push(e):hh(a,e)});a.B.F(d,"keystatuseschange",e=>ih(a,e));c={initData:c.initData,initDataType:c.initDataType,loaded:!1,Sf:Infinity,eb:null,type:"persistent-license",Dd:0,Sg:!1};a.i.set(d,c);try{const e=await d.load(b);kg(a.j);e||(a.i.delete(d),a.m(new H(a.h.persistentSessionOnlinePlayback?1:2,6,6013)),c.loaded=!0);jh(a,c);
kh(a);return d}catch(e){kg(a.j,e),a.i.delete(d),a.m(new H(a.h.persistentSessionOnlinePlayback?1:2,6,6005,e.message)),c.loaded=!0,kh(a)}return Promise.resolve()}async function lh(a,b){if(b=await eh(a,b,{initData:null,initDataType:null})){var c=[],d=a.i.get(b);d&&(d.eb=Promise.withResolvers(),c.push(d.eb.promise));c.push(b.remove());await Promise.all(c);a.i.delete(b)}}function fh(a){const b=a.g&&a.g.keyIds||new Set([]);for(const c of b)if(a.X.get(c)!=="usable")return!1;return!0}
function ah(a){a=a.i.values();return ng(a,b=>b.loaded)}
function Wg(a,b,c){const d=[],e=[],f=[],g=[],h=[],k=new Set,l=new Set;Kg(c,d,e,g,f,h,k,l);a=a.O?"persistent-license":"temporary";b={keySystem:b,encryptionScheme:d[0],licenseServerUri:e[0],distinctiveIdentifierRequired:c[0].distinctiveIdentifierRequired,persistentStateRequired:c[0].persistentStateRequired,sessionType:c[0].sessionType||a,audioRobustness:c[0].audioRobustness||"",videoRobustness:c[0].videoRobustness||"",serverCertificate:g[0],serverCertificateUri:f[0],initData:h,keyIds:k,mediaTypes:c[0].mediaTypes};
l.size>0&&(b.keySystemUris=l);for(const m of c)m.distinctiveIdentifierRequired&&(b.distinctiveIdentifierRequired=m.distinctiveIdentifierRequired),m.persistentStateRequired&&(b.persistentStateRequired=m.persistentStateRequired);return b}
function bh(a,b,c,d,e=!1){let f;try{f=a.u.createSession(d)}catch(g){return a.m(new H(2,6,6005,g.message)),null}a.B.F(f,"message",g=>{gh(a)?a.L.push(g):hh(a,g)});a.B.F(f,"keystatuseschange",g=>ih(a,g));a.i.set(f,{initData:c,initDataType:b,loaded:!1,Sf:Infinity,eb:null,type:d,Dd:0,Sg:e});f.closed.then(g=>{if(!a.j.g){var h=a.i.get(f);if(h){var k=f;g=g||"unknown";g!=="unknown"&&(a.i.delete(k),mh(a,g,h))}}}).catch(()=>{});a.h.logLicenseExchange&&Db(c);f.generateRequest(b,c).catch(g=>{if(!a.j.g){a.i.delete(f);
var h=g.errorCode;if(h&&h.systemCode){var k=h.systemCode;k<0&&(k+=4294967296);k="0x"+k.toString(16)}a.m(new H(2,6,6006,g.message,g,k))}});return f}function nh(a){a=a.i.keys();a=mg(a,b=>b.sessionId);return Array.from(a)}
async function Ng(a,b){const c=a.i.get(b);c&&(c.Dd=Date.now()/1E3);if(a.g){var d=a.g.keySystem,e=b,f={sessionId:b.sessionId,sessionType:a.g.sessionType,initData:c?c.initData:null,initDataType:c?c.initDataType:null};try{if(nb(d)){const g=yb("renew");await b.update(g)}else if(mb(d)&&c&&c.initData&&c.initDataType)e=await oh(a,b,c);else{ma("Manual license renewal is not supported for "+d);return}}catch(g){return}b=a.i.get(e);e={sessionId:e.sessionId,sessionType:a.g.sessionType,initData:b?b.initData:null,
initDataType:b?b.initDataType:null};f=new P("licenserenewal",(new Map).set("oldSessionMetadata",f).set("newSessionMetadata",e));a.D.onEvent(f)}}async function Qg(a,b){let c=null;try{c=(await ve(ph,Promise.all([b.close().catch(()=>{}),b.closed])))[1]}catch(d){}c&&c!=="unknown"&&mh(a,c)}function qh(a){return a.I?a.I:NaN}
function Vg(a,b,c){for(var d of b){var e=(d.video?d.video.drmInfos:[]).concat(d.audio?d.audio.drmInfos:[]);for(const g of e)c.getOrInsertComputed(g.keySystem,()=>[]).push(g)}if(c.size==1&&c.has(""))throw new H(2,6,6E3);d=a.h.preferredKeySystems;d.length||(e=og(a.h.servers),e.size==1&&(d=Array.from(e.keys())));for(const g of d)for(var f of b)if(e=f.decodingInfos.find(h=>h.supported&&h.keySystemAccess!=null&&h.keySystemAccess.keySystem==g))return e.keySystemAccess;for(const g of[!0,!1])for(const h of b)for(const k of h.decodingInfos){if(!k.supported||
!k.keySystemAccess)continue;f=k.keySystemAccess.keySystem;if(d.includes(f))continue;e=c.get(f);!e&&a.h.keySystemsMapping[f]&&(e=c.get(a.h.keySystemsMapping[f]));for(const l of e)if(!!l.licenseServerUri==g)return k.keySystemAccess}return null}function kh(a){ah(a)&&a.l.resolve()}function jh(a,b){(new te(()=>{b.loaded=!0;kh(a)})).ha(rh)}
function ih(a,b){b=b.target;const c=a.i.get(b);let d=!1;b.keyStatuses.forEach((f,g)=>{if(typeof g=="string"){var h=g;g=f;f=h}h=A();if(mb(a.g.keySystem)&&g.byteLength==16&&h.L()){h=eb(g);const k=h.getUint32(0,!0),l=h.getUint16(4,!0),m=h.getUint16(6,!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}c&&f!="status-pending"&&(c.loaded=!0);f=="expired"&&(d=!0);g=Gb(g).slice(0,32);a.X.set(g,f)});const e=b.expiration-Date.now();(e<0||d&&e<1E3)&&c&&!c.eb&&(a.i.delete(b),Qg(a,b));ah(a)&&(a.l.resolve(),
a.K.ha(sh))}function gh(a){return a.o?a.h.delayLicenseRequestUntilPlayed&&a.o.paused&&!a.ba:!a.W&&a.h.delayLicenseRequestUntilPlayed}
async function hh(a,b){var c=b.target;a.h.logLicenseExchange&&Db(b.message);const d=a.i.get(c);var e=a.g.licenseServerUri;const f=a.h.advanced[a.g.keySystem];b.messageType=="individualization-request"&&f&&f.individualizationServer&&(e=f.individualizationServer);e=ag([e],a.h.retryParameters);e.body=b.message;e.method="POST";e.licenseRequestType=b.messageType;e.sessionId=c.sessionId;e.drmInfo=a.g;d&&(e.initData=d.initData,e.initDataType=d.initDataType,d.Sg&&(e.licenseRequestType="license-renewal"));
if(f&&f.headers)for(const m in f.headers)e.headers[m]=f.headers[m];if(kb(a.g.keySystem)){b=a.g;try{var g=xb(e.body);if(g){var h=JSON.parse(g);h.type||(h.type=b.sessionType,e.body=yb(JSON.stringify(h)))}}catch(m){}}if(mb(a.g.keySystem))if(g=vb(e.body,!0,!0),g.includes("PlayReadyKeyMessage")){g=Fc(g,"PlayReadyKeyMessage");h=Pc(g,"HttpHeader");for(var k of h)h=Pc(k,"name")[0],b=Pc(k,"value")[0],e.headers[Nc(h)]=Nc(b);k=Pc(g,"Challenge")[0];e.body=Eb(Nc(k))}else e.headers["Content-Type"]="text/xml; charset=utf-8";
k=Date.now();try{const m=a.D.dc.request(2,e,{isPreload:a.S()});a.T.push(m);var l=await m.promise;ua(a.T,m)}catch(m){if(a.j.g)return;l=new H(2,6,6007,m,{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType});if(a.h.failureCallback)try{a.h.failureCallback(l)}catch(n){}if(l.handled){d&&d.eb&&d.eb.reject(l);return}a.i.size==1?(a.m(l),d&&d.eb&&d.eb.reject(l)):(d&&d.eb&&d.eb.reject(l),a.i.delete(c),ah(a)&&(a.l.resolve(),a.K.ha(.1)));return}if(!a.j.g){a.I+=(Date.now()-
k)/1E3;a.h.logLicenseExchange&&Db(l.data);try{await c.update(l.data),d&&(d.Dd=Date.now()/1E3)}catch(m){c=new H(2,6,6008,m&&m.message||String(m));a.m(c);d&&d.eb&&d.eb.reject(c);return}a.j.g||(c=new P("drmsessionupdate"),a.D.onEvent(c),d&&(d.eb&&d.eb.resolve(),jh(a,d)))}}async function th(a){a.J&&!gh(a)&&(await a.l.promise,await Promise.all(a.T.map(b=>b.promise)))}
function mh(a,b,c){if(b==="internal-error")a.m(new H(2,6,6005,"CDM reported internal error"));else if(b!=="closed-by-application"&&b!=="release-acknowledged"&&b!=="resource-evicted"&&b==="hardware-context-reset"&&c)if(c.initDataType&&c.initData)try{bh(a,c.initDataType,c.initData,c.type)}catch(d){a.m(new H(2,6,6005,"Failed to recreate session after hardware context reset: "+d.message))}else a.m(new H(2,6,6005,"Cannot recreate session after hardware reset: missing metadata"))}
async function oh(a,b,c){a.i.delete(b);await Qg(a,b);a=bh(a,c.initDataType,c.initData,a.g.sessionType,!0);if(!a)throw new H(2,6,6005,"Failed to create new session for renewal");return a}
var vh=class{constructor(a){this.D=a;this.o=this.u=null;this.W=this.P=!1;this.I=0;this.g=null;this.B=new Ca;this.i=new Map;this.T=[];this.A=new Map;this.J=!1;this.l=Promise.withResolvers();this.h=null;this.m=b=>{b.severity==2&&this.l.reject(b);a.onError(b)};this.X=new Map;this.Z=new Map;this.K=new te(()=>Lg(this));this.O=!1;this.L=[];this.ba=!1;this.C=new te(()=>{Mg(this)});this.l.promise.catch(()=>{});this.j=new lg(()=>Og(this));this.N=!1;this.G=this.H=null;this.S=()=>!1}destroy(){return this.j.destroy()}configure(a,
b){this.h=a;b&&(this.S=b);this.C&&this.P&&this.g&&this.C.Aa(this.h.updateExpirationTime)}async Hb(a){if(this.o!==a)if(this.u){var b=A();this.o=a;this.h.delayLicenseRequestUntilPlayed&&this.B.na(this.o,"play",()=>{for(const c of this.L)hh(this,c);this.ba=!0;this.L=[]});(a=uh(b,this.o))?this.B.Pb(a,["connect","connecting","disconnect"],()=>{Pg(this)}):"webkitCurrentPlaybackTargetIsWireless"in this.o&&this.B.F(this.o,"webkitcurrentplaybacktargetiswirelesschanged",()=>Pg(this));this.G=this.g?this.g.initData.find(c=>
c.initData.length>0)||null:null;(b=b.P(this.g.keySystem))||!this.G&&this.g.keySystem==="com.apple.fps"&&!this.A.size||await Zg(this);dh(this).catch(()=>{});!b&&(this.G||this.A.size||this.h.parseInbandPsshEnabled)||this.B.F(this.o,"encrypted",c=>ch(this,c))}else this.B.na(a,"encrypted",()=>{this.m(new H(2,6,6010))})}Gf(){var a=this.i.keys();a=mg(a,b=>{const c=this.i.get(b);return{sessionId:b.sessionId,sessionType:c.type,initData:c.initData,initDataType:c.initDataType}});return Array.from(a)}ag(a){this.i.forEach((b,
c)=>{a!=void 0&&c.sessionId!=a||Ng(this,c)})}async eg(a,b=.1){kg(this.j);let c=null,d=null;this.i.forEach((g,h)=>{h.sessionId===a.sessionId&&(c=h,d=g)});if(!(c&&d&&this.g&&d.initData&&d.initDataType))return!1;const e=d.initData,f=d.initDataType;b>0&&await we(b);try{this.i.delete(c);await Qg(this,c);if(!bh(this,f,e,this.g.sessionType,!1))throw new H(2,6,6005,"Failed to create new session for license retry");return!0}catch(g){return!1}}vd(){let a=Infinity;const b=this.i.keys();for(const c of b)isNaN(c.expiration)||
(a=Math.min(a,c.expiration));return a}me(){return pg(this.Z)}},ph=1,rh=5,sh=.5;function wh(a,b){const c=a.g!==b;a.g=b;c&&b===xh&&(a.i=Date.now());return c}var zh=class{constructor(){this.g=xh;this.j=(new Map).set(xh,2).set(yh,1);this.i=0;this.h=-1}},yh=0,xh=1;function Ah(a,b){const c=Bh(a,b);if(b){const d=a.g?a.g.g:null;if(d&&a.g.u){const e=new Set;for(const f of b.variants)f.audio&&e.add(f.audio),f.video&&e.add(f.video);for(const f of e)Ch(a,d.keySystem,f)}Dh(a,b)}return c}
async function Eh(a,b){await Le(a.g,b,a.h.drm.preferredKeySystems,a.h.drm.keySystemsMapping);if(!a.h.streaming.dontChooseCodecs){const c=a.h.preferredVideo.map(f=>f.codec).filter(Boolean),d=a.h.preferredAudio.map(f=>f.codec).filter(Boolean),e=a.h.preferredText.map(f=>f.format).filter(Boolean);He(b,c,d,a.h.preferredDecodingAttributes,e)}if(!b.variants.some(kf))throw new H(2,4,4032);return Ah(a,b)}
function Bh(a,b){var c=b.variants;b=a.h.restrictions;a=a.i;let d=!1;for(const e of c)c=e.allowedByApplication,e.allowedByApplication=Ke(e,b,a),c!=e.allowedByApplication&&(d=!0);return d}function Ch(a,b,c){for(const d of c.drmInfos)if(d.keySystem==b){for(const e of d.initData||[])$g(a.g,e.initDataType,e.initData);c=a.g;c.g&&(c.g.mediaTypes!==d.mediaTypes&&(c.g.mediaTypes=d.mediaTypes),hb(d)&&(c.g=Wg(c,c.g.keySystem,[c.g,d])))}}
function Dh(a,b){const c=a.g?a.g.me():{};a=Object.keys(c);const d=a.length&&a[0]=="00";a=!1;const e=new Set,f=new Set,g=new WeakSet,h=k=>{if(k&&!g.has(k)&&(g.add(k),k.keyIds.size))for(const l of k.keyIds)(k=c[d?"00":l])?Fh.includes(k)&&f.add(k):e.add(l)};for(const k of b.variants){if(!k.allowedByApplication)a=!0;else if(k.allowedByKeySystem)return;h(k.audio);h(k.video)}b={hasAppRestrictions:a,missingKeys:Array.from(e),restrictedKeyStatuses:Array.from(f)};throw new H(2,4,4012,b);}
var Gh=class{constructor(a,b,c){this.h=a;this.i=b;this.g=c}},Fh=["output-restricted","internal-error"];w("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});function Hh(a){return Ih.getOrInsertComputed(a,()=>(window.ManagedMediaSource||window.MediaSource)?.isTypeSupported(a)??!1)}function Jh(){const a=window.ManagedMediaSource||window.MediaSource;return a&&a.prototype?!!a.prototype.setLiveSeekableRange&&!!a.prototype.clearLiveSeekableRange:!1}var Ih=new Map;function Kh(a,b){let c=null,d=null,e=null,f=null;const g=a.U();b&1&&(e=a.kd());b&2&&(f=a.U());b&8&&(c=a.U());b&16&&(d=a.U());return{trackId:g,qc:c,Rc:d,Ch:e,fh:f}}function Lh(a,b){return b==1?(b=a.U(),a=a.U(),{Fa:b*4294967296+a}):{Fa:a.U()}}function Mh(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.U();a.skip(4);a=a.Ca();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
function Nh(a,b,c){const d=a.U(),e=[];let f=null;c&1&&(f=a.Xf());c&4&&a.skip(4);for(let g=0;g<d;g++){const h={Jd:null,sampleSize:null,Ne:null};c&256&&(h.Jd=a.U());c&512&&(h.sampleSize=a.U());c&1024&&a.skip(4);c&2048&&(h.Ne=b==0?a.U():a.Xf());e.push(h)}return{Qk:d,Id:e,je:f}}
function Oh(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));const c=a.U();b==1?a.skip(8):a.skip(4);a.skip(4);a.skip(8);a.skip(2);a.skip(2);a.skip(2);a.skip(2);a.skip(36);b=a.Ca()+a.Ca()/16;a=a.Ca()+a.Ca()/16;return{trackId:c,width:b,height:a}}function Ph(a){a.skip(6);a.skip(2);a.skip(8);const b=a.Ca();a.skip(2);a.skip(2);a.skip(2);a=a.Ca()+a.Ca()/65536;return{channelCount:b,sampleRate:a}}function Qh(a,b=!1){a=a.toString(16).toUpperCase();return b?a:("0"+a).slice(-2)}
function Rh(a){a=a.U();return{codec:ug(a)}}function Sh(a){a.Y();a.Y();a.Y();a.Y();a=a.cb(16,!1);return{defaultKID:Gb(a)}}
function Th(a){let b=null,c=null;var d=a.cb(4,!1);let e;e=String.fromCharCode(d[0]);e+=String.fromCharCode(d[1]);e+=String.fromCharCode(d[2]);e+=String.fromCharCode(d[3]);if(e==="nclx"){switch(a.Ca()){case 1:case 5:case 6:case 7:b="srgb";break;case 9:b="rec2020";break;case 11:case 12:b="p3"}d=a.Ca();a.Ca();switch(d){case 1:case 6:case 13:case 14:case 15:c="SDR";break;case 16:c="PQ";break;case 18:c="HLG"}}return{colorGamut:b,Od:c}}function Uh(a){return(a<10?"0":"")+a};function Vh(a){return a.encrypted&&a.drmInfos.length>0}function Wh(a,...b){var c=0;for(var d of b)c+=d.byteLength;a=Xh(a,c);c=8;for(d=0;d<b.length;d++)a.set(b[d],c),c+=b[d].byteLength;return a}function Xh(a,b){let c=Yh.get(a);c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],Yh.set(a,c));a=8+b;b=new Uint8Array(a);b[0]=a>>24&255;b[1]=a>>16&255;b[2]=a>>8&255;b[3]=a&255;b.set(c,4);return b}
function Zh(a){if(a.g.length===0)throw Error("StreamInfos must have elements");var b=[];for(var c of a.g){var d=b,e=d.push;var f=c.id+1;var g=c.stream.width||0;var h=c.stream.height||0;c.type=="audio"&&(h=g=0);var k=c.duration*c.timescale,l=Math.floor(k/($h+1));k=Math.floor(k%($h+1));const n=ai.value();bi(n,f,20);bi(n,l,28);bi(n,k,32);ci(n,g,88);ci(n,h,92);f=Wh("tkhd",n);h=c.duration*c.timescale;g=Math.floor(h/($h+1));h=Math.floor(h%($h+1));l=c.stream.language;l=l.charCodeAt(0)-96<<10|l.charCodeAt(1)-
96<<5|l.charCodeAt(2)-96;k=di.value();bi(k,c.timescale,20);bi(k,g,24);bi(k,h,28);ci(k,l,32);g=Wh("mdhd",k);h=new Uint8Array([]);switch(c.type){case "video":h=ei.value();break;case "audio":h=fi.value()}h=Wh("hdlr",h);a:{switch(c.type){case "video":l=Wh("minf",Wh("vmhd",gi.value()),hi.value(),ii(c));break a;case "audio":l=Wh("minf",Wh("smhd",ji.value()),hi.value(),ii(c));break a}l=new Uint8Array([])}g=Wh("mdia",g,h,l);f=Wh("trak",f,g);e.call(d,f)}d=a.g[0];c=d.duration*d.timescale;e=Math.floor(c/($h+
1));c=Math.floor(c%($h+1));f=ki.value();bi(f,d.timescale,20);bi(f,e,24);bi(f,c,28);e=Wh("mvhd",f);c=[];for(m of a.g)a=c,f=a.push,g=m.id+1,h=li.value(),bi(h,g,4),g=Wh("trex",h),f.call(a,g);var m=Wh("mvex",...c);b=Wh("moov",e,...b,m,mi(d.stream));m=ni.value();a=new Uint8Array(m.byteLength+b.byteLength);a.set(m);a.set(b,m.byteLength);return a}
function mi(a){const b=[];if(!Vh(a))return new Uint8Array([]);for(const c of a.drmInfos)if(c.initData)for(const d of c.initData)b.push(d.initData);return Hb(...b)}function bi(a,b,c){a[c]=b>>>24&255;a[c+1]=b>>>16&255;a[c+2]=b>>>8&255;a[c+3]=b&255}function ci(a,b,c){a[c]=b>>>8&255;a[c+1]=b&255}
function ii(a){var b="aac";a.codecs.includes("mp3")?b="mp3":a.codecs.includes("ac-3")?b=A().I()?"ec-3":"ac-3":a.codecs.includes("ec-3")?b="ec-3":a.codecs.includes("opus")&&(b="opus");var c=new Uint8Array([]);switch(a.type){case "video":a.codecs.includes("avc1")?c=oi(a,"avc1","avcC"):a.codecs.includes("hvc1")&&(c=oi(a,"hvc1","hvcC"));break;case "audio":if(b=="mp3")a=Wh(".mp3",pi(a));else if(b=="ac-3"){b=Wh("dac3",a.Ua);c="ac-3";var d=new Uint8Array([]);Vh(a.stream)&&(d=qi(a.stream,a.codecs),c="enca");
a=Wh(c,pi(a),b,d)}else if(b=="ec-3")b=Wh("dec3",a.Ua),c="ec-3",d=new Uint8Array([]),Vh(a.stream)&&(d=qi(a.stream,a.codecs),c="enca"),a=Wh(c,pi(a),b,d);else if(b=="opus")b=Wh("dOps",a.Ua),c="Opus",d=new Uint8Array([]),Vh(a.stream)&&(d=qi(a.stream,a.codecs),c="enca"),a=Wh(c,pi(a),b,d);else{if(a.Ua.byteLength>0)b=Wh("esds",a.Ua);else{b=a.id+1;c=a.stream.channelsCount||2;var e=a.stream.audioSamplingRate||44100,f=Nb("audio",a.codecs.split(","));const g={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,
22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12};d=g[e];if(f==="mp4a.40.5"||f==="mp4a.40.29")d=g[e*2];e=parseInt(f.split(".").pop(),10);f=ri.value();ci(f,b,6);f[26]=e<<3|d>>>1;f[27]=d<<7|c<<3;b=Wh("esds",f)}c="mp4a";d=new Uint8Array([]);Vh(a.stream)&&(d=qi(a.stream,a.codecs),c="enca");a=Wh(c,pi(a),b,d)}c=a}a=Wh("stsd",si.value(),c);return Wh("stbl",a,ti.value(),ui.value(),vi.value(),wi.value())}
function qi(a,b){var c=b.split(".")[0];b=Xh("frma",4);bi(b,xi(c),8);c="cenc";var d=a.drmInfos[0];d&&d.encryptionScheme&&(c=d.encryptionScheme);d=yi.value();bi(d,xi(c),4);c=Wh("schm",d);d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);for(e of a.drmInfos)if(e&&e.keyIds&&e.keyIds.size)for(const f of e.keyIds){a=new Uint8Array(f.length/2);for(d=0;d<f.length/2;d+=1)a[d]=parseInt(String(f[d*2]+f[d*2+1]),16);d=a}var e=Wh("tenc",zi.value(),d);return Wh("sinf",b,c,Wh("schi",e))}
function oi(a,b,c){var d=a.stream.width||0,e=a.stream.height||0;let f=new Uint8Array([]);a.Ua.byteLength>0&&(f=Wh(c,a.Ua));c=Ai.value();ci(c,d,24);ci(c,e,26);if(a.Ec||a.Mc){d=a.Ec||0;e=a.Mc||0;var g=Xh("pasp",8);bi(g,d,8);bi(g,e,12);d=g}else d=new Uint8Array([]);e=new Uint8Array([]);Vh(a.stream)&&(e=qi(a.stream,a.codecs),b="encv");return Wh(b,c,f,d,e)}function pi(a){const b=a.stream.channelsCount||2;a=a.stream.audioSamplingRate||44100;const c=Bi.value();c[17]=b;ci(c,a,24);return c}
function xi(a){let b=0;for(let c=0;c<a.length;c+=1)b|=a.charCodeAt(c)<<(a.length-c-1)*8;return b}
function Ci(a){const b=[];var c=0;for(var d of a.g){a=d.data?d.data.sequenceNumber:0;var e=Xh("mfhd",8);bi(e,a,12);a=e;var f;e=d.data?d.data.Ya:[];var g=Xh("sdtp",4+e.length);for(f=0;f<e.length;f++){var h=e[f].flags;g[f+12]=h.le<<4|h.we<<2|h.se}e=g;h=e.length+32+20+8+16+8+8;g=d.id+1;f=Di.value();bi(f,g,4);g=Wh("tfhd",f);var k=d.data?d.data.Fa:0;f=Math.floor(k/($h+1));k=Math.floor(k%($h+1));var l=Xh("tfdt",12);l[8]=1;bi(l,f,12);bi(l,k,16);f=l;var m=h;h=d.data?d.data.Ya:[];k=h.length;var n=12+16*k;
l=Xh("trun",n);m+=8+n;l[8]=d.type==="video"?1:0;l[9]=0;l[10]=15;l[11]=1;bi(l,k,12);bi(l,m,16);for(m=0;m<k;m++){n=h[m];const p=n.flags,q=20+16*m;bi(l,n.duration,q);bi(l,n.size,q+4);l[q+8]=p.Mf<<2|p.le;l[q+9]=p.we<<6|p.se<<4|p.Nf;l[q+10]=p.ke&61440;l[q+11]=p.ke&15;bi(l,n.ib,q+12)}e=Wh("traf",g,f,l,e);a=Wh("moof",a,e);e=d.data?d.data.Ya:[];g=0;for(const p of e)g+=p.data.byteLength;g=8+g;b.push({Ni:a,Ya:e,Li:g});c+=a.byteLength+g}c=G(new ArrayBuffer(c));d=0;for(const {Ni:p,Ya:q,Li:r}of b){c.set(p,d);
d+=p.byteLength;bi(c,r,d);c.set(Ei.value(),d+4);d+=8;for(const t of q)c.set(t.data,d),d+=t.data.byteLength}return c}
var Fi=class{constructor(a=[]){this.g=a}},$h=4294967295,Yh=new Map,Ei=new Ga(()=>new Uint8Array([109,100,97,116])),ki=new Ga(()=>new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,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])),ai=new Ga(()=>new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,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])),di=new Ga(()=>new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),li=new Ga(()=>new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),Di=new Ga(()=>new Uint8Array([0,0,0,58,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),ri=new Ga(()=>new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,0,0,6,1,2])),Bi=new Ga(()=>new Uint8Array([0,
0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0])),Ai=new Ga(()=>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,0,0,0,0,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])),zi=new Ga(()=>new Uint8Array([0,0,0,0,0,0,1,8])),yi=new Ga(()=>new Uint8Array([0,0,0,0,0,0,0,0,0,1,0,0])),ei=new Ga(()=>new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,
97,110,100,108,101,114,0])),fi=new Ga(()=>new Uint8Array([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])),gi=new Ga(()=>new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])),ji=new Ga(()=>new Uint8Array([0,0,0,0,0,0,0,0])),si=new Ga(()=>new Uint8Array([0,0,0,0,0,0,0,1])),ni=new Ga(()=>{const a=new Uint8Array([105,115,111,109]),b=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);return Wh("ftyp",a,c,a,b)}),hi=new Ga(()=>{var a=new Uint8Array([0,
0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);a=Wh("dref",a);return Wh("dinf",a)}),ti=new Ga(()=>Xh("stts",8)),ui=new Ga(()=>Xh("stsc",8)),vi=new Ga(()=>Xh("stsz",12)),wi=new Ga(()=>Xh("stco",8));function Gi(a){a=G(a);let b=null;(new Dg).Ga(["moov","trak","mdia","minf","stbl"],vg).$("stsd",xg).box("enca",c=>{b=c.reader.h;return zg(c)}).box("sinf",vg).box("frma",c=>{c.parser.stop();({codec:c}=Rh(c.reader));c==="ec-3"&&b&&b.getUint16(16)!==2&&b.setUint16(16,2)}).parse(a);return a}
function Hi(a){a=G(a);let b=null,c=-1;(new Dg).Ga(["moov","trak","mdia","minf","stbl"],vg).$("stsd",xg).box("hvc1",d=>{b=d.reader.h;c=d.start;return yg(d)}).box("dvvC",d=>{d.parser.stop();b.setUint32(d.start-c-4,1718773093)}).parse(a);return a}
function Ii(a,b,c,d){let e=b=G(b),f=!1,g;const h=[],k=[];(new Dg).Ga(["moov","trak","mdia","minf","stbl"],l=>{h.push(l);vg(l)}).$("stsd",l=>{g=l;h.push(l);xg(l)}).Ga(["encv","enca"],l=>{f=!0;l.parser.stop()}).Ga("dvav dva1 dvh1 dvhe dvc1 dvi1 hev1 hvc1 avc1 avc3".split(" "),l=>{k.push({box:l,Yg:1701733238})}).Ga("ac-3 ec-3 ac-4 Opus fLaC mp4a".split(" "),l=>{k.push({box:l,Yg:1701733217})}).parse(b);if(f)return b;if(k.length==0||!g)throw ra(Gb(b)),new H(2,3,3019,c);k.reverse();for(const l of k)e=Ji(a,
e,g,l.box,h,l.Yg,d);e=Ki(a,e);return A().S(d)?(a=new Uint8Array(b.byteLength+e.byteLength),a.set(e),a.set(b,e.byteLength),a):e}function Li(a){a=G(a);const b=[];(new Dg).box("mdat",d=>{b.push(d)}).parse(a);const c=[];for(let d=0;d<b.length;d++){const e=b[d-1],f=b[d];c.push(Mi(a.subarray(e?e.start+e.size:0,f.start+f.size)))}return Hb(...c)}
function Mi(a){let b,c,d,e;const f=[];(new Dg).Ga(["moof","traf"],k=>{f.push(k);vg(k)}).$("tfhd",k=>{b=k;d=Kh(k.reader,k.flags)}).$("trun",k=>{c=k;e=Nh(k.reader,k.version,k.flags)}).parse(a);if(d&&d.fh!==2){const k=b.start+wg(b)+4+(d.Ch!==null?8:0);var g=eb(a);if(d.fh!==null)g.setUint32(k,2);else{Ni(a,b.start,b.size+4);var h=g.getUint32(b.start+8);g.setUint32(b.start+8,h|2);e&&e.je!==null&&g.setInt32(c.start+wg(c)+4,e.je+4);h=a.subarray(0,k);g=a.subarray(k);a=new Uint8Array(a.byteLength+4);a.set(h);
h=[];for(let l=3;l>=0;l--)h.push(2>>8*l&255);a.set(new Uint8Array(h),k);a.set(g,k+4);for(const l of f)Ni(a,l.start,l.size+4)}}return a}function Ni(a,b,c){a=eb(a,b);b=a.getUint32(0);b!=0&&(b==1?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}
function Ji(a,b,c,d,e,f,g){const h=qi(a,d.name),k=b.subarray(d.start,d.start+d.size);a=new Uint8Array(d.size+h.byteLength);a.set(k,0);eb(a).setUint32(4,f);a.set(h,d.size);Ni(a,0,a.byteLength);f=new Uint8Array(b.byteLength+a.byteLength);d=A().K(g)?d.start:d.start+d.size;g=b.subarray(d);f.set(b.subarray(0,d));f.set(a,d);f.set(g,d+a.byteLength);for(const l of e)Ni(f,l.start,l.size+a.byteLength);b=eb(f,c.start);c=wg(c);e=b.getUint32(c);b.setUint32(c,e+1);return f}
function Ki(a,b){a=mi(a);if(a.byteLength===0)return b;let c=0,d=0;(new Dg).box("moov",h=>{c=h.start;d=h.size;h.parser.stop()}).parse(b);const e=c+d;Ni(b,c,d+a.byteLength);const f=new Uint8Array(b.byteLength+a.byteLength),g=b.subarray(e);f.set(b.subarray(0,e));f.set(a,e);f.set(g,e+a.byteLength);return f}
function Oi(a){const b=G(a),c=[];(new Dg).Ga(["moov","trak","mdia","minf","stbl"],d=>{c.push({start:d.start,size:d.size});vg(d)}).box("stsd",d=>{c.push({start:d.start,size:d.size});const e=eb(b,d.start);for(let f=0;f<d.size-3;f++){const g=e.getUint32(f);g==1633889587?e.setUint32(f,1700998451):g==1684103987&&e.setUint32(f,1684366131)}}).parse(b);return b};function Pi(a,b){return a===b?!0:a&&b?a.wc()==b.wc()&&a.uc()==b.uc()&&za(a.R().sort(),b.R().sort())&&ab(a.Mb(),b.Mb()):a==b}var Qi=class{constructor(a,b,c,d=null,e=null,f=null,g=null,h=!1){this.R=a;this.startByte=b;this.endByte=c;this.cd=d;this.timescale=e;this.h=f;this.aesKey=g;this.g=this.mimeType=this.codecs=null;this.encrypted=h}wc(){return this.startByte}uc(){return this.endByte}Kd(a){this.h=a}Mb(){return this.h}};w("shaka.media.InitSegmentReference",Qi);Qi.prototype.getEndByte=Qi.prototype.uc;
Qi.prototype.getStartByte=Qi.prototype.wc;function Ri(a){if(a.endByte)return a.endByte+1-a.startByte;if(a.bandwidth){const b=a.bandwidth*(a.endTime-a.startTime);if(!isNaN(b)&&b>0)return b}if(a.h.length>0&&a.m)for(const b of a.h){Ri(b);break}return null}function Si(a,b){a.ea=b;for(const c of a.h)Si(c,b)}
var Q=class{constructor(a,b,c,d,e,f,g,h,k,l=[],m="",n=null,p=null,q=Ti,r=null,t=!1){this.startTime=a;this.j=this.endTime=b;this.D=c;this.startByte=d;this.endByte=e;this.ea=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.h=l;this.tilesLayout=m;this.A=n;this.g=p;this.status=q;this.preload=!1;this.l=!0;this.o=!1;this.aesKey=r;this.thumbnailSprite=null;this.i=-1;this.m=t;this.Cd=this.Hc=!1;for(const u of this.h)u.Xg();this.m&&this.h.length&&this.h[this.h.length-1].Wg();this.u=
this.bandwidth=this.mimeType=this.codecs=null;this.C=!1;this.B=null}R(){return this.D()}getStartTime(){return this.startTime}Xh(){return this.endTime}wc(){return this.startByte}uc(){return this.endByte}pi(){return this.tilesLayout}oi(){return this.A}Nb(){return this.status}Ji(){this.status=Ui}Pf(){this.preload=!0}isPreload(){return this.preload}bd(){this.l=!1}Ai(){return this.l}Xg(){this.Hc=!0}Ci(){return this.Hc}Wg(){this.Cd=!0}Bi(){return this.Cd}Vg(){this.o=!0}wi(){return this.o}Re(a){this.thumbnailSprite=
a}mi(){return this.thumbnailSprite}offset(a){this.startTime+=a;this.endTime+=a;this.j+=a;for(const b of this.h)b.startTime+=a,b.endTime+=a,b.j+=a}mg(a){this.g==null?la("Sync attempted without sync time!"):(a=this.g-a-this.startTime,Math.abs(a)>=.001&&this.offset(a))}Kd(a,b=!1){this.u=a;this.C=b}Mb(a=!0){const b=this.u;a&&this.C&&(this.u=null);return b}Qe(a){this.B=a}getMetadata(){return this.B}};w("shaka.media.SegmentReference",Q);Q.prototype.getMetadata=Q.prototype.getMetadata;
Q.prototype.setMetadata=Q.prototype.Qe;Q.prototype.getSegmentData=Q.prototype.Mb;Q.prototype.setSegmentData=Q.prototype.Kd;Q.prototype.syncAgainst=Q.prototype.mg;Q.prototype.offset=Q.prototype.offset;Q.prototype.getThumbnailSprite=Q.prototype.mi;Q.prototype.setThumbnailSprite=Q.prototype.Re;Q.prototype.hasByterangeOptimization=Q.prototype.wi;Q.prototype.markAsByterangeOptimization=Q.prototype.Vg;Q.prototype.isLastPartial=Q.prototype.Bi;Q.prototype.markAsLastPartial=Q.prototype.Wg;
Q.prototype.isPartial=Q.prototype.Ci;Q.prototype.markAsPartial=Q.prototype.Xg;Q.prototype.isIndependent=Q.prototype.Ai;Q.prototype.markAsNonIndependent=Q.prototype.bd;Q.prototype.isPreload=Q.prototype.isPreload;Q.prototype.markAsPreload=Q.prototype.Pf;Q.prototype.markAsUnavailable=Q.prototype.Ji;Q.prototype.getStatus=Q.prototype.Nb;Q.prototype.getTileDuration=Q.prototype.oi;Q.prototype.getTilesLayout=Q.prototype.pi;Q.prototype.getEndByte=Q.prototype.uc;Q.prototype.getStartByte=Q.prototype.wc;
Q.prototype.getEndTime=Q.prototype.Xh;Q.prototype.getStartTime=Q.prototype.getStartTime;Q.prototype.getUris=Q.prototype.R;var Ti=0,Ui=1;Q.Status={xj:Ti,Hk:Ui,ck:2};function Vi(a){return a.length==1&&a.end(0)-a.start(0)<1E-4}function Wi(a){return!a||Vi(a)?null:a.length==1&&a.start(0)<0?0:a.length?a.start(0):null}function Xi(a){return!a||Vi(a)?null:a.length?a.end(a.length-1):null}function Yi(a,b){return!a||!a.length||Vi(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function Zi(a,b){if(!a||!a.length||Vi(a))return 0;let c=0;for(const {start:d,end:e}of $i(a))e>b&&(c+=e-Math.max(d,b));return c}
function $i(a){if(!a)return[];const b=[];for(let c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b}function aj(a,b,c){if(!a||!a.length||Vi(a))return null;a=$i(a).findIndex((d,e,f)=>d.start>b&&(e==0||f[e-1].end-b<=c));return a>=0?a:null};function bj(a,b=""){const c=document.createElement("source");c.src=a;c.type=b;return c}function cj(a){let b=!1;const c=a.getElementsByTagName("source");for(let d=c.length-1;d>=0;--d)a.removeChild(c[d]),b=!0;a.src&&(a.removeAttribute("src"),b=!0);return b}function dj(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
function ej(){if(fj)return fj;gj||=new te(()=>{fj=null});(fj=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(fj=document.createElement("video"));gj.ha(1);return fj}
async function hj(a,b){if("fonts"in document&&"FontFace"in window&&(await document.fonts.ready,"entries"in document.fonts)){var c=d=>{d=d.entries();const e=[];let f=d.next();for(;f.done===!1;)e.push(f.value),f=d.next();return e};for(const d of c(document.fonts))if(d.family===a&&d.display==="swap")return;a=new FontFace(a,`url(${b})`,{display:"swap"});document.fonts.add(a)}}var ij=class{};w("shaka.util.Dom",ij);ij.removeAllChildren=dj;ij.clearSourceFromVideo=cj;var gj=null,fj=null;function jj(a,b){return b+10<=a.length&&a[b]===73&&a[b+1]===68&&a[b+2]===51&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function kj(a,b){return b+10<=a.length&&a[b]===51&&a[b+1]===68&&a[b+2]===73&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function lj(a,b){let c;c=(a[b]&127)<<21;c|=(a[b+1]&127)<<14;c|=(a[b+2]&127)<<7;return c|=a[b+3]&127}
function mj(a){const b={key:a.type,description:"",data:"",mimeType:null,pictureType:null};if(a.type==="APIC"){if(a.size<2||a.data[0]!==3)return null;var c=a.data.subarray(1).indexOf(0);if(c===-1)return null;var d=ub(G(a.data,1,c));const e=a.data[2+c],f=a.data.subarray(3+c).indexOf(0);if(f===-1)return null;const g=ub(G(a.data,3+c,f));let h;d==="--\x3e"?h=ub(G(a.data,4+c+f)):h=cb(a.data.subarray(4+c+f));b.mimeType=d;b.pictureType=e;b.description=g;b.data=h;return b}if(a.type==="TXXX"){if(a.size<2||
a.data[0]!==3)return null;d=a.data.subarray(1).indexOf(0);if(d===-1)return null;c=ub(G(a.data,1,d));a=ub(G(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if(a.type==="WXXX"){if(a.size<2||a.data[0]!==3)return null;d=a.data.subarray(1).indexOf(0);if(d===-1)return null;c=ub(G(a.data,1,d));a=ub(G(a.data,2+d)).replace(/\0*$/,"");b.description=c;b.data=a;return b}if(a.type==="PRIV"){if(a.size<2)return null;c=a.data.indexOf(0);if(c===-1)return null;c=ub(G(a.data,0,c));b.description=c;
c=="com.apple.streaming.transportStreamTimestamp"?(c=a.data.subarray(c.length+1),a=c[3]&1,c=(c[4]<<23)+(c[5]<<15)+(c[6]<<7)+c[7],c/=45,a&&(c+=4.772185884E7),b.data=c):(a=cb(a.data.subarray(c.length+1)),b.data=a);return b}if(a.type[0]==="T"){if(a.size<2||a.data[0]!==3)return null;a=ub(a.data.subarray(1)).replace(/\0*$/,"");b.data=a;return b}return a.type[0]==="W"?(a=ub(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=cb(a.data),b):null}
function nj(a){let b=0;const c=[];for(;jj(a,b);){var d=lj(a,b+6);a[b+5]>>6&1&&(b+=10);b+=10;for(d=b+d;b+10<d;){var e=a.subarray(b),f=lj(e,4);e={type:String.fromCharCode(e[0],e[1],e[2],e[3]),size:f,data:e.subarray(10,10+f)};(f=mj(e))&&c.push(f);b+=e.size+10}kj(a,b)&&(b+=10)}return c}function oj(a,b=0){const c=b;let d=0;for(;jj(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=lj(a,b+6),kj(a,b+10)&&(d+=10),b+=d;return d>0?a.subarray(c,c+d):new Uint8Array([])}var pj=class{};w("shaka.util.Id3Utils",pj);
pj.getID3Data=oj;pj.getID3Frames=nj;function qj(a,b,c=Number.EPSILON){if(a===b)return!0;a=Math.abs(a-b);return a<=c?!0:c!==Number.EPSILON?Math.abs(a-c)<=Number.EPSILON:!1};function rj(a){return(new Date(Date.UTC(1900,0,1,0,0,0,0)+a)).getTime()};/*

 Copyright Brightcove, Inc.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function sj(a){const b=a.j.byteLength-a.i,c=Math.min(4,a.i);if(c!==0){var d=0;for(let e=0;e<c;e++)d=d<<8|a.j[b+e];a.h=d<<(4-c)*8;a.g=c*8;a.i-=c}}function tj(a,b){if(a.g<=b){b-=a.g;const c=Math.floor(b/8);b-=c*8;a.g-=c;sj(a)}a.h<<=b;a.g-=b}function uj(a,b){let c=Math.min(a.g,b);const d=a.h>>>32-c;a.g-=c;a.g>0?a.h<<=c:a.i>0&&sj(a);c=b-c;return c>0?d<<c|uj(a,c):d}
function vj(a){let b=0;for(;a.g===0;){if(a.i===0)return b;sj(a)}for(;;){let c=Math.clz32(a.h);c>a.g&&(c=a.g);b+=c;a.h<<=c;a.g-=c;if(a.g>0||a.i===0)break;sj(a)}return b}function wj(a){tj(a,1+vj(a))}function R(a){const b=vj(a);return uj(a,b+1)-1}function xj(a){a=R(a);return 1&a?1+a>>>1:-1*(a>>>1)}function T(a){return uj(a,1)===1}function yj(a){return uj(a,8)}function zj(a,b){let c=8;var d=8;for(let e=0;e<b;e++)d!==0&&(d=xj(a),d=(c+d+256)%256),c=d===0?c:d}function Aj(a){yj(a);R(a);return R(a)}
var Bj=class{constructor(a,b=!1){this.j=a;if(b){b=new Uint8Array(a.byteLength);let c=0;for(let d=0;d<a.byteLength;d++)d>=2&&a[d]==3&&a[d-1]==0&&a[d-2]==0||(b[c]=a[d],c++);this.j=G(b,0,c)}this.i=this.j.byteLength;this.g=this.h=0}};w("shaka.util.ExpGolomb",Bj);function Cj(a){const b=Math.min(1E3,a.length-564);let c=0;for(;c<b;){if(a[c]==71&&a[c+188]==71&&a[c+376]==71)return c;const d=a.indexOf(71,c+1);c=d>=0&&d<b?d:c+1}return-1}function Dj(a){return Cj(a)<0?!1:!0}function Ej(a,b,c){return Ib(a,b[c],c+1<b.length?b[c+1]:a.length)}function Fj(a,b){let c=1;for(a>b&&(c=-1);Math.abs(b-a)>4294967296;)a+=c*8589934592;return a}
function Gj(a,b){if((b[0]<<16|b[1]<<8|b[2])!==1)return null;const c=b[4]<<8|b[5];if(c&&c>b.byteLength-6)return null;let d=null;var e=null;const f=b[7];if(f&192){const g=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2;a.A==null&&(a.A=g);d=Fj(g,a.A);e=a.A=d;f&64&&(e=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,a.u==null&&(a.u=e),e=d!=g?Fj(e,a.u):e);a.u=e}a=b[8]+9;return b.byteLength<=a?null:{data:b.subarray(a),packetLength:c,
pts:d,dts:e,nalus:[]}}
function Hj(a){const b={height:null,width:null,codec:null,frameRate:null};var c=a.qe();if(!c.length)return b;c=c.find(z=>z.type==33);if(!c)return b;var d=new Bj(c.fullData,!0);yj(d);yj(d);uj(d,4);var e=uj(d,3);T(d);var f=uj(d,2),g=uj(d,1);const h=uj(d,5),k=uj(d,32);c=yj(d);const l=yj(d),m=yj(d),n=yj(d),p=yj(d),q=yj(d),r=yj(d);var t=[],u=[];for(var v=0;v<e;v++)t.push(T(d)),u.push(T(d));if(e>0)for(v=e;v<8;v++)uj(d,2);for(v=0;v<e;v++)t[v]&&uj(d,88),u[v]&&yj(d);R(d);e=R(d);e==3&&uj(d,1);t=R(d);u=R(d);
let x=v=0,y=0,D=0;T(d)&&(v+=R(d),x+=R(d),y+=R(d),D+=R(d));b.width=String(t-(v+x)*(e===1||e===2?2:1));b.height=String(u-(y+D)*(e===1?2:1));d=(z=>{let B=0;for(let E=0;E<32;E++)B|=(z>>E&1)<<31-E;return B>>>0})(k);g=g==1?"H":"L";f="hvc1"+("."+["","A","B","C"][f]+h);f+="."+d.toString(16).toUpperCase();f+="."+g+r;q&&(f+="."+q.toString(16).toUpperCase());p&&(f+="."+p.toString(16).toUpperCase());n&&(f+="."+n.toString(16).toUpperCase());m&&(f+="."+m.toString(16).toUpperCase());l&&(f+="."+l.toString(16).toUpperCase());
c&&(f+="."+c.toString(16).toUpperCase());b.codec=f;b.frameRate=Ij(a);return b}
function Jj(a){const b={height:null,width:null,codec:null,frameRate:null};var c=a.qe();if(!c.length)return b;c=c.find(q=>q.type==7);if(!c)return b;c=new Bj(c.data);const d=yj(c),e=yj(c),f=yj(c);wj(c);if(Kj.includes(d)){var g=R(c);g===3&&tj(c,1);wj(c);wj(c);tj(c,1);if(T(c)){g=g!==3?8:12;for(var h=0;h<g;h++)T(c)&&(h<6?zj(c,16):zj(c,64))}}wj(c);g=R(c);if(g===0)R(c);else if(g===1)for(tj(c,1),wj(c),wj(c),g=R(c),h=0;h<g;h++)wj(c);wj(c);tj(c,1);g=R(c);h=R(c);const k=uj(c,1);k===0&&tj(c,1);tj(c,1);let l=
0,m=0,n=0,p=0;T(c)&&(l=R(c),m=R(c),n=R(c),p=R(c));b.height=String((2-k)*(h+1)*16-n*2-p*2);b.width=String((g+1)*16-l*2-m*2);b.codec="avc1."+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2)+("0"+f.toString(16).toUpperCase()).slice(-2);b.frameRate=Ij(a);return b}function Ij(a){var b=a.Xc();return b.length>1&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?Math.abs(1/(b-a)*9E4):null}
var Lj=class{constructor(){this.K=null;this.L=!1;this.B=this.N=null;this.D=[];this.j=[];this.g=[];this.G=this.H=null;this.l=[];this.i=[];this.h=[];this.I=null;this.o=[];this.m=[];this.C=this.J=this.u=this.A=null}clearData(){this.D=[];this.j=[];this.g=[];this.l=[];this.i=[];this.h=[];this.o=[];this.m=[]}Pe(a){this.C!=null&&this.C!=a&&(this.u=this.A=null);this.C=a}parse(a){if(a.length<564)return this;const b=Math.max(0,Cj(a)),c=a.length-(a.length+b)%188;let d=!1;for(let k=b;k<c;k+=188)if(a[k]==71){var e=
!!(a[k+1]&64),f=((a[k+1]&31)<<8)+a[k+2],g=void 0;if((a[k+3]&48)>>4>1){if(g=k+5+a[k+4],g==k+188)continue}else g=k+4;switch(f){case 0:e&&(g+=a[g]+1);this.K=(a[g+10]&31)<<8|a[g+11];break;case 17:case 8191:break;case this.K:e&&(g+=a[g]+1);e=a;f={audio:-1,video:-1,ue:-1,audioCodec:"",videoCodec:""};const l=g+3+((e[g+1]&15)<<8|e[g+2])-4;for(g+=12+((e[g+10]&15)<<8|e[g+11]);g<l;){const m=(e[g+1]&31)<<8|e[g+2],n=(e[g+3]&15)<<8|e[g+4];switch(e[g]){case 6:if(n>0){let p=g+5,q=n;for(;q>2;){const r=e[p+1]+2;switch(e[p]){case 5:var h=
p+2;h=e[h]<<24|e[h+1]<<16|e[h+2]<<8|e[h+3];f.audio==-1&&h===1332770163?(f.audio=m,f.audioCodec="opus"):f.video==-1&&h===1096167473&&(f.video=m,f.videoCodec="av1");break;case 106:f.audio==-1&&(f.audio=m,f.audioCodec="ac3");break;case 122:f.audio==-1&&(f.audio=m,f.audioCodec="ec3");break;case 124:f.audio==-1&&(f.audio=m,f.audioCodec="aac");break;case 127:f.audioCodec=="opus"&&(h=null,e[p+2]===128&&(h=e[p+3]),h!=null&&(this.J={channelCount:(h&15)===0?2:h&15,Fh:h,sampleRate:48E3}))}p+=r;q-=r}}break;case 15:f.audio==
-1&&(f.audio=m,f.audioCodec="aac");break;case 17:f.audio==-1&&(f.audio=m,f.audioCodec="aac-loas");break;case 21:f.ue==-1&&(f.ue=m);break;case 27:f.video==-1&&(f.video=m,f.videoCodec="avc");break;case 3:case 4:f.audio==-1&&(f.audio=m,f.audioCodec="mp3");break;case 36:f.video==-1&&(f.video=m,f.videoCodec="hvc");break;case 129:f.audio==-1&&(f.audio=m,f.audioCodec="ac3");break;case 132:case 135:f.audio==-1&&(f.audio=m,f.audioCodec="ec3")}g+=n+5}e=f;e.video!=-1&&(this.N=e.video,this.B=e.videoCodec);e.audio!=
-1&&(this.H=e.audio,this.G=e.audioCodec);e.ue!=-1&&(this.I=e.ue);d&&!this.L&&(d=!1,k=b-188);this.L=!0;break;case this.N:g=a.subarray(g,k+188);e?(this.j.push(this.D.length),this.D.push(g)):this.j.length&&this.D.push(g);break;case this.H:g=a.subarray(g,k+188);e?(this.i.push(this.l.length),this.l.push(g)):this.i.length&&this.l.push(g);break;case this.I:g=a.subarray(g,k+188);e?(this.m.push(this.o.length),this.o.push(g)):this.m.length&&this.o.push(g);break;default:d=!0}}return this}ah(a,b){var c=a.pts?
a.pts/9E4:null;a=a.data;const d=a.byteLength;let e=1;this.B=="hvc"&&(e=2);var f=b.state||0;const g=f;let h=0;const k=[];let l=-1,m=0;const n=this.B==="hvc";f==-1&&(l=0,m=n?a[0]>>1&63:a[0]&31,f=0,h=1);for(;h<d;){var p=a[h++];if(f)if(f===1)f=p?0:2;else if(p)if(p==1){p=h-f-1;if(l>=0)k.push({data:a.subarray(l+e,p),fullData:a.subarray(l,p),type:m,time:c,state:null});else if(f=k.length?k[k.length-1]:b.Fe)g&&h<=4-g&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-g),f.fullData=f.fullData.subarray(0,
f.fullData.byteLength-g)),p>0&&(p=a.subarray(0,p),f.data=Hb(f.data,p),f.fullData=Hb(f.fullData,p),f.state=0);h<d?(m=n?a[h]>>1&63:a[h]&31,l=h,f=0):f=-1}else f=0;else f=3;else f=p?0:1}l>=0&&f>=0&&k.push({data:a.subarray(l+e,d),fullData:a.subarray(l,d),type:m,time:c,state:f});!k.length&&b.Fe&&(c=k.length?k[k.length-1]:b.Fe)&&(c.data=Hb(c.data,a),c.fullData=Hb(c.fullData,a));b.state=f;return k}getMetadata(){const a=[];for(let c=0;c<this.m.length;c++){var b=Ej(this.o,this.m,c);(b=Gj(this,b))&&a.push({cueTime:b.pts?
b.pts/9E4:null,data:b.data,frames:nj(b.data),dts:b.dts,pts:b.pts})}return a}kb(){if(this.i.length&&!this.h.length)for(let b=0;b<this.i.length;b++){var a=Ej(this.l,this.i,b);const c=Gj(this,a);let d=this.h.length?this.h[this.h.length-1]:null;c&&c.pts!=null&&c.dts!=null&&(!d||d.pts!=c.pts&&d.dts!=c.dts)?this.h.push(c):this.h.length&&(a=c?c.data:a)&&(d=this.h[this.h.length-1],d.data=Hb(d.data,a))}return this.h}Xc(a=!0){if(this.j.length&&!this.g.length){for(var b=0;b<this.j.length;b++){var c=Ej(this.D,
this.j,b);const e=Gj(this,c);var d=this.g.length?this.g[this.g.length-1]:null;e&&e.pts!=null&&e.dts!=null&&(!d||d.pts!=e.pts&&d.dts!=e.dts)?this.g.push(e):this.g.length&&(c=e?e.data:c)&&(d=this.g[this.g.length-1],d.data=Hb(d.data,c))}if(a){b={Fe:null,state:null};d=[];for(const e of this.g)e.nalus=this.ah(e,b),e.nalus.length&&(d.push(e),b.Fe=e.nalus[e.nalus.length-1]);this.g=d}}return a?this.g:(a=this.g,this.g=[],a)}getStartTime(a){if(a=="audio"){a=null;var b=this.kb();b.length&&(a=b[0],a=Math.min(a.dts,
a.pts)/9E4);return a}return a=="video"?(a=null,b=this.Xc(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null}ud(){return{audio:this.G,video:this.B}}qe(){const a=[];for(const b of this.Xc())a.push(...b.nalus);return a}Pg(){return this.B=="hvc"?Hj(this):Jj(this)}};w("shaka.util.TsParser",Lj);Lj.syncOffset=Cj;Lj.probe=Dj;Lj.prototype.getVideoInfo=Lj.prototype.Pg;Lj.prototype.getVideoNalus=Lj.prototype.qe;Lj.prototype.getCodecs=Lj.prototype.ud;Lj.prototype.getStartTime=Lj.prototype.getStartTime;
Lj.prototype.getVideoData=Lj.prototype.Xc;Lj.prototype.getAudioData=Lj.prototype.kb;Lj.prototype.getMetadata=Lj.prototype.getMetadata;Lj.prototype.parseNalus=Lj.prototype.ah;Lj.prototype.parse=Lj.prototype.parse;Lj.prototype.setDiscontinuitySequence=Lj.prototype.Pe;Lj.prototype.clearData=Lj.prototype.clearData;Lj.Timescale=9E4;var Kj=[100,110,122,244,44,83,86,118,128,138,139,134];function Mj(){var a=['video/mp4; codecs="avc1.42E01E"','video/mp4; codecs="avc3.42E01E"','video/mp4; codecs="hev1.1.6.L93.90"','video/mp4; codecs="hvc1.1.6.L93.90"','video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084"','video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084"','video/mp4; codecs="hvc1.2.20000000.L153.B0"','video/mp4; codecs="hvc1.2.4.L120.b0"','video/mp4; codecs="hvc1.2.4.L123.b0"','video/mp4; codecs="vp9"','video/mp4; codecs="vp09.00.10.08"','video/mp4; codecs="av01.0.01M.08"',
'video/mp4; codecs="av01.0.31M.10.0.111.09.16.09.0"','video/mp4; codecs="av01.0.31M.10.0.112.09.18.09.0"','video/mp4; codecs="dvh1.05.01"','video/mp4; codecs="dvh1.08.01"','video/mp4; codecs="dav1.10.01"','video/mp4; codecs="dvh1.20.01"','audio/mp4; codecs="mp4a.40.2"','audio/mp4; codecs="ac-3"','audio/mp4; codecs="ec-3"','audio/mp4; codecs="ac-4.02.01.03"','audio/mp4; codecs="opus"','audio/mp4; codecs="flac"','audio/mp4; codecs="dtsc"','audio/mp4; codecs="dtse"','audio/mp4; codecs="dtsx"','audio/mp4; codecs="apac.31.00"',
'video/webm; codecs="vp8"','video/webm; codecs="vp9"','video/webm; codecs="vp09.00.10.08"','audio/webm; codecs="vorbis"','audio/webm; codecs="opus"','video/mp2t; codecs="avc1.42E01E"','video/mp2t; codecs="avc3.42E01E"','video/mp2t; codecs="hvc1.1.6.L93.90"','video/mp2t; codecs="mp4a.40.2"','video/mp2t; codecs="ac-3"','video/mp2t; codecs="ec-3"',"text/vtt",'application/mp4; codecs="wvtt"',"application/ttml+xml",'application/mp4; codecs="stpp"',...Sd];const b={};A();for(const c of a){if(fe(c))b[c]=
!0;else if($b()){a=Zd(c);const d=$e($d(c),a);a=Rd(a,d);b[c]=Hh(a)||(Ld(a)?!0:!1)}else b[c]=ac(c);a=c.split(";")[0];b[a]=b[a]||b[c]}return b}
function Nj(a,b){a.qa=!0;let c;window.ManagedMediaSource?(a.I||(a.g.disableRemotePlayback=!0),c=new ManagedMediaSource,a.A.F(c,"startstreaming",()=>{a.qa=!0}),a.A.F(c,"endstreaming",()=>{a.qa=!1})):c=new MediaSource;a.A.na(c,"sourceopen",()=>{URL.revokeObjectURL(a.sa);b.resolve()});a.A.na(a.g,"playing",()=>{a.$a=!0});a.sa=Oj(c);Pj(a);a.u.useSourceElements?(a.S=bj(a.sa),a.g.appendChild(a.S),a.I&&a.g.appendChild(a.I),a.g.load()):a.g.src=a.sa;return c}
async function Qj(a){const b=[];for(const [c,d]of a.m){const e=d[0];a.m.set(c,d.slice(0,1));e&&b.push(e.p.promise.catch(()=>{}));for(const f of d.slice(1))f.p.reject(new H(2,7,7003,void 0))}a.h&&b.push(a.h.destroy());await Promise.all(b);for(const c of a.j.values())c.destroy();a.A&&(a.A.release(),a.A=null);a.g&&(Pj(a),a.g.load(),a.g.disableRemotePlayback=!1);a.g=null;a.S=null;a.I=null;a.u=null;a.i=null;a.h=null;a.W=null;a.l.clear();a.Ba.clear();a.j.clear();a.H=null;a.m.clear();a.G=null;a.Ka.clear();
a.D=null}function Pj(a){a.g&&(a.g.removeAttribute("src"),a.S?.parentElement===a.g&&a.g.removeChild(a.S),a.I?.parentElement===a.g&&a.g.removeChild(a.I))}function Rj(a,b,c){a.g&&window.ManagedMediaSource&&a.i&&a.u.useSourceElements&&(a.I?.parentElement===a.g&&a.g.removeChild(a.I),a.I=bj(b,c),a.g.appendChild(a.I),a.g.disableRemotePlayback=!1)}function Sj(a){return a.K?!1:a.i?a.i.readyState=="ended":!0}function Tj(a){return a.K?!1:a.i?a.i.readyState=="closed":!0}
function Uj(a,b,c,d){b=="audio"&&d&&(d=$e(d,c.mimeType));b=="video"&&d&&c.mimeType=="video/mp4"&&(d=af(d));var e=Rd(c.mimeType,d);if(b==K)Vj(a,e,c.external);else{var f=a.u.forceTransmux;if(!Hh(e)||!a.L&&Sd.includes(e))f=!0;var g=Td(c.mimeType,d);if(f){f=Ob("audio",(d||"").split(","));d=Ob("video",(d||"").split(","));if(f&&d){a.o=!0;Uj(a,"audio",c,f);Uj(a,"video",c,d);return}if(d=Ld(g))e=d(),a.j.set(b,e),e=e.convertCodecs(b,g)}g=e+a.u.addExtraFeaturesToSourceBuffer(e);kg(a.C);let h;try{h=a.i.addSourceBuffer(g)}catch(k){throw new H(2,
3,3015,k,"The mediaSource_ status was "+a.i.readyState+" expected 'open'",null);}a.L&&(h.mode=Wj);a.A.F(h,"error",()=>{const k=a.m.get(b)[0];k.p.reject(new H(2,3,3014,a.g.error?a.g.error.code:0,k.uri))});a.A.F(h,"updateend",()=>Xj(a,b));a.l.set(b,h);a.B.set(b,e);a.Ba.set(b,!!c.drmInfos.length)}}
function Vj(a,b,c){a.h||(a.h=new pe(a.W,a.P),a.h&&(a.h.C=a.u.modifyCueCallback));var d=a.h;a=a.wa;b=="application/cea-608"||b=="application/cea-708"?d.l=null:(d.l=de.get(b)(),d.l.setManifestType(d.D),d.H=a,d.B=c)}function Xj(a,b){if(a.K||a.C.g){var c=a.m.get(b);c&&c.length&&((c=c[0])&&c.p&&c.p.resolve(),a.m.set(b,[]))}else if(c=a.m.get(b)[0])c.p.resolve(),Yj(a,b)}function Zj(a){return a.qa&&!a.T&&!a.K}
function ak(a,b){if(!bk(a))return null;try{return a.l.get(b).buffered}catch(c){return a.l.has(b),null}}function ck(a,b){return a.l.size?b==K?a.h.g:Wi(ak(a,b)):null}function dk(a,b){return a.l.size?b==K?a.h.h:Xi(ak(a,b)):null}function ek(a,b,c){if(b==K)return a=a.h,a.h==null||a.h<c?0:a.h-Math.max(c,a.g);a=ak(a,b);return Zi(a,c)}function bk(a){return!a.i||a.C.g||a.g.error||a.T||a.K||Tj(a)?!1:!0}
function fk(a,b,c,d){const e=qj(b.startTime,c.startTime+b.presentationTimeDelta/b.timescale);d&&a.P=="HLS"&&!e&&(c=-d+c.startTime,b.startTime+=c,b.endTime+=c);a.D.Qi(b);!b.messageData||b.schemeIdUri!="https://aomedia.org/emsg/ID3"&&b.schemeIdUri!="https://developer.apple.com/streaming/emsg-id3"||(c=nj(b.messageData),c.length&&(d=b.startTime,a.D.onMetadata([{cueTime:d,data:b.messageData,frames:c,dts:d,pts:d}],0,b.endTime)))}
function gk(a,b,c,d,e,f,g=!1){let h=null;var k=[],l=G(c);if(Sd.includes(f))c=nj(l),c.length&&d&&((g=c.find(m=>m.description==="com.apple.streaming.transportStreamTimestamp"))&&typeof g.data=="number"&&(h=Math.round(g.data)/1E3),a.D.onMetadata([{cueTime:d.startTime,data:l,frames:c,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(f.includes("/mp4")&&d&&d.ea){l=new Dg;const m=e.emsgSchemeIdUris!=null&&e.emsgSchemeIdUris.length>0||a.u.dispatchAllEmsgBoxes,n=[];m&&l.$("emsg",t=>{a:{var u=e.emsgSchemeIdUris;
let x,y,D,z,B,E;if(t.version===0){D=t.reader.jd();E=t.reader.jd();var v=t.reader.U();B=t.reader.U();y=t.reader.U();x=t.reader.U();z=d.startTime+B/v}else v=t.reader.U(),z=t.reader.kd()/v+d.timestampOffset,B=z-d.startTime,y=t.reader.U(),x=t.reader.U(),D=t.reader.jd(),E=t.reader.jd();t=t.reader.cb(t.reader.mb()-t.reader.Na(),!0);if(u&&u.includes(D)||a.u.dispatchAllEmsgBoxes)if(D=="urn:mpeg:dash:event:2012")a.D.Si();else{u=z;if(D!=="https://aomedia.org/emsg/ID3"||y!==4294967295)u+=y/v;v={startTime:z,
endTime:u,schemeIdUri:D,value:E,timescale:v,presentationTimeDelta:B,eventDuration:y,id:x,messageData:t};break a}v=null}v&&n.push(v)});const p=d.ea.timescale;b=p&&!isNaN(p);let q=0,r=!1;b&&l.$("prft",t=>{var u=t.reader,v=t.version;u.U();t=u.U();const x=u.U();t=t*1E3+x/2**32*1E3;v===0?u=u.U():(v=u.U(),u=u.U(),u=v*4294967296+u);t=rj(t);u=(new Map).set("detail",{wallClockTime:t,programStartDate:new Date(t-u/p*1E3)});u=new P("prft",u);a.D.onEvent(u)}).Ga(["moof","traf"],vg).$("tfdt",t=>{r||(q=Lh(t.reader,
t.version).Fa/p,r=!0,m||t.parser.stop())});(m||b)&&l.parse(c,!1,g);r&&d.timestampOffset==0&&(h=q);for(const t of n)fk(a,t,d,h)}else f.includes("/mp4")||f.includes("/webm")||!Dj(l)||(k=a.Ka.getOrInsertComputed(b,()=>new Lj),k.clearData(),k.Pe(d.i),k.parse(l),l=k.getStartTime(b),l!=null&&(h=l),k=k.getMetadata());return{timestamp:h,metadata:k}}function hk(a,b,c,d=!1){b=(new Map).set("data",c).set("contentType",b).set("isInitData",d);b=new P("bufferappending",b);a.D.onEvent(b)}
async function ik(a,b,c,d,e,f,g=!1,h=!1,k=!1,l=!1,m){if(b==K)await ge(a.h,c,d?d.startTime:null,d?d.endTime:null,d?d.R()[0]:null,d?d.i:-1);else if(!l&&a.o)await ik(a,"audio",c,d,e,f,g,h,k,!0),await ik(a,"video",c,d,e,f,g,h,k,!0);else if(a.l.has(b)){var n=a.l.get(b).timestampOffset;l=a.B.get(b);a.j.has(b)&&(l=a.j.get(b).getOriginalMimeType());if(d){const {timestamp:q,metadata:r}=gk(a,b,c,d,e,l,k);if(q!=null){if(a.O==null&&b=="video"&&(a.O=q,a.ba=d.startTime,a.N!=null)){var p=0;a.ba==a.Z&&(p=a.O-a.N);
a.X.resolve(p)}a.N==null&&b=="audio"&&(a.N=q,a.Z=d.startTime,a.O!=null&&(p=0,a.ba==a.Z&&(p=a.O-a.N),a.X.resolve(p)));p=q;!a.L&&Sd.includes(a.B.get(b))&&(p=0);p=d.startTime-p;(Math.abs(n-p)>=.001||g||h)&&(!k||p>0||!n)&&(n=p,a.Sa&&(jk(a,b,()=>kk(a,b),null),jk(a,b,()=>lk(a,b,n),null)));b!="video"&&a.l.has("video")||!a.h||(je(a.h,n,d.i),ke(a.h,(l||"").includes("mp2t")))}if(r.length)a.D.onMetadata(r,n,d?d.endTime:null)}f&&b=="video"&&(a.h||Vj(a,"application/cea-608",!1),a.H||(a.H=new oc(l.split(";",1)[0])),
d?(f=jc(a.H,c),f.length&&oe(a.h,f,n)):a.H.init(c,h,m));if(a.j.has(b))if(f=await a.j.get(b).transmux(c,e,d,a.i.duration,b),ArrayBuffer.isView(f))c=f;else{if(f.init!=null){const q=f.init;jk(a,b,()=>{mk(a,b,q,n,e,!0)},d?d.R()[0]:null)}c=f.data}c=nk(a,e,c,d,b);if(d&&a.L&&b!=K&&(g||h)){let q=d.startTime;a.P=="HLS"&&!a.o&&b=="audio"&&a.l.has("video")&&(g=await a.X.promise,Math.abs(g)>.15&&(q-=g));jk(a,b,()=>kk(a,b),null);jk(a,b,()=>lk(a,b,q),null)}await jk(a,b,()=>{mk(a,b,c,n,e,!d)},d?d.R()[0]:null)}}
function jk(a,b,c,d){kg(a.C);c={start:c,p:Promise.withResolvers(),uri:d};a.m.get(b).push(c);a.m.get(b).length==1&&ok(a,b);return c.p.promise}function kk(a,b){const c=a.l.get(b),d=c.appendWindowStart,e=c.appendWindowEnd;c.abort();c.appendWindowStart=d;c.appendWindowEnd=e;Xj(a,b)}function lk(a,b,c){c<0&&(c+=.001);a.l.get(b).timestampOffset=c;Xj(a,b)}function mk(a,b,c,d,e,f=!1){a.G&&Ub(a.G,c,d,e);hk(a,b,c,f);a.l.get(b).appendBuffer(c)}
function nk(a,b,c,d,e){if(Vd(a.B.get(e))!="mp4")return c;const f=d===null,g=a.Ba.get(e),h=a.D.wd();let k=!1;d&&d.ea&&(k=d.ea.encrypted);d=d?d.R()[0]:null;const l=A();a.u.correctEc3Enca&&f&&e==="audio"&&(c=Gi(c));var m;if(m=f)if(l.h()!="CHROMIUM")m=!1;else{m=null;const n=navigator.userAgent.match(/Chrome\/(\d+)/);n&&(m=parseInt(n[1],10));m=b.type==="video"&&m!=null&&m<94&&b.supplementalCodecs!=b.codecs&&/dvh1|dvhe/.test(b.supplementalCodecs)}m&&(c=Hi(c));a.u.insertFakeEncryptionInInit&&g&&l.G(h,e)&&
(f?c=Ii(b,c,d,h):!k&&l.ma(e)&&(c=Li(c)));f&&l.I()&&(c=Oi(c));return c}function pk(a,b){const c=dk(a,"video")||0;me(a.h,b,c)}function qk(a){a.h&&me(a.h,"",0)}function rk(a,b,c,d){if(d<=c)Xj(a,b);else{if(a.G){var e=a.G;b==="video"&&e.g&&e.g.flushBuffer(c,d)}a.l.get(b).remove(c,d)}}
async function sk(a,b){b==K?a.h&&await a.h.remove(0,Infinity):(b==="video"&&a.H&&a.h&&await a.h.remove(0,Infinity,!0),await jk(a,b,()=>rk(a,b,0,a.i.duration),null),a.o&&await jk(a,"audio",()=>rk(a,"audio",0,a.i.duration),null))}function tk(a){a.H&&a.H.g.clear()}
async function uk(a,b,c,d,e){const {type:f,Xb:g,Ge:h}=vk(a,b,c,d,e);if(c=e.get("audio"))a.o=c.isAudioMuxedInVideo;if(f==wk)return a.j.has(b)&&!g?(a.j.get(b).destroy(),a.j.delete(b)):!a.j.has(b)&&g?a.j.set(b,g):g&&(a.j.has(b)&&a.j.get(b).transmux!==g.transmux?(a.j.get(b).destroy(),a.j.set(b,g)):g.destroy()),!1;f==xk?await yk(a,b,h,g):f==zk&&(g&&g.destroy(),await Ak(a,e));return!0}
function Bk(a,b,c,d){const e=a.l.get(b);if(e.appendWindowEnd!==d||e.appendWindowStart!==c)e.appendWindowStart=0,e.appendWindowEnd=d,e.appendWindowStart=c;Xj(a,b)}
async function Ck(a,b,c,d,e,f,g,h,k){if(b==K)f||je(a.h,c),le(a.h,d,e);else{var l=[];await uk(a,b,g,h,k)||(l.push(jk(a,b,()=>kk(a,b),null)),a.o&&l.push(jk(a,"audio",()=>kk(a,"audio"),null)));f||(l.push(jk(a,b,()=>lk(a,b,c),null)),a.o&&l.push(jk(a,"audio",()=>lk(a,"audio",c),null)));if(d!=0||e!=Infinity)l.push(jk(a,b,()=>Bk(a,b,d,e),null)),a.o&&l.push(jk(a,"audio",()=>Bk(a,"audio",d,e),null));l.length&&await Promise.all(l)}}
async function Dk(a,b,c){if(b!=K&&a.L){var d=dk(a,b);d&&Math.abs(d-c)<.15||(jk(a,b,()=>kk(a,b),null),a.o&&jk(a,"audio",()=>kk(a,"audio"),null),await jk(a,b,()=>lk(a,b,c),null),a.o&&await jk(a,"audio",()=>lk(a,"audio",c),null))}}
async function Ek(a,b){kg(a.C);const c=[],d=Array.from(a.l.keys()),e=new Map;for(const f of d){const g=Promise.withResolvers(),h={start:()=>g.resolve(),p:g,uri:null},k=a.m.get(f);k.push(h);c.push(g.promise);e.set(f,h);k.length==1&&h.start()}try{await Promise.all(c)}catch(f){if(a.C.g){for(const g of d)b=a.m.get(g),e.has(g)&&ua(b,e.get(g));return}throw f;}try{await b()}catch(f){const g=a.g.error?sb(a.g.error):"No error in the media element";throw new H(2,3,3015,f,g,null);}finally{for(const f of d)Yj(a,
f)}}async function Fk(a,b,c){bk(a)&&a.i.duration===Infinity&&(a.Oa=!0,await Ek(a,()=>{bk(a)&&a.i.duration===Infinity&&a.i.setLiveSeekableRange(b,c)}))}async function Gk(a){bk(a)&&a.Oa&&a.i.duration===Infinity&&(a.Oa=!1,await Ek(a,()=>{bk(a)&&a.i.duration===Infinity&&a.i.clearLiveSeekableRange()}))}function Yj(a,b){a.m.get(b).shift();ok(a,b)}
function ok(a,b){const c=a.m.get(b)[0];if(c)try{c.start()}catch(d){if(d.name=="QuotaExceededError")c.p.reject(new H(2,3,3017,b));else if(Zj(a)){const e=a.g.error?sb(a.g.error):"No error in the media element";c.p.reject(new H(2,3,3015,d,e,c.uri))}else c.p.reject(new H(2,3,3024,b));Yj(a,b)}}function Hk(a,b){a.W=b;a.h&&(a.h.j=b)}
function yk(a,b,c,d){return jk(a,b,()=>{if(b!==K){a.B.get(b);var e=A(),f=a.D.wd();e.l(f)&&(a.j.has(b)&&(a.j.get(b).destroy(),a.j.delete(b)),d&&a.j.set(b,d),e=c+a.u.addExtraFeaturesToSourceBuffer(c),a.l.get(b).changeType(e),a.B.set(b,c));Xj(a,b)}},null)}
async function Ik(a,b){if(!a.K&&!a.T){a.K=!0;a.o=!1;var c=a.g.currentTime,d=a.g.autoplay;a.g.paused||(a.ya=!0);a.$a&&(a.g.autoplay=!1);try{a.A.xa();for(const n of a.j.values())n.destroy();for(const n of a.l.values())try{a.i.removeSourceBuffer(n)}catch(p){}a.j.clear();a.l.clear();const e=a.i.duration;a.J=Promise.withResolvers();a.i=Nj(a,a.J);await a.J.promise;!isNaN(e)&&e?a.i.duration=e:!isNaN(a.ma)&&a.ma&&(a.i.duration=a.ma);const f=Promise.withResolvers(),g=a.i.sourceBuffers,h=b.size;let k=0;const l=
()=>{k++;k===h&&(f.resolve(),a.A.Ma(g,"addsourcebuffer",l))};a.A.F(g,"addsourcebuffer",l);for(const n of b.keys()){const p=b.get(n);Uj(a,n,p,p.codecs)}const m=b.get("audio");m&&m.isAudioMuxedInVideo&&(a.o=!0);a.o&&!a.m.has("audio")&&a.m.set("audio",[]);await f.promise}finally{a.K=!1,kg(a.C),a.A.na(a.g,"loadedmetadata",()=>{a.C.g||(a.g.currentTime=c)}),a.A.na(a.g,"canplaythrough",()=>{a.C.g||(a.g.autoplay=d,a.ya&&(a.ya=!1,a.g.play()))})}}}function Ak(a,b){return Ek(a,()=>Ik(a,b))}
function Jk(a,b,c,d){let e,f=!1;const g=Ob("audio",(d||"").split(",")),h=Ob("video",(d||"").split(","));var k=h;b=="audio"&&(k=g);k||=d;let l=Rd(c,k);const m=Zd(a.B.get(b));let n=a.u.forceTransmux;!Hh(l)||!a.L&&Sd.includes(l)?n=!0:n||c==m||(n=!A().N()&&Sd.includes(c));n&&(a=Td(c,k),k=Ld(a))&&(e=k(),g&&h&&(f=!0),l=e.convertCodecs(b,a));!e&&b==="video"&&g&&(l=Rd(c,d));b=Wd($d(l));return{Xb:e,pj:f,zg:Zd(l),codec:b,mimeType:l}}
function vk(a,b,c,d,e){if(b==K)return{type:wk,Ge:c,Xb:null};var f=Wd($d(a.B.get(b)));const g=Zd(a.B.get(b));var h=Jk(a,b,c,d);const k=h.Xb,l=h.pj,m=h.zg,n=h.codec;h=h.mimeType;var p=!0;l&&a.B.has("audio")&&(c=Jk(a,"audio",c,d),d=Wd($d(a.B.get("audio"))),p=Zd(a.B.get("audio")),p=d==c.codec&&p==c.zg,c.Xb&&c.Xb.destroy());if(f===n&&g===m&&p)return{type:wk,Ge:h,Xb:k};f=!0;if(a.o&&!e.has("audio")||l&&k&&!a.j.has(b))f=!1;b=A();e=a.D.wd();if(f&&a.u.codecSwitchingStrategy==="smooth"&&b.l(e))return{type:xk,
Ge:h,Xb:k};k&&k.destroy();return{type:zk,Ge:h,Xb:null}}function Kk(a,b,c,d,e){a=vk(a,b,c,d,e);a.Xb&&a.Xb.destroy();return a.type==zk}
var Lk=class{constructor(a,b,c,d,e){this.g=a;this.D=c;this.u=d;this.W=b;this.l=new Map;this.B=new Map;this.Ba=new Map;this.h=null;this.wa=!1;this.G=e||null;this.m=new Map;this.A=new Ca;this.j=new Map;this.H=null;this.J=Promise.withResolvers();this.sa="";this.$a=!1;this.qa=!0;this.T=!1;this.I=this.S=null;this.i=Nj(this,this.J);this.ya=this.K=!1;this.C=new lg(()=>Qj(this));this.L=!1;this.P="UNKNOWN";this.o=this.Sa=this.Ta=!1;this.ma=null;this.Ka=new Map;this.Z=this.N=this.ba=this.O=null;this.X=Promise.withResolvers();
const f=uh(A(),this.g);f&&(this.T=f.state!="disconnected",this.A.Pb(f,["connect","connecting","disconnect"],()=>{this.T=f.state!="disconnected"}));this.Oa=!1}destroy(){return this.C.destroy()}async init(a,b=!1,c="UNKNOWN",d=!1){await this.J.promise;if(Sj(this)||Tj(this))la("Expected MediaSource to be open during init(); reopening the media source."),this.J=Promise.withResolvers(),this.i=Nj(this,this.J),await this.J.promise;this.L=b;this.P=c;this.Ta=d;this.Sa=!this.L&&this.P=="HLS"&&!this.Ta;this.Ka.clear();
this.Z=this.N=this.ba=this.O=null;this.X=Promise.withResolvers();for(const e of a.keys())b=a.get(e),Uj(this,e,b,b.codecs),this.o?(this.m.set("audio",[]),this.m.set("video",[])):this.m.set(e,[]);(a=a.get("audio"))&&a.isAudioMuxedInVideo&&(this.o=!0)}configure(a){this.u=a;this.h&&(this.h.C=a.modifyCueCallback)}tc(){const a={total:this.K?[]:$i(this.g.buffered),audio:$i(ak(this,"audio")),video:$i(ak(this,"video")),text:[]};if(this.h){const b=this.h.g,c=this.h.h;b!=null&&c!=null&&a.text.push({start:b,
end:c})}return a}async remove(a,b,c,d){a=="video"&&this.H&&(this.H.remove(d),this.h.remove(this.h.g||0,c,!0));a==K?await this.h.remove(b,c):c>b&&(await jk(this,a,()=>rk(this,a,b,c),null),this.o&&await jk(this,"audio",()=>rk(this,"audio",b,c),null))}async flush(a){a!=K&&(await jk(this,a,()=>{this.g.currentTime-=.001;Xj(this,a)},null),this.o&&await jk(this,"audio",()=>{this.g.currentTime-=.001;Xj(this,"audio")},null))}async endOfStream(a){await Ek(this,()=>{Sj(this)||Tj(this)||(a?this.i.endOfStream(a):
this.i.endOfStream())})}async Eb(a){await Ek(this,()=>{if(this.u.durationReductionEmitsUpdateEnd&&a<this.i.duration)for(const b of this.l.keys()){const c={start:()=>{},p:Promise.withResolvers(),uri:null};this.m.get(b).unshift(c)}this.ma=this.i.duration=a})}getDuration(){return this.i.duration}},Oj=window.URL.createObjectURL,Wj="sequence",wk="none",zk="reset",xk="changeType";var U=class{constructor(a,b,c=!0,d=1){this.h=a;this.D=b;this.u=this.m=Infinity;this.i=d;this.g=this.l=null;this.B=0;this.A=!0;this.I=!1;this.H=0;this.C=c;this.G=0;this.o=!1;this.j=a}getDuration(){return this.m}ci(){return this.i}ih(a){this.h=a}Eb(a){this.m=a}ji(){return this.h}hh(a){this.B=a}od(a){a&&!this.A&&(this.I=!0);this.A=a}kg(a){this.u=a}pe(){return this.u}ig(a){this.D=a}Wh(){return this.D}$g(a,b){if(a.length!=0){var c=(Date.now()+this.B)/1E3;a=a.filter(e=>e.start+b<c);if(a.length!=0){var d=
a[a.length-1].end+b;this.He(a[0].start+b);this.i=a.reduce((e,f)=>Math.max(e,f.end-f.start),this.i);this.g=Math.max(this.g,d);this.h!=null&&this.C&&!this.o&&(this.h=c-this.g-this.i)}}}Ed(a){if(a.length!=0){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.B)/1E3;for(const e of a)d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.i=Math.max(this.i,e.endTime-e.startTime));this.He(b);this.g=Math.max(this.g,c);this.h!=null&&this.C&&!this.o&&(this.h=d-this.g-this.i)}}Zg(a,b){this.He(a);
b==Infinity||this.isLive()||(this.g=Math.max(this.g,b))}di(){return this.g}Of(){this.o=!0}Di(){return this.o}jg(a){this.j=a}ai(){return this.j}He(a){this.l==null?this.l=a:this.I||(this.l=Math.min(this.l,a))}Qf(a){this.i=Math.max(this.i,a)}offset(a){this.l!=null&&(this.l+=a);this.g!=null&&(this.g+=a)}isLive(){return this.m==Infinity&&!this.A}$c(){return this.m!=Infinity&&!this.A}ua(){return!this.A}sb(){const a=this.vc()-this.u;return Math.max(this.H,a)}mh(a){this.H=a}vc(){return this.ua()?Math.min(Math.max(0,
(Date.now()+this.B)/1E3-this.i-this.h)+this.G,this.m):this.g?Math.min(this.g,this.m):this.m}xd(a){const b=Math.max(this.l,this.H);if(this.u==Infinity)return Math.ceil(b*1E3)/1E3;const c=this.vc()-this.u;a=Math.min(c+a,this.rb());return Math.max(b,a)}Ab(){return this.xd(0)}rb(){const a=this.ua()?this.D:0;return Math.max(0,this.vc()-a)}sh(){return this.h==null||this.g!=null&&this.C?!1:!0}gh(a){this.G=a}Sh(){return this.G}};w("shaka.media.PresentationTimeline",U);
U.prototype.getAvailabilityTimeOffset=U.prototype.Sh;U.prototype.setAvailabilityTimeOffset=U.prototype.gh;U.prototype.usingPresentationStartTime=U.prototype.sh;U.prototype.getSeekRangeEnd=U.prototype.rb;U.prototype.getSeekRangeStart=U.prototype.Ab;U.prototype.getSafeSeekRangeStart=U.prototype.xd;U.prototype.getSegmentAvailabilityEnd=U.prototype.vc;U.prototype.setUserSeekStart=U.prototype.mh;U.prototype.getSegmentAvailabilityStart=U.prototype.sb;U.prototype.isDynamic=U.prototype.ua;
U.prototype.isInProgress=U.prototype.$c;U.prototype.isLive=U.prototype.isLive;U.prototype.offset=U.prototype.offset;U.prototype.notifyMaxSegmentDuration=U.prototype.Qf;U.prototype.notifyMinSegmentStartTime=U.prototype.He;U.prototype.getInitialProgramDateTime=U.prototype.ai;U.prototype.setInitialProgramDateTime=U.prototype.jg;U.prototype.isStartTimeLocked=U.prototype.Di;U.prototype.lockStartTime=U.prototype.Of;U.prototype.getMaxSegmentEndTime=U.prototype.di;U.prototype.notifyPeriodDuration=U.prototype.Zg;
U.prototype.notifySegments=U.prototype.Ed;U.prototype.notifyTimeRange=U.prototype.$g;U.prototype.getDelay=U.prototype.Wh;U.prototype.setDelay=U.prototype.ig;U.prototype.getSegmentAvailabilityDuration=U.prototype.pe;U.prototype.setSegmentAvailabilityDuration=U.prototype.kg;U.prototype.setStatic=U.prototype.od;U.prototype.setClockOffset=U.prototype.hh;U.prototype.getPresentationStartTime=U.prototype.ji;U.prototype.setDuration=U.prototype.Eb;U.prototype.setPresentationStartTime=U.prototype.ih;
U.prototype.getMaxSegmentDuration=U.prototype.ci;U.prototype.getDuration=U.prototype.getDuration;function Mk(a){if(!a.h.stallEnabled)return null;const b=a.h.stallThreshold,c=a.h.stallSkip;return new Nk(new Ok(a.g),b,async()=>{if($i(a.g.buffered).length){if(c)a.g.currentTime+=c;else{await a.g.play();if(!a.g)return;a.g.pause();a.g.play()}a.G++;a.u(new P("stalldetected"))}})}
function Pk(a){if(a.g.readyState!=0){if(a.g.seeking){if(!a.o)return}else a.o=!1;if(!a.g.paused||a.g.currentTime==a.m&&(a.g.autoplay||a.g.currentTime!=a.m))if(!a.j||!Qk(a.j)){var b=a.g.currentTime,c=a.g.buffered,d=aj(c,b,a.h.gapDetectionThreshold);if(d==null&&a.j&&!Qk(a.j)){var e=$i(c);for(var f=0;f<e.length-1;f++)if(Math.abs(b-e[f].end)<.1&&e[f+1].start>e[f].end){d=f+1;break}}d==null||d==0&&!a.A||(e=c.start(d),(f=a.h.gapPadding)&&(e=Math.ceil((e+f)*100)/100),f=a.D.rb(),e>=f||e-b<.001||(d!=0&&c.end(d-
1),Rk(a,e),b==a.m&&(a.m=e),a.C++,a.u(new P("gapjumped"))))}}}function Rk(a,b){a.B=!0;a.l.na(a.g,"seeked",()=>{a.B=!1});a.g.currentTime=b}
var Sk=class{constructor(a,b,c,d){this.u=d;this.g=a;this.D=b;this.h=c;this.l=new Ca;this.o=!1;this.m=0;this.B=!1;this.G=this.C=0;this.j=Mk(this);this.A=!1;this.l.F(a,"waiting",()=>Pk(this));this.i=(new te(()=>{Pk(this)})).Aa(this.h.gapJumpTimerTime)}release(){this.l&&(this.l.release(),this.l=null);this.i!=null&&(this.i.stop(),this.i=null);this.j&&(this.j.release(),this.j=null);this.g=this.D=this.u=null}fd(){this.A=!0;this.i&&this.i.Aa(this.h.gapJumpTimerTime);Pk(this)}};
function Qk(a){const b=a.h;var c=Tk(b),d=b.g.currentTime;const e=Date.now()/1E3;if(a.g!=d||a.m!=c)a.l=e,a.g=d,a.m=c,a.i=!1;d=e-a.l;if(c=d>=a.o&&c&&!a.i)a.j&&a.j(a.g,d),a.i=!0,a.g=b.g.currentTime;return c}var Nk=class{constructor(a,b,c){this.h=a;this.m=Tk(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.i=!1;this.o=b;this.j=c}release(){this.h&&this.h.release();this.j=this.h=null}};
function Tk(a){if(a.g.paused||a.g.playbackRate==0||a.i||a.g.buffered.length==0)var b=!1;else a:{b=a.g.buffered;a=a.g.currentTime;for(const {start:c,end:d}of $i(b))if(!(a<c-.1||a>d-.5)){b=!0;break a}b=!1}return b}var Ok=class{constructor(a){this.g=a;this.h=new Ca;this.i=!1;this.h.F(this.g,"audiofocuspaused",()=>{this.i=!0});this.h.F(this.g,"audiofocusgranted",()=>{this.i=!1});this.h.F(this.g,"audiofocuslost",()=>{this.i=!0})}release(){this.h&&this.h.release();this.h=null}};function Uk(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Vk.value().get(b),c.na(a,b,d))}var Vk=new Ga(()=>new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]]));function Wk(a,b){Math.abs(a.g.currentTime-b)<.001?Xk(a):(a.h.na(a.g,"seeking",()=>{Xk(a)}),Yk(a.i,b))}function Zk(a){return a.o?a.g.currentTime:a.j()}function $k(a,b){a.g.readyState>0?Yk(a.i,b):Uk(a.g,HTMLMediaElement.HAVE_METADATA,a.h,()=>{Wk(a,a.j())})}function Xk(a){a.o=!0;a.h.F(a.g,"seeking",()=>a.m());a.u(a.g.currentTime)}
var bl=class{constructor(a,b,c,d){this.g=a;this.m=b;this.u=c;this.l=null;this.j=()=>{this.l==null&&(this.l=d());return this.l};this.o=!1;this.h=new Ca;this.i=new al(a);Uk(this.g,HTMLMediaElement.HAVE_METADATA,this.h,()=>{Wk(this,this.j())})}release(){this.h&&(this.h.release(),this.h=null);this.i!=null&&(this.i.release(),this.i=null);this.m=()=>{};this.g=null}};function Yk(a,b){a.l=a.g.currentTime;a.j=b;a.i=a.m;a.g.currentTime=b;a.h.Aa(.1)}
var al=class{constructor(a){this.g=a;this.m=10;this.j=this.l=this.i=0;this.h=new te(()=>{this.i<=0?this.h.stop():this.g.currentTime!=this.l||this.g.currentTime===this.j?this.h.stop():(this.g.currentTime=this.j,this.i--)})}release(){this.h&&(this.h.stop(),this.h=null);this.g=null}};function cl(a){return a.g.getStartDate&&(a=a.g.getStartDate().getTime(),!isNaN(a))?a/1E3:null}function dl(a,b){a=a.g.seekable;a.length>0&&(b=Math.max(a.start(0),b),b=Math.min(a.end(a.length-1),b));return b}
var el=class{constructor(a){this.g=a;this.i=!1;this.h=null;this.j=new Ca}ready(){const a=()=>{if(this.h==null||this.h==0&&this.g.duration!=Infinity)this.i=!0;else{const b=this.g.currentTime;let c=null;if(typeof this.h==="number")c=this.h;else if(this.h instanceof Date){const d=cl(this);d!==null&&(c=this.h.getTime()/1E3-d,c=dl(this,c))}c==null?this.i=!0:(c<0&&(c=Math.max(0,b+c)),b!=c?(this.j.na(this.g,"seeking",()=>{this.i=!0}),this.g.currentTime=c):this.i=!0)}};Uk(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,
this.j,()=>{a()})}release(){this.j&&(this.j.release(),this.j=null);this.g=null}u(a){this.h=this.i?this.h:a}m(){let a=this.i?this.g.currentTime:this.h;a instanceof Date&&(a=a.getTime()/1E3-(cl(this)||0),a=dl(this,a));return a||0}G(){return 0}D(){return 0}C(){return!1}I(){}H(){const a=Xi(this.g.buffered);return a!=null&&a>=this.g.duration-1}};function fl(a,b){b==null?b=a.g.ua()?a.g.rb():a.g.Ab():b instanceof Date?b=b.getTime()/1E3-(a.g.j||a.g.h):b<0&&(b=a.g.rb()+b);return gl(a,hl(a,b))}
function hl(a,b){const c=a.g.Ab();if(b<c)return c;a=a.g.rb();return b>a?a:b}function gl(a,b){const c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}
function il(a,b){var c=a.l.rebufferingGoal;const d=a.l.safeSeekOffset;let e=a.g.Ab();const f=a.g.rb(),g=a.g.getDuration();f-e<3&&(e=f-3);const h=a.g.xd(c),k=a.g.xd(d);c=a.g.xd(c+d);return b>=g?gl(a,b):b>f?f-a.l.safeSeekEndOffset:b<e?a.g.isLive()&&a.l.returnToEndOfLiveWindowWhenOutside?f-a.l.safeSeekEndOffset:Yi(a.h.buffered,k)?k:c:b>=h||Yi(a.h.buffered,b)?b:c}
var jl=class{constructor(a,b,c,d,e,f){this.h=a;this.g=b.presentationTimeline;this.l=c;this.B=e;this.A=null;this.i=new Sk(a,b.presentationTimeline,c,f);this.j=new bl(a,()=>{a:{var g=this.i;g.o=!0;g.A=!1;g.i&&g.i.Aa(g.h.gapJumpTimerTime);Pk(g);var h=Zk(this.j);g=il(this,h);if(!Jh()&&Math.abs(g-h)>.001){h=!1;const k=A().qa();if(k){const l=Date.now()/1E3;if(!this.A||this.A<l-k)this.A=l,h=!0}else h=!0;if(h){$k(this.j,g);g=void 0;break a}}this.B();g=void 0}return g},g=>{var h=this.i;h.g.seeking&&!h.o&&
(h.o=!0,h.m=g);h.i&&h.i.Aa(h.h.gapJumpTimerTime);Pk(h)},()=>fl(this,d));this.o=new te(()=>{if(this.h.readyState!=0&&!this.h.paused){var g=Zk(this.j),h=this.g.Ab(),k=this.g.rb();k-h<3&&(h=k-3);g<h&&(g=il(this,g),this.h.currentTime=g)}})}ready(){this.o.Aa(.25)}release(){this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.o&&(this.o.stop(),this.o=null);this.h=this.j=this.g=this.l=null;this.B=()=>{}}u(a){$k(this.j,fl(this,a))}m(){const a=Zk(this.j);return this.h.readyState>
0&&!this.h.paused?hl(this,a):a}G(){return this.i.G}D(){return this.i.C}C(){return this.i.B}I(){this.i.fd()}H(){if(this.g.ua()){const a=this.g.vc(),b=Xi(this.h.buffered);if(b!=null&&b>=a)return!0}return!1}};function kl(a,b,c){a=new Q(a,a+b,()=>c,0,null,null,a,a,a+b);return new ll([a])}
var ll=class{constructor(a){this.g=a;this.m=null;this.i=0;this.o=!1}getNumReferences(){return this.g.length}getNumEvicted(){return this.i}release(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)}Ki(){this.o=!0}yb(a){for(const b of this.g)a(b)}xb(){return this.g[0]||null}find(a){var b=this.g.length-1;if(b<0)return null;if(a<this.g[0].startTime)return this.i;const c=ya(this.g,e=>e.startTime<=a)-1;if(c<0)return null;const d=this.g[c];b=c<b?this.g[c+1].startTime:d.endTime;return a>=d.startTime&&
a<b?c+this.i:null}get(a){if(this.g.length==0)return null;a-=this.i;return a<0||a>=this.g.length?null:this.g[a]}offset(a){if(!this.o)for(const b of this.g)b.offset(a)}Ce(a){if(!this.o&&a.length){var b=Math.round(a[0].startTime*1E3)/1E3,c=ya(this.g,d=>Math.round(d.startTime*1E3)/1E3<b);this.g.length=c;this.g.push(...a)}}ed(a,b){const c=Math.max(b,this.g.length>0?this.g[0].startTime:-Infinity);let d=0;for(;d<a.length&&a[d].endTime<=c;)d++;d>0&&(a=a.slice(d));this.Ce(a);this.Pa(b)}Pa(a){if(!this.o){var b=
ya(this.g,c=>c.endTime<=a);b>0&&(this.i+=b,this.g=this.g.slice(b))}}Sc(a,b,c=!1){if(!this.o){for(;this.g.length;)if(this.g[this.g.length-1].startTime>=b)this.g.pop();else break;var d=ya(this.g,e=>e.endTime<=a);d>0&&(c||(this.i+=d),this.g=this.g.slice(d));this.g.length!=0&&(c=this.g[this.g.length-1],b=new Q(c.startTime,b,c.D,c.startByte,c.endByte,c.ea,c.timestampOffset,c.appendWindowStart,c.appendWindowEnd,c.h,c.tilesLayout,c.A,c.g,c.status,c.aesKey),b.mimeType=c.mimeType,b.codecs=c.codecs,b.i=c.i,
this.g[this.g.length-1]=b)}}Ue(a,b){this.o||(this.m&&this.m.stop(),this.m=new te(()=>{const c=b();c?this.g.push(...c):(this.m.stop(),this.m=null)}),this.m.Aa(a))}[Symbol.iterator](){return this.Kb(0)}Kb(a,b=!1,c=!1){let d=this.find(a);if(d==null)return null;const e=this.get(d);c?d++:d--;let f=-1;if(e&&e.h.length>0)for(let g=e.h.length-1;g>=0;--g){let h=e.h[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.l;)g--,h=e.h[g];if(!h.l)return la("No independent partial segment found!"),null}c?d--:d++;
f=g-1;break}}return new ml(this,d,f,c)}u(){return-1}};w("shaka.media.SegmentIndex",ll);ll.forSingleSegment=kl;ll.prototype.getIteratorForTime=ll.prototype.Kb;ll.prototype.updateEvery=ll.prototype.Ue;ll.prototype.fit=ll.prototype.Sc;ll.prototype.evict=ll.prototype.Pa;ll.prototype.mergeAndEvict=ll.prototype.ed;ll.prototype.offset=ll.prototype.offset;ll.prototype.get=ll.prototype.get;ll.prototype.find=ll.prototype.find;ll.prototype.markImmutable=ll.prototype.Ki;ll.prototype.release=ll.prototype.release;
ll.prototype.getNumEvicted=ll.prototype.getNumEvicted;ll.prototype.getNumReferences=ll.prototype.getNumReferences;
var ml=class{constructor(a,b,c,d){this.i=a;this.h=b;this.g=c;this.reverse=d}nd(a){this.reverse=a}Kh(){return this.h}current(){let a=this.i.get(this.h);a&&a.h.length>0&&a.m&&this.g>=a.h.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&a.h.length>0?a.h[this.g]:a}next(){var a=this.i.get(this.h);this.reverse?a&&a.h.length>0?(this.g--,this.g<0&&(this.h--,this.g=(a=this.i.get(this.h))&&a.h.length>0?a.h.length-1:0)):(this.h--,this.g=0):a&&a.h.length>0?(this.g++,a.m&&this.g==a.h.length&&(this.h++,
this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}}dg(){var a=this.current();if(a&&a.Hc&&!a.l&&(a=this.i.get(this.h))&&a.h.length>0){let b=a.h[this.g];for(;b.l&&!(this.g<=0);)this.g--,b=a.h[this.g]}}};w("shaka.media.SegmentIterator",ml);ml.prototype.resetToLastIndependent=ml.prototype.dg;ml.prototype.next=ml.prototype.next;ml.prototype.current=ml.prototype.current;ml.prototype.currentPosition=ml.prototype.Kh;ml.prototype.setReverse=ml.prototype.nd;
function nl(a,b){for(const c of a.h)b(c)}function ol(a,b){for(const c of a.h)if(c.find(b)!=null)return c.u();return-1}
var pl=class extends ll{constructor(){super([]);this.h=[]}clone(){const a=new pl;a.h=this.h.slice();a.i=this.i;return a}release(){this.h=[]}yb(a){for(const b of this.h)b.yb(a)}find(a){let b=this.i;for(const c of this.h){const d=c.find(a);if(d!=null)return d+b;b+=c.getNumEvicted()+c.getNumReferences()}return null}get(a){let b=this.i;for(const d of this.h){var c=d.get(a-b);if(c)return c;c=d.getNumReferences();b+=d.getNumEvicted()+c}return null}offset(){}Ce(){}Pa(a){if(this.h.length){var b=this.h[0];
b.Pa(a);b.getNumReferences()==0&&(this.h.shift(),this.i+=b.getNumEvicted(),b.release(),this.Pa(a))}}ed(){}Sc(){}Ue(){}};w("shaka.media.MetaSegmentIndex",pl);pl.prototype.updateEvery=pl.prototype.Ue;pl.prototype.fit=pl.prototype.Sc;pl.prototype.mergeAndEvict=pl.prototype.ed;pl.prototype.evict=pl.prototype.Pa;pl.prototype.merge=pl.prototype.Ce;pl.prototype.offset=pl.prototype.offset;pl.prototype.get=pl.prototype.get;pl.prototype.find=pl.prototype.find;pl.prototype.forEachTopLevelReference=pl.prototype.yb;
pl.prototype.release=pl.prototype.release;function ql(a){a.i.stop();const b=a.j?0:a.h;if(b>=0&&b<=16)try{a.g.If()!=b&&a.g.jh(b);return}catch(c){}a.i.Aa(.25);a.g.If()!=0&&a.g.jh(0)}var rl=class{constructor(a){this.g=a;this.j=!1;this.h=this.g.If();this.i=new te(()=>{this.g.isPaused()||this.g.Oi(this.h*.25)})}release(){this.set(this.Uc());this.i&&(this.i.stop(),this.i=null);this.g=null}set(a){this.h=a;ql(this)}Uc(){return this.g.Uc()}};function sl(a,b){const c=a.j.currentTime;for(const d of a.g)d.j(c,b)}var tl=class{constructor(a){this.j=a;this.h=new Ca;this.g=new Set;this.i=(new te(()=>{sl(this,!1)})).La();a.paused||this.i.Aa(.25);this.h.F(a,"playing",()=>{this.i.La().Aa(.25)});this.h.F(a,"pause",()=>{this.i.stop()});this.h.F(a,"seeked",()=>{this.i.La();a.paused||this.i.Aa(.25)})}release(){this.h&&(this.h.release(),this.h=null);this.i.stop();for(const a of this.g)a.release();this.g.clear()}};function ul(a){const b={bandwidth:a.bandwidth||0,audioSamplingRate:null,codecs:a.codecs,contentType:a.type,frameRate:null,height:null,mimeType:a.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:a.roles,language:null};a.type=="video"&&(b.frameRate=a.frameRate||null,b.height=a.height||null,b.pixelAspectRatio=a.pixelAspectRatio||null,b.width=a.width||null);a.type=="audio"&&(b.audioSamplingRate=a.audioSamplingRate,b.channelsCount=a.channelsCount,b.label=a.label||null,b.language=
a.language);return b}function vl(a,b){let c=a.g.get(b);c||(c={Hd:[],lf:null,contentType:b},a.g.set(b,c));return c}function wl(a,b){if((a=a.h()[b.contentType])&&a.length>0){const c=a[0].start,d=a[a.length-1].end,e=b.Hd;b.Hd=e.filter((f,g)=>f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0)}else b.Hd=[]}function xl(a,b,c){var d=vl(a,b.contentType);wl(a,d);a={cd:b,position:c};d=d.Hd;b=d.findIndex(e=>e.position>=c);b>=0?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
function yl(a,b,c){return(a=a.h()[c])&&a.length>0&&(c=a[a.length-1].end,b>=a[0].start&&b<c)?!0:!1}
var zl=class extends Vf{constructor(a){super();this.g=new Map;this.h=a}release(){this.g.clear();super.release()}j(a){for(const f of this.g.values()){var b=f.lf;a:{var c=f.Hd;for(var d=c.length-1;d>=0;d--){var e=c[d];if(e.position<=a){c=e.cd;break a}}c=null}d=c&&!(b===c||b&&c&&b.bandwidth==c.bandwidth&&b.audioSamplingRate==c.audioSamplingRate&&b.codecs==c.codecs&&b.contentType==c.contentType&&b.frameRate==c.frameRate&&b.height==c.height&&b.mimeType==c.mimeType&&b.channelsCount==c.channelsCount&&b.pixelAspectRatio==
c.pixelAspectRatio&&b.width==c.width);e=c&&b&&c.label&&b.label&&b.label!==c.label;const g=c&&b&&c.language&&b.language&&b.language!==c.language;b=c&&b&&c.roles&&b.roles&&!za(b.roles,c.roles);(e||g||b)&&yl(this,a,c.contentType)&&(f.lf=c,b=new P("audiotrackchange",new Map([["quality",c],["position",a]])),this.dispatchEvent(b));d&&yl(this,a,c.contentType)&&(f.lf=c,JSON.stringify(c),b=new P("qualitychange",new Map([["quality",c],["position",a]])),this.dispatchEvent(b))}}};function Al(a){a.g||(a.g=(new te(()=>{const b=a.j();for(const [c,d]of a.h)if(d.endTime<b.start){a.h.delete(c);const e=new P("regionremove",new Map([["region",d]]));a.dispatchEvent(e)}!a.h.size&&a.g&&(a.g.stop(),a.g=null)})).Aa(2))}function Bl(a,b){const c=`${b.schemeIdUri}_${b.id}_${b.startTime.toFixed(1)}_${b.endTime.toFixed(1)}`;a.h.has(c)||(a.h.set(c,b),b=new P("regionadd",new Map([["region",b]])),a.dispatchEvent(b),Al(a))}
var Cl=class extends Vf{constructor(a){super();this.h=new Map;this.j=a;this.g=null}release(){this.h.clear();this.g&&(this.g.stop(),this.g=null);super.release()}i(){return this.h.values()}};function Dl(a,b){a.l=b;for(const c of a.g.values())c.g=b}function El(a,b){if(!a.i.segmentIndex||b.Mb()||Array.from(a.j.keys()).some(e=>Pi(e,b)))return Promise.resolve();const c=new Fl(a.l),d=Gl(c,b,a.i);a.j.set(b,c);return d}function Hl(a){if(a.g.size){var b=Array.from(a.g.keys());for(const c of a.j.keys())b.some(d=>Pi(d.ea,c))||Il(a,c)}}
function Jl(a,b,c=!1){if(!a.i.segmentIndex)return Promise.resolve();a.h||(a.h=a.i.segmentIndex.Kb(b,!0,a.o));if(!a.h)return Promise.resolve();c&&a.h.next();b=[];c=Math.abs(a.u());for(c=Math.ceil(a.m*c);a.g.size<c;){const e=a.h.next().value;if(!e)break;var d=!0;e.isPreload()&&e.endByte!=null&&(d=!1);e.Nb()==2&&(d=!1);e.Mb(!1)&&(d=!1);d&&e.ea&&b.push(El(a,e.ea));d&&!a.g.has(e)&&(d=new Fl(a.l),b.push(Gl(d,e,a.i)),a.g.set(e,d));if(!a.A(e,a.i))break}Hl(a);return Promise.all(b)}
function Il(a,b){let c=a.g;b instanceof Qi&&(c=a.j);a=c.get(b);c.delete(b);a&&a.abort()}function Kl(a){var b=a.g;for(const c of b.keys())c&&Il(a,c);b=a.j;for(const c of b.keys())c&&Il(a,c);a.h=null}function Ll(a,b){a.m=b;const c=Array.from(a.g.keys());for(;c.length>b;){const d=c.pop();d&&Il(a,d)}Hl(a)}function Ml(a,b){b&&b!==a.i&&(Kl(a),a.i=b)}
var Nl=class{constructor(a,b,c,d,e,f){this.m=a;this.i=b;this.l=c;this.g=new Map;this.j=new Map;this.h=null;this.o=d;a=(g,h)=>h.fastSwitching&&g.Hc&&g.Cd?!1:!0;this.A=e||a;this.u=f||(()=>1)}Pa(a,b=!1){for(const c of this.g.keys())a>c.endTime&&Il(this,c);b&&Hl(this)}nd(a){this.o=a;this.h&&this.h.nd(a)}};
function Gl(a,b,c){let d=new Uint8Array(0);a.Fd=a.g(b,c,async e=>{d.byteLength>0?d=Hb(d,e):d=e;a.lg&&(await a.lg(d),d=new Uint8Array(0))});return a.Fd.promise.catch(e=>e instanceof H&&e.code==7001?Promise.resolve():Promise.reject(e))}var Fl=class{constructor(a){this.g=a;this.Fd=this.lg=null}abort(){this.Fd&&this.Fd.abort()}};w("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});function Ol(a){var b=0,c=eb(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+4+2;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;const e=c.getUint16(a,!0);a+=2;if((e&1)!=0||e+a>c.byteLength){c=[];break a}const f=G(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function Pl(a){a=Ol(a).find(b=>b.type===Ql);if(!a)return null;a=vb(a.value,!0);return(a=Fc(a,"WRMHEADER"))?a:null}function Rl(a){a=Eb(Nc(a));return Sl(a)}
function Sl(a){try{const c=Pl(a);if(c)a:{for(const d of Pc(c,"DATA"))if(d.children)for(const e of d.children)if(e.tagName=="LA_URL"){var b=Nc(e);break a}b=""}else b="";return b}catch(c){return""}}function Tl(a){var b=8;a=eb(a);const c=a.getUint8(b);b+=20;c>0&&(b+=4+16*a.getUint32(b));b=G(a,b+4);return Sl(b)}var Ql=1;function Ul(a){const b=Zd(a),c=b.split("/")[0];a=$d(a);return{type:c,mimeType:b,codecs:a,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,Od:null,colorGamut:null,frameRate:null,timescale:null,drmInfos:[]}}
function Vl(a,b,c){const d=[];let e=[];const f=[];let g=!1,h=!1,k=!1;const l=C=>{C=C.toLowerCase();switch(C){case "avc1":case "avc3":e.push(C+".42E01E");h=!0;break;case "hev1":case "hvc1":e.push(C+".1.6.L93.90");h=!0;break;case "dvh1":case "dvhe":e.push(C+".05.04");h=!0;break;case "vp09":e.push(C+".00.10.08");h=!0;break;case "av01":e.push(C+".0.01M.08");h=!0;break;case "mp4a":d.push("mp4a.40.2");g=!0;break;case "ac-3":case "ec-3":case "ac-4":case "opus":case "flac":d.push(C);g=!0;break;case "apac":d.push("apac.31.00"),
g=!0}};let m=null,n=null,p=null,q=null,r=null,t=null,u=null,v=null;var x=null;const y=new Map,D=new Set;let z=null,B=null,E,J=0,X=[];const L=new Map;let W=null;const F=new Map;if(a&&b){x=G(a);var I=G(b);I=Hb(x,I)}else b?I=G(b):a&&(I=G(a));x=C=>{const S=Ph(C.reader);q=S.channelCount;r=S.sampleRate;l(C.name);C.reader.Ha()&&vg(C)};const O=C=>{E=C.name;var S=C.reader;S.skip(24);const V=S.Ca(),wa=S.Ca();S.skip(50);p=String(V);n=String(wa);C.reader.Ha()&&vg(C)};let M;(new Dg).Ga("moov trak mdia minf stbl moof traf".split(" "),
vg).$("tkhd",C=>{W=Oh(C.reader,C.version).trackId}).$("mdhd",C=>{C=Mh(C.reader,C.version);m=C.language;W!==null&&L.set(W,C.timescale)}).$("stsd",xg).$("tfhd",C=>{C=Kh(C.reader,C.flags);C.qc&&(J=C.qc)}).$("trun",C=>{X=Nh(C.reader,C.version,C.flags).Id}).box("mp4a",C=>{const S=Ph(C.reader);q=S.channelCount;r=S.sampleRate;C.reader.Ha()?vg(C):l(C.name)}).box("esds",C=>{C=C.reader;let S="mp4a";for(var V,wa;C.Ha();){V=C.Y();for(var Ia=C.Y();Ia&128;)Ia=C.Y();if(V==3)C.Ca(),Ia=C.Y(),Ia&128&&C.Ca(),Ia&64&&
C.skip(C.Y()),Ia&32&&C.Ca();else if(V==4)wa=C.Y(),C.skip(12);else if(V==5)break}wa&&(S+="."+Qh(wa),V==5&&C.Ha()&&(V=C.Y(),wa=(V&248)>>3,wa===31&&C.Ha()&&(wa=32+((V&7)<<3)+((C.Y()&224)>>5)),S+="."+wa));d.push(S);g=!0}).Ga("ac-3 ec-3 ac-4 Opus fLaC apac".split(" "),x).Ga("avc1 avc3 hev1 hvc1 dva1 dvav dvh1 dvhe vp09 av01".split(" "),O).box("avcC",C=>{var S=E||"";switch(E){case "dvav":S="avc3";break;case "dva1":S="avc1"}C=C.reader;C.skip(1);C=S+"."+Qh(C.Y())+Qh(C.Y())+Qh(C.Y());e.push(C);h=!0}).box("hvcC",
C=>{var S=E||"";switch(E){case "dvh1":S="hvc1";break;case "dvhe":S="hev1"}var V=C.reader;V.skip(1);C=V.Y();var wa=["","A","B","C"][C>>6],Ia=C&31,kc=V.U(),Cc=(C&32)>>5?"H":"L";C=[V.Y(),V.Y(),V.Y(),V.Y(),V.Y(),V.Y()];V=V.Y();let Pf=0;for(let Qf=0;Qf<32;Qf++){Pf|=kc&1;if(Qf==31)break;Pf<<=1;kc>>=1}S=S+("."+wa+Ia)+("."+Qh(Pf,!0));S+="."+Cc+V;wa="";for(Ia=C.length;Ia--;)if((Cc=C[Ia])||wa)wa="."+Cc.toString(16).toUpperCase()+wa;S+=wa;e.push(S);h=!0}).box("dvcC",C=>{var S=E||"";switch(E){case "hvc1":S="dvh1";
break;case "hev1":S="dvhe";break;case "avc1":S="dva1";break;case "avc3":S="dvav";break;case "av01":S="dav1"}var V=C.reader;V.skip(2);C=V.Y();V=V.Y();e.push(S+"."+Uh(C>>1&127)+"."+Uh(C<<5&32|V>>3&31));h=!0}).box("dvvC",C=>{var S=E||"";switch(E){case "hvc1":S="dvh1";break;case "hev1":S="dvhe";break;case "avc1":S="dva1";break;case "avc3":S="dvav";break;case "av01":S="dav1"}var V=C.reader;V.skip(2);C=V.Y();V=V.Y();e.push(S+"."+Uh(C>>1&127)+"."+Uh(C<<5&32|V>>3&31));h=!0}).$("vpcC",C=>{var S=E||"",V=C.reader;
C=V.Y();const wa=V.Y();V=V.Y()>>4&15;e.push(S+"."+Uh(C)+"."+Uh(wa)+"."+Uh(V));h=!0}).box("av1C",C=>{var S=E||"";switch(E){case "dav1":S="av01"}var V=C.reader;V.skip(1);C=V.Y();V=V.Y();const wa=C>>>5,Ia=(V&64)>>6;e.push(S+"."+wa+"."+Uh(C&31)+(V>>>7?"H":"M")+"."+Uh(wa===2&&Ia?(V&32)>>5?12:10:Ia?10:8)+"."+((V&16)>>4)+"."+((V&8)>>3)+((V&4)>>2)+(V&3)+"."+Uh(1)+"."+Uh(1)+"."+Uh(1)+".0");h=!0}).box("wvtt",C=>{f.push(C.name);k=!0}).box("stpp",C=>{f.push(C.name);k=!0}).box("c608",()=>{F.set("CC1","CC1");W!==
null&&L.delete(W)}).box("enca",x).box("encv",O).box("sinf",vg).box("frma",C=>{({codec:C}=Rh(C.reader));l(C)}).box("colr",C=>{e=e.map(wa=>{if(wa.startsWith("av01.")){var Ia=C.reader;const Pf=Ia.Na();var kc=Ia.cb(4,!1);var Cc=String.fromCharCode(kc[0]);Cc+=String.fromCharCode(kc[1]);Cc+=String.fromCharCode(kc[2]);Cc+=String.fromCharCode(kc[3]);if(Cc==="nclx"){kc=Ia.Ca();Cc=Ia.Ca();const Qf=Ia.Ca(),wy=Ia.Y()>>7,re=wa.split(".");re.length==10&&(re[6]=Uh(kc),re[7]=Uh(Cc),re[8]=Uh(Qf),re[9]=String(wy),
wa=re.join("."))}Ia.seek(Pf)}return wa});const {Od:S,colorGamut:V}=Th(C.reader);t=S;u=V}).$("schm",C=>{z=ug(C.reader.U())}).box("schi",vg).$("tenc",C=>{B=Sh(C.reader).defaultKID}).$("pssh",C=>{var S=G(C.reader.h,-12,C.size),V=Gb(S);if(!D.has(V)&&(D.add(V),V=C.reader.cb(16,!1),V=Gb(V),M||=pb(!0),V=M[V.toLowerCase()])){var wa=Lb(V,"cenc",[{initDataType:"cenc",initData:S}]);mb(V)&&(wa.licenseServerUri=Tl(S));if(C.version>0){S=C.reader.U();for(let Ia=0;Ia<S;Ia++){const kc=C.reader.cb(16,!1);wa.keyIds.add(Gb(kc))}}y.set(V,
wa)}}).parse(I,!0,!0);if(!d.length&&!e.length&&!f.length)return null;x=L.values().next().value;I=g&&!h;if(h&&!c&&b&&!F.size){c=new oc("video/mp4");a&&c.init(a);try{jc(c,b);for(var ba of c.g.getStreams())F.set(ba,ba)}catch(C){}c.g.clear()}a=d.concat(e).concat(f);z==="cbcs"&&B&&!y.has("com.apple.fps")&&y.set("com.apple.fps",Lb("com.apple.fps",z,null));for(var ta of y.values())z&&(ta.encryptionScheme=z),B&&ta.keyIds.add(B);ta="video";b="video/mp4";k?(ta="text",b="application/mp4"):I&&(ta="audio",b="audio/mp4");
if(ta==="video"&&x!=null&&X.length){ba=0;for(const C of X)ba+=C.Jd??J;ba>0&&(v=x*X.length/ba)}return{type:ta,mimeType:b,codecs:Wl(a).join(", "),language:m,height:n,width:p,channelCount:q,sampleRate:r,closedCaptions:F,Od:t,colorGamut:u,frameRate:v,timescale:x,drmInfos:Array.from(y.values())}}function Wl(a){var b=new Set;const c=[];for(var d of a)a=Yd(d),b.has(a)||(c.push(d),b.add(a));b=Qb("audio",c);a=Qb("video",c);d=Qb(K,c);a=Xl(a);b=b.concat(a).concat(d);return c.length&&!b.length?c:b}
function Xl(a){if(a.length<=1)return a;const b=a.find(c=>c.startsWith("dvav.")||c.startsWith("dva1.")||c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")||c.startsWith("dvc1.")||c.startsWith("dvi1."));return b?Hh(`video/mp4; codecs="${b}"`)?[b]:a.filter(c=>c!=b):a}function Yl(a){let b=null;(new Dg).Ga(["moov","trak","mdia","minf","stbl"],vg).$("stsd",xg).box("encv",yg).box("enca",zg).box("sinf",vg).box("schi",vg).$("tenc",c=>{b=Sh(c.reader).defaultKID}).parse(a,!0);return b}
async function Zl(a,b,c){b.cryptoKey||await b.fetchKey();if(b.blockCipherMode=="GCM"&&b.bitsKey==256){a=G(a);if(a.byteLength<32)throw new H(2,4,4060);return window.crypto.subtle.decrypt({name:"AES-GCM",iv:a.slice(0,16),tagLength:128},b.cryptoKey,a.slice(16))}let d=b.iv;if(!d){d=G(new ArrayBuffer(16));c=b.firstMediaSequenceNumber+c;for(let f=d.byteLength-1;f>=0;f--)d[f]=c&255,c>>=8}let e;b.blockCipherMode=="CBC"?e={name:"AES-CBC",iv:d}:e={name:"AES-CTR",counter:d,length:64};return window.crypto.subtle.decrypt(e,
b.cryptoKey,a)};async function $l(a,b,c){let d=am.get(bm(a))??"";if(d)return d;a=ag([a],c);try{a.method="HEAD",d=(await b.request(0,a).promise).headers["content-type"]}catch(e){!e||e.code!=1002&&e.code!=1001||(a.method="GET",d=(await b.request(0,a).promise).headers["content-type"])}return d?d.toLowerCase().split(";").shift():""}
function bm(a){let b=a.length;for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d===63||d===35){b=c;break}}for(c=b-1;c>=0;c--){d=a.charCodeAt(c);if(d===46){if(c+1<b)return a.slice(c+1,b).toLowerCase();break}if(d===47)break}return""}function cm(a,b,c,d,e){a=ag(a,d,e);if(b!=0||c!=null)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a}
var am=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("srt","text/srt").set("vtt",
"text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");function dm(a){return a&&a.type==K&&(a.stream.mimeType=="application/cea-608"||a.stream.mimeType=="application/cea-708")}function em(a,b,c,d,e,f=!1){const g=a instanceof Q?a:void 0,h=g?1:0;a=cm(a.R(),a.startByte,a.endByte,d,c);a.contentType=b.type;return e.request(gg,a,{type:h,stream:b,segment:g,isPreload:f})}
async function fm(a){a.u?.stop();a.u=null;a.L?.release();a.L=null;a.K?.stop();a.K=null;a.J?.release();a.J=null;const b=[];for(const c of a.h.values())gm(c),b.push(hm(c)),c.ia&&(Kl(c.ia),c.ia=null);for(const c of a.m.values())Kl(c);await Promise.all(b);a.h.clear();a.m.clear();a.g=null;a.j=null;a.i=null;a.G=null}function gm(a){a.fb!=null&&(a.fb.stop(),a.fb=null)}async function hm(a){a.Qa&&await a.Qa.abort()}
function im(a,b){if(a.j.type=="MSF"||b.type==="video"&&a.i.disableVideoPrefetch||b.type==="audio"&&a.i.disableAudioPrefetch||b.type===K&&(b.mimeType=="application/cea-608"||b.mimeType=="application/cea-708")||b.type===K&&a.i.disableTextPrefetch)return null;if(a.m.has(b))return a.m.get(b);var c=a.h.get(b.type);return(c=c&&c.ia)&&b===c.i?c:a.i.segmentPrefetchLimit>0?new Nl(a.i.segmentPrefetchLimit,b,(d,e,f)=>em(d,e,f||null,a.i.retryParameters,a.g.dc),a.g.qb()<0,a.g.mj,a.g.qb):null}
function jm(a){const b=a.i.segmentPrefetchLimit,c=a.i.prefetchAudioLanguages;for(const e of a.j.variants){if(!e.audio)continue;if(a.m.has(e.audio)){var d=a.m.get(e.audio);Ll(d,b);if(!(b>0&&c.some(f=>xe(e.audio.language,f)))){const f=a.h.get(e.audio.type);d!==(f&&f.ia)&&Kl(d);a.m.delete(e.audio)}continue}if(b<=0)continue;if(!c.some(f=>xe(e.audio.language,f)))continue;if(d=im(a,e.audio))e.audio.segmentIndex||e.audio.createSegmentIndex(),a.m.set(e.audio,d)}}
function km(a,b,c){a.j.presentationTimeline.ua()||(a.Z=b,a.X=c)}async function lm(a,b){if(!a.o)throw new H(2,5,5006);const c=mm(a,!0);await a.g.V.init(c,a.j.sequenceMode,a.j.type,a.j.ignoreManifestTimestampsInSegmentsMode);kg(a.l);a.updateDuration().catch(()=>{});for(const e of c.keys()){var d=c.get(e);if(!a.h.has(e)){const f=nm(a,d);if(d=b.get(d.id))Dl(d,(g,h,k)=>em(g,h,k||null,a.i.retryParameters,a.g.dc)),f.ia=d;a.h.set(e,f);om(a,f,0)}}pm(a)}
function nm(a,b){const c={stream:b,type:b.type,va:null,ia:im(a,b),Da:null,bb:null,Ae:null,bc:null,ac:null,ye:null,ze:null,yc:null,endOfStream:!1,Ia:!1,fb:null,Fb:!1,Pc:0,qd:!1,Jb:!1,Jc:!0,cf:!1,Zf:!1,Yc:!1,Qa:null,sc:null};b.dependencyStream&&(c.sc=nm(a,b.dependencyStream));return c}function om(a,b,c){const d=b.type;if(d!=K||a.h.has(d))b.fb=(new te(async()=>{try{await qm(a,b)}catch(e){if(a.g)a.g.onError(e)}})).ha(c)}
async function rm(a,b){a.T++;const c=a.T;try{await sk(a.g.V,K)}catch(e){if(a.g)a.g.onError(e)}const d=Rd(b.mimeType,b.codecs);Vj(a.g.V,d,b.external);a.g.V.W.isTextVisible()&&a.T==c&&(b=nm(a,b),a.h.set(K,b),om(a,b,0))}function sm(a){const b=a.h.get(K);b&&(gm(b),hm(b).catch(()=>{}),a.C=a.h.get(K),a.h.delete(K),b.stream&&b.stream.closeSegmentIndex&&b.stream.closeSegmentIndex());a.B=null}
function tm(a,b,c,d,e,f){const g=a.h.get(b.type);g||b.type!=K?g&&(g.yc&&(b.trickModeVideo?(g.yc=b,b=b.trickModeVideo):g.yc=null),g.stream!=b||e)&&(a.m.has(b)?g.ia=a.m.get(b):g.ia&&Ml(g.ia,b),b.type==K&&g.stream!=b&&(e=Rd(b.mimeType,b.codecs),Vj(a.g.V,e,b.external)),a.m.has(g.stream)||g.stream.closeSegmentIndex&&(g.Ia?a.O.getOrInsert("("+g.type+":"+g.stream.id+")",g.stream.closeSegmentIndex):g.stream.closeSegmentIndex()),e=g.stream.isAudioMuxedInVideo!=b.isAudioMuxedInVideo,g.stream=b,g.va=null,g.cf=
!!f,b.dependencyStream?g.sc=nm(a,b.dependencyStream):g.sc=null,pm(a),e&&(g.bb=null,g.bc=null,g.ac=null,b.isAudioMuxedInVideo&&(b=null,g.type==="video"?b=a.h.get("audio"):g.type==="audio"&&(b=a.h.get("video")),b&&(hm(b).catch(()=>{}),b.bb=null,b.bc=null,b.ac=null,um(a,b),vm(a,b).catch(h=>{if(a.g)a.g.onError(h)})))),c?g.Jb?g.qd=!0:g.Ia?(g.Fb=!0,g.Pc=d,g.qd=!0):(gm(g),wm(a,g,!0,d).catch(h=>{if(a.g)a.g.onError(h)})):g.Ia||g.fb||om(a,g,0),vm(a,g).catch(h=>{if(a.g)a.g.onError(h)})):rm(a,b)}
function xm(a,b){var c=a.g.qb()<0;for(var d of a.h.values())d.va&&d.va.nd(c),d.ia&&d.ia.nd(c);for(const e of a.m.values())e.nd(c);if(c=a.h.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.yc&&(tm(a,b,!1,0,!1),c.yc=d);else if(b=c.yc)c.yc=null,tm(a,b,!0,0,!1)}function ym(a,b,c=!1,d=0,e=!1,f=!1){a.o=b;a.I&&(b.video&&tm(a,b.video,c,d,e,f),b.audio&&tm(a,b.audio,c,d,e,f))}async function zm(a,b){a.C=null;a.B=b;a.I&&(b.segmentIndex||await b.createSegmentIndex(),tm(a,b,!0,0,!1))}
function Am(a){const b=a.h.get(K);b&&tm(a,b.stream,!0,0,!0)}function Bm(a,b){for(const [c,d]of a.O.entries()){const e=c,f=d;e.includes(b.type)&&(f(),a.O.delete(e))}}function pm(a){a.J.xa();Cm(a)&&a.J.Pb(a.g.video,["waiting","timeupdate"],()=>{Dm(a)})}function um(a,b){b.Jb||b.Fb||(b.Ia?(b.Fb=!0,b.Pc=0):ck(a.g.V,b.type)==null?b.fb==null&&om(a,b,0):(gm(b),wm(a,b,!1,0).catch(c=>{if(a.g)a.g.onError(c)})))}
async function vm(a,b){if(b.Qa){var c=b.stream,d=b.Qa;c.segmentIndex||await c.createSegmentIndex();var e=c.dependencyStream;e&&!e.segmentIndex&&await e.createSegmentIndex();if(d=b.Qa==d){if(c=b.stream==c){c=a.g.Lb();d=dk(a.g.V,b.type);e=b.stream.segmentIndex.find(b.Da?b.Da.endTime:c);var f=e==null?null:b.stream.segmentIndex.get(e);e=f?Ri(f):null;f&&!e&&(e=(f.endTime-f.getStartTime())*(b.stream.bandwidth||a.o.bandwidth)/8);e?((f=f.ea)&&(e+=(f.endByte?f.endByte+1-f.startByte:null)||0),f=a.g.getBandwidthEstimate(),
c=e*8/f<(d||0)-c-a.i.rebufferingGoal||b.Qa.h.g>e?!0:!1):c=!0}d=c}d&&b.Qa.abort()}}async function wm(a,b,c,d){b.Fb=!1;b.qd=!1;b.Pc=0;b.Jb=!0;b.Da=null;b.va=null;b.ia&&!a.m.has(b.stream)&&Kl(b.ia);if(d){c=a.g.Lb();const e=a.g.V.getDuration();await a.g.V.remove(b.type,c+d,e)}else await sk(a.g.V,b.type),kg(a.l),c&&await a.g.V.flush(b.type);kg(a.l);b.Jb=!1;b.endOfStream=!1;b.Ia||b.fb||om(a,b,0)}
function Cm(a){if(a.i.crossBoundaryStrategy!=="keep")return!0;const b=A(),c=a.g.wd();if(!b.l(c))for(var d of a.h.keys()){var e=a.h.get(d);if(e.type===Rb.vg)continue;if((e=e.stream)&&e.fullMimeTypes&&e.fullMimeTypes.size>1)return!0}else if(!b.N())for(const f of a.h.keys()){d=a.h.get(f);if(d.type===Rb.vg)continue;if((d=d.stream)&&d.fullMimeTypes&&d.fullMimeTypes.size>1){a=new Set;for(e of d.fullMimeTypes)a.add(Vd(e));return a.size>1}}return!1}
function Dm(a){if(Cm(a)){a.K.stop();var b=a.g.Lb(),c=a.h.get("video")||a.h.get("audio");c&&(c=c.bb)&&c.g!==null&&(b=c.g-b,b<0||b>1||(a.G=c.g+.1,a.K.ha(b)))}}
function mm(a,b=!1){const c=f=>{if(f.fullMimeTypes&&f.fullMimeTypes.size>1&&a.h.has(f.type)){var g=a.h.get(f.type);const h=dk(a.g.V,g.type),k=a.g.Lb();(g=Em(a,g,k,h))&&g.codecs&&g.mimeType&&(f.codecs=g.codecs,f.mimeType=g.mimeType)}},d=new Map;var e=a.o.audio;e&&(c(e),d.set("audio",e));if(e=a.o.video)c(e),d.set("video",e);b&&a.B&&d.set(K,a.B);return d}
async function Fm(a,b,c){if(c.code==3024)b.Ia=!1,gm(b),om(a,b,0);else{await a.W.attempt();kg(a.l);if(c.code==3015||c.code==3014||c.category===1&&c.code!=1003){if(b.yc){xm(a,!1);return}c.handled=a.g.disableStream(b.stream,Gm(a,c));c.handled&&(c.severity=1)}if(!c.handled&&c.code==1011){const d=a.g.Lb(),e=dk(a.g.V,b.type);let f=Em(a,b,d,e);for(;f?.Nb()===2;)b.Da=f,f=Em(a,b,d,e);if(f){await Dk(a.g.V,b.type,f.startTime);b.Ia=!1;b.Yc=!1;gm(b);om(a,b,0);return}}if(!c.handled||c.code!=1011)a.g.onError(c);
c.handled||a.i.failureCallback(c)}}
function Hm(a,b){if(dm(b))return pk(a.g.V,b.stream.originalId||""),null;b.type==K&&qk(a.g.V);if(b.stream.isAudioMuxedInVideo&&b.type=="audio")return null;if(b.type!=K&&Tj(a.g.V))return Im(a,!0),null;var c=a.i.updateIntervalSeconds/Math.max(1,Math.abs(a.g.qb()));if(!Zj(a.g.V)&&b.type!=K)return c/2;const d=a.g.Lb();if(b.type==="audio")for(var e of a.m.keys()){var f=a.m.get(e);f.Pa(d,!0);Jl(f,d)}e=b.Da?b.Da.endTime:d;var g=ek(a.g.V,b.type,d);f=Math.max(1,Math.max(a.i.rebufferingGoal,a.i.bufferingGoal)*
a.A);var h=a.j.presentationTimeline.ua()?Infinity:a.j.presentationTimeline.getDuration()-e,k=dk(a.g.V,b.type);if(h<1E-6&&k)return b.endOfStream=!0,b.type=="video"&&((c=a.h.get(K))&&dm(c)&&(c.endOfStream=!0),(c=a.h.get("audio"))&&c.stream.isAudioMuxedInVideo&&(c.endOfStream=!0)),null;b.endOfStream=!1;if(g>0&&a.i.stopFetchingOnPause&&a.g.video.paused||g>=f)return c/2;g=!b.va;k=Em(a,b,d,k);if(!k){if(!a.j.presentationTimeline.ua()&&h<1E-6)return b.endOfStream=!0,b.type=="video"&&(c=a.h.get(K))&&dm(c)&&
(c.endOfStream=!0),null;a=Infinity;(b=b.Da)&&(a=b.endTime-b.startTime);return Math.min(a/2,c)}h=b.bb;const l=k.ea;h&&l&&Pi(l,h)&&(h.g=l.g);h=!1;g&&b.cf&&(h=!0,b.cf=!1);g=Infinity;for(const m of a.h.values())dm(m)||m.stream.isAudioMuxedInVideo||m.va&&!m.va.current()||(g=Math.min(g,m.Da?m.Da.endTime:d));if(e>=g+a.j.presentationTimeline.i)return c;b.ia&&b.va&&!a.m.has(b.stream)&&(b.ia.Pa(k.startTime+.001),Jl(b.ia,k.startTime).catch(()=>{}));if(Cm(a)&&Jm(a,b,k))return null;Km(a,b,d,k,h).catch(()=>{});
b.sc&&Lm(a,b.sc,d,f);return null}
async function qm(a,b){kg(a.l);if(!b.Ia&&b.fb!=null&&!b.Jb)if(b.fb=null,b.Fb)await wm(a,b,b.qd,b.Pc);else{Bm(a,b);if(!b.stream.segmentIndex){var c=b.stream,d=b.stream.codecs;const e=b.stream.mimeType;try{await b.stream.createSegmentIndex()}catch(f){await Fm(a,b,f);return}b.type!==K||d==b.stream.codecs&&e==b.stream.mimeType||(d=Rd(b.stream.mimeType,b.stream.codecs),Vj(a.g.V,d,b.stream.external));if(c!=b.stream){c.closeSegmentIndex&&c.closeSegmentIndex();b.Ia||b.fb||om(a,b,0);return}}if(b.sc&&!b.sc.stream.segmentIndex)try{await b.sc.stream.createSegmentIndex()}catch(e){}try{const e=
Hm(a,b);e!=null&&(om(a,b,e),b.Yc=!1)}catch(e){await Fm(a,b,e);return}b.type!==K&&(c=[],b.stream&&!b.stream.isAudioMuxedInVideo&&c.push(b),(b=a.h.get(b.type==="audio"?"video":"audio"))&&b.stream&&!b.stream.isAudioMuxedInVideo&&c.push(b),a.I&&c.every(e=>e.endOfStream)&&(await a.g.V.endOfStream(),kg(a.l),b=a.g.V.getDuration(),b!=0&&b<a.j.presentationTimeline.getDuration()&&a.j.presentationTimeline.Eb(b)))}}
async function Im(a,b=!1){var c=Date.now()/1E3,d=a.i.minTimeBetweenRecoveries;if(!b&&(!a.i.allowMediaSourceRecoveries||c-a.P<d))return!1;a.P=c;if(b=a.h.get("audio"))gm(b),b.Qa&&(b.Qa.abort(),b.Qa=null),b.bb=null,b.bc=null,b.ac=null,b.Ia=!1,b.Fb=!1,b.Pc=0,b.qd=!1,b.Jb=!1,b.va&&b.va.dg();if(c=a.h.get("video"))gm(c),c.Qa&&(c.Qa.abort(),c.Qa=null),c.bb=null,c.bc=null,c.ac=null,c.Ia=!1,c.Fb=!1,c.Pc=0,c.qd=!1,c.Jb=!1,c.va&&c.va.dg();d=a.g.video.paused;await Ak(a.g.V,mm(a));!c||c.Jb||c.Ia||c.fb||om(a,c,
0);!b||b.Jb||b.Ia||b.fb||om(a,b,0);d||a.g.video.play();return!0}
function Em(a,b,c,d){if(b.va)return(c=b.va.current())&&b.Da&&(a=b.Da.endTime,qj(b.Da.startTime,c.startTime,.002)&&qj(a,c.endTime,.002)&&(c=b.va.next().value)),c;if(b.Da||d)return c=b.Da?b.Da.endTime:d,a=a.g.qb()<0,b.stream.segmentIndex&&(b.va=b.stream.segmentIndex.Kb(c,!1,a)),b.va&&b.va.next().value;d=a.j.sequenceMode||Cm(a)||a.j.type==="MSF"?0:a.i.inaccurateManifestTolerance;let e=Math.max(c-d,0);var f=a.g.V.getDuration();Math.abs(e-f)<1&&(d=1,e=Math.max(c-d,0));a=a.g.qb()<0;f=null;d&&(b.stream.segmentIndex&&
(b.va=b.stream.segmentIndex.Kb(e,!1,a)),f=b.va&&b.va.next().value);f||(b.stream.segmentIndex&&(b.va=b.stream.segmentIndex.Kb(c,!1,a)),f=b.va&&b.va.next().value);for(;f?.Nb()===2;)f=b.va?.next().value??null;return f}
function Jm(a,b,c){if(b.type===K)return!1;const d=b.bb;if(!d)return!1;const e=c.ea;c=d.g!==e.g;a.i.crossBoundaryStrategy==="reset_to_encrypted"&&(d.encrypted||e.encrypted||(c=!1),d.encrypted&&(a.i.crossBoundaryStrategy="keep"));a.i.crossBoundaryStrategy==="RESET_ON_ENCRYPTION_CHANGE"&&d.encrypted==e.encrypted&&(c=!1);if(a.i.crossBoundaryStrategy==="keep"&&d.mimeType&&e.mimeType){const f=Wd($d(d.mimeType)),g=Wd($d(e.mimeType));d.mimeType==e.mimeType&&f==g&&(c=!1)}(a.h.get("video")||a.h.get("audio"))===
b&&c&&(a.H||b.Jc)&&(a.H=!1,Im(a,!0).then(()=>{const f=(new Map).set("oldEncrypted",d.encrypted).set("newEncrypted",e.encrypted);a.g.onEvent(new P("boundarycrossed",f))}));return c}
async function Km(a,b,c,d,e){const f=b.stream;var g=b.va;b.Ia=!0;try{if(d.Nb()==2)throw new H(1,1,1011);await Mm(a,b,d,e);kg(a.l);if(!a.D){var h=f.mimeType=="video/mp4"||f.mimeType=="audio/mp4",k=window.ReadableStream;if(a.i.lowLatencyMode&&a.j.isLowLatency&&k&&h&&(a.j.type!="HLS"||d.o)){let m=new Uint8Array(0),n=!1,p=!1,q;const r=await Nm(a,b,d,async t=>{if(!n&&(p=!0,kg(a.l),!a.D))try{m=Hb(m,t);let u=!1,v=0;(new Dg).box("mdat",x=>{v=x.size+x.start;u=!0}).parse(m,!1,!0);if(u){const x=m.subarray(0,
v);m=m.subarray(v);await Om(a,b,c,f,d,x,!0,e);b.ia&&b.va&&Jl(b.ia,d.startTime,!0)}}catch(u){q=u}});if(q)throw q;if(!p){n=!0;kg(a.l);if(a.D)return;if(b.Fb){b.Ia=!1;om(a,b,0);return}await Om(a,b,c,f,d,r,!1,e)}b.ia&&b.va&&Jl(b.ia,d.startTime,!0)}else{const m=await Nm(a,b,d);kg(a.l);if(a.D)return;kg(a.l);if(b.Fb){b.Ia=!1;om(a,b,0);return}await Om(a,b,c,f,d,m,!1,e)}kg(a.l);if(!a.D){b.Da=d;g.next();b.Ia=!1;b.Zf=!1;var l=a.g.V.tc()[b.type];qa(JSON.stringify(l));b.Fb||(g=null,b.type==="video"?g=a.h.get("audio"):
b.type==="audio"&&(g=a.h.get("video")),g&&g.type=="audio"?a.g.fd(d,b.stream,g.stream.isAudioMuxedInVideo,!1):a.g.fd(d,b.stream,b.stream.codecs.includes(","),!1));gm(b);om(a,b,0)}}}catch(m){kg(a.l,m),a.D||(b.Ia=!1,m.code==7001?(b.Ia=!1,gm(b),om(a,b,0)):b.type==K&&a.i.ignoreTextStreamFailures?a.h.delete(K):m.code==3017?await Pm(a,b,m):(b.Yc=!0,m.category==1&&b.ia&&Il(b.ia,d),m.severity=2,await Fm(a,b,m)))}}
async function Lm(a,b,c,d){var e=b.stream,f=e.segmentIndex;for(c=(f=f&&f.Kb(c))&&f.next().value;c&&a.N.includes(c.startTime);)c=f&&f.next().value;if(c){if((f=c.ea)&&!Pi(f,b.bb)){b.bb=f;try{const k=await Nm(a,b,f);if(!a.g)return;var g=a.g.V;g.G&&Ub(g.G,k,0,e);a.N=[]}catch(k){throw b.bb=null,k;}}if(!b.Da||b.Da!=c){b.Da=c;try{const k=await Nm(a,b,c);if(!a.g)return;var h=a.g.V;h.G&&Ub(h.G,k,0,e);a.N.push(c.startTime)}catch(k){throw b.Da=null,k;}a.g&&(b.Fb||(e=null,b.type==="video"?e=a.h.get("audio"):
b.type==="audio"&&(e=a.h.get("video")),e&&e.type=="audio"?a.g.fd(c,b.stream,e.stream.isAudioMuxedInVideo,!0):a.g.fd(c,b.stream,b.stream.codecs.includes(","),!0)),e=Math.max(0,...a.N),a.g.Lb()+d>e&&await Lm(a,b,c.startTime,d))}}}
async function Mm(a,b,c,d){var e=b.Da==null;const f=[];var g=Math.max(0,Math.max(c.appendWindowStart,a.Z)-.1);let h=Math.min(c.appendWindowEnd,a.X)+.1;if(a.i.clampAppendWindowToDuration){var k=a.j.presentationTimeline.getDuration();k<Infinity&&(h=Math.min(h,k))}var l=c.codecs||b.stream.codecs;k=Yd(l);const m=Zd(c.mimeType||b.stream.mimeType),n=c.timestampOffset;if(n!=b.Ae||g!=b.bc||h!=b.ac||k!=b.ye||m!=b.ze)b.ye&&b.ze&&Kk(a.g.V,b.type,m,l,mm(a))&&(l=null,b.type==="video"?l=a.h.get("audio"):b.type===
"audio"&&(l=a.h.get("video")),l&&(await hm(l).catch(()=>{}),l.bb=null,l.bc=null,l.ac=null,um(a,l))),await Qm(a,b,n,g,h,c,k,m);if(!Pi(c.ea,b.bb)&&(b.bb=c.ea,c.l&&c.ea)){const p=Nm(a,b,c.ea);g=c.startTime;e&&(e=dk(a.g.V,b.type),e!=null&&(g=e));a.g.Ri(g,c.ea);f.push((async()=>{try{const q=await p;kg(a.l);let r=null;const t=new Map,u={projection:null,hfov:null};if(b.stream){const z=b.stream.videoLayout;if(z){const B=z.split("/");B.includes("PROJ-RECT")?u.projection="rect":B.includes("PROJ-EQUI")?u.projection=
"equi":B.includes("PROJ-HEQU")?u.projection="hequ":B.includes("PROJ-PRIM")?u.projection="prim":B.includes("PROJ-AIV")&&(u.projection="hequ")}}const v=new Dg;v.box("moov",vg).box("trak",vg).box("mdia",vg).$("mdhd",z=>{r=Mh(z.reader,z.version).timescale}).$("hdlr",z=>{z=z.reader;z.skip(4);z=z.cb(4,!1);switch(String.fromCharCode(z[0],z[1],z[2],z[3])){case "soun":t.set("audio",r);break;case "vide":t.set("video",r)}r=null});b.type!=="video"||u.projection||v.box("minf",vg).box("stbl",vg).$("stsd",xg).Ga("encv avc1 avc3 hev1 hvc1 dvav dva1 dvh1 dvhe dvc1 dvi1".split(" "),
yg).box("vexu",vg).box("proj",vg).$("prji",z=>{z=z.reader.jd();u.projection=z}).box("hfov",z=>{z=z.reader.U()/1E3;u.hfov=z});v.parse(q,!0,!0);b.type==="video"&&Rm(a,u);t.has(b.type)?c.ea.timescale=t.get(b.type):r!=null&&(c.ea.timescale=r);const x=b.stream.segmentIndex;let y;x instanceof pl&&(y=ol(x,c.startTime));const D=b.stream.closedCaptions&&b.stream.closedCaptions.size>0;await a.g.Ag(b.type,q);await ik(a.g.V,b.type,q,null,b.stream,D,b.Jc,d,!1,!1,y)}catch(q){throw b.bb=null,q;}})())}c.i!=(b.Da?
b.Da.i:-1)&&f.push(Dk(a.g.V,b.type,c.startTime));await Promise.all(f)}async function Nm(a,b,c,d){var e=c.Mb();if(e)return e;e=null;if(b.ia){{e=b.ia;let f=e.g;c instanceof Qi&&(f=e.j);f.has(c)?(e=f.get(c),d&&(e.lg=d),e=e.Fd):e=null}}e||=em(c,b.stream,d||null,a.i.retryParameters,a.g.dc);a=0;b.va&&(a=b.va.h);b.Qa=e;d=await e.promise;b.Qa=null;b=d.data;c.aesKey&&(b=await Zl(b,c.aesKey,a));return b}
async function Om(a,b,c,d,e,f,g=!1,h=!1){const k=d.closedCaptions&&d.closedCaptions.size>0;if(a.i.shouldFixTimestampOffset){const l=d.mimeType=="video/mp4"||d.mimeType=="audio/mp4";let m=null;e.ea&&(m=e.ea.timescale);l&&m&&d.type==="video"&&a.j.type=="DASH"&&(new Dg).box("moof",vg).box("traf",vg).$("tfdt",async n=>{if(n=Lh(n.reader,n.version).Fa)n=-n/m,(Number(b.Ae)||0)<n&&await Qm(a,b,n,b.bc,b.ac,e)}).parse(f,!1,g)}await Sm(a,b,c);kg(a.l);c=b.Jc;b.Jc=!1;await a.g.Ag(b.type,f);await ik(a.g.V,b.type,
f,e,d,k,c,h,g);kg(a.l)}async function Pm(a,b,c){var d=!1;for(const e of a.h.values())if(e!=b&&e.Zf){d=!0;break}if(!d){if(a.i.avoidEvictionOnQuotaExceededError){if(a.g.disableStream(b.stream,Gm(a,c)))return;om(a,b,4);return}d=Math.round(100*a.A);if(d>20)a.A-=.2;else if(d>4)a.A-=.04;else{a.g.disableStream(b.stream,Gm(a,c))?(a.A=1,c=a.g.Lb(),await Sm(a,b,c)):(b.Yc=!0,a.D=!0,a.g.onError(c));return}b.Zf=!0;c=a.g.Lb();await Sm(a,b,c)}om(a,b,4)}
function Gm(a,b){return a.i.maxDisabledTime===0&&b.code==1011?1:b.code==3014||b.code==3015?Infinity:a.i.maxDisabledTime}
async function Sm(a,b,c){a.C==b&&(a.C=null);var d=b.stream.segmentIndex;let e;d instanceof pl&&(d.Pa(a.j.presentationTimeline.sb()),e=[],nl(d,n=>{e.push(n.u())}));d=Math.max(a.i.bufferBehind*a.A,a.j.presentationTimeline.i);const f=ck(a.g.V,b.type);if(f!=null){var g=c-f,h=a.i.evictionGoal,k=a.j.presentationTimeline.Ab(),l=a.j.presentationTimeline.rb()-k,m=g-d;l>h&&(m=Math.max(g-d,k-h-f));m<=h||(await a.g.V.remove(b.type,f,f+m,e),kg(a.l),a.C&&(await Sm(a,a.C,c),kg(a.l)))}}
async function Qm(a,b,c,d,e,f,g,h){const k=mm(a);try{b.bc=d;b.ac=e;g&&(b.ye=g);h&&(b.ze=h);b.Ae=c;const l=a.j.sequenceMode||a.j.type=="HLS";g=null;b.type==="video"?g=a.h.get("audio"):b.type==="audio"&&(g=a.h.get("video"));g&&g.stream&&g.stream.isAudioMuxedInVideo&&await Ck(a.g.V,g.type,c,d,e,l,g.stream.mimeType,g.stream.codecs,k);await Ck(a.g.V,b.type,c,d,e,l,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,k)}catch(l){throw b.bc=null,b.ac=null,b.ye=null,b.ze=null,b.Ae=null,l;}}
function Rm(a,b){if(a.S.projection!=b.projection||a.S.hfov!=b.hfov){if(b.projection!=null||b.hfov!=null){var c=(new Map).set("detail",b);c=new P("spatialvideoinfo",c)}else c=new P("nospatialvideoinfo");c.cancelable=!0;a.g.onEvent(c);a.S=b}}
var Tm=class{constructor(a,b){this.g=b;this.j=a;this.i=null;this.O=new Map;this.A=1;this.B=this.o=null;this.T=0;this.h=new Map;this.I=!1;this.W=null;this.D=!1;this.l=new lg(()=>fm(this));this.P=Date.now()/1E3;this.m=new Map;this.S={projection:null,hfov:null};this.Z=0;this.X=Infinity;this.C=null;this.N=[];this.L=new Ca;this.u=new te(()=>{if(this.j&&this.g)if(this.j.presentationTimeline.ua()){var c=this.j.presentationTimeline.Ab(),d=this.j.presentationTimeline.rb();d-c>1?Fk(this.g.V,c,d):Gk(this.g.V)}else Gk(this.g.V),
this.u&&this.u.stop();else this.u&&this.u.stop()});this.G=null;this.H=!1;this.K=new te(()=>{const c=this.g.video;!c.ended&&this.G&&(this.H=!0,c.currentTime=this.G,this.G=null)});this.J=new Ca}destroy(){return this.l.destroy()}configure(a){this.i=a;this.W=new Jf({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);if(a.disableAudioPrefetch){var b=
this.h.get("audio");b&&b.ia&&(Kl(b.ia),b.ia=null);for(const c of this.m.keys())Kl(this.m.get(c)),this.m.delete(c)}a.disableTextPrefetch&&(b=this.h.get(K))&&b.ia&&(Kl(b.ia),b.ia=null);a.disableVideoPrefetch&&(b=this.h.get("video"))&&b.ia&&(Kl(b.ia),b.ia=null);for(const c of this.h.keys())b=this.h.get(c),b.ia?(Ll(b.ia,a.segmentPrefetchLimit),a.segmentPrefetchLimit>0||(Kl(b.ia),b.ia=null)):a.segmentPrefetchLimit>0&&(b.ia=im(this,b.stream));a.disableAudioPrefetch||jm(this)}async start(a){await lm(this,
a||new Map);kg(this.l);this.I=!0}ba(){return this.o}Jc(){if(this.g){var a=this.g.Lb(),b=c=>{var d=this.g.V;c==K?(c=d.h,c=c.g==null||c.h==null?!1:a>=c.g&&a<c.h):(c=ak(d,c),c=Yi(c,a));return c};for(const c of this.h.keys()){const d=this.h.get(c);if(!this.H&&!b(c)){this.P=0;d.ia&&(d.ia.h=null);if(d.type==="audio")for(const e of this.m.values())e.h=null;d.va=null;(dk(this.g.V,c)!=null||d.Ia)&&um(this,d);d.Qa&&(d.Qa.abort(),d.Qa=null);c===K&&tk(this.g.V);d.Jc=!0}!this.H||d.Jb||d.Ia||d.fb||om(this,d,0)}Cm(this)&&
Dm(this)}}async updateDuration(){const a=Jh(),b=this.j.presentationTimeline.getDuration();this.L.xa();b<Infinity?(a&&(this.u&&this.u.stop(),Gk(this.g.V)),await this.g.V.Eb(b)):a?(await this.g.V.Eb(Infinity),this.u&&(this.u.La(),this.L.na(this.g.video,"timeupdate",()=>{this.u.La().Aa(.5)}))):this.g.V.Eb(4294967296)}};function Um(a,b,c,d,e){const f=e in d,g=new Set(["__proto__","constructor","prototype"]);let h;h=f?c.constructor==Object&&Object.keys(d).length==0:c.constructor==Object&&Object.keys(c).length==0;const k=f||h;let l=!0;for(const n of Object.keys(b)){var m=e+"."+n;const p=f?d[e]:c[n];g.has(n)?(la("Invalid config, dangerous key "+m),l=!1):k||n in c?b[n]===void 0?p===void 0||k?delete a[n]:a[n]=zc(p):h?a[n]=b[n]:p.constructor==Object&&b[n]&&b[n].constructor==Object?(a[n]||(a[n]=zc(p)),m=Um(a[n],b[n],p,
d,m),l=l&&m):typeof b[n]!=typeof p||b[n]==null||typeof b[n]!="function"&&b[n].constructor!=p.constructor?(la("Invalid config, wrong type for "+m),l=!1):typeof c[n]=="function"&&c[n].length!=b[n].length?(ma("Unexpected number of arguments for "+m),a[n]=b[n]):a[n]=Array.isArray(a[n])?b[n].slice():b[n]:(la("Invalid config, unrecognized key "+m),l=!1)}return l}
function Vm(a,b){const c={};let d=c;for(var e=0,f=0;;){e=a.indexOf(".",e);if(e<0)break;if(e==0||a[e-1]!="\\")f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}function Wm(a,b){return a&&b}
function Xm(a,b){const c=f=>f&&typeof f==="object"&&!Array.isArray(f),d=(f,g)=>Object.keys(f).reduce((h,k)=>{var l=f[k];if(g.hasOwnProperty(k))if(l instanceof HTMLElement&&g[k]instanceof HTMLElement)l.isEqualNode(g[k])||(h[k]=l);else if(c(l)&&c(g[k])){if(l=d(l,g[k]),Object.keys(l).length>0||!c(l))h[k]=l}else Array.isArray(l)&&Array.isArray(g[k])?za(l,g[k])||(h[k]=l):Number.isNaN(l)&&Number.isNaN(g[k])||l!==g[k]&&(h[k]=l);else h[k]=l;return h},{});a=d(a,b);const e=f=>{for(const g of Object.keys(f))f[g]instanceof
HTMLElement||(c(f[g])&&Object.keys(f[g]).length===0?delete f[g]:typeof f[g]=="function"?delete f[g]:c(f[g])&&(e(f[g]),Object.keys(f[g]).length===0&&delete f[g]))};e(a);return a}var Ym=class{};w("shaka.util.ConfigUtils",Ym);Ym.getDifferenceFromConfigObjects=Xm;Ym.convertToConfigObject=Vm;Ym.mergeConfigObjects=Um;w("shaka.config.MsfFilterType",{NONE:0,NEXT_GROUP_START:1,LARGEST_OBJECT:2,ABSOLUTE_START:3,ABSOLUTE_RANGE:4});w("shaka.config.MsfVersion",{AUTO:"auto",DRAFT_14:"draft-14",DRAFT_16:"draft-16"});w("shaka.config.PositionArea",{DEFAULT:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,CENTER_LEFT:4,CENTER:5,CENTER_RIGHT:6,BOTTOM_LEFT:7,BOTTOM_CENTER:8,BOTTOM_RIGHT:9});w("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function Zm(a){a=xb(a);return(new Ma(a)).wb}function $m(a,b,c){if(!c||!c.byteLength)throw new H(2,6,6015);let d;typeof b=="string"?d=zb(b,!0):d=b;a=xb(a);a=zb(a,!0);const e=new Uint8Array(12+a.byteLength+d.byteLength+c.byteLength);let f=0;b=g=>{eb(e).setUint32(f,g.byteLength,!0);f+=4;e.set(G(g),f);f+=g.byteLength};b(a);b(d);b(c);return e}function an(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=xb(a).split("skd://").pop();return $m(a,c,b)}
function bn(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&nb(a.keySystem)&&(b.headers["Content-Type"]="application/octet-stream")}var cn=class{};w("shaka.drm.FairPlay",cn);
cn.commonFairPlayResponse=function(a,b){if(a===2&&(a=b.originalRequest.drmInfo)&&nb(a.keySystem)){try{var c=ub(b.data)}catch(d){return}a=!1;c=c.trim();c.substr(0,5)==="<ckc>"&&c.substr(-6)==="</ckc>"&&(c=c.slice(5,-6),a=!0);if(!a)try{const d=JSON.parse(c);d.ckc&&(c=d.ckc,a=!0);d.CkcMessage&&(c=d.CkcMessage,a=!0);d.License&&(c=d.License,a=!0)}catch(d){}a&&(b.data=cb(Eb(c)))}};
cn.gumletFairPlayRequest=function(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&nb(a.keySystem)&&b.body&&(a=G(b.body),a=Db(a),b.body=yb(JSON.stringify({Sk:a})),b.headers["Content-Type"]="application/json")};cn.muxFairPlayRequest=function(a,b){bn(a,b)};cn.expressplayFairPlayRequest=function(a,b){bn(a,b)};cn.conaxFairPlayRequest=function(a,b){bn(a,b)};cn.ezdrmFairPlayRequest=function(a,b){bn(a,b)};
cn.verimatrixFairPlayRequest=function(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&nb(a.keySystem)&&(a=G(b.body),a=Db(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=yb("spc="+a))};cn.muxInitDataTransform=function(a,b,c){return an(a,b,c)};cn.expressplayInitDataTransform=function(a,b,c){return an(a,b,c)};
cn.conaxInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=xb(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(c.length*2);d=db(d);for(let e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return $m(a,d,b)};cn.ezdrmInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=xb(a).split(";").pop();return $m(a,c,b)};cn.verimatrixInitDataTransform=function(a,b,c){return an(a,b,c)};cn.initDataTransform=$m;
cn.defaultGetContentId=Zm;cn.isFairPlaySupported=async function(){const a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]};try{return await navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),!0}catch(b){return!1}};function dn(a,b){if(a.mimeType!=b.mimeType)return!1;a=a.codecs.split(",").map(c=>Yd(c));b=b.codecs.split(",").map(c=>Yd(c));return va(a,b)}
function en(a,b,c=!0){a=a.h;var d;if(!(d=!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language)&&(d=a.audio&&b.audio)){d=a.audio;var e=b.audio;d=!(!((!d.channelsCount||!e.channelsCount||d.channelsCount>2||e.channelsCount>2)&&d.channelsCount!=e.channelsCount||d.spatialAudio!==e.spatialAudio||c&&!dn(d,e))&&va(d.roles,e.roles)&&d.groupId===e.groupId)}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||dn(a,b))&&va(a.roles,b.roles)));return d?!1:!0}
var fn=class{constructor(a,b,c=!0){this.h=a;this.g=new Set([a]);b=b||[];for(const d of b)this.add(d,c)}add(a,b){return en(this,a,b)?(this.g.add(a),!0):!1}values(){return this.g.values()}};w("shaka.media.AdaptationSet",fn);function gn(a,b,c,d){for(const h of b){b=a;if(h.language&&(b=hn(b,h.language),!b.length))continue;if(h.role&&(b=jn(b,h.role),!b.length))continue;if(h.label&&(b=kn(b,h.label),!b.length))continue;if(h.channelCount&&(b=ln(b,h.channelCount),!b.length))continue;const k=[];h.codec&&k.push(h.codec);c&&k.push(c);d&&k.push(d);var e=k.filter((l,m)=>k.indexOf(l)===m);if(e.length){let l=!1;for(const m of e)if(e=mn(b,m),e.length){b=e;l=!0;break}if(!l&&h.codec)continue}if(h.spatialAudio!==void 0&&(b=nn(b,h.spatialAudio),
!b.length))continue;if(b.length)return b}const f=[];c&&f.push(c);d&&f.push(d);c=f.filter((h,k)=>f.indexOf(h)===k);if(c.length)for(var g of c)if(c=mn(a,g),c.length){a=c;break}g=a.filter(h=>h.primary);return g.length?g:a}function hn(a,b){b=ye(b);const c=Fe(b,a.map(d=>Ee(d)));return c?a.filter(d=>c==Ee(d)):[]}function jn(a,b){return a.filter(c=>c.audio?b?c.audio.roles.includes(b):c.audio.roles.length==0:!1)}
function on(a,b){return a.filter(c=>c.video?b?c.video.roles.includes(b):c.video.roles.length==0:!1)}function kn(a,b){return a.filter(c=>c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1)}function pn(a,b){return a.filter(c=>c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1)}
function ln(a,b){return a.filter(c=>c.audio&&c.audio.channelsCount&&c.audio.channelsCount>b?!1:!0).sort((c,d)=>c.audio||d.audio?c.audio?d.audio?(d.audio.channelsCount||0)-(c.audio.channelsCount||0):1:-1:0)}function qn(a,b){if(b=="AUTO"){const c=a.some(d=>d.video&&d.video.hdr&&d.video.hdr=="HLG"?!0:!1);b=A().A(c)}return a.filter(c=>c.video&&c.video.hdr&&c.video.hdr!=b?!1:!0)}function rn(a,b){return a.filter(c=>c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0)}
function nn(a,b){return a.filter(c=>c.audio&&c.audio.spatialAudio!=b?!1:!0)}function mn(a,b){return a.filter(c=>c.audio&&c.audio.codecs!=b?!1:!0)}function sn(a,b){return a.filter(c=>c.video&&c.video.codecs!=b?!1:!0)}
var tn=class{constructor(){this.h=this.g=null}configure(a){this.g=a}getConfiguration(){return this.g}create(a){a=gn(a,this.g.preferredAudio,this.g.audioCodec,this.g.activeAudioCodec);a:{var b=this.g.preferredVideo;for(var c of b){b=a;if(c.role&&(b=on(b,c.role),!b.length))continue;if(c.label&&(b=pn(b,c.label),!b.length))continue;if(c.hdrLevel&&(b=qn(b,c.hdrLevel),!b.length))continue;if(c.layout&&(b=rn(b,c.layout),!b.length))continue;if(c.codec&&(b=sn(b,c.codec),!b.length))continue;if(b.length){a=b;
break a}}}c=A();b=this.g.keySystem;c=this.g.codecSwitchingStrategy=="smooth"&&c.l(b);return this.h=new fn(a[0],a,!c)}getLastAdaptationSet(){return this.h}};function un(){let a=Infinity;const b=A();navigator.connection&&navigator.connection.saveData&&(a=360);const c={retryParameters:If(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:(h,k,l)=>{"apple"===window.shakaMediaKeysPolyfill&&k=="skd"&&(k=l.serverCertificate,l=Zm(h),h=$m(h,l,k));return h},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:!1,
minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE",renewalIntervalSec:0,failureCallback:h=>Wm([h])};let d="reload";b.l("")&&(d="smooth");const e={retryParameters:If(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,disableChapters:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,
continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,updatePeriod:-1,ignoreDrmInfo:!1,enableAudioGroups:!0,dash:{clockSyncUri:"",xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:pb(!1,!0),manifestPreprocessorTXml:vn,sequenceMode:!1,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,
defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:b.D(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1,chaptersUri:""},msf:{fingerprintUri:"",namespaces:[],authorizationToken:"",subscribeFilterType:2,
useFetchCatalog:!1,version:"auto"}},f={trackSelectionCallback:async h=>h,downloadSizeCallback:async h=>{if(navigator.storage&&navigator.storage.estimate){const k=await navigator.storage.estimate();return k.usage+h<k.quota*.95}return!0},progressCallback:(h,k)=>Wm([h,k]),usePersistentLicense:!0,numberOfParallelDownloads:5},g={drm:c,manifest:e,streaming:{retryParameters:If(),failureCallback:h=>Wm([h]),rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,
gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!0,preferNativeDash:!1,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,
maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",
returnToEndOfLiveWindowWhenOutside:!1,stopFetchingOnPause:!1,clampAppendWindowToDuration:!1},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3,commonAccessTokenHeaderName:"cta-common-access-token"},mediaSource:{codecSwitchingStrategy:d,addExtraFeaturesToSourceBuffer:h=>Wm([h],""),forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:(h,k,l)=>Wm([h,k,l]),dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0},offline:f,abrFactory:()=>
new Af,adaptationSetCriteriaFactory:(...h)=>new tn(...h),abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5,droppedFramesThreshold:.15,
droppedFramesInterval:2,droppedFramesBanDuration:30},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,droppedFrames:!0},preferredAudio:[{language:"",role:"",label:"",channelCount:2,codec:""}],preferredText:[],preferredVideo:[{label:"",role:"",codec:"",hdrLevel:"AUTO",layout:""}],preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,
maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{captionsUpdatePeriod:.25,fontScaleFactor:1,positionArea:0,subtitleDelay:0},textDisplayFactory:()=>null,cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],version:1,targets:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},
lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0,disableTrackingEvents:!1,disableSnapback:!1,interstitialPreloadAheadTime:10},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:Infinity,preloadPrevItem:!0,repeatMode:0},accessibility:{handleForcedSubtitlesAutomatically:!0,
speechToText:{enabled:!1,maxTextLength:140,processLocally:!1,languagesToTranslate:[]}}};f.trackSelectionCallback=async h=>{const k=g.preferredAudio.map(l=>l.language).filter(Boolean);return wn(h,k,g.preferredVideo[0]&&g.preferredVideo[0].hdrLevel||"")};return b.j(g)}function vn(a){return Wm([a],a)}
function wn(a,b,c){let d=c;d=="AUTO"&&(c=a.some(l=>l.hdr&&l.hdr=="HLG"?!0:!1),d=A().A(c));const e=a.filter(l=>l.type!="variant"||l.hdr&&l.hdr!=d?!1:!0);c=[];const f=e.map(l=>l.language);let g=null;for(var h of b)if(g=Fe(h,f))break;g&&(c=e.filter(l=>ye(l.language)==g));c.length==0&&(c=e.filter(l=>l.primary));c.length==0&&(e.map(l=>l.language),c=e);const k=c.filter(l=>l.height&&l.height<=480);k.length&&(k.sort((l,m)=>m.height-l.height),c=k.filter(l=>l.height==k[0].height));b=[];c.length&&(h=Math.floor(c.length/
2),c.sort((l,m)=>l.bandwidth-m.bandwidth),b.push(c[h]));for(const l of a)l.type!=K&&l.type!="image"&&l.type!="chapter"||b.push(l);return b}function xn(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}
function yn(a,b,c){const d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return Um(a,b,c||un(),d,"")}
function zn(a){const b=a.preferredAudio[0],c=a.preferredVideo[0];a.language=b?.language??"";a.role=b?.role??"";a.channelCount=b?.channelCount??2;a.spatialAudio=b?.spatialAudio??!1;a.audioLabel=b?.label??"";a.videoRole=c?.role??"";a.hdrLevel=c?.hdrLevel??"";a.videoLayout=c?.layout??"";a.videoLabel=c?.label??"";a.preferredAudioCodecs=a.preferredAudio.map(d=>d.codec).filter(Boolean);a.preferredAudioChannelCount=b?.channelCount??2}var An=class{};w("shaka.util.PlayerConfiguration",An);
An.mergeConfigObjects=yn;An.createDefaultForLL=xn;An.createDefault=un;function Bn(a,b){let c=0;a.g&&a.g.state==b&&(c+=a.g.duration);for(const d of a.h)c+=d.state==b?d.duration:0;return c}function Cn(a){const b=d=>({timestamp:d.timestamp,state:d.state,duration:d.duration}),c=[];for(const d of a.h)c.push(b(d));a.g&&c.push(b(a.g));return c}var Dn=class{constructor(){this.g=null;this.h=[]}};function En(a,b,c){a.i!=b&&(a.i=b,a.g.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))}var Fn=class{constructor(){this.i=this.h=null;this.g=[]}};function Gn(a,b,c){a.O=b;a.N=c}function Hn(a,b,c){a.T=b;a.B=c}function In(a,b){b>=0&&(a.I=b)}function Jn(a,b){a.h=isNaN(a.h)?b:Math.max(a.h,b)}function Kn(a,b){b>=0&&(a.o=b)}function Ln(a,b){b>=0&&(a.D=b)}function Mn(a,b){b>=0&&(a.J=b)}function Nn(a,b){a.i=isNaN(a.i)?b:a.i+b}
function On(a){var b=a.T,c=a.B,d=a.l,e=a.A,f=a.N,g=a.O,h=a.L,k=a.S,l=a.P,m=a.u,n=a.h,p=a.C,q=a.I,r=a.m,t=Bn(a.g,"playing"),u=Bn(a.g,"paused"),v=Bn(a.g,"buffering"),x=a.o,y=a.D,D=a.J,z=a.Ug,B=a.i,E=a.K,J=a.H,X=a.G,L=Cn(a.g);a=a.j;const W=[];for(const F of a.g)W.push({timestamp:F.timestamp,id:F.id,type:F.type,fromAdaptation:F.fromAdaptation,bandwidth:F.bandwidth});return{width:b,height:c,currentCodecs:d,streamBandwidth:e,decodedFrames:f,droppedFrames:g,corruptedFrames:h,stallsDetected:k,gapsJumped:l,
estimatedBandwidth:m,completionPercent:n,loadLatency:p,manifestTimeSeconds:q,drmTimeSeconds:r,playTime:t,pauseTime:u,bufferingTime:v,licenseTime:x,liveLatency:y,maxSegmentDuration:D,manifestSizeBytes:z,bytesDownloaded:B,nonFatalErrorCount:E,manifestPeriodCount:J,manifestGapCount:X,stateHistory:L,switchHistory:W}}
var Pn=class{constructor(){this.B=this.T=NaN;this.l="";this.i=this.Ug=this.u=this.A=this.J=this.D=this.o=this.m=this.I=this.C=this.h=this.P=this.S=this.L=this.N=this.O=NaN;this.K=0;this.G=this.H=NaN;this.g=new Dn;this.j=new Fn}};function Qn(a){const b=c=>c.video&&c.audio||c.video&&c.video.codecs.includes(",");a.variants.some(b)&&(a.variants=a.variants.filter(b))}function Rn(a,b,c){(a=b?a.K:a.L)?a.push(c):c()}function Sn(a){if(a.K)for(const b of a.K)b();a.K=null}function Tn(a,b){a.O=b;a.P=!0;if(a.L)for(const c of a.L)c();a.L=null}function Un(a){a.ma=!0;return a.J}function Vn(a){a.X=!0;return a.j}function Wn(a){a.qa=!0;return a.D}
async function Xn(a){Yn(a,"manifest-parser");a.o||(a.I=bc(a.N,a.S),a.o=a.I(),a.o.configure(a.i.manifest,()=>a.G));const b=Date.now()/1E3;Yn(a,"manifest");a.g||(a.g=await a.o.start(a.N,a.Ka),Qn(a.g),await Zn(a));a.Z.resolve();var c=new P("manifestparsed",void 0);await Promise.resolve();a.dispatchEvent(c);if(a.g.variants.length==0)throw new H(2,4,4036);Qn(a.g);Bh(a.H,a.g)&&(c=new P("trackschanged",void 0),await Promise.resolve(),$n(a),a.dispatchEvent(c));In(a.T,Date.now()/1E3-b)}
function $n(a){if(a.l)throw new H(2,7,7003);}
async function ao(a,b){if(a.g&&!a.j){Yn(a,"drm-engine");a.sa=Date.now()/1E3;a.j=a.ya();a.H.g=a.j;a.j.configure(a.i.drm,()=>a.G);var c=lf(a.g.variants),d=!0;a.g&&a.g.presentationTimeline&&(d=a.g.presentationTimeline.ua());await Ug(a.j,c,a.g.offlineSessionIds,d);$n(a);b&&(await a.j.Hb(b),$n(a));a.m&&(b=a.m.getConfiguration(),b.keySystem=jb(a.j?a.j.g:null),a.m.configure(b));await Eh(a.H,a.g)&&(b=new P("trackschanged",void 0),await Promise.resolve(),a.dispatchEvent(b))}}
async function bo(a){a.h&&!a.g.variants.includes(a.h)&&(await co(a.h),a.h=eo(a),a.h&&await fo(a.h))}async function go(a){if(!a.h){var b=eo(a);b&&(a.h=b)}if(a.h){b=a.g.presentationTimeline.isLive();const d=[];var c=a.h;c.video&&d.push(ho(a,c.video,b));c.audio&&d.push(ho(a,c.audio,b));if(c=io(a,c))d.push(ho(a,c,b)),a.u=c;await Promise.all(d)}}function Yn(a,b){a.dispatchEvent(new P("onstatechange",(new Map).set("state",b)))}
async function Zn(a){if(!a.m){a.m=a.i.adaptationSetCriteriaFactory();const b={preferredAudio:a.i.preferredAudio,preferredVideo:a.i.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:a.i.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:jb(a.j?a.j.g:null)};zn(b);a.m.configure(b)}if(a.h||
!a.g.variants.length?0:a.g.variants.length==1||a.g.type=="HLS")a.h=eo(a),a.h&&await fo(a.h)}
async function jo(a){if(a.h){var b=a.g.presentationTimeline.isLive(),c=[],d=k=>{k&&(a.D.has(k.id)&&(Kl(a.D.get(k.id)),a.D.delete(k.id)),k.segmentIndex&&k.closeSegmentIndex&&c.push(k.closeSegmentIndex()))},e=()=>{const k=a.h;for(const l of[k.video,k.audio])d(l);a.u=null},f=()=>{d(a.u);a.u=null},g=a.m.getConfiguration(),h={preferredAudio:a.i.preferredAudio,preferredVideo:a.i.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",
preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:a.i.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:jb(a.j?a.j.g:null)};zn(h);Bc(g)!=Bc(h)&&(a.m.configure(h),e(),a.h=eo(a));a.h?(e=io(a,a.h))?e!=a.u&&(f(),a.u=e):f():f();await Promise.all(c);f=[];if(a.h){e=a.h;for(const k of[e.video,e.audio])f.push(ho(a,k,b));a.u&&f.push(ho(a,a.u,b))}await Promise.all(f)}}
function eo(a){if(!a.B){var b=a.i.abrFactory;a.B=b();a.B.configure(a.i.abr)}b=a.g.isLowLatency&&a.i.streaming.lowLatencyMode;var c=lf(a.g.variants);c=a.m.create(c);a.B.setVariants(Array.from(c.values()),b);return a.B.chooseVariant(!0)}async function fo(a){const b=[];for(const c of[a.video,a.audio])c&&!c.segmentIndex&&b.push(c.createSegmentIndex());b.length>0&&await Promise.all(b)}
async function co(a){const b=[];for(const c of[a.video,a.audio])c&&c.segmentIndex&&c.closeSegmentIndex&&b.push(c.closeSegmentIndex());b.length>0&&await Promise.all(b)}
async function ho(a,b,c){const d=new Nl(a.i.streaming.segmentPrefetchLimit||2,b,(g,h,k)=>em(g,h,k||null,a.i.streaming.retryParameters,a.wa,a.G),!1);a.D.set(b.id,d);b.segmentIndex||await b.createSegmentIndex();const e=b.segmentIndex.Kb(typeof a.A==="number"?a.A:0);let f=null;e&&(f=e.current(),f||(f=e.next().value));f||=b.segmentIndex.xb();f&&(c?f.ea&&await El(d,f.ea):await Jl(d,f.startTime))}
function io(a,b){let c=null;var d=a.i.preferredText;for(const e of d){if(!e.language)continue;d=mf(a.g.textStreams,e.language,e.role,e.forced);if(d.length){c=d[0];break}}!c&&b?.audio&&a.i.accessibility.handleForcedSubtitlesAutomatically&&(a=mf(a.g.textStreams,b.audio.language,"",!0),a.length&&(c=a[0]));return c}
var ko=class extends Vf{constructor(a,b,c,d){super();this.N=a;this.S=b;this.wa=d.networkingEngine;this.A=c;this.m=null;this.sa=0;this.ya=d.Qc;this.H=d.Hi;this.Ka=d.Ii;this.i=d.config;this.o=this.I=this.g=null;this.ba=!1;this.J=d.Vi;this.ma=!1;this.j=null;this.X=!1;this.B=null;this.D=new Map;this.qa=!1;this.Ba=d.Ui;this.T=new Pn;this.Z=Promise.withResolvers();this.C=Promise.withResolvers();this.O=null;this.l=!1;this.W=d.yh;this.u=this.h=null;this.P=!1;this.L=[];this.K=[];this.G=!0}getStartTime(){return this.A}oe(){return this.S}Cc(){return this.N}Hf(){return this.g}getStats(){return this.T}ii(){return this.h?
bf(this.h):null}gi(){return this.u?cf(this.u):null}start(){(async()=>{await Promise.resolve();try{await Xn(this),$n(this),"webkit"!==window.shakaMediaKeysPolyfill&&(await ao(this),$n(this)),await bo(this),$n(this),this.W&&(await go(this),$n(this)),this.W&&this.j&&(await th(this.j),$n(this)),this.C.resolve()}catch(a){a instanceof H&&(a.code==7001||a.code==7003)||this.C.reject(a)}})()}dispatchEvent(a){return this.O?this.O.dispatchEvent(a):super.dispatchEvent(a)}onError(a){a.severity===2&&(this.C.reject(a),
this.destroy());var b=(new Map).set("detail",a);b=new P("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)}configure(a,b){a=Vm(a,b);yn(this.i,a);jo(this)}getConfiguration(){return zc(this.i)}uj(){return this.C.promise}async destroy(){this.l=!0;this.o&&!this.ba&&await this.o.stop();this.B&&this.B.release();this.J&&!this.ma&&this.J.release();this.j&&!this.X&&await this.j.destroy();if(this.D.size>0&&!this.qa)for(const a of this.D.values())Kl(a)}};w("shaka.media.PreloadManager",ko);
ko.prototype.destroy=ko.prototype.destroy;ko.prototype.waitForFinish=ko.prototype.uj;ko.prototype.getPrefetchedTextTrack=ko.prototype.gi;ko.prototype.getPrefetchedVariantTrack=ko.prototype.ii;function lo(a,b,c,d){b=new P(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}
var po=class extends Vf{constructor(a,b){super();this.i=a;this.l=b;this.g=new Map;this.m=[{Oc:null,Nc:mo,Fc:(c,d)=>lo(this,"enter",c,d)},{Oc:no,Nc:mo,Fc:(c,d)=>lo(this,"enter",c,d)},{Oc:oo,Nc:mo,Fc:(c,d)=>lo(this,"enter",c,d)},{Oc:mo,Nc:no,Fc:(c,d)=>lo(this,"exit",c,d)},{Oc:mo,Nc:oo,Fc:(c,d)=>lo(this,"exit",c,d)},{Oc:no,Nc:oo,Fc:(c,d)=>{d?lo(this,"skip",c,d):(lo(this,"enter",c,d),lo(this,"exit",c,d))}},{Oc:oo,Nc:no,Fc:(c,d)=>lo(this,"skip",c,d)}];this.h=new Ca;this.h.F(this.i,"regionremove",c=>{this.g.delete(c.region)})}release(){this.i=
null;this.g.clear();this.h.release();this.h=null;super.release()}j(a,b){if(!this.l||a!=0){this.l=!1;for(const c of this.i.i()){const d=this.g.get(c),e=a<c.startTime?no:a>c.endTime?oo:mo;this.g.set(c,e);for(const f of this.m)f.Oc==d&&f.Nc==e&&f.Fc(c,b)}}}},no=1,mo=2,oo=3;/*
 @license
 Copyright 2013 Ali Al Dallal

 Licensed under the MIT license.

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
*/
var qo={ach:"Lwo",ady:"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"T\u0255\u0265i",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-AR":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-MA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-SA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629)","ay-BO":"Aymar aru",az:"Az\u0259rbaycan dili","az-AZ":"Az\u0259rbaycan dili",
"be-BY":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",bg:"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","bg-BG":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438",bn:"\u09ac\u09be\u0982\u09b2\u09be","bn-IN":"\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)","bn-BD":"\u09ac\u09be\u0982\u09b2\u09be(\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)","bs-BA":"Bosanski",ca:"Catal\u00e0","ca-ES":"Catal\u00e0",cak:"Maya Kaqchikel","ck-US":"\u13e3\u13b3\u13a9 (tsalagi)",
cs:"\u010ce\u0161tina","cs-CZ":"\u010ce\u0161tina",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (\u00d6sterreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserb\u0161\u0107ina",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","el-GR":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)",
"en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Espa\u00f1ol","es-AR":"Espa\u00f1ol (Argentine)","es-419":"Espa\u00f1ol (Latinoam\u00e9rica)","es-CL":"Espa\u00f1ol (Chile)","es-CO":"Espa\u00f1ol (Colombia)","es-EC":"Espa\u00f1ol (Ecuador)","es-ES":"Espa\u00f1ol (Espa\u00f1a)","es-LA":"Espa\u00f1ol (Latinoam\u00e9rica)","es-NI":"Espa\u00f1ol (Nicaragua)","es-MX":"Espa\u00f1ol (M\u00e9xico)",
"es-US":"Espa\u00f1ol (Estados Unidos)","es-VE":"Espa\u00f1ol (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc","fa-IR":"\u0641\u0627\u0631\u0633\u06cc","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"F\u00f8royskt",fr:"Fran\u00e7ais","fr-CA":"Fran\u00e7ais (Canada)","fr-FR":"Fran\u00e7ais (France)","fr-BE":"Fran\u00e7ais (Belgique)","fr-CH":"Fran\u00e7ais (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",
gl:"Galego","gl-ES":"Galego","gn-PY":"Ava\u00f1e'\u1ebd","gu-IN":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","gx-GR":"\u1f19\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u1f00\u03c1\u03c7\u03b1\u03af\u03b1",he:"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f","he-IL":"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f",hi:"\u0939\u093f\u0928\u094d\u0926\u0940","hi-IN":"\u0939\u093f\u0928\u094d\u0926\u0940",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserb\u0161\u0107ina",ht:"Krey\u00f2l",hu:"Magyar","hu-HU":"Magyar","hy-AM":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"\u00cdslenska","is-IS":"\u00cdslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"\u65e5\u672c\u8a9e","ja-JP":"\u65e5\u672c\u8a9e","jv-ID":"Basa Jawa","ka-GE":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","kk-KZ":"\u049a\u0430\u0437\u0430\u049b\u0448\u0430",km:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","km-KH":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a",kab:"Taqbaylit",kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","kn-IN":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1 (India)",
ko:"\ud55c\uad6d\uc5b4","ko-KR":"\ud55c\uad6d\uc5b4 (\u97e9\u56fd)",ku:"Kurd\u00ee","ku-TR":"Kurd\u00ee",la:"Latin","la-VA":"Latin",lb:"L\u00ebtzebuergesch","li-NL":"L\u00e8mb\u00f6rgs",lt:"Lietuvi\u0173","lt-LT":"Lietuvi\u0173",lv:"Latvie\u0161u","lv-LV":"Latvie\u0161u",mai:"\u092e\u0948\u0925\u093f\u0932\u0940, \u09ae\u09c8\u09a5\u09bf\u09b2\u09c0","mg-MG":"Malagasy",mk:"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438","mk-MK":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438)",
ml:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","ml-IN":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mn-MN":"\u041c\u043e\u043d\u0433\u043e\u043b",mr:"\u092e\u0930\u093e\u0920\u0940","mr-IN":"\u092e\u0930\u093e\u0920\u0940",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"\u1017\u1019\u102c\u1005\u1000\u102c",nb:"Norsk (bokm\u00e5l)","nb-NO":"Norsk (bokm\u00e5l)",ne:"\u0928\u0947\u092a\u093e\u0932\u0940","ne-NP":"\u0928\u0947\u092a\u093e\u0932\u0940",nl:"Nederlands","nl-BE":"Nederlands (Belgi\u00eb)",
"nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"\u0b13\u0b21\u0b3c\u0b3f\u0b06",pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","pa-IN":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40 (\u0a2d\u0a3e\u0a30\u0a24 \u0a28\u0a42\u0a70)",pl:"Polski","pl-PL":"Polski","ps-AF":"\u067e\u069a\u062a\u0648",pt:"Portugu\u00eas","pt-BR":"Portugu\u00eas (Brasil)","pt-PT":"Portugu\u00eas (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Rom\u00e2n\u0103","ro-RO":"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",
"ru-RU":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439","sa-IN":"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d","se-NO":"Davvis\u00e1megiella","si-LK":"\u0db4\u0dc5\u0dcf\u0dad",sk:"Sloven\u010dina","sk-SK":"Sloven\u010dina (Slovakia)",sl:"Sloven\u0161\u010dina","sl-SI":"Sloven\u0161\u010dina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438","sr-RS":"\u0421\u0440\u043f\u0441\u043a\u0438 (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili",
"sw-KE":"Kiswahili",ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","ta-IN":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",te:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","te-IN":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",tg:"\u0437\u0430\u0431\u043e\u0301\u043d\u0438 \u0442\u043e\u04b7\u0438\u043a\u04e3\u0301","tg-TJ":"\u0442\u043e\u04b7\u0438\u043a\u04e3",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22","th-TH":"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22 (\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22)",tl:"Filipino","tl-PH":"Filipino",
tlh:"tlhIngan-Hol",tr:"T\u00fcrk\u00e7e","tr-TR":"T\u00fcrk\u00e7e","tt-RU":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","uk-UA":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u0631\u062f\u0648","ur-PK":"\u0627\u0631\u062f\u0648",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Ti\u1ebfng Vi\u1ec7t","vi-VN":"Ti\u1ebfng Vi\u1ec7t","xh-ZA":"isiXhosa",yi:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9","yi-DE":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",
zh:"\u4e2d\u6587","zh-HANS":"\u4e2d\u6587\u7b80\u4f53","zh-HANT":"\u4e2d\u6587\u7e41\u9ad4","zh-CN":"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09","zh-HK":"\u4e2d\u6587\uff08\u9999\u6e2f\uff09","zh-SG":"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09","zh-TW":"\u4e2d\u6587\uff08\u53f0\u7063\uff09","zu-ZA":"isiZulu"};for(let a of Object.keys(qo))qo[a.toLowerCase()]=qo[a];function ro(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(g=>ro(g,a)).join("");if(!a.payload)return a.payload;const c=[];var d=a.fontWeight>=ud,e=a.fontStyle==vd;const f=a.textDecoration.includes(wd);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;e==""&&b&&(e=b.color);d="";(e=so(e))&&(d+=`.${e}`);e=a.backgroundColor;e==""&&b&&(e=b.backgroundColor);(b=so(e))&&(d+=`.bg_${b}`);d&&c.push(["c",d]);return c.reduceRight((g,[h,k=""])=>`<${h}${k}>${g}</${h}>`,
a.payload)}
function so(a){a=a.toLowerCase();const b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&a.length>7&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";case "yellow":case "#ff0":case "#ffff00":return"yellow";
case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null}function to(a,b){const c=[];for(const d of uo(a))d.isContainer?c.push(...to(d.nestedCues,d)):(a=d.clone(),a.nestedCues=[],a.payload=ro(d,b),c.push(a));return c}function uo(a){const b=[];for(const c of a)b.some(d=>kd(c,d))||b.push(c);return b}
function vo(a){if(a.startTime>=a.endTime)return null;const b=new VTTCue(a.startTime,a.endTime,a.payload),c=d=>{let e=5381,f=d.length;for(;f;)e=e*33^d.charCodeAt(--f);return(e>>>0).toString()};b.id=c(a.startTime.toString())+c(a.endTime.toString())+c(a.payload);b.lineAlign=a.lineAlign;b.positionAlign=a.positionAlign;a.size&&(b.size=a.size);try{b.align=a.textAlign}catch(d){}a.textAlign=="center"&&b.align!="center"&&(b.align="middle");a.writingMode=="vertical-lr"?b.vertical="lr":a.writingMode=="vertical-rl"&&
(b.vertical="rl");a.lineInterpretation==1&&(b.snapToLines=!1);a.line!=null&&(b.line=a.line);a.position!=null&&(b.position=a.position);return b}
function wo(a,b){var c=to(b);const d=[];b=a.cues?Array.from(a.cues):[];for(const e of c)!b.some(f=>f.startTime==e.startTime&&f.endTime==e.endTime&&f.text==e.payload?!0:!1)&&e.payload&&(c=vo(e))&&d.push(c);b=d.slice().sort((e,f)=>e.startTime!=f.startTime?e.startTime-f.startTime:e.endTime!=f.endTime?e.endTime-f.startTime:"line"in VTTCue.prototype?d.indexOf(f)-d.indexOf(e):d.indexOf(e)-d.indexOf(f));for(const e of b)a.addCue(e)}
function xo(a,b){let c=!1;a.mode==="disabled"&&(c=!0,a.mode="hidden");let d=0;for(;d<a.cues.length;){const e=a.cues[d];b(e)?a.removeCue(e):d++}c&&(a.mode="disabled")}function yo(a){const b=new jd(0,0,""),c=d=>{d.line=b.line;d.lineAlign=b.lineAlign;d.position=b.position;d.positionAlign=b.positionAlign;d.size=b.size;d.displayAlign=b.displayAlign;d.region=b.region;for(const e of d.nestedCues)c(e)};c(a)};function zo(a){!a.j&&a.h&&a.h.Vc()===Ao&&(a.j=a.h.ob(),a.o.na(a.h,"unloading",()=>Bo(a)),a.m.F(a.h,"textchanged",()=>Co(a)),a.m.F(a.j.textTracks,"change",()=>Do(a)),Co(a))}function Eo(a){return a.g.has(a.i)?a.g.get(a.i).track:null}function Bo(a){a.l?.stop();a.l=null;a.m?.xa();for(const b of a.g.values())b.remove();a.g.clear();a.i=-1;a.j=null}
function Fo(a,b){a=Array.from(a.h.ob().textTracks).filter(c=>["captions","subtitles","forced"].includes(c.kind));if(b)!a.some(c=>c.mode==="showing")&&(b=a.find(c=>c.mode==="hidden"))&&(b.mode="showing");else for(const c of a)c.mode==="showing"&&(c.mode="hidden")}
function Co(a){var b=new Map,c=a.h.ub();for(const f of c){if(a.g.has(f.id)){c=a;var d=c.g.get(f.id);f.active||d.track.mode==="disabled"||(d.track.mode="disabled");c.g.delete(f.id);c=d}else{c=a;d=c.j.ownerDocument.createElement("track");var e=A();e=f.forced&&e.h()==="WEBKIT"?"forced":f.kind==="caption"?"captions":"subtitles";d.kind=e;d.label=Go(f);d.srclang=f.language?f.language in qo?f.language:De(f.language)??"und":"und";d.src="data:,WEBVTT";d.track.mode="disabled";c.j.appendChild(d);c=d}b.set(f.id,
c);f.active&&(a.i=f.id)}for(const f of a.g.values())f.remove();a.g=b;a.i<=-1||(a.g.has(a.i)?(b=a.g.get(a.i).track,b.mode==="disabled"&&(b.mode=a.u?"showing":"hidden")):a.i=-1)}function Ho(a,b){if(b>-1){const c=a.h.ub().find(d=>d.id===b);if(c){a.h.lc(c);return}}a.h.lc(null)}
function Do(a){if(!a.l){var b=a.j;a.l=(new te(()=>{a.l=null;if(a.j===b){a:{var c=-1;if(a.g.has(a.i)){var d=a.g.get(a.i).track.mode;if(d==="showing"){c=a.i;break a}d==="hidden"&&(c=a.i)}for(var e of a.g.keys()){d=a.g.get(e);if(d.track.mode==="showing"){c=e;break a}c<0&&d.track.mode==="hidden"&&(c=e)}}e=a.g.get(c);for(const f of a.g.values())f!==e&&f.track.mode!=="disabled"&&(f.track.mode="disabled");a.i!==c&&(a.i=c,Ho(a,c))}})).ha(0)}}
function Go(a){if(a.label)return a.label;if(a.language){var b=De(a.language);if(window.Intl&&"DisplayNames"in Intl)try{var c=(new Intl.DisplayNames(a.language,{type:"language",languageDisplay:"standard"})).of(a.language);if(c&&c.toLowerCase()!=a.language.toLowerCase())return c.charAt(0).toUpperCase()+c.slice(1)}catch(d){}if(c=qo[a.language])return c;if(c=b&&qo[b])return b===a.language?c:`${c} (${a.language})`}b=String(a.originalTextId??"");return a.language&&a.language!==a.originalTextId?`${b} (${a.language})`:
b}
var Jo=class{constructor(a){this.h=a;this.o=new Ca;this.m=new Ca;this.j=this.A=null;this.g=new Map;this.i=-1;this.u=!1;this.l=null;this.o.F(a,"loaded",()=>zo(this));zo(this)}configure(a){this.A=a}remove(a,b){if(!this.h)return!1;const c=Eo(this);c&&xo(c,d=>d.startTime<b&&d.endTime>a);return!0}append(a){const b=Eo(this);if(b){var c=this.A?.subtitleDelay??0;a=c!==0?a.map(d=>{d=d.clone();d.startTime=Math.max(0,d.startTime+c);d.endTime=Math.max(0,d.endTime+c);return d}):a;wo(b,a)}}destroy(){this.h&&(this.j&&
Bo(this),this.h=null);this.l?.stop();this.l=null;this.o?.release();this.o=null;this.m?.release();this.m=null;return Promise.resolve()}isTextVisible(){return this.u}setTextVisibility(a){this.u=a;const b=Eo(this);b?b.mode!=="disabled"&&(a=a?"showing":"hidden",b.mode!==a&&(b.mode=a)):this.h&&this.h.Vc()===Io&&Fo(this,a)}setTextLanguage(){}};w("shaka.text.NativeTextDisplayer",Jo);Jo.prototype.setTextLanguage=Jo.prototype.setTextLanguage;Jo.prototype.setTextVisibility=Jo.prototype.setTextVisibility;
Jo.prototype.isTextVisible=Jo.prototype.isTextVisible;Jo.prototype.destroy=Jo.prototype.destroy;Jo.prototype.append=Jo.prototype.append;Jo.prototype.remove=Jo.prototype.remove;Jo.prototype.configure=Jo.prototype.configure;var Ao=2,Io=3;async function Ko(a){a.h?.i();var b=a.l.getAudioTracks();if(b.length){var c=Lo(a);if(c){var d=b.find(f=>f.active);b="en";d&&d.language&&d.language!="und"&&(b=d.language);d=a.i.find(f=>f.id==a.m);var e="";d&&d.language&&d.language!="und"&&(e=d.language);if(a.B.isActive()&&a.G===b&&a.D!==e)a.D=e,await Mo(a.A,b,e);else{No(a);try{await Mo(a.A,b,e)}catch(f){if(f.name=="NotSupportedError")return}await a.B.start(c,b,a.o.processLocally);a.G=b;a.D=e}}}}
function Oo(a){return{id:a.I++,active:!1,type:K,bandwidth:0,language:"",label:null,kind:null,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:!1,originalTextId:null,originalLanguage:"speech-to-text"}}
function Po(a){var b=a.i.map(c=>c.language).filter(c=>c);if(!va(a.o.languagesToTranslate,b)&&"Translator"in window){a.i=a.i.filter(c=>{if(c.id==a.C.id||a.o.languagesToTranslate.includes(c.language))return!0;c.id==a.m&&a.disable();return!1});for(const c of a.o.languagesToTranslate)b=a.i.find(d=>d.language==c),b||(b=Oo(a),b.language=c,a.i.push(b));b=new P("textchanged");a.l.dispatchEvent(b)}}function No(a,b=!0){a.B.stop(b)}
function Qo(a){a=a.l.jc;if(!a)return null;const b=document.createElement("div");b.classList.add("shaka-speech-to-text-container");b.style.textAlign="center";b.style.display="flex";b.style.flexDirection="column";b.style.alignItems="center";b.style.justifyContent="flex-end";a.appendChild(b);return b}
function Lo(a){const b=a.l.ob();return b?Ro.getOrInsertComputed(b,()=>{const c=new (window.AudioContext||window.webkitAudioContext),d=c.createMediaElementSource(b),e=c.createMediaStreamDestination();d.connect(e);d.connect(c.destination);const f=e.stream.getAudioTracks()[0];return{Mk:c,Rk:d,Ok:e,Bh:f}}).Bh:null}
var Wo=class{constructor(a){this.l=a;this.o=null;this.j=new Ca;this.H=So.value();this.g=null;this.u=!1;this.A=new To;this.J=new te(()=>{Ko(this)});this.I=1E15;this.C=Oo(this);this.i=[this.C];this.D=this.G=this.h=this.m=null;this.B=new Uo(this.A,this.J,b=>{if(this.u&&this.g){var c=this.o.maxTextLength;if(!(b.length<=c)){for(c=b.length-c;c>0&&b[c-1]!==" ";)c--;b="..."+b.slice(c).trimStart()}this.h?.j(b)}},()=>{this.h?.i()})}configure(a){this.o=a;Po(this)}release(){this.m=null;this.j.xa();No(this);this.l=
null;this.j.release();this.h?.release();this.g&&this.g.parentElement&&(this.g.remove(),this.g=null)}enable(a){this.H&&(this.g||(this.g=Qo(this)),this.g&&(this.h||(this.h=new Vo(this.g)),this.u&&a.id==this.m||(this.u=!0,this.m=a.id,this.j.F(this.l,"audiotrackschanged",()=>{Ko(this)}),a=this.l.ob(),this.j.F(a,"seeking",()=>{Ko(this)}),this.j.F(a,"pause",()=>{No(this,!1)}),this.j.F(a,"play",()=>{Ko(this)}),a.paused||Ko(this))))}disable(){this.u&&(this.u=!1,this.m=null,this.j.xa(),No(this),this.h?.release(),
this.h=null,this.A.release(),this.B.release())}isSupported(){if(!this.H)return!1;this.g||(this.g=Qo(this));return this.g?!0:!1}ub(){if(!this.isSupported())return[];for(const a of this.i)a.active=a.id==this.m;return this.i}},Ro=new Map,So=new Ga(()=>{var a=document.body.appendChild(document.createElement("iframe"));var b=a.contentWindow;b=b.SpeechRecognition||b.webkitSpeechRecognition;if(!b)return a.remove(),!1;b=new b;a.remove();try{return b.start(0),b.stop(),!1}catch(c){return c.name=="TypeError"}}),
Vo=class{constructor(a){this.h=a;this.g=null}j(a){this.h&&(this.g||(this.g=document.createElement("span"),this.g.setAttribute("translate","no"),this.g.style.backgroundColor="rgba(0,0,0,0.8)",this.g.style.padding="0px 5px",this.g.style.margin="2.5% 5%",this.h.appendChild(this.g)),this.g.textContent=a)}i(){this.g&&(this.g.textContent="")}release(){this.h&&dj(this.h);this.g=null}},Uo=class{constructor(a,b,c,d){this.m=a;this.i=b;this.u=c;this.o=d;this.h=new Ca;this.l=null;this.g=0;this.j=!1}async start(a,
b,c){this.stop();this.g++;const d=this.g;this.j=!0;const e=window.SpeechRecognition||window.webkitSpeechRecognition,f=new e;this.l=f;f.lang=b;f.continuous=!0;f.interimResults=!0;if(c&&"install"in e&&"available"in e)try{switch(await e.available({langs:[b],processLocally:!0})){case "available":f.processLocally=!0;break;case "downloading":case "downloadable":await e.install({langs:[b],processLocally:!0});f.processLocally=!0;break;default:return}}catch(h){}if(d===this.g){var g=!1;this.h.F(f,"start",()=>
{d===this.g&&this.i.ha(5)});this.h.F(f,"result",async h=>{if(d===this.g){var k="";for(let l=h.resultIndex;l<h.results.length;l++)k+=h.results[l][0].transcript;h=await Xo(this.m,k);h!==null&&d===this.g&&(this.u(h),this.i.ha(.75))}});this.h.F(f,"error",h=>{d===this.g&&(g=!0,this.o(),h.error=="network"&&this.i.ha(30))});this.h.F(f,"end",()=>{this.j&&d===this.g&&(g||this.start(a,b,c))});f.start(a)}}stop(a=!0){this.g++;this.j=!1;this.h.xa();this.i.stop();this.l&&(this.l.stop(),this.l=null);a&&this.o()}release(){this.stop();
this.m.release()}isActive(){return this.j}};async function Mo(a,b,c){if(a.i!==b||a.j!==c||!a.g){a.release();a.l++;var d=a.l;if(c&&b!=c&&"Translator"in window){a.h=new AbortController;try{const e=await Translator.create({sourceLanguage:b,targetLanguage:c,signal:a.h.signal});d!==a.l?e.destroy():(a.g=e,a.i=b,a.j=c)}catch(e){if(e.name=="NotSupportedError")throw e;}}}}
async function Xo(a,b){if(!a.g)return b;a.m++;const c=a.m;try{const d=await a.g.translate(b);return c!==a.m?null:d}catch(d){return null}}var To=class{constructor(){this.h=this.g=null;this.m=this.l=0;this.j=this.i=null}release(){this.h?.abort();this.h=null;this.g?.destroy();this.j=this.i=this.g=null}};var Yo=class{configure(){}remove(){}append(){}destroy(){}isTextVisible(){return!1}setTextVisibility(){}setTextLanguage(){}};w("shaka.text.StubTextDisplayer",Yo);Yo.prototype.setTextLanguage=Yo.prototype.setTextLanguage;Yo.prototype.setTextVisibility=Yo.prototype.setTextVisibility;Yo.prototype.isTextVisible=Yo.prototype.isTextVisible;Yo.prototype.destroy=Yo.prototype.destroy;Yo.prototype.append=Yo.prototype.append;Yo.prototype.remove=Yo.prototype.remove;Yo.prototype.configure=Yo.prototype.configure;function Zo(a,b){for(let c=a.length-1;c>=0;c--){const d=b(a[c]);if(d||d===0)return d}return null}function $o(a,b,c,d=1){var e=(e=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(e[1]),unit:e[2]}:null;if(!e)return a;a=e.unit;d*=e.value;switch(a){case "%":return d/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*d/b.cellResolution.rows+"px";default:return d+a}}
function ap(a,b=!1){if(a.g&&!a.C){var c=a.m.currentTime-(a.h?.subtitleDelay??0);if(!a.A||b){for(const d of a.G.values())dj(d);dj(a.g);a.l.clear();a.G.clear()}a.A&&(b=a.j,a.h&&a.h.positionArea!=0&&(b=b.map(d=>{d=d.clone();yo(d);d.region=bp.value();switch(a.h.positionArea){case 1:d.textAlign="left";d.displayAlign="before";break;case 2:d.textAlign=sd;d.displayAlign="before";break;case 3:d.textAlign="right";d.displayAlign="before";break;case 4:d.textAlign="left";d.displayAlign="center";break;case 5:d.textAlign=
sd;d.displayAlign="center";break;case 6:d.textAlign="right";d.displayAlign="center";break;case 7:d.textAlign="left";d.displayAlign=Cd;break;case 8:d.textAlign=sd;d.displayAlign=Cd;break;case 9:d.textAlign="right",d.displayAlign=Cd}return d})),cp(a,b,a.g,c,[]))}}function dp(a){a.B&&(a.j.length&&!a.C?a.B.Aa((a.h?a.h.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(a.m.playbackRate))):a.B.stop())}
function ep(a){var b=a.m;let c=!1;window.documentPictureInPicture&&window.documentPictureInPicture.window?c=!0:document.pictureInPictureElement===b&&(c=!0);let d=!1;document.fullscreenEnabled&&document.fullscreenElement===a.o?d=!0:b.webkitSupportsFullscreen&&(d=b.webkitDisplayingFullscreen);b=document.visibilityState==="visible";c||d||b&&a.K?a.C&&(a.C=!1,dp(a),requestAnimationFrame(()=>{a.g&&a.g.parentElement&&a.A&&ap(a)})):a.C||(a.C=!0,a.B&&a.B.stop())}
function fp(a,b){for(;b!=null;){if(b==a.g)return!0;b=b.parentElement}return!1}
function gp(a,b,c){var d=c.length>1,e=d?"span":"div";b.lineBreak&&(e="br");b.rubyTag&&(e=b.rubyTag);d=!d&&b.nestedCues.length>0;const f=document.createElement(e);e!="br"&&hp(a,f,b,c,d);c=null;if(b.region&&b.region.id){{const n=b.region,p=a.D===4/3?2.5:1.9;e=`${n.id}_${n.width}x${n.height}${n.heightUnits==pc?"%":"px"}-${n.viewportAnchorX}x${n.viewportAnchorY}${n.viewportAnchorUnits==pc?"%":"px"}-${n.regionAnchorX}x${n.regionAnchorY}`;if(a.G.has(e))c=a.G.get(e);else{c=document.createElement("span");
var g=n.heightUnits==pc?"%":"px",h=n.widthUnits==pc?"%":"px",k=n.viewportAnchorUnits==pc?"%":"px";c.id="shaka-text-region---"+e;c.classList.add("shaka-text-region");c.style.position="absolute";var l=n.height,m=n.width;n.heightUnits===2&&(l=n.height*5.33,g="%");n.widthUnits===2&&(m=n.width*p,h="%");c.style.height=l+g;c.style.width=m+h;n.viewportAnchorUnits===2?(g=n.viewportAnchorY/75*100,h=n.viewportAnchorX/(a.D===4/3?160:210)*100,g-=n.regionAnchorY*l/100,h-=n.regionAnchorX*m/100,c.style.top=g+"%",
c.style.left=h+"%"):(c.style.top=n.viewportAnchorY-n.regionAnchorY*l/100+k,c.style.left=n.viewportAnchorX-n.regionAnchorX*m/100+k);n.heightUnits!==0&&n.widthUnits!==0&&n.viewportAnchorUnits!==0&&(l=Math.max(0,Math.min(100-(parseInt(c.style.width.slice(0,-1),10)||0),parseInt(c.style.left.slice(0,-1),10)||0)),c.style.top=Math.max(0,Math.min(100-(parseInt(c.style.height.slice(0,-1),10)||0),parseInt(c.style.top.slice(0,-1),10)||0))+"%",c.style.left=l+"%");c.style.display="flex";c.style.flexDirection=
"column";c.style.alignItems="center";c.style.justifyContent=b.displayAlign=="before"?"flex-start":b.displayAlign=="center"?"center":"flex-end";a.G.set(e,c)}}}e=f;d&&(e=document.createElement("span"),e.classList.add("shaka-text-wrapper"),e.style.backgroundColor=b.backgroundColor,e.style.lineHeight="normal",f.appendChild(e));a.l.set(b,{kf:f,wh:e,Ic:c})}
function cp(a,b,c,d,e){let f=!1;const g=[],h=[];for(const k of b){e.push(k);b=k;let l=a.l.get(k);if(!l&&a.h&&a.h.positionArea!=0)for(const p of a.l.keys())kd(k,p)&&(b=p,l=a.l.get(p));const m=k.startTime<=d&&k.endTime>d;let n=l?l.wh:null;l&&(g.push(l.kf),l.Ic&&g.push(l.Ic),m||(f=!0,a.l.delete(b),l=null));m&&(h.push(k),l?fp(a,n)||(f=!0):(gp(a,k,e),l=a.l.get(b),n=l.wh,f=!0));k.nestedCues.length>0&&n&&cp(a,k.nestedCues,n,d,e);e.pop()}if(f){for(const k of g)k.parentElement&&k.parentElement.removeChild(k);
h.sort((k,l)=>k.startTime!=l.startTime?k.startTime-l.startTime:k.endTime-l.endTime);for(const k of h){d=a.l.get(k);if(!d&&a.h.positionArea!=0)for(const l of a.l.keys())kd(k,l)&&(d=a.l.get(l));d.Ic?(d.Ic.contains(c)&&d.Ic.removeChild(c),c.appendChild(d.Ic),d.Ic.appendChild(d.kf)):c.appendChild(d.kf)}}}
function hp(a,b,c,d,e){const f=b.style;var g=c.nestedCues.length==0,h=d.length>1;f.whiteSpace="pre-wrap";const k=c.payload.replace(/\s+$/g,l=>"\u00a0".repeat(l.length));f.webkitTextStrokeColor=c.textStrokeColor;f.webkitTextStrokeWidth=c.textStrokeWidth;f.color=c.color;f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=$o(c.linePadding,c,a.o);f.paddingRight=$o(c.linePadding,c,a.o);f.textCombineUpright=c.textCombineUpright;f.textShadow=c.textShadow;if(c.backgroundImage)f.backgroundImage="url('"+
c.backgroundImage.replace(/['"()\\]/g,"")+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",c.backgroundColor&&(f.backgroundColor=c.backgroundColor),f.width="100%",f.height="100%";else{let l;c.nestedCues.length?l=b:(l=document.createElement("span"),b.appendChild(l));c.border&&(l.style.border=c.border);e||((b=Zo(d,m=>m.backgroundColor))?l.style.backgroundColor=b:k&&(l.style.backgroundColor="rgba(0, 0, 0, 0.8)"));k&&(l.setAttribute("translate","no"),l.textContent=
k)}if(h&&!d[d.length-1].isContainer)f.display="inline";else{f.display="flex";f.flexDirection="column";f.alignItems="center";if(c.textAlign=="left"||c.textAlign=="start")f.width="100%",f.alignItems="flex-start";else if(c.textAlign=="right"||c.textAlign=="end")f.width="100%",f.alignItems="flex-end";f.justifyContent=c.displayAlign=="before"?"flex-start":c.displayAlign=="center"?"center":"flex-end"}g||(f.margin="0");f.fontFamily=c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;
f.letterSpacing=c.letterSpacing;d=a.h?a.h.fontScaleFactor:1;if(d!==1||c.fontSize)f.fontSize=$o(c.fontSize||"1em",c,a.o,d);d=c.line;d!=null&&(g=c.lineInterpretation,g==Ad&&(g=1,h=16,a.D&&a.D<1&&(h=32),d=d<0?100+d/h*100:d/h*100),g==1&&(f.position="absolute",c.writingMode==zd?(f.width="100%",c.lineAlign==Bd?f.top=d+"%":c.lineAlign=="end"&&(f.bottom=100-d+"%")):c.writingMode=="vertical-lr"?(f.height="100%",c.lineAlign==Bd?f.left=d+"%":c.lineAlign=="end"&&(f.right=100-d+"%")):(f.height="100%",c.lineAlign==
Bd?f.right=d+"%":c.lineAlign=="end"&&(f.left=100-d+"%"))));f.lineHeight=c.lineHeight;a=ip(c);a=="line-left"?(f.cssFloat="left",c.position!==null&&(f.position="absolute",c.writingMode==zd?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%")):a=="line-right"?(f.cssFloat="right",c.position!==null&&(f.position="absolute",c.writingMode==zd?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):c.position!==null&&c.position!=50&&(f.position="absolute",c.writingMode==zd?(f.left=c.position+
"%",f.width="auto"):f.top=c.position+"%",c.size&&(f.transform="translateX(-50%)"));f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(c.writingMode==zd?f.width=c.size+"%":f.height=c.size+"%")}
function ip(a){const b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==xd?c:a==="left"||a==="start"&&b===yd||a==="end"&&b==="rtl"?"line-left":a==="right"||a==="start"&&b==="rtl"||a==="end"&&b===yd?"line-right":"center"}
var jp=class{constructor(a){this.A=!1;this.j=[];this.m=a.ob();this.o=a.jc;this.D=null;this.C=!1;this.K=!0;this.h=null;this.g=document.createElement("div");this.g.classList.add("shaka-text-container");this.g.style.textAlign="center";this.g.style.display="flex";this.g.style.flexDirection="column";this.g.style.alignItems="center";this.g.style.justifyContent="flex-end";this.B=new te(()=>{this.m.paused||ap(this)});dp(this);this.u=new te(()=>{ep(this)});this.l=new Map;this.i=new Ca;this.i.F(document,"fullscreenchange",
()=>{ap(this,!0)});this.i.F(this.m,"seeking",()=>{ap(this,!0)});this.i.F(this.m,"ratechange",()=>{dp(this)});this.i.F(this.m,"resize",()=>{var b=this.m;const c=b.videoWidth;b=b.videoHeight;c&&b?this.D=c/b:this.D=null});this.J=!1;this.H=null;"ResizeObserver"in window&&(this.H=new ResizeObserver(()=>{this.J||(this.J=!0,requestAnimationFrame(()=>{this.J=!1;this.g&&this.g.parentElement&&this.A&&ap(this,!0)}))}),this.H.observe(this.o));this.G=new Map;this.I=null;"IntersectionObserver"in window&&(this.I=
new IntersectionObserver(b=>{b.length&&(b=b[b.length-1],this.K=b.isIntersecting&&b.intersectionRatio>0,this.u.ha(this.h?.captionsUpdatePeriod||.25))},{root:null,threshold:[.01]}),this.I.observe(this.o));this.i.F(document,"visibilitychange",()=>{this.u.La()});this.i.F(document,"fullscreenchange",()=>{this.u.La()});this.i.Pb(this.m,["enterpictureinpicture","leavepictureinpicture"],()=>{this.u.La()});"documentPictureInPicture"in window&&this.i.F(window.documentPictureInPicture,"enter",b=>{this.u.La();
this.i.na(b.window,"pagehide",()=>{this.u.La()})});a=this.m;(a.webkitPresentationMode||a.webkitSupportsFullscreen)&&this.i.F(a,"webkitpresentationmodechanged",()=>{this.u.La()});ep(this)}configure(a){this.h=a;dp(this);ap(this,!0)}append(a){const b=[...this.j];for(const c of uo(a))b.some(d=>kd(d,c))||this.j.push(c);this.j.length&&dp(this);ap(this)}destroy(){if(!this.g)return Promise.resolve();this.g.parentElement&&this.o.removeChild(this.g);this.g=null;this.A=!1;this.j=[];this.B?.stop();this.B=null;
this.u?.stop();this.u=null;this.l.clear();this.i?.release();this.i=null;this.H?.disconnect();this.H=null;this.I?.disconnect();this.I=null;return Promise.resolve()}remove(a,b){if(!this.g)return!1;const c=this.j.length;this.j=this.j.filter(d=>d.startTime<a||d.endTime>=b);ap(this,c>this.j.length);this.j.length||dp(this);return!0}isTextVisible(){return this.A}setTextVisibility(a){(this.A=a)?(this.g.parentElement||this.o.appendChild(this.g),ap(this,!0)):this.g.parentElement&&this.o.removeChild(this.g)}setTextLanguage(a){a&&
a!="und"?this.g.setAttribute("lang",a):this.g.setAttribute("lang","")}};w("shaka.text.UITextDisplayer",jp);jp.prototype.setTextLanguage=jp.prototype.setTextLanguage;jp.prototype.setTextVisibility=jp.prototype.setTextVisibility;jp.prototype.isTextVisible=jp.prototype.isTextVisible;jp.prototype.remove=jp.prototype.remove;jp.prototype.destroy=jp.prototype.destroy;jp.prototype.append=jp.prototype.append;jp.prototype.configure=jp.prototype.configure;
var bp=new Ga(()=>{const a=new rc;a.id="shaka-custom-region";a.height=90;a.width=90;a.viewportAnchorX=5;a.viewportAnchorY=5;return a});function kp(a,b){const c=e=>{var f=e;for(var g of b)g.end&&g.start<e&&(f+=g.end-g.start);e=Math.floor(f/3600);g=Math.floor(f/60%60);const h=Math.floor(f%60);f=Math.floor(f*1E3%1E3);return(e<10?"0":"")+e+":"+(g<10?"0":"")+g+":"+(h<10?"0":"")+h+"."+(f<100?f<10?"00":"0":"")+f};a=to(a);let d="WEBVTT\n\n";for(const e of a)d+=c(e.startTime)+" --\x3e "+c(e.endTime)+(f=>{const g=[];switch(f.textAlign){case "left":g.push("align:left");break;case "right":g.push("align:right");break;case sd:g.push("align:middle");
break;case "start":g.push("align:start");break;case "end":g.push("align:end")}switch(f.writingMode){case "vertical-lr":g.push("vertical:lr");break;case "vertical-rl":g.push("vertical:rl")}return g.length?" "+g.join(" "):""})(e)+"\n",d+=e.payload+"\n\n";return d}w("shaka.text.WebVttGenerator",class{});function lp(a,b){if(!b||a.includes("offline:"))return a;a=new Ma(a);a.g.set("CMCD",b);return a.toString()}function mp(a){var b=Object.keys(a);const c={},d=["Object","Request","Session","Status"],e=[{},{},{},{}],f={br:0,d:0,ot:0,tb:0,url:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,ltc:1,ttfb:1,ttlb:1,ts:1,rc:1,cmsdd:1,cmsds:1,sn:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd:2,bs:3,rtp:3,bg:3};for(const g of b)e[f[g]!=null?f[g]:1][g]=a[g];for(a=0;a<e.length;a++)(b=np(e[a]))&&(c[`CMCD-${d[a]}`]=b);return c}
function np(a){const b=[],c=g=>!Number.isNaN(g)&&g!=null&&g!==""&&g!==!1;var d=g=>Math.round(g),e=g=>Math.round(g/100)*100;d={br:d,d,bl:e,dl:e,mtp:e,nor:g=>encodeURIComponent(g),rtp:e,tb:d,ttfb:d,ttlb:d};e=Object.keys(a||{}).sort();for(const g of e){e=a[g];if(!c(e))continue;if(g==="v"&&e===1)continue;if(g=="pr"&&e===1)continue;var f=d[g];f&&(e=f(e));f=typeof e;e=f==="string"&&g!=="ot"&&g!=="sf"&&g!=="st"?`${g}=${JSON.stringify(e)}`:f==="boolean"?g:f==="symbol"?`${g}=${e.description}`:`${g}=${e}`;
b.push(e)}return b.join(",")}
function op(a){a.i.F(a.h,"playing",()=>{a.D||(a.D=Date.now());pp(a,"ps",{sta:"p"})});a.i.F(a.h,"volumechange",()=>{pp(a,a.h.muted?"m":"um")});a.i.F(a.h,"play",()=>{a.B||(a.B=Date.now(),pp(a,"ps",{sta:"s"}))});a.i.F(a.h,"pause",()=>{pp(a,"ps",{sta:"a"})});a.i.F(a.j,"buffering",()=>{pp(a,"ps",{sta:"w"})});a.i.F(a.h,"seeking",()=>pp(a,"ps",{sta:"k"}));a.i.F(document,"fullscreenchange",()=>{pp(a,document.fullscreenElement?"pe":"pc")});const b=a.h;(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&
a.i.F(b,"webkitpresentationmodechanged",()=>{b.webkitPresentationMode?pp(a,b.webkitPresentationMode!=="inline"?"pe":"pc"):b.webkitSupportsFullscreen&&pp(a,b.webkitDisplayingFullscreen?"pe":"pc")});a.i.F(a.h,"enterpictureinpicture",()=>{pp(a,"pe")});a.i.F(a.h,"leavepictureinpicture",()=>{pp(a,"pc")});"documentPictureInPicture"in window&&a.i.F(window.documentPictureInPicture,"enter",c=>{pp(a,"pe");a.i.na(c.window,"pagehide",()=>{pp(a,"pc")})});a.i.F(document,"visibilitychange",()=>{document.hidden?
pp(a,"b",{bg:!0}):pp(a,"b")});a.i.F(a.j,"complete",()=>{pp(a,"ps",{sta:"e"})})}function qp(a){rp(a);var b=sp(a);for(const c of b)if(b=c.timeInterval,b===void 0&&(b=tp),b>=1){const d=new te(()=>pp(a,up));d.Aa(b);a.C.push(d)}}function rp(a){if(a.C)for(const b of a.C)b.stop();a.C=[]}function vp(a){a.m.clear();a.u=!1;a.I=!0;a.H=!1;a.A=!1;a.B=0;a.D=0;a.G=0;a.J={request:!1,response:!1,event:!1};rp(a);a.o={};a.h=null;a.i.xa()}
function pp(a,b,c={}){b=Object.assign({e:b,ts:Date.now()},c);b=wp(a,b,xp);c=a.g.targets;if(!(a.g.version<yp)&&c){var d=sp(a);c=Array.from(new Set([...zp,...Ap]));for(const h of d){d=Bp(h.includeKeys||[],c);d.includes(Cp)||d.push(Cp);d.includes("e")||d.push("e");var e=Dp(h);a.o[e]||(a.o[e]={request:1,response:1});b.sn=a.o[e].response++;e=Ep(b,d);d=h.events||[];var f=e.e,g=e.sta;if(!f||Fp.includes(f)&&(f!=="ps"||g&&Gp.includes(g))&&(!(d&&d.length>0)||d.includes(f)))a:{d=a;f=If();g=h.url;if(h.useHeaders){e=
mp(e);if(!Object.keys(e).length)break a;f=ag([g],f);Object.assign(f.headers,e)}else{e=np(e);if(!e)break a;e=lp(g,e);f=ag([e],f)}d.j.pb().request(9,f)}}}}function Hp(a,b){a.A=b;a.A?a.l==Ip?a.l=Jp:a.l==Kp&&(a.l=Lp):a.l==Jp?a.l=Ip:a.l==Lp&&(a.l=Kp)}function Mp(a,b){if(a.g&&a.g.enabled&&(pp(a,"ps",{sta:"d"}),a.h&&a.h.autoplay)){const c=a.h.play();c&&c.then(()=>{a.G=b}).catch(()=>{a.G=0})}}
function Np(a,b,c){if(a.g.enabled){c=wp(a,c,Op);var d=Dp({mode:Op,useHeaders:a.g.useHeaders,includeKeys:a.g.includeKeys||[]});a.o[d]||(a.o[d]={request:1,response:1});c.sn=a.o[d].request++;d=a.g.includeKeys||[];var e=a.g.version==yp?Array.from(new Set([...zp,...Pp])):Qp;d=Bp(d,e);c=Ep(c,d);Rp(a,c,b,a.g.useHeaders)}}
function Sp(a,b,c,d={}){if(a.g.enabled)if(c.method==="HEAD")Np(a,c,{});else switch(b){case 0:try{if(a.g.enabled){if(d.type){a:{switch(d.type){case 4:var e=a.A?Jp:Ip;break a;case 3:case 2:e=a.A?Lp:Kp;break a}e=void 0}a.l=e}Np(a,c,{ot:Tp,su:!a.u})}}catch(g){na("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",g)}break;case gg:try{if(a.g.enabled){var f=Up(a,d,c.uris[0]);f.ts=Date.now();a.m.has(c)&&a.m.delete(c);a.m.set(c,f.ts);Np(a,c,f)}}catch(g){na("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",
g)}break;case 2:case 5:case 6:Np(a,c,{ot:Vp});break;case 4:Np(a,c,{ot:Wp})}}function Xp(a){return(a=a.g.targets)?a.some(b=>b.events&&b.events.includes("rr")&&b.enabled):!1}
function Yp(a,b,c,d={}){if(Xp(a))switch(b){case gg:try{const g=Up(a,d,c.uri);c.originalRequest&&c.originalRequest.timeToFirstByte!=null&&(g.ttfb=c.originalRequest.timeToFirstByte);c.timeMs!=null&&(g.ttlb=c.timeMs);var e=c.originalUri||c.uri;if(e.includes("CMCD="))try{const h=new URL(e);h.searchParams.delete("CMCD");var f=h.toString()}catch(h){f=e}else f=e;g.url=f;g.rc=c.status||0;a.m.has(c.originalRequest)?(g.ts=a.m.get(c.originalRequest),a.m.delete(c.originalRequest)):g.ts||(g.ts=Date.now());c.headers&&
c.headers["CMSD-Static"]&&(g.cmsds=btoa(c.headers["CMSD-Static"]));c.headers&&c.headers["CMSD-Dynamic"]&&(g.cmsdd=btoa(c.headers["CMSD-Dynamic"]));pp(a,"rr",g)}catch(g){na("CMCD_SEGMENT_ERROR","Could not generate response segment CMCD data.",g)}}}
function Up(a,b,c){var d=b.segment,e=0;d&&(e=d.endTime-d.startTime);e={d:e*1E3,st:a.j.isLive()?Zp:$p};e.ot=aq(b);const f=e.ot===bq||e.ot===cq||e.ot===dq||e.ot===eq;if(b=b.stream){var g=a.j.qb();if(f&&(e.bl=fq(a,b.type),e.ot!==eq)){var h=gq(a,b.type);e.dl=g?h/Math.abs(g):h}b.bandwidth&&(e.br=b.bandwidth/1E3);if(b.segmentIndex&&d){if((g=b.segmentIndex.Kb(d.endTime,!0,g<0))&&(g=g.next().value)&&g!=d){if(c&&!za(d.R(),g.R())){var k=g.R()[0];h=new URL(k);var l=new URL(c);if(h.origin!==l.origin)c=k;else{c=
h.pathname.split("/").slice(1);k=l.pathname.split("/").slice(1,-1);l=Math.min(c.length,k.length);for(let m=0;m<l&&c[m]===k[m];m++)c.shift(),k.shift();for(;k.length;)k.shift(),c.unshift("..");c=c.join("/")+h.search+h.hash}e.nor=c}!g.startByte&&!g.endByte||d.startByte==g.startByte&&d.endByte==g.endByte||(c=g.startByte+"-",g.endByte&&(c+=g.endByte),e.nrr=c)}g=a.j.qb()||1;c=gq(a,b.type)||500;d=(b=b.bandwidth)?b*(d.endTime-d.startTime)/1E3/(c/g/1E3)*a.g.rtpSafetyFactor:NaN;isNaN(d)||(e.rtp=d)}}f&&e.ot!==
eq&&(e.tb=hq(a,e.ot)/1E3);return e}function iq(a){a.g.sessionId||(a.g.sessionId=window.crypto.randomUUID());return{v:a.g.version,sf:a.l,sid:a.g.sessionId,cid:a.g.contentId,mtp:a.j.getBandwidthEstimate()/1E3}}
function jq(a,b,c){try{if(!a.g.enabled)return b;const e=iq(a);a:{switch(c.toLowerCase()){case "audio/mp4":case "audio/webm":case "audio/ogg":case "audio/mpeg":case "audio/aac":case "audio/flac":case "audio/wav":var d=cq;break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":d=dq;break a;case "application/x-mpegurl":case "application/vnd.apple.mpegurl":case "audio/x-mpegurl":case "application/dash+xml":case "video/vnd.mpeg.dash.mpd":case "application/vnd.ms-sstr+xml":d=Tp;break a}d=
void 0}e.ot=d;e.su=!0;const f=np(e);return lp(b,f)}catch(e){return na("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),b}}function sp(a){return(a=a.g.targets)?a.filter(b=>b.enabled):[]}function wp(a,b,c){Object.assign(b,iq(a));b.pr=a.j.qb();var d=b.ot===bq||b.ot===dq;a.H&&d&&(b.bs=!0,b.su=!0,a.H=!1);b.su==null&&(b.su=a.I);a.j.isLive()&&(d=kq(a.j),b.ltc=d||void 0);document.hidden&&(b.bg=!0);d=a.D&&a.B?a.D-(a.G||a.B):void 0;d==void 0||a.J[c]||(b.msd=d,a.J[c]=!0);return b}
function Bp(a,b){if(!a||a.length===0)return b;for(const c of a)b.includes(c);return a=a.filter(c=>b.includes(c))}function Dp(a){const b=Object.keys(a).sort().reduce((c,d)=>{d!=="enabled"&&(c[d]=a[d]);return c},{});return JSON.stringify(b)}function Ep(a,b){return Object.keys(a).reduce((c,d)=>{b.includes(d)&&(c[d]=a[d]);return c},{})}
function Rp(a,b,c,d){if(d){b=mp(b);if(!Object.keys(b).length)return;Object.assign(c.headers,b)}else{const e=np(b);if(!e)return;c.uris=c.uris.map(f=>lp(f,e))}!Xp(a)&&a.m.has(c)&&a.m.delete(c)}function aq(a){if(a.type===0)return lq;if(a=a.stream){var b=a.type;if(b=="video")return a.codecs&&a.codecs.includes(",")?dq:bq;if(b=="audio")return cq;if(b=="text")return a.mimeType==="application/mp4"?eq:mq}}
function fq(a,b){b=a.j.tc()[b];if(!b.length)return NaN;const c=a.h?a.h.currentTime:0;return(a=b.find(d=>d.start<=c&&d.end>=c))?(a.end-c)*1E3:NaN}function gq(a,b){b=a.j.tc()[b];if(!b.length)return 0;const c=a.h?a.h.currentTime:0;return(a=b.find(d=>d.start<=c&&d.end>=c))?(a.end-c)*1E3:0}
function hq(a,b){a=a.j.Dc();if(!a.length)return NaN;let c=a[0];for(const d of a)d.type==="variant"&&d.bandwidth>c.bandwidth&&(c=d);switch(b){case bq:return c.videoBandwidth||NaN;case cq:return c.audioBandwidth||NaN;default:return c.bandwidth}}
var nq=class{constructor(a,b){this.g=b;this.j=a;this.m=new Map;this.l=void 0;this.u=!1;this.I=!0;this.A=this.H=!1;this.D=this.B=void 0;this.G=0;this.J={request:!1,event:!1};this.o={};this.i=new Ca;this.C=[];this.h=null}setMediaElement(a){this.h=a;op(this)}configure(a){this.g=a;qp(this)}},Tp="m",cq="a",bq="v",dq="av",lq="i",mq="c",eq="tt",Vp="k",Wp="o",yp=2,$p="v",Zp="l",Ip="d",Jp="ld",Kp="h",Lp="lh";w("shaka.util.CmcdManager.StreamingFormat",{DASH:Ip,Yj:Jp,HLS:Kp,Zj:Lp,qk:"s",OTHER:"o"});
var Qp="br bl bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v".split(" "),zp="br ab bl tbl bs cdn cid ltc mtp pr sf sid bg sta st ts tpb tb lb tab lab pt ec msd v sn".split(" "),Pp="ab bl tbl bs cdn cid d dl ltc mtp nor ot pr rtp sf sid bg sta st su ts tpb tb lb tab lab pt ec msd v".split(" "),Ap="e sta d dl nor ot rtp rc su ttfb ttfbb ttlb url cmsdd cmsds".split(" "),Fp="ps e t c b m um pe pc rr".split(" "),Gp="spawkrfeqd".split(""),tp=10,Cp="ts",up="t",Op="request",xp="event";function oq(a){return a?a.toLowerCase()==="false"?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}
var tq=class{constructor(a){this.h=a;this.g=null}configure(a){this.h=a}Lg(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(pq)?this.g.get(pq)*1E3:null}Jg(){return this.h.enabled&&this.g&&this.g.has(qq)?this.g.get(qq)*1E3:null}ki(){return this.h.enabled&&this.g&&this.g.has(rq)?this.g.get(rq):null}li(){return this.h.enabled&&this.g&&this.g.has(sq)?this.g.get(sq):null}getBandwidthEstimate(a){const b=this.Jg();if(!b)return a;const c=this.h.estimatedThroughputWeightRatio;
return c>0&&c<=1?a*(1-c)+b*c:a}};w("shaka.util.CmsdManager",tq);tq.prototype.getBandwidthEstimate=tq.prototype.getBandwidthEstimate;tq.prototype.getRoundTripTime=tq.prototype.li;tq.prototype.getResponseDelay=tq.prototype.ki;tq.prototype.getEstimatedThroughput=tq.prototype.Jg;tq.prototype.getMaxBitrate=tq.prototype.Lg;var qq="etp",pq="mb",rq="rd",sq="rtt";async function uq(a,b){a.g&&await new Promise(c=>a.h.push(c));a.g=b}var vq=class{constructor(){this.g=null;this.h=[]}release(){this.h.length>0?this.h.shift()():this.g=null}};function wq(a,b){return new P(a,b)}function xq(a,b){yq.set(a,b)}function zq(a,b,c){b>0&&(a.ua()||a.mh(b));b=a.getDuration();c<b&&(a.ua()||a.Eb(c))}
function Aq(a){var b=(e,f)=>{ma(e,"has been deprecated. Please use",f,"instead.")},c={preferredAudioLanguage:"language",preferredAudioRole:"role",preferredAudioLabel:"label",preferredAudioChannelCount:"channelCount",preferSpatialAudio:"spatialAudio"};if(Object.keys(c).some(e=>e in a)){var d={language:"",role:"",label:"",channelCount:0,codec:""};for(const [e,f]of Object.entries(c))e in a&&(b(e,"preferredAudio"),d[f]=a[e],delete a[e]);a.preferredAudio||(a.preferredAudio=[d])}"preferredAudioCodecs"in
a&&(b("preferredAudioCodecs","preferredAudio"),c=a.preferredAudioCodecs,Array.isArray(c)&&c.length&&(a.preferredAudio||(a.preferredAudio=c.map(e=>({language:"",role:"",label:"",channelCount:0,codec:e})))),delete a.preferredAudioCodecs);c={preferredTextLanguage:"language",preferredTextRole:"role",preferForcedSubs:"forced"};if(Object.keys(c).some(e=>e in a)){d={language:"",role:"",format:""};for(const [e,f]of Object.entries(c))e in a&&(b(e,"preferredText"),d[f]=a[e],delete a[e]);a.preferredText||(a.preferredText=
[d])}"preferredTextFormats"in a&&(b("preferredTextFormats","preferredText"),c=a.preferredTextFormats,Array.isArray(c)&&c.length&&(a.preferredText||(a.preferredText=c.map(e=>({language:"",role:"",format:e})))),delete a.preferredTextFormats);c={preferredVideoLabel:"label",preferredVideoRole:"role",preferredVideoHdrLevel:"hdrLevel",preferredVideoLayout:"layout"};if(Object.keys(c).some(e=>e in a)){d={label:"",role:"",codec:"",hdrLevel:"",layout:""};for(const [e,f]of Object.entries(c))e in a&&(b(e,"preferredVideo"),
d[f]=a[e],delete a[e]);a.preferredVideo||(a.preferredVideo=[d])}"preferredVideoCodecs"in a&&(b("preferredVideoCodecs","preferredVideo"),b=a.preferredVideoCodecs,Array.isArray(b)&&b.length&&(a.preferredVideo||(a.preferredVideo=b.map(e=>({label:"",role:"",codec:e,hdrLevel:"",layout:""})))),delete a.preferredVideoCodecs)}function kq(a){if(!a.h||!a.h.currentTime)return null;const b=a.Ng();return b?Math.floor(Date.now()-(b.getTime()+a.h.currentTime*1E3)):null}
function Bq(a){const b=un();b.streaming.failureCallback=c=>{if(a.ua()){var d=null;c.code==1001||c.code==1002?(d=1,a.g.streaming.lowLatencyMode&&(d=.1)):c.code==1003&&(d=.1);d!=null&&(c.severity=1,a.fg(d))}};b.textDisplayFactory=c=>{if(a.jc){var d=a.h;d=d.webkitDisplayingFullscreen||d.webkitPresentationMode&&d.webkitPresentationMode!="inline"?!1:!0}else d=!1;return d?new jp(c):"track"in document.createElement("track")?new Jo(c):new Yo};return b}
function Cq(a,b){b||=()=>null;const c=f=>{b()?Rn(b(),!0,f):f()},d=f=>{b()?b().dispatchEvent(f):a.dispatchEvent(f)},e=new jg((f,g,h,k,l)=>{c(()=>{a.u&&a.u.segmentDownloaded(f,g,h,k,l)})},(f,g,h)=>{g=(new Map).set("headers",f).set("request",g).set("requestType",h);d(wq("downloadheadersreceived",g));c(()=>{if(a.sa){var k=a.sa;if(k.h.enabled){var l=f["cmsd-static"];if(l)try{var m=new Map;const p=l.split(",");for(l=0;l<p.length;l++){const q=p[l].split("=");m.set(q[0],oq(q[1]))}}catch(p){}if(m=f["cmsd-dynamic"]){a:{try{const p=
new Map,q=m.split(";");for(m=1;m<q.length;m++){const r=q[m].split("=");p.set(r[0],oq(r[1]))}var n=p;break a}catch(p){n=null;break a}n=void 0}n&&(k.g=n)}}}})},(f,g,h,k)=>{f=(new Map).set("requestType",f).set("request",g).set("context",h).set("response",k);d(wq("downloadcompleted",f))},(f,g,h,k,l,m)=>{f=(new Map).set("requestType",f).set("request",g).set("context",h).set("error",k).set("httpResponseCode",l).set("aborted",m);d(wq("downloadfailed",f))},(f,g,h)=>{c(()=>{a.J&&Sp(a.J,f,g,h)})},(f,g,h,k)=>
{(f=b()?b().o:a.H)&&f.banLocation&&f.banLocation(k)},(f,g,h)=>{if(g.data){const k=g.data.byteLength,l=b()?b().getStats():a.o;l&&(Nn(l,k),f===0&&(l.Ug=k));Yp(a.J,f,g,h)}});e.configure(a.g.networking);return e}function Dq(a,b=!0){if(a.l==Eq){a.Xd.stop();for(const c of a.i.variants)isFinite(c.disabledUntilTime)&&(c.disabledUntilTime=0);b&&Fq(a)}}function Gq(a){a.S!=null&&(Vb(a.S),a.S.release(),a.S=null)}
function Hq(a,b,c){c||b.lcevc.enabled?(Gq(a),a.S==null&&(a.S=new Wb(a.h,a.wg,b.lcevc,c),a.G&&(a.G.G=a.S))):Gq(a)}function Iq(a,b){a.dispatchEvent(wq("onstatechange",(new Map).set("state",b)))}async function Jq(a,b){const c=++a.ce;await uq(a.ba,b);return c!=a.ce?(a.ba.release(),!0):!1}
async function Kq(a){A();Iq(a,"media-source");a.g.mediaSource.useSourceElements&&cj(a.h);Lq(a);const b=Mq(a.h,a.D,{wd:()=>a.keySystem(),onMetadata:(c,d,e)=>{for(const f of c)if(f.data&&typeof f.cueTime=="number"&&f.frames){c=f.cueTime+d;let g=e;g&&c>g&&(g=c);for(const h of f.frames)Nq(a,c,g,"org.id3",h);if(a.B)a.B.onHlsTimedMetadata(f,c)}},Qi:c=>{a.Sa&&Bl(a.Sa,{schemeIdUri:c.schemeIdUri,startTime:c.startTime,endTime:c.endTime,id:String(c.id),emsg:c})},onEvent:c=>a.dispatchEvent(c),Si:()=>{a.H&&a.H.update&&
a.H.update()}},a.S,a.g.mediaSource);b.wa=a.g.manifest.segmentRelativeVttTiming;await b.J.promise;a.G=b}
function Oq(a){var b=a.Lf();if(a.o&&a.P&&a.C){if(a.g.streaming.rebufferingGoal==0){var c=a.K;c.j=!1;ql(c)}else c=a.K,c.j=b,ql(c);a.J&&(c=a.J,b||c.u||(c.u=!0),c.u&&b&&(c.H=!0,pp(c,"ps",{sta:"r"})),c.I=b);Pq(a);c=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.g.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.ee<c){c=a.g.streaming.liveSync.dynamicTargetLatency.maxLatency;const d=a.g.streaming.liveSync.targetLatencyTolerance,e=a.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;
a.T&&(a.T=Math.min(a.T+ ++a.ee*e,c-d))}}b=(new Map).set("buffering",b);a.dispatchEvent(wq("buffering",b))}async function Qq(a,b){a=await $l(b,a.N,a.g.manifest.retryParameters);ae(a)?A().h()==="WEBKIT"&&(a="application/vnd.apple.mpegurl"):a==="video/quicktime"&&A().h()==="CHROMIUM"&&(a="video/mp4");return a}
async function Rq(a,b,c,d,e=!1,f){d||=await Qq(a,b);if(Sq(a,d))return null;f=f||a.g;let g=!1;e&&a.h&&a.h.nodeName==="AUDIO"&&(g=!0);b=Tq(a,b,c,d||null,f,!e,g);return b=e?b.then(h=>{h.G=!1;return h}):b.then(h=>{a.Yd.push(h);return h})}function Uq(a,b,c){b=(new Map).set("startTime",b.startTime).set("endTime",b.endTime).set("metadataType",b.schemeIdUri).set("payload",b.payload);a.dispatchEvent(wq(c,b))}
async function Vq(a,b){const c=Date.now()/1E3;let d=!0;a.A=a.Qc({dc:a.N,onError:e=>{Wq(a,e)},Je:()=>{},onExpirationUpdated:()=>{const e=wq("expirationupdated");a.dispatchEvent(e)},onEvent:e=>{a.dispatchEvent(e);if(e.type=="drmsessionupdate"&&d){d=!1;e=a.o;var f=Date.now()/1E3-c;f>=0&&(e.m=f)}}});a.A.configure(a.g.drm);b=qf([b]);a.A.N=!0;await Ug(a.A,[b],[]);await a.A.Hb(a.h)}
async function Xq(a,b,c){Iq(a,"src-equals");const d=a.h;a.C=new el(d);let e=!1;a.Rd.push(()=>{e=!0});a.dispatchEvent(wq("canupdatestarttime"));a.O!=null&&a.C.u(a.O);a.Ob=Yq(a,a.O||0);Zq(a,d);$q(a,d,!0);if(d.textTracks){Lq(a);const h=l=>{if(!(a.D instanceof Jo)){const m=ar(a).find(n=>n.mode!=="disabled");m&&(m.mode=l?"showing":"hidden")}};a.m.F(d,"enterpictureinpicture",()=>h(!0));a.m.F(d,"leavepictureinpicture",()=>h(!1));const k=uh(A(),d);k?a.m.Pb(k,["connect","connecting","disconnect"],()=>{h(!1)}):
"webkitCurrentPlaybackTargetIsWireless"in d&&a.m.F(d,"webkitcurrentplaybacktargetiswirelesschanged",()=>h(!1));(d.webkitPresentationMode||d.webkitSupportsFullscreen)&&a.m.F(d,"webkitpresentationmodechanged",()=>{d.webkitPresentationMode?h(d.webkitPresentationMode!=="inline"):d.webkitSupportsFullscreen&&h(d.webkitDisplayingFullscreen)})}br(a,d,b);b=jq(a.J,a.W,c);!b.includes("#t=")&&(a.g.playRangeStart>0||isFinite(a.g.playRangeEnd))&&(b+="#t=",a.g.playRangeStart>0&&(b+=a.g.playRangeStart),isFinite(a.g.playRangeEnd)&&
(b+=","+a.g.playRangeEnd));a.G&&(await a.G.destroy(),a.G=null);cj(d);d.src=b;b=A();b.i()=="TV"&&d.load();d.preload!="none"&&!d.autoplay&&ae(c)&&b.h()==="WEBKIT"&&d.load();a.l=cr;a.dispatchEvent(wq("streaming"));const f=()=>new Promise(h=>{const k=new te(h);a.m.F(d.textTracks,"change",()=>k.ha(.5));k.ha(.5)}),g=Promise.withResolvers();Uk(d,HTMLMediaElement.HAVE_METADATA,a.m,async()=>{a.C.ready();a.ya&&ae(a.ya)&&await f();g.resolve()});Uk(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.m,async()=>{await f();
if(!e){dr(a);var h=ar(a);h.some(k=>k.mode==="showing")&&(a.wa=!0,a.D.setTextVisibility(!0));if(!(a.D instanceof Jo)){let k=!1;for(const l of h)l.mode!=="disabled"&&(k?(l.mode="disabled",ma("Found more than one enabled text track, disabling it",l)):(er(a,l),k=!0))}fr(a)}});d.error?g.reject(gr(a)):d.preload=="none"&&(ma('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),
g.resolve());a.m.na(d,"error",()=>{g.reject(gr(a))});await ve(a.g.streaming.loadTimeout,g.promise);((c=a.ua())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.g.streaming.liveSync.panicMode)||a.g.streaming.vodDynamicPlaybackRate)&&a.m.F(d,"timeupdate",()=>hr(a));c||(a.m.F(d,"timeupdate",()=>ir(a)),ir(a));if(a.B&&(a.B.onManifestUpdated(c),c)){let h=a.Ea().end;a.m.F(d,"progress",()=>{const k=a.Ea().end;h!=k&&(a.B.onManifestUpdated(a.ua()),h=k)})}await jr(a);a.X=!0}
function kr(a){for(const b of a.i.variants)b.video&&(b.video.closeSegmentIndex(),b.video=null),b.bandwidth=b.audio&&b.audio.bandwidth?b.audio.bandwidth:0;a.i.variants=a.i.variants.filter(b=>b.audio)}
async function lr(a,b,c,d){Iq(a,"load");const e=a.h;Zq(a,e);br(a,e,b);"onchange"in window.screen&&a.m.F(window.screen,"change",()=>{if(a.L.getConfiguration){const m=a.L.getConfiguration();m.preferredVideo.some(n=>n.hdrLevel=="AUTO")?Fq(a):a.g.preferredVideo.some(n=>n.hdrLevel=="AUTO")&&a.g.abr.enabled&&(m.preferredVideo=a.g.preferredVideo,zn(m),a.L.configure(m),Fq(a))}});var f=!1;for(var g of a.i.variants){var h=g.video&&g.video.dependencyStream;h&&(f=Tb(h))}Hq(a,a.g,f);a.Zd=a.g.preferredText[0]&&
a.g.preferredText[0].language||"";a.Xe=a.g.preferredText[0]&&a.g.preferredText[0].role||"";a.We=a.g.preferredText[0]?.forced||!1;zq(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.u.init((m,n,p)=>mr(a,m,n,p),(m,n)=>{const p=a.j?.ba();(m=p&&p[m])&&a.disableStream(m,n)});a.u.setMediaElement(e);a.u.setCmsdManager(a.sa);a.j=nr(a);a.j.configure(a.g.streaming);a.l=Eq;a.dispatchEvent(wq("streaming"));f=c;do{g=a.j.o;g||(h=or(a,!0),c||(f=h));const m=[];h=g||f;for(var k of[h.video,h.audio])k&&
!k.segmentIndex&&(m.push(k.createSegmentIndex()),k.dependencyStream&&m.push(k.dependencyStream.createSegmentIndex()));m.length>0&&await Promise.all(m)}while(!h||h.disabledUntilTime!=0);Fq(a);if(a.H&&a.H.onInitialVariantChosen)a.H.onInitialVariantChosen(h);a.i.isLowLatency&&(a.g.streaming.lowLatencyMode?a.configure(a.Ze):ma("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));
a.J&&(Hp(a.J,a.i.isLowLatency&&a.g.streaming.lowLatencyMode),Mp(a.J,b*1E3));zq(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);km(a.j,a.g.playRangeStart,a.g.playRangeEnd);await jr(a);a.X=!0;a.dispatchEvent(wq("canupdatestarttime"));b=m=>{a.C=pr(a,m);a.Ob=qr(a,m);$q(a,e,!1)};a.g.streaming.startAtSegmentBoundary||(c=a.O,c==null&&a.i.startTime&&(c=a.i.startTime),b(c));if(!g){if(a.g.streaming.startAtSegmentBoundary){c=a.i.presentationTimeline;var l;a.O instanceof Date&&(k=a.O.getTime()/
1E3-(c.j||c.h),k!=null&&(l=k));l==null&&(l=typeof a.O==="number"?a.O:a.isLive()?Infinity:a.h.currentTime);a.O==null&&a.i.startTime&&(l=a.i.startTime);k=c.Ab();c=c.rb();l<k?l=k:l>c&&(l=c);l=await rr(f,l);b(l)}sr(a,f,!0,!1,0)}a.C.ready();if(!a.ub().find(m=>m.active)){if(l=tr(a,f))En(a.o.j,l,!0),ur(a,l);l&&a.wa&&(zm(a.j,l),vr(a))}await a.j.start(d);a.g.abr.enabled&&(a.u.enable(),wr(a));xr(a);a.i.variants.some(m=>m.primary);((d=a.ua())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.i.serviceDescription||
a.g.streaming.liveSync.panicMode)||a.g.streaming.vodDynamicPlaybackRate)&&a.m.F(e,"timeupdate",()=>hr(a));if(!d&&(a.m.F(e,"timeupdate",()=>ir(a)),ir(a),a.i.nextUrl)){if(a.g.streaming.preloadNextUrlWindow>0){const m=async()=>{const n=a.Ea().end-a.h.currentTime;!isNaN(n)&&n<=a.g.streaming.preloadNextUrlWindow&&(a.m.Ma(e,"timeupdate",m),a.$a=await a.preload(a.i.nextUrl))};a.m.F(e,"timeupdate",m)}a.m.F(e,"ended",()=>{a.load(a.$a||a.i.nextUrl)})}if(a.B)a.B.onManifestUpdated(d)}
async function yr(a,b=!1){var c=null;if(a.i&&a.H&&a.fc&&a.W&&a.g){c=a.h.currentTime;b||(c=null);c=await Tq(a,a.W,c,a.ya,a.g,!0,!1);a.Yd.push(c);a.H&&a.H.setMediaElement&&a.H.setMediaElement(null);if(b=a.j?a.j.o:null)c.h=b;b=c;var d=a.H,e=a.fc;b.g=a.i;b.o=d;b.I=e;c.m=a.L;c.start();a.i=null;a.H=null;a.fc=null;a.u=null;a.Wd=null}return c}
async function Tq(a,b,c,d,e,f=!0,g=!1){let h=null;e=zc(e);g&&(e.manifest.disableVideo=!0);const k=()=>h.P&&h.l?null:h;a.Ba.width!=Infinity||a.Ba.height!=Infinity||a.g.ignoreHardwareResolution||(g=await A().o(),a.Ba.width=g.width,a.Ba.height=g.height);const l=new Gh(e,a.Ba,null);g={networkingEngine:a.N,filter:async t=>{await Eh(l,t)&&(t=wq("trackschanged"),await Promise.resolve(),h.dispatchEvent(t))},makeTextStreamsForClosedCaptions:t=>zr(a,t),onTimelineRegionAdded:t=>{Bl(h.J,t)},onEvent:t=>h.dispatchEvent(t),
onError:t=>h.onError(t),isLowLatencyMode:()=>(k()?k().getConfiguration():a.g).streaming.lowLatencyMode,updateDuration:()=>{a.j&&h.P&&a.j.updateDuration()},newDrmInfo:t=>{const u=h.j,v=u?u.g:null;v&&u.u&&Ch(l,v.keySystem,t)},onManifestUpdated:()=>{const t=(new Map).set("isLive",a.isLive()).set("isInProgress",a.$c());h.dispatchEvent(wq("manifestupdated",t));Rn(h,!1,()=>{if(a.B)a.B.onManifestUpdated(a.ua())})},getBandwidthEstimate:()=>a.u.getBandwidthEstimate(),onMetadata:(t,u,v,x)=>{let y=t;if(t=="com.apple.hls.interstitial"||
t=="com.apple.hls.overlay")y="com.apple.quicktime.HLS";const D={type:y,startTime:u,endTime:v,values:x};t=new Promise(z=>{Rn(h,!1,async()=>{if(a.B){if(a.h)try{await a.B.onHLSMetadata(D)}catch(B){}z()}})});for(const z of x)z.name!="ID"&&Rn(h,!1,()=>{Nq(a,u,v,y,z)});return t},disableStream:t=>a.disableStream(t,a.g.streaming.maxDisabledTime),addFont:(t,u)=>a.addFont(t,u),getStreamingRetryParameters:()=>a.g.streaming.retryParameters};const m=new Cl(()=>a.Ea());m.addEventListener("regionadd",t=>{const u=
t.region;Ar(a,"timelineregionadded",u,h);Rn(h,!1,()=>{if(a.B)a.B.onDASHMetadata(u)})});let n=null;e.streaming.observeQualityChanges&&(n=new zl(()=>a.tc()),n.addEventListener("qualitychange",t=>{Br(a,t.quality,t.position)}),n.addEventListener("audiotrackchange",t=>{Br(a,t.quality,t.position,!0)}));let p=!0;const q={dc:a.N,onError:t=>h.onError(t),Je:t=>{Rn(h,!0,()=>{a.A&&Cr(a,t)})},onExpirationUpdated:(t,u)=>{var v=wq("expirationupdated");h.dispatchEvent(v);if((v=h.o)&&v.onExpirationUpdated)v.onExpirationUpdated(t,
u)},onEvent:t=>{h.dispatchEvent(t);if(t.type=="drmsessionupdate"&&p){p=!1;const u=Date.now()/1E3-h.sa;t=a.o||h.getStats();u>=0&&(t.m=u);a.S&&Vb(a.S)}}},r=Cq(a,k);bg(a.N,r);return h=new ko(b,d,c,{config:e,Ii:g,Vi:m,Ui:n,Qc:()=>a.Qc(q),Hi:l,networkingEngine:r,yh:f})}
async function Wq(a,b){if(a.l!=Dr){b.severity===1&&a.o.K++;if(a.i&&a.j&&(b.code==3016||b.code==3014||b.code==3015||b.code==3024||b.code==3018)&&(lf(a.i.variants).length>1||a.X)){if(A().h()==="WEBKIT"&&b.code==3016)return;try{if(await Im(a.j)){var c=wq("mediasourcerecovered");a.dispatchEvent(c);return}}catch(d){}}b.severity===2&&Dq(a,!1);c=wq("error",(new Map).set("detail",b));a.dispatchEvent(c);c.defaultPrevented&&(b.handled=!0)}}
function Sq(a,b){if(!$b(A()))return!0;if(b){if((a.h||ej()).canPlayType(b)=="")return!1;if(!$b(A())||!Yb.has(b))return!0;if(ae(b))return A().h()==="WEBKIT"&&(a.g.drm.servers["com.apple.fps"]||a.g.drm.servers["com.apple.fps.1_0"])?a.g.streaming.useNativeHlsForFairPlay:a.g.streaming.preferNativeHls;if(b==="application/dash+xml"||b==="video/vnd.mpeg.dash.mpd")return a.g.streaming.preferNativeDash}return!1}
function zr(a,b){const c=new Set;for(var d of b.textStreams)d.mimeType!="application/cea-608"&&d.mimeType!="application/cea-708"||c.add(d.originalId);for(const f of b.variants)if((d=f.video)&&d.closedCaptions)for(const g of d.closedCaptions.keys())if(!c.has(g)){var e=g.startsWith("CC")?"application/cea-608":"application/cea-708";const h=new pl,k=d.closedCaptions.get(g);e={id:a.Vd++,originalId:g,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:h,mimeType:e,codecs:"",supplementalCodecs:"",
kind:"caption",encrypted:!1,drmInfos:[],keyIds:new Set,language:k,originalLanguage:k,label:null,type:K,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:d.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set([Rd(e,"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};b.textStreams.push(e);c.add(g)}}
function Nq(a,b,c,d,e){a.Z&&(b={schemeIdUri:d,startTime:b,endTime:c||Infinity,id:"",payload:e},b.id=JSON.stringify(b),Bl(a.Z,b))}function Ar(a,b,c,d=a){a=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,timescale:c.timescale,eventNode:c.eventNode});d.dispatchEvent(wq(b,a))}
function Br(a,b,c,d=!1){b=(new Map).set("mediaQuality",{bandwidth:b.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate,height:b.height,mimeType:b.mimeType,channelsCount:b.channelsCount,pixelAspectRatio:b.pixelAspectRatio,width:b.width,label:b.label,roles:b.roles,language:b.language}).set("position",c);a.dispatchEvent(wq(d?"audiotrackchanged":"mediaqualitychanged",b))}
function Cr(a,b){if(a.j){var c=wq("keystatuschanged");a.dispatchEvent(c);var d=Object.keys(b);d.length==1&&d[0]==""&&(d=["00"],b={"00":b[""]});var e=d.length==1&&d[0]=="00";c=!1;if(d.length){d=a.keySystem();const h=og(a.g.drm.clearKeys),k=(l,m)=>{l.allowedByKeySystem=!0;for(const n of m)if((m=b[e?"00":n])||a.A.G)l.allowedByKeySystem=l.allowedByKeySystem&&!!m&&!Fh.includes(m)};for(var f of a.i.variants){var g=of(f);for(const l of g){g=f.allowedByKeySystem;if(l.keyIds.size)if(l.drmInfos.length&&!h.size&&
a.i.type=="HLS")for(const m of l.drmInfos)m.keySystem==d&&(m.keyIds.size?k(f,m.keyIds):k(f,l.keyIds));else k(f,l.keyIds);g!=f.allowedByKeySystem&&(c=!0)}}}c&&(xr(a),(f=a.j.o)&&!f.allowedByKeySystem?Er(a):Fq(a))}}function Lq(a,b=!1){const c=a.g.textDisplayFactory;a.ug!==c||b?(b=a.D,a.D=c(a),a.D.configure(a.g.textDisplayer),b?(a.D.setTextVisibility(b.isTextVisible()),b.destroy().catch(()=>{})):a.D.setTextVisibility(a.wa),a.G&&Hk(a.G,a.D),a.ug=c,a.j&&Am(a.j)):a.D&&a.D.configure(a.g.textDisplayer)}
function Mq(a,b,c,d,e){return new Lk(a,b,c,e,d)}function Zq(a,b){a.K=new rl({If:()=>b.playbackRate,Uc:()=>b.defaultPlaybackRate,jh:c=>{b.playbackRate=c},Oi:c=>{const d=b.currentTime;if(Yi(b.buffered,d)&&!(b.readyState<=HTMLMediaElement.HAVE_CURRENT_DATA)){c=d+c;var e=a.Ea();c<e.start?d!==e.start&&(b.currentTime=e.start):c>e.end?d!==e.end&&(b.currentTime=e.end):b.currentTime=c}},isPaused:()=>b.paused})}
function Pq(a){if(a.o&&a.P){var b=a.o.g,c="playing";a.P.g==yh?c="buffering":a.Zc()?c="ended":a.h.paused&&(c="paused");var d=c;if(b.g==null)b.g={timestamp:Date.now()/1E3,state:d,duration:0},b=!0;else{{const e=Date.now()/1E3;b.g.duration=e-b.g.timestamp;b.g.state==d?b=!1:(b.h.push(b.g),b.g={timestamp:e,state:d,duration:0},b=!0)}}b&&(c=(new Map).set("newstate",c),a.dispatchEvent(wq("statechanged",c)))}}
function Fr(a){var b=a.h.playbackRate;b==0?(b=a.qb(),b!==0&&b!==1&&(b=wq("ratechange"),a.dispatchEvent(b))):(a.K&&(a.K.set(b),a.l==Eq&&a.u.playbackRateChanged(b),Gr(a,b)),b=wq("ratechange"),a.dispatchEvent(b))}function Hr(a){const b=wq("textchanged");Ir(a,b)}function xr(a){const b=wq("trackschanged");Ir(a,b);Jr(a)}
function Kr(a,b){if(b.kind=="metadata"){b.mode="hidden";var c=()=>{if(b.cues){var e=[];for(const f of b.cues)if(f.startTime!=null&&"type"in f){let g=e.find(h=>h.startTime==f.startTime&&h.endTime==f.endTime);g||(g={type:f.type,startTime:f.startTime,endTime:f.endTime,values:[]},e.push(g));f.value&&f.value.key=="X-AD-CREATIVE-SIGNALING"&&(g.type="urn:svta:advertising-wg:ad-creative-signaling");g.values.push(f.value)}for(const f of e)a.B&&(f.values.some(g=>g.key=="X-ASSET-URI"||g.key=="X-ASSET-LIST")&&
(e=f.startTime==0&&!a.ua(),f.values.push({key:"CUE",description:"",data:e?"ONCE,PRE":"ONCE",mimeType:null,pictureType:null})),a.B.onHLSMetadata(f))}};a.m.F(b,"cuechange",()=>{if(b.activeCues)for(const e of b.activeCues)if(Nq(a,e.startTime,e.endTime,e.type,e.value),a.B)a.B.onCueMetadataChange(e.value);c()});c();var d=(new te(()=>{const e=Lr(a);for(const f of e)f.mode="hidden"})).La().ha(.5);a.Rd.push(()=>{d.stop()})}}
function Mr(a,b){if(b&&b.kind=="chapters"){b.mode="hidden";var c=(new te(()=>{b.mode="hidden"})).La().ha(.5);a.Rd.push(()=>{c.stop()})}}
function br(a,b,c){a.m.Pb(b,["playing","pause","ended"],()=>{Pq(a)});a.m.F(b,"ratechange",()=>{Fr(a)});const d=uh(A(),b);d&&(a.m.F(d,"connect",()=>{a.j&&d.state=="connected"&&Hr(a);xr(a)}),a.m.F(d,"connecting",()=>xr(a)),a.m.F(d,"disconnect",async()=>{a.j&&d.state=="disconnected"&&(await Im(a.j),Hr(a));xr(a)}));b.audioTracks&&a.m.Pb(b.audioTracks,["addtrack","removetrack","change"],()=>{xr(a)});b.videoTracks&&a.m.Pb(b.videoTracks,["addtrack","removetrack","change"],()=>{xr(a)});(b.webkitPresentationMode||
b.webkitSupportsFullscreen)&&a.m.F(b,"webkitpresentationmodechanged",()=>{a.jc&&Lq(a,!0)});if(b.textTracks){const e=()=>{a.l===cr&&a.D instanceof Jo&&Hr(a);xr(a)};a.m.F(b.textTracks,"addtrack",f=>{if(f.track)switch(f=f.track,f.kind){case "metadata":Kr(a,f);break;case "chapters":Mr(a,f);break;default:e()}});a.m.Pb(b.textTracks,["removetrack","change"],e)}b.preload!="none"&&a.m.na(b,"loadedmetadata",()=>{var e=a.o,f=Date.now()/1E3-c;f>=0&&(e.C=f)})}
function Fq(a){try{Dh(a.Ud,a.i)}catch(d){return Wq(a,d),!1}const b=a.i.isLowLatency&&a.g.streaming.lowLatencyMode;var c=lf(a.i.variants);c=a.L.create(c);a=a.u.setVariants(Array.from(c.values()),b);return typeof a=="boolean"?a:!0}function mr(a,b,c=!1,d=0){a.i&&a.j&&b!=a.j.o&&sr(a,b,!0,c,d)}
function nr(a){return new Tm(a.i,{Lb:()=>a.C?a.C.m():0,getBandwidthEstimate:()=>a.u.getBandwidthEstimate(),qb:()=>a.qb(),video:a.h,V:a.G,dc:a.N,onError:b=>Wq(a,b),onEvent:b=>a.dispatchEvent(b),fd:(b,c,d,e)=>{var f=b.startTime,g=b.endTime,h=c.type;if(h!=K){if(a.C){a.C.I();const k=ck(a.G,h);!a.ua()&&a.h.paused&&!a.h.seeking&&k!=null&&k>0&&a.C.m()<k&&!qj(a.C.m(),k,.001)&&a.C.u(k)}Nr(a)}d=(new Map).set("start",f).set("end",g).set("contentType",h).set("isMuxed",d).set("isDependency",e);a.dispatchEvent(wq("segmentappended",
d));a.u&&c.fastSwitching&&b.Hc&&b.Cd&&a.u.trySuggestStreams()},Ri:(b,c)=>{(c=c.cd)&&a.Nd&&xl(a.Nd,c,b)},Ag:(b,c)=>{var d=a.A;if(d.h.parseInbandPsshEnabled&&!d.G&&["audio","video"].includes(b)){b=new Fg(G(c));c=0;for(var e of b.data)c+=e.length;if(c==0)d=Promise.resolve();else{e=new Uint8Array(c);c=0;for(const f of b.data)e.set(f,c),c+=f.length;$g(d,"cenc",e);d=d.l.promise}}else d=Promise.resolve();return d},disableStream:(b,c)=>a.disableStream(b,c),mj:(b,c)=>a.g.abr.enabled&&c.fastSwitching&&b.Hc&&
b.Cd?!1:!0,wd:()=>a.keySystem()})}function or(a,b=!1){if(Fq(a)){if(!a.g.abr.enabled){var c=a.L.getLastAdaptationSet();if(c&&(c=Array.from(c.values()),c.length)){const d=a.j.o;if(d&&d.video&&(c=c.find(e=>e.video==d.video)))return c}}return a.u.chooseVariant(b)}return null}async function jr(a){a.Td.size&&await Promise.all([...a.Td])}function pr(a,b){return new jl(a.h,a.i,a.g.streaming,b,()=>{a.Ob&&sl(a.Ob,!a.C.C());a.j&&a.j.Jc();a.P&&Nr(a,"seeking")},c=>a.dispatchEvent(c))}
function qr(a,b){var c=a.ua()||typeof b==="number"&&b>0;b=new po(a.hc,c);b.addEventListener("enter",f=>{Ar(a,"timelineregionenter",f.region)});b.addEventListener("exit",f=>{Ar(a,"timelineregionexit",f.region)});b.addEventListener("skip",f=>{const g=f.region;f.seeking||(Ar(a,"timelineregionenter",g),Ar(a,"timelineregionexit",g))});const d=new po(a.Z,c);d.addEventListener("enter",f=>{Uq(a,f.region,"metadata")});c=new po(a.Sa,c);c.addEventListener("enter",f=>{f=(new Map).set("detail",f.region.emsg);
a.dispatchEvent(wq("emsg",f))});const e=new tl(a.h);e.g.add(b);e.g.add(d);e.g.add(c);a.Nd&&e.g.add(a.Nd);return e}
function $q(a,b,c){a.P=new zh;wh(a.P,yh);Or(a);Oq(a);a.Oa=new te(()=>{Nr(a)});a.g.streaming.rebufferingGoal&&a.Oa.Aa(.25);a.m.F(b,"waiting",()=>Nr(a,"waiting"));a.m.F(b,"canplaythrough",()=>Nr(a,"canplaythrough"));a.m.F(b,"playing",()=>Nr(a,"playing"));a.m.F(b,"seeked",()=>Nr(a,"seeked"));a.m.F(b,"timeupdate",()=>Nr(a,"timeupdate"));c&&(a.m.F(b,"progress",()=>Nr(a,"progress")),a.m.F(b,"stalled",()=>Nr(a,"stalled")))}
async function rr(a,b){var c=a.video;const d=async(e,f)=>{if(!e)return null;e.segmentIndex||await e.createSegmentIndex();return(e=(e=e.segmentIndex.Kb(f))?e.next().value:null)?e.startTime:null};a=await d(a.audio,b);c=await d(c,b);return c!=null&&a!=null?Math.max(c,a):c!=null?c:a!=null?a:b}
function sr(a,b,c,d,e,f=!1){var g=a.j.o;if(b==g)d&&ym(a.j,b,d,e,!0);else{var h=a.o.j;h.h!=b&&(h.h=b,h.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));ym(a.j,b,d,e,f,c);d=null;g&&(d=bf(g));g=bf(b);g.active=!0;if(a.S&&(e=a.S,h=b.video)){h.dependencyStream&&(h=h.dependencyStream);b=0;f=-1;switch(h.mimeType){case "video/webm":b=1;break;case "video/mp4":b=2}switch(a.Kg()){case "DASH":f=1;break;case "HLS":f=0}e.g&&(e.g.setLevelSwitching(h.id,!0),e.g.setContainerFormat(b),
e.g.setStreamingFormat(f))}c?(c=(new Map).set("oldTrack",d).set("newTrack",g),c=wq("adaptation",c),Ir(a,c)):Pr(a,d,g);Qr(a,d,g)}}function tr(a,b){let c=null,d=mf(a.i.textStreams,a.Zd,a.Xe,a.We);d.length&&(c=d[0]);!c&&b.audio&&a.g.accessibility.handleForcedSubtitlesAutomatically&&(d=mf(a.i.textStreams,b.audio.language,"",!0),d.length&&(c=d[0]));return c}function ur(a,b){b?(a.wa=!0,a.D.setTextVisibility(!0)):(a.wa=!1,a.D.setTextVisibility(!1))}
function vr(a){const b=a.ub().find(c=>c.active);b&&a.D&&a.D.setTextLanguage(b.language)}function wr(a){a.g.abr.enabled||Dq(a);const b=(new Map).set("newStatus",a.g.abr.enabled);Ir(a,wq("abrstatuschanged",b))}
function hr(a){const b=a.h.playbackRate;var c=a.ua();if(a.g.streaming.vodDynamicPlaybackRate&&!c){var d=a.g.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.Ig();e<=a.g.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.Md(d,!1):e==1&&b!==a.K.Uc()&&a.rd()}if(c&&(c=a.Ea(),Number.isFinite(c.end)&&!(a.h.currentTime<c.start||a.h.paused))){d=a.g.streaming.liveSync.targetLatencyTolerance;e=a.g.streaming.liveSync.dynamicTargetLatency.enabled;var f=a.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
if(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled){var g=a.g.streaming.liveSync.targetLatency;var h=g+d;var k=Math.max(0,g-d);var l=a.g.streaming.liveSync.maxPlaybackRate;var m=a.g.streaming.liveSync.minPlaybackRate}else a.i&&a.i.serviceDescription&&(g=a.i.serviceDescription.targetLatency,a.i.serviceDescription.targetLatency!=null?h=a.i.serviceDescription.targetLatency+d:a.i.serviceDescription.maxLatency!=null&&(h=a.i.serviceDescription.maxLatency),a.i.serviceDescription.targetLatency!=null?
k=Math.max(0,a.i.serviceDescription.targetLatency-d):a.i.serviceDescription.minLatency!=null&&(k=a.i.serviceDescription.minLatency),l=a.i.serviceDescription.maxPlaybackRate||a.g.streaming.liveSync.maxPlaybackRate,m=a.i.serviceDescription.minPlaybackRate||a.g.streaming.liveSync.minPlaybackRate);a.T||typeof g!=="number"||(a.T=g);var n=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Qb&&a.T!==null&&typeof g==="number"&&a.ee<n&&Date.now()-a.Qb>f*1E3&&(f=a.g.streaming.liveSync.dynamicTargetLatency.minLatency,
a.T=Math.max(a.T-(g-f)/2,f+d),a.Qb=Date.now());e&&a.T!==null&&(h=a.T+d,k=a.T-d);g=c.end-a.h.currentTime;d=0;a.l==cr&&(e=a.h.buffered,e.length>0&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.g.streaming.liveSync.panicMode;e=a.g.streaming.liveSync.panicThreshold*1E3;f=Date.now()-a.P.i;c&&!m&&(m=a.g.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.Md(m,!1):h!=void 0&&l&&g-d>h?(b!=l&&a.Md(l,!1),a.Qb=null):k!=void 0&&m&&g-d<k?(b!=m&&a.Md(m,!1),a.Qb=null):b!==a.K.Uc()&&(a.rd(),a.Qb=Date.now())}}
function ir(a){if(a.h){var b=a.Ea();b=b.end-b.start;b=b>0?a.h.currentTime/b:0;if(!isNaN(b)){b*=100;if(Rr(a,0,b))var c=wq("started");else if(Rr(a,25,b))c=wq("firstquartile");else if(Rr(a,50,b))c=wq("midpoint");else if(Rr(a,75,b))c=wq("thirdquartile");else{if(Rr(a,100,b)||b>100)c=wq("complete");a.g&&a.g.playRangeEnd!=Infinity&&a.Zc()&&a.h.pause()}c&&a.dispatchEvent(c)}}}
function Yq(a,b){b=new po(a.Z,b instanceof Date||b>0);b.addEventListener("enter",d=>{Uq(a,d.region,"metadata")});const c=new tl(a.h);c.g.add(b);return c}function ar(a){return Array.from(a.h.textTracks).filter(b=>b.kind!="metadata"&&b.kind!="chapters"&&b.label!="Shaka Player TextTrack")}function dr(a){var b=a.g.preferredAudio;if(b.length&&a.h&&a.h.audioTracks){const c=a.Dc();for(const d of b){if(!d.language)continue;if(b=mf(c,d.language,d.role,!1)[0]){a.gg(b);break}}}}
function er(a,b){a.m.F(b,"cuechange",()=>{a.D.remove(0,Math.max(0,a.h.currentTime-a.g.streaming.bufferBehind));const c={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0,isMpegTs:!1},d=[];var e=Array.from(b.activeCues||[]);for(const f of e){a:{if(f.endTime===Infinity||f.endTime<f.startTime){e=null;break a}e=new jd(f.startTime,f.endTime,f.text);e.line=typeof f.line==="number"?f.line:null;f.lineAlign&&(e.lineAlign=f.lineAlign);e.lineInterpretation=f.snapToLines?Ad:1;e.position=typeof f.position===
"number"?f.position:null;f.positionAlign&&(e.positionAlign=f.positionAlign);e.size=f.size;e.textAlign=f.align;f.vertical==="lr"?e.writingMode="vertical-lr":f.vertical==="rl"&&(e.writingMode="vertical-rl");f.region&&(e.region.id=f.region.id,e.region.height=f.region.lines,e.region.heightUnits=2,e.region.regionAnchorX=f.region.regionAnchorX,e.region.regionAnchorY=f.region.regionAnchorY,e.region.scroll=f.region.scroll,e.region.viewportAnchorX=f.region.viewportAnchorX,e.region.viewportAnchorY=f.region.viewportAnchorY,
e.region.viewportAnchorUnits=pc,e.region.width=f.region.width,e.region.widthUnits=pc);ld(e)}if(e){const g=a.g.mediaSource.modifyCueCallback;g&&g(e,null,c);d.push(e)}}a.D.append(d)});b.mode=document.pictureInPictureElement?"showing":"hidden"}
function fr(a){var b=a.ub();if(!b.some(e=>e.active)){var c=a.g.preferredText;for(var d of c){if(!d.language)continue;c=mf(b,d.language,d.role,d.forced);if(c.length){a.lc(c[0]);return}}if(a.h&&a.h.audioTracks&&a.g.accessibility.handleForcedSubtitlesAutomatically&&(d=Array.from(a.h.audioTracks).find(e=>e.enabled))&&(b=mf(b,d.language,"",!0),b.length)){a.lc(b[0]);return}a.lc(null)}}
function gr(a,b=!0){if(!a.h.error)return b?new H(2,3,3016):null;const {code:c,Nh:d,message:e}=sb(a.h.error);return b||c!==MediaError.MEDIA_ERR_ABORTED?new H(2,3,3016,c,d,e):null}function Lr(a){return Array.from(a.h.textTracks).filter(b=>b.kind=="metadata")}function Or(a){const b=a.g.streaming.rebufferingGoal;a.P.j.set(xh,Math.min(.5,b/2)).set(yh,b)}
function Nr(a,b){if(a.g.streaming.rebufferingGoal){b=a.G?Sj(a.G):!1;b=a.Zc()||b||a.C.H();var c=Zi(a.h.buffered,a.h.currentTime),d=a.P,e=d.j.get(d.g);wh(d,b||c>=e&&c>0?xh:yh)&&Oq(a)}else if(b){c=a.P;d=a.h.currentTime;e=c.h;c.h=d;let f=void 0;switch(b){case "seeking":case "waiting":c.h=-1;f=yh;break;case "canplaythrough":case "playing":case "seeked":f=xh;break;case "timeupdate":e>=0&&d-e>.01&&(f=xh)}f!==void 0&&wh(c,f)&&Oq(a)}}
function Sr(a,b){a.Ud=new Gh(a.g,a.Ba,a.A);if(a.H){var c=zc(a.g.manifest);a.h&&a.h.nodeName==="AUDIO"&&(c.disableVideo=!0);a.H.configure(c)}a.A&&a.A.configure(a.g.drm);if(a.j){a.j.configure(a.g.streaming);try{a.l!=Dr&&Ah(a.Ud,a.i)&&xr(a)}catch(e){Wq(a,e)}a.u&&Fq(a);c=a.j.o;!c||c.allowedByApplication&&c.allowedByKeySystem||Er(a)}a.N&&a.N.configure(a.g.networking);a.G&&(a.G.configure(a.g.mediaSource),a.G.wa=a.g.manifest.segmentRelativeVttTiming);a.D&&Lq(a);a.u&&(a.u.configure(a.g.abr),a.g.abr.enabled?
a.u.enable():a.u.disable(),wr(a));a.P&&Or(a);a.Oa&&(a.g.streaming.rebufferingGoal?a.Oa.Aa(.25):a.Oa.stop());a.i&&zq(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.B&&a.B.configure(a.g.ads);a.J&&a.J.configure(a.g.cmcd);a.sa&&a.sa.configure(a.g.cmsd);a.Ka&&a.Ka.configure(a.g.queue);c=a.l==Eq||a.l==cr;a.g.accessibility.speechToText.enabled?a.I?a.I.configure(a.g.accessibility.speechToText):(a.I=new Wo(a),a.I.configure(a.g.accessibility.speechToText),c&&Hr(a)):a.I&&(a.I.release(),a.I=
null,c&&Hr(a));if(a.l==Eq&&a.L.getConfiguration){c=a.L.getConfiguration();var d=!1;Bc(b.preferredVideo)!=Bc(a.g.preferredVideo)&&(c.preferredVideo=a.g.preferredVideo,d=!0);Bc(b.preferredAudio)!=Bc(a.g.preferredAudio)&&(c.preferredAudio=a.g.preferredAudio,d=!0);d&&(zn(c),a.L.configure(c),Er(a))}b=wq("configurationchanged");a.dispatchEvent(b)}function Er(a,b=!0,c=0,d=!1,e=!0){const f=or(a);f&&sr(a,f,e,b,c,d)}
function Gr(a,b){a.Sb.xa();a.Sb.F(a.h,"timeupdate",()=>{const c=a.h.currentTime,d=a.Ea(),e=a.ua(),f=e?a.g.streaming.safeSeekOffset:0;b>0?e&&b>1&&Math.floor(c)>=Math.floor(d.end)&&a.rd():Math.floor(c)<=Math.floor(d.start+f)&&a.rd()})}function Tr(a){return a.h&&a.h.videoTracks?Array.from(a.h.videoTracks).find(b=>b.selected):null}
async function Ur(a,b){if(a.l!=Eq&&a.l!=cr)return null;let c=a.ae;a.i&&(c=a.i.imageStreams);let d=c[0];if(!d)return null;b!=null&&(d=c.find(e=>e.id==b));if(!d)return null;d.segmentIndex||await d.createSegmentIndex();d.closeSegmentIndex&&(a.ec.has(d)||a.ec.set(d,new te(()=>{d&&(d.closeSegmentIndex(),a.ec.delete(d))})),a.ec.get(d).ha(5));return d}function Vr(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
function Wr(a,b,c,d){const e=a.R();if(!e.length)return null;const f=b.width||0,g=b.height||0;let h=f/d.columns,k=g/d.rows;const l=d.columns*d.rows;var m=a.j-a.startTime;m=a.A||m/l;let n=a.startTime,p=0;var q=0;l>1&&(q=Math.floor((c-a.startTime)/m+1E-4),n=a.startTime+q*m,p=q%d.columns*h,q=Math.floor(q/d.columns)*k);if(n>=a.endTime||qj(n,a.endTime,1E-4))return null;d=!1;if(c=a.thumbnailSprite)d=!0,k=c.height,p=c.positionX,q=c.positionY,h=c.width;return{segment:a,imageHeight:g,imageWidth:f,height:k,
positionX:p,positionY:q,startTime:n,duration:m,uris:e,startByte:a.wc(),endByte:a.uc(),width:h,sprite:d,mimeType:a.mimeType||b.mimeType,codecs:a.codecs||b.codecs}}function Xr(a,b){b=!!b;a.wa!=b&&(a.wa=b,a.l==Eq?(a.D.setTextVisibility(b),b?a.j.B||(b=mf(a.i.textStreams,a.Zd,a.Xe,a.We),b.length>0&&(zm(a.j,b[0]),Hr(a),vr(a))):sm(a.j)):a.h&&a.h.src&&a.h.textTracks&&a.D.setTextVisibility(b))}
function Yr(a,b){var c=Array.from(a.h.audioTracks).find(e=>e.enabled);b.enabled=!0;if(c){b.id!==c.id&&(c.enabled=!1);var d=Tr(a);c=jf(c,d);b=jf(b,d);Pr(a,c,b);Qr(a,c,b)}}function Zr(a){return a.h&&a.h.textTracks?Array.from(a.h.textTracks).filter(b=>b.kind=="chapters"):[]}
function $r(a,b){a=Zr(a);if(!a.length)return[];const c=ye(b);var d=a.filter(e=>ye(e.language)==c);if(!d||!d.length)return[];b=[];a=new Set;for(const e of d)if(e&&e.cues)for(const f of e.cues){(d=f.id)&&d!=""||(d=f.startTime+"-"+f.endTime+"-"+f.text);const g={id:d,title:f.text,startTime:f.startTime,endTime:f.endTime,images:[]};a.has(d)||(b.push(g),a.add(d))}return b}async function as(a,b){let c;try{c=await $l(b,a.N,a.g.streaming.retryParameters)}catch(d){}if(c)return c;throw new H(1,2,2011,b);}
async function bs(a,b,c,d,e,f,g){if(e!="text/vtt"||g.length)b=await cs(a,b),b=ds(a,b,e,g),b=Oj(new Blob([b],{type:"text/vtt"}));e=document.createElement("track");a:{g=a.J;try{if(!g.g.enabled){var h=b;break a}const k=iq(g);k.ot=mq;k.su=!0;const l=np(k);h=lp(b,l);break a}catch(k){na("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",k);h=b;break a}h=void 0}e.src=h;e.label=f;e.kind=d;e.srclang=c;a.h.getAttribute("crossorigin")||a.h.setAttribute("crossorigin","anonymous");a.h.appendChild(e);
a.Ye.push(e);return e}async function cs(a,b){b=ag([b],a.g.streaming.retryParameters);b.method="GET";var c=a.J;try{c.g.enabled&&Np(c,b,{ot:mq,su:!0})}catch(d){na("CMCD_TEXT_ERROR","Could not generate text CMCD data.",d)}return(await a.N.request(gg,b).promise).data}function ds(a,b,c,d){const e=ee(c);if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0,isMpegTs:!1},b=G(b),b=c.parseMedia(b,a,null,[]),kp(b,d);throw new H(2,2,2014,c);}
function es(a,b){a.Td.add(b);b.finally(()=>a.Td.delete(b))}function Rr(a,b,c){return(qj(b,c,.01)||c>b)&&a.Ve<b?(a.Ve=b,!0):!1}function Pr(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=wq("variantchanged",b);Ir(a,b)}function Qr(a,b,c){let d=!1;b&&b.audioId==c.audioId&&b.audioGroupId==c.audioGroupId||(d=!0);d&&Jr(a)}async function Ir(a,b){await Promise.resolve();a.l!=Dr&&a.dispatchEvent(b)}function Jr(a){const b=wq("audiotrackschanged");Ir(a,b)}
var Y=class extends Vf{constructor(a,b=null,c){super();this.l=fs;this.h=null;this.jc=b;this.wa=!1;this.be=new Ca;this.Qd=new Ca;this.m=new Ca;this.Sb=new Ca;this.pd=new Ca;this.C=this.G=this.A=this.N=null;this.ce=0;this.ba=new vq;this.O=this.ya=this.W=this.i=this.fc=this.H=this.j=this.Nd=this.S=this.wg=this.sa=this.J=this.Sa=this.Z=this.hc=this.P=this.Oa=this.K=this.Ob=null;this.X=!1;this.Wd=this.u=null;this.Vd=1E9;this.ae=[];this.ec=new Map;this.$d=[];this.Ve=-1;this.g=Bq(this);this.Ze=xn();this.T=
null;this.ee=-1;this.Qb=null;this.Ba={width:Infinity,height:Infinity};this.Ud=new Gh(this.g,this.Ba,null);this.Yd=[];this.o=null;this.L=this.g.adaptationSetCriteriaFactory();b={preferredAudio:this.g.preferredAudio,preferredVideo:this.g.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",
activeAudioCodec:"",activeAudioChannelCount:0,keySystem:this.keySystem()};zn(b);this.L.configure(b);this.Zd=this.g.preferredText[0]?.language||"";this.Xe=this.g.preferredText[0]?.role||"";this.We=this.g.preferredText[0]?.forced||!1;this.Rd=[];c&&c(this);this.J=new nq(this,this.g.cmcd);this.sa=new tq(this.g.cmsd);this.N=Cq(this);this.ma=this.qa=this.Ka=this.B=null;this.bf=!1;this.Ye=[];this.$e=new te(async()=>{this.qa&&(await this.Hb(this.ma,!0),await this.load(this.qa),this.bf?this.ma.pause():this.ma.play(),
this.qa=null,this.bf=!1)});gs&&(this.B=gs(this),this.B.configure(this.g.ads),this.pd.F(this.B,"ad-content-pause-requested",async d=>{this.$e.stop();if(!this.qa){this.ma=this.h;this.bf=this.Zc();d=d.saveLivePosition||!1;let e=!0;this.isLive()&&(e=d);this.qa=await this.Fg(!0,e)}}),this.pd.F(this.B,"ad-content-resume-requested",d=>{d=d.offset||0;if(this.qa){var e=this.qa;e.A&&d&&(typeof e.A==="number"?e.A+=d:e.A.setTime(e.A.getTime()+d*1E3))}this.$e.ha(.1)}),this.pd.F(this.B,"ad-content-attach-requested",
async()=>{!this.h&&this.ma&&(await this.Hb(this.ma,!0),this.ma=null)}));hs&&(this.Ka=hs(this),this.Ka.configure(this.g.queue));this.be.F(window,"online",()=>{Dq(this);this.fg()});this.Xd=new te(()=>{const d=Date.now()/1E3;let e=!1,f=!0;for(const g of this.i.variants)g.disabledUntilTime>0&&g.disabledUntilTime<=d&&(g.disabledUntilTime=0,e=!0),g.disabledUntilTime>0&&(f=!1);f&&this.Xd.stop();e&&Er(this,!1,void 0,!1,!1)});this.I=this.D=this.$a=null;this.Td=new Set;a&&(ma("Please migrate from initializing Player with a mediaElement; use the attach method instead."),
this.Hb(a,!0))}async destroy(){if(this.l!=Dr){Gq(this);var a=this.detach();this.l=Dr;await a;await this.mf();this.be&&(this.be.release(),this.be=null);this.Qd&&(this.Qd.release(),this.Qd=null);this.m&&(this.m.release(),this.m=null);this.Sb&&(this.Sb.release(),this.Sb=null);this.pd&&(this.pd.release(),this.pd=null);this.sa=this.J=this.jc=this.o=this.g=this.Wd=null;this.N&&(await this.N.destroy(),this.N=null);this.u&&(this.u.release(),this.u=null);this.Ka&&(this.Ka.destroy(),this.Ka=null);this.I&&(this.I.release(),
this.I=null);super.release()}}async Hb(a,b=!0){if(this.l==Dr)throw new H(2,7,7E3);const c=this.h&&this.h==a;this.h&&this.h!=a&&await this.detach();if(!await Jq(this,"attach"))try{c||(Iq(this,"attach"),this.Qd.F(a,"error",()=>{const d=gr(this,!1);d&&Wq(this,d)}),this.h=a,this.J&&this.J.setMediaElement(a)),A(),b&&$b()&&!this.G&&await Kq(this)}catch(d){throw await this.detach(),d;}finally{this.ba.release()}}Ah(a){this.wg=a}async detach(a=!1,b=!1){if(this.l==Dr)throw new H(2,7,7E3);await this.mc(!1,a,
b);if(!await Jq(this,"detach"))try{this.h&&(this.Qd.xa(),this.h=null),Iq(this,"detach"),this.B&&!a&&this.B.release()}finally{this.ba.release()}}async mc(a=!0,b=!1,c=!1){this.l!=Dr&&(this.l=fs);if(!await Jq(this,"unload")){try{this.X=!1;Iq(this,"unload");Gq(this);const d=this.Rd.map(f=>f());this.Rd=[];await Promise.all(d);const e=(new Map).set("isSwitchingContent",c);this.dispatchEvent(wq("unloading",e));this.hc&&(this.hc.release(),this.hc=null);this.Z&&(this.Z.release(),this.Z=null);this.Sa&&(this.Sa.release(),
this.Sa=null);this.h&&(this.m.xa(),this.Sb.xa());this.Xd.stop();this.Ob&&(this.Ob.release(),this.Ob=null);this.Oa&&(this.Oa.stop(),this.Oa=null);this.H&&(await this.H.stop(),this.fc=this.H=null);this.u&&this.u.stop();this.j&&(await this.j.destroy(),this.j=null);this.K&&(this.K.release(),this.K=null);this.C&&(this.C.release(),this.C=null);"webkit"===window.shakaMediaKeysPolyfill&&this.A&&(await this.A.destroy(),this.A=null);this.G&&(await this.G.destroy(),this.G=null);if(this.B&&!b)this.B.onAssetUnload();
this.qa&&!b&&(this.qa.destroy(),this.qa=null);b||this.$e.stop();this.J&&vp(this.J);this.sa&&(this.sa.g=null);this.D&&(await this.D.destroy(),this.D=null);this.wa=!1;this.I&&this.I.disable();this.Td.clear();if(this.h){for(const f of this.Ye)f.src.startsWith("blob:")&&URL.revokeObjectURL(f.src),f.remove();this.Ye=[];cj(this.h)&&this.h.load()}this.A&&(await this.A.destroy(),this.A=null);this.$a&&this.W!=this.$a.Cc()&&(this.$a.l||this.$a.destroy(),this.$a=null);this.P=this.ya=this.W=null;if(this.i){for(const f of this.i.variants)for(const g of[f.audio,
f.video])g&&g.segmentIndex&&g.segmentIndex.release();for(const f of this.i.textStreams)f.segmentIndex&&f.segmentIndex.release()}this.g&&this.g.streaming.clearDecodingCache&&(Ye.clear(),rb.clear());this.i=null;this.o=new Pn;this.T=this.Qb=this.ug=null;this.ee=-1;this.ae=[];for(const f of this.ec.values())f.stop();this.ec.clear();this.$d=[];this.Ve=-1;this.N&&this.N.Cg();Oq(this)}finally{this.ba.release()}A();a&&$b()&&!this.G&&this.h&&await Kq(this)}}tj(a){this.O=a}async load(a,b=null,c){if(this.l==
Dr)throw new H(2,7,7E3);!this.h&&this.ma&&(await this.Hb(this.ma,!0),this.ma=null);let d=null,e="";c=c?.toLowerCase();if(a instanceof ko){if(a.l)throw new H(2,7,7006);d=a;e=d.Cc()||""}else e=a||"";await uq(this.ba,"load");this.ba.release();if(!this.h)throw new H(2,7,7002);this.W&&(this.W=e,await this.mc(!1,!1,!0));const f=++this.ce,g=async()=>{if(this.ce!=f)throw d&&await d.destroy(),new H(2,7,7E3);};a=async(h,k)=>{try{await uq(this.ba,k),await g(),await h(),await g(),d&&this.g&&(d.i=this.g)}finally{this.ba.release()}};
try{b==null&&d&&(b=d.getStartTime());this.O=b;this.X=!1;this.dispatchEvent(wq("loading"));d?c=d.oe():c||await a(async()=>{c=await Qq(this,e)},"guessMimeType_");const h=!!d;d?(Tn(d,this),this.o=d.getStats()):(d=await Rq(this,e,b,c,!0,this.g))?(d.G=!1,Tn(d,this),this.o=d.getStats(),d.start(),d.C.promise.catch(()=>{})):this.o=new Pn;b=!d;const k=Date.now()/1E3;this.o=d?d.getStats():new Pn;this.W=e;this.ya=c||null;Oq(this);const l=()=>{const m=this.h?this.h.buffered:null;return{start:Wi(m)||0,end:Xi(m)||
0}};this.Z=new Cl(l);this.Z.addEventListener("regionadd",m=>{Uq(this,m.region,"metadataadded")});if(b)await a(async()=>{await Vq(this,c)},"initializeSrcEqualsDrmInner_"),await a(async()=>{await Xq(this,k,c)},"srcEqualsInner_");else{this.Sa=new Cl(l);await a(async()=>{await Promise.race([d.Z.promise,d.C.promise]);this.fc=d.I;var r=d;r.ba=!0;this.H=r.o;this.i=d.Hf()},"waitForFinish");this.G||await a(async()=>{await Kq(this)},"initializeMediaSourceEngineInner_");await a(async()=>{await d.C.promise},
"waitForFinish");this.g=d.getConfiguration();this.Ud=d.H;this.H&&this.H.setMediaElement&&this.h&&this.H.setMediaElement(this.h);this.hc=Un(d);this.Nd=d.Ba;const m=d.m;m&&(this.L=m);h&&this.h&&this.h.nodeName==="AUDIO"&&(kr(this),this.configure("manifest.disableVideo",!0));d.j||await a(async()=>{await ao(d,this.h)},"drmEngine_.init");this.A=Vn(d);await a(async()=>{await this.A.Hb(this.h)},"drmEngine_.attach");if(this.L){const r=this.L.getConfiguration();r.keySystem=this.keySystem();this.L.configure(r)}const n=
this.g.abrFactory;this.u&&this.Wd==n||(this.Wd=n,this.u&&this.u.release(),this.u=n(),this.u.configure(this.g.abr));const p=Wn(d),q=d.h;await a(async()=>{await lr(this,k,q,p)},"loadInner_");Sn(d);this.ya&&A().Ba()&&ae(this.ya)&&Rj(this.G,this.W,this.ya)}this.dispatchEvent(wq("loaded"))}catch(h){throw h&&h.code!=7E3&&await this.mc(!1),h;}finally{d&&await d.destroy(),this.$a=null}}async rh(a=!0,b=!1,c=!1,d=!1){c=await yr(this,c);await this.mc(a,b,d);return c}async Fg(a=!1,b=!1,c=!1){b=await yr(this,
b);await this.detach(a,c);return b}async preload(a,b=null,c,d){c=c?.toLowerCase();const e=Bq(this);yn(e,d||this.g,Bq(this));(a=await Rq(this,a,b,c,!1,e))?a.start():Wq(this,new H(2,7,7005));return a}async mf(){const a=[];for(const b of this.Yd)b.l||a.push(b.destroy());this.Yd=[];await Promise.all(a)}Zi(){for(var a=this.ba;a.g;)a.release()}Qc(a){return new vh(a)}configure(a,b){const c=this.getConfiguration();arguments.length==2&&typeof a=="string"&&(a=Vm(a,b));if(a.manifest&&a.manifest.dash&&"disableXlinkProcessing"in
a.manifest.dash){var d=new Cf(6,0),e=Hf,f=e.g;const g=d.h-f.h;((d.g-f.g||g)>0?e.i:e.h)(e.g,d,"manifest.dash.disableXlinkProcessing configuration","It is now automatically detected if the manifest has Xlink.");delete a.manifest.dash.disableXlinkProcessing}Aq(a);d=yn(this.g,a,Bq(this));Sr(this,c);return d}Jh(a){this.Ze=a}getConfiguration(){const a=Bq(this);yn(a,this.g,Bq(this));return a}Vh(){return this.Ze}Mg(){const a=Bq(this);yn(a,this.g,Bq(this));return Xm(this.g,Bq(this))}Ig(){if(this.h){var a=
this.h.buffered.length;a=a?this.h.buffered.end(a-1):0;const b=Math.min(this.h.currentTime+this.g.streaming.bufferingGoal,this.Ea().end);if(a>=b)return 1;if(!(a<=this.h.currentTime)&&a<b)return(a-this.h.currentTime)/(b-this.h.currentTime)}return 0}dh(){const a=this.getConfiguration();for(const b in this.g)delete this.g[b];yn(this.g,Bq(this),Bq(this));Sr(this,a)}Vc(){return this.l}Kg(){return this.i?this.i.type:null}ob(){return this.h}pb(){return this.N}Cc(){return this.W}oe(){return this.ya}Ph(){return Array.from(this.Z?.i()||
[])}Oh(){return Array.from(this.Sa?.i()||[])}Rh(){return Array.from(this.hc?.i()||[])}td(){return this.B?this.B:null}Og(){return this.Ka?this.Ka:null}isLive(){return this.i&&!this.za()?this.i.presentationTimeline.isLive():this.h&&(this.h.src||this.za())?this.h.duration==Infinity:!1}$c(){return this.i?this.i.presentationTimeline.$c():!1}ua(){return this.isLive()||this.$c()}xi(){if(this.i&&!this.za()){const a=this.i.variants;return a.length?!a[0].video:!1}return this.h&&(this.h.src||this.za())?this.h.videoTracks?
this.h.videoTracks.length==0:this.h.videoHeight==0:!1}Tg(){if(this.i&&!this.za()){var a=this.i.variants;if(!a.length)return!1;a=a[0];return a.audio||!a.video?!1:!a.video.codecs.includes(",")}return this.h&&(this.h.src||this.za())&&this.h.audioTracks?this.h.audioTracks.length==0:!1}Ea(){if(this.i&&!this.za()){if(!this.X&&this.i.type=="HLS")return{start:0,end:0};var a=this.i.presentationTimeline;return{start:a.Ab(),end:a.rb()}}if(this.h&&(this.h.src||this.za())&&(a=this.h.seekable)&&a.length){var b=
this.g?this.g.playRangeStart:0;b=Math.max(a.start(0),b);const c=this.g?this.g.playRangeEnd:Infinity;a=Math.min(a.end(a.length-1),c);return{start:b,end:a}}return{start:0,end:0}}ti(){this.ua()&&(this.h.currentTime=this.Ea().end)}Rg(){return this.X}keySystem(){return jb(this.drmInfo())}drmInfo(){return this.A?this.A.g:null}vd(){return this.A?this.A.vd():Infinity}Gf(){return this.A?this.A.Gf():[]}ag(a){this.A&&this.A.ag(a)}async eg(a,b){return this.A?await this.A.eg(a,b):!1}me(){return this.A?this.A.me():
{}}Lf(){return this.P?this.P.g==yh:!!this.W}qb(){return this.h?this.K?this.K.h:1:0}rg(a){this.l==Eq&&this.j&&xm(this.j,a)}Md(a,b=!0){if(a==0)ma("A trick play rate of 0 is unsupported!");else{var c=this.h.playbackRate,d=this.K.h;this.K.set(a);this.l==Eq&&(this.u.playbackRateChanged(a),this.rg(b&&a!=1));Gr(this,a);c===0&&this.h.playbackRate===0&&a!=d&&Fr(this)}}rd(){const a=this.K.Uc();this.l==cr&&this.K.set(a);this.l==Eq&&(this.K.set(a),this.u.playbackRateChanged(a),this.rg(!1));this.Sb.xa()}Dc(){if(this.i&&
!this.za()){var a=this.j?this.j.o:null;const b=[];let c=0;for(const d of this.i.variants){if(!kf(d))continue;const e=bf(d);e.active=d==a;e.active||c==1||a==null||d.video!=a.video||d.audio!=a.audio||(e.active=!0);e.active&&c++;b.push(e)}return b}if(this.h&&this.h.audioTracks){const b=Tr(this);a=Array.from(this.h.audioTracks);return a.length?a.map(c=>jf(c,b)):b?[jf(null,b)]:[]}return[]}ub(){if(this.i){if(this.za())return[];var a=this.j?this.j.B:null;const b=[];for(const c of this.i.textStreams){const d=
cf(c);d.active=c==a;b.push(d)}this.I&&b.push(...this.I.ub());return b}if(this.h&&this.h.src&&this.h.textTracks){a=ar(this);const b=this.D.isTextVisible();a=a.map(c=>hf(c,b));this.I&&a.push(...this.I.ub());return a}return[]}$h(){let a=this.ae;this.i&&(a=this.i.imageStreams);return a.map(b=>df(b))}async Qh(a){const b=await Ur(this,a);if(!b)return null;const c=[];b.segmentIndex.yb(d=>{const e=Vr(d.tilesLayout||b.tilesLayout);if(e){const f=e.rows*e.columns,g=(d.j-d.startTime)/f;for(let h=0;h<f;h++){const k=
Wr(d,b,d.startTime+h*g,e);if(!k)break;c.push(k)}}});return c}async ni(a,b){a=await Ur(this,a);if(!a)return null;var c=a.segmentIndex.find(b);if(c==null)return null;c=a.segmentIndex.get(c);const d=Vr(c.tilesLayout||a.tilesLayout);return d?Wr(c,a,b,d):null}lc(a){var b=!1;this.I&&a&&(b=this.I.ub().includes(a));this.I&&!b&&this.I.disable();if(!a||b)this.I&&b&&a&&this.I.enable(a),Hr(this),Xr(this,!1);else{b=()=>{const c=this.i.textStreams.find(d=>d.id==a.id);c?c!=this.j.B&&(En(this.o.j,c,!1),zm(this.j,
c),Hr(this),vr(this),this.Zd=c.language,Xr(this,!0)):this.za()};if(this.i&&this.C&&(b(),!this.za()))return;(()=>{if(this.h&&this.h.textTracks){var c=ar(this);const e=c.find(f=>ff(f)===a.id);if(e){if(this.D instanceof Jo)for(var d of c)c=d===e?this.wa?"showing":"hidden":"disabled",d.mode!==c&&(d.mode=c);else d=c.find(f=>f.mode!=="disabled"),d!==e&&(d&&(d.mode="disabled",this.m.Ma(d,"cuechange"),this.D.remove(0,Infinity)),e&&er(this,e));Hr(this);vr(this);Xr(this,!0)}}})()}}gg(a,b=!1,c=0){const d=()=>
{var e=this.i.variants.find(g=>g.id==a.id);if(e){if(kf(e)){var f=this.j.o;this.g.abr.enabled&&(f.video!=e.video||f.audio&&e.audio&&f.audio.language==e.audio.language&&f.audio.channelsCount==e.audio.channelsCount&&f.audio.label==e.audio.label)&&ma("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");this.za()?sr(this,e,!1,!1,0):sr(this,e,!1,b||!1,c||0);e={preferredAudio:[{language:e.language||
"",role:e.audio&&e.audio.roles&&e.audio.roles[0]||"",label:e.audio&&e.audio.label||"",channelCount:e.audio&&e.audio.channelsCount||0,codec:e.audio&&e.audio.codecs||"",spatialAudio:e.audio&&e.audio.spatialAudio?e.audio.spatialAudio:!1}],preferredVideo:[{label:e.video&&e.video.label||"",role:e.video&&e.video.roles&&e.video.roles[0]||"",codec:e.video&&e.video.codecs||"",hdrLevel:e.video&&e.video.hdr||"",layout:e.video&&e.video.videoLayout||""}],language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",
spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:e.audio&&e.audio.codecs?e.audio.codecs:"",activeAudioCodec:f.audio&&f.audio.codecs?f.audio.codecs:"",activeAudioChannelCount:f.audio&&f.audio.channelsCount?f.audio.channelsCount:0,keySystem:this.keySystem()};zn(e);this.L.configure(e);Fq(this)}}else this.za()};if(this.i&&this.C&&(d(),!this.za()))return;(()=>{if(a.originalAudioId&&
this.h&&this.h.audioTracks){const e=Array.from(this.h.audioTracks);for(const f of e)if(ff(f)==a.id){Yr(this,f);break}}})()}fj(a,b=0){const c=(e,f)=>{if(e!=f&&this.g.accessibility.handleForcedSubtitlesAutomatically){var g=this.ub(),h=g.find(l=>l.active),k=h?ye(h.language):null;e=ye(e);f=ye(f);if(!h||k==e&&k!=f&&h.forced)g=mf(g,f,"",!0),g.length&&this.lc(g[0])}},d=()=>{const e=this.L.getConfiguration();e.audioCodec=a.codecs||"";e.preferredAudio=[{language:a.language,role:a.roles[0]||"",label:a.label||
"",channelCount:a.channelsCount||0,codec:"",spatialAudio:a.spatialAudio}];var f=this.j.o;if(f=f&&f.audio)e.activeAudioCodec=f.codecs||"",e.activeAudioChannelCount=f.channelsCount||0,c(f.language,a.language);zn(e);this.L.configure(e);Er(this,!0,b,!1,!1)};if(this.i&&this.C&&(d(),!this.za()))return;(()=>{if(this.h&&this.h.audioTracks){const f=ye(a.language);var e=Array.from(this.h.audioTracks);let g=null,h=null;for(const k of e)e=k.language||"und",g||k.label!=a.label||ye(e)!=f||k.kind!=a.roles[0]||(g=
k),k.enabled&&(h=k);g&&(h&&c(h.language,g.language),Yr(this,g))}})()}getAudioTracks(){if(this.i&&!this.za()){var a=this.Dc();if(!a.length)return[];const c=a.find(d=>d.active);if(!c)return[];var b=a;this.l!=Eq||this.za()||(b=a.filter(d=>d.originalVideoId===c.originalVideoId&&(d.audioCodec||Sd.includes(d.audioMimeType||""))));if(!b.length)return[];a=new Map;for(const d of b){b=[d.language,d.originalLanguage,d.label||"",(d.audioRoles||[]).join(","),d.channelsCount,d.spatialAudio,d.audioCodec||"",d.accessibilityPurpose||
""].join("_");const e={active:d.active,language:d.language,label:d.label,mimeType:d.audioMimeType,codecs:d.audioCodec,primary:d.primary,roles:d.audioRoles||[],accessibilityPurpose:d.accessibilityPurpose,channelsCount:d.channelsCount,audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,originalLanguage:d.originalLanguage};a.has(b)?!a.get(b).active&&e.active&&a.set(b,e):a.set(b,e)}return Array.from(a.values())}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map(c=>{var d=
c.language;d={active:c.enabled,language:ye(d||"und"),label:c.label,mimeType:null,codecs:null,primary:c.kind=="main",roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:d};c.kind&&(c.kind=="description"&&(d.accessibilityPurpose="visually impaired"),d.roles.push(c.kind));c.configuration&&(c.configuration.codec&&(d.codecs=c.configuration.codec),c.configuration.sampleRate&&(d.audioSamplingRate=c.configuration.sampleRate),c.configuration.numberOfChannels&&
(d.channelsCount=c.configuration.numberOfChannels));return d}):[]}gj(a,b=!1,c=0){var d=this.Dc();if(d.length){var e=d.find(g=>g.active);if(e){d=d.filter(g=>(g.videoBandwidth||g.bandwidth)==a.bandwidth&&g.width==a.width&&g.height==a.height&&g.frameRate==a.frameRate&&g.pixelAspectRatio==a.pixelAspectRatio&&g.hdr==a.hdr&&g.colorGamut==a.colorGamut&&g.videoLayout==a.videoLayout&&g.videoMimeType==a.mimeType&&g.videoCodec==a.codecs&&za(g.videoRoles,a.roles)&&g.videoLabel==a.label);var f;d.length==1?f=d[0]:
f=d.find(g=>g.audioId===e.audioId);f||=d.find(g=>g.language==e.language&&g.label===e.label&&g.channelsCount===e.channelsCount&&g.spatialAudio===e.spatialAudio&&g.audioMimeType===e.audioMimeType&&Wd(g.audioCodec||"")===Wd(e.audioCodec||"")&&za(g.audioRoles,e.audioRoles));f&&!f.active&&this.gg(f,b,c)}}}getVideoTracks(){if(this.l==cr||this.za())return[];var a=this.Dc();if(!a.length)return[];const b=a.find(d=>d.active);if(!b)return[];var c=a;this.Tg()||(c=a.filter(d=>d.videoCodec&&d.audioGroupId===b.audioGroupId&&
d.originalAudioId===b.originalAudioId?d.audioId===b.audioId?!0:d.language===b.language&&d.label===b.label&&d.channelsCount===b.channelsCount&&d.spatialAudio===b.spatialAudio&&d.audioMimeType===b.audioMimeType&&Wd(d.audioCodec||"")===Wd(b.audioCodec||"")&&za(d.audioRoles,b.audioRoles):!1));if(!c.length)return[];a=new Map;for(const d of c)(c=d.originalVideoId)||d.videoId==null||(c=String(d.videoId)),c&&a.set(c,{active:d.active,bandwidth:d.videoBandwidth||d.bandwidth,width:d.width,height:d.height,frameRate:d.frameRate,
pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,colorGamut:d.colorGamut,videoLayout:d.videoLayout,mimeType:d.videoMimeType,codecs:d.videoCodec,roles:d.videoRoles||[],label:d.videoLabel});return Array.from(a.values())}Uh(){var a=this.$d;this.i&&(a=this.i.chapterStreams);a=a.map(c=>ef(c));const b=Zr(this);b.length&&a.push(...b.map(c=>({id:ff(c),type:"chapter",bandwidth:0,language:ye(c.language||"und")})));return a}async Th(a){var b=$r(this,a);if(b.length)return b;b=this.$d;this.i&&(b=this.i.chapterStreams);
if(!b.length)return[];const c=ye(a);a=b.filter(f=>ye(f.language)==c);if(!a.length)return[];const d=[],e=new Set;for(const f of a){f.segmentIndex||await f.createSegmentIndex();let g=0;this.isLive()&&this.i?.type==="HLS"&&(a=this.i.presentationTimeline,g=Math.max(0,a.j??a.h));f.segmentIndex.yb(h=>{const k=h.getMetadata();if(k){var l=k.title,m=h.startTime+"-"+h.endTime+"-"+l;g>0&&h.endTime-g<0&&(g=0);h={id:m,title:l,startTime:Math.max(0,h.startTime-g),endTime:Math.max(0,h.endTime-g),images:k.images};
e.has(m)||(d.push(h),e.add(m))}})}return d}ei(){let a;if(this.C)a=this.C.m();else{if(this.O==null)return new Date;if(this.O instanceof Date)return this.O;a=this.O}if(this.i&&!this.za()){var b=this.i.presentationTimeline;return new Date(((b.j||b.h)+a)*1E3)}return this.h&&this.h.getStartDate?(b=this.h.getStartDate(),b instanceof Date&&!isNaN(b.getTime())?new Date(b.getTime()+a*1E3):null):null}Ng(){if(this.i&&!this.za()){var a=this.i.presentationTimeline;a=a.j||a.h;return a===null?null:new Date(a*1E3)}return this.h&&
this.h.getStartDate?(a=this.h.getStartDate(),a instanceof Date&&!isNaN(a.getTime())?a:null):null}pe(){return this.isLive()?this.i?this.i.presentationTimeline.pe():null:null}tc(){if(this.l==Eq)return this.G.tc();const a={total:[],audio:[],video:[],text:[]};this.l==cr&&(a.total=$i(this.h.buffered));return a}getBandwidthEstimate(){return this.u?this.u.getBandwidthEstimate():NaN}getStats(){if(this.l!=Eq&&this.l!=cr)return{width:NaN,height:NaN,currentCodecs:"",streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,
corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,manifestGapCount:NaN,switchHistory:[],stateHistory:[]};Pq(this);var a=this.h,b=a.currentTime/a.duration;isNaN(b)||this.ua()||Jn(this.o,Math.round(100*b));
this.C&&(this.o.P=this.C.D(),this.o.S=this.C.G());a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),Gn(this.o,Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.o.L=Number(b.corruptedVideoFrames));Kn(this.o,this.A?qh(this.A):NaN);Hn(this.o,a.videoWidth||NaN,a.videoHeight||NaN);this.o.l="";this.ua()&&(a=kq(this),a!=null&&Ln(this.o,a/1E3));b=this.Dc().find(c=>c.active);a=this.ub().find(c=>c.active);if(b){if(b.bandwidth){const c=this.K?this.K.h:1;let d=c*b.bandwidth;a&&a.bandwidth&&
(d+=c*a.bandwidth);this.o.A=d}b.width&&b.height&&Hn(this.o,b.width||NaN,b.height||NaN);b=b.codecs;a&&(b+=","+(a.codecs||a.mimeType));b&&(this.o.l=b)}this.l!=Eq||this.za()||(this.i&&(this.o.H=this.i.periodCount,this.o.G=this.i.gapCount,this.i.presentationTimeline&&Mn(this.o,this.i.presentationTimeline.i)),a=this.u.getBandwidthEstimate(),this.o.u=a);this.l==cr&&Nn(this.o,NaN);return On(this.o)}Gb(a,b,c,d,e,f,g=!1){const h=(async()=>{if(this.l!=Eq&&this.l!=cr)throw new H(1,7,7004);c!="subtitles"&&c!=
"captions"&&ma("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");d||=await as(this,a);var k=[];this.B&&(k=this.B.getCuePoints());if(this.l==cr){var l=A();g&&l.h()==="WEBKIT"&&(c="forced");k=await bs(this,a,b,c,d,f||"",k);if(k.track)return xr(this),Hr(this),hf(k.track,this.D.isTextVisible());throw new H(1,2,2012);}l=this.Ea();l=l.end-l.start;this.i&&(l=this.i.presentationTimeline.getDuration());if(l==Infinity)throw new H(1,4,4033);if(k.length){const m=await cs(this,
a);k=ds(this,m,d,k);a=Oj(new Blob([k],{type:"text/vtt"}));d="text/vtt"}k={id:this.Vd++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:kl(0,l,[a]),mimeType:d||"",codecs:e||"",supplementalCodecs:"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:K,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!!g,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,
accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Rd(d||"",e||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};l=Rd(k.mimeType,k.codecs);if(!fe(l))throw new H(2,2,2014,d);this.i.textStreams.push(k);xr(this);Hr(this);return cf(k)})();this.X||es(this,h);return h}Zb(a,b){const c=(async()=>{if(this.l!=Eq&&this.l!=cr)throw new H(1,7,7004);b||=await as(this,a);if(b!="text/vtt")throw new H(1,2,2017,a);var d=this.Ea(),e=d.end-d.start;this.i&&(e=this.i.presentationTimeline.getDuration());
if(e==Infinity)throw new H(1,4,4045);d=await cs(this,a);var f=ee(b);if(!f)throw new H(2,2,2014,b);f=f();e={periodStart:0,segmentStart:0,segmentEnd:e,vttOffset:0,isMpegTs:!1};d=G(d);f=f.parseMedia(d,e,a,[]);d=[];for(const g of f){let h=null;f=new Q(g.startTime,g.endTime,()=>{h==null&&(h=Kb([a],[g.payload]));return h||[]},0,null,null,0,0,Infinity);g.payload.includes("#xywh")&&(e=g.payload.split("#xywh=")[1].split(","),e.length===4&&f.Re({height:parseInt(e[3],10),positionX:parseInt(e[0],10),positionY:parseInt(e[1],
10),width:parseInt(e[2],10)}));d.push(f)}f=b;d.length&&(f=await as(this,d[0].R()[0]));d={id:this.Vd++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ll(d),mimeType:f||"",codecs:"",supplementalCodecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,
closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Rd(f||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};this.l==cr?this.ae.push(d):this.i.imageStreams.push(d);xr(this);return df(d)})();this.X||es(this,c);return c}Yb(a,b,c){const d=(async()=>{if(this.l!=Eq&&this.l!=cr)throw new H(1,7,7004);c||=await as(this,a);var e=this.Ea(),f=e.end-e.start;this.i&&(f=this.i.presentationTimeline.getDuration());if(f==Infinity)throw new H(1,4,4055);
var g=ee(c);if(!g)throw new H(2,2,2014,c);e=await cs(this,a);g=g();f={periodStart:0,segmentStart:0,segmentEnd:f,vttOffset:0,isMpegTs:!1};e=G(e);g=g.parseMedia(e,f,a,[]);e=[];for(var h of g)g=new Q(h.startTime,h.endTime,()=>[],0,null,null,0,0,Infinity),g.Qe({title:h.payload,images:[]}),e.push(g);h={id:this.Vd++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ll(e),mimeType:"text/plain",codecs:"",supplementalCodecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,
language:b,originalLanguage:b,label:null,type:"chapter",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Rd("text/plain","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};this.l==Eq?this.i.chapterStreams.push(h):this.$d.push(h);xr(this);return ef(h)})();this.X||es(this,d);return d}lj(a,b){this.Ba.width=
a;this.Ba.height=b}fg(a=.1){if(this.l==Eq){var b=this.j;if(b.l.g)a=!1;else if(b.D)a=!1;else{for(const c of b.h.values())!c.Yc||c.Ia||c.fb||(c.Yc=!1,om(b,c,a));a=!0}}else a=!1;return a}Hf(){ma("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees.  It may change at any time!  Please consider filing a feature request for whatever you use getManifest() for.");return this.i}bi(){return this.fc}Yh(){const a={video:null,audio:null,text:null};if(this.l!=
Eq)return a;var b=this.j.o;const c=this.j.B,d=this.h.currentTime;for(const e of[b.video,b.audio,c]){if(!e||!e.segmentIndex)continue;b=e.segmentIndex.find(d);b=e.segmentIndex.get(b);b={codecs:b?.codecs??e.codecs,mimeType:b?.mimeType??e.mimeType,bandwidth:b?.bandwidth??e.bandwidth};e.type=="video"?(b.width=e.width,b.height=e.height,a.video=b):e.type=="audio"?a.audio=b:e.type==K&&(a.text=b)}return a}nh(a){this.jc=a}disableStream(a,b){if(!this.g.abr.enabled||this.l===Dr||!navigator.onLine||b==0||!this.i)return!1;
if(this.i.variants.some(c=>{const d=c[a.type];return d&&d.id!==a.id&&!c.disabledUntilTime?a.type=="audio"?a.language===d.language:!0:!1})){let c=!1,d=!1;for(const e of this.i.variants){const f=e[a.type];f&&(f.id===a.id?(e.disabledUntilTime=Date.now()/1E3+b,c=!0):f.trickModeVideo&&f.trickModeVideo.id==a.id&&(d=!0))}if(!c&&d)return!1;this.Xd.Aa(1);({video:b}=this.tc());b=b.reduce((e,{start:f,end:g})=>e+g-f,0);Er(this,!1,b,!0,!1);return!0}return!1}addFont(a,b){return hj(a,b)}za(){if(!this.h)return!1;
const a=uh(A(),this.h);return a?a.state!="disconnected":!1}Zc(){return!this.h||this.h.ended?!0:this.X&&!this.ua()&&this.h.currentTime>=this.Ea().end}};w("shaka.Player",Y);Y.prototype.isEnded=Y.prototype.Zc;Y.prototype.isRemotePlayback=Y.prototype.za;Y.prototype.addFont=Y.prototype.addFont;Y.prototype.setVideoContainer=Y.prototype.nh;Y.prototype.getFetchedPlaybackInfo=Y.prototype.Yh;Y.prototype.getManifestParserFactory=Y.prototype.bi;Y.prototype.getManifest=Y.prototype.Hf;
Y.prototype.retryStreaming=Y.prototype.fg;Y.prototype.setMaxHardwareResolution=Y.prototype.lj;Y.prototype.addChaptersTrack=Y.prototype.Yb;Y.prototype.addThumbnailsTrack=Y.prototype.Zb;Y.prototype.addTextTrackAsync=Y.prototype.Gb;Y.prototype.getStats=Y.prototype.getStats;Y.prototype.getBufferedInfo=Y.prototype.tc;Y.prototype.getSegmentAvailabilityDuration=Y.prototype.pe;Y.prototype.getPresentationStartTimeAsDate=Y.prototype.Ng;Y.prototype.getPlayheadTimeAsDate=Y.prototype.ei;
Y.prototype.getChaptersAsync=Y.prototype.Th;Y.prototype.getChaptersTracks=Y.prototype.Uh;Y.prototype.getVideoTracks=Y.prototype.getVideoTracks;Y.prototype.selectVideoTrack=Y.prototype.gj;Y.prototype.getAudioTracks=Y.prototype.getAudioTracks;Y.prototype.selectAudioTrack=Y.prototype.fj;Y.prototype.selectVariantTrack=Y.prototype.gg;Y.prototype.selectTextTrack=Y.prototype.lc;Y.prototype.getThumbnails=Y.prototype.ni;Y.prototype.getAllThumbnails=Y.prototype.Qh;Y.prototype.getImageTracks=Y.prototype.$h;
Y.prototype.getTextTracks=Y.prototype.ub;Y.prototype.getVariantTracks=Y.prototype.Dc;Y.prototype.cancelTrickPlay=Y.prototype.rd;Y.prototype.trickPlay=Y.prototype.Md;Y.prototype.useTrickPlayTrackIfAvailable=Y.prototype.rg;Y.prototype.getPlaybackRate=Y.prototype.qb;Y.prototype.isBuffering=Y.prototype.Lf;Y.prototype.getKeyStatuses=Y.prototype.me;Y.prototype.retryLicensing=Y.prototype.eg;Y.prototype.renewLicense=Y.prototype.ag;Y.prototype.getActiveSessionsMetadata=Y.prototype.Gf;
Y.prototype.getExpiration=Y.prototype.vd;Y.prototype.drmInfo=Y.prototype.drmInfo;Y.prototype.keySystem=Y.prototype.keySystem;Y.prototype.isFullyLoaded=Y.prototype.Rg;Y.prototype.goToLive=Y.prototype.ti;Y.prototype.seekRange=Y.prototype.Ea;Y.prototype.isVideoOnly=Y.prototype.Tg;Y.prototype.isAudioOnly=Y.prototype.xi;Y.prototype.isDynamic=Y.prototype.ua;Y.prototype.isInProgress=Y.prototype.$c;Y.prototype.isLive=Y.prototype.isLive;Y.prototype.getQueueManager=Y.prototype.Og;Y.prototype.getAdManager=Y.prototype.td;
Y.prototype.getAllTimelineRegions=Y.prototype.Rh;Y.prototype.getAllEmsgRegions=Y.prototype.Oh;Y.prototype.getAllMetadataRegions=Y.prototype.Ph;Y.prototype.getMimeType=Y.prototype.oe;Y.prototype.getAssetUri=Y.prototype.Cc;Y.prototype.getNetworkingEngine=Y.prototype.pb;Y.prototype.getMediaElement=Y.prototype.ob;Y.prototype.getManifestType=Y.prototype.Kg;Y.prototype.getLoadMode=Y.prototype.Vc;Y.prototype.resetConfiguration=Y.prototype.dh;Y.prototype.getBufferFullness=Y.prototype.Ig;
Y.prototype.getNonDefaultConfiguration=Y.prototype.Mg;Y.prototype.getConfigurationForLowLatency=Y.prototype.Vh;Y.prototype.getConfiguration=Y.prototype.getConfiguration;Y.prototype.configurationForLowLatency=Y.prototype.Jh;Y.prototype.configure=Y.prototype.configure;Y.prototype.releaseAllMutexes=Y.prototype.Zi;Y.prototype.destroyAllPreloads=Y.prototype.mf;Y.prototype.preload=Y.prototype.preload;Y.prototype.detachAndSavePreload=Y.prototype.Fg;Y.prototype.unloadAndSavePreload=Y.prototype.rh;
Y.prototype.load=Y.prototype.load;Y.prototype.updateStartTime=Y.prototype.tj;Y.prototype.unload=Y.prototype.mc;Y.prototype.detach=Y.prototype.detach;Y.prototype.attachCanvas=Y.prototype.Ah;Y.prototype.attach=Y.prototype.Hb;Y.probeSupport=async function(a=!0){let b={};a&&(b=await Jg());a=Zb();const c=Mj(),d=await A().o(),e={manifest:a,media:c,drm:b,hardwareResolution:d};yq.forEach((f,g)=>{e[g]=f()});return e};
Y.isBrowserSupported=function(){window.Promise||ma("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return!1;A();return $b()?!0:ac("application/x-mpegurl")};Y.setQueueManagerFactory=function(a){hs=a};Y.setAdManagerFactory=function(a){gs=a};Y.registerSupportPlugin=xq;Y.prototype.destroy=Y.prototype.destroy;var Dr=0,fs=1,Eq=2,cr=3;
Y.LoadMode={DESTROYED:Dr,NOT_LOADED:fs,MEDIA_SOURCE:Eq,SRC_EQUALS:cr};Y.version="v5.1.10";var Ff;const is=["5","1"];Ff=new Cf(Number(is[0]),Number(is[1]));Hf=new Gf;var yq=new Map,gs=null,hs=null;function js(a){return a.g.length?a.g.reduce((b,c)=>b+c,0)/a.g.length:0}var ks=class{constructor(){this.g=[];this.i=this.m=this.l=this.j=this.h=0}};var ls=class extends Bf{constructor(a,b,c){super(c);this.g=a;this.h=b;this.i=!1;this.j=this.h.getVolume();this.l=new Ca;this.l.F(this.h,google.ima.AdEvent.Type.PAUSED,()=>{this.i=!0});this.l.F(this.h,google.ima.AdEvent.Type.RESUMED,()=>{this.i=!1})}needsSkipUI(){return!1}hasCustomClick(){return!0}isUsingAnotherMediaElement(){return!0}getDuration(){return this.g.getDuration()}getMinSuggestedDuration(){return this.g.getMinSuggestedDuration()}getRemainingTime(){return this.h.getRemainingTime()}isPaused(){return this.i}isSkippable(){return this.g.getSkipTimeOffset()>=
0}getTimeUntilSkippable(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)}canSkipNow(){return this.h.getAdSkippableState()}skip(){return this.h.skip()}pause(){return this.h.pause()}play(){return this.h.resume()}getVolume(){return this.h.getVolume()}setVolume(a){this.video.volume=a;return this.h.setVolume(a)}isMuted(){return this.h.getVolume()==0}isLinear(){return this.g.isLinear()}resize(a,b){this.h.resize(a,b)}setMuted(a){(this.video.muted=a)?(this.j=this.getVolume(),
this.h.setVolume(0)):this.h.setVolume(this.j)}getSequenceLength(){const a=this.g.getAdPodInfo();return a==null?1:a.getTotalAds()}getPositionInSequence(){const a=this.g.getAdPodInfo();return a==null?1:a.getAdPosition()}getTitle(){return this.g.getTitle()}getDescription(){return this.g.getDescription()}getVastMediaBitrate(){return this.g.getVastMediaBitrate()}getVastMediaHeight(){return this.g.getVastMediaHeight()}getVastMediaWidth(){return this.g.getVastMediaWidth()}getAdId(){return this.g.getAdId()}getCreativeAdId(){return this.g.getCreativeAdId()}getAdvertiserName(){return this.g.getAdvertiserName()}getMediaUrl(){return this.g.getMediaUrl()}getTimeOffset(){const a=
this.g.getAdPodInfo();return a==null?0:a.getTimeOffset()}getPodIndex(){const a=this.g.getAdPodInfo();return a==null?0:a.getPodIndex()}release(){this.h=this.g=null}};w("shaka.ads.ClientSideAd",ls);function ms(a,b){const c=[];for(const p of Mc(a,"Ad")){a=p.attributes.id||null;const q=Qc(p,"InLine");if(!q)continue;var d=Qc(q,"Creatives");if(d)for(const r of Mc(d,"Creative")){if(d=Qc(r,"Linear")){var e=ns(q);os(c,b,d,e,a)}if(d=Qc(r,"NonLinearAds")){e=Mc(d,"NonLinear");for(const t of e){e=ns(q);var f=Qc(d,"TrackingEvents");f&&ps(Lc(f),e);a:{f=c;var g=b;let u;var h=Qc(t,"StaticResource");if(h)u=h.attributes.creativeType;else{h=Qc(t,"HTMLResource");if(!h)break a;u="text/html"}let v=Oc(h);if(v){u===
"text/html"&&(v="data:text/html;charset=UTF-8,"+encodeURIComponent(v));h=N(t,"width",Yc)||N(t,"expandedWidth",Yc);var k=N(t,"height",Yc)||N(t,"expandedHeight",Yc);if(h||k){var l=null,m=Qc(t,"NonLinearClickThrough");m&&(m=Oc(m))&&(l=m);for(const x of Mc(t,"NonLinearClickTracking"))if(m=Nc(x))e.clickTracking||(e.clickTracking=[]),e.clickTracking.push(m);m=null;var n=t.attributes.minSuggestedDuration;n&&(m=sc(n));n=0;g!=null&&(n=g);f.push({id:a,groupId:null,startTime:n,endTime:null,uri:v,mimeType:u,
isSkippable:!1,skipOffset:null,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:m,once:!0,pre:g==null,post:g==Infinity,timelineRange:!1,loop:!1,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:h||0,y:k||0}},displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:l,tracking:e})}}}}}}}return c}
function ns(a){const b=qs();for(const c of Mc(a,"Error")){const d=Nc(c);d&&(b.error||(b.error=[]),b.error.push(d))}for(const c of Mc(a,"Impression"))if(a=Nc(c))b.impression||(b.impression=[]),b.impression.push(a);return b}
function os(a,b,c,d,e){let f=0;b!=null&&(f=b);let g=null;c.attributes.skipoffset&&(g=sc(c.attributes.skipoffset),isNaN(g)&&(g=null));var h=Qc(c,"MediaFiles");if(h){var k=null,l=Qc(c,"VideoClicks");if(l){var m=Qc(l,"ClickThrough");m&&(m=Oc(m))&&(k=m);for(const n of Mc(l,"ClickTracking"))if(l=Nc(n))d.clickTracking||(d.clickTracking=[]),d.clickTracking.push(l)}(c=Qc(c,"TrackingEvents"))&&ps(Lc(c),d);h=c=Mc(h,"MediaFile");c=c.filter(n=>n.attributes.delivery=="streaming");c.length&&(h=c);h=h.sort((n,p)=>
(parseInt(p.attributes.height,10)||0)-(parseInt(n.attributes.height,10)||0));for(const n of h){if(n.attributes.apiFramework)continue;if(h=Oc(n)){a.push({id:e,groupId:null,startTime:f,endTime:null,uri:h,mimeType:n.attributes.type||null,isSkippable:g!=null,skipOffset:g,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:b==null,post:b==Infinity,timelineRange:!1,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:k,tracking:d});break}}}}
function ps(a,b){for(const c of a)if(a=c.attributes.event,a in b){const d=Nc(c);d&&(b[a]||(b[a]=[]),b[a].push(d))}}function rs(a){const b=[];for(const d of Mc(a,"vmap:AdBreak")){var c=d.attributes.timeOffset;if(!c)continue;a=null;c=="start"?a=null:c=="end"?a=Infinity:a=sc(c);c=Qc(d,"vmap:AdSource");if(!c)continue;c=Qc(c,"vmap:AdTagURI");if(!c)continue;(c=Nc(c))&&b.push({time:a,uri:c})}return b}
function qs(){return{impression:null,clickTracking:null,start:null,firstQuartile:null,midpoint:null,thirdQuartile:null,complete:null,skip:null,error:null,resume:null,pause:null,mute:null,unmute:null}}function ss(a){const b=qs();for(const c of a)c.type in b&&(b[c.type]?b[c.type].push(...c.urls):b[c.type]=c.urls);return b}var ts=class{};w("shaka.ads.Utils",ts);ts.ADS_LOADED="ads-loaded";ts.AD_STARTED="ad-started";ts.AD_PLAYING="ad-playing";ts.AD_FIRST_QUARTILE="ad-first-quartile";ts.AD_MIDPOINT="ad-midpoint";
ts.AD_THIRD_QUARTILE="ad-third-quartile";ts.AD_COMPLETE="ad-complete";ts.AD_STOPPED="ad-stopped";ts.AD_SKIPPED="ad-skipped";ts.AD_VOLUME_CHANGED="ad-volume-changed";ts.AD_MUTED="ad-muted";ts.AD_PAUSED="ad-paused";ts.AD_RESUMED="ad-resumed";ts.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";ts.CUEPOINTS_CHANGED="ad-cue-points-changed";ts.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";ts.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";ts.AD_CLICKED="ad-clicked";ts.AD_PROGRESS="ad-progress";
ts.AD_BUFFERING="ad-buffering";ts.AD_IMPRESSION="ad-impression";ts.AD_DURATION_CHANGED="ad-duration-changed";ts.AD_CLOSED="ad-closed";ts.AD_LOADED="ad-loaded";ts.ALL_ADS_COMPLETED="all-ads-completed";ts.AD_LINEAR_CHANGED="ad-linear-changed";ts.AD_METADATA="ad-metadata";ts.AD_RECOVERABLE_ERROR="ad-recoverable-error";ts.AD_ERROR="ad-error";ts.AD_BREAK_READY="ad-break-ready";ts.AD_BREAK_STARTED="ad-break-started";ts.AD_BREAK_ENDED="ad-break-ended";ts.AD_INTERSTITIAL_PRELOAD="ad-interstitial-preload";
ts.AD_INTERSTITIAL_PRELOADED="ad-interstitial-preloaded";ts.AD_INTERACTION="ad-interaction";ts.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";ts.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";ts.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function us(a,b){a.l(new P("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));if(a.o.customPlayheadTracker){const c={currentTime:a.i.currentTime};a.g=b.getAdsManager(c,a.B);a.i.muted?a.g.setVolume(0):a.g.setVolume(a.i.volume);a.h.F(a.i,"timeupdate",()=>{a.i.duration&&(c.currentTime=a.i.currentTime)});a.h.F(a.i,"volumechange",()=>{a.j&&(a.j.setVolume(a.i.volume),a.i.muted&&a.j.setMuted(!0))})}else a.g=b.getAdsManager(a.i,a.B);a.l(new P("ima-ad-manager-loaded",(new Map).set("imaAdManager",
a.g)));b=a.g.getCuePoints();if(b.length){const c=[];for(const d of b)c.push({start:d,end:null});a.l(new P("ad-cue-points-changed",(new Map).set("cuepoints",c)))}vs(a);try{a.g.init(a.i.offsetWidth,a.i.offsetHeight),a.h.F(a.i,"loadeddata",()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),"ResizeObserver"in window?(a.A=new ResizeObserver(()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),a.A.observe(a.i)):a.h.F(document,"fullscreenchange",()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),a.C||a.o.skipPlayDetection?
a.g.start():a.h.na(a.i,"play",()=>{a.C=!0;a.g.start()})}catch(c){ws(a,null)}}function xs(a,b){b.getError();b=(new Map).set("originalEvent",b);a.l(new P("ad-error",b));ws(a,null);a.l(new P("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
function ws(a,b){b&&b.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!a.o.supportsMultipleMediaElements&&a.l(new P("ad-content-resume-requested"));a.l(new P("ad-stopped",(new Map).set("originalEvent",b)));a.j&&a.j.isLinear()&&(a.u.removeAttribute("ad-active"),a.o.customPlayheadTracker||a.i.ended||a.i.play())}
function vs(a){const b=(c,d)=>{c=(new Map).set("originalEvent",c);a.l(new P(d,c))};a.h.F(a.g,google.ima.AdErrorEvent.Type.AD_ERROR,c=>{xs(a,c)});a.h.F(a.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,c=>{ys(a,c)});a.h.F(a.g,google.ima.AdEvent.Type.STARTED,c=>{ys(a,c)});a.h.F(a.g,google.ima.AdEvent.Type.FIRST_QUARTILE,c=>{b(c,"ad-first-quartile")});a.h.F(a.g,google.ima.AdEvent.Type.MIDPOINT,c=>{b(c,"ad-midpoint")});a.h.F(a.g,google.ima.AdEvent.Type.THIRD_QUARTILE,c=>{b(c,"ad-third-quartile")});
a.h.F(a.g,google.ima.AdEvent.Type.COMPLETE,c=>{b(c,"ad-complete")});a.h.F(a.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,c=>{ws(a,c)});a.h.F(a.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,c=>{b(c,"all-ads-completed");ws(a,c)});a.h.F(a.g,google.ima.AdEvent.Type.SKIPPED,c=>{b(c,"ad-skipped")});a.h.F(a.g,google.ima.AdEvent.Type.VOLUME_CHANGED,c=>{b(c,"ad-volume-changed")});a.h.F(a.g,google.ima.AdEvent.Type.VOLUME_MUTED,c=>{b(c,"ad-muted")});a.h.F(a.g,google.ima.AdEvent.Type.PAUSED,c=>{a.j&&(a.j.i=
!0,b(c,"ad-paused"))});a.h.F(a.g,google.ima.AdEvent.Type.RESUMED,c=>{a.j&&(a.j.i=!1,b(c,"ad-resumed"))});a.h.F(a.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,c=>{a.j&&b(c,"ad-skip-state-changed")});a.h.F(a.g,google.ima.AdEvent.Type.CLICK,c=>{b(c,"ad-clicked")});a.h.F(a.g,google.ima.AdEvent.Type.AD_PROGRESS,c=>{b(c,"ad-progress")});a.h.F(a.g,google.ima.AdEvent.Type.AD_BUFFERING,c=>{b(c,"ad-buffering")});a.h.F(a.g,google.ima.AdEvent.Type.IMPRESSION,c=>{b(c,"ad-impression")});a.h.F(a.g,google.ima.AdEvent.Type.DURATION_CHANGE,
c=>{b(c,"ad-duration-changed")});a.h.F(a.g,google.ima.AdEvent.Type.USER_CLOSE,c=>{b(c,"ad-closed")});a.h.F(a.g,google.ima.AdEvent.Type.LOADED,c=>{b(c,"ad-loaded")});a.h.F(a.g,google.ima.AdEvent.Type.LINEAR_CHANGED,c=>{b(c,"ad-linear-changed")});a.h.F(a.g,google.ima.AdEvent.Type.AD_METADATA,c=>{b(c,"ad-metadata")});a.h.F(a.g,google.ima.AdEvent.Type.LOG,c=>{b(c,"ad-recoverable-error")});a.h.F(a.g,google.ima.AdEvent.Type.AD_BREAK_READY,c=>{b(c,"ad-break-ready")});a.h.F(a.g,google.ima.AdEvent.Type.INTERACTION,
c=>{b(c,"ad-interaction")})}
function ys(a,b){const c=b.getAd();c?(a.j=new ls(c,a.g,a.i),b.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||a.o.supportsMultipleMediaElements||a.l(new P("ad-content-pause-requested")),b=(new Map).set("ad",a.j).set("sdkAdObject",c).set("originalEvent",b),a.l(new P("ad-started",b)),a.j.isLinear()&&(a.u.setAttribute("ad-active","true"),a.o.customPlayheadTracker||a.i.pause(),a.i.muted?(b=a.j,b.j=a.i.volume,b.h.setVolume(0)):a.j.setVolume(a.i.volume))):ma("The IMA SDK fired a "+b.type+" event with no associated ad. Unable to play ad!")}
var zs=class{constructor(a,b,c,d,e){this.u=a;this.i=b;this.C=!1;this.A=this.o=null;this.G=NaN;this.l=e;this.j=null;this.h=new Ca;google.ima.settings.setLocale(c);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0);this.D=new google.ima.AdDisplayContainer(this.u,this.i);this.D.initialize();this.m=new google.ima.AdsLoader(this.D);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v5.1.10");this.g=null;this.B=d||new google.ima.AdsRenderingSettings;this.h.F(this.m,
google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,f=>{us(this,f)});this.h.F(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,f=>{xs(this,f)});this.h.F(this.i,"ended",()=>{this.m.contentComplete()});this.h.na(this.i,"play",()=>{this.C=!0})}configure(a){this.o=a}stop(){this.g&&this.g.stop();this.u&&dj(this.u)}release(){this.stop();this.A&&this.A.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy();this.D.destroy()}};var As=class extends Bf{constructor(a,b,c,d,e,f){super(a);this.g=b;this.i=(this.h=b.isSkippable)?b.skipOffset||0:b.skipOffset;this.j=b.skipFor;this.u=c;this.m=d;this.l=e;this.o=f;this.A=b.overlay}hasCustomClick(){return this.g.clickThroughUrl!=null}isUsingAnotherMediaElement(){return this.o}getDuration(){const a=this.video.duration;return isNaN(a)?-1:a}getRemainingTime(){const a=this.video.duration;return isNaN(a)?-1:a-this.video.currentTime}isSkippable(){return this.h&&this.j!=null?this.getDuration()-
this.getRemainingTime()<this.i+this.j:this.h}getTimeUntilSkippable(){if(this.isSkippable()){const a=this.getRemainingTime()+this.i-this.getDuration();return Math.max(a,0)}return Math.max(this.getRemainingTime(),0)}canSkipNow(){return this.h&&this.getTimeUntilSkippable()==0}skip(){this.canSkipNow()&&this.u()}isLinear(){return this.A==null}getSequenceLength(){return this.m}getPositionInSequence(){return this.l}getAdId(){return this.g.id||""}getMediaUrl(){return this.g.uri}getTimeOffset(){return this.g.pre?
0:this.g.post?-1:this.g.startTime}};w("shaka.ads.InterstitialAd",As);var Bs=class extends Bf{constructor(a,b,c){super();this.g=a;this.j=b;this.h=c;this.i=a.overlay==null}hasCustomClick(){return this.g.clickThroughUrl!=null}isLinear(){return this.i}getSequenceLength(){return this.j}getPositionInSequence(){return this.h}getAdId(){return this.g.id||""}getMediaUrl(){return this.g.uri}getTimeOffset(){return this.g.pre?0:this.g.post?-1:this.g.startTime}};w("shaka.ads.InterstitialStaticAd",Bs);function Cs(a){a.h!==null&&(a.g?.cancelVideoFrameCallback?.(a.h),a.h=null);a.i=null}var Ds=class{constructor(a){this.g=a;this.i=this.h=null}start(a){Cs(this);if(!(this.g&&"requestVideoFrameCallback"in this.g))return!1;const b=(c,d)=>{this.g&&this.i===b&&a(c,d);this.g&&this.i===b&&(this.h=this.g.requestVideoFrameCallback(b))};this.i=b;this.h=this.g.requestVideoFrameCallback(b);return!0}release(){Cs(this);this.g=null}};function Es(a){a.i.configure(a.u.Mg());a.i.configure("ads.disableHLSInterstitial",!0);a.i.configure("ads.disableDASHInterstitial",!0);a.i.configure("playRangeEnd",Infinity);bg(a.u.pb(),a.i.pb())}
function Fs(a,b=!1,c=null){let d=0,e=null;if(a.H.size&&a.l!=null){var f=Array.from(a.H).sort((h,k)=>k.startTime-h.startTime),g=f;g=b?f.filter(h=>h.pre):a.K?f.filter(h=>h.post):f.filter(h=>!h.pre&&!h.post);for(const h of g){f=!1;if(b)f=h.pre;else if(a.K)f=h.post;else if(!h.pre&&!h.post){g=a.l-Math.round(h.startTime*1E3)/1E3;let k=1;a.I.allowStartInMiddleOfInterstitial&&h.endTime&&h.endTime!=Infinity&&(k=h.endTime-h.startTime);(g>0||g==0&&a.l==0)&&(g<=k||!h.canJump)&&(f=c==null&&a.B&&!a.B.pre&&!a.B.post&&
a.B.startTime>=h.startTime?!1:!0)}f&&(!a.B||h.startTime>=a.B.startTime)&&(d==(c||0)?e=h:e&&!h.canJump&&Math.round(h.startTime*1E3)/1E3-Math.round(e.startTime*1E3)/1E3>.001&&(e=h,d=0),d++)}}return e}
function Gs(a,b,c,d,e,f=0){a.B=b;Hs(a);a.A||!a.o||a.h.parentElement||a.o.appendChild(a.h);d==1&&c==1&&(c=Array.from(a.H).filter(g=>b.pre?g.pre==b.pre:b.post?g.post==b.post:Math.abs(g.startTime-b.startTime)<.001).length);b.once&&(f++,a.H.delete(b),Is(a),b.overlay||Js(a));b.mimeType&&(b.mimeType.startsWith("image/")||b.mimeType==="text/html")?b.overlay?Ks(a,b,c,d,f):ma("Unsupported interstitial",b):a.A&&b.overlay?ma("Unsupported interstitial",b):Ls(a,b,c,d,e,f)}
function Ms(a,b){if(a.L.has(b)){var c=a.L.get(b);for(const d of c)d.parentNode.removeChild(d);a.L.delete(b)}}function Is(a){a.ma&&!a.H.size&&(a.J.Ma(a.g,"playing",a.W),a.J.Ma(a.g,"timeupdate",a.W),a.J.Ma(a.g,"seeked",a.sa),a.J.Ma(a.g,"ended",a.X),a.T?.release(),a.T=null,a.S?.stop(),a.N?.stop(),a.ma=!1)}
function Ns(a,b){if(b.pre&&a.l==null||b.startTime==0&&!b.canJump)return!0;if(a.l!=null){let c=Infinity;!a.C&&a.g.duration&&(c=a.g.duration);b=Math.min(b.startTime,c)-a.l;if(b>0&&b<=a.I.interstitialPreloadAheadTime)return!0}return!1}function Os(a){return(a=a.mimeType)?!a.startsWith("image/")&&a!=="text/html":!0}
function Ps(a,b,c){a.wa(new P(b,c));if(!a.I.disableTrackingEvents&&(c=a.B&&a.B.tracking)){switch(b){case "ad-impression":var d=c.impression;break;case "ad-clicked":d=c.clickTracking;break;case "ad-started":d=c.start;break;case "ad-first-quartile":d=c.firstQuartile;break;case "ad-midpoint":d=c.midpoint;break;case "ad-third-quartile":d=c.thirdQuartile;break;case "ad-complete":d=c.complete;break;case "ad-skipped":d=c.skip;break;case "ad-error":d=c.error;break;case "ad-resumed":d=c.resume;break;case "ad-paused":d=
c.pause;break;case "ad-muted":d=c.mute;break;case "ad-volume-changed":d=c.unmute}if(d)for(const e of d)b=a,d=ag([e],If()),d.method="POST",b.u.pb().request(7,d,{type:13})}}
function Qs(a,b){if(!(a.L.has(b)||a.I&&!a.I.allowPreloadOnDomElements)){var c=e=>{const f=document.createElement("link");f.rel="preload";f.href=e;f.as="image";document.head.appendChild(f);return f},d=[];if(b.background){const e=b.background.match(/url\(('|")?([^'"()]+)('|")\)?/);e&&d.push(c(e[2]))}b.mimeType&&b.mimeType.startsWith("image/")&&d.push(c(b.uri));a.L.set(b,d)}}
function Js(a){const b=[];for(const c of a.H){if(c.overlay)continue;const d={start:c.startTime,end:null};c.pre?(d.start=0,d.end=null):c.post?(d.start=-1,d.end=null):c.timelineRange&&(d.end=c.endTime);b.find(e=>d.start==e.start&&d.end==e.end)||b.push(d)}Ps(a,"ad-cue-points-changed",(new Map).set("cuepoints",b))}
function Hs(a,b=!1){if(a.o&&a.I){var c=a.I.supportsMultipleMediaElements,d=a.g;d.controls?c=!1:d.webkitPresentationMode&&d.webkitPresentationMode!=="inline"?c=!1:d.webkitDisplayingFullscreen&&(c=!1);if(b||a.A==c)a.A=!c,a.A?(a.h=a.g,a.D&&(a.D.parentElement&&a.o.removeChild(a.D),a.D=null)):(b&&a.D&&(a.D.parentElement&&a.o.removeChild(a.D),a.D=null),a.D||(b=document.createElement(a.g.tagName),b.autoplay=!0,b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height=
"100%",b.style.display="none",b.setAttribute("playsinline",""),a.D=b),a.h=a.D)}else a.A=!0}function Rs(){const a=A().i();return a=="TV"||a=="CONSOLE"||a=="CAST"?!0:!1}function Ss(a){if(!a.ma&&a.H.size){a.J.F(a.g,"playing",a.W);a.J.F(a.g,"timeupdate",a.W);a.J.F(a.g,"seeked",a.sa);a.J.F(a.g,"ended",a.X);var b=!0;Rs()||(a.T?.release(),a.T=new Ds(a.g),b=!a.T.start(()=>{a.X()}));b&&a.S.Aa(.025);a.N&&a.N.Aa(1);a.ma=!0}}
function Ts(a,b){if(!b||b.displayOnBackground)a.g.style.zIndex="";b&&b.currentVideo==null||(a.g.style.transformOrigin="",a.g.style.transition="",a.g.style.transform="");a.o&&(a.o.removeAttribute("ad-active"),a.o.style.pointerEvents="",!b||b.background)&&(a.o.style.background="");a.D&&(a.D.style.background="")}
function Us(a,b){const c=[];if(!b)return c;var d=b.values.find(v=>v.key=="X-ASSET-URI");if(!d)return c;d=d.data;if(!d)return c;let e=null;var f=b.values.find(v=>v.key=="X-OVERLAY-ID");f&&(e=f.data);f=e==null?Math.floor(b.startTime*10)/10:b.startTime;let g=b.endTime;b.endTime&&b.endTime!=Infinity&&typeof b.endTime=="number"&&(g=e==null?Math.floor(b.endTime*10)/10:b.endTime);let h=!1,k=!1;var l=!1,m=b.values.find(v=>v.key=="CUE");m&&(l=m.data,h=l.includes("ONCE"),k=l.includes("PRE"),l=l.includes("POST"));
m=null;var n=b.values.find(v=>v.key=="X-ASSET-MIMETYPE");n&&(m=n.data);n=!1;var p=b.values.find(v=>v.key=="X-LOOP");p&&(n=p.data=="YES");p=1;var q=b.values.find(v=>v.key=="X-DEPTH");q&&(p=parseFloat(q.data),isNaN(p)&&(p=1));q=null;var r=b.values.find(v=>v.key=="X-BACKGROUND");r&&(q=r.data);r=1920;var t=1080,u=b.values.find(v=>v.key=="X-VIEWPORT");if(u){t=u.data.split("x");if(t.length!=2)return c;r=parseFloat(t[0]);t=parseFloat(t[1])}r={viewport:{x:r,y:t},topLeft:{x:0,y:0},size:{x:r,y:t}};if(t=b.values.find(v=>
v.key=="X-OVERLAY-POSITION")){t=t.data.split("x");if(t.length!=2)return c;r.topLeft.x=parseFloat(t[0]);r.topLeft.y=parseFloat(t[1])}if(t=b.values.find(v=>v.key=="X-OVERLAY-SIZE")){t=t.data.split("x");if(t.length!=2)return c;r.size.x=parseFloat(t[0]);r.size.y=parseFloat(t[1])}t=null;if(u=b.values.find(v=>v.key=="X-SQUEEZECURRENT"))if(t=parseFloat(u.data),isNaN(t)&&(t=1),t={viewport:{x:1920,y:1080},topLeft:{x:0,y:0},size:{x:1920*t,y:1080*t}},b=b.values.find(v=>v.key=="X-SQUEEZECURRENT-POSITION")){b=
b.data.split("x");if(b.length!=2)return c;t.topLeft.x=parseFloat(b[0]);t.topLeft.y=parseFloat(b[1])}c.push({id:e,groupId:null,startTime:f,endTime:g,uri:Vs(a,d),mimeType:m,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:h,pre:k,post:l,timelineRange:!0,loop:n,overlay:r,displayOnBackground:p==-1,currentVideo:t,background:q,clickThroughUrl:null,tracking:null});return c}
async function Ws(a,b){const c=[];if(!b)return c;var d=b.values.find(E=>E.key=="X-ASSET-URI"),e=b.values.find(E=>E.key=="X-ASSET-LIST");if(!d&&!e)return c;let f=null;var g=b.values.find(E=>E.key=="ID");g&&(f=g.data);g=f==null?Math.floor(b.startTime*10)/10:b.startTime;let h=b.endTime;b.endTime&&b.endTime!=Infinity&&typeof b.endTime=="number"&&(h=f==null?Math.floor(b.endTime*10)/10:b.endTime);var k=b.values.find(E=>E.key=="X-RESTRICT");let l=!0;var m=!0;k&&k.data&&(m=k.data,l=!m.includes("SKIP"),m=
!m.includes("JUMP"));k=l?0:null;var n=b.values.find(E=>E.key=="X-SKIP-CONTROL-OFFSET");n&&(k=parseFloat(n.data),isNaN(k)&&(k=l?0:null));n=null;var p=b.values.find(E=>E.key=="X-SKIP-CONTROL-DURATION");p&&(n=parseFloat(p.data),isNaN(k)&&(n=null));p=null;const q=b.values.find(E=>E.key=="X-RESUME-OFFSET");q&&(p=parseFloat(q.data),isNaN(p)&&(p=null));p!=null&&p!=0&&h&&h!=Infinity&&qj(g+p,h)&&(p=null);let r=null;var t=b.values.find(E=>E.key=="X-PLAYOUT-LIMIT");t&&(r=parseFloat(t.data),isNaN(r)&&(r=null));
let u=t=!1;var v=!1,x=b.values.find(E=>E.key=="CUE");x&&(v=x.data,t=v.includes("ONCE"),u=v.includes("PRE"),v=v.includes("POST"));x=!1;(b=b.values.find(E=>E.key=="X-TIMELINE-OCCUPIES"))?x=b.data.includes("RANGE"):!q&&a.u.isLive()&&(x=!u&&!v);if(d){var y=d.data;if(!y)return c;c.push({id:f,groupId:null,startTime:g,endTime:h,uri:Vs(a,y),mimeType:null,isSkippable:l,skipOffset:k,skipFor:n,canJump:m,resumeOffset:p,playoutLimit:r,once:t,pre:u,post:v,timelineRange:x,loop:!1,overlay:null,displayOnBackground:!1,
currentVideo:null,background:null,clickThroughUrl:null,tracking:null})}else if(e){e=e.data;if(!e)return c;try{d=0;!u&&!v&&a.I.allowStartInMiddleOfInterstitial&&a.u.isLive()&&(d=(a.l??a.g.currentTime)-g);var D=Vs(a,e,d);y=await Xs(a,D,{type:11}).promise;var z=ub(y.data);const E=JSON.parse(z);var B=E["SKIP-CONTROL"];if(B){const J=B.OFFSET;typeof J=="number"&&(k=parseFloat(J),isNaN(J)&&(k=l?0:null));const X=B.DURATION;typeof X=="number"&&(n=parseFloat(X),isNaN(n)&&(n=null))}D=0;for(z=0;z<E.ASSETS.length;z++){const J=
E.ASSETS[z],X=J.URI,L=parseFloat(J.DURATION)||0;if(d>0&&L>0&&(B=D+L,B<=d)){D=B;continue}if(X){const W=new Ma(y.uri),F=new Ma(X),I=W.resolve(F),O={id:f+"_shaka_asset_"+z,groupId:f,startTime:g,endTime:h,uri:Vs(a,I.toString()),mimeType:null,isSkippable:l,skipOffset:k,skipFor:n,canJump:m,resumeOffset:p,playoutLimit:r,once:t,pre:u,post:v,timelineRange:x,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null,tracking:null},M=J["X-AD-CREATIVE-SIGNALING"];if(M){const ba=
M.payload&&M.payload[0];ba&&(O.clickThroughUrl=ba.clickThrough,ba.tracking&&(O.tracking=ss(ba.tracking)))}d>0&&D<d&&a.O.set(O.id,d-D);c.push(O)}D+=L}}catch(E){}}return c}
async function Ys(a,b){let c=!1;for(const d of b){if(!d.uri){ma("Missing URL in interstitial",d);continue}if(!d.mimeType)try{d.mimeType=await $l(d.uri,a.i.pb(),a.u.getConfiguration().streaming.retryParameters)}catch(e){}b=d.id||JSON.stringify(d);a.P.has(b)||(d.loop&&!d.overlay&&ma("Loop is only supported in overlay interstitials",d),d.overlay||(c=!0),a.P.add(b),a.H.add(d),Ns(a,d)&&(!a.G.has(d)&&Os(d)&&(b=new Zs(a.i,d,(e,f)=>{Ps(a,e,f)}),a.G.set(d,b)),Qs(a,d)))}c&&Js(a);Ss(a)}
async function $s(a,b){var c=null;const d=b.values.find(e=>e.key=="ID");d&&(c=d.data);if(c){if(a.qa.has(c))return;a.qa.add(c)}Es(a);c=[];c=b&&b.values.find(e=>e.key=="X-OVERLAY-ID")?Us(a,b):await Ws(a,b);c.length&&await Ys(a,c)}
function at(a,b){var c=Qc(b.eventNode,"OverlayEvent");const d=c.attributes.uri,e=c.attributes.mimeType,f=c.attributes.loop=="true",g=N(c,"z",Yc);if(d&&g!=0){var h=null,k=Qc(c,"Background");if(k){var l=k.attributes.uri;l?h=`center / contain no-repeat url('${l}')`:h=Oc(k)}k=1920;l=1080;var m=Qc(c,"Viewport");if(m){k=N(m,"x",Yc);if(k==null)return;l=N(m,"y",Yc);if(l==null)return}var n={viewport:{x:k,y:l},topLeft:{x:0,y:0},size:{x:k,y:l}},p=Qc(c,"Overlay");if(m&&p){var q=Qc(p,"TopLeft"),r=Qc(p,"Size");
if(q&&r){p=N(q,"x",Yc);if(p==null)return;q=N(q,"y",Yc);if(q==null)return;const t=N(r,"x",Yc);if(t==null)return;r=N(r,"y",Yc);if(r==null)return;n.topLeft.x=p;n.topLeft.y=q;n.size.x=t;n.size.y=r}}p=null;c=Qc(c,"Squeeze");if(m&&c&&(r=Qc(c,"TopLeft"),c=Qc(c,"Size"),r&&c)){m=N(r,"x",Yc);if(m==null)return;p=N(r,"y",Yc);if(p==null)return;r=N(c,"x",Yc);if(r==null)return;c=N(c,"y",Yc);if(c==null)return;p={viewport:{x:k,y:l},topLeft:{x:m,y:p},size:{x:r,y:c}}}Ys(a,[{id:b.id,groupId:null,startTime:b.startTime,
endTime:b.endTime,uri:d,mimeType:e,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:!0,loop:f,overlay:n,displayOnBackground:g==-1,currentVideo:p,background:h,clickThroughUrl:null,tracking:null}])}}function Xs(a,b,c){return a.u.pb().request(7,ag([b],If()),c)}
function Ks(a,b,c,d,e){let f=b.startTime;b.pre?f=0:b.post&&(f=-1);if(!a.C){var g=(new Map).set("timeOffset",f).set("startedAt",a.l);Ps(a,"ad-break-started",g)}a.C=!0;var h=b.overlay;g=b.mimeType=="text/html"?"iframe":"img";const k=document.createElement(g);k.style.objectFit="contain";k.style.position="absolute";k.style.border="none";bt(a,b);const l=()=>{a.m&&(a.m.stop(),a.m=null);a.o.removeChild(k);Ts(a,b);Ps(a,"ad-stopped");a.j.xa();const q=Fs(a,b.pre,d-e);q?Gs(a,q,c,++d,Date.now(),e):a.C=!1;a.C||
Ps(a,"ad-break-ended",(new Map).set("timeOffset",f))};var m=new Bs(b,c,d);Ps(a,"ad-impression");Ps(a,"ad-started",(new Map).set("ad",m));g=="iframe"?k.src=b.uri:(k.src=b.uri,k.onerror=q=>{Ps(a,"ad-error",(new Map).set("originalEvent",q));l()});m=h.viewport;const n=h.topLeft;h=h.size;m.x==0&&m.y==0?(k.width=b.overlay.size.x,k.height=b.overlay.size.y,k.style.bottom="10%",k.style.left="0",k.style.right="0",k.style.width="100%",b.overlay.size.y||g!="iframe"||(k.style.height="auto")):(k.style.height=h.y/
m.y*100+"%",k.style.left=n.x/m.x*100+"%",k.style.top=n.y/m.y*100+"%",k.style.width=h.x/m.x*100+"%");a.o.appendChild(k);const p=Date.now();a.m&&a.m.stop();a.m=new te(()=>{b.playoutLimit&&(Date.now()-p)/1E3>b.playoutLimit?(Ps(a,"ad-complete"),l()):b.endTime&&a.g.currentTime>b.endTime?(Ps(a,"ad-complete"),l()):a.g.currentTime<b.startTime&&(Ps(a,"ad-skipped"),l())});b.playoutLimit&&!b.endTime?a.m.ha(b.playoutLimit):b.endTime&&a.m.Aa(.025);a.j.F(a.g,"seeked",()=>{const q=a.g.currentTime;if(q<b.startTime||
b.endTime&&q>b.endTime)a.m&&a.m.stop(),Ps(a,"ad-skipped"),l()});b.clickThroughUrl&&a.j.F(k,"click",()=>{b.clickThroughUrl&&(Ps(a,"ad-clicked"),window.open(b.clickThroughUrl,"_blank"))})}
async function Ls(a,b,c,d,e,f){var g=Date.now();let h=b.startTime;b.pre?h=0:b.post&&(h=-1);if(!a.C){var k=(new Map).set("timeOffset",h).set("startedAt",a.l);Ps(a,"ad-break-started",k)}a.C=!0;let l=!1;const m=()=>{if(!a.A&&!b.overlay&&b.resumeOffset==null)if(b.timelineRange&&b.endTime&&b.endTime!=Infinity)a.g.currentTime!=b.endTime&&(a.g.currentTime=b.endTime);else{const x=Date.now();a.g.currentTime+=(x-e)/1E3;e=x}},n=async(x,y)=>{y||m();let D=Fs(a,b.pre,d-f);if(x&&b.groupId)for(;D&&D.groupId==b.groupId;)d++,
D=Fs(a,b.pre,d-f);a.m&&(!b.groupId||D&&D.groupId!=b.groupId)&&(a.m.stop(),a.m=null);Ts(a,b);if(!D||D.overlay)b.post&&(a.l=null,a.B=null),a.A?await a.i.detach():await a.i.mc(),a.A?(x=b.resumeOffset,x==null&&(x=b.timelineRange&&b.endTime&&b.endTime!=Infinity?b.endTime-(a.l||0):(Date.now()-e)/1E3),Ps(a,"ad-content-resume-requested",(new Map).set("offset",x))):a.u.isLive()&&b.resumeOffset!=null&&b.resumeOffset!=0&&(a.g.currentTime+=b.resumeOffset),Ps(a,"ad-stopped"),a.j.xa(),a.C=!1,a.A?Js(a):(a.h.style.display=
"none",y||m(),a.K||a.g.play());D&&a.A&&Rs()?(await a.i.detach(),Hs(a,!0)):Hs(a);D&&(Ps(a,"ad-stopped"),a.j.xa(),Gs(a,D,c,++d,e,f));a.C||(Ps(a,"ad-break-ended",(new Map).set("timeOffset",h)),a.m?.stop(),a.m=null)},p=async(x,y)=>{l||(l=!0,y=y&&x.code===1001,Ps(a,"ad-error",(new Map).set("originalEvent",x)),await n(!1,y))},q=async()=>{l||(l=!0,await n(!1,!1),Ps(a,"ad-complete"))};a.Z=async()=>{l||(l=!0,Ps(a,"ad-skipped"),await n(!0,!1))};const r=new As(a.h,b,a.Z,c,d,!a.A);a.A||(r.setMuted(a.g.muted),
r.setVolume(a.g.volume));Ps(a,"ad-impression");Ps(a,"ad-started",(new Map).set("ad",r));let t=r.canSkipNow();t&&Ps(a,"ad-skip-state-changed");if(a.G.has(b)&&(k=a.G.get(b).i)){a.G.delete(b);p(k,!0);return}a.j.na(a.i,"error",x=>{p(x.detail,!1)});a.j.F(a.h,"timeupdate",()=>{if(a.h.duration){var x=r.canSkipNow();t!=x&&r.getRemainingTime()>0&&r.getDuration()>0&&Ps(a,"ad-skip-state-changed");t=x;!a.A&&!b.overlay&&b.resumeOffset==null&&b.timelineRange&&b.endTime&&b.endTime!=Infinity&&a.g.currentTime!=b.endTime&&
a.u.Ea().end>=b.endTime&&(a.g.currentTime=b.endTime)}});a.j.na(a.i,"firstquartile",()=>{m();Ps(a,"ad-first-quartile")});a.j.na(a.i,"midpoint",()=>{m();Ps(a,"ad-midpoint")});a.j.na(a.i,"thirdquartile",()=>{m();Ps(a,"ad-third-quartile")});a.j.na(a.i,"complete",q);let u=!1;a.j.F(a.h,"play",()=>{u?Ps(a,"ad-resumed"):(u=!0,Ps(a,"ad-playing",(new Map).set("ad",r)))});a.j.F(a.h,"pause",()=>{const x=a.i.getConfiguration();a.h.currentTime>=x.playRangeEnd?q():Ps(a,"ad-paused")});a.j.F(a.h,"volumechange",()=>
{a.h.muted?Ps(a,"ad-muted"):Ps(a,"ad-volume-changed");a.A||(a.g.volume=a.h.volume,a.g.muted=a.h.muted)});b.clickThroughUrl&&a.j.F(a.o||a.h,"click",()=>{b.clickThroughUrl&&(r.isPaused()||r.pause(),window.open(b.clickThroughUrl,"_blank"))});if(a.A&&d==1){Ps(a,"ad-content-pause-requested",(new Map).set("saveLivePosition",!0));const x=Promise.withResolvers(),y=async D=>{D.state=="detach"&&(Rs()&&await we(.1),x.resolve(),a.j.Ma(a.u,"onstatechange",y))};a.j.F(a.u,"onstatechange",y);await x.promise}bt(a,
b);if(!a.A)if(a.h.style.display="",b.overlay){a.h.loop=b.loop;k=b.overlay.viewport;const x=b.overlay.topLeft,y=b.overlay.size;a.h.style.height=y.y/k.y*100+"%";a.h.style.left=x.x/k.x*100+"%";a.h.style.top=x.y/k.y*100+"%";a.h.style.width=y.x/k.x*100+"%"}else a.g.pause(),a.u.isLive()||b.resumeOffset==null||b.resumeOffset==0||(a.g.currentTime+=b.resumeOffset),a.h.loop=!1,a.h.style.height="100%",a.h.style.left="0",a.h.style.top="0",a.h.style.width="100%";try{Es(a);if(b.startTime&&b.endTime&&b.endTime!=
Infinity&&b.startTime!=b.endTime){var v=b.endTime-b.startTime;v>0&&a.i.configure("playRangeEnd",v)}v=null;if(d==1&&!b.pre&&!b.post&&a.I.allowStartInMiddleOfInterstitial&&a.l!=null&&b.startTime<=a.l&&(!b.endTime||b.endTime>a.l))if(b.id&&a.O.has(b.id)){const y=a.O.get(b.id);a.O.delete(b.id);Math.abs(y)>.25&&(v=y)}else{const y=a.l-b.startTime;Math.abs(y)>.25&&(v=y)}d==1&&(a.m?.stop(),a.m=null);let x=b.playoutLimit;x&&!a.m&&(v&&(x-=v),a.m=(new te(()=>{a.Z()})).ha(x),a.i.configure("playRangeEnd",x));a.i.ob()!==
a.h&&await a.i.Hb(a.h);if(a.G.has(b)){const y=a.G.get(b);a.G.delete(b);const D=y.i;if(D)throw D;const z=y.g;z?await a.i.load(z,v):await a.i.load(b.uri,v,b.mimeType||void 0)}else await a.i.load(b.uri,v,b.mimeType||void 0);b.overlay&&a.g.paused?a.h.pause():a.h.play();Ps(a,"ads-loaded",(new Map).set("loadTime",(Date.now()-g)/1E3));a.A&&a.g.play();b.overlay&&(b.pre||b.post||a.u.isLive()&&!(b.startTime>0)||(g=()=>{const y=a.g.currentTime-b.startTime;Math.abs(y-a.h.currentTime)>.1&&(a.h.currentTime=y)},
a.j.na(a.h,"playing",g),a.j.F(a.g,"seeking",g)),a.j.F(a.g,"seeked",()=>{const y=a.g.currentTime;(y<b.startTime||b.endTime&&y>b.endTime)&&a.Z()}))}catch(x){a.C&&p(x,!0)}}
function bt(a,b){b.displayOnBackground&&(a.g.style.zIndex="1");if(b.currentVideo!=null){var c=b.currentVideo;a.g.style.transformOrigin="top left";let e=!0;const f=[];var d=c.topLeft.x/c.viewport.x*100;d>0&&d<=100&&(f.push(`translateX(${d}%)`),e=!1);d=c.topLeft.y/c.viewport.y*100;d>0&&d<=100&&(f.push(`translateY(${d}%)`),e=!1);d=c.size.x/c.viewport.x;d<1&&f.push(`scaleX(${d})`);c=c.size.y/c.viewport.y;d<1&&f.push(`scaleY(${c})`);f.length&&(a.g.style.transform=f.join(" "));e&&(a.g.style.transition=
"transform 250ms")}a.o&&(b.clickThroughUrl?(a.o.setAttribute("ad-active","true"),a.o.style.pointerEvents=""):a.o.style.pointerEvents="none",b.background&&(a.o.style.background=b.background));a.D&&(a.D.style.background=b.overlay?"":"rgb(0, 0, 0)")}function Vs(a,b,c=0){if(!b.startsWith("data:")){a.ba||(a.ba=window.crypto.randomUUID());b=new Ma(b);const d=b.g;d.add("_HLS_primary_id",a.ba);c>0&&d.add("_HLS_start_offset",String(Math.round(c*1E3)/1E3));return b.toString()}return b}
var ct=class{constructor(a,b,c){this.I=null;this.o=a;this.u=b;this.g=b.ob();this.D=null;this.A=!0;this.h=this.g;this.wa=c;this.qa=new Set;this.P=new Set;this.H=new Set;this.G=new Map;this.L=new Map;this.i=new Y;Es(this);this.J=new Ca;this.j=new Ca;this.C=this.K=!1;this.Z=this.m=this.B=this.l=null;this.ma=!1;this.ba=this.T=null;this.O=new Map;const d=e=>e?e.overlay?!0:this.K?e.post:this.g.paused?!1:!0:!1;this.X=()=>{if(!this.C&&this.l&&!this.u.za()){this.K=this.g.ended;this.l=this.g.currentTime;var e=
Fs(this);e&&d(e)&&Gs(this,e,1,1,Date.now())}};this.W=()=>{if(!(this.C||this.l||this.u.za())){this.K=this.g.ended;this.g.paused||(this.l=this.g.currentTime);var e;this.B||(e=Fs(this,!0));e||=Fs(this);e&&d(e)&&Gs(this,e,1,1,Date.now())}};this.sa=()=>{if(!this.C&&this.l&&!this.u.za()){this.K=this.g.ended;var e=this.g.currentTime;this.B&&!this.B.pre&&!this.B.post&&e<this.B.startTime&&(this.B=null)}};this.S=new te(this.X);this.N=new te(()=>{if(!this.C&&this.H.size&&this.l!=null){var e=this.u.Vc();if(e!=
Dr&&e!=fs){e=!1;var f=Array.from(this.H),g=this.u.Ea();for(const h of f)h!=this.B&&(g.start-(h.endTime||h.startTime)>=1?(this.G.has(h)&&(this.G.get(h).release(),this.G.delete(h)),Ms(this,h),f=h.id||JSON.stringify(h),this.P.has(f)&&this.P.delete(f),this.H.delete(h),Is(this),h.overlay||(e=!0)):Ns(this,h)&&(!this.G.has(h)&&Os(h)&&(f=new Zs(this.i,h,(k,l)=>{Ps(this,k,l)}),this.G.set(h,f)),Qs(this,h)));e&&Js(this)}}});this.configure(this.u.getConfiguration().ads)}configure(a){this.I=a;this.C||Hs(this)}stop(){this.j&&
this.j.xa();this.qa.clear();this.P.clear();this.H.clear();this.i.mf();var a=Array.from(this.G.values());for(const b of a)b.release();this.G.clear();if(this.L.size){a=Array.from(this.L.keys());for(const b of a)Ms(this,b)}this.L.clear();this.O.clear();this.i.detach();this.C=this.K=!1;this.B=this.l=null;this.A=!0;this.h=this.g;this.ba=this.D=null;Ts(this);Is(this);this.o&&dj(this.o);this.m&&(this.m.stop(),this.m=null)}release(){this.stop();this.J&&this.J.release();this.j&&this.j.release();this.S&&(this.S.stop(),
this.S=null);this.N&&(this.N.stop(),this.N=null);this.i.destroy()}Wc(){return this.i}async addAdUrlInterstitial(a){const b={type:12};a=await Xs(this,a,b).promise;a=Ec(a.data,"VAST,vmap:VMAP");if(!a)throw new H(2,10,10007);let c=[];if(a.tagName=="VAST")c=ms(a,this.l);else if(a.tagName=="vmap:VMAP"){const d=async f=>{var g=await Xs(this,f.uri,b).promise;g=Ec(g.data,"VAST");if(!g)throw new H(2,10,10007);c.push(...ms(g,f.time))},e=[];for(const f of rs(a))e.push(d(f));e.length&&await Promise.all(e)}Ys(this,
c)}};async function dt(a,b){try{a.h&&a.h("ad-interstitial-preload",(new Map).set("interstitial",b));const c=await a.l.preload(b.uri,null,b.mimeType||void 0);if(a.j){if(c)try{await c.destroy()}catch(d){}}else(a.g=c)&&a.h&&a.h("ad-interstitial-preloaded",(new Map).set("interstitial",b))}catch(c){a.i=c instanceof H?c:null}}var Zs=class{constructor(a,b,c=null){this.l=a;this.i=this.g=null;this.j=!1;this.h=c;dt(this,b)}release(){this.j=!0;this.g&&(this.g.destroy(),this.g=null)}};var et=class extends Bf{constructor(a,b,c,d,e){super(e);this.g=a;this.i=sc(this.g.skipOffset);this.h=b;this.j=c;this.m=d;this.l=!1}isClientRendering(){return!1}getDuration(){return this.g.durationInSeconds}getRemainingTime(){return this.g.startTimeInSeconds+this.g.durationInSeconds-this.video.currentTime}isSkippable(){return typeof this.i=="number"?!0:!1}getTimeUntilSkippable(){if(typeof this.i!="number")return this.getRemainingTime();const a=this.getRemainingTime()+this.i-this.getDuration();return Math.max(a,
0)}canSkipNow(){return this.getTimeUntilSkippable()==0}skip(){this.l=!0;this.video.currentTime+=this.getRemainingTime()}isLinear(){return this.m}getSequenceLength(){return this.j?this.j:1}getPositionInSequence(){return this.h?this.h:1}getTitle(){return this.g.adTitle}getVastAdId(){return this.g.vastAdId||""}getAdId(){return this.g.adId}getCreativeAdId(){return this.g.creativeId}getTimeOffset(){return this.g.startTimeInSeconds}release(){this.j=this.h=this.g=null}};w("shaka.ads.MediaTailorAd",et);async function ft(a,b,c){var d=ag([b],If());d.method="POST";c&&(c=JSON.stringify(c),d.body=yb(c));d=a.L.request(7,d,{type:7});try{const e=await d.promise,f=ub(e.data),g=JSON.parse(f);if(g.manifestUrl&&g.trackingUrl){const h=new Ma(b),k=new Ma(g.trackingUrl);a.I=h.resolve(k).toString();a.h(new P("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.S)));const l=new Ma(g.manifestUrl);a.l.resolve(h.resolve(l).toString());a.l=null}else throw Error("Insufficient data from MediaTailor.");}catch(e){a.J.length?
a.l.resolve(a.J):a.l.reject(new H(1,10,10010)),a.l=null}}function gt(a){if(a.g&&a.B){a.m&&dj(a.m);a.K||a.N.add(a.B.adId);ht(a,a.g.l);const b=a.g.getPositionInSequence(),c=a.g.getSequenceLength();b===c&&it(a,"breakEnd");a.g=null;a.B=null;a.H=null}}
async function jt(a,b,c){b=a.L.request(7,ag([b],If()),{type:8});try{const d=await b.promise;b=[];const e=ub(d.data),f=JSON.parse(e);if(f.avails.length>0){if(Bc(a.j)!=Bc(f.avails)){a.j=f.avails;for(const g of a.j)for(const h of g.nonLinearAdsList)for(const k of h.nonLinearAdList)kt(a,k);b=a.getCuePoints();a.h(new P("ad-cue-points-changed",(new Map).set("cuepoints",b)))}}else a.j.length&&a.h(new P("ad-cue-points-changed",(new Map).set("cuepoints",b))),gt(a),a.j=[];c&&(a.K||b.length>0)&&lt(a)}catch(d){}}
async function kt(a,b){if(b.staticResource){var c=mt(b);if(!a.C.has(c)){b=a.L.request(7,ag([b.staticResource],If()),{type:9});try{a.C.set(c,[]);const d=await b.promise,e=ub(d.data),f=JSON.parse(e).apps;a.C.set(c,f)}catch(d){a.C.delete(c)}}}}function lt(a){a.O||(a.O=!0,nt(a),a.K||(ot(a),a.o.F(a.i,"seeked",()=>{ot(a)}),a.o.F(a.i,"ended",()=>{gt(a)})),a.o.F(a.i,"timeupdate",()=>{nt(a)}))}
function mt(a){return[a.adId,a.adParameters,a.adSystem,a.adTitle,a.creativeAdId,a.creativeId,a.creativeSequence,a.height,a.width,a.staticResource].join("|")}
function nt(a){if(a.i.duration&&(a.g||a.j.length)){var b=a.i.currentTime,c=!1;if(a.g){c=!0;var d=a.B,e=d.startTimeInSeconds+.5*d.durationInSeconds,f=d.startTimeInSeconds+.75*d.durationInSeconds;b>=d.startTimeInSeconds+.25*d.durationInSeconds&&!a.A.has("firstQuartile")?(a.A.add("firstQuartile"),it(a,"firstQuartile")):b>=e&&!a.A.has("midpoint")?(a.A.add("midpoint"),it(a,"midpoint")):b>=f&&!a.A.has("thirdQuartile")&&(a.A.add("thirdQuartile"),it(a,"thirdQuartile"));d=a.g.getRemainingTime();e=a.g.getDuration();
a.g.canSkipNow()&&d>0&&e>0&&it(a,"skipStateChanged");e>0&&(d<=0||d>e)&&gt(a)}if(!a.g||!a.g.isLinear()){a:for(var g of a.j){if(a.g&&a.g.isLinear())break;for(d=0;d<g.ads.length;d++)if(e=g.ads[d],f=e.startTimeInSeconds+e.durationInSeconds,e.startTimeInSeconds<=b&&f>b){if(a.N.has(e.adId)){if(a.i.ended)continue;a.i.currentTime=f;break a}gt(a);a.H=g;a.g=new et(e,d+1,g.ads.length,!0,a.i);a.B=e;d===0&&it(a,"breakStart");pt(a);break}}if(!a.g&&a.m)for(const h of a.j){if(a.g)break;for(g=0;g<h.nonLinearAdsList.length;g++){d=
h.nonLinearAdsList[g];if(!d.nonLinearAdList.length)continue;e=h.startTimeInSeconds;f=a.C.get(mt(d.nonLinearAdList[0]));if(e<=b&&f&&f.length){gt(a);e=a;for(const k of f){if(!k.data.source.length)continue;f=document.createElement("img");f.src=k.data.source[0].url;f.style.top=(k.placeholder.top||0)+"%";f.style.height=100-(k.placeholder.top||0)+"%";f.style.left=(k.placeholder.left||0)+"%";f.style.maxWidth=100-(k.placeholder.left||0)+"%";f.style.objectFit="contain";f.style.position="absolute";e.m.appendChild(f)}a.H=
h;a.g=new et(d,g+1,h.ads.length,!1,a.i);a.B=d;g===0&&it(a,"breakStart");pt(a);break}}}c&&!a.g&&(b=a.i.currentTime,a.D&&a.D>b&&(a.i.currentTime=a.D),a.D=null)}}}
function ot(a){const b=a.i.currentTime;if(!(a.G&&a.G.disableSnapback||b==0||a.D!=null)){for(const e of a.j)for(const f of e.ads)if(!c){if(f.startTimeInSeconds<b){var c=f;var d=e}}else if(c.durationInSeconds>0&&f.startTimeInSeconds<b&&f.startTimeInSeconds>c.startTimeInSeconds+c.durationInSeconds){c=f;d=e;break}d&&c&&!a.N.has(c.adId)&&(a.D=b,a.i.currentTime=d.startTimeInSeconds)}}
function it(a,b){if(a.B&&a.H){var c=a.B.trackingEvents.find(d=>d.eventType==b);c||=a.H.adBreakTrackingEvents.find(d=>d.eventType==b);if(c&&a.G&&!a.G.disableTrackingEvents){const d={type:10};for(const e of c.beaconUrls){if(!e||e=="")continue;c=ag([e],If());c.method="POST";a.L.request(7,c,d)}}switch(b){case "impression":a.h(new P("ad-impression"));break;case "start":a.h(new P("ad-started",(new Map).set("ad",a.g)));break;case "mute":a.h(new P("ad-muted"));break;case "unmute":a.h(new P("ad-volume-changed"));
break;case "resume":a.h(new P("ad-resumed"));break;case "pause":a.h(new P("ad-paused"));break;case "firstQuartile":a.h(new P("ad-first-quartile"));break;case "midpoint":a.h(new P("ad-midpoint"));break;case "thirdQuartile":a.h(new P("ad-third-quartile"));break;case "complete":a.h(new P("ad-complete"));a.h(new P("ad-stopped"));break;case "skip":a.h(new P("ad-skipped"));a.h(new P("ad-stopped"));break;case "breakStart":a.m&&a.m.setAttribute("ad-active","true");break;case "breakEnd":a.m&&a.m.removeAttribute("ad-active");
break;case "skipStateChanged":a.h(new P("ad-skip-state-changed"))}}}function pt(a){let b=!1;a.i.paused?b=!0:(it(a,"impression"),it(a,"start"));a.u.push({target:a.i,type:"volumechange",listener:()=>{it(a,a.i.muted?"mute":"unmute")}});a.u.push({target:a.i,type:"play",listener:()=>{b?(it(a,"impression"),it(a,"start"),b=!1):it(a,"resume")}});a.u.push({target:a.i,type:"pause",listener:()=>{it(a,"pause")}});for(const c of a.u)a.o.F(c.target,c.type,c.listener)}
function ht(a,b=!1){b?it(a,"skip"):it(a,"complete");for(const c of a.u)a.o.Ma(c.target,c.type,c.listener);a.u=[];a.A.clear()}
var qt=class{constructor(a,b,c,d){this.m=a;this.L=b;this.G=null;this.i=c;this.l=null;this.S=NaN;this.h=d;this.K=!1;this.D=null;this.j=[];this.N=new Set;this.H=this.B=this.g=null;this.C=new Map;this.u=[];this.A=new Set;this.I="";this.P=!0;this.J="";this.o=new Ca;this.O=!1}configure(a){this.G=a}stop(){for(const a of this.u)this.o.Ma(a.target,a.type,a.listener);gt(this);this.u=[];this.A.clear();this.I="";this.P=!0;this.J="";this.D=null;this.j=[];this.N.clear();this.C.clear();this.l=null;this.O=!1}release(){this.stop();
this.o&&this.o.release()}onManifestUpdated(a){this.K=a;this.I!=""&&(jt(this,this.I,this.P),this.P=!1)}getCuePoints(){const a=new Map;for(const b of this.j)for(const c of b.ads){const d=c.startTimeInSeconds,e=d+c.durationInSeconds;if(!isFinite(d)||!isFinite(e)||e<=d)continue;const f=`${d.toFixed(1)}|${e.toFixed(1)}`;a.has(f)||a.set(f,{start:d,end:e})}return Array.from(a.values()).sort((b,c)=>b.start-c.start)}};var rt=class extends Bf{constructor(a,b){super(b);this.g=a;this.h=null}isClientRendering(){return!1}hasCustomClick(){return!0}getDuration(){return this.h?this.h.duration:-1}getRemainingTime(){return this.h?this.h.duration-this.h.currentTime:-1}isSkippable(){return this.g.isSkippable()}getTimeUntilSkippable(){var a=this.g.getSkipTimeOffset();a=this.getRemainingTime()-a;return Math.max(a,0)}canSkipNow(){return this.getTimeUntilSkippable()==0}skip(){this.video.currentTime+=this.getRemainingTime()}getSequenceLength(){const a=
this.g.getAdPodInfo();return a==null?1:a.getTotalAds()}getPositionInSequence(){const a=this.g.getAdPodInfo();return a==null?1:a.getAdPosition()}getTitle(){return this.g.getTitle()}getDescription(){return this.g.getDescription()}getVastMediaHeight(){return this.g.getVastMediaHeight()}getVastMediaWidth(){return this.g.getVastMediaWidth()}getAdId(){return this.g.getAdId()}getCreativeAdId(){return this.g.getCreativeAdId()}getAdvertiserName(){return this.g.getAdvertiserName()}getTimeOffset(){const a=this.g.getAdPodInfo();
return a==null?0:a.getTimeOffset()}getPodIndex(){const a=this.g.getAdPodInfo();return a==null?0:a.getPodIndex()}release(){this.h=this.g=null}};w("shaka.ads.ServerSideAd",rt);function st(a,b){a.i(new P("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));b=b.getStreamData().url;a.j.resolve(b);a.j=null;a.H||a.h.F(a.l,"seeked",()=>{const c=a.l.currentTime;if(!(a.D&&a.D.disableSnapback||c==0)){a.g.streamTimeForContentTime(c);var d=a.g.previousCuePointForStreamTime(c);d&&!d.played&&(a.o=c,a.l.currentTime=d.start)}})}
var tt=class{constructor(a,b,c,d){this.u=a;this.l=b;this.j=this.D=null;this.G=NaN;this.i=d;this.H=!1;this.A=this.m=this.o=null;this.B="";this.C=[];this.h=new Ca;a=new google.ima.dai.api.UiSettings;a.setLocale(c);this.g=new google.ima.dai.api.StreamManager(this.l,this.u,a);this.i(new P("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g)));this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,e=>{st(this,e)});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,()=>{this.B.length?
this.j.resolve(this.B):this.j.reject("IMA Stream request returned an error and there was no backup asset uri provided.");this.j=null});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,()=>{});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,e=>{e=e.getAd();this.m=new rt(e,this.l);this.A&&(this.m.h=this.A);this.i(new P("ad-started",(new Map).set("ad",this.m)));this.u.setAttribute("ad-active","true")});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,
()=>{this.u.removeAttribute("ad-active");const e=this.l.currentTime;this.o&&this.o>e&&(this.l.currentTime=this.o,this.o=null)});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,e=>{this.A=e.getStreamData().adProgressData;this.m&&(this.m.h=this.A)});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,()=>{this.i(new P("ad-first-quartile"))});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,()=>{this.i(new P("ad-midpoint"))});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,
()=>{this.i(new P("ad-third-quartile"))});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,()=>{this.i(new P("ad-complete"));this.i(new P("ad-stopped"));this.u.removeAttribute("ad-active");this.m=null});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,()=>{this.i(new P("ad-skipped"));this.i(new P("ad-stopped"))});this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,e=>{e=e.getStreamData();const f=[];for(const g of e.cuepoints)f.push({start:g.start,end:g.end});
this.C=f;this.i(new P("ad-cue-points-changed",(new Map).set("cuepoints",f)))})}configure(a){this.D=a}stop(){this.g.reset();this.B="";this.o=null;this.C=[]}release(){this.stop();this.h&&this.h.release()}onCueMetadataChange(a){if(a.key&&a.data){const b={};b[a.key]=a.data;this.g.onTimedMetadata(b)}}getCuePoints(){return this.C}};var ut=class extends Bf{constructor(a,b){super(a);this.g=b}isClientRendering(){return!1}getDuration(){return this.g.endTime?this.g.endTime-this.g.startTime:-1}getRemainingTime(){return this.g.endTime?this.g.endTime-this.video.currentTime:-1}getSequenceLength(){return this.g.sequenceLength}getPositionInSequence(){return this.g.position}getTimeOffset(){return this.g.startTime}};w("shaka.ads.SvtaAd",ut);function vt(a){a.m||(a.m=!0,a.j=a.g.ob())}function wt(a){a.m&&(a.m=!1,a.j=null,a.u.xa(),a.l.clear(),xt(a),a.i.xa(),a.o&&a.o.stop())}function yt(a){const b=[];if(a.l.size)for(const c of a.l.values()){const d={start:c.startTime,end:c.endTime};b.find(e=>d.start==e.start&&d.end==e.end)||b.push(d)}zt(a,"ad-cue-points-changed",(new Map).set("cuepoints",b))}
function At(a,b){if(a.m&&b.length)if(a.g.Rg()){var c=!1;for(const d of b){const e=JSON.stringify(d);a.l.getOrInsert(e,d)===d&&(c=!0)}c&&yt(a);Bt(a);a.u.F(a.j,"timeupdate",()=>Bt(a));a.o&&a.g.isLive()&&a.o.Aa(1)}else a.u.na(a.g,"loaded",()=>{At(a,b)})}
function Ct(a,b){if(a.m&&Dt.has(b.type)){var c=b.values.find(f=>f.key=="X-AD-CREATIVE-SIGNALING");if(c){c=c.data;try{var d=JSON.parse(window.atob(c))}catch(f){return}if(d.payload){c=[];for(let f=0;f<d.payload.length;f++){var e=d.payload[f];const g=b.startTime+e.start||0,h=e.duration?b.startTime+e.duration:b.endTime;e&&e.tracking&&(e={startTime:g,endTime:h,tracking:ss(e.tracking),position:f+1,sequenceLength:d.payload.length},c.push(e))}At(a,c)}}}}
function Bt(a){if(a.l.size&&!a.h&&a.j.duration){var b=a.j.currentTime;for(const c of a.l.values())if(c.startTime<=b&&c.endTime&&b<=c.endTime&&!a.g.Zc()){a.h=c;break}a.h&&(b=!1,a.g.isLive()||(b=a.g.Ea(),b=b.start===a.h.startTime&&b.end===a.h.endTime),Et(a),b?Ft(a):Gt(a))}}function xt(a,b=!1){a.h&&(b||(zt(a,"ad-skipped"),zt(a,"ad-stopped")),a.i.xa(),a.h=null)}
function Et(a){const b=new ut(a.j,a.h);zt(a,"ad-impression");zt(a,"ad-started",(new Map).set("ad",b));a.i.F(a.g,"error",c=>{zt(a,"ad-error",(new Map).set("originalEvent",c))});a.i.F(a.j,"play",()=>{zt(a,"ad-resumed")});a.i.F(a.j,"pause",()=>{zt(a,"ad-paused")});a.i.F(a.j,"volumechange",()=>{a.j.muted?zt(a,"ad-muted"):zt(a,"ad-volume-changed")})}
function Ft(a){a.i.na(a.g,"firstquartile",()=>{zt(a,"ad-first-quartile")});a.i.na(a.g,"midpoint",()=>{zt(a,"ad-midpoint")});a.i.na(a.g,"thirdquartile",()=>{zt(a,"ad-third-quartile")});a.i.na(a.g,"complete",()=>{zt(a,"ad-stopped");zt(a,"ad-complete");xt(a,!0)})}
function Gt(a){var b=a.h.endTime;a.g.isLive()&&b||(b=a.g.Ea(),b=Math.min(b.end,a.h.endTime||Infinity));const c=b-a.h.startTime;let d=-1;const e=(f,g)=>(qj(f,g)||g>f)&&d<f?(d=f,!0):!1;a.i.F(a.j,"timeupdate",()=>{var f=(a.j.currentTime-a.h.startTime)/c;if(!isNaN(f))if(f*=100,e(25,f))zt(a,"ad-first-quartile");else if(e(50,f))zt(a,"ad-midpoint");else if(e(75,f))zt(a,"ad-third-quartile");else if(e(100,f)||f>100)zt(a,"ad-stopped"),zt(a,"ad-complete"),xt(a,!0)})}
function zt(a,b,c){a.D(new P(b,c));if(!a.B.disableTrackingEvents&&(c=a.h&&a.h.tracking)){switch(b){case "ad-impression":var d=c.impression;break;case "ad-clicked":d=c.clickTracking;break;case "ad-started":d=c.start;break;case "ad-first-quartile":d=c.firstQuartile;break;case "ad-midpoint":d=c.midpoint;break;case "ad-third-quartile":d=c.thirdQuartile;break;case "ad-complete":d=c.complete;break;case "ad-skipped":d=c.skip;break;case "ad-error":d=c.error;break;case "ad-resumed":d=c.resume;break;case "ad-paused":d=
c.pause;break;case "ad-muted":d=c.mute;break;case "ad-volume-changed":d=c.unmute}if(d)for(const e of d)b=a,d=ag([e],If()),d.method="POST",b.g.pb().request(7,d,{type:13})}}
var Ht=class{constructor(a,b){this.B=null;this.g=a;this.D=b;this.j=null;this.m=!1;this.l=new Map;this.h=null;this.A=new Ca;this.u=new Ca;this.i=new Ca;this.A.F(this.g,"loading",()=>{vt(this)});this.A.F(this.g,"unloading",()=>{wt(this)});this.o=new te(()=>{if(this.l.size){var c=this.g.Vc();if(c!=Dr&&c!=fs){var d=!1,e=Array.from(this.l.values());c=this.g.Ea();for(const f of e)f!=this.h&&c.start-(f.endTime||f.startTime)>=1&&(d=JSON.stringify(f),this.l.delete(d),d=!0);d&&yt(this)}}});this.g.Cc()&&vt(this)}configure(a){this.B=
a}stop(){wt(this)}release(){this.stop();this.g=null;this.A&&this.A.release();this.u&&this.u.release();this.i&&this.i.release();this.o&&(this.o.stop(),this.o=null)}},Dt=(new Set).add("urn:svta:advertising-wg:ad-id-signaling").add("urn:svta:advertising-wg:ad-creative-signaling");function It(a,b){if(b&&b.type)switch(b.type){case "ads-loaded":a.o.g.push(b.loadTime);break;case "ad-started":a.o.h++;a.u=b.ad;a.u&&!a.u.isLinear()&&a.o.j++;break;case "ad-stopped":a.u=null;break;case "ad-complete":a.o.l++;break;case "ad-skipped":a.o.m++;break;case "ad-error":a.o.i++}a.dispatchEvent(b)}
function Jt(a,b){if(!window.google||!google.ima||!google.ima.AdsLoader)throw new H(2,10,1E4);a.l&&a.l.release();if(!a.B)throw new H(2,10,10008);a.l=new zs(a.B,a.A.ob(),a.C,b,c=>It(a,c));a.l.configure(a.j)}function Kt(a){if(!window.google||!google.ima||!google.ima.dai)throw new H(2,10,10002);a.h&&a.h.release();if(!a.D)throw new H(2,10,10009);a.h=new tt(a.D,a.A.ob(),a.C,b=>It(a,b));a.h.configure(a.j)}function Lt(a){a.i&&a.i.release();a.i=new qt(a.D,a.A.pb(),a.A.ob(),b=>It(a,b));a.i.configure(a.j)}
function Mt(a){const b=a.B;a.g&&a.g.release();a.g=new ct(b,a.A,c=>It(a,c));a.g.configure(a.j)}function Nt(a){a.m&&a.m.release();a.m=new Ht(a.A,b=>It(a,b));a.m.configure(a.j)}
var Ot=class extends Vf{constructor(a){super();this.A=a;this.m=this.h=this.i=this.l=this.g=null;this.o=new ks;this.C=navigator.language;this.D=this.B=this.u=this.j=null}setLocale(a){this.C=a}setContainers(a,b){this.B=a;this.D=b}configure(a){this.j=a;this.g&&this.g.configure(this.j);this.l&&this.l.configure(this.j);this.h&&this.h.configure(this.j);this.m&&this.m.configure(this.j);this.i&&this.i.configure(this.j)}release(){this.l&&(this.l.release(),this.l=null);this.h&&(this.h.release(),this.h=null);
this.i&&(this.i.release(),this.i=null);this.g&&(this.g.release(),this.g=null);this.m&&(this.m.release(),this.m=null);super.release()}onAssetUnload(){this.l&&(this.l.release(),this.l=null);this.h&&this.h.stop();this.i&&this.i.stop();this.g&&this.g.stop();this.m&&this.m.stop();this.u&&(It(this,new P("ad-stopped")),It(this,new P("ad-content-attach-requested")));this.o=new ks}requestClientSideAds(a,b){this.l||Jt(this,b);b=this.l;b.g&&b.g.destroy();b.m&&b.m.contentComplete();b.G=Date.now()/1E3;b.m.requestAds(a)}updateClientSideAdsRenderingSettings(a){this.l||
Jt(this,a);var b=this.l;b.B=a;b.g&&b.g.updateAdsRenderingSettings(b.B)}requestServerSideStream(a,b=""){this.h||Kt(this);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&ma('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');a.adTagParameters.mpt="shaka-player";a.adTagParameters.mpv="v5.1.10";c=this.h;c.j?a=Promise.reject(new H(1,10,10004)):(a instanceof
google.ima.dai.api.LiveStreamRequest&&(c.H=!0),c.j=Promise.withResolvers(),c.g.requestStream(a),c.B=b||"",c.G=Date.now()/1E3,a=c.j.promise);return a}replaceServerSideAdTagParameters(a){this.h||Kt(this);(a.mpt||a.mpv)&&ma('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');a.mpt="Shaka Player";a.mpv="v5.1.10";this.h.g.replaceAdTagParameters(a)}requestMediaTailorStream(a,b,c=""){this.i||
Lt(this);var d=this.i;d.l?a=Promise.reject(new H(1,10,10004)):(d.l=Promise.withResolvers(),ft(d,a,b),d.J=c||"",d.S=Date.now()/1E3,a=d.l.promise);return a}addMediaTailorTrackingUrl(a){this.i||Lt(this);var b=this.i;b.I=a;b.h(new P("ads-loaded",(new Map).set("loadTime",0)))}addCustomInterstitial(a){this.g||Mt(this);Ys(this.g,[a])}addAdUrlInterstitial(a){this.g||Mt(this);return this.g.addAdUrlInterstitial(a)}getInterstitialPlayer(){this.g||Mt(this);return this.g.Wc()}getCuePoints(){let a=[];this.h&&(a=
a.concat(this.h.getCuePoints()));this.i&&(a=a.concat(this.i.getCuePoints()));return a}getStats(){var a=this.o;return{loadTimes:a.g,averageLoadTime:js(a),started:a.h,overlayAds:a.j,playedCompletely:a.l,skipped:a.m,errors:a.i}}onManifestUpdated(a){if(this.i)this.i.onManifestUpdated(a)}onHlsTimedMetadata(a,b){this.h&&this.h.g.processMetadata("ID3",a.data,b)}onCueMetadataChange(a){if(this.h)this.h.onCueMetadataChange(a)}async onHLSMetadata(a){a.type=="com.apple.quicktime.HLS"?this.j&&this.j.disableHLSInterstitial||
(this.g||Mt(this),this.g&&await $s(this.g,a)):Dt.has(a.type)&&(this.m||Nt(this),Ct(this.m,a))}onDASHMetadata(a){var b=a.schemeIdUri;if(b=="urn:google:dai:2018")this.h&&this.h.g.processMetadata(a.schemeIdUri,a.eventNode?a.eventNode.attributes.messageData:null,a.startTime);else if(b=="urn:mpeg:dash:event:alternativeMPD:insert:2025"||b=="urn:mpeg:dash:event:alternativeMPD:replace:2025"){if(!this.j||!this.j.disableDASHInterstitial)if(this.g||Mt(this),this.g){var c=this.g;const n=a.schemeIdUri=="urn:mpeg:dash:event:alternativeMPD:replace:2025",
p=a.schemeIdUri=="urn:mpeg:dash:event:alternativeMPD:insert:2025";if(n||p){b=a.startTime;var d=a.endTime,e=null,f=0,g=!0,h=null;for(var k of a.eventNode.children)if(k.tagName=="AlternativeMPD"){var l=k.attributes.uri;if(l){var m=l;break}}else if(k.tagName=="InsertPresentation"||k.tagName=="ReplacePresentation")if(l=k.attributes.uri||k.attributes.url){m=Ab(l);(l=N(k,"maxDuration",Yc))&&(e=l/a.timescale);(l=N(k,"returnOffset",Yc))&&(f=l/a.timescale);n&&f&&(d=b+f);N(k,"noJump",Yc)&&(g=!1);k=N(k,"skipAfter",
Wc);typeof k=="number"&&(h=k);break}m&&Ys(c,[{id:a.id,groupId:null,startTime:b,endTime:d,uri:m,mimeType:null,isSkippable:h!=null,skipOffset:h,skipFor:null,canJump:g,resumeOffset:p?f:null,playoutLimit:e,once:!1,pre:!1,post:!1,timelineRange:n&&!p,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null,tracking:null}])}}}else if((b=="urn:mpeg:dash:event:2012"||b=="urn:scte:dash:scte214-events")&&a.eventNode&&Qc(a.eventNode,"OverlayEvent"))this.j&&this.j.disableDASHInterstitial||
(this.g||Mt(this),this.g&&at(this.g,a));else if(Dt.has(a.schemeIdUri)&&a.eventNode)a:if(this.m||Nt(this),m=this.m,m.m&&Dt.has(a.schemeIdUri)&&a.eventNode&&(k=Nc(a.eventNode))){try{c=JSON.parse(k)}catch(n){break a}if(c.payload){k=[];for(b=0;b<c.payload.length;b++)d=c.payload[b],e=a.startTime+d.start||0,f=d.duration?a.startTime+d.duration:a.endTime,d&&d.tracking&&(d={startTime:e,endTime:f,tracking:ss(d.tracking),position:b+1,sequenceLength:c.payload.length},k.push(d));At(m,k)}}}getCurrentAd(){return this.u}};
w("shaka.ads.AdManager",Ot);Ot.prototype.getCurrentAd=Ot.prototype.getCurrentAd;Ot.prototype.onDASHMetadata=Ot.prototype.onDASHMetadata;Ot.prototype.onHLSMetadata=Ot.prototype.onHLSMetadata;Ot.prototype.onCueMetadataChange=Ot.prototype.onCueMetadataChange;Ot.prototype.onHlsTimedMetadata=Ot.prototype.onHlsTimedMetadata;Ot.prototype.onManifestUpdated=Ot.prototype.onManifestUpdated;Ot.prototype.getStats=Ot.prototype.getStats;Ot.prototype.getCuePoints=Ot.prototype.getCuePoints;
Ot.prototype.getInterstitialPlayer=Ot.prototype.getInterstitialPlayer;Ot.prototype.addAdUrlInterstitial=Ot.prototype.addAdUrlInterstitial;Ot.prototype.addCustomInterstitial=Ot.prototype.addCustomInterstitial;Ot.prototype.addMediaTailorTrackingUrl=Ot.prototype.addMediaTailorTrackingUrl;Ot.prototype.requestMediaTailorStream=Ot.prototype.requestMediaTailorStream;Ot.prototype.replaceServerSideAdTagParameters=Ot.prototype.replaceServerSideAdTagParameters;Ot.prototype.requestServerSideStream=Ot.prototype.requestServerSideStream;
Ot.prototype.updateClientSideAdsRenderingSettings=Ot.prototype.updateClientSideAdsRenderingSettings;Ot.prototype.requestClientSideAds=Ot.prototype.requestClientSideAds;Ot.prototype.onAssetUnload=Ot.prototype.onAssetUnload;Ot.prototype.release=Ot.prototype.release;Ot.prototype.configure=Ot.prototype.configure;Ot.prototype.setContainers=Ot.prototype.setContainers;Ot.prototype.setLocale=Ot.prototype.setLocale;gs=a=>new Ot(a);function Pt(a){return JSON.stringify(a,(b,c)=>{if(typeof c!="function"){b=c instanceof P;if(c instanceof Event||b){var d={};for(var e in c){var f=c[e];f&&typeof f=="object"?e=="detail"?d[e]=f:f instanceof Event||f instanceof P?d[e]={__type__:"Event",event:Pt(f)}:b&&Array.isArray(f)&&(d[e]=f):e in Event||(d[e]=f)}return d}if(c instanceof Error){e=new Set(["name","message","stack"]);for(f in c)e.add(f);for(const g of Object.getOwnPropertyNames(c))e.add(g);b={};for(d of e)b[d]=c[d];c={__type__:"Error",
contents:b}}else if(c instanceof TimeRanges){e={__type__:"TimeRanges",length:c.length,start:[],end:[]};for(const {start:g,end:h}of $i(c))e.start.push(g),e.end.push(h);c=e}else c=ArrayBuffer.isView(c)&&c.BYTES_PER_ELEMENT===1?{__type__:"Uint8Array",entries:Array.from(c)}:typeof c=="number"?isNaN(c)?"NaN":isFinite(c)?c:c<0?"-Infinity":"Infinity":c;return c}})}
function Qt(a){return JSON.parse(a,(b,c)=>{if(c=="NaN")var d=NaN;else if(c=="-Infinity")d=-Infinity;else if(c=="Infinity")d=Infinity;else if(c&&typeof c=="object"&&c.__type__=="TimeRanges")d=Rt(c);else if(c&&typeof c=="object"&&c.__type__=="Uint8Array")d=new Uint8Array(c.entries);else if(c&&typeof c=="object"&&c.__type__=="Error"){b=c.contents;c=Error(b.message);for(d in b)c[d]=b[d];d=c}else d=c&&typeof c=="object"&&c.__type__=="Event"?Qt(c.event):c;return d})}
function Rt(a){return{length:a.length,start:b=>a.start[b],end:b=>a.end[b]}}
var St="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),Tt="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Ut=["loop","playbackRate"],Vt=["pause","play"],Wt=(new Map).set("getAssetUri",2).set("getMimeType",2).set("getBufferFullness",1).set("getBufferedInfo",2).set("getExpiration",2).set("getKeyStatuses",2).set("getPlaybackRate",2).set("isAudioOnly",10).set("isBuffering",1).set("isInProgress",
1).set("isLive",10).set("isDynamic",10).set("isVideoOnly",10).set("keySystem",10).set("seekRange",1).set("getLoadMode",10).set("getManifestType",10).set("isFullyLoaded",1).set("isEnded",1).set("getBandwidthEstimate",1).set("isRemotePlayback",1),Xt=(new Map).set("getConfiguration",4).set("getNonDefaultConfiguration",4).set("getConfigurationForLowLatency",4).set("getStats",5).set("getAudioTracks",2).set("getChaptersTracks",2).set("getImageTracks",2).set("getVideoTracks",2).set("getTextTracks",2).set("getVariantTracks",
2).set("getFetchedPlaybackInfo",2).set("getAllMetadataRegions",1).set("getAllEmsgRegions",1).set("getAllTimelineRegions",1),Yt=(new Map).set("getPlayheadTimeAsDate",1).set("getPresentationStartTimeAsDate",20).set("getSegmentAvailabilityDuration",20).set("getLiveLatency",1),Zt=[["getNonDefaultConfiguration","configure","getConfigurationForLowLatency","configurationForLowLatency"]],$t="cancelTrickPlay configure configurationForLowLatency resetConfiguration retryStreaming selectAudioTrack selectTextTrack selectVariantTrack selectVideoTrack trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable setMaxHardwareResolution renewLicense retryLicensing".split(" "),
au="addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" "),bu=(new Map).set("getCuePoints",4).set("getStats",5),cu="setLocale configure requestClientSideAds updateClientSideAdsRenderingSettings addMediaTailorTrackingUrl replaceServerSideAdTagParameters addCustomInterstitial".split(" "),du=["requestMediaTailorStream","requestServerSideStream","addAdUrlInterstitial"],eu="ads-loaded ad-started ad-first-quartile ad-midpoint ad-third-quartile ad-complete ad-stopped ad-skipped ad-volume-changed ad-muted ad-paused ad-resumed ad-skip-state-changed ad-cue-points-changed ima-ad-manager-loaded ima-stream-manager-loaded ad-clicked ad-progress ad-buffering ad-impression ad-duration-changed ad-closed ad-loaded all-ads-completed ad-linear-changed ad-metadata ad-recoverable-error ad-error ad-break-ready ad-interaction ad-content-pause-requested ad-content-resume-requested ad-content-attach-requested ad-playing ad-break-started ad-break-ended ad-interstitial-preload ad-interstitial-preloaded".split(" "),
fu=(new Map).set("needsSkipUI",20).set("isClientRendering",20).set("hasCustomClick",20).set("isUsingAnotherMediaElement",20).set("getDuration",1).set("getMinSuggestedDuration",1).set("getRemainingTime",1).set("getTimeUntilSkippable",1).set("isPaused",1).set("isSkippable",1).set("canSkipNow",1).set("getVolume",1).set("isMuted",1).set("isLinear",20).set("getSequenceLength",20).set("getPositionInSequence",20).set("getTitle",20).set("getDescription",20).set("getVastMediaBitrate",20).set("getVastMediaHeight",
20).set("getVastMediaWidth",20).set("getVastAdId",20).set("getAdId",20).set("getCreativeAdId",20).set("getAdvertiserName",20).set("getMediaUrl",20).set("getTimeOffset",20).set("getPodIndex",20),gu="skip play pause setVolume setMuted resize".split(" ");function hu(a){const b=iu?iu.status=="connected":!1;if(a.i&&!b){a.C();for(const c in a.g)a.g[c]={};ju(a)}a.i=b;a.I=b?iu.receiver.friendlyName:"";a.l.La()}function ju(a){if(a.h)for(const b of a.h.keys()){const c=a.h.get(b);a.h.delete(b);c.reject(new H(1,7,7E3))}}function ku(a){const b=iu;b.removeUpdateListener(a.B);b.removeMessageListener("urn:x-cast:com.google.shaka.v2",a.D)}
function lu(a,b){b=Pt(b);var c=iu;try{c.sendMessage("urn:x-cast:com.google.shaka.v2",b,()=>{},pa)}catch(d){throw b=new H(2,8,8005,d),c=new P("error",(new Map).set("detail",b)),a.A("player",c),a.Tc(),b;}}function mu(a,b){const c=a.L();iu=b;b.addUpdateListener(a.B);b.addMessageListener("urn:x-cast:com.google.shaka.v2",a.D);hu(a);lu(a,{type:"init",initState:c,appData:a.o});a.j.resolve()}
function nu(a,b){let c=8003;switch(b.code){case "cancel":c=8004;break;case "timeout":c=8005;break;case "receiver_unavailable":c=8006}a.j.reject(new H(2,8,c,b))}function ou(a){a.i&&chrome.cast.requestSession(b=>mu(a,b),b=>nu(a,b))}function pu(a,b,c,...d){lu(a,{type:"call",targetName:b,methodName:c,args:d})}
function qu(a,b,c,...d){const e=Promise.withResolvers(),f=a.H.toString();a.H++;a.h.set(f,e);try{lu(a,{type:"asyncCall",targetName:b,methodName:c,args:d,id:f})}catch(g){e.reject(g)}return e.promise}
var wu=class{constructor(a,b,c,d,e,f,g){this.G=a;this.J=g;this.l=new te(b);this.K=c;this.u=!1;this.A=d;this.C=e;this.L=f;this.i=this.m=!1;this.I="";this.o=null;this.B=()=>hu(this);this.D=(h,k)=>{h=Qt(k);switch(h.type){case "event":var l=h.targetName,m=Tf(h.event);this.A(l,m);break;case "update":l=h.update;for(m in l){h=this.g[m]||{};for(var n in l[m])h[n]=l[m][n]}this.u&&(this.K(),this.u=!1);break;case "asyncComplete":if(n=h.id,m=h.error,k=h.res,h=this.h.get(n),this.h.delete(n),h)if(m){n=new H(m.severity,
m.category,m.code);for(l in m)n[l]=m[l];h.reject(n)}else h.resolve(k)}};this.g={video:{},player:{},adManager:{},currentAd:{}};this.H=0;this.h=new Map;this.j=null;ru.add(this)}destroy(){ru.delete(this);ju(this);iu&&ku(this);this.l&&(this.l.stop(),this.l=null);this.C=this.A=null;this.i=this.m=!1;this.D=this.B=this.j=this.h=this.g=this.o=null;return Promise.resolve()}ab(){return this.i}Yf(){return this.I}init(){if(this.G.length)if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0;this.l.La();
var a=new chrome.cast.SessionRequest(this.G,[],null,this.J,null);a=new chrome.cast.ApiConfig(a,b=>{for(const e of ru){var c=e,d=b;c.j=Promise.withResolvers();c.u=!0;mu(c,d)}},b=>{for(const c of ru)su=b=="available",c.l.La()},"origin_scoped");chrome.cast.initialize(a,()=>{},()=>{});su&&this.l.ha(tu);(a=iu)&&a.status!=chrome.cast.SessionStatus.STOPPED?(this.j=Promise.withResolvers(),this.u=!0,mu(this,a)):iu=null}else window.__onGCastApiAvailable!==uu&&(vu=window.__onGCastApiAvailable||null,window.__onGCastApiAvailable=
uu)}hg(a){this.o=a;this.i&&lu(this,{type:"appData",appData:this.o})}async cast(){if(!this.m)throw new H(1,8,8E3);if(!su)throw new H(1,8,8001);if(this.i)throw new H(1,8,8002);this.j=Promise.withResolvers();chrome.cast.requestSession(a=>mu(this,a),a=>nu(this,a));await this.j.promise}Tc(){if(this.i){ju(this);if(iu){ku(this);try{iu.stop(()=>{},()=>{})}catch(a){}iu=null}hu(this)}}get(a,b){const c={video:{Pd:Vt},player:{Pd:$t,Wf:au,re:[Wt,Xt],bh:Yt},adManager:{Pd:cu,Wf:du,re:[bu]},currentAd:{Pd:gu,re:[fu]}}[a];
return c.bh&&c.bh.has(b)&&!this.get("player","isLive")()?()=>{}:c.Pd&&c.Pd.includes(b)?(...d)=>pu(this,a,b,...d):c.Wf&&c.Wf.includes(b)?(...d)=>qu(this,a,b,...d):c.re&&c.re.some(d=>d.has(b))?()=>this.g[a][b]:this.g[a][b]}set(a,b,c){this.g[a][b]=c;lu(this,{type:"set",targetName:a,property:b,value:c})}},tu=.02,su=!1,iu=null,vu=null,ru=new Set,uu=a=>{vu?window.__onGCastApiAvailable=vu:delete window.__onGCastApiAvailable;vu=null;if(a)for(const b of ru)b.init();typeof window.__onGCastApiAvailable==="function"&&
window.__onGCastApiAvailable(a)};function xu(a){const b=new P("caststatuschanged");a.dispatchEvent(b)}function yu(a){const b=new P(a.u.paused?"pause":"play");a.o.dispatchEvent(b)}function zu(a,b,c){a.g.ab()&&(b=="video"?a.o.dispatchEvent(c):b=="player"?(c.type=="unloading"&&Au(a),a.D.dispatchEvent(c)):b=="adManager"&&(c.type=="ad-started"?a.G=new Proxy(new Bu,{get:(d,e)=>typeof e!="string"?d[e]:a.g.ab()?a.g.get("currentAd",e):null}):c.type=="ad-stopped"&&(a.G=null),a.A.dispatchEvent(c)))}
function Cu(a){for(var b of Zt){var c=b[1],d=a.g.get("player",b[0])();a.h[c](d)}const e=a.j.Zb,f=a.j.Gb,g=a.j.Yb;Au(a);const h=a.g.get("player","getAssetUri")();d=a.g.get("video","ended");b=Promise.resolve();const k=a.i.autoplay;c=null;d||(c=a.g.get("video","currentTime"));let l;(d=a.g.get("player","getTextTracks")())&&d.length&&(l=d.find(n=>n.active));h&&(a.i.autoplay=!1,b=a.h.load(h,c));const m={};for(const n of Ut)m[n]=a.g.get("video",n);b.then(()=>{if(a.i){for(var n of e)a.Wc().Zb(...n);for(const p of f)a.Wc().Gb(...p);
for(const p of g)a.Wc().Yb(...p);for(const p of Ut)a.i[p]=m[p];l?(n=a.h.ub().find(p=>p.language==l.language&&za(p.roles,l.roles)&&p.forced==l.forced),a.h.lc(n)):a.h.lc();a.i.autoplay=k;h&&a.i.play()}},n=>{n=(new Map).set("detail",n);n=new P("error",n);a.h.dispatchEvent(n)})}
function Du(a){const b={video:{},player:{},manifest:a.h.Cc(),startTime:null,mimeType:a.h.oe(),addThumbnailsTrackCalls:a.j.Zb,addTextTrackAsyncCalls:a.j.Gb,addChaptersTrackCalls:a.j.Yb};a.i.pause();for(var c of Ut)b.video[c]=a.i[c];a.i.ended||(b.startTime=a.i.currentTime);for(const d of Zt){c=d[1];const e=a.h[d[0]]();b.player[c]=e}return b}
function Eu(a){a.g.init();a.l=new Ca;for(const b of St)a.l.F(a.i,b,c=>{a.g.ab()||(c=Tf(c),a.o.dispatchEvent(c))});for(const b in Uf)a.l.F(a.h,Uf[b],c=>{a.g.ab()||a.D.dispatchEvent(c)});if(a.m)for(const b of eu)a.l.F(a.m,b,c=>{a.g.ab()||a.A.dispatchEvent(c)});a.u=new Proxy(a.i,{get:(b,c)=>typeof c!="string"?b[c]:Fu(a,c),set:(b,c,d)=>{if(typeof c!="string")return b[c]=d,!0;a.g.ab()?a.g.set("video",c,d):a.i[c]=d;return!0}});a.C=new Proxy(a.h,{get:(b,c)=>typeof c!="string"?b[c]:Gu(a,c)});a.m&&(a.B=new Proxy(a.m,
{get:(b,c)=>typeof c!="string"?b[c]:Hu(a,c)}));Iu(b=>{Ju(b,a.h)},a.I);Iu(b=>{Ju(b,a.m)},a.H);a.o=new Vf;a.o.Sd=a.u;a.D=new Vf;a.D.Sd=a.C;a.A=new Vf;a.A.Sd=a.B;a.l.F(a.h,"unloading",()=>{a.g&&a.g.ab()||Au(a)})}function Fu(a,b){if(b=="addEventListener")return(c,d,e)=>a.o.addEventListener(c,d,e);if(b=="removeEventListener")return(c,d,e)=>a.o.removeEventListener(c,d,e);if(a.g.ab()&&Object.keys(a.g.g.video).length==0){const c=a.i[b];if(typeof c!="function")return c}return Ku(a,a.i,"video",b)}
function Gu(a,b,c=!1){a.I.has(b)&&(b=a.I.get(b));if(b=="addEventListener")return(d,e,f)=>a.D.addEventListener(d,e,f);if(b=="removeEventListener")return(d,e,f)=>a.D.removeEventListener(d,e,f);if(b=="getMediaElement")return()=>a.u;if(b=="getSharedConfiguration")return a.g.get("player","getConfiguration");if(b=="getNetworkingEngine")return()=>a.h.pb();if(b=="getDrmEngine")return()=>a.h.A;if(b=="getAdManager")return()=>a.B;if(b=="getQueueManager")return()=>a.h.Og();if(b=="setVideoContainer")return d=>
a.h.nh(d);if(!c){if(b=="addThumbnailsTrack")return(...d)=>{a.j.Zb.push(d);return Gu(a,b,!0)(...d)};if(b=="addTextTrackAsync")return(...d)=>{a.j.Gb.push(d);return Gu(a,b,!0)(...d)};if(b=="addChaptersTrack")return(...d)=>{a.j.Yb.push(d);return Gu(a,b,!0)(...d)}}if(a.g.ab()){if(b=="getManifest"||b=="drmInfo")return()=>{ma(b+"() does not work while casting!");return null};if(b=="attach"||b=="detach")return()=>{ma(b+"() does not work while casting!");return Promise.resolve()}}return a.g.ab()&&Object.keys(a.g.g.video).length==
0&&(Wt.has(b)||Xt.has(b))?(c=a.h[b],typeof c!="function"?c:c.bind(a.h)):Ku(a,a.h,"player",b)}function Hu(a,b){a.H.has(b)&&(b=a.H.get(b));return b=="addEventListener"?(c,d,e)=>a.A.addEventListener(c,d,e):b=="removeEventListener"?(c,d,e)=>a.A.removeEventListener(c,d,e):Ku(a,a.m,"adManager",b)}function Iu(a,b){const c=new Map;a((d,e)=>{c.has(e)?(e=c.get(e),d.length<e.length?b.set(d,e):b.set(e,d)):c.set(e,d)})}function Au(a){a.j.Zb=[];a.j.Gb=[];a.j.Yb=[]}
function Ju(a,b){function c(g){return g=="constructor"||typeof b[g]!="function"?!1:!d.has(g)}const d=new Set;for(var e in b)c(e)&&(d.add(e),a(e,b[e]));e=Object.getPrototypeOf(b);const f=Object.getPrototypeOf({});for(;e&&e!=f;){for(const g of Object.getOwnPropertyNames(e))c(g)&&(d.add(g),a(g,b[g]));e=Object.getPrototypeOf(e)}}function Ku(a,b,c,d){return a.g.ab()?d=="getCurrentAd"?()=>a.G:a.g.get(c,d):(c=b[d],typeof c=="function"?c.bind(b):c)}
var Lu=class extends Vf{constructor(a,b,c,d=!1){super();this.i=a;this.h=b;this.m=this.h.td();this.l=this.A=this.D=this.o=this.G=this.B=this.C=this.u=null;this.K=c;this.J=d;this.j={Zb:[],Gb:[],Yb:[]};this.I=new Map;this.H=new Map;this.g=null;window.chrome&&typeof Proxy!="undefined"&&A().i()!="CAST"?(this.g=new wu(c,()=>xu(this),()=>yu(this),(e,f)=>zu(this,e,f),()=>Cu(this),()=>Du(this),d),Eu(this)):(this.u=this.i,this.C=this.h,this.B=this.m)}destroy(a=!1){this.g&&a&&this.g.Tc();this.l&&(this.l.release(),
this.l=null);a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.g&&(a.push(this.g.destroy()),this.g=null);this.G=this.B=this.C=this.u=this.m=this.i=null;super.release();return Promise.all(a)}si(){return this.u}Wc(){return this.C}td(){return this.B}Dh(){return this.g?this.g.m&&su:!1}ab(){return this.g?this.g.ab():!1}Yf(){return this.g?this.g.Yf():""}async cast(){this.g&&(await this.g.cast(),this.h&&await this.h.mc())}hg(a){this.g&&this.g.hg(a)}nj(){this.g&&ou(this.g)}Tc(){this.g&&this.g.Tc()}async Eh(a,
b=!1){if(a!=this.K||b!=this.J)this.K=a,this.J=b,this.g&&(this.g.Tc(),await this.g.destroy(),this.g=null,this.g=new wu(a,()=>xu(this),()=>yu(this),(c,d)=>zu(this,c,d),()=>Cu(this),()=>Du(this),b),this.g.init())}};w("shaka.cast.CastProxy",Lu);Lu.prototype.changeReceiverId=Lu.prototype.Eh;Lu.prototype.forceDisconnect=Lu.prototype.Tc;Lu.prototype.suggestDisconnect=Lu.prototype.nj;Lu.prototype.setAppData=Lu.prototype.hg;Lu.prototype.cast=Lu.prototype.cast;Lu.prototype.receiverName=Lu.prototype.Yf;
Lu.prototype.isCasting=Lu.prototype.ab;Lu.prototype.canCast=Lu.prototype.Dh;Lu.prototype.getAdManager=Lu.prototype.td;Lu.prototype.getPlayer=Lu.prototype.Wc;Lu.prototype.getVideo=Lu.prototype.si;Lu.prototype.destroy=Lu.prototype.destroy;var Bu=class extends Bf{};function Mu(a){a.H.ha(Nu);const b={video:{},player:{},currentAd:{}};for(var c of Tt)b.video[c]=a.g[c];a.h.isLive()&&Yt.forEach((d,e)=>{a.j%d==0&&(b.player[e]=a.h[e]())});Wt.forEach((d,e)=>{a.j%d==0&&(b.player[e]=a.h[e]())});a.u&&fu.forEach((d,e)=>{a.j%d==0&&(b.currentAd[e]=a.u[e]())});if(c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())b.video.volume=c.level,b.video.muted=c.muted;Ou(a,{type:"update",update:b},a.m);Xt.forEach((d,e)=>{a.j%d==0&&(d={player:{}},d.player[e]=a.h[e](),
Ou(a,{type:"update",update:d},a.m))});a.o&&bu.forEach((d,e)=>{a.j%d==0&&(d={adManager:{}},d.adManager[e]=a.o[e](),Ou(a,{type:"update",update:d},a.m))});a.G&&(a.j+=1);Pu(a)}
function Qu(a){const b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected=()=>Ru(a);b.onSenderDisconnected=()=>Ru(a);b.onSystemVolumeChanged=()=>{const c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();c&&Ou(a,{type:"update",update:{video:{volume:c.level,muted:c.muted}}},a.m);Ou(a,{type:"event",targetName:"video",event:{type:"volumechange"}},a.m)};a.D=b.getCastMessageBus("urn:x-cast:com.google.cast.media");a.D.onMessage=c=>Su(a,c);a.m=b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");
a.m.onMessage=c=>Tu(a,c);b.start();for(const c of St)a.i.F(a.g,c,d=>Uu(a,"video",d));for(const c in Uf)a.i.F(a.h,Uf[c],d=>Uu(a,"player",d));if(a.o)for(const c of eu)a.i.F(a.o,c,d=>{d.type=="ad-started"?(a.u=a.o.getCurrentAd(),a.j=0,a.B.currentAd=a.u):d.type=="ad-stopped"&&(a.u=null,a.B.currentAd=a.u);Uu(a,"adManager",d)});a.i.F(a.g,"loadeddata",()=>{a.G=!0});a.i.F(a.h,"loading",()=>{a.A=!1;Vu(a)});a.i.F(a.g,"playing",()=>{a.A=!1;Vu(a)});a.i.F(a.g,"pause",()=>{Vu(a)});a.i.F(a.h,"unloading",()=>{a.A=
!0;Vu(a)});a.i.F(a.g,"ended",()=>{(new te(()=>{a.g&&a.g.ended&&(a.A=!0,Vu(a))})).ha(Wu)})}function Xu(a){a.l||(a.l={metadataType:cast.receiver.media.MetadataType.GENERIC})}function Ru(a){a.j=0;a.C=!0;a.J=cast.receiver.CastReceiverManager.getInstance().getSenders().length!=0;Vu(a)}
function Su(a,b){const c=Qt(b.data);switch(c.type){case "PLAY":a.g.play();Yu(a);break;case "PAUSE":a.g.pause();Yu(a);break;case "SEEK":b=c.currentTime;var d=c.resumeState;b!=null&&(a.g.currentTime=Number(b));d&&d=="PLAYBACK_START"?(a.g.play(),Yu(a)):d&&d=="PLAYBACK_PAUSE"&&(a.g.pause(),Yu(a));break;case "STOP":a.h.mc().then(()=>{a.h&&Yu(a)});break;case "GET_STATUS":Zu(a,Number(c.requestId));break;case "VOLUME":d=c.volume;b=d.level;d=d.muted;var e=a.g.volume,f=a.g.muted;b!=null&&(a.g.volume=Number(b));
d!=null&&(a.g.muted=d);e==a.g.volume&&f==a.g.muted||Yu(a);break;case "LOAD":a.j=0;a.G=!1;a.C=!1;b=c.media;d=c.currentTime;e=a.K(b.contentId);f=c.autoplay||!0;a.I(b.customData);f&&(a.g.autoplay=!0);a.h.load(e,d).then(()=>{a.h&&Zu(a)}).catch(g=>{let h="LOAD_FAILED";g.category==7&&g.code==7E3&&(h="LOAD_CANCELLED");Ou(a,{requestId:Number(c.requestId),type:h},a.D)});break;default:Ou(a,{requestId:Number(c.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},a.D)}}
function Tu(a,b){var c=Qt(b.data);switch(c.type){case "init":a.j=0;a.G=!1;a.C=!0;$u(a,c.initState,c.appData);Mu(a);break;case "appData":a.I(c.appData);break;case "set":var d=c.targetName,e=c.property;c=c.value;if(d=="video")if(b=cast.receiver.CastReceiverManager.getInstance(),e=="volume"){b.setSystemVolumeLevel(c);break}else if(e=="muted"){b.setSystemVolumeMuted(c);break}a.B[d]&&(a.B[d][e]=c);break;case "call":d=c.methodName;e=c.args;(c=a.B[c.targetName])&&c[d].apply(c,e);break;case "asyncCall":d=
c.targetName;e=c.methodName;d=="player"&&e=="load"&&(a.j=0,a.G=!1);const f=c.id,g=b.senderId;b=a.B[d];c=b[e].apply(b,c.args);d=="player"&&e=="load"&&(c=c.then(()=>{a.C=!0}));c.then(h=>av(a,g,f,null,h),h=>av(a,g,f,h,null))}}function Uu(a,b,c){a.h&&(Mu(a),Ou(a,{type:"event",targetName:b,event:c},a.m))}async function Vu(a){await Promise.resolve();if(a.h){var b=new P("caststatuschanged");a.dispatchEvent(b);Pu(a)||Yu(a)}}function Pu(a){return a.C&&(a.g.duration||a.h.isLive())?(Zu(a),a.C=!1,!0):!1}
function Yu(a,b=0,c=null){const d={mediaSessionId:0,playbackRate:a.g.playbackRate,playerState:a.A?bv:a.h.Lf()?cv:a.g.paused?dv:ev,currentTime:a.g.currentTime,supportedMediaCommands:63,volume:{level:a.g.volume,muted:a.g.muted}};c&&(d.media=c);Ou(a,{requestId:b,type:"MEDIA_STATUS",status:[d]},a.D)}
async function $u(a,b,c){for(const d in b.player)a.h[d](b.player[d]);a.I(c);c=a.g.autoplay;if(b.manifest){a.g.autoplay=!1;try{await a.h.load(b.manifest,b.startTime,b.mimeType);if(b.addThumbnailsTrackCalls)for(const d of b.addThumbnailsTrackCalls)a.h.Zb(...d);if(b.addTextTrackAsyncCalls)for(const d of b.addTextTrackAsyncCalls)a.h.Gb(...d);if(b.addChaptersTrackCalls)for(const d of b.addChaptersTrackCalls)a.h.Yb(...d)}catch(d){b=(new Map).set("detail",d);b=new P("error",b);a.h&&a.h.dispatchEvent(b);
return}}else await Promise.resolve();if(a.h){for(const d in b.video)a.g[d]=b.video[d];a.g.autoplay=c;b.manifest&&(a.g.play(),Yu(a))}}function Ou(a,b,c,d){a.J&&(a=Pt(b),d?c.getCastChannel(d).send(a):c.broadcast(a))}function Zu(a,b=0){const c={contentId:a.h.Cc(),streamType:a.h.isLive()?"LIVE":"BUFFERED",contentType:""};a.h.isLive()||(c.duration=a.g.duration);a.l&&(c.metadata=a.l);Yu(a,b,c)}function av(a,b,c,d,e){a.h&&Ou(a,{type:"asyncComplete",id:c,error:d,res:e},a.m,b)}
var fv=class extends Vf{constructor(a,b,c,d){super();this.g=a;this.h=b;this.o=b.td();this.u=null;this.i=new Ca;this.B={video:a,player:b,adManager:this.o,currentAd:this.u};this.I=c||(()=>{});this.K=d||(e=>e);this.l=null;this.J=!1;this.A=!0;this.j=0;this.G=!1;this.C=!0;this.D=this.m=null;this.H=new te(()=>{Mu(this)});Qu(this)}isConnected(){return this.J}zi(){return this.A}jj(a){this.l=a}Ih(){this.l=null}kj(a){Xu(this);this.l.title=a}ij(a){Xu(this);this.l.images=[{url:a}]}hj(a){Xu(this);this.l.artist=
a;this.l.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK}async destroy(){this.i&&(this.i.release(),this.i=null);const a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.H&&(this.H.stop(),this.H=null);this.I=this.B=this.o=this.g=null;this.J=!1;this.A=!0;this.D=this.m=null;super.release();await Promise.all(a);cast.receiver.CastReceiverManager.getInstance().stop()}};w("shaka.cast.CastReceiver",fv);fv.prototype.destroy=fv.prototype.destroy;fv.prototype.setContentArtist=fv.prototype.hj;
fv.prototype.setContentImage=fv.prototype.ij;fv.prototype.setContentTitle=fv.prototype.kj;fv.prototype.clearContentMetadata=fv.prototype.Ih;fv.prototype.setContentMetadata=fv.prototype.jj;fv.prototype.isIdle=fv.prototype.zi;fv.prototype.isConnected=fv.prototype.isConnected;var Nu=.5,Wu=5,bv="IDLE",ev="PLAYING",cv="BUFFERING",dv="PAUSED";function gv(a,b,c,d,e){if(d>=e)return null;var f=-1;let g=-1;for(var h=0;h<c.length;h++)if(c[h].some(t=>t!=null&&t.g.trim()!="")){f=h;break}for(h=c.length-1;h>=0;h--)if(c[h].some(t=>t!=null&&t.g.trim()!="")){g=h;break}if(f===-1||g===-1)return null;let k=h=!1,l="white",m="black";for(var n=hv(d,e,h,k,l,m);f<=g;f++){var p=c[f],q=-1;let t=-1;for(var r=0;r<p.length;r++)if(p[r]!=null&&p[r].g.trim()!==""){q=r;break}for(r=p.length-1;r>=0;r--)if(p[r]!=null&&p[r].g.trim()!==""){t=r;break}if(q===-1||t===-1)p=
iv(d,e),a.nestedCues.push(p);else{for(;q<=t;q++){r=p[q];if(!r){n.payload+=" ";continue}const u=r.l,v=r.i,x=r.j,y=r.h;if(u!=h||v!=k||x!=l||y!=m)n.payload&&a.nestedCues.push(n),n=hv(d,e,u,v,x,y),h=u,k=v,l=x,m=y;n.payload+=r.g}n.payload&&a.nestedCues.push(n);f!==g&&(n=iv(d,e),a.nestedCues.push(n));n=hv(d,e,h,k,l,m)}}return a.nestedCues.length?{cue:a,stream:b}:null}function hv(a,b,c,d,e,f){a=new jd(a,b,"");c&&a.textDecoration.push(wd);d&&(a.fontStyle=vd);a.color=e;a.backgroundColor=f;return a}
function iv(a,b){a=new jd(a,b,"");a.lineBreak=!0;return a}var jv=class{constructor(a,b,c,d,e){this.g=a;this.l=b;this.i=c;this.h=d;this.j=e}};function kv(a){lv(a,0,15);a.g=1}function mv(a,b,c){const d=`CC${(a.D<<1|a.B)+1}`,e=new jd(b,c,"");e.lineInterpretation=1;let f=nv.get(a.g);f&&(e.line=f);a.u!=null&&a.A!=null&&(e.position=10+Math.min(70,a.u*10)+a.A*2.5);(b=gv(e,d,a.i,b,c))&&a.g+b.cue.nestedCues.length-3>15&&(f=nv.get(a.g+3-b.cue.nestedCues.length))&&(e.line=f);return b}
function ov(a,b,c){if(!(c<32||c>127)){var d="";switch(b){case 0:d=pv.has(c)?pv.get(c):String.fromCharCode(c);break;case 1:d=qv.get(c);break;case 2:a.i[a.g].pop();d=rv.get(c);break;case 3:a.i[a.g].pop(),d=sv.get(c)}d&&a.i[a.g].push(new jv(d,a.m,a.j,a.o,a.l))}}function tv(a,b,c,d){if(!(c<0||b<0))if(b>=c)for(--d;d>=0;d--)a.i[b+d]=a.i[c+d].map(e=>e);else for(let e=0;e<d;e++)a.i[b+e]=a.i[c+e].map(f=>f)}function lv(a,b,c){for(let d=0;d<=c;d++)a.i[b+d]=[]}
var uv=class{constructor(a,b){this.i=[];this.g=1;this.h=0;this.D=a;this.B=b;this.j=this.m=!1;this.l="white";this.o="black";this.u=this.A=null;kv(this)}},pv=new Map([[39,"\u2019"],[42,"\u00e1"],[92,"\u00e9"],[92,"\u00e9"],[94,"\u00ed"],[95,"\u00f3"],[96,"\u00fa"],[123,"\u00e7"],[124,"\u00f7"],[125,"\u00d1"],[126,"\u00f1"],[127,"\u2588"]]),qv=new Map([[48,"\u00ae"],[49,"\u00b0"],[50,"\u00bd"],[51,"\u00bf"],[52,"\u2122"],[53,"\u00a2"],[54,"\u00a3"],[55,"\u266a"],[56,"\u00e0"],[57," "],[58,"\u00e8"],
[59,"\u00e2"],[60,"\u00ea"],[61,"\u00ee"],[62,"\u00f4"],[63,"\u00fb"]]),rv=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],[35,"\u00da"],[36,"\u00dc"],[37,"\u00fc"],[38,"\u2018"],[39,"\u00a1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\u00a9"],[44,"\u2120"],[45,"\u00b7"],[46,"\u201c"],[47,"\u201d"],[48,"\u00c0"],[49,"\u00c2"],[50,"\u00c7"],[51,"\u00c8"],[52,"\u00ca"],[53,"\u00cb"],[54,"\u00eb"],[55,"\u00ce"],[56,"\u00cf"],[57,"\u00ef"],[58,"\u00d4"],[59,"\u00d9"],[60,"\u00f9"],[61,"\u00db"],[62,"\u00ab"],
[63,"\u00bb"]]),sv=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],[39,"\u00d5"],[40,"\u00f5"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]),nv=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,
36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function vv(a){a.h=1;a.g=a.j;a.g.h=0}function wv(a,b,c){a.g=a.i;const d=a.g;let e=null;a.h!==3&&a.h!==4&&(e=mv(d,a.l,c),c=a.i,c.g=c.h>0?c.h:0,lv(c,0,15),c=a.j,c.g=c.h>0?c.h:0,lv(c,0,15),d.g=15);a.h=3;d.h=b;return e}function xv(a){na("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.g=a.o;a.h=4}
var yv=class{constructor(a,b){this.h=0;this.o=new uv(a,b);this.i=new uv(a,b);this.g=this.j=new uv(a,b);this.l=0;this.m=null}},zv="black green blue cyan red yellow magenta black".split(" "),Av="white green blue cyan red yellow magenta white_italics".split(" ");function Bv(a){a.i=[];for(let b=0;b<16;b++)a.i.push(Cv())}function Cv(){const a=[];for(let b=0;b<42;b++)a.push(null);return a}function Dv(a){const b=a.g<a.m&&a.g>=0;return a.h<a.o&&a.h>=0&&b}function Ev(a,b){Dv(a)&&(a.i[a.h][a.g]=new jv(b,a.D,a.A,a.u,a.B),a.g++)}function Fv(a){let b=0;for(var c=1;c<16;c++,b++)a.i[b]=a.i[c];for(c=0;c<1;c++,b++)a.i[b]=Cv()}
function Gv(a,b,c){const d=new jd(a.j,b,"");d.textAlign=a.C===0?"left":a.C===1?"right":sd;var e=d.region;a.I&&(e.id+="svc"+a.I);e.id+="win"+a.L;e.height=a.o;e.width=a.m;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.H;e.viewportAnchorY=a.K;e.viewportAnchorUnits=a.J?pc:2;switch(a.G){case 0:e.regionAnchorX=0;e.regionAnchorY=0;break;case 1:e.regionAnchorX=50;e.regionAnchorY=0;break;case 2:e.regionAnchorX=100;e.regionAnchorY=0;break;case 3:e.regionAnchorX=0;e.regionAnchorY=50;break;case 4:e.regionAnchorX=
50;e.regionAnchorY=50;break;case 5:e.regionAnchorX=100;e.regionAnchorY=50;break;case 6:e.regionAnchorX=0;e.regionAnchorY=100;break;case 7:e.regionAnchorX=50;e.regionAnchorY=100;break;case 8:e.regionAnchorX=100,e.regionAnchorY=100}if(c=gv(d,`svc${c}`,a.i,a.j,b))a.j=b;return c}
var Hv=class{constructor(a,b){this.I=b;this.L=a;this.J=this.l=!1;this.m=this.o=this.G=this.K=this.H=0;this.C=2;this.i=[];this.g=this.h=this.j=0;this.D=this.A=!1;this.B="white";this.u="black";Bv(this)}isVisible(){return this.l}display(){this.l=!0}};function Iv(a,b){b.type===3?(a.g=(b.value&63)*2-1,a.h=[]):a.h&&(a.g>0&&(a.h.push(b),a.g--),a.g===0&&(a.i.push(new Jv(a.h)),a.h=null,a.g=0))}var Kv=class{constructor(){this.i=[];this.h=null;this.g=0}};function Lv(a){if(!a.Ha())throw new H(2,2,3E3);return a.h[a.g++]}var Jv=class{constructor(a){this.g=0;this.h=a}Ha(){return this.g<this.h.length}Na(){return this.g}skip(a){if(this.g+a>this.h.length)throw new H(2,2,3E3);this.g+=a}eh(a){if(this.g-a<0)throw new H(2,2,3E3);this.g-=a}};function Mv(a,b,c,d){if(!a.g)return[];if(c==24)return c=Lv(b).value,d=Lv(b).value,c=(f=>f.map(g=>("0"+(g&255).toString(16)).slice(-2)).join(""))([c,d]),Ev(a.g,String.fromCharCode(parseInt(c,16))),[];b=a.g;let e=null;switch(c){case 8:!Dv(b)||b.g<=0&&b.h<=0||(b.g<=0?(b.g=b.m-1,b.h--):b.g--,b.i[b.h][b.g]=null);break;case 13:b.isVisible()&&(e=Gv(b,d,a.i));b.h+1>=b.o?Fv(b):b.h++;b.g=0;break;case 14:b.isVisible()&&(e=Gv(b,d,a.i));b.i[b.h]=Cv();b.g=0;break;case 12:b.isVisible()&&(e=Gv(b,d,a.i)),Bv(b),b.h=
0,b.g=0}return e?[e]:[]}
function Nv(a,b,c,d){if(c>=128&&c<=135)d=c&7,a.h[d]&&(a.g=a.h[d]);else{if(c===136){var e=Lv(b).value;b=[];for(var f of Ov(a,e)){e=a.h[f];if(e.isVisible()){var g=Gv(e,d,a.i);g&&b.push(g)}Bv(e)}return b}if(c===137){b=Lv(b).value;for(var h of Ov(a,b))b=a.h[h],b.isVisible()||(b.j=d),b.display()}else{if(c===138){f=Lv(b).value;b=null;for(e of Ov(a,f))f=a.h[e],f.isVisible()&&(b=Gv(f,d,a.i)),f.l=!1;return b?[b]:[]}if(c===139){f=Lv(b).value;b=null;for(g of Ov(a,f))f=a.h[g],f.isVisible()?b=Gv(f,d,a.i):f.j=
d,f.l=!f.l;return b?[b]:[]}if(c===140)return b=Lv(b).value,Pv(a,b,d);if(c===143)return d=Pv(a,255,d),Qv(a),d;if(c===144)b.skip(1),b=Lv(b).value,a.g&&(d=(b&64)>0,a.g.A=(b&128)>0,a.g.D=d);else if(c===145)d=Lv(b).value,f=Lv(b).value,b.skip(1),a.g&&(b=Rv((f&48)>>4,(f&12)>>2,f&3),a.g.B=Rv((d&48)>>4,(d&12)>>2,d&3),a.g.u=b);else if(c===146)d=Lv(b).value,b=Lv(b).value,a.g&&(a=a.g,a.h=d&15,a.g=b&63);else if(c===151)b.skip(1),b.skip(1),d=Lv(b).value,b.skip(1),a.g&&(a.g.C=d&3);else if(c>=152&&c<=159){f=(c&15)-
8;e=a.h[f]!==null;e||(g=new Hv(f,a.i),g.j=d,a.h[f]=g);d=Lv(b).value;g=Lv(b).value;h=Lv(b).value;c=Lv(b).value;const k=Lv(b).value;b=Lv(b).value;e&&(b&7)===0||(b=a.h[f],b.h=0,b.g=0,b.D=!1,b.A=!1,b.B="white",b.u="black");b=a.h[f];b.l=(d&32)>0;b.K=g&127;b.H=h;b.G=(c&240)>>4;b.J=(g&128)>0;b.o=(c&15)+1;b.m=(k&63)+1;a.g=a.h[f]}}}return[]}
function Sv(a,b){var c=Lv(b);let d=c.value;c=c.pts;if(d===16){const e=Lv(b);d=d<<16|e.value}if(d>=0&&d<=31)return Mv(a,b,d,c);if(d>=128&&d<=159)return Nv(a,b,d,c);d>=4096&&d<=4127?(a=d&255,a>=8&&a<=15?b.skip(1):a>=16&&a<=23?b.skip(2):a>=24&&a<=31&&b.skip(3)):d>=4224&&d<=4255?(a=d&255,a>=128&&a<=135?b.skip(4):a>=136&&a<=143&&b.skip(5)):d>=32&&d<=127?(b=d,a.g&&(b===127?Ev(a.g,"\u266a"):Ev(a.g,String.fromCharCode(b)))):d>=160&&d<=255?a.g&&Ev(a.g,String.fromCharCode(d)):d>=4128&&d<=4223?(b=d&255,a.g&&
(Tv.has(b)?(b=Tv.get(b),Ev(a.g,b)):Ev(a.g,"_"))):d>=4256&&d<=4351&&a.g&&((d&255)!=160?Ev(a.g,"_"):Ev(a.g,"[CC]"));return[]}function Pv(a,b,c){const d=[];for(const e of Ov(a,b))b=a.h[e],b.isVisible()&&(b=Gv(b,c,a.i))&&d.push(b),a.h[e]=null;return d}function Ov(a,b){const c=[];for(let d=0;d<8;d++)(b&1)===1&&a.h[d]&&c.push(d),b>>=1;return c}function Qv(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function Rv(a,b,c){const d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return Uv[a<<2|b<<1|c]}
var Vv=class{constructor(a){this.i=a;this.h=[null,null,null,null,null,null,null,null];this.g=null}},Tv=new Map([[32," "],[33,"\u00a0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201c"],[52,"\u201d"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215b"],[119,"\u215c"],[120,"\u215d"],[121,"\u215e"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250c"]]),Uv="black blue green cyan red magenta yellow white".split(" ");function Wv(a){a.m=0;a.o=0;for(const b of a.l.values())b.h=0,b.g=b.j,b.m=null,kv(b.i),kv(b.j),kv(b.o);a.A=!0}
function Xv(a,b){var c=b.type;if((b.hb&112)===16){var d=b.hb>>3&1;c===0?a.m=d:a.o=d}d=`CC${(c<<1|(c?a.o:a.m))+1}`;c=a.l.get(d);if(b.hb===255&&b.Ib===255||!b.hb&&!b.Ib||!Yv(b.hb)||!Yv(b.Ib))return++a.j>=45&&Wv(a),null;a.j=0;b.hb&=127;b.Ib&=127;var e=b.hb;if(e>=1&&e<=15||!b.hb&&!b.Ib)return null;e=null;if((b.hb&112)===16)a:{a.u.add(d),d=b.hb;a=b.Ib;if(c.m===(d<<8|a))c.m=null;else if(c.m=d<<8|a,(d&240)===16&&(a&192)===64){b=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(d&7)<<1|a>>5&1];d="white";e=!1;let g=
null;var f=a>95?a-96:a-64;f<=13?d=Av[Math.floor(f/2)]:f<=15?e=!0:g=Math.floor((f-16)/2);f=(a&1)===1;c.h!==4&&(a=c.g,c.h===3&&b!==a.g&&(c=1+b-a.h,tv(a,c,1+a.g-a.h,a.h),lv(a,0,c-1),lv(a,b+1,15-b)),a.g=b,a.m=f,a.j=e,a.l=d,a.u=g,a.o="black")}else if((d&247)===17&&(a&240)===32)c.g.m=!1,c.g.j=!1,c.g.l="white",ov(c.g,0,32),d=!1,b=Av[(a&14)>>1],b==="white_italics"&&(b="white",d=!0),c.g.m=(a&1)===1,c.g.j=d,c.g.l=b;else if((d&247)===16&&(a&240)===32||(d&247)===23&&(a&255)===45)b="black",(d&7)===0&&(b=zv[(a&
14)>>1]),c.g.o=b;else if((d&247)===17&&(a&240)===48)ov(c.g,1,a);else if((d&246)===18&&(a&224)===32)ov(c.g,d&1?3:2,a);else{if((d&246)===20&&(a&240)===32){a=b.pts;d=null;switch(b.Ib){case 32:vv(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:d=wv(c,2,a);break;case 38:d=wv(c,3,a);break;case 39:d=wv(c,4,a);break;case 40:ov(c.g,0,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.l=a;break;case 42:kv(c.o);xv(c);break;case 43:xv(c);break;case 44:b=c.i;d=null;c.h!==4&&(d=mv(b,c.l,a));lv(b,0,15);break;case 45:e=
c.g;c.h!==3?d=null:(b=mv(e,c.l,a),d=e.g-e.h+1,tv(e,d-1,d,e.h),lv(e,0,d-1),lv(e,e.g,15-e.g),c.l=a,d=b);break;case 46:lv(c.j,0,15);break;case 47:b=null,c.h!==4&&(b=mv(c.i,c.l,a)),d=c.j,c.j=c.i,c.i=d,vv(c),c.l=a,d=b}e=d;break a}(d==23||d==31)&&a>=33&&a<=35&&(c.g.A=a-32)}e=null}else a=b.Ib,ov(c.g,0,b.hb),ov(c.g,0,a);return e}
function Zv(a,b){const c=[];try{for(;b.Ha();){const d=Lv(b).value;let e=(d&224)>>5;const f=d&31;e===7&&f!=0&&(e=Lv(b).value&63);if(e!=0){a.u.add("svc"+e);const g=a.B.getOrInsertComputed(e,k=>new Vv(k)),h=b.Na();for(;b.Na()-h<f;){const k=Sv(g,b);c.push(...k)}}}}catch(d){if(d instanceof H&&d.code===3E3)na("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw d;}return c}function Yv(a){let b=0;for(;a;)b^=a&1,a>>=1;return b===1}
var $v=class{constructor(){this.g=[];this.h=[];this.i=new Kv;this.j=0;this.l=new Map([["CC1",new yv(0,0)],["CC2",new yv(0,1)],["CC3",new yv(1,0)],["CC4",new yv(1,1)]]);this.o=this.m=0;this.B=new Map;this.A=!0;this.u=new Set;Wv(this)}clear(){this.j=0;this.g=[];this.h=[];var a=this.i;a.i=[];a.h=[];a.g=0;Wv(this);for(const b of this.B.values())Qv(b)}extract(a,b){if(this.A){for(var c of this.l.values())c.l=b;this.A=!1}a=new sg(a,0);if(!(a.mb()<8)&&a.Y()===181&&a.Ca()===49&&a.U()===1195456820&&a.Y()===
3&&(c=a.Y(),(c&64)!==0)){c&=31;a.skip(1);for(let e=0;e<c;e++){var d=a.Y();const f=(d&4)>>2,g=a.Y(),h=a.Y();f&&(d&=3,d===0||d===1?this.g.push({pts:b,type:d,hb:g,Ib:h,order:this.g.length}):(this.h.push({pts:b,type:d,value:g,order:this.h.length}),this.h.push({pts:b,type:2,value:h,order:this.h.length})))}}}extractRaw608(a,b){for(let c=0;c+1<a.length;c+=2)this.g.push({pts:b,type:0,hb:a[c],Ib:a[c+1],order:this.g.length})}decode(){const a=[];var b=(d,e)=>d.pts-e.pts||d.order-e.order;this.g.sort(b);this.h.sort(b);
for(var c of this.g)(b=Xv(this,c))&&a.push(b);for(const d of this.h)Iv(this.i,d);c=this.i.i;for(const d of c)c=Zv(this,d),a.push(...c);this.i.i=[];this.g=[];this.h=[];return a}getStreams(){return Array.from(this.u)}};w("shaka.cea.CeaDecoder",$v);nc=()=>new $v;function aw(a){const b=[];for(var c=a,d=a=0;d<c.length;)a==2&&c[d]==3?(a=0,c=[...c],c.splice(d,1),c=new Uint8Array(c)):c[d]==0?a++:a=0,d++;a=c;for(d=0;d<a.length;){for(c=0;a[d]==255;)c+=255,d++;c+=a[d++];let e=0;for(;a[d]==255;)e+=255,d++;e+=a[d++];c==4&&b.push(a.subarray(d,d+e));d+=e}return b};function bw(a,b,c,d,e,f,g,h){var k=g.map(l=>l.Id);k=[].concat(...k);a.skip(f+g[0].je);for(f=0;f<k.length;f++){g=b/c;const l=a.cb(k[f].sampleSize||e,!1);h.push({packet:l,pts:g,format:mc});b+=k[f].Jd||d}}
function cw(a,b,c,d,e,f,g,h,k){let l=0,m=f;var n=h.map(r=>r.Id);n=[].concat(...n);n.length&&(m=n[0].sampleSize||f);for(b.skip(g+h[0].je);b.Ha();){g=b.U();var p=b.Y(),q=null;q=!1;h=1;switch(a.g){case dw:q=p&31;q=q==6;break;case ew:h=2;b.skip(1);q=p>>1&63;q=q==39||q==40;break;case fw:h=2;b.skip(1);q=p>>1&63;q=q==23||q==24;break;default:return}if(q){p=0;l<n.length&&(p=n[l].Ne||0);p=(c+p)/d;h=b.cb(g-h,!1);for(const r of aw(h))k.push({packet:r,pts:p,format:lc})}else try{b.skip(g-h)}catch(r){break}m-=g+
4;m==0&&(c=l<n.length?c+(n[l].Jd||e):c+e,l++,l<n.length?m=n[l].sampleSize||f:m=f)}}
var jw=class{constructor(){this.j=new Map;this.i=this.h=0;this.l=null;this.g=gw}init(a){const b=[],c=[];let d=null;(new Dg).Ga("moov trak mdia minf stbl mvex".split(" "),vg).$("trex",e=>{var f=e.reader;f.skip(4);f.skip(4);e=f.U();f=f.U();this.h=e;this.i=f}).$("tkhd",e=>{e=Oh(e.reader,e.version);d=e.trackId;b.push(e.trackId)}).$("mdhd",e=>{e=Mh(e.reader,e.version);c.push(e.timescale)}).$("stsd",xg).Ga("avc1 avc3 dvav dva1 hev1 hvc1 dvh1 dvhe vvc1 vvi1 dvc1 dvi1".split(" "),e=>{e=e.name;hw.has(e)&&
(this.g=hw.get(e))}).box("encv",yg).box("sinf",vg).box("frma",e=>{({codec:e}=Rh(e.reader));hw.has(e)&&(this.g=hw.get(e))}).box("c608",()=>{this.g=iw;this.l=d}).parse(a,!0,!0);if(!b.length||!c.length||b.length!=c.length)throw new H(2,2,2010);this.g==gw&&ma("Unable to determine bitstream format for CEA parsing!");b.forEach((e,f)=>{this.j.set(e,c[f])})}parse(a){if(this.g==gw)return[];const b=[];let c=0,d=[];(new Dg).box("moof",e=>{c=e.start;d=[];vg(e)}).box("traf",e=>{d.push({trackId:null,Fa:null,qc:this.h,
Rc:this.i,Uf:[],timescale:9E4});vg(e)}).$("trun",e=>{const f=d[d.length-1];e=Nh(e.reader,e.version,e.flags);f.Uf.push(e)}).$("tfhd",e=>{const f=d[d.length-1];e=Kh(e.reader,e.flags);f.trackId=e.trackId;f.qc=e.qc||this.h;f.Rc=e.Rc||this.i;e=e.trackId;this.j.has(e)&&(f.timescale=this.j.get(e))}).$("tfdt",e=>{const f=d[d.length-1];e=Lh(e.reader,e.version);f.Fa=e.Fa}).box("mdat",e=>{const f=c-e.start-8,g=e.reader.Na();for(const h of d)if(this.g!=iw||h.trackId===this.l)h.Fa===null?ma("Unable to find base media decode time for CEA captions!"):
(e.reader.seek(g),this.g===iw?bw(e.reader,h.Fa,h.timescale,h.qc,h.Rc,f,h.Uf,b):cw(this,e.reader,h.Fa,h.timescale,h.qc,h.Rc,f,h.Uf,b))}).parse(a,!1,!0);return b}};w("shaka.cea.Mp4CeaParser",jw);var gw=0,dw=1,ew=2,fw=3,iw=4,hw=(new Map).set("avc1",dw).set("avc3",dw).set("dvav",dw).set("dva1",dw).set("hev1",ew).set("hvc1",ew).set("dvh1",ew).set("dvhe",ew).set("vvc1",fw).set("vvi1",fw).set("dvc1",fw).set("dvi1",fw);ic("video/mp4",()=>new jw);var kw=class{constructor(){this.g=null}init(){}parse(a){this.g?this.g.clearData():this.g=new Lj;const b=[];a=G(a);if(!Dj(a))return b;var c=this.g.parse(a);a=c.ud();c=c.qe();const d=[];switch(a.video){case "avc":d.push(6);break;case "hvc":d.push(39),d.push(40)}if(!d.length)return b;for(const e of c)if(d.includes(e.type)&&e.time!=null)for(const f of aw(e.data))b.push({packet:f,pts:e.time,format:lc});return b}};w("shaka.cea.TsCeaParser",kw);ic("video/mp2t",()=>new kw);function lw(a){var b=Rc(a.node,"https://dashif.org/CPS","Laurl");if(b&&(b=Nc(b)))return b;if((b=Rc(a.node,"urn:microsoft:playready","pro"))&&Nc(b))return Rl(b);if(a=Rc(a.node,"urn:mpeg:cenc:2013","pssh"))if(a=Nc(a))return a=Eb(a),Tl(a);return""}
function mw(a,b,c,d,e){const f=[];for(const l of c)if(c=d[l.ld]){a:{var g=Rc(l.node,"urn:microsoft:playready","pro");if(!g||!Nc(g)){g=null;break a}g=Nc(g);g=Eb(g);var h=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);g=[{initData:Eg(g,h,new Set,0),initDataType:"cenc",keyId:l.keyId}]}h=null;if(l.ld==="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e")a:{h=l;var k=e;if(k.size==0){h=null;break a}const m=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]),
n=new Uint8Array([]);h=[{initData:Eg(n,m,k,1),initDataType:"cenc",keyId:h.keyId}]}g=Lb(c,b,l.init||a||g||h);if(c=nw.get(c))g.licenseServerUri=c(l);a:{if(c=Rc(l.node,"https://dashif.org/CPS","Certurl"))if(c=Nc(c))break a;c=""}g.serverCertificateUri=c;f.push(g)}return f}
function ow(a){if(!window.crypto||!window.crypto.subtle)throw ma("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new H(2,4,4042);var b=Rc(a.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!b)throw new H(2,4,4051);if(b.attributes.schemeIdUri!="urn:mpeg:dash:sea:aes128-cbc:2013")throw new H(2,4,4051);b=Rc(a.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!b)throw new H(2,4,4051);a=b.attributes.IV;b=Ab(b.attributes.keyUriTemplate);
if(!a||!b)throw new H(2,4,4051);a=Fb(a.substr(2));if(a.byteLength!=16)throw new H(2,4,4048);return{Ei:b,iv:a}}function pw(a,b){const c=[];for(const d of b)(b=qw(a,d))&&c.push(b);return c}
function rw(a,b,c,d){const e=pw(a,b);let f=null;a=[];var g=[];b=null;const h=new Set(e.map(m=>m.keyId));h.delete(null);let k="cenc";if(h.size>1)throw new H(2,4,4010);if(!c){g=e.filter(m=>m.ld=="urn:mpeg:dash:sea:2012");if(g.length>1)throw new H(2,4,4050);g.length&&(b=ow(g[0]));(g=e.find(m=>m.ld=="urn:mpeg:dash:mp4protection:2011"))&&g.encryptionScheme&&(k=g.encryptionScheme);g=e.filter(m=>m.ld=="urn:mpeg:dash:mp4protection:2011"?(f=m.init||f,!1):m.ld!="urn:mpeg:dash:sea:2012");g.length&&(a=mw(f,k,
g,d,h),a.length==0&&(a=[Lb("",k,f)]))}if(e.length&&!b&&(c||!g.length)){a=[];for(var l of Object.values(d))kb(l)||(c=Lb(l,k,f),a.push(c))}if(l=Array.from(h)[0]||null)for(const m of a)for(const n of m.initData)n.keyId=l;return{Dg:l,Nk:f,drmInfos:a,df:b,Hg:!0}}
function sw(a,b,c,d,e){const f=rw(a,b,d,e);if(c.Hg){a=c.drmInfos.length==1&&!c.drmInfos[0].keySystem;b=f.drmInfos.length==0;if(c.drmInfos.length==0||a&&!b)c.drmInfos=f.drmInfos;c.Hg=!1}else if(f.drmInfos.length>0&&(c.drmInfos=c.drmInfos.filter(g=>f.drmInfos.some(h=>h.keySystem==g.keySystem)),c.drmInfos.length==0))throw new H(2,4,4008);return f.Dg||c.Dg}
function qw(a,b){let c=b.attributes.schemeIdUri,d=Tc(b,"urn:mpeg:cenc:2013","default_KID");const e=Sc(b,"urn:mpeg:cenc:2013","pssh").map(Oc),f=b.attributes.value;if(!c)return null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new H(2,4,4009);let g=[];try{g=e.map(h=>({initDataType:"cenc",initData:a.g.getOrInsertComputed(h,()=>Eb(h)),keyId:null}))}catch(h){throw new H(2,4,4007);}return{node:b,ld:c,keyId:d,init:g.length>0?g:null,encryptionScheme:f}}
var tw=class{constructor(){this.g=new Map}release(){this.g.clear()}},nw=(new Map).set("com.apple.fps",function(a){if("apple"===window.shakaMediaKeysPolyfill)throw new H(2,4,4054);if(a=Rc(a.node,"https://dashif.org/CPS","Laurl"))if(a=Nc(a))return a;return""}).set("com.widevine.alpha",function(a){var b=Rc(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=Nc(b))?b:(a=Rc(a.node,"urn:microsoft","laurl"))?Ab(a.attributes.licenseUrl)||"":""}).set("com.microsoft.playready",lw).set("com.microsoft.playready.recommendation",
lw).set("com.microsoft.playready.software",lw).set("com.microsoft.playready.hardware",lw).set("org.w3.clearkey",function(a){var b=Rc(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=Nc(b))?b:(a=Rc(a.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&a.attributes.Lic_type==="EME-1.0"&&a&&(a=Nc(a))?a:""});function uw(a,b,c,d,e,f){const g=(new Map).set("RepresentationID",b).set("Number",c).set("SubNumber",d).set("Bandwidth",e).set("Time",f);return a.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(h,k,l,m)=>{if(h=="$$")return"$";let n=g.get(k);if(n==null)return h;k=="RepresentationID"&&l&&(l=void 0);k=="Time"&&typeof n!="bigint"&&(Math.abs(n-Math.round(n))>=.2&&ma("Calculated $Time$ values must be close to integers"),n=Math.round(n));switch(m){case void 0:case "d":case "i":case "u":h=
n.toString();break;case "o":h=n.toString(8);break;case "x":h=n.toString(16);break;case "X":h=n.toString(16).toUpperCase();break;default:h=n.toString()}l=window.parseInt(l,10)||1;return Array(Math.max(0,l-h.length)+1).join("0")+h})}
function vw(a,b){var c=ww(a,b,"timescale");let d=1;c&&(d=Zc(c)||1);c=ww(a,b,"duration");const e=(c=Zc(c||""))?c/d:null;var f=ww(a,b,"startNumber");const g=Number(ww(a,b,"presentationTimeOffset"))||0;let h=$c(f||"");if(f==null||h==null)h=1;var k=null;if(f=xw(a,b,"SegmentTimeline")){b=[];k=new Map;var l=Mc(f,"Pattern");for(m of l)(l=m.attributes.id)&&k.set(l,m);var m=k;f=Mc(f,"S");if(m.size)for(var n of f)f=yw(n,m),b.push(...f);else b=f;n=b;m=d;a=a.oa.duration||Infinity;b=h;f=[];var p=-g;for(k=0;k<
n.length;++k){var q=n[k],r=n[k+1],t=N(q,"t",$c);l=N(q,"d",$c);var u=N(q,"r",Yc);q=N(q,"k",Yc)||0;t!=null&&(t-=g);if(!l)continue;t=t!=null?t:p;u=u||0;if(u<0)if(r){r=N(r,"t",$c);if(r==null)break;else if(t>=r)break;u=Math.ceil((r-t)/l)-1}else{if(a==Infinity)break;else if(t/m>=a)break;u=Math.ceil((a*m-t)/l)-1}f.length>0&&t!=p&&(f[f.length-1].end=t/m);for(r=0;r<=u;++r)p=t+l,f.push({start:t/m,Te:t,end:p/m,qg:p,Tb:q,ej:f.length+b}),t=p}k=f}return{timescale:d,Se:c,Za:e,Ld:h,Vb:g/d||0,Kc:g,timeline:k}}
function yw(a,b){var c=a.attributes.p;if(!c)return[a];if(!b.has(c))return[];b=b.get(c);c=Mc(b,"P");if(!c.length)return[];b=[];for(var d of c){c=Number(d.attributes.d);var e=Number(d.attributes.r||0);if(Number.isFinite(c)&&!(c<=0))for(var f=0;f<=e;f++)b.push(c)}if(!b.length)return[];d=Number(a.attributes.pE||0);c=Number(a.attributes.r||0)+1;e=Number(a.attributes.k||1);f=[];a=Number(a.attributes.t||0);const g=b.length;for(let h=0;h<c;h++){const k=b[(d+h)%g],l={tagName:"S",attributes:{t:String(a),d:String(k)},
children:[],parent:null};e>1&&(l.attributes.k=String(e));f.push(l);a+=k}return f}function zw(a,b){return[b(a.M),b(a.ra),b(a.Ja)].filter(ue)}function ww(a,b,c){a=zw(a,b);b=null;for(const d of a)if(b=d.attributes[c])break;return b}function xw(a,b,c){a=zw(a,b);b=null;for(const d of a)if(b=Qc(d,c))break;return b}
function Aw(a,b,c,d,e,f){const g=Tc(a,"http://www.w3.org/1999/xlink","href"),h=Tc(a,"http://www.w3.org/1999/xlink","actuate")||"onRequest";for(const l of Object.keys(a.attributes)){const m=l.split(":"),n=Jc("http://www.w3.org/1999/xlink");m[0]==n&&delete a.attributes[l]}if(f>=5)return Kf(new H(2,4,4028));if(h!="onLoad")return Kf(new H(2,4,4027));const k=Kb([d],[g]);return e.request(0,ag(k,b)).Ra(l=>{l=Ec(l.data,a.tagName);if(!l)return Kf(new H(2,4,4001,g));for(a.children=[];l.children.length;){const m=
l.children.shift();a.children.push(m)}for(const m of Object.keys(l.attributes))a.attributes[m]=l.attributes[m];return Bw(a,b,c,k[0],e,f+1)})}
function Bw(a,b,c,d,e,f=0){var g=new Set(["MPD","Period","AdaptationSet","Representation","SegmentList"]);if(Tc(a,"http://www.w3.org/1999/xlink","href"))return g=Aw(a,b,c,d,e,f),c&&(g=g.Ra(void 0,()=>Bw(a,b,c,d,e,f))),g;const h=[];for(const k of Lc(a))Tc(k,"http://www.w3.org/1999/xlink","href")=="urn:mpeg:dash:resolve-to-zero:2013"?a.children=a.children.filter(l=>l!==k):g.has(k.tagName)&&h.push(Bw(k,b,c,d,e,f));return Rf(h).Ra(()=>a)};function Cw(a,b,c,d,e,f,g,h){let k;const l=(new Dg).$("sidx",m=>{k=Dw(b,d,e,f,g,c,m,h)});a&&l.parse(a);if(k)return k;throw new H(2,3,3004);}
function Dw(a,b,c,d,e,f,g,h=!1){const k=[];g.reader.skip(4);const l=g.reader.U();if(l==0)throw new H(2,3,3005);if(g.version==0){var m=g.reader.U();var n=g.reader.U()}else m=g.reader.kd(),n=g.reader.kd();g.reader.skip(2);const p=g.reader.Ca();a=(h?-g.size:a)+g.size+n;for(h=0;h<p;h++){var q=g.reader.U();n=(q&2147483648)>>>31;q&=2147483647;const r=g.reader.U();g.reader.skip(4);if(n==1)throw new H(2,3,3006);k.push(new Q(m/l+c,(m+r)/l+c,()=>f,a,a+q-1,b,c,d,e));m+=r;a+=q}g.parser.stop();return k};function Ew(a){const b=a.g.Na();var c=a.g.Y();if(c==0)throw new H(2,3,3002);c=8-Math.floor(Math.log2(c));a.g.skip(c-1);return G(a.h,b,c)}
function Fw(a){var b=Ew(a);if(b.length>7)throw new H(2,3,3002);var c=0;for(var d of b)c=256*c+d;b=c;c=Ew(a);a:{for(e of Gw)if(ab(c,new Uint8Array(e))){var e=!0;break a}e=!1}if(e)c=a.h.byteLength-a.g.Na();else{if(c.length==8&&c[1]&224)throw new H(2,3,3001);e=0;for(d=0;d<c.length;d++){const f=c[d];e=d==0?f&(1<<8-c.length)-1:256*e+f}c=e}c=a.g.Na()+c<=a.h.byteLength?c:a.h.byteLength-a.g.Na();e=eb(a.h,a.g.Na(),c);a.g.skip(c);return new Hw(b,e)}
var Iw=class{constructor(a){this.h=eb(a);this.g=new sg(this.h,0)}Ha(){return this.g.Ha()}},Gw=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function Jw(a){if(a.g.byteLength>8)throw new H(2,3,3002);if(a.g.byteLength==8&&a.g.getUint8(0)&224)throw new H(2,3,3001);let b=0;for(let c=0;c<a.g.byteLength;c++){const d=a.g.getUint8(c);b=256*b+d}return b}var Hw=class{constructor(a,b){this.id=a;this.g=b}};function Kw(a,b,c,d,e,f,g){b=new Iw(b);if(Fw(b).id!=440786851)throw new H(2,3,3008);var h=Fw(b);if(h.id!=408125543)throw new H(2,3,3009);b=h.g.byteOffset;h=new Iw(h.g);for(var k=null;h.Ha();){var l=Fw(h);if(l.id==357149030){k=l;break}}if(!k)throw new H(2,3,3010);k=new Iw(k.g);l=1E6;for(h=null;k.Ha();){const m=Fw(k);if(m.id==2807729)l=Jw(m);else if(m.id==17545)if(m.g.byteLength==4)h=m.g.getFloat32(0);else if(m.g.byteLength==8)h=m.g.getFloat64(0);else throw new H(2,3,3003);}if(h==null)throw new H(2,
3,3011);k=l/1E9;h*=k;a=Fw(new Iw(a));if(a.id!=475249515)throw new H(2,3,3007);return Lw(a,b,k,h,c,d,e,f,g)}function Lw(a,b,c,d,e,f,g,h,k){const l=[],m=()=>e;a=new Iw(a.g);let n=null,p=null;for(;a.Ha();){var q=Fw(a);if(q.id!=187)continue;var r=Mw(q);if(!r)continue;q=c*r.sj;r=b+r.Yi;n!=null&&l.push(new Q(n+g,q+g,m,p,r-1,f,g,h,k));n=q;p=r}n!=null&&l.push(new Q(n+g,d+g,m,p,null,f,g,h,k));return l}
function Mw(a){var b=new Iw(a.g);a=Fw(b);if(a.id!=179)throw new H(2,3,3013);a=Jw(a);b=Fw(b);if(b.id!=183)throw new H(2,3,3012);b=new Iw(b.g);let c=0;for(;b.Ha();){const d=Fw(b);if(d.id==241){c=Jw(d);break}}return{sj:a,Yi:c}};function Nw(a,b,c){b=xw(a,b,"Initialization");if(!b)return null;let d=a.M.Va();var e=b.attributes.sourceURL;e&&(d=Kb(d,[Ab(e)],a.zb()));e=0;let f=null;if(b=N(b,"range",Xc))e=b.start,f=b.end;c=new Qi(()=>d,e,f,Ow(a),null,null,c,a.ra.encrypted);c.codecs=a.M.codecs;c.mimeType=a.M.mimeType;a.oa&&!a.oa.xe&&(c.g=a.oa.start+a.oa.duration);return c}
function Ow(a){const b=a.M;return{bandwidth:a.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate||null,height:b.height||null,mimeType:b.mimeType,channelsCount:b.Ie,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.ra.label||null,roles:a.roles||null,language:a.ra.language||null}}
function Pw(a,b,c){const d=Number(ww(a,Qw,"presentationTimeOffset"))||0,e=ww(a,Qw,"timescale");let f=1;e&&(f=Zc(e)||1);const g=d/f||0,h=Nw(a,Qw,c);Rw(a,h);const k=Ac(a);return{endTime:-1,timeline:-1,Bc:()=>{var l=xw(k,Qw,"RepresentationIndex");var m=k.M.Va();l&&(l=Ab(l.attributes.sourceURL))&&(m=Kb(m,[l],k.zb()));l=Sw(k);return Tw(k,b,h,m,l.start,l.end,g)},timescale:f}}
async function Tw(a,b,c,d,e,f,g){const h=a.presentationTimeline,k=!a.jb||!a.oa.xe,l=a.oa.start;var m=a.oa.duration;const n=a.M.mimeType.split("/")[1];var p=null;f=[b(d,e,f,!1),n=="webm"?b(c.R(),c.startByte,c.endByte,!0):null];b=null;b=await Promise.all(f);f=b[0];b=b[1]||null;p=null;g=l-g;m=m?l+m:Infinity;p=a.M.Va();const q=p.length!=d.length||p.some((r,t)=>r!=d[t]);p=n=="mp4"?Cw(f,e,p,c,g,l,m,q):Kw(f,b,p,c,g,l,m);for(const r of p)r.codecs=a.M.codecs,r.mimeType=a.M.mimeType,r.bandwidth=a.bandwidth;
h.Ed(p);p=new ll(p);k&&p.Sc(l,m,!0);return p}function Qw(a){return a.md}function Sw(a){const b=xw(a,Qw,"RepresentationIndex");a=ww(a,Qw,"indexRange");a=Xc(a||"");b&&(a=N(b,"range",Xc,a));return a}function Rw(a,b){Uw(a,b);if(!Sw(a))throw new H(2,4,4002);}function Uw(a,b){const c=a.M.mimeType.split("/")[1];if(a.M.contentType!=K&&c!="mp4"&&c!="webm")throw new H(2,4,4006);if(c=="webm"&&!b)throw new H(2,4,4005);};function Vw(a,b,c){const d=Nw(a,Ww,c),e=Xw(a);if(!e.Za&&!e.timeline&&e.dd.length>1)throw new H(2,4,4002);if(!e.Za&&!a.oa.duration&&!e.timeline&&e.dd.length==1)throw new H(2,4,4002);if(e.timeline&&e.timeline.length==0)throw new H(2,4,4002);let f=null,g=null;a.Ja.id&&a.M.id&&(g=b.get(a.Ja.id+","+a.M.id))&&(f=g.segmentIndex);const h=Yw(a.oa.start,a.oa.duration,a.M.Va,e,d,c,a.M.mimeType,a.M.codecs,a.bandwidth,a.zb);b=!f;f?(c=a.presentationTimeline.sb(),f.ed(h,c)):f=new ll(h);a.presentationTimeline.Ed(h);
a.jb&&a.oa.xe||f.Sc(a.oa.start,a.oa.duration?a.oa.start+a.oa.duration:Infinity,b);g&&(g.segmentIndex=f);return{endTime:-1,timeline:-1,Bc:()=>{f&&f.getNumReferences()!=0||f.Ce(h);return Promise.resolve(f)},timescale:e.timescale}}function Ww(a){return a.kc}function Xw(a){const b=Zw(a);a=vw(a,Ww);let c=a.Ld;c==0&&(c=1);let d=0;a.Za?d=a.Za*(c-1):a.timeline&&a.timeline.length>0&&(d=a.timeline[0].start);return{Za:a.Za,startTime:d,Ld:c,Vb:a.Vb,timescale:a.timescale,timeline:a.timeline,dd:b}}
function Yw(a,b,c,d,e,f,g,h,k,l){let m=d.dd.length;d.timeline&&d.timeline.length!=d.dd.length&&(m=Math.min(d.timeline.length,d.dd.length));const n=a-d.Vb,p=b?a+b:Infinity,q=[];var r=d.startTime;for(let u=0;u<m;u++){const v=d.dd[u];var t=r;r=d.Za!=null?t+d.Za:d.timeline?d.timeline[u].end:t+b;let x=null;t=new Q(a+t,a+r,()=>{x==null&&(x=Kb(c(),[v.Mi],l()));return x},v.start,v.end,e,n,a,p,[],"",null,null,Ti,f);t.codecs=h;t.mimeType=g;t.bandwidth=k;q.push(t)}return q}
function Zw(a){return[a.M.kc,a.ra.kc,a.Ja.kc].filter(ue).map(b=>Mc(b,"SegmentURL")).reduce((b,c)=>b.length>0?b:c).map(b=>{b.attributes.indexRange&&!a.Kf&&(a.Kf=!0);const c=Ab(b.attributes.media);b=N(b,"mediaRange",Xc,{start:0,end:null});return{Mi:c,start:b.start,end:b.end}})};function $w(a,b,c,d,e,f,g,h,k,l){k||a.M.ve||(a.M.ve=ww(a,ax,"initialization"));const m=a.M.ve?bx(a,g):null,n=cx(a);dx(n);const p=Ac(a);if(n.Bd)return Uw(a,m),{endTime:-1,timeline:-1,Bc:()=>{var v=uw(n.Bd,p.M.originalId,null,null,p.bandwidth||null,null);v=Kb(p.M.Va(),[v]);return Tw(p,b,m,v,0,null,n.Vb)},timescale:n.timescale};if(n.Za){if(!d&&a.ra.contentType!=="image"&&a.ra.contentType!=="text"){l=a.oa.start;var q=a.Ja.id;d=a.oa.duration;q=(q=q!=null&&f.get(q)||d)?l+q:Infinity;a.presentationTimeline.Qf(n.Za);
a.presentationTimeline.Zg(l,q)}return{endTime:-1,timeline:-1,Bc:()=>ex(p,n,e,m,f,g,h,a.M.Oe),timescale:n.timescale}}let r=null;d=d=null;a.Ja.id&&a.M.id&&(d=a.Ja.id+","+a.M.id,d=c.get(d))&&(r=d.segmentIndex);const t=a.oa.start,u=a.oa.duration?t+a.oa.duration:Infinity;if(r)l=r,fx(l,n,t,u,m,a.jb),q=a.presentationTimeline.sb(),l.Pa(q);else{c=0;k=-1;if(a.Ja.id!=null&&a.M.id!=null){const v=l.get(a.Ja.id);if(v)k=v.timeline;else for(q of l.values())if(Math.abs(n.Vb-q.endTime)<=Sb&&q.cg.includes(a.M.id)){k=
q.timeline;break}else q.timeline>=c&&(c=q.timeline+1)}k==-1&&(k=c);r=new gx(a.jb,n,a.M.originalId,a.bandwidth,a.M.Va,a.zb,t,u,m,g,a.M.Oe,k)}n.timeline&&a.ra.contentType!=="image"&&a.ra.contentType!=="text"&&a.presentationTimeline.$g(r.h?r.h.timeline:[],t);d&&a.jb&&(d.segmentIndex=r);l=(l=(l=n.timeline)&&l[l.length-1])?l.end+n.Vb:-1;q=-1;r instanceof gx&&(q=r.u());return{endTime:l,timeline:q,Bc:()=>{r instanceof gx&&r.getNumReferences()==0&&fx(r,n,t,u,m,a.jb);return Promise.resolve(r)},timescale:n.timescale}}
function ax(a){return a.zc}function cx(a){const b=vw(a,ax),c=ww(a,ax,"media"),d=ww(a,ax,"index"),e=ww(a,ax,"k");let f=0;e&&(f=parseInt(e,10));return{Se:b.Se,Za:b.Za,timescale:b.timescale,Ld:b.Ld,Vb:b.Vb,Kc:b.Kc,timeline:b.timeline,Rb:c&&Ab(c),Bd:d,mimeType:a.M.mimeType,codecs:a.M.codecs,bandwidth:a.bandwidth,Pi:f}}function dx(a){let b;b=a.Bd?1:0;b+=a.timeline?1:0;b+=a.Za?1:0;if(b==0)throw new H(2,4,4002);b!=1&&(a.Bd&&(a.timeline=null),a.Se=null,a.Za=null);if(!a.Bd&&!a.Rb)throw new H(2,4,4002);}
function ex(a,b,c,d,e,f,g,h){const k=a.presentationTimeline,l=a.oa.start,m=a.Ja.id,n=a.oa.duration,p=()=>{const L=m!=null&&e.get(m)||n;return L?l+L:Infinity},q=b.Za,r=b.Ld,t=b.Rb,u=a.bandwidth||null,v=a.M.originalId,x=a.M.Va,y=a.zb,D=l-b.Vb,z=()=>{var L=[Math.max(k.sb(),l),Math.min(k.vc(),p())].map(W=>W-l);L=[Math.ceil(L[0]/q),Math.ceil(L[1]/q)-1];a.M.gb&&L[1]++;return L.map(W=>W+r)};var B=z();c=a.jb?Math.max(B[0],B[1]-c+1):B[0];g=g||B[1];const E=L=>{var W=L-r,F=W*q,I=b.Se;let O=W*I;"BigInt"in window&&
O>Number.MAX_SAFE_INTEGER&&(O=BigInt(W)*BigInt(I));F+=l;W=F+q;I=Math.min(W,p());const M=[],ba=b.Pi;if(ba){const C=(I-F)/ba;for(let S=0;S<ba;S++){var ta=F+C*S;const V=S;ta=new Q(ta,ta+C,()=>{const wa=uw(t,v,L,V,u,O);return Kb(x(),[wa],y())},0,null,d,D,l,p(),[],"",null,null,Ti,f);ta.codecs=a.M.codecs;ta.mimeType=a.M.mimeType;h==0?S>0&&ta.bd():S%h!=0&&ta.bd();M.push(ta)}}F=new Q(F,I,()=>{if(ba)return[];const C=uw(t,v,L,null,u,O);return Kb(x(),[C],y())},0,null,d,D,l,p(),M,"",null,null,Ti,f,M.length>0);
F.codecs=a.M.codecs;F.mimeType=a.M.mimeType;F.bandwidth=a.bandwidth;F.j=W;return F},J=new hx(c,g,r,l,q,E);B=k.vc()<p();const X=k.isLive();if(B||X){let L=Math.max(c,g+1);c=q;a.M.gb&&(c=.1);J.Ue(c,()=>{const W=k.sb();J.Pa(W);const [,F]=z(),I=[];for(;L<=F;){const O=E(L);I.push(O);L++}return W>p()&&!I.length?null:I})}return Promise.resolve(J)}
function bx(a,b){let c=a.M.ve;c||=ww(a,ax,"initialization");if(!c)return null;c=Ab(c);const d=a.M.originalId,e=a.bandwidth||null,f=a.M.Va,g=a.zb;b=new Qi(()=>{const h=uw(c,d,null,null,e,null);return Kb(f(),[h],g())},0,null,Ow(a),null,null,b,a.ra.encrypted);b.codecs=a.M.codecs;b.mimeType=a.M.mimeType;a.oa&&!a.oa.xe&&(b.g=a.oa.start+a.oa.duration);return b}
var hx=class extends ll{constructor(a,b,c,d,e,f){super(Array(Math.max(0,b-a+1)));this.h=a;this.A=c;this.j=d;this.l=e;this.B=f}find(a){var b=this.g.length-1;if(b<0)return null;var c=this.get(this.i);if(!c)return null;if(a<c.startTime)return this.i;c=Math.floor((a-this.j)/this.l)+this.A-this.h;if(c<this.i)return null;const d=this.get(c);if(!d)return null;b=(b=c-this.i<b?this.get(c+1):null)?b.startTime:d.endTime;return a>=d.startTime&&a<b?c:null}get(a){const b=a-this.i;if(b<0||b>=this.g.length)return null;
let c=this.g[b];c||(c=this.B(this.h+a),this.g[b]=c);return c}xb(){return this.get(this.i)}yb(a){for(let b=0;b<this.g.length;b++){const c=this.get(b+this.i);c&&a(c)}}Pa(a){if(!this.o){var b=this.g.length-1;if(!(b<0)){var c=this.get(this.i);!c||c.endTime>a||(a=(b=this.get(this.i+b))&&b.endTime<=a?this.g.length:Math.max(0,Math.min(this.g.length,Math.floor((a-this.j)/this.l+this.A-1)-(this.h+this.i)+1)),a>0&&(this.i+=a,this.g=this.g.slice(a)))}}}};
function ix(a,b,c,d,e,f,g,h){a=uw(a,b,c,f,d||null,e);return Kb(g(),[a],h()).map(k=>k.toString())}
function fx(a,b,c,d,e,f){jx(a,e);a.C=f;if(a.h){if(a.h.Kc!==b.Kc)for(c=b.Kc-a.h.Kc,e=0;e<b.timeline.length;e++)f=b.timeline[e],f.Te+=c,f.qg+=c,f.start=(f.Te+c)/b.timescale,f.end=(f.qg+c)/b.timescale;a.h.Rb!==b.Rb&&(a.h.Rb=b.Rb);c=a.h.timeline;if(c.length){const g=c[c.length-1];b=b.timeline.filter(h=>h.end>g.end)}else b=b.timeline.slice();b.length>0&&a.h.timeline.push(...b);a.l!==d&&(a.l=d)}else a.h=b,a.j=c,a.l=d;kx(a)}
function kx(a){if(a.h&&!a.o){var b=a.h.timeline,c=[];for(const d of b)d.start>=a.l||d.end<=0||c.push(d);a.h.timeline=c;a.Pa(a.j)}}function jx(a,b){if(a.A!==b){a.A=b;for(const c of a.g)c&&Si(c,b)}}
var gx=class extends ll{constructor(a,b,c,d,e,f,g,h,k,l,m,n){super([]);this.C=a;this.h=b;this.H=c;this.D=d;this.G=e;this.J=f;this.j=g;this.l=h;this.A=k;this.B=l;this.I=m;this.K=n;kx(this)}getNumReferences(){return this.h?this.h.timeline.length:0}release(){super.release();this.h=null}Pa(a){if(this.h){var b=this.h.timeline;if(b){for(var c=0;c<b.length&&b[c].end+this.j<=a;)c++;c>0&&(this.h.timeline=b.slice(c),this.g.length>=c&&(this.g=this.g.slice(c)),this.i+=c,this.getNumReferences()===0&&this.release())}}}find(a){if(this.h&&
this.h.timeline&&this.h.timeline.length&&a<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var b=this.h.timeline;if(a<this.j||a>=this.l)return null;const c=b.length-1,d=ya(b,g=>g.start+this.j<=a)-1;if(d<0)return null;const e=b[d],f=e.start+this.j;b=d<c?b[d+1].start+this.j:this.l===Infinity?e.end+this.j:this.l;return a>=f&&a<b?d+this.i:null}get(a){a-=this.i;if(a<0||a>=this.getNumReferences()||!this.h)return null;var b=this.g[a];if(!b){b=this.h.timeline[a];const e=b.ej,f=b.Te+this.h.Kc,
g=this.j-this.h.Vb,h=this.j+b.end;let k=h;a===this.getNumReferences()-1&&this.l!==Infinity&&(k=this.C&&Math.abs(k-this.l)>.1?Math.min(k,this.l):this.l);const l=this.h.codecs,m=this.h.mimeType,n=this.h.bandwidth,p=[];var c=!1;b.Tb&&this.h&&this.h.Rb&&(c=this.h.Rb.includes("$SubNumber$"));if(c){c=(b.end-b.start)/b.Tb;for(let q=0;q<b.Tb;q++){var d=b.start+c*q;const r=q;let t=null;d=new Q(this.j+d,this.j+(d+c),()=>{if(!this.h)return[];t==null&&(t=ix(this.h.Rb,this.H,e,this.D,f,r,this.G,this.J));return t},
0,null,this.A,g,this.j,this.l,[],"",null,null,Ti,this.B);d.codecs=l;d.mimeType=m;d.bandwidth=n;this.I==0?q>0&&d.bd():q%this.I!=0&&d.bd();p.push(d)}}b=new Q(this.j+b.start,k,()=>p.length>0||!this.h?[]:ix(this.h.Rb,this.H,e,this.D,f,null,this.G,this.J),0,null,this.A,g,this.j,this.l,p,"",null,null,Ti,this.B,p.length>0);b.codecs=l;b.mimeType=m;b.j=h;b.bandwidth=n;this.g[a]=b}return b}yb(a){kx(this);for(let b=0;b<this.getNumReferences();b++){const c=this.get(b+this.i);c&&a(c)}}u(){return this.K}};function lx(a,b){if(!a.m.length)return b;b=new Ma(b);const c=a.B||a.m[0],d=Math.round(a.A.getBandwidthEstimate()),e=b.g;a.u=="DASH"?(e.add("_DASH_pathway",c),e.add("_DASH_throughput",String(d))):a.u=="HLS"&&(e.add("_HLS_pathway",c),e.add("_HLS_throughput",String(d)));$a(e);e.sd&&Qa(b,e);return b.toString()}function mx(a,b,c){a.g!=null&&(a.g.stop(),a.g=null);const d=b["RELOAD-URI"]||c;a.g=new te(()=>{nx(a,d)});if(c=b.TTL)a.D=c;a.g.ha(a.D);a.m=b["PATHWAY-PRIORITY"]||[];a.C=b["PATHWAY-CLONES"]||[]}
async function nx(a,b){var c=Kb(a.i,[lx(a,b)]);c=a.A.networkingEngine.request(8,ag(c,a.o.retryParameters));Wf(a.G,c);try{const d=await c.promise,e=ub(d.data),f=JSON.parse(e);f.VERSION==1&&mx(a,f,d.uri)}catch(d){d&&d.code==7001||(a.g!=null&&(a.g.stop(),a.g=null),a.g=new te(()=>{nx(a,b)}),a.g.ha(a.D))}}function ox(a,b,c,d){let e=a.l.get(b);e||=new Map;e.set(c,d);a.l.set(b,e)}
function px(a,b,c=!1){b=a.l.get(b)||new Map;var d=[];for(const h of a.m){var e=b.get(h);if(e)d.push({Vf:h,location:e});else if(e=a.C.find(k=>k.Tj==h)){var f=b.get(e["BASE-ID"]);f&&(e["URI-REPLACEMENT"].xh?(f=new Ma(f),Oa(f,e["URI-REPLACEMENT"].xh),d.push({Vf:h,location:f.toString()})):d.push({Vf:h,location:f}))}}e=Date.now();for(var g of a.j.keys())f=a.j.get(g),e>f&&a.j.delete(g);d=d.filter(h=>{for(const k of a.j.keys())if(k.includes((new Ma(h.location)).wb))return!1;return!0});d.length&&(a.B=d[0].Vf);
g=d.map(h=>h.location);if(!g.length&&a.h)for(const h of a.h.split(","))if(d=b.get(h))a.B=a.h,g.push(d);if(!g.length)for(const h of b.values())g.push(h);return c?g:Kb(a.i,g)}
var qx=class{constructor(a){this.o=null;this.A=a;this.G=new Xf;this.i=[];this.h=null;this.m=[];this.B=null;this.C=[];this.D=300;this.l=new Map;this.j=new Map;this.g=null;this.u="UNKNOWN"}configure(a){this.o=a}destroy(){this.A=this.o=null;this.i=[];this.h=null;this.m=[];this.C=[];this.l.clear();this.g!=null&&(this.g.stop(),this.g=null);return this.G.destroy()}setManifestType(a){this.u=a}banLocation(a){this.j.set(a,Date.now()+6E4)}};function rx(a,b){a.matchedStreams=a.matchedStreams?.filter(c=>c!==b)}function sx(a){const b=[];for(const c of tx){const d=a[c];d&&b.push(d)}return b}function ux(a,b){return new Map(a.map(c=>[b(c),c]))}
function vx(a){const b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=()=>Promise.resolve();b.closeSegmentIndex=()=>{};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set(a.keyIds);b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;b.trickModeVideo=null;b.dependencyStream=null;return b}
function wx(a,b){a.roles=xx(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=xx(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(var c of b.keyIds)a.keyIds.add(c);a.originalId==null?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=","+c);c=ib(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new H(2,4,4038);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions){a.closedCaptions||(a.closedCaptions=new Map);for(const [d,
e]of b.closedCaptions)a.closedCaptions.set(d,e)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));for(const d of tx)yx(a,b,d)}
async function zx(a){if(a.length==1)return a[0];var b=a.map(p=>new Map(p.filter(q=>q.type==="audio").map(q=>[Ax(q),q])));const c=a.map(p=>new Map(p.filter(q=>q.type==="video").map(q=>[Bx(q),q]))),d=a.map(p=>new Map(p.filter(q=>q.type===K).map(q=>[Cx(q),q])));a=a.map(p=>new Map(p.filter(q=>q.type==="image").map(q=>[Dx(q),q])));for(var e of d){const p=Ex(K);e.set(Cx(p),p)}for(const p of a)e=Ex("image"),p.set(Dx(e),e);const f=new Fx,[g,h,k,l]=await Promise.all([b,c,d,a].map(p=>Gx(f,[],p,0,Hx,Ix,0)));
b=0;if(h.length&&g.length)for(var m of g)for(const p of h){var n=b++;p.variantIds.push(n);m.variantIds.push(n)}else{m=h.concat(g);for(n of m)n.variantIds=[b++]}return h.concat(g).concat(k).concat(l)}function Hx(a){const b=Object.assign({},a);b.roles=b.roles.slice();b.keyIds=new Set(a.keyIds);b.segments=[];b.variantIds=[];b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;return b}
function Ix(a,b){a.roles=xx(a.roles,b.roles);for(const c of b.keyIds)a.keyIds.add(c);a.encrypted=a.encrypted&&b.encrypted;a.segments.push(...b.segments);if(b.closedCaptions){a.closedCaptions||(a.closedCaptions=new Map);for(const [c,d]of b.closedCaptions)a.closedCaptions.set(c,d)}}function Jx(a){switch(a.type){case K:return!a.language;case "image":return!a.tilesLayout;default:return!1}}
async function Kx(a,b){var c=[];const d=a.matchedStreams;for(let f=b;f<d.length;f++){var e=d[f];c.push(e.createSegmentIndex());e=sx(e);for(const g of e)g.segmentIndex||c.push(g.createSegmentIndex())}await Promise.all(c);if(a.segmentIndex instanceof pl)for(;b<d.length;b++)c=d[b],c.segmentIndex&&a.segmentIndex.h.push(c.segmentIndex)}
function Lx(a,b,c,d,e){const f=a.matchedStreams;for(b+=e;b<f.length;b++){const h=f[b];c(a,h);var g=!0;a.type=="audio"&&Ce(a.language,h.language)==0&&(g=!1);if(g&&((g=d[b-e])&&g.delete(h),h.fullMimeTypes))for(const k of h.fullMimeTypes.values())a.fullMimeTypes.add(k)}}function xx(a,b){a||=[];for(const c of b)a.includes(c)||a.push(c);return a}
function yx(a,b,c){const d=b[c]||null;let e=a[c]||null;d?(e||(e=vx(d),e.matchedStreams=[],e.createSegmentIndex=async()=>{if(!e.segmentIndex){var f=new pl;for(const g of e.matchedStreams)g.segmentIndex||await g.createSegmentIndex(),f.h.push(g.segmentIndex);e.segmentIndex=f}},a[c]=e),e.matchedStreams.push(d),wx(e,d)):e&&(e.matchedStreams.push(b),wx(e,b))}
function Ax(a){return Mx([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,a.codecs,a.mimeType,a.roles,a.audioSamplingRate,a.primary,a.dependencyStream?.baseOriginalId??a.baseOriginalId,Array.from(a.keyIds)])}function Bx(a){return Mx([a.fastSwitching,a.width,a.frameRate,a.codecs,a.mimeType,a.label,a.roles,a.closedCaptions?Array.from(a.closedCaptions.entries()):null,a.bandwidth,a.dependencyStream?.baseOriginalId??a.baseOriginalId,Array.from(a.keyIds)])}
function Cx(a){return Mx([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}function Dx(a){return Mx([a.width,a.codecs,a.mimeType])}function Nx(a,b){return b.language?a.forced!==b.forced||Ce(a.language,b.language)==0||b.kind!=a.kind?!1:!0:!0}function Ox(){return!0}
function Px(a,b,c){var d=Qx(a,b,c);if(d===Rx)return!0;if(d===Sx)return!1;d=Ce(a.language,b.language);var e=Ce(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(f=>a.roles.includes(f));e=c.roles.filter(f=>a.roles.includes(f));if(e.length>d.length)return!0;if(e.length<d.length)return!1;if(c.roles.length!==b.roles.length)return c.roles.length<b.roles.length}else{if(!c.roles.length&&
b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;d=Tx(a.channelsCount,b.channelsCount,c.channelsCount);if(d==Rx)return!0;if(d==Sx)return!1;d=Tx(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==Rx?!0:d==Sx?!1:a.bandwidth&&Ux(a.bandwidth,b.bandwidth,c.bandwidth)==Rx?!0:!1}
function Vx(a,b,c){var d=Qx(a,b,c);if(d===Rx)return!0;if(d===Sx)return!1;d=Tx(a.width*a.height,b.width*b.height,c.width*c.height);if(d==Rx)return!0;if(d==Sx)return!1;if(a.frameRate){d=Tx(a.frameRate,b.frameRate,c.frameRate);if(d==Rx)return!0;if(d==Sx)return!1}return a.bandwidth&&Ux(a.bandwidth,b.bandwidth,c.bandwidth)==Rx?!0:!1}
function Wx(a,b,c){var d=Ce(a.language,b.language),e=Ce(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(f=>a.roles.includes(f));e=c.roles.filter(f=>a.roles.includes(f));if(e.length>d.length)return!0;if(e.length<d.length)return!1}else{if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}return c.mimeType!=
a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function Xx(a,b,c){return Tx(a.width*a.height,b.width*b.height,c.width*c.height)==Rx?!0:!1}function Yx(a,b){return a.mimeType!=b.mimeType?!1:Zx(a.codecs)===Zx(b.codecs)}function Zx(a){return $x.getOrInsertComputed(a,()=>Wd(a))}
function Qx(a,b,c){const d=a.mimeType===b.mimeType&&a.codecs===b.codecs,e=a.mimeType===c.mimeType&&a.codecs===c.codecs;if(d&&!e)return Sx;if(!d&&e)return Rx;b=Yx(a,b);a=Yx(a,c);return b&&!a?Sx:!b&&a?Rx:ay}function Tx(a,b,c){if(b==a&&a!=c)return Sx;if(c==a&&a!=b)return Rx;if(b>a){if(c<=a||c-a<b-a)return Rx;if(c-a>b-a)return Sx}else{if(c>a)return Sx;if(a-c<a-b)return Rx;if(a-c>a-b)return Sx}return ay}function Ux(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?Rx:b<a?Sx:ay}
function Ex(a){return{id:0,originalId:"",groupId:null,primary:!1,type:a,mimeType:"",codecs:"",supplementalCodecs:"",language:"",originalLanguage:null,label:null,width:null,height:null,encrypted:!1,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1,baseOriginalId:null}}
function by(a){return{id:0,originalId:"",groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ll([]),mimeType:"",codecs:"",supplementalCodecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:a,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,
isAudioMuxedInVideo:!1,baseOriginalId:null}}function Mx(a){return JSON.stringify(a)}async function Gx(a,b,c,d,e,f,g){const h=[];for(let k=0;k<c.length;k++)k>=d?h.push(new Set(c[k].values())):h.push(new Set);for(const k of b)if(!await cy(a,k,c,d,f,h,g))throw new H(2,4,4037);for(const k of h)for(const l of k)(d=dy(a,b,l,c,e,f,h))&&b.push(d);for(const k of h)for(const l of k)if(!Jx(l)&&b.some(m=>l.drmInfos&&!gb(l.drmInfos,m.drmInfos)?!1:!0))throw new H(2,4,4037);return b}
function ey(a,b){const c=[],d=[],e=[],f=[];for(const h of a){a=ux(h.audioStreams,Ax);const k=ux(h.videoStreams,Bx),l=ux(h.textStreams,Cx),m=ux(h.imageStreams,Dx);if(b){var g=by(K);l.set(Cx(g),g);g=by("image");m.set(Dx(g),g)}c.push(a);d.push(k);e.push(l);f.push(m)}return{yg:c,uh:d,oh:e,Qg:f}}async function cy(a,b,c,d,e,f,g){fy(a,c,b,g>0);if(!b.matchedStreams)return!1;b.segmentIndex&&await Kx(b,d+g);Lx(b,d,e,f,g);return!0}
function dy(a,b,c,d,e,f,g){if(Jx(c))return null;const h=e(c);fy(a,d,h);h.createSegmentIndex&&(h.createSegmentIndex=async()=>{h.segmentIndex||(h.segmentIndex=new pl,await Kx(h,0))},h.closeSegmentIndex=()=>{h.segmentIndex&&(h.segmentIndex.release(),h.segmentIndex=null);if(h.matchedStreams)for(const n of h.matchedStreams){var k;if(k=n.segmentIndex){a:{k=n;var l=h,m=b;for(const p of m)if(p!==l&&p.segmentIndex&&p.matchedStreams&&p.matchedStreams.includes(k)){k=!0;break a}k=!1}k=!k}k&&(n.segmentIndex.release(),
n.segmentIndex=null)}});if(!h.matchedStreams||!h.matchedStreams.length)return null;Lx(h,0,f,g,0);return h}function fy(a,b,c,d=!1){d=d?c.matchedStreams:[];for(const e of b){b=gy(a,e,c);if(!b)return;d.push(b)}c.matchedStreams=d}
function gy(a,b,c){const d={audio:Ax,video:Bx,text:Cx,image:Dx}[c.type];let e=null;var f=d(c);if(b.has(f))e=b.get(f);else{f={audio:(h,k)=>h.drmInfos&&!gb(h.drmInfos,k.drmInfos)?!1:!0,video:(h,k)=>h.drmInfos&&!gb(h.drmInfos,k.drmInfos)?!1:!0,text:Nx,image:Ox}[c.type];const g={audio:Px,video:Vx,text:Wx,image:Xx}[c.type];for(const h of b.values())!f(c,h)||c.fastSwitching!=h.fastSwitching||e&&!g(c,e,h)||(e=h)}a.o&&!Jx(e)&&b.delete(d(e));return e}
var Fx=class{constructor(){this.l=[];this.h=[];this.g=[];this.j=[];this.i=[];this.o=!1;this.m=new Set;this.u=(new Map).set("audio",this.h).set("video",this.g).set(K,this.j).set("image",this.i)}release(){const a=this.h.concat(this.g,this.j,this.i);for(const b of a)b.segmentIndex&&b.segmentIndex.release();this.h=[];this.g=[];this.j=[];this.i=[];this.l=[];this.o=!1;this.m.clear();this.u.clear()}ri(){return this.l}Jf(){return this.j.slice()}Zh(){return this.i}Eg(a,b){if(a){var c=this.u.get(a.type)||[];
for(const d of c){rx(d,a);c=sx(d);for(const e of c)rx(e,a)}a.segmentIndex&&a.closeSegmentIndex();this.m.delete(b)}}async jf(a,b,c=!1){if(b||a.length!=1){b=c?this.m.size:0;c=-1;for(var d=0;d<a.length;d++){const n=a[d];this.m.has(n.id)||(this.m.add(n.id),c==-1&&(c=d))}if(c==-1)return;const {yg:h,uh:k,oh:l,Qg:m}=ey(a,!0);await Promise.all([Gx(this,this.h,h,c,vx,wx,b),Gx(this,this.g,k,c,vx,wx,b),Gx(this,this.j,l,c,vx,wx,b),Gx(this,this.i,m,c,vx,wx,b)])}else{const {yg:h,uh:k,oh:l,Qg:m}=ey(a,!1);this.h=
Array.from(h[0].values());this.g=Array.from(k[0].values());this.j=Array.from(l[0].values());this.i=Array.from(m[0].values())}a=0;b=[];if(this.g.length&&this.h.length)for(var e of this.h)for(var f of this.g){var g=ib(e.drmInfos,f.drmInfos);if(e.drmInfos.length&&f.drmInfos.length&&!g.length)continue;c=(e.bandwidth||0)+(f.bandwidth||0);e.dependencyStream&&(c+=e.dependencyStream.bandwidth||0);f.dependencyStream&&(c+=f.dependencyStream.bandwidth||0);d=a++;b.push({id:d,language:e.language,disabledUntilTime:0,
primary:e.primary,audio:e,video:f,bandwidth:c,drmInfos:g,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]})}else{e=this.g.length?this.g:this.h;for(g of e)e=a++,f=g.bandwidth||0,g.dependencyStream&&(f+=g.dependencyStream.bandwidth||0),b.push({id:e,language:g.language,disabledUntilTime:0,primary:g.primary,audio:g.type=="audio"?g:null,video:g.type=="video"?g:null,bandwidth:f,drmInfos:g.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]})}this.l=b}kh(a){this.o=a}};
w("shaka.util.PeriodCombiner",Fx);Fx.prototype.setUseStreamOnce=Fx.prototype.kh;Fx.prototype.combinePeriods=Fx.prototype.jf;Fx.prototype.deleteStream=Fx.prototype.Eg;Fx.prototype.getImageStreams=Fx.prototype.Zh;Fx.prototype.getTextStreams=Fx.prototype.Jf;Fx.prototype.getVariants=Fx.prototype.ri;var tx=["trickModeVideo","dependencyStream"],Rx=1,ay=0,Sx=-1,$x=new Map;function hy(a,b,c){return()=>a&&b?px(a,"BaseURL"):c.slice()}function iy(){return""}function jy(a,b){b=Rd(a,b);return fe(b)?K:a.split("/")[0]}async function ky(a){let b=0;try{b=await ly(a)}catch(c){if(a.j){if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure){a.j.onError(c);return}c.severity=1;a.j.onError(c)}}a.j&&(a.j.onManifestUpdated(),my(a,b))}
async function ly(a){var b=4,c="MPD",d=ny(a),e=a.A;d.length?(e=d,c="Patch",b=6):a.A.length>1&&a.i&&(d=px(a.i,"Location",!0),d.length&&(e=d));d=Date.now();e=await oy(a,ag(e,a.g.retryParameters),0,{type:b});if(!a.j)return 0;e.uri&&e.uri!=e.originalUri&&!a.A.includes(e.uri)&&a.A.unshift(e.uri);a.W=(new Ma(e.uri)).g.toString();b=e.uri;e=Ec(e.data,c);await py(a,e,b,c);c=(Date.now()-d)/1E3;a.Ba.sample(1,c);a.Z.clear();return c}
function my(a,b){if(!(a.O<0)){var c=a.O;a.g.updatePeriod>=0&&(c=a.g.updatePeriod);a.J.ha(Math.max(c-b,ia(a.Ba)))}}function ny(a){const b=a.l.Gd;if(!a.l.Ee||!b||!a.G.length)return[];const c=Date.now()/1E3,d=a.G.filter(e=>{e=$c(e.attributes.ttl);return!e||b+e>c}).map(Oc).filter(ue);return d.length?Kb(a.A,d):[]}function oy(a,b,c,d){d||={};d.isPreload=a.ba();b=a.j.networkingEngine.request(c,b,d);Wf(a.P,b);return b.promise}
async function py(a,b,c,d){if(!b)throw new H(2,4,4001,c);var e=a.g.dash.manifestPreprocessorTXml;e!=vn&&e(b);if(d==="Patch")return qy(a,b);a:{if(b.attributes["xmlns:xlink"]==="http://www.w3.org/1999/xlink"){d=new Set(["Period","AdaptationSet","SegmentList"]);e=new Set(["MPD","Period","AdaptationSet","Representation","SegmentList"]);for(var f=[b];f.length;){const h=f.pop();if(d.has(h.tagName)&&Tc(h,"http://www.w3.org/1999/xlink","href")){var g=!0;break a}for(g of Lc(h))e.has(g.tagName)&&f.push(g)}}g=
!1}if(!g)return ry(a,b,c);b=Bw(b,a.g.retryParameters,a.g.dash.xlinkFailGracefully,c,a.j.networkingEngine);Wf(a.P,b);b=await b.promise;return ry(a,b,c)}
async function qy(a,b){var c=b.attributes.mpdId,d=N(b,"originalPublishTime",Vc);if(!c||c!==a.l.Ee||d!==a.l.Gd)throw a.G=[],new H(1,4,4052);c=[];d=[];const e=new Set;for(const k of Lc(b)){b=dd(k.attributes.sel||"");var f=b[b.length-1];b=Oc(k)||"";if(f.name==="MPD")if(f.nc==="mediaPresentationDuration"){if(f=Oc(k)||"",b=a,f=Wc(f),f!=null){b.l.cc=f;for(const l of b.u.values())l.cc=f}}else if(f.nc==="type"){f=a;f.h.presentationTimeline.od(b=="static");f.l.type=b;for(const l of f.u.values())l.jb=b=="dynamic";
b=="static"&&(f.O=-1)}else f.nc==="publishTime"?a.l.Gd=Vc(b)||0:f.nc===null&&k.tagName==="add"&&d.push(k);else if(f.name==="PatchLocation")ed(a.G,k);else if(f.name==="Period")k.tagName==="add"?d.push(k):k.tagName==="remove"&&f.id&&sy(a,f.id);else if(f.name==="SegmentTemplate"){a:{b=a;var g=dd(k.attributes.sel||"");f=g[g.length-1];if(!f.nc){b=[];break a}g=ty(b,g);var h=Oc(k)||"";for(const l of g){const m=b.u.get(l);gd(m.M.zc,k.tagName,f.nc,h)}b=g}for(const l of b)e.add(l)}else if(f.name==="SegmentTimeline"||
f.name==="S"){b=a;f=dd(k.attributes.sel||"");f=ty(b,f);for(const l of f)g=b.u.get(l),g=xw(g,ax,"SegmentTimeline"),h=Mc(g,"S"),ed(h,k),g.children=h;b=f;for(const l of b)e.add(l)}}for(const k of e)uy(a,k);for(const k of d)c.push(...vy(a,{jb:a.l.type=="dynamic",presentationTimeline:a.h.presentationTimeline,Ja:null,oa:null,ra:null,M:null,bandwidth:0,Kf:!1,gb:a.l.gb,profiles:a.l.profiles,cc:a.l.cc,roles:null,zb:iy,name:""},a.l.Va,k,!0).periods);c.length&&(a.h.periodCount+=c.length,a.h.gapCount=a.K,await xy(a,
c,!0));a.l.type=="static"&&a.h.presentationTimeline.Eb(a.l.cc||Infinity)}
async function ry(a,b,c){a.i&&a.i.l.clear();c=[c];var d=[],e=new Map,f=Mc(b,"Location");for(var g of f){f=g.attributes.serviceLocation;var h=Oc(g);if(!h)continue;h=Kb(c,[h])[0];f&&(a.i?ox(a.i,"Location",f,h):e.set(f,h));d.push(h)}a.i?(g=px(a.i,"Location",!0),g.length>0&&(c=a.A=g)):d.length&&(c=a.A=d);a.l.Ee=b.attributes.id||"";a.l.Gd=N(b,"publishTime",Vc)||0;a.G=Mc(b,"PatchLocation");g=Promise.resolve();if((d=Qc(b,"ContentSteering"))&&a.j){f=d.attributes.defaultServiceLocation;a.i?(a.i.i=c,a.i.h=
f):(a.i=new qx(a.j),a.i.configure(a.g),a.i.setManifestType("DASH"),a.i.i=c,a.i.h=f,(f=Oc(d))&&(N(d,"queryBeforeStart",bd,!1)?g=nx(a.i,f):nx(a.i,f)));for(var k of e.keys())d=e.get(k),ox(a.i,"Location",k,d)}k=Mc(b,"BaseURL");e=!1;if(a.i)for(var l of k)d=l.attributes.serviceLocation,f=Oc(l),d&&f&&(ox(a.i,"BaseURL",d,f),e=!0);a.sa.splice(0);e&&a.i||(l=k.map(Oc),a.sa.push(...Kb(c,l)));c=hy.call(yy,a.i,e,a.sa);a.l.Va=c;f=0;k&&k.length&&(f=N(k[0],"availabilityTimeOffset",ad)||0);a.l.gb=f;a.O=N(b,"minimumUpdatePeriod",
Wc,-1);l=N(b,"availabilityStartTime",Vc);h=N(b,"timeShiftBufferDepth",Wc);k=null;a.g.dash.ignoreSuggestedPresentationDelay||(k=N(b,"suggestedPresentationDelay",Wc));e=null;a.g.dash.ignoreMaxSegmentDuration||(e=N(b,"maxSegmentDuration",Wc));d=b.attributes.type||"static";a.h&&a.h.presentationTimeline&&(a.T=a.h.presentationTimeline.isLive()&&d=="static");a.l.type=d;if(a.h){l=a.h.presentationTimeline;var m=l.sb();for(var n of a.o.values())n.segmentIndex&&n.segmentIndex.Pa(m)}else n=0,a.g.dash.ignoreMinBufferTime||
(n=N(b,"minBufferTime",Wc)||0),l=new U(l,k!=null?Math.min(k,h||Infinity):a.g.defaultPresentationDelay>0?a.g.defaultPresentationDelay:Math.min(n*1.5,h||Infinity),a.g.dash.autoCorrectDrift);l.od(d=="static");l.isLive()&&!isNaN(a.g.availabilityWindowOverride)&&(h=a.g.availabilityWindowOverride);h==null&&(h=Infinity);l.kg(h);n=b.attributes.profiles||"";a.l.profiles=n.split(",");f={jb:d!="static",presentationTimeline:l,Ja:null,oa:null,ra:null,M:null,bandwidth:0,Kf:!1,gb:f,cc:null,profiles:n.split(","),
roles:null,zb:iy,name:""};await g;a.K=0;g=vy(a,f,c,b,!1);h=g.duration;n=g.periods;(d!="static"||a.T)&&g.Gg||l.Eb(h||Infinity);a.S&&a.ma&&l.gh(a.X);l.Qf(e||1);a.S&&a.ma&&l.ig(k!=null?k:a.g.defaultPresentationDelay);if(a.h)a.h.periodCount=n.length,a.h.gapCount=a.K,await xy(a,n,!1);else{await a.m.jf(n,f.jb);g=l;k=a.m.l;e=a.m.Jf();d=a.m.i;f=a.g.dash.sequenceMode;if(m=Qc(b,"ServiceDescription"))if(h=Qc(m,"Latency"),m=Qc(m,"PlaybackRate"),h||m){var p={};h&&("target"in h.attributes&&(p.targetLatency=parseInt(h.attributes.target,
10)/1E3),"max"in h.attributes&&(p.maxLatency=parseInt(h.attributes.max,10)/1E3),"min"in h.attributes&&(p.minLatency=parseInt(h.attributes.min,10)/1E3));m&&("max"in m.attributes&&(p.maxPlaybackRate=parseFloat(m.attributes.max)),"min"in m.attributes&&(p.minPlaybackRate=parseFloat(m.attributes.min)));h=p}else h=null;else h=null;a:{m=Mc(b,"SupplementalProperty");if(m.length)for(q of m)if(q.attributes.schemeIdUri=="urn:mpeg:dash:chaining:2016"){var q=q.attributes.value;break a}q=null}a.h={presentationTimeline:g,
variants:k,textStreams:e,imageStreams:d,chapterStreams:[],offlineSessionIds:[],sequenceMode:f,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:h,nextUrl:q,periodCount:n.length,gapCount:a.K,isLowLatency:a.S,startTime:null};if(l.sh()){q=Mc(b,"UTCTiming");q=await zy(a,c,q);if(!a.j)return;l.hh(q)}l.Of();a.m&&!a.h.presentationTimeline.isLive()&&a.m.release();if(b=Qc(b,"ProgramInformation"))b=(new Map).set("detail",b),b=new P("programinformation",b),a.j.onEvent(b)}a.j.makeTextStreamsForClosedCaptions(a.h);
Ay(a);By(a,n)}
function vy(a,b,c,d,e){let f=b.cc;f||(f=N(d,"mediaPresentationDuration",Wc),a.l.cc=f);let g=0;a.h&&a.h.presentationTimeline&&a.T&&(g=a.h.presentationTimeline.Ab());const h=[];var k=g;d=Mc(d,"Period");const l=b.jb;l||a.C.clear();const m=l&&!e?new Set(a.D.slice(1,-1)):null;for(let t=0;t<d.length;t++){var n=d[t],p=d[t+1];let u=N(n,"start",Wc,k);var q=n.attributes.id;const v=N(n,"duration",Wc);u=t==0&&u==0&&a.T?g:u;let x=null;if(p){var r=N(p,"start",Wc);r!=null&&(x=r-u+g)}else f!=null&&(x=f-u+g);r=Sb;
x&&v&&Math.abs(x-v)>r&&x>v&&a.K++;x==null&&(x=v);if(a.N!==null&&q!=null&&u!==null&&u<a.N&&!a.D.includes(q)&&t+1!=d.length)continue;u!==null&&(a.N===null||u>a.N)&&(a.N=u);k={start:u,duration:x,node:n,xe:x==null||!p};n=null;p=t>0&&t<d.length-1;l&&m&&p&&!e&&(q??="__shaka_period_"+u,m.has(q)&&(q=a.C.get(q))&&(n=q));n||(n=Cy(a,b,c,k),l&&n.id&&a.C.set(n.id,n));h.push(n);n.id&&x&&a.wa.set(n.id,x);if(x==null){k=null;break}k=u+x}l&&!e&&Dy(a,h);if(e)for(const t of h)b=t.id,a.D.includes(b)||a.D.push(b);else a.D=
h.map(t=>t.id);return f!=null?{periods:h,duration:f+g,Gg:!1}:{periods:h,duration:k,Gg:!0}}async function xy(a,b,c){await a.m.jf(b,!0,c);a.h.variants=a.m.l;b=a.m.Jf();b.length>0&&(a.h.textStreams=b);a.h.imageStreams=a.m.i;a.j.filter(a.h)}
async function zy(a,b,c){c=c.map(e=>({scheme:e.attributes.schemeIdUri,value:e.attributes.value}));const d=a.g.dash.clockSyncUri;!c.length&&d&&c.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:d});for(const e of c)try{const f=e.scheme,g=e.value;switch(f){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":return await Ey(a,b,g,"HEAD");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":return await Ey(a,
b,g,"GET");case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":const h=Date.parse(g);return isNaN(h)?0:h-Date.now();case "urn:mpeg:dash:utc:http-ntp:2014":case "urn:mpeg:dash:utc:ntp:2014":case "urn:mpeg:dash:utc:sntp:2014":ma("NTP UTCTiming scheme is not supported");break;default:ma("Unrecognized scheme in UTCTiming element",f)}}catch(f){}ma("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!");return 0}
function Ay(a){var b=Array.from(a.L.keys()).filter(c=>!a.D.includes(c));for(const c of b){b=!0;for(const d of a.L.get(c)){const e=a.o.get(d);e&&(e.segmentIndex&&e.segmentIndex.getNumReferences()!=0?b=!1:(a.m&&a.m.Eg(e,c),a.o.delete(d)))}b&&a.L.delete(c)}}function By(a,b){b=new Set(b.map(c=>c.id));for(const c of a.B.keys())b.has(c)||a.B.delete(c)}
function sy(a,b){a.h.periodCount--;for(const c of a.u.keys())if(c.startsWith(b)){const d=a.u.get(c);xw(d,ax,"SegmentTimeline").children=[];uy(a,c);a.u.delete(c)}a.D=a.D.filter(c=>c!==b);a.C.delete(b)}
function uy(a,b){var c=a.u.get(b);const d=a.o.get(b);d.segmentIndex&&d.segmentIndex.Pa(a.h.presentationTimeline.sb());try{const e=$w(c,(f,g,h,k)=>Fy(a,f,g,h,k),a.o,!0,a.g.dash.initialSegmentLimit,a.wa,c.M.aesKey,null,!0,a.B);d.createSegmentIndex=async()=>{d.segmentIndex||(d.segmentIndex=await e.Bc())}}catch(e){if(b=c.M.contentType,c=b=="image",b!=K&&b!="application"&&!c||e.code!=4002)throw e;}}
function ty(a,b){let c="",d="",e=-1,f="";for(const g of b)g.name==="Period"?c=g.id:g.name==="AdaptationSet"?(d=g.id,g.position!==null&&(e=g.position)):g.name==="Representation"&&(f=g.id);b=[];if(f)b.push(c+","+f);else if(d)for(const g of a.u.values())g.Ja.id===c&&g.ra.id===d&&g.M.id&&b.push(c+","+g.M.id);else if(e>-1)for(const g of a.u.values())g.Ja.id===c&&g.ra.position===e&&g.M.id&&b.push(c+","+g.M.id);return b}
async function Fy(a,b,c,d,e){e=e?0:1;b=cm(b,c,d,a.j.getStreamingRetryParameters());return(await oy(a,b,gg,{type:e})).data}
function Cy(a,b,c,d){b.Ja=Gy(a,d.node,null,c);b.oa=d;b.Ja.gb=b.gb;b.Ja.id||(b.Ja.id="__shaka_period_"+d.start);c=Mc(d.node,"EventStream");var e=b.presentationTimeline.sb();for(var f of c)Hy(a,d.start,d.duration,f,e);f=Mc(d.node,"SupplementalProperty");for(var g of f)g.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"&&(f=Iy(a,g))&&(b.zb=f);const h=Mc(d.node,"AdaptationSet").map((t,u)=>Jy(a,b,u,t)).filter(ue);if(b.jb){g=new Set;f=0;for(c=0;c<h.length;c++){e=h[c].aj;for(let t=0;t<e.length;t++)g.add(e[t]),
f++}if(f!=g.size)throw new H(2,4,4018);}const k=new Map;for(var l of h)for(const [t,u]of l.Lh)k.set(t,u);if(k.size){l=new Map;for(g=0;g<h.length;g++)for(f=h[g].streams,c=0;c<f.length;c++)k.has(f[c].originalId)&&(l.has(g)||l.set(g,[]),l.get(g).push(f[c].originalId));if(l.size){const t=Mc(d.node,"AdaptationSet");d=b.name;b.name="dependencyStream";l.forEach((u,v)=>{var x=t[v];if(x&&(x=Jy(a,b,v,x))){var y=[];for(let D=0;D<u.length;D++){const z=u[D],B=x.streams.find(E=>E.originalId==z);if(B){const E=k.get(B.originalId||
"");B.dependencyStream=E;B.originalId+=E.originalId;B.baseOriginalId=E.baseOriginalId;y.push(B)}}y.length&&h[v].streams.push(...y)}});b.name=d}}const [m,n]=xa(h,t=>!!t.qh);if(!a.g.disableIFrames)for(var p of m){d=p.qh.split(" ");for(var q of n)if(d.includes(q.id))for(var r of q.streams)pf(r,p.streams)}p=Ky(a.g.disableAudio,n,"audio");q=Ky(a.g.disableVideo,n,"video");r=Ky(a.g.disableText,n,K);d=Ky(a.g.disableThumbnails,n,"image");if(q.length===0&&p.length===0)throw new H(2,4,4004);return{id:b.Ja.id,
audioStreams:p,videoStreams:q,textStreams:r,imageStreams:d}}function Dy(a,b){b=new Set(b.map(c=>c.id));for(const c of Array.from(a.C.keys()))b.has(c)||a.C.delete(c)}
function Gy(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",supplementalCodecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Ie:null,audioSamplingRate:null,gb:0,Oe:1,encrypted:!1};d=d||c.Va;const e=b.attributes.id,f=b.attributes.supplementalId,g=Mc(b,"BaseURL");let h,k=!1;if(a.i)for(var l of g){var m=l.attributes.serviceLocation,n=Oc(l);m&&n&&(ox(a.i,e,m,n),k=!0)}k&&a.i||(h=g.map(Oc));const p=a.i;a=b.attributes.contentType||c.contentType;l=b.attributes.mimeType||c.mimeType;m=
Wl([b.attributes.codecs||c.codecs]).join(",");n=[Tc(b,"urn:scte:dash:scte214-extensions","supplementalCodecs")||c.supplementalCodecs];n=Wl(n).join(",");const q=N(b,"frameRate",cd)||c.frameRate,r=b.attributes.sar||c.pixelAspectRatio,t=Ly(Mc(b,"InbandEventStream"),c.emsgSchemeIdUris);var u=Mc(b,"AudioChannelConfiguration");u=My(u)||c.Ie;const v=N(b,"audioSamplingRate",$c)||c.audioSamplingRate;a||=jy(l,m);const x=Qc(b,"SegmentBase"),y=Qc(b,"SegmentTemplate");var D=x?N(x,"availabilityTimeOffset",ad)||
0:0,z=y?N(y,"availabilityTimeOffset",ad)||0:0,B=g&&g.length?N(g[0],"availabilityTimeOffset",ad)||0:0;D=c.gb+B+D+z;z=null;(B=Qc(b,"SegmentSequenceProperties"))&&(B=N(B,"cadence",Zc))&&(z=B);B=b.attributes.label;var E=Mc(b,"Label");E&&E.length&&(E=E[0],Nc(E)&&(B=Nc(E)));return{Va:()=>Kb(d(),g.length?p&&k?px(p,e):h?h:[]:[]),md:x||c.md,kc:Qc(b,"SegmentList")||c.kc,zc:y||c.zc,Le:Qc(b,"ProducerReferenceTime")||c.Le,width:N(b,"width",$c)||c.width,height:N(b,"height",$c)||c.height,contentType:a,mimeType:l,
codecs:m,supplementalCodecs:n.split(" ").join(","),frameRate:q,pixelAspectRatio:r,emsgSchemeIdUris:t,id:f||e,originalId:e,language:b.attributes.lang,Ie:u,audioSamplingRate:v,gb:D,ve:null,Oe:z||c.Oe,label:B||null,encrypted:!1}}
function Hy(a,b,c,d,e){const f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=N(d,"timescale",$c)||1,k=N(d,"presentationTimeOffset",$c)||0;for(const m of Mc(d,"Event")){var l=N(m,"presentationTime",$c)||0;d=N(m,"duration",$c)||0;l=Math.max((l-k)/h+b,b);d=l+d/h;c!=null&&(l=Math.min(l,b+c),d=Math.min(d,b+c));if(d<e)continue;d={schemeIdUri:f,value:g,startTime:l,endTime:d,id:m.attributes.id||"",timescale:h,eventNode:hd(m)};a.j.onTimelineRegionAdded(d)}}
function Iy(a,b){if((b=Rc(b,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&N(b,"useMPDUrlQuery",bd,!1)){const c=b.attributes.queryTemplate;if(c)return()=>c=="$querypart$"?a.W:c.split("&").map(d=>{if(d=="$querypart$")return a.W;var e=/\$query:(.*?)\$/g.exec(d);if(e&&e.length==2){e=e[1];const f=(new Sa(a.W)).get(e);if(f.length)return e+"="+f[0]}return d}).join("&")}return null}
function Jy(a,b,c,d){b.ra=Gy(a,d,b.Ja,null);b.ra.position=c;let e=!1;var f=Mc(d,"Role");const g=f.map(M=>M.attributes.value).filter(ue);let h=void 0;(c=b.ra.contentType==K)&&(h="subtitle");for(var k of f)if(f=k.attributes.schemeIdUri,f==null||f=="urn:mpeg:dash:role:2011")switch(f=k.attributes.value,f){case "main":e=!0;break;case "caption":case "subtitle":h=f}let l,m;f=M=>{switch(M){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}};var n=M=>{switch(M){case 1:case 5:case 6:case 7:return"srgb";
case 9:return"rec2020";case 11:case 12:return"p3"}};const p=M=>{const ba=M.attributes["dvb:fontFamily"];M=M.attributes["dvb:url"];ba&&M&&(M=Kb(b.ra.Va(),[M],b.zb()),a.j.addFont(ba,M[0]))};var q=Mc(d,"EssentialProperty");k=null;let r=!1,t=null,u=!1;for(var v of q)q=v.attributes.schemeIdUri,q=="http://dashif.org/guidelines/trickmode"?k=v.attributes.value:q=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?l=f(parseInt(v.attributes.value,10)):q=="urn:mpeg:mpegB:cicp:ColourPrimaries"?m=n(parseInt(v.attributes.value,
10)):q!="urn:mpeg:mpegB:cicp:MatrixCoefficients"&&(q=="urn:mpeg:dash:ssr:2023"&&a.g.dash.enableFastSwitching?r=!0:q=="urn:dvb:dash:fontdownload:2014"?p(v):q=="urn:mpeg:dash:urlparam:2014"?(t=Iy(a,v))||(u=!0):q!="urn:mpeg:dash:pattern:2024"&&(u=!0));if(u)return null;let x=null;v=Mc(d,"SupplementalProperty");for(var y of v)v=y.attributes.schemeIdUri,v=="http://dashif.org/guidelines/last-segment-number"?x=parseInt(y.attributes.value,10)-1:v=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?l=f(parseInt(y.attributes.value,
10)):v=="urn:mpeg:mpegB:cicp:ColourPrimaries"?m=n(parseInt(y.attributes.value,10)):v=="urn:dvb:dash:fontdownload:2014"?p(y):v=="urn:mpeg:dash:urlparam:2014"&&(t=Iy(a,y));t&&(b.zb=t);y=Mc(d,"Accessibility");const D=new Map;let z;for(var B of y)if(y=B.attributes.schemeIdUri,v=B.attributes.value,y!="urn:scte:dash:cc:cea-608:2015"||a.g.disableText)if(y!="urn:scte:dash:cc:cea-708:2015"||a.g.disableText)y=="urn:mpeg:dash:role:2011"?v!=null&&(g.push(v),v=="captions"&&(h="caption")):y=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&
(v=="1"?z="visually impaired":v=="2"?z="hard of hearing":v=="9"&&(z="spoken subtitles"));else if(y=1,v!=null)for(var E of v.split(";"))E.includes("=")?(f=E.split("="),v=`svc${f[0]}`,f=f[1].split(",")[0].split(":").pop()):(v=`svc${y}`,y++,f=E),D.set(v,ye(f));else D.set("svc1","und");else if(y=1,v!=null){v=v.split(";");for(var J of v)J.includes("=")?(n=J.split("="),f=n[0].startsWith("CC")?n[0]:`CC${n[0]}`,n=n[1]||"und"):(f=`CC${y}`,v.length==2?y+=2:y++,n=J),D.set(f,ye(n))}else D.set("CC1","und");B=
Mc(d,"ContentProtection");const X=rw(a.qa,B,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);b.ra.encrypted=B.length>0;const L=ye(b.ra.language||"und"),W=b.ra.label,F=new Map;d=Mc(d,"Representation");if(!a.g.ignoreSupplementalCodecs){B=[];for(var I of d)if(E=Tc(I,"urn:scte:dash:scte214-extensions","supplementalCodecs"))J=zc(I),J.attributes.codecs=E.split(" ").join(","),J.attributes.id&&(J.attributes.supplementalId=J.attributes.id+"_supplementalCodecs"),B.push(J);d.push(...B)}I=d.map(M=>{const ba=Ny(a,
b,X,h,L,W,e,g,D,M,z,x);return ba&&(ba.hdr=ba.hdr||l,ba.colorGamut=ba.colorGamut||m,ba.fastSwitching=r,M=M.attributes.dependencyId)?(ba.baseOriginalId=M,F.set(M,ba),null):ba}).filter(M=>!!M);if(I.length==0&&F.size==0){var O=b.ra.contentType=="image";if(a.g.dash.ignoreEmptyAdaptationSet||c||O)return null;throw new H(2,4,4003);}if(!b.ra.contentType||b.ra.contentType=="application"){b.ra.contentType=jy(I[0].mimeType,I[0].codecs);for(const M of I)M.type=b.ra.contentType}c=b.ra.id||"__fake__"+a.ya++;for(O of I){for(const M of X.drmInfos)M.keyIds=
M.keyIds&&O.keyIds?new Set([...M.keyIds,...O.keyIds]):M.keyIds||O.keyIds;a.g.enableAudioGroups&&(O.groupId=c)}O=d.map(M=>M.attributes.supplementalId||M.attributes.id).filter(ue);return{id:c,contentType:b.ra.contentType,language:L,Pk:e,streams:I,drmInfos:X.drmInfos,qh:k,aj:O,Lh:F}}function Ky(a,b,c){return a||!b.length?[]:b.reduce((d,e)=>{if(e.contentType!=c)return d;d.push(...e.streams);return d},[])}
function Ny(a,b,c,d,e,f,g,h,k,l,m,n){const p=b.Ja.id;b.M=Gy(a,l,b.ra,null);const q=b.M.id;a.X=Math.min(a.X,b.M.gb);a.S=a.X>0;if(!Oy(b.M))return null;const r=b.oa.start;b.bandwidth=N(l,"bandwidth",Zc)||0;b.roles=h;var t=Mc(l,"SupplementalProperty"),u=Mc(l,"EssentialProperty"),v=Mc(l,"ContentProtection");l=null;var x=u.find(J=>J.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014");x?l=Iy(a,x):(x=t.find(J=>J.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"))&&(l=Iy(a,x));l&&(b.zb=l);let y;x=b.M.contentType;
l=x==K||x=="application";x=x=="image";v.length&&(b.ra.encrypted=!0);try{let J=void 0;if(c.df){var D=b.M.Va;const X=b.zb,L=Kb(D(),[c.df.Ei],X()),W=ag(L,a.g.retryParameters);J={bitsKey:128,blockCipherMode:"CBC",iv:c.df.iv,firstMediaSequenceNumber:0,fetchKey:async()=>{const F=await oy(a,W,6);if(!F.data||F.data.byteLength!=16)throw new H(2,4,4049);J.cryptoKey=await window.crypto.subtle.importKey("raw",F.data,{name:"AES-CBC"},!0,["decrypt"]);J.fetchKey=void 0}}}b.M.aesKey=J;D=(X,L,W,F)=>Fy(a,X,L,W,F);
if(b.M.md)y=Pw(b,D,J);else if(b.M.kc)y=Vw(b,a.o,J);else if(b.M.zc)y=$w(b,D,a.o,!!a.h,a.g.dash.initialSegmentLimit,a.wa,J,n,!1,a.B);else{const X=b.oa.duration||0,L=b.M.Va,W=b.M.mimeType,F=b.M.codecs;y={endTime:-1,timeline:-1,Bc:()=>{const I=kl(r,X,L());I.yb(O=>{O.mimeType=W;O.codecs=F});return Promise.resolve(I)},timescale:1}}}catch(J){if((l||x)&&J.code==4002)return null;throw J;}n=sw(a.qa,v,c,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);n=new Set(n?[n]:[]);v=t.some(J=>J.attributes.schemeIdUri=="tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&
J.attributes.value=="JOC");t=t.some(J=>J.attributes.schemeIdUri=="tag:dolby.com,2016:dash:virtualized_content:2016"&&J.attributes.value=="1");t=v||t;v=!1;l&&(v=h.includes("forced_subtitle")||h.includes("forced-subtitle"));let z;if(x&&((u=u.find(J=>["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(J.attributes.schemeIdUri)))&&(z=u.attributes.value),!z))return null;let B;u=b.M.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&
(u.includes("hvc1.2.4.L153.B0")||u.includes("hev1.2.4.L153.B0"))&&(B="PQ");(l=q?p+","+q:"")&&b.name&&(l+=b.name);a.G.length&&l&&a.u.set(l,Py(b));b.M.Le&&Qy(a,b.M.Le,y,b.presentationTimeline);y.endTime!=-1&&p!=null&&q!=null&&((x=a.B.get(p))?(x.endTime=y.endTime,x.cg.includes(q)||x.cg.push(q),a.B.set(p,x)):a.B.set(p,{endTime:y.endTime,timeline:y.timeline,cg:[q]}));let E;E=l&&a.o.has(l)?a.o.get(l):{id:a.ya++,originalId:q,groupId:null,createSegmentIndex:()=>Promise.resolve(),closeSegmentIndex:()=>{E.segmentIndex&&
(E.segmentIndex.release(),E.segmentIndex=null)},segmentIndex:null,mimeType:b.M.mimeType,codecs:u,supplementalCodecs:b.M.supplementalCodecs,frameRate:b.M.frameRate,pixelAspectRatio:b.M.pixelAspectRatio,bandwidth:b.bandwidth,width:b.M.width,height:b.M.height,kind:d,encrypted:c.drmInfos.length>0,drmInfos:c.drmInfos,keyIds:n,language:e,originalLanguage:b.ra.language,label:f,type:b.ra.contentType,primary:g,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:b.M.emsgSchemeIdUris,roles:h,forced:v,
channelsCount:b.M.Ie,audioSamplingRate:b.M.audioSamplingRate,spatialAudio:t,closedCaptions:k,hdr:B,colorGamut:void 0,videoLayout:void 0,tilesLayout:z,accessibilityPurpose:m,external:!1,fastSwitching:!1,fullMimeTypes:new Set([Rd(b.M.mimeType,b.M.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null};E.createSegmentIndex=async()=>{E.segmentIndex||(E.segmentIndex=await y.Bc())};l&&b.jb&&!a.o.has(l)&&(a.o.set(l,E),a.L.getOrInsertComputed(p||"",()=>[]).push(l));return E}
function Oy(a){let b;b=a.md?1:0;b+=a.kc?1:0;b+=a.zc?1:0;if(b==0)return a.contentType==K||a.contentType=="application"?!0:!1;b!=1&&(a.md&&(a.kc=null),a.zc=null);return!0}function Py(a){const b=c=>{if(!c)return null;c=Ac(c);c.md=null;c.kc=null;c.zc=hd(c.zc);c.Le=null;return c};a=Ac(a);a.Ja=b(a.Ja);a.ra=b(a.ra);a.M=b(a.M);a.oa&&(a.oa=Ac(a.oa),a.oa.node=null);return a}
function Qy(a,b,c,d){if(!a.Z.has(b)){a.Z.add(b);var e=N(b,"presentationTime",$c)||0,f=Qc(b,"UTCTiming"),g;if(g=f&&f.attributes.schemeIdUri)f=f.attributes.schemeIdUri,g=!(f==="urn:mpeg:dash:utc:http-ntp:2014"||f==="urn:mpeg:dash:utc:ntp:2014"||f==="urn:mpeg:dash:utc:sntp:2014");g?b=(N(b,"wallClockTime",Vc)||0)*1E3:(b=N(b,"wallClockTime",$c)||0,b=rj(b));c=new Date(b-e/c.timescale*1E3);e=c.getTime()/1E3;isNaN(e)||(d.o||d.jg(e),d=(new Map).set("detail",{wallClockTime:b,programStartDate:c}),d=new P("prft",
d),a.j.onEvent(d))}}function Ly(a,b){b=b.slice();for(const c of a)a=c.attributes.schemeIdUri,b.includes(a)||b.push(a);return b}
function My(a){for(const e of a){var b=e.attributes.schemeIdUri;if(!b)continue;if(a=e.attributes.value)switch(b){case "urn:mpeg:dash:outputChannelPositionList:2012":return a.trim().split(/ +/).length;case "urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case "urn:dts:dash:audio_channel_configuration:2012":a=parseInt(a,10);if(!a)continue;return a;case "tag:dolby.com,2015:dash:audio_channel_configuration:2015":b=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2];a=parseInt(a,16);if(!a)continue;var c=0;for(var d=
0;d<b.length;d++)a&1<<d&&(c+=b[d]);if(c)return c;continue;case "tag:dolby.com,2014:dash:audio_channel_configuration:2011":case "urn:dolby:dash:audio_channel_configuration:2011":b=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse();a=parseInt(a,16);if(!a)continue;c=0;for(d=0;d<b.length;d++)a&1<<d&&(c+=b[d]);if(c)return c;continue;case "urn:mpeg:mpegB:cicp:ChannelConfiguration":if(b=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(a=parseInt(a,10))&&a>0&&a<b.length)return b[a]}}return null}
async function Ey(a,b,c,d){c=[Ab(c)];b=Kb(b(),c);b=ag(b,a.g.retryParameters);b.method=d;b=a.j.networkingEngine.request(4,b,{isPreload:a.ba()});Wf(a.P,b);a=await b.promise;if(d=="HEAD"){if(!a.headers||!a.headers.date)return 0;d=a.headers.date}else d=ub(a.data);d=Date.parse(d);return isNaN(d)?0:d-Date.now()}
var yy=class{constructor(){this.j=this.g=null;this.A=[];this.h=null;this.ya=1;this.G=[];this.l={Ee:"",type:"",profiles:[],cc:null,gb:0,Va:null,Gd:0};this.u=new Map;this.B=new Map;this.C=new Map;this.o=new Map;this.L=new Map;this.wa=new Map;this.m=new Fx;this.O=0;this.Ba=new ja(5);this.J=new te(()=>{if(this.I&&!this.g.continueLoadingWhenPaused&&(this.H.Ma(this.I,"timeupdate"),this.I.paused)){this.H.na(this.I,"timeupdate",()=>ky(this));return}ky(this)});this.P=new Xf;this.N=null;this.D=[];this.X=Infinity;
this.ma=!1;this.i=null;this.K=0;this.S=!1;this.H=new Ca;this.I=null;this.T=!1;this.W="";this.ba=()=>!1;this.sa=[];this.Z=new Set;this.qa=new tw}configure(a,b){const c=this.j&&a.updatePeriod!=this.g.updatePeriod&&a.updatePeriod>=0;this.g=a;b&&(this.ba=b);c&&this.h&&this.h.presentationTimeline.isLive()&&this.J.La();this.i&&this.i.configure(this.g);this.m&&this.m.kh(this.g.dash.useStreamOnceInPeriodFlattening)}async start(a,b){this.ma=b.isLowLatencyMode();this.A=[a];this.j=b;a=await ly(this);this.j&&
my(this,a);if(!this.j)throw new H(2,7,7001);return this.h}stop(){for(const a of this.o.values())a.segmentIndex&&a.segmentIndex.release();this.m&&this.m.release();this.g=this.j=null;this.A=[];this.h=null;this.o.clear();this.L.clear();this.u.clear();this.B.clear();this.C.clear();this.l={Ee:"",type:"",profiles:[],cc:null,gb:0,Va:null,Gd:0};this.m=null;this.J!=null&&(this.J.stop(),this.J=null);this.i&&this.i.destroy();this.H&&(this.H.release(),this.H=null);this.Z.clear();this.qa.release();return this.P.destroy()}async update(){try{await ly(this)}catch(a){if(this.j&&
a)this.j.onError(a)}}onExpirationUpdated(){}onInitialVariantChosen(a){if(this.h&&this.h.presentationTimeline.isLive()){var b=a.video||a.audio;if(b&&b.segmentIndex){a=this.h.presentationTimeline.vc();const c=b.segmentIndex.find(a);c!=null&&(b=b.segmentIndex.get(c))&&(this.O=b.endTime-a,my(this,0))}}}banLocation(a){this.i&&this.i.banLocation(a)}setMediaElement(a){this.I=a}};w("shaka.dash.DashParser",yy);Xb("application/dash+xml",()=>new yy);Xb("video/vnd.mpeg.dash.mpd",()=>new yy);function $b(){const a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}function ac(a){return ej().canPlayType(a)!=""}function uh(a,b){a=a.i();return["DESKTOP","MOBILE","VR","APPLE_VR"].includes(a)?b.remote:null}
var Ry=class{constructor(){this.Ka=new Ga(()=>{var a=navigator.userAgent.toLowerCase(),b=[{type:"VR",$f:/oculus|quest/},{type:"TV",$f:/smart[ _]?tv|android ?tv/},{type:"MOBILE",$f:/iphone|ipad|ipod|android/}];for(const c of b)if(c.$f.test(a))return c.type;a=navigator.userAgentData;b=a?.platform?.toLowerCase()||"";if(a){if(a.mobile)return"MOBILE";if(b.includes("android"))return"TV"}return"DESKTOP"});this.Oa=new Ga(()=>{const a=navigator.userAgent;return navigator.vendor.includes("Apple")&&(a.includes("Version/")||
a.includes("OS/"))?"WEBKIT":a.includes("Edge/")?"EDGE":a.includes("Chrome/")?"CHROMIUM":a.includes("Firefox/")?"GECKO":"UNKNOWN"})}u(){return!!navigator.mediaCapabilities}i(){return this.Ka.value()}h(){return this.Oa.value()}G(){return!1}S(){return!1}K(){return!1}ma(){return!1}I(){return!1}D(){return!0}l(){const a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType}J(){return!0}qa(){return 0}o(){return Promise.resolve({width:Infinity,height:Infinity})}sa(){return!1}T(){return!1}j(a){const b=
this.i();if(b==="TV"||b==="CONSOLE"||b==="CAST")a.ads.customPlayheadTracker=!0,a.ads.skipPlayDetection=!0,a.ads.supportsMultipleMediaElements=!1;return a}W(){return!!window.indexedDB}ba(){return[]}A(a){return window.matchMedia!==void 0&&(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(dynamic-range: high)").matches)?a?"HLG":"PQ":"SDR"}Ba(){return!1}X(){return!1}L(){return!1}O(){return!0}Z(){return!1}wa(){return!0}B(){return!1}P(a){return a==="com.apple.fps"}N(){return!0}toString(){return`Device: ${this.m()} v${this.g()}; Type: ${this.i()}`}};function Sy(a){a=a.C.value();return a[0]>=27?!0:a[0]===26&&a[1]>=4}
var Ty=class extends Ry{constructor(){super();this.C=new Ga(()=>{let a=navigator.userAgent.match(/Version\/(\d+)(?:\.(\d+))?/);a||=navigator.userAgent.match(/OS (\d+)(?:_(\d+))?/);return a?[parseInt(a[1],10),parseInt(a[2]||"0",10)]:[0,0]});this.H=new Ga(()=>/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP")}g(){return this.C.value()[0]}m(){return"Apple Browser"}i(){return this.H.value()}h(){return"WEBKIT"}u(){return!1}G(a,b){return!Sy(this)&&
b==="audio"}K(){return!Sy(this)}ma(a){return!Sy(this)&&a==="audio"}j(a){super.j(a);a.abr.minTimeToSwitch=.5;return a}Ba(){return!0}N(){return!1}};(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(Ja=()=>new Ty);function Uy(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}
var Yy=class extends Ry{constructor(){if(!Uy())throw Error("Not a Chromecast device!");super();this.H=new Ga(()=>{const a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null});this.C=new Ga(()=>{let a=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;a=a.toLowerCase();return a.includes("android")?Vy:a.includes("fuchsia")?Wy:Xy})}g(){return this.H.value()}m(){return"Chromecast with "+this.C.value()}i(){return"CAST"}h(){return"CHROMIUM"}u(){return super.u()&&
this.C.value()!==Xy}l(a){return super.l(a)&&this.C.value()!==Xy}qa(){switch(this.C.value()){case Vy:return 0;case Wy:return 3;default:return 1}}async o(){const a=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType,b={width:1280,height:720};try{a&&await cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?(b.width=3840,b.height=2160):a&&await cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080')&&(b.width=1920,
b.height=1080)}catch(c){la("Failed to check canDisplayType:",c)}return b}j(a){super.j(a);a.streaming.stallSkip=0;return a}W(){return!1}B(){return!0}},Vy="Android",Wy="Fuchsia",Xy="Linux";Uy()&&(Ja=()=>new Yy);var Zy=class extends Ry{constructor(){super();this.ya=new Ga(()=>{const a=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return a?parseInt(a[2],10):null});this.C=new Ga(()=>navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown");this.H=new Ga(()=>navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="windows":navigator.platform?navigator.platform.toLowerCase().includes("win32"):
!1);this.Ta=new Ga(()=>navigator.userAgent.includes("sony.hbbtv.tv"));this.Sa=new Ga(()=>navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="android":navigator.userAgent.includes("Android")?!0:!1)}g(){return this.ya.value()}m(){return this.C.value()}G(a){return mb(a)?this.H.value():!1}S(a){return mb(a)||this.C.value()==="Edge"?this.H.value():!1}K(a){return mb(a)||this.C.value()==="Edge"?this.H.value():!1}l(a){return this.H.value()&&mb(a)?!1:super.l(a)}j(a){super.j(a);
if(this.H.value())switch(this.C.value()){case "Firefox":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case "Chrome":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}this.Sa.value()&&(a.drm.defaultAudioRobustnessForWidevine="",a.drm.defaultVideoRobustnessForWidevine="");return a}L(){return this.C.value()==="Edge"||
this.Ta.value()}B(){if(this.h()==="GECKO"){const a=this.g();return a!==null?a>=100:super.B()}return super.B()}P(a){return this.h()==="GECKO"?mb(a):super.P(a)}};Ka=()=>new Zy;var $y=class extends Ry{g(){return null}m(){return"Hisense"}i(){return"TV"}u(){return!1}l(){return!1}o(){const a={width:1920,height:1080};let b=null;if(window.Hisense_Get4KSupportState)try{b=window.Hisense_Get4KSupportState()}catch(c){}b==null&&(b=navigator.userAgent.includes("UHD"));b&&(a.width=3840,a.height=2160);return Promise.resolve(a)}j(a){super.j(a);a.streaming.stallSkip=0;return a}};if(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))Ja=()=>new $y;var az=class extends Ry{constructor(){super();this.C=new Ga(()=>{const a=navigator.userAgent.match(/PlayStation (\d+)/);return a?parseInt(a[1],10):null})}m(){return"PlayStation"}i(){return"CONSOLE"}h(){return"WEBKIT"}g(){return this.C.value()}u(){return!1}D(){return!1}l(){return!1}T(){return this.g()===4}async o(){const a={width:1920,height:1080};let b=!1;try{b=(await window.msdk.device.getDisplayInfo()).resolution==="4K"}catch(c){try{b=(await window.msdk.device.getDisplayInfoImmediate()).resolution===
"4K"}catch(d){ma("PlayStation: Failed to get the display info:",d)}}b&&(a.width=3840,a.height=2160);return a}j(a){super.j(a);this.g()===4&&a.drm.preferredKeySystems.push("com.microsoft.playready");a.streaming.clearDecodingCache=!0;return a}L(){return this.g()===4}O(){return this.g()!==4}};navigator.userAgent.includes("PlayStation")&&(Ja=()=>new az);var bz=class extends Ry{g(){return null}m(){return"TitanOS"}i(){return"TV"}o(){const a={width:1920,height:1080};try{SmartTvA_API.hasCapability("UHD")?(a.width=3840,a.height=2160):SmartTvA_API.hasCapability("FHD")?(a.width=1920,a.height=1080):(a.width=1280,a.height=720)}catch(b){ma("Titan OS: Error detecting screen size, default screen size 1920x1080.",b)}return Promise.resolve(a)}A(a){try{if(SmartTvA_API.hasCapability("HDR","HDR10")||SmartTvA_API.hasCapability("HDR","DV"))return a?"HLG":"PQ"}catch(b){return ma("Titan OS: Error checking HDR support",
b),super.A(a)}return"SDR"}};navigator.userAgent.includes("TitanOS")&&(Ja=()=>new bz);var cz=class extends Ry{g(){return null}m(){return"TiVoOS"}i(){return"TV"}h(){return"CHROMIUM"}l(){return!1}};navigator.userAgent.includes("TiVoOS")&&(Ja=()=>new cz);var dz=class extends Ry{constructor(){super();const a=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.C=a?parseInt(a[1],10):null;this.H=a?parseInt(a[2],10):null}g(){return this.C}m(){return"Tizen"}h(){return"CHROMIUM"}i(){return"TV"}G(){return!0}I(){return this.g()===3}u(){return!1}D(){const a=this.g();return a!==null?a>=4:super.D()}l(){return!1}J(){return this.C&&this.H?this.C===5?this.H>=5:this.C>5:super.J()}o(){var a=window.devicePixelRatio;a={width:window.screen.width*a>1920?3840:1920,height:window.screen.height*
a>1080?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){const b=webapis.systeminfo.getMaxVideoResolution();a.width=b.width;a.height=b.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(a.width=7680,a.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(a.width=3840,a.height=2160)}catch(b){ma("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}j(a){super.j(a);
a.drm.ignoreDuplicateInitData=this.g()!==2;this.g()===3&&(a.streaming.crossBoundaryStrategy="reset_to_encrypted");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;a.streaming.gapPadding=2;return a}ba(){const a=[];this.C!==null&&this.C<5&&a.push("opus");return a}A(a){try{if(webapis.avinfo.isHdrTvSupport())return a?"HLG":"PQ"}catch(b){return super.A(a)}return"SDR"}X(){return!0}Z(){return this.g()===3}};navigator.userAgent.includes("Tizen")&&(Ja=()=>new dz);var ez=class extends Ry{g(){return null}m(){return"Vizio"}i(){return"TV"}u(){return!1}};navigator.userAgent.includes("VIZIO SmartCast")&&(Ja=()=>new ez);var fz=class extends Ry{constructor(){super();this.ya=new Ga(()=>navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB"));this.H=new Ga(()=>navigator.userAgent.includes("SOPOpenBrowser"));this.C=new Ga(()=>{if(navigator.userAgent.includes("DT_STB_BCM"))return 11;let a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null})}g(){return this.C.value()}m(){return"WebKit STB"}i(){return"TV"}h(){return"WEBKIT"}u(){return!1}D(){const a=
this.C.value();return a!==null?a>=15:!0}G(){return this.H.value()}o(){return Promise.resolve({width:window.screen.width*window.devicePixelRatio,height:window.screen.height*window.devicePixelRatio})}O(){return!this.ya.value()}N(){return!1}};
if(navigator.userAgent.includes("SOPOpenBrowser")||navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))Ja=()=>new fz;function gz(){let a=null;const b=navigator.userAgent.match(/Chrome\/(\d+)/);b&&(a=parseInt(b[1],10));switch(a){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;default:return null}}
var hz=class extends Ry{constructor(){super();this.H=gz();this.C=null;try{const a=new PalmServiceBridge;a.onservicecallback=b=>{b=JSON.parse(b);this.C=b.configs?.["tv.model.supportHDR"]??b.configs?.["tv.config.supportDolbyHDRContents"]??!1};a.call("luna://com.webos.service.config/getConfigs",JSON.stringify({configNames:["tv.model.supportHDR","tv.config.supportDolbyHDRContents"]}))}catch(a){ma("WebOS: getConfigs call failed",a)}}g(){return this.H}m(){return"WebOS"}i(){return"TV"}h(){return"CHROMIUM"}u(){return!1}D(){const a=
this.g();return a!==null?a>3:super.D()}l(){return!1}J(){const a=this.g();return a!==null?a>3:super.J()}o(){const a={width:1920,height:1080};try{const b=JSON.parse(window.PalmSystem.deviceInfo);a.width=Math.max(1920,b.screenWidth);a.height=Math.max(1080,b.screenHeight)}catch(b){ma("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}j(a){super.j(a);this.g()===3&&(a.streaming.crossBoundaryStrategy="reset");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=
0;return a}A(a){return this.C==null?(ma("WebOS: getConfigs call haven't finished"),super.A(a)):this.C?a?"HLG":"PQ":"SDR"}wa(){return!1}B(){const a=this.g();return a!==null?a>=6:super.B()}};if(navigator.userAgent.includes("Web0S")){const a=new hz;Ja=()=>a};function iz(){let a=null;try{a=typeof Windows!=="undefined"?Windows:chrome.webview.hostObjects.sync.Windows}catch(b){}return a}
var jz=class extends Ry{constructor(){super();this.C=navigator.userAgent.includes("Edge/");const a=navigator.userAgent.match(/Edge?\/(\d+)/);this.H=a?parseInt(a[1],10):null}g(){return this.H}m(){return"Xbox"}i(){return"CONSOLE"}h(){return this.C?"EDGE":"CHROMIUM"}G(){return!0}S(){return!0}K(){return!0}sa(){return this.C}o(){const a={width:1920,height:1080};var b=iz();if(b)try{const c=new b.Media.Protection.ProtectionCapabilities,d=b.Media.Protection.ProtectionCapabilityResult;b=null;do b=c.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',
"com.microsoft.playready.recommendation");while(b===d.maybe);b===d.probably&&(a.width=3840,a.height=2160)}catch(c){ma("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}j(a){super.j(a);a.drm.parseInbandPsshEnabled=this.C;a.drm.preferredKeySystems.push("com.microsoft.playready");this.C&&(a.streaming.gapPadding=.01);return a}L(){return!0}W(){return!1}};if(navigator.userAgent.includes("Xbox One")||iz()!==null)Ja=()=>new jz;var kz=class{constructor(a,b,c){this.type=a;this.aa=b;this.segments=c||null}};function lz(a,b){if(b)return a.toString();b=(new Set).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI");return a.toString(b)}function mz(a,b){return a.attributes.find(c=>c.name===b)||null}function Z(a,b,c){return(a=mz(a,b))?a.value:c||null}function nz(a,b){a=mz(a,b);if(!a)throw new H(2,4,4023,b);return a.value}
var oz=class{constructor(a,b,c,d=null){this.id=a;this.name=b;this.attributes=c;this.value=d}toString(a){var b=d=>d.name+"="+(isNaN(Number(d.value))?'"'+d.value+'"':d.value);let c="#"+this.name;b=this.attributes?this.attributes.filter(d=>a?!a.has(d.name):!0).map(b):[];this.value&&b.unshift(this.value);b.length>0&&(c+=":"+b.join(","));return c}},pz=class{constructor(a,b,c=[]){this.aa=b;this.g=a;this.Tb=c}},qz=class{constructor(a,b){this.name=a;this.value=b}};function rz(a,b){return a.filter(c=>c.name==b)}function sz(a,b){return a.filter(c=>nz(c,"TYPE")==b)}function tz(a,b){for(const c of a)if(c.name===b)return c;return null}function uz(a,b,c=0){return(a=tz(a,b))?Number(a.value):c}function vz(a,b,c){return b?wz(a,[b],c):[]}function wz(a,b,c){if(!b.length)return[];let d=b;c&&c.size&&(d=b.map(e=>xz(e,c)));return Kb(a,d)}
function xz(a,b){if(!b||!b.size)return a;a=String(a).replace(/%7B/g,"{").replace(/%7D/g,"}");var c=a.match(/{\$\w*}/g);if(c)for(const d of c){c=d.slice(2,d.length-1);const e=b.get(c);if(e)a=a.replace(d,e);else throw new H(2,4,4039,c);}return a}function yz(a){a=a.value;const b=a.indexOf(",");return Number(b===-1?a:a.substring(0,b))}function zz(a){return(a=Z(a,"SUPPLEMENTAL-CODECS"))?a.split(/\s*,\s*/).map(b=>b.split("/")[0]).join(","):""};function Az(a,b){var c=b.indexOf(":"),d=c===-1?b.substring(1):b.substring(1,c);if(!d.startsWith("EXT"))throw new H(2,4,4016,b);const {name:e,data:f}={name:d,data:c===-1?null:b.substring(c+1)};if(f===null)return new oz(a,e,[]);if(f.indexOf("=")===-1)return new oz(a,e,[],f);b=[];c=null;d=0;var g=f.indexOf(","),h=f.indexOf("=");g!==-1&&g<h&&(c=f.substring(0,g),d=g+1);for(;d<f.length;){for(;f[d]===" ";)d++;h=f.indexOf("=",d);if(h===-1)break;g=f.substring(d,h);d=h+1;if(f[d]==='"'){d++;var k=f.indexOf('"',
d);h=k===-1?f.substring(d):f.substring(d,k);d=k===-1?f.length:k+1}else k=f.indexOf(",",d),h=k===-1?f.substring(d):f.substring(d,k),d=k===-1?f.length:k;d<f.length&&f[d]===","&&d++;b.push(new qz(g,h))}return new oz(a,e,b,c)}
function Bz(a,b){var c=ub(b).trim().split(/[\r\n]+/);if(!c[0].startsWith("#EXTM3U"))throw new H(2,4,4015);b=0;var d=!1;const e=[];var f=!0;for(var g=0;g<c.length;g++){var h=c[g],k=c[g+1];if(h.startsWith("#")&&!h.startsWith("#EXT")||f){f=!1;continue}h=Az(a.g++,h);d||(Cz.has(h.name)?(b=1,d=!0):h.name=="EXT-X-STREAM-INF"||h.name=="EXT-X-MEDIA"?d=!0:Dz.has(h.name)&&(b=1,d=!0));if(Dz.has(h.name)){if(b!=1)throw new H(2,4,4017);var l=g;g=Array(Math.max(100,Math.floor((c.length-l)/2)));d=0;k=[];h=[];for(f=
null;l<c.length;l++){var m=c[l];if(m.startsWith("#EXT"))m=Az(a.g++,m),Cz.has(m.name)?e.push(m):m.name=="EXT-X-MAP"?f=m:m.name=="EXT-X-PART"?h.push(m):m.name=="EXT-X-PRELOAD-HINT"?Z(m,"TYPE")=="PART"?h.push(m):Z(m,"TYPE")=="MAP"&&(m.name="EXT-X-MAP",f=m):k.push(m);else if(!m.startsWith("#")||m.startsWith("#EXT"))m=m.trim(),f&&k.push(f),k=new pz(m,k,h),d<g.length?g[d++]=k:(g.push(k),d++),k=[],h=[]}h.length&&(f&&k.push(f),a=new pz("",k,h),d<g.length?g[d++]=a:(g.push(a),d++));return new kz(b,e,d<g.length?
g.slice(0,d):g)}e.push(h);h.name=="EXT-X-STREAM-INF"&&(h.attributes.push(new qz("URI",k)),f=!0)}return new kz(b,e)}var Ez=class{constructor(){this.g=0}},Cz=new Set("EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" ")),Dz=new Set("EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" "));function Fz(a,b){try{const c=Gz(a);return Nf({uri:a,originalUri:a,data:c.data,headers:{"content-type":c.contentType},originalRequest:b})}catch(c){return Kf(c)}}
function Gz(a){if(!a.startsWith("data:"))throw new H(2,1,1004,a);var b=a.substring(5),c=b.indexOf(",");if(c<0)throw new H(2,1,1004,a);a=b.substring(0,c);b=decodeURIComponent(b.substring(c+1));c=a.split(";");a=c[0];let d=!1;c.length>1&&c[c.length-1].toLowerCase()=="base64"&&(d=!0,c.pop());let e;d?e=Eb(b):e=yb(b);return{data:e,contentType:a,pg:c}}var Hz=class{};w("shaka.net.DataUriPlugin",Hz);Hz.parse=Fz;Yf("data",Fz);async function Iz(a,b,c,d){if(c=="video/mp2t")throw new H(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new H(2,4,4041);var e=nz(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(e))return null;c="cenc";e=="SAMPLE-AES"&&(c="cbcs");e=nz(b,"URI");b=Lb("com.apple.fps",c,null,e);c=(new Ma(e)).wb.replace(/-/g,"").toLowerCase();c=c.length===32&&/^[0-9a-f]+$/.test(c)?c:null;!c&&d&&(c=await Jz(a,d));c&&b.keyIds.add(c);return b}
function Kz(a,b){var c=nz(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c))return Promise.resolve(null);var d="cenc";c=="SAMPLE-AES"&&(d="cbcs");c=nz(b,"URI");const e=Gz(c.split("?")[0]);a=a.sa.getOrInsertComputed(c.split("?")[0],()=>G(e.data));d=Lb("com.widevine.alpha",d,[{initDataType:"cenc",initData:a}],void 0,e.pg);(b=Z(b,"KEYID"))&&d.keyIds.add(b.toLowerCase().substr(2));return Promise.resolve(d)}
function Lz(a,b){var c=nz(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c))return Promise.resolve(null);var d="cenc";c=="SAMPLE-AES"&&(d="cbcs");c=nz(b,"URI");const e=Gz(c.split("?")[0]);a=a.sa.getOrInsertComputed(c.split("?")[0],()=>G(e.data));d=Lb("com.huawei.wiseplay",d,[{initDataType:"cenc",initData:a}],void 0,e.pg);(b=Z(b,"KEYID"))&&d.keyIds.add(b.toLowerCase().substr(2));return Promise.resolve(d)}
async function Mz(a){if(a.i){try{const b=Date.now();await a.update();const c=Date.now();if(Nz(a)){a.$a.sample(1,(c-b)/1E3);const d=Math.max(0,(a.g.updatePeriod>0?a.g.updatePeriod:a.u)-ia(a.$a));isFinite(d)?a.B.ha(d):a.B.ha(1)}}catch(b){if(!a.i)return;if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure){a.i.onError(b);return}b.severity=1;a.i.onError(b);a.B.ha(.1)}if(a.i)a.i.onManifestUpdated()}}function Oz(a,b,c){return Pz(a,ag(b,a.g.retryParameters),0,{type:c?2:3})}
async function Qz(a,b){b=Bz(a.Ka,b);var c=rz(b.aa,"EXT-X-DEFINE"),d=[],e=[],f=[];a.m=new U(null,0);a.m.od(!0);const g=()=>[a.C];var h=null,k=new Map;a.h={presentationTimeline:a.m,variants:d,textStreams:e,imageStreams:f,chapterStreams:[],offlineSessionIds:[],sequenceMode:a.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:a.g.hls.ignoreManifestTimestampsInSegmentsMode,type:"HLS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:a.o};if(b.type==1){a.O=!1;
k=rz(b.aa,"EXT-X-DEFINE");k=Rz(a,k,a.C);h=new Map;var l=a.C;l=await Sz(a,a.D++,k,b,g,"","video","",!0,"Media Playlist",null,h,null,!1,null,!1,"",l);a.j.set(a.C,l);if(l.stream){const q=ul(l.stream);l.stream.segmentIndex.yb(r=>{r.ea&&(r.ea.cd=q)})}h=l.stream.type;c=!0;a.g.disableAudio&&l.type=="audio"?c=!1:a.g.disableVideo&&l.type=="video"&&!l.stream.codecs.includes(",")&&(c=!1);c&&d.push({id:0,language:ye("und"),disabledUntilTime:0,primary:!0,audio:l.type=="audio"?l.stream:null,video:l.type=="video"?
l.stream:null,bandwidth:l.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});a.g.hls.chaptersUri&&!a.N.includes(a.g.hls.chaptersUri)&&a.N.push(a.g.hls.chaptersUri);await Tz(a)}else{Uz(a,c);e=rz(b.aa,"EXT-X-MEDIA");d=rz(b.aa,"EXT-X-STREAM-INF");f=rz(b.aa,"EXT-X-IMAGE-STREAM-INF");c=rz(b.aa,"EXT-X-I-FRAME-STREAM-INF");const q=rz(b.aa,"EXT-X-SESSION-KEY");var m=rz(b.aa,"EXT-X-SESSION-DATA"),n=rz(b.aa,"EXT-X-CONTENT-STEERING");a.N=Vz(a,m);a.g.hls.chaptersUri&&!a.N.includes(a.g.hls.chaptersUri)&&
a.N.push(a.g.hls.chaptersUri);await Wz(a,n);if(!a.g.ignoreSupplementalCodecs){m=[];for(var p of d){const r=zz(p);if(!r)continue;n=p.attributes.map(t=>{const u=t.name;let v=t.value;u=="CODECS"&&(v=r,t=t.value.split(","),t.length>1&&(t=Ob("audio",t))&&(v+=","+t));return new qz(u,v)});m.push(new oz(p.id,p.name,n,null))}d.push(...m);p=[];for(l of c){const r=zz(l);if(!r)continue;m=l.attributes.map(t=>{const u=t.name;t=t.value;u=="CODECS"&&(t=r);return new qz(u,t)});p.push(new oz(l.id,l.name,m,null))}c.push(...p)}Xz(a,
d);Yz(a,e);l=Zz(a,c);d=await $z(a,d,q,e,g,a.H,l);e=aA(a,e);[f]=await Promise.all([bA(a,f,c),Tz(a)])}if(!a.i)throw new H(2,7,7001);cA(a,b);b.type==1&&(Nz(a)&&(dA(a,b),a.B.ha(a.u)),l=Array.from(a.j.values()),eA(a,l),fA(a),await gA(a,b.aa,h,k,g));a.h.variants=d;a.h.textStreams=e;a.h.imageStreams=f;a.h.chapterStreams=Array.from(a.Ba.values());a.h.startTime=a.o;if(!a.Z&&a.g.hls.disableCodecGuessing){b=[];for(const q of a.h.variants)q.audio&&q.audio.codecs===""&&b.push(q.audio.createSegmentIndex()),q.video&&
q.video.codecs===""&&b.push(q.video.createSegmentIndex());await Promise.all(b)}a.i.makeTextStreamsForClosedCaptions(a.h)}function Nz(a){return a.A!=hA}
async function iA(a,b){if(!b.stream.isAudioMuxedInVideo){var c=[];for(var d of b.R()){var e=new Ma(d),f=e.g;b.fe&&(b.Cb>=0&&f.add("_HLS_msn",String(b.Cb)),b.Db>=0&&f.add("_HLS_part",String(b.Db)));b.ge?f.add("_HLS_skip","v2"):b.ie&&f.add("_HLS_skip","YES");c.push(e.toString())}try{var g=await Oz(a,c,!0).promise}catch(t){throw a.i&&a.i.disableStream(b.stream),t;}if(b.stream.segmentIndex){c=Bz(a.Ka,g.data);if(c.type!=1)throw new H(2,4,4017);d=g.uri;d==g.originalUri||b.R().includes(d)||b.Me.push(d);
e=rz(c.aa,"EXT-X-DEFINE");d=Rz(a,e,d);e=b.stream;f=jA(a,b);var {keyIds:h,drmInfos:k,encrypted:l,xg:m}=await kA(a,c,e.mimeType,b.R,d);e.encrypted||!l||m||(e.encrypted=!0);((t,u)=>t.size===u.size&&[...t].every(v=>u.has(v)))(e.keyIds,h)||(e.keyIds=h,e.drmInfos=k,a.i.newDrmInfo(e));var {segments:n,oj:p,bandwidth:q}=lA(a,c,f,d,b.R,b.type,g.uri!==g.originalUri,e.segmentIndex);q&&(e.bandwidth=q);g=ul(e);for(var r of n)r.ea&&(r.ea.cd=g);n.length&&e.segmentIndex.ed(n,a.m.sb());if(p){r=uz(c.aa,"EXT-X-MEDIA-SEQUENCE",
0);g=(g=tz(c.aa,"EXT-X-SKIP"))?Number(Z(g,"SKIPPED-SEGMENTS")):0;const {Cb:t,Db:u}=mA(a,r,n,p);b.Cb=t+g;b.Db=u;r=f.get(r);e.segmentIndex.Pa(r)}if(r=e.segmentIndex.xb())b.Gc=r.startTime,n.length&&(b.xc=n[n.length-1].endTime);tz(c.aa,"EXT-X-ENDLIST")&&(b.yd=!0);nA(a,c);gA(a,c.aa,e.type,d,b.R)}}}async function Tz(a){if(!a.g.disableChapters){var b=[];for(const c of a.N)b.push(oA(a,c));await Promise.all(b)}}
function pA(a,b){const c=[];for(const d of b)d.segmentIndex&&d.segmentIndex.yb(e=>{c.push(e)});a.m.Ed(c)}function qA(a,b){a.A=b;a.m&&a.m.od(!Nz(a));Nz(a)||a.B.stop()}
function fA(a){if(a.A==rA){var b=Infinity;let c=Infinity;for(const d of a.j.values())d.stream.segmentIndex&&d.stream.type!="text"&&!d.stream.isAudioMuxedInVideo&&(b=Math.min(b,d.xc),c=Math.min(c,d.Gc));b=b-c||0;isNaN(a.g.availabilityWindowOverride)||(b=a.g.availabilityWindowOverride);a.m.kg(b)}else a.m.Eb(sA(a));if(!a.m.o)for(const c of a.j.values()){if(!c.stream.segmentIndex)continue;if(c.type!="audio"&&c.type!="video")continue;(b=c.stream.segmentIndex.xb())&&b.g!=null&&a.m.jg(b.g)}a.m.Of()}
function jA(a,b){return a.A==rA?a.G.get(b.type):b.Be}function Rz(a,b,c){c=(new Ma(c)).g;const d=new Map;for(const g of b){var e=Z(g,"NAME");const h=Z(g,"VALUE");var f=Z(g,"QUERYPARAM");b=Z(g,"IMPORT");e&&h&&d.getOrInsert(e,h);f&&(e=c.get(f)[0])&&!d.has(e)&&d.set(f,e);b&&(f=a.H.get(b))&&d.set(b,f)}return d}
async function kA(a,b,c,d,e){var f=new Map;if(!a.g.ignoreDrmInfo&&b.segments)for(var g of b.segments){var h=rz(g.aa,"EXT-X-KEY"),k=void 0;if(h.length){k=tA(a,b,g.aa,d,e);for(var l of h)f.set(l,k)}}g=b=!1;h=[];k=new Set;for(const [n,p]of f){f=n;l=p;var m=nz(f,"METHOD");if(m!="NONE"){b=!0;const q=Z(f,"KEYFORMAT")||"identity";if(uA(m))g=!0;else if(f=q=="identity"?await vA(a,f,c,d,l,e):(m=a.ec.get(q))?await m(f,c,l):null,f){if(f.keyIds)for(const r of f.keyIds)k.add(r);h.push(f)}}}return{drmInfos:h,keyIds:k,
encrypted:b,xg:g}}
function lA(a,b,c,d,e,f,g,h){const k=b.segments;let l=null,m=null,n=null,p=null,q=void 0,r=uz(b.aa,"EXT-X-DISCONTINUITY-SEQUENCE",-1);const t=uz(b.aa,"EXT-X-MEDIA-SEQUENCE",0);var u=tz(b.aa,"EXT-X-SKIP");const v=u?Number(Z(u,"SKIPPED-SEGMENTS")):0;var x=t+v;let y=0;a.A==rA&&c.has(x)&&(y=c.get(x));y===0&&a.A==rA&&c.size>0&&!c.has(x)&&a.m.h!=null&&(y=a.m.sb());const D=[];u=[];var z=null;let B=null;var E=[];let J=0;if(!g&&h){J=k.length;for(var X=0;X<k.length;X++){x=t+v+X;if(!c.has(x)){J=X;break}if(k[X].Tb.length){J=
X;break}if(a.T){var L=tz(k[X].aa,"EXTINF");if(L&&(L=yz(L),(x=wA(h,c,x))&&Math.abs(x.endTime-x.startTime-L)>.001)){J=X;break}}}J>0&&((z=wA(h,c,t+v+J-1))?B=z:J=0)}h=O=>{O=bm(O);if(!O)return null;let M=xA.get(f).get(O);M||=yA.get(O);return M};for(X=0;X<k.length;X++){var W=k[X];(x=tz(W.aa,"EXT-X-MAP"))&&x.id!==m&&(l=tA(a,b,W.aa,e,d),m=x.id);x=W.g;L="";x&&(L=bm(x));L!==p&&(n=h(x),p=L);var F=X==0?y:z.endTime;x=t+v+X;tz(W.aa,"EXT-X-DISCONTINUITY")&&(r++,X>=J&&z&&z.ea&&(z.ea.g=F));for(const O of W.aa)O.name==
"EXT-X-KEY"&&(uA(nz(O,"METHOD"))?q=zA(a,O,b,e,d):q=void 0);if(X<J)continue;L=g||!c.has(x);c.set(x,F);if(F=AA(a,l,z,W,F,d,f,e,n,q)){if(z=uz(W.aa,"EXT-X-BITRATE"))E.push({bitrate:z,duration:F.endTime-F.startTime}),F.bandwidth=z;else if(F.endByte){if(W=Ri(F))z=F.endTime-F.startTime,W=W*8/z/1E3,E.push({bitrate:W,duration:z}),F.bandwidth=W}else E.length&&(z=E[E.length-1],z.duration+=F.endTime-F.startTime,F.bandwidth=z.bitrate);if(F.bandwidth)for(const O of F.h)O.bandwidth=F.bandwidth;z=F;F.i=r;BA(a,f)&&
a.L!=null&&x<a.L||(D.push(F),!L&&g||u.push(F))}}b=void 0;E.length&&(b=E.reduce((O,M)=>O+M.duration,0),b=Math.round(E.reduce((O,M)=>O+M.bitrate*M.duration,0)/b*1E3));if(E=!!B?.g||D.some(O=>O.g!=null))for(c=0;c<D.length;c++){const O=D[c];if(O.g!=null)continue;let M=0,ba=c;d=()=>{const S=D[ba];if(S){if(S.g!=null)return S.g+M;M-=S.endTime-S.startTime;ba+=1}return null};let ta=0,C=c;for(e=()=>{const S=D[C];if(S){S!=O&&(ta+=S.endTime-S.startTime);if(S.g!=null)return S.g+ta;--C}else if(B&&B.g!=null)return B.g+
(B.endTime-B.startTime)+ta;return null};O.g==null;)O.g=e(),O.g==null&&(O.g=d())}if(E){c=0;d=B;for(var I of D){I.g!=null&&(d&&d.g!=null&&d.i!=I.i&&(d=I.g-(d.g+(d.endTime-d.startTime))-c,Math.abs(d)>1&&(c+=d)),I.g-=c);d=I.g;for(const O of I.h)O.g=d,d+=O.endTime-O.startTime;d=I}}I=a.ba;if(E&&I!=Infinity&&!BA(a,f))for(const O of D)O.mg(I);return{segments:g?D:u,oj:J+D.length,bandwidth:b}}
function mA(a,b,c,d=c.length){a=b+d-1;b=-1;if(!c.length)return a++,{Cb:a,Db:b};c=c[c.length-1];d=c.h;if(!c.h.length)return a++,c.o&&(b=0),{Cb:a,Db:b};b=d.length-1;d[d.length-1].isPreload()||(a++,b=0);return{Cb:a,Db:b}}
function nA(a,b){var c=Infinity,d=b.segments;if(d.length)for(var e=d.length-1;e>=0;){const f=tz(d[e].aa,"EXTINF");if(f){c=yz(f);break}e--}d=tz(b.aa,"EXT-X-TARGETDURATION");if(!d)throw new H(2,4,4024,"EXT-X-TARGETDURATION");d=Number(d.value);if(e=tz(b.aa,"EXT-X-PART-INF"))a.P=Number(nz(e,"PART-TARGET"));b=tz(b.aa,"EXT-X-SERVER-CONTROL");a.T&&a.P?(a.u=a.fc?a.P*5<=c?Math.min(a.P,a.u):Math.min(c,a.u):Math.min(a.P,a.u),a.ya=b?Number(nz(b,"PART-HOLD-BACK")):0):(a.u=Math.min(c,a.u),c=b?mz(b,"HOLD-BACK"):
null,a.qa=c?Number(c.value):0);a.Oa=Math.max(d,a.Oa)}
async function gA(a,b,c,d,e){if(c=="video"||c=="audio"){var f=a.m.j;if(f!=null&&!BA(a,c)){b=rz(b,"EXT-X-DATERANGE");b=b.filter(k=>mz(k,"START-DATE")!=null).sort((k,l)=>{k=nz(k,"START-DATE");l=nz(l,"START-DATE");return k<l?-1:k>l?1:0});c=[];for(let k=0;k<b.length;k++){var g=b[k];try{const l=nz(g,"START-DATE"),m=Vc(l);if(isNaN(m))continue;const n=Math.max(0,m-f);let p=null;const q=Z(g,"END-DATE");if(q){const v=Vc(q);if(!isNaN(v)&&(p=v-f,p<0))continue}if(p==null){const v=Z(g,"DURATION")||Z(g,"PLANNED-DURATION");
if(v){const x=parseFloat(v);isNaN(x)||(p=n+x);if(m-f+x<0)continue}}const r=Z(g,"CLASS")||"com.apple.quicktime.HLS",t=Z(g,"END-ON-NEXT")=="YES";if(p==null&&t){for(var h=k+1;h<b.length;h++){const v=Z(b[h],"CLASS")||"com.apple.quicktime.HLS";if(r!=v)continue;const x=nz(b[h],"START-DATE"),y=Vc(x);if(!isNaN(y)&&y&&y>m){p=Math.max(0,y-f);break}}if(p==null)continue}const u=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];h=[];for(const v of g.attributes){if(u.includes(v.name))continue;let x=xz(v.value,
d);if(v.name=="X-ASSET-URI"||v.name=="X-ASSET-LIST")x=vz(e(),v.value,d)[0];h.push({key:v.name,description:"",data:x,mimeType:null,pictureType:null})}if(h.length>1){const v=a.i.onMetadata(r,n,p,h);g=!1;const x=h.find(y=>y.key=="CUE");x&&x.data.includes("PRE")&&(g=!0);if(p!=null&&!g){let y;y=a.h.startTime!=null?a.h.startTime:Nz(a)?a.h.presentationTimeline.rb():a.h.presentationTimeline.Ab();g=n<=y&&p>=y}g&&c.push(v)}}catch(l){}}c.length&&await Promise.all(c)}}}
function BA(a,b){return a.g.hls.ignoreManifestProgramDateTime?!0:a.g.hls.ignoreManifestProgramDateTimeForTypes.includes(b)}function CA(a,b,c){if(!(Math.abs(c)<.001)){b.Gc+=c;b.xc+=c;a=jA(a,b);for(const [d,e]of a)a.set(d,e+c);b.R()}}
function DA(a,b,c=!1){var d=a.L==-1;for(const f of b){var e=f.stream.segmentIndex;const g=jA(a,f);if(e=e.xb())for(const [h,k]of g)if(k==e.startTime){d&&(a.L=Math.max(a.L,h));f.nf=h;break}}if(!(a.L<0))for(const f of b){if(!BA(a,f.type)&&!c)continue;if(b=f.stream.segmentIndex)if(d=a.L-f.nf,d>0&&(b.g.splice(0,d),b=b.xb()))b=-b.startTime,f.stream.segmentIndex.offset(b),CA(a,f,b)}}
function EA(a,b){if(a.ba==Infinity)for(var c of b)b=c.stream.segmentIndex.xb(),b!=null&&b.g!=null&&(a.ba=Math.min(a.ba,b.g));c=a.ba;if(c!=Infinity)for(const d of a.j.values()){if(BA(a,d.type))continue;b=d.stream.segmentIndex;if(b!=null){const e=b.xb();if(e)if(e.g==null)la("Missing EXT-X-PROGRAM-DATE-TIME for stream",d.R(),"Expect AV sync issues!");else{CA(a,d,e.g-c-e.startTime);for(const f of b)f.mg(c)}}}}
async function Sz(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t,u,v,x,y=!0,D=!0){b=d.segments||[];var z=b.every(C=>tz(C.aa,"EXT-X-GAP")?!0:!1);if(!b.length||z)throw new H(2,4,4053);FA(a,d);Nz(a)&&nA(a,d);b=a.A==rA?a.G.get(g):new Map;const {segments:B,bandwidth:E}=lA(a,d,b,c,e,g,!0,null);x||g!=K||(x=await GA(a,g,f,B),f||x!="application/mp4"||!B[0]||B[0].ea||(x="text/vtt"),f||x!="application/mp4"||(D=y=!0));let J=z=null,X=null,L=null,W=null;B.length>0&&y&&(y=await HA(a,B),g!=y.type&&a.A==rA&&(a.G.set(y.type,a.G.get(g)),
a.G.set(g,new Map)),g=y.type,h=y.language,m=y.channelCount,r=y.sampleRate,a.g.disableText||(n=y.closedCaptions),J=y.height,z=y.width,X=y.Od,L=y.colorGamut,W=y.frameRate,D&&(x=y.mimeType,f=y.codecs));x||=await GA(a,g,f,B);const {drmInfos:F,keyIds:I,encrypted:O,xg:M}=await kA(a,d,x,e,c);if(O&&!F.length&&!M)throw new H(2,4,4026);c=IA(a,f,g,h,k,l,m,n,p,q,r,t,u,v);c.encrypted=O&&!M;c.drmInfos=F;c.keyIds=I;c.mimeType=x;E&&(c.bandwidth=E);JA(c);g=="video"&&(z||J||X||L)&&KA(c,z,J,W,X,null,L);Nz(a)&&nA(a,
d);x=B[0].startTime;f=B[B.length-1].endTime;c.segmentIndex=new ll(B);h=(l=tz(d.aa,"EXT-X-SERVER-CONTROL"))?mz(l,"CAN-SKIP-UNTIL")!=null:!1;k=!1;h&&(k=l?mz(l,"CAN-SKIP-DATERANGES")!=null:!1);l=l?mz(l,"CAN-BLOCK-RELOAD")!=null:!1;d=uz(d.aa,"EXT-X-MEDIA-SEQUENCE",0);const {Cb:ba,Db:ta}=mA(a,d,B);return{stream:c,type:g,Me:[],R:e,Gc:x,xc:f,ie:h,ge:k,fe:l,yd:!1,nf:-1,Cb:ba,Db:ta,Be:b}}
function Uz(a,b){const c=(new Ma(a.C)).g;for(const e of b){var d=Z(e,"NAME");const f=Z(e,"VALUE");b=Z(e,"QUERYPARAM");d&&f&&a.H.getOrInsert(d,f);b&&(d=c.get(b)[0])&&!a.H.has(d)&&a.H.set(b,d)}}
function Vz(a,b){const c=[];for(const d of b){b=Z(d,"DATA-ID");const e=Z(d,"URI"),f=Z(d,"LANGUAGE"),g=Z(d,"VALUE"),h=(new Map).set("id",b);e&&h.set("uri",vz([a.C],e,a.H)[0]);f&&h.set("language",f);g&&h.set("value",g);b=="com.apple.hls.chapters"&&e&&c.push(h.get("uri"));b=new P("sessiondata",h);if(a.i)a.i.onEvent(b)}return c}
async function Wz(a,b){if(a.i&&a.g){for(const d of b){b=Z(d,"PATHWAY-ID");const e=Z(d,"SERVER-URI");if(b&&e){a.l=new qx(a.i);a.l.configure(a.g);a.l.i=[a.C];a.l.setManifestType("HLS");a.l.h=b;var c=nx(a.l,e);break}}await c}}
function Xz(a,b){for(const e of b){var c=Z(e,"AUDIO");b=Z(e,"VIDEO");var d=Z(e,"SUBTITLES");const f=LA(a,e);if(d){const g=Ob(K,f);a.J.set(d,g);ua(f,g)}c&&(d=Ob("audio",f),d||(d=a.g.hls.defaultAudioCodec),a.J.set(c,d));b&&(c=Ob("video",f),c||(c=a.g.hls.defaultVideoCodec),a.J.set(b,c))}}
function Yz(a,b){b=sz(b,"CLOSED-CAPTIONS");a.O=b.length==0;for(const d of b){var c=Z(d,"LANGUAGE");b=ye(c||"und");c||(c=Z(d,"NAME"))&&(b=c);c=nz(d,"GROUP-ID");const e=nz(d,"INSTREAM-ID").replace("SERVICE","svc");a.I.get(c)||a.I.set(c,new Map);a.I.get(c).set(e,b)}}function Zz(a,b){return b.map(c=>{c=MA(a,c);return c.stream.type!=="video"?null:c.stream}).filter(c=>c)}
async function $z(a,b,c,d,e,f,g){const h=[],k=new Set;if(!a.g.ignoreDrmInfo&&c.length>0)for(var l of c){c=nz(l,"METHOD");const p=Z(l,"KEYFORMAT")||"identity";let q=null;if(c!="NONE")if(uA(c)){const r=vz(e(),nz(l,"URI"),f);c=r.sort().join("");a.wa.getOrInsertComputed(c,()=>Pz(a,ag(r,a.g.retryParameters),6).promise)}else if(q=p=="identity"?await vA(a,l,"",e,null,f):(c=a.ec.get(p))?await c(l,"",null):null,q){if(q.keyIds)for(var m of q.keyIds)k.add(m);h.push(q)}}e={};for(var n of b)b=lz(n,!a.l),e[b]?
e[b].push(n):e[b]=[n];n=[];for(const p in e){l=e[p];c=l[0];b=NA(c);f=Number(nz(c,"BANDWIDTH"))||Number(Z(c,"AVERAGE-BANDWIDTH"));m=Z(c,"RESOLUTION");const [q,r]=m?m.split("x"):[null,null];m=Z(c,"VIDEO-RANGE");(c=Z(c,"REQ-VIDEO-LAYOUT"))&&c.includes(",")&&(c=c.split(",").filter(t=>t=="CH-STEREO"||t=="CH-MONO")[0]);c=c||"CH-MONO";l=OA(a,l,d);n.push(...PA(a,l.audio,l.video,f,q,r,b,m,c,h,k,g))}return n.filter(p=>p!=null)}
function aA(a,b){b=sz(b,"SUBTITLES");const c={};for(var d of b){const f=lz(d,!a.l);c[f]?c[f].push(d):c[f]=[d]}d=[];if(!a.g.disableText)for(var e in c)try{d.push(QA(a,c[e],new Map).stream)}catch(f){if(!a.g.hls.ignoreTextStreamFailures)throw f;}for(const f of b)if(b=nz(f,"GROUP-ID"),e=a.J.get(b))if(b=a.K.get(b))for(const g of b)g.stream.codecs=e,g.stream.mimeType=RA(K,e)||SA(K),JA(g.stream);return d.filter(f=>f)}
async function bA(a,b,c){b=b.map(async d=>{if(a.g.disableThumbnails)return null;try{return(await TA(a,d)).stream}catch(e){if(a.g.hls.ignoreImageStreamFailures)return null;throw e;}}).concat(c.map(d=>{if(a.g.disableThumbnails)return null;try{const e=MA(a,d);return e.stream.type!=="image"?null:e.stream}catch(e){if(a.g.hls.ignoreImageStreamFailures)return null;throw e;}}));return(await Promise.all(b)).filter(d=>d)}
function cA(a,b){a.o==null&&(b=tz(b.aa,"EXT-X-START"))&&(a.o=Number(nz(b,"TIME-OFFSET")))}function dA(a,b){let c=0;if(a.g.defaultPresentationDelay)c=a.g.defaultPresentationDelay;else if(a.ya)c=a.ya;else if(a.qa)c=a.qa;else{const e=b.segments.length;var d=Math.min(e,a.g.hls.liveSegmentsDelay);for(d=e-d;d<e;d++){const f=tz(b.segments[d].aa,"EXTINF");c=f?c+yz(f):c+a.Oa}}a.o&&a.o<0&&(c=Math.min(-a.o,c),a.o+=c);a.m.ih(0);a.m.ig(c);a.m.od(!1)}
function eA(a,b){if(!Nz(a)){var c=sA(a);for(var d of b)d.stream.segmentIndex.Sc(0,c)}pA(a,b.map(f=>f.stream));d=Array.from(a.j.values()).filter(f=>f.stream.segmentIndex);c=d.some(f=>f.stream.type=="audio");const e=d.some(f=>f.stream.type=="video");d=a.A==rA&&!a.Sa;c=!Nz(a)&&a.Sa&&!(c&&e);a.g.hls.ignoreManifestProgramDateTime||d||c?DA(a,b,d):(EA(a,b),a.g.hls.ignoreManifestProgramDateTimeForTypes.length>0&&DA(a,b))}
function UA(a,b){a=a.A==rA?Math.trunc((b.length-1)/2):0;let c=b[a];for(;c.Nb()==2&&a+1<b.length;)a++,c=b[a];return{segment:c,segmentIndex:a}}async function VA(a,b,c){if(!b)return{mimeType:null,data:null};var d=cm(b.R(),b.wc(),b.uc(),a.i.getStreamingRetryParameters());d=await Pz(a,d,gg,{type:b instanceof Q?1:0}).promise;a=d.data;b.aesKey&&(a=await Zl(a,b.aesKey,c));b instanceof Q?b.Kd(a,!0):b.Kd(a);(b=d.headers["content-type"])&&(b=b.split(";")[0].toLowerCase());return{mimeType:b,data:a}}
async function HA(a,b){const c=Ul(a.g.hls.mediaPlaylistFullMimeType);if(!b.length)return c;const {segment:d,segmentIndex:e}=UA(a,b);b=d.R();var f=bm(b[0]);if(f&&(b=yA.get(f)))return Ul(b);var g=await Promise.all([VA(a,d.ea,0),VA(a,d,e)]);b=g[1].mimeType;var h=g[0].data;g=g[1].data;var k="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" "),l=["audio/mp4","video/mp4","video/iso.segment"];l=d.ea||l.includes(b);if(!l&&Dj(G(g))){{k=a.g.disableAudio;l=a.g.disableVideo;a=a.g.disableText;f=G(g);
const n=(new Lj).parse(f),p=n.ud();f=n.Pg();h=[];let q=!1,r=!1;if(!k)switch(p.audio){case "aac":case "aac-loas":n.kb().length&&(h.push("mp4a.40.2"),q=!0);break;case "mp3":n.kb().length&&(h.push("mp4a.40.34"),q=!0);break;case "ac3":n.kb().length&&(h.push("ac-3"),q=!0);break;case "ec3":n.kb().length&&(h.push("ec-3"),q=!0);break;case "opus":n.kb().length&&(h.push("opus"),q=!0)}if(!l)switch(p.video){case "avc":f.codec?h.push(f.codec):h.push("avc1.42E01E");r=!0;break;case "hvc":f.codec?h.push(f.codec):
h.push("hvc1.1.6.L93.90");r=!0;break;case "av1":h.push("av01.0.01M.08"),r=!0}if(h.length){k=q&&!r;l=new Map;if(r&&!a){a=new oc("video/mp2t");jc(a,g);for(m of a.g.getStreams())l.set(m,m);a.g.clear()}var m={type:k?"audio":"video",mimeType:"video/mp2t",codecs:h.join(", "),language:null,height:f.height,width:f.width,channelCount:null,sampleRate:null,closedCaptions:l,Od:null,colorGamut:null,frameRate:f.frameRate,timescale:null,drmInfos:[]}}else m=null}if(m)return m}else if(l||k.includes(f))if(m=Vl(h,g,
a.g.disableText))return m;return b?Ul(b):c}function Pz(a,b,c,d){if(!a.X)throw new H(2,7,7001);d||={};d.isPreload=a.Ob();b=a.i.networkingEngine.request(c,b,d);Wf(a.X,b);return b}function sA(a){let b=Infinity;for(const c of a.j.values())c.stream.segmentIndex&&c.stream.type!="text"&&!c.stream.isAudioMuxedInVideo&&(b=Math.min(b,c.xc));return b}
function LA(a,b){b=Z(b,"CODECS")||"";a.Z=b.length>0;a.Z||a.g.hls.disableCodecGuessing||(b=[],a.g.disableVideo||b.push(a.g.hls.defaultVideoCodec),a.g.disableAudio||b.push(a.g.hls.defaultAudioCodec),b=b.join(","));return Wl(b.split(/\s*,\s*/))}
function QA(a,b,c,d=!0){var e=[],f=[],g=new Map;for(var h of b){var k=++a.D,l=d?nz(h,"URI"):Z(h,"URI")||"shaka://hls-muxed"+k;k=nz(h,"GROUP-ID");e.push(l);f.push(k);g.set(k,l);(l=Z(h,"PATHWAY-ID"))&&c.set(k,l)}d=f.sort().join(",");k=b[0];b="";h=nz(k,"TYPE").toLowerCase();h=="subtitles"&&(h=K);h==K&&(b=Z(k,"CODECS")||"");if(!b)for(var m of f)if(a.J.has(m)){b=a.J.get(m);break}m=zz(k);f=l=e.sort().join(",");h=="audio"&&d&&(f+=d);if(a.j.has(f))return a.j.get(f);const n=a.D++;if(a.l)for(const [v,x]of g)(g=
c.get(v))&&ox(a.l,n,g,x);c=Z(k,"LANGUAGE");g=Z(k,"NAME");const p=Z(k,"DEFAULT")=="YES";var q=h=="audio"?(q=Z(k,"CHANNELS"))?parseInt(q.split("/")[0],10):null:null;var r;h=="audio"?(r=Z(k,"CHANNELS"))?(r=r.split("/"),r=r.length!=2?!1:r[1]==="JOC"||r[1].includes("ATMOS")||r[1].includes("IMSA")):r=!1:r=!1;const t=Z(k,"CHARACTERISTICS"),u=Z(k,"FORCED")=="YES";h=="audio"?k=(k=Z(k,"SAMPLE-RATE"))?parseInt(k,10):null:k=null;e=WA(a,n,e,b,h,c,p,g,q,null,t,u,k,r,m,l);a.K.has(d)?a.K.get(d).push(e):a.K.set(d,
[e]);a.j.set(f,e);return e}function RA(a,b){if(a==K){if(b=="vtt"||b=="wvtt")return"text/vtt";if(b&&b!=="")return"application/mp4"}return a!="image"||b&&b!="jpeg"?a=="audio"&&b=="mp4a.40.34"?"audio/mpeg":b=="mjpg"?"application/mp4":null:"image/jpeg"}function SA(a){return a==K?"text/vtt":xA.get(a).get("mp4")}function JA(a){const b=new Set([Rd(a.mimeType,a.codecs)]);a.segmentIndex&&a.segmentIndex.yb(c=>{c.mimeType&&b.add(Rd(c.mimeType,a.codecs))});a.fullMimeTypes=b}
async function TA(a,b){const c=nz(b,"URI");var d=Z(b,"CODECS","jpeg")||"",e=zz(b);if(a.j.has(c))return a.j.get(c);var f=Z(b,"LANGUAGE");const g=Z(b,"NAME"),h=Z(b,"CHARACTERISTICS");d=WA(a,a.D++,[c],d,"image",f,!1,g,null,null,h,!1,null,!1,e,c);if(e=Z(b,"RESOLUTION")){await d.stream.createSegmentIndex();if(f=d.stream.segmentIndex.xb().tilesLayout)d.stream.width=Number(e.split("x")[0])*Number(f.split("x")[0]),d.stream.height=Number(e.split("x")[1])*Number(f.split("x")[1]);d.stream.closeSegmentIndex()}if(b=
Z(b,"BANDWIDTH"))d.stream.bandwidth=Number(b);a.j.set(c,d);return d}
function MA(a,b){var c="video";const d=nz(b,"URI");var e=Z(b,"CODECS")||"";const f=zz(b);e=="mjpg"&&(c="image");if(a.j.has(d))return a.j.get(d);const g=Z(b,"LANGUAGE"),h=Z(b,"NAME"),k=Z(b,"CHARACTERISTICS");c=WA(a,a.D++,[d],e,c,g,!1,h,null,null,k,!1,null,!1,f,d);e=Z(b,"RESOLUTION");const [l,m]=e?e.split("x"):[null,null];c.stream.width=Number(l)||void 0;c.stream.height=Number(m)||void 0;if(b=Z(b,"BANDWIDTH"))c.stream.bandwidth=Number(b);a.j.set(d,c);return c}
async function oA(a,b){b=await Pz(a,ag([b],a.g.retryParameters),10).promise;var c=ub(b.data);c=JSON.parse(c);const d=new Map;for(let f=0;f<c.length;f++){const g=c[f];if(!g.titles)continue;const h=[];if(g.images)for(const k of g.images)if(k.url){var e=vz([b.uri],k.url);for(const l of e)h.push({type:k["image-category"],width:k["pixel-width"],height:k["pixel-height"],url:l})}for(const k of g.titles)e={id:"",title:k.title,startTime:g["start-time"],endTime:g["start-time"],images:h},g.duration?e.endTime+=
g.duration:f+1<c.length&&(e.endTime=c[f+1]["start-time"]),d.getOrInsertComputed(k.language,()=>[]).push(e)}d.forEach((f,g)=>{const h=[];for(var k of f)f=new Q(k.startTime,k.endTime,()=>[],0,null,null,0,0,Infinity),f.Qe({title:k.title,images:k.images}),h.push(f);k=a.Ba.getOrInsertComputed(g,()=>({id:a.D++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:null,mimeType:"text/plain",codecs:"",supplementalCodecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:g,
originalLanguage:g,label:null,type:"chapter",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Rd("text/plain","")]),isAudioMuxedInVideo:!1,baseOriginalId:null}));k.segmentIndex?k.segmentIndex.ed(h,a.m.sb()):k.segmentIndex=new ll(h)})}
function XA(a,b,c){b=b.filter(e=>{const f=Z(e,"URI")||"";e=Z(e,"TYPE");return e!="SUBTITLES"&&(f!=""||e=="AUDIO")});const d={};for(const e of b)b=lz(e,!a.l),d[b]?d[b].push(e):d[b]=[e];for(const e in d)QA(a,d[e],c,!1)}function uA(a){return a=="AES-128"||a=="AES-256"||a=="AES-256-CTR"||a=="AES-256-GCM"}
async function vA(a,b,c,d,e,f){if(c=="video/mp2t")throw new H(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new H(2,4,4041);c=nz(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c))return null;const g=vz(d(),nz(b,"URI"),f);g[0].startsWith("data:text/plain;base64,")?b=Gb(Eb(g[0].split("data:text/plain;base64,").pop())):(b=g.sort().join(""),b=await a.Sb.getOrInsertComputed(b,()=>Pz(a,ag(g,a.g.retryParameters),6).promise),b=Gb(b.data));d="00000000000000000000000000000000";e&&(e=
await Jz(a,e))&&(d=e);e=new Map;e.set(d,b);b="cenc";c=="SAMPLE-AES"&&(b="cbcs");return Mb(e,b)}function NA(a){return(a=Z(a,"FRAME-RATE"))?parseFloat(a):null}
function OA(a,b,c){const d={audio:[],video:[]};var e=new Map;const f=[];var g=!1,h=!1;for(var k of b){var l=Z(k,"AUDIO");const n=Z(k,"VIDEO"),p=l||n;if(!p)continue;f.includes(p)||f.push(p);const q=Z(k,"PATHWAY-ID");q&&e.set(p,q);l?g=!0:n&&(h=!0)}f.length&&c.length&&(c=c.filter(n=>f.includes(nz(n,"GROUP-ID"))),XA(a,c,e));e=(e=f.sort().join(","))&&a.K.has(e)?a.K.get(e):[];g?d.audio.push(...e):h&&d.video.push(...e);h=!1;const m=b.map(n=>nz(n,"URI"));g=d.audio.find(n=>n&&n.R().find(p=>m.includes(p)));
e=LA(a,b[0]);c=Ob("video",e);k=Ob("audio",e);l=zz(b[0]);k&&!c?(g="audio",h=d.audio.length>0&&!d.audio.some(n=>n.stream.isAudioMuxedInVideo)):!d.audio.length&&!d.video.length&&k&&c?(g="video",e=[[c,k].join()]):d.audio.length&&g?(g="audio",h=!0):g=d.video.length&&!d.audio.length?"audio":"video";h||(a=YA(a,b,e,g,l),a.stream.type=="audio"&&g==="audio"&&d.audio.some(n=>n.stream.isAudioMuxedInVideo)&&(b=d.audio[0].stream,a.stream.language=b.language,a.stream.channelsCount=b.channelsCount,a.stream.label=
b.label,a.stream.audioSamplingRate=b.audioSamplingRate,a.stream.originalId=b.originalId,a.stream.originalLanguage=b.originalLanguage),d[a.stream.type]=[a]);return d}
function PA(a,b,c,d,e,f,g,h,k,l,m,n){for(var p of c)KA(p.stream,e,f,g,h,k,null);e=a.g.disableVideo;if(!c.length||e)c=[null];e&&(b=b.filter(q=>!q.stream.isAudioMuxedInVideo));e=a.g.disableAudio;if(!b.length||e)b=[null];e=[];for(const q of b)for(const r of c){if(b=q?q.stream:null)b.drmInfos=l,b.keyIds=m;if(f=r?r.stream:null)f.drmInfos=l,f.keyIds=m,a.g.disableIFrames||pf(f,n);f&&!b&&(f.bandwidth=d);!f&&b&&(b.bandwidth=d);g=q?q.stream.drmInfos:null;h=r?r.stream.drmInfos:null;k=r?r.R().sort().join(","):
"";p=q?q.R().sort().join(","):"";const t=[];b&&b.codecs&&t.push(b.codecs);f&&f.codecs&&t.push(f.codecs);k=[k,p,t.sort()].join("-");if(b&&f&&!gb(g,h))continue;if(a.Ta.has(k))continue;b={id:a.D++,language:b?b.language:"und",disabledUntilTime:0,primary:!!b&&b.primary||!!f&&f.primary,audio:b,video:f,bandwidth:d,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};e.push(b);a.Ta.add(k)}return e}
function YA(a,b,c,d,e){const f=a.D++,g=[];for(var h of b){var k=nz(h,"URI");const m=Z(h,"PATHWAY-ID");a.l&&m&&ox(a.l,f,m,k);g.push(k)}h=g.sort().join(",")+c.sort().join(",");if(a.j.has(h))return a.j.get(h);k=g.join(",");a:{b=Z(b[0],"CLOSED-CAPTIONS");if(d=="video"){if(a.g.disableText){a.O=!1;var l=null;break a}if(b){if(b!="NONE"){l=a.I.get(b);break a}a.O=!1}else if(!b&&a.I.size)for(l of a.I.keys()){l=a.I.get(l);break a}}l=null}c=Nb(d,c);d=WA(a,f,g,c,d,null,!1,null,null,l,null,!1,null,!1,e,k);a.j.set(h,
d);return d}function KA(a,b,c,d,e,f,g){a&&(a.width=Number(b)||void 0,a.height=Number(c)||void 0,a.frameRate=d||void 0,a.hdr=e||void 0,a.videoLayout=f||void 0,a.colorGamut=g||void 0)}
function WA(a,b,c,d,e,f,g,h,k,l,m,n,p,q,r,t){const u=IA(a,d,e,f,g,h,k,l,m,n,p,q,r,t);c.some(B=>B.startsWith("shaka://hls-muxed"))&&(u.isAudioMuxedInVideo=!0,u.mimeType="video/mp2t",JA(u));const v={stream:u,type:e,Me:[],R:()=>{},Gc:0,xc:0,Be:new Map,ie:!1,ge:!1,fe:!1,yd:!1,nf:-1,Cb:-1,Db:-1},x=()=>a.l&&c.length>1?px(a.l,b):v.Me.concat(wz([a.C],c,a.H));v.R=x;const y=async B=>{try{const M=await B.promise;if(!B.aborted){var E=M.uri;E!=M.originalUri&&(v.R().includes(E)||v.Me.push(E));var J=Bz(a.Ka,M.data);
if(J.type!=1)throw new H(2,4,4017);var X=rz(J.aa,"EXT-X-DEFINE"),L=Rz(a,X,E);E=!1;(!a.Z&&a.g.hls.disableCodecGuessing||a.O&&e=="video"&&!a.g.hls.disableClosedCaptionsDetection)&&J.segments.length>0&&(a.O=!1,E=!0);var W=Nz(a),F=await Sz(a,0,L,J,x,d,e,f,g,h,k,l,m,n,p,q,r,t,void 0,E,!a.Z&&a.g.hls.disableCodecGuessing);if(!B.aborted){var I=F.stream;cA(a,J);Nz(a)&&!W&&dA(a,J);v.Gc=F.Gc;v.xc=F.xc;v.ie=F.ie;v.ge=F.ge;v.fe=F.fe;v.yd=F.yd;v.Be=F.Be;v.Cb=F.Cb;v.Db=F.Db;u.segmentIndex=I.segmentIndex;u.encrypted=
I.encrypted;u.drmInfos=I.drmInfos;u.keyIds=I.keyIds;u.mimeType=I.mimeType;u.bandwidth=u.bandwidth||I.bandwidth;u.codecs=u.codecs||I.codecs;u.closedCaptions=u.closedCaptions||I.closedCaptions;u.width=u.width||I.width;u.height=u.height||I.height;u.hdr=u.hdr||I.hdr;u.colorGamut=u.colorGamut||I.colorGamut;u.frameRate=u.frameRate||I.frameRate;u.language=="und"&&I.language!="und"&&(u.language=I.language);u.language=u.language||I.language;u.channelsCount=u.channelsCount||I.channelsCount;u.audioSamplingRate=
u.audioSamplingRate||I.audioSamplingRate;JA(u);u.drmInfos.length&&a.i.newDrmInfo(u);B=!1;if(!l&&u.closedCaptions||l&&u.closedCaptions&&l.size!=u.closedCaptions.size)B=!0;a.h&&B&&a.i.makeTextStreamsForClosedCaptions(a.h);if(e==K){const ba=I.segmentIndex.xb();ba&&ba.ea&&(u.mimeType="application/mp4",JA(u))}var O=ul(u);u.segmentIndex.yb(ba=>{ba.ea&&(ba.ea.cd=O)});if(ZA(a))if(a.jc)eA(a,[v]);else{a.jc=!0;const ba=Array.from(a.j.values()).filter(C=>C.stream.segmentIndex);eA(a,ba);fA(a);const ta=a.u;ta>
0&&a.B.ha(ta)}a.h&&(a.h.startTime=a.o);await gA(a,J.aa,u.type,L,x)}}}catch(M){if(u.closeSegmentIndex(),M.code!==7001&&!a.i.disableStream(u))throw M;}};let D=null,z;u.createSegmentIndex=()=>{if(D)return D;if(u.isAudioMuxedInVideo)return u.segmentIndex=new ll([]),Promise.resolve();z=Oz(a,v.R(),!0);return D=new Promise(B=>{B(y(z))})};u.closeSegmentIndex=()=>{D&&!u.segmentIndex&&z.abort();u.segmentIndex&&(u.segmentIndex.release(),u.segmentIndex=null);D=null};return v}
function IA(a,b,c,d,e,f,g,h,k,l,m,n,p,q){const r=RA(c,b)||SA(c),t=[];if(k)for(var u of k.split(","))t.push(u);u=void 0;k=null;c==K?u=t.includes("public.accessibility.transcribes-spoken-dialog")&&t.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":t.includes("public.accessibility.describes-video")&&(k="visually impaired");t.length||u!=="subtitle"||t.push("subtitle");u=null;c!="video"&&(u=f);a={id:a.D++,originalId:q,groupId:null,createSegmentIndex:()=>Promise.resolve(),
segmentIndex:null,mimeType:r,codecs:b,supplementalCodecs:p,kind:c==K?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:ye(d||"und"),originalLanguage:d,label:u,type:c,primary:e,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:t,forced:l,channelsCount:g,audioSamplingRate:m,spatialAudio:n,closedCaptions:h,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:k,
external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null};JA(a);return a}function ZA(a){if(!a.h||!a.h.variants.length)return!1;const b=[],c=[];for(const d of a.h.variants)d.video&&b.push(d.video),d.audio&&c.push(d.audio);return b.length>0&&!b.some(d=>d.segmentIndex)||c.length>0&&!c.some(d=>d.segmentIndex)?!1:!0}
function FA(a,b){var c=tz(b.aa,"EXT-X-PLAYLIST-TYPE");b=tz(b.aa,"EXT-X-ENDLIST");b=c&&c.value=="VOD"||b;c=c&&c.value=="EVENT"&&!b;c=!b&&!c;b?qA(a,hA):c?qA(a,rA):qA(a,$A)}
async function GA(a,b,c,d){({segment:d}=UA(a,d));if(d.status==2)return SA(b);d=d.R();const e=bm(d[0]);if(e){let h=xA.get(b).get(e);if(h||(h=yA.get(e)))return h}if(c=RA(b,c))return c;let f;d=ag(d,a.i.getStreamingRetryParameters());let g;try{d.method="HEAD",g=await Pz(a,d,gg,{type:1}).promise,f=g.headers["content-type"]}catch(h){!h||h.code!=1002&&h.code!=1001||(d.method="GET",a.g.hls.allowRangeRequestsToGuessMimeType&&(d.headers.Range="bytes=0-0"),g=await Pz(a,d,gg,{type:1}).promise,f=g.headers["content-type"])}return f&&
(c=f.toLowerCase().split(";")[0],c=="application/octet-stream"&&(g.data.byteLength||(d.method="GET",g=await Pz(a,d,gg,{type:1}).promise),Dj(G(g.data))&&(c="video/mp2t")),c!="application/octet-stream")?c:SA(b)}function wA(a,b,c){if(!a||!b.has(c))return null;b=b.get(c);c=a.find(b);return c==null?null:(a=a.get(c))&&a.startTime==b?a:null}
function tA(a,b,c,d,e){const f=tz(c,"EXT-X-MAP");if(!f)return null;var g=nz(f,"URI");const h=vz(d(),g,e);g=[h.toString(),Z(f,"BYTERANGE","")].join("-");return a.hc.getOrInsertComputed(g,()=>{let k=void 0,l=void 0;var m=!1;for(const n of c)n.name=="EXT-X-KEY"?(m=nz(n,"METHOD"),uA(m)&&n.id<f.id?(m=!1,k=zA(a,n,b,d,e)):m=m!="NONE"):n.name=="EXT-X-BYTERANGE"&&n.id<f.id&&(l=n);return aB(h,f,l,k,m)})}
function zA(a,b,c,d,e){if(!window.crypto||!window.crypto.subtle)throw ma("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new H(2,4,4042);const f=nz(b,"METHOD");let g=0,h;const k=Z(b,"IV","");if(f==="AES-256-GCM"){if(k)throw new H(2,4,4059);}else if(k){if(h=Fb(k.substr(2)),h.byteLength!=16)throw new H(2,4,4048);}else g=uz(c.aa,"EXT-X-MEDIA-SEQUENCE",0);const l=vz(d(),nz(b,"URI"),e),m=l.sort().join("");return a.Qb.getOrInsertComputed(`${b.toString()}-${g}-${m}`,
()=>{const n={bitsKey:128,blockCipherMode:"CBC",iv:h,firstMediaSequenceNumber:g};switch(f){case "AES-256":n.bitsKey=256;break;case "AES-256-CTR":n.bitsKey=256;n.blockCipherMode="CTR";break;case "AES-256-GCM":n.bitsKey=256,n.blockCipherMode="GCM"}n.fetchKey=async()=>{const p=await a.wa.getOrInsertComputed(m,()=>Pz(a,ag(l,a.g.retryParameters),6).promise);if(!p.data||p.data.byteLength!=n.bitsKey/8)throw new H(2,4,4049);n.cryptoKey=await window.crypto.subtle.importKey("raw",p.data,{name:n.blockCipherMode===
"CBC"?"AES-CBC":n.blockCipherMode==="GCM"?"AES-GCM":"AES-CTR",length:n.bitsKey},!0,["decrypt"]);n.fetchKey=void 0};return n})}function aB(a,b,c,d,e){var f=0,g=null;b=Z(b,"BYTERANGE");!b&&c&&(b=c.value);b&&(f=b.split("@"),g=Number(f[0]),f=Number(f[1]),g=f+g-1,d&&(c=g+1-f,c%16&&(g+=16-c%16)));return new Qi(()=>a,f,g,null,null,null,d,e)}function bB(a,b){var c=0;let d=null;b&&(c=b.split("@"),b=Number(c[0]),c=c[1]?Number(c[1]):a.endByte+1,d=c+b-1);return[c,d]}
function AA(a,b,c,d,e,f,g,h,k,l){const m=d.aa;var n=tz(m,"EXTINF"),p=0;let q=0,r=null;d.Tb.length&&(a.h.isLowLatency=!0);let t=null;if(!a.g.hls.ignoreManifestProgramDateTime){var u=tz(m,"EXT-X-PROGRAM-DATE-TIME");u&&u.value&&(t=Vc(u.value),a.Sa=!0)}let v=Ti;tz(m,"EXT-X-GAP")&&(a.h.gapCount++,v=2);if(!n){if(d.Tb.length==0)throw new H(2,4,4024,"EXTINF");if(!a.T)return null}let x=[];u=!1;let y=null,D=!1,z=!1;if(a.T&&d.Tb.length){p=b&&window.ReadableStream&&a.g.hls.allowLowLatencyByteRangeOptimization;
let F=t;for(let I=0;I<d.Tb.length;I++){var B=d.Tb[I],E=I==0?c:x[x.length-1],J=I==0?e:E.endTime;const O=Number(Z(B,"DURATION"))||a.P;if(!O)continue;const M=J+O;var X=0,L=null;B.name=="EXT-X-PRELOAD-HINT"?(X=(X=Z(B,"BYTERANGE-START"))?Number(X):0,(E=Z(B,"BYTERANGE-LENGTH"))?L=X+Number(E)-1:X&&(L=Number.MAX_SAFE_INTEGER)):(L=Z(B,"BYTERANGE"),[X,L]=bB(E,L));const ba=Z(B,"URI");if(!ba)continue;E=Ti;Z(B,"GAP")=="YES"&&(a.h.gapCount++,E=2,D=!0);let ta=null;const C=()=>{ta==null&&(ta=vz(h(),ba,f));return ta};
p&&X>=0&&L!=null&&(y=C,u=!0);J=new Q(J,M,C,X,L,b,0,0,Infinity,[],"",null,F,E,l);B.name=="EXT-X-PRELOAD-HINT"&&(J.Pf(),z=!0);Z(B,"INDEPENDENT")!="YES"&&I>0&&J.bd();B=k;B||(x.length&&x[0].mimeType?B=x[0].mimeType:ba&&(B=bm(ba),B=xA.get(g).get(B)||null));B&&(J.mimeType=B,cB.has(B)&&(J.ea=null));x.push(J);F&&(F+=O)}}if(n){n=yz(n);if(n==0)return null;p=e+n}else if(x.length)p=x[x.length-1].endTime;else return null;u&&(D||x[0].startByte!=0?(u=!1,y=null):x=[]);(n=tz(m,"EXT-X-BYTERANGE"))?[q,r]=bB(c,n.value):
x.length&&(q=x[0].startByte,r=x[x.length-1].endByte);c="";n=null;g=="image"&&(c="1x1",g=tz(m,"EXT-X-TILES"))&&(c=nz(g,"LAYOUT"),(g=Z(g,"DURATION"))&&(n=Number(g)));let W=null;b=new Q(e,p,()=>{if(y)return y();W==null&&(W=vz(h(),d.g,f));return W||[]},q,r,b,0,0,Infinity,x,c,n,t,v,l,x.length>0&&!!d.g);k&&(b.mimeType=k,cB.has(k)&&(b.ea=null));u&&(a.fc=!0,b.Vg(),z&&b.Pf());return b}
async function Jz(a,b){if(a.ma.has(b))var c=a.ma.get(b);else c=cm(b.R(),b.wc(),b.uc(),a.i.getStreamingRetryParameters()),c=await Pz(a,c,gg,{type:0}).promise,b.Kd(c.data),c=Yl(c.data),a.ma.set(b,c);return c}
var dB=class{constructor(){this.g=this.i=null;this.D=1;this.H=new Map;this.K=new Map;this.G=new Map;this.G.set("video",new Map);this.G.set("audio",new Map);this.G.set(K,new Map);this.G.set("image",new Map);this.ec=(new Map).set("com.apple.streamingkeydelivery",(a,b,c)=>Iz(this,a,b,c)).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",a=>Kz(this,a)).set("com.microsoft.playready",a=>{var b=nz(a,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b)){var c="cenc";b=="SAMPLE-AES"&&(c="cbcs");a=nz(a,
"URI");b=Gz(a.split("?")[0]);a=G(b.data);var d=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);d=Eg(a,d,new Set,0);c=Lb("com.microsoft.playready",c,[{initDataType:"cenc",initData:d}],void 0,b.pg);if(a=Fc(["<PLAYREADY>",Db(a),"</PLAYREADY>"].join("\n")))c.licenseServerUri=Rl(a);c=Promise.resolve(c)}else c=Promise.resolve(null);return c}).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",a=>Lz(this,a));this.Ta=new Set;this.j=new Map;this.m=null;this.C="";this.Ka=new Ez;
this.L=-1;this.ba=Infinity;this.Z=this.jc=this.Sa=!1;this.B=new te(()=>{if(this.W&&!this.g.continueLoadingWhenPaused&&(this.S.Ma(this.W,"timeupdate"),this.W.paused)){this.S.na(this.W,"timeupdate",()=>Mz(this));return}Mz(this)});this.A=hA;this.h=null;this.Oa=0;this.u=Infinity;this.ya=this.qa=this.P=0;this.X=new Xf;this.I=new Map;this.J=new Map;this.hc=new Map;this.Qb=new Map;this.wa=new Map;this.Sb=new Map;this.ma=new Map;this.fc=this.T=!1;this.$a=new ja(5);this.l=null;this.O=!0;this.S=new Ca;this.o=
this.W=null;this.Ob=()=>!1;this.sa=new Map;this.N=[];this.Ba=new Map}configure(a,b){const c=this.i&&a.updatePeriod!=this.g.updatePeriod&&a.updatePeriod>=0;this.g=a;b&&(this.Ob=b);this.l&&this.l.configure(this.g);c&&this.h&&this.h.presentationTimeline.ua()&&this.B.La()}async start(a,b){this.i=b;this.T=b.isLowLatencyMode();a=await Oz(this,[a]).promise;this.C=a.uri;await Qz(this,a.data);return this.h}stop(){this.B&&(this.B.stop(),this.B=null);const a=[];this.X&&(a.push(this.X.destroy()),this.X=null);
this.g=this.i=null;this.Ta.clear();this.h=null;this.j.clear();this.K.clear();this.J.clear();this.H.clear();this.hc.clear();this.Qb.clear();this.wa.clear();this.Sb.clear();this.ma.clear();this.sa.clear();this.l&&this.l.destroy();this.S&&(this.S.release(),this.S=null);return Promise.all(a)}async update(){if(Nz(this)){var a=[],b=Array.from(this.j.values()).filter(d=>!d.stream.isAudioMuxedInVideo&&d.stream.segmentIndex);if(b.length!==0){this.u=Infinity;this.h.gapCount=0;for(const d of b)a.push(iA(this,
d));a.push(Tz(this));await Promise.all(a);a=Array.from(this.Ba.values());for(var c of a)this.h.chapterStreams.includes(c)||this.h.chapterStreams.push(c);pA(this,b.map(d=>d.stream));c=b.some(d=>d.yd==0);b.length&&!c&&(qA(this,hA),fA(this));c&&fA(this);for(const d of b)d.stream.isAudioMuxedInVideo||!d.stream.segmentIndex||d.stream.segmentIndex.xb()||this.i.disableStream(d.stream)}}}onExpirationUpdated(){}onInitialVariantChosen(){}banLocation(a){this.l&&this.l.banLocation(a)}setMediaElement(a){this.W=
a}};w("shaka.hls.HlsParser",dB);
var yA=(new Map).set("aac","audio/aac").set("ac3","audio/ac3").set("ec3","audio/ec3").set("mp3","audio/mpeg"),eB=(new Map).set("mp4","audio/mp4").set("mp4a","audio/mp4").set("m4s","audio/mp4").set("m4i","audio/mp4").set("m4a","audio/mp4").set("m4f","audio/mp4").set("cmfa","audio/mp4").set("ts","video/mp2t").set("tsa","video/mp2t"),fB=(new Map).set("mp4","video/mp4").set("mp4v","video/mp4").set("m4s","video/mp4").set("m4i","video/mp4").set("m4v","video/mp4").set("m4f","video/mp4").set("cmfv","video/mp4").set("ts",
"video/mp2t").set("tsv","video/mp2t"),gB=(new Map).set("mp4","application/mp4").set("m4s","application/mp4").set("m4i","application/mp4").set("m4f","application/mp4").set("cmft","application/mp4").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml"),hB=(new Map).set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif"),xA=(new Map).set("audio",eB).set("video",fB).set("text",gB).set("image",hB),cB=new Set(["video/mp2t",
...Sd]),hA="VOD",$A="EVENT",rA="LIVE";Xb("application/x-mpegurl",()=>new dB);Xb("application/vnd.apple.mpegurl",()=>new dB);Xb("audio/x-mpegurl",()=>new dB);function iB(a,b,c,d,e,f,g){if(c>=200&&c<=299&&c!=202||c==304)return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"],originalRequest:f};f=null;try{f=xb(b)}catch(h){}throw new H(1,1,1001,d,c,f,a,g,e||d);};function jB(a,b,c,d,e,f){const g=new kB;try{og(b.headers).forEach((l,m)=>{g.append(m,l)})}catch(l){return Kf(new H(1,1,1002,a,l,c))}const h=new lB,k={Bg:!1,ph:!1};a=mB(a,b,c,{body:b.body||void 0,headers:g,method:b.method,signal:h.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},k,d,e,b.streamDataCallback,f.minBytesForProgressEvents||0);a=new Lf(a,()=>{k.Bg=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){const l=new te(()=>{k.ph=!0;h.abort()});l.ha(b/1E3);a.finally(()=>
{l.stop()})}return a}
async function mB(a,b,c,d,e,f,g,h,k){let l,m=new ArrayBuffer(0),n=0,p=0,q={},r=Date.now();try{l=await nB(a,d);q=oB(l.headers);g(q);if(d.method!="HEAD"){const t=l.headers.get("Content-Length"),u=t?parseInt(t,10):0;if(l.body){const v=l.clone().body.getReader();new pB({start:x=>{const y=async()=>{let D;try{D=await v.read()}catch(E){return}D.done||(n+=D.value.byteLength,h&&await h(D.value));const z=Date.now(),B=n-p;if(z-r>100&&B>=k||D.done)f(z-r,B,D.done?0:u-n),p=n,r=z;D.done?x.close():(x.enqueue(D.value),
y())};y()}});m=await l.arrayBuffer()}else m=await l.arrayBuffer(),f(Date.now()-r,m.byteLength,0)}if(b.headers.Range){const t=b.headers.Range.replace("bytes=","").split("-").filter(u=>u).map(u=>parseInt(u,10));t.length==2&&m.byteLength!=t[1]-t[0]+1&&ma("Payload length does not match range requested bytes",b,l)}}catch(t){if(e.Bg)throw new H(1,1,7001,a,c);if(e.ph)throw new H(1,1,1003,a,c);throw new H(1,1,1002,a,t,c);}return iB(q,m,l.status,a,l.url,b,c)}
function oB(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b}function qB(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||"polyfill"in window.fetch||!window.AbortController)}var rB=class{};w("shaka.net.HttpFetchPlugin",rB);rB.isSupported=qB;rB.parse=jB;var nB=window.fetch,lB=window.AbortController,pB=window.ReadableStream,kB=window.Headers;
qB()&&(Yf("http",jB,2,!0),Yf("https",jB,2,!0),Yf("blob",jB,2,!0));function sB(a,b,c,d,e,f){const g=new tB;let h=Date.now(),k=0;const l=new Promise((m,n)=>{g.open(b.method,a,!0);g.responseType="arraybuffer";g.timeout=b.retryParameters.timeout;g.withCredentials=b.allowCrossSiteCredentials;let p={};g.onabort=()=>{n(new H(1,1,7001,a,c))};g.onreadystatechange=()=>{if(g.readyState===XMLHttpRequest.HEADERS_RECEIVED){var q=g.getAllResponseHeaders().trim().split("\r\n");const r={};for(const t of q)q=t.indexOf(": "),q!==-1&&(r[t.slice(0,q).toLowerCase()]=t.slice(q+2));p=
r;e(p)}};g.onload=()=>{const q=g.response;try{const r=iB(p,q,g.status,a,g.responseURL,b,c);m(r)}catch(r){n(r)}};g.onerror=q=>{n(new H(1,1,1002,a,q,c))};g.ontimeout=()=>{n(new H(1,1,1003,a,c))};g.onprogress=q=>{const r=Date.now(),t=f.minBytesForProgressEvents||0,u=q.loaded-k;if(r-h>100&&u>=t||q.lengthComputable&&q.loaded==q.total)d(r-h,u,g.readyState==4?0:q.total-q.loaded),k=q.loaded,h=r};for(const q in b.headers)try{g.setRequestHeader(q.toLowerCase(),b.headers[q])}catch(r){throw new H(1,1,1002,a,
r,c);}g.send(b.body)});return new Lf(l,()=>{g.abort();return Promise.resolve()})}var uB=class{};w("shaka.net.HttpXHRPlugin",uB);uB.parse=sB;var tB=window.XMLHttpRequest;Yf("http",sB,1,!0);Yf("https",sB,1,!0);Yf("blob",sB,1,!0);function vB(a){const b=a.Mb(!1);return b?Db(b):a.R().map(c=>"{"+encodeURI(c.split("#xywh=")[0])+"}").join("")+":"+a.startByte+":"+a.endByte}function wB(a,b){return cm(a.g.R(),a.g.startByte,a.g.endByte,b.streaming.retryParameters)}var xB=class{constructor(a,b,c,d,e){this.g=a;this.h=b;this.groupId=c;this.i=d;this.j=e}};function yB(a,b){a.i+=b;const c=a.l;a.l++;a.h.set(c,b);return c}function zB(a){return a.i==0?0:a.j/a.i}var AB=class{constructor(){this.g=this.j=this.i=0;this.h=new Map;this.l=0}close(a,b){if(this.h.has(a)){var c=this.h.get(a);this.h.delete(a);this.j+=c;this.g+=b}}};function BB(a){a.l=!0;const b=a.j.map(c=>c());a.j=[];return Promise.all(b)}function CB(a,b,c){a.o=b;a.m=c}async function DB(a,b){const c=a.u.request(gg,b);b=()=>c.abort();a.j.push(b);const d=await c.promise;ua(a.j,b);return d.data}
function EB(a,b,c,d,e,f){kg(a.h);const g=(a.i.get(b)||Promise.resolve()).then(()=>{if(a.h.g)throw new H(2,9,7001);if(e){var h=G(c);h=new Fg(h);for(const k in h.data){const l=Number(k);a.m(h.data[l],h.g[l])}}a.g.close(d,c.byteLength);a.o(zB(a.g),a.g.g);return f(c)});a.i.set(b,g)}async function FB(a){await Promise.all(a.i.values());return a.g.g}
var GB=class{constructor(a){this.u=a;this.i=new Map;this.h=new lg(()=>BB(this).catch(()=>{}));this.j=[];this.o=()=>{};this.m=()=>{};this.g=new AB;this.l=!1}destroy(){return this.h.destroy()}queue(a,b,c,d,e){kg(this.h);const f=(this.i.get(a)||Promise.resolve()).then(async()=>{const g=await DB(this,b);if(this.h.g)throw new H(2,9,7001);if(d){var h=G(g);h=new Fg(h);for(const k in h.data){const l=Number(k);this.m(h.data[l],h.g[l])}}this.g.close(c,g.byteLength);this.o(zB(this.g),this.g.g);return e(g)});
this.i.set(a,f);return f}};function HB(a,b){return new Promise((c,d)=>{const e=a.h.openCursor();e.onerror=d;e.onsuccess=async()=>{if(e.result==null)c();else{var f=e.result;await b(f.key,f.value,f);f.continue()}}})}var IB=class{constructor(a,b){this.i=a;this.h=a.objectStore(b);this.g=Promise.withResolvers();a.onabort=c=>{c.preventDefault();this.g.reject()};a.onerror=c=>{c.preventDefault();this.g.reject()};a.oncomplete=()=>{this.g.resolve()}}async abort(){try{this.i.abort()}catch(a){}try{await this.g.promise}catch(a){}}store(){return this.h}promise(){return this.g.promise}};function JB(a,b,c){c=a.h.transaction([b],c);const d=new IB(c,b);a.g.push(d);d.promise().then(()=>{ua(a.g,d)},()=>{ua(a.g,d)});return d}function KB(a,b){return JB(a,b,"readwrite")}var LB=class{constructor(a){this.h=a;this.g=[]}destroy(){return Promise.all(this.g.map(a=>a.abort()))}};function MB(a){return Promise.reject(new H(2,9,9011,"Cannot add new value to "+a))}function NB(a,b,c,d){a=KB(a.h,b);b=a.store();for(const e of c)b.delete(e).onsuccess=()=>d(e);return a.promise()}async function OB(a,b,c){a=JB(a.h,b,"readonly");b=a.store();const d={},e=[];for(const f of c){const g=b.get(f);g.onsuccess=()=>{g.result==void 0&&e.push(f);d[f]=g.result}}await a.promise();if(e.length)throw new H(2,9,9012,"Could not find values for "+e);return c.map(f=>d[f])}
function PB(a,b,c){a=KB(a.h,a.g);const d=a.store();d.get(b).onsuccess=()=>{d.put(c,b)};return a.promise()}
var QB=class{constructor(a,b,c){this.h=new LB(a);this.j=b;this.g=c}destroy(){return this.h.destroy()}hasFixedKeySpace(){return!0}addSegments(){return MB(this.j)}removeSegments(a,b){return NB(this,this.j,a,b)}async getSegments(a){return(await OB(this,this.j,a)).map(b=>this.l(b))}addManifests(){return MB(this.g)}updateManifest(){return Promise.reject(new H(2,9,9016,"Cannot modify values in "+this.g))}updateManifestExpiration(a,b){const c=KB(this.h,this.g),d=c.store();d.get(a).onsuccess=e=>{if(e=e.target.result)e.expiration=
b,d.put(e,a)};return c.promise()}removeManifests(a,b){return NB(this,this.g,a,b)}async getManifests(a){a=await OB(this,this.g,a);return Promise.all(a.map(b=>this.i(b)))}async getAllManifests(){const a=JB(this.h,this.g,"readonly"),b=new Map;await HB(a,async(c,d)=>{d=await this.i(d);b.set(c,d)});await a.promise();return b}l(a){return a}i(a){return Promise.resolve(a)}async add(a,b){a=KB(this.h,a);const c=a.store(),d=[];for(const e of b){const f=c.add(e);f.onsuccess=()=>{d.push(f.result)}}await a.promise();
return d}};var RB=class{constructor(a){this.g=new LB(a)}destroy(){return this.g.destroy()}async getAll(){const a=JB(this.g,"session-ids","readonly"),b=[];await HB(a,(c,d)=>{b.push(d)});await a.promise();return b}add(a){const b=KB(this.g,"session-ids"),c=b.store();for(const d of a)c.add(d);return b.promise()}async remove(a){const b=KB(this.g,"session-ids");await HB(b,(c,d,e)=>{a.includes(d.sessionId)&&e.delete()});await b.promise()}};function SB(a,b){TB.set(a,b)}function UB(a){let b=null;a.g.forEach((c,d)=>{c.getCells().forEach((e,f)=>{e.hasFixedKeySpace()||b||(b={path:{Bb:d,Wa:f},Wa:e})})});if(b)return b;throw new H(2,9,9013,"Could not find a cell that supports add-operations");}function VB(a,b){a.g.forEach((c,d)=>{c.getCells().forEach((e,f)=>{b({Bb:d,Wa:f},e)})})}
function WB(a,b,c){a=a.g.get(b);if(!a)throw new H(2,9,9013,"Could not find mechanism with name "+b);b=a.getCells().get(c);if(!b)throw new H(2,9,9013,"Could not find cell with name "+c);return b}function XB(a,b){a.g.forEach(c=>{b(c.getEmeSessionCell())})}function YB(a){const b=Array.from(a.g.keys());if(!b.length)throw new H(2,9,9E3,"No supported storage mechanisms found");return a.g.get(b[0]).getEmeSessionCell()}
async function ZB(a){const b=Array.from(a.g.values());(a=b.length>0)||TB.forEach(c=>{(c=c())&&b.push(c)});await Promise.all(b.map(c=>c.erase()));a||await Promise.all(b.map(c=>c.destroy()))}var $B=class{constructor(){this.g=new Map}destroy(){const a=[];for(const b of this.g.values())a.push(b.destroy());this.g.clear();return Promise.all(a)}init(){TB.forEach((b,c)=>{(b=b())&&this.g.set(c,b)});const a=[];for(const b of this.g.values())a.push(b.init());return Promise.all(a)}};
w("shaka.offline.StorageMuxer",$B);$B.unregister=function(a){TB.delete(a)};$B.register=SB;$B.prototype.destroy=$B.prototype.destroy;var TB=new Map;function aC(a,b){bC(a);for(const c of a.streams);return a.streams.map(c=>cC(c,a.startTime,b))}
function cC(a,b,c){const d=a.initSegmentUri?dC(a.initSegmentUri):null,e=b+a.presentationTimeOffset,f=b+c;return{id:a.id,originalId:null,groupId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:void 0,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:a.kind,language:a.language,originalLanguage:a.language||null,label:a.label,width:a.width,height:a.height,initSegmentKey:d,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(g=>
{const h=dC(g.uri);return{startTime:b+g.startTime,endTime:b+g.endTime,dataKey:h,initSegmentKey:d,appendWindowStart:b,appendWindowEnd:f,timestampOffset:e,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null,chapterTitle:null}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}
function dC(a){let b;if((b=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(a))||(b=/^offline:segment\/([0-9]+)$/.exec(a)))return Number(b[1]);throw new H(2,9,9004,"Could not parse uri "+a);}
function bC(a){var b=a.streams.filter(f=>f.contentType=="audio");a=a.streams.filter(f=>f.contentType=="video");if(!b.every(f=>f.variantIds)||!a.every(f=>f.variantIds)){for(var c of b)c.variantIds=[];for(var d of a)d.variantIds=[];c=0;if(a.length&&!b.length){d=c++;for(var e of a)e.variantIds.push(d)}if(!a.length&&b.length){e=c++;for(const f of b)f.variantIds.push(e)}if(a.length&&b.length)for(const f of b)for(const g of a)b=c++,f.variantIds.push(b),g.variantIds.push(b)}}
var eC=class extends QB{async updateManifestExpiration(a,b){const c=KB(this.h,this.g),d=c.store(),e=Promise.withResolvers();d.get(a).onsuccess=f=>{(f=f.target.result)?(f.expiration=b,d.put(f),e.resolve()):e.reject(new H(2,9,9012,"Could not find values for "+a))};await Promise.all([c.promise(),e.promise])}async i(a){var b=[];for(let c=0;c<a.periods.length;++c){const d=aC(a.periods[c],(c==a.periods.length-1?a.duration:a.periods[c+1].startTime)-a.periods[c].startTime);b.push(d)}b=await zx(b);return{creationTime:0,
originalManifestUri:a.originalManifestUri,duration:a.duration,size:a.size,expiration:a.expiration==null?Infinity:a.expiration,streams:b,sessionIds:a.sessionIds,drmInfo:a.drmInfo,appMetadata:a.appMetadata,sequenceMode:!1}}l(a){return{data:a.data}}};function fC(a,b,c){return{id:a.id,originalId:a.originalId,groupId:null,primary:a.primary,type:a.contentType,mimeType:a.mimeType,codecs:a.codecs,frameRate:a.frameRate,pixelAspectRatio:a.pixelAspectRatio,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:a.kind,language:a.language,originalLanguage:a.language||null,label:a.label,width:a.width,height:a.height,encrypted:a.encrypted,keyIds:new Set([a.keyId]),segments:a.segments.map(d=>({startTime:b+d.startTime,endTime:b+d.endTime,initSegmentKey:a.initSegmentKey,
appendWindowStart:b,appendWindowEnd:c,timestampOffset:b-a.presentationTimeOffset,dataKey:d.dataKey,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null,chapterTitle:null})),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}
var gC=class extends QB{async i(a){var b=[];for(let e=0;e<a.periods.length;++e){var c=a.periods[e],d=(e==a.periods.length-1?a.duration:a.periods[e+1].startTime)-a.periods[e].startTime;const f=[];for(const g of c.streams)g.variantIds.length!=0&&f.push(fC(g,c.startTime,c.startTime+d));b.push(f)}b=await zx(b);return{appMetadata:a.appMetadata,creationTime:0,drmInfo:a.drmInfo,duration:a.duration,expiration:a.expiration==null?Infinity:a.expiration,originalManifestUri:a.originalManifestUri,sessionIds:a.sessionIds,
size:a.size,streams:b,sequenceMode:!1}}};var hC=class extends QB{hasFixedKeySpace(){return!1}addSegments(a){return this.add(this.j,a)}addManifests(a){return this.add(this.g,a)}updateManifest(a,b){return PB(this,a,b)}i(a){a.expiration==null&&(a.expiration=Infinity);return Promise.resolve(a)}};function iC(){const a=Promise.withResolvers(),b=window.indexedDB.deleteDatabase("shaka_offline_db");b.onblocked=()=>{};b.onsuccess=()=>{a.resolve()};b.onerror=c=>{a.reject(new H(2,9,9001,b.error));c.preventDefault()};return a.promise}
var kC=class{constructor(){this.m=this.j=this.i=this.h=this.g=this.l=null}init(){const a=Promise.withResolvers();let b=!1;const c=new te(()=>{b=!0;a.reject(new H(2,9,9017))});typeof jC==="number"&&jC>0&&c.ha(jC);const d=window.indexedDB.open("shaka_offline_db",5);d.onsuccess=()=>{if(!b){c.stop();var e=d.result;this.l=e;var f=e.objectStoreNames;f=f.contains("manifest")&&f.contains("segment")?new eC(e,"segment","manifest"):null;this.g=f;f=e.objectStoreNames;f=f.contains("manifest-v2")&&f.contains("segment-v2")?
new gC(e,"segment-v2","manifest-v2"):null;this.h=f;f=e.objectStoreNames;f=f.contains("manifest-v3")&&f.contains("segment-v3")?new gC(e,"segment-v3","manifest-v3"):null;this.i=f;f=e.objectStoreNames;f=f.contains("manifest-v5")&&f.contains("segment-v5")?new hC(e,"segment-v5","manifest-v5"):null;this.j=f;e=e.objectStoreNames.contains("session-ids")?new RB(e):null;this.m=e;a.resolve()}};d.onupgradeneeded=()=>{var e=d.result;const f=["segment-v5","manifest-v5","session-ids"];for(const g of f)e.objectStoreNames.contains(g)||
e.createObjectStore(g,{autoIncrement:!0})};d.onerror=e=>{b||(c.stop(),a.reject(new H(2,9,9001,d.error)),e.preventDefault())};return a.promise}async destroy(){this.g&&await this.g.destroy();this.h&&await this.h.destroy();this.i&&await this.i.destroy();this.j&&await this.j.destroy();this.m&&await this.m.destroy();this.l&&this.l.close()}getCells(){const a=new Map;this.g&&a.set("v1",this.g);this.h&&a.set("v2",this.h);this.i&&a.set("v3",this.i);this.j&&a.set("v5",this.j);return a}getEmeSessionCell(){return this.m}async erase(){this.g&&
await this.g.destroy();this.h&&await this.h.destroy();this.i&&await this.i.destroy();this.j&&await this.j.destroy();this.l&&this.l.close();await iC();this.j=this.i=this.h=this.g=this.l=null;await this.init()}},jC=5;w("shaka.offline.indexeddb.StorageMechanismOpenTimeout",jC);SB("idb",()=>A().W()?new kC:null);function lC(a){a=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(a);if(a==null)return null;const b=a[1];if(b!="manifest"&&b!="segment")return null;const c=a[2];if(!c)return null;const d=a[3];return d&&b!=null?new mC(b,c,d,Number(a[4])):null}var mC=class{constructor(a,b,c,d){this.g=a;this.i=b;this.h=c;this.l=d;this.j=["offline:",a,"/",b,"/",c,"/",d].join("")}Bb(){return this.i}Wa(){return this.h}key(){return this.l}toString(){return this.j}};function nC(a,b,c,d){var e=new Set;for(var f of b)for(const h of f.variantIds)e.add(h);for(const h of c)for(const k of h.variantIds)e.add(k);f=new Map;for(const h of e)f.set(h,{id:h,language:"",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});for(var g of b){b=oC(a,g,d);for(const h of g.variantIds)e=f.get(h),e.language=b.language,e.primary=e.primary||b.primary,e.audio=b}for(const h of c){c=oC(a,h,d);for(const k of h.variantIds)g=
f.get(k),g.primary=g.primary||c.primary,g.video=c}return f}
function oC(a,b,c){const d=b.segments.map(e=>pC(a,e,b));c.Ed(d);return{id:b.id,originalId:b.originalId,groupId:b.groupId,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ll(d),mimeType:b.mimeType,codecs:b.codecs,supplementalCodecs:"",width:b.width||void 0,height:b.height||void 0,frameRate:b.frameRate,pixelAspectRatio:b.pixelAspectRatio,hdr:b.hdr,colorGamut:b.colorGamut,videoLayout:b.videoLayout,kind:b.kind,encrypted:b.encrypted,drmInfos:[],keyIds:b.keyIds,language:b.language,originalLanguage:b.originalLanguage||
null,label:b.label,type:b.type,primary:b.primary,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:b.roles,forced:b.forced,channelsCount:b.channelsCount,audioSamplingRate:b.audioSamplingRate,spatialAudio:b.spatialAudio,closedCaptions:b.closedCaptions,tilesLayout:b.tilesLayout,accessibilityPurpose:null,external:b.external,fastSwitching:b.fastSwitching,fullMimeTypes:new Set([Rd(b.mimeType,b.codecs)]),isAudioMuxedInVideo:b.isAudioMuxedInVideo||!1,baseOriginalId:null}}
function qC(a,b){const c=new U(null,0);c.Eb(b.duration);var d=b.streams.filter(k=>k.type=="audio"),e=b.streams.filter(k=>k.type=="video");d=nC(a,d,e,c);e=b.streams.filter(k=>k.type==K).map(k=>oC(a,k,c));const f=b.streams.filter(k=>k.type=="image").map(k=>oC(a,k,c)),g=b.streams.filter(k=>k.type=="chapter").map(k=>oC(a,k,c)),h=b.drmInfo?[b.drmInfo]:[];if(b.drmInfo)for(const k of d.values())k.audio&&k.audio.encrypted&&(k.audio.drmInfos=h),k.video&&k.video.encrypted&&(k.video.drmInfos=h);return{presentationTimeline:c,
offlineSessionIds:b.sessionIds,variants:Array.from(d.values()),textStreams:e,imageStreams:f,chapterStreams:g,sequenceMode:b.sequenceMode||!1,ignoreManifestTimestampsInSegmentsMode:!1,type:b.type||"UNKNOWN",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null}}
function pC(a,b,c){const d=c.type=="chapter"?"":new mC("segment",a.h,a.g,b.dataKey);a=new Q(b.startTime,b.endTime,()=>[d.toString()],0,null,b.initSegmentKey!=null?rC(a,b.initSegmentKey):null,b.timestampOffset,b.appendWindowStart,b.appendWindowEnd,[],b.tilesLayout||"");a.mimeType=b.mimeType||c.mimeType||"";a.codecs=b.codecs||c.codecs||"";b.thumbnailSprite&&a.Re(b.thumbnailSprite);b.chapterTitle&&a.Qe({title:b.chapterTitle,images:[]});return a}
function rC(a,b){const c=new mC("segment",a.h,a.g,b);return new Qi(()=>[c.toString()],0,null)}var sC=class{constructor(a,b){this.h=a;this.g=b}};var tC=class{constructor(){this.g=null}configure(){}async start(a,b){const c=lC(a);this.g=c;if(c==null||c.g!="manifest")throw new H(2,1,9004,a);a=new $B;try{await a.init();const d=(await (await WB(a,c.Bb(),c.Wa())).getManifests([c.key()]))[0],e=qC(new sC(c.Bb(),c.Wa()),d);b.makeTextStreamsForClosedCaptions(e);return e}finally{await a.destroy()}}stop(){return Promise.resolve()}update(){}async onExpirationUpdated(a,b){const c=this.g,d=new $B;try{await d.init();const e=await WB(d,c.Bb(),c.Wa()),f=(await e.getManifests([c.key()]))[0],
g=f.sessionIds.includes(a),h=f.expiration==void 0||f.expiration>b;g&&h&&await e.updateManifestExpiration(c.key(),b)}catch(e){}finally{await d.destroy()}}onInitialVariantChosen(){}banLocation(){}setMediaElement(){}};Xb("application/x-offline-manifest",()=>new tC);function uC(a,b){const c=lC(a);c&&c.g=="manifest"?(a={uri:a,originalUri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"},originalRequest:b},a=Nf(a)):a=c&&c.g=="segment"?vC(c.key(),c,b):Kf(new H(2,1,9004,a));return a}function vC(a,b,c){const d=new $B;return Nf(void 0).Ra(()=>d.init()).Ra(()=>WB(d,b.Bb(),b.Wa())).Ra(e=>e.getSegments([b.key()])).Ra(e=>({uri:b,data:e[0].data,headers:{},originalRequest:c})).finally(()=>d.destroy())}var wC=class{};
w("shaka.offline.OfflineScheme",wC);wC.plugin=uC;Yf("offline",uC);function xC(a){const b=[];for(const c of a){a=!1;for(const d of b)if(yC(d.info,c)){d.sessionIds.push(c.sessionId);a=!0;break}a||b.push({info:c,sessionIds:[c.sessionId]})}return b}function yC(a,b){const c=(d,e)=>d.robustness==e.robustness&&d.contentType==e.contentType;return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&va(a.audioCapabilities,b.audioCapabilities,c)&&va(a.videoCapabilities,b.videoCapabilities,c)}
async function zC(a,b,c){const d=new vh({dc:b,onError:()=>{},Je:()=>{},onExpirationUpdated:()=>{},onEvent:()=>{}});try{d.configure(a),await Yg(d,c.info.keySystem,c.info.licenseUri,c.info.serverCertificate,c.info.audioCapabilities,c.info.videoCapabilities)}catch(f){return await d.destroy(),[]}const e=[];await Promise.all(c.sessionIds.map(async f=>{try{await lh(d,f),e.push(f)}catch(g){}}));await d.destroy();return e}
async function AC(a,b,c){let d=[];for(const e of xC(c))c=await zC(a,b,e),d=d.concat(c);return d};function BC(a,b,c){const d=b.presentationTimeline.getDuration();b=CC(b);return{offlineUri:null,originalManifestUri:a,duration:d,size:0,expiration:Infinity,tracks:b,appMetadata:c,isIncomplete:!1}}function CC(a){const b=[],c=lf(a.variants);for(const d of c)b.push(bf(d));a=a.textStreams;for(const d of a)b.push(cf(d));return b}
function DC(a,b){var c=qC(new sC(a.Bb(),a.Wa()),b);const d=b.appMetadata||{};c=CC(c);return{offlineUri:a.toString(),originalManifestUri:b.originalManifestUri,duration:b.duration,size:b.size,expiration:b.expiration,tracks:c,appMetadata:d,isIncomplete:b.isIncomplete||!1}};function EC(a,b){const c=b.audio,d=b.video;c&&!d&&a.g.set(c.id,c.bandwidth||b.bandwidth);!c&&d&&a.g.set(d.id,d.bandwidth||b.bandwidth);if(c&&d){const e=c.bandwidth||393216;let f=d.bandwidth||b.bandwidth-e;f<=0&&(f=b.bandwidth);a.g.set(c.id,e);a.g.set(d.id,f)}}function FC(a,b){a=a.g.get(b);a==null&&(a=0);return a}var GC=class{constructor(){this.g=new Map}};function HC(){if($b(A()))a:{var a=TB;for(b of a.values())if(a=b()){a.destroy();var b=!0;break a}b=!1}else b=!1;return b}async function IC(a){const b=new $B;await b.init();const c=await UB(b);a=new mC("manifest",c.path.Bb,c.path.Wa,a);await b.destroy();await (new JC).remove(a.toString())}
async function KC(a,b,c,d,e,f){let g=!1;try{let h=!0;for(const k of c.streams)if(k.type!="chapter")for(const l of k.segments){let m=l.pendingSegmentRefId?d[l.pendingSegmentRefId]:null;m!=null&&(l.dataKey=m,l.pendingSegmentRefId=void 0);m=l.pendingInitSegmentRefId?d[l.pendingInitSegmentRefId]:null;m!=null&&(l.initSegmentKey=m,l.pendingInitSegmentRefId=void 0);l.pendingSegmentRefId&&(h=!1);l.pendingInitSegmentRefId&&(h=!1)}c.size+=e;h&&(c.isIncomplete=!1);await a.updateManifest(b,c);g=!0;f()}catch(h){throw await IC(b),
g||(b=Object.values(d),await a.removeSegments(b,()=>{})),h;}}function LC(a){a.variants.map(c=>c.video);const b=new Set(a.variants.map(c=>c.audio));a=a.textStreams;for(const c of b)for(const d of b);for(const c of a)for(const d of a);}
function MC(a,b){const c=[];for(const d of a.streams)b&&d.type=="video"?c.push({contentType:Rd(d.mimeType,d.codecs),robustness:a.drmInfo.videoRobustness}):b||d.type!="audio"||c.push({contentType:Rd(d.mimeType,d.codecs),robustness:a.drmInfo.audioRobustness});return c}
async function NC(a,b,c,d){if(d.drmInfo){c=YB(c);var e=d.sessionIds.map(g=>({sessionId:g,keySystem:d.drmInfo.keySystem,licenseUri:d.drmInfo.licenseServerUri,serverCertificate:d.drmInfo.serverCertificate,audioCapabilities:MC(d,!1),videoCapabilities:MC(d,!0)})),f=await AC(b,a,e);await c.remove(f);await c.add(e.filter(g=>!f.includes(g.sessionId)))}}
function OC(a){const b=new Set;for(const c of a.streams)for(const d of c.segments)d.initSegmentKey!=null&&b.add(d.initSegmentKey),b.add(d.dataKey);return Array.from(b)}function PC(a){const b=new Set;for(const c of a.variants)c.audio&&b.add(c.audio),c.video&&b.add(c.video);for(const c of a.textStreams)b.add(c);for(const c of a.imageStreams)b.add(c);for(const c of a.chapterStreams)b.add(c);return b}
function QC(a,b,c){b=a.segmentIndex.find(b);if(b!=null)for(var d=a.segmentIndex.get(b);d;)c(d,b),d=a.segmentIndex.get(++b)}
async function RC(a,b,c,d,e,f,g,h){SC();let k=null,l=null;const m=new $B;let n=null,p=null,q=null;try{k=await f();const r=await TC(a,b,k,g);UC(a);if(r.presentationTimeline.ua())throw new H(2,9,9005,b);for(const D of d){const z=await VC(a,D,r);r.imageStreams.push(z);UC(a)}for(const D of e){const z=await WC(a,r,D.uri,D.language,D.kind,D.mime,D.codecs);r.textStreams.push(z);UC(a)}Gg(g.drm.clearKeys,r.variants);const t=r.variants.some(D=>{if(D.audio)for(const z of D.audio.drmInfos)if(z.licenseServerUri.startsWith("data:"))return!0;
if(D.video)for(const z of D.video.drmInfos)if(z.licenseServerUri.startsWith("data:"))return!0;return!1});let u=g.offline.usePersistentLicense;t&&(u=!1);l=await a.Qc(r,D=>{q=q||D},g,u);UC(a);if(q)throw q;await XC(r,l,g,u);await m.init();UC(a);n=await UB(m);UC(a);const {Gi:v,og:x}=YC(l,r,b,c,g,h,u),y=await n.Wa.addManifests([v]);UC(a);p=y[0];UC(a);if(q)throw q;await ZC(a,x,p,v,h,g,n.Wa,r,l,u);UC(a);$C(r,v,l,u);await n.Wa.updateManifest(p,v);UC(a);return DC(new mC("manifest",n.path.Bb,n.path.Wa,p),v)}catch(r){throw p!=
null&&await IC(p),q||r;}finally{await m.destroy(),k&&await k.stop(),l&&await l.destroy()}}function aD(a,b){const c=b.promise;a.i.push(c);return b.finally(()=>{ua(a.i,c)})}function SC(){if(!HC())throw new H(2,9,9E3);}
async function TC(a,b,c,d){let e=null;const f={networkingEngine:a.g,filter:()=>Promise.resolve(),makeTextStreamsForClosedCaptions:()=>{},onTimelineRegionAdded:()=>{},onEvent:()=>{},onError:g=>{e=g},isLowLatencyMode:()=>!1,updateDuration:()=>{},newDrmInfo:()=>{},onManifestUpdated:()=>{},getBandwidthEstimate:()=>d.abr.defaultBandwidthEstimate,onMetadata:()=>Promise.resolve(),disableStream:()=>{},addFont:()=>{},getStreamingRetryParameters:()=>d.streaming.retryParameters};c.configure(d.manifest);UC(a);
b=await c.start(b,f);UC(a);c=PC(b);await Promise.all(mg(c,g=>g.createSegmentIndex()));UC(a);if(e)throw e;return b}function UC(a){if(a.j.g)throw new H(2,9,7001);}
async function VC(a,b,c){var d=await bD(a,b);if(d!="text/vtt")throw new H(1,2,2017,b);var e=await cD(b,a.g,a.h.streaming.retryParameters),f=ee(d);if(!f)throw new H(2,2,2014,d);f=f();c={periodStart:0,segmentStart:0,segmentEnd:c.presentationTimeline.getDuration(),vttOffset:0,isMpegTs:!1};e=G(e);f=f.parseMedia(e,c,b,[]);e=[];for(const g of f){let h=null;f=new Q(g.startTime,g.endTime,()=>{h==null&&(h=Kb([b],[g.payload]));return h||[]},0,null,null,0,0,Infinity);g.payload.includes("#xywh")&&(c=g.payload.split("#xywh=")[1].split(","),
c.length===4&&f.Re({height:parseInt(c[3],10),positionX:parseInt(c[0],10),positionY:parseInt(c[1],10),width:parseInt(c[2],10)}));e.push(f)}e.length&&(d=await $l(e[0].R()[0],a.g,a.h.manifest.retryParameters));return{id:a.m++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ll(e),mimeType:d||"",codecs:"",supplementalCodecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:!1,trickModeVideo:null,
dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Rd(d||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null}}
async function WC(a,b,c,d,e,f,g){f||=await bD(a,c);a={id:a.m++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:kl(0,b.presentationTimeline.getDuration(),[c]),mimeType:f||"",codecs:g||"",supplementalCodecs:"",kind:e,encrypted:!1,drmInfos:[],keyIds:new Set,language:d,originalLanguage:d,label:null,type:K,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,
accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:new Set([Rd(f||"",g||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};b=Rd(a.mimeType,a.codecs);if(!fe(b))throw new H(2,2,2014,f);return a}
async function XC(a,b,c,d){Je(a,c.restrictions);await Me(b,a,d,c.drm.preferredKeySystems,c.drm.keySystemsMapping);b=[];d=c.preferredDecodingAttributes;const e=c.preferredVideo.map(r=>r.codec).filter(Boolean),f=c.preferredAudio.map(r=>r.codec).filter(Boolean),g=c.preferredText.map(r=>r.format).filter(Boolean);He(a,e,f,d,g);for(var h of a.variants)b.push(bf(h));for(var k of a.textStreams)b.push(cf(k));for(var l of a.imageStreams)b.push(df(l));for(const r of a.chapterStreams)b.push(ef(r));h=await c.offline.trackSelectionCallback(b);
k=a.presentationTimeline.getDuration();l=0;for(const r of h)l+=r.bandwidth*k/8;try{if(!await c.offline.downloadSizeCallback(l))throw new H(2,9,9014);}catch(r){if(r instanceof H)throw r;throw new H(2,9,9015);}const m=new Set,n=new Set,p=new Set,q=new Set;for(const r of h)r.type=="variant"&&m.add(r.id),r.type=="text"&&n.add(r.id),r.type=="image"&&p.add(r.id),r.type=="chapter"&&q.add(r.id);a.variants=a.variants.filter(r=>m.has(r.id));a.textStreams=a.textStreams.filter(r=>n.has(r.id));a.imageStreams=
a.imageStreams.filter(r=>p.has(r.id));a.chapterStreams=a.chapterStreams.filter(r=>q.has(r.id));LC(a)}
function YC(a,b,c,d,e,f,g){const h=BC(c,b,d),k=e.offline.progressCallback;CB(f,(r,t)=>{h.size=t;k(h,r)},(r,t)=>{l&&g&&m==t&&$g(a,"cenc",r)});const l=dD(b)&&!eD(b);let m=null;l&&(m=fD.get(a.g.keySystem));const n=new GC;for(const r of b.textStreams)n.g.set(r.id,52);for(const r of b.imageStreams)n.g.set(r.id,r.bandwidth||2048);for(const r of b.chapterStreams)n.g.set(r.id,r.bandwidth||2048);for(const r of b.variants)EC(n,r);const {streams:p,og:q}=gD(f,n,b,e);(e=a.g)&&g&&(e.initData=[]);return{Gi:{creationTime:Date.now(),
originalManifestUri:c,duration:b.presentationTimeline.getDuration(),size:0,expiration:a.vd(),streams:p,sessionIds:g?nh(a):[],drmInfo:e,appMetadata:d,isIncomplete:!0,sequenceMode:b.sequenceMode,type:b.type},og:q}}
async function ZC(a,b,c,d,e,f,g,h,k,l){let m={},n=0;const p=()=>{if(a.j.g||e.l)throw new H(2,9,7001);};var q=async(r,t)=>{for(const u of r){p();r=wB(u,f);const v=u.h,x=u.i,y=async z=>{var B=u.g,E=B.Mb(!1);B.aesKey&&!E&&(z=await Zl(z,B.aesKey,u.j));B=vB(B);E=await g.addSegments([{data:z}]);p();m[B]=E[0];n+=z.byteLength},D=u.g.Mb(!1);D?EB(e,u.groupId,D,v,x,y):e.queue(u.groupId,r,v,x,y)}await FB(e);p();t&&!e.l&&($C(h,d,k,l),await g.updateManifest(c,d))};try{dD(h),await q(b,!1),p(),b=m,q=n,m={},n=0,await KC(g,
c,d,b,q,()=>p()),p()}catch(r){throw b=Object.values(m),await g.removeSegments(b,()=>{}),r;}}function $C(a,b,c,d){b.expiration=c.vd();c=nh(c);b.sessionIds=d?c:[];if(dD(a)&&d&&!c.length)throw new H(2,9,9007);}function dD(a){return a.variants.some(b=>{const c=b.audio&&b.audio.encrypted;return b.video&&b.video.encrypted||c})}function eD(a){return a.variants.some(b=>(b.video?b.video.drmInfos:[]).concat(b.audio?b.audio.drmInfos:[]).some(c=>c.initData&&c.initData.length))}
function gD(a,b,c,d){const e=new Map;var f=PC(c);const g=new Map;for(const h of f)f=hD(a,b,c,h,d,e),g.set(h.id,f);for(const h of c.variants)h.audio&&g.get(h.audio.id).variantIds.push(h.id),h.video&&g.get(h.video.id).variantIds.push(h.id);return{streams:Array.from(g.values()),og:Array.from(e.values())}}async function iD(a,b){a.i.push(b);try{return await b}finally{ua(a.i,b)}}
async function jD(a,b){SC();const c=lC(b);if(c==null||c.g!="manifest")throw new H(2,9,9004,b);b=new $B;try{await b.init();const d=await WB(b,c.Bb(),c.Wa()),e=(await d.getManifests([c.key()]))[0];await Promise.all([kD(a,e,b),lD(d,c,e)])}finally{await b.destroy()}}async function kD(a,b,c){await NC(a.g,a.h.drm,c,b)}function lD(a,b,c){const d=OC(c);DC(b,c);c=()=>{};return Promise.all([a.removeSegments(d,c),a.removeManifests([b.key()],c)])}
async function mD(a){SC();const b=a.g;a=a.h.drm;const c=new $B;let d=!1;try{await c.init();const e=[];XB(c,f=>e.push(f));for(const f of e){const g=await f.getAll(),h=await AC(a,b,g);await f.remove(h);h.length!=g.length&&(d=!0)}}finally{await c.destroy()}return!d}
async function nD(){SC();const a=[],b=new $B;try{await b.init();let c=Promise.resolve();VB(b,(d,e)=>{c=c.then(async()=>{(await e.getAllManifests()).forEach((f,g)=>{f=DC(new mC("manifest",d.Bb,d.Wa,g),f);a.push(f)})})});await c}finally{await b.destroy()}return a}async function bD(a,b){let c;try{c=await $l(b,a.g,a.h.streaming.retryParameters)}catch(d){}if(c)return c;throw new H(1,2,2011,b);}async function cD(a,b,c){a=ag([a],c);a.method="GET";return(await b.request(gg,a).promise).data}
function hD(a,b,c,d,e,f){const g={id:d.id,originalId:d.originalId,groupId:d.groupId,primary:d.primary,type:d.type,mimeType:d.mimeType,codecs:d.codecs,supplementalCodecs:"",frameRate:d.frameRate,pixelAspectRatio:d.pixelAspectRatio,hdr:d.hdr,colorGamut:d.colorGamut,videoLayout:d.videoLayout,kind:d.kind,language:d.language,originalLanguage:d.originalLanguage,label:d.label,width:d.width||null,height:d.height||null,encrypted:d.encrypted,keyIds:d.keyIds,segments:[],variantIds:[],roles:d.roles,forced:d.forced,
channelsCount:d.channelsCount,audioSamplingRate:d.audioSamplingRate,spatialAudio:d.spatialAudio,closedCaptions:d.closedCaptions,tilesLayout:d.tilesLayout,external:d.external,fastSwitching:d.fastSwitching,isAudioMuxedInVideo:d.isAudioMuxedInVideo};c=c.presentationTimeline.sb();const h=e.offline.numberOfParallelDownloads;let k=h===0?d.id:0;QC(d,c,(l,m)=>{const n=vB(l);let p=void 0,q=null;if(d.type=="chapter"){var r=l.getMetadata();r&&(q=r.title)}q||f.has(n)||(r=l.endTime-l.startTime,r=FC(b,d.id)*r,
r=yB(a.g,r),f.set(n,new xB(l,r,k,!1,m)));l.ea&&(p=vB(l.ea),f.has(p)||(r=FC(b,d.id)*.5,r=yB(a.g,r),f.set(p,new xB(l.ea,r,k,!0,m))));g.segments.push({pendingInitSegmentRefId:p,initSegmentKey:p?0:null,startTime:l.startTime,endTime:l.endTime,appendWindowStart:l.appendWindowStart,appendWindowEnd:l.appendWindowEnd,timestampOffset:l.timestampOffset,tilesLayout:l.tilesLayout,pendingSegmentRefId:n,dataKey:0,mimeType:l.mimeType,codecs:l.codecs,thumbnailSprite:l.thumbnailSprite,chapterTitle:q});h!==0&&(k=(k+
1)%h)});return g}
var JC=class{constructor(a){if(a&&a.constructor!=Y)throw new H(2,9,9008);this.g=this.h=null;a?(this.h=a.g,this.g=a.pb()):(this.h=un(),this.g=new jg,this.g.configure(this.h.networking));this.i=[];this.l=[];const b=!a;this.j=new lg(async()=>{await Promise.all(this.l.map(e=>BB(e)));const c=()=>{},d=[];for(const e of this.i)d.push(e.then(c,c));await Promise.all(d);b&&await this.g.destroy();this.g=this.h=null});this.m=1E9}destroy(){return this.j.destroy()}configure(a,b){arguments.length==2&&typeof a==
"string"&&(a=Vm(a,b));return yn(this.h,a)}getConfiguration(){const a=un();yn(a,this.h,un());return a}pb(){return this.g}store(a,b,c,d,e){const f=this.getConfiguration(),g=new GB(this.g);this.l.push(g);b=RC(this,a,b||{},d||[],e||[],async()=>{c||=await $l(a,this.g,f.manifest.retryParameters);return bc(a,c||null)()},f,g);b=new Lf(b,()=>BB(g));b.finally(()=>{ua(this.l,g)});return aD(this,b)}remove(a){return iD(this,jD(this,a))}$i(){return iD(this,mD(this))}list(){return iD(this,nD())}async Qc(a,b,c,d){b=
new vh({dc:this.g,onError:b,Je:()=>{},onExpirationUpdated:()=>{},onEvent:()=>{}});b.configure(c.drm);await Tg(b,a.variants,d);d&&await dh(b);return b}};w("shaka.offline.Storage",JC);JC.deleteAll=async function(){const a=new $B;try{await ZB(a)}finally{await a.destroy()}};JC.prototype.list=JC.prototype.list;JC.prototype.removeEmeSessions=JC.prototype.$i;JC.prototype.remove=JC.prototype.remove;JC.prototype.store=JC.prototype.store;JC.prototype.getNetworkingEngine=JC.prototype.pb;
JC.prototype.getConfiguration=JC.prototype.getConfiguration;JC.prototype.configure=JC.prototype.configure;JC.prototype.destroy=JC.prototype.destroy;JC.support=HC;
var fD=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95").set("com.huawei.wiseplay","3d5e6d359b9a41e8b843dd3c6e72c42c");
xq("offline",HC);function oD(a,b){a={priority:b||0,callback:a};for(b=0;b<pD.length;b++)if(pD[b].priority<a.priority){pD.splice(b,0,a);return}pD.push(a)}var qD=class{};w("shaka.polyfill",qD);qD.register=oD;qD.installAll=function(){for(const a of pD)try{a.callback()}catch(b){ma("Error installing polyfill!",b)}};var pD=[];var rD=class{constructor(a,b,c){this.g=a;this.i=b||null;this.h=c||null;this.keySystem=a.keySystem}getConfiguration(){const a=this.g.getConfiguration();if(a.videoCapabilities)for(const b of a.videoCapabilities)b.encryptionScheme=this.i;if(a.audioCapabilities)for(const b of a.audioCapabilities)b.encryptionScheme=this.h;return a}createMediaKeys(){return this.g.createMediaKeys()}};function sD(a){if(nb(a))return"cbcs";if(lb(a)||mb(a)||kb(a)||a==="com.huawei.wiseplay")return"cenc";ma("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function tD(a){if(!a)return!1;a=a.getConfiguration();const b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&a.encryptionScheme!==void 0?!0:!1}function uD(a,b){return!a||a==b||(a=="cbcs"||a=="cbcs-1-9")&&A().B()?!0:!1};function vD(){A().O()&&!wD&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(wD=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=xD,navigator.emeEncryptionSchemePolyfilled=!0)}async function xD(a,b){const c=await wD.call(this,a,b);if(tD(c))return navigator.requestMediaKeySystemAccess=wD,c;navigator.requestMediaKeySystemAccess=yD;return yD.call(this,a,b)}
async function yD(a,b){var c=sD(a),d=[];for(var e of b){b=zD(e.videoCapabilities,c);const f=zD(e.audioCapabilities,c);if(!e.videoCapabilities||!e.videoCapabilities.length||b.length)if(!e.audioCapabilities||!e.audioCapabilities.length||f.length){const g=Object.assign({},e);g.videoCapabilities=b;g.audioCapabilities=f;d.push(g)}}if(!d.length)throw d=Error("Unsupported keySystem or supportedConfigurations."),d.name="NotSupportedError",d.code=DOMException.NOT_SUPPORTED_ERR,d;a=await wD.call(this,a,d);
e=c=null;d[0]&&(d[0].videoCapabilities&&(c=d[0].videoCapabilities[0].encryptionScheme),d[0].audioCapabilities&&(e=d[0].audioCapabilities[0].encryptionScheme));return new rD(a,c,e)}function zD(a,b){return a?a.filter(c=>uD(c.encryptionScheme,b)):a}var AD=class{},wD;qD.EmeEncryptionScheme=AD;AD.install=vD;oD(vD);function BD(){"getOrInsert"in Map.prototype||(Map.prototype.getOrInsert=CD);"getOrInsertComputed"in Map.prototype||(Map.prototype.getOrInsertComputed=DD);"getOrInsert"in WeakMap.prototype||(WeakMap.prototype.getOrInsert=CD);"getOrInsertComputed"in WeakMap.prototype||(WeakMap.prototype.getOrInsertComputed=DD)}function CD(a,b){this.has(a)||this.set(a,b);return this.get(a)}function DD(a,b){this.has(a)||this.set(a,b(a));return this.get(a)}var ED=class{};qD.Map=ED;ED.install=BD;oD(BD);function FD(){A().O()&&!GD&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(GD=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=HD,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}
async function HD(a){const b=await GD.call(this,a);if(!b.supported||!a.keySystemConfiguration)return b;const c=b.keySystemAccess;if(tD(c))return navigator.mediaCapabilities.decodingInfo=GD,b;navigator.mediaCapabilities.decodingInfo=ID;return c?ID.call(this,a):(b.keySystemAccess=await JD(a),b)}
async function ID(a){var b=null;let c=null;if(a.keySystemConfiguration){b=a.keySystemConfiguration;var d=b.keySystem;c=b.audio&&b.audio.encryptionScheme;b=b.video&&b.video.encryptionScheme;d=sD(d);const e={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a};if(!uD(c,d)||!uD(b,d))return e}d=await GD.call(this,a);d.keySystemAccess?d.keySystemAccess=new rD(d.keySystemAccess,b,c):a.keySystemConfiguration&&(d.keySystemAccess=await JD(a));return d}
async function JD(a){var b=a.keySystemConfiguration;const c=[],d=[];b.audio&&c.push({robustness:b.audio.robustness||"",contentType:a.audio.contentType,encryptionScheme:b.audio.encryptionScheme});b.video&&d.push({robustness:b.video.robustness||"",contentType:a.video.contentType,encryptionScheme:b.video.encryptionScheme});b={initDataTypes:b.initDataType?[b.initDataType]:[],distinctiveIdentifier:b.distinctiveIdentifier,persistentState:b.persistentState,sessionTypes:b.sessionTypes};c.length&&(b.audioCapabilities=
c);d.length&&(b.videoCapabilities=d);return await navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b])}var KD=class{},GD;qD.MCapEncryptionScheme=KD;KD.install=FD;oD(FD,-2);function LD(){A().u()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),MD.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=ND)}
async function ND(a){const b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};A();const c=a.video,d=a.audio;if(a.type=="media-source"){if(!$b()||c&&!await OD(c)||d&&!await PD(d))return b}else if(a.type=="file"){if(c&&!ac(c.contentType)||d&&!ac(d.contentType))return b}else return b;if(a.keySystemConfiguration){if(a=await QD(c,d,a.keySystemConfiguration))b.supported=!0,b.keySystemAccess=a}else b.supported=!0;return b}
async function OD(a){return A().i()==="CAST"?await RD(a):Hh(a.contentType)}async function PD(a){const b=A().i();let c=a.contentType;return b==="CAST"&&a.spatialRendering&&(c+="; spatialRendering=true",window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)?(SD.has(c)?a=SD.get(c):(a=await cast.__platform__.canDisplayType(c),SD.set(c,a)),a):Hh(c)}
async function QD(a,b,c){var d=[],e=[];const f=[];if(c.audio){var g={robustness:c.audio.robustness||"",contentType:b.contentType};A().X()&&b.contentType.includes('codecs="ac-3"')&&(g.contentType='audio/mp4; codecs="ec-3"');c.audio.encryptionScheme&&(g.encryptionScheme=c.audio.encryptionScheme,f.push(c.audio.encryptionScheme));d.push(g)}c.video&&(g={robustness:c.video.robustness||"",contentType:a.contentType},c.video.encryptionScheme&&(g.encryptionScheme=c.video.encryptionScheme,f.push(c.video.encryptionScheme)),
e.push(g));g={initDataTypes:[c.initDataType],distinctiveIdentifier:c.distinctiveIdentifier,persistentState:c.persistentState,sessionTypes:c.sessionTypes};d.length&&(g.audioCapabilities=d);e.length&&(g.videoCapabilities=e);a=a?a.contentType:"";d=b?b.contentType:"";b=Zd(a)+";"+Yd(a);a=Zd(d)+";"+Yd(d);d=c.keySystem;e=null;try{const h=ob(b,a,d,f);if(rb.has(h)){const k=ob(b,a,d,f);e=rb.get(k)||null}else{c=e=await navigator.requestMediaKeySystemAccess(c.keySystem,[g]);const k=ob(b,a,d,f);rb.set(k,c)}}catch(h){}return e}
async function RD(a){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return Hh(a.contentType);let b=a.contentType;a.width&&a.height&&a.width>1280&&a.height>720&&(b+=`; width=${a.width}; height=${a.height}`);if(a.framerate){const c=Math.round(a.framerate);if(c<24||c>30)b+=`; framerate=${a.framerate}`}switch(a.transferFunction||""){case "":case "srgb":break;case "pq":b+="; eotf=smpte2084";break;case "hlg":b+="; eotf=arib-std-b67";break;default:return!1}SD.has(b)?a=SD.get(b):(a=
await cast.__platform__.canDisplayType(b),SD.set(b,a));return a}var MD=class{};qD.MediaCapabilities=MD;MD.install=LD;MD.originalMcap=null;var SD=new Map;oD(LD,-1);function TD(){const a=A(),b=a.h()==="WEBKIT"?a.g():null;(window.MediaSource||window.ManagedMediaSource)&&b&&window.MediaSource&&(b<=12?(UD(),VD()):b<=15&&UD());for(const c of a.ba())WD(c);(window.MediaSource||window.ManagedMediaSource)&&XD();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&YD()}
function UD(){const a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(...b){b=a.apply(this,b);b.abort=function(){};return b}}function VD(){const a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
function WD(a){const b=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=c=>Yd(c)!=a&&b(c);if(window.ManagedMediaSource){const c=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=d=>Yd(d)!=a&&c(d)}}
function XD(){if(window.MediaSource){const a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=b=>Vd(b)!="mp2t"&&a(b)}if(window.ManagedMediaSource){const a=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=b=>Vd(b)!="mp2t"&&a(b)}}
function YD(){const a=MediaSource.isTypeSupported;A().wa()&&(MediaSource.isTypeSupported=b=>{const c=b.split(/ *; */),d=c.findIndex(g=>g.startsWith("codecs="));if(d<0)return a(b);const e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(g=>g.startsWith("vp09"));f>=0&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}var ZD=class{};qD.MediaSource=ZD;ZD.install=TD;oD(TD);function $D(a=!1){window.HTMLVideoElement&&window.WebKitMediaKeys&&window.shakaMediaKeysPolyfill!=aE&&(a&&(bE=!0,cE=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),dE=HTMLMediaElement.prototype.setMediaKeys,eE=window.MediaKeys,fE=window.MediaKeySystemAccess,gE=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=hE,window.MediaKeys=iE,window.MediaKeySystemAccess=
jE,navigator.requestMediaKeySystemAccess=kE,window.shakaMediaKeysPolyfill=aE,Ye.clear(),rb.clear())}function kE(a,b){try{const c=new jE(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}function hE(a){const b=this.mediaKeys;b&&b!=a&&lE(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?lE(a,this):Promise.resolve()}
function mE(a){a=G(a.initData);if(eb(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=vb(a.subarray(4),!0);a=yb(a);const b=new Event("encrypted");b.initDataType="skd";b.initData=cb(a);this.dispatchEvent(b)}var nE=class{},bE,cE,dE,eE,fE,gE;qD.PatchedMediaKeysApple=nE;
nE.uninstall=function(){window.shakaMediaKeysPolyfill==aE&&bE&&(bE=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",cE),HTMLMediaElement.prototype.setMediaKeys=dE,window.MediaKeys=eE,window.MediaKeySystemAccess=fE,navigator.requestMediaKeySystemAccess=gE,cE=gE=dE=fE=eE=null,window.shakaMediaKeysPolyfill="",Ye.clear(),rb.clear())};nE.install=$D;
var jE=class{constructor(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(var c of b){a:{if(c.persistentState=="required"){a=null;break a}a={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:c.initDataTypes,sessionTypes:["temporary"],label:c.label};let d=b=!1;if(c.audioCapabilities)for(const e of c.audioCapabilities)e.contentType&&(b=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,e.contentType.split(";")[0])&&(a.audioCapabilities.push(e),
d=!0));if(c.videoCapabilities)for(const e of c.videoCapabilities)e.contentType&&(b=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,e.contentType.split(";")[0])&&(a.videoCapabilities.push(e),d=!0));b||(d=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));a=d?a:null}if(a){this.g=a;return}}c=Error("Unsupported keySystem");c.name="NotSupportedError";c.code=DOMException.NOT_SUPPORTED_ERR;throw c;}createMediaKeys(){const a=new iE(this.keySystem);return Promise.resolve(a)}getConfiguration(){return this.g}};
function lE(a,b){a.g.xa();if(!b)return Promise.resolve();a.g.F(b,"webkitneedkey",mE);try{return Uk(b,HTMLMediaElement.HAVE_METADATA,a.g,()=>{b.webkitSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}var iE=class{constructor(a){this.h=new WebKitMediaKeys(a);this.g=new Ca}createSession(a){a=a||"temporary";if(a!="temporary")throw new TypeError("Session type "+a+" is unsupported on this platform.");return new oE(this.h)}setServerCertificate(){return Promise.resolve(!1)}getStatusForPolicy(){return Promise.resolve("usable")}};
function pE(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.g=b;b=new P("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}
var oE=class extends Vf{constructor(a){super();this.i=null;this.m=a;this.g=this.h=null;this.j=new Ca;this.l=Promise.withResolvers();this.sessionId="";this.expiration=NaN;this.keyStatuses=new qE;this.onkeystatuseschange=null}get closed(){return this.l.promise}generateRequest(a,b){this.h=Promise.withResolvers();try{const c=this.m.createSession("video/mp4",G(b));this.i=c;this.sessionId=c.sessionId||"";this.j.F(this.i,"webkitkeymessage",d=>{this.h&&(this.h.resolve(),this.h=null);d=(new Map).set("messageType",
this.keyStatuses.Nb()==void 0?"license-request":"license-renewal").set("message",cb(d.message));d=new P("message",d);this.dispatchEvent(d)});this.j.F(c,"webkitkeyadded",()=>{this.g&&(pE(this,"usable"),this.g.resolve(),this.g=null)});this.j.F(c,"webkitkeyerror",()=>{const d=Error("EME PatchedMediaKeysApple key error");d.errorCode=this.i.error;if(this.h!=null)this.h.reject(d),this.h=null;else if(this.g!=null)this.g.reject(d),this.g=null;else switch(this.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:pE(this,
"output-not-allowed");break;default:pE(this,"internal-error")}});pE(this,"status-pending")}catch(c){this.h.reject(c)}return this.h.promise}load(){return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){this.g=Promise.withResolvers();try{this.i.update(G(a))}catch(b){this.g.reject(b)}return this.g.promise}close(){try{this.i.close(),this.l.resolve(),this.j.xa()}catch(a){this.l.reject(a)}return this.closed}remove(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))}},
qE=class{constructor(){this.size=0;this.g=void 0}Nb(){return this.g}forEach(a){this.g&&a(this.g,qb.value())}get(a){if(this.has(a))return this.g}has(a){const b=qb.value();return this.g&&ab(a,b)?!0:!1}entries(){}keys(){}values(){}},aE="apple";oD(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||$D())});function rE(){if(window.MediaKeys){var a=A();MediaKeys.prototype.setServerCertificate&&a.J()||(MediaKeys.prototype.setServerCertificate=sE)}}function sE(){return Promise.resolve(!1)}var tE=class{};qD.PatchedMediaKeysCert=tE;tE.install=rE;oD(rE);function uE(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)vE="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=wE;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=xE;window.MediaKeys=yE;window.MediaKeySystemAccess=zE;window.shakaMediaKeysPolyfill=
AE}}function BE(a){const b=vE;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function wE(a,b){try{const c=new zE(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}function xE(a){const b=this.mediaKeys;b&&b!=a&&CE(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&CE(a,this);return Promise.resolve()}var DE=class{};qD.PatchedMediaKeysWebkit=DE;DE.install=uE;
var zE=class{constructor(a,b){this.g=this.keySystem=a;var c=!1;a=="org.w3.clearkey"&&(this.g="webkit-org.w3.clearkey",c=!1);let d=!1;var e=document.getElementsByTagName("video");e=e.length?e[0]:document.createElement("video");for(const f of b){b={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes,sessionTypes:["temporary"],label:f.label};let g=!1;if(f.audioCapabilities)for(const h of f.audioCapabilities)h.contentType&&
(g=!0,e.canPlayType(h.contentType.split(";")[0],this.g)&&(b.audioCapabilities.push(h),d=!0));if(f.videoCapabilities)for(const h of f.videoCapabilities)h.contentType&&(g=!0,e.canPlayType(h.contentType,this.g)&&(b.videoCapabilities.push(h),d=!0));g||(d=e.canPlayType("video/mp4",this.g)||e.canPlayType("video/webm",this.g));f.persistentState=="required"&&(c?(b.persistentState="required",b.sessionTypes=["persistent-license"]):d=!1);if(d){this.h=b;return}}c="Unsupported keySystem";if(a=="org.w3.clearkey"||
a=="com.widevine.alpha")c="None of the requested configurations were supported.";a=Error(c);a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}createMediaKeys(){const a=new yE(this.g);return Promise.resolve(a)}getConfiguration(){return this.h}};
function CE(a,b){a.h=b;a.g.xa();const c=vE;b&&(a.g.F(b,c+"needkey",d=>{const e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=cb(d.initData);a.h.dispatchEvent(e)}),a.g.F(b,c+"keymessage",d=>{const e=EE(a,d.sessionId);e&&(d=(new Map).set("messageType",e.keyStatuses.Nb()==void 0?"licenserequest":"licenserenewal").set("message",d.message),d=new P("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.g.F(b,c+"keyadded",d=>{(d=EE(a,d.sessionId))&&d.ready()}),a.g.F(b,c+"keyerror",
d=>{const e=EE(a,d.sessionId);if(e){var f=Error("EME v0.1b key error");const g=d.errorCode;g.systemCode=d.systemCode;f.errorCode=g;!d.sessionId&&e.h?(d.systemCode==45&&(f.message="Unsupported session type."),e.h.reject(f),e.h=null):d.sessionId&&e.g?(e.g.reject(f),e.g=null):(f=d.systemCode,d.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?FE(e,"output-restricted"):f==1?FE(e,"expired"):FE(e,"internal-error"))}}))}
function EE(a,b){let c=a.j.get(b);return c?c:(c=a.i.shift())?(c.sessionId=b,a.j.set(b,c),c):null}var yE=class{constructor(a){this.l=a;this.h=null;this.g=new Ca;this.i=[];this.j=new Map}createSession(a){a=a||"temporary";if(a!="temporary"&&a!="persistent-license")throw new TypeError("Session type "+a+" is unsupported on this platform.");const b=this.h||document.createElement("video");b.src||(b.src="about:blank");a=new GE(b,this.l,a);this.i.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}getStatusForPolicy(){return Promise.resolve("usable")}};
function FE(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.g=b;b=new P("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}
function HE(a,b,c){if(a.o)return Promise.reject(Error("The session is already initialized."));a.o=!0;let d;try{if(a.m=="persistent-license")if(c)d=G(yb("LOAD_SESSION|"+c));else{const f=yb("PERSISTENT|");d=Hb(f,b)}else d=G(b)}catch(f){return Promise.reject(f)}a.h=Promise.withResolvers();const e=BE("generateKeyRequest");try{a.l[e](a.j,d)}catch(f){if(f.name!="InvalidStateError")return a.h=null,Promise.reject(f);(new te(()=>{try{a.l[e](a.j,d)}catch(g){a.h.reject(g),a.h=null}})).ha(.01)}return a.h.promise}
function IE(a,b,c){if(a.g)a.g.promise.then(()=>IE(a,b,c)).catch(()=>IE(a,b,c));else{a.g=b;if(a.j=="webkit-org.w3.clearkey"){var d=ub(c);var e=JSON.parse(d);e.keys[0].kty!="oct"&&(a.g.reject(Error("Response is not a valid JSON Web Key Set.")),a.g=null);d=Eb(e.keys[0].k);e=Eb(e.keys[0].kid)}else d=G(c),e=null;var f=BE("addKey");try{a.l[f](a.j,d,e,a.sessionId)}catch(g){a.g.reject(g),a.g=null}}}
var GE=class extends Vf{constructor(a,b,c){super();this.l=a;this.o=!1;this.g=this.h=null;this.j=b;this.m=c;this.i=Promise.withResolvers();this.sessionId="";this.expiration=NaN;this.keyStatuses=new JE;this.onkeystatuseschange=null}get closed(){return this.i.promise}ready(){FE(this,"usable");this.g&&this.g.resolve();this.g=null}generateRequest(a,b){return HE(this,b,null)}load(a){return this.m=="persistent-license"?HE(this,null,a):Promise.reject(Error("Not a persistent session."))}update(a){const b=
Promise.withResolvers();IE(this,b,a);return b.promise}close(){if(this.m!="persistent-license"){if(!this.sessionId)return this.i.reject(Error("The session is not callable.")),this.i.promise;const a=BE("cancelKeyRequest");try{this.l[a](this.j,this.sessionId)}catch(b){}}this.i.resolve();return this.i.promise}remove(){return this.m!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()}},JE=class{constructor(){this.size=0;this.g=void 0}Nb(){return this.g}forEach(a){this.g&&
a(this.g,qb.value())}get(a){if(this.has(a))return this.g}has(a){const b=qb.value();return this.g&&ab(a,b)?!0:!1}entries(){}keys(){}values(){}},vE="",AE="webkit";oD(uE);function KE(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=LE))}function LE(){const a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}var ME=class{};qD.RandomUUID=ME;ME.install=KE;oD(KE);function NE(){const a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:OE})}function OE(){const a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}var PE=class{};qD.Symbol=PE;PE.install=NE;oD(NE);function QE(){const a=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array];for(const b of a){let c;(c=b.prototype).indexOf??(c.indexOf=Array.prototype.indexOf);let d;(d=b.prototype).lastIndexOf??(d.lastIndexOf=Array.prototype.lastIndexOf);let e;(e=b.prototype).includes??(e.includes=Array.prototype.includes)}}var RE=class{};qD.TypedArray=RE;RE.install=QE;oD(QE);function SE(){if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}}var TE=class{};qD.VideoPlayPromise=TE;TE.install=SE;oD(SE);function UE(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||typeof ej().webkitDroppedFrameCount==="number")&&(a.getVideoPlaybackQuality=VE)}}function VE(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}var WE=class{};qD.VideoPlaybackQuality=WE;WE.install=UE;oD(UE);function XE(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(b==3)a=YE;else if(b==6)a=ZE;else{try{var c=!!YE(1,2,"")}catch(d){c=!1}c&&(a=YE)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function YE(a,b,c){return new window.TextTrackCue(a,b,c)}function ZE(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}var $E=class{};qD.VTTCue=$E;$E.install=XE;oD(XE);function aF(a,b){if(a.u&&!(a.u.preloadNextUrlWindow<=0)){var c=!1,d=async()=>{if(!(a.l||a.h.length<=1||c||a.g.ua())&&b.duration){var e=a.g.Ea().end-b.currentTime;if(!(isNaN(e)||e>a.u.preloadNextUrlWindow)){c=!0;e=null;var f=a.u.repeatMode,g=a.j+1;g<a.h.length?e=a.h[g]:f===1&&(e=a.h[0]);if(e&&(!e.preloadManager||e.preloadManager.l)){try{const h=await a.g.preload(e.manifestUri,e.startTime,e.mimeType,e.config);a.l={item:e,preloadManager:h}}catch(h){a.l={item:e,preloadManager:null}}a.m.Ma(b,"timeupdate",
d)}c=!1}}};a.m.F(b,"timeupdate",d)}}function bF(a,b){a.m.F(a.g,"complete",()=>{const c=a.u?.repeatMode;if(c===2)cF(a,b);else{var d=a.j+1,e=null;d<a.h.length?e=d:c===1&&(e=a.h.length>1?0:a.j);e!==null&&(e===a.j?cF(a,b):(a.o&&(a.o.stop(),a.o=null),a.o=(new te(()=>{a.playItem(e).catch(()=>{})})).ha(0)))}})}
function dF(a,b){let c=b.manifestUri;b.preloadManager&&!b.preloadManager.l?c=b.preloadManager:a.l?.item===b&&a.l.preloadManager?c=a.l.preloadManager:a.i?.item===b&&a.i.preloadManager&&(c=a.i.preloadManager);return c}
async function eF(a,b,c){b=a.i?.item===b;a.i&&!b&&a.i.preloadManager&&!a.i.preloadManager.l&&await a.i.preloadManager.destroy();a.i=null;if(a.u?.preloadPrevItem&&c&&a.g.Vc()===Eq)try{const d=await a.g.rh(!1,!1,!1,!0);a.i={item:c,preloadManager:d}}catch(d){a.i={item:c,preloadManager:null}}}
async function fF(a,b){const c=b.extraText?.map(async e=>{e.mime?await a.g.Gb(e.uri,e.language,e.kind,e.mime,e.codecs):await a.g.Gb(e.uri,e.language,e.kind)})||[],d=b.extraThumbnail?.map(async e=>{await a.g.Zb(e)})||[];b=b.extraChapter?.map(async e=>{await a.g.Yb(e.uri,e.language,e.mime)})||[];await Promise.all([...c,...d,...b])}function cF(a,b){b.paused?(b.currentTime=a.g.Ea().start,b.play()):a.m.na(b,"paused",()=>{b.currentTime=a.g.Ea().start;b.play()})}
var gF=class extends Vf{constructor(a){super();this.g=a;this.u=null;this.h=[];this.j=-1;this.i=this.l=null;this.m=new Ca;this.o=null}async destroy(){await this.removeAllItems();this.g=null;this.m&&(this.m.release(),this.m=null);this.o&&(this.o.stop(),this.o=null);super.release()}configure(a){this.u=a}getConfiguration(){return this.u}setCustomPlayer(a){this.g=a}getCurrentItem(){return this.h.length&&this.j>=0&&this.j<this.h.length?this.h[this.j]:null}getCurrentItemIndex(){return this.j}getItems(){return this.h.slice()}insertItems(a){this.h.push(...a);
this.dispatchEvent(new P("itemsinserted"))}async removeAllItems(){this.m.xa();if(this.g&&this.h.length&&this.j>=0)try{await this.g.mc()}catch(b){}const a=[];this.i?.preloadManager&&!this.i.preloadManager.l&&a.push(this.i.preloadManager.destroy());this.i=null;this.l?.preloadManager&&!this.l.preloadManager.l&&a.push(this.l.preloadManager.destroy());this.l=null;for(const b of this.h)b.preloadManager&&!b.preloadManager.l&&a.push(b.preloadManager.destroy());a.length&&await Promise.all(a);this.h=[];this.j=
-1;this.dispatchEvent(new P("itemsremoved"))}async playItem(a){this.m.xa();this.o&&(this.o.stop(),this.o=null);if(!this.h.length||a<0||a>=this.h.length)throw new H(2,7,7007);const b=this.getCurrentItem(),c=this.h[a];this.j!==a&&(this.j=a,this.dispatchEvent(new P("currentitemchanged")));a=this.g.ob();aF(this,a);bF(this,a);a=dF(this,c);await eF(this,c,b);c.config&&(this.g.dh(),this.g.configure(c.config));(c.extraText?.length||c.extraThumbnail?.length||c.extraChapter?.length)&&this.m.na(this.g,"streaming",
async()=>{await fF(this,c)});await this.g.load(a,c.startTime,c.mimeType);this.l=null}};w("shaka.queue.QueueManager",gF);gF.prototype.playItem=gF.prototype.playItem;gF.prototype.removeAllItems=gF.prototype.removeAllItems;gF.prototype.insertItems=gF.prototype.insertItems;gF.prototype.getItems=gF.prototype.getItems;gF.prototype.getCurrentItemIndex=gF.prototype.getCurrentItemIndex;gF.prototype.getCurrentItem=gF.prototype.getCurrentItem;gF.prototype.setCustomPlayer=gF.prototype.setCustomPlayer;
gF.prototype.getConfiguration=gF.prototype.getConfiguration;gF.prototype.configure=gF.prototype.configure;gF.prototype.destroy=gF.prototype.destroy;hs=a=>new gF(a);function hF(a){return a?(a=/^(\d+) (\d+)$/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
function iF(a,b,c,d){const e=new rc;var f=b.attributes["xml:id"];if(!f)return null;e.id=f;f=null;d&&(f=jF.exec(d)||kF.exec(d));d=f?Number(f[1]):null;f=f?Number(f[2]):null;let g,h;const k=lF(a,b,c,"extent");k&&(g=(h=jF.exec(k))||kF.exec(k),g!=null&&(e.width=Number(g[1]),e.height=Number(g[2]),h||(d!=null&&(e.width=e.width*100/d),f!=null&&(e.height=e.height*100/f)),e.widthUnits=h||d!=null?pc:0,e.heightUnits=h||f!=null?pc:0));if(a=lF(a,b,c,"origin"))if(g=(h=jF.exec(a))||kF.exec(a),g!=null)e.viewportAnchorX=
Number(g[1]),e.viewportAnchorY=Number(g[2]),h?k||(e.width=100-e.viewportAnchorX,e.widthUnits=pc,e.height=100-e.viewportAnchorY,e.heightUnits=pc):(f!=null&&(e.viewportAnchorY=e.viewportAnchorY*100/f),d!=null&&(e.viewportAnchorX=e.viewportAnchorX*100/d)),e.viewportAnchorUnits=h||d!=null?pc:0;return e}
function mF(a,b,c,d,e,f,g,h,k,l,m,n,p,q){let r,t=m;if(Kc(b)){if(!n)return null;r={tagName:"span",children:[Nc(b)],attributes:{},parent:null}}else r=b;let u=null;for(var v of nF)if(u=oF(r,"backgroundImage",e,"#",v)[0])break;v=null;var x=Uc(r,nF,"backgroundImage"),y=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(x&&y.test(x)){v=parseInt(x.split(":").pop(),10)-1;if(v>=q.length)return null;v=q[v]}else p&&x&&!x.startsWith("#")&&(y=new Ma(p),x=new Ma(x),(x=y.resolve(x).toString())&&(v=x));
if(b.tagName=="p"||u||v)n=!0;b=n;x=(r.attributes["xml:space"]||(k?"default":"preserve"))=="default";y=r.children.every(Kc);k=[];if(!y)for(const B of r.children){const E=mF(a,B,c,d,e,f,g,h,x,l,r,n,p,q);E&&k.push(E)}e=m!=null;p=Nc(r);p=r.children.length&&p&&/\S/.test(p);q=r.attributes.begin||r.attributes.end||r.attributes.dur;if(!(q||p||r.tagName=="br"||k.length!=0||e&&!x))return null;let {start:D,end:z}=pF(r,d);for(;t&&t.tagName&&t.tagName!="tt";)({start:D,end:z}=qF(t,d,D,z)),t=t.parent;D==null&&(D=
0);D+=c.periodStart;z=z==null?Infinity:z+c.periodStart;a.g!=="HLS"&&(D=Math.max(D,c.segmentStart),z=Math.min(z,c.segmentEnd));if(!q&&k.length>0){D=Infinity;z=0;for(const B of k)D=Math.min(D,B.startTime),z=Math.max(z,B.endTime)}if(r.tagName=="br")return a=new jd(D,z,""),a.lineBreak=!0,a;c="";y&&(c=Ab(Nc(r)||""),x&&(c=c.replace(/\s+/g," ")));c=new jd(D,z,c);c.nestedCues=k;n||(c.isContainer=!0);l&&(c.cellResolution=l);l=oF(r,"region",g,"")[0];if(r.attributes.region&&l&&l.attributes["xml:id"]){const B=
l.attributes["xml:id"];c.region=h.filter(E=>E.id==B)[0]}h=l;m&&e&&!r.attributes.region&&!r.attributes.style&&(h=oF(m,"region",g,"")[0]);rF(a,c,r,h,u,v,f,b,k.length==0);return c}function oF(a,b,c,d,e){const f=[];if(!a||c.length<1)return f;var g=a;for(a=null;!a&&!(a=e?Tc(g,e,b):g.attributes[b])&&(g=g.parent,g););if(b=a){b=b.split(" ");for(const h of b)for(const k of c)if(d+k.attributes["xml:id"]==h){f.push(k);break}}return f}
function pF(a,b){const c=sF(a.attributes.begin,b);let d=sF(a.attributes.end,b);a=sF(a.attributes.dur,b);d==null&&a!=null&&(d=c+a);return{start:c,end:d}}function qF(a,b,c,d){a=pF(a,b);c==null?c=a.start:a.start!=null&&(c+=a.start);d==null?d=a.end:a.start!=null&&(d+=a.start);return{start:c,end:d}}
function rF(a,b,c,d,e,f,g,h,k){h=h||k;tF(a,c,d,g,"direction",h)=="rtl"&&(b.direction="rtl");k=tF(a,c,d,g,"writingMode",h);k=="tb"||k=="tblr"?b.writingMode="vertical-lr":k=="tbrl"?b.writingMode="vertical-rl":k=="rltb"||k=="rl"?b.direction="rtl":k&&(b.direction=yd);(k=tF(a,c,d,g,"textAlign",!0))?(b.positionAlign=uF.get(k),b.lineAlign=vF.get(k),b.textAlign=Fd[k.toUpperCase()]):b.textAlign=sd;if(k=tF(a,c,d,g,"displayAlign",!0))b.displayAlign=Gd[k.toUpperCase()];if(k=tF(a,c,d,g,"color",h))b.color=wF(k);
if(k=tF(a,c,d,g,"backgroundColor",h))b.backgroundColor=wF(k);if(k=tF(a,c,d,g,"border",h))b.border=k;if(k=tF(a,c,d,g,"fontFamily",h))switch(k){case "monospaceSerif":b.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case "proportionalSansSerif":b.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case "sansSerif":b.fontFamily="sans-serif";break;case "monospaceSansSerif":b.fontFamily="Consolas,monospace";break;case "proportionalSerif":b.fontFamily="serif";break;default:b.fontFamily=
k.split(",").filter(l=>l!="default").join(",")}(k=tF(a,c,d,g,"fontWeight",h))&&k=="bold"&&(b.fontWeight=ud);k=tF(a,c,d,g,"wrapOption",h);b.wrapLine=k&&k=="noWrap"?!1:!0;(k=tF(a,c,d,g,"lineHeight",h))&&k.match(xF)&&(b.lineHeight=k);(k=tF(a,c,d,g,"fontSize",h))&&(k.match(xF)||k.match(yF))&&(b.fontSize=k);if(k=tF(a,c,d,g,"fontStyle",h))b.fontStyle=Id[k.toUpperCase()];e?(f=e.attributes.imageType||e.attributes.imagetype,k=e.attributes.encoding,e=Nc(e).trim(),f=="PNG"&&k=="Base64"&&e&&(b.backgroundImage=
"data:image/png;base64,"+e)):f&&(b.backgroundImage=f);if(e=tF(a,c,d,g,"textOutline",h))e=e.split(" "),e[0].match(xF)?b.textStrokeColor=b.color:(b.textStrokeColor=wF(e[0]),e.shift()),e[0]&&e[0].match(xF)?b.textStrokeWidth=e[0]:b.textStrokeColor="";(e=tF(a,c,d,g,"letterSpacing",h))&&e.match(xF)&&(b.letterSpacing=e);(e=tF(a,c,d,g,"linePadding",h))&&e.match(xF)&&(b.linePadding=e);if(e=tF(a,c,d,g,"opacity",h))b.opacity=parseFloat(e);(e=lF(a,d,g,"textDecoration"))&&zF(b,e);(e=AF(a,c,g,"textDecoration"))&&
zF(b,e);if(e=tF(a,c,d,g,"textCombine",h))b.textCombineUpright=e;switch(tF(a,c,d,g,"ruby",h)){case "container":b.rubyTag="ruby";break;case "text":b.rubyTag="rt"}}function lF(a,b,c,d){if(!b)return null;const e=Uc(b,BF,d);return e?e:CF(a,b,c,d)}function wF(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(","),b.length==4)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a}function tF(a,b,c,d,e,f=!0){return(b=AF(a,b,d,e))?b:f?lF(a,c,d,e):null}
function zF(a,b){for(const c of b.split(" "))switch(c){case "underline":a.textDecoration.includes(wd)||a.textDecoration.push(wd);break;case "noUnderline":a.textDecoration.includes(wd)&&ua(a.textDecoration,wd);break;case "lineThrough":a.textDecoration.includes("lineThrough")||a.textDecoration.push("lineThrough");break;case "noLineThrough":a.textDecoration.includes("lineThrough")&&ua(a.textDecoration,"lineThrough");break;case "overline":a.textDecoration.includes("overline")||a.textDecoration.push("overline");
break;case "noOverline":a.textDecoration.includes("overline")&&ua(a.textDecoration,"overline")}}function AF(a,b,c,d){const e=Uc(b,BF,d);return e?e:CF(a,b,c,d)}function CF(a,b,c,d){b=oF(b,"style",c,"");let e=null;for(let f=0;f<b.length;f++){let g=Tc(b[f],"urn:ebu:tt:style",d);g||=Uc(b[f],BF,d);g||=AF(a,b[f],c,d);g&&(e=g)}return e}
function sF(a,b){var c=null;if(DF.test(a)){a=DF.exec(a);c=Number(a[1]);const d=Number(a[2]);let e=Number(a[3]),f=Number(a[4]);f+=(Number(a[5])||0)/b.h;e+=f/b.frameRate;c=e+d*60+c*3600}else if(EF.test(a))c=FF(EF,a);else if(GF.test(a))c=FF(GF,a);else if(HF.test(a))a=HF.exec(a),c=Number(a[1])/b.frameRate;else if(IF.test(a))a=IF.exec(a),c=Number(a[1])/b.g;else if(JF.test(a))c=FF(JF,a);else if(a)throw new H(2,2,2001,"Could not parse cue time range in TTML");return c}
function FF(a,b){a=a.exec(b);return a==null||a[0]==""?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+(Number(a[2])||0)*60+(Number(a[1])||0)*3600}
var MF=class{constructor(){this.g="UNKNOWN"}parseInit(){}setManifestType(a){this.g=a}parseMedia(a,b,c,d){var e=ub(a);a=[];if(e=="")return a;var f=Fc(e,"tt",!0);if(!f)throw new H(2,2,2005,"Failed to parse TTML.");e=Pc(f,"body")[0];if(!e)return[];var g=Uc(f,KF,"frameRate"),h=Uc(f,KF,"subFrameRate"),k=Uc(f,KF,"frameRateMultiplier"),l=Uc(f,KF,"tickRate"),m=Uc(f,KF,"cellResolution"),n=f.attributes["xml:space"]||"default";const p=Uc(f,BF,"extent");if(n!="default"&&n!="preserve")throw new H(2,2,2005,"Invalid xml:space value: "+
n);n=n=="default";g=new LF(g,h,k,l);m=hF(m);h=Pc(f,"metadata")[0];h=(h?h.children:[]).filter(q=>q!="\n");k=Pc(f,"style");f=Pc(f,"region");l=[];for(const q of f){const r=iF(this,q,k,p);r&&l.push(r)}if(Mc(e,"p").length)throw new H(2,2,2001,"<p> can only be inside <div> in TTML");for(const q of Mc(e,"div"))if(Mc(q,"span").length)throw new H(2,2,2001,"<span> can only be inside <p> in TTML");if(b=mF(this,e,b,g,h,k,f,l,n,m,null,!1,c,d))b.backgroundColor||(b.backgroundColor="transparent"),a.push(b);return a}};
w("shaka.text.TtmlTextParser",MF);MF.prototype.parseMedia=MF.prototype.parseMedia;MF.prototype.setManifestType=MF.prototype.setManifestType;MF.prototype.parseInit=MF.prototype.parseInit;
var LF=class{constructor(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.g=Number(d);this.g==0&&(this.g=a?this.frameRate*this.h:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))}},jF=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,yF=/^(\d{1,4}(?:\.\d+)?|100)%$/,xF=/^(\d+px|\d+em|\d*\.?\d+c)$/,kF=/^(\d+)px (\d+)px$/,DF=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,EF=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,GF=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,
HF=/^(\d*(?:\.\d*)?)f$/,IF=/^(\d*(?:\.\d*)?)t$/,JF=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),vF=(new Map).set("left",Bd).set("center","center").set("right","end").set("start",Bd).set("end","end"),uF=(new Map).set("left","line-left").set("center","center").set("right","line-right").set("start","line-left").set("end","line-right"),KF=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],BF=["http://www.w3.org/ns/ttml#styling",
"http://www.w3.org/2006/10/ttaf1#styling"],nF=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];ce("application/ttml+xml",()=>new MF);var NF=class{constructor(){this.g=new MF}parseInit(a){let b=!1;(new Dg).Ga(["moov","trak","mdia","minf","stbl"],vg).$("stsd",xg).box("stpp",c=>{b=!0;c.parser.stop()}).parse(a);if(!b)throw new H(2,2,2007);}setManifestType(a){this.g.setManifestType(a)}parseMedia(a,b,c){let d=[],e=null;const f=[],g=new Map,h=[];(new Dg).Ga(["moof","traf"],vg).$("tfhd",m=>{e=Kh(m.reader,m.flags).Rc}).$("trun",m=>{m=Nh(m.reader,m.version,m.flags);for(const n of m.Id)h.push(n.sampleSize||e||0)}).$("subs",m=>{const n=m.reader,
p=n.U();let q=-1;for(let t=0;t<p;t++){var r=n.U();q+=r;r=n.Ca();const u=[];for(let v=0;v<r;v++)m.version==1?u.push(n.U()):u.push(n.Ca()),n.Y(),n.Y(),n.U();g.set(q,u)}}).box("mdat",Ag(m=>{f.push(m)},!1)).parse(a,!1);if(f.length==0)throw new H(2,2,2007);a=Hb(...f);let k=0;for(let m=0;m<h.length;m++){const n=G(a,k,h[m]);k+=h[m];const p=g.get(m);if(p&&p.length){const q=G(n,0,p[0]),r=[];let t=p[0];for(let u=1;u<p.length;u++){var l=G(n,t,p[u]);l=Cb(l);r.push("data:image/png;base64,"+l);t+=p[u]}d=d.concat(this.g.parseMedia(q,
b,c,r))}else d=d.concat(this.g.parseMedia(n,b,c,[]))}return d}};w("shaka.text.Mp4TtmlParser",NF);NF.prototype.parseMedia=NF.prototype.parseMedia;NF.prototype.setManifestType=NF.prototype.setManifestType;NF.prototype.parseInit=NF.prototype.parseInit;ce('application/mp4; codecs="stpp"',()=>new NF);ce('application/mp4; codecs="stpp.ttml"',()=>new NF);ce('application/mp4; codecs="stpp.ttml.im1i"',()=>new NF);ce('application/mp4; codecs="stpp.ttml.im1t"',()=>new NF);
ce('application/mp4; codecs="stpp.ttml.im2i"',()=>new NF);ce('application/mp4; codecs="stpp.ttml.im2t"',()=>new NF);ce('application/mp4; codecs="stpp.ttml.etd1"',()=>new NF);ce('application/mp4; codecs="stpp.ttml.etd1|im1t"',()=>new NF);ce('application/mp4; codecs="stpp.ttml.im1t|etd1"',()=>new NF);ce('application/mp4; codecs="stpp.TTML.im1t"',()=>new NF);function OF(a,b,c){let d;if(d=PF.exec(b))b=d[1],b=="middle"?a.textAlign=sd:a.textAlign=Fd[b.toUpperCase()];else if(d=QF.exec(b))a.writingMode=d[1]=="lr"?"vertical-lr":"vertical-rl";else if(d=RF.exec(b))a.size=Number(d[1]);else if(d=SF.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b=="line-left"||b=="start"?"line-left":b=="line-right"||b=="end"?"line-right":b=="center"||b=="middle"?"center":xd);else if(d=TF.exec(b)){if(b=UF(c,d[1]))a.region=b}else if(c=VF.exec(b))a.lineInterpretation=
1,a.line=Number(c[1]),c[2]&&(a.lineAlign=Hd[c[2].toUpperCase()]);else if(c=WF.exec(b))a.lineInterpretation=Ad,a.line=Number(c[1]),c[2]&&(a.lineAlign=Hd[c[2].toUpperCase()])}function UF(a,b){a=a.filter(c=>c.id==b);return a.length?a[0]:null}
var YF=class{constructor(){this.g="UNKNOWN"}parseInit(){}setManifestType(a){this.g=a}parseMedia(a,b){a=ub(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new H(2,2,2E3);a=b.vttOffset;if(this.g=="HLS"&&c[0].includes("X-TIMESTAMP-MAP")){var d=c[0];a=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!a||!d)throw new H(2,2,2E3);a=sc(a[1]);if(a==null)throw new H(2,2,2E3);d=Number(d[1]);if(b.isMpegTs)for(var e=
b.segmentStart-b.periodStart;e>=95443.7176888889;)e-=95443.7176888889,d+=8589934592;a=b.periodStart+d/9E4-a}b=[];for(var f of c[0].split("\n"))if(/^Region:/.test(f)){e=new uc(f);var g=new rc;xc(e);yc(e);for(var h=xc(e);h;){var k=void 0;d=g;(k=/^id=(.*)$/.exec(h))?d.id=k[1]:(k=/^width=(\d{1,2}|100)%$/.exec(h))?d.width=Number(k[1]):(k=/^lines=(\d+)$/.exec(h))?(d.height=Number(k[1]),d.heightUnits=2):(k=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(h))?(d.regionAnchorX=Number(k[1]),d.regionAnchorY=
Number(k[2])):(k=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(h))?(d.viewportAnchorX=Number(k[1]),d.viewportAnchorY=Number(k[2])):/^scroll=up$/.exec(h)&&(d.scroll="up");yc(e);h=xc(e)}b.push(g)}f=new Map;md(f);d=[];for(const p of c.slice(1)){c=p.split("\n");if((c.length!=1||c[0])&&!XF.test(c[0])&&c[0]=="STYLE"){e=[];g=-1;for(h=1;h<c.length;h++)c[h].includes("::cue")&&(e.push([]),g=e.length-1),g!=-1&&(e[g].push(c[h]),c[h].includes("}")&&(g=-1));for(const q of e){e="global";(g=q[0].match(/\((.*)\)/))&&
(e=g.pop());g=q.slice(1,-1);q[0].includes("}")&&(h=/\{(.*?)\}/.exec(q[0]))&&(g=h[1].split(";"));(h=f.get(e))||(h=new jd(0,0,""));k=!1;for(var l=0;l<g.length;l++){var m=/^\s*([^:]+):\s*(.*)/.exec(g[l]);if(m){var n=m[2].trim().replace(";","");switch(m[1].trim()){case "background-color":case "background":k=!0;h.backgroundColor=n;break;case "color":k=!0;h.color=n;break;case "font-family":k=!0;h.fontFamily=n;break;case "font-size":k=!0;h.fontSize=n;break;case "font-weight":if(parseInt(n,10)>=700||n=="bold")k=
!0,h.fontWeight=ud;break;case "font-style":switch(n){case "normal":k=!0;h.fontStyle=Ed;break;case "italic":k=!0;h.fontStyle=vd;break;case "oblique":k=!0,h.fontStyle="oblique"}break;case "opacity":k=!0;h.opacity=parseFloat(n);break;case "text-combine-upright":k=!0;h.textCombineUpright=n;break;case "text-shadow":k=!0;h.textShadow=n;break;case "white-space":k=!0,h.wrapLine=n!="noWrap"}}}k&&f.set(e,h)}}a:{k=c;m=a;if(k.length==1&&!k[0]||XF.test(k[0])||k[0]=="STYLE"||k[0]=="REGION"){c=null;break a}c=null;
l=0;k[0].includes("--\x3e")||(c=k[0],l=1);e=new uc(k[l]);g=tc(e);n=vc(e,/[ \t]+--\x3e[ \t]+/g);h=tc(e);if(g==null||n==null||h==null){ma("Failed to parse VTT time code. Cue skipped:",c,k);c=null;break a}g+=m;h+=m;g<0&&(g=0);m="";for(n=l+1;n<k.length;n++)n>l+1&&(m+="\n"),m+=k[n];m=m.trim();f.has("global")?(k=f.get("global").clone(),k.startTime=g,k.endTime=h,k.payload=m):k=new jd(g,h,m);yc(e);for(g=xc(e);g;)OF(k,g,b),yc(e),g=xc(e);ld(k,f);c!=null&&(k.id=c);c=k}c&&d.push(c)}return d}};
w("shaka.text.VttTextParser",YF);YF.prototype.parseMedia=YF.prototype.parseMedia;YF.prototype.setManifestType=YF.prototype.setManifestType;YF.prototype.parseInit=YF.prototype.parseInit;var XF=/^NOTE($|[ \t])/,PF=/^align:(start|middle|center|end|left|right)$/,QF=/^vertical:(lr|rl)$/,RF=/^size:([\d.]+)%$/,SF=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/,TF=/^region:(.*)$/,VF=/^line:([\d.]+)%(?:,(start|end|center))?$/,WF=/^line:(-?\d+)(?:,(start|end|center))?$/;
ce("text/vtt",()=>new YF);ce('text/vtt; codecs="vtt"',()=>new YF);ce('text/vtt; codecs="wvtt"',()=>new YF);function ZF(a,b,c){let d,e,f;(new Dg).box("payl",Ag(g=>{d=ub(g)},!1)).box("iden",Ag(g=>{e=ub(g)},!1)).box("sttg",Ag(g=>{f=ub(g)},!1)).parse(a);return d?$F(d,e,f,b,c):null}function $F(a,b,c,d,e){a=new jd(d,e,a);ld(a);b&&(a.id=b);if(c)for(b=new uc(c),c=xc(b);c;)OF(a,c,[]),yc(b),c=xc(b);return a}
var aG=class{constructor(){this.g=null}parseInit(a){let b=!1;(new Dg).Ga(["moov","trak","mdia","minf","stbl"],vg).$("mdhd",c=>{this.g=Mh(c.reader,c.version).timescale}).$("stsd",xg).box("wvtt",()=>{b=!0}).parse(a);if(!this.g)throw new H(2,2,2008);if(!b)throw new H(2,2,2008);}setManifestType(){}parseMedia(a,b){if(!a.length)return[];if(!this.g)throw new H(2,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new Dg).Ga(["moof","traf"],vg).$("tfdt",p=>{g=!0;c=Lh(p.reader,p.version).Fa}).$("tfhd",
p=>{l=Kh(p.reader,p.flags).qc}).$("trun",p=>{h=!0;d=Nh(p.reader,p.version,p.flags).Id}).box("mdat",Ag(p=>{k=!0;e=p},!1)).parse(a,!1);if(!k&&!g&&!h)throw new H(2,2,2008);a=c;const m=new sg(e,0);for(const p of d){const q=p.Jd||l,r=p.Ne?c+p.Ne:a;a=r+(q||0);let t=0;do{var n=m.U();t+=n;const u=m.U();let v=null;ug(u)=="vttc"?n>8&&(v=m.cb(n-8,!1)):m.skip(n-8);q&&v&&(n=ZF(v,b.periodStart+r/this.g,b.periodStart+a/this.g),f.push(n))}while(p.sampleSize&&t<p.sampleSize)}return f.filter(ue)}};
w("shaka.text.Mp4VttParser",aG);aG.prototype.parseMedia=aG.prototype.parseMedia;aG.prototype.setManifestType=aG.prototype.setManifestType;aG.prototype.parseInit=aG.prototype.parseInit;ce('application/mp4; codecs="wvtt"',()=>new aG);function bG(a){var b=a.split("\n").map(f=>f.trim()).filter(Boolean);if(b.length<2)return"";/^\d+$/.test(b[0])&&b.shift();if(b.length<2)return"";var c=b[0].match(/^([\d:,]+)\s*--\x3e\s*([\d:,]+)(.*)?$/);if(!c)return"";a=cG(c[1]);c=cG(c[2]);let d="";b=b.slice(1).join("\n");var e=b.match(/{\\an(\d)}/);if(e){const f={1:"line:-1 align:left",2:"line:-1 align:center",3:"line:-1 align:right",7:"line:0 align:left",8:"line:0 align:center",9:"line:0 align:right"};d+=f[e[1]]?` ${f[e[1]]}`:""}(e=b.match(/{\\pos\((\d+),(\d+)\)}/))&&
(d+=` position:${Math.min(100,Math.round(parseFloat(e[1])/19.2))}% line:${Math.min(100,Math.round(parseFloat(e[2])/10.8))}%`);b=b.replace(/{\\.*?}/g,"");b=b.replace(/{b}/gi,"<b>").replace(/{\/b}/gi,"</b>").replace(/{i}/gi,"<i>").replace(/{\/i}/gi,"</i>").replace(/{u}/gi,"<u>").replace(/{\/u}/gi,"</u>");b=dG(b);return`${a} --> ${c}${d}\n${b}\n\n`}function cG(a){return/^\d{2}:\d{2},\d{3}$/.test(a)?"00:"+a.replace(",","."):a.replace(",",".")}
function dG(a){const b=[];a=a.replace(/<font color=["']?([^"'>]+)["']?>/gi,(c,d)=>(c=so(d.toLowerCase()))?(b.push(c),`<c.${c}>`):"");return a=a.replace(/<\/font>/gi,()=>b.length?(b.pop(),"</c>"):"")}var eG=class{constructor(){this.g=new YF}parseInit(){}setManifestType(){}parseMedia(a,b,c){var d=ub(a);a="WEBVTT\n\n";if(d!=""){d=d.replace(/\r+/g,"");d=d.trim();d=d.split("\n\n");for(e of d)a+=bG(e)}var e=a;e=G(yb(e));return this.g.parseMedia(e,b,c,[])}};w("shaka.text.SrtTextParser",eG);
eG.prototype.parseMedia=eG.prototype.parseMedia;eG.prototype.setManifestType=eG.prototype.setManifestType;eG.prototype.parseInit=eG.prototype.parseInit;ce("text/srt",()=>new eG);function fG(a,b){const c=a[b+1]&1?7:9;return b+c<=a.length&&(a=((a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5)-c,a>0)?{zd:c,ka:a}:null}function gG(a,b){const c=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050,16E3,12E3,11025,8E3,7350],d=(a[b+2]&60)>>>2;if(d>c.length-1)return null;const e=((a[b+2]&192)>>>6)+1;let f=(a[b+2]&1)<<2;f|=(a[b+3]&192)>>>6;return{sampleRate:c[d],channelCount:f,codec:"mp4a.40."+e}}
function hG(a,b){if(b+1<a.length&&a[b]===255&&(a[b+1]&246)===240){const c=a[b+1]&1?7:9;if(b+c>=a.length)return!1;const d=(a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5;if(d<=c)return!1;b+=d;return b===a.length||b+1<a.length&&a[b]===255&&(a[b+1]&246)===240}return!1}
function iG(a,b){switch(a){case "mp4a.40.2":if(b===1)return new Uint8Array([0,200,0,128,35,128]);if(b===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(b===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(b===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(b===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(b===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,
2,0,178,0,32,8,224]);break;default:if(b===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(b===2||b===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null};var jG=Object.freeze({Mf:0,we:0,se:0,ke:0,le:2,Nf:0}),kG=Object.freeze({Mf:0,we:0,se:0,ke:0,le:2,Nf:0}),lG=Object.freeze({Mf:0,we:0,se:0,ke:0,le:1,Nf:1});var mG=class{constructor(a){this.j=a;this.g=0;this.h=new Map;this.i=null}destroy(){this.h.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/aac"?Hh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/aac"?`audio/mp4; codecs="${$d(b)||"mp4a.40.2"}"`:b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){var e=G(a),f=oj(e);let g=f.length;for(;g<e.length&&!hG(e,g);g++);a=c.endTime*1E3;f=nj(f);f.length&&c&&(f=f.find(l=>l.description==="com.apple.streaming.transportStreamTimestamp"))&&
(a=f.data);f=gG(e,g);if(!f)return Promise.reject(new H(2,3,3018,c?c.R()[0]:null));b.audioSamplingRate=f.sampleRate;b.channelsCount=f.channelCount;const h=[];for(;g<e.length;){const l=fG(e,g);if(!l)return Promise.reject(new H(2,3,3018,c?c.R()[0]:null));const m=l.zd+l.ka;g+m<=e.length&&h.push({data:e.subarray(g+l.zd,g+m),size:l.ka,duration:1024,ib:0,flags:jG});g+=m}e=f.sampleRate;a=Math.floor(a*e/1E3);d={id:b.id,type:"audio",codecs:f.codec,timescale:e,duration:d,Ua:new Uint8Array([]),data:{sequenceNumber:this.g,
Fa:a,Ya:h},stream:b};const k=new Fi([d]);b=this.h.getOrInsertComputed(b.id+"_"+c.i,()=>Zh(k));c=this.i!==b;d=Ci(k);this.i=b;this.g++;return Promise.resolve({data:d,init:c?b:null})}};w("shaka.transmuxer.AacTransmuxer",mG);mG.prototype.transmux=mG.prototype.transmux;mG.prototype.getOriginalMimeType=mG.prototype.getOriginalMimeType;mG.prototype.convertCodecs=mG.prototype.convertCodecs;mG.prototype.isSupported=mG.prototype.isSupported;mG.prototype.destroy=mG.prototype.destroy;
Jd("audio/aac",()=>new mG("audio/aac"),Pd);function nG(a,b,c){if(b+8>a.length||a[b]!==11||a[b+1]!==119)return!1;const d=a[b+4]>>6;if(d>=3)return!1;const e=a[b+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,
1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][e*3+d]*2;if(b+f>a.length)return!1;const g=a[b+6]>>5;var h=0;g===2?h+=2:(g&1&&g!==1&&(h+=2),g&4&&(h+=2));h=(a[b+6]<<8|a[b+7])>>12-h&1;const k=a[b+5]&7;a=new Uint8Array([d<<6|a[b+5]>>3<<1|k>>2,(k&3)<<6|g<<3|h<<2|e>>4,e<<4&224]);c.sampleRate=[48E3,44100,32E3][d];c.channelCount=[2,1,2,3,3,4,4,5][g]+h;c.$b=a;c.ka=f;return!0}
function oG(a,b){if(a[b]===11&&a[b+1]===119){let d=0,e=5;b+=e;let f;for(;e>0;){f=a[b];const g=Math.min(e,8),h=8-g;var c=4278190080>>>24+h<<h;c=(f&c)>>h;d=d?d<<g|c:c;b+=1;e-=g}if(d<16)return!0}return!1};var pG=class{constructor(a){this.j=a;this.g=0;this.h=new Map;this.i=null}destroy(){this.h.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/ac3"?Hh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/ac3"?A().I()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){a=G(a);var e=oj(a);let f=e.length;for(;f<a.length&&!oG(a,f);f++);let g=c.endTime*1E3;e=nj(e);e.length&&c&&(e=e.find(n=>
n.description==="com.apple.streaming.transportStreamTimestamp"))&&(g=e.data);e=0;let h=new Uint8Array([]);const k=[],l={sampleRate:0,channelCount:0,$b:new Uint8Array(0),ka:0};for(;f<a.length;){if(!nG(a,f,l))return Promise.reject(new H(2,3,3018,c?c.R()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.$b;k.push({data:a.subarray(f,f+l.ka),size:l.ka,duration:1536,ib:0,flags:jG});f+=l.ka}const m=new Fi([{id:b.id,type:"audio",codecs:"ac-3",timescale:e,duration:d,
Ua:h,data:{sequenceNumber:this.g,Fa:Math.floor(g*e/1E3),Ya:k},stream:b}]);b=this.h.getOrInsertComputed(b.id+"_"+c.i,()=>Zh(m));c=this.i!==b;d=Ci(m);this.i=b;this.g++;return Promise.resolve({data:d,init:c?b:null})}};w("shaka.transmuxer.Ac3Transmuxer",pG);pG.prototype.transmux=pG.prototype.transmux;pG.prototype.getOriginalMimeType=pG.prototype.getOriginalMimeType;pG.prototype.convertCodecs=pG.prototype.convertCodecs;pG.prototype.isSupported=pG.prototype.isSupported;pG.prototype.destroy=pG.prototype.destroy;
Jd("audio/ac3",()=>new pG("audio/ac3"),Pd);function qG(a,b,c){if(b+8>a.length||(a[b]<<8|a[b+1]<<0)!==2935)return!1;var d=new Bj(a.subarray(b+2));tj(d,2);tj(d,3);const e=uj(d,11)+1<<1;var f=uj(d,2);let g;f==3?(f=uj(d,2),f=[24E3,22060,16E3][f],g=3):(f=[48E3,44100,32E3][f],g=uj(d,2));const h=uj(d,3),k=uj(d,1);d=uj(d,5);if(b+e>a.byteLength)return!1;a=Math.floor(e*f/([1,2,3,6][g]*16));a=new Uint8Array([(a&8160)>>5,(a&31)<<3,f<<6|d<<1|0,0|h<<1|k<<0,0]);c.sampleRate=f;c.channelCount=[2,1,2,3,3,4,4,5][h]+k;c.$b=a;c.ka=e;return!0};var rG=class{constructor(a){this.j=a;this.g=0;this.h=new Map;this.i=null}destroy(){this.h.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/ec3"?Hh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/ec3"?'audio/mp4; codecs="ec-3"':b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){a=G(a);var e=oj(a);let f=e.length;for(;f<a.length&&(a[f]<<8|a[f+1]<<0)!==2935;f++);let g=c.endTime*1E3;e=nj(e);e.length&&c&&(e=e.find(n=>n.description===
"com.apple.streaming.transportStreamTimestamp"))&&(g=e.data);e=0;let h=new Uint8Array([]);const k=[],l={sampleRate:0,channelCount:0,$b:new Uint8Array(0),ka:0};for(;f<a.length;){if(!qG(a,f,l))return Promise.reject(new H(2,3,3018,c?c.R()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.$b;k.push({data:a.subarray(f,f+l.ka),size:l.ka,duration:1536,ib:0,flags:jG});f+=l.ka}const m=new Fi([{id:b.id,type:"audio",codecs:"ec-3",timescale:e,duration:d,Ua:h,data:{sequenceNumber:this.g,
Fa:Math.floor(g*e/1E3),Ya:k},stream:b}]);b=this.h.getOrInsertComputed(b.id+"_"+c.i,()=>Zh(m));c=this.i!==b;d=Ci(m);this.i=b;this.g++;return Promise.resolve({data:d,init:c?b:null})}};w("shaka.transmuxer.Ec3Transmuxer",rG);rG.prototype.transmux=rG.prototype.transmux;rG.prototype.getOriginalMimeType=rG.prototype.getOriginalMimeType;rG.prototype.convertCodecs=rG.prototype.convertCodecs;rG.prototype.isSupported=rG.prototype.isSupported;rG.prototype.destroy=rG.prototype.destroy;
Jd("audio/ec3",()=>new rG("audio/ec3"),Pd);function sG(a){if(!a.length)return null;var b=a.find(p=>p.type==7);a=a.find(p=>p.type==8);if(!b||!a)return null;var c=new Bj(b.data),d=yj(c);yj(c);yj(c);wj(c);if(tG.includes(d)&&(d=R(c),d===3&&tj(c,1),wj(c),wj(c),tj(c,1),T(c))){d=d!==3?8:12;for(var e=0;e<d;e++)T(c)&&(e<6?zj(c,16):zj(c,64))}wj(c);d=R(c);if(d===0)R(c);else if(d===1)for(tj(c,1),wj(c),wj(c),d=R(c),e=0;e<d;e++)wj(c);wj(c);tj(c,1);var f=R(c),g=R(c),h=uj(c,1);h===0&&tj(c,1);tj(c,1);var k=0,l=0;let m=0,n=0;T(c)&&(k=R(c),l=R(c),m=R(c),n=R(c));
e=d=1;if(T(c)&&T(c)){const p=yj(c),q=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],r=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];p>0&&p<=16?(d=q[p-1],e=r[p-1]):p===255&&(d=uj(c,16),e=uj(c,16))}c=(2-h)*(g+1)*16-m*2-n*2;f=(f+1)*16-k*2-l*2;b=b.fullData;k=b.byteLength;a=a.fullData;l=a.byteLength;g=0;h=new Uint8Array(11+k+l);h[g++]=1;h[g++]=b[1];h[g++]=b[2];h[g++]=b[3];h[g++]=255;h[g++]=225;h[g++]=k>>>8&255;h[g++]=k&255;h.set(b,g);g+=k;h[g++]=1;h[g++]=l>>>8&255;h[g++]=l&255;h.set(a,g);return{height:c,
width:f,sg:h,Ec:d,Mc:e}}
function uG(a){const b=[];let c=null,d=!1;const e=()=>{if(c&&c.nalus.length&&c.frame){var l=c.nalus.length*4;for(var m of c.nalus)l+=m.fullData.byteLength;l=new Uint8Array(l);m=0;for(const n of c.nalus){const p=n.fullData.byteLength;l[m]=p>>24&255;l[m+1]=p>>16&255;l[m+2]=p>>8&255;l[m+3]=p&255;l.set(n.fullData,m+4);m+=4+p}c.data=l;b.push(c)}},f=new Uint8Array(0),g=l=>{c={data:f,frame:!1,isKeyframe:!1,pts:l.pts,dts:l.dts,nalus:[]}};for(let l=0;l<a.length;l++){const m=a[l];var h=m.nalus;let n=!1;c&&
h.length&&!d&&(e(),g(m));for(const p of m.nalus){h=!1;switch(p.type){case 1:let q=!1;h=!0;var k=p.data;n&&k.length>4&&(k=Aj(new Bj(k)),k===2||k===4||k===7||k===9)&&(q=!0);q&&c&&c.frame&&!c.isKeyframe&&(e(),c=null);c||g(m);c.frame=!0;c.isKeyframe=q;break;case 5:h=!0;c&&c.frame&&!c.isKeyframe&&(e(),c=null);c||g(m);c.frame=!0;c.isKeyframe=!0;break;case 6:h=!0;break;case 7:n=h=!0;break;case 8:h=!0;break;case 9:d=h=!0;c&&c.frame&&(e(),c=null);c||g(m);break;case 12:h=!0;break;default:h=!1}c&&h&&c.nalus.push(p)}}e();
return b}var tG=[100,110,122,244,44,83,86,118,128,138,139,134];function vG(a){if(!a.length)return null;var b=a.find(g=>g.type==32);const c=a.find(g=>g.type==33),d=a.find(g=>g.type==34);if(!b||!c||!d)return null;const e=wG(b.fullData);a=xG(c.fullData);const f=yG(d.fullData);b=zG(b.fullData,c.fullData,d.fullData,{Rf:e.Rf,ng:e.ng,Ef:a.Ef,Ff:a.Ff,yf:a.yf,Df:a.Df,zf:a.zf,Af:a.Af,Bf:a.Bf,Cf:a.Cf,rf:a.rf,tf:a.tf,uf:a.uf,vf:a.vf,wf:a.wf,xf:a.xf,De:a.De,hf:a.hf,gf:a.gf,ef:a.ef,Tf:f.Tf,qf:a.qf,pf:a.pf});return{height:a.height,width:a.width,sg:b,Ec:a.dj,Mc:a.cj}}
function wG(a){var b=new Bj(a,!0);yj(b);yj(b);uj(b,4);uj(b,2);uj(b,6);a=uj(b,3);b=T(b);return{Rf:a+1,ng:b}}
function xG(a){a=new Bj(a,!0);yj(a);yj(a);let b=0,c=0,d=0,e=0;uj(a,4);const f=uj(a,3);T(a);const g=uj(a,2),h=uj(a,1),k=uj(a,5),l=yj(a),m=yj(a),n=yj(a),p=yj(a),q=yj(a),r=yj(a),t=yj(a),u=yj(a),v=yj(a),x=yj(a),y=yj(a);var D=[],z=[];for(var B=0;B<f;B++)D.push(T(a)),z.push(T(a));if(f>0)for(B=f;B<8;B++)uj(a,2);for(B=0;B<f;B++)D[B]&&uj(a,88),z[B]&&yj(a);R(a);D=R(a);D==3&&uj(a,1);z=R(a);B=R(a);T(a)&&(b+=R(a),c+=R(a),d+=R(a),e+=R(a));const E=R(a),J=R(a);var X=R(a);if(T(a))for(var L=0;L<=f;L++)R(a),R(a),R(a);
else R(a),R(a),R(a);R(a);R(a);R(a);R(a);R(a);R(a);if(T(a)&&T(a))for(L=0;L<4;L++)for(var W=0;W<(L===3?2:6);W++)if(T(a)){var F=Math.min(64,1<<4+(L<<1));L>1&&xj(a);for(var I=0;I<F;I++)xj(a)}else R(a);T(a);T(a);T(a)&&(yj(a),R(a),R(a),T(a));L=R(a);W=0;for(F=0;F<L;F++)if(I=!1,F!==0&&(I=T(a)),I){F===L&&R(a);T(a);R(a);I=0;for(var O=0;O<=W;O++){var M=T(a),ba=!1;M||(ba=T(a));(M||ba)&&I++}W=I}else{O=R(a);I=R(a);W=O+I;for(M=0;M<O;M++)R(a),T(a);for(O=0;O<I;O++)R(a),T(a)}if(T(a))for(L=R(a),W=0;W<L;W++){for(F=0;F<
X+4;F++)uj(a,1);uj(a,1)}L=X=1;W=!0;F=1;O=I=0;T(a);T(a);if(T(a)){if(T(a)){M=yj(a);ba=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2];var ta=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];M>0&&M<=16?(X=ba[M-1],L=ta[M-1]):M===255&&(X=uj(a,16),L=uj(a,16))}T(a)&&T(a);T(a)&&(uj(a,3),T(a),T(a)&&(yj(a),yj(a),yj(a)));T(a)&&(R(a),R(a));T(a);T(a);T(a);if(M=T(a))wj(a),wj(a),wj(a),wj(a);if(T(a)&&(F=uj(a,32),I=uj(a,32),T(a)&&R(a),T(a))){ta=!1;M=T(a);ba=T(a);if(M||ba){if(ta=T(a))yj(a),uj(a,5),T(a),uj(a,5);uj(a,4);
uj(a,4);ta&&uj(a,4);uj(a,5);uj(a,5);uj(a,5)}for(let S=0;S<=f;S++){W=T(a);var C=!0;let V=1;W||(C=T(a));let wa=!1;C?R(a):wa=T(a);wa||(V=R(a)+1);if(M){for(C=0;C<V;C++)R(a),R(a),ta&&(R(a),R(a));T(a)}if(ba){for(C=0;C<V;C++)R(a),R(a),ta&&(R(a),R(a));T(a)}}}T(a)&&(T(a),T(a),T(a),O=R(a),R(a),R(a),R(a),R(a))}return{yf:y,Ef:g,Ff:h,Df:k,zf:l,Af:m,Bf:n,Cf:p,rf:q,tf:r,uf:t,vf:u,wf:v,xf:x,De:O,hf:D,gf:E,ef:J,width:z-(b+c)*(D===1||D===2?2:1),height:B-(d+e)*(D===1?2:1),dj:X,cj:L,qf:I/F,pf:W}}
function yG(a){var b=new Bj(a,!0);yj(b);yj(b);R(b);R(b);T(b);T(b);uj(b,3);T(b);T(b);R(b);R(b);xj(b);T(b);T(b);T(b)&&R(b);xj(b);xj(b);T(b);T(b);T(b);T(b);a=T(b);b=T(b);let c=1;b&&a?c=0:b?c=3:a&&(c=2);return{Tf:c}}
function zG(a,b,c,d){const e=new Uint8Array(23+(5+a.byteLength)+(5+b.byteLength)+(5+c.byteLength));e[0]=1;e[1]=(d.Ef&3)<<6|(d.Ff?1:0)<<5|d.Df&31;e[2]=d.zf;e[3]=d.Af;e[4]=d.Bf;e[5]=d.Cf;e[6]=d.rf;e[7]=d.tf;e[8]=d.uf;e[9]=d.vf;e[10]=d.wf;e[11]=d.xf;e[12]=d.yf;e[13]=240|(d.De&3840)>>8;e[14]=d.De&255;e[15]=252|d.Tf&3;e[16]=252|d.hf&3;e[17]=248|d.gf&7;e[18]=248|d.ef&7;e[19]=0;e[20]=parseInt(d.qf,10);e[21]=((d.pf?1:0)&3)<<6|(d.Rf&7)<<3|(d.ng?1:0)<<2|3;e[22]=3;a=[a,b,c];b=23;c=a.length-1;for(d=0;d<a.length;d+=
1)e.set(new Uint8Array([32+d|(d===c?128:0),0,1,a[d].byteLength>>8,a[d].byteLength&255]),b),b+=5,e.set(a[d],b),b+=a[d].byteLength;return e};function AG(a,b){var c=a[b+1]>>3&3;const d=a[b+1]>>1&3;var e=a[b+2]>>4&15,f=a[b+2]>>2&3;if(c!==1&&e!==0&&e!==15&&f!==3){const h=a[b+3]>>6;e=BG[(c===3?3-d:d===3?3:4)*14+e-1]*1E3;f=CG[(c===3?0:c===2?1:2)*3+f];c=DG[c][d];const k=EG[d],l=Math.floor(c*e/f+(a[b+2]>>1&1))*k;var g=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);(g=g?parseInt(g[1],10):0)&&g<=87&&d===2&&e>=224E3&&h===0&&(a[b+3]|=128);return{sampleRate:f,channelCount:h===3?1:2,ka:l,bj:c*8*k}}return null}
function FG(a,b){return a[b]===255&&(a[b+1]&224)===224&&(a[b+1]&6)!==0}function GG(a,b){if(b+1<a.length&&FG(a,b)){const c=AG(a,b);let d=4;c&&c.ka&&(d=c.ka);b+=d;return b===a.length||b+1<a.length&&FG(a,b)}return!1}
var BG=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],CG=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],DG=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],EG=[0,1,1,4];var HG=class{constructor(a){this.j=a;this.g=0;this.h=new Map;this.i=null}destroy(){this.h.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/mpeg"?Hh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/mpeg"?'audio/mp4; codecs="mp3"':b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){var e=G(a);let f=oj(e).length;for(;f<e.length&&!GG(e,f);f++);let g;for(a=[];f<e.length;){const k=AG(e,f);if(!k)return Promise.reject(new H(2,3,3018,
c?c.R()[0]:null));g||=k;f+k.ka<=e.length&&a.push({data:e.subarray(f,f+k.ka),size:k.ka,duration:1152,ib:0,flags:jG});f+=k.ka}if(!g)return Promise.reject(new H(2,3,3018,c?c.R()[0]:null));e=g.bj*9E4/g.sampleRate*this.g;d={id:b.id,type:"audio",codecs:"mp3",timescale:g.sampleRate,duration:d,Ua:new Uint8Array([]),data:{sequenceNumber:this.g,Fa:e,Ya:a},stream:b};const h=new Fi([d]);b=this.h.getOrInsertComputed(b.id+"_"+c.i,()=>Zh(h));c=this.i!==b;d=Ci(h);this.i=b;this.g++;return Promise.resolve({data:d,
init:c?b:null})}};w("shaka.transmuxer.Mp3Transmuxer",HG);HG.prototype.transmux=HG.prototype.transmux;HG.prototype.getOriginalMimeType=HG.prototype.getOriginalMimeType;HG.prototype.convertCodecs=HG.prototype.convertCodecs;HG.prototype.isSupported=HG.prototype.isSupported;HG.prototype.destroy=HG.prototype.destroy;Jd("audio/mpeg",()=>new HG("audio/mpeg"),Pd);var IG=class{constructor(a){this.h=a;this.g=null}destroy(){}isSupported(a){if(a.toLowerCase().split(";")[0]!="video/mp2t")return!1;var b=$d(a).split(",");const c=Ob("audio",b);b=Ob("video",b);return!c||b||Wd(c)!="mp3"?!1:Hh(this.convertCodecs("audio",a))}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="video/mp2t"?"audio/mpeg":b}getOriginalMimeType(){return this.h}transmux(a,b,c,d,e){this.g?this.g.clearData():this.g=new Lj;this.g.Pe(c.i);a=G(a);a=this.g.parse(a);if(a.ud().audio!="mp3"||e!=
"audio")return Promise.reject(new H(2,3,3018,c?c.R()[0]:null));c=new Uint8Array([]);for(const f of a.kb()){e=f.data;if(!e)continue;for(a=0;a<e.length;)(b=AG(e,a))?(a+b.ka<=e.length&&(c=Hb(c,e.subarray(a,a+b.ka))),a+=b.ka):a++}return Promise.resolve(c)}};w("shaka.transmuxer.MpegTsTransmuxer",IG);IG.prototype.transmux=IG.prototype.transmux;IG.prototype.getOriginalMimeType=IG.prototype.getOriginalMimeType;IG.prototype.convertCodecs=IG.prototype.convertCodecs;IG.prototype.isSupported=IG.prototype.isSupported;
IG.prototype.destroy=IG.prototype.destroy;Jd("video/mp2t",()=>new IG("video/mp2t"),Od);function JG(a){if(a.length<1)return 960;var b=a[0];const c=b&3;b=KG[b>>3&31];if(c===0)a=1;else if(c===1||c===2)a=2;else{if(a.length<2)return b;a=a[1]&63;if(a===0)return b}return b*a}var KG=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960];function LG(a,b,c,d,e){const f=[];let g=null;b=b.Xc();var h=uG(b);if(!h.length)throw new H(2,3,3023,e?e.R()[0]:null);for(let l=0;l<h.length;l++){const m=h[l];g==null&&(g=m.dts);f.push({data:m.data,size:m.data.byteLength,duration:l+1<h.length?(h[l+1].dts||0)-(m.dts||0):h.length>1?(m.dts||0)-(h[l-1].dts||0):(e.endTime-e.startTime)*9E4,ib:Math.round((m.pts||0)-(m.dts||0)),flags:m.isKeyframe?kG:lG})}h=[];for(var k of b)h.push(...k.nalus);k=sG(h);if(!k||g==null)throw new H(2,3,3018,e?e.R()[0]:null);c.height=
c.height||k.height;c.width=c.width||k.width;return{id:c.id,type:"video",codecs:"avc1",timescale:9E4,duration:d,Ua:k.sg,Ec:k.Ec,Mc:k.Mc,data:{sequenceNumber:a.g,Fa:g,Ya:f},stream:c}}
function MG(a,b,c,d,e){const f=[];let g=null;var h=[];b=b.Xc();var k=new Uint8Array(0),l=!1;if(!b.length)throw new H(2,3,3023,e?e.R()[0]:null);for(let q=0;q<b.length;q++){const r=b[q];var m=r.nalus;h.push(...m);a:{var n=!1;var p=[];let t=0,u=!1;for(const v of m){switch(v.type){case 1:case 0:m=u=!0;break;case 19:case 20:case 21:n=m=u=!0;break;case 32:case 33:case 34:m=!0;break;case 35:u=m=!0;break;case 39:case 40:m=!0;break;default:m=!1}u&&m&&(p.push(v.fullData),t+=v.fullData.byteLength)}if(!p.length){n=
!1;break a}t+=4*p.length;k=new Uint8Array(t);l=0;for(const v of p)p=v.byteLength,k[l]=p>>24&255,k[l+1]=p>>16&255,k[l+2]=p>>8&255,k[l+3]=p&255,k.set(v,l+4),l+=p+4;l=n;n=!0}n&&(g==null&&r.dts!=null&&(g=r.dts),f.push({data:k,size:k.byteLength,duration:q+1<b.length?(b[q+1].dts||0)-(r.dts||0):b.length>1?(r.dts||0)-(b[q-1].dts||0):(e.endTime-e.startTime)*9E4,ib:Math.round((r.pts||0)-(r.dts||0)),flags:l?kG:lG}))}h=vG(h);if(!h||g==null)throw new H(2,3,3018,e?e.R()[0]:null);c.height=c.height||h.height;c.width=
c.width||h.width;return{id:c.id,type:"video",codecs:"hvc1",timescale:9E4,duration:d,Ua:h.sg,Ec:h.Ec,Mc:h.Mc,data:{sequenceNumber:a.g,Fa:g,Ya:f},stream:c}}
function NG(a,b,c,d,e){const f=[];var g=null,h=null;let k=null;for(var l of b.kb()){b=l.data;if(!b)continue;let n=0;if(h==-1&&k)b=Hb(k,l.data),h=null;else if(h!=null&&k){n=Math.max(0,h);var m=Hb(k,b.subarray(0,n));f.push({data:m,size:m.byteLength,duration:1024,ib:0,flags:jG});h=k=null}m=gG(b,n);if(!m)throw new H(2,3,3018,e?e.R()[0]:null);c.audioSamplingRate=m.sampleRate;c.channelsCount=m.channelCount;g==null&&l.pts!==null&&(g=l.pts);for(;n<b.length;){const p=fG(b,n);if(!p){k=b.subarray(n,b.length);
h=-1;break}const q=p.zd+p.ka;h=Math.max(0,n+q-b.length);h!=0?k=b.subarray(n+p.zd,n+q):n+q<=b.length&&f.push({data:b.subarray(n+p.zd,n+q),size:p.ka,duration:1024,ib:0,flags:jG});n+=q}}if(!m||g==null){g=e.startTime*9E4;l=Ob("audio",c.codecs.split(","));if(!l||!c.channelsCount||!c.audioSamplingRate)throw new H(2,3,3018,e?e.R()[0]:null);m={sampleRate:c.audioSamplingRate,channelCount:c.channelsCount,codec:l};l=iG(l,c.channelsCount);if(!l)throw new H(2,3,3018,e?e.R()[0]:null);e=g+(e.endTime-e.startTime)*
9E4;for(h=g;h<e;)f.push({data:l,size:l.byteLength,duration:1024,ib:0,flags:jG}),h+=1024/m.sampleRate*9E4}e=m.sampleRate;g=g/9E4*e;return{id:c.id,type:"audio",codecs:m.codec,timescale:e,duration:d,Ua:new Uint8Array([]),data:{sequenceNumber:a.g,Fa:g,Ya:f},stream:c}}
function OG(a,b,c,d,e){const f=[];let g=0,h=new Uint8Array([]),k=null;const l={sampleRate:0,channelCount:0,$b:new Uint8Array(0),ka:0};for(const m of b.kb()){b=m.data;k==null&&m.pts!==null&&(k=m.pts);let n=0;for(;n<b.length;)nG(b,n,l)?(c.audioSamplingRate=l.sampleRate,c.channelsCount=l.channelCount,g=l.sampleRate,h=l.$b,f.push({data:b.subarray(n,n+l.ka),size:l.ka,duration:1536,ib:0,flags:jG}),n+=l.ka):n++}if(g==0||h.byteLength==0||k==null)throw new H(2,3,3018,e?e.R()[0]:null);return{id:c.id,type:"audio",
codecs:"ac-3",timescale:g,duration:d,Ua:h,data:{sequenceNumber:a.g,Fa:k/9E4*g,Ya:f},stream:c}}
function PG(a,b,c,d,e){const f=[];let g=0,h=new Uint8Array([]),k=null;const l={sampleRate:0,channelCount:0,$b:new Uint8Array(0),ka:0};for(const m of b.kb()){b=m.data;k==null&&m.pts!==null&&(k=m.pts);let n=0;for(;n<b.length;)qG(b,n,l)?(c.audioSamplingRate=l.sampleRate,c.channelsCount=l.channelCount,g=l.sampleRate,h=l.$b,f.push({data:b.subarray(n,n+l.ka),size:l.ka,duration:1536,ib:0,flags:jG}),n+=l.ka):n++}if(g==0||h.byteLength==0||k==null)throw new H(2,3,3018,e?e.R()[0]:null);return{id:c.id,type:"audio",
codecs:"ec-3",timescale:g,duration:d,Ua:h,data:{sequenceNumber:a.g,Fa:k/9E4*g,Ya:f},stream:c}}
function QG(a,b,c,d,e){const f=[];let g;var h=null;for(const k of b.kb()){b=k.data;if(!b)continue;h==null&&k.pts!==null&&(h=k.pts);let l=0;for(;l<b.length;){const m=AG(b,l);m?(g||=m,l+m.ka<=b.length&&f.push({data:b.subarray(l,l+m.ka),size:m.ka,duration:1152,ib:0,flags:jG}),l+=m.ka):l++}}if(!g||h==null)throw new H(2,3,3018,e?e.R()[0]:null);e=g.sampleRate;h=h/9E4*e;return{id:c.id,type:"audio",codecs:"mp3",timescale:e,duration:d,Ua:new Uint8Array([]),data:{sequenceNumber:a.g,Fa:h,Ya:f},stream:c}}
function RG(a,b,c,d,e){const f=[];let g=null;const h=b.J;if(!h)throw new H(2,3,3018,e?e.R()[0]:null);var k=[];switch(h.Fh){case 1:case 2:k=[0];break;case 0:k=[255,1,1,0,1];break;case 128:k=[255,2,0,0,1];break;case 3:k=[1,2,1,0,2,1];break;case 4:k=[1,2,2,0,1,2,3];break;case 5:k=[1,3,2,0,4,1,2,3];break;case 6:k=[1,4,2,0,4,1,2,3,5];break;case 7:k=[1,4,2,0,4,1,2,3,5,6];break;case 8:k=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:k=[1,1,2,0,1];break;case 131:k=[1,1,3,0,1,2];break;case 132:k=[1,1,4,0,1,2,3];break;
case 133:k=[1,1,5,0,1,2,3,4];break;case 134:k=[1,1,6,0,1,2,3,4,5];break;case 135:k=[1,1,7,0,1,2,3,4,5,6];break;case 136:k=[1,1,8,0,1,2,3,4,5,6,7]}k=new Uint8Array([0,h.channelCount,0,0,h.sampleRate>>>24&255,h.sampleRate>>>17&255,h.sampleRate>>>8&255,h.sampleRate>>>0&255,0,0,...k]);const l=h.sampleRate;for(const p of b.kb()){b=p.data;g==null&&p.pts!==null&&(g=p.pts);for(var m=0;m<b.length;){var n=(b[m+1]&16)!==0;const q=(b[m+1]&8)!==0;m+=2;let r=0;for(;b[m]===255;)r+=255,m+=1;r+=b[m];m+=1;m+=n?2:0;
m+=q?2:0;n=b.slice(m,m+r);f.push({data:n,size:n.byteLength,duration:JG(n),ib:0,flags:jG});m+=r}}if(k.byteLength==0||g==null)throw new H(2,3,3018,e?e.R()[0]:null);c.audioSamplingRate=h.sampleRate;c.channelsCount=h.channelCount;return{id:c.id,type:"audio",codecs:"opus",timescale:l,duration:d,Ua:k,data:{sequenceNumber:a.g,Fa:g/9E4*l,Ya:f},stream:c}}
var UG=class{constructor(a){this.m=a;this.g=0;this.j=new Map;this.l=this.i=this.h=null}destroy(){this.j.clear();this.i&&this.i.destroy()}isSupported(a,b){if(a.toLowerCase().split(";")[0]!="video/mp2t")return!1;var c=a;b&&(c=this.convertCodecs(b,a));var d=$d(c).split(",");c=Ob("audio",d);d=Ob("video",d);if(c&&(c=Wd(c),!SG.includes(c))||d&&(c=Wd(d),!TG.includes(c)))return!1;if(b)return Hh(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Hh(b)||Hh(a)}convertCodecs(a,
b){return b.toLowerCase().split(";")[0]=="video/mp2t"?(b=$d(b).replace("mp4a.40.34","mp3").split(",").map(c=>$e(c,"audio/mp4")).map(af).join(","),a=="audio"?`audio/mp4; codecs="${b}"`:`video/mp4; codecs="${b}"`):b}getOriginalMimeType(){return this.m}transmux(a,b,c,d,e){var f=G(a);if(e=="audio"&&!Dj(f)){for(var g=oj(f),h=g.length;h<f.length;h++)if(GG(f,h))return Promise.reject(new H(2,3,3018,c?c.R()[0]:null));for(h=g.length;h<f.length;h++)if(hG(f,h))return this.i||(this.i=new mG("audio/aac")),this.i.transmux(a,
b,c,d,e);return Promise.reject(new H(2,3,3018,c?c.R()[0]:null))}this.h?this.h.clearData():this.h=new Lj;this.h.Pe(c.i);a=this.h.parse(f);f=[];g=a.ud();try{h=null;if(e=="video"){switch(g.video){case "avc":h=LG(this,a,b,d,c);break;case "hvc":h=MG(this,a,b,d,c)}h&&(f.push(h),h=null)}if(e=="audio"){switch(g.audio){case "aac":h=NG(this,a,b,d,c);break;case "ac3":h=OG(this,a,b,d,c);break;case "ec3":h=PG(this,a,b,d,c);break;case "mp3":h=QG(this,a,b,d,c);break;case "opus":h=RG(this,a,b,d,c)}h&&(f.push(h),
h=null)}}catch(l){return l&&l.code==3023?Promise.resolve(new Uint8Array([])):Promise.reject(l)}if(!f.length)return Promise.reject(new H(2,3,3018,c?c.R()[0]:null));const k=new Fi(f);b=this.j.getOrInsertComputed(b.id+"_"+c.i,()=>Zh(k));c=this.l!==b;d=Ci(k);this.l=b;this.g++;return Promise.resolve({data:d,init:c?b:null})}};w("shaka.transmuxer.TsTransmuxer",UG);UG.prototype.transmux=UG.prototype.transmux;UG.prototype.getOriginalMimeType=UG.prototype.getOriginalMimeType;UG.prototype.convertCodecs=UG.prototype.convertCodecs;
UG.prototype.isSupported=UG.prototype.isSupported;UG.prototype.destroy=UG.prototype.destroy;var SG=["aac","ac-3","ec-3","mp3","opus"],TG=["avc","hevc"];Jd("video/mp2t",()=>new UG("video/mp2t"),Nd);var VG=class{constructor(a){this.g=new Uint8Array(a);eb(this.g);this.h=0}Na(){return this.h}mb(){return this.h}seek(a){if(a>this.g.length)throw new H(2,3,3025);this.h=a}skip(a){var b=this.h+a;b<=this.g.length||(b=new Uint8Array(Math.max(this.g.length*2,b)),b.set(this.g),this.g=b,eb(this.g));this.h+=a}};w("shaka.util.DataViewWriter",VG);VG.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:1};}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();

//# sourceMappingURL=shaka-player.compiled-es2021.map