/*
 @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,ba=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 ca(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 da=ca(this),ha="Int8 Uint8 Uint8Clamped Int16 Uint16 Int32 Uint32 Float32 Float64".split(" ");
da.BigInt64Array&&(ha.push("BigInt64"),ha.push("BigUint64"));function ja(a,b){if(b)for(var c=0;c<ha.length;c++)ka(ha[c]+"Array.prototype."+a,b)}function la(a,b){b&&ka(a,b)}function ka(a,b){var c=da;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&b!=null&&ba(c,a,{configurable:!0,writable:!0,value:b})}function ma(a){a=Math.trunc(a)||0;a<0&&(a+=this.length);if(!(a<0||a>=this.length))return this[a]}
la("Array.prototype.at",function(a){return a?a:ma});ja("at",function(a){return a?a:ma});la("String.prototype.at",function(a){return a?a:ma});var na=this||self;function x(a,b){a=a.split(".");var c=na;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 pa(a){const b=new C(a.type);for(const c in a)Object.defineProperty(b,c,{value:a[c],writable:!0,enumerable:!0});return b}
var C=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(){}};x("shaka.util.FakeEvent",C);
var qa={tk:"abrstatuschanged",vk:"adaptation",wk:"audiotrackchanged",xk:"audiotrackschanged",yk:"boundarycrossed",zk:"buffering",Ak:"canupdatestarttime",Bk:"complete",Ck:"currentitemchanged",Dk:"downloadcompleted",Ek:"downloadfailed",Fk:"downloadheadersreceived",Gk:"drmsessionupdate",Hk:"emsg",Ok:"itemsinserted",Pk:"itemsremoved",hl:"prft",Error:"error",Ik:"expirationupdated",Jk:"firstquartile",Kk:"gapjumped",Qk:"keystatuschanged",Tk:"loaded",Uk:"loading",Wk:"manifestparsed",Xk:"manifestupdated",
Yk:"mediaqualitychanged",Zk:"mediasourcerecovered",$k:"metadataadded",Metadata:"metadata",al:"midpoint",cl:"nospatialvideoinfo",fl:"onstatechange",il:"ratechange",ll:"segmentappended",ol:"sessiondata",ql:"spatialvideoinfo",rl:"stalldetected",ul:"started",vl:"statechanged",wl:"streaming",xl:"textchanged",yl:"texttrackvisibility",zl:"thirdquartile",Al:"timelineregionadded",Bl:"timelineregionenter",Cl:"timelineregionexit",Dl:"trackschanged",Fl:"unloading",Il:"variantchanged"};function ra(){}function sa(){}function ta(a,...b){va.has(a)||(va.add(a),sa(...b))}function wa(){}function xa(){}function za(){}var va=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)),sa=(...a)=>{console.warn(...a)},ra=(...a)=>{console.error(...a)});var Aa=class{constructor(){this.g=new Map}push(a,b){this.g.has(a)?this.g.get(a).push(b):this.g.set(a,[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 Ba=class{constructor(){this.Ta=new Aa;this.ee=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.ee;a.currentTarget=this.ee;try{d.handleEvent?d.handleEvent(a):d.call(this,a)}catch(e){}if(a.g)break}return a.defaultPrevented}release(){this.Ta=null}};function Ca(a,b){const c=[];for(const d of a)c.push(b(d));return c}function Da(a,b){for(const c of a)if(!b(c))return!1;return!0}function Ea(a,b){for(const c of a)if(b(c))return!0;return!1}function Fa(a,b){const c=[];for(const d of a)b(d)&&c.push(d);return c};/*
 @license
 Copyright 2006 The Closure Library Authors
 SPDX-License-Identifier: Apache-2.0
*/
var Ga=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");function Ha(a){var b;a instanceof Ha?(Ia(this,a.Xb),this.Qc=a.Qc,Ja(this,a.ub),Ka(this,a.jd),this.Mb=a.Mb,La(this,a.g.clone()),this.Ec=a.Ec):a&&(b=String(a).match(Ga))?(Ia(this,b[1]||"",!0),this.Qc=Ma(b[2]||""),Ja(this,b[3]||"",!0),Ka(this,b[4]),this.Mb=Ma(b[5]||"",!0),La(this,b[6]||"",!0),this.Ec=Ma(b[7]||"")):this.g=new Na(null)}aa=Ha.prototype;aa.Xb="";aa.Qc="";aa.ub="";aa.jd=null;aa.Mb="";aa.Ec="";
aa.toString=function(){var a=[],b=this.Xb;b&&a.push(Oa(b,Pa,!0),":");if(b=this.ub){a.push("//");var c=this.Qc;c&&a.push(Oa(c,Pa,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.jd;b!=null&&a.push(":",String(b))}if(b=this.Mb)this.ub&&b.charAt(0)!="/"&&a.push("/"),a.push(Oa(b,b.charAt(0)=="/"?Qa:Sa,!0));(b=this.g.toString())&&a.push("?",b);(b=this.Ec)&&a.push("#",Oa(b,Ta));return a.join("")};
aa.resolve=function(a){var b=this.clone();b.Xb==="data"&&(b=new Ha);var c=!!a.Xb;c?Ia(b,a.Xb):c=!!a.Qc;c?b.Qc=a.Qc:c=!!a.ub;c?Ja(b,a.ub):c=a.jd!=null;var d=a.Mb;if(c)Ka(b,a.jd);else if(c=!!a.Mb){if(d.charAt(0)!="/")if(this.ub&&!this.Mb)d="/"+d;else{var e=b.Mb.lastIndexOf("/");e!=-1&&(d=b.Mb.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.Mb=d:c=a.g.toString()!=="";c?La(b,a.g.clone()):c=!!a.Ec;c&&(b.Ec=a.Ec);return b};aa.clone=function(){return new Ha(this)};function Ia(a,b,c){a.Xb=c?Ma(b,!0):b;a.Xb&&(a.Xb=a.Xb.replace(/:$/,""))}function Ja(a,b,c){a.ub=c?Ma(b,!0):b}function Ka(a,b){if(b){b=Number(b);if(isNaN(b)||b<0)throw Error("Bad port number "+b);a.jd=b}else a.jd=null}
function La(a,b,c){b instanceof Na?a.g=b:(c||(b=Oa(b,Ua)),a.g=new Na(b))}function Ma(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Oa(a,b,c){return a!=null?(a=encodeURI(a).replace(b,Wa),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Wa(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Pa=/[#\/\?@]/g,Sa=/[#\?:]/g,Qa=/[#\?]/g,Ua=/[#\?@]/g,Ta=/#/g;function Na(a){this.g=a||null}
function Ya(a){if(!a.cb&&(a.cb=new Map,a.xd=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=Na.prototype;aa.cb=null;aa.xd=null;aa.add=function(a,b){Ya(this);this.g=null;var c=this.cb.has(a)?this.cb.get(a):null;c||this.cb.set(a,c=[]);c.push(b);this.xd++;return this};
aa.set=function(a,b){Ya(this);this.g=null;this.cb.has(a)?this.cb.set(a,[b]):this.add(a,b);return this};aa.get=function(a){Ya(this);return this.cb.get(a)||[]};aa.toString=function(){if(this.g)return this.g;if(!this.cb||!this.cb.size)return"";var a=[];for(const f of this.cb.keys())for(var b=encodeURIComponent(f),c=this.cb.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 Na;a.g=this.g;if(this.cb){var b=new Map;for(const [c,d]of this.cb)b.set(c,d.concat());a.cb=b;a.xd=this.xd}return a};function Za(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=$a(a);b=$a(b);for(let d=0;d<a.byteLength;d++)if(c[d]!=b[d])return!1;return!0}function $a(a,b=0,c=Infinity){return ab(a,b,c,Uint8Array)}function bb(a){return ArrayBuffer.isView(a)?a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer:a}
function ab(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 cb(a,b=0,c=Infinity){return ab(a,b,c,Uint16Array)}function db(a,b=0,c=Infinity){return ab(a,b,c,DataView)}var eb=class{};x("shaka.util.BufferUtils",eb);eb.toDataView=db;eb.toUint16=cb;eb.toUint8=$a;
eb.toArrayBuffer=bb;eb.equal=Za;var fb=class{constructor(a){this.h=a;this.g=void 0}value(){this.g===void 0&&(this.g=this.h());return this.g}};function hb(a,b){if(a===b||!a.length||!b.length)return!0;for(const c of a){if(ib(c))return!0;for(const d of b)if(c.keySystem===d.keySystem||ib(d))return!0}return!1}function ib(a){return(a=a.licenseServerUri)?a.startsWith("data:application/json;base64,"):!1}
function jb(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 ib(e)?c.push(e):ib(f)&&c.push(f);return c}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}`}var pb=new fb(()=>bb(new Uint8Array([0]))),qb=new Map;var D=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(sb)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}toString(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")}};x("shaka.util.Error",D);var sb=!0;D.Severity={RECOVERABLE:1,CRITICAL:2};D.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
D.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,MSS_MISSING_DATA_FOR_TRANSMUXING:3020,MSS_TRANSMUXING_FAILED:3022,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,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,MSS_INVALID_XML:4046,MSS_LIVE_CONTENT_NOT_SUPPORTED:4047,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,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,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007};function tb(){return ub.value()}var vb=null,wb=null,ub=new fb(()=>{let a=void 0;vb&&(a=vb());!a&&wb&&(a=wb());return a});function xb(a){if(!a)return"";a=$a(a);a[0]==239&&a[1]==187&&a[2]==191&&(a=a.subarray(3));if(window.TextDecoder&&!tb().V())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&ra('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 yb(a,b,c){if(!a)return"";if(!c&&a.byteLength%2!=0)throw new D(2,2,2004);c=Math.floor(a.byteLength/2);const d=new Uint16Array(c);a=db(a);for(let e=0;e<c;e++)d[e]=a.getUint16(e*2,b);return zb.value()(d)}
function Bb(a){if(!a)return"";const b=$a(a);if(b[0]==239&&b[1]==187&&b[2]==191)return xb(b);if(b[0]==254&&b[1]==255)return yb(b.subarray(2),!1);if(b[0]==255&&b[1]==254)return yb(b.subarray(2),!0);const c=d=>b.byteLength<=d||b[d]>=9&&b[d]<=126;if(b[0]==0&&b[2]==0)return yb(a,!1);if(b[1]==0&&b[3]==0)return yb(a,!0);if(c(0)&&c(1)&&c(2)&&c(3))return xb(a);throw new D(2,2,2003);}
function Cb(a){if(window.TextEncoder&&!tb().V()){var b=new TextEncoder;return bb(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 bb(b)}function Eb(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 Fb(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 Gb=class{};x("shaka.util.StringUtils",Gb);Gb.resetFromCharCode=function(){zb.g=void 0};
Gb.toUTF16=Eb;Gb.toUTF8=Cb;Gb.fromBytesAutoDetect=Bb;Gb.fromUTF16=yb;Gb.fromUTF8=xb;var zb=new fb(()=>{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 Hb(a){a=$a(a);return Uint8Array.prototype.toBase64?a.toBase64({alphabet:"base64",omitPadding:!1}):(a=zb.value()(a),btoa(a))}function Ib(a,b){b=b==void 0?!0:b;return Uint8Array.prototype.toBase64?$a(a).toBase64({alphabet:"base64url",omitPadding:!b}):(a=Hb(a).replace(/\+/g,"-").replace(/\//g,"_"),b?a:a.replace(/[=]*$/,""))}
function Jb(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 Kb(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 Mb(a){a=$a(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 Nb(...a){return Ob(a,0,a.length)}function Ob(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($a(f),e);e+=f.byteLength}return d}var Pb=class{};x("shaka.util.Uint8ArrayUtils",Pb);Pb.concat=Nb;Pb.toHex=Mb;
Pb.fromHex=Kb;Pb.fromBase64=Jb;Pb.toBase64=Ib;Pb.toStandardBase64=Hb;function Qb(a,b,c=""){if(b.length==0)return a;if(a.length==1&&b.length==1){var d=new Ha(a[0]),e=new Ha(b[0]);d=d.resolve(e);c&&La(d,c);return[d.toString()]}b=b.map(g=>new Ha(g));const f=[];for(d of a){a=new Ha(d);for(e of b){const g=a.resolve(e);c&&La(g,c);f.push(g.toString())}}return f}
function Rb(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 Sb(a,b="cenc"){const c=[],d=[],e=[];a.forEach((g,h)=>{let k=h;k.length!=22&&(k=Ib(Kb(h),!1));let l=g;l.length!=22&&(l=Ib(Kb(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:$a(Cb(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 Tb(a,b){if(b.length==1)return b[0];a=Ub(a,b);if(a!=null)return a;throw new D(2,4,4025,b);}function Ub(a,b){const c=Vb.get(a);for(const d of c)for(const e of b)if(d.test(e.trim()))return e.trim();return a==F?"":null}function Wb(a,b){const c=[];a=Vb.get(a);for(const d of a)for(const e of b)d.test(e.trim())&&c.push(e.trim());return c}
var F="text",Xb={Gl:"video",qk:"audio",Ug:F,Nk:"image",pk:"application"},Yb=1/15,Vb=(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 Zb(a,b){a=$b(a);b=$b(b);return a.split("-")[0]==b.split("-")[0]}function ac(a,b){a=$b(a);b=$b(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&a.length==1&&b.length==2}function bc(a,b){a=$b(a);b=$b(b);a=a.split("-");b=b.split("-");return a.length==2&&b.length==2&&a[0]==b[0]}function $b(a){const [b="",c=""]=a.split("-x-"),[d="",e=""]=b.split("-");a=c?`${"x-"}${c}`:"";let f=d.toLowerCase();f=cc.get(f)||f;const g=e.toUpperCase();return`${g?`${f}-${g}`:f}${a?`-${a}`:""}`}
function ec(a,b){const c=fc(a),d=fc(b);return a!=c&&b!=d&&c==d}function hc(a,b){a=$b(a);b=$b(b);return b==a?4:ac(b,a)?3:bc(b,a)?2:ac(a,b)?1:0}function fc(a){const b=a.indexOf("-");a=b>=0?a.substring(0,b):a;a=a.toLowerCase();return a=cc.get(a)||a}function ic(a){return a.language?$b(a.language):a.audio&&a.audio.language?$b(a.audio.language):a.video&&a.video.language?$b(a.video.language):"und"}
function jc(a,b){a=$b(a);const c=new Set;for(const d of b)c.add($b(d));for(const d of c)if(d==a)return d;for(const d of c)if(ac(d,a))return d;for(const d of c)if(bc(d,a))return d;for(const d of c)if(ac(a,d))return d;return null}var kc=class{};x("shaka.util.LanguageUtils",kc);kc.findClosestLocale=jc;kc.getLocaleForVariant=ic;kc.getLocaleForText=function(a){return $b(a.language||"und")};kc.getBase=fc;kc.relatedness=hc;kc.areSiblings=ec;kc.normalize=$b;kc.isSiblingOf=bc;kc.isParentOf=ac;
kc.areLanguageCompatible=Zb;kc.areLocaleCompatible=function(a,b){a=$b(a);b=$b(b);return a==b};
var cc=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 lc(a,b,c){for(const d of b)a.get(d)||c.add(d)}
function mc(a){var b=a.h,c=a.j,d=a.g,e=new Set;for(const k of d){e.add(k);e.add(fc(k));var f=Fa(b.keys(),l=>ec(l,k));f.sort();for(const l of f)e.add(l);f=Fa(b.keys(),l=>fc(l)==k);f.sort();for(const l of f)e.add(l)}e.add(c);c=[];for(var g of e)(e=b.get(g))&&c.push(e);c.reverse();a.i.clear();for(var h of c)h.forEach((k,l)=>{a.i.set(l,k)});b=a.i.keys();g=new Set;for(const k of a.g)h=a.h.get(k)||new Map,lc(h,b,g);g.size>0&&(d=(new Map).set("locales",Array.from(d)).set("missing",Array.from(g)),a.dispatchEvent(new C("missing-localizations",
d)))}
var oc=class extends Ba{constructor(a){super();this.j=$b(a);this.i=new Map;this.g=new Set;this.h=new Map}release(){super.release()}ah(a){this.g.clear();for(const b of a)this.g.add($b(b));mc(this);a=Fa(this.g,b=>!this.h.has(b));a.length&&this.dispatchEvent(new C("unknown-locales",(new Map).set("locales",a)));a=Fa(this.g,b=>this.h.has(b));a=(new Map).set("locales",a.length?a:[this.j]);this.dispatchEvent(new C("locale-changed",a))}Ra(a,b,c){a=$b(a);c===void 0&&(c=nc);const d=this.h.get(a)||new Map;b.forEach((e,
f)=>{d.has(f)&&c!=nc||d.set(f,e)});this.h.set(a,d);mc(this);this.dispatchEvent(new C("locale-updated"));return this}Sj(a){for(const b of a.keys())a.set(b,this.resolve(b))}resolve(a){const b=this.i.get(a);if(b)return b;a=(new Map).set("locales",Array.from(this.g)).set("missing",a);this.dispatchEvent(new C("unknown-localization",a));return""}Hi(){return this.g}};x("shaka.ui.Localization",oc);oc.prototype.getCurrentLocales=oc.prototype.Hi;oc.prototype.resolve=oc.prototype.resolve;
oc.prototype.resolveDictionary=oc.prototype.Sj;oc.prototype.insert=oc.prototype.Ra;oc.prototype.changeLocale=oc.prototype.ah;oc.prototype.release=oc.prototype.release;var nc=1;oc.ConflictResolution={USE_OLD:0,USE_NEW:nc};oc.UNKNOWN_LOCALES="unknown-locales";oc.UNKNOWN_LOCALIZATION="unknown-localization";oc.MISSING_LOCALIZATIONS="missing-localizations";oc.LOCALE_CHANGED="locale-changed";oc.LOCALE_UPDATED="locale-updated";function pc(a){return a.h/(1-Math.pow(a.g,a.j))}var qc=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 rc=class{constructor(){this.h=new qc(2);this.j=new qc(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(pc(this.h),pc(this.j))}};function sc(a,b){return typeof a==="number"&&typeof b==="number"&&isNaN(a)&&isNaN(b)?!0:a===b}function tc(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1)}function uc(a,b,c){c||=sc;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 vc(a,b){const c=[],d=[];for(const e of a)b(e)?c.push(e):d.push(e);return[c,d]}function wc(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 xc(a,b,c){if(a===b)return!0;if(!a||!b)return a==b;c||=sc;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 zc=class{constructor(){this.g=new Aa}release(){this.Na();this.g=null}o(a,b,c,d){this.g&&(a=new yc(a,b,c,d),this.g.push(b,a))}sa(a,b,c,d){const e=f=>{this.Ea(a,b,e);c(f)};this.o(a,b,e,d)}Ea(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.Ea(),this.g.remove(b,e))}}Na(){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.Ea();this.g.g.clear()}}};x("shaka.util.EventManager",zc);zc.prototype.removeAll=zc.prototype.Na;
zc.prototype.unlisten=zc.prototype.Ea;zc.prototype.listenOnce=zc.prototype.sa;zc.prototype.listen=zc.prototype.o;zc.prototype.release=zc.prototype.release;function Ac(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 Bc(a)?b:b.capture||!1}
function Bc(a){let b=Cc;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}Cc=b}return b||!1}
var yc=class{constructor(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.g=Ac(a,d);this.target.addEventListener(b,c,this.g)}Ea(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=!1}},Cc=void 0;x("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3});var Dc=class{constructor(a,b){this.g=a;this.h=b}toString(){return"v"+this.g+"."+this.h}};var Hc=class{constructor(){var a=Ec,b=Fc;this.g=Gc;this.i=a;this.h=b}};function Ec(a,b,c,d){sa([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Fc(a,b,c,d){ra([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(" "))}function Ic(a,b){var c=new Dc(5,0),d=Jc,e=d.g;const f=c.h-e.h;((c.g-e.g||f)>0?d.i:d.h)(d.g,c,a,b)}var Jc=null;function Kc(a){return a&&typeof LCEVCdec!=="undefined"?a.codecs=="lvc1":!1}function Lc(a){a.g&&a.i.classList.add("shaka-hidden")}
var Mc=class{constructor(a,b,c,d){this.g=null;this.l=a;this.i=b;this.m=c;this.u=d;this.j=!1;a:{typeof libDPIModule==="undefined"&&sa("Could not find LCEVC Library dependencies on this page");if(typeof LCEVCdec!=="undefined")this.h=LCEVCdec;else if(typeof LcevcDil!=="undefined")this.h=LcevcDil,this.j=!0,Ic("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{sa("Could not find LCEVC Library on this page");a=!1;break a}typeof this.h.SupportObject==="undefined"?(sa("Could not find LCEVC Library on this page"),
a=!1):(this.h.SupportObject.SupportStatus||sa(this.h.SupportObject.SupportError),a=typeof this.h!=="undefined"&&typeof libDPIModule!=="undefined"&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}a&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}release(){this.g&&(this.g.close(),this.g=null)}};x("shaka.lcevc.Dec",Mc);
Mc.prototype.release=Mc.prototype.release;function Nc(a,b){Oc.set(a,b)}function Pc(){const a={};tb();if(Qc())for(var b of Oc.keys())a[b]=!0;b=["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","audio/x-mpegurl","application/vnd.ms-sstr+xml"];for(const c of b)a[c]=Qc()?Oc.has(c):Rc(c);return a}function Sc(a,b){if(b){const c=Oc.get(b);if(c)return c}throw new D(2,4,4E3,a,b);}var Tc=class{};x("shaka.media.ManifestParser",Tc);Tc.unregisterParserByMime=function(a){Oc.delete(a)};Tc.registerParserByMime=Nc;
Tc.registerParserByExtension=function(){Ic("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")};Tc.AccessibilityPurpose={Hl:"visually impaired",Lk:"hard of hearing",kl:"spoken subtitles"};var Oc=new Map;var Uc=class{extract(){}decode(){return[]}clear(){}getStreams(){return[]}};var Vc=class{init(){}parse(){return[]}};function Wc(a){return Xc.get(a)}function Yc(a,b){Xc.set(a,b)}function Zc(a,b){b=a.j.parse(b);for(const c of b)b=$a(c.packet),b.length>0&&a.g.extract(b,c.pts);return a.g.decode()}
var ad=class{constructor(a){this.h=new Map;this.i=0;this.j=new Vc;if(a=Wc(a.toLowerCase()))this.j=a();this.g=new Uc;if(a=$c)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=$c)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)}}};
x("shaka.media.ClosedCaptionParser",ad);ad.findDecoder=function(){return $c};ad.unregisterDecoder=function(){$c=null};ad.registerDecoder=function(a){$c=a};ad.findParser=Wc;ad.unregisterParser=function(a){Xc.delete(a)};ad.registerParser=Yc;var Xc=new Map,$c=null;var fd=class{constructor(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=bd;this.scroll=ed}};x("shaka.text.CueRegion",fd);var bd=1;fd.units={PX:0,PERCENTAGE:bd,LINES:2};var ed="";fd.scrollMode={NONE:ed,UP:"up"};function gd(a){return a?hd(new id(a)):null}function hd(a){a=jd(a,kd);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 ld(a){return a.g==a.h.length?null:(a=jd(a,/[^ \t\n]*/gm))?a[0]:null}function jd(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 md(a){jd(a,/[ \t]+/gm)}var id=class{constructor(a){this.h=a||"";this.g=0}},kd=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function nd(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 od(a){const b={};for(const c in a)b[c]=a[c];return b}
function pd(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=pd(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=pd(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a}var qd=class{};x("shaka.util.ObjectUtils",qd);qd.alphabeticalKeyOrderStringify=pd;qd.shallowCloneObject=od;
qd.cloneObject=nd;/*
 @license
 tXml
 Copyright 2015 Tobias Nickel
 SPDX-License-Identifier: MIT
*/
function rd(a,b){a=Bb(a);return sd(a,b,!1)}function sd(a,b,c=!1){a=td(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 td(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 r=a.charCodeAt(e);if(r>64&&r<91||r>96&&r<123){r=d();for(var q=a.charCodeAt(e);q&&
q!==39&&q!==34&&!(q>64&&q<91||q>96&&q<123)&&q!==62;)e++,q=a.charCodeAt(e);var t=e+1;e=a.indexOf(a[e],t);t=(" "+a.slice(t,e)).slice(1);if(q===39||q===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(r.startsWith("xmlns:")){q=t;var u=r.split(":")[1];ud.set(q,u);vd.set(u,q)}n==="tt"&&r==="xml:space"&&t==="preserve"&&(m=!0);p[r]=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++)r=l[p],typeof r!=="string"?b&&(r.parent=m):p==n-1&&r=="\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 wd(a){return ud.has(a)?ud.get(a):""}function xd(a){return typeof a==="string"}function yd(a){const b=[];if(!a.children)return[];for(const c of a.children)typeof c!=="string"&&b.push(c);return b}function zd(a,b){const c=[];if(!a.children)return[];for(const d of a.children)d.tagName===b&&c.push(d);return c}
function Ad(a){if(typeof a==="string")return Fb(a);const b=[];for(const c of a.children)typeof c==="string"&&b.push(c);a=b.join("");return a===""?null:Fb(a)}function Bd(a){for(const b of a.children)if(typeof b!=="string")return null;(a=Ad(a))&&(a=a.trim());return a}function Cd(a,b,c=[]){a.tagName===b&&c.push(a);if(a.children)for(const d of a.children)Cd(d,b,c);return c}function Fd(a,b){a=zd(a,b);return a.length!=1?null:a[0]}function Gd(a,b,c){a=Hd(a,b,c);return a.length!=1?null:a[0]}
function Hd(a,b,c){const d=wd(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 Id(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 Jd(a,b,c){b=wd(b);return a.attributes[`${b}:${c}`]||null}function Kd(a,b,c){for(const d of b)if(b=Jd(a,d,c))return b;return null}
function Ld(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 Md(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 Nd(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 Od(a){a=Number(a);return a%1===0?a:null}function Pd(a){a=Number(a);return a%1===0&&a>0?a:null}function Qd(a){a=Number(a);return a%1===0&&a>=0?a:null}function Rd(a){a=Number(a);return isNaN(a)?null:a}function Sd(a){return a?a.toLowerCase()==="true":!1}
function Td(a){let b,c;c=(b=a.match(/^(\d+)\/(\d+)$/))?Number(b[1])/Number(b[2]):Number(a);return isNaN(c)?null:c}
function Ud(a){const b=[];a=Fb(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,qc:c.split("/@")[1]||null})}else c.startsWith("@")&&
b.length&&(b[b.length-1].qc=c.slice(1));return b}function Vd(a,b){var c=Ud(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=Wd(a,"t",d.t)),d.n!==null&&(c=Wd(a,"n",d.n)));c===null?c=e==="prepend"?0:a.length:e==="prepend"?--c:e==="after"&&++c;e=b.tagName;(d=d.qc)&&a[c]?Xd(a[c],e,d,Bd(b)||""):(e!=="remove"&&e!=="replace"||a.splice(c,1),e!=="add"&&e!=="replace"||a.splice(c,0,...b.children))}}
function Wd(a,b,c){let d=0;for(const e of a){if(Number(e.attributes[b])===c)return d;d++}return null}function Xd(a,b,c,d){if(b==="remove")delete a.attributes[c];else if(b==="add"||b==="replace")a.attributes[c]=d}
function Yd(a){var b="";const c=a.tagName.split(":");c.length>0&&(b=c[0],b=vd.has(b)?vd.get(b):"");b=document.createElementNS(b,a.tagName);for(const d in a.attributes)b.setAttribute(d,a.attributes[d]);for(const d of a.children){let e;typeof d=="string"?e=new Text(d):e=Yd(d);b.appendChild(e)}return b}
function Zd(a){if(!a)return null;const b={tagName:a.tagName,attributes:od(a.attributes),children:[],parent:null};for(const c of a.children)typeof c==="string"?b.children.push(c):(a=Zd(c),a.parent=b,b.children.push(a));return b}var ud=new Map,vd=new Map;function $d(a,b){a=new ae(a,b,"");a.lineBreak=!0;return a}function be(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(!xc(a.nestedCues,b.nestedCues,be))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(!xc(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}
function ce(a,b=new Map){var c=a.payload;if(c.includes("<")){b.size===0&&de(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(ee)&&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=fe(c);a.payload="";k="<span>"+c.replace(/\n/g,"<br />")+"</span>";try{var l=sd(k,"span")}catch(m){}if(l)if(l=l.children,l.length!=1||l[0].tagName)for(const m of l)ge(m,a,b);
else a.payload=Fb(c);else a.payload=Fb(c)}else a.payload=Fb(c)}function de(a){for(const [c,d]of Object.entries(he)){var b=new ae(0,0,"");b.color=d;a.set("."+c,b)}for(const [c,d]of Object.entries(ie))b=new ae(0,0,""),b.backgroundColor=d,a.set("."+c,b)}function fe(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 ge(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new fd;d.position=null;d.size=0;d.textAlign=je;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=ke(g.backgroundColor,e.backgroundColor),e.color=ke(g.color,e.color),e.fontFamily=ke(g.fontFamily,e.fontFamily),e.fontSize=ke(g.fontSize,e.fontSize),
e.textShadow=ke(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=$d(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=le;break;case "i":d.fontStyle=me;break;case "u":d.textDecoration.push(ne);break;case "font":if(e=a.attributes.color)d.color=e;break;case "div":e=a.attributes.time;if(!e)break;if(e=gd(e))d.startTime=e;break;
case "ruby":case "rp":case "rt":d.rubyTag=f}}}f=a.children;if(xd(a)||f.length==1&&xd(f[0])){a=Ad(a).split("\n");c=!0;for(const h of a)c||(a=$d(d.startTime,d.endTime),b.nestedCues.push(a)),h.length>0&&(a=d.clone(),a.payload=Fb(h),b.nestedCues.push(a)),c=!1}else{b.nestedCues.push(d);for(const h of f)ge(h,d,c)}}function ke(a,b){return a&&a.length>0?a:b}
var ae=class{constructor(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new fd;this.position=null;this.positionAlign=oe;this.size=0;this.textAlign=je;this.direction=pe;this.writingMode=qe;this.lineInterpretation=re;this.line=null;this.lineHeight="";this.lineAlign=se;this.displayAlign=te;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=ue;this.fontStyle=ve;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 ae(0,0,"");for(const b in this)a[b]=this[b],Array.isArray(a[b])&&(a[b]=a[b].slice());return a}};x("shaka.text.Cue",ae);ae.parseCuePayload=ce;ae.equal=be;ae.prototype.clone=ae.prototype.clone;var oe="auto";
ae.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:oe};var je="center",we={LEFT:"left",RIGHT:"right",CENTER:je,START:"start",END:"end"};ae.textAlign=we;var te="after",xe={BEFORE:"before",CENTER:"center",AFTER:te};ae.displayAlign=xe;var pe="ltr";ae.direction={HORIZONTAL_LEFT_TO_RIGHT:pe,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var qe="horizontal-tb";ae.writingMode={HORIZONTAL_TOP_TO_BOTTOM:qe,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var re=0;
ae.lineInterpretation={LINE_NUMBER:re,PERCENTAGE:1};var se="start",ye={CENTER:"center",START:se,END:"end"};ae.lineAlign=ye;var he={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};ae.defaultTextColor=he;var ie={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};ae.defaultTextBackgroundColor=ie;var ue=400,le=700;ae.fontWeight={NORMAL:ue,BOLD:le};
var ve="normal",me="italic",ze={NORMAL:ve,ITALIC:me,OBLIQUE:"oblique"};ae.fontStyle=ze;var ne="underline";ae.textDecoration={UNDERLINE:ne,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var ee=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function Ae(a,b,c){Be.set(a.toLowerCase().split(";")[0]+"-"+c,{priority:c,Se:b})}function Ce(a,b){const c=a.toLowerCase().split(";")[0];var d=[De,Ee,Fe,Ge];for(const e of d)if(d=Be.get(c+"-"+e)){const f=d.Se(),g=f.isSupported(a,b);f.destroy();if(g)return d.Se}return null}var He=class{destroy(){}};x("shaka.transmuxer.TransmuxerEngine",He);He.findTransmuxer=Ce;He.unregisterTransmuxer=function(a,b){Be.delete(a.toLowerCase().split(";")[0]+"-"+b)};He.registerTransmuxer=Ae;He.prototype.destroy=He.prototype.destroy;
var Be=new Map,Ge=1,Fe=2,Ee=3,De=4;He.PluginPriority={FALLBACK:Ge,PREFERRED_SECONDARY:Fe,PREFERRED:Ee,APPLICATION:De};function Ie(a,b){let c=a;b&&!Ke.includes(a)&&(c+='; codecs="'+b+'"');return c}function Le(a,b){b&&(a+='; codecs="'+b+'"');return a}function Me(a,b,c){const d=Ie(a,b);b=Le(a,b);Ce(b)?(a=Ce(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 Ne(a){return a.split(";")[0].split("/")[1]}
function Oe(a){var b=Pe(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 Pe(a){a=a.split(".");const b=a[0];a.shift();return[b,a.join(".")]}function Qe(a){const b=[];for(const c of a.split(","))a=Pe(c),b.push(a[0]);return b.sort().join(",")}function Re(a){return a.split(";")[0]}function Se(a){a=a.split(/ *; */);a.shift();return(a=a.find(b=>b.startsWith("codecs=")))?a.split("=")[1].replace(/^"|"$/g,""):""}
function Te(a){return a==="application/x-mpegurl"||a==="application/vnd.apple.mpegurl"||a==="audio/x-mpegurl"}var Ue=class{};x("shaka.util.MimeUtils",Ue);Ue.getFullTypeWithAllCodecs=Le;Ue.getFullType=Ie;(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var Ke=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Ve(a,b){We.set(a,b)}function Xe(a){return We.get(a)}function Ye(a){return We.has(a)?!0:a=="application/cea-608"||a=="application/cea-708"?!!$c:!1}
async function Ze(a,b,c,d,e){await Promise.resolve();if(a.i&&a.l)if(c==null||d==null)a.i.parseInit($a(b));else{var f={periodStart:a.B?0:a.A,segmentStart:c,segmentEnd:d,vttOffset:a.F||a.B?c:a.A};b=a.i.parseMedia($a(b),f,e,[]);for(const g of b)a.C(g,e||null,f);e=b.filter(g=>g.startTime>=a.m&&g.startTime<a.u);a.l.append(e);a.g==null&&(a.g=Math.max(c,a.m));a.h=Math.min(d,a.u)}}function $e(a,b,c){for(const d of a.j.keys()){let e=a.j.get(d);e=e.filter(f=>f.startTime<b||f.endTime>=c);a.j.set(d,e)}}
function af(a){let b=Infinity,c=-Infinity;for(const d of a.j.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.m):Math.min(a.g,Math.max(b,a.m)),a.h=Math.max(a.h,Math.min(c,a.u)))}function bf(a,b,c){a.m=b;a.u=c}function cf(a,b,c){a.D=b;if(b=a.j.get(b))b=b.filter(d=>d.endTime<=c),b.length&&a.l.append(b)}function df(a,b,c){b.startTime+=c;b.endTime+=c;for(const d of b.nestedCues)df(a,d,c)}
function ef(a,b,c){const d=new Map;for(const e of b){b=e.stream;const f=e.cue;d.has(b)||d.set(b,[]);df(a,f,c);f.startTime>=a.m&&f.startTime<a.u&&(d.get(b).push(f),b==a.D&&a.l.append([f]))}for(const e of d.keys()){a.j.has(e)||a.j.set(e,[]);for(const f of d.get(e))a.j.get(e).push(f)}af(a)}
var ff=class{constructor(a){this.i=null;this.l=a;this.B=this.F=!1;this.m=this.A=0;this.u=Infinity;this.h=this.g=null;this.D="";this.C=()=>{};this.j=new Map}destroy(){this.l=this.i=null;this.j.clear();return Promise.resolve()}async remove(a,b,c=!1){await Promise.resolve();if(!(a>=b)){if(c&&($e(this,a,b),this.D===""))return;this.l&&this.l.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)),af(this))}}};
x("shaka.text.TextEngine",ff);ff.prototype.destroy=ff.prototype.destroy;ff.findParser=Xe;ff.unregisterParser=function(a){We.delete(a)};ff.registerParser=Ve;var We=new Map;function gf(a,b,c){let d=!0,e=null;a.h=()=>{clearTimeout(e);d=!1};e=setTimeout(()=>{d&&b()},c*1E3)}function hf(a,b){gf(a,()=>{hf(a,b);a.g()},b)}var H=class{constructor(a){this.g=a;this.h=null}Ia(){this.stop();this.g();return this}Z(a){this.stop();gf(this,()=>{this.g()},a);return this}wa(a){this.stop();hf(this,a);return this}stop(){this.h?.();this.h=null}};x("shaka.util.Timer",H);H.prototype.stop=H.prototype.stop;H.prototype.tickEvery=H.prototype.wa;H.prototype.tickAfter=H.prototype.Z;
H.prototype.tickNow=H.prototype.Ia;function jf(a,b){return a.concat(b)}function kf(){}function lf(a){return a!=null}function mf(a,b){return Promise.race([b,new Promise((c,d)=>{(new H(d)).Z(a)})])};function nf(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=of(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 r=[];for(const q of p)p=d.filter(t=>q.decodingInfos[0][t]).length,p>n?(n=p,r=[q]):p==n&&r.push(q);m.push(...r)});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=Oe(m.codecs),n=Oe(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=Oe(c[c.length-1].codecs);const n=Oe(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 of(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 pf(a,b){var c={width:Infinity,height:Infinity};a.variants=a.variants.filter(d=>qf(d,b,c))}
function qf(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 rf(a,b,c=[],d={}){await sf(a,b,b.offlineSessionIds.length>0,c,d);tf(b);await uf(b)}async function sf(a,b,c,d,e){tb().oa()&&vf(b.variants);await wf(b.variants,c,!1,d);let f=null;a&&(a=a.g)&&(f=a.keySystem);b.variants=b.variants.filter(g=>{const h=xf(g,f,e);if(!h){const k=[];g.audio&&k.push(yf(g.audio));g.video&&k.push(yf(g.video))}return h})}
function tf(a){a.textStreams=a.textStreams.filter(b=>{b=Ie(b.mimeType,b.codecs);return Ye(b)})}async function uf(a){const b=[];for(const d of a.imageStreams){let e=d.mimeType;e=="application/mp4"&&d.codecs=="mjpg"&&(e="image/jpg");if(!zf.has(e)){var c=Af.get(e);c?(c=await Bf(c),zf.set(e,c)):zf.set(e,!1)}zf.get(e)&&b.push(d)}a.imageStreams=b}
function vf(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 wf(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=Cf(g,b,c).filter(k=>{k=k[0];k=k.keySystemConfiguration&&k.keySystemConfiguration.keySystem;return!k||k===e});for(const k of h)await Df(g,k);g.decodingInfos.some(k=>k.supported)&&(f=!0)}if(f)return}for(const e of a){a=Cf(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 Df(e,f)}}}
function xf(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=tb(),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)&&!Kc(e))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")||a&&a.dependencyStream?!1:!0}
async function Df(a,b){const c=(f,g)=>{if(f){const h=od(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=pd(f),h=Ef;h.has(g)?d=c(d,h.get(g)):e.push(Ff(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 Ff(a){let b=[""];a.video&&(b=Se(a.video.contentType).split(","));let c=[""];a.audio&&(c=Se(a.audio.contentType).split(","));const d=[];for(const e of b)for(const f of c){const g=nd(a);a.video&&(g.video.contentType=Ie(Re(g.video.contentType),e));a.audio&&(g.audio.contentType=Ie(Re(g.audio.contentType),f));d.push(new Promise((h,k)=>{(tb().i()=="MOBILE"?mf(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 Cf(a,b,c){const d=a.audio,e=a.video;var f=[],g=[];if(e)for(var h of e.fullMimeTypes){var k=Se(h);if(k.includes(",")&&!d){var l=k.split(","),m=Re(h);k=Tb("video",l);l=Tb("audio",l);l=Gf(l,m);m=Me(m,l,"audio");g.push({contentType:m,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}k=Hf(k);k={contentType:Me(Re(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=Re(n),k=Gf(Se(n),h),h=Me(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 r of g)f={type:c?"file":"media-source"},p&&(f.video=p),r&&(f.audio=r),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 q of g)c.get(q.keySystem)||c.set(q.keySystem,[]),c.get(q.keySystem).push(q);q=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);r={keySystem:t,initDataType:"cenc",persistentState:q,
distinctiveIdentifier:"optional",sessionTypes:b};for(const y of u){if(y.initData&&y.initData.length){f=new Set;for(const w of y.initData)f.add(w.initDataType);r.initDataType=y.initData[0].initDataType}y.distinctiveIdentifierRequired&&(r.distinctiveIdentifier="required");y.persistentStateRequired&&(r.persistentState="required");y.sessionType&&(r.sessionTypes=[y.sessionType]);d&&(r.audio?(y.encryptionScheme&&(r.audio.encryptionScheme=r.audio.encryptionScheme||y.encryptionScheme),r.audio.robustness=
r.audio.robustness||y.audioRobustness):(r.audio={robustness:y.audioRobustness},y.encryptionScheme&&(r.audio.encryptionScheme=y.encryptionScheme)),r.audio.robustness==""&&delete r.audio.robustness);e&&(r.video?(y.encryptionScheme&&(r.video.encryptionScheme=r.video.encryptionScheme||y.encryptionScheme),r.video.robustness=r.video.robustness||y.videoRobustness):(r.video={robustness:y.videoRobustness},y.encryptionScheme&&(r.video.encryptionScheme=y.encryptionScheme)),r.video.robustness==""&&delete r.video.robustness)}p.keySystemConfiguration=
r;g.push(p)}a.push(g)}}return a}function Gf(a,b){const c=tb();return a.toLowerCase()=="flac"?c.h()!="WEBKIT"?"flac":"fLaC":a.toLowerCase()==="opus"?c.h()!="WEBKIT"?"opus":Ne(b)=="mp4"?"Opus":"opus":a.toLowerCase()=="ac-3"&&c.I()?"ec-3":a}function Hf(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 Bf(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 If(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=Tb("video",e),a.audioCodec=Tb("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 Jf(a){return{id:a.id,active:!1,type:F,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 Kf(a){let b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=a.segmentIndex.wb());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 Lf(a){a.__shaka_id||(a.__shaka_id=Mf++);return a.__shaka_id}
function Nf(a){const b={id:Lf(a),active:a.mode!="disabled",type:F,bandwidth:0,language:$b(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 Of(a,b){var c=a?a.language:null;c={id:Lf(a||b),active:a?a.enabled:b.selected,type:"variant",bandwidth:0,language:$b(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 Pf(a){return a.allowedByApplication&&a.allowedByKeySystem&&a.disabledUntilTime==0}function Qf(a){return a.filter(b=>Pf(b))}
function Rf(a,b,c,d){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=jc($b(b),a.map(k=>k.language));h&&(e=a.filter(k=>$b(k.language)==h))}e=e.filter(h=>h.forced==d);if(c){if(a=Sf(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(jf,[]);return a.length?Sf(e,a[0]):e}function Sf(a,b){return a.filter(c=>c.roles.includes(b))}
function Tf(a){const b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}function Uf(a,b){b.length&&(b=b.filter(c=>Oe(a.codecs)==Oe(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 yf(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 Vf(a,b,c){if(c.autoShowText==0)return!1;if(c.autoShowText==1)return!0;const d=$b(c.preferredTextLanguage);b=$b(b.language);if(c.autoShowText==2)return Zb(b,d);if(c.autoShowText==3){if(!a)return!1;a=$b(a.language);return Zb(b,d)&&!Zb(a,b)}sa("Invalid autoShowText setting!");return!1}
function Wf(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?Re(c):"",codecs:c?Se(c):"",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(Ie(a.mimeType,a.codecs)),c.startsWith("audio/")?(a.type="audio",b.audio=a):b.video=a;return b}var Xf=class{};x("shaka.util.StreamUtils",Xf);Xf.meetsRestrictions=qf;
var Ef=new Map,Mf=0,zf=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Af=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function Yf(a,b,c,d,e){if(a.D){const f=a.D.mh();f&&(c=c.filter(g=>g.bandwidth&&f?g.bandwidth<=f:!0))}b&&(c=c.filter(f=>qf(f,b,{width:e,height:d})));return c.sort((f,g)=>f.bandwidth-g.bandwidth)}function Zf(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 $f(a,b=!1){if(!b){if(!a.I){b=a.A;if(!(b.g>=b.i))return;a.I=!0;a.B-=(a.g.switchInterval-a.g.minTimeToSwitch)*1E3}if(Date.now()-a.B<a.g.switchInterval*1E3)return}b=a.chooseVariant();a.getBandwidthEstimate();b&&a.G&&a.G(b,a.g.clearBufferSwitch,a.g.safeMarginSwitch)}
var bg=class{constructor(){this.G=null;this.F=!1;this.A=new rc;this.j=new zc;navigator.connection&&navigator.connection.addEventListener&&this.j.o(navigator.connection,"change",()=>{this.g.useNetworkInformation&&navigator.onLine&&(this.A=new rc,this.g&&this.A.configure(this.g.advanced),this.trySuggestStreams())});this.l=[];this.H=1;this.I=!1;this.h=this.u=this.g=this.B=null;this.m=new H(()=>{if(this.F&&(this.g.restrictToElementSize||this.g.restrictToScreenSize)){const a=this.chooseVariant();a&&this.G&&
this.G(a,this.g.clearBufferSwitch,this.g.safeMarginSwitch)}});this.C=window;"documentPictureInPicture"in window&&this.j.o(window.documentPictureInPicture,"enter",()=>{this.C=window.documentPictureInPicture.window;this.m&&this.m.Ia();this.j.sa(this.C,"pagehide",()=>{this.C=window;this.m&&this.m.Ia()})});this.D=this.i=null}stop(){this.G=null;this.F=!1;this.l=[];this.H=1;this.u=this.B=null;this.h&&(this.h.disconnect(),this.h=null);this.m&&this.m.stop();this.D=this.i=null}release(){this.stop();this.j.release();
this.m=null}init(a){this.G=a}chooseVariant(a=!1){var b=Infinity,c=Infinity;this.g.restrictToScreenSize&&(c=this.g.ignoreDevicePixelRatio?1:this.C.devicePixelRatio,b=this.C.screen.height*c,c*=this.C.screen.width);if(this.h&&this.g.restrictToElementSize){var d=this.g.ignoreDevicePixelRatio?1:this.C.devicePixelRatio,e=this.u.clientHeight,f=this.u.clientWidth;this.i&&document.pictureInPictureElement&&document.pictureInPictureElement==this.u&&(e=this.i.height,f=this.i.width);b=Math.min(b,e*d);c=Math.min(c,
f*d)}e=this.l.filter(h=>h&&!(h.audio&&h.audio.fastSwitching||h.video&&h.video.fastSwitching));e.length||(e=this.l);d=e;a&&e.length!=this.l.length&&(d=this.l.filter(h=>h&&(h.audio&&h.audio.fastSwitching||h.video&&h.video.fastSwitching?!0:!1)));a=Yf(this,this.g.restrictions,d,Infinity,Infinity);if(b!=Infinity||c!=Infinity){a=Zf(a);for(var g of a)if(g.height>=b&&g.width>=c){b=g.height;c=g.width;break}a=Yf(this,this.g.restrictions,d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(a=Yf(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.B=Date.now();return g}enable(){this.F=
!0;this.l.length&&this.trySuggestStreams()}disable(){this.F=!1}segmentDownloaded(a,b,c,d){let e=a;this.g.removeLatencyFromFirstPacketTime&&d&&d.packetNumber===1&&d.timeToFirstByte&&(e=a-d.timeToFirstByte);e>=this.g.cacheLoadThreshold&&this.A.sample(e,b);c&&this.B!=null&&this.F&&$f(this)}trySuggestStreams(){this.F&&(this.B=Date.now(),$f(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.A.getBandwidthEstimate(a);return this.D?this.D.getBandwidthEstimate(a):a}setVariants(a){if(uc(a,this.l))return!1;this.l=a;return!0}playbackRateChanged(a){this.H=a}setMediaElement(a){this.u=a;this.h&&(this.h.disconnect(),this.h=null);const b=()=>{this.m.Z(ag)};this.u&&"ResizeObserver"in window&&(this.h=new ResizeObserver(b),this.h.observe(this.u));this.j.o(a,
"enterpictureinpicture",c=>{c.pictureInPictureWindow&&(this.i=c.pictureInPictureWindow,this.j.o(this.i,"resize",b))});this.j.o(a,"leavepictureinpicture",()=>{this.i&&this.j.Ea(this.i,"resize",b);this.i=null})}setCmsdManager(a){this.D=a}configure(a){this.g=a;this.A&&this.g&&this.A.configure(this.g.advanced)}};x("shaka.abr.SimpleAbrManager",bg);bg.prototype.configure=bg.prototype.configure;bg.prototype.setCmsdManager=bg.prototype.setCmsdManager;bg.prototype.setMediaElement=bg.prototype.setMediaElement;
bg.prototype.playbackRateChanged=bg.prototype.playbackRateChanged;bg.prototype.setVariants=bg.prototype.setVariants;bg.prototype.getBandwidthEstimate=bg.prototype.getBandwidthEstimate;bg.prototype.trySuggestStreams=bg.prototype.trySuggestStreams;bg.prototype.segmentDownloaded=bg.prototype.segmentDownloaded;bg.prototype.disable=bg.prototype.disable;bg.prototype.enable=bg.prototype.enable;bg.prototype.chooseVariant=bg.prototype.chooseVariant;bg.prototype.init=bg.prototype.init;
bg.prototype.release=bg.prototype.release;bg.prototype.stop=bg.prototype.stop;var ag=1;function cg(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}}function dg(a){a.g=1;a.h=a.j}async function eg(a){if(a.g>=a.l)if(a.i)dg(a);else throw new D(2,7,1010);const b=a.g;a.g++;if(b!=0){var c=a.h*(1+(Math.random()*2-1)*a.u);await new Promise(d=>{(new H(d)).Z(c/1E3)});a.h*=a.m}}
var fg=class{constructor(a,b=!1){const c=cg();this.l=a.maxAttempts==null?c.maxAttempts:a.maxAttempts;this.j=a.baseDelay==null?c.baseDelay:a.baseDelay;this.u=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}};var gg=class{constructor(){let a,b;const c=new Promise((d,e)=>{a=d;b=e});c.resolve=a;c.reject=b;return c}resolve(){}reject(){}};function hg(a){return new ig(Promise.reject(a),()=>Promise.resolve())}function jg(){const a=Promise.reject(new D(2,7,7001));a.catch(()=>{});return new ig(a,()=>Promise.resolve())}function kg(a){return new ig(Promise.resolve(a),()=>Promise.resolve())}function lg(a){return new ig(a,()=>a.catch(()=>{}))}function mg(a){return new ig(Promise.all(a.map(b=>b.promise)),()=>Promise.all(a.map(b=>b.abort())))}
function ng(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 ig=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}Ya(a,b){const c=new gg;c.catch(()=>{});const d=new D(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=ng(k,h,c):(g?c.resolve:c.reject)(h)}};this.promise.then(f(!0),f(!1));return new ig(c,()=>e())}};
x("shaka.util.AbortableOperation",ig);ig.prototype.chain=ig.prototype.Ya;ig.prototype["finally"]=ig.prototype.finally;ig.all=mg;ig.prototype.abort=ig.prototype.abort;ig.notAbortable=lg;ig.completed=kg;ig.aborted=jg;ig.failed=hg;function og(a,b){a.g.push(b.finally(()=>{tc(a.g,b)}))}var pg=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 qg(a,b,c,d=!1){c=c||rg;const e=sg.get(a);(!e||c>=e.priority)&&sg.set(a,{priority:c,Se:b,Jj:d})}function tg(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}}function ug(a,b){for(const c of a.g)b.g.add(c);for(const c of a.h)b.h.add(c)}
function vg(a,b,c,d){let e=kg(void 0);const f=g=>{e=e.Ya(()=>{c.body&&(c.body=bb(c.body));return g(b,c,d)})};a.D&&f(a.D);for(const g of a.g)f(g);return e.Ya(void 0,g=>{if(g instanceof D&&g.code==7001)throw g;throw new D(2,1,1006,g);})}function wg(a,b,c,d){let e=kg(void 0);for(const f of a.h)e=e.Ya(()=>{const g=c.response;g.data&&(g.data=bb(g.data));return f(b,g,d)});return e.Ya(()=>c,f=>{let g=2;if(f instanceof D){if(f.code==7001)throw f;g=f.severity}throw new D(g,1,1007,f);})}
function xg(a){if(a){const b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.Kc)return!1}return!0}
function yg(a,b,c,d,e,f,g,h){a.i.forceHTTP&&(c.uris[f]=c.uris[f].replace("https://","http://"));a.i.forceHTTPS&&(c.uris[f]=c.uris[f].replace("http://","https://"));f>0&&a.G&&a.G(b,d,c.uris[f],c.uris[f-1]);var k=new Ha(c.uris[f]),l=k.Xb;let m=!1;l||(l=location.protocol,l=l.slice(0,-1),Ia(k,l),c.uris[f]=k.toString());l=l.toLowerCase();const n=(l=sg.get(l))?l.Se:null;if(!n)return hg(new D(2,1,1E3,k));const p=l.Jj;(k=a.l.get(k.ub))&&(c.headers["common-access-token"]=k);let r=null,q=null,t=!1,u=!1,v;return lg(eg(e)).Ya(()=>
{if(a.j)return jg();v=Date.now();let y=0;c.requestStartTime=Date.now();const w=n(c.uris[f],c,b,(B,E,G)=>{r&&r.stop();q&&q.Z(A/1E3);a.u&&b==zg&&(y++,c.packetNumber=y,a.u(B,E,xg(d),c,d),m=!0,h.g=G)},B=>{u=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.m&&a.m(B,c,b)},{minBytesForProgressEvents:a.i.minBytesForProgressEvents});if(!p)return w;const z=c.retryParameters.connectionTimeout;z&&(r=new H(()=>{t=!0;w.abort()}),r.Z(z/1E3));const A=c.retryParameters.stallTimeout;A&&(q=new H(()=>{t=!0;w.abort()}));
return w}).Ya(y=>{r&&r.stop();q&&q.stop();y.timeMs==void 0&&(y.timeMs=Date.now()-v);var w=y.headers["common-access-token"];if(w){const z=new Ha(y.uri);a.l.set(z.ub,w)}w={response:y,mj:m};!u&&a.m&&a.m(y.headers,c,b);a.B&&a.B(c,y);return w},y=>{r&&r.stop();q&&q.stop();if(a.C){var w=null;let z=0;y instanceof D&&(w=y,y.code==1001&&(z=y.data[1]));a.C(c,w,z,t)}if(a.j)return jg();t&&(y=new D(1,1,1003,c.uris[f],b));if(y instanceof D){if(y.code==7001)throw y;if(y.code==1010)throw g;if(y.severity==1){w=(new Map).set("error",
y);w=new C("retry",w);w.cancelable=!0;a.dispatchEvent(w);if(w.defaultPrevented)throw y;f=(f+1)%c.uris.length;return yg(a,b,c,d,e,f,y,h)}}throw y;})}
var Cg=class extends Ba{constructor(a,b,c,d,e,f,g){super();this.i=null;this.j=!1;this.A=new pg;this.g=new Set;this.h=new Set;this.u=a||null;this.m=b||null;this.B=c||null;this.C=d||null;this.D=e||null;this.G=f||null;this.F=g||null;this.l=new Map}configure(a){this.i=a}Mj(a){this.g.add(a)}ik(a){this.g.delete(a)}li(){this.g.clear()}Nj(a){this.h.add(a)}jk(a){this.h.delete(a)}mi(){this.h.clear()}dh(){this.l.clear()}destroy(){this.j=!0;this.g.clear();this.h.clear();this.l.clear();super.release();return this.A.destroy()}request(a,
b,c){const d=new Ag;if(this.j){var e=Promise.reject(new D(2,7,7001));e.catch(()=>{});return new Bg(e,()=>Promise.resolve(),d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?nd(b.retryParameters):cg();b.uris=nd(b.uris);e=vg(this,a,b,c);const f=e.Ya(()=>yg(this,a,b,c,new fg(b.retryParameters,!1),0,null,d)),g=f.Ya(n=>wg(this,a,n,c)),h=Date.now();let k=0;e.promise.then(()=>{k=Date.now()-h},()=>{});let l=0;f.promise.then(()=>{l=Date.now()},()=>{});const m=g.Ya(n=>
{const p=Date.now()-l,r=n.response;r.timeMs+=k;r.timeMs+=p;n.mj||!this.u||r.fromCache||b.method=="HEAD"||a!=zg||this.u(r.timeMs,r.data.byteLength,xg(c),b,c);this.F&&this.F(a,r,c);return r},n=>{n&&(n.severity=2);throw n;});e=new Bg(m.promise,()=>m.abort(),d);og(this.A,e);return e}};x("shaka.net.NetworkingEngine",Cg);Cg.prototype.request=Cg.prototype.request;Cg.prototype.destroy=Cg.prototype.destroy;Cg.makeRequest=tg;Cg.defaultRetryParameters=function(){return cg()};
Cg.prototype.clearCommonAccessTokenMap=Cg.prototype.dh;Cg.prototype.clearAllResponseFilters=Cg.prototype.mi;Cg.prototype.unregisterResponseFilter=Cg.prototype.jk;Cg.prototype.registerResponseFilter=Cg.prototype.Nj;Cg.prototype.clearAllRequestFilters=Cg.prototype.li;Cg.prototype.unregisterRequestFilter=Cg.prototype.ik;Cg.prototype.registerRequestFilter=Cg.prototype.Mj;Cg.unregisterScheme=function(a){sg.delete(a)};Cg.registerScheme=qg;Cg.prototype.configure=Cg.prototype.configure;
var Ag=class{constructor(){this.g=0}};Cg.NumBytesRemainingClass=Ag;var Bg=class extends ig{constructor(a,b,c){super(a,b);this.h=c}};Cg.PendingRequest=Bg;var zg=1;Cg.RequestType={MANIFEST:0,SEGMENT:zg,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8,CMCD:9};
Cg.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5,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};var rg=3;Cg.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:rg};var sg=new Map;function Dg(a,b){if(a.g){if(b instanceof D&&b.code==7003)throw b;throw new D(2,7,7003,b);}}var Eg=class{constructor(a){this.g=!1;this.h=new gg;this.i=a}destroy(){if(this.g)return this.h;this.g=!0;return this.i().then(()=>{this.h.resolve()},()=>{this.h.resolve()})}};function Fg(a){const b=new Map;for(const c of Object.keys(a))b.set(c,a[c]);return b}function Gg(a){const b={};a.forEach((c,d)=>{b[d]=c});return b};function Hg(){return new D(2,3,3E3)}
var Jg=class{constructor(a,b){this.h=db(a);this.i=b==Ig;this.g=0}Ma(){return this.g<this.h.byteLength}Qa(){return this.g}getLength(){return this.h.byteLength}ba(){try{const a=this.h.getUint8(this.g);this.g+=1;return a}catch(a){throw Hg();}}Ga(){try{const a=this.h.getUint16(this.g,this.i);this.g+=2;return a}catch(a){throw Hg();}}Y(){try{const a=this.h.getUint32(this.g,this.i);this.g+=4;return a}catch(a){throw Hg();}}vg(){try{const a=this.h.getInt32(this.g,this.i);this.g+=4;return a}catch(a){throw Hg();
}}md(){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 Hg();}if(b>2097151)throw new D(2,3,3001);this.g+=8;return b*4294967296+a}Kb(a,b){if(this.g+a>this.h.byteLength)throw Hg();const c=$a(this.h,this.g,a);this.g+=a;return b?new Uint8Array(c):c}skip(a){if(this.g+a>this.h.byteLength)throw Hg();this.g+=a}Gh(a){if(this.g<a)throw Hg();this.g-=a}seek(a){if(a<0||a>this.h.byteLength)throw Hg();
this.g=a}ld(){for(var a=this.g;this.Ma()&&this.h.getUint8(this.g)!=0;)this.g+=1;a=$a(this.h,a,this.g-a);this.g+=1;return xb(a)}};x("shaka.util.DataViewReader",Jg);Jg.prototype.readTerminatedString=Jg.prototype.ld;Jg.prototype.seek=Jg.prototype.seek;Jg.prototype.rewind=Jg.prototype.Gh;Jg.prototype.skip=Jg.prototype.skip;Jg.prototype.readBytes=Jg.prototype.Kb;Jg.prototype.readUint64=Jg.prototype.md;Jg.prototype.readInt32=Jg.prototype.vg;Jg.prototype.readUint32=Jg.prototype.Y;
Jg.prototype.readUint16=Jg.prototype.Ga;Jg.prototype.readUint8=Jg.prototype.ba;Jg.prototype.getLength=Jg.prototype.getLength;Jg.prototype.getPosition=Jg.prototype.Qa;Jg.prototype.hasMoreData=Jg.prototype.Ma;var Ig=1;Jg.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:Ig};function Kg(a){let b=0;for(const c of a)b=b<<8|c.charCodeAt(0);return b}function Lg(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function Mg(a){const b=Ng(a);for(;a.reader.Ma()&&!a.parser.g;)a.parser.hd(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function Ng(a){return 8+(a.has64BitSize?8:0)+(a.flags!=null?4:0)}function Og(a){const b=Ng(a),c=a.reader.Y();for(let d=0;d<c&&(a.parser.hd(a.start+b,a.reader,a.partialOkay,a.stopOnPartial),!a.parser.g);d++);}
function Pg(a){const b=Ng(a);for(a.reader.skip(78);a.reader.Ma()&&!a.parser.g;)a.parser.hd(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function Qg(a){const b=Ng(a);a.reader.skip(8);const c=a.reader.Ga();a.reader.skip(6);c==2?a.reader.skip(48):a.reader.skip(12);for(c==1&&a.reader.skip(16);a.reader.Ma()&&!a.parser.g;)a.parser.hd(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function Rg(a,b){return c=>{a(c.reader.Kb(c.reader.getLength()-c.reader.Qa(),b))}}
var Ug=class{constructor(){this.i=new Map;this.h=new Map;this.g=!1}box(a,b){a=Kg(a);this.i.set(a,Sg);this.h.set(a,b);return this}boxes(a,b){for(const c of a)this.box(c,b);return this}ra(a,b){a=Kg(a);this.i.set(a,Tg);this.h.set(a,b);return this}stop(){this.g=!0}parse(a,b,c){a=new Jg(a,0);for(this.g=!1;a.Ma()&&!this.g;)this.hd(0,a,b,c)}hd(a,b,c,d){const e=b.Qa();if(d&&e+8>b.getLength())this.g=!0;else{var f=b.Y(),g=b.Y(),h=Lg(g),k=!1;switch(f){case 0:f=b.getLength()-e;break;case 1:if(d&&b.Qa()+8>b.getLength()){this.g=
!0;return}f=b.md();k=!0}var l=this.h.get(g);if(l){let n=null;var m=null;if(this.i.get(g)==Tg){if(d&&b.Qa()+4>b.getLength()){this.g=!0;return}m=b.Y();n=m>>>24;m&=16777215}g=e+f;c&&g>b.getLength()&&(g=b.getLength());d&&g>b.getLength()?this.g=!0:(g-=b.Qa(),b=g>0?b.Kb(g,!1):new Uint8Array(0),b=new Jg(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.Qa(),b.getLength()-b.Qa()))}}};
x("shaka.util.Mp4Parser",Ug);Ug.headerSize=Ng;Ug.typeToString=Lg;Ug.allData=Rg;Ug.audioSampleEntry=Qg;Ug.visualSampleEntry=Pg;Ug.sampleDescription=Og;Ug.children=Mg;Ug.prototype.parseNext=Ug.prototype.hd;Ug.prototype.parse=Ug.prototype.parse;Ug.prototype.stop=Ug.prototype.stop;Ug.prototype.fullBox=Ug.prototype.ra;Ug.prototype.boxes=Ug.prototype.boxes;Ug.prototype.box=Ug.prototype.box;var Sg=0,Tg=1;function Vg(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=db(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=Kb(l),g.set(b,k),k+=b.length}h.setUint32(k,e);g.set(a,k+4);return g}
var Wg=class{constructor(a){this.g=[];this.data=[];(new Ug).boxes(["moov","moof"],Mg).ra("pssh",b=>{if(!(b.version>1)){var c=$a(b.reader.h,-12,b.size);this.data.push(c);b=b.reader.Kb(16,!1);this.g.push(Mb(b))}}).parse(a)}};function Xg(a,b){a=Fg(a);if(a.size!=0){a=Sb(a);for(const c of b)c.video&&(c.video.drmInfos=[a]),c.audio&&(c.audio.drmInfos=[a])}}function Yg(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 Zg(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 $g(){var a="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment 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=tb(),k=async(n,p,r)=>{let q;try{q=await p.createMediaKeys()}catch(v){return}var t=p.getConfiguration().sessionTypes,u=t?t.includes("persistent-license"):!1;h.$()&&(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(r&&"getStatusForPolicy"in q)for(const v of d)if(!u.minHdcpVersions.includes(v))if(await q.getStatusForPolicy({minHdcpVersion:v})=="usable")u.minHdcpVersions.includes(v)||u.minHdcpVersions.push(v);else break},l=async(n,p,r,q,t=!1)=>{try{const u=nd(e);for(const w of u.videoCapabilities)w.encryptionScheme=
p,w.robustness=r;for(const w of u.audioCapabilities)w.encryptionScheme=p,w.robustness=q;const v=nd(u);v.persistentState="required";v.sessionTypes=["persistent-license"];p=[v,u];let y;y=tb().i()=="MOBILE"?await mf(5,navigator.requestMediaKeySystemAccess(n,p)):await navigator.requestMediaKeySystemAccess(n,p);await k(n,y,t)}catch(u){}},m=[];for(b of a){g.set(b,null);if(tb().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 Gg(g)}
function ah(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=>Za(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&&Za(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 bh(a){var b=a.W;const c=a.X;c.clear();b.forEach((d,e)=>c.set(e,d));b=Array.from(c.values());b.length&&b.every(d=>d=="expired")&&a.A(new D(2,6,6014));a.D.Re(Gg(c))}function ch(a){a.i.forEach((b,c)=>{const d=b.qg;let e=c.expiration;isNaN(e)&&(e=Infinity);e!=d&&(a.D.onExpirationUpdated(c.sessionId,e),b.qg=e)})}
async function dh(a){a.u.release();a.u=null;a.l.reject();a.F.stop();a.F=null;a.K.stop();a.K=null;await eh(a);if(a.j){try{await a.j.setMediaKeys(null)}catch(b){sa("DrmEngine.destroyNow_ exception",b)}a.j=null}a.g=null;a.B=null;a.C=new Map;a.h=null;a.A=()=>{};a.D=null;a.M=!1;a.H=null}
async function eh(a){const b=Array.from(a.i.entries());a.i.clear();await Promise.all(b.map(async([c,d])=>{try{a.V||a.C.has(c.sessionId)||d.type!=="persistent-license"||a.h.persistentSessionOnlinePlayback?await fh(c):await c.remove()}catch(e){}}))}
async function gh(a,b,c){Xg(a.h.clearKeys,b);const d=b.some(k=>k.video&&k.video.drmInfos.length||k.audio&&k.audio.drmInfos.length?!0:!1),e=Fg(a.h.servers),f=Fg(a.h.advanced||{});!d&&c&&Yg(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),Zg(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 wf(b,a.O,a.M,a.h.preferredKeySystems);Dg(a.m);if(!(d||e.size>0))return a.P=!0,Promise.resolve();b=hh(a,b);return d?b:b.catch(()=>{})}function ih(a,b,c){a.V=!0;a.C=new Map;a.O=c;return gh(a,b,!1)}
function jh(a,b,c,d=!0){a.C=new Map;for(const e of c)a.C.set(e,{initData:null,initDataType:null});for(const e of a.h.persistentSessionsMetadata)a.C.set(e.sessionId,{initData:e.initData,initDataType:e.initDataType});a.O=a.C.size>0;return gh(a,b,d)}
async function hh(a,b){const c=new Map;b=kh(a,b,c);if(!b){if(!navigator.requestMediaKeySystemAccess)throw new D(2,6,6020);throw new D(2,6,6001);}Dg(a.m);try{b.getConfiguration();const d=a.h.keySystemsMapping[b.keySystem]||b.keySystem;a.g=lh(a,d,c.get(d));if(!a.g.licenseServerUri)throw new D(2,6,6012,a.g.keySystem);const e=await b.createMediaKeys();Dg(a.m);a.B=e;if(a.h.minHdcpVersion!=""&&"getStatusForPolicy"in a.B)try{if(await a.B.getStatusForPolicy({minHdcpVersion:a.h.minHdcpVersion})!="usable")throw new D(2,
6,6018);Dg(a.m)}catch(f){if(f instanceof D)throw f;throw new D(2,6,6019,f.message);}a.P=!0;a.F.wa(a.h.updateExpirationTime);await mh(a);Dg(a.m)}catch(d){Dg(a.m,d);a.g=null;if(d instanceof D)throw d;throw new D(2,6,6002,d.message);}}
async function nh(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=Rb(b,k,null);k.licenseServerUri=c;k.serverCertificate=d;k.persistentStateRequired=!0;k.sessionType="persistent-license";return k};g=Wf(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 wf([g],!0,a.M,[]);Dg(a.m);return hh(a,[g])}
async function oh(a){if(!a.j.mediaKeys){if(a.H)await a.H;else try{a.H=a.j.setMediaKeys(a.B),await a.H}catch(b){a.A(new D(2,6,6003,b.message))}Dg(a.m)}}
function ph(a,b,c){if(c.length){try{c=a.h.initDataTransform(c,b,a.g)}catch(d){b=d;d instanceof D||(b=new D(2,6,6016,d));a.A(b);return}if(a.h.ignoreDuplicateInitData){const d=a.i.values();for(const f of d)if(Za(c,f.initData))return;let e=!1;a.C.forEach(f=>{!e&&Za(c,f.initData)&&(e=!0)});if(e)return}a.J=!0;a.i.size>0&&qh(a)&&(a.l.resolve(),a.J=!1,a.l=new gg,a.l.catch(()=>{}));rh(a,b,c,a.g.sessionType)}}async function sh(a,b){await oh(a);ph(a,b.initDataType,$a(b.initData))}
async function th(a){if(a.C.size){a.C.forEach((c,d)=>{uh(a,d,c)});await a.l;if((a.g&&a.g.keyIds||new Set([])).size>0&&vh(a))return a.l;a.J=!1;a.l=new gg;a.l.catch(()=>{})}const b=(a.g?a.g.initData:[])||[];for(const c of b)ph(a,c.initDataType,c.initData);qh(a)&&a.l.resolve();return a.l}
async function mh(a){if(a.B&&a.g){if(a.g.serverCertificateUri&&(!a.g.serverCertificate||!a.g.serverCertificate.length)){const b=tg([a.g.serverCertificateUri],a.h.retryParameters);try{const c=await a.D.hc.request(5,b,{isPreload:a.R()}).promise;a.g.serverCertificate=$a(c.data)}catch(c){throw new D(2,6,6017,c);}if(a.m.g)return}if(a.g.serverCertificate&&a.g.serverCertificate.length)try{await a.B.setServerCertificate(a.g.serverCertificate)}catch(b){throw new D(2,6,6004,b.message);}}}
async function uh(a,b,c){let d;try{d=a.B.createSession("persistent-license")}catch(e){return b=new D(2,6,6005,e.message),a.A(b),Promise.reject(b)}a.u.o(d,"message",e=>{wh(a)?a.L.push(e):xh(a,e)});a.u.o(d,"keystatuseschange",e=>yh(a,e));c={initData:c.initData,initDataType:c.initDataType,loaded:!1,qg:Infinity,Bb:null,type:"persistent-license"};a.i.set(d,c);try{const e=await d.load(b);Dg(a.m);e||(a.i.delete(d),a.A(new D(a.h.persistentSessionOnlinePlayback?1:2,6,6013)),c.loaded=!0);zh(a,c);Ah(a);return d}catch(e){Dg(a.m,
e),a.i.delete(d),a.A(new D(a.h.persistentSessionOnlinePlayback?1:2,6,6005,e.message)),c.loaded=!0,Ah(a)}return Promise.resolve()}async function Bh(a,b){if(b=await uh(a,b,{initData:null,initDataType:null})){var c=[],d=a.i.get(b);d&&(d.Bb=new gg,c.push(d.Bb));c.push(b.remove());await Promise.all(c);a.i.delete(b)}}function vh(a){const b=a.g&&a.g.keyIds||new Set([]);for(const c of b)if(a.W.get(c)!=="usable")return!1;return!0}function qh(a){a=a.i.values();return Da(a,b=>b.loaded)}
function lh(a,b,c){const d=[],e=[],f=[],g=[],h=[],k=new Set,l=new Set;ah(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 rh(a,b,c,d){let e;try{e=a.B.createSession(d)}catch(f){a.A(new D(2,6,6005,f.message));return}a.u.o(e,"message",f=>{wh(a)?a.L.push(f):xh(a,f)});a.u.o(e,"keystatuseschange",f=>yh(a,f));a.i.set(e,{initData:c,initDataType:b,loaded:!1,qg:Infinity,Bb:null,type:d});a.h.logLicenseExchange&&Ib(c);e.generateRequest(b,c).catch(f=>{if(!a.m.g){a.i.delete(e);var g=f.errorCode;if(g&&g.systemCode){var h=g.systemCode;h<0&&(h+=4294967296);h="0x"+h.toString(16)}a.A(new D(2,6,6006,f.message,f,h))}})}
function Ch(a){a=a.i.keys();a=Ca(a,b=>b.sessionId);return Array.from(a)}function Dh(a){return a.I?a.I:NaN}
function kh(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.has(g.keySystem)||c.set(g.keySystem,[]),c.get(g.keySystem).push(g)}if(c.size==1&&c.has(""))throw new D(2,6,6E3);d=a.h.preferredKeySystems;d.length||(e=Fg(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 Ah(a){qh(a)&&a.l.resolve()}function zh(a,b){(new H(()=>{b.loaded=!0;Ah(a)})).Z(Eh)}
function yh(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=tb();if(mb(a.g.keySystem)&&g.byteLength==16&&h.L()){h=db(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)}f!="status-pending"&&(c.loaded=!0);f=="expired"&&(d=!0);g=Mb(g).slice(0,32);a.W.set(g,f)});const e=b.expiration-Date.now();(e<0||d&&e<1E3)&&c&&!c.Bb&&(a.i.delete(b),fh(b));qh(a)&&(a.l.resolve(),
a.K.Z(Fh))}function wh(a){return a.j?a.h.delayLicenseRequestUntilPlayed&&a.j.paused&&!a.$:!a.V&&a.h.delayLicenseRequestUntilPlayed}
async function xh(a,b){var c=b.target;a.h.logLicenseExchange&&Ib(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=tg([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);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=Bb(e.body);if(g){var h=JSON.parse(g);h.type||(h.type=b.sessionType,e.body=Cb(JSON.stringify(h)))}}catch(m){}}if(mb(a.g.keySystem))if(g=yb(e.body,!0,!0),g.includes("PlayReadyKeyMessage")){g=sd(g,"PlayReadyKeyMessage");h=Cd(g,"HttpHeader");for(var k of h)h=Cd(k,"name")[0],b=Cd(k,"value")[0],e.headers[Ad(h)]=Ad(b);k=Cd(g,"Challenge")[0];e.body=Jb(Ad(k))}else e.headers["Content-Type"]="text/xml; charset=utf-8";k=Date.now();try{const m=a.D.hc.request(2,
e,{isPreload:a.R()});a.T.push(m);var l=await m.promise;tc(a.T,m)}catch(m){if(a.m.g)return;l=new D(2,6,6007,m,{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType});a.i.size==1?(a.A(l),d&&d.Bb&&d.Bb.reject(l)):(d&&d.Bb&&d.Bb.reject(l),a.i.delete(c),qh(a)&&(a.l.resolve(),a.K.Z(.1)));return}if(!a.m.g){a.I+=(Date.now()-k)/1E3;a.h.logLicenseExchange&&Ib(l.data);try{await c.update(l.data)}catch(m){c=new D(2,6,6008,m&&m.message||String(m));a.A(c);d&&d.Bb&&d.Bb.reject(c);
return}a.m.g||(c=new C("drmsessionupdate"),a.D.onEvent(c),d&&(d.Bb&&d.Bb.resolve(),zh(a,d)))}}async function Gh(a){a.J&&!wh(a)&&(await a.l,await Promise.all(a.T.map(b=>b.promise)))}async function fh(a){try{await mf(Hh,Promise.all([a.close().catch(()=>{}),a.closed]))}catch(b){}}
var Ih=class{constructor(a){this.D=a;this.j=this.B=null;this.V=this.P=!1;this.I=0;this.g=null;this.u=new zc;this.i=new Map;this.T=[];this.C=new Map;this.J=!1;this.l=new gg;this.h=null;this.A=b=>{b.severity==2&&this.l.reject(b);a.onError(b)};this.W=new Map;this.X=new Map;this.K=new H(()=>bh(this));this.O=!1;this.L=[];this.$=!1;this.F=new H(()=>{ch(this)});this.l.catch(()=>{});this.m=new Eg(()=>dh(this));this.M=!1;this.G=this.H=null;this.R=()=>!1}destroy(){return this.m.destroy()}configure(a,b){this.h=
a;b&&(this.R=b);this.F&&this.P&&this.g&&this.F.wa(this.h.updateExpirationTime)}async Db(a){this.j!==a&&(this.B?(this.j=a,this.h.delayLicenseRequestUntilPlayed&&this.u.sa(this.j,"play",()=>{for(const b of this.L)xh(this,b);this.$=!0;this.L=[]}),this.j.remote?(this.u.o(this.j.remote,"connect",()=>eh(this)),this.u.o(this.j.remote,"connecting",()=>eh(this)),this.u.o(this.j.remote,"disconnect",()=>eh(this))):"webkitCurrentPlaybackTargetIsWireless"in this.j&&this.u.o(this.j,"webkitcurrentplaybacktargetiswirelesschanged",
()=>eh(this)),this.G=this.g?this.g.initData.find(b=>b.initData.length>0)||null:null,a=this.g.keySystem,(a=tb().R(a))||!this.G&&this.g.keySystem==="com.apple.fps"&&!this.C.size||await oh(this),th(this).catch(()=>{}),!a&&(this.G||this.C.size||this.h.parseInbandPsshEnabled)||this.u.o(this.j,"encrypted",b=>sh(this,b))):this.u.sa(a,"encrypted",()=>{this.A(new D(2,6,6010))}))}Vf(){var a=this.i.keys();a=Ca(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)}Cd(){let a=Infinity;const b=this.i.keys();for(const c of b)isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a}se(){return Gg(this.X)}},Hh=1,Eh=5,Fh=.5;function Jh(a,b){const c=a.g!==b;a.g=b;c&&b===Kh&&(a.i=Date.now());return c}var Mh=class{constructor(){this.g=Kh;this.j=(new Map).set(Kh,2).set(Lh,1);this.i=0;this.h=-1}},Lh=0,Kh=1;function Nh(a,b){const c=Oh(a,b);if(b){const d=a.g?a.g.g:null;if(d&&a.g.B){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)Ph(a,d.keySystem,f)}Qh(a,b)}return c}
async function Rh(a,b){await rf(a.g,b,a.h.drm.preferredKeySystems,a.h.drm.keySystemsMapping);a.h.streaming.dontChooseCodecs||nf(b,a.h.preferredVideoCodecs,a.h.preferredAudioCodecs,a.h.preferredDecodingAttributes,a.h.preferredTextFormats);if(!b.variants.some(Pf))throw new D(2,4,4032);return Nh(a,b)}function Oh(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=qf(e,b,a),c!=e.allowedByApplication&&(d=!0);return d}
function Ph(a,b,c){for(const d of c.drmInfos)if(d.keySystem==b){for(const e of d.initData||[])ph(a.g,e.initDataType,e.initData);c=a.g;c.g&&(c.g.mediaTypes!==d.mediaTypes&&(c.g.mediaTypes=d.mediaTypes),ib(d)&&(c.g=lh(c,c.g.keySystem,[c.g,d])))}}
function Qh(a,b){const c=a.g?a.g.se():{};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])?Sh.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 D(2,4,4012,b);}
var Th=class{constructor(a,b,c){this.h=a;this.i=b;this.g=c}},Sh=["output-restricted","internal-error"];x("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});function Uh(a){if(Vh.has(a))return Vh.get(a);var b=window.ManagedMediaSource||window.MediaSource;return b?(b=b.isTypeSupported(a),Vh.set(a,b),b):!1}function Wh(){const a=window.ManagedMediaSource||window.MediaSource;return a&&a.prototype?!!a.prototype.setLiveSeekableRange&&!!a.prototype.clearLiveSeekableRange:!1}var Vh=new Map;function Xh(a,b){let c=null,d=null,e=null,f=null;const g=a.Y();b&1&&(e=a.md());b&2&&(f=a.Y());b&8&&(c=a.Y());b&16&&(d=a.Y());return{trackId:g,yd:c,zd:d,ji:e,Hh:f}}function Yh(a,b){return b==1?(b=a.Y(),a=a.Y(),{baseMediaDecodeTime:b*4294967296+a}):{baseMediaDecodeTime:a.Y()}}function Zh(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.Y();a.skip(4);a=a.Ga();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
function $h(a,b,c){const d=a.Y(),e=[];let f=null;c&1&&(f=a.vg());c&4&&a.skip(4);for(let g=0;g<d;g++){const h={Dg:null,sampleSize:null,Xe:null};c&256&&(h.Dg=a.Y());c&512&&(h.sampleSize=a.Y());c&1024&&a.skip(4);c&2048&&(h.Xe=b==0?a.Y():a.vg());e.push(h)}return{Ml:d,Cg:e,Cf:f}}function ai(a){a.skip(6);a.skip(2);a.skip(8);const b=a.Ga();a.skip(2);a.skip(2);a.skip(2);a=a.Ga()+a.Ga()/65536;return{channelCount:b,sampleRate:a}}
function bi(a,b=!1){a=a.toString(16).toUpperCase();return b?a:("0"+a).slice(-2)}function ci(a){a=a.Y();return{codec:Lg(a)}}
function di(a){let b=null,c=null;var d=a.Kb(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.Ga()){case 1:case 5:case 6:case 7:b="srgb";break;case 9:b="rec2020";break;case 11:case 12:b="p3"}d=a.Ga();a.Ga();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,Ud:c}}function ei(a){return(a<10?"0":"")+a};function fi(a){return a.encrypted&&a.drmInfos.length>0}function gi(a,...b){let c=hi.get(a);c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],hi.set(a,c));a=8;for(var d=b.length-1;d>=0;d--)a+=b[d].byteLength;d=new Uint8Array(a);d[0]=a>>24&255;d[1]=a>>16&255;d[2]=a>>8&255;d[3]=a&255;d.set(c,4);for(let e=0,f=8;e<b.length;e++)d.set(b[e],f),f+=b[e].byteLength;return d}
function ii(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/(ji+1));k=Math.floor(k%(ji+1));f=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,...ki(f,4),0,0,0,0,...ki(l,4),...ki(k,4),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,...ki(g,2),0,
0,...ki(h,2),0,0]);f=gi("tkhd",f);h=c.duration*c.timescale;g=Math.floor(h/(ji+1));h=Math.floor(h%(ji+1));l=c.stream.language;l=l.charCodeAt(0)-96<<10|l.charCodeAt(1)-96<<5|l.charCodeAt(2)-96;g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,...ki(c.timescale,4),...ki(g,4),...ki(h,4),...ki(l,2),0,0]);g=gi("mdhd",g);h=new Uint8Array([]);switch(c.type){case "video":h=li.value();break;case "audio":h=mi.value()}h=gi("hdlr",h);a:{switch(c.type){case "video":l=gi("minf",gi("vmhd",ni.value()),oi.value(),
pi(c));break a;case "audio":l=gi("minf",gi("smhd",qi.value()),oi.value(),pi(c));break a}l=new Uint8Array([])}g=gi("mdia",g,h,l);f=gi("trak",f,g);e.call(d,f)}d=a.g[0];c=d.duration*d.timescale;e=Math.floor(c/(ji+1));c=Math.floor(c%(ji+1));e=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,...ki(d.timescale,4),...ki(e,4),...ki(c,4),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]);e=gi("mvhd",e);c=[];for(m of a.g)a=c,f=a.push,g=new Uint8Array([0,0,0,0,...ki(m.id+1,4),0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]),g=gi("trex",g),f.call(a,g);var m=gi("mvex",...c);b=gi("moov",e,...b,m,ri(d.stream));m=si.value();a=new Uint8Array(m.byteLength+b.byteLength);a.set(m);a.set(b,m.byteLength);return a}function ri(a){const b=[];if(!fi(a))return new Uint8Array([]);for(const c of a.drmInfos)if(c.initData)for(const d of c.initData)b.push(d.initData);return Nb(...b)}
function ki(a,b){const c=[];for(--b;b>=0;b--)c.push(a>>8*b&255);return c}
function pi(a){var b="aac";a.codecs.includes("mp3")?b="mp3":a.codecs.includes("ac-3")?b=tb().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":if(a.codecs.includes("avc1")){b=a.stream.width||0;c=a.stream.height||0;if(a.Sa.byteLength>0)var d=gi("avcC",a.Sa);else{var e=7,f=[];d=[];var g=0,h=0;let l=0;for(var k=0;k<a.rb.length;k++){const m=ti(a.rb[k]);switch(m[0]&31){case 7:f.push(m);e+=m.length+2;break;case 8:d.push(m),
e+=m.length+2}}f.length>0&&(g=f[0][1],l=f[0][2],h=f[0][3]);e=new Uint8Array(e);k=0;e[k++]=1;e[k++]=g;e[k++]=l;e[k++]=h;e[k++]=255;e[k++]=224|f.length;for(g=0;g<f.length;g++)e[k++]=(f[g].length&65280)>>8,e[k++]=f[g].length&255,e.set(f[g],k),k+=f[g].length;e[k++]=d.length;for(f=0;f<d.length;f++)e[k++]=(d[f].length&65280)>>8,e[k++]=d[f].length&255,e.set(d[f],k),k+=d[f].length;d=gi("avcC",e)}b=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,...ki(b,2),...ki(c,2),0,72,0,0,0,72,0,0,0,0,
0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]);c="avc1";f=ui(a);g=new Uint8Array([]);fi(a.stream)&&(g=vi(a.stream,a.codecs),c="encv");c=gi(c,b,d,f,g)}else a.codecs.includes("hvc1")&&(c=a.stream.width||0,d=a.stream.height||0,b=new Uint8Array([]),a.Sa.byteLength>0&&(b=gi("hvcC",a.Sa)),c=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,...ki(c,2),...ki(d,2),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]),d="hvc1",f=ui(a),g=new Uint8Array([]),fi(a.stream)&&(g=vi(a.stream,a.codecs),d="encv"),c=gi(d,c,b,f,g));break;case "audio":if(b=="mp3")a=gi(".mp3",wi(a));else if(b=="ac-3")b=gi("dac3",a.Fa),c="ac-3",d=new Uint8Array([]),fi(a.stream)&&(d=vi(a.stream,a.codecs),c="enca"),a=gi(c,wi(a),b,d);else if(b=="ec-3")b=gi("dec3",a.Fa),c="ec-3",d=new Uint8Array([]),fi(a.stream)&&(d=vi(a.stream,a.codecs),c="enca"),a=gi(c,wi(a),b,
d);else if(b=="opus")b=gi("dOps",a.Fa),c="Opus",d=new Uint8Array([]),fi(a.stream)&&(d=vi(a.stream,a.codecs),c="enca"),a=gi(c,wi(a),b,d);else{if(a.Fa.byteLength>0)b=gi("esds",a.Fa);else{b=a.id+1;c=a.stream.channelsCount||2;f=a.stream.audioSamplingRate||44100;g=Tb("audio",a.codecs.split(","));h={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=h[f];if(g==="mp4a.40.5"||g==="mp4a.40.29")d=h[f*2];f=parseInt(g.split(".").pop(),10);b=new Uint8Array([0,0,
0,0,3,25,...ki(b,2),0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,f<<3|d>>>1,d<<7|c<<3,6,1,2]);b=gi("esds",b)}c="mp4a";d=new Uint8Array([]);fi(a.stream)&&(d=vi(a.stream,a.codecs),c="enca");a=gi(c,wi(a),b,d)}c=a}a=gi("stsd",xi.value(),c);return gi("stbl",a,gi("stts",yi.value()),gi("stsc",zi.value()),gi("stsz",Ai.value()),gi("stco",Bi.value()))}function ui(a){if(!a.Za&&!a.$a)return new Uint8Array([]);const b=a.$a;a=new Uint8Array([...ki(a.Za,4),...ki(b,4)]);return gi("pasp",a)}
function vi(a,b){b=new Uint8Array([...ki(Ci(b.split(".")[0]),4)]);b=gi("frma",b);var c="cenc";var d=a.drmInfos[0];d&&d.encryptionScheme&&(c=d.encryptionScheme);c=new Uint8Array([0,0,0,0,...ki(Ci(c),4),0,1,0,0]);c=gi("schm",c);d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);for(const e of a.drmInfos)if(e&&e.keyIds&&e.keyIds.size)for(const f of e.keyIds)d=ti(f);a=new Uint8Array([0,0,0,0,0,0,1,8]);a=gi("tenc",a,d);return gi("sinf",b,c,gi("schi",a))}
function ti(a){const b=new Uint8Array(a.length/2);for(let c=0;c<a.length/2;c+=1)b[c]=parseInt(String(a[c*2]+a[c*2+1]),16);return b}function wi(a){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,a.stream.channelsCount||2,0,16,0,0,0,0,...ki(a.stream.audioSamplingRate||44100,2),0,0])}function Ci(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 Di(a){a=(a.data?a.data.pb:[]).map(b=>b.data);return gi("mdat",...a)}
function Ei(a){const b=[];for(const p of a.g){a=b;var c=a.push;var d=new Uint8Array([0,0,0,0,...ki(p.data?p.data.sequenceNumber:0,4)]);d=gi("mfhd",d);var e;var f=p.data?p.data.pb:[];var g=new Uint8Array(4+f.length);for(e=0;e<f.length;e++){var h=f[e].flags;g[e+4]=h.qe<<4|h.Ce<<2|h.ye}f=gi("sdtp",g);h=f.length+32+20+8+16+8+8;g=new Uint8Array([0,0,0,58,...ki(p.id+1,4),0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]);g=gi("tfhd",g);e=p.data?p.data.baseMediaDecodeTime:0;var k=Math.floor(e%(ji+1));e=new Uint8Array([1,
0,0,0,...ki(Math.floor(e/(ji+1)),4),...ki(k,4)]);e=gi("tfdt",e);var l=h;h=p.data?p.data.pb:[];k=h.length;var m=12+16*k;const r=new Uint8Array(m);l+=8+m;r.set([p.type==="video"?1:0,0,15,1,...ki(k,4),...ki(l,4)],0);for(l=0;l<k;l++){var n=h[l];m=ki(n.duration,4);const q=ki(n.size,4),t=n.flags;n=ki(n.jb,4);r.set([...m,...q,t.jg<<2|t.qe,t.Ce<<6|t.ye<<4|t.lg,t.pe&61440,t.pe&15,...n],12+16*l)}h=gi("trun",r);f=gi("traf",g,e,h,f);d=gi("moof",d,f);c.call(a,d,Di(p))}return Nb(...b)}
var Fi=class{constructor(a=[]){this.g=a}},ji=4294967295,hi=new Map,li=new fb(()=>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])),mi=new fb(()=>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])),yi=new fb(()=>new Uint8Array([0,0,0,0,0,0,0,0])),zi=new fb(()=>new Uint8Array([0,0,0,0,0,0,0,0])),Bi=new fb(()=>new Uint8Array([0,0,0,0,0,0,0,0])),Ai=new fb(()=>new Uint8Array([0,
0,0,0,0,0,0,0,0,0,0,0])),ni=new fb(()=>new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])),qi=new fb(()=>new Uint8Array([0,0,0,0,0,0,0,0])),xi=new fb(()=>new Uint8Array([0,0,0,0,0,0,0,1])),si=new fb(()=>{const a=new Uint8Array([105,115,111,109]),b=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);return gi("ftyp",a,c,a,b)}),oi=new fb(()=>{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=gi("dref",a);return gi("dinf",a)});function Gi(a){a=$a(a);let b=null;(new Ug).boxes(["moov","trak","mdia","minf","stbl"],Mg).ra("stsd",Og).box("enca",c=>{b=c.reader.h;return Qg(c)}).box("sinf",Mg).box("frma",c=>{c.parser.stop();({codec:c}=ci(c.reader));c==="ec-3"&&b&&b.getUint16(16)!==2&&b.setUint16(16,2)}).parse(a);return a}
function Hi(a,b,c){let d=b=$a(b),e=!1,f;const g=[],h=[];(new Ug).boxes(["moov","trak","mdia","minf","stbl"],k=>{g.push(k);Mg(k)}).ra("stsd",k=>{f=k;g.push(k);Og(k)}).boxes(["encv","enca"],k=>{e=!0;k.parser.stop()}).boxes("dvav dva1 dvh1 dvhe dvc1 dvi1 hev1 hvc1 avc1 avc3".split(" "),k=>{h.push({box:k,Bh:1701733238})}).boxes("ac-3 ec-3 ac-4 Opus fLaC mp4a".split(" "),k=>{h.push({box:k,Bh:1701733217})}).parse(b);if(e)return b;if(h.length==0||!f)throw za(Mb(b)),new D(2,3,3019,c);h.reverse();for(const k of h)d=
Ii(a,d,f,k.box,g,k.Bh);d=Ji(a,d);return tb().T()?(a=new Uint8Array(b.byteLength+d.byteLength),a.set(d),a.set(b,d.byteLength),a):d}function Ki(a){a=$a(a);const b=[];(new Ug).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(Li(a.subarray(e?e.start+e.size:0,f.start+f.size)))}return Nb(...c)}
function Li(a){let b,c,d,e;const f=[];(new Ug).boxes(["moof","traf"],k=>{f.push(k);Mg(k)}).ra("tfhd",k=>{b=k;d=Xh(k.reader,k.flags)}).ra("trun",k=>{c=k;e=$h(k.reader,k.version,k.flags)}).parse(a);if(d&&d.Hh!==2){const k=b.start+Ng(b)+4+(d.ji!==null?8:0);var g=db(a);if(d.Hh!==null)g.setUint32(k,2);else{Mi(a,b.start,b.size+4);var h=g.getUint32(b.start+8);g.setUint32(b.start+8,h|2);e&&e.Cf!==null&&g.setInt32(c.start+Ng(c)+4,e.Cf+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)Mi(a,l.start,l.size+4)}}return a}function Mi(a,b,c){a=db(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 Ii(a,b,c,d,e,f){var g=vi(a,d.name);const h=b.subarray(d.start,d.start+d.size);a=new Uint8Array(d.size+g.byteLength);a.set(h,0);db(a).setUint32(4,f);a.set(g,d.size);Mi(a,0,a.byteLength);f=new Uint8Array(b.byteLength+a.byteLength);d=tb().K()?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 k of e)Mi(f,k.start,k.size+a.byteLength);b=db(f,c.start);c=Ng(c);e=b.getUint32(c);b.setUint32(c,e+1);return f}
function Ji(a,b){a=ri(a);if(a.byteLength===0)return b;let c=0,d=0;(new Ug).box("moov",h=>{c=h.start;d=h.size;h.parser.stop()}).parse(b);const e=c+d;Mi(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 Ni(a){const b=$a(a),c=[];(new Ug).boxes(["moov","trak","mdia","minf","stbl"],d=>{c.push({start:d.start,size:d.size});Mg(d)}).box("stsd",d=>{c.push({start:d.start,size:d.size});const e=db(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 Oi(a,b){return a===b?!0:a&&b?a.wc()==b.wc()&&a.uc()==b.uc()&&xc(a.S().sort(),b.S().sort())&&Za(a.Rb(),b.Rb()):a==b}var Pi=class{constructor(a,b,c,d=null,e=null,f=null,g=null,h=!1){this.S=a;this.startByte=b;this.endByte=c;this.ed=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}Qd(a){this.h=a}Rb(){return this.h}};x("shaka.media.InitSegmentReference",Pi);Pi.prototype.getEndByte=Pi.prototype.uc;
Pi.prototype.getStartByte=Pi.prototype.wc;function Qi(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.g.length>0&&a.m)for(const b of a.g){Qi(b);break}return null}function Ri(a,b){a.ha=b;for(const c of a.g)Ri(c,b)}
var I=class{constructor(a,b,c,d,e,f,g,h,k,l=[],m="",n=null,p=null,r=Si,q=null,t=!1){this.startTime=a;this.j=this.endTime=b;this.C=c;this.startByte=d;this.endByte=e;this.ha=f;this.timestampOffset=g;this.appendWindowStart=h;this.appendWindowEnd=k;this.g=l;this.tilesLayout=m;this.B=n;this.h=p;this.status=r;this.preload=!1;this.l=!0;this.u=!1;this.aesKey=q;this.thumbnailSprite=null;this.i=-1;this.m=t;this.Id=this.Kc=!1;for(const u of this.g)u.Ah();this.m&&this.g.length&&this.g[this.g.length-1].yh();this.A=
this.bandwidth=this.mimeType=this.codecs=null;this.D=!1}S(){return this.C()}getStartTime(){return this.startTime}Ji(){return this.endTime}wc(){return this.startByte}uc(){return this.endByte}fj(){return this.tilesLayout}ej(){return this.B}Sb(){return this.status}Aj(){this.status=Ti}ng(){this.preload=!0}isPreload(){return this.preload}dd(){this.l=!1}qj(){return this.l}Ah(){this.Kc=!0}sj(){return this.Kc}yh(){this.Id=!0}rj(){return this.Id}xh(){this.u=!0}nj(){return this.u}df(a){this.thumbnailSprite=
a}dj(){return this.thumbnailSprite}offset(a){this.startTime+=a;this.endTime+=a;this.j+=a;for(const b of this.g)b.startTime+=a,b.endTime+=a,b.j+=a}Mg(a){this.h==null?ra("Sync attempted without sync time!"):(a=this.h-a-this.startTime,Math.abs(a)>=.001&&this.offset(a))}Qd(a,b=!1){this.A=a;this.D=b}Rb(a=!0){const b=this.A;a&&this.D&&(this.A=null);return b}};x("shaka.media.SegmentReference",I);I.prototype.getSegmentData=I.prototype.Rb;I.prototype.setSegmentData=I.prototype.Qd;I.prototype.syncAgainst=I.prototype.Mg;
I.prototype.offset=I.prototype.offset;I.prototype.getThumbnailSprite=I.prototype.dj;I.prototype.setThumbnailSprite=I.prototype.df;I.prototype.hasByterangeOptimization=I.prototype.nj;I.prototype.markAsByterangeOptimization=I.prototype.xh;I.prototype.isLastPartial=I.prototype.rj;I.prototype.markAsLastPartial=I.prototype.yh;I.prototype.isPartial=I.prototype.sj;I.prototype.markAsPartial=I.prototype.Ah;I.prototype.isIndependent=I.prototype.qj;I.prototype.markAsNonIndependent=I.prototype.dd;
I.prototype.isPreload=I.prototype.isPreload;I.prototype.markAsPreload=I.prototype.ng;I.prototype.markAsUnavailable=I.prototype.Aj;I.prototype.getStatus=I.prototype.Sb;I.prototype.getTileDuration=I.prototype.ej;I.prototype.getTilesLayout=I.prototype.fj;I.prototype.getEndByte=I.prototype.uc;I.prototype.getStartByte=I.prototype.wc;I.prototype.getEndTime=I.prototype.Ji;I.prototype.getStartTime=I.prototype.getStartTime;I.prototype.getUris=I.prototype.S;var Si=0,Ti=1;I.Status={rk:Si,El:Ti,Vk:2};function Ui(a){return a.length==1&&a.end(0)-a.start(0)<1E-4}function Vi(a){return!a||Ui(a)?null:a.length==1&&a.start(0)<0?0:a.length?a.start(0):null}function Wi(a){return!a||Ui(a)?null:a.length?a.end(a.length-1):null}function Xi(a,b){return!a||!a.length||Ui(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function Yi(a,b){if(!a||!a.length||Ui(a))return 0;let c=0;for(const {start:d,end:e}of Zi(a))e>b&&(c+=e-Math.max(d,b));return c}
function Zi(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 $i(a,b,c){if(!a||!a.length||Ui(a))return null;a=Zi(a).findIndex((d,e,f)=>d.start>b&&(e==0||f[e-1].end-b<=c));return a>=0?a:null};function J(a){return document.createElement(a)}function aj(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function bj(){const a=document.createElement("button");a.setAttribute("type","button");return a}function cj(a,b=""){const c=document.createElement("source");c.src=a;c.type=b;return c}function dj(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 ej(a){a=a.getElementsByClassName("shaka-overflow-quality-mark");return a.length?a[0]:null}function fj(a){for(;a.firstChild;)a.removeChild(a.firstChild)}function gj(){if(hj)return hj;ij||=new H(()=>{hj=null});(hj=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(hj=document.createElement("video"));ij.Z(1);return hj}
async function jj(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 kj=class{};x("shaka.util.Dom",kj);kj.removeAllChildren=fj;kj.clearSourceFromVideo=dj;var ij=null,hj=null;function lj(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 mj(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 nj(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 oj(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=xb($a(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=xb($a(a.data,3+c,f));let h;d==="--\x3e"?h=xb($a(a.data,4+c+f)):h=bb(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=xb($a(a.data,1,d));a=xb($a(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=xb($a(a.data,1,d));a=xb($a(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=xb($a(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=bb(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=xb(a.data.subarray(1)).replace(/\0*$/,"");b.data=a;return b}return a.type[0]==="W"?(a=xb(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=bb(a.data),b):null}
function pj(a){let b=0;const c=[];for(;lj(a,b);){var d=nj(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=nj(e,4);e={type:String.fromCharCode(e[0],e[1],e[2],e[3]),size:f,data:e.subarray(10,10+f)};(f=oj(e))&&c.push(f);b+=e.size+10}mj(a,b)&&(b+=10)}return c}function qj(a,b=0){const c=b;let d=0;for(;lj(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=nj(a,b+6),mj(a,b+10)&&(d+=10),b+=d;return d>0?a.subarray(c,c+d):new Uint8Array([])}var rj=class{};x("shaka.util.Id3Utils",rj);
rj.getID3Data=qj;rj.getID3Frames=pj;function sj(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 tj(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 uj(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 vj(a,b){if(a.g<=b){b-=a.g;const c=Math.floor(b/8);b-=c*8;a.g-=c;uj(a)}a.h<<=b;a.g-=b}function wj(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&&uj(a);c=b-c;return c>0?d<<c|wj(a,c):d}
function xj(a){let b=0;for(;a.g===0;){if(a.i===0)return b;uj(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;uj(a)}return b}function yj(a){vj(a,1+xj(a))}function K(a){const b=xj(a);return wj(a,b+1)-1}function zj(a){a=K(a);return 1&a?1+a>>>1:-1*(a>>>1)}function O(a){return wj(a,1)===1}function Aj(a){return wj(a,8)}function Bj(a,b){let c=8;var d=8;for(let e=0;e<b;e++)d!==0&&(d=zj(a),d=(c+d+256)%256),c=d===0?c:d}function Cj(a){Aj(a);K(a);return K(a)}
var Dj=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=$a(b,0,c)}this.i=this.j.byteLength;this.g=this.h=0}};x("shaka.util.ExpGolomb",Dj);function Ej(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 Fj(a){return Ej(a)<0?!1:!0}function Gj(a,b,c){return Ob(a,b[c],c+1<b.length?b[c+1]:a.length)}function Hj(a,b){let c=1;for(a>b&&(c=-1);Math.abs(b-a)>4294967296;)a+=c*8589934592;return a}
function Ij(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.B==null&&(a.B=g);d=Hj(g,a.B);e=a.B=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.A==null&&(a.A=e),e=d!=g?Hj(e,a.A):e);a.A=e}a=b[8]+9;return b.byteLength<=a?null:{data:b.subarray(a),packetLength:c,
pts:d,dts:e,nalus:[]}}
function Jj(a){const b={height:null,width:null,codec:null,frameRate:null};var c=a.xe();if(!c.length)return b;c=c.find(A=>A.type==33);if(!c)return b;var d=new Dj(c.fullData,!0);Aj(d);Aj(d);wj(d,4);var e=wj(d,3);O(d);var f=wj(d,2),g=wj(d,1);const h=wj(d,5),k=wj(d,32);c=Aj(d);const l=Aj(d),m=Aj(d),n=Aj(d),p=Aj(d),r=Aj(d),q=Aj(d);var t=[],u=[];for(var v=0;v<e;v++)t.push(O(d)),u.push(O(d));if(e>0)for(v=e;v<8;v++)wj(d,2);for(v=0;v<e;v++)t[v]&&wj(d,88),u[v]&&Aj(d);K(d);e=K(d);e==3&&wj(d,1);t=K(d);u=K(d);
let y=v=0,w=0,z=0;O(d)&&(v+=K(d),y+=K(d),w+=K(d),z+=K(d));b.width=String(t-(v+y)*(e===1||e===2?2:1));b.height=String(u-(w+z)*(e===1?2:1));d=(A=>{let B=0;for(let E=0;E<32;E++)B|=(A>>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+q;r&&(f+="."+r.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=Kj(a);return b}
function Lj(a){const b={height:null,width:null,codec:null,frameRate:null};var c=a.xe();if(!c.length)return b;c=c.find(r=>r.type==7);if(!c)return b;c=new Dj(c.data);const d=Aj(c),e=Aj(c),f=Aj(c);yj(c);if(Mj.includes(d)){var g=K(c);g===3&&vj(c,1);yj(c);yj(c);vj(c,1);if(O(c)){g=g!==3?8:12;for(var h=0;h<g;h++)O(c)&&(h<6?Bj(c,16):Bj(c,64))}}yj(c);g=K(c);if(g===0)K(c);else if(g===1)for(vj(c,1),yj(c),yj(c),g=K(c),h=0;h<g;h++)yj(c);yj(c);vj(c,1);g=K(c);h=K(c);const k=wj(c,1);k===0&&vj(c,1);vj(c,1);let l=
0,m=0,n=0,p=0;O(c)&&(l=K(c),m=K(c),n=K(c),p=K(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=Kj(a);return b}function Kj(a){var b=a.Zc();return b.length>1&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?String(Math.abs(1/(b-a)*9E4)):null}
var Nj=class{constructor(){this.K=null;this.L=!1;this.C=this.M=null;this.D=[];this.j=[];this.g=[];this.G=this.H=null;this.l=[];this.i=[];this.h=[];this.I=null;this.u=[];this.m=[];this.F=this.J=this.A=this.B=null}clearData(){this.D=[];this.j=[];this.g=[];this.l=[];this.i=[];this.h=[];this.u=[];this.m=[]}$e(a){this.F!=null&&this.F!=a&&(this.A=this.B=null);this.F=a}parse(a){if(a.length<564)return this;const b=Math.max(0,Ej(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,ze:-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,r=n;for(;r>2;){const q=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,ki:h,sampleRate:48E3}))}p+=q;r-=q}}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.ze==-1&&(f.ze=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.M=e.video,this.C=e.videoCodec);e.audio!=
-1&&(this.H=e.audio,this.G=e.audioCodec);e.ze!=-1&&(this.I=e.ze);d&&!this.L&&(d=!1,k=b-188);this.L=!0;break;case this.M: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.u.length),this.u.push(g)):this.m.length&&this.u.push(g);break;default:d=!0}}return this}Ij(a){Ic("TsParser.parseAvcNalus",
"Please use parseNalus function instead.");return this.sg(a,{Kd:null,state:null})}sg(a,b){var c=a.pts?a.pts/9E4:null;a=a.data;const d=a.byteLength;let e=1;this.C=="hvc"&&(e=2);var f=b.state||0;const g=f;let h=0;const k=[];let l=-1,m=0;const n=this.C==="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.Kd)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=Nb(f.data,p),f.fullData=Nb(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.Kd&&(c=k.length?k[k.length-1]:b.Kd)&&(c.data=Nb(c.data,a),c.fullData=Nb(c.fullData,a));b.state=f;return k}getMetadata(){const a=
[];for(let c=0;c<this.m.length;c++){var b=Gj(this.u,this.m,c);(b=Ij(this,b))&&a.push({cueTime:b.pts?b.pts/9E4:null,data:b.data,frames:pj(b.data),dts:b.dts,pts:b.pts})}return a}ob(){if(this.i.length&&!this.h.length)for(let b=0;b<this.i.length;b++){var a=Gj(this.l,this.i,b);const c=Ij(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=Nb(d.data,a))}return this.h}Zc(a=
!0){if(this.j.length&&!this.g.length){for(var b=0;b<this.j.length;b++){var c=Gj(this.D,this.j,b);const e=Ij(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=Nb(d.data,c))}if(a){b={Kd:null,state:null};d=[];for(const e of this.g)e.nalus=this.sg(e,b),e.nalus.length&&(d.push(e),b.Kd=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.ob();b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4);return a}return a=="video"?(a=null,b=this.Zc(!1),b.length&&(a=b[0],a=Math.min(a.dts,a.pts)/9E4),a):null}Bd(){return{audio:this.G,video:this.C}}xe(){const a=[];for(const b of this.Zc())a.push(...b.nalus);return a}kj(){Ic("TsParser.getVideoResolution","Please use getVideoInfo function instead.");const a=this.dg();return{height:a.height,width:a.width}}dg(){return this.C=="hvc"?Jj(this):Lj(this)}};
x("shaka.util.TsParser",Nj);Nj.syncOffset=Ej;Nj.probe=Fj;Nj.prototype.getVideoInfo=Nj.prototype.dg;Nj.prototype.getVideoResolution=Nj.prototype.kj;Nj.prototype.getVideoNalus=Nj.prototype.xe;Nj.prototype.getCodecs=Nj.prototype.Bd;Nj.prototype.getStartTime=Nj.prototype.getStartTime;Nj.prototype.getVideoData=Nj.prototype.Zc;Nj.prototype.getAudioData=Nj.prototype.ob;Nj.prototype.getMetadata=Nj.prototype.getMetadata;Nj.prototype.parseNalus=Nj.prototype.sg;Nj.prototype.parseAvcNalus=Nj.prototype.Ij;
Nj.prototype.parse=Nj.prototype.parse;Nj.prototype.setDiscontinuitySequence=Nj.prototype.$e;Nj.prototype.clearData=Nj.prototype.clearData;Nj.Timescale=9E4;var Mj=[100,110,122,244,44,83,86,118,128,138,139,134];function Oj(){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"',...Ke];const b={};tb();for(const c of a){if(Ye(c))b[c]=
!0;else if(Qc()){a=Re(c);const d=Gf(Se(c),a);a=Ie(a,d);b[c]=Uh(a)||(Ce(a)?!0:!1)}else b[c]=Rc(c);a=c.split(";")[0];b[a]=b[a]||b[c]}return b}
function Pj(a,b){a.na=!0;let c;window.ManagedMediaSource?(a.I||(a.g.disableRemotePlayback=!0),c=new ManagedMediaSource,a.A.o(c,"startstreaming",()=>{a.na=!0}),a.A.o(c,"endstreaming",()=>{a.na=!1})):c=new MediaSource;a.A.sa(c,"sourceopen",()=>{URL.revokeObjectURL(a.oa);b.resolve()});a.A.sa(a.g,"playing",()=>{a.Wa=!0});a.oa=Qj(c);Rj(a);a.B.useSourceElements?(a.T=cj(a.oa),a.g.appendChild(a.T),a.I&&a.g.appendChild(a.I),a.g.load()):a.g.src=a.oa;return c}
async function Sj(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.catch(kf));for(const f of d.slice(1))f.p.reject(new D(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&&(Rj(a),a.g.load(),a.g.disableRemotePlayback=!1);a.g=null;a.T=null;a.I=null;a.B=null;a.i=null;a.h=null;a.W=null;a.l.clear();a.Aa.clear();a.j.clear();a.H=null;a.m.clear();a.M=null;a.V.clear();a.L=null}
function Rj(a){a.g&&(a.g.removeAttribute("src"),a.T?.parentElement===a.g&&a.g.removeChild(a.T),a.I?.parentElement===a.g&&a.g.removeChild(a.I))}function Tj(a,b,c){a.g&&window.ManagedMediaSource&&a.i&&a.B.useSourceElements&&(a.I?.parentElement===a.g&&a.g.removeChild(a.I),a.I=cj(b,c),a.g.appendChild(a.I),a.g.disableRemotePlayback=!1)}function Uj(a){return a.F?!1:a.i?a.i.readyState=="ended":!0}function Vj(a){return a.F?!1:a.i?a.i.readyState=="closed":!0}
function Wj(a,b,c,d){b=="audio"&&d&&(d=Gf(d,c.mimeType));b=="video"&&d&&c.mimeType=="video/mp4"&&(d=Hf(d));var e=Ie(c.mimeType,d);if(b==F)Xj(a,e,a.G,c.external);else{var f=a.B.forceTransmux;if(!Uh(e)||!a.G&&Ke.includes(e))f=!0;var g=Le(c.mimeType,d);if(f){f=Ub("audio",(d||"").split(","));d=Ub("video",(d||"").split(","));if(f&&d){a.u=!0;Wj(a,"audio",c,f);Wj(a,"video",c,d);return}if(d=Ce(g))e=d(),a.j.set(b,e),e=e.convertCodecs(b,g)}g=e+a.B.addExtraFeaturesToSourceBuffer(e);Dg(a.D);let h;try{h=a.i.addSourceBuffer(g)}catch(k){throw new D(2,
3,3015,k,"The mediaSource_ status was "+a.i.readyState+" expected 'open'",null);}a.G&&(h.mode=Yj);a.A.o(h,"error",()=>{const k=a.m.get(b)[0];k.p.reject(new D(2,3,3014,a.g.error?a.g.error.code:0,k.uri))});a.A.o(h,"updateend",()=>Zj(a,b));a.l.set(b,h);a.C.set(b,e);a.Aa.set(b,!!c.drmInfos.length)}}
function Xj(a,b,c,d){a.h||(a.h=new ff(a.W),a.h&&(a.h.C=a.B.modifyCueCallback));var e=a.h,f=a.za;a=a.O;b=="application/cea-608"||b=="application/cea-708"?e.i=null:(e.i=We.get(b)(),e.i.setSequenceMode?e.i.setSequenceMode(c):Ic("Text parsers w/ setSequenceMode",'Text parsers should have a "setSequenceMode" method!'),e.i.setManifestType?e.i.setManifestType(a):Ic("Text parsers w/ setManifestType",'Text parsers should have a "setManifestType" method!'),e.F=f,e.B=d)}
function Zj(a,b){if(a.F||a.D.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(),ak(a,b)}function bk(a){return a.na&&!a.K&&!a.F}function ck(a,b){if(a.F||a.K||Vj(a))return null;try{return a.l.get(b).buffered}catch(c){return a.l.has(b),null}}function dk(a,b){return a.l.size?b==F?a.h.g:Vi(ck(a,b)):null}function ek(a,b){return a.l.size?b==F?a.h.h:Wi(ck(a,b)):null}
function hk(a,b,c){if(b==F)return a=a.h,a.h==null||a.h<c?0:a.h-Math.max(c,a.g);a=ck(a,b);return Yi(a,c)}
function ik(a,b,c,d){const e=sj(b.startTime,c.startTime+b.presentationTimeDelta/b.timescale);d&&a.O=="HLS"&&!e&&(c=-d+c.startTime,b.startTime+=c,b.endTime+=c);a.L.Fj(b);!b.messageData||b.schemeIdUri!="https://aomedia.org/emsg/ID3"&&b.schemeIdUri!="https://developer.apple.com/streaming/emsg-id3"||(c=pj(b.messageData),c.length&&(d=b.startTime,a.L.onMetadata([{cueTime:d,data:b.messageData,frames:c,dts:d,pts:d}],0,b.endTime)))}
function jk(a,b,c,d,e,f,g=!1){let h=null;var k=[],l=$a(c);if(Ke.includes(f))c=pj(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.L.onMetadata([{cueTime:d.startTime,data:l,frames:c,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(f.includes("/mp4")&&d&&d.ha){l=new Ug;const m=e.emsgSchemeIdUris!=null&&e.emsgSchemeIdUris.length>0||a.B.dispatchAllEmsgBoxes,n=[];m&&l.ra("emsg",t=>{a:{var u=e.emsgSchemeIdUris;
let y,w,z,A,B,E;if(t.version===0){z=t.reader.ld();E=t.reader.ld();var v=t.reader.Y();B=t.reader.Y();w=t.reader.Y();y=t.reader.Y();A=d.startTime+B/v}else v=t.reader.Y(),A=t.reader.md()/v+d.timestampOffset,B=A-d.startTime,w=t.reader.Y(),y=t.reader.Y(),z=t.reader.ld(),E=t.reader.ld();t=t.reader.Kb(t.reader.getLength()-t.reader.Qa(),!0);if(u&&u.includes(z)||a.B.dispatchAllEmsgBoxes)if(z=="urn:mpeg:dash:event:2012")a.L.Hj();else{u=A;if(z!=="https://aomedia.org/emsg/ID3"||w!==4294967295)u+=w/v;v={startTime:A,
endTime:u,schemeIdUri:z,value:E,timescale:v,presentationTimeDelta:B,eventDuration:w,id:y,messageData:t};break a}v=null}v&&n.push(v)});const p=d.ha.timescale;b=p&&!isNaN(p);let r=0,q=!1;b&&l.ra("prft",t=>{var u=t.reader,v=t.version;u.Y();t=u.Y();const y=u.Y();t=t*1E3+y/2**32*1E3;v===0?u=u.Y():(v=u.Y(),u=u.Y(),u=v*4294967296+u);t=tj(t);u=(new Map).set("detail",{wallClockTime:t,programStartDate:new Date(t-u/p*1E3)});u=new C("prft",u);a.L.onEvent(u)}).boxes(["moof","traf"],Mg).ra("tfdt",t=>{q||(r=Yh(t.reader,
t.version).baseMediaDecodeTime/p,q=!0,m||t.parser.stop())});(m||b)&&l.parse(c,!1,g);q&&d.timestampOffset==0&&(h=r);for(const t of n)ik(a,t,d,h)}else f.includes("/mp4")||f.includes("/webm")||!Fj(l)||(a.V.has(b)||a.V.set(b,new Nj),k=a.V.get(b),k.clearData(),k.$e(d.i),k.parse(l),l=k.getStartTime(b),l!=null&&(h=l),k=k.getMetadata());return{timestamp:h,metadata:k}}
async function kk(a,b,c,d,e,f,g=!1,h=!1,k=!1,l=!1,m){if(b==F)a.O=="HLS"&&(g=await a.Ta,a.h.A=g),await Ze(a.h,c,d?d.startTime:null,d?d.endTime:null,d?d.S()[0]:null);else if(!l&&a.u)await kk(a,"audio",c,d,e,f,g,h,k,!0),await kk(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.C.get(b);a.j.has(b)&&(l=a.j.get(b).getOriginalMimeType());if(d){const {timestamp:r,metadata:q}=jk(a,b,c,d,e,l,k);if(r!=null){if(a.R==null&&b=="video"&&(a.R=r,a.ea=d.startTime,a.P!=null)){var p=
0;a.ea==a.$&&(p=a.R-a.P);a.X.resolve(p)}a.P==null&&b=="audio"&&(a.P=r,a.$=d.startTime,a.R!=null&&(p=0,a.ea==a.$&&(p=a.R-a.P),a.X.resolve(p)));p=r;!a.G&&Ke.includes(a.C.get(b))&&(p=0);p=d.startTime-p;(Math.abs(n-p)>=.001||g||h)&&(!k||p>0||!n)&&(n=p,a.Oa&&(lk(a,b,()=>mk(a,b),null),lk(a,b,()=>nk(a,b,n),null)));b!="video"&&a.l.has("video")||a.Ta.resolve(n)}if(q.length)a.L.onMetadata(q,n,d?d.endTime:null)}f&&b=="video"&&(a.h||Xj(a,"application/cea-608",a.G,!1),a.H||(a.H=new ad(l.split(";",1)[0])),d?(f=
Zc(a.H,c),f.length&&ef(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 r=f.init;lk(a,b,()=>{ok(a,r,n,e);a.l.get(b).appendBuffer(r)},d?d.S()[0]:null)}c=f.data}c=pk(a,e,c,d,b);if(d&&a.G&&b!=F&&(g||h)){let r=d.startTime;a.O=="HLS"&&!a.u&&b=="audio"&&a.l.has("video")&&(g=await a.X,Math.abs(g)>.15&&(r-=g));lk(a,b,()=>mk(a,b),null);lk(a,b,()=>nk(a,b,r),null)}await lk(a,b,()=>{var r=c;ok(a,r,n,e);a.l.get(b).appendBuffer(r)},
d?d.S()[0]:null)}}function lk(a,b,c,d){Dg(a.D);c={start:c,p:new gg,uri:d};a.m.get(b).push(c);a.m.get(b).length==1&&qk(a,b);return c.p}function mk(a,b){const c=a.l.get(b),d=c.appendWindowStart,e=c.appendWindowEnd;c.abort();c.appendWindowStart=d;c.appendWindowEnd=e;Zj(a,b)}function nk(a,b,c){c<0&&(c+=.001);a.l.get(b).timestampOffset=c;Zj(a,b)}
function pk(a,b,c,d,e){if(Ne(a.C.get(e))!="mp4")return c;const f=d===null,g=a.Aa.get(e),h=a.L.Ni();let k=!1;d&&d.ha&&(k=d.ha.encrypted);d=d?d.S()[0]:null;const l=tb();a.B.correctEc3Enca&&f&&e==="audio"&&(c=Gi(c));a.B.insertFakeEncryptionInInit&&g&&l.G(h,e)&&(f?c=Hi(b,c,d):!k&&l.ma(e)&&(c=Ki(c)));f&&l.I()&&(c=Ni(c));return c}function rk(a,b){const c=ek(a,"video")||0;cf(a.h,b,c)}function sk(a){a.h&&cf(a.h,"",0)}
function tk(a,b,c,d){if(d<=c)Zj(a,b);else{if(a.M){var e=a.M;b==="video"&&e.g&&e.g.flushBuffer(c,d)}a.l.get(b).remove(c,d)}}async function uk(a,b){b==F?a.h&&await a.h.remove(0,Infinity):(b==="video"&&a.H&&a.h&&await a.h.remove(0,Infinity,!0),await lk(a,b,()=>tk(a,b,0,a.i.duration),null),a.u&&await lk(a,"audio",()=>tk(a,"audio",0,a.i.duration),null))}function vk(a){a.H&&a.H.g.clear()}
async function wk(a,b,c,d,e){const {type:f,Yb:g,Oe:h}=xk(a,b,c,d,e);if(c=e.get("audio"))a.u=c.isAudioMuxedInVideo;if(f==yk)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==zk?await Ak(a,b,h,g):f==Bk&&(g&&g.destroy(),await Ck(a,e));return!0}
function Dk(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;Zj(a,b)}
async function Ek(a,b,c,d,e,f,g,h,k){if(b==F)f||(a.h.A=c),bf(a.h,d,e);else{var l=[];await wk(a,b,g,h,k)||(l.push(lk(a,b,()=>mk(a,b),null)),a.u&&l.push(lk(a,"audio",()=>mk(a,"audio"),null)));f||(l.push(lk(a,b,()=>nk(a,b,c),null)),a.u&&l.push(lk(a,"audio",()=>nk(a,"audio",c),null)));if(d!=0||e!=Infinity)l.push(lk(a,b,()=>Dk(a,b,d,e),null)),a.u&&l.push(lk(a,"audio",()=>Dk(a,"audio",d,e),null));l.length&&await Promise.all(l)}}
async function Fk(a,b,c){if(b!=F&&(b=="video"&&(a.Ta=new gg),a.G)){var d=ek(a,b);d&&Math.abs(d-c)<.15||(lk(a,b,()=>mk(a,b),null),a.u&&lk(a,"audio",()=>mk(a,"audio"),null),await lk(a,b,()=>nk(a,b,c),null),a.u&&await lk(a,"audio",()=>nk(a,"audio",c),null))}}
async function Gk(a,b){Dg(a.D);const c=[],d=Array.from(a.l.keys()),e=new Map;for(const f of d){const g=new gg,h={start:()=>g.resolve(),p:g,uri:null},k=a.m.get(f);k.push(h);c.push(g);e.set(f,h);k.length==1&&h.start()}try{await Promise.all(c)}catch(f){if(a.D.g){for(const g of d)b=a.m.get(g),e.has(g)&&tc(b,e.get(g));return}throw f;}try{await b()}catch(f){throw new D(2,3,3015,f,a.g.error||"No error in the media element",null);}finally{for(const f of d)ak(a,f)}}
async function Hk(a,b,c){a.D.g||a.g.error||a.K||a.F||Uj(a)||Vj(a)||await Gk(a,()=>{Uj(a)||Vj(a)||a.i.setLiveSeekableRange(b,c)})}async function Ik(a){a.D.g||a.g.error||a.K||a.F||Uj(a)||Vj(a)||await Gk(a,()=>{Uj(a)||Vj(a)||a.i.clearLiveSeekableRange()})}function ok(a,b,c,d){a.M&&(a=a.M,d.type!=="video"||a.u&&!d.baseOriginalId||a.g&&a.g.appendBuffer(b,"video",d.id,-c,!a.u))}function ak(a,b){a.m.get(b).shift();qk(a,b)}
function qk(a,b){const c=a.m.get(b)[0];if(c)try{c.start()}catch(d){d.name=="QuotaExceededError"?c.p.reject(new D(2,3,3017,b)):bk(a)?c.p.reject(new D(2,3,3015,d,a.g.error||"No error in the media element",c.uri)):c.p.reject(new D(2,3,3024,b)),ak(a,b)}}function Jk(a,b){a.W=b;a.h&&(a.h.l=b)}
function Ak(a,b,c,d){return lk(a,b,()=>{if(b!==F){a.C.get(b);if(tb().l()){a.j.has(b)&&(a.j.get(b).destroy(),a.j.delete(b));d&&a.j.set(b,d);const e=c+a.B.addExtraFeaturesToSourceBuffer(c);a.l.get(b).changeType(e);a.C.set(b,c)}Zj(a,b)}},null)}
async function Kk(a,b){if(!a.F&&!a.K){a.F=!0;a.u=!1;var c=a.g.currentTime,d=a.g.autoplay;a.g.paused||(a.Ha=!0);a.Wa&&(a.g.autoplay=!1);try{a.A.Na();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=new gg;a.i=Pj(a,a.J);await a.J;!isNaN(e)&&e?a.i.duration=e:!isNaN(a.ma)&&a.ma&&(a.i.duration=a.ma);const f=new gg,g=a.i.sourceBuffers,h=b.size;let k=0;const l=()=>{k++;k===h&&(f.resolve(),a.A.Ea(g,
"addsourcebuffer",l))};a.A.o(g,"addsourcebuffer",l);for(const n of b.keys()){const p=b.get(n);Wj(a,n,p,p.codecs)}const m=b.get("audio");m&&m.isAudioMuxedInVideo&&(a.u=!0);a.u&&!a.m.has("audio")&&a.m.set("audio",[]);await f}finally{a.F=!1,Dg(a.D),a.A.sa(a.g,"loadedmetadata",()=>{a.D.g||(a.g.currentTime=c)}),a.A.sa(a.g,"canplaythrough",()=>{a.D.g||(a.g.autoplay=d,a.Ha&&(a.Ha=!1,a.g.play()))})}}}function Ck(a,b){return Gk(a,()=>Kk(a,b))}
function Lk(a,b,c,d){let e,f=!1;const g=Ub("audio",(d||"").split(",")),h=Ub("video",(d||"").split(","));var k=h;b=="audio"&&(k=g);k||=d;let l=Ie(c,k);const m=Re(a.C.get(b));let n=a.B.forceTransmux;!Uh(l)||!a.G&&Ke.includes(l)?n=!0:n||c==m||(n=!tb().O()&&Ke.includes(c));n&&(a=Le(c,k),k=Ce(a))&&(e=k(),g&&h&&(f=!0),l=e.convertCodecs(b,a));!e&&b==="video"&&g&&(l=Ie(c,d));b=Oe(Se(l));return{Yb:e,hk:f,Yg:Re(l),codec:b,mimeType:l}}
function xk(a,b,c,d,e){if(b==F)return{type:yk,Oe:c,Yb:null};var f=Oe(Se(a.C.get(b)));const g=Re(a.C.get(b));var h=Lk(a,b,c,d);const k=h.Yb,l=h.hk,m=h.Yg,n=h.codec;h=h.mimeType;var p=!0;l&&a.C.has("audio")&&(c=Lk(a,"audio",c,d),d=Oe(Se(a.C.get("audio"))),p=Re(a.C.get("audio")),p=d==c.codec&&p==c.Yg,c.Yb&&c.Yb.destroy());if(f===n&&g===m&&p)return{type:yk,Oe:h,Yb:k};f=!0;if(a.u&&!e.has("audio")||l&&k&&!a.j.has(b))f=!1;b=tb();if(f&&a.B.codecSwitchingStrategy==="smooth"&&b.l())return{type:zk,Oe:h,Yb:k};
k&&k.destroy();return{type:Bk,Oe:h,Yb:null}}function Mk(a,b,c,d,e){a=xk(a,b,c,d,e);a.Yb&&a.Yb.destroy();return a.type==Bk}
var Nk=class{constructor(a,b,c,d,e){this.g=a;this.L=c;this.B=d;this.W=b;this.l=new Map;this.C=new Map;this.Aa=new Map;this.h=null;this.za=!1;this.M=e||null;this.m=new Map;this.A=new zc;this.j=new Map;this.H=null;this.J=new gg;this.oa="";this.Wa=!1;this.na=!0;this.K=!1;this.I=this.T=null;this.i=Pj(this,this.J);this.Ha=this.F=!1;this.D=new Eg(()=>Sj(this));this.G=!1;this.O="UNKNOWN";this.Oa=this.Va=!1;this.Ta=new gg;this.u=!1;this.ma=null;this.V=new Map;this.$=this.P=this.ea=this.R=null;this.X=new gg;
this.g.remote&&(this.K=this.g.remote.state!="disconnected",this.A.o(this.g.remote,"connect",()=>{this.K=this.g.remote.state!="disconnected"}),this.A.o(this.g.remote,"connecting",()=>{this.K=this.g.remote.state!="disconnected"}),this.A.o(this.g.remote,"disconnect",()=>{this.K=this.g.remote.state!="disconnected"}))}destroy(){return this.D.destroy()}async init(a,b=!1,c="UNKNOWN",d=!1){await this.J;if(Uj(this)||Vj(this))ra("Expected MediaSource to be open during init(); reopening the media source."),
this.J=new gg,this.i=Pj(this,this.J),await this.J;this.G=b;this.O=c;this.Va=d;this.Oa=!this.G&&this.O=="HLS"&&!this.Va;this.V.clear();this.$=this.P=this.ea=this.R=null;this.X=new gg;for(const e of a.keys())b=a.get(e),Wj(this,e,b,b.codecs),this.u?(this.m.set("audio",[]),this.m.set("video",[])):this.m.set(e,[]);(a=a.get("audio"))&&a.isAudioMuxedInVideo&&(this.u=!0)}configure(a){this.B=a;this.h&&(this.h.C=a.modifyCueCallback)}tc(){const a={total:this.F?[]:Zi(this.g.buffered),audio:Zi(ck(this,"audio")),
video:Zi(ck(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==F?await this.h.remove(b,c):c>b&&(await lk(this,a,()=>tk(this,a,b,c),null),this.u&&await lk(this,"audio",()=>tk(this,"audio",b,c),null))}async flush(a){a!=F&&(await lk(this,a,()=>{this.g.currentTime-=.001;Zj(this,a)},null),this.u&&await lk(this,"audio",()=>{this.g.currentTime-=
.001;Zj(this,"audio")},null))}async endOfStream(a){await Gk(this,()=>{Uj(this)||Vj(this)||(a?this.i.endOfStream(a):this.i.endOfStream())})}async qb(a){await Gk(this,()=>{if(this.B.durationReductionEmitsUpdateEnd&&a<this.i.duration)for(const b of this.l.keys()){const c={start:()=>{},p:new gg,uri:null};this.m.get(b).unshift(c)}this.ma=this.i.duration=a})}getDuration(){return this.i.duration}},Qj=window.URL.createObjectURL,Yj="sequence",yk="none",Bk="reset",zk="changeType";var Ok=class{constructor(a,b,c=!0){this.i=a;this.D=b;this.A=this.l=Infinity;this.h=1;this.g=this.j=null;this.B=0;this.C=!0;this.I=!1;this.H=0;this.F=c;this.G=0;this.u=!1;this.m=a}getDuration(){return this.l}Si(){return this.h}Ph(a){this.i=a}qb(a){this.l=a}Xi(){return this.i}Mh(a){this.B=a}Nc(a){a&&!this.C&&(this.I=!0);this.C=a}bf(a){this.A=a}we(){return this.A}Gg(a){this.D=a}Ii(){return this.D}Dh(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.Pe(a[0].start+b);this.h=a.reduce((e,f)=>Math.max(e,f.end-f.start),this.h);this.g=Math.max(this.g,d);this.i!=null&&this.F&&!this.u&&(this.i=c-this.g-this.h)}}}Ld(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.h=Math.max(this.h,e.endTime-e.startTime));this.Pe(b);this.g=Math.max(this.g,c);this.i!=null&&this.F&&!this.u&&(this.i=d-this.g-this.h)}}Ch(a,b){this.Pe(a);b==
Infinity||this.U()||(this.g=Math.max(this.g,b))}Ti(){return this.g}Je(){this.u=!0}uj(){return this.u}Ig(a){this.m=a}Mi(){return this.m}Pe(a){this.j==null?this.j=a:this.I||(this.j=Math.min(this.j,a))}og(a){this.h=Math.max(this.h,a)}offset(a){this.j!=null&&(this.j+=a);this.g!=null&&(this.g+=a)}U(){return this.l==Infinity&&!this.C}Ic(){return this.l!=Infinity&&!this.C}yb(){return Math.max(this.H,this.vc()-this.A)}Sh(a){this.H=a}vc(){return this.U()||this.Ic()?Math.min(Math.max(0,(Date.now()+this.B)/
1E3-this.h-this.i)+this.G,this.l):this.g?Math.min(this.g,this.l):this.l}Dd(a){const b=Math.max(this.j,this.H);return this.A==Infinity?Math.ceil(b*1E3)/1E3:Math.max(b,Math.min(this.vc()-this.A+a,this.xb()))}Qb(){return this.Dd(0)}xb(){return Math.max(0,this.vc()-(this.U()||this.Ic()?this.D:0))}$h(){return this.i==null||this.g!=null&&this.F?!1:!0}Lh(a){this.G=a}xi(){return this.G}};x("shaka.media.PresentationTimeline",Ok);Ok.prototype.getAvailabilityTimeOffset=Ok.prototype.xi;
Ok.prototype.setAvailabilityTimeOffset=Ok.prototype.Lh;Ok.prototype.usingPresentationStartTime=Ok.prototype.$h;Ok.prototype.getSeekRangeEnd=Ok.prototype.xb;Ok.prototype.getSeekRangeStart=Ok.prototype.Qb;Ok.prototype.getSafeSeekRangeStart=Ok.prototype.Dd;Ok.prototype.getSegmentAvailabilityEnd=Ok.prototype.vc;Ok.prototype.setUserSeekStart=Ok.prototype.Sh;Ok.prototype.getSegmentAvailabilityStart=Ok.prototype.yb;Ok.prototype.isInProgress=Ok.prototype.Ic;Ok.prototype.isLive=Ok.prototype.U;
Ok.prototype.offset=Ok.prototype.offset;Ok.prototype.notifyMaxSegmentDuration=Ok.prototype.og;Ok.prototype.notifyMinSegmentStartTime=Ok.prototype.Pe;Ok.prototype.getInitialProgramDateTime=Ok.prototype.Mi;Ok.prototype.setInitialProgramDateTime=Ok.prototype.Ig;Ok.prototype.isStartTimeLocked=Ok.prototype.uj;Ok.prototype.lockStartTime=Ok.prototype.Je;Ok.prototype.getMaxSegmentEndTime=Ok.prototype.Ti;Ok.prototype.notifyPeriodDuration=Ok.prototype.Ch;Ok.prototype.notifySegments=Ok.prototype.Ld;
Ok.prototype.notifyTimeRange=Ok.prototype.Dh;Ok.prototype.getDelay=Ok.prototype.Ii;Ok.prototype.setDelay=Ok.prototype.Gg;Ok.prototype.getSegmentAvailabilityDuration=Ok.prototype.we;Ok.prototype.setSegmentAvailabilityDuration=Ok.prototype.bf;Ok.prototype.setStatic=Ok.prototype.Nc;Ok.prototype.setClockOffset=Ok.prototype.Mh;Ok.prototype.getPresentationStartTime=Ok.prototype.Xi;Ok.prototype.setDuration=Ok.prototype.qb;Ok.prototype.setPresentationStartTime=Ok.prototype.Ph;
Ok.prototype.getMaxSegmentDuration=Ok.prototype.Si;Ok.prototype.getDuration=Ok.prototype.getDuration;function Pk(a){if(!a.h.stallEnabled)return null;const b=a.h.stallThreshold,c=a.h.stallSkip;return new Qk(new Rk(a.g),b,async()=>{if(Zi(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.A(new C("stalldetected"))}})}
function Sk(a){if(a.g.readyState!=0){if(a.g.seeking){if(!a.u)return}else a.u=!1;if(!a.g.paused||a.g.currentTime==a.m&&(a.g.autoplay||a.g.currentTime!=a.m))if(!a.j||!Tk(a.j)){var b=a.g.currentTime,c=a.g.buffered,d=$i(c,b,a.h.gapDetectionThreshold);if(d==null&&a.j&&!Tk(a.j)){var e=Zi(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.B||(e=c.start(d),(f=a.h.gapPadding)&&(e=Math.ceil((e+f)*100)/100),e>=a.D.xb()||e-b<.001||(d!=0&&c.end(d-
1),Uk(a,e),b==a.m&&(a.m=e),a.F++,a.A(new C("gapjumped"))))}}}function Uk(a,b){a.C=!0;a.l.sa(a.g,"seeked",()=>{a.C=!1});a.g.currentTime=b}
var Vk=class{constructor(a,b,c,d){this.A=d;this.g=a;this.D=b;this.h=c;this.l=new zc;this.u=!1;this.m=0;this.C=!1;this.G=this.F=0;this.j=Pk(this);this.B=!1;this.l.o(a,"waiting",()=>Sk(this));this.i=(new H(()=>{Sk(this)})).wa(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.A=null}gd(){this.B=!0;this.i&&this.i.wa(this.h.gapJumpTimerTime);Sk(this)}};
function Tk(a){const b=a.h;var c=Wk(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.u&&c&&!a.i)a.j&&a.j(a.g,d),a.i=!0,a.g=b.g.currentTime;return c}var Qk=class{constructor(a,b,c){this.h=a;this.m=Wk(a);this.g=a.g.currentTime;this.l=Date.now()/1E3;this.i=!1;this.u=b;this.j=c}release(){this.h&&this.h.release();this.j=this.h=null}};
function Wk(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 Zi(b))if(!(a<c-.1||a>d-.5)){b=!0;break a}b=!1}return b}var Rk=class{constructor(a){this.g=a;this.h=new zc;this.i=!1;this.h.o(this.g,"audiofocuspaused",()=>{this.i=!0});this.h.o(this.g,"audiofocusgranted",()=>{this.i=!1});this.h.o(this.g,"audiofocuslost",()=>{this.i=!0})}release(){this.h&&this.h.release();this.h=null}};function Xk(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=Yk.value().get(b),c.sa(a,b,d))}var Yk=new fb(()=>new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]]));function Zk(a,b){Math.abs(a.g.currentTime-b)<.001?$k(a):(a.h.sa(a.g,"seeking",()=>{$k(a)}),al(a.i,a.g.currentTime&&a.g.currentTime!=0?a.g.currentTime:b))}function bl(a){return a.u?a.g.currentTime:a.j()}function cl(a,b){a.g.readyState>0?al(a.i,b):Xk(a.g,HTMLMediaElement.HAVE_METADATA,a.h,()=>{Zk(a,a.j())})}function $k(a){a.u=!0;a.h.o(a.g,"seeking",()=>a.m());a.A(a.g.currentTime)}
var el=class{constructor(a,b,c,d){this.g=a;this.m=b;this.A=c;this.l=null;this.j=()=>{this.l==null&&(this.l=d());return this.l};this.u=!1;this.h=new zc;this.i=new dl(a);Xk(this.g,HTMLMediaElement.HAVE_METADATA,this.h,()=>{Zk(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 al(a,b){a.l=a.g.currentTime;a.j=b;a.i=a.m;a.g.currentTime=b;a.h.wa(.1)}
var dl=class{constructor(a){this.g=a;this.m=10;this.j=this.l=this.i=0;this.h=new H(()=>{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 fl(a){return a.g.getStartDate&&(a=a.g.getStartDate().getTime(),!isNaN(a))?a/1E3:null}function gl(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 hl=class{constructor(a){this.g=a;this.i=!1;this.h=null;this.j=new zc}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=fl(this);d!==null&&(c=this.h.getTime()/1E3-d,c=gl(this,c))}c==null?this.i=!0:(c<0&&(c=Math.max(0,b+c)),b!=c?(this.j.sa(this.g,"seeking",()=>{this.i=!0}),this.g.currentTime=c):this.i=!0)}};Xk(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,
this.j,()=>{a()})}release(){this.j&&(this.j.release(),this.j=null);this.g=null}A(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-(fl(this)||0),a=gl(this,a));return a||0}G(){return 0}D(){return 0}F(){return!1}I(){}H(){const a=Wi(this.g.buffered);return a!=null&&a>=this.g.duration-1}};
function il(a,b){b==null?b=a.g.getDuration()<Infinity?a.g.Qb():a.g.xb():b instanceof Date?b=b.getTime()/1E3-(a.g.m||a.g.i):b<0&&(b=a.g.xb()+b);return jl(a,kl(a,b))}function kl(a,b){const c=a.g.Qb();if(b<c)return c;a=a.g.xb();return b>a?a:b}function jl(a,b){const c=a.g.getDuration();return b>=c?c-a.l.durationBackoff:b}
function ll(a,b){var c=a.l.rebufferingGoal;const d=a.l.safeSeekOffset;let e=a.g.Qb();const f=a.g.xb(),g=a.g.getDuration();f-e<3&&(e=f-3);const h=a.g.Dd(c),k=a.g.Dd(d);c=a.g.Dd(c+d);return b>=g?jl(a,b):b>f?f-a.l.safeSeekEndOffset:b<e?a.g.U()&&a.l.returnToEndOfLiveWindowWhenOutside?f-a.l.safeSeekEndOffset:Xi(a.h.buffered,k)?k:c:b>=h||Xi(a.h.buffered,b)?b:c}
var ml=class{constructor(a,b,c,d,e,f){this.h=a;this.g=b.presentationTimeline;this.l=c;this.C=e;this.B=null;this.i=new Vk(a,b.presentationTimeline,c,f);this.j=new el(a,()=>{a:{var g=this.i;g.u=!0;g.B=!1;g.i&&g.i.wa(g.h.gapJumpTimerTime);Sk(g);var h=bl(this.j);g=ll(this,h);if(!Wh()&&Math.abs(g-h)>.001){h=!1;const k=tb().na();if(k){const l=Date.now()/1E3;if(!this.B||this.B<l-k)this.B=l,h=!0}else h=!0;if(h){cl(this.j,g);g=void 0;break a}}this.C();g=void 0}return g},g=>{var h=this.i;h.g.seeking&&!h.u&&
(h.u=!0,h.m=g);h.i&&h.i.wa(h.h.gapJumpTimerTime);Sk(h)},()=>il(this,d));this.u=new H(()=>{if(this.h.readyState!=0&&!this.h.paused){var g=bl(this.j),h=this.g.Qb(),k=this.g.xb();k-h<3&&(h=k-3);g<h&&(g=ll(this,g),this.h.currentTime=g)}})}ready(){this.u.wa(.25)}release(){this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.u&&(this.u.stop(),this.u=null);this.h=this.j=this.g=this.l=null;this.C=()=>{}}A(a){cl(this.j,il(this,a))}m(){const a=bl(this.j);return this.h.readyState>
0&&!this.h.paused?kl(this,a):a}G(){return this.i.G}D(){return this.i.F}F(){return this.i.C}I(){this.i.gd()}H(){if(this.g.U()){const a=this.g.vc(),b=Wi(this.h.buffered);if(b!=null&&b>=a)return!0}return!1}};function nl(a,b,c){a=new I(a,a+b,()=>c,0,null,null,a,a,a+b);return new ol([a])}
var ol=class{constructor(a){this.g=a;this.m=null;this.i=0;this.u=!1}getNumReferences(){return this.g.length}getNumEvicted(){return this.i}release(){this.u||(this.g=[],this.m&&this.m.stop(),this.m=null)}Bj(){this.u=!0}mb(a){for(const b of this.g)a(b)}wb(){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=wc(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.u)for(const b of this.g)b.offset(a)}Le(a){if(!this.u&&a.length){var b=Math.round(a[0].startTime*1E3)/1E3,c=wc(this.g,d=>Math.round(d.startTime*1E3)/1E3<b);this.g.length=c;this.g.push(...a)}}Jd(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.Le(a);this.Ua(b)}Ua(a){if(!this.u){var b=
wc(this.g,c=>c.endTime<=a);b>0&&(this.i+=b,this.g=this.g.slice(b))}}Wc(a,b,c=!1){if(!this.u){for(;this.g.length;)if(this.g[this.g.length-1].startTime>=b)this.g.pop();else break;var d=wc(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 I(c.startTime,b,c.C,c.startByte,c.endByte,c.ha,c.timestampOffset,c.appendWindowStart,c.appendWindowEnd,c.g,c.tilesLayout,c.B,c.h,c.status,c.aesKey),b.mimeType=c.mimeType,b.codecs=c.codecs,b.i=c.i,
this.g[this.g.length-1]=b)}}hf(a,b){this.u||(this.m&&this.m.stop(),this.m=new H(()=>{const c=b();c?this.g.push(...c):(this.m.stop(),this.m=null)}),this.m.wa(a))}[Symbol.iterator](){return this.Ob(0)}Ob(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.g.length>0)for(let g=e.g.length-1;g>=0;--g){let h=e.g[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.l;)g--,h=e.g[g];if(!h.l)return ra("No independent partial segment found!"),null}c?d--:d++;
f=g-1;break}}return new pl(this,d,f,c)}A(){return-1}};x("shaka.media.SegmentIndex",ol);ol.forSingleSegment=nl;ol.prototype.getIteratorForTime=ol.prototype.Ob;ol.prototype.updateEvery=ol.prototype.hf;ol.prototype.fit=ol.prototype.Wc;ol.prototype.evict=ol.prototype.Ua;ol.prototype.mergeAndEvict=ol.prototype.Jd;ol.prototype.offset=ol.prototype.offset;ol.prototype.get=ol.prototype.get;ol.prototype.find=ol.prototype.find;ol.prototype.markImmutable=ol.prototype.Bj;ol.prototype.release=ol.prototype.release;
ol.prototype.getNumEvicted=ol.prototype.getNumEvicted;ol.prototype.getNumReferences=ol.prototype.getNumReferences;
var pl=class{constructor(a,b,c,d){this.i=a;this.h=b;this.g=c;this.reverse=d}qd(a){this.reverse=a}pi(){return this.h}current(){let a=this.i.get(this.h);a&&a.g.length>0&&a.m&&this.g>=a.g.length&&(this.h++,this.g=0,a=this.i.get(this.h));return a&&a.g.length>0?a.g[this.g]:a}next(){var a=this.i.get(this.h);this.reverse?a&&a.g.length>0?(this.g--,this.g<0&&(this.h--,this.g=(a=this.i.get(this.h))&&a.g.length>0?a.g.length-1:0)):(this.h--,this.g=0):a&&a.g.length>0?(this.g++,a.m&&this.g==a.g.length&&(this.h++,
this.g=0)):(this.h++,this.g=0);a=this.current();return{value:a,done:!a}}zg(){var a=this.current();if(a&&a.Kc&&!a.l&&(a=this.i.get(this.h))&&a.g.length>0){let b=a.g[this.g];for(;b.l&&!(this.g<=0);)this.g--,b=a.g[this.g]}}};x("shaka.media.SegmentIterator",pl);pl.prototype.resetToLastIndependent=pl.prototype.zg;pl.prototype.next=pl.prototype.next;pl.prototype.current=pl.prototype.current;pl.prototype.currentPosition=pl.prototype.pi;pl.prototype.setReverse=pl.prototype.qd;
function ql(a,b){for(const c of a.h)b(c)}function rl(a,b){for(const c of a.h)if(c.find(b)!=null)return c.A();return-1}
var sl=class extends ol{constructor(){super([]);this.h=[]}clone(){const a=new sl;a.h=this.h.slice();a.i=this.i;return a}release(){this.h=[]}mb(a){for(const b of this.h)b.mb(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(){}Le(){}Ua(a){if(this.h.length){var b=this.h[0];
b.Ua(a);b.getNumReferences()==0&&(this.h.shift(),this.i+=b.getNumEvicted(),b.release(),this.Ua(a))}}Jd(){}Wc(){}hf(){}};x("shaka.media.MetaSegmentIndex",sl);sl.prototype.updateEvery=sl.prototype.hf;sl.prototype.fit=sl.prototype.Wc;sl.prototype.mergeAndEvict=sl.prototype.Jd;sl.prototype.evict=sl.prototype.Ua;sl.prototype.merge=sl.prototype.Le;sl.prototype.offset=sl.prototype.offset;sl.prototype.get=sl.prototype.get;sl.prototype.find=sl.prototype.find;sl.prototype.forEachTopLevelReference=sl.prototype.mb;
sl.prototype.release=sl.prototype.release;function tl(a){a.i.stop();const b=a.j?0:a.h;if(b>=0&&b<=16)try{a.g.ag()!=b&&a.g.Qh(b);return}catch(c){}a.i.wa(.25);a.g.ag()!=0&&a.g.Qh(0)}var ul=class{constructor(a){this.g=a;this.j=!1;this.h=this.g.ag();this.i=new H(()=>{this.g.isPaused()||this.g.Dj(this.h*.25)})}release(){this.set(this.Yc());this.i&&(this.i.stop(),this.i=null);this.g=null}set(a){this.h=a;tl(this)}Yc(){return this.g.Yc()}};function vl(a,b){const c=a.j.currentTime;for(const d of a.g)d.j(c,b)}var wl=class{constructor(a){this.j=a;this.h=new zc;this.g=new Set;this.i=(new H(()=>{vl(this,!1)})).Ia();a.paused||this.i.wa(.25);this.h.o(a,"playing",()=>{this.i.Ia().wa(.25)});this.h.o(a,"pause",()=>{this.i.stop()});this.h.o(a,"seeked",()=>{this.i.Ia();a.paused||this.i.wa(.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 xl(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 yl(a,b){let c=a.g.get(b);c||(c={Od:[],Bf:null,contentType:b},a.g.set(b,c));return c}function zl(a,b){if((a=a.h()[b.contentType])&&a.length>0){const c=a[0].start,d=a[a.length-1].end,e=b.Od;b.Od=e.filter((f,g)=>f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0)}else b.Od=[]}function Al(a,b,c){var d=yl(a,b.contentType);zl(a,d);a={ed:b,position:c};d=d.Od;b=d.findIndex(e=>e.position>=c);b>=0?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
function Bl(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 Cl=class extends Ba{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.Bf;a:{var c=f.Od;for(var d=c.length-1;d>=0;d--){var e=c[d];if(e.position<=a){c=e.ed;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&&!xc(b.roles,c.roles);(e||g||b)&&Bl(this,a,c.contentType)&&(f.Bf=c,b=new C("audiotrackchange",new Map([["quality",c],["position",a]])),this.dispatchEvent(b));d&&Bl(this,a,c.contentType)&&(f.Bf=c,JSON.stringify(c),b=new C("qualitychange",new Map([["quality",c],["position",a]])),this.dispatchEvent(b))}}};function Dl(a){a.g||(a.g=(new H(()=>{const b=a.i();for(const [c,d]of a.h)if(d.endTime<b.start){a.h.delete(c);const e=new C("regionremove",new Map([["region",d]]));a.dispatchEvent(e)}!a.h.size&&a.g&&(a.g.stop(),a.g=null)})).wa(2))}function El(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 C("regionadd",new Map([["region",b]])),a.dispatchEvent(b),Dl(a))}
var Fl=class extends Ba{constructor(a){super();this.h=new Map;this.i=a;this.g=null}release(){this.h.clear();this.g&&(this.g.stop(),this.g=null);super.release()}};function Gl(a,b){a.l=b;for(const c of a.g.values())c.g=b}function Hl(a,b){if(!a.i.segmentIndex||b.Rb()||Array.from(a.j.keys()).some(e=>Oi(e,b)))return Promise.resolve();const c=new Il(a.l),d=Jl(c,b,a.i);a.j.set(b,c);return d}function Kl(a){if(a.g.size){var b=Array.from(a.g.keys());for(const c of a.j.keys())b.some(d=>Oi(d.ha,c))||Ll(a,c)}}
function Ml(a,b,c=!1){if(!a.i.segmentIndex)return Promise.resolve();a.h||(a.h=a.i.segmentIndex.Ob(b,!0,a.u));if(!a.h)return Promise.resolve();c&&a.h.next();for(b=[];a.g.size<a.m;){c=a.h.next().value;if(!c)break;var d=!0;c.isPreload()&&c.endByte!=null&&(d=!1);c.Sb()==2&&(d=!1);c.Rb(!1)&&(d=!1);d&&c.ha&&b.push(Hl(a,c.ha));d&&!a.g.has(c)&&(d=new Il(a.l),b.push(Jl(d,c,a.i)),a.g.set(c,d));if(!a.A(c,a.i))break}Kl(a);return Promise.all(b)}
function Ll(a,b){let c=a.g;b instanceof Pi&&(c=a.j);a=c.get(b);c.delete(b);a&&a.abort()}function Nl(a){var b=a.g;for(const c of b.keys())c&&Ll(a,c);b=a.j;for(const c of b.keys())c&&Ll(a,c);a.h=null}function Ol(a,b){a.m=b;const c=Array.from(a.g.keys());for(;c.length>b;){const d=c.pop();d&&Ll(a,d)}Kl(a)}function Pl(a,b){b&&b!==a.i&&(Nl(a),a.i=b)}
var Ql=class{constructor(a,b,c,d,e){this.m=a;this.i=b;this.l=c;this.g=new Map;this.j=new Map;this.h=null;this.u=d;a=(f,g)=>g.fastSwitching&&f.Kc&&f.Id?!1:!0;this.A=e||a}Ua(a,b=!1){for(const c of this.g.keys())a>c.endTime&&Ll(this,c);b&&Kl(this)}qd(a){this.u=a;this.h&&this.h.qd(a)}};
function Jl(a,b,c){let d=new Uint8Array(0);a.Md=a.g(b,c,async e=>{d.byteLength>0?d=Nb(d,e):d=e;a.Lg&&(await a.Lg(d),d=new Uint8Array(0))});return a.Md.promise.catch(e=>e instanceof D&&e.code==7001?Promise.resolve():Promise.reject(e))}var Il=class{constructor(a){this.g=a;this.Md=this.Lg=null}abort(){this.Md&&this.Md.abort()}};x("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});function Rl(a){const b=Re(a),c=b.split("/")[0];a=Se(a);return{type:c,mimeType:b,codecs:a,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,Ud:null,colorGamut:null,frameRate:null,timescale:null}}
function Sl(a,b,c){const d=[];let e=[],f=!1,g=!1;const h=w=>{w=w.toLowerCase();switch(w){case "avc1":case "avc3":e.push(w+".42E01E");g=!0;break;case "hev1":case "hvc1":e.push(w+".1.6.L93.90");g=!0;break;case "dvh1":case "dvhe":e.push(w+".05.04");g=!0;break;case "vp09":e.push(w+".00.10.08");g=!0;break;case "av01":e.push(w+".0.01M.08");g=!0;break;case "mp4a":d.push("mp4a.40.2");f=!0;break;case "ac-3":case "ec-3":case "ac-4":case "opus":case "flac":d.push(w);f=!0;break;case "apac":d.push("apac.31.00"),
f=!0}};let k=null,l=null,m=null,n=null,p=null,r=null,q=null,t=null,u;var v=w=>{const z=ai(w.reader);n=z.channelCount;p=z.sampleRate;h(w.name)},y=w=>{u=w.name;var z=w.reader;z.skip(24);const A=z.Ga(),B=z.Ga();z.skip(50);m=String(A);l=String(B);w.reader.Ma()&&Mg(w)};(new Ug).box("moov",Mg).box("trak",Mg).box("mdia",Mg).ra("mdhd",w=>{w=Zh(w.reader,w.version);k=w.language;t=w.timescale}).box("minf",Mg).box("stbl",Mg).ra("stsd",Og).box("mp4a",w=>{const z=ai(w.reader);n=z.channelCount;p=z.sampleRate;w.reader.Ma()?
Mg(w):h(w.name)}).box("esds",w=>{w=w.reader;let z="mp4a";for(var A,B;w.Ma();){A=w.ba();for(var E=w.ba();E&128;)E=w.ba();if(A==3)w.Ga(),E=w.ba(),E&128&&w.Ga(),E&64&&w.skip(w.ba()),E&32&&w.Ga();else if(A==4)B=w.ba(),w.skip(12);else if(A==5)break}B&&(z+="."+bi(B),A==5&&w.Ma()&&(A=w.ba(),B=(A&248)>>3,B===31&&w.Ma()&&(B=32+((A&7)<<3)+((w.ba()&224)>>5)),z+="."+B));d.push(z);f=!0}).box("ac-3",v).box("ec-3",v).box("ac-4",v).box("Opus",v).box("fLaC",v).box("apac",v).box("avc1",y).box("avc3",y).box("hev1",
y).box("hvc1",y).box("dva1",y).box("dvav",y).box("dvh1",y).box("dvhe",y).box("vp09",y).box("av01",y).box("avcC",w=>{var z=u||"";switch(u){case "dvav":z="avc3";break;case "dva1":z="avc1"}w=w.reader;w.skip(1);w=z+"."+bi(w.ba())+bi(w.ba())+bi(w.ba());e.push(w);g=!0}).box("hvcC",w=>{var z=u||"";switch(u){case "dvh1":z="hvc1";break;case "dvhe":z="hev1"}var A=w.reader;A.skip(1);w=A.ba();var B=["","A","B","C"][w>>6],E=w&31,G=A.Y(),ea=(w&32)>>5?"H":"L";w=[A.ba(),A.ba(),A.ba(),A.ba(),A.ba(),A.ba()];A=A.ba();
let M=0;for(let N=0;N<32;N++){M|=G&1;if(N==31)break;M<<=1;G>>=1}z=z+("."+B+E)+("."+bi(M,!0));z+="."+ea+A;B="";for(E=w.length;E--;)if((ea=w[E])||B)B="."+ea.toString(16).toUpperCase()+B;z+=B;e.push(z);g=!0}).box("dvcC",w=>{var z=u||"";switch(u){case "hvc1":z="dvh1";break;case "hev1":z="dvhe";break;case "avc1":z="dva1";break;case "avc3":z="dvav";break;case "av01":z="dav1"}var A=w.reader;A.skip(2);w=A.ba();A=A.ba();e.push(z+"."+ei(w>>1&127)+"."+ei(w<<5&32|A>>3&31));g=!0}).box("dvvC",w=>{var z=u||"";switch(u){case "hvc1":z=
"dvh1";break;case "hev1":z="dvhe";break;case "avc1":z="dva1";break;case "avc3":z="dvav";break;case "av01":z="dav1"}var A=w.reader;A.skip(2);w=A.ba();A=A.ba();e.push(z+"."+ei(w>>1&127)+"."+ei(w<<5&32|A>>3&31));g=!0}).ra("vpcC",w=>{var z=u||"",A=w.reader;w=A.ba();const B=A.ba();A=A.ba()>>4&15;e.push(z+"."+ei(w)+"."+ei(B)+"."+ei(A));g=!0}).box("av1C",w=>{var z=u||"";switch(u){case "dav1":z="av01"}var A=w.reader;A.skip(1);w=A.ba();A=A.ba();const B=w>>>5,E=(A&64)>>6;e.push(z+"."+B+"."+ei(w&31)+(A>>>7?
"H":"M")+"."+ei(B===2&&E?(A&32)>>5?12:10:E?10:8)+"."+((A&16)>>4)+"."+((A&8)>>3)+((A&4)>>2)+(A&3)+"."+ei(1)+"."+ei(1)+"."+ei(1)+".0");g=!0}).box("enca",Qg).box("encv",Pg).box("sinf",Mg).box("frma",w=>{({codec:w}=ci(w.reader));h(w)}).box("colr",w=>{e=e.map(B=>{if(B.startsWith("av01.")){var E=w.reader;const M=E.Qa();var G=E.Kb(4,!1);var ea=String.fromCharCode(G[0]);ea+=String.fromCharCode(G[1]);ea+=String.fromCharCode(G[2]);ea+=String.fromCharCode(G[3]);if(ea==="nclx"){G=E.Ga();ea=E.Ga();const N=E.Ga(),
ia=E.ba()>>7,L=B.split(".");L.length==10&&(L[6]=ei(G),L[7]=ei(ea),L[8]=ei(N),L[9]=String(ia),B=L.join("."))}E.seek(M)}return B});const {Ud:z,colorGamut:A}=di(w.reader);r=z;q=A}).parse(a||b,!0,!0);if(!d.length&&!e.length)return null;v=f&&!g;y=new Map;if(g&&!c){c=new ad("video/mp4");a&&c.init(a);try{Zc(c,b);for(const w of c.g.getStreams())y.set(w,w)}catch(w){}c.g.clear()}return{type:v?"audio":"video",mimeType:v?"audio/mp4":"video/mp4",codecs:Tl(d.concat(e)).join(", "),language:k,height:l,width:m,channelCount:n,
sampleRate:p,closedCaptions:y,Ud:r,colorGamut:q,frameRate:null,timescale:t}}function Tl(a){var b=new Set;const c=[];for(var d of a)a=Qe(d),b.has(a)||(c.push(d),b.add(a));b=Wb("audio",c);a=Wb("video",c);d=Wb(F,c);a=Ul(a);b=b.concat(a).concat(d);return c.length&&!b.length?c:b}
function Ul(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?Uh(`video/mp4; codecs="${b}"`)?[b]:a.filter(c=>c!=b):a}
function Vl(a){let b=null;(new Ug).box("moov",Mg).box("trak",Mg).box("mdia",Mg).box("minf",Mg).box("stbl",Mg).ra("stsd",Og).box("encv",Pg).box("enca",Qg).box("sinf",Mg).box("schi",Mg).ra("tenc",c=>{c=c.reader;c.ba();c.ba();c.ba();c.ba();c=c.Kb(16,!1);b=Mb(c)}).parse(a,!0);return b}
async function Wl(a,b,c){b.cryptoKey||await b.fetchKey();let d=b.iv;if(!d){d=$a(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 Xl(a,b,c){let d=Yl.get(Zl(a));if(d)return d;a=tg([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 Zl(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 $l(a,b,c,d,e){a=tg(a,d,e);if(b!=0||c!=null)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a}
var Yl=(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("ism","application/vnd.ms-sstr+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("sbv",
"text/x-subviewer").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("lrc","application/x-subtitle-lrc").set("ssa","text/x-ssa").set("ass","text/x-ssa").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 am(a){return a&&a.type==F&&(a.stream.mimeType=="application/cea-608"||a.stream.mimeType=="application/cea-708")}function bm(a,b,c,d,e,f=!1){const g=a instanceof I?a:void 0,h=g?1:0;a=$l(a.S(),a.startByte,a.endByte,d,c);a.contentType=b.type;return e.request(zg,a,{type:h,stream:b,segment:g,isPreload:f})}
async function cm(a){a.A&&a.A.stop();a.A=null;a.J&&a.J.stop();a.J=null;a.F&&(a.F.release(),a.F=null);const b=[];for(const c of a.h.values())dm(c),b.push(em(c)),c.ka&&(Nl(c.ka),c.ka=null);for(const c of a.m.values())Nl(c);await Promise.all(b);a.h.clear();a.m.clear();a.g=null;a.j=null;a.i=null;a.H=null}function dm(a){a.hb!=null&&(a.hb.stop(),a.hb=null)}async function em(a){a.Xa&&await a.Xa.abort()}
function fm(a,b){if(b.type==="video"&&a.i.disableVideoPrefetch||b.type==="audio"&&a.i.disableAudioPrefetch||b.type===F&&(b.mimeType=="application/cea-608"||b.mimeType=="application/cea-708")||b.type===F&&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.ka)&&b===c.i?c:a.i.segmentPrefetchLimit>0?new Ql(a.i.segmentPrefetchLimit,b,(d,e,f)=>bm(d,e,f||null,a.i.retryParameters,a.g.hc),a.g.Pa()<0,a.g.fk):null}
function gm(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);Ol(d,b);if(!(b>0&&c.some(f=>Zb(e.audio.language,f)))){const f=a.h.get(e.audio.type);d!==(f&&f.ka)&&Nl(d);a.m.delete(e.audio)}continue}if(b<=0)continue;if(!c.some(f=>Zb(e.audio.language,f)))continue;if(d=fm(a,e.audio))e.audio.segmentIndex||e.audio.createSegmentIndex(),a.m.set(e.audio,d)}}
function hm(a,b,c){a.j.presentationTimeline.U()||(a.W=b,a.V=c)}async function im(a,b){if(!a.u)throw new D(2,5,5006);const c=jm(a,!0);await a.g.aa.init(c,a.j.sequenceMode,a.j.type,a.j.ignoreManifestTimestampsInSegmentsMode);Dg(a.l);a.updateDuration();for(const e of c.keys()){var d=c.get(e);if(!a.h.has(e)){const f=km(a,d);b.has(d.id)&&(d=b.get(d.id),Gl(d,(g,h,k)=>bm(g,h,k||null,a.i.retryParameters,a.g.hc)),f.ka=d);a.h.set(e,f);lm(a,f,0)}}mm(a)}
function km(a,b){const c={stream:b,type:b.type,ya:null,ka:fm(a,b),Ja:null,gb:null,Ie:null,ec:null,dc:null,Ge:null,He:null,Bc:null,endOfStream:!1,La:!1,hb:null,Lb:!1,Uc:0,ud:!1,Nb:!1,Mc:!0,qf:!1,wg:!1,$c:!1,Xa:null,sc:null};b.dependencyStream&&(c.sc=km(a,b.dependencyStream));return c}function lm(a,b,c){const d=b.type;if(d!=F||a.h.has(d))b.hb=(new H(async()=>{try{await nm(a,b)}catch(e){if(a.g)a.g.onError(e)}})).Z(c)}
async function om(a,b){a.R++;const c=a.R;try{await uk(a.g.aa,F)}catch(e){if(a.g)a.g.onError(e)}const d=Ie(b.mimeType,b.codecs);Xj(a.g.aa,d,a.j.sequenceMode,b.external);(a.g.aa.W.isTextVisible()||a.i.alwaysStreamText)&&a.R==c&&(b=km(a,b),a.h.set(F,b),lm(a,b,0))}function pm(a){const b=a.h.get(F);b&&(dm(b),em(b).catch(()=>{}),a.G=a.h.get(F),a.h.delete(F),b.stream&&b.stream.closeSegmentIndex&&b.stream.closeSegmentIndex());a.B=null}
function qm(a,b,c,d,e,f){const g=a.h.get(b.type);g||b.type!=F?g&&(g.Bc&&(b.trickModeVideo?(g.Bc=b,b=b.trickModeVideo):g.Bc=null),g.stream!=b||e)&&(a.m.has(b)?g.ka=a.m.get(b):g.ka&&Pl(g.ka,b),b.type==F&&g.stream!=b&&(e=Ie(b.mimeType,b.codecs),Xj(a.g.aa,e,a.j.sequenceMode,b.external)),!a.m.has(g.stream)&&g.stream.closeSegmentIndex&&(g.La?(e="("+g.type+":"+g.stream.id+")",a.K.has(e)||a.K.set(e,g.stream.closeSegmentIndex)):g.stream.closeSegmentIndex()),e=g.stream.isAudioMuxedInVideo!=b.isAudioMuxedInVideo,
g.stream=b,g.ya=null,g.qf=!!f,b.dependencyStream?g.sc=km(a,b.dependencyStream):g.sc=null,mm(a),e&&(g.gb=null,g.ec=null,g.dc=null,b.isAudioMuxedInVideo&&(b=null,g.type==="video"?b=a.h.get("audio"):g.type==="audio"&&(b=a.h.get("video")),b&&(em(b).catch(()=>{}),b.gb=null,b.ec=null,b.dc=null,rm(a,b),sm(a,b).catch(h=>{if(a.g)a.g.onError(h)})))),c?g.Nb?g.ud=!0:g.La?(g.Lb=!0,g.Uc=d,g.ud=!0):(dm(g),tm(a,g,!0,d).catch(h=>{if(a.g)a.g.onError(h)})):g.La||g.hb||lm(a,g,0),sm(a,g).catch(h=>{if(a.g)a.g.onError(h)})):
om(a,b)}function um(a,b){var c=a.g.Pa()<0;for(var d of a.h.values())d.ya&&d.ya.qd(c),d.ka&&d.ka.qd(c);for(const e of a.m.values())e.qd(c);if(c=a.h.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.Bc&&(qm(a,b,!1,0,!1),c.Bc=d);else if(b=c.Bc)c.Bc=null,qm(a,b,!0,0,!1)}function vm(a,b,c=!1,d=0,e=!1,f=!1){a.u=b;a.L&&(b.video&&qm(a,b.video,c,d,e,f),b.audio&&qm(a,b.audio,c,d,e,f))}async function wm(a,b){a.G=null;a.B=b;a.L&&(b.segmentIndex||await b.createSegmentIndex(),qm(a,b,!0,0,!1))}
function xm(a){const b=a.h.get(F);b&&qm(a,b.stream,!0,0,!0)}function ym(a,b){for(const [c,d]of a.K.entries()){const e=c,f=d;e.includes(b.type)&&(f(),a.K.delete(e))}}function mm(a){a.F.Na();zm(a)&&(a.F.o(a.g.video,"waiting",()=>Am(a)),a.F.o(a.g.video,"timeupdate",()=>Am(a)))}function rm(a,b){b.Nb||b.Lb||(b.La?(b.Lb=!0,b.Uc=0):dk(a.g.aa,b.type)==null?b.hb==null&&lm(a,b,0):(dm(b),tm(a,b,!1,0).catch(c=>{if(a.g)a.g.onError(c)})))}
async function sm(a,b){if(b.Xa){var c=b.stream,d=b.Xa;c.segmentIndex||await c.createSegmentIndex();var e=c.dependencyStream;e&&!e.segmentIndex&&await e.createSegmentIndex();if(d=b.Xa==d){if(c=b.stream==c){c=a.g.Pb();d=ek(a.g.aa,b.type);e=b.stream.segmentIndex.find(b.Ja?b.Ja.endTime:c);var f=e==null?null:b.stream.segmentIndex.get(e);e=f?Qi(f):null;f&&!e&&(e=(f.endTime-f.getStartTime())*(b.stream.bandwidth||a.u.bandwidth)/8);e?((f=f.ha)&&(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.Xa.h.g>e?!0:!1):c=!0}d=c}d&&b.Xa.abort()}}async function tm(a,b,c,d){b.Lb=!1;b.ud=!1;b.Uc=0;b.Nb=!0;b.Ja=null;b.ya=null;b.ka&&!a.m.has(b.stream)&&Nl(b.ka);if(d){c=a.g.Pb();const e=a.g.aa.getDuration();await a.g.aa.remove(b.type,c+d,e)}else await uk(a.g.aa,b.type),Dg(a.l),c&&await a.g.aa.flush(b.type);Dg(a.l);b.Nb=!1;b.endOfStream=!1;b.La||b.hb||lm(a,b,0)}
function zm(a){if(a.i.crossBoundaryStrategy!=="keep")return!0;const b=tb();if(!b.l())for(var c of a.h.keys()){var d=a.h.get(c);if(d.type===Xb.Ug)continue;if((d=d.stream)&&d.fullMimeTypes&&d.fullMimeTypes.size>1)return!0}else if(!b.O())for(const e of a.h.keys()){c=a.h.get(e);if(c.type===Xb.Ug)continue;if((c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1){a=new Set;for(d of c.fullMimeTypes)a.add(Ne(d));return a.size>1}}return!1}
function Am(a){if(zm(a)){a.J.stop();var b=a.g.Pb(),c=a.h.get("video")||a.h.get("audio");c&&(c=c.gb)&&c.g!==null&&(b=c.g-b,b<0||b>1||(a.H=c.g+.1,a.J.Z(b)))}}
function jm(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=ek(a.g.aa,g.type),k=a.g.Pb();(g=Bm(a,g,k,h))&&g.codecs&&g.mimeType&&(f.codecs=g.codecs,f.mimeType=g.mimeType)}},d=new Map;var e=a.u.audio;e&&(c(e),d.set("audio",e));if(e=a.u.video)c(e),d.set("video",e);b&&a.B&&d.set(F,a.B);return d}
async function Cm(a,b,c){if(c.code==3024)b.La=!1,dm(b),lm(a,b,0);else{await eg(a.T);Dg(a.l);if(c.category===1&&c.code!=1003){if(b.Bc){um(a,!1);return}c.handled=a.g.disableStream(b.stream,Dm(a,c));c.handled&&(c.severity=1)}if(!c.handled&&c.code==1011){const d=a.g.Pb(),e=ek(a.g.aa,b.type);let f=Bm(a,b,d,e);for(;f?.Sb()===2;)b.Ja=f,f=Bm(a,b,d,e);if(f){await Fk(a.g.aa,b.type,f.startTime);b.La=!1;b.$c=!1;dm(b);lm(a,b,0);return}}if(!c.handled||c.code!=1011)a.g.onError(c);c.handled||a.i.failureCallback(c)}}
function Em(a,b){if(am(b))return rk(a.g.aa,b.stream.originalId||""),null;b.type==F&&sk(a.g.aa);if(b.stream.isAudioMuxedInVideo&&b.type=="audio")return null;if(b.type!=F&&Vj(a.g.aa))return Fm(a,!0),null;var c=a.i.updateIntervalSeconds/Math.max(1,Math.abs(a.g.Pa()));if(!bk(a.g.aa)&&b.type!=F)return c/2;const d=a.g.Pb();if(b.type==="audio")for(var e of a.m.keys()){var f=a.m.get(e);f.Ua(d,!0);Ml(f,d)}e=b.Ja?b.Ja.endTime:d;var g=hk(a.g.aa,b.type,d);f=Math.max(1,Math.max(a.i.rebufferingGoal,a.i.bufferingGoal)*
a.C);var h=a.j.presentationTimeline.getDuration()-e,k=ek(a.g.aa,b.type);if(h<1E-6&&k)return b.endOfStream=!0,b.type=="video"&&((c=a.h.get(F))&&am(c)&&(c.endOfStream=!0),(c=a.h.get("audio"))&&c.stream.isAudioMuxedInVideo&&(c.endOfStream=!0)),null;b.endOfStream=!1;if(g>=f)return c/2;g=!b.ya;k=Bm(a,b,d,k);if(!k)return a=Infinity,(b=b.Ja)&&(a=b.endTime-b.startTime),Math.min(a/2,c);h=b.gb;const l=k.ha;h&&l&&Oi(l,h)&&(h.g=l.g);h=!1;g&&b.qf&&(h=!0,b.qf=!1);g=Infinity;for(const m of a.h.values())am(m)||m.stream.isAudioMuxedInVideo||
m.ya&&!m.ya.current()||(g=Math.min(g,m.Ja?m.Ja.endTime:d));if(e>=g+a.j.presentationTimeline.h)return c;b.ka&&b.ya&&!a.m.has(b.stream)&&(b.ka.Ua(k.startTime+.001),Ml(b.ka,k.startTime).catch(()=>{}));if(zm(a)&&Gm(a,b,k))return null;Hm(a,b,d,k,h).catch(()=>{});b.sc&&Im(a,b.sc,d,f);return null}
async function nm(a,b){Dg(a.l);if(!b.La&&b.hb!=null&&!b.Nb)if(b.hb=null,b.Lb)await tm(a,b,b.ud,b.Uc);else{ym(a,b);if(!b.stream.segmentIndex){var c=b.stream;try{await b.stream.createSegmentIndex()}catch(d){await Cm(a,b,d);return}if(c!=b.stream){c.closeSegmentIndex&&c.closeSegmentIndex();b.La||b.hb||lm(a,b,0);return}}if(b.sc&&!b.sc.stream.segmentIndex)try{await b.sc.stream.createSegmentIndex()}catch(d){}try{const d=Em(a,b);d!=null&&(lm(a,b,d),b.$c=!1)}catch(d){await Cm(a,b,d);return}b.type!==F&&(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.L&&c.every(d=>d.endOfStream)&&(await a.g.aa.endOfStream(),Dg(a.l),b=a.g.aa.getDuration(),b!=0&&b<a.j.presentationTimeline.getDuration()&&a.j.presentationTimeline.qb(b)))}}
async function Fm(a,b=!1){var c=Date.now()/1E3,d=a.i.minTimeBetweenRecoveries;if(!b&&(!a.i.allowMediaSourceRecoveries||c-a.O<d))return!1;a.O=c;if(b=a.h.get("audio"))dm(b),b.Xa&&(b.Xa.abort(),b.Xa=null),b.gb=null,b.ec=null,b.dc=null,b.La=!1,b.Lb=!1,b.Uc=0,b.ud=!1,b.Nb=!1,b.ya&&b.ya.zg();if(c=a.h.get("video"))dm(c),c.Xa&&(c.Xa.abort(),c.Xa=null),c.gb=null,c.ec=null,c.dc=null,c.La=!1,c.Lb=!1,c.Uc=0,c.ud=!1,c.Nb=!1,c.ya&&c.ya.zg();d=a.g.video.paused;await Ck(a.g.aa,jm(a));!c||c.Nb||c.La||c.hb||lm(a,c,
0);!b||b.Nb||b.La||b.hb||lm(a,b,0);d||a.g.video.play();return!0}
function Bm(a,b,c,d){if(b.ya)return(c=b.ya.current())&&b.Ja&&(a=b.Ja.endTime,sj(b.Ja.startTime,c.startTime,.002)&&sj(a,c.endTime,.002)&&(c=b.ya.next().value)),c;if(b.Ja||d)return c=b.Ja?b.Ja.endTime:d,a=a.g.Pa()<0,b.stream.segmentIndex&&(b.ya=b.stream.segmentIndex.Ob(c,!1,a)),b.ya&&b.ya.next().value;d=a.j.sequenceMode||zm(a)?0:a.i.inaccurateManifestTolerance;let e=Math.max(c-d,0);var f=a.g.aa.getDuration();Math.abs(e-f)<1&&(d=1,e=Math.max(c-d,0));a=a.g.Pa()<0;f=null;d&&(b.stream.segmentIndex&&(b.ya=
b.stream.segmentIndex.Ob(e,!1,a)),f=b.ya&&b.ya.next().value);f||(b.stream.segmentIndex&&(b.ya=b.stream.segmentIndex.Ob(c,!1,a)),f=b.ya&&b.ya.next().value);for(;f?.Sb()===2;)f=b.ya?.next().value??null;return f}
function Gm(a,b,c){if(b.type===F)return!1;const d=b.gb;if(!d)return!1;const e=c.ha;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=Oe(Se(d.mimeType)),g=Oe(Se(e.mimeType));d.mimeType==e.mimeType&&f==g&&(c=!1)}(a.h.get("video")||a.h.get("audio"))===
b&&c&&(a.I||b.Mc)&&(a.I=!1,Fm(a,!0).then(()=>{const f=(new Map).set("oldEncrypted",d.encrypted).set("newEncrypted",e.encrypted);a.g.onEvent(new C("boundarycrossed",f))}));return c}
async function Hm(a,b,c,d,e){const f=b.stream;var g=b.ya;b.La=!0;try{if(d.Sb()==2)throw new D(1,1,1011);await Jm(a,b,d,e);Dg(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.u)){let m=new Uint8Array(0),n=!1,p=!1,r;const q=await Km(a,b,d,async t=>{if(!n&&(p=!0,Dg(a.l),!a.D))try{m=Nb(m,t);let u=!1,v=0;(new Ug).box("mdat",y=>{v=y.size+y.start;u=!0}).parse(m,!1,!0);if(u){const y=m.subarray(0,
v);m=m.subarray(v);await Lm(a,b,c,f,d,y,!0,e);b.ka&&b.ya&&Ml(b.ka,d.startTime,!0)}}catch(u){r=u}});if(r)throw r;if(!p){n=!0;Dg(a.l);if(a.D)return;if(b.Lb){b.La=!1;lm(a,b,0);return}await Lm(a,b,c,f,d,q,!1,e)}b.ka&&b.ya&&Ml(b.ka,d.startTime,!0)}else{const m=await Km(a,b,d);Dg(a.l);if(a.D)return;Dg(a.l);if(b.Lb){b.La=!1;lm(a,b,0);return}await Lm(a,b,c,f,d,m,!1,e)}Dg(a.l);if(!a.D){b.Ja=d;g.next();b.La=!1;b.wg=!1;var l=a.g.aa.tc()[b.type];xa(JSON.stringify(l));b.Lb||(g=null,b.type==="video"?g=a.h.get("audio"):
b.type==="audio"&&(g=a.h.get("video")),g&&g.type=="audio"?a.g.gd(d,b.stream,g.stream.isAudioMuxedInVideo,!1):a.g.gd(d,b.stream,b.stream.codecs.includes(","),!1));dm(b);lm(a,b,0)}}}catch(m){Dg(a.l,m),a.D||(b.La=!1,m.code==7001?(b.La=!1,dm(b),lm(a,b,0)):b.type==F&&a.i.ignoreTextStreamFailures?a.h.delete(F):m.code==3017?await Mm(a,b,m):(b.$c=!0,m.category==1&&b.ka&&Ll(b.ka,d),m.severity=2,await Cm(a,b,m)))}}
async function Im(a,b,c,d){var e=b.stream,f=e.segmentIndex;for(c=(f=f&&f.Ob(c))&&f.next().value;c&&a.M.includes(c.startTime);)c=f&&f.next().value;if(c){if((f=c.ha)&&!Oi(f,b.gb)){b.gb=f;try{const g=await Km(a,b,f);if(!a.g)return;ok(a.g.aa,g,0,e);a.M=[]}catch(g){throw b.gb=null,g;}}if(!b.Ja||b.Ja!=c){b.Ja=c;try{const g=await Km(a,b,c);if(!a.g)return;ok(a.g.aa,g,0,e);a.M.push(c.startTime)}catch(g){throw b.Ja=null,g;}a.g&&(b.Lb||(e=null,b.type==="video"?e=a.h.get("audio"):b.type==="audio"&&(e=a.h.get("video")),
e&&e.type=="audio"?a.g.gd(c,b.stream,e.stream.isAudioMuxedInVideo,!0):a.g.gd(c,b.stream,b.stream.codecs.includes(","),!0)),e=Math.max(0,...a.M),a.g.Pb()+d>e&&await Im(a,b,c.startTime,d))}}}
async function Jm(a,b,c,d){var e=b.Ja==null;const f=[];var g=Math.max(0,Math.max(c.appendWindowStart,a.W)-.1);const h=Math.min(c.appendWindowEnd,a.V)+.1;var k=c.codecs||b.stream.codecs;const l=Qe(k),m=Re(c.mimeType||b.stream.mimeType),n=c.timestampOffset;if(n!=b.Ie||g!=b.ec||h!=b.dc||l!=b.Ge||m!=b.He)b.Ge&&b.He&&Mk(a.g.aa,b.type,m,k,jm(a))&&(k=null,b.type==="video"?k=a.h.get("audio"):b.type==="audio"&&(k=a.h.get("video")),k&&(await em(k).catch(()=>{}),k.gb=null,k.ec=null,k.dc=null,rm(a,k))),await Nm(a,
b,n,g,h,c,l,m);if(!Oi(c.ha,b.gb)&&(b.gb=c.ha,c.l&&c.ha)){const p=Km(a,b,c.ha);g=c.startTime;e&&(e=ek(a.g.aa,b.type),e!=null&&(g=e));a.g.Gj(g,c.ha);f.push((async()=>{try{const r=await p;Dg(a.l);let q=null;const t=new Map,u={projection:null,hfov:null};if(b.stream){const A=b.stream.videoLayout;if(A){const B=A.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 Ug;v.box("moov",Mg).box("trak",Mg).box("mdia",Mg).ra("mdhd",A=>{q=Zh(A.reader,A.version).timescale}).ra("hdlr",A=>{A=A.reader;A.skip(4);A=A.Kb(4,!1);switch(String.fromCharCode(A[0],A[1],A[2],A[3])){case "soun":t.set("audio",q);break;case "vide":t.set("video",q)}q=null});b.type!=="video"||u.projection||v.box("minf",Mg).box("stbl",Mg).ra("stsd",Og).boxes("encv avc1 avc3 hev1 hvc1 dvav dva1 dvh1 dvhe dvc1 dvi1".split(" "),Pg).box("vexu",Mg).box("proj",Mg).ra("prji",
A=>{A=A.reader.ld();u.projection=A}).box("hfov",A=>{A=A.reader.Y()/1E3;u.hfov=A});v.parse(r,!0,!0);b.type==="video"&&Om(a,u);t.has(b.type)?c.ha.timescale=t.get(b.type):q!=null&&(c.ha.timescale=q);const y=b.stream.segmentIndex;let w;y instanceof sl&&(w=rl(y,c.startTime));const z=b.stream.closedCaptions&&b.stream.closedCaptions.size>0;await a.g.Zg(b.type,r);await kk(a.g.aa,b.type,r,null,b.stream,z,b.Mc,d,!1,!1,w)}catch(r){throw b.gb=null,r;}})())}c.i!=(b.Ja?b.Ja.i:-1)&&f.push(Fk(a.g.aa,b.type,c.startTime));
await Promise.all(f)}async function Km(a,b,c,d){var e=c.Rb();if(e)return e;e=null;if(b.ka){{e=b.ka;let f=e.g;c instanceof Pi&&(f=e.j);f.has(c)?(e=f.get(c),d&&(e.Lg=d),e=e.Md):e=null}}e||=bm(c,b.stream,d||null,a.i.retryParameters,a.g.hc);a=0;b.ya&&(a=b.ya.h);b.Xa=e;d=await e.promise;b.Xa=null;b=d.data;c.aesKey&&(b=await Wl(b,c.aesKey,a));return b}
async function Lm(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.ha&&(m=e.ha.timescale);l&&m&&d.type==="video"&&a.j.type=="DASH"&&(new Ug).box("moof",Mg).box("traf",Mg).ra("tfdt",async n=>{if(n=Yh(n.reader,n.version).baseMediaDecodeTime)n=-n/m,(Number(b.Ie)||0)<n&&await Nm(a,b,n,b.ec,b.dc,e)}).parse(f,!1,g)}await Pm(a,b,c);Dg(a.l);c=b.Mc;b.Mc=!1;await a.g.Zg(b.type,f);await kk(a.g.aa,
b.type,f,e,d,k,c,h,g);Dg(a.l)}async function Mm(a,b,c){var d=!1;for(const e of a.h.values())if(e!=b&&e.wg){d=!0;break}if(!d){if(a.i.avoidEvictionOnQuotaExceededError){if(a.g.disableStream(b.stream,Dm(a,c)))return;lm(a,b,4);return}d=Math.round(100*a.C);if(d>20)a.C-=.2;else if(d>4)a.C-=.04;else{a.g.disableStream(b.stream,Dm(a,c))?(a.C=1,c=a.g.Pb(),await Pm(a,b,c)):(b.$c=!0,a.D=!0,a.g.onError(c));return}b.wg=!0;c=a.g.Pb();await Pm(a,b,c)}lm(a,b,4)}
function Dm(a,b){return a.i.maxDisabledTime===0&&b.code==1011?1:a.i.maxDisabledTime}
async function Pm(a,b,c){a.G==b&&(a.G=null);var d=b.stream.segmentIndex;let e;d instanceof sl&&(d.Ua(a.j.presentationTimeline.yb()),e=[],ql(d,m=>{e.push(m.A())}));d=Math.max(a.i.bufferBehind*a.C,a.j.presentationTimeline.h);const f=dk(a.g.aa,b.type);if(f!=null){var g=c-f,h=a.i.evictionGoal,k=a.j.presentationTimeline.Qb(),l=g-d;a.j.presentationTimeline.xb()-k>h&&(l=Math.max(g-d,k-h-f));l<=h||(await a.g.aa.remove(b.type,f,f+l,e),Dg(a.l),a.G&&(await Pm(a,a.G,c),Dg(a.l)))}}
async function Nm(a,b,c,d,e,f,g,h){const k=jm(a);try{b.ec=d;b.dc=e;g&&(b.Ge=g);h&&(b.He=h);b.Ie=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 Ek(a.g.aa,g.type,c,d,e,l,g.stream.mimeType,g.stream.codecs,k);await Ek(a.g.aa,b.type,c,d,e,l,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,k)}catch(l){throw b.ec=null,b.dc=null,b.Ge=null,b.He=null,b.Ie=null,l;}}
function Om(a,b){if(a.P.projection!=b.projection||a.P.hfov!=b.hfov){if(b.projection!=null||b.hfov!=null){var c=(new Map).set("detail",b);c=new C("spatialvideoinfo",c)}else c=new C("nospatialvideoinfo");c.cancelable=!0;a.g.onEvent(c);a.P=b}}
var Qm=class{constructor(a,b){this.g=b;this.j=a;this.i=null;this.K=new Map;this.C=1;this.B=this.u=null;this.R=0;this.h=new Map;this.L=!1;this.T=null;this.D=!1;this.l=new Eg(()=>cm(this));this.O=Date.now()/1E3;this.m=new Map;this.P={projection:null,hfov:null};this.W=0;this.V=Infinity;this.G=null;this.M=[];this.A=new H(()=>{if(this.j&&this.g)if(this.j.presentationTimeline.U()){var c=this.j.presentationTimeline.Qb(),d=this.j.presentationTimeline.xb();d-c>1?Hk(this.g.aa,c,d):Ik(this.g.aa)}else Ik(this.g.aa),
this.A&&this.A.stop();else this.A&&this.A.stop()});this.H=null;this.I=!1;this.J=new H(()=>{const c=this.g.video;!c.ended&&this.H&&(this.I=!0,c.currentTime=this.H,this.H=null)});this.F=new zc}destroy(){return this.l.destroy()}configure(a){this.i=a;this.T=new fg({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.ka&&(Nl(b.ka),b.ka=null);for(const c of this.m.keys())Nl(this.m.get(c)),this.m.delete(c)}a.disableTextPrefetch&&(b=this.h.get(F))&&b.ka&&(Nl(b.ka),b.ka=null);a.disableVideoPrefetch&&(b=this.h.get("video"))&&b.ka&&(Nl(b.ka),b.ka=null);for(const c of this.h.keys())b=this.h.get(c),b.ka?(Ol(b.ka,a.segmentPrefetchLimit),a.segmentPrefetchLimit>0||(Nl(b.ka),b.ka=null)):a.segmentPrefetchLimit>0&&(b.ka=fm(this,b.stream));a.disableAudioPrefetch||gm(this)}async start(a){await im(this,
a||new Map);Dg(this.l);this.L=!0}Mc(){if(this.g){var a=this.g.Pb(),b=c=>{var d=this.g.aa;c==F?(c=d.h,c=c.g==null||c.h==null?!1:a>=c.g&&a<c.h):(c=ck(d,c),c=Xi(c,a));return c};for(const c of this.h.keys()){const d=this.h.get(c);if(!this.I&&!b(c)){this.O=0;d.ka&&(d.ka.h=null);if(d.type==="audio")for(const e of this.m.values())e.h=null;d.ya=null;(ek(this.g.aa,c)!=null||d.La)&&rm(this,d);d.Xa&&(d.Xa.abort(),d.Xa=null);c===F&&vk(this.g.aa);d.Mc=!0}!this.I||d.Nb||d.La||d.hb||lm(this,d,0)}zm(this)&&Am(this)}}updateDuration(){const a=
Wh(),b=this.j.presentationTimeline.getDuration();b<Infinity?(a&&(this.A&&this.A.stop(),Ik(this.g.aa)),this.g.aa.qb(b)):a?(this.A&&this.A.wa(.5),this.g.aa.qb(Infinity)):this.g.aa.qb(4294967296)}};function Rm(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)?(ra("Invalid config, dangerous key "+m),l=!1):k||n in c?b[n]===void 0?p===void 0||k?delete a[n]:a[n]=nd(p):h?a[n]=b[n]:p.constructor==Object&&b[n]&&b[n].constructor==Object?(a[n]||(a[n]=nd(p)),m=Rm(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?(ra("Invalid config, wrong type for "+m),l=!1):typeof c[n]=="function"&&c[n].length!=b[n].length?(sa("Unexpected number of arguments for "+m),a[n]=b[n]):a[n]=Array.isArray(a[n])?b[n].slice():b[n]:(ra("Invalid config, unrecognized key "+m),l=!1)}return l}
function Sm(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 Tm(a,b){return a&&b}
function Um(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])?uc(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 h of Object.keys(f))if(!(f[h]instanceof
HTMLElement))if(c(f[h])&&Object.keys(f[h]).length===0)delete f[h];else{var g=f[h];Array.isArray(g)&&g.length===0?delete f[h]:typeof f[h]=="function"?delete f[h]:c(f[h])&&(e(f[h]),Object.keys(f[h]).length===0&&delete f[h])}};e(a);return a}var Vm=class{};x("shaka.util.ConfigUtils",Vm);Vm.getDifferenceFromConfigObjects=Um;Vm.convertToConfigObject=Sm;Vm.mergeConfigObjects=Rm;x("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function Wm(a){a=Bb(a);return(new Ha(a)).ub}function Xm(a,b,c){if(!c||!c.byteLength)throw new D(2,6,6015);let d;typeof b=="string"?d=Eb(b,!0):d=b;a=Bb(a);a=Eb(a,!0);const e=new Uint8Array(12+a.byteLength+d.byteLength+c.byteLength);let f=0;b=g=>{db(e).setUint32(f,g.byteLength,!0);f+=4;e.set($a(g),f);f+=g.byteLength};b(a);b(d);b(c);return e}function Ym(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Bb(a).split("skd://").pop();return Xm(a,c,b)}
function Zm(a,b){a===2&&(a=b.drmInfo)&&nb(a.keySystem)&&(b.headers["Content-Type"]="application/octet-stream")}var $m=class{};x("shaka.drm.FairPlay",$m);
$m.commonFairPlayResponse=function(a,b){if(a===2&&(a=b.originalRequest.drmInfo)&&nb(a.keySystem)){try{var c=xb(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=bb(Jb(c)))}};$m.muxFairPlayRequest=function(a,b){Zm(a,b)};
$m.expressplayFairPlayRequest=function(a,b){if(a===2){var c=b.drmInfo;c&&nb(c.keySystem)&&Zm(a,b)}};$m.conaxFairPlayRequest=function(a,b){Zm(a,b)};$m.ezdrmFairPlayRequest=function(a,b){Zm(a,b)};$m.verimatrixFairPlayRequest=function(a,b){a===2&&(a=b.drmInfo)&&nb(a.keySystem)&&(a=$a(b.body),a=Ib(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=Cb("spc="+a))};$m.muxInitDataTransform=function(a,b,c){return Ym(a,b,c)};
$m.expressplayInitDataTransform=function(a,b,c){return Ym(a,b,c)};$m.conaxInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Bb(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(c.length*2);d=cb(d);for(let e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return Xm(a,d,b)};$m.ezdrmInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Bb(a).split(";").pop();return Xm(a,c,b)};
$m.verimatrixInitDataTransform=function(a,b,c){return Ym(a,b,c)};$m.initDataTransform=Xm;$m.defaultGetContentId=Wm;$m.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 an(a,b){if(a.mimeType!=b.mimeType)return!1;a=a.codecs.split(",").map(c=>Qe(c));b=b.codecs.split(",").map(c=>Qe(c));return uc(a,b)}
function bn(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&&!an(d,e))&&uc(d.roles,e.roles)&&d.groupId===e.groupId)}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||an(a,b))&&uc(a.roles,b.roles)));return d?!1:!0}
var cn=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 bn(this,a,b)?(this.g.add(a),!0):!1}values(){return this.g.values()}};x("shaka.media.AdaptationSet",cn);function dn(a,b){b=$b(b);const c=jc(b,a.map(d=>ic(d)));return c?a.filter(d=>c==ic(d)):[]}function en(a,b){return a.filter(c=>c.audio?b?c.audio.roles.includes(b):c.audio.roles.length==0:!1)}function fn(a,b){return a.filter(c=>c.video?b?c.video.roles.includes(b):c.video.roles.length==0:!1)}function gn(a,b){return a.filter(c=>c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1)}
function hn(a,b){return a.filter(c=>c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1)}function jn(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 kn(a,b){if(b=="AUTO"){const c=a.some(d=>d.video&&d.video.hdr&&d.video.hdr=="HLG"?!0:!1);b=tb().F(c)}return a.filter(c=>c.video&&c.video.hdr&&c.video.hdr!=b?!1:!0)}
function ln(a,b){return a.filter(c=>c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0)}function mn(a,b){return a.filter(c=>c.audio&&c.audio.spatialAudio!=b?!1:!0)}function nn(a,b){return a.filter(c=>c.audio&&c.audio.codecs!=b?!1:!0)}
var on=class{constructor(){this.h=this.g=null}configure(a){this.g=a}getConfiguration(){return this.g}create(a){var b;if(this.g.language){const g=dn(a,this.g.language);g.length&&(b=g)}b||(b=a.filter(g=>g.primary),b=b.length?b:a);a=en(b,this.g.role);a.length&&(b=a);a=fn(b,this.g.videoRole);a.length&&(b=a);this.g.videoLayout&&(a=ln(b,this.g.videoLayout),a.length&&(b=a));this.g.hdrLevel&&(a=kn(b,this.g.hdrLevel),a.length&&(b=a));const c=[this.g.channelCount,this.g.preferredAudioChannelCount];a=c.filter((g,
h)=>g&&c.indexOf(g)===h);if(a.length)for(var d of a)if(a=jn(b,d),a.length){b=a;break}this.g.audioLabel&&(d=gn(b,this.g.audioLabel),d.length&&(b=d));this.g.videoLabel&&(d=hn(b,this.g.videoLabel),d.length&&(b=d));d=mn(b,this.g.spatialAudio);d.length&&(b=d);const e=[this.g.audioCodec,this.g.activeAudioCodec,...this.g.preferredAudioCodecs];d=e.filter((g,h)=>g&&e.indexOf(g)===h);if(d.length)for(var f of d)if(d=nn(b,f),d.length){b=d;break}f=tb();f=this.g.codecSwitchingStrategy=="smooth"&&f.l();return this.h=
new cn(b[0],b,!f)}getLastAdaptationSet(){return this.h}};function pn(){let a=Infinity;const b=tb();navigator.connection&&navigator.connection.saveData&&(a=360);const c={retryParameters:cg(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:(h,k,l)=>{"apple"===window.shakaMediaKeysPolyfill&&k=="skd"&&(k=l.serverCertificate,l=Wm(h),h=Xm(h,l,k));return h},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:!1,
minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE"};let d="reload";b.l()&&(d="smooth");const e={retryParameters:cg(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,updatePeriod:-1,
ignoreDrmInfo:!1,enableAudioGroups:!0,dash:{clockSyncUri:"",disableXlinkProcessing:!0,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready",
"urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"},manifestPreprocessor:qn,manifestPreprocessorTXml:rn,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.C(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1},mss:{manifestPreprocessor:qn,manifestPreprocessorTXml:rn,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}},
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)=>Tm([h,k]),usePersistentLicense:!0,numberOfParallelDownloads:5},g={drm:c,manifest:e,streaming:{retryParameters:cg(),failureCallback:h=>Tm([h]),rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!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},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3},mediaSource:{codecSwitchingStrategy:d,addExtraFeaturesToSourceBuffer:h=>Tm([h],""),forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:(h,k,l)=>Tm([h,k,l]),dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0},offline:f,abrFactory:()=>new bg,adaptationSetCriteriaFactory:(...h)=>new on(...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},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,
cacheLoadThreshold:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,removeLatencyFromFirstPacketTime:!1},autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredAudioRole:"",preferredVideoRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:!1,preferSpatialAudio:!1,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},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},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:Infinity,preloadPrevItem:!0,repeatMode:0}};f.trackSelectionCallback=async h=>sn(h,g.preferredAudioLanguage,g.preferredVideoHdrLevel);
return b.j(g)}function qn(a){return Tm([a],a)}function rn(a){return Tm([a],a)}
function sn(a,b,c){let d=c;d=="AUTO"&&(c=a.some(h=>h.hdr&&h.hdr=="HLG"?!0:!1),d=tb().F(c));var e=a.filter(h=>h.type!="variant"||h.hdr&&h.hdr!=d?!1:!0);c=[];const f=jc(b,e.map(h=>h.language));f&&(c=e.filter(h=>$b(h.language)==f));c.length==0&&(c=e.filter(h=>h.primary));c.length==0&&(e.map(h=>h.language),c=e);const g=c.filter(h=>h.height&&h.height<=480);g.length&&(g.sort((h,k)=>k.height-h.height),c=g.filter(h=>h.height==g[0].height));b=[];c.length&&(e=Math.floor(c.length/2),c.sort((h,k)=>h.bandwidth-
k.bandwidth),b.push(c[e]));for(const h of a)h.type!=F&&h.type!="image"||b.push(h);return b}function tn(){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 un(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 Rm(a,b,c||pn(),d,"")}var vn=class{};x("shaka.util.PlayerConfiguration",vn);vn.mergeConfigObjects=un;vn.createDefaultForLL=tn;vn.createDefault=pn;function wn(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 xn(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 yn=class{constructor(){this.g=null;this.h=[]}};function zn(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 An=class{constructor(){this.i=this.h=null;this.g=[]}};function Bn(a,b,c){a.O=b;a.M=c}function Cn(a,b,c){a.T=b;a.C=c}function Dn(a,b){b>=0&&(a.I=b)}function En(a,b){a.i=isNaN(a.i)?b:Math.max(a.i,b)}function Fn(a,b){b>=0&&(a.u=b)}function Gn(a,b){b>=0&&(a.D=b)}function Hn(a,b){b>=0&&(a.J=b)}function In(a,b){a.j=isNaN(a.j)?b:a.j+b}
function Jn(a){var b=a.T,c=a.C,d=a.l,e=a.B,f=a.M,g=a.O,h=a.L,k=a.R,l=a.P,m=a.A,n=a.i,p=a.F,r=a.I,q=a.m,t=wn(a.g,"playing"),u=wn(a.g,"paused"),v=wn(a.g,"buffering"),y=a.u,w=a.D,z=a.J,A=a.wh,B=a.j,E=a.K,G=a.H,ea=a.G,M=xn(a.g);a=a.h;const N=[];for(const ia of a.g)N.push({timestamp:ia.timestamp,id:ia.id,type:ia.type,fromAdaptation:ia.fromAdaptation,bandwidth:ia.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:r,drmTimeSeconds:q,playTime:t,pauseTime:u,bufferingTime:v,licenseTime:y,liveLatency:w,maxSegmentDuration:z,manifestSizeBytes:A,bytesDownloaded:B,nonFatalErrorCount:E,manifestPeriodCount:G,manifestGapCount:ea,stateHistory:M,switchHistory:N}}
var Kn=class{constructor(){this.C=this.T=NaN;this.l="";this.j=this.wh=this.A=this.B=this.J=this.D=this.u=this.m=this.I=this.F=this.i=this.P=this.R=this.L=this.M=this.O=NaN;this.K=0;this.G=this.H=NaN;this.g=new yn;this.h=new An}};function Ln(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 Mn(a,b,c){(a=b?a.I:a.J)?a.push(c):c()}function Nn(a){if(a.I)for(const b of a.I)b();a.I=null}function On(a,b){a.M=b;a.O=!0;if(a.J)for(const c of a.J)c();a.J=null}function Pn(a){a.ea=!0;return a.H}function Qn(a){a.W=!0;return a.j}function Rn(a){a.ma=!0;return a.K}
async function Sn(a){Tn(a,"manifest-parser");a.m||(a.G=Sc(a.L,a.R),a.m=a.G(),a.m.configure(a.g.manifest,()=>a.D));const b=Date.now()/1E3;Tn(a,"manifest");a.h||(a.h=await a.m.start(a.L,a.Ha),Ln(a.h),await Un(a));a.X.resolve();var c=new C("manifestparsed",void 0);await Promise.resolve();a.dispatchEvent(c);if(a.h.variants.length==0)throw new D(2,4,4036);Ln(a.h);Oh(a.F,a.h)&&(c=new C("trackschanged",void 0),await Promise.resolve(),Vn(a),a.dispatchEvent(c));Dn(a.T,Date.now()/1E3-b)}
function Vn(a){if(a.l)throw new D(2,7,7003);}async function Wn(a,b){if(a.h&&!a.j){Tn(a,"drm-engine");a.na=Date.now()/1E3;a.j=a.Aa();a.F.g=a.j;a.j.configure(a.g.drm,()=>a.D);var c=Qf(a.h.variants),d=!0;a.h&&a.h.presentationTimeline&&(d=a.h.presentationTimeline.U());await jh(a.j,c,a.h.offlineSessionIds,d);Vn(a);b&&(await a.j.Db(b),Vn(a));await Rh(a.F,a.h)&&(b=new C("trackschanged",void 0),await Promise.resolve(),a.dispatchEvent(b))}}
async function Xn(a){a.i&&!a.h.variants.includes(a.i)&&(await Yn(a.i),a.i=$n(a),a.i&&await ao(a.i))}async function bo(a){if(!a.i){var b=$n(a);b&&(a.i=b)}if(a.i){b=a.h.presentationTimeline.U();const c=[],d=a.i;d.video&&c.push(co(a,d.video,b));d.audio&&c.push(co(a,d.audio,b));const e=Rf(a.h.textStreams,a.g.preferredTextLanguage,a.g.preferredTextRole,a.g.preferForcedSubs)[0]||null;e&&Vf(d.audio,e,a.g)&&(c.push(co(a,e,b)),a.P=e);await Promise.all(c)}}
function Tn(a,b){a.dispatchEvent(new C("onstatechange",(new Map).set("state",b)))}
async function Un(a){a.C||(a.C=a.g.adaptationSetCriteriaFactory(),a.C.configure({language:a.g.preferredAudioLanguage,role:a.g.preferredAudioRole,videoRole:a.g.preferredVideoRole,channelCount:0,hdrLevel:a.g.preferredVideoHdrLevel,spatialAudio:a.g.preferSpatialAudio,videoLayout:a.g.preferredVideoLayout,audioLabel:a.g.preferredAudioLabel,videoLabel:a.g.preferredVideoLabel,codecSwitchingStrategy:a.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:a.g.preferredAudioCodecs,
preferredAudioChannelCount:a.g.preferredAudioChannelCount}));if(a.i||!a.h.variants.length?0:a.h.variants.length==1||a.h.type=="HLS")a.i=$n(a),a.i&&await ao(a.i)}function $n(a){if(!a.A){var b=a.g.abrFactory;a.A=b();a.A.configure(a.g.abr)}b=Qf(a.h.variants);b=a.C.create(b);a.A.setVariants(Array.from(b.values()));return a.A.chooseVariant(!0)}async function ao(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 Yn(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 co(a,b,c){const d=new Ql(a.g.streaming.segmentPrefetchLimit||2,b,(g,h,k)=>bm(g,h,k||null,a.g.streaming.retryParameters,a.oa,a.D),!1);a.K.set(b.id,d);b.segmentIndex||await b.createSegmentIndex();const e=b.segmentIndex.Ob(typeof a.u==="number"?a.u:0);let f=null;e&&(f=e.current(),f||(f=e.next().value));f||=b.segmentIndex.wb();f&&(c?f.ha&&await Hl(d,f.ha):await Ml(d,f.startTime))}
var eo=class extends Ba{constructor(a,b,c,d){super();this.L=a;this.R=b;this.oa=d.networkingEngine;this.u=c;this.C=null;this.na=0;this.Aa=d.Vc;this.F=d.yj;this.Ha=d.zj;this.g=d.config;this.m=this.G=this.h=null;this.$=!1;this.H=d.Lj;this.ea=!1;this.j=null;this.W=!1;this.A=null;this.K=new Map;this.ma=!1;this.za=d.Kj;this.T=new Kn;this.X=new gg;this.B=new gg;this.M=null;this.l=!1;this.V=d.ii;this.P=this.i=null;this.O=!1;this.J=[];this.I=[];this.D=!0}getStartTime(){return this.u}Gc(){return this.L}Zf(){return this.h}getStats(){return this.T}Wi(){return this.i?
If(this.i):null}Vi(){return this.P?Jf(this.P):null}start(){(async()=>{await Promise.resolve();try{await Sn(this),Vn(this),"webkit"!==window.shakaMediaKeysPolyfill&&(await Wn(this),Vn(this)),await Xn(this),Vn(this),this.V&&(await bo(this),Vn(this)),this.V&&this.j&&(await Gh(this.j),Vn(this)),this.B.resolve()}catch(a){a instanceof D&&(a.code==7001||a.code==7003)||this.B.reject(a)}})()}dispatchEvent(a){return this.M?this.M.dispatchEvent(a):super.dispatchEvent(a)}onError(a){a.severity===2&&(this.B.reject(a),
this.destroy());var b=(new Map).set("detail",a);b=new C("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)}configure(a,b){a=Sm(a,b);un(this.g,a)}getConfiguration(){return nd(this.g)}nk(){return this.B}async destroy(){this.l=!0;this.m&&!this.$&&await this.m.stop();this.A&&this.A.release();this.H&&!this.ea&&this.H.release();this.j&&!this.W&&await this.j.destroy();if(this.K.size>0&&!this.ma)for(const a of this.K.values())Nl(a)}};x("shaka.media.PreloadManager",eo);
eo.prototype.destroy=eo.prototype.destroy;eo.prototype.waitForFinish=eo.prototype.nk;eo.prototype.getPrefetchedTextTrack=eo.prototype.Vi;eo.prototype.getPrefetchedVariantTrack=eo.prototype.Wi;function fo(a,b,c,d){b=new C(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}
var jo=class extends Ba{constructor(a,b){super();this.i=a;this.l=b;this.g=new Map;this.m=[{Sc:null,Rc:go,Hc:(c,d)=>fo(this,"enter",c,d)},{Sc:ho,Rc:go,Hc:(c,d)=>fo(this,"enter",c,d)},{Sc:io,Rc:go,Hc:(c,d)=>fo(this,"enter",c,d)},{Sc:go,Rc:ho,Hc:(c,d)=>fo(this,"exit",c,d)},{Sc:go,Rc:io,Hc:(c,d)=>fo(this,"exit",c,d)},{Sc:ho,Rc:io,Hc:(c,d)=>{d?fo(this,"skip",c,d):(fo(this,"enter",c,d),fo(this,"exit",c,d))}},{Sc:io,Rc:ho,Hc:(c,d)=>fo(this,"skip",c,d)}];this.h=new zc;this.h.o(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.h.values()){const d=this.g.get(c),e=a<c.startTime?ho:a>c.endTime?io:go;this.g.set(c,e);for(const f of this.m)f.Sc==d&&f.Rc==e&&f.Hc(c,b)}}}},ho=1,go=2,io=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 ko={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(ko))ko[a.toLowerCase()]=ko[a];function lo(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(g=>lo(g,a)).join("");if(!a.payload)return a.payload;const c=[];var d=a.fontWeight>=le,e=a.fontStyle==me;const f=a.textDecoration.includes(ne);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;e==""&&b&&(e=b.color);d="";(e=mo(e))&&(d+=`.${e}`);e=a.backgroundColor;e==""&&b&&(e=b.backgroundColor);(b=mo(e))&&(d+=`.bg_${b}`);d&&c.push(["c",d]);return c.reduceRight((g,[h,k=""])=>`<${h}${k}>${g}</${h}>`,
a.payload)}
function mo(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 no(a,b){const c=[];for(const d of oo(a))d.isContainer?c.push(...no(d.nestedCues,d)):(a=d.clone(),a.nestedCues=[],a.payload=lo(d,b),c.push(a));return c}function oo(a){const b=[];for(const c of a)b.some(d=>be(c,d))||b.push(c);return b}
function po(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 qo(a,b){var c=no(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=po(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 ro(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")};var so=class{constructor(a){this.i=a;this.l=new zc;this.j=null;this.h=new Map;this.g=-1;this.A=!1;this.m=null;this.C=()=>{this.m?.stop();this.m=null;this.l.Ea(this.i,"textchanged",this.u);this.l.Ea(this.j.textTracks,"change",this.B);for(const b of this.h.values())b.remove();this.h.clear();this.g=-1;this.j=null};this.u=()=>{const b=new Map;var c=this.i.cc();for(var d of c){if(this.h.has(d.id))c=this.h.get(d.id),d.active||c.track.mode==="disabled"||(c.track.mode="disabled"),this.h.delete(d.id);else{var e=
c=this.j.ownerDocument.createElement("track");var f=tb();f=d.forced&&f.h()==="WEBKIT"?"forced":d.kind==="caption"?"captions":"subtitles";e.kind=f;e=c;f=void 0;if(d.label)f=d.label;else if(d.language)if(d.language in ko)f=ko[d.language];else{const g=fc(d.language);g in ko&&(f=`${ko[g]} (${d.language})`)}f||(f=d.originalTextId,d.language&&d.language!==d.originalTextId&&(f+=` (${d.language})`));e.label=f;d.language?d.language in ko?c.srclang=d.language:(e=fc(d.language),c.srclang=e??"und"):c.srclang=
"und";c.src="data:,WEBVTT";c.track.mode="disabled";this.j.appendChild(c)}b.set(d.id,c);d.active&&(this.g=d.id)}for(const g of this.h.values())g.remove();this.g>-1&&(b.has(this.g)?(d=b.get(this.g).track,d.mode==="disabled"&&(d.mode=this.A?"showing":"hidden")):this.g=-1);this.h=b};this.B=()=>{if(!this.m){var b=this.j;this.m=(new H(()=>{this.m=null;if(this.j===b){var c=-1,d=!1;if(this.h.has(this.g)){const e=this.h.get(this.g);e.track.mode==="showing"?(c=this.g,d=!0):e.track.mode==="hidden"&&(c=this.g)}if(!d)for(const [e,
f]of this.h)if(f.track.mode==="showing"){c=e;break}else c<0&&f.track.mode==="hidden"&&(c=e);for(const [e,f]of this.h)e!==c&&f.track.mode!=="disabled"&&(f.track.mode="disabled");this.g!==c&&(this.g=c,c>-1&&this.i.Ze({id:c}));this.i.rd(c>-1&&this.h.get(c).track.mode==="showing")}})).Z(0)}};this.l.o(a,"loaded",()=>this.enableTextDisplayer());this.enableTextDisplayer()}configure(){}remove(a,b){if(this.i)this.h.has(this.g)&&ro(this.h.get(this.g).track,c=>c.startTime<b&&c.endTime>a);else return!1;return!0}append(a){this.h.has(this.g)&&
qo(this.h.get(this.g).track,a)}destroy(){this.i&&(this.j&&this.C(),this.i=null);this.m?.stop();this.m=null;this.l?.release();this.l=null;return Promise.resolve()}isTextVisible(){return this.A}setTextVisibility(a){this.A=a;if(this.h.has(this.g)){var b=this.h.get(this.g).track;b.mode!=="disabled"&&(a=a?"showing":"hidden",b.mode!==a&&(b.mode=a))}else if(this.i&&this.i.bc()===3)if(b=Array.from(this.i.ue().textTracks).filter(c=>["captions","subtitles","forced"].includes(c.kind)),a){a=null;for(const c of b)if(c.mode===
"showing"){a=null;break}else a||c.mode!=="hidden"||(a=c);a&&(a.mode="showing")}else for(const c of b)c.mode==="showing"&&(c.mode="hidden")}setTextLanguage(){}enableTextDisplayer(){!this.j&&this.i&&this.i.bc()===2&&(this.j=this.i.ue(),this.l.sa(this.i,"unloading",this.C),this.l.o(this.i,"textchanged",this.u),this.l.o(this.j.textTracks,"change",this.B),this.u())}};x("shaka.text.NativeTextDisplayer",so);so.prototype.enableTextDisplayer=so.prototype.enableTextDisplayer;so.prototype.setTextLanguage=so.prototype.setTextLanguage;
so.prototype.setTextVisibility=so.prototype.setTextVisibility;so.prototype.isTextVisible=so.prototype.isTextVisible;so.prototype.destroy=so.prototype.destroy;so.prototype.append=so.prototype.append;so.prototype.remove=so.prototype.remove;so.prototype.configure=so.prototype.configure;function to(a){a.h&&!a.g&&(a.g=a.h.addTextTrack("subtitles",a.i),a.g.mode="hidden")}
var uo=class{constructor(a,b){Ic("SimpleTextDisplayer","Please migrate to NativeTextDisplayer");this.h=a;this.i=b;this.g=null;for(const c of Array.from(this.h.textTracks))c.kind!=="metadata"&&c.kind!=="chapters"&&(c.mode="disabled",c.label==this.i&&(this.g=c));this.g&&(this.g.mode="hidden")}configure(){}remove(a,b){if(!this.g)return!1;ro(this.g,c=>c.startTime<b&&c.endTime>a);return!0}append(a){this.g&&qo(this.g,a)}destroy(){this.g&&(ro(this.g,()=>!0),this.g.mode="disabled");this.g=this.h=null;return Promise.resolve()}isTextVisible(){return this.g?
this.g.mode=="showing":!1}setTextVisibility(a){a&&!this.g&&to(this);this.g&&(this.g.mode=a?"showing":"hidden")}setTextLanguage(){}enableTextDisplayer(){to(this)}};x("shaka.text.SimpleTextDisplayer",uo);uo.prototype.enableTextDisplayer=uo.prototype.enableTextDisplayer;uo.prototype.setTextLanguage=uo.prototype.setTextLanguage;uo.prototype.setTextVisibility=uo.prototype.setTextVisibility;uo.prototype.isTextVisible=uo.prototype.isTextVisible;uo.prototype.destroy=uo.prototype.destroy;
uo.prototype.append=uo.prototype.append;uo.prototype.remove=uo.prototype.remove;uo.prototype.configure=uo.prototype.configure;var vo=class{configure(){}remove(){}append(){}destroy(){}isTextVisible(){return!1}setTextVisibility(){}setTextLanguage(){}enableTextDisplayer(){}};x("shaka.text.StubTextDisplayer",vo);vo.prototype.enableTextDisplayer=vo.prototype.enableTextDisplayer;vo.prototype.setTextLanguage=vo.prototype.setTextLanguage;vo.prototype.setTextVisibility=vo.prototype.setTextVisibility;vo.prototype.isTextVisible=vo.prototype.isTextVisible;vo.prototype.destroy=vo.prototype.destroy;vo.prototype.append=vo.prototype.append;
vo.prototype.remove=vo.prototype.remove;vo.prototype.configure=vo.prototype.configure;function wo(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 xo(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 yo(a,b=!1){if(a.g){var c=a.m.currentTime;if(!a.j||b){for(const d of a.F.values())fj(d);fj(a.g);a.u.clear();a.F.clear()}a.j&&zo(a,a.h,a.g,c,[])}}function Ao(a){a.B&&(a.h.length?a.B.wa((a.C?a.C.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(a.m.playbackRate))):a.B.stop())}function Bo(a,b){for(;b!=null;){if(b==a.g)return!0;b=b.parentElement}return!1}
function Co(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=J(e);e!="br"&&Do(a,f,b,c,d);c=null;if(b.region&&b.region.id){{const n=b.region,p=a.A===4/3?2.5:1.9;e=`${n.id}_${n.width}x${n.height}${n.heightUnits==bd?"%":"px"}-${n.viewportAnchorX}x${n.viewportAnchorY}${n.viewportAnchorUnits==bd?"%":"px"}-${n.regionAnchorX}x${n.regionAnchorY}`;if(a.F.has(e))c=a.F.get(e);else{c=J("span");var g=n.heightUnits==bd?"%":"px",h=n.widthUnits==
bd?"%":"px",k=n.viewportAnchorUnits==bd?"%":"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.A===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.F.set(e,c)}}}e=f;d&&(e=J("span"),e.classList.add("shaka-text-wrapper"),e.style.backgroundColor=b.backgroundColor,e.style.lineHeight="normal",f.appendChild(e));a.u.set(b,{Af:f,di:e,Lc:c})}
function zo(a,b,c,d,e){let f=!1;const g=[],h=[];for(const k of b){e.push(k);b=a.u.get(k);const l=k.startTime<=d&&k.endTime>d;let m=b?b.di:null;b&&(g.push(b.Af),b.Lc&&g.push(b.Lc),l||(f=!0,a.u.delete(k),b=null));l&&(h.push(k),b?Bo(a,m)||(f=!0):(Co(a,k,e),b=a.u.get(k),m=b.di,f=!0));k.nestedCues.length>0&&m&&zo(a,k.nestedCues,m,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.u.get(k),d.Lc?(d.Lc.contains(c)&&d.Lc.removeChild(c),c.appendChild(d.Lc),d.Lc.appendChild(d.Af)):c.appendChild(d.Af)}}
function Do(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=xo(c.linePadding,c,a.l);f.paddingRight=xo(c.linePadding,c,a.l);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=J("span"),b.appendChild(l));c.border&&(l.style.border=c.border);e||((b=wo(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.C?a.C.fontScaleFactor:1;if(d!==1||c.fontSize)f.fontSize=xo(c.fontSize||"1em",c,a.l,d);d=c.line;d!=null&&(g=c.lineInterpretation,g==re&&(g=1,h=16,a.A&&a.A<1&&(h=32),d=d<0?100+d/h*100:d/h*100),g==1&&(f.position="absolute",c.writingMode==qe?(f.width="100%",c.lineAlign==se?f.top=d+"%":c.lineAlign=="end"&&(f.bottom=100-d+"%")):c.writingMode=="vertical-lr"?(f.height="100%",c.lineAlign==se?f.left=d+"%":c.lineAlign=="end"&&(f.right=100-d+"%")):(f.height="100%",c.lineAlign==se?f.right=d+"%":c.lineAlign==
"end"&&(f.left=100-d+"%"))));f.lineHeight=c.lineHeight;a=Eo(c);a=="line-left"?(f.cssFloat="left",c.position!==null&&(f.position="absolute",c.writingMode==qe?(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==qe?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):c.position!==null&&c.position!=50&&(f.position="absolute",c.writingMode==qe?(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==qe?f.width=c.size+"%":f.height=c.size+"%")}
function Eo(a){const b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==oe?c:a==="left"||a==="start"&&b===pe||a==="end"&&b==="rtl"?"line-left":a==="right"||a==="start"&&b==="rtl"||a==="end"&&b===pe?"line-right":"center"}
var Fo=class{constructor(a,b){this.j=!1;this.h=[];this.m=a;this.l=b;this.C=this.A=null;this.g=J("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 H(()=>{this.m.paused||yo(this)});Ao(this);this.u=new Map;this.i=new zc;this.i.o(document,"fullscreenchange",()=>{yo(this,!0)});this.i.o(this.m,"seeking",()=>{yo(this,!0)});this.i.o(this.m,
"ratechange",()=>{Ao(this)});this.i.o(this.m,"resize",()=>{var c=this.m;const d=c.videoWidth;c=c.videoHeight;d&&c?this.A=d/c:this.A=null});this.G=!1;this.D=null;"ResizeObserver"in window&&(this.D=new ResizeObserver(()=>{this.G||(this.G=!0,requestAnimationFrame(()=>{this.G=!1;this.g&&this.g.parentElement&&this.j&&yo(this,!0)}))}),this.D.observe(this.l));this.F=new Map}configure(a){this.C=a;Ao(this);yo(this,!0)}append(a){const b=[...this.h];for(const c of oo(a))b.some(d=>be(d,c))||this.h.push(c);this.h.length&&
Ao(this);yo(this)}destroy(){if(!this.g)return Promise.resolve();this.g.parentElement&&this.l.removeChild(this.g);this.g=null;this.j=!1;this.h=[];this.B&&(this.B.stop(),this.B=null);this.u.clear();this.i&&(this.i.release(),this.i=null);this.D&&(this.D.disconnect(),this.D=null);return Promise.resolve()}remove(a,b){if(!this.g)return!1;const c=this.h.length;this.h=this.h.filter(d=>d.startTime<a||d.endTime>=b);yo(this,c>this.h.length);this.h.length||Ao(this);return!0}isTextVisible(){return this.j}setTextVisibility(a){(this.j=
a)?(this.g.parentElement||this.l.appendChild(this.g),yo(this,!0)):this.g.parentElement&&this.l.removeChild(this.g)}setTextLanguage(a){a&&a!="und"?this.g.setAttribute("lang",a):this.g.setAttribute("lang","")}enableTextDisplayer(){}};x("shaka.text.UITextDisplayer",Fo);Fo.prototype.enableTextDisplayer=Fo.prototype.enableTextDisplayer;Fo.prototype.setTextLanguage=Fo.prototype.setTextLanguage;Fo.prototype.setTextVisibility=Fo.prototype.setTextVisibility;Fo.prototype.isTextVisible=Fo.prototype.isTextVisible;
Fo.prototype.remove=Fo.prototype.remove;Fo.prototype.destroy=Fo.prototype.destroy;Fo.prototype.append=Fo.prototype.append;Fo.prototype.configure=Fo.prototype.configure;function Go(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=no(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 je: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}x("shaka.text.WebVttGenerator",class{});function Ho(a,b){if(!b||a.includes("offline:"))return a;a=new Ha(a);a.g.set("CMCD",b);return a.toString()}function Io(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=Jo(e[a]))&&(c[`CMCD-${d[a]}`]=b);return c}
function Jo(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 Ko(a){a.i.o(a.h,"playing",()=>{a.C||(a.C=Date.now());Lo(a,"ps",{Oc:"p"})});a.i.o(a.h,"volumechange",()=>{Lo(a,a.h.muted?"m":"um")});a.i.o(a.h,"play",()=>{a.B||(a.B=Date.now(),Lo(a,"ps",{Oc:"s"}))});a.i.o(a.h,"pause",()=>{Lo(a,"ps",{Oc:"a"})});a.i.o(a.j,"buffering",()=>{Lo(a,"ps",{Oc:"w"})});a.i.o(a.h,"seeking",()=>Lo(a,"ps",{Oc:"k"}));a.i.o(document,"fullscreenchange",()=>{Lo(a,document.fullscreenElement?"pe":"pc")});const b=a.h;(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.i.o(b,
"webkitpresentationmodechanged",()=>{b.webkitPresentationMode?Lo(a,b.webkitPresentationMode!=="inline"?"pe":"pc"):b.webkitSupportsFullscreen&&Lo(a,b.webkitDisplayingFullscreen?"pe":"pc")});a.i.o(a.h,"enterpictureinpicture",()=>{Lo(a,"pe")});a.i.o(a.h,"leavepictureinpicture",()=>{Lo(a,"pc")});"documentPictureInPicture"in window&&a.i.o(window.documentPictureInPicture,"enter",c=>{Lo(a,"pe");a.i.sa(c.window,"pagehide",()=>{Lo(a,"pc")})});a.i.o(document,"visibilitychange",()=>{document.hidden?Lo(a,"b",
{bg:!0}):Lo(a,"b")});a.i.o(a.j,"complete",()=>{Lo(a,"ps",{Oc:"e"})})}function Mo(a){No(a);var b=Oo(a);for(const c of b)if(b=c.timeInterval,b===void 0&&(b=Po),b>=1){const d=new H(()=>Lo(a,Qo));d.wa(b);a.F.push(d)}}function No(a){if(a.F)for(const b of a.F)b.stop();a.F=[]}function Ro(a){a.m.clear();a.D=!1;a.I=!0;a.H=!1;a.A=!1;a.B=0;a.C=0;a.G=0;a.J={request:!1,response:!1,event:!1};No(a);a.u={};a.h=null;a.i.Na()}
function Lo(a,b,c={}){b=Object.assign({e:b,ts:Date.now()},c);b=So(a,b,To);c=a.g.targets;if(!(a.g.version<Uo)&&c){var d=Oo(a);c=Array.from(new Set([...Vo,...Wo]));for(const e of d){d=Xo(e.includeKeys||[],c);d.includes(Yo)||d.push(Yo);const f=Zo(b,d);d=e.events||[];const g=f.e,h=f.sta;g&&(!$o.includes(g)||!(g!=="ps"||h&&ap.includes(h))||d&&d.length>0&&!d.includes(g))||bp(a,f,e)}}}function cp(a,b){a.A=b;a.A?a.l==dp?a.l=ep:a.l==fp&&(a.l=gp):a.l==ep?a.l=dp:a.l==gp&&(a.l=fp)}
function hp(a,b){if(a.g&&a.g.enabled&&(Lo(a,"ps",{Oc:"d"}),a.h&&a.h.autoplay)){const c=a.h.play();c&&c.then(()=>{a.G=b}).catch(()=>{a.G=0})}}function ip(a,b,c){if(a.g.enabled){c=So(a,c,jp);var d=kp({mode:jp,useHeaders:a.g.useHeaders,includeKeys:a.g.includeKeys||[]});a.u[d]||(a.u[d]={request:1,response:1});c.sn=a.u[d].request++;d=a.g.includeKeys||[];var e=a.g.version==Uo?Array.from(new Set([...Vo,...lp])):mp;d=Xo(d,e);c=Zo(c,d);np(a,c,b,a.g.useHeaders)}}
function op(a,b,c,d={}){if(a.g.enabled)if(c.method==="HEAD")ip(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?ep:dp;break a;case 3:case 2:e=a.A?gp:fp;break a;case 5:e=pp;break a}e=void 0}a.l=e}ip(a,c,{ot:qp,su:!a.D})}}catch(g){ta("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",g)}break;case zg:try{if(a.g.enabled){var f=rp(a,d,c.uris[0]);f.ts=Date.now();a.m.has(c)&&a.m.delete(c);a.m.set(c,f.ts);ip(a,c,f)}}catch(g){ta("CMCD_SEGMENT_ERROR",
"Could not generate segment CMCD data.",g)}break;case 2:case 5:case 6:ip(a,c,{ot:sp});break;case 4:ip(a,c,{ot:tp})}}function up(a){return(a=a.g.targets)?a.filter(b=>b.mode===vp&&b.enabled===!0):[]}
function wp(a,b,c,d={}){if(up(a).length!==0)switch(b){case zg:try{const k=rp(a,d,c.uri);c.originalRequest&&c.originalRequest.timeToFirstByte!=null&&(k.ttfb=c.originalRequest.timeToFirstByte);c.timeMs!=null&&(k.ttlb=c.timeMs);var e=c.originalUri||c.uri;if(e.includes("CMCD="))try{const m=new URL(e);m.searchParams.delete("CMCD");var f=m.toString()}catch(m){f=e}else f=e;k.url=f;a.m.has(c.originalRequest)?(k.ts=a.m.get(c.originalRequest),a.m.delete(c.originalRequest)):k.ts||(k.ts=Date.now());const l=up(a);
if(l.length!==0){var g=a.g.version==Uo?Array.from(new Set([...Vo,...xp])):mp;k.rc=c.status||0;var h=So(a,k,vp);c.headers&&c.headers["CMSD-Static"]&&(h.cmsds=btoa(c.headers["CMSD-Static"]));c.headers&&c.headers["CMSD-Dynamic"]&&(h.cmsdd=btoa(c.headers["CMSD-Dynamic"]));for(const m of l){const n=Xo(m.includeKeys||[],g),p=kp(m);a.u[p]||(a.u[p]={request:1,response:1});h.sn=a.u[p].response++;const r=Zo(h,n);bp(a,r,m,c)}}}catch(k){ta("CMCD_SEGMENT_ERROR","Could not generate response segment CMCD data.",
k)}}}
function rp(a,b,c){var d=b.segment,e=0;d&&(e=d.endTime-d.startTime);e={d:e*1E3,st:a.j.U()?yp:zp};e.ot=Ap(b);const f=e.ot===Bp||e.ot===Cp||e.ot===Dp||e.ot===Ep;if(b=b.stream){var g=a.j.Pa();if(f&&(e.bl=Fp(a,b.type),e.ot!==Ep)){var h=Gp(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.Ob(d.endTime,!0,g<0))&&(g=g.next().value)&&g!=d){if(c&&!xc(d.S(),g.S())){var k=g.S()[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.Pa()||1;c=Gp(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!==Ep&&(e.tb=Hp(a,e.ot)/1E3);return e}
function Ip(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 Jp(a,b,c){try{if(!a.g.enabled)return b;const e=Ip(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=Cp;break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":d=Dp;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=qp;break a}d=
void 0}e.ot=d;e.su=!0;const f=Jo(e);return Ho(b,f)}catch(e){return ta("CMCD_SRC_ERROR","Could not generate src CMCD data.",e),b}}function Oo(a){return(a=a.g.targets)?a.filter(b=>b.mode===To&&b.enabled):[]}function So(a,b,c){Object.assign(b,Ip(a));b.pr=a.j.Pa();var d=b.ot===Bp||b.ot===Dp;a.H&&d&&(b.bs=!0,b.su=!0,a.H=!1);b.su==null&&(b.su=a.I);a.j.U()&&(d=Kp(a.j),b.ltc=d||void 0);document.hidden&&(b.bg=!0);d=a.C&&a.B?a.C-(a.G||a.B):void 0;d==void 0||a.J[c]||(b.msd=d,a.J[c]=!0);return b}
function Xo(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 Zo(a,b){return Object.keys(a).reduce((c,d)=>{b.includes(d)&&(c[d]=a[d]);return c},{})}function bp(a,b,c,d){const e=cg();var f=c.url;if(c.useHeaders){b=Io(b);if(!Object.keys(b).length)return;d&&Object.assign(d.headers,b);d=tg([f],e);Object.assign(d.headers,b)}else{b=Jo(b);if(!b)return;f=Ho(f,b);d&&(d.uri=f);d=tg([f],e)}a.j.Eb().request(9,d)}
function kp(a){const b=Object.keys(a).sort().reduce((c,d)=>{d!=="enabled"&&(c[d]=a[d]);return c},{});return JSON.stringify(b)}function np(a,b,c,d){if(d){b=Io(b);if(!Object.keys(b).length)return;Object.assign(c.headers,b)}else{const e=Jo(b);if(!e)return;c.uris=c.uris.map(f=>Ho(f,e))}up(a).length>0||!a.m.has(c)||a.m.delete(c)}
function Ap(a){if(a.type===0)return Lp;if(a=a.stream){var b=a.type;if(b=="video")return a.codecs&&a.codecs.includes(",")?Dp:Bp;if(b=="audio")return Cp;if(b=="text")return a.mimeType==="application/mp4"?Ep:Mp}}function Fp(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 Gp(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 Hp(a,b){a=a.j.zb();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 Bp:return c.videoBandwidth||NaN;case Cp:return c.audioBandwidth||NaN;default:return c.bandwidth}}
var Np=class{constructor(a,b){this.g=b;this.j=a;this.m=new Map;this.l=void 0;this.D=!1;this.I=!0;this.A=this.H=!1;this.C=this.B=void 0;this.G=0;this.J={request:!1,response:!1,event:!1};this.u={};this.i=new zc;this.F=[];this.h=null}setMediaElement(a){this.h=a;Ko(this)}configure(a){this.g=a;Mo(this)}},qp="m",Cp="a",Bp="v",Dp="av",Lp="i",Mp="c",Ep="tt",sp="k",tp="o",Uo=2,zp="v",yp="l",dp="d",ep="ld",fp="h",gp="lh",pp="s";x("shaka.util.CmcdManager.StreamingFormat",{DASH:dp,Rk:ep,HLS:fp,Sk:gp,jl:pp,OTHER:"o"});
var mp="br bl bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v".split(" "),Vo="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(" "),lp="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(" "),xp="d dl nor ot rtp rc su ttfb ttfbb ttlb url cmsdd cmsds".split(" "),Wo=["e","sta"],$o="ps e t c b m um pe pc".split(" "),ap="spawkrfeqd".split(""),Po=10,Yo="ts",Qo="t",jp="request",vp="response",To="event";function Op(a){return a?a.toLowerCase()==="false"?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}
var Tp=class{constructor(a){this.h=a;this.g=null}configure(a){this.h=a}mh(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(Pp)?this.g.get(Pp)*1E3:null}kh(){return this.h.enabled&&this.g&&this.g.has(Qp)?this.g.get(Qp)*1E3:null}Yi(){return this.h.enabled&&this.g&&this.g.has(Rp)?this.g.get(Rp):null}Zi(){return this.h.enabled&&this.g&&this.g.has(Sp)?this.g.get(Sp):null}getBandwidthEstimate(a){const b=this.kh();if(!b)return a;const c=this.h.estimatedThroughputWeightRatio;
return c>0&&c<=1?a*(1-c)+b*c:a}};x("shaka.util.CmsdManager",Tp);Tp.prototype.getBandwidthEstimate=Tp.prototype.getBandwidthEstimate;Tp.prototype.getRoundTripTime=Tp.prototype.Zi;Tp.prototype.getResponseDelay=Tp.prototype.Yi;Tp.prototype.getEstimatedThroughput=Tp.prototype.kh;Tp.prototype.getMaxBitrate=Tp.prototype.mh;var Qp="etp",Pp="mb",Rp="rd",Sp="rtt";async function Up(a,b){a.g&&await new Promise(c=>a.h.push(c));a.g=b}var Vp=class{constructor(){this.g=null;this.h=[]}release(){this.h.length>0?this.h.shift()():this.g=null}};function Wp(a,b){return new C(a,b)}function Xp(a,b){Yp.set(a,b)}function Zp(){window.Promise||sa("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return!1;tb();return Qc()?!0:Rc("application/x-mpegurl")}function $p(a,b,c){b>0&&(a.U()||a.Sh(b));b=a.getDuration();c<b&&(a.U()||a.qb(c))}
function aq(a){const b=new Map,c=new Map;for(let e=0;e<a.length;e++){const f=a[e];let g="und",h=[];f.language&&(g=$b(f.language));f.type=="variant"?h=f.audioRoles:h=f.roles;h&&h.length||(h=[""]);b.has(g)||b.set(g,new Set);for(const k of h)b.get(g).add(k),f.label&&(c.has(g)||c.set(g,new Map),c.get(g).set(k,f.label))}const d=[];b.forEach((e,f)=>{for(const g of e)e=null,c.has(f)&&c.get(f).has(g)&&(e=c.get(f).get(g)),d.push({language:f,role:g,label:e})});return d}
function bq(a){const b=new Set;for(const c of a)c.language?b.add($b(c.language)):b.add("und");return b}function Kp(a){if(!a.h||!a.h.currentTime)return null;const b=a.oh();return b?Math.floor(Date.now()-(b.getTime()+a.h.currentTime*1E3)):null}
function cq(a){const b=pn();b.streaming.failureCallback=c=>{if(a.U()){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.Ag(d))}};b.textDisplayFactory=()=>{if(a.Vd){var c=a.h;c=c.webkitDisplayingFullscreen||c.webkitPresentationMode&&c.webkitPresentationMode!="inline"?!1:!0}else c=!1;return c?new Fo(a.h,a.Vd):"track"in document.createElement("track")?new so(a):new vo};return b}
function dq(a,b){b||=()=>null;const c=f=>{b()?Mn(b(),!0,f):f()},d=f=>{b()?b().dispatchEvent(f):a.dispatchEvent(f)},e=new Cg((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(Wp("downloadheadersreceived",g));c(()=>{if(a.ea){var k=a.ea;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 r=p[l].split("=");m.set(r[0],Op(r[1]))}}catch(p){}if(m=f["cmsd-dynamic"]){a:{try{const p=
new Map,r=m.split(";");for(m=1;m<r.length;m++){const q=r[m].split("=");p.set(q[0],Op(q[1]))}var n=p;break a}catch(p){n=null;break a}n=void 0}n&&(k.g=n)}}}})},(f,g)=>{f=(new Map).set("request",f).set("response",g);d(Wp("downloadcompleted",f))},(f,g,h,k)=>{f=(new Map).set("request",f).set("error",g).set("httpResponseCode",h).set("aborted",k);d(Wp("downloadfailed",f))},(f,g,h)=>{c(()=>{a.J&&op(a.J,f,g,h)})},(f,g,h,k)=>{(f=b()?b().m:a.H)&&f.banLocation&&f.banLocation(k)},(f,g,h)=>{if(g.data){const k=
g.data.byteLength,l=b()?b().getStats():a.B;l&&(In(l,k),f===0&&(l.wh=k));wp(a.J,f,g,h)}});e.configure(a.g.networking);return e}function eq(a,b=!0){if(a.m==fq){a.be.stop();for(const c of a.i.variants)c.disabledUntilTime=0;b&&gq(a)}}function hq(a){a.P!=null&&(Lc(a.P),a.P.release(),a.P=null)}function iq(a,b,c){c||b.lcevc.enabled?(hq(a),a.P==null&&(a.P=new Mc(a.h,a.Tg,b.lcevc,c),a.G&&(a.G.M=a.P))):hq(a)}function jq(a,b){a.dispatchEvent(Wp("onstatechange",(new Map).set("state",b)))}
async function kq(a,b){const c=++a.ie;await Up(a.W,b);return c!=a.ie?(a.W.release(),!0):!1}
async function lq(a){tb();jq(a,"media-source");a.g.mediaSource.useSourceElements&&dj(a.h);mq(a);const b=nq(a.h,a.A,{Ni:()=>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)oq(a,c,g,"org.id3",h);if(a.C)a.C.onHlsTimedMetadata(f,c)}},Fj:c=>{a.Va&&El(a.Va,{schemeIdUri:c.schemeIdUri,startTime:c.startTime,endTime:c.endTime,id:String(c.id),emsg:c})},onEvent:c=>a.dispatchEvent(c),Hj:()=>{a.H&&a.H.update&&
a.H.update()}},a.P,a.g.mediaSource);b.za=a.g.manifest.segmentRelativeVttTiming;await b.J;a.G=b}
function pq(a){var b=a.Be();if(a.B&&a.O&&a.F){if(a.g.streaming.rebufferingGoal==0){var c=a.K;c.j=!1;tl(c)}else c=a.K,c.j=b,tl(c);a.J&&(c=a.J,b||c.D||(c.D=!0),c.D&&b&&(c.H=!0,Lo(c,"ps",{Oc:"r"})),c.I=b);qq(a);c=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.g.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.je<c){c=a.g.streaming.liveSync.dynamicTargetLatency.maxLatency;const d=a.g.streaming.liveSync.targetLatencyTolerance,e=a.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;
a.R&&(a.R=Math.min(a.R+ ++a.je*e,c-d))}}b=(new Map).set("buffering",b);a.dispatchEvent(Wp("buffering",b))}async function rq(a,b){a=await Xl(b,a.L,a.g.manifest.retryParameters);Te(a)?tb().h()==="WEBKIT"&&(a="application/vnd.apple.mpegurl"):a==="video/quicktime"&&tb().h()==="CHROMIUM"&&(a="video/mp4");return a}
async function sq(a,b,c,d,e=!1,f){d||=await rq(a,b);if(tq(a,d))return null;f=f||a.g;let g=!1;e&&a.h&&a.h.nodeName==="AUDIO"&&(g=!0);b=uq(a,b,c,d||null,f,!e,g);return b=e?b.then(h=>{h.D=!1;return h}):b.then(h=>{a.ce.push(h);return h})}function vq(a,b,c){b=(new Map).set("startTime",b.startTime).set("endTime",b.endTime).set("metadataType",b.schemeIdUri).set("payload",b.payload);a.dispatchEvent(Wp(c,b))}
async function wq(a,b){const c=Date.now()/1E3;let d=!0;a.D=a.Vc({hc:a.L,onError:e=>{xq(a,e)},Re:()=>{},onExpirationUpdated:()=>{const e=Wp("expirationupdated");a.dispatchEvent(e)},onEvent:e=>{a.dispatchEvent(e);if(e.type=="drmsessionupdate"&&d){d=!1;e=a.B;var f=Date.now()/1E3-c;f>=0&&(e.m=f)}}});a.D.configure(a.g.drm);b=Wf([b]);a.D.M=!0;await jh(a.D,[b],[]);await a.D.Db(a.h)}
async function yq(a,b,c){jq(a,"src-equals");const d=a.h;a.F=new hl(d);let e=!1;a.Xd.push(()=>{e=!0});a.dispatchEvent(Wp("canupdatestarttime"));a.M!=null&&a.F.A(a.M);a.Ab=zq(a,a.M||0);Aq(a,d);Bq(a,d,!0);if(d.textTracks){mq(a);const h=k=>{if(!(a.A instanceof so)){var l=Cq(a).find(m=>m.mode!=="disabled");l&&(l.mode=k?"showing":"hidden");a.A instanceof uo&&(l=Dq(a))&&(l.mode=!k&&a.A.isTextVisible()?"showing":"hidden")}};a.j.o(d,"enterpictureinpicture",()=>h(!0));a.j.o(d,"leavepictureinpicture",()=>h(!1));
d.remote?(a.j.o(d.remote,"connect",()=>h(!1)),a.j.o(d.remote,"connecting",()=>h(!1)),a.j.o(d.remote,"disconnect",()=>h(!1))):"webkitCurrentPlaybackTargetIsWireless"in d&&a.j.o(d,"webkitcurrentplaybacktargetiswirelesschanged",()=>h(!1));(d.webkitPresentationMode||d.webkitSupportsFullscreen)&&a.j.o(d,"webkitpresentationmodechanged",()=>{d.webkitPresentationMode?h(d.webkitPresentationMode!=="inline"):d.webkitSupportsFullscreen&&h(d.webkitDisplayingFullscreen)})}Eq(a,d,b);b=Jp(a.J,a.T,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);dj(d);d.src=b;b=tb();b.i()=="TV"&&d.load();d.preload!="none"&&!d.autoplay&&Te(c)&&b.h()==="WEBKIT"&&d.load();a.m=Fq;a.dispatchEvent(Wp("streaming"));const f=()=>new Promise(h=>{const k=new H(h);a.j.o(d.textTracks,"change",()=>k.Z(.5));k.Z(.5)}),g=new gg;Xk(d,HTMLMediaElement.HAVE_METADATA,a.j,async()=>
{a.F.ready();a.za&&Te(a.za)&&await f();g.resolve()});Xk(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.j,async()=>{await f();if(!e){Gq(a);var h=Cq(a);h.some(k=>k.mode==="showing")&&(a.V=!0,a.A.setTextVisibility(!0));if(!(a.A instanceof so)){h.length&&(a.A.enableTextDisplayer?a.A.enableTextDisplayer():Ic("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method'));let k=!1;for(const l of h)l.mode!=="disabled"&&(k?(l.mode="disabled",sa("Found more than one enabled text track, disabling it",
l)):(Hq(a,l),k=!0))}Iq(a)}});d.error?g.reject(Jq(a)):d.preload=="none"&&(sa('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.j.sa(d,"error",()=>{g.reject(Jq(a))});await mf(a.g.streaming.loadTimeout,g);((c=a.U())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.g.streaming.liveSync.panicMode)||
a.g.streaming.vodDynamicPlaybackRate)&&a.j.o(d,"timeupdate",()=>Kq(a));c||(a.j.o(d,"timeupdate",()=>Lq(a)),Lq(a));if(a.C&&(a.C.onManifestUpdated(c),c)){let h=a.va().end;a.j.o(d,"progress",()=>{const k=a.va().end;h!=k&&(a.C.onManifestUpdated(a.U()),h=k)})}a.Ha=!0}function Mq(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 Nq(a,b,c,d){jq(a,"load");const e=a.h;Aq(a,e);Eq(a,e,b);"onchange"in window.screen&&a.j.o(window.screen,"change",()=>{if(a.I.getConfiguration){const m=a.I.getConfiguration();m.hdrLevel=="AUTO"?gq(a):a.g.preferredVideoHdrLevel=="AUTO"&&a.g.abr.enabled&&(m.hdrLevel="AUTO",a.I.configure(m),gq(a))}});var f=!1;for(var g of a.i.variants){var h=g.video&&g.video.dependencyStream;h&&(f=Kc(h))}iq(a,a.g,f);a.nd=a.g.preferredTextLanguage;a.vd=a.g.preferredTextRole;a.Yd=a.g.preferForcedSubs;$p(a.i.presentationTimeline,
a.g.playRangeStart,a.g.playRangeEnd);a.u.init((m,n,p)=>Oq(a,m,n,p));a.u.setMediaElement(e);a.u.setCmsdManager(a.ea);a.l=Pq(a);a.l.configure(a.g.streaming);a.m=fq;a.dispatchEvent(Wp("streaming"));f=c;do{g=a.l.u;g||(h=Qq(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);gq(a);if(a.H&&a.H.onInitialVariantChosen)a.H.onInitialVariantChosen(h);
a.i.isLowLatency&&(a.g.streaming.lowLatencyMode?a.configure(a.mf):sa("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&&(cp(a.J,a.i.isLowLatency&&a.g.streaming.lowLatencyMode),hp(a.J,b*1E3));$p(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);hm(a.l,a.g.playRangeStart,a.g.playRangeEnd);a.Ha=!0;a.dispatchEvent(Wp("canupdatestarttime"));
b=m=>{a.F=Rq(a,m);a.Ab=Sq(a,m);Bq(a,e,!1)};a.g.streaming.startAtSegmentBoundary||(c=a.M,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.M instanceof Date&&(k=a.M.getTime()/1E3-(c.m||c.i),k!=null&&(l=k));l==null&&(l=typeof a.M==="number"?a.M:a.U()?Infinity:a.h.currentTime);a.M==null&&a.i.startTime&&(l=a.i.startTime);k=c.Qb();c=c.xb();l<k?l=k:l>c&&(l=c);l=await Tq(f,l);b(l)}Uq(a,f,!0,!1,0)}a.F.ready();a.cc().find(m=>
m.active)||((l=Rf(a.i.textStreams,a.nd,a.vd,a.Yd)[0]||null)&&zn(a.B.h,l,!0),f&&Vq(a,f,l),l&&(a.g.streaming.alwaysStreamText||a.zc())&&(wm(a.l,l),Wq(a)));await a.l.start(d);a.g.abr.enabled&&(a.u.enable(),Xq(a));Yq(a);a.i.variants.some(m=>m.primary);((d=a.U())&&(a.g.streaming.liveSync&&a.g.streaming.liveSync.enabled||a.i.serviceDescription||a.g.streaming.liveSync.panicMode)||a.g.streaming.vodDynamicPlaybackRate)&&a.j.o(e,"timeupdate",()=>Kq(a));if(!d&&(a.j.o(e,"timeupdate",()=>Lq(a)),Lq(a),a.i.nextUrl)){if(a.g.streaming.preloadNextUrlWindow>
0){const m=async()=>{const n=a.va().end-a.h.currentTime;!isNaN(n)&&n<=a.g.streaming.preloadNextUrlWindow&&(a.j.Ea(e,"timeupdate",m),a.Oa=await a.preload(a.i.nextUrl))};a.j.o(e,"timeupdate",m)}a.j.o(e,"ended",()=>{a.load(a.Oa||a.i.nextUrl)})}if(a.C)a.C.onManifestUpdated(d)}
async function Zq(a,b=!1){var c=null;if(a.i&&a.H&&a.lc&&a.T&&a.g){c=a.h.currentTime;b||(c=null);c=await uq(a,a.T,c,a.za,a.g,!0,!1);a.ce.push(c);a.H&&a.H.setMediaElement&&a.H.setMediaElement(null);if(b=a.l?a.l.u:null)c.i=b;b=c;var d=a.H,e=a.lc;b.h=a.i;b.m=d;b.G=e;c.C=a.I;c.start();a.i=null;a.H=null;a.lc=null;a.u=null;a.ae=null}return c}
async function uq(a,b,c,d,e,f=!0,g=!1){let h=null;e=nd(e);g&&(e.manifest.disableVideo=!0);const k=()=>h.O&&h.l?null:h;a.ma.width!=Infinity||a.ma.height!=Infinity||a.g.ignoreHardwareResolution||(g=await tb().A(),a.ma.width=g.width,a.ma.height=g.height);const l=new Th(e,a.ma,null);g={networkingEngine:a.L,filter:async t=>{await Rh(l,t)&&(t=Wp("trackschanged"),await Promise.resolve(),h.dispatchEvent(t))},makeTextStreamsForClosedCaptions:t=>$q(a,t),onTimelineRegionAdded:t=>{El(h.H,t)},onEvent:t=>h.dispatchEvent(t),
onError:t=>h.onError(t),isLowLatencyMode:()=>(k()?k().getConfiguration():a.g).streaming.lowLatencyMode,updateDuration:()=>{a.l&&h.O&&a.l.updateDuration()},newDrmInfo:t=>{const u=h.j,v=u?u.g:null;v&&u.B&&Ph(l,v.keySystem,t)},onManifestUpdated:()=>{const t=(new Map).set("isLive",a.U());h.dispatchEvent(Wp("manifestupdated",t));Mn(h,!1,()=>{if(a.C)a.C.onManifestUpdated(a.U())})},getBandwidthEstimate:()=>a.u.getBandwidthEstimate(),onMetadata:(t,u,v,y)=>{let w=t;if(t=="com.apple.hls.interstitial"||t=="com.apple.hls.overlay")if(w=
"com.apple.quicktime.HLS",t={startTime:u,endTime:v,values:y},a.C)a.C.onHLSInterstitialMetadata(a,a.h,t);for(const z of y)z.name!="ID"&&Mn(h,!1,()=>{oq(a,u,v,w,z)})},disableStream:t=>a.disableStream(t,a.g.streaming.maxDisabledTime),addFont:(t,u)=>a.addFont(t,u)};const m=new Fl(()=>a.va());m.addEventListener("regionadd",t=>{const u=t.region;ar(a,"timelineregionadded",u,h);Mn(h,!1,()=>{a.C&&(a.C.onDashTimedMetadata(u),a.C.onDASHInterstitialMetadata(a,a.h,u))})});let n=null;e.streaming.observeQualityChanges&&
(n=new Cl(()=>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 r={hc:a.L,onError:t=>h.onError(t),Re:t=>{Mn(h,!0,()=>{a.D&&cr(a,t)})},onExpirationUpdated:(t,u)=>{var v=Wp("expirationupdated");h.dispatchEvent(v);if((v=h.m)&&v.onExpirationUpdated)v.onExpirationUpdated(t,u)},onEvent:t=>{h.dispatchEvent(t);if(t.type=="drmsessionupdate"&&p){p=!1;const u=Date.now()/1E3-h.na;t=a.B||h.getStats();
u>=0&&(t.m=u);a.P&&Lc(a.P)}}},q=dq(a,k);ug(a.L,q);return h=new eo(b,d,c,{config:e,zj:g,Lj:m,Kj:n,Vc:()=>a.Vc(r),yj:l,networkingEngine:q,ii:f})}
async function xq(a,b){if(a.m!=dr){b.severity===1&&a.B.K++;var c=!0;if(a.Ha&&a.i&&a.l&&(b.code==3016||b.code==3014||b.code==3015||b.code==3024||b.code==3018)){if(tb().h()==="WEBKIT"&&b.code==3016)return;try{const d=await Fm(a.l);c=!d;if(d){const e=Wp("mediasourcerecovered");a.dispatchEvent(e)}}catch(d){c=!0}}c&&(b.severity===2&&eq(a,!1),c=Wp("error",(new Map).set("detail",b)),a.dispatchEvent(c),c.defaultPrevented&&(b.handled=!0))}}
function tq(a,b){if(!Qc(tb()))return!0;if(b){if((a.h||gj()).canPlayType(b)=="")return!1;if(!Qc(tb())||!Oc.has(b))return!0;if(Te(b))return tb().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 $q(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 sl,k=d.closedCaptions.get(g);e={id:a.$d++,originalId:g,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:h,mimeType:e,codecs:"",kind:"caption",
encrypted:!1,drmInfos:[],keyIds:new Set,language:k,originalLanguage:k,label:null,type:F,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([Ie(e,"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};b.textStreams.push(e);c.add(g)}}
function oq(a,b,c,d,e){a.oa&&(b={schemeIdUri:d,startTime:b,endTime:c||Infinity,id:"",payload:e},b.id=JSON.stringify(b),El(a.oa,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,eventElement:c.eventElement,eventNode:c.eventNode});d.dispatchEvent(Wp(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(Wp(d?"audiotrackchanged":"mediaqualitychanged",b))}
function cr(a,b){if(a.l){var c=Wp("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=Fg(a.g.drm.clearKeys),k=(l,m)=>{l.allowedByKeySystem=!0;for(const n of m)if((m=b[e?"00":n])||a.D.G)l.allowedByKeySystem=l.allowedByKeySystem&&!!m&&!Sh.includes(m)};for(var f of a.i.variants){var g=Tf(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&&(Yq(a),(f=a.l.u)&&!f.allowedByKeySystem?er(a):gq(a))}}
function mq(a,b=!1){const c=a.g.textDisplayFactory;a.Sg!==c||b?(b=a.A,a.A=c(),a.A.configure?a.A.configure(a.g.textDisplayer):Ic("Text displayer w/ configure",'Text displayer should have a "configure" method!'),a.A.setTextLanguage||Ic("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!'),b?(a.A.setTextVisibility(b.isTextVisible()),b.destroy().catch(()=>{})):a.A.setTextVisibility(a.V),a.G&&Jk(a.G,a.A),a.Sg=c,a.l&&xm(a.l)):a.A&&a.A.configure&&a.A.configure(a.g.textDisplayer)}
function nq(a,b,c,d,e){return new Nk(a,b,c,e,d)}function Aq(a,b){a.K=new ul({ag:()=>b.playbackRate,Yc:()=>b.defaultPlaybackRate,Qh:c=>{b.playbackRate=c},Dj:c=>{const d=b.currentTime;if(Xi(b.buffered,d)&&!(b.readyState<=HTMLMediaElement.HAVE_CURRENT_DATA)){c=d+c;var e=a.va();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 qq(a){if(a.B&&a.O){var b=a.B.g,c="playing";a.O.g==Lh?c="buffering":a.isEnded()?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(Wp("statechanged",c)))}}
function fr(a){var b=a.h.playbackRate;b==0?(b=a.Pa(),b!==0&&b!==1&&(b=Wp("ratechange"),a.dispatchEvent(b))):(a.K&&(a.K.set(b),a.m==fq&&a.u.playbackRateChanged(b),gr(a,b)),b=Wp("ratechange"),a.dispatchEvent(b))}function hr(a){const b=Wp("textchanged");ir(a,b)}function Yq(a){const b=Wp("trackschanged");ir(a,b);jr(a)}
function kr(a,b){if(b.kind=="metadata"){b.mode="hidden";a.j.o(b,"cuechange",()=>{if(b.activeCues)for(var d of b.activeCues)if(oq(a,d.startTime,d.endTime,d.type,d.value),a.C)a.C.onCueMetadataChange(d.value);if(b.cues){d=[];for(const e of b.cues)if(e.type=="com.apple.quicktime.HLS"&&e.startTime!=null){let f=d.find(g=>g.startTime==e.startTime&&g.endTime==e.endTime);f||(f={startTime:e.startTime,endTime:e.endTime,values:[]},d.push(f));f.values.push(e.value)}for(const e of d)e.values.some(f=>f.key=="X-ASSET-URI"||
f.key=="X-ASSET-LIST")&&a.C&&(e.values.push({key:"CUE",description:"",data:e.startTime!=0||a.U()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),a.C.onHLSInterstitialMetadata(a,a.h,e))}});var c=(new H(()=>{const d=lr(a);for(const e of d)e.mode="hidden"})).Ia().Z(.5);a.Xd.push(()=>{c.stop()})}}function mr(a,b){if(b&&b.kind=="chapters"){b.mode="hidden";var c=(new H(()=>{b.mode="hidden"})).Ia().Z(.5);a.Xd.push(()=>{c.stop()})}}
function Eq(a,b,c){const d=()=>qq(a);a.j.o(b,"playing",d);a.j.o(b,"pause",d);a.j.o(b,"ended",d);a.j.o(b,"ratechange",()=>fr(a));b.remote&&(a.j.o(b.remote,"connect",()=>{a.l&&b.remote.state=="connected"&&hr(a);Yq(a)}),a.j.o(b.remote,"connecting",()=>Yq(a)),a.j.o(b.remote,"disconnect",async()=>{a.l&&b.remote.state=="disconnected"&&(await Fm(a.l),hr(a));Yq(a)}));b.audioTracks&&(a.j.o(b.audioTracks,"addtrack",()=>Yq(a)),a.j.o(b.audioTracks,"removetrack",()=>Yq(a)),a.j.o(b.audioTracks,"change",()=>Yq(a)));
b.videoTracks&&(a.j.o(b.videoTracks,"addtrack",()=>Yq(a)),a.j.o(b.videoTracks,"removetrack",()=>Yq(a)),a.j.o(b.videoTracks,"change",()=>Yq(a)));(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.j.o(b,"webkitpresentationmodechanged",()=>{a.Vd&&mq(a,!0)});if(b.textTracks){const e=()=>{a.m===Fq&&a.A instanceof so&&hr(a);Yq(a)};a.j.o(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.j.o(b.textTracks,"removetrack",
e);a.j.o(b.textTracks,"change",e)}b.preload!="none"&&a.j.sa(b,"loadedmetadata",()=>{var e=a.B,f=Date.now()/1E3-c;f>=0&&(e.F=f)})}function gq(a){try{Qh(a.Zd,a.i)}catch(c){return xq(a,c),!1}var b=Qf(a.i.variants);b=a.I.create(b);a=a.u.setVariants(Array.from(b.values()));return typeof a=="boolean"?a:!0}function Oq(a,b,c=!1,d=0){a.i&&a.l&&b!=a.l.u&&Uq(a,b,!0,c,d)}
function Pq(a){return new Qm(a.i,{Pb:()=>a.F?a.F.m():0,getBandwidthEstimate:()=>a.u.getBandwidthEstimate(),Pa:()=>a.Pa(),video:a.h,aa:a.G,hc:a.L,onError:b=>xq(a,b),onEvent:b=>a.dispatchEvent(b),gd:(b,c,d,e)=>{var f=b.startTime,g=b.endTime,h=c.type;if(h!=F){if(a.F){a.F.I();const k=dk(a.G,h);!a.U()&&a.h.paused&&!a.h.seeking&&k!=null&&k>0&&a.F.m()<k&&!sj(a.F.m(),k,.001)&&a.F.A(k)}nr(a)}d=(new Map).set("start",f).set("end",g).set("contentType",h).set("isMuxed",d).set("isDependency",e);a.dispatchEvent(Wp("segmentappended",
d));a.u&&c.fastSwitching&&b.Kc&&b.Id&&a.u.trySuggestStreams()},Gj:(b,c)=>{(c=c.ed)&&a.Sd&&Al(a.Sd,c,b)},Zg:(b,c)=>{var d=a.D;if(d.h.parseInbandPsshEnabled&&!d.G&&["audio","video"].includes(b)){b=new Wg($a(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;ph(d,"cenc",e);d=d.l}}else d=Promise.resolve();return d},disableStream:(b,c)=>a.disableStream(b,c),fk:(b,c)=>a.g.abr.enabled&&c.fastSwitching&&b.Kc&&b.Id?
!1:!0})}function Qq(a,b=!1){if(gq(a)){if(!a.g.abr.enabled){var c=a.I;typeof c.getLastAdaptationSet!="function"&&(Ic("AdaptationSetCriteria w/o getLastAdaptationSet","Please use an AdaptationSetCriteria with getLastAdaptationSet."),c.getLastAdaptationSet=()=>null);if(c=c.getLastAdaptationSet())if(c=Array.from(c.values()),c.length){const d=a.l.u;if(d&&d.video&&(c=c.find(e=>e.video==d.video)))return c}}return a.u.chooseVariant(b)}return null}
function Rq(a,b){return new ml(a.h,a.i,a.g.streaming,b,()=>{a.Ab&&vl(a.Ab,!a.F.F());a.l&&a.l.Mc();a.O&&nr(a,"seeking")},c=>a.dispatchEvent(c))}
function Sq(a,b){var c=a.U()||typeof b==="number"&&b>0;b=new jo(a.Td,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 jo(a.oa,c);d.addEventListener("enter",f=>{vq(a,f.region,"metadata")});c=new jo(a.Va,c);c.addEventListener("enter",f=>{f=(new Map).set("detail",f.region.emsg);
a.dispatchEvent(Wp("emsg",f))});const e=new wl(a.h);e.g.add(b);e.g.add(d);e.g.add(c);a.Sd&&e.g.add(a.Sd);return e}
function Bq(a,b,c){a.O=new Mh;Jh(a.O,Lh);or(a);pq(a);a.Aa=new H(()=>{nr(a)});a.g.streaming.rebufferingGoal&&a.Aa.wa(.25);a.j.o(b,"waiting",()=>nr(a,"waiting"));a.j.o(b,"canplaythrough",()=>nr(a,"canplaythrough"));a.j.o(b,"playing",()=>nr(a,"playing"));a.j.o(b,"seeked",()=>nr(a,"seeked"));a.j.o(b,"timeupdate",()=>nr(a,"timeupdate"));c&&(a.j.o(b,"progress",()=>nr(a,"progress")),a.j.o(b,"stalled",()=>nr(a,"stalled")))}
async function Tq(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.Ob(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 Uq(a,b,c,d,e,f=!1){var g=a.l.u;if(b==g)d&&vm(a.l,b,d,e,!0);else{var h=a.B.h;h.h!=b&&(h.h=b,h.g.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));vm(a.l,b,d,e,f,c);d=null;g&&(d=If(g));g=If(b);g.active=!0;if(a.P&&(e=a.P,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.$f()){case "DASH":f=1;break;case "HLS":f=0}e.g&&(e.g.setLevelSwitching(h.id,!0),e.g.setContainerFormat(b),
e.j||e.g.setStreamingFormat(f))}c?(c=(new Map).set("oldTrack",d).set("newTrack",g),c=Wp("adaptation",c),ir(a,c)):pr(a,d,g);qr(a,d,g)}}function Vq(a,b,c){c?(Vf(b.audio,c,a.g)&&(a.V=!0),a.V&&a.A.setTextVisibility(!0)):(a.V=!1,a.A.setTextVisibility(!1));rr(a)}function Wq(a){const b=a.cc().find(c=>c.active);b&&a.A&&a.A.setTextLanguage&&a.A.setTextLanguage(b.language)}function Xq(a){a.g.abr.enabled||eq(a);const b=(new Map).set("newStatus",a.g.abr.enabled);ir(a,Wp("abrstatuschanged",b))}
function Kq(a){const b=a.h.playbackRate;var c=a.U();if(a.g.streaming.vodDynamicPlaybackRate&&!c){var d=a.g.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.jh();e<=a.g.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.Zb(d,!1):e==1&&b!==a.K.Yc()&&a.Tc()}if(c&&(c=a.va(),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.R||typeof g!=="number"||(a.R=g);var n=a.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Tb&&a.R!==null&&typeof g==="number"&&a.je<n&&Date.now()-a.Tb>f*1E3&&(f=a.g.streaming.liveSync.dynamicTargetLatency.minLatency,
a.R=Math.max(a.R-(g-f)/2,f+d),a.Tb=Date.now());e&&a.R!==null&&(h=a.R+d,k=a.R-d);g=c.end-a.h.currentTime;d=0;a.m==Fq&&(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.O.i;c&&!m&&(m=a.g.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.Zb(m,!1):h!=void 0&&l&&g-d>h?(b!=l&&a.Zb(l,!1),a.Tb=null):k!=void 0&&m&&g-d<k?(b!=m&&a.Zb(m,!1),a.Tb=null):b!==a.K.Yc()&&(a.Tc(),a.Tb=Date.now())}}
function Lq(a){if(a.h){var b=a.va();b=b.end-b.start;b=b>0?a.h.currentTime/b:0;if(!isNaN(b)){b*=100;if(sr(a,0,b))var c=Wp("started");else if(sr(a,25,b))c=Wp("firstquartile");else if(sr(a,50,b))c=Wp("midpoint");else if(sr(a,75,b))c=Wp("thirdquartile");else{if(sr(a,100,b)||b>100)c=Wp("complete");a.g&&a.g.playRangeEnd!=Infinity&&a.isEnded()&&a.h.pause()}c&&a.dispatchEvent(c)}}}
function zq(a,b){b=new jo(a.oa,b instanceof Date||b>0);b.addEventListener("enter",d=>{vq(a,d.region,"metadata")});const c=new wl(a.h);c.g.add(b);return c}function Cq(a){return Array.from(a.h.textTracks).filter(b=>b.kind!="metadata"&&b.kind!="chapters"&&b.label!="Shaka Player TextTrack")}function Dq(a){return Array.from(a.h.textTracks).find(b=>b.label=="Shaka Player TextTrack")}function Gq(a){const b=a.g.preferredAudioLanguage;b!=""&&a.Ih(b,a.g.preferredAudioRole)}
function Hq(a,b){a.j.o(b,"cuechange",()=>{a.A.remove(0,Math.max(0,a.h.currentTime-a.g.streaming.bufferBehind));const c={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},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 ae(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?re: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=bd,e.region.width=f.region.width,e.region.widthUnits=bd);ce(e)}if(e){const g=a.g.mediaSource.modifyCueCallback;g&&g(e,null,c);d.push(e)}}a.A.append(d)});b.mode=document.pictureInPictureElement?"showing":"hidden"}function Iq(a){const b=a.g.preferredTextLanguage;b!=""&&a.Eg(b,a.g.preferredTextRole,a.g.preferForcedSubs)}
function Jq(a,b=!0){if(!a.h.error)return b?new D(2,3,3016):null;const c=a.h.error.code;if(!b&&c==1)return null;if(b=a.h.error.msExtendedCode)b<0&&(b+=4294967296),b=b.toString(16);return new D(2,3,3016,c,b,a.h.error.message)}function lr(a){return Array.from(a.h.textTracks).filter(b=>b.kind=="metadata")}function or(a){const b=a.g.streaming.rebufferingGoal;a.O.j.set(Kh,Math.min(.5,b/2)).set(Lh,b)}
function nr(a,b){if(a.g.streaming.rebufferingGoal){b=a.G?Uj(a.G):!1;b=a.isEnded()||b||a.F.H();var c=Yi(a.h.buffered,a.h.currentTime),d=a.O,e=d.j.get(d.g);Jh(d,b||c>=e&&c>0?Kh:Lh)&&pq(a)}else if(b){c=a.O;d=a.h.currentTime;e=c.h;c.h=d;let f=void 0;switch(b){case "seeking":case "waiting":c.h=-1;f=Lh;break;case "canplaythrough":case "playing":case "seeked":f=Kh;break;case "timeupdate":e>=0&&d-e>.01&&(f=Kh)}f!==void 0&&Jh(c,f)&&pq(a)}}
function tr(a,b){a.Zd=new Th(a.g,a.ma,a.D);if(a.H){var c=nd(a.g.manifest);a.h&&a.h.nodeName==="AUDIO"&&(c.disableVideo=!0);a.H.configure(c)}a.D&&a.D.configure(a.g.drm);if(a.l){a.l.configure(a.g.streaming);try{a.m!=dr&&Nh(a.Zd,a.i)&&Yq(a)}catch(e){xq(a,e)}a.u&&gq(a);c=a.l.u;!c||c.allowedByApplication&&c.allowedByKeySystem||er(a)}a.L&&a.L.configure(a.g.networking);a.G&&(a.G.configure(a.g.mediaSource),a.G.za=a.g.manifest.segmentRelativeVttTiming);a.A&&mq(a);a.u&&(a.u.configure(a.g.abr),a.g.abr.enabled?
a.u.enable():a.u.disable(),Xq(a));a.O&&or(a);a.Aa&&(a.g.streaming.rebufferingGoal?a.Aa.wa(.25):a.Aa.stop());a.i&&$p(a.i.presentationTimeline,a.g.playRangeStart,a.g.playRangeEnd);a.C&&a.C.configure(a.g.ads);a.J&&a.J.configure(a.g.cmcd);a.ea&&a.ea.configure(a.g.cmsd);a.na&&a.na.configure(a.g.queue);if(a.m==fq&&a.I.getConfiguration){c=a.I.getConfiguration();var d=!1;b.preferredVideoHdrLevel!=a.g.preferredVideoHdrLevel&&c.hdrLevel!=a.g.preferredVideoHdrLevel&&(c.hdrLevel=a.g.preferredVideoHdrLevel,d=
!0);b.preferredVideoLayout!=a.g.preferredVideoLayout&&c.videoLayout!=a.g.preferredVideoLayout&&(c.videoLayout=a.g.preferredVideoLayout,d=!0);b.preferSpatialAudio!=a.g.preferSpatialAudio&&c.spatialAudio!=a.g.preferSpatialAudio&&(c.spatialAudio=a.g.preferSpatialAudio,d=!0);b.preferredVideoRole!=a.g.preferredVideoRole&&c.videoRole!=a.g.preferredVideoRole&&(c.videoRole=a.g.preferredVideoRole,d=!0);d&&(a.I.configure(c),er(a))}}function er(a,b=!0,c=0,d=!1,e=!0){const f=Qq(a);f&&Uq(a,f,e,b,c,d)}
function gr(a,b){a.Vb.Na();a.Vb.o(a.h,"timeupdate",()=>{const c=a.h.currentTime,d=a.va(),e=a.U(),f=e?a.g.streaming.safeSeekOffset:0;b>0?e&&b>1&&Math.floor(c)>=Math.floor(d.end)&&a.Tc():Math.floor(c)<=Math.floor(d.start+f)&&a.Tc()})}function ur(a){return a.h&&a.h.videoTracks?Array.from(a.h.videoTracks).find(b=>b.selected):null}
async function vr(a,b){if(a.m!=fq&&a.m!=Fq)return null;let c=a.fe;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.jc.has(d)||a.jc.set(d,new H(()=>{d&&(d.closeSegmentIndex(),a.jc.delete(d))})),a.jc.get(d).Z(5));return d}function wr(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
function xr(a,b,c,d){const e=b.width||0,f=b.height||0;let g=e/d.columns,h=f/d.rows;const k=d.columns*d.rows;var l=a.j-a.startTime;l=a.B||l/k;let m=a.startTime,n=0;var p=0;k>1&&(p=Math.floor((c-a.startTime)/l+1E-4),m=a.startTime+p*l,n=p%d.columns*g,p=Math.floor(p/d.columns)*h);if(m>=a.endTime||sj(m,a.endTime,1E-4))return null;d=!1;if(c=a.thumbnailSprite)d=!0,h=c.height,n=c.positionX,p=c.positionY,g=c.width;return{segment:a,imageHeight:f,imageWidth:e,height:h,positionX:n,positionY:p,startTime:m,duration:l,
uris:a.S(),startByte:a.wc(),endByte:a.uc(),width:g,sprite:d,mimeType:a.mimeType||b.mimeType,codecs:a.codecs||b.codecs}}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=ur(a);c=Of(c,d);b=Of(b,d);pr(a,c,b);qr(a,c,b)}}function rr(a){const b=Wp("texttrackvisibility");ir(a,b)}async function zr(a,b){let c;try{c=await Xl(b,a.L,a.g.streaming.retryParameters)}catch(d){}if(c)return c;throw new D(1,2,2011,b);}
async function Ar(a,b,c,d,e,f,g){if(e!="text/vtt"||g.length)b=await Br(a,b),b=Cr(a,b,e,g),b=Qj(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=Ip(g);k.ot=Mp;k.su=!0;const l=Jo(k);h=Ho(b,l);break a}catch(k){ta("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.lf.push(e);return e}async function Br(a,b){b=tg([b],a.g.streaming.retryParameters);b.method="GET";var c=a.J;try{c.g.enabled&&ip(c,b,{ot:Mp,su:!0})}catch(d){ta("CMCD_TEXT_ERROR","Could not generate text CMCD data.",d)}return(await a.L.request(zg,b).promise).data}function Cr(a,b,c,d){const e=Xe(c);if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.h.duration,vttOffset:0},b=$a(b),b=c.parseMedia(b,a,null,[]),Go(b,d);throw new D(2,2,2014,c);}
function sr(a,b,c){return(sj(b,c,.01)||c>b)&&a.kf<b?(a.kf=b,!0):!1}function pr(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=Wp("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.m!=dr&&a.dispatchEvent(b)}function jr(a){const b=Wp("audiotrackschanged");ir(a,b)}
var P=class extends Ba{constructor(a,b=null,c){super();this.m=Dr;this.h=null;this.Vd=b;this.V=!1;this.ge=new zc;this.Wd=new zc;this.j=new zc;this.Vb=new zc;this.kd=new zc;this.F=this.G=this.D=this.L=null;this.ie=0;this.W=new Vp;this.M=this.za=this.T=this.i=this.lc=this.H=this.l=this.Sd=this.P=this.Tg=this.ea=this.J=this.Va=this.oa=this.Td=this.O=this.Aa=this.K=this.Ab=null;this.Ha=!1;this.ae=this.u=null;this.$d=1E9;this.fe=[];this.jc=new Map;this.Wa=[];this.kf=-1;this.g=cq(this);this.mf=tn();this.R=
null;this.je=-1;this.Tb=null;this.ma={width:Infinity,height:Infinity};this.Zd=new Th(this.g,this.ma,null);this.ce=[];this.B=null;this.I=this.g.adaptationSetCriteriaFactory();this.I.configure({language:this.g.preferredAudioLanguage,role:this.g.preferredAudioRole,videoRole:this.g.preferredVideoRole,channelCount:0,hdrLevel:this.g.preferredVideoHdrLevel,spatialAudio:this.g.preferSpatialAudio,videoLayout:this.g.preferredVideoLayout,audioLabel:this.g.preferredAudioLabel,videoLabel:this.g.preferredVideoLabel,
codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});this.nd=this.g.preferredTextLanguage;this.vd=this.g.preferredTextRole;this.Yd=this.g.preferForcedSubs;this.Xd=[];c&&c(this);this.J=new Np(this,this.g.cmcd);this.ea=new Tp(this.g.cmsd);this.L=dq(this);this.X=this.$=this.na=this.C=null;this.pf=!1;this.lf=[];this.nf=
new H(async()=>{this.$&&(await this.Db(this.X,!0),await this.load(this.$),this.pf?this.X.pause():this.X.play(),this.$=null,this.pf=!1)});Er&&(this.C=Er(),this.C.configure(this.g.ads),this.kd.o(this.C,"ad-content-pause-requested",async d=>{this.nf.stop();if(!this.$){this.X=this.h;this.pf=this.isEnded();d=d.saveLivePosition||!1;let e=!0;this.U()&&(e=d);this.$=await this.gh(!0,e)}}),this.kd.o(this.C,"ad-content-resume-requested",d=>{d=d.offset||0;if(this.$){var e=this.$;e.u&&d&&(typeof e.u==="number"?
e.u+=d:e.u.setTime(e.u.getTime()+d*1E3))}this.nf.Z(.1)}),this.kd.o(this.C,"ad-content-attach-requested",async()=>{!this.h&&this.X&&(await this.Db(this.X,!0),this.X=null)}));Fr&&(this.na=Fr(this),this.na.configure(this.g.queue));this.ge.o(window,"online",()=>{eq(this);this.Ag()});this.be=new H(()=>{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.be.stop();e&&er(this,
!1,void 0,!1,!1)});this.Oa=null;a&&(Ic("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.Db(a,!0));this.A=null}async destroy(){if(this.m!=dr){hq(this);var a=this.detach();this.m=dr;await a;await this.Df();this.ge&&(this.ge.release(),this.ge=null);this.Wd&&(this.Wd.release(),this.Wd=null);this.j&&(this.j.release(),this.j=null);this.Vb&&(this.Vb.release(),this.Vb=null);this.kd&&(this.kd.release(),this.kd=null);this.ea=this.J=
this.Vd=this.B=this.g=this.ae=null;this.L&&(await this.L.destroy(),this.L=null);this.u&&(this.u.release(),this.u=null);this.na&&(this.na.destroy(),this.na=null);super.release()}}async Db(a,b=!0){if(this.m==dr)throw new D(2,7,7E3);const c=this.h&&this.h==a;this.h&&this.h!=a&&await this.detach();if(!await kq(this,"attach"))try{c||(jq(this,"attach"),this.Wd.o(a,"error",()=>{const d=Jq(this,!1);d&&xq(this,d)}),this.h=a,this.J&&this.J.setMediaElement(a)),tb(),b&&Qc()&&!this.G&&await lq(this)}catch(d){throw await this.detach(),
d;}finally{this.W.release()}}Wg(a){this.Tg=a}async detach(a=!1){if(this.m==dr)throw new D(2,7,7E3);await this.$b(!1,a);if(!await kq(this,"detach"))try{this.h&&(this.Wd.Na(),this.h=null),jq(this,"detach"),this.C&&!a&&this.C.release()}finally{this.W.release()}}async $b(a=!0,b=!1){this.m!=dr&&(this.m=Dr);if(!await kq(this,"unload")){try{this.Ha=!1;jq(this,"unload");hq(this);const c=this.Xd.map(d=>d());this.Xd=[];await Promise.all(c);this.dispatchEvent(Wp("unloading"));this.Td&&(this.Td.release(),this.Td=
null);this.oa&&(this.oa.release(),this.oa=null);this.Va&&(this.Va.release(),this.Va=null);this.h&&(this.j.Na(),this.Vb.Na());this.be.stop();this.Ab&&(this.Ab.release(),this.Ab=null);this.Aa&&(this.Aa.stop(),this.Aa=null);this.H&&(await this.H.stop(),this.lc=this.H=null);this.u&&this.u.stop();this.l&&(await this.l.destroy(),this.l=null);this.K&&(this.K.release(),this.K=null);this.F&&(this.F.release(),this.F=null);"webkit"===window.shakaMediaKeysPolyfill&&this.D&&(await this.D.destroy(),this.D=null);
this.G&&(await this.G.destroy(),this.G=null);if(this.C&&!b)this.C.onAssetUnload();this.$&&!b&&(this.$.destroy(),this.$=null);b||this.nf.stop();this.J&&Ro(this.J);this.ea&&(this.ea.g=null);this.A&&(await this.A.destroy(),this.A=null);this.V=!1;if(this.h){for(const d of this.lf)d.src.startsWith("blob:")&&URL.revokeObjectURL(d.src),d.remove();this.lf=[];dj(this.h)&&this.h.load()}this.D&&(await this.D.destroy(),this.D=null);this.Oa&&this.T!=this.Oa.Gc()&&(this.Oa.l||this.Oa.destroy(),this.Oa=null);this.O=
this.za=this.T=null;if(this.i){for(const d of this.i.variants)for(const e of[d.audio,d.video])e&&e.segmentIndex&&e.segmentIndex.release();for(const d of this.i.textStreams)d.segmentIndex&&d.segmentIndex.release()}this.g&&this.g.streaming.clearDecodingCache&&(Ef.clear(),qb.clear());this.i=null;this.B=new Kn;this.R=this.Tb=this.Sg=null;this.je=-1;this.fe=[];for(const d of this.jc.values())d.stop();this.jc.clear();this.Wa=[];this.kf=-1;this.L&&this.L.dh();pq(this)}finally{this.W.release()}tb();a&&Qc()&&
!this.G&&this.h&&await lq(this)}}lk(a){this.M=a}async load(a,b=null,c){if(this.m==dr)throw new D(2,7,7E3);!this.h&&this.X&&(await this.Db(this.X,!0),this.X=null);let d=null,e="";c=c?.toLowerCase();if(a instanceof eo){if(a.l)throw new D(2,7,7006);d=a;e=d.Gc()||""}else e=a||"";await Up(this.W,"load");this.W.release();if(!this.h)throw new D(2,7,7002);this.T&&(this.T=e,await this.$b(!1));const f=++this.ie,g=async()=>{if(this.ie!=f)throw d&&await d.destroy(),new D(2,7,7E3);};a=async(h,k)=>{try{await Up(this.W,
k),await g(),await h(),await g(),d&&this.g&&(d.g=this.g)}finally{this.W.release()}};try{b==null&&d&&(b=d.getStartTime());this.M=b;this.Ha=!1;this.dispatchEvent(Wp("loading"));d?c=d.R:c||await a(async()=>{c=await rq(this,e)},"guessMimeType_");const h=!!d;d?(On(d,this),this.B=d.getStats()):(d=await sq(this,e,b,c,!0,this.g))?(d.D=!1,On(d,this),this.B=d.getStats(),d.start(),d.B.catch(()=>{})):this.B=new Kn;b=!d;const k=Date.now()/1E3;this.B=d?d.getStats():new Kn;this.T=e;this.za=c||null;pq(this);const l=
()=>{const m=this.h?this.h.buffered:null;return{start:Vi(m)||0,end:Wi(m)||0}};this.oa=new Fl(l);this.oa.addEventListener("regionadd",m=>{vq(this,m.region,"metadataadded")});if(b)await a(async()=>{await wq(this,c)},"initializeSrcEqualsDrmInner_"),await a(async()=>{await yq(this,k,c)},"srcEqualsInner_");else{this.Va=new Fl(l);await a(async()=>{await Promise.race([d.X,d.B]);this.lc=d.G;var q=d;q.$=!0;this.H=q.m;this.i=d.Zf()},"waitForFinish");this.G||await a(async()=>{await lq(this)},"initializeMediaSourceEngineInner_");
this.i&&this.i.textStreams.length&&(this.A.enableTextDisplayer?this.A.enableTextDisplayer():Ic("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!'));await a(async()=>{await d.B},"waitForFinish");this.g=d.getConfiguration();this.Zd=d.F;this.H&&this.H.setMediaElement&&this.h&&this.H.setMediaElement(this.h);this.Td=Pn(d);this.Sd=d.za;const m=d.C;m&&(this.I=m);h&&this.h&&this.h.nodeName==="AUDIO"&&(Mq(this),this.configure("manifest.disableVideo",!0));d.j||
await a(async()=>{await Wn(d,this.h)},"drmEngine_.init");this.D=Qn(d);await a(async()=>{await this.D.Db(this.h)},"drmEngine_.attach");const n=this.g.abrFactory;this.u&&this.ae==n||(this.ae=n,this.u&&this.u.release(),this.u=n(),typeof this.u.setMediaElement!="function"&&(Ic("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),this.u.setMediaElement=()=>{}),typeof this.u.setCmsdManager!="function"&&(Ic("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),
this.u.setCmsdManager=()=>{}),typeof this.u.trySuggestStreams!="function"&&(Ic("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),this.u.trySuggestStreams=()=>{}),this.u.configure(this.g.abr));const p=Rn(d),r=d.i;await a(async()=>{await Nq(this,k,r,p)},"loadInner_");Nn(d);this.za&&tb().M()&&Te(this.za)&&Tj(this.G,this.T,this.za)}this.dispatchEvent(Wp("loaded"))}catch(h){throw h&&h.code!=7E3&&await this.$b(!1),h;}finally{d&&await d.destroy(),this.Oa=null}}async Zh(a=
!0,b=!1,c=!1){c=await Zq(this,c);await this.$b(a,b);return c}async gh(a=!1,b=!1){b=await Zq(this,b);await this.detach(a);return b}async preload(a,b=null,c,d){c=c?.toLowerCase();const e=cq(this);un(e,d||this.g,cq(this));(a=await sq(this,a,b,c,!1,e))?a.start():xq(this,new D(2,7,7005));return a}async Df(){const a=[];for(const b of this.ce)b.l||a.push(b.destroy());this.ce=[];await Promise.all(a)}Pj(){for(var a=this.W;a.g;)a.release()}Vc(a){return new Ih(a)}configure(a,b){const c=this.getConfiguration();
arguments.length==2&&typeof a=="string"&&(a=Sm(a,b));"preferredVariantRole"in a&&(Ic("preferredVariantRole configuration","Please Use preferredAudioRole instead."),a.preferredAudioRole=a.preferredVariantRole,delete a.preferredVariantRole);a.streaming&&"forceTransmuxTS"in a.streaming&&(Ic("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.mediaSource=a.streaming.forceTransmuxTS,delete a.streaming.forceTransmuxTS);
a.streaming&&"forceTransmux"in a.streaming&&(Ic("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.mediaSource=a.streaming.forceTransmux,delete a.streaming.forceTransmux);if(a.streaming&&"useNativeHlsOnSafari"in a.streaming){Ic("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");var d=tb();a.streaming.preferNativeHls=a.streaming.useNativeHlsOnSafari&&
d.h()==="WEBKIT";delete a.streaming.useNativeHlsOnSafari}a.streaming&&typeof a.streaming.liveSync=="boolean"&&(Ic("streaming.liveSync","Please Use streaming.liveSync.enabled instead."),d=a.streaming.liveSync,a.streaming.liveSync={},a.streaming.liveSync.enabled=d);if(a.streaming&&!(a.streaming.liveSync&&"targetLatency"in a.streaming.liveSync)&&("liveSyncMinLatency"in a.streaming||"liveSyncMaxLatency"in a.streaming)){d=a.streaming.liveSyncMinLatency||0;const f=Math.abs((a.streaming.liveSyncMaxLatency||
1)-d)/2;a.streaming.liveSync=a.streaming.liveSync||{};a.streaming.liveSync.targetLatency=d+f;a.streaming.liveSync.targetLatencyTolerance=f}a.streaming&&"liveSyncMaxLatency"in a.streaming&&(Ic("streaming.liveSyncMaxLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete a.streaming.liveSyncMaxLatency);a.streaming&&"liveSyncMinLatency"in a.streaming&&(Ic("streaming.liveSyncMinLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),
delete a.streaming.liveSyncMinLatency);a.streaming&&"liveSyncTargetLatency"in a.streaming&&(Ic("streaming.liveSyncTargetLatency","Please Use streaming.liveSync.targetLatency instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.targetLatency=a.streaming.liveSyncTargetLatency,delete a.streaming.liveSyncTargetLatency);a.streaming&&"liveSyncTargetLatencyTolerance"in a.streaming&&(Ic("streaming.liveSyncTargetLatencyTolerance","Please Use streaming.liveSync.targetLatencyTolerance instead."),
a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.targetLatencyTolerance=a.streaming.liveSyncTargetLatencyTolerance,delete a.streaming.liveSyncTargetLatencyTolerance);a.streaming&&"liveSyncPlaybackRate"in a.streaming&&(Ic("streaming.liveSyncPlaybackRate","Please Use streaming.liveSync.maxPlaybackRate instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.maxPlaybackRate=a.streaming.liveSyncPlaybackRate,delete a.streaming.liveSyncPlaybackRate);a.streaming&&"liveSyncMinPlaybackRate"in
a.streaming&&(Ic("streaming.liveSyncMinPlaybackRate","Please Use streaming.liveSync.minPlaybackRate instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.minPlaybackRate=a.streaming.liveSyncMinPlaybackRate,delete a.streaming.liveSyncMinPlaybackRate);a.streaming&&"liveSyncPanicMode"in a.streaming&&(Ic("streaming.liveSyncPanicMode","Please Use streaming.liveSync.panicMode instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.panicMode=a.streaming.liveSyncPanicMode,
delete a.streaming.liveSyncPanicMode);a.streaming&&"liveSyncPanicThreshold"in a.streaming&&(Ic("streaming.liveSyncPanicThreshold","Please Use streaming.liveSync.panicThreshold instead."),a.streaming.liveSync=a.streaming.liveSync||{},a.streaming.liveSync.panicThreshold=a.streaming.liveSyncPanicThreshold,delete a.streaming.liveSyncPanicThreshold);if(a.mediaSource&&"sourceBufferExtraFeatures"in a.mediaSource){Ic("mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");
const f=a.mediaSource.sourceBufferExtraFeatures;a.mediaSource.addExtraFeaturesToSourceBuffer=()=>f;delete a.mediaSource.sourceBufferExtraFeatures}a.manifest&&a.manifest.hls&&"useSafariBehaviorForLive"in a.manifest.hls&&(Ic("manifest.hls.useSafariBehaviorForLive configuration","Please Use liveSync config to keep on live Edge instead."),delete a.manifest.hls.useSafariBehaviorForLive);a.streaming&&"parsePrftBox"in a.streaming&&(Ic("streaming.parsePrftBox configuration","Now fired without needing a configuration."),
delete a.streaming.parsePrftBox);a.manifest&&a.manifest.dash&&"enableAudioGroups"in a.manifest.dash&&(Ic("manifest.dash.enableAudioGroups configuration","Please Use manifest.enableAudioGroups instead."),a.manifest.enableAudioGroups=a.manifest.dash.enableAudioGroups,delete a.manifest.dash.enableAudioGroups);a.streaming&&"dispatchAllEmsgBoxes"in a.streaming&&(Ic("streaming.dispatchAllEmsgBoxes configuration","Please Use mediaSource.dispatchAllEmsgBoxes instead."),a.mediaSource=a.mediaSource||{},a.mediaSource.dispatchAllEmsgBoxes=
a.streaming.dispatchAllEmsgBoxes,delete a.streaming.dispatchAllEmsgBoxes);a.streaming&&"autoLowLatencyMode"in a.streaming&&(Ic("streaming.autoLowLatencyMode configuration","Please Use streaming.lowLatencyMode instead."),a.streaming.lowLatencyMode=a.streaming.autoLowLatencyMode,delete a.streaming.autoLowLatencyMode);a.manifest&&a.manifest.dash&&"ignoreSupplementalCodecs"in a.manifest.dash&&(Ic("manifest.dash.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),
a.manifest.ignoreSupplementalCodecs=a.manifest.dash.ignoreSupplementalCodecs,delete a.manifest.dash.ignoreSupplementalCodecs);a.manifest&&a.manifest.hls&&"ignoreSupplementalCodecs"in a.manifest.hls&&(Ic("manifest.hls.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),a.manifest.ignoreSupplementalCodecs=a.manifest.hls.ignoreSupplementalCodecs,delete a.manifest.hls.ignoreSupplementalCodecs);a.manifest&&a.manifest.dash&&"updatePeriod"in a.manifest.dash&&
(Ic("manifest.dash.updatePeriod configuration","Please Use manifest.updatePeriod instead."),a.manifest.updatePeriod=a.manifest.dash.updatePeriod,delete a.manifest.dash.updatePeriod);a.manifest&&a.manifest.hls&&"updatePeriod"in a.manifest.hls&&(Ic("manifest.hls.updatePeriod configuration","Please Use manifest.updatePeriod instead."),a.manifest.updatePeriod=a.manifest.hls.updatePeriod,delete a.manifest.hls.updatePeriod);a.manifest&&a.manifest.dash&&"ignoreDrmInfo"in a.manifest.dash&&(Ic("manifest.dash.ignoreDrmInfo configuration",
"Please Use manifest.ignoreDrmInfo instead."),a.manifest.ignoreDrmInfo=a.manifest.dash.ignoreDrmInfo,delete a.manifest.dash.ignoreDrmInfo);if(a.drm&&a.drm.advanced){d=!1;for(var e in a.drm.advanced){const {videoRobustness:f,audioRobustness:g}=a.drm.advanced[e];"videoRobustness"in a.drm.advanced[e]&&!Array.isArray(a.drm.advanced[e].videoRobustness)&&(a.drm.advanced[e].videoRobustness=[f],d=!0);"audioRobustness"in a.drm.advanced[e]&&!Array.isArray(a.drm.advanced[e].audioRobustness)&&(a.drm.advanced[e].audioRobustness=
[g],d=!0)}d&&Ic("AdvancedDrmConfiguration's videoRobustness and audioRobustness","These properties are no longer strings but array of strings, please update your usage of these properties.")}a.streaming&&"forceHTTP"in a.streaming&&(Ic("streaming.forceHTTP configuration","Please Use networking.forceHTTP instead."),a.networking=a.networking||{},a.networking.forceHTTP=a.streaming.forceHTTP,delete a.streaming.forceHTTP);a.streaming&&"forceHTTPS"in a.streaming&&(Ic("streaming.forceHTTPS configuration",
"Please Use networking.forceHTTP instead."),a.networking=a.networking||{},a.networking.forceHTTPS=a.streaming.forceHTTPS,delete a.streaming.forceHTTPS);a.streaming&&"minBytesForProgressEvents"in a.streaming&&(Ic("streaming.minBytesForProgressEvents configuration","Please Use networking.minBytesForProgressEvents instead."),a.networking=a.networking||{},a.networking.minBytesForProgressEvents=a.streaming.minBytesForProgressEvents,delete a.streaming.minBytesForProgressEvents);e=un(this.g,a,cq(this));
tr(this,c);return e}oi(a){this.mf=a}getConfiguration(){const a=cq(this);un(a,this.g,cq(this));return a}Ei(){return this.mf}nh(){const a=cq(this);un(a,this.g,cq(this));return Um(this.g,cq(this))}jh(){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.va().end);if(a>=b)return 1;if(!(a<=this.h.currentTime)&&a<b)return(a-this.h.currentTime)/(b-this.h.currentTime)}return 0}Fh(){const a=this.getConfiguration();for(const b in this.g)delete this.g[b];
un(this.g,cq(this),cq(this));tr(this,a)}bc(){return this.m}$f(){return this.i?this.i.type:null}ue(){return this.h}Eb(){return this.L}Gc(){return this.T}re(){return this.C?this.C:null}ve(){return this.na?this.na:null}U(){return this.i&&!this.Ca()?this.i.presentationTimeline.U():this.h&&(this.h.src||this.Ca())?this.h.duration==Infinity:!1}Ic(){return this.i?this.i.presentationTimeline.Ic():!1}bd(){if(this.i&&!this.Ca()){const a=this.i.variants;return a.length?!a[0].video:!1}return this.h&&(this.h.src||
this.Ca())?this.h.videoTracks?this.h.videoTracks.length==0:this.h.videoHeight==0:!1}Fe(){if(this.i&&!this.Ca()){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.Ca())&&this.h.audioTracks?this.h.audioTracks.length==0:!1}va(){if(this.i&&!this.Ca()){if(!this.Ha&&this.i.type=="HLS")return{start:0,end:0};var a=this.i.presentationTimeline;return{start:a.Qb(),end:a.xb()}}if(this.h&&(this.h.src||this.Ca())&&(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}}lj(){this.U()&&(this.h.currentTime=this.va().end)}ig(){return this.Ha}keySystem(){var a=this.drmInfo();return a?a.keySystem:""}drmInfo(){return this.D?this.D.g:null}Cd(){return this.D?this.D.Cd():Infinity}Vf(){return this.D?this.D.Vf():[]}se(){return this.D?this.D.se():{}}Be(){return this.O?this.O.g==Lh:!!this.T}Pa(){return this.h?
this.K?this.K.h:1:0}Rg(a){this.m==fq&&this.l&&um(this.l,a)}Zb(a,b=!0){if(a==0)sa("A trick play rate of 0 is unsupported!");else{var c=this.h.playbackRate,d=this.K.h;this.K.set(a);this.m==fq&&(this.u.playbackRateChanged(a),this.Rg(b&&a!=1));gr(this,a);c===0&&this.h.playbackRate===0&&a!=d&&fr(this)}}Tc(){const a=this.K.Yc();this.m==Fq&&this.K.set(a);this.m==fq&&(this.K.set(a),this.u.playbackRateChanged(a),this.Rg(!1));this.Vb.Na()}zb(){if(this.i&&!this.Ca()){var a=this.l?this.l.u:null;const b=[];let c=
0;for(const d of this.i.variants){if(!Pf(d))continue;const e=If(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=ur(this);a=Array.from(this.h.audioTracks);return a.length?a.map(c=>Of(c,b)):b?[Of(null,b)]:[]}return[]}cc(){if(this.i){if(this.Ca())return[];const a=this.l?this.l.B:null,b=[];for(const c of this.i.textStreams){const d=Jf(c);d.active=c==a;b.push(d)}return b}return this.h&&this.h.src&&
this.h.textTracks?Cq(this).map(a=>Nf(a)):[]}Yf(){let a=this.fe;this.i&&(a=this.i.imageStreams);return a.map(b=>Kf(b))}async si(a){const b=await vr(this,a);if(!b)return null;const c=[];b.segmentIndex.mb(d=>{const e=wr(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=xr(d,b,d.startTime+h*g,e);if(!k)break;c.push(k)}}});return c}async ph(a,b){a=await vr(this,a);if(!a)return null;var c=a.segmentIndex.find(b);if(c==null)return null;c=a.segmentIndex.get(c);
const d=wr(c.tilesLayout||a.tilesLayout);return d?xr(c,a,b,d):null}Ze(a){const b=()=>{const c=this.i.textStreams.find(d=>d.id==a.id);c&&c!=this.l.B&&(zn(this.B.h,c,!1),wm(this.l,c),hr(this),Wq(this),this.nd=c.language)};if(this.i&&this.F&&(b(),!this.Ca()))return;(()=>{if(this.h&&this.h.textTracks){var c=Cq(this);const e=c.find(f=>Lf(f)===a.id);if(e){if(this.A instanceof so)for(var d of c)c=d===e?this.V?"showing":"hidden":"disabled",d.mode!==c&&(d.mode=c);else d=c.find(f=>f.mode!=="disabled"),d!==
e&&(d&&(d.mode="disabled",this.j.Ea(d,"cuechange"),this.A.remove(0,Infinity)),e&&Hq(this,e));hr(this);Wq(this)}}})()}Pd(a,b=!1,c=0){const d=()=>{const e=this.i.variants.find(g=>g.id==a.id);if(e&&Pf(e)){var f=this.l.u;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)&&sa("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");
this.Ca()?Uq(this,e,!1,!1,0):Uq(this,e,!1,b||!1,c||0);this.I.configure({language:e.language,role:e.audio&&e.audio.roles&&e.audio.roles[0]||"",videoRole:e.video&&e.video.roles&&e.video.roles[0]||"",channelCount:e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,hdrLevel:e.video&&e.video.hdr?e.video.hdr:"",spatialAudio:e.audio&&e.audio.spatialAudio?e.audio.spatialAudio:!1,videoLayout:e.video&&e.video.videoLayout?e.video.videoLayout:"",audioLabel:e.audio&&e.audio.label?e.audio.label:"",videoLabel:e.video&&
e.video.label?e.video.label:"",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,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});gq(this)}};if(this.i&&this.F&&(d(),!this.Ca()))return;(()=>{if(a.originalAudioId&&this.h&&this.h.audioTracks){const e=
Array.from(this.h.audioTracks);for(const f of e)if(Lf(f)==a.id){yr(this,f);break}}})()}Jh(a,b=0){const c=()=>{const d=this.I.getConfiguration();d.audioCodec=a.codecs||"";d.audioLabel=a.label||"";d.channelCount=a.channelsCount||0;d.language=a.language;d.role=a.roles[0]||"";d.spatialAudio=a.spatialAudio;var e=this.l.u;if(e=e&&e.audio)d.activeAudioCodec=e.codecs||"",d.activeAudioChannelCount=e.channelsCount||0;this.I.configure(d);er(this,!0,b,!1,!1)};if(this.i&&this.F&&(c(),!this.Ca()))return;(()=>{if(this.h&&
this.h.audioTracks){const e=$b(a.language);var d=Array.from(this.h.audioTracks);let f=null;for(const g of d)if(d=g.language||"und",g.label==a.label&&$b(d)==e&&g.kind==a.roles[0]){f=g;break}f&&yr(this,f)}})()}getAudioTracks(){if(this.i&&!this.Ca()){var a=this.zb();if(!a.length)return[];const c=a.find(d=>d.active);if(!c)return[];var b=a;this.m!=fq||this.Ca()||(b=a.filter(d=>d.originalVideoId===c.originalVideoId&&(d.audioCodec||Ke.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:$b(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}):[]}Kh(a,b=!1,c=0){var d=this.zb();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&&xc(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&&Oe(g.audioCodec||"")===Oe(e.audioCodec||"")&&xc(g.audioRoles,e.audioRoles));f&&!f.active&&this.Pd(f,b,c)}}}getVideoTracks(){if(this.m==Fq||this.Ca())return[];var a=
this.zb();if(!a.length)return[];const b=a.find(d=>d.active);if(!b)return[];var c=a;this.Fe()||(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&&Oe(d.audioCodec||"")===Oe(b.audioCodec||"")&&xc(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())}wi(){return aq(this.zb())}cj(){return aq(this.cc())}ti(){return Array.from(bq(this.zb()))}bj(){return Array.from(bq(this.cc()))}Ih(a,
b,c=0,d=0,e="",f=!1,g=""){const h=()=>{var k=this.l.u;this.I=this.g.adaptationSetCriteriaFactory();this.I.configure({language:a,role:b||"",videoRole:k.video&&k.video.roles&&k.video.roles[0]||"",channelCount:c||0,hdrLevel:"",spatialAudio:f||!1,videoLayout:"",audioLabel:g||"",videoLabel:"",codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:e||"",activeAudioCodec:k.audio&&k.audio.codecs?k.audio.codecs:"",activeAudioChannelCount:k.audio&&k.audio.channelsCount?k.audio.channelsCount:
0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});const l=(p,r)=>p.video||r.video?p.video&&r.video?Math.abs((p.video.height||0)-(r.video.height||0))+Math.abs((p.video.width||0)-(r.video.width||0)):Infinity:0,m=this.I.create(this.i.variants);let n=null;for(const p of m.values())Pf(p)&&(!n||l(n,k)>l(p,k))&&(n=p);n!=k&&(n?(k=If(n),this.Pd(k,!0,d||0)):er(this))};if(this.i&&this.F&&(h(),!this.Ca()))return;(()=>{if(this.h&&this.h.audioTracks){const k=
Rf(this.zb(),a,b||"",!1)[0];k&&this.Pd(k)}})()}Eg(a,b,c=!1){const d=()=>{this.nd=a;this.vd=b||"";this.Yd=c||!1;const e=Rf(this.i.textStreams,this.nd,this.vd,this.Yd)[0]||null;e&&e!=this.l.B&&(zn(this.B.h,e,!1),this.g.streaming.alwaysStreamText||this.zc())&&(wm(this.l,e),hr(this),Wq(this))};if(this.i&&this.F&&(d(),!this.Ca()))return;(()=>{const e=Rf(this.cc(),a,b||"",c||!1)[0];e&&this.Ze(e)})()}Xj(a,b=!0,c=0){const d=()=>{let e=null;for(const f of this.i.variants)if(f.audio.label==a){e=f;break}e!=
null&&(this.I=this.g.adaptationSetCriteriaFactory(),this.I.configure({language:e.language,role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",videoLabel:"",audioLabel:a,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount}),er(this,b,c))};if(this.i&&this.F&&(d(),!this.Ca()))return;(()=>{if(this.h&&
this.h.audioTracks){const e=Array.from(this.h.audioTracks);let f=null;for(const g of e)g.label==a&&(f=g);f&&yr(this,f)}})()}zc(){const a=this.V;return this.A?this.A.isTextVisible():a}Bi(){return this.Wa.map(a=>Jf(a))}Ai(a){Ic("getChapters","Please use an getChaptersAsync.");if(!this.Wa.length)return[];const b=$b(a);a=this.Wa.filter(e=>$b(e.language)==b);if(!a.length)return[];const c=[],d=new Set;for(const e of a)e.segmentIndex&&e.segmentIndex.mb(f=>{const g=f.S()[0],h=f.startTime+"-"+f.endTime+"-"+
g;f={id:h,title:g,startTime:f.startTime,endTime:f.endTime};d.has(h)||(c.push(f),d.add(h))});return c}async Wf(a){if(!this.Wa.length)return[];const b=$b(a);a=this.Wa.filter(e=>$b(e.language)==b);if(!a.length)return[];const c=[],d=new Set;for(const e of a)e.segmentIndex||await e.createSegmentIndex(),e.segmentIndex.mb(f=>{const g=f.S()[0],h=f.startTime+"-"+f.endTime+"-"+g;f={id:h,title:g,startTime:f.startTime,endTime:f.endTime};d.has(h)||(c.push(f),d.add(h))});return c}rd(a){a=!!a;this.V!=a&&(this.V=
a,this.m==fq?(this.A.setTextVisibility(a),this.g.streaming.alwaysStreamText||(a?this.l.B||(a=Rf(this.i.textStreams,this.nd,this.vd,this.Yd),a.length>0&&(wm(this.l,a[0]),hr(this),Wq(this))):pm(this.l))):this.h&&this.h.src&&this.h.textTracks&&this.A.setTextVisibility(a),rr(this))}Ui(){let a;if(this.F)a=this.F.m();else{if(this.M==null)return new Date;if(this.M instanceof Date)return this.M;a=this.M}if(this.i&&!this.Ca()){var b=this.i.presentationTimeline;return new Date(((b.m||b.i)+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}oh(){if(this.i&&!this.Ca()){var a=this.i.presentationTimeline;a=a.m||a.i;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}we(){return this.U()?this.i?this.i.presentationTimeline.we():null:null}tc(){if(this.m==fq)return this.G.tc();const a={total:[],audio:[],video:[],text:[]};this.m==
Fq&&(a.total=Zi(this.h.buffered));return a}getBandwidthEstimate(){return this.u?this.u.getBandwidthEstimate():NaN}getStats(){if(this.m!=fq&&this.m!=Fq)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:[]};qq(this);var a=this.h,b=a.currentTime/a.duration;isNaN(b)||this.U()||En(this.B,Math.round(100*b));this.F&&(this.B.P=this.F.D(),this.B.R=this.F.G());a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),Bn(this.B,Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.B.L=Number(b.corruptedVideoFrames));Fn(this.B,this.D?Dh(this.D):NaN);Cn(this.B,
a.videoWidth||NaN,a.videoHeight||NaN);this.B.l="";this.U()&&(a=Kp(this),a!=null&&Gn(this.B,a/1E3));b=this.zb().find(c=>c.active);a=this.cc().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.B.B=d}b.width&&b.height&&Cn(this.B,b.width||NaN,b.height||NaN);b=b.codecs;a&&(b+=","+(a.codecs||a.mimeType));b&&(this.B.l=b)}this.m!=fq||this.Ca()||(this.i&&(this.B.H=this.i.periodCount,this.B.G=this.i.gapCount,this.i.presentationTimeline&&
Hn(this.B,this.i.presentationTimeline.h)),a=this.u.getBandwidthEstimate(),this.B.A=a);this.m==Fq&&In(this.B,NaN);return Jn(this.B)}async wd(a,b,c,d,e,f,g=!1){if(this.m!=fq&&this.m!=Fq)throw new D(1,7,7004);c!="subtitles"&&c!="captions"&&sa("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");d||=await zr(this,a);let h=[];this.C&&(h=this.C.getCuePoints());if(this.m==Fq){e=tb();g&&e.h()==="WEBKIT"&&(c="forced");d=await Ar(this,a,b,c,d,f||"",h);if(d.track)return Yq(this),
hr(this),Nf(d.track);throw new D(1,2,2012);}var k=this.va();k=k.end-k.start;this.i&&(k=this.i.presentationTimeline.getDuration());if(k==Infinity)throw new D(1,4,4033);h.length&&(a=await Br(this,a),d=Cr(this,a,d,h),a=Qj(new Blob([d],{type:"text/vtt"})),d="text/vtt");b={id:this.$d++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:nl(0,k,[a]),mimeType:d||"",codecs:e||"",kind:c,encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:f||null,type:F,
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([Ie(d||"",e||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};c=Ie(b.mimeType,b.codecs);if(!Ye(c))throw new D(2,2,2014,d);this.i.textStreams.push(b);Yq(this);hr(this);return Jf(b)}async le(a,b){if(this.m!=fq&&this.m!=Fq)throw new D(1,7,7004);b||=await zr(this,
a);if(b!="text/vtt")throw new D(1,2,2017,a);var c=this.va(),d=c.end-c.start;this.i&&(d=this.i.presentationTimeline.getDuration());if(d==Infinity)throw new D(1,4,4045);c=await Br(this,a);var e=Xe(b);if(!e)throw new D(2,2,2014,b);e=e();d={periodStart:0,segmentStart:0,segmentEnd:d,vttOffset:0};c=$a(c);e=e.parseMedia(c,d,a,[]);c=[];for(const f of e){let g=null;e=new I(f.startTime,f.endTime,()=>{g==null&&(g=Qb([a],[f.payload]));return g||[]},0,null,null,0,0,Infinity);f.payload.includes("#xywh")&&(d=f.payload.split("#xywh=")[1].split(","),
d.length===4&&e.df({height:parseInt(d[3],10),positionX:parseInt(d[0],10),positionY:parseInt(d[1],10),width:parseInt(d[2],10)}));c.push(e)}c.length&&(b=await zr(this,c[0].S()[0]));b={id:this.$d++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ol(c),mimeType:b||"",codecs:"",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([Ie(b||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};this.m==Fq?this.fe.push(b):this.i.imageStreams.push(b);Yq(this);return Kf(b)}async ke(a,b,c){if(this.m!=fq&&this.m!=Fq)throw new D(1,7,7004);c||=await zr(this,a);var d=this.va();d=d.end-d.start;this.i&&(d=this.i.presentationTimeline.getDuration());if(d==Infinity)throw new D(1,
4,4055);var e=Xe(c);if(!e)throw new D(2,2,2014,c);c=await Br(this,a);e=e();d={periodStart:0,segmentStart:0,segmentEnd:d,vttOffset:0};c=$a(c);d=e.parseMedia(c,d,a,[]);a=[];for(const f of d)d=new I(f.startTime,f.endTime,()=>[f.payload],0,null,null,0,0,Infinity),a.push(d);b={id:this.$d++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ol(a),mimeType:"text/plain",codecs:"",kind:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:b,originalLanguage:b,label:null,type:F,
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([Ie("text/plain","")]),isAudioMuxedInVideo:!1,baseOriginalId:null};this.Wa.push(b);Yq(this);return Jf(b)}dk(a,b){this.ma.width=a;this.ma.height=b}Ag(a=.1){if(this.m==fq){var b=this.l;if(b.l.g)a=!1;else if(b.D)a=!1;else{for(const c of b.h.values())!c.$c||
c.La||c.hb||(c.$c=!1,lm(b,c,a));a=!0}}else a=!1;return a}Zf(){sa("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}Ri(){return this.lc}Ki(){const a={video:null,audio:null,text:null};if(this.m!=fq)return a;var b=this.l.u;const c=this.l.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==F&&(a.text=b)}return a}Kg(a){this.Vd=a}disableStream(a,b){if(!this.g.abr.enabled||this.m===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.be.wa(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 jj(a,b)}Ca(){return this.h&&this.h.remote?this.h.remote.state!="disconnected":!1}isEnded(){return!this.h||this.h.ended?!0:this.Ha&&!this.U()&&this.h.currentTime>=
this.va().end}};x("shaka.Player",P);P.prototype.isEnded=P.prototype.isEnded;P.prototype.isRemotePlayback=P.prototype.Ca;P.prototype.addFont=P.prototype.addFont;P.prototype.setVideoContainer=P.prototype.Kg;P.prototype.getFetchedPlaybackInfo=P.prototype.Ki;P.prototype.getManifestParserFactory=P.prototype.Ri;P.prototype.getManifest=P.prototype.Zf;P.prototype.retryStreaming=P.prototype.Ag;P.prototype.setMaxHardwareResolution=P.prototype.dk;P.prototype.addChaptersTrack=P.prototype.ke;
P.prototype.addThumbnailsTrack=P.prototype.le;P.prototype.addTextTrackAsync=P.prototype.wd;P.prototype.getStats=P.prototype.getStats;P.prototype.getBufferedInfo=P.prototype.tc;P.prototype.getSegmentAvailabilityDuration=P.prototype.we;P.prototype.getPresentationStartTimeAsDate=P.prototype.oh;P.prototype.getPlayheadTimeAsDate=P.prototype.Ui;P.prototype.setTextTrackVisibility=P.prototype.rd;P.prototype.getChaptersAsync=P.prototype.Wf;P.prototype.getChapters=P.prototype.Ai;
P.prototype.getChaptersTracks=P.prototype.Bi;P.prototype.isTextTrackVisible=P.prototype.zc;P.prototype.selectVariantsByLabel=P.prototype.Xj;P.prototype.selectTextLanguage=P.prototype.Eg;P.prototype.selectAudioLanguage=P.prototype.Ih;P.prototype.getTextLanguages=P.prototype.bj;P.prototype.getAudioLanguages=P.prototype.ti;P.prototype.getTextLanguagesAndRoles=P.prototype.cj;P.prototype.getAudioLanguagesAndRoles=P.prototype.wi;P.prototype.getVideoTracks=P.prototype.getVideoTracks;
P.prototype.selectVideoTrack=P.prototype.Kh;P.prototype.getAudioTracks=P.prototype.getAudioTracks;P.prototype.selectAudioTrack=P.prototype.Jh;P.prototype.selectVariantTrack=P.prototype.Pd;P.prototype.selectTextTrack=P.prototype.Ze;P.prototype.getThumbnails=P.prototype.ph;P.prototype.getAllThumbnails=P.prototype.si;P.prototype.getImageTracks=P.prototype.Yf;P.prototype.getTextTracks=P.prototype.cc;P.prototype.getVariantTracks=P.prototype.zb;P.prototype.cancelTrickPlay=P.prototype.Tc;
P.prototype.trickPlay=P.prototype.Zb;P.prototype.useTrickPlayTrackIfAvailable=P.prototype.Rg;P.prototype.getPlaybackRate=P.prototype.Pa;P.prototype.isBuffering=P.prototype.Be;P.prototype.getKeyStatuses=P.prototype.se;P.prototype.getActiveSessionsMetadata=P.prototype.Vf;P.prototype.getExpiration=P.prototype.Cd;P.prototype.drmInfo=P.prototype.drmInfo;P.prototype.keySystem=P.prototype.keySystem;P.prototype.isFullyLoaded=P.prototype.ig;P.prototype.goToLive=P.prototype.lj;P.prototype.seekRange=P.prototype.va;
P.prototype.isVideoOnly=P.prototype.Fe;P.prototype.isAudioOnly=P.prototype.bd;P.prototype.isInProgress=P.prototype.Ic;P.prototype.isLive=P.prototype.U;P.prototype.getQueueManager=P.prototype.ve;P.prototype.getAdManager=P.prototype.re;P.prototype.getAssetUri=P.prototype.Gc;P.prototype.getNetworkingEngine=P.prototype.Eb;P.prototype.getMediaElement=P.prototype.ue;P.prototype.getManifestType=P.prototype.$f;P.prototype.getLoadMode=P.prototype.bc;P.prototype.resetConfiguration=P.prototype.Fh;
P.prototype.getBufferFullness=P.prototype.jh;P.prototype.getNonDefaultConfiguration=P.prototype.nh;P.prototype.getConfigurationForLowLatency=P.prototype.Ei;P.prototype.getConfiguration=P.prototype.getConfiguration;P.prototype.configurationForLowLatency=P.prototype.oi;P.prototype.configure=P.prototype.configure;P.prototype.releaseAllMutexes=P.prototype.Pj;P.prototype.destroyAllPreloads=P.prototype.Df;P.prototype.preload=P.prototype.preload;P.prototype.detachAndSavePreload=P.prototype.gh;
P.prototype.unloadAndSavePreload=P.prototype.Zh;P.prototype.load=P.prototype.load;P.prototype.updateStartTime=P.prototype.lk;P.prototype.unload=P.prototype.$b;P.prototype.detach=P.prototype.detach;P.prototype.attachCanvas=P.prototype.Wg;P.prototype.attach=P.prototype.Db;P.probeSupport=async function(a=!0){let b={};a&&(b=await $g());a=Pc();const c=Oj(),d=await tb().A(),e={manifest:a,media:c,drm:b,hardwareResolution:d};Yp.forEach((f,g)=>{e[g]=f()});return e};P.isBrowserSupported=Zp;
P.setQueueManagerFactory=function(a){Fr=a};P.setAdManagerFactory=function(a){Er=a};P.registerSupportPlugin=Xp;P.prototype.destroy=P.prototype.destroy;var dr=0,Dr=1,fq=2,Fq=3;P.LoadMode={DESTROYED:dr,NOT_LOADED:Dr,MEDIA_SOURCE:fq,SRC_EQUALS:Fq};P.version="v4.16.37";var Gc;const Gr=["4","16"];Gc=new Dc(Number(Gr[0]),Number(Gr[1]));Jc=new Hc;var Yp=new Map,Er=null,Fr=null;function Hr(a){return a.g.length?a.g.reduce((b,c)=>b+c,0)/a.g.length:0}var Ir=class{constructor(){this.g=[];this.i=this.m=this.l=this.j=this.h=0}};var R=class{constructor(a,b,c){this.g=a;this.h=b;this.m=c;this.i=!1;this.j=this.h.getVolume();this.l=new zc;this.l.o(this.h,google.ima.AdEvent.Type.PAUSED,()=>{this.i=!0});this.l.o(this.h,google.ima.AdEvent.Type.RESUMED,()=>{this.i=!1})}needsSkipUI(){return!1}isClientRendering(){return!0}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.m.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.m.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()}getVastAdId(){return""}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}};x("shaka.ads.ClientSideAd",R);R.prototype.release=R.prototype.release;R.prototype.getPodIndex=R.prototype.getPodIndex;R.prototype.getTimeOffset=R.prototype.getTimeOffset;R.prototype.getMediaUrl=R.prototype.getMediaUrl;R.prototype.getAdvertiserName=R.prototype.getAdvertiserName;R.prototype.getCreativeAdId=R.prototype.getCreativeAdId;
R.prototype.getAdId=R.prototype.getAdId;R.prototype.getVastAdId=R.prototype.getVastAdId;R.prototype.getVastMediaWidth=R.prototype.getVastMediaWidth;R.prototype.getVastMediaHeight=R.prototype.getVastMediaHeight;R.prototype.getVastMediaBitrate=R.prototype.getVastMediaBitrate;R.prototype.getDescription=R.prototype.getDescription;R.prototype.getTitle=R.prototype.getTitle;R.prototype.getPositionInSequence=R.prototype.getPositionInSequence;R.prototype.getSequenceLength=R.prototype.getSequenceLength;
R.prototype.setMuted=R.prototype.setMuted;R.prototype.resize=R.prototype.resize;R.prototype.isLinear=R.prototype.isLinear;R.prototype.isMuted=R.prototype.isMuted;R.prototype.setVolume=R.prototype.setVolume;R.prototype.getVolume=R.prototype.getVolume;R.prototype.play=R.prototype.play;R.prototype.pause=R.prototype.pause;R.prototype.skip=R.prototype.skip;R.prototype.canSkipNow=R.prototype.canSkipNow;R.prototype.getTimeUntilSkippable=R.prototype.getTimeUntilSkippable;R.prototype.isSkippable=R.prototype.isSkippable;
R.prototype.isPaused=R.prototype.isPaused;R.prototype.getRemainingTime=R.prototype.getRemainingTime;R.prototype.getMinSuggestedDuration=R.prototype.getMinSuggestedDuration;R.prototype.getDuration=R.prototype.getDuration;R.prototype.isUsingAnotherMediaElement=R.prototype.isUsingAnotherMediaElement;R.prototype.hasCustomClick=R.prototype.hasCustomClick;R.prototype.isClientRendering=R.prototype.isClientRendering;R.prototype.needsSkipUI=R.prototype.needsSkipUI;function Jr(a,b){const c=[];for(const l of zd(a,"Ad")){a=Fd(l,"InLine");if(!a)continue;if(a=Fd(a,"Creatives"))for(const m of zd(a,"Creative"))if((a=Fd(m,"Linear"))&&Kr(c,b,a),a=Fd(m,"NonLinearAds")){a=zd(a,"NonLinear");for(const n of a)a:{a=c;var d=b;let p;var e=Fd(n,"StaticResource");if(e)p=e.attributes.creativeType;else{e=Fd(n,"HTMLResource");if(!e)break a;p="text/html"}let r=Bd(e);if(r){p==="text/html"&&(r="data:text/html;charset=UTF-8,"+encodeURIComponent(r));e=Id(n,"width",Od)||Id(n,"expandedWidth",
Od);var f=Id(n,"height",Od)||Id(n,"expandedHeight",Od);if(e||f){var g=null,h=Fd(n,"NonLinearClickThrough");h&&(h=Bd(h))&&(g=h);h=null;var k=n.attributes.minSuggestedDuration;k&&(h=gd(k));k=0;d!=null&&(k=d);a.push({id:null,groupId:null,startTime:k,endTime:null,uri:r,mimeType:p,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:h,once:!0,pre:d==null,post:d==Infinity,timelineRange:!1,loop:!1,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:e||0,y:f||0}},displayOnBackground:!1,
currentVideo:null,background:null,clickThroughUrl:g})}}}}}return c}
function Kr(a,b,c){let d=0;b!=null&&(d=b);let e=null;c.attributes.skipoffset&&(e=gd(c.attributes.skipoffset),isNaN(e)&&(e=null));var f=Fd(c,"MediaFiles");if(f){var g=null;(c=Fd(c,"VideoClicks"))&&(c=Fd(c,"ClickThrough"))&&(c=Bd(c))&&(g=c);f=c=zd(f,"MediaFile");c=c.filter(h=>h.attributes.delivery=="streaming");c.length&&(f=c);f=f.sort((h,k)=>(parseInt(k.attributes.height,10)||0)-(parseInt(h.attributes.height,10)||0));for(const h of f){if(h.attributes.apiFramework)continue;if(f=Bd(h)){a.push({id:null,
groupId:null,startTime:d,endTime:null,uri:f,mimeType:h.attributes.type||null,isSkippable:e!=null,skipOffset:e,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:g});break}}}}
function Lr(a){const b=[];for(const d of zd(a,"vmap:AdBreak")){var c=d.attributes.timeOffset;if(!c)continue;a=null;c=="start"?a=null:c=="end"?a=Infinity:a=gd(c);c=Fd(d,"vmap:AdSource");if(!c)continue;c=Fd(c,"vmap:AdTagURI");if(!c)continue;(c=Ad(c))&&b.push({time:a,uri:c})}return b}var Mr=class{};x("shaka.ads.Utils",Mr);Mr.ADS_LOADED="ads-loaded";Mr.AD_STARTED="ad-started";Mr.AD_FIRST_QUARTILE="ad-first-quartile";Mr.AD_MIDPOINT="ad-midpoint";Mr.AD_THIRD_QUARTILE="ad-third-quartile";
Mr.AD_COMPLETE="ad-complete";Mr.AD_STOPPED="ad-stopped";Mr.AD_SKIPPED="ad-skipped";Mr.AD_VOLUME_CHANGED="ad-volume-changed";Mr.AD_MUTED="ad-muted";Mr.AD_PAUSED="ad-paused";Mr.AD_RESUMED="ad-resumed";Mr.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";Mr.CUEPOINTS_CHANGED="ad-cue-points-changed";Mr.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";Mr.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";Mr.AD_CLICKED="ad-clicked";Mr.AD_PROGRESS="ad-progress";Mr.AD_BUFFERING="ad-buffering";
Mr.AD_IMPRESSION="ad-impression";Mr.AD_DURATION_CHANGED="ad-duration-changed";Mr.AD_CLOSED="ad-closed";Mr.AD_LOADED="ad-loaded";Mr.ALL_ADS_COMPLETED="all-ads-completed";Mr.AD_LINEAR_CHANGED="ad-linear-changed";Mr.AD_METADATA="ad-metadata";Mr.AD_RECOVERABLE_ERROR="ad-recoverable-error";Mr.AD_ERROR="ad-error";Mr.AD_BREAK_READY="ad-break-ready";Mr.AD_INTERACTION="ad-interaction";Mr.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";Mr.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";
Mr.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function Nr(a,b){a.l(new C("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.G)));if(a.u.customPlayheadTracker){const c={currentTime:a.i.currentTime};a.g=b.getAdsManager(c,a.C);a.i.muted?a.g.setVolume(0):a.g.setVolume(a.i.volume);a.h.o(a.i,"timeupdate",()=>{a.i.duration&&(c.currentTime=a.i.currentTime)});a.h.o(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.C);a.l(new C("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 C("ad-cue-points-changed",(new Map).set("cuepoints",c)))}Or(a);try{a.g.init(a.i.offsetWidth,a.i.offsetHeight),a.h.o(a.i,"loadeddata",()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),"ResizeObserver"in window?(a.B=new ResizeObserver(()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),a.B.observe(a.i)):a.h.o(document,"fullscreenchange",()=>{a.g.resize(a.i.offsetWidth,a.i.offsetHeight)}),a.F||a.u.skipPlayDetection?
a.g.start():a.h.sa(a.i,"play",()=>{a.F=!0;a.g.start()})}catch(c){Pr(a,null)}}function Qr(a,b){b.getError();b=(new Map).set("originalEvent",b);a.l(new C("ad-error",b));Pr(a,null);a.l(new C("ad-cue-points-changed",(new Map).set("cuepoints",[])))}
function Pr(a,b){b&&b.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!a.u.supportsMultipleMediaElements&&a.l(new C("ad-content-resume-requested"));a.l(new C("ad-stopped",(new Map).set("originalEvent",b)));a.j&&a.j.isLinear()&&(a.A.removeAttribute("ad-active"),a.u.customPlayheadTracker||a.i.ended||a.i.play())}
function Or(a){const b=(c,d)=>{c=(new Map).set("originalEvent",c);a.l(new C(d,c))};a.h.o(a.g,google.ima.AdErrorEvent.Type.AD_ERROR,c=>{Qr(a,c)});a.h.o(a.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,c=>{Rr(a,c)});a.h.o(a.g,google.ima.AdEvent.Type.STARTED,c=>{Rr(a,c)});a.h.o(a.g,google.ima.AdEvent.Type.FIRST_QUARTILE,c=>{b(c,"ad-first-quartile")});a.h.o(a.g,google.ima.AdEvent.Type.MIDPOINT,c=>{b(c,"ad-midpoint")});a.h.o(a.g,google.ima.AdEvent.Type.THIRD_QUARTILE,c=>{b(c,"ad-third-quartile")});
a.h.o(a.g,google.ima.AdEvent.Type.COMPLETE,c=>{b(c,"ad-complete")});a.h.o(a.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,c=>{Pr(a,c)});a.h.o(a.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,c=>{b(c,"all-ads-completed");Pr(a,c)});a.h.o(a.g,google.ima.AdEvent.Type.SKIPPED,c=>{b(c,"ad-skipped")});a.h.o(a.g,google.ima.AdEvent.Type.VOLUME_CHANGED,c=>{b(c,"ad-volume-changed")});a.h.o(a.g,google.ima.AdEvent.Type.VOLUME_MUTED,c=>{b(c,"ad-muted")});a.h.o(a.g,google.ima.AdEvent.Type.PAUSED,c=>{a.j&&(a.j.i=
!0,b(c,"ad-paused"))});a.h.o(a.g,google.ima.AdEvent.Type.RESUMED,c=>{a.j&&(a.j.i=!1,b(c,"ad-resumed"))});a.h.o(a.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,c=>{a.j&&b(c,"ad-skip-state-changed")});a.h.o(a.g,google.ima.AdEvent.Type.CLICK,c=>{b(c,"ad-clicked")});a.h.o(a.g,google.ima.AdEvent.Type.AD_PROGRESS,c=>{b(c,"ad-progress")});a.h.o(a.g,google.ima.AdEvent.Type.AD_BUFFERING,c=>{b(c,"ad-buffering")});a.h.o(a.g,google.ima.AdEvent.Type.IMPRESSION,c=>{b(c,"ad-impression")});a.h.o(a.g,google.ima.AdEvent.Type.DURATION_CHANGE,
c=>{b(c,"ad-duration-changed")});a.h.o(a.g,google.ima.AdEvent.Type.USER_CLOSE,c=>{b(c,"ad-closed")});a.h.o(a.g,google.ima.AdEvent.Type.LOADED,c=>{b(c,"ad-loaded")});a.h.o(a.g,google.ima.AdEvent.Type.LINEAR_CHANGED,c=>{b(c,"ad-linear-changed")});a.h.o(a.g,google.ima.AdEvent.Type.AD_METADATA,c=>{b(c,"ad-metadata")});a.h.o(a.g,google.ima.AdEvent.Type.LOG,c=>{b(c,"ad-recoverable-error")});a.h.o(a.g,google.ima.AdEvent.Type.AD_BREAK_READY,c=>{b(c,"ad-break-ready")});a.h.o(a.g,google.ima.AdEvent.Type.INTERACTION,
c=>{b(c,"ad-interaction")})}
function Rr(a,b){const c=b.getAd();c?(a.j=new R(c,a.g,a.i),b.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||a.u.supportsMultipleMediaElements||a.l(new C("ad-content-pause-requested")),b=(new Map).set("ad",a.j).set("sdkAdObject",c).set("originalEvent",b),a.l(new C("ad-started",b)),a.j.isLinear()&&(a.A.setAttribute("ad-active","true"),a.u.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))):sa("The IMA SDK fired a "+b.type+" event with no associated ad. Unable to play ad!")}
var Sr=class{constructor(a,b,c,d,e){this.A=a;this.i=b;this.F=!1;this.B=this.u=null;this.G=NaN;this.l=e;this.j=null;this.h=new zc;google.ima.settings.setLocale(c);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0);this.D=new google.ima.AdDisplayContainer(this.A,this.i);this.D.initialize();this.m=new google.ima.AdsLoader(this.D);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.16.37");this.g=null;this.C=d||new google.ima.AdsRenderingSettings;this.h.o(this.m,
google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,f=>{Nr(this,f)});this.h.o(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,f=>{Qr(this,f)});this.h.o(this.i,"ended",()=>{this.m.contentComplete()});this.h.sa(this.i,"play",()=>{this.F=!0})}configure(a){this.u=a}stop(){this.g&&this.g.stop();this.A&&fj(this.A)}release(){this.stop();this.B&&this.B.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy();this.D.destroy()}};var S=class{constructor(a,b,c,d,e,f){this.g=a;this.h=b;this.j=(this.i=b.isSkippable)?b.skipOffset||0:b.skipOffset;this.l=b.skipFor;this.B=c;this.u=d;this.m=e;this.A=f;this.C=b.overlay}needsSkipUI(){return!0}isClientRendering(){return!0}hasCustomClick(){return this.h.clickThroughUrl!=null}isUsingAnotherMediaElement(){return this.A}getDuration(){const a=this.g.duration;return isNaN(a)?-1:a}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){const a=this.g.duration;return isNaN(a)?
-1:a-this.g.currentTime}isPaused(){return this.g.paused}isSkippable(){return this.i&&this.l!=null?this.getDuration()-this.getRemainingTime()<this.j+this.l:this.i}getTimeUntilSkippable(){if(this.isSkippable()){const a=this.getRemainingTime()+this.j-this.getDuration();return Math.max(a,0)}return Math.max(this.getRemainingTime(),0)}canSkipNow(){return this.i&&this.getTimeUntilSkippable()==0}skip(){this.canSkipNow()&&this.B()}pause(){return this.g.pause()}play(){return this.g.play()}getVolume(){return this.g.volume}setVolume(a){this.g.volume=
a}isMuted(){return this.g.muted}isLinear(){return this.C==null}resize(){}setMuted(a){this.g.muted=a}getSequenceLength(){return this.u}getPositionInSequence(){return this.m}getTitle(){return""}getDescription(){return""}getVastMediaBitrate(){return 0}getVastMediaHeight(){return 0}getVastMediaWidth(){return 0}getVastAdId(){return""}getAdId(){return this.h.id||""}getCreativeAdId(){return""}getAdvertiserName(){return""}getMediaUrl(){return this.h.uri}getTimeOffset(){return this.h.pre?0:this.h.post?-1:
this.h.startTime}getPodIndex(){return 0}release(){this.g=null}};x("shaka.ads.InterstitialAd",S);S.prototype.release=S.prototype.release;S.prototype.getPodIndex=S.prototype.getPodIndex;S.prototype.getTimeOffset=S.prototype.getTimeOffset;S.prototype.getMediaUrl=S.prototype.getMediaUrl;S.prototype.getAdvertiserName=S.prototype.getAdvertiserName;S.prototype.getCreativeAdId=S.prototype.getCreativeAdId;S.prototype.getAdId=S.prototype.getAdId;S.prototype.getVastAdId=S.prototype.getVastAdId;
S.prototype.getVastMediaWidth=S.prototype.getVastMediaWidth;S.prototype.getVastMediaHeight=S.prototype.getVastMediaHeight;S.prototype.getVastMediaBitrate=S.prototype.getVastMediaBitrate;S.prototype.getDescription=S.prototype.getDescription;S.prototype.getTitle=S.prototype.getTitle;S.prototype.getPositionInSequence=S.prototype.getPositionInSequence;S.prototype.getSequenceLength=S.prototype.getSequenceLength;S.prototype.setMuted=S.prototype.setMuted;S.prototype.resize=S.prototype.resize;
S.prototype.isLinear=S.prototype.isLinear;S.prototype.isMuted=S.prototype.isMuted;S.prototype.setVolume=S.prototype.setVolume;S.prototype.getVolume=S.prototype.getVolume;S.prototype.play=S.prototype.play;S.prototype.pause=S.prototype.pause;S.prototype.skip=S.prototype.skip;S.prototype.canSkipNow=S.prototype.canSkipNow;S.prototype.getTimeUntilSkippable=S.prototype.getTimeUntilSkippable;S.prototype.isSkippable=S.prototype.isSkippable;S.prototype.isPaused=S.prototype.isPaused;
S.prototype.getRemainingTime=S.prototype.getRemainingTime;S.prototype.getMinSuggestedDuration=S.prototype.getMinSuggestedDuration;S.prototype.getDuration=S.prototype.getDuration;S.prototype.isUsingAnotherMediaElement=S.prototype.isUsingAnotherMediaElement;S.prototype.hasCustomClick=S.prototype.hasCustomClick;S.prototype.isClientRendering=S.prototype.isClientRendering;S.prototype.needsSkipUI=S.prototype.needsSkipUI;var T=class{constructor(a,b,c){this.g=a;this.j=b;this.h=c;this.i=a.overlay==null}needsSkipUI(){return!0}isClientRendering(){return!0}hasCustomClick(){return this.g.clickThroughUrl!=null}isUsingAnotherMediaElement(){return!1}getDuration(){return-1}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){return-1}isPaused(){return!1}isSkippable(){return!1}getTimeUntilSkippable(){return 0}canSkipNow(){return!1}skip(){}pause(){}play(){}getVolume(){return 1}setVolume(){}isMuted(){return!1}isLinear(){return this.i}resize(){}setMuted(){}getSequenceLength(){return this.j}getPositionInSequence(){return this.h}getTitle(){return""}getDescription(){return""}getVastMediaBitrate(){return 0}getVastMediaHeight(){return 0}getVastMediaWidth(){return 0}getVastAdId(){return""}getAdId(){return this.g.id||
""}getCreativeAdId(){return""}getAdvertiserName(){return""}getMediaUrl(){return this.g.uri}getTimeOffset(){return this.g.pre?0:this.g.post?-1:this.g.startTime}getPodIndex(){return 0}release(){}};x("shaka.ads.InterstitialStaticAd",T);T.prototype.release=T.prototype.release;T.prototype.getPodIndex=T.prototype.getPodIndex;T.prototype.getTimeOffset=T.prototype.getTimeOffset;T.prototype.getMediaUrl=T.prototype.getMediaUrl;T.prototype.getAdvertiserName=T.prototype.getAdvertiserName;
T.prototype.getCreativeAdId=T.prototype.getCreativeAdId;T.prototype.getAdId=T.prototype.getAdId;T.prototype.getVastAdId=T.prototype.getVastAdId;T.prototype.getVastMediaWidth=T.prototype.getVastMediaWidth;T.prototype.getVastMediaHeight=T.prototype.getVastMediaHeight;T.prototype.getVastMediaBitrate=T.prototype.getVastMediaBitrate;T.prototype.getDescription=T.prototype.getDescription;T.prototype.getTitle=T.prototype.getTitle;T.prototype.getPositionInSequence=T.prototype.getPositionInSequence;
T.prototype.getSequenceLength=T.prototype.getSequenceLength;T.prototype.setMuted=T.prototype.setMuted;T.prototype.resize=T.prototype.resize;T.prototype.isLinear=T.prototype.isLinear;T.prototype.isMuted=T.prototype.isMuted;T.prototype.setVolume=T.prototype.setVolume;T.prototype.getVolume=T.prototype.getVolume;T.prototype.play=T.prototype.play;T.prototype.pause=T.prototype.pause;T.prototype.skip=T.prototype.skip;T.prototype.canSkipNow=T.prototype.canSkipNow;T.prototype.getTimeUntilSkippable=T.prototype.getTimeUntilSkippable;
T.prototype.isSkippable=T.prototype.isSkippable;T.prototype.isPaused=T.prototype.isPaused;T.prototype.getRemainingTime=T.prototype.getRemainingTime;T.prototype.getMinSuggestedDuration=T.prototype.getMinSuggestedDuration;T.prototype.getDuration=T.prototype.getDuration;T.prototype.isUsingAnotherMediaElement=T.prototype.isUsingAnotherMediaElement;T.prototype.hasCustomClick=T.prototype.hasCustomClick;T.prototype.isClientRendering=T.prototype.isClientRendering;T.prototype.needsSkipUI=T.prototype.needsSkipUI;function Tr(a){a.i.configure(a.C.nh());a.i.configure("ads.disableHLSInterstitial",!0);a.i.configure("ads.disableDASHInterstitial",!0);a.i.configure("playRangeEnd",Infinity);ug(a.C.Eb(),a.i.Eb())}
function Ur(a,b=!1,c=null){let d=0,e=null;if(a.G.size&&a.l!=null){const h=a.g.ended;var f=Array.from(a.G).sort((k,l)=>l.startTime-k.startTime),g=f;g=b?f.filter(k=>k.pre):h?f.filter(k=>k.post):f.filter(k=>!k.pre&&!k.post);for(const k of g){f=!1;if(b)f=k.pre;else if(h)f=k.post;else if(!k.pre&&!k.post){g=a.l-Math.round(k.startTime*1E3)/1E3;let l=1;a.K.allowStartInMiddleOfInterstitial&&k.endTime&&k.endTime!=Infinity&&(l=k.endTime-k.startTime);(g>0||g==0&&a.l==0)&&(g<=l||!k.canJump)&&(f=c==null&&a.B&&
!a.B.pre&&!a.B.post&&a.B.startTime>=k.startTime?!1:!0)}f&&(!a.B||k.startTime>=a.B.startTime)&&(d==(c||0)?e=k:e&&!k.canJump&&Math.round(k.startTime*1E3)/1E3-Math.round(e.startTime*1E3)/1E3>.001&&(e=k,d=0),d++)}}return e}
function Vr(a,b,c,d,e,f=0){a.B=b;Wr(a);a.A||!a.m||a.h.parentElement||a.m.appendChild(a.h);d==1&&c==1&&(c=Array.from(a.G).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.G.delete(b),Xr(a),b.overlay||Yr(a));b.mimeType&&(b.mimeType.startsWith("image/")||b.mimeType==="text/html")?b.overlay?Zr(a,b,c,d,f):sa("Unsupported interstitial",b):a.A&&b.overlay?sa("Unsupported interstitial",b):$r(a,b,c,d,e,f)}
function as(a,b){if(a.J.has(b)){var c=a.J.get(b);for(const d of c)d.parentNode.removeChild(d);a.J.delete(b)}}function Xr(a){a.W&&!a.G.size&&(a.H.Ea(a.g,"playing",a.R),a.H.Ea(a.g,"timeupdate",a.R),a.H.Ea(a.g,"seeked",a.$),a.H.Ea(a.g,"ended",a.T),a.M!=-1&&(a.g.cancelVideoFrameCallback(a.M),a.M=-1),a.O&&a.O.stop(),a.L&&a.L.stop(),a.W=!1)}function bs(a){return(a=a.mimeType)?!a.startsWith("image/")&&a!=="text/html":!0}
function cs(a,b){if(!(a.J.has(b)||a.K&&!a.K.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.J.set(b,d)}}
function Yr(a){const b=[];for(const c of a.G){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)}ds(a,"ad-cue-points-changed",(new Map).set("cuepoints",b))}
function Wr(a){if(a.m&&a.K){var b=a.K.supportsMultipleMediaElements,c=a.g;c.controls?b=!1:c.webkitPresentationMode&&c.webkitPresentationMode!=="inline"?b=!1:c.webkitDisplayingFullscreen&&(b=!1);a.A==b&&(a.A=!b,a.A?(a.h=a.g,a.F&&(a.F.parentElement&&a.m.removeChild(a.F),a.F=null)):(a.F||(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.F=
b),a.h=a.F))}else a.A=!0}function es(){const a=tb().i();return a=="TV"||a=="CONSOLE"||a=="CAST"?!0:!1}function fs(a){if(!a.W&&a.G.size){a.H.o(a.g,"playing",a.R);a.H.o(a.g,"timeupdate",a.R);a.H.o(a.g,"seeked",a.$);a.H.o(a.g,"ended",a.T);if("requestVideoFrameCallback"in a.g&&!es()){const b=a.g,c=()=>{a.M!=-1&&(a.T(),a.M!=-1&&(a.M=b.requestVideoFrameCallback(c)))};a.M=b.requestVideoFrameCallback(c)}else a.O.wa(.025);a.L&&a.L.wa(1);a.W=!0}}
function gs(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.m&&(a.m.removeAttribute("ad-active"),a.m.style.pointerEvents="",!b||b.background)&&(a.m.style.background="");a.F&&(a.F.style.background="")}
function hs(a){const b=[];if(!a)return b;var c=a.values.find(u=>u.key=="X-ASSET-URI");if(!c)return b;c=c.data;if(!c)return b;let d=null;var e=a.values.find(u=>u.key=="X-OVERLAY-ID");e&&(d=e.data);e=d==null?Math.floor(a.startTime*10)/10:a.startTime;let f=a.endTime;a.endTime&&a.endTime!=Infinity&&typeof a.endTime=="number"&&(f=d==null?Math.floor(a.endTime*10)/10:a.endTime);let g=!1,h=!1;var k=!1,l=a.values.find(u=>u.key=="CUE");l&&(k=l.data,g=k.includes("ONCE"),h=k.includes("PRE"),k=k.includes("POST"));
l=null;var m=a.values.find(u=>u.key=="X-ASSET-MIMETYPE");m&&(l=m.data);m=!1;var n=a.values.find(u=>u.key=="X-LOOP");n&&(m=n.data=="YES");n=1;var p=a.values.find(u=>u.key=="X-DEPTH");p&&(n=parseFloat(p.data),isNaN(n)&&(n=1));p=null;var r=a.values.find(u=>u.key=="X-BACKGROUND");r&&(p=r.data);r=1920;var q=1080,t=a.values.find(u=>u.key=="X-VIEWPORT");if(t){q=t.data.split("x");if(q.length!=2)return b;r=parseFloat(q[0]);q=parseFloat(q[1])}r={viewport:{x:r,y:q},topLeft:{x:0,y:0},size:{x:r,y:q}};if(q=a.values.find(u=>
u.key=="X-OVERLAY-POSITION")){q=q.data.split("x");if(q.length!=2)return b;r.topLeft.x=parseFloat(q[0]);r.topLeft.y=parseFloat(q[1])}if(q=a.values.find(u=>u.key=="X-OVERLAY-SIZE")){q=q.data.split("x");if(q.length!=2)return b;r.size.x=parseFloat(q[0]);r.size.y=parseFloat(q[1])}q=null;if(t=a.values.find(u=>u.key=="X-SQUEEZECURRENT"))if(q=parseFloat(t.data),isNaN(q)&&(q=1),q={viewport:{x:1920,y:1080},topLeft:{x:0,y:0},size:{x:1920*q,y:1080*q}},a=a.values.find(u=>u.key=="X-SQUEEZECURRENT-POSITION")){a=
a.data.split("x");if(a.length!=2)return b;q.topLeft.x=parseFloat(a[0]);q.topLeft.y=parseFloat(a[1])}b.push({id:d,groupId:null,startTime:e,endTime:f,uri:c,mimeType:l,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:g,pre:h,post:k,timelineRange:!0,loop:m,overlay:r,displayOnBackground:n==-1,currentVideo:q,background:p,clickThroughUrl:null});return b}
async function is(a,b){const c=[];if(!b)return c;var d=b.values.find(z=>z.key=="X-ASSET-URI");const e=b.values.find(z=>z.key=="X-ASSET-LIST");if(!d&&!e)return c;let f=null;var g=b.values.find(z=>z.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(z=>z.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(z=>z.key=="X-ENABLE-SKIP-AFTER");n&&(k=parseFloat(n.data),isNaN(k)&&(k=l?0:null));n=null;var p=b.values.find(z=>z.key=="X-ENABLE-SKIP-FOR");p&&(n=parseFloat(p.data),isNaN(k)&&(n=null));p=null;const r=b.values.find(z=>z.key=="X-RESUME-OFFSET");r&&(p=parseFloat(r.data),isNaN(p)&&(p=null));let q=null;var t=b.values.find(z=>z.key=="X-PLAYOUT-LIMIT");t&&(q=parseFloat(t.data),isNaN(q)&&(q=null));let u=t=!1;var v=!1,y=b.values.find(z=>z.key=="CUE");y&&
(v=y.data,t=v.includes("ONCE"),u=v.includes("PRE"),v=v.includes("POST"));y=!1;(b=b.values.find(z=>z.key=="X-TIMELINE-OCCUPIES"))?y=b.data.includes("RANGE"):!r&&a.C.U()&&(y=!u&&!v);if(d){var w=d.data;if(!w)return c;c.push({id:f,groupId:null,startTime:g,endTime:h,uri:w,mimeType:null,isSkippable:l,skipOffset:k,skipFor:n,canJump:m,resumeOffset:p,playoutLimit:q,once:t,pre:u,post:v,timelineRange:y,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null})}else if(e){d=
e.data;if(!d)return c;try{const z=await js(a,d,{type:11}),A=xb(z);w=JSON.parse(A);const B=w["SKIP-CONTROL"];if(B){const E=B["ENABLE-SKIP-AFTER"];typeof E=="number"&&(k=parseFloat(E),isNaN(E)&&(k=l?0:null));const G=B["ENABLE-SKIP-FOR"];typeof G=="number"&&(n=parseFloat(G),isNaN(G)&&(n=null))}for(a=0;a<w.ASSETS.length;a++){const E=w.ASSETS[a];E.URI&&c.push({id:f+"_shaka_asset_"+a,groupId:f,startTime:g,endTime:h,uri:E.URI,mimeType:null,isSkippable:l,skipOffset:k,skipFor:n,canJump:m,resumeOffset:p,playoutLimit:q,
once:t,pre:u,post:v,timelineRange:y,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null})}}catch(z){}}return c}
async function ks(a,b){let c=!1;for(const d of b){if(!d.uri){sa("Missing URL in interstitial",d);continue}if(!d.mimeType)try{d.mimeType=await Xl(d.uri,a.i.Eb(),a.C.getConfiguration().streaming.retryParameters)}catch(e){}b=d.id||JSON.stringify(d);if(a.P.has(b))continue;d.loop&&!d.overlay&&sa("Loop is only supported in overlay interstitials",d);d.overlay||(c=!0);a.P.add(b);a.G.add(d);b=!1;if(d.pre&&a.l==null)b=!0;else if(d.startTime==0&&!d.canJump)b=!0;else if(a.l!=null){const e=d.startTime-a.l;e>0&&
e<=10&&(b=!0)}b&&(!a.D.has(d)&&bs(d)&&a.D.set(d,a.i.preload(d.uri,null,d.mimeType||void 0)),cs(a,d))}c&&Yr(a);fs(a)}async function ls(a,b){var c=null;const d=b.values.find(e=>e.key=="ID");d&&(c=d.data);if(c){if(a.X.has(c))return;a.X.add(c)}Tr(a);c=[];c=b&&b.values.find(e=>e.key=="X-OVERLAY-ID")?hs(b):await is(a,b);c.length?ks(a,c):sa("Unsupported HLS interstitial",b)}
function ms(a,b){var c=Fd(b.eventNode,"OverlayEvent");const d=c.attributes.uri,e=c.attributes.mimeType,f=c.attributes.loop=="true",g=Id(c,"z",Od);if(d&&g!=0){var h=null,k=Fd(c,"Background");if(k){var l=k.attributes.uri;l?h=`center / contain no-repeat url('${l}')`:h=Bd(k)}k=1920;l=1080;var m=Fd(c,"Viewport");if(m){k=Id(m,"x",Od);if(k==null)return;l=Id(m,"y",Od);if(l==null)return}var n={viewport:{x:k,y:l},topLeft:{x:0,y:0},size:{x:k,y:l}},p=Fd(c,"Overlay");if(m&&p){var r=Fd(p,"TopLeft"),q=Fd(p,"Size");
if(r&&q){p=Id(r,"x",Od);if(p==null)return;r=Id(r,"y",Od);if(r==null)return;const t=Id(q,"x",Od);if(t==null)return;q=Id(q,"y",Od);if(q==null)return;n.topLeft.x=p;n.topLeft.y=r;n.size.x=t;n.size.y=q}}p=null;c=Fd(c,"Squeeze");if(m&&c&&(q=Fd(c,"TopLeft"),c=Fd(c,"Size"),q&&c)){m=Id(q,"x",Od);if(m==null)return;p=Id(q,"y",Od);if(p==null)return;q=Id(c,"x",Od);if(q==null)return;c=Id(c,"y",Od);if(c==null)return;p={viewport:{x:k,y:l},topLeft:{x:m,y:p},size:{x:q,y:c}}}ks(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}])}}async function js(a,b,c){return(await a.C.Eb().request(7,tg([b],cg()),c).promise).data}
function Zr(a,b,c,d,e){a.I=!0;var f=b.overlay;const g=b.mimeType=="text/html"?"iframe":"img",h=document.createElement(g);h.style.objectFit="contain";h.style.position="absolute";h.style.border="none";ns(a,b);const k=()=>{a.u&&(a.u.stop(),a.u=null);a.m.removeChild(h);gs(a,b);ds(a,"ad-stopped");a.j.Na();const p=Ur(a,b.pre,d-e);p?Vr(a,p,c,++d,Date.now(),e):a.I=!1};var l=new T(b,c,d);ds(a,"ad-impression");ds(a,"ad-started",(new Map).set("ad",l));g=="iframe"?h.src=b.uri:(h.src=b.uri,h.onerror=p=>{ds(a,
"ad-error",(new Map).set("originalEvent",p));k()});l=f.viewport;const m=f.topLeft;f=f.size;l.x==0&&l.y==0?(h.width=b.overlay.size.x,h.height=b.overlay.size.y,h.style.bottom="10%",h.style.left="0",h.style.right="0",h.style.width="100%",b.overlay.size.y||g!="iframe"||(h.style.height="auto")):(h.style.height=f.y/l.y*100+"%",h.style.left=m.x/l.x*100+"%",h.style.top=m.y/l.y*100+"%",h.style.width=f.x/l.x*100+"%");a.m.appendChild(h);const n=Date.now();a.u&&a.u.stop();a.u=new H(()=>{b.playoutLimit&&(Date.now()-
n)/1E3>b.playoutLimit?(ds(a,"ad-complete"),k()):b.endTime&&a.g.currentTime>b.endTime?(ds(a,"ad-complete"),k()):a.g.currentTime<b.startTime&&(ds(a,"ad-skipped"),k())});b.playoutLimit&&!b.endTime?a.u.Z(b.playoutLimit):b.endTime&&a.u.wa(.025);a.j.o(a.g,"seeked",()=>{const p=a.g.currentTime;if(p<b.startTime||b.endTime&&p>b.endTime)a.u&&a.u.stop(),ds(a,"ad-skipped"),k()});b.clickThroughUrl&&a.j.o(h,"click",()=>{b.clickThroughUrl&&window.open(b.clickThroughUrl,"_blank")})}
async function $r(a,b,c,d,e,f){var g=Date.now();a.I=!0;let h=!1;const k=()=>{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 t=Date.now();a.g.currentTime+=(t-e)/1E3;e=t}},l=async t=>{k();let u=Ur(a,b.pre,d-f);if(t&&b.groupId)for(;u&&u.groupId==b.groupId;)d++,u=Ur(a,b.pre,d-f);a.u&&(!b.groupId||u&&u.groupId!=b.groupId)&&(a.u.stop(),a.u=null);gs(a,b);if(!u||u.overlay)b.post&&(a.l=null,a.B=
null),a.A?await a.i.detach():await a.i.$b(),a.A&&(t=b.resumeOffset,t==null&&(t=b.timelineRange&&b.endTime&&b.endTime!=Infinity?b.endTime-(a.l||0):(Date.now()-e)/1E3),ds(a,"ad-content-resume-requested",(new Map).set("offset",t))),ds(a,"ad-stopped"),a.j.Na(),a.I=!1,a.A?Yr(a):(a.h.style.display="none",k(),a.g.ended||a.g.play());Wr(a);u&&(ds(a,"ad-stopped"),a.j.Na(),Vr(a,u,c,++d,e,f))},m=async t=>{h||(h=!0,ds(a,"ad-error",(new Map).set("originalEvent",t)),await l(!1))},n=async()=>{h||(h=!0,await l(!1),
ds(a,"ad-complete"))};a.V=async()=>{h||(h=!0,ds(a,"ad-skipped"),await l(!0))};const p=new S(a.h,b,a.V,c,d,!a.A);a.A||(p.setMuted(a.g.muted),p.setVolume(a.g.volume));ds(a,"ad-started",(new Map).set("ad",p));let r=p.canSkipNow();r&&ds(a,"ad-skip-state-changed");a.j.sa(a.i,"error",m);a.j.o(a.h,"timeupdate",()=>{if(a.h.duration){var t=p.canSkipNow();r!=t&&p.getRemainingTime()>0&&p.getDuration()>0&&ds(a,"ad-skip-state-changed");r=t;!a.A&&!b.overlay&&b.resumeOffset==null&&b.timelineRange&&b.endTime&&b.endTime!=
Infinity&&a.g.currentTime!=b.endTime&&a.C.va().end>=b.endTime&&(a.g.currentTime=b.endTime)}});a.j.sa(a.i,"firstquartile",()=>{k();ds(a,"ad-first-quartile")});a.j.sa(a.i,"midpoint",()=>{k();ds(a,"ad-midpoint")});a.j.sa(a.i,"thirdquartile",()=>{k();ds(a,"ad-third-quartile")});a.j.sa(a.i,"complete",n);a.j.o(a.h,"play",()=>{ds(a,"ad-resumed")});a.j.o(a.h,"pause",()=>{const t=a.i.getConfiguration();a.h.currentTime>=t.playRangeEnd?n():ds(a,"ad-paused")});a.j.o(a.h,"volumechange",()=>{a.h.muted?ds(a,"ad-muted"):
ds(a,"ad-volume-changed");a.A||(a.g.volume=a.h.volume,a.g.muted=a.h.muted)});b.clickThroughUrl&&a.j.o(a.m||a.h,"click",()=>{b.clickThroughUrl&&(p.isPaused()||p.pause(),window.open(b.clickThroughUrl,"_blank"))});if(a.A&&d==1){ds(a,"ad-content-pause-requested",(new Map).set("saveLivePosition",!0));const t=new gg,u=async v=>{v.state=="detach"&&(es()&&await new Promise(y=>(new H(y)).Z(.1)),t.resolve(),a.j.Ea(a.C,"onstatechange",u))};a.j.o(a.C,"onstatechange",u);await t}ns(a,b);if(!a.A)if(a.h.style.display=
"",b.overlay){a.h.loop=b.loop;var q=b.overlay.viewport;const t=b.overlay.topLeft,u=b.overlay.size;a.h.style.height=u.y/q.y*100+"%";a.h.style.left=t.x/q.x*100+"%";a.h.style.top=t.y/q.y*100+"%";a.h.style.width=u.x/q.x*100+"%"}else a.g.pause(),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{Tr(a);if(b.startTime&&b.endTime&&b.endTime!=Infinity&&b.startTime!=b.endTime){const t=
b.endTime-b.startTime;t>0&&a.i.configure("playRangeEnd",t)}b.playoutLimit&&!a.u&&(a.u=(new H(()=>{a.V()})).Z(b.playoutLimit),a.i.configure("playRangeEnd",b.playoutLimit));await a.i.Db(a.h);q=null;if(!b.pre&&!b.post&&a.K.allowStartInMiddleOfInterstitial&&a.l!=null){const t=a.l-b.startTime;Math.abs(t)>.25&&(q=t)}if(a.D.has(b)){const t=await a.D.get(b);a.D.delete(b);t?await a.i.load(t):await a.i.load(b.uri,q,b.mimeType||void 0)}else await a.i.load(b.uri,q,b.mimeType||void 0);b.overlay&&a.g.paused?a.h.pause():
a.h.play();ds(a,"ads-loaded",(new Map).set("loadTime",(Date.now()-g)/1E3));a.A&&a.g.play();b.overlay&&(b.pre||b.post||a.C.U()&&!(b.startTime>0)||(g=()=>{const t=a.g.currentTime-b.startTime;Math.abs(t-a.h.currentTime)>.1&&(a.h.currentTime=t)},a.j.sa(a.h,"playing",g),a.j.o(a.g,"seeking",g)),a.j.o(a.g,"seeked",()=>{const t=a.g.currentTime;(t<b.startTime||b.endTime&&t>b.endTime)&&a.V()}))}catch(t){a.I&&m(t)}}
function ns(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.m&&(b.clickThroughUrl?(a.m.setAttribute("ad-active","true"),a.m.style.pointerEvents=""):a.m.style.pointerEvents="none",b.background&&(a.m.style.background=b.background));a.F&&(a.F.style.background=b.overlay?"":"rgb(0, 0, 0)")}function ds(a,b,c){a.ea(new C(b,c))}
var os=class{constructor(a,b,c,d){this.K=null;this.m=a;this.C=b;this.g=c;this.F=null;this.A=!0;this.h=this.g;this.ea=d;this.X=new Set;this.P=new Set;this.G=new Set;this.D=new Map;this.J=new Map;this.i=new P;Tr(this);this.H=new zc;this.j=new zc;this.I=!1;this.V=this.u=this.B=this.l=null;this.W=!1;this.M=-1;const e=f=>f?f.overlay?!0:this.g.ended?f.post:this.g.paused?!1:!0:!1;this.T=()=>{if(!this.I&&this.l&&!this.C.Ca()){this.l=this.g.currentTime;var f=Ur(this);f&&e(f)&&Vr(this,f,1,1,Date.now())}};this.R=
()=>{if(!(this.I||this.l||this.C.Ca())){this.g.paused||(this.l=this.g.currentTime);var f;this.B||(f=Ur(this,!0));f||=Ur(this);f&&e(f)&&Vr(this,f,1,1,Date.now())}};this.$=()=>{if(!this.I&&this.l&&!this.C.Ca()){var f=this.g.currentTime;this.B&&!this.B.pre&&!this.B.post&&f<(this.B.endTime||this.B.startTime)&&(this.B=null)}};this.O=new H(this.T);this.L=new H(async()=>{if(this.G.size&&this.l!=null){var f=this.C.bc();if(f!=dr&&f!=Dr){f=!1;var g=Array.from(this.G),h=this.C.va();for(const k of g)k!=this.B&&
(h.start-(k.endTime||k.startTime)>=1?(this.D.has(k)&&((g=await this.D.get(k))&&g.destroy(),this.D.delete(k)),as(this,k),g=k.id||JSON.stringify(k),this.P.has(g)&&this.P.delete(g),this.G.delete(k),Xr(this),k.overlay||(f=!0)):(g=k.startTime-this.l,g>0&&g<=10&&(!this.D.has(k)&&bs(k)&&this.D.set(k,this.i.preload(k.uri,null,k.mimeType||void 0)),cs(this,k))));f&&Yr(this)}}});this.configure(this.C.getConfiguration().ads)}configure(a){this.K=a;this.I||Wr(this)}stop(){this.j&&this.j.Na();this.X.clear();this.P.clear();
this.G.clear();this.i.Df();if(this.D.size){var a=Array.from(this.D.values());for(const b of a)b&&b.then(c=>{c&&c.destroy()})}this.D.clear();if(this.J.size){a=Array.from(this.J.keys());for(const b of a)as(this,b)}this.J.clear();this.i.detach();this.I=!1;this.B=this.l=null;this.A=!0;this.h=this.g;this.F=null;gs(this);Xr(this);this.m&&fj(this.m);this.u&&(this.u.stop(),this.u=null)}release(){this.stop();this.H&&this.H.release();this.j&&this.j.release();this.O&&(this.O.stop(),this.O=null);this.L&&(this.L.stop(),
this.L=null);this.i.destroy()}Fb(){return this.i}async addAdUrlInterstitial(a){const b={type:12};a=await js(this,a,b);a=rd(a,"VAST,vmap:VMAP");if(!a)throw new D(2,10,10007);let c=[];if(a.tagName=="VAST")c=Jr(a,this.l);else if(a.tagName=="vmap:VMAP"){const d=async f=>{var g=await js(this,f.uri,b);g=rd(g,"VAST");if(!g)throw new D(2,10,10007);c.push(...Jr(g,f.time))},e=[];for(const f of Lr(a))e.push(d(f));e.length&&await Promise.all(e)}ks(this,c)}};var U=class{constructor(a,b,c,d,e){this.h=a;this.j=gd(this.h.skipOffset);this.g=e;this.i=b;this.l=c;this.u=d;this.m=!1}needsSkipUI(){return!0}isClientRendering(){return!1}hasCustomClick(){return!1}isUsingAnotherMediaElement(){return!1}getDuration(){return this.h.durationInSeconds}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){return this.h.startTimeInSeconds+this.h.durationInSeconds-this.g.currentTime}isPaused(){return this.g.paused}isSkippable(){return typeof this.j=="number"?
!0:!1}getTimeUntilSkippable(){if(typeof this.j!="number")return this.getRemainingTime();const a=this.getRemainingTime()+this.j-this.getDuration();return Math.max(a,0)}canSkipNow(){return this.getTimeUntilSkippable()==0}skip(){this.m=!0;this.g.currentTime+=this.getRemainingTime()}pause(){return this.g.pause()}play(){return this.g.play()}getVolume(){return this.g.volume}setVolume(a){this.g.volume=a}isMuted(){return this.g.muted}isLinear(){return this.u}resize(){}setMuted(a){this.g.muted=a}getSequenceLength(){return this.l?
this.l:1}getPositionInSequence(){return this.i?this.i:1}getTitle(){return this.h.adTitle}getDescription(){return""}getVastMediaBitrate(){return 0}getVastMediaHeight(){return 0}getVastMediaWidth(){return 0}getVastAdId(){return this.h.vastAdId||""}getAdId(){return this.h.adId}getCreativeAdId(){return this.h.creativeId}getAdvertiserName(){return""}getMediaUrl(){return null}getTimeOffset(){return 0}getPodIndex(){return 0}release(){this.l=this.i=this.g=this.h=null}};x("shaka.ads.MediaTailorAd",U);
U.prototype.release=U.prototype.release;U.prototype.getPodIndex=U.prototype.getPodIndex;U.prototype.getTimeOffset=U.prototype.getTimeOffset;U.prototype.getMediaUrl=U.prototype.getMediaUrl;U.prototype.getAdvertiserName=U.prototype.getAdvertiserName;U.prototype.getCreativeAdId=U.prototype.getCreativeAdId;U.prototype.getAdId=U.prototype.getAdId;U.prototype.getVastAdId=U.prototype.getVastAdId;U.prototype.getVastMediaWidth=U.prototype.getVastMediaWidth;U.prototype.getVastMediaHeight=U.prototype.getVastMediaHeight;
U.prototype.getVastMediaBitrate=U.prototype.getVastMediaBitrate;U.prototype.getDescription=U.prototype.getDescription;U.prototype.getTitle=U.prototype.getTitle;U.prototype.getPositionInSequence=U.prototype.getPositionInSequence;U.prototype.getSequenceLength=U.prototype.getSequenceLength;U.prototype.setMuted=U.prototype.setMuted;U.prototype.resize=U.prototype.resize;U.prototype.isLinear=U.prototype.isLinear;U.prototype.isMuted=U.prototype.isMuted;U.prototype.setVolume=U.prototype.setVolume;
U.prototype.getVolume=U.prototype.getVolume;U.prototype.play=U.prototype.play;U.prototype.pause=U.prototype.pause;U.prototype.skip=U.prototype.skip;U.prototype.canSkipNow=U.prototype.canSkipNow;U.prototype.getTimeUntilSkippable=U.prototype.getTimeUntilSkippable;U.prototype.isSkippable=U.prototype.isSkippable;U.prototype.isPaused=U.prototype.isPaused;U.prototype.getRemainingTime=U.prototype.getRemainingTime;U.prototype.getMinSuggestedDuration=U.prototype.getMinSuggestedDuration;
U.prototype.getDuration=U.prototype.getDuration;U.prototype.isUsingAnotherMediaElement=U.prototype.isUsingAnotherMediaElement;U.prototype.hasCustomClick=U.prototype.hasCustomClick;U.prototype.isClientRendering=U.prototype.isClientRendering;U.prototype.needsSkipUI=U.prototype.needsSkipUI;async function ps(a,b,c){var d=tg([b],cg());d.method="POST";c&&(c=JSON.stringify(c),d.body=Cb(c));d=a.J.request(7,d,{type:7});try{const e=await d.promise,f=xb(e.data),g=JSON.parse(f);if(g.manifestUrl&&g.trackingUrl){const h=new Ha(b),k=new Ha(g.trackingUrl);a.G=h.resolve(k).toString();a.i(new C("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.O)));const l=new Ha(g.manifestUrl);a.u.resolve(h.resolve(l).toString());a.u=null}else throw Error("Insufficient data from MediaTailor.");}catch(e){a.H.length?
a.u.resolve(a.H):a.u.reject("MediaTailor request returned an error and there was no backup asset uri provided."),a.u=null}}function qs(a){if(a.g){for(;a.C.lastChild;)a.C.removeChild(a.C.firstChild);a.I||a.L.push(a.D.adId);rs(a,a.g.m);const b=a.g.getPositionInSequence(),c=a.g.getSequenceLength();b===c&&ss(a,"breakEnd");a.g=null;a.D=null;a.K=null}}
async function ts(a,b,c){b=a.J.request(7,tg([b],cg()),{type:8});try{const d=await b.promise;b=[];const e=xb(d.data),f=JSON.parse(e);if(f.avails.length>0){if(JSON.stringify(a.j)!=JSON.stringify(f.avails)){a.j=f.avails;for(const g of a.j)for(const h of g.nonLinearAdsList)for(const k of h.nonLinearAdList)us(a,k);b=a.getCuePoints();a.i(new C("ad-cue-points-changed",(new Map).set("cuepoints",b)))}}else a.j.length&&a.i(new C("ad-cue-points-changed",(new Map).set("cuepoints",b))),qs(a),a.j=[];c&&(a.I||b.length>
0)&&vs(a)}catch(d){}}async function us(a,b){if(b.staticResource){var c=ws(b);if(!a.F.get(c)){b=a.J.request(7,tg([b.staticResource],cg()),{type:9});try{a.F.set(c,[]);const d=await b.promise,e=xb(d.data),f=JSON.parse(e).apps;a.F.set(c,f)}catch(d){a.F.delete(c)}}}}function vs(a){xs(a);a.I||(ys(a),a.m.o(a.h,"seeked",()=>{ys(a)}),a.m.o(a.h,"ended",()=>{qs(a)}));a.m.o(a.h,"timeupdate",()=>{xs(a)})}
function ws(a){return[a.adId,a.adParameters,a.adSystem,a.adTitle,a.creativeAdId,a.creativeId,a.creativeSequence,a.height,a.width,a.staticResource].join("")}
function xs(a){if(a.h.duration&&(a.g||a.j.length)){var b=a.h.currentTime,c=!1;if(a.g){c=!0;var d=a.D,e=d.startTimeInSeconds+.5*d.durationInSeconds,f=d.startTimeInSeconds+.75*d.durationInSeconds;b>=d.startTimeInSeconds+.25*d.durationInSeconds&&!a.A.includes("firstQuartile")?(a.A.push("firstQuartile"),ss(a,"firstQuartile")):b>=e&&!a.A.includes("midpoint")?(a.A.push("midpoint"),ss(a,"midpoint")):b>=f&&!a.A.includes("thirdQuartile")&&(a.A.push("thirdQuartile"),ss(a,"thirdQuartile"));d=a.g.getRemainingTime();
e=a.g.getDuration();a.g.canSkipNow()&&d>0&&e>0&&ss(a,"skipStateChanged");e>0&&(d<=0||d>e)&&qs(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.L.includes(e.adId)){if(a.h.ended)continue;a.h.currentTime=f;break a}qs(a);a.K=g;a.g=new U(e,d+1,g.ads.length,!0,a.h);a.D=e;d===0&&ss(a,"breakStart");zs(a);break}}if(!a.g)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.F.get(ws(d.nonLinearAdList[0]));if(e<=b&&f&&f.length){qs(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.C.appendChild(f)}a.K=h;a.g=new U(d,g+1,h.ads.length,!1,a.h);a.D=d;g===0&&ss(a,"breakStart");zs(a);break}}}c&&!a.g&&(b=a.h.currentTime,a.B&&a.B>b&&(a.h.currentTime=a.B),a.B=null)}}}
function ys(a){const b=a.h.currentTime;if(b!=0&&a.B==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(f.startTimeInSeconds<b&&f.startTimeInSeconds>c.startTimeInSeconds+c.durationInSeconds){c=f;d=e;break}d&&c&&!a.L.includes(c.adId)&&(a.B=b,a.h.currentTime=d.startTimeInSeconds)}}
function ss(a,b){var c=a.D.trackingEvents.find(d=>d.eventType==b);c||=a.K.adBreakTrackingEvents.find(d=>d.eventType==b);if(c){const d={type:10};for(const e of c.beaconUrls){if(!e||e=="")continue;c=tg([e],cg());c.method="POST";a.J.request(7,c,d)}}switch(b){case "impression":a.i(new C("ad-impression"));break;case "start":a.i(new C("ad-started",(new Map).set("ad",a.g)));break;case "mute":a.i(new C("ad-muted"));break;case "unmute":a.i(new C("ad-volume-changed"));break;case "resume":a.i(new C("ad-resumed"));
break;case "pause":a.i(new C("ad-paused"));break;case "firstQuartile":a.i(new C("ad-first-quartile"));break;case "midpoint":a.i(new C("ad-midpoint"));break;case "thirdQuartile":a.i(new C("ad-third-quartile"));break;case "complete":a.i(new C("ad-complete"));a.i(new C("ad-stopped"));break;case "skip":a.i(new C("ad-skipped"));a.i(new C("ad-stopped"));break;case "breakStart":a.C.setAttribute("ad-active","true");break;case "breakEnd":a.C.removeAttribute("ad-active");break;case "skipStateChanged":a.i(new C("ad-skip-state-changed"))}}
function zs(a){let b=!1;a.h.paused?b=!0:(ss(a,"impression"),ss(a,"start"));a.l.push({target:a.h,type:"volumechange",listener:()=>{a.h.muted&&ss(a,"mute")}});a.l.push({target:a.h,type:"volumechange",listener:()=>{a.h.muted||ss(a,"unmute")}});a.l.push({target:a.h,type:"play",listener:()=>{b?(ss(a,"impression"),ss(a,"start"),b=!1):ss(a,"resume")}});a.l.push({target:a.h,type:"pause",listener:()=>{ss(a,"pause")}});for(const c of a.l)a.m.o(c.target,c.type,c.listener)}
function rs(a,b=!1){b?ss(a,"skip"):ss(a,"complete");for(const c of a.l)a.m.Ea(c.target,c.type,c.listener);a.l=[];a.A=[]}
var As=class{constructor(a,b,c,d){this.C=a;this.J=b;this.h=c;this.u=null;this.O=NaN;this.i=d;this.I=!1;this.B=null;this.j=[];this.L=[];this.K=this.D=this.g=null;this.F=new Map;this.l=[];this.A=[];this.G="";this.M=!0;this.H="";this.m=new zc}stop(){for(const a of this.l)this.m.Ea(a.target,a.type,a.listener);qs(this);this.l=[];this.A=[];this.G="";this.M=!0;this.H="";this.B=null;this.j=[];this.L=[];this.F.clear()}release(){this.stop();this.m&&this.m.release()}onManifestUpdated(a){this.I=a;this.G!=""&&
(ts(this,this.G,this.M),this.M=!1)}getCuePoints(){const a=[];for(const b of this.j)for(const c of b.ads)a.push({start:c.startTimeInSeconds,end:c.startTimeInSeconds+c.durationInSeconds});return a}};var V=class{constructor(a,b){this.g=a;this.i=null;this.h=b}needsSkipUI(){return!0}isClientRendering(){return!1}hasCustomClick(){return!0}isUsingAnotherMediaElement(){return!1}getDuration(){return this.i?this.i.duration:-1}getMinSuggestedDuration(){return this.getDuration()}getRemainingTime(){return this.i?this.i.duration-this.i.currentTime:-1}isPaused(){return this.h.paused}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.h.currentTime+=this.getRemainingTime()}pause(){return this.h.pause()}play(){return this.h.play()}getVolume(){return this.h.volume}setVolume(a){this.h.volume=a}isMuted(){return this.h.muted}isLinear(){return!0}resize(){}setMuted(a){this.h.muted=a}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 0}getVastMediaHeight(){return this.g.getVastMediaHeight()}getVastMediaWidth(){return this.g.getVastMediaWidth()}getVastAdId(){return""}getAdId(){return this.g.getAdId()}getCreativeAdId(){return this.g.getCreativeAdId()}getAdvertiserName(){return this.g.getAdvertiserName()}getMediaUrl(){return null}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.i=this.g=null}};x("shaka.ads.ServerSideAd",V);V.prototype.release=V.prototype.release;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getTimeOffset=V.prototype.getTimeOffset;V.prototype.getMediaUrl=V.prototype.getMediaUrl;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getCreativeAdId=V.prototype.getCreativeAdId;
V.prototype.getAdId=V.prototype.getAdId;V.prototype.getVastAdId=V.prototype.getVastAdId;V.prototype.getVastMediaWidth=V.prototype.getVastMediaWidth;V.prototype.getVastMediaHeight=V.prototype.getVastMediaHeight;V.prototype.getVastMediaBitrate=V.prototype.getVastMediaBitrate;V.prototype.getDescription=V.prototype.getDescription;V.prototype.getTitle=V.prototype.getTitle;V.prototype.getPositionInSequence=V.prototype.getPositionInSequence;V.prototype.getSequenceLength=V.prototype.getSequenceLength;
V.prototype.setMuted=V.prototype.setMuted;V.prototype.resize=V.prototype.resize;V.prototype.isLinear=V.prototype.isLinear;V.prototype.isMuted=V.prototype.isMuted;V.prototype.setVolume=V.prototype.setVolume;V.prototype.getVolume=V.prototype.getVolume;V.prototype.play=V.prototype.play;V.prototype.pause=V.prototype.pause;V.prototype.skip=V.prototype.skip;V.prototype.canSkipNow=V.prototype.canSkipNow;V.prototype.getTimeUntilSkippable=V.prototype.getTimeUntilSkippable;V.prototype.isSkippable=V.prototype.isSkippable;
V.prototype.isPaused=V.prototype.isPaused;V.prototype.getRemainingTime=V.prototype.getRemainingTime;V.prototype.getMinSuggestedDuration=V.prototype.getMinSuggestedDuration;V.prototype.getDuration=V.prototype.getDuration;V.prototype.isUsingAnotherMediaElement=V.prototype.isUsingAnotherMediaElement;V.prototype.hasCustomClick=V.prototype.hasCustomClick;V.prototype.isClientRendering=V.prototype.isClientRendering;V.prototype.needsSkipUI=V.prototype.needsSkipUI;function Bs(a,b){a.i(new C("ads-loaded",(new Map).set("loadTime",Date.now()/1E3-a.F)));b=b.getStreamData().url;a.j.resolve(b);a.j=null;a.G||a.h.o(a.l,"seeked",()=>{const c=a.l.currentTime;if(c!=0){a.g.streamTimeForContentTime(c);var d=a.g.previousCuePointForStreamTime(c);d&&!d.played&&(a.u=c,a.l.currentTime=d.start)}})}
var Cs=class{constructor(a,b,c,d){this.A=a;this.l=b;this.j=null;this.F=NaN;this.i=d;this.G=!1;this.B=this.m=this.u=null;this.C="";this.D=[];this.h=new zc;a=new google.ima.dai.api.UiSettings;a.setLocale(c);this.g=new google.ima.dai.api.StreamManager(this.l,this.A,a);this.i(new C("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g)));this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,e=>{Bs(this,e)});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,()=>{this.C.length?
this.j.resolve(this.C):this.j.reject("IMA Stream request returned an error and there was no backup asset uri provided.");this.j=null});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,()=>{});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,e=>{e=e.getAd();this.m=new V(e,this.l);this.B&&(this.m.i=this.B);this.i(new C("ad-started",(new Map).set("ad",this.m)));this.A.setAttribute("ad-active","true")});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,
()=>{this.A.removeAttribute("ad-active");const e=this.l.currentTime;this.u&&this.u>e&&(this.l.currentTime=this.u,this.u=null)});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,e=>{this.B=e.getStreamData().adProgressData;this.m&&(this.m.i=this.B)});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,()=>{this.i(new C("ad-first-quartile"))});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,()=>{this.i(new C("ad-midpoint"))});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,
()=>{this.i(new C("ad-third-quartile"))});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,()=>{this.i(new C("ad-complete"));this.i(new C("ad-stopped"));this.A.removeAttribute("ad-active");this.m=null});this.h.o(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,()=>{this.i(new C("ad-skipped"));this.i(new C("ad-stopped"))});this.h.o(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.D=f;this.i(new C("ad-cue-points-changed",(new Map).set("cuepoints",f)))})}configure(){}stop(){this.C="";this.u=null;this.D=[]}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.D}};function Ds(a,b){if(b&&b.type)switch(b.type){case "ads-loaded":a.m.g.push(b.loadTime);break;case "ad-started":a.m.h++;const c=b.ad;c&&!c.isLinear()&&a.m.j++;break;case "ad-complete":a.m.l++;break;case "ad-skipped":a.m.m++;break;case "ad-error":a.m.i++}a.dispatchEvent(b)}
var W=class extends Ba{constructor(){super();this.h=this.i=this.j=this.g=null;this.m=new Ir;this.u=navigator.language;this.l=null}setLocale(a){this.u=a}configure(a){this.l=a;this.g&&this.g.configure(this.l);this.j&&this.j.configure(this.l);this.h&&this.h.configure(this.l)}initInterstitial(a,b,c){this.g&&this.g.release();this.g=new os(a,b,c,d=>Ds(this,d));this.g.configure(this.l)}initClientSide(a,b,c){if(!window.google||!google.ima||!google.ima.AdsLoader)throw new D(2,10,1E4);this.j&&this.j.release();
this.j=new Sr(a,b,this.u,c,d=>Ds(this,d));this.j.configure(this.l)}release(){this.g&&(this.g.release(),this.g=null);this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.h&&(this.h.release(),this.h=null);super.release()}onAssetUnload(){this.g&&this.g.stop();this.j&&this.j.stop();this.i&&this.i.stop();this.h&&this.h.stop();this.dispatchEvent(new C("ad-stopped"));this.dispatchEvent(new C("ad-content-attach-requested"));this.m=new Ir}requestClientSideAds(a){if(!this.j)throw new D(1,
10,10001);var b=this.j;b.g&&b.g.destroy();b.m&&b.m.contentComplete();b.G=Date.now()/1E3;b.m.requestAds(a)}updateClientSideAdsRenderingSettings(a){if(!this.j)throw new D(1,10,10001);var b=this.j;b.C=a;b.g&&b.g.updateAdsRenderingSettings(b.C)}initMediaTailor(a,b,c){this.i&&this.i.release();this.i=new As(a,b,c,d=>Ds(this,d))}requestMediaTailorStream(a,b,c=""){if(!this.i)throw new D(1,10,10005);var d=this.i;d.u?a=Promise.reject(new D(1,10,10004)):(d.u=new gg,ps(d,a,b),d.H=c||"",d.O=Date.now()/1E3,a=d.u);
return a}addMediaTailorTrackingUrl(a){if(!this.i)throw new D(1,10,10005);var b=this.i;b.G=a;b.i(new C("ads-loaded",(new Map).set("loadTime",0)))}initServerSide(a,b){if(!window.google||!google.ima||!google.ima.dai)throw new D(2,10,10002);this.h&&this.h.release();this.h=new Cs(a,b,this.u,c=>Ds(this,c));this.h.configure(this.l)}requestServerSideStream(a,b=""){if(!this.h)throw new D(1,10,10003);a.adTagParameters||(a.adTagParameters={});var c=a.adTagParameters;(c.mpt||c.mpv)&&sa('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="v4.16.37";c=this.h;c.j?a=Promise.reject(new D(1,10,10004)):(a instanceof google.ima.dai.api.LiveStreamRequest&&(c.G=!0),c.j=new gg,c.g.requestStream(a),c.C=b||"",c.F=Date.now()/1E3,a=c.j);return a}replaceServerSideAdTagParameters(a){if(!this.h)throw new D(1,10,10003);(a.mpt||a.mpv)&&sa('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="v4.16.37";this.h.g.replaceAdTagParameters(a)}getServerSideCuePoints(){Ic("AdManager.getServerSideCuePoints","Please use getCuePoints function.");return this.getCuePoints()}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.m;return{loadTimes:a.g,averageLoadTime:Hr(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)}onDashTimedMetadata(a){this.h&&
a.schemeIdUri=="urn:google:dai:2018"&&this.h.g.processMetadata(a.schemeIdUri,a.eventNode?a.eventNode.attributes.messageData:null,a.startTime)}onHlsTimedMetadata(a,b){this.h&&this.h.g.processMetadata("ID3",a.data,b)}onCueMetadataChange(a){if(this.h)this.h.onCueMetadataChange(a)}onHLSInterstitialMetadata(a,b,c){this.l&&this.l.disableHLSInterstitial||(this.g||this.initInterstitial(null,a,b),this.g&&ls(this.g,c))}onDASHInterstitialMetadata(a,b,c){if(!this.l||!this.l.disableDASHInterstitial){var d=c.schemeIdUri;
if(d=="urn:mpeg:dash:event:alternativeMPD:insert:2025"||d=="urn:mpeg:dash:event:alternativeMPD:replace:2025"){if(this.g||this.initInterstitial(null,a,b),this.g){a=this.g;const l=c.schemeIdUri=="urn:mpeg:dash:event:alternativeMPD:replace:2025",m=c.schemeIdUri=="urn:mpeg:dash:event:alternativeMPD:insert:2025";if(l||m){b=c.startTime;d=c.endTime;var e=null,f=0;for(var g of c.eventNode.children)if(g.tagName=="AlternativeMPD"){var h=g.attributes.uri;if(h){var k=h;break}}else if(g.tagName=="InsertPresentation"||
g.tagName=="ReplacePresentation")if(h=g.attributes.uri||g.attributes.url){k=Fb(h);(h=Id(g,"maxDuration",Od))&&(e=h/c.timescale);(g=Id(g,"returnOffset",Od))&&(f=g/c.timescale);l&&f&&(d=b+f);break}k&&ks(a,[{id:c.id,groupId:null,startTime:b,endTime:d,uri:k,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:m?f:null,playoutLimit:e,once:!1,pre:!1,post:!1,timelineRange:l&&!m,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null}])}}}else(d==
"urn:mpeg:dash:event:2012"||d=="urn:scte:dash:scte214-events")&&c.eventNode&&Fd(c.eventNode,"OverlayEvent")&&(this.g||this.initInterstitial(null,a,b),this.g&&ms(this.g,c))}}addCustomInterstitial(a){if(!this.g)throw new D(1,10,10006);ks(this.g,[a])}addAdUrlInterstitial(a){if(!this.g)throw new D(1,10,10006);return this.g.addAdUrlInterstitial(a)}getInterstitialPlayer(){if(!this.g)throw new D(1,10,10006);return this.g.Fb()}};x("shaka.ads.AdManager",W);W.prototype.getInterstitialPlayer=W.prototype.getInterstitialPlayer;
W.prototype.addAdUrlInterstitial=W.prototype.addAdUrlInterstitial;W.prototype.addCustomInterstitial=W.prototype.addCustomInterstitial;W.prototype.onDASHInterstitialMetadata=W.prototype.onDASHInterstitialMetadata;W.prototype.onHLSInterstitialMetadata=W.prototype.onHLSInterstitialMetadata;W.prototype.onCueMetadataChange=W.prototype.onCueMetadataChange;W.prototype.onHlsTimedMetadata=W.prototype.onHlsTimedMetadata;W.prototype.onDashTimedMetadata=W.prototype.onDashTimedMetadata;
W.prototype.onManifestUpdated=W.prototype.onManifestUpdated;W.prototype.getStats=W.prototype.getStats;W.prototype.getCuePoints=W.prototype.getCuePoints;W.prototype.getServerSideCuePoints=W.prototype.getServerSideCuePoints;W.prototype.replaceServerSideAdTagParameters=W.prototype.replaceServerSideAdTagParameters;W.prototype.requestServerSideStream=W.prototype.requestServerSideStream;W.prototype.initServerSide=W.prototype.initServerSide;W.prototype.addMediaTailorTrackingUrl=W.prototype.addMediaTailorTrackingUrl;
W.prototype.requestMediaTailorStream=W.prototype.requestMediaTailorStream;W.prototype.initMediaTailor=W.prototype.initMediaTailor;W.prototype.updateClientSideAdsRenderingSettings=W.prototype.updateClientSideAdsRenderingSettings;W.prototype.requestClientSideAds=W.prototype.requestClientSideAds;W.prototype.onAssetUnload=W.prototype.onAssetUnload;W.prototype.release=W.prototype.release;W.prototype.initClientSide=W.prototype.initClientSide;W.prototype.initInterstitial=W.prototype.initInterstitial;
W.prototype.configure=W.prototype.configure;W.prototype.setLocale=W.prototype.setLocale;W.ADS_LOADED="ads-loaded";W.AD_STARTED="ad-started";W.AD_FIRST_QUARTILE="ad-first-quartile";W.AD_MIDPOINT="ad-midpoint";W.AD_THIRD_QUARTILE="ad-third-quartile";W.AD_COMPLETE="ad-complete";W.AD_STOPPED="ad-stopped";W.AD_SKIPPED="ad-skipped";W.AD_VOLUME_CHANGED="ad-volume-changed";W.AD_MUTED="ad-muted";W.AD_PAUSED="ad-paused";W.AD_RESUMED="ad-resumed";W.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";
W.CUEPOINTS_CHANGED="ad-cue-points-changed";W.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";W.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";W.AD_CLICKED="ad-clicked";W.AD_PROGRESS="ad-progress";W.AD_BUFFERING="ad-buffering";W.AD_IMPRESSION="ad-impression";W.AD_DURATION_CHANGED="ad-duration-changed";W.AD_CLOSED="ad-closed";W.AD_LOADED="ad-loaded";W.ALL_ADS_COMPLETED="all-ads-completed";W.AD_LINEAR_CHANGED="ad-linear-changed";W.AD_METADATA="ad-metadata";W.AD_RECOVERABLE_ERROR="ad-recoverable-error";
W.AD_ERROR="ad-error";W.AD_BREAK_READY="ad-break-ready";W.AD_INTERACTION="ad-interaction";W.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";W.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";W.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";Er=()=>new W;function Es(a){return JSON.stringify(a,(b,c)=>{if(typeof c!="function"){b=c instanceof C;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 C?d[e]={__type__:"Event",event:Es(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 Zi(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 Fs(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=Gs(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"?Fs(c.event):c;return d})}
function Gs(a){return{length:a.length,start:b=>a.start[b],end:b=>a.end[b]}}
var Hs="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),Is="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Js=["loop","playbackRate"],Ks=["pause","play"],Ls=(new Map).set("getAssetUri",2).set("getAudioLanguages",4).set("getAudioLanguagesAndRoles",4).set("getBufferFullness",1).set("getBufferedInfo",2).set("getExpiration",2).set("getKeyStatuses",2).set("getPlaybackRate",2).set("getTextLanguages",
4).set("getTextLanguagesAndRoles",4).set("isAudioOnly",10).set("isBuffering",1).set("isInProgress",1).set("isLive",10).set("isTextTrackVisible",1).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),Ms=(new Map).set("getConfiguration",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),Ns=(new Map).set("getPlayheadTimeAsDate",1).set("getPresentationStartTimeAsDate",20).set("getSegmentAvailabilityDuration",20),Os=[["getConfiguration","configure","getConfigurationForLowLatency","configurationForLowLatency"]],Ps=[["isTextTrackVisible","setTextTrackVisibility"]],Qs="cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable".split(" "),
Rs="addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" ");function Ss(a){const b=Ts?Ts.status=="connected":!1;if(a.i&&!b){a.F();for(const c in a.g)a.g[c]={};Us(a)}a.i=b;a.I=b?Ts.receiver.friendlyName:"";a.l.Ia()}function Us(a){if(a.h)for(const b of a.h.keys()){const c=a.h.get(b);a.h.delete(b);c.reject(new D(1,7,7E3))}}function Vs(a){const b=Ts;b.removeUpdateListener(a.C);b.removeMessageListener("urn:x-cast:com.google.shaka.v2",a.D)}
function Ws(a,b){b=Es(b);var c=Ts;try{c.sendMessage("urn:x-cast:com.google.shaka.v2",b,()=>{},wa)}catch(d){throw b=new D(2,8,8005,d),c=new C("error",(new Map).set("detail",b)),a.B("player",c),a.Xc(),b;}}function Xs(a,b){const c=a.L();Ts=b;b.addUpdateListener(a.C);b.addMessageListener("urn:x-cast:com.google.shaka.v2",a.D);Ss(a);Ws(a,{type:"init",initState:c,appData:a.u});a.j.resolve()}
function Ys(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 D(2,8,c,b))}function Zs(a){a.i&&chrome.cast.requestSession(b=>Xs(a,b),b=>Ys(a,b))}function $s(a,b,c,...d){Ws(a,{type:"call",targetName:b,methodName:c,args:d})}function at(a,b,c,...d){const e=new gg,f=a.H.toString();a.H++;a.h.set(f,e);try{Ws(a,{type:"asyncCall",targetName:b,methodName:c,args:d,id:f})}catch(g){e.reject(g)}return e}
var gt=class{constructor(a,b,c,d,e,f,g){this.G=a;this.J=g;this.l=new H(b);this.K=c;this.A=!1;this.B=d;this.F=e;this.L=f;this.i=this.m=!1;this.I="";this.u=null;this.C=()=>Ss(this);this.D=(h,k)=>{h=Fs(k);switch(h.type){case "event":var l=h.targetName,m=pa(h.event);this.B(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.A&&(this.K(),this.A=!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 D(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:{}};this.H=0;this.h=new Map;this.j=null;bt.add(this)}destroy(){bt.delete(this);Us(this);Ts&&Vs(this);this.l&&(this.l.stop(),this.l=null);this.F=this.B=null;this.i=this.m=!1;this.D=this.C=this.j=this.h=this.g=this.u=null;return Promise.resolve()}Ka(){return this.i}Ue(){return this.I}init(){if(this.G.length)if(window.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0;this.l.Ia();var a=new chrome.cast.SessionRequest(this.G,
[],null,this.J,null);a=new chrome.cast.ApiConfig(a,b=>{for(const e of bt){var c=e,d=b;c.j=new gg;c.A=!0;Xs(c,d)}},b=>{for(const c of bt)ct=b=="available",c.l.Ia()},"origin_scoped");chrome.cast.initialize(a,()=>{},()=>{});ct&&this.l.Z(dt);(a=Ts)&&a.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new gg,this.A=!0,Xs(this,a)):Ts=null}else window.__onGCastApiAvailable!==et&&(ft=window.__onGCastApiAvailable||null,window.__onGCastApiAvailable=et)}Fg(a){this.u=a;this.i&&Ws(this,{type:"appData",appData:this.u})}async cast(){if(!this.m)throw new D(1,
8,8E3);if(!ct)throw new D(1,8,8001);if(this.i)throw new D(1,8,8002);this.j=new gg;chrome.cast.requestSession(a=>Xs(this,a),a=>Ys(this,a));await this.j}Xc(){if(this.i){Us(this);if(Ts){Vs(this);try{Ts.stop(()=>{},()=>{})}catch(a){}Ts=null}Ss(this)}}get(a,b){if(a=="video"){if(Ks.includes(b))return(...c)=>$s(this,a,b,...c)}else if(a=="player"){if(Ns.has(b)&&!this.get("player","isLive")())return()=>{};if(Qs.includes(b))return(...c)=>$s(this,a,b,...c);if(Rs.includes(b))return(...c)=>at(this,a,b,...c);if(Ls.has(b)||
Ms.has(b))return()=>this.g[a][b]}return this.g[a][b]}set(a,b,c){this.g[a][b]=c;Ws(this,{type:"set",targetName:a,property:b,value:c})}},dt=.02,ct=!1,Ts=null,ft=null,bt=new Set,et=a=>{ft?window.__onGCastApiAvailable=ft:delete window.__onGCastApiAvailable;ft=null;if(a)for(const b of bt)b.init();typeof window.__onGCastApiAvailable==="function"&&window.__onGCastApiAvailable(a)};function ht(a){const b=new C("caststatuschanged");a.dispatchEvent(b)}function it(a){const b=new C(a.j.paused?"pause":"play");a.m.dispatchEvent(b)}function jt(a,b,c){a.g.Ka()&&(b=="video"?a.m.dispatchEvent(c):b=="player"&&(c.type=="unloading"&&kt(a),a.u.dispatchEvent(c)))}
function lt(a){for(var b of Os){var c=b[1],d=a.g.get("player",b[0])();a.h[c](d)}const e=a.D,f=a.C,g=a.B;kt(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(p=>p.active));const m=a.g.get("player","isTextTrackVisible")();h&&(a.i.autoplay=!1,b=a.h.load(h,c));const n={};for(const p of Js)n[p]=a.g.get("video",p);b.then(()=>{if(a.i){for(var p of e)a.Fb().le(...p);
for(var r of f)a.Fb().wd(...r);for(const q of g)a.Fb().ke(...q);for(const q of Js)a.i[q]=n[q];for(const q of Ps)p=q[1],r=a.g.get("player",q[0])(),a.h[p](r);a.h.rd(m);l&&a.h.Eg(l.language,l.roles,l.forced);a.i.autoplay=k;h&&a.i.play()}},p=>{p=(new Map).set("detail",p);p=new C("error",p);a.h.dispatchEvent(p)})}
function mt(a){const b={video:{},player:{},playerAfterLoad:{},manifest:a.h.Gc(),startTime:null,addThumbnailsTrackCalls:a.D,addTextTrackAsyncCalls:a.C,addChaptersTrackCalls:a.B};a.i.pause();for(var c of Js)b.video[c]=a.i[c];a.i.ended||(b.startTime=a.i.currentTime);for(var d of Os){c=d[1];const e=a.h[d[0]]();b.player[c]=e}for(const e of Ps)d=e[1],c=a.h[e[0]](),b.playerAfterLoad[d]=c;return b}
function nt(a){a.g.init();a.l=new zc;for(const b of Hs)a.l.o(a.i,b,c=>{a.g.Ka()||(c=pa(c),a.m.dispatchEvent(c))});for(const b in qa)a.l.o(a.h,qa[b],c=>{a.g.Ka()||a.u.dispatchEvent(c)});a.j={};for(const b in a.i)Object.defineProperty(a.j,b,{configurable:!1,enumerable:!0,get:()=>ot(a,b),set:c=>{var d=b;a.g.Ka()?a.g.set("video",d,c):a.i[d]=c}});a.A={};pt(a,b=>{Object.defineProperty(a.A,b,{configurable:!1,enumerable:!0,get:()=>qt(a,b)})});rt(a);a.m=new Ba;a.m.ee=a.j;a.u=new Ba;a.u.ee=a.A;a.l.o(a.h,"unloading",
()=>{a.g&&a.g.Ka()||kt(a)})}function ot(a,b){if(b=="addEventListener")return(c,d,e)=>a.m.addEventListener(c,d,e);if(b=="removeEventListener")return(c,d,e)=>a.m.removeEventListener(c,d,e);if(a.g.Ka()&&Object.keys(a.g.g.video).length==0){const c=a.i[b];if(typeof c!="function")return c}return a.g.Ka()?a.g.get("video",b):(b=a.i[b],typeof b=="function"&&(b=b.bind(a.i)),b)}
function pt(a,b){function c(g){return g=="constructor"||typeof d[g]!="function"?!1:!e.has(g)}const d=a.h,e=new Set;for(var f in d)c(f)&&(e.add(f),b(f,d[f]));a=Object.getPrototypeOf(d);for(f=Object.getPrototypeOf({});a&&a!=f;){for(const g of Object.getOwnPropertyNames(a))c(g)&&(e.add(g),b(g,d[g]));a=Object.getPrototypeOf(a)}}
function qt(a,b,c=!1){a.F.has(b)&&(b=a.F.get(b));if(b=="addEventListener")return(d,e,f)=>a.u.addEventListener(d,e,f);if(b=="removeEventListener")return(d,e,f)=>a.u.removeEventListener(d,e,f);if(b=="getMediaElement")return()=>a.j;if(b=="getSharedConfiguration")return a.g.get("player","getConfiguration");if(b=="getNetworkingEngine")return()=>a.h.Eb();if(b=="getDrmEngine")return()=>a.h.D;if(b=="getAdManager")return()=>a.h.re();if(b=="getQueueManager")return()=>a.h.ve();if(b=="setVideoContainer")return d=>
a.h.Kg(d);if(!c){if(b=="addThumbnailsTrack")return(...d)=>{a.D.push(d);return qt(a,b,!0)(...d)};if(b=="addTextTrackAsync")return(...d)=>{a.C.push(d);return qt(a,b,!0)(...d)};if(b=="addChaptersTrack")return(...d)=>{a.B.push(d);return qt(a,b,!0)(...d)}}if(a.g.Ka()){if(b=="getManifest"||b=="drmInfo")return()=>{sa(b+"() does not work while casting!");return null};if(b=="attach"||b=="detach")return()=>{sa(b+"() does not work while casting!");return Promise.resolve()};if(b=="getChapters")return()=>{sa(b+
"() does not work while casting!");return[]}}return a.g.Ka()&&Object.keys(a.g.g.video).length==0&&(Ls.has(b)||Ms.has(b))||!a.g.Ka()?a.h[b].bind(a.h):a.g.get("player",b)}function rt(a){const b=new Map;pt(a,(c,d)=>{b.has(d)?(d=b.get(d),c.length<d.length?a.F.set(c,d):a.F.set(d,c)):b.set(d,c)})}function kt(a){a.D=[];a.C=[];a.B=[]}
var st=class extends Ba{constructor(a,b,c,d=!1){super();this.i=a;this.h=b;this.l=this.u=this.m=this.A=this.j=null;this.H=c;this.G=d;this.D=[];this.C=[];this.B=[];this.F=new Map;this.g=null;window.chrome&&tb().i()!="CAST"?(this.g=new gt(c,()=>ht(this),()=>it(this),(e,f)=>jt(this,e,f),()=>lt(this),()=>mt(this),d),nt(this)):(this.j=this.i,this.A=this.h)}destroy(a=!1){this.g&&a&&this.g.Xc();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.A=this.j=this.i=null;super.release();return Promise.all(a)}xc(){return this.j}Fb(){return this.A}vf(){return this.g?this.g.m&&ct:!1}Ka(){return this.g?this.g.Ka():!1}Ue(){return this.g?this.g.Ue():""}async cast(){this.g&&(await this.g.cast(),this.h&&await this.h.$b())}Fg(a){this.g&&this.g.Fg(a)}Uh(){this.g&&Zs(this.g)}Xc(){this.g&&this.g.Xc()}async bh(a,b=!1){if(a!=this.H||b!=this.G)this.H=a,this.G=b,this.g&&(this.g.Xc(),await this.g.destroy(),this.g=null,this.g=new gt(a,()=>ht(this),
()=>it(this),(c,d)=>jt(this,c,d),()=>lt(this),()=>mt(this),b),this.g.init())}};x("shaka.cast.CastProxy",st);st.prototype.changeReceiverId=st.prototype.bh;st.prototype.forceDisconnect=st.prototype.Xc;st.prototype.suggestDisconnect=st.prototype.Uh;st.prototype.setAppData=st.prototype.Fg;st.prototype.cast=st.prototype.cast;st.prototype.receiverName=st.prototype.Ue;st.prototype.isCasting=st.prototype.Ka;st.prototype.canCast=st.prototype.vf;st.prototype.getPlayer=st.prototype.Fb;
st.prototype.getVideo=st.prototype.xc;st.prototype.destroy=st.prototype.destroy;function tt(a){a.D.Z(ut);const b={video:{},player:{}};for(var c of Is)b.video[c]=a.g[c];a.h.U()&&Ns.forEach((d,e)=>{a.m%d==0&&(b.player[e]=a.h[e]())});Ls.forEach((d,e)=>{a.m%d==0&&(b.player[e]=a.h[e]())});if(c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())b.video.volume=c.level,b.video.muted=c.muted;vt(a,{type:"update",update:b},a.l);Ms.forEach((d,e)=>{a.m%d==0&&(d={player:{}},d.player[e]=a.h[e](),vt(a,{type:"update",update:d},a.l))});a.C&&(a.m+=1);wt(a)}
function xt(a){const b=cast.receiver.CastReceiverManager.getInstance();b.onSenderConnected=()=>yt(a);b.onSenderDisconnected=()=>yt(a);b.onSystemVolumeChanged=()=>{const c=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();c&&vt(a,{type:"update",update:{video:{volume:c.level,muted:c.muted}}},a.l);vt(a,{type:"event",targetName:"video",event:{type:"volumechange"}},a.l)};a.A=b.getCastMessageBus("urn:x-cast:com.google.cast.media");a.A.onMessage=c=>zt(a,c);a.l=b.getCastMessageBus("urn:x-cast:com.google.shaka.v2");
a.l.onMessage=c=>At(a,c);b.start();for(const c of Hs)a.j.o(a.g,c,d=>Bt(a,"video",d));for(const c in qa)a.j.o(a.h,qa[c],d=>Bt(a,"player",d));a.j.o(a.g,"loadeddata",()=>{a.C=!0});a.j.o(a.h,"loading",()=>{a.u=!1;Ct(a)});a.j.o(a.g,"playing",()=>{a.u=!1;Ct(a)});a.j.o(a.g,"pause",()=>{Ct(a)});a.j.o(a.h,"unloading",()=>{a.u=!0;Ct(a)});a.j.o(a.g,"ended",()=>{(new H(()=>{a.g&&a.g.ended&&(a.u=!0,Ct(a))})).Z(Dt)})}
function yt(a){a.m=0;a.B=!0;a.G=cast.receiver.CastReceiverManager.getInstance().getSenders().length!=0;Ct(a)}
function zt(a,b){const c=Fs(b.data);switch(c.type){case "PLAY":a.g.play();Et(a);break;case "PAUSE":a.g.pause();Et(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(),Et(a)):d&&d=="PLAYBACK_PAUSE"&&(a.g.pause(),Et(a));break;case "STOP":a.h.$b().then(()=>{a.h&&Et(a)});break;case "GET_STATUS":Ft(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||Et(a);break;case "LOAD":a.m=0;a.C=!1;a.B=!1;b=c.media;d=c.currentTime;e=a.I(b.contentId);f=c.autoplay||!0;a.F(b.customData);f&&(a.g.autoplay=!0);a.h.load(e,d).then(()=>{a.h&&Ft(a)}).catch(g=>{let h="LOAD_FAILED";g.category==7&&g.code==7E3&&(h="LOAD_CANCELLED");vt(a,{requestId:Number(c.requestId),type:h},a.A)});break;default:vt(a,{requestId:Number(c.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},a.A)}}
function At(a,b){var c=Fs(b.data);switch(c.type){case "init":a.m=0;a.C=!1;a.B=!0;Gt(a,c.initState,c.appData);tt(a);break;case "appData":a.F(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.H[d][e]=c;break;case "call":d=a.H[c.targetName];d[c.methodName].apply(d,c.args);break;case "asyncCall":d=c.targetName;e=c.methodName;
d=="player"&&e=="load"&&(a.m=0,a.C=!1);const f=c.id,g=b.senderId;b=a.H[d];c=b[e].apply(b,c.args);d=="player"&&e=="load"&&(c=c.then(()=>{a.B=!0}));c.then(h=>Ht(a,g,f,null,h),h=>Ht(a,g,f,h,null))}}function Bt(a,b,c){a.h&&(tt(a),vt(a,{type:"event",targetName:b,event:c},a.l))}async function Ct(a){await Promise.resolve();if(a.h){var b=new C("caststatuschanged");a.dispatchEvent(b);wt(a)||Et(a)}}function wt(a){return a.B&&(a.g.duration||a.h.U())?(Ft(a),a.B=!1,!0):!1}
function Et(a,b=0,c=null){const d={mediaSessionId:0,playbackRate:a.g.playbackRate,playerState:a.u?It:a.h.Be()?Jt:a.g.paused?Kt:Lt,currentTime:a.g.currentTime,supportedMediaCommands:63,volume:{level:a.g.volume,muted:a.g.muted}};c&&(d.media=c);vt(a,{requestId:b,type:"MEDIA_STATUS",status:[d]},a.A)}
async function Gt(a,b,c){for(const d in b.player)a.h[d](b.player[d]);a.F(c);c=a.g.autoplay;if(b.manifest){a.g.autoplay=!1;try{await a.h.load(b.manifest,b.startTime);if(b.addThumbnailsTrackCalls)for(const d of b.addThumbnailsTrackCalls)a.h.le(...d);if(b.addTextTrackAsyncCalls)for(const d of b.addTextTrackAsyncCalls)a.h.wd(...d);if(b.addChaptersTrackCalls)for(const d of b.addChaptersTrackCalls)a.h.ke(...d)}catch(d){b=(new Map).set("detail",d);b=new C("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];for(const d in b.playerAfterLoad)a.h[d](b.playerAfterLoad[d]);a.g.autoplay=c;b.manifest&&(a.g.play(),Et(a))}}function vt(a,b,c,d){a.G&&(a=Es(b),d?c.getCastChannel(d).send(a):c.broadcast(a))}function Ft(a,b=0){const c={contentId:a.h.Gc(),streamType:a.h.U()?"LIVE":"BUFFERED",contentType:""};a.h.U()||(c.duration=a.g.duration);a.i&&(c.metadata=a.i);Et(a,b,c)}function Ht(a,b,c,d,e){a.h&&vt(a,{type:"asyncComplete",id:c,error:d,res:e},a.l,b)}
var Mt=class extends Ba{constructor(a,b,c,d){super();this.g=a;this.h=b;this.j=new zc;this.H={video:a,player:b};this.F=c||(()=>{});this.I=d||(e=>e);this.i=null;this.G=!1;this.u=!0;this.m=0;this.C=!1;this.B=!0;this.A=this.l=null;this.D=new H(()=>{tt(this)});xt(this)}isConnected(){return this.G}pj(){return this.u}$j(a){this.i=a}ni(){this.i=null}bk(a){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});this.i.title=a}Zj(a){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});
this.i.images=[{url:a}]}Yj(a){this.i||(this.i={});this.i.artist=a;this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK}async destroy(){this.j&&(this.j.release(),this.j=null);const a=[];this.h&&(a.push(this.h.destroy()),this.h=null);this.D&&(this.D.stop(),this.D=null);this.F=this.H=this.g=null;this.G=!1;this.u=!0;this.A=this.l=null;super.release();await Promise.all(a);cast.receiver.CastReceiverManager.getInstance().stop()}};x("shaka.cast.CastReceiver",Mt);Mt.prototype.destroy=Mt.prototype.destroy;
Mt.prototype.setContentArtist=Mt.prototype.Yj;Mt.prototype.setContentImage=Mt.prototype.Zj;Mt.prototype.setContentTitle=Mt.prototype.bk;Mt.prototype.clearContentMetadata=Mt.prototype.ni;Mt.prototype.setContentMetadata=Mt.prototype.$j;Mt.prototype.isIdle=Mt.prototype.pj;Mt.prototype.isConnected=Mt.prototype.isConnected;var ut=.5,Dt=5,It="IDLE",Lt="PLAYING",Jt="BUFFERING",Kt="PAUSED";function Nt(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=Ot(d,e,h,k,l,m);f<=g;f++){var p=c[f],r=-1;let t=-1;for(var q=0;q<p.length;q++)if(p[q]!=null&&p[q].g.trim()!==""){r=q;break}for(q=p.length-1;q>=0;q--)if(p[q]!=null&&p[q].g.trim()!==""){t=q;break}if(r===-1||t===-1)p=
Pt(d,e),a.nestedCues.push(p);else{for(;r<=t;r++){q=p[r];if(!q){n.payload+=" ";continue}const u=q.l,v=q.i,y=q.j,w=q.h;if(u!=h||v!=k||y!=l||w!=m)n.payload&&a.nestedCues.push(n),n=Ot(d,e,u,v,y,w),h=u,k=v,l=y,m=w;n.payload+=q.g}n.payload&&a.nestedCues.push(n);f!==g&&(n=Pt(d,e),a.nestedCues.push(n));n=Ot(d,e,h,k,l,m)}}return a.nestedCues.length?{cue:a,stream:b}:null}function Ot(a,b,c,d,e,f){a=new ae(a,b,"");c&&a.textDecoration.push(ne);d&&(a.fontStyle=me);a.color=e;a.backgroundColor=f;return a}
function Pt(a,b){a=new ae(a,b,"");a.lineBreak=!0;return a}var Qt=class{constructor(a,b,c,d,e){this.g=a;this.l=b;this.i=c;this.h=d;this.j=e}};function Rt(a){St(a,0,15);a.g=1}function Tt(a,b,c){const d=`CC${(a.D<<1|a.C)+1}`,e=new ae(b,c,"");e.lineInterpretation=1;let f=Ut.get(a.g);f&&(e.line=f);a.A!=null&&a.B!=null&&(e.position=10+Math.min(70,a.A*10)+a.B*2.5);(b=Nt(e,d,a.i,b,c))&&a.g+b.cue.nestedCues.length-3>15&&(f=Ut.get(a.g+3-b.cue.nestedCues.length))&&(e.line=f);return b}
function Vt(a,b,c){if(!(c<32||c>127)){var d="";switch(b){case 0:d=Wt.has(c)?Wt.get(c):String.fromCharCode(c);break;case 1:d=Xt.get(c);break;case 2:a.i[a.g].pop();d=Yt.get(c);break;case 3:a.i[a.g].pop(),d=Zt.get(c)}d&&a.i[a.g].push(new Qt(d,a.m,a.j,a.u,a.l))}}function $t(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 St(a,b,c){for(let d=0;d<=c;d++)a.i[b+d]=[]}
var au=class{constructor(a,b){this.i=[];this.g=1;this.h=0;this.D=a;this.C=b;this.j=this.m=!1;this.l="white";this.u="black";this.A=this.B=null;Rt(this)}},Wt=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"]]),Xt=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"]]),Yt=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"]]),Zt=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"]]),Ut=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 bu(a){a.h=1;a.g=a.j;a.g.h=0}function cu(a,b,c){a.g=a.i;const d=a.g;let e=null;a.h!==3&&a.h!==4&&(e=Tt(d,a.l,c),c=a.i,c.g=c.h>0?c.h:0,St(c,0,15),c=a.j,c.g=c.h>0?c.h:0,St(c,0,15),d.g=15);a.h=3;d.h=b;return e}function du(a){ta("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.g=a.u;a.h=4}
var eu=class{constructor(a,b){this.h=0;this.u=new au(a,b);this.i=new au(a,b);this.g=this.j=new au(a,b);this.l=0;this.m=null}},fu="black green blue cyan red yellow magenta black".split(" "),gu="white green blue cyan red yellow magenta white_italics".split(" ");function hu(a){a.i=[];for(let b=0;b<16;b++)a.i.push(iu())}function iu(){const a=[];for(let b=0;b<42;b++)a.push(null);return a}function ju(a){const b=a.g<a.m&&a.g>=0;return a.h<a.u&&a.h>=0&&b}function ku(a,b){ju(a)&&(a.i[a.h][a.g]=new Qt(b,a.D,a.B,a.A,a.C),a.g++)}function lu(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]=iu()}
function mu(a,b,c){const d=new ae(a.j,b,"");d.textAlign=a.F===0?"left":a.F===1?"right":je;var e=d.region;a.I&&(e.id+="svc"+a.I);e.id+="win"+a.L;e.height=a.u;e.width=a.m;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.H;e.viewportAnchorY=a.K;e.viewportAnchorUnits=a.J?bd: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=Nt(d,`svc${c}`,a.i,a.j,b))a.j=b;return c}
var nu=class{constructor(a,b){this.I=b;this.L=a;this.J=this.l=!1;this.m=this.u=this.G=this.K=this.H=0;this.F=2;this.i=[];this.g=this.h=this.j=0;this.D=this.B=!1;this.C="white";this.A="black";hu(this)}isVisible(){return this.l}display(){this.l=!0}};function ou(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 pu(a.h)),a.h=null,a.g=0))}var qu=class{constructor(){this.i=[];this.h=null;this.g=0}};function ru(a){if(!a.Ma())throw new D(2,2,3E3);return a.h[a.g++]}var pu=class{constructor(a){this.g=0;this.h=a}Ma(){return this.g<this.h.length}Qa(){return this.g}skip(a){if(this.g+a>this.h.length)throw new D(2,2,3E3);this.g+=a}Gh(a){if(this.g-a<0)throw new D(2,2,3E3);this.g-=a}};function su(a,b,c,d){if(!a.g)return[];if(c==24)return c=ru(b).value,d=ru(b).value,c=(f=>f.map(g=>("0"+(g&255).toString(16)).slice(-2)).join(""))([c,d]),ku(a.g,String.fromCharCode(parseInt(c,16))),[];b=a.g;let e=null;switch(c){case 8:!ju(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=mu(b,d,a.i));b.h+1>=b.u?lu(b):b.h++;b.g=0;break;case 14:b.isVisible()&&(e=mu(b,d,a.i));b.i[b.h]=iu();b.g=0;break;case 12:b.isVisible()&&(e=mu(b,d,a.i)),hu(b),b.h=
0,b.g=0}return e?[e]:[]}
function tu(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=ru(b).value;b=[];for(var f of uu(a,e)){e=a.h[f];if(e.isVisible()){var g=mu(e,d,a.i);g&&b.push(g)}hu(e)}return b}if(c===137){b=ru(b).value;for(var h of uu(a,b))b=a.h[h],b.isVisible()||(b.j=d),b.display()}else{if(c===138){f=ru(b).value;b=null;for(e of uu(a,f))f=a.h[e],f.isVisible()&&(b=mu(f,d,a.i)),f.l=!1;return b?[b]:[]}if(c===139){f=ru(b).value;b=null;for(g of uu(a,f))f=a.h[g],f.isVisible()?b=mu(f,d,a.i):f.j=
d,f.l=!f.l;return b?[b]:[]}if(c===140)return b=ru(b).value,vu(a,b,d);if(c===143)return d=vu(a,255,d),wu(a),d;if(c===144)b.skip(1),b=ru(b).value,a.g&&(d=(b&64)>0,a.g.B=(b&128)>0,a.g.D=d);else if(c===145)d=ru(b).value,f=ru(b).value,b.skip(1),a.g&&(b=xu((f&48)>>4,(f&12)>>2,f&3),a.g.C=xu((d&48)>>4,(d&12)>>2,d&3),a.g.A=b);else if(c===146)d=ru(b).value,b=ru(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=ru(b).value,b.skip(1),a.g&&(a.g.F=d&3);else if(c>=152&&c<=159){f=(c&15)-
8;e=a.h[f]!==null;e||(g=new nu(f,a.i),g.j=d,a.h[f]=g);d=ru(b).value;g=ru(b).value;h=ru(b).value;c=ru(b).value;const k=ru(b).value;b=ru(b).value;e&&(b&7)===0||(b=a.h[f],b.h=0,b.g=0,b.D=!1,b.B=!1,b.C="white",b.A="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.u=(c&15)+1;b.m=(k&63)+1;a.g=a.h[f]}}}return[]}function vu(a,b,c){const d=[];for(const e of uu(a,b))b=a.h[e],b.isVisible()&&(b=mu(b,c,a.i))&&d.push(b),a.h[e]=null;return d}
function uu(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 wu(a){a.g=null;a.h=[null,null,null,null,null,null,null,null]}function xu(a,b,c){const d={0:0,1:0,2:1,3:1};a=d[a];b=d[b];c=d[c];return yu[a<<2|b<<1|c]}
var zu=class{constructor(a){this.i=a;this.h=[null,null,null,null,null,null,null,null];this.g=null}},Au=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"]]),yu="black blue green cyan red magenta yellow white".split(" ");function Bu(a){a.u=0;a.A=0;for(const b of a.m.values())b.h=0,b.g=b.j,b.m=null,Rt(b.i),Rt(b.j),Rt(b.u);a.C=!0}
function Cu(a,b){var c=b.type;if((b.sb&112)===16){var d=b.sb>>3&1;c===0?a.u=d:a.A=d}d=`CC${(c<<1|(c?a.A:a.u))+1}`;c=a.m.get(d);if(b.sb===255&&b.ac===255||!b.sb&&!b.ac||!Du(b.sb)||!Du(b.ac))return++a.l>=45&&Bu(a),null;a.l=0;b.sb&=127;b.ac&=127;var e=b.sb;if(e>=1&&e<=15||!b.sb&&!b.ac)return null;e=null;if((b.sb&112)===16)a:{a.B.add(d),d=b.sb;a=b.ac;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=gu[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,$t(a,c,1+a.g-a.h,a.h),St(a,0,c-1),St(a,b+1,15-b)),a.g=b,a.m=f,a.j=e,a.l=d,a.A=g,a.u="black")}else if((d&247)===17&&(a&240)===32)c.g.m=!1,c.g.j=!1,c.g.l="white",Vt(c.g,0,32),d=!1,b=gu[(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=fu[(a&
14)>>1]),c.g.u=b;else if((d&247)===17&&(a&240)===48)Vt(c.g,1,a);else if((d&246)===18&&(a&224)===32)Vt(c.g,d&1?3:2,a);else{if((d&246)===20&&(a&240)===32){a=b.pts;d=null;switch(b.ac){case 32:bu(c);break;case 33:c=c.g;c.i[c.g].pop();break;case 37:d=cu(c,2,a);break;case 38:d=cu(c,3,a);break;case 39:d=cu(c,4,a);break;case 40:Vt(c.g,0,32);break;case 41:c.h=2;c.g=c.i;c.g.h=0;c.l=a;break;case 42:Rt(c.u);du(c);break;case 43:du(c);break;case 44:b=c.i;d=null;c.h!==4&&(d=Tt(b,c.l,a));St(b,0,15);break;case 45:e=
c.g;c.h!==3?d=null:(b=Tt(e,c.l,a),d=e.g-e.h+1,$t(e,d-1,d,e.h),St(e,0,d-1),St(e,e.g,15-e.g),c.l=a,d=b);break;case 46:St(c.j,0,15);break;case 47:b=null,c.h!==4&&(b=Tt(c.i,c.l,a)),d=c.j,c.j=c.i,c.i=d,bu(c),c.l=a,d=b}e=d;break a}(d==23||d==31)&&a>=33&&a<=35&&(c.g.B=a-32)}e=null}else a=b.ac,Vt(c.g,0,b.sb),Vt(c.g,0,a);return e}
function Eu(a,b){const c=[];try{for(;b.Ma();){const h=ru(b).value;var d=(h&224)>>5;const k=h&31;d===7&&k!=0&&(d=ru(b).value&63);if(d!=0){a.B.add("svc"+d);a.j.has(d)||a.j.set(d,new zu(d));const l=a.j.get(d),m=b.Qa();for(;b.Qa()-m<k;){{d=l;var e=b;const n=ru(e);let p=n.value;const r=n.pts;if(p===16){const q=ru(e);p=p<<16|q.value}if(p>=0&&p<=31)var f=su(d,e,p,r);else if(p>=128&&p<=159)f=tu(d,e,p,r);else{if(p>=4096&&p<=4127)d=e,e=p&255,e>=8&&e<=15?d.skip(1):e>=16&&e<=23?d.skip(2):e>=24&&e<=31&&d.skip(3);
else if(p>=4224&&p<=4255)d=e,e=p&255,e>=128&&e<=135?d.skip(4):e>=136&&e<=143&&d.skip(5);else if(p>=32&&p<=127)e=p,d.g&&(e===127?ku(d.g,"\u266a"):ku(d.g,String.fromCharCode(e)));else if(p>=160&&p<=255)d.g&&ku(d.g,String.fromCharCode(p));else if(p>=4128&&p<=4223){if(e=p&255,d.g)if(Au.has(e)){var g=Au.get(e);ku(d.g,g)}else ku(d.g,"_")}else p>=4256&&p<=4351&&d.g&&((p&255)!=160?ku(d.g,"_"):ku(d.g,"[CC]"));f=[]}}c.push(...f)}}}}catch(h){if(h instanceof D&&h.code===3E3)ta("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");
else throw h;}return c}function Du(a){let b=0;for(;a;)b^=a&1,a>>=1;return b===1}
var Fu=class{constructor(){this.h=[];this.g=[];this.i=new qu;this.l=0;this.m=new Map([["CC1",new eu(0,0)],["CC2",new eu(0,1)],["CC3",new eu(1,0)],["CC4",new eu(1,1)]]);this.A=this.u=0;this.j=new Map;this.C=!0;this.B=new Set;Bu(this)}clear(){this.l=0;this.h=[];this.g=[];var a=this.i;a.i=[];a.h=[];a.g=0;Bu(this);for(const b of this.j.values())wu(b)}extract(a,b){if(this.C){for(var c of this.m.values())c.l=b;this.C=!1}a=new Jg(a,0);if(!(a.getLength()<8)&&a.ba()===181&&a.Ga()===49&&a.Y()===1195456820&&
a.ba()===3&&(c=a.ba(),(c&64)!==0)){c&=31;a.skip(1);for(let e=0;e<c;e++){var d=a.ba();const f=(d&4)>>2,g=a.ba(),h=a.ba();f&&(d&=3,d===0||d===1?this.h.push({pts:b,type:d,sb:g,ac:h,order:this.h.length}):(this.g.push({pts:b,type:d,value:g,order:this.g.length}),this.g.push({pts:b,type:2,value:h,order:this.g.length})))}}}decode(){const a=[];var b=(d,e)=>d.pts-e.pts||d.order-e.order;this.h.sort(b);this.g.sort(b);for(var c of this.h)(b=Cu(this,c))&&a.push(b);for(const d of this.g)ou(this.i,d);c=this.i.i;
for(const d of c)c=Eu(this,d),a.push(...c);this.i.i=[];this.h=[];this.g=[];return a}getStreams(){return Array.from(this.B)}};x("shaka.cea.CeaDecoder",Fu);$c=()=>new Fu;function Gu(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 Hu(a,b,c,d,e,f,g,h,k){let l=0,m=f;var n=h.map(q=>q.Cg);n=[].concat(...n);n.length&&(m=n[0].sampleSize||f);for(b.skip(g+h[0].Cf);b.Ma();){g=b.Y();var p=b.ba(),r=null;r=!1;h=1;switch(a.g){case Iu:r=p&31;r=r==6;break;case Ju:h=2;b.skip(1);r=p>>1&63;r=r==39||r==40;break;case Ku:h=2;b.skip(1);r=p>>1&63;r=r==23||r==24;break;default:return}if(r){p=0;l<n.length&&(p=n[l].Xe||0);p=(c+p)/d;h=b.Kb(g-h,!1);for(const q of Gu(h))k.push({packet:q,pts:p})}else try{b.skip(g-h)}catch(q){break}m-=g+4;m==0&&
(c=l<n.length?c+(n[l].Dg||e):c+e,l++,l<n.length?m=n[l].sampleSize||f:m=f)}}
var Nu=class{constructor(){this.j=new Map;this.i=this.h=0;this.g=Lu}init(a){const b=[],c=[];(new Ug).boxes("moov trak mdia minf stbl mvex".split(" "),Mg).ra("trex",d=>{var e=d.reader;e.skip(4);e.skip(4);d=e.Y();e=e.Y();this.h=d;this.i=e}).ra("tkhd",d=>{var e=d.reader;d=d.version;d==1?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4));const f=e.Y();d==1?e.skip(8):e.skip(4);e.skip(4);e.skip(8);e.skip(2);e.skip(2);e.skip(2);e.skip(2);e.skip(36);e.Ga();e.Ga();e.Ga();e.Ga();b.push(f)}).ra("mdhd",d=>{d=Zh(d.reader,
d.version);c.push(d.timescale)}).ra("stsd",Og).boxes("avc1 avc3 dvav dva1 hev1 hvc1 dvh1 dvhe vvc1 vvi1 dvc1 dvi1".split(" "),d=>{d=d.name;Mu.has(d)&&(this.g=Mu.get(d))}).box("encv",Pg).box("sinf",Mg).box("frma",d=>{({codec:d}=ci(d.reader));Mu.has(d)&&(this.g=Mu.get(d))}).parse(a,!0,!0);if(!b.length||!c.length||b.length!=c.length)throw new D(2,2,2010);this.g==Lu&&sa("Unable to determine bitstream format for CEA parsing!");b.forEach((d,e)=>{this.j.set(d,c[e])})}parse(a){if(this.g==Lu)return[];const b=
[];let c=0,d=[];(new Ug).box("moof",e=>{c=e.start;d=[];Mg(e)}).box("traf",e=>{d.push({baseMediaDecodeTime:null,yd:this.h,zd:this.i,Eh:[],timescale:9E4});Mg(e)}).ra("trun",e=>{const f=d[d.length-1];e=$h(e.reader,e.version,e.flags);f.Eh.push(e)}).ra("tfhd",e=>{const f=d[d.length-1];e=Xh(e.reader,e.flags);f.yd=e.yd||this.h;f.zd=e.zd||this.i;e=e.trackId;this.j.has(e)&&(f.timescale=this.j.get(e))}).ra("tfdt",e=>{const f=d[d.length-1];e=Yh(e.reader,e.version);f.baseMediaDecodeTime=e.baseMediaDecodeTime}).box("mdat",
e=>{const f=c-e.start-8,g=e.reader.Qa();for(const h of d)h.baseMediaDecodeTime===null?sa("Unable to find base media decode time for CEA captions!"):(e.reader.seek(g),Hu(this,e.reader,h.baseMediaDecodeTime,h.timescale,h.yd,h.zd,f,h.Eh,b))}).parse(a,!1,!0);return b}};x("shaka.cea.Mp4CeaParser",Nu);
var Lu=0,Iu=1,Ju=2,Ku=3,Mu=(new Map).set("avc1",Iu).set("avc3",Iu).set("dvav",Iu).set("dva1",Iu).set("hev1",Ju).set("hvc1",Ju).set("dvh1",Ju).set("dvhe",Ju).set("vvc1",Ku).set("vvi1",Ku).set("dvc1",Ku).set("dvi1",Ku);Yc("video/mp4",()=>new Nu);var Ou=class{constructor(){this.g=null}init(){}parse(a){this.g?this.g.clearData():this.g=new Nj;const b=[];a=$a(a);if(!Fj(a))return b;var c=this.g.parse(a);a=c.Bd();c=c.xe();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 Gu(e.data))b.push({packet:f,pts:e.time});return b}};x("shaka.cea.TsCeaParser",Ou);Yc("video/mp2t",()=>new Ou);function Pu(a){var b=0,c=db(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=$a(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function Qu(a){a=Jb(Ad(a));a=Pu(a).filter(b=>b.type===Ru)[0];if(!a)return null;a=yb(a.value,!0);return(a=sd(a,"WRMHEADER"))?a:null}
function Su(a){try{const c=Qu(a);if(c)a:{for(const d of Cd(c,"DATA"))if(d.children)for(const e of d.children)if(e.tagName=="LA_URL"){var b=Ad(e);break a}b=""}else b="";return b}catch(c){return""}}var Ru=1;function Tu(a){var b=Gd(a.node,"https://dashif.org/CPS","Laurl");if(b&&(b=Ad(b)))return b;if((b=Gd(a.node,"urn:microsoft:playready","pro"))&&Ad(b))return Su(b);if(a=Gd(a.node,"urn:mpeg:cenc:2013","pssh"))if(a=Ad(a)){b=Jb(a);a=8;b=db(b);const c=b.getUint8(a);a+=20;c>0&&(a+=4+16*b.getUint32(a));a=$a(b,a+4);a=Hb(a);a=sd("<pro>"+a+"</pro>");return Su(a)}return""}
function Uu(a,b,c,d,e){const f=[];for(const l of c)if(c=d[l.od]){a:{var g=Gd(l.node,"urn:microsoft:playready","pro");if(!g||!Ad(g)){g=null;break a}g=Ad(g);g=Jb(g);var h=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);g=[{initData:Vg(g,h,new Set,0),initDataType:"cenc",keyId:l.keyId}]}h=null;if(l.od==="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:Vg(n,m,k,1),initDataType:"cenc",keyId:h.keyId}]}g=Rb(c,b,l.init||a||g||h);if(c=Vu.get(c))g.licenseServerUri=c(l);a:{if(c=Gd(l.node,"https://dashif.org/CPS","Certurl"))if(c=Ad(c))break a;c=""}g.serverCertificateUri=c;f.push(g)}return f}
function Wu(a){if(!window.crypto||!window.crypto.subtle)throw sa("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new D(2,4,4042);var b=Gd(a.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!b)throw new D(2,4,4051);if(b.attributes.schemeIdUri!="urn:mpeg:dash:sea:aes128-cbc:2013")throw new D(2,4,4051);b=Gd(a.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!b)throw new D(2,4,4051);a=b.attributes.IV;b=Fb(b.attributes.keyUriTemplate);
if(!a||!b)throw new D(2,4,4051);a=Kb(a.substr(2));if(a.byteLength!=16)throw new D(2,4,4048);return{vj:b,iv:a}}function Xu(a,b){const c=[];for(const d of b)(b=Yu(a,d))&&c.push(b);return c}
function Zu(a,b,c,d){const e=Xu(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 D(2,4,4010);if(!c){g=e.filter(m=>m.od=="urn:mpeg:dash:sea:2012");if(g.length>1)throw new D(2,4,4050);g.length&&(b=Wu(g[0]));(g=e.find(m=>m.od=="urn:mpeg:dash:mp4protection:2011"))&&g.encryptionScheme&&(k=g.encryptionScheme);g=e.filter(m=>m.od=="urn:mpeg:dash:mp4protection:2011"?(f=m.init||f,!1):m.od!="urn:mpeg:dash:sea:2012");g.length&&(a=Uu(f,k,
g,d,h),a.length==0&&(a=[Rb("",k,f)]))}if(e.length&&!b&&(c||!g.length)){a=[];for(var l of Object.values(d))kb(l)||(c=Rb(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{eh:l,Jl:f,drmInfos:a,rf:b,ih:!0}}
function $u(a,b,c,d,e){const f=Zu(a,b,d,e);if(c.ih){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.ih=!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 D(2,4,4008);return f.eh||c.eh}
function Yu(a,b){let c=b.attributes.schemeIdUri,d=Jd(b,"urn:mpeg:cenc:2013","default_KID");const e=Hd(b,"urn:mpeg:cenc:2013","pssh").map(Bd),f=b.attributes.value;if(!c)return null;c=c.toLowerCase();if(d&&(d=d.replace(/-/g,"").toLowerCase(),d.includes(" ")))throw new D(2,4,4009);let g=[];try{g=e.map(h=>{if(!a.g.has(h)){const k=Jb(h);a.g.set(h,k)}return{initDataType:"cenc",initData:a.g.get(h),keyId:null}})}catch(h){throw new D(2,4,4007);}return{node:b,od:c,keyId:d,init:g.length>0?g:null,encryptionScheme:f}}
var av=class{constructor(){this.g=new Map}release(){this.g.clear()}},Vu=(new Map).set("com.apple.fps",function(a){if("apple"===window.shakaMediaKeysPolyfill)throw new D(2,4,4054);if(a=Gd(a.node,"https://dashif.org/CPS","Laurl"))if(a=Ad(a))return a;return""}).set("com.widevine.alpha",function(a){var b=Gd(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=Ad(b))?b:(a=Gd(a.node,"urn:microsoft","laurl"))?Fb(a.attributes.licenseUrl)||"":""}).set("com.microsoft.playready",Tu).set("com.microsoft.playready.recommendation",
Tu).set("com.microsoft.playready.software",Tu).set("com.microsoft.playready.hardware",Tu).set("org.w3.clearkey",function(a){var b=Gd(a.node,"https://dashif.org/CPS","Laurl");return b&&(b=Ad(b))?b:(a=Gd(a.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&a.attributes.Lic_type==="EME-1.0"&&a&&(a=Ad(a))?a:""});function bv(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&&sa("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 cv(a,b){var c=dv(a,b,"timescale");let d=1;c&&(d=Pd(c)||1);c=dv(a,b,"duration");const e=(c=Pd(c||""))?c/d:null;var f=dv(a,b,"startNumber");const g=Number(dv(a,b,"presentationTimeOffset"))||0;let h=Qd(f||"");if(f==null||h==null)h=1;f=null;if(b=ev(a,b,"SegmentTimeline")){b=zd(b,"S");f=d;a=a.ua.duration||Infinity;var k=h;const q=[];var l=-g;for(let t=0;t<b.length;++t){var m=b[t],n=b[t+1],p=Id(m,"t",Qd);const u=Id(m,"d",Qd);var r=Id(m,"r",Od);m=Id(m,"k",Od)||0;p!=null&&(p-=g);if(!u)continue;p=
p!=null?p:l;r=r||0;if(r<0)if(n){n=Id(n,"t",Qd);if(n==null)break;else if(p>=n)break;r=Math.ceil((n-p)/u)-1}else{if(a==Infinity)break;else if(p/f>=a)break;r=Math.ceil((a*f-p)/u)-1}q.length>0&&p!=l&&(q[q.length-1].end=p/f);for(n=0;n<=r;++n)l=p+u,q.push({start:p/f,td:p,end:l/f,Qg:l,kc:m,Wj:q.length+k}),p=l}f=q}return{timescale:d,gf:c,eb:e,Rd:h,Wb:g/d||0,Pc:g,timeline:f}}function fv(a,b){return[b(a.N),b(a.xa),b(a.Da)].filter(lf)}
function dv(a,b,c){a=fv(a,b);b=null;for(const d of a)if(b=d.attributes[c])break;return b}function ev(a,b,c){a=fv(a,b);b=null;for(const d of a)if(b=Fd(d,c))break;return b}
function gv(a,b,c,d,e,f){const g=Jd(a,"http://www.w3.org/1999/xlink","href"),h=Jd(a,"http://www.w3.org/1999/xlink","actuate")||"onRequest";for(const l of Object.keys(a.attributes)){const m=l.split(":"),n=wd("http://www.w3.org/1999/xlink");m[0]==n&&delete a.attributes[l]}if(f>=5)return hg(new D(2,4,4028));if(h!="onLoad")return hg(new D(2,4,4027));const k=Qb([d],[g]);return e.request(0,tg(k,b)).Ya(l=>{l=rd(l.data,a.tagName);if(!l)return hg(new D(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 hv(a,b,c,k[0],e,f+1)})}
function hv(a,b,c,d,e,f=0){if(Jd(a,"http://www.w3.org/1999/xlink","href")){var g=gv(a,b,c,d,e,f);c&&(g=g.Ya(void 0,()=>hv(a,b,c,d,e,f)));return g}g=[];for(const h of yd(a))Jd(h,"http://www.w3.org/1999/xlink","href")=="urn:mpeg:dash:resolve-to-zero:2013"?a.children=a.children.filter(k=>k!==h):h.tagName!="SegmentTimeline"&&g.push(hv(h,b,c,d,e,f));return mg(g).Ya(()=>a)};function iv(a,b,c,d,e,f,g,h){let k;const l=(new Ug).ra("sidx",m=>{k=jv(b,d,e,f,g,c,m,h)});a&&l.parse(a);if(k)return k;throw new D(2,3,3004);}
function jv(a,b,c,d,e,f,g,h=!1){const k=[];g.reader.skip(4);const l=g.reader.Y();if(l==0)throw new D(2,3,3005);if(g.version==0){var m=g.reader.Y();var n=g.reader.Y()}else m=g.reader.md(),n=g.reader.md();g.reader.skip(2);const p=g.reader.Ga();a=(h?-g.size:a)+g.size+n;for(h=0;h<p;h++){var r=g.reader.Y();n=(r&2147483648)>>>31;r&=2147483647;const q=g.reader.Y();g.reader.skip(4);if(n==1)throw new D(2,3,3006);k.push(new I(m/l+c,(m+q)/l+c,()=>f,a,a+r-1,b,c,d,e));m+=q;a+=r}g.parser.stop();return k};function kv(a){const b=a.g.Qa();var c=a.g.ba();if(c==0)throw new D(2,3,3002);c=8-Math.floor(Math.log2(c));a.g.skip(c-1);return $a(a.h,b,c)}
function lv(a){var b=kv(a);if(b.length>7)throw new D(2,3,3002);var c=0;for(var d of b)c=256*c+d;b=c;c=kv(a);a:{for(e of mv)if(Za(c,new Uint8Array(e))){var e=!0;break a}e=!1}if(e)c=a.h.byteLength-a.g.Qa();else{if(c.length==8&&c[1]&224)throw new D(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.Qa()+c<=a.h.byteLength?c:a.h.byteLength-a.g.Qa();e=db(a.h,a.g.Qa(),c);a.g.skip(c);return new nv(b,e)}
var ov=class{constructor(a){this.h=db(a);this.g=new Jg(this.h,0)}Ma(){return this.g.Ma()}},mv=[[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 pv(a){if(a.g.byteLength>8)throw new D(2,3,3002);if(a.g.byteLength==8&&a.g.getUint8(0)&224)throw new D(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 nv=class{constructor(a,b){this.id=a;this.g=b}};function qv(a,b,c,d,e,f,g){b=new ov(b);if(lv(b).id!=440786851)throw new D(2,3,3008);var h=lv(b);if(h.id!=408125543)throw new D(2,3,3009);b=h.g.byteOffset;h=new ov(h.g);for(var k=null;h.Ma();){var l=lv(h);if(l.id==357149030){k=l;break}}if(!k)throw new D(2,3,3010);k=new ov(k.g);l=1E6;for(h=null;k.Ma();){const m=lv(k);if(m.id==2807729)l=pv(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 D(2,3,3003);}if(h==null)throw new D(2,
3,3011);k=l/1E9;h*=k;a=lv(new ov(a));if(a.id!=475249515)throw new D(2,3,3007);return rv(a,b,k,h,c,d,e,f,g)}function rv(a,b,c,d,e,f,g,h,k){const l=[],m=()=>e;a=new ov(a.g);let n=null,p=null;for(;a.Ma();){var r=lv(a);if(r.id!=187)continue;var q=sv(r);if(!q)continue;r=c*q.kk;q=b+q.Oj;n!=null&&l.push(new I(n+g,r+g,m,p,q-1,f,g,h,k));n=r;p=q}n!=null&&l.push(new I(n+g,d+g,m,p,null,f,g,h,k));return l}
function sv(a){var b=new ov(a.g);a=lv(b);if(a.id!=179)throw new D(2,3,3013);a=pv(a);b=lv(b);if(b.id!=183)throw new D(2,3,3012);b=new ov(b.g);let c=0;for(;b.Ma();){const d=lv(b);if(d.id==241){c=pv(d);break}}return{kk:a,Oj:c}};function tv(a,b,c){b=ev(a,b,"Initialization");if(!b)return null;let d=a.N.ab();var e=b.attributes.sourceURL;e&&(d=Qb(d,[Fb(e)],a.Cb()));e=0;let f=null;if(b=Id(b,"range",Nd))e=b.start,f=b.end;c=new Pi(()=>d,e,f,uv(a),null,null,c,a.xa.encrypted);c.codecs=a.N.codecs;c.mimeType=a.N.mimeType;a.ua&&!a.ua.De&&(c.g=a.ua.start+a.ua.duration);return c}
function uv(a){const b=a.N;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.Qe,pixelAspectRatio:b.pixelAspectRatio||null,width:b.width||null,label:a.xa.label||null,roles:a.roles||null,language:a.xa.language||null}}
function vv(a,b,c){const d=Number(dv(a,wv,"presentationTimeOffset"))||0,e=dv(a,wv,"timescale");let f=1;e&&(f=Pd(e)||1);const g=d/f||0,h=tv(a,wv,c);xv(a,h);const k=od(a);return{endTime:-1,timeline:-1,Fc:()=>{var l=ev(k,wv,"RepresentationIndex");var m=k.N.ab();l&&(l=Fb(l.attributes.sourceURL))&&(m=Qb(m,[l],k.Cb()));l=yv(k);return zv(k,b,h,m,l.start,l.end,g)},timescale:f}}
async function zv(a,b,c,d,e,f,g){const h=a.presentationTimeline,k=!a.kb||!a.ua.De,l=a.ua.start;var m=a.ua.duration;const n=a.N.mimeType.split("/")[1];var p=null;f=[b(d,e,f,!1),n=="webm"?b(c.S(),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.N.ab();const r=p.length!=d.length||p.some((q,t)=>q!=d[t]);p=n=="mp4"?iv(f,e,p,c,g,l,m,r):qv(f,b,p,c,g,l,m);for(const q of p)q.codecs=a.N.codecs,q.mimeType=a.N.mimeType,q.bandwidth=a.bandwidth;
h.Ld(p);p=new ol(p);k&&p.Wc(l,m,!0);return p}function wv(a){return a.pd}function yv(a){const b=ev(a,wv,"RepresentationIndex");a=dv(a,wv,"indexRange");a=Nd(a||"");b&&(a=Id(b,"range",Nd,a));return a}function xv(a,b){Av(a,b);if(!yv(a))throw new D(2,4,4002);}function Av(a,b){const c=a.N.mimeType.split("/")[1];if(a.N.contentType!=F&&c!="mp4"&&c!="webm")throw new D(2,4,4006);if(c=="webm"&&!b)throw new D(2,4,4005);};function Bv(a,b,c){const d=tv(a,Cv,c),e=Dv(a);if(!e.eb&&!e.timeline&&e.fd.length>1)throw new D(2,4,4002);if(!e.eb&&!a.ua.duration&&!e.timeline&&e.fd.length==1)throw new D(2,4,4002);if(e.timeline&&e.timeline.length==0)throw new D(2,4,4002);let f=null,g=null;a.Da.id&&a.N.id&&(g=b.get(a.Da.id+","+a.N.id))&&(f=g.segmentIndex);const h=Ev(a.ua.start,a.ua.duration,a.N.ab,e,d,c,a.N.mimeType,a.N.codecs,a.bandwidth,a.Cb);b=!f;f?f.Jd(h,a.presentationTimeline.yb()):f=new ol(h);a.presentationTimeline.Ld(h);a.kb&&
a.ua.De||f.Wc(a.ua.start,a.ua.duration?a.ua.start+a.ua.duration:Infinity,b);g&&(g.segmentIndex=f);return{endTime:-1,timeline:-1,Fc:()=>{f&&f.getNumReferences()!=0||f.Le(h);return Promise.resolve(f)},timescale:e.timescale}}function Cv(a){return a.mc}function Dv(a){const b=Fv(a);a=cv(a,Cv);let c=a.Rd;c==0&&(c=1);let d=0;a.eb?d=a.eb*(c-1):a.timeline&&a.timeline.length>0&&(d=a.timeline[0].start);return{eb:a.eb,startTime:d,Rd:c,Wb:a.Wb,timescale:a.timescale,timeline:a.timeline,fd:b}}
function Ev(a,b,c,d,e,f,g,h,k,l){let m=d.fd.length;d.timeline&&d.timeline.length!=d.fd.length&&(m=Math.min(d.timeline.length,d.fd.length));const n=a-d.Wb,p=b?a+b:Infinity,r=[];var q=d.startTime;for(let u=0;u<m;u++){const v=d.fd[u];var t=q;q=d.eb!=null?t+d.eb:d.timeline?d.timeline[u].end:t+b;let y=null;t=new I(a+t,a+q,()=>{y==null&&(y=Qb(c(),[v.Cj],l()));return y},v.start,v.end,e,n,a,p,[],"",null,null,Si,f);t.codecs=h;t.mimeType=g;t.bandwidth=k;r.push(t)}return r}
function Fv(a){return[a.N.mc,a.xa.mc,a.Da.mc].filter(lf).map(b=>zd(b,"SegmentURL")).reduce((b,c)=>b.length>0?b:c).map(b=>{b.attributes.indexRange&&!a.hg&&(a.hg=!0);const c=Fb(b.attributes.media);b=Id(b,"mediaRange",Nd,{start:0,end:null});return{Cj:c,start:b.start,end:b.end}})};function Gv(a,b,c,d,e,f,g,h,k,l){k||a.N.Ae||(a.N.Ae=dv(a,Hv,"initialization"));const m=a.N.Ae?Iv(a,g):null,n=Jv(a);Kv(n);const p=od(a);if(n.Gd)return Av(a,m),{endTime:-1,timeline:-1,Fc:()=>{var v=bv(n.Gd,p.N.originalId,null,null,p.bandwidth||null,null);v=Qb(p.N.ab(),[v]);return zv(p,b,m,v,0,null,n.Wb)},timescale:n.timescale};if(n.eb){if(!d&&a.xa.contentType!=="image"&&a.xa.contentType!=="text"){l=a.ua.start;var r=a.Da.id;d=a.ua.duration;r=(r=r!=null&&f.get(r)||d)?l+r:Infinity;a.presentationTimeline.og(n.eb);
a.presentationTimeline.Ch(l,r)}return{endTime:-1,timeline:-1,Fc:()=>Lv(p,n,e,m,f,g,h,a.N.Ye),timescale:n.timescale}}let q=null;d=d=null;a.Da.id&&a.N.id&&(d=a.Da.id+","+a.N.id,d=c.get(d))&&(q=d.segmentIndex);const t=a.ua.start,u=a.ua.duration?t+a.ua.duration:Infinity;if(q)l=q,Mv(l,n,t,u,m,a.kb),l.Ua(a.presentationTimeline.yb());else{c=0;k=-1;if(a.Da.id!=null&&a.N.id!=null){const v=l.get(a.Da.id);if(v)k=v.timeline;else for(r of l.values())if(Math.abs(n.Wb-r.endTime)<=Yb&&r.yg.includes(a.N.id)){k=r.timeline;
break}else r.timeline>=c&&(c=r.timeline+1)}k==-1&&(k=c);q=new Nv(a.kb,n,a.N.originalId,a.bandwidth,a.N.ab,a.Cb,t,u,m,g,a.N.Ye,k)}n.timeline&&a.xa.contentType!=="image"&&a.xa.contentType!=="text"&&a.presentationTimeline.Dh(q.h?q.h.timeline:[],t);d&&a.kb&&(d.segmentIndex=q);l=(l=(l=n.timeline)&&l[l.length-1])?l.end+n.Wb:-1;r=-1;q instanceof Nv&&(r=q.A());return{endTime:l,timeline:r,Fc:()=>{q instanceof Nv&&q.getNumReferences()==0&&Mv(q,n,t,u,m,a.kb);return Promise.resolve(q)},timescale:n.timescale}}
function Hv(a){return a.Cc}function Jv(a){const b=cv(a,Hv),c=dv(a,Hv,"media"),d=dv(a,Hv,"index"),e=dv(a,Hv,"k");let f=0;e&&(f=parseInt(e,10));return{gf:b.gf,eb:b.eb,timescale:b.timescale,Rd:b.Rd,Wb:b.Wb,Pc:b.Pc,timeline:b.timeline,Ub:c&&Fb(c),Gd:d,mimeType:a.N.mimeType,codecs:a.N.codecs,bandwidth:a.bandwidth,Ej:f}}function Kv(a){let b;b=a.Gd?1:0;b+=a.timeline?1:0;b+=a.eb?1:0;if(b==0)throw new D(2,4,4002);b!=1&&(a.Gd&&(a.timeline=null),a.gf=null,a.eb=null);if(!a.Gd&&!a.Ub)throw new D(2,4,4002);}
function Lv(a,b,c,d,e,f,g,h){const k=a.presentationTimeline,l=a.ua.start,m=a.Da.id,n=a.ua.duration,p=()=>{const M=m!=null&&e.get(m)||n;return M?l+M:Infinity},r=b.eb,q=b.Rd,t=b.Ub,u=a.bandwidth||null,v=a.N.originalId,y=a.N.ab,w=a.Cb,z=l-b.Wb,A=()=>{var M=[Math.max(k.yb(),l),Math.min(k.vc(),p())].map(N=>N-l);M=[Math.ceil(M[0]/r),Math.ceil(M[1]/r)-1];a.N.ib&&M[1]++;return M.map(N=>N+q)};var B=A();c=a.kb?Math.max(B[0],B[1]-c+1):B[0];g=g||B[1];const E=M=>{var N=M-q,ia=N*r,L=b.gf;let fa=N*L;"BigInt"in window&&
fa>Number.MAX_SAFE_INTEGER&&(fa=BigInt(N)*BigInt(L));ia+=l;N=ia+r;L=Math.min(N,p());const Q=[],ua=b.Ej;if(ua){const Va=(L-ia)/ua;for(let Ab=0;Ab<ua;Ab++){var Ra=ia+Va*Ab;const rb=Ab;Ra=new I(Ra,Ra+Va,()=>{const dc=bv(t,v,M,rb,u,fa);return Qb(y(),[dc],w())},0,null,d,z,l,p(),[],"",null,null,Si,f);Ra.codecs=a.N.codecs;Ra.mimeType=a.N.mimeType;h==0?Ab>0&&Ra.dd():Ab%h!=0&&Ra.dd();Q.push(Ra)}}ia=new I(ia,L,()=>{if(ua)return[];const Va=bv(t,v,M,null,u,fa);return Qb(y(),[Va],w())},0,null,d,z,l,p(),Q,"",null,
null,Si,f,Q.length>0);ia.codecs=a.N.codecs;ia.mimeType=a.N.mimeType;ia.bandwidth=a.bandwidth;ia.j=N;return ia},G=new Ov(c,g,q,l,r,E);B=k.vc()<p();const ea=k.U();if(B||ea){let M=Math.max(c,g+1);c=r;a.N.ib&&(c=.1);G.hf(c,()=>{const N=k.yb();G.Ua(N);const [,ia]=A(),L=[];for(;M<=ia;){const fa=E(M);L.push(fa);M++}return N>p()&&!L.length?null:L})}return Promise.resolve(G)}
function Iv(a,b){let c=a.N.Ae;c||=dv(a,Hv,"initialization");if(!c)return null;c=Fb(c);const d=a.N.originalId,e=a.bandwidth||null,f=a.N.ab,g=a.Cb;b=new Pi(()=>{const h=bv(c,d,null,null,e,null);return Qb(f(),[h],g())},0,null,uv(a),null,null,b,a.xa.encrypted);b.codecs=a.N.codecs;b.mimeType=a.N.mimeType;a.ua&&!a.ua.De&&(b.g=a.ua.start+a.ua.duration);return b}
var Ov=class extends ol{constructor(a,b,c,d,e,f){super(Array(Math.max(0,b-a+1)));this.h=a;this.B=c;this.j=d;this.l=e;this.C=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.B-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.C(this.h+a),this.g[b]=c);return c}wb(){return this.get(this.i)}mb(a){for(let b=0;b<this.g.length;b++){const c=this.get(b+this.i);c&&a(c)}}Ua(a){if(!this.u){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.B-1)-(this.h+this.i)+1)),a>0&&(this.i+=a,this.g=this.g.slice(a)))}}}};
function Pv(a,b,c,d,e,f,g,h){a=bv(a,b,c,f,d||null,e);return Qb(g(),[a],h()).map(k=>k.toString())}
function Mv(a,b,c,d,e,f){Qv(a,e);a.F=f;if(a.h){if(a.h.Pc!==b.Pc)for(c=b.Pc-a.h.Pc,e=0;e<b.timeline.length;e++)f=b.timeline[e],f.td+=c,f.Qg+=c,f.start=(f.td+c)/b.timescale,f.end=(f.Qg+c)/b.timescale;a.h.Ub!==b.Ub&&(a.h.Ub=b.Ub);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;Rv(a)}
function Rv(a){if(a.h&&!a.u){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.Ua(a.j)}}function Qv(a,b){if(a.B!==b){a.B=b;for(const c of a.g)c&&Ri(c,b)}}
var Nv=class extends ol{constructor(a,b,c,d,e,f,g,h,k,l,m,n){super([]);this.F=a;this.h=b;this.H=c;this.D=d;this.G=e;this.J=f;this.j=g;this.l=h;this.B=k;this.C=l;this.I=m;this.K=n;Rv(this)}getNumReferences(){return this.h?this.h.timeline.length:0}release(){super.release();this.h=null}Ua(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=wc(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.Wj,f=b.td+this.h.Pc,
g=this.j-this.h.Wb,h=this.j+b.end;let k=h;a===this.getNumReferences()-1&&this.l!==Infinity&&(k=this.F&&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.kc&&this.h&&this.h.Ub&&(c=this.h.Ub.includes("$SubNumber$"));if(c){c=(b.end-b.start)/b.kc;for(let r=0;r<b.kc;r++){var d=b.start+c*r;const q=r;let t=null;d=new I(this.j+d,this.j+(d+c),()=>{if(!this.h)return[];t==null&&(t=Pv(this.h.Ub,this.H,e,this.D,f,q,this.G,this.J));return t},
0,null,this.B,g,this.j,this.l,[],"",null,null,Si,this.C);d.codecs=l;d.mimeType=m;d.bandwidth=n;this.I==0?r>0&&d.dd():r%this.I!=0&&d.dd();p.push(d)}}b=new I(this.j+b.start,k,()=>p.length>0||!this.h?[]:Pv(this.h.Ub,this.H,e,this.D,f,null,this.G,this.J),0,null,this.B,g,this.j,this.l,p,"",null,null,Si,this.C,p.length>0);b.codecs=l;b.mimeType=m;b.j=h;b.bandwidth=n;this.g[a]=b}return b}mb(a){Rv(this);for(let b=0;b<this.getNumReferences();b++){const c=this.get(b+this.i);c&&a(c)}}A(){return this.K}};function Sv(a,b){if(!a.m.length)return b;b=new Ha(b);const c=a.C||a.m[0],d=Math.round(a.B.getBandwidthEstimate()),e=b.g;a.A=="DASH"?(e.add("_DASH_pathway",c),e.add("_DASH_throughput",String(d))):a.A=="HLS"&&(e.add("_HLS_pathway",c),e.add("_HLS_throughput",String(d)));Ya(e);e.xd&&La(b,e);return b.toString()}function Tv(a,b,c){a.g!=null&&(a.g.stop(),a.g=null);const d=b["RELOAD-URI"]||c;a.g=new H(()=>{Uv(a,d)});if(c=b.TTL)a.D=c;a.g.Z(a.D);a.m=b["PATHWAY-PRIORITY"]||[];a.F=b["PATHWAY-CLONES"]||[]}
async function Uv(a,b){var c=Qb(a.i,[Sv(a,b)]);c=a.B.networkingEngine.request(8,tg(c,a.u.retryParameters));og(a.G,c);try{const d=await c.promise,e=xb(d.data),f=JSON.parse(e);f.VERSION==1&&Tv(a,f,d.uri)}catch(d){d&&d.code==7001||(a.g!=null&&(a.g.stop(),a.g=null),a.g=new H(()=>{Uv(a,b)}),a.g.Z(a.D))}}function Vv(a,b,c,d){let e=a.l.get(b);e||=new Map;e.set(c,d);a.l.set(b,e)}
function Wv(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({ug:h,location:e});else if(e=a.F.find(k=>k.Mk==h)){var f=b.get(e["BASE-ID"]);f&&(e["URI-REPLACEMENT"].ei?(f=new Ha(f),Ja(f,e["URI-REPLACEMENT"].ei),d.push({ug:h,location:f.toString()})):d.push({ug: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 Ha(h.location)).ub))return!1;return!0});d.length&&(a.C=d[0].ug);
g=d.map(h=>h.location);if(!g.length&&a.h)for(const h of a.h.split(","))if(d=b.get(h))a.C=a.h,g.push(d);if(!g.length)for(const h of b.values())g.push(h);return c?g:Qb(a.i,g)}
var Xv=class{constructor(a){this.u=null;this.B=a;this.G=new pg;this.i=[];this.h=null;this.m=[];this.C=null;this.F=[];this.D=300;this.l=new Map;this.j=new Map;this.g=null;this.A="UNKNOWN"}configure(a){this.u=a}destroy(){this.B=this.u=null;this.i=[];this.h=null;this.m=[];this.F=[];this.l.clear();this.g!=null&&(this.g.stop(),this.g=null);return this.G.destroy()}setManifestType(a){this.A=a}banLocation(a){this.j.set(a,Date.now()+6E4)}};function Yv(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 Zv(a,b){var c=(d,e)=>{d||=[];for(const f of e)d.includes(f)||d.push(f);return d};a.roles=c(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=c(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(const d of b.keyIds)a.keyIds.add(d);a.originalId==null?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=","+c);c=jb(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new D(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));b.trickModeVideo?(a.trickModeVideo||(a.trickModeVideo=Yv(b.trickModeVideo),a.trickModeVideo.matchedStreams=[],a.trickModeVideo.createSegmentIndex=()=>{if(a.trickModeVideo.segmentIndex)return Promise.resolve();const d=new sl;for(const e of a.trickModeVideo.matchedStreams)d.h.push(e.segmentIndex);a.trickModeVideo.segmentIndex=
d;return Promise.resolve()}),a.trickModeVideo.matchedStreams.push(b.trickModeVideo),Zv(a.trickModeVideo,b.trickModeVideo)):a.trickModeVideo&&(a.trickModeVideo.matchedStreams.push(b),Zv(a.trickModeVideo,b));b.dependencyStream?(a.dependencyStream||(a.dependencyStream=Yv(b.dependencyStream),a.dependencyStream.matchedStreams=[],a.dependencyStream.createSegmentIndex=()=>{if(a.dependencyStream.segmentIndex)return Promise.resolve();const d=new sl;for(const e of a.dependencyStream.matchedStreams)d.h.push(e.segmentIndex);
a.dependencyStream.segmentIndex=d;return Promise.resolve()}),a.dependencyStream.matchedStreams.push(b.dependencyStream),Zv(a.dependencyStream,b.dependencyStream)):a.dependencyStream&&(a.dependencyStream.matchedStreams.push(b),Zv(a.dependencyStream,b))}
async function $v(a){if(a.length==1)return a[0];var b=a.map(k=>new Map(k.filter(l=>l.type==="audio").map(l=>[aw(l),l]))),c=a.map(k=>new Map(k.filter(l=>l.type==="video").map(l=>[bw(l),l]))),d=a.map(k=>new Map(k.filter(l=>l.type===F).map(l=>[cw(l),l])));a=a.map(k=>new Map(k.filter(l=>l.type==="image").map(l=>[dw(l),l])));for(var e of d){const k=ew(F);e.set(cw(k),k)}for(var f of a)e=ew("image"),f.set(dw(e),e);f=new fw;b=await gw(f,[],b,0,hw,iw,0);c=await gw(f,[],c,0,hw,iw,0);d=await gw(f,[],d,0,hw,
iw,0);a=await gw(f,[],a,0,hw,iw,0);f=0;if(c.length&&b.length)for(var g of b)for(const k of c){var h=f++;k.variantIds.push(h);g.variantIds.push(h)}else{g=c.concat(b);for(h of g)h.variantIds=[f++]}return c.concat(b).concat(d).concat(a)}function hw(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 iw(a,b){var c=a.roles,d=b.roles;c||=[];for(const e of d)c.includes(e)||c.push(e);a.roles=c;for(const e of b.keyIds)a.keyIds.add(e);a.encrypted=a.encrypted&&b.encrypted;a.segments.push(...b.segments);if(b.closedCaptions){a.closedCaptions||(a.closedCaptions=new Map);for(const [e,f]of b.closedCaptions)a.closedCaptions.set(e,f)}}function jw(a){switch(a.type){case F:return!a.language;case "image":return!a.tilesLayout;default:return!1}}
async function kw(a,b){var c=[];const d=a.matchedStreams;for(let e=b;e<d.length;e++){const f=d[e];c.push(f.createSegmentIndex());f.trickModeVideo&&!f.trickModeVideo.segmentIndex&&c.push(f.trickModeVideo.createSegmentIndex());f.dependencyStream&&!f.dependencyStream.segmentIndex&&c.push(f.dependencyStream.createSegmentIndex())}await Promise.all(c);if(a.segmentIndex instanceof sl)for(;b<d.length;b++)c=d[b],c.segmentIndex&&a.segmentIndex.h.push(c.segmentIndex)}
function lw(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"&&hc(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 aw(a){return mw([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,a.codecs,a.mimeType,a.roles,a.audioSamplingRate,a.primary,a.dependencyStream?a.dependencyStream.baseOriginalId:null,Array.from(a.keyIds)])}
function bw(a){return mw([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?a.dependencyStream.baseOriginalId:null,Array.from(a.keyIds)])}function cw(a){return mw([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}function dw(a){return mw([a.width,a.codecs,a.mimeType])}
function nw(a,b){return b.language?a.forced!==b.forced||hc(a.language,b.language)==0||b.kind!=a.kind?!1:!0:!0}function ow(){return!0}
function pw(a,b,c){var d=qw(a,b,c);if(d===rw)return!0;if(d===sw)return!1;d=hc(a.language,b.language);var e=hc(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=tw(a.channelsCount,b.channelsCount,c.channelsCount);if(d==rw)return!0;if(d==sw)return!1;d=tw(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==rw?!0:d==sw?!1:a.bandwidth&&uw(a.bandwidth,b.bandwidth,c.bandwidth)==rw?!0:!1}
function vw(a,b,c){var d=qw(a,b,c);if(d===rw)return!0;if(d===sw)return!1;d=tw(a.width*a.height,b.width*b.height,c.width*c.height);if(d==rw)return!0;if(d==sw)return!1;if(a.frameRate){d=tw(a.frameRate,b.frameRate,c.frameRate);if(d==rw)return!0;if(d==sw)return!1}return a.bandwidth&&uw(a.bandwidth,b.bandwidth,c.bandwidth)==rw?!0:!1}
function ww(a,b,c){var d=hc(a.language,b.language),e=hc(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 xw(a,b,c){return tw(a.width*a.height,b.width*b.height,c.width*c.height)==rw?!0:!1}function yw(a,b){return a.mimeType!=b.mimeType?!1:zw(a.codecs)===zw(b.codecs)}function zw(a){if(!Aw.has(a)){const b=Oe(a);Aw.set(a,b)}return Aw.get(a)}
function qw(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 sw;if(!d&&e)return rw;b=yw(a,b);a=yw(a,c);return b&&!a?sw:!b&&a?rw:Bw}function tw(a,b,c){if(b==a&&a!=c)return sw;if(c==a&&a!=b)return rw;if(b>a){if(c<=a||c-a<b-a)return rw;if(c-a>b-a)return sw}else{if(c>a)return sw;if(a-c<a-b)return rw;if(a-c>a-b)return sw}return Bw}function uw(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?rw:b<a?sw:Bw}
function ew(a){return{id:0,originalId:"",groupId:null,primary:!1,type:a,mimeType:"",codecs:"",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 Cw(a){return{id:0,originalId:"",groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ol([]),mimeType:"",codecs:"",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 mw(a){return JSON.stringify(a)}async function gw(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 Dw(a,k,c,d,f,h,g))throw new D(2,4,4037);for(const k of h)for(const l of k)(d=Ew(a,b,l,c,e,f,h))&&b.push(d);for(const k of h)for(const l of k)if(!jw(l)&&b.some(m=>l.drmInfos&&!hb(l.drmInfos,m.drmInfos)?!1:!0))throw new D(2,4,4037);return b}
function Fw(a,b){const c=[],d=[],e=[],f=[];for(const h of a){a=new Map(h.audioStreams.map(n=>[aw(n),n]));const k=new Map(h.videoStreams.map(n=>[bw(n),n])),l=new Map(h.textStreams.map(n=>[cw(n),n])),m=new Map(h.imageStreams.map(n=>[dw(n),n]));if(b){var g=Cw(F);l.set(cw(g),g);g=Cw("image");m.set(dw(g),g)}c.push(a);d.push(k);e.push(l);f.push(m)}return{Xg:c,bi:d,Vh:e,sh:f}}
async function Dw(a,b,c,d,e,f,g){Gw(a,c,b,g>0);if(!b.matchedStreams)return!1;b.segmentIndex&&await kw(b,d+g);lw(b,d,e,f,g);return!0}
function Ew(a,b,c,d,e,f,g){if(jw(c))return null;const h=e(c);Gw(a,d,h);h.createSegmentIndex&&(h.createSegmentIndex=async()=>{h.segmentIndex||(h.segmentIndex=new sl,await kw(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;lw(h,0,f,g,0);return h}function Gw(a,b,c,d=!1){d=d?c.matchedStreams:[];for(const e of b){b=Hw(a,e,c);if(!b)return;d.push(b)}c.matchedStreams=d}
function Hw(a,b,c){const d={audio:aw,video:bw,text:cw,image:dw}[c.type];let e=null;var f=d(c);if(b.has(f))e=b.get(f);else{f={audio:(h,k)=>h.drmInfos&&!hb(h.drmInfos,k.drmInfos)?!1:!0,video:(h,k)=>h.drmInfos&&!hb(h.drmInfos,k.drmInfos)?!1:!0,text:nw,image:ow}[c.type];const g={audio:pw,video:vw,text:ww,image:xw}[c.type];for(const h of b.values())!f(c,h)||c.fastSwitching!=h.fastSwitching||e&&!g(c,e,h)||(e=h)}a.u&&!jw(e)&&b.delete(d(e));return e}
var fw=class{constructor(){this.l=[];this.h=[];this.g=[];this.j=[];this.i=[];this.u=!1;this.m=new Set}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.u=!1;this.m.clear()}ij(){return this.l}cg(){return this.j.slice()}Li(){return this.i}fh(a,b){if(a){if(a.type=="audio")for(const c of this.h)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);else if(a.type=="video")for(const c of this.g)c.matchedStreams=
c.matchedStreams.filter(d=>d!==a),c.trickModeVideo&&(c.trickModeVideo.matchedStreams=c.trickModeVideo.matchedStreams.filter(d=>d!==a)),c.dependencyStream&&(c.dependencyStream.matchedStreams=c.dependencyStream.matchedStreams.filter(d=>d!==a));else if(a.type==F)for(const c of this.j)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);else if(a.type=="image")for(const c of this.i)c.matchedStreams=c.matchedStreams.filter(d=>d!==a);a.segmentIndex&&a.closeSegmentIndex();this.m.delete(b)}}async zf(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 {Xg:h,bi:k,Vh:l,sh:m}=Fw(a,!0);await Promise.all([gw(this,this.h,h,c,Yv,Zv,b),gw(this,this.g,k,c,Yv,Zv,b),gw(this,this.j,l,c,Yv,Zv,b),gw(this,this.i,m,c,Yv,Zv,b)])}else{const {Xg:h,bi:k,Vh:l,sh:m}=Fw(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=jb(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}Rh(a){this.u=a}};x("shaka.util.PeriodCombiner",fw);fw.prototype.setUseStreamOnce=fw.prototype.Rh;fw.prototype.combinePeriods=fw.prototype.zf;
fw.prototype.deleteStream=fw.prototype.fh;fw.prototype.getImageStreams=fw.prototype.Li;fw.prototype.getTextStreams=fw.prototype.cg;fw.prototype.getVariants=fw.prototype.ij;var rw=1,Bw=0,sw=-1,Aw=new Map;function Iw(a,b){var c=new DOMParser;const d=Jw.value()(a);a=null;try{a=c.parseFromString(d,"text/xml")}catch(e){return null}c=a.documentElement;if(!c||c.getElementsByTagName("parsererror").length||c.tagName!=b)return null;if(!("createNodeIterator"in document))return c;for(b=document.createNodeIterator(a,NodeFilter.SHOW_ALL);a=b.nextNode();)if(a instanceof HTMLElement||a instanceof SVGElement)return null;return c}function Kw(a,b){try{const c=Bb(a);return Iw(c,b)}catch(c){return null}}
var Jw=new fb(()=>{if(typeof trustedTypes!=="undefined"){const a=trustedTypes.createPolicy("shaka-player#xml",{createHTML:b=>b});return b=>a.createHTML(b)}return a=>a});function Lw(a,b,c){return()=>a&&b?Wv(a,"BaseURL"):c.slice()}function Mw(){return""}function Nw(a,b){b=Ie(a,b);return Ye(b)?F:a.split("/")[0]}async function Ow(a){let b=0;try{b=await Pw(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(),Qw(a,b))}
async function Pw(a){var b=4,c="MPD",d=Rw(a);let e=a.B;d.length?(e=d,c="Patch",b=6):a.B.length>1&&a.i&&(d=Wv(a.i,"Location",!0),d.length&&(e=d));d=Date.now();b=await Sw(a,tg(e,a.g.retryParameters),0,{type:b});if(!a.j)return 0;b.uri&&b.uri!=b.originalUri&&!a.B.includes(b.uri)&&a.B.unshift(b.uri);a.V=(new Ha(b.uri)).g.toString();await Tw(a,b.data,b.uri,c);c=(Date.now()-d)/1E3;a.za.sample(1,c);a.X.clear();return c}
function Qw(a,b){if(!(a.K<0)){var c=a.K;a.g.updatePeriod>=0&&(c=a.g.updatePeriod);a.L.Z(Math.max(c-b,pc(a.za)))}}function Rw(a){const b=a.l.Nd;if(!a.l.Ne||!b||!a.H.length)return[];const c=Date.now()/1E3,d=a.H.filter(e=>{e=Qd(e.attributes.ttl);return!e||b+e>c}).map(Bd).filter(lf);return d.length?Qb(a.B,d):[]}function Sw(a,b,c,d){d||={};d.isPreload=a.$();b=a.j.networkingEngine.request(c,b,d);og(a.P,b);return b.promise}
async function Tw(a,b,c,d){var e=b;b=a.g.dash.manifestPreprocessor;if(b!=qn){Ic("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead.");e=Kw(e,d);if(!e)throw new D(2,4,4001,c);b(e);e=Cb(e.outerHTML)}b=rd(e,d);if(!b)throw new D(2,4,4001,c);e=a.g.dash.manifestPreprocessorTXml;e!=rn&&e(b);if(d==="Patch")return Uw(a,b);if(a.g.dash.disableXlinkProcessing)return Vw(a,b,c);d=hv(b,a.g.retryParameters,a.g.dash.xlinkFailGracefully,c,a.j.networkingEngine);
og(a.P,d);d=await d.promise;return Vw(a,d,c)}
async function Uw(a,b){var c=b.attributes.mpdId,d=Id(b,"originalPublishTime",Ld);if(!c||c!==a.l.Ne||d!==a.l.Nd)throw a.H=[],new D(1,4,4052);c=[];d=[];const e=new Set;for(const k of yd(b)){b=Ud(k.attributes.sel||"");var f=b[b.length-1];b=Bd(k)||"";if(f.name==="MPD")if(f.qc==="mediaPresentationDuration"){if(f=Bd(k)||"",b=a,f=Md(f),f!=null){b.l.fc=f;for(const l of b.A.values())l.fc=f}}else if(f.qc==="type"){f=a;f.h.presentationTimeline.Nc(b=="static");f.l.type=b;for(const l of f.A.values())l.kb=b=="dynamic";
b=="static"&&(f.K=-1)}else f.qc==="publishTime"?a.l.Nd=Ld(b)||0:f.qc===null&&k.tagName==="add"&&d.push(k);else if(f.name==="PatchLocation")Vd(a.H,k);else if(f.name==="Period")k.tagName==="add"?d.push(k):k.tagName==="remove"&&f.id&&Ww(a,f.id);else if(f.name==="SegmentTemplate"){a:{b=a;var g=Ud(k.attributes.sel||"");f=g[g.length-1];if(!f.qc){b=[];break a}g=Xw(b,g);var h=Bd(k)||"";for(const l of g){const m=b.A.get(l);Xd(m.N.Cc,k.tagName,f.qc,h)}b=g}for(const l of b)e.add(l)}else if(f.name==="SegmentTimeline"||
f.name==="S"){b=a;f=Ud(k.attributes.sel||"");f=Xw(b,f);for(const l of f)g=b.A.get(l),g=ev(g,Hv,"SegmentTimeline"),h=zd(g,"S"),Vd(h,k),g.children=h;b=f;for(const l of b)e.add(l)}}for(const k of e)Yw(a,k);for(const k of d)c.push(...Zw(a,{kb:a.l.type=="dynamic",presentationTimeline:a.h.presentationTimeline,Da:null,ua:null,xa:null,N:null,bandwidth:0,hg:!1,ib:a.l.ib,profiles:a.l.profiles,fc:a.l.fc,roles:null,Cb:Mw},a.l.ab,k,!0).periods);c.length&&(a.h.periodCount+=c.length,a.h.gapCount=a.M,await $w(a,
c,!0));a.l.type=="static"&&a.h.presentationTimeline.qb(a.l.fc||Infinity)}
async function Vw(a,b,c){a.i&&a.i.l.clear();c=[c];var d=[],e=new Map,f=zd(b,"Location");for(var g of f){f=g.attributes.serviceLocation;var h=Bd(g);if(!h)continue;h=Qb(c,[h])[0];f&&(a.i?Vv(a.i,"Location",f,h):e.set(f,h));d.push(h)}a.i?(g=Wv(a.i,"Location",!0),g.length>0&&(c=a.B=g)):d.length&&(c=a.B=d);a.l.Ne=b.attributes.id||"";a.l.Nd=Id(b,"publishTime",Ld)||0;a.H=zd(b,"PatchLocation");g=Promise.resolve();if((d=Fd(b,"ContentSteering"))&&a.j){f=d.attributes.defaultServiceLocation;a.i?(a.i.i=c,a.i.h=
f):(a.i=new Xv(a.j),a.i.configure(a.g),a.i.setManifestType("DASH"),a.i.i=c,a.i.h=f,(f=Bd(d))&&(Id(d,"queryBeforeStart",Sd,!1)?g=Uv(a.i,f):Uv(a.i,f)));for(var k of e.keys())d=e.get(k),Vv(a.i,"Location",k,d)}k=zd(b,"BaseURL");e=!1;if(a.i)for(var l of k)d=l.attributes.serviceLocation,f=Bd(l),d&&f&&(Vv(a.i,"BaseURL",d,f),e=!0);a.na.splice(0);e&&a.i||(l=k.map(Bd),a.na.push(...Qb(c,l)));c=Lw.call(ax,a.i,e,a.na);a.l.ab=c;f=0;k&&k.length&&(f=Id(k[0],"availabilityTimeOffset",Rd)||0);a.l.ib=f;a.K=Id(b,"minimumUpdatePeriod",
Md,-1);l=Id(b,"availabilityStartTime",Ld);h=Id(b,"timeShiftBufferDepth",Md);k=null;a.g.dash.ignoreSuggestedPresentationDelay||(k=Id(b,"suggestedPresentationDelay",Md));e=null;a.g.dash.ignoreMaxSegmentDuration||(e=Id(b,"maxSegmentDuration",Md));d=b.attributes.type||"static";a.h&&a.h.presentationTimeline&&(a.T=a.h.presentationTimeline.U()&&d=="static");a.l.type=d;if(a.h){l=a.h.presentationTimeline;var m=l.yb();for(var n of a.u.values())n.segmentIndex&&n.segmentIndex.Ua(m)}else n=0,a.g.dash.ignoreMinBufferTime||
(n=Id(b,"minBufferTime",Md)||0),l=new Ok(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.Nc(d=="static");l.U()&&!isNaN(a.g.availabilityWindowOverride)&&(h=a.g.availabilityWindowOverride);h==null&&(h=Infinity);l.bf(h);n=b.attributes.profiles||"";a.l.profiles=n.split(",");f={kb:d!="static",presentationTimeline:l,Da:null,ua:null,xa:null,N:null,bandwidth:0,hg:!1,ib:f,fc:null,profiles:n.split(","),roles:null,
Cb:Mw};await g;a.M=0;g=Zw(a,f,c,b,!1);h=g.duration;n=g.periods;(d!="static"||a.T)&&g.hh||l.qb(h||Infinity);a.R&&a.ea&&l.Lh(a.W);l.og(e||1);a.R&&a.ea&&l.Gg(k!=null?k:a.g.defaultPresentationDelay);if(a.h)a.h.periodCount=n.length,a.h.gapCount=a.M,await $w(a,n,!1);else{await a.m.zf(n,f.kb);g=l;k=a.m.l;e=a.m.cg();d=a.m.i;f=a.g.dash.sequenceMode;if(m=Fd(b,"ServiceDescription"))if(h=Fd(m,"Latency"),m=Fd(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=zd(b,"SupplementalProperty");if(m.length)for(r of m)if(r.attributes.schemeIdUri=="urn:mpeg:dash:chaining:2016"){var r=r.attributes.value;break a}r=null}a.h={presentationTimeline:g,
variants:k,textStreams:e,imageStreams:d,offlineSessionIds:[],sequenceMode:f,ignoreManifestTimestampsInSegmentsMode:!1,type:"DASH",serviceDescription:h,nextUrl:r,periodCount:n.length,gapCount:a.M,isLowLatency:a.R,startTime:null};if(l.$h()){b=zd(b,"UTCTiming");b=await bx(a,c,b);if(!a.j)return;l.Mh(b)}l.Je();a.m&&!a.h.presentationTimeline.U()&&a.m.release()}a.j.makeTextStreamsForClosedCaptions(a.h);cx(a);dx(a,n)}
function Zw(a,b,c,d,e){let f=b.fc;f||(f=Id(d,"mediaPresentationDuration",Md),a.l.fc=f);let g=0;a.h&&a.h.presentationTimeline&&a.T&&(g=a.h.presentationTimeline.Qb());const h=[];var k=g;d=zd(d,"Period");const l=b.kb;l||a.G.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=Id(n,"start",Md,k);var r=n.attributes.id;const v=Id(n,"duration",Md);u=t==0&&u==0&&a.T?g:u;let y=null;if(p){var q=Id(p,"start",Md);q!=null&&(y=q-u+g)}else f!=null&&(y=f-u+g);
q=Yb;y&&v&&Math.abs(y-v)>q&&y>v&&a.M++;y==null&&(y=v);if(a.O!==null&&r!=null&&u!==null&&u<a.O&&!a.D.includes(r)&&t+1!=d.length)continue;u!==null&&(a.O===null||u>a.O)&&(a.O=u);k={start:u,duration:y,node:n,De:y==null||!p};n=null;p=t>0&&t<d.length-1;l&&m&&p&&!e&&(r??="__shaka_period_"+u,m.has(r)&&(r=a.G.get(r))&&(n=r));n||(n=ex(a,b,c,k),l&&n.id&&a.G.set(n.id,n));h.push(n);n.id&&y&&a.oa.set(n.id,y);if(y==null){k=null;break}k=u+y}l&&!e&&fx(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,hh:!1}:{periods:h,duration:k,hh:!0}}async function $w(a,b,c){await a.m.zf(b,!0,c);a.h.variants=a.m.l;b=a.m.cg();b.length>0&&(a.h.textStreams=b);a.h.imageStreams=a.m.i;a.j.filter(a.h)}
async function bx(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 gx(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 gx(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":sa("NTP UTCTiming scheme is not supported");break;default:sa("Unrecognized scheme in UTCTiming element",f)}}catch(f){}sa("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!");return 0}
function cx(a){var b=Array.from(a.F.keys()).filter(c=>!a.D.includes(c));for(const c of b){b=!0;for(const d of a.F.get(c)){const e=a.u.get(d);e&&(e.segmentIndex&&e.segmentIndex.getNumReferences()!=0?b=!1:(a.m&&a.m.fh(e,c),a.u.delete(d)))}b&&a.F.delete(c)}}function dx(a,b){b=new Set(b.map(c=>c.id));for(const c of a.C.keys())b.has(c)||a.C.delete(c)}
function Ww(a,b){a.h.periodCount--;for(const c of a.A.keys())if(c.startsWith(b)){const d=a.A.get(c);ev(d,Hv,"SegmentTimeline").children=[];Yw(a,c);a.A.delete(c)}a.D=a.D.filter(c=>c!==b);a.G.delete(b)}
function Yw(a,b){var c=a.A.get(b);const d=a.u.get(b);d.segmentIndex&&d.segmentIndex.Ua(a.h.presentationTimeline.yb());try{const e=Gv(c,(f,g,h,k)=>hx(a,f,g,h,k),a.u,!0,a.g.dash.initialSegmentLimit,a.oa,c.N.aesKey,null,!0,a.C);d.createSegmentIndex=async()=>{d.segmentIndex||(d.segmentIndex=await e.Fc())}}catch(e){if(b=c.N.contentType,c=b=="image",b!=F&&b!="application"&&!c||e.code!=4002)throw e;}}
function Xw(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.A.values())g.Da.id===c&&g.xa.id===d&&g.N.id&&b.push(c+","+g.N.id);else if(e>-1)for(const g of a.A.values())g.Da.id===c&&g.xa.position===e&&g.N.id&&b.push(c+","+g.N.id);return b}
async function hx(a,b,c,d,e){e=e?0:1;b=$l(b,c,d,a.g.retryParameters);return(await Sw(a,b,zg,{type:e})).data}
function ex(a,b,c,d){b.Da=ix(a,d.node,null,c);b.ua=d;b.Da.ib=b.ib;b.Da.id||(b.Da.id="__shaka_period_"+d.start);c=zd(d.node,"EventStream");const e=b.presentationTimeline.yb();for(var f of c)jx(a,d.start,d.duration,f,e);f=zd(d.node,"SupplementalProperty");for(var g of f)g.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"&&(f=kx(a,g))&&(b.Cb=f);g=zd(d.node,"AdaptationSet").map((t,u)=>lx(a,b,u,t)).filter(lf);if(b.kb){f=[];for(var h of g)for(var k of h.Rj)f.push(k);if(f.length!=(new Set(f)).size)throw new D(2,
4,4018);}h=new Map;for(var l of g)for(const [t,u]of l.ri)h.set(t,u);if(h.size){l=null;for(const t of g){k=[];for(const u of t.streams)if(h.has(u.originalId)){l||=zd(d.node,"AdaptationSet").map((v,y)=>lx(a,b,y,v)).filter(lf);for(const v of l)if(f=v.streams.find(y=>y.originalId==u.originalId))f.dependencyStream=h.get(f.originalId),f.originalId+=f.dependencyStream.originalId,k.push(f)}k.length&&t.streams.push(...k)}}const [m,n]=vc(g,t=>!!t.Yh);if(!a.g.disableIFrames)for(var p of m){d=p.Yh.split(" ");
for(var r of n)if(d.includes(r.id))for(var q of r.streams)Uf(q,p.streams)}p=mx(a.g.disableAudio,n,"audio");r=mx(a.g.disableVideo,n,"video");q=mx(a.g.disableText,n,F);d=mx(a.g.disableThumbnails,n,"image");if(r.length===0&&p.length===0)throw new D(2,4,4004);return{id:b.Da.id,audioStreams:p,videoStreams:r,textStreams:q,imageStreams:d}}function fx(a,b){b=new Set(b.map(c=>c.id));for(const c of Array.from(a.G.keys()))b.has(c)||a.G.delete(c)}
function ix(a,b,c,d){c=c||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,Qe:null,audioSamplingRate:null,ib:0,Ye:1,encrypted:!1};d=d||c.ab;const e=b.attributes.id,f=b.attributes.supplementalId,g=zd(b,"BaseURL");let h,k=!1;if(a.i)for(var l of g){var m=l.attributes.serviceLocation,n=Bd(l);m&&n&&(Vv(a.i,e,m,n),k=!0)}k&&a.i||(h=g.map(Bd));const p=a.i;a=b.attributes.contentType||c.contentType;l=b.attributes.mimeType||c.mimeType;m=Tl([b.attributes.codecs||
c.codecs]).join(",");n=Id(b,"frameRate",Td)||c.frameRate;const r=b.attributes.sar||c.pixelAspectRatio,q=nx(zd(b,"InbandEventStream"),c.emsgSchemeIdUris);var t=zd(b,"AudioChannelConfiguration");t=ox(t)||c.Qe;const u=Id(b,"audioSamplingRate",Qd)||c.audioSamplingRate;a||=Nw(l,m);const v=Fd(b,"SegmentBase"),y=Fd(b,"SegmentTemplate");var w=v?Id(v,"availabilityTimeOffset",Rd)||0:0,z=y?Id(y,"availabilityTimeOffset",Rd)||0:0,A=g&&g.length?Id(g[0],"availabilityTimeOffset",Rd)||0:0;w=c.ib+A+w+z;z=null;(A=Fd(b,
"SegmentSequenceProperties"))&&(A=Id(A,"cadence",Pd))&&(z=A);A=b.attributes.label;var B=zd(b,"Label");B&&B.length&&(B=B[0],Ad(B)&&(A=Ad(B)));return{ab:()=>Qb(d(),g.length?p&&k?Wv(p,e):h?h:[]:[]),pd:v||c.pd,mc:Fd(b,"SegmentList")||c.mc,Cc:y||c.Cc,Te:Fd(b,"ProducerReferenceTime")||c.Te,width:Id(b,"width",Qd)||c.width,height:Id(b,"height",Qd)||c.height,contentType:a,mimeType:l,codecs:m,frameRate:n,pixelAspectRatio:r,emsgSchemeIdUris:q,id:f||e,originalId:e,language:b.attributes.lang,Qe:t,audioSamplingRate:u,
ib:w,Ae:null,Ye:z||c.Ye,label:A||null,encrypted:!1}}
function jx(a,b,c,d,e){const f=d.attributes.schemeIdUri||"",g=d.attributes.value||"",h=Id(d,"timescale",Qd)||1,k=Id(d,"presentationTimeOffset",Qd)||0;for(const m of zd(d,"Event")){var l=Id(m,"presentationTime",Qd)||0;d=Id(m,"duration",Qd)||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,eventElement:Yd(m),eventNode:Zd(m)};a.j.onTimelineRegionAdded(d)}}
function kx(a,b){if((b=Gd(b,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&Id(b,"useMPDUrlQuery",Sd,!1)){const c=b.attributes.queryTemplate;if(c)return()=>c=="$querypart$"?a.V:c.split("&").map(d=>{if(d=="$querypart$")return a.V;var e=/\$query:(.*?)\$/g.exec(d);if(e&&e.length==2){e=e[1];const f=(new Na(a.V)).get(e);if(f.length)return e+"="+f[0]}return d}).join("&")}return null}
function lx(a,b,c,d){b.xa=ix(a,d,b.Da,null);b.xa.position=c;let e=!1;var f=zd(d,"Role");const g=f.map(Q=>Q.attributes.value).filter(lf);let h=void 0;(c=b.xa.contentType==F)&&(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=Q=>{switch(Q){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}};var n=Q=>{switch(Q){case 1:case 5:case 6:case 7:return"srgb";
case 9:return"rec2020";case 11:case 12:return"p3"}};const p=Q=>{const ua=Q.attributes["dvb:fontFamily"];Q=Q.attributes["dvb:url"];ua&&Q&&(Q=Qb(b.xa.ab(),[Q],b.Cb()),a.j.addFont(ua,Q[0]))};var r=zd(d,"EssentialProperty");k=null;let q=!1,t=null,u=!1;for(var v of r)r=v.attributes.schemeIdUri,r=="http://dashif.org/guidelines/trickmode"?k=v.attributes.value:r=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?l=f(parseInt(v.attributes.value,10)):r=="urn:mpeg:mpegB:cicp:ColourPrimaries"?m=n(parseInt(v.attributes.value,
10)):r!="urn:mpeg:mpegB:cicp:MatrixCoefficients"&&(r=="urn:mpeg:dash:ssr:2023"&&a.g.dash.enableFastSwitching?q=!0:r=="urn:dvb:dash:fontdownload:2014"?p(v):r=="urn:mpeg:dash:urlparam:2014"?(t=kx(a,v))||(u=!0):u=!0);if(u)return null;let y=null;v=zd(d,"SupplementalProperty");for(var w of v)v=w.attributes.schemeIdUri,v=="http://dashif.org/guidelines/last-segment-number"?y=parseInt(w.attributes.value,10)-1:v=="urn:mpeg:mpegB:cicp:TransferCharacteristics"?l=f(parseInt(w.attributes.value,10)):v=="urn:mpeg:mpegB:cicp:ColourPrimaries"?
m=n(parseInt(w.attributes.value,10)):v=="urn:dvb:dash:fontdownload:2014"?p(w):v=="urn:mpeg:dash:urlparam:2014"&&(t=kx(a,w));t&&(b.Cb=t);w=zd(d,"Accessibility");const z=new Map;let A;for(var B of w)if(w=B.attributes.schemeIdUri,v=B.attributes.value,w!="urn:scte:dash:cc:cea-608:2015"||a.g.disableText)if(w!="urn:scte:dash:cc:cea-708:2015"||a.g.disableText)w=="urn:mpeg:dash:role:2011"?v!=null&&(g.push(v),v=="captions"&&(h="caption")):w=="urn:tva:metadata:cs:AudioPurposeCS:2007"&&(v=="1"?A="visually impaired":
v=="2"?A="hard of hearing":v=="9"&&(A="spoken subtitles"));else if(w=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${w}`,w++,f=E),z.set(v,$b(f));else z.set("svc1","und");else if(w=1,v!=null){v=v.split(";");for(var G of v)G.includes("=")?(n=G.split("="),f=n[0].startsWith("CC")?n[0]:`CC${n[0]}`,n=n[1]||"und"):(f=`CC${w}`,v.length==2?w+=2:w++,n=G),z.set(f,$b(n))}else z.set("CC1","und");B=zd(d,"ContentProtection");const ea=
Zu(a.ma,B,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);b.xa.encrypted=B.length>0;const M=$b(b.xa.language||"und"),N=b.xa.label,ia=new Map;d=zd(d,"Representation");if(!a.g.ignoreSupplementalCodecs){B=[];for(var L of d)if(E=Jd(L,"urn:scte:dash:scte214-extensions","supplementalCodecs"))G=nd(L),G.attributes.codecs=E.split(" ").join(","),G.attributes.id&&(G.attributes.supplementalId=G.attributes.id+"_supplementalCodecs"),B.push(G);d.push(...B)}L=d.map(Q=>{const ua=px(a,b,ea,h,M,N,e,g,z,Q,A,y);return ua&&
(ua.hdr=ua.hdr||l,ua.colorGamut=ua.colorGamut||m,ua.fastSwitching=q,Q=Q.attributes.dependencyId)?(ua.baseOriginalId=Q,ia.set(Q,ua),null):ua}).filter(Q=>!!Q);if(L.length==0&&ia.size==0){var fa=b.xa.contentType=="image";if(a.g.dash.ignoreEmptyAdaptationSet||c||fa)return null;throw new D(2,4,4003);}if(!b.xa.contentType||b.xa.contentType=="application"){b.xa.contentType=Nw(L[0].mimeType,L[0].codecs);for(const Q of L)Q.type=b.xa.contentType}c=b.xa.id||"__fake__"+a.Aa++;for(fa of L){for(const Q of ea.drmInfos)Q.keyIds=
Q.keyIds&&fa.keyIds?new Set([...Q.keyIds,...fa.keyIds]):Q.keyIds||fa.keyIds;a.g.enableAudioGroups&&(fa.groupId=c)}fa=d.map(Q=>Q.attributes.supplementalId||Q.attributes.id).filter(lf);return{id:c,contentType:b.xa.contentType,language:M,Kl:e,streams:L,drmInfos:ea.drmInfos,Yh:k,Rj:fa,ri:ia}}function mx(a,b,c){return a||!b.length?[]:b.reduce((d,e)=>{if(e.contentType!=c)return d;d.push(...e.streams);return d},[])}
function px(a,b,c,d,e,f,g,h,k,l,m,n){b.N=ix(a,l,b.xa,null);var p=b.N.id;a.W=Math.min(a.W,b.N.ib);a.R=a.W>0;if(!qx(b.N))return null;const r=b.ua.start;b.bandwidth=Id(l,"bandwidth",Pd)||0;b.roles=h;var q=zd(l,"SupplementalProperty"),t=zd(l,"EssentialProperty"),u=zd(l,"ContentProtection");l=null;var v=t.find(E=>E.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014");v?l=kx(a,v):(v=q.find(E=>E.attributes.schemeIdUri=="urn:mpeg:dash:urlparam:2014"))&&(l=kx(a,v));l&&(b.Cb=l);let y;v=b.N.contentType;l=
v==F||v=="application";v=v=="image";u.length&&(b.xa.encrypted=!0);try{let E=void 0;if(c.rf){var w=b.N.ab;const G=b.Cb,ea=Qb(w(),[c.rf.vj],G()),M=tg(ea,a.g.retryParameters);E={bitsKey:128,blockCipherMode:"CBC",iv:c.rf.iv,firstMediaSequenceNumber:0,fetchKey:async()=>{const N=await Sw(a,M,6);if(!N.data||N.data.byteLength!=16)throw new D(2,4,4049);E.cryptoKey=await window.crypto.subtle.importKey("raw",N.data,{name:"AES-CBC"},!0,["decrypt"]);E.fetchKey=void 0}}}b.N.aesKey=E;w=(G,ea,M,N)=>hx(a,G,ea,M,N);
if(b.N.pd)y=vv(b,w,E);else if(b.N.mc)y=Bv(b,a.u,E);else if(b.N.Cc)y=Gv(b,w,a.u,!!a.h,a.g.dash.initialSegmentLimit,a.oa,E,n,!1,a.C);else{const G=b.ua.duration||0,ea=b.N.ab,M=b.N.mimeType,N=b.N.codecs;y={endTime:-1,timeline:-1,Fc:()=>{const ia=nl(r,G,ea());ia.mb(L=>{L.mimeType=M;L.codecs=N});return Promise.resolve(ia)},timescale:1}}}catch(E){if((l||v)&&E.code==4002)return null;throw E;}n=$u(a.ma,u,c,a.g.ignoreDrmInfo,a.g.dash.keySystemsByURI);n=new Set(n?[n]:[]);u=q.some(E=>E.attributes.schemeIdUri==
"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&E.attributes.value=="JOC");q=q.some(E=>E.attributes.schemeIdUri=="tag:dolby.com,2016:dash:virtualized_content:2016"&&E.attributes.value=="1");q=u||q;u=!1;l&&(u=h.includes("forced_subtitle")||h.includes("forced-subtitle"));let z;if(v&&((t=t.find(E=>["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(E.attributes.schemeIdUri)))&&(z=t.attributes.value),!z))return null;let A;l=b.N.codecs;b.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&
(l.includes("hvc1.2.4.L153.B0")||l.includes("hev1.2.4.L153.B0"))&&(A="PQ");t=b.N.id?b.Da.id+","+b.N.id:"";a.H.length&&p&&a.A.set(`${b.Da.id},${p}`,rx(b));b.N.Te&&sx(a,b.N.Te,y,b.presentationTimeline);y.endTime!=-1&&b.Da.id!=null&&b.N.id!=null&&((p=a.C.get(b.Da.id))?(p.endTime=y.endTime,p.yg.includes(b.N.id)||p.yg.push(b.N.id),a.C.set(b.Da.id,p)):a.C.set(b.Da.id,{endTime:y.endTime,timeline:y.timeline,yg:[b.N.id]}));let B;B=t&&a.u.has(t)?a.u.get(t):{id:a.Aa++,originalId:b.N.id,groupId:null,createSegmentIndex:()=>
Promise.resolve(),closeSegmentIndex:()=>{B.segmentIndex&&(B.segmentIndex.release(),B.segmentIndex=null)},segmentIndex:null,mimeType:b.N.mimeType,codecs:l,frameRate:b.N.frameRate,pixelAspectRatio:b.N.pixelAspectRatio,bandwidth:b.bandwidth,width:b.N.width,height:b.N.height,kind:d,encrypted:c.drmInfos.length>0,drmInfos:c.drmInfos,keyIds:n,language:e,originalLanguage:b.xa.language,label:f,type:b.xa.contentType,primary:g,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:b.N.emsgSchemeIdUris,roles:h,
forced:u,channelsCount:b.N.Qe,audioSamplingRate:b.N.audioSamplingRate,spatialAudio:q,closedCaptions:k,hdr:A,colorGamut:void 0,videoLayout:void 0,tilesLayout:z,accessibilityPurpose:m,external:!1,fastSwitching:!1,fullMimeTypes:new Set([Ie(b.N.mimeType,b.N.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null};B.createSegmentIndex=async()=>{B.segmentIndex||(B.segmentIndex=await y.Fc())};t&&b.kb&&!a.u.has(t)&&(b=b.Da.id||"",a.F.has(b)||a.F.set(b,[]),a.u.set(t,B),a.F.get(b).push(t));return B}
function qx(a){let b;b=a.pd?1:0;b+=a.mc?1:0;b+=a.Cc?1:0;if(b==0)return a.contentType==F||a.contentType=="application"?!0:!1;b!=1&&(a.pd&&(a.mc=null),a.Cc=null);return!0}function rx(a){const b=c=>{if(!c)return null;c=od(c);c.pd=null;c.mc=null;c.Cc=Zd(c.Cc);c.Te=null;return c};a=od(a);a.Da=b(a.Da);a.xa=b(a.xa);a.N=b(a.N);a.ua&&(a.ua=od(a.ua),a.ua.node=null);return a}
function sx(a,b,c,d){if(!a.X.has(b)){a.X.add(b);var e=Id(b,"presentationTime",Qd)||0,f=Fd(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=(Id(b,"wallClockTime",Ld)||0)*1E3:(b=Id(b,"wallClockTime",Qd)||0,b=tj(b));c=new Date(b-e/c.timescale*1E3);e=c.getTime()/1E3;isNaN(e)||(d.u||d.Ig(e),d=(new Map).set("detail",{wallClockTime:b,programStartDate:c}),d=new C("prft",
d),a.j.onEvent(d))}}function nx(a,b){b=b.slice();for(const c of a)a=c.attributes.schemeIdUri,b.includes(a)||b.push(a);return b}
function ox(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 gx(a,b,c,d){c=[Fb(c)];b=Qb(b(),c);b=tg(b,a.g.retryParameters);b.method=d;b=a.j.networkingEngine.request(4,b,{isPreload:a.$()});og(a.P,b);a=await b.promise;if(d=="HEAD"){if(!a.headers||!a.headers.date)return 0;d=a.headers.date}else d=xb(a.data);d=Date.parse(d);return isNaN(d)?0:d-Date.now()}
var ax=class{constructor(){this.j=this.g=null;this.B=[];this.h=null;this.Aa=1;this.H=[];this.l={Ne:"",type:"",profiles:[],fc:null,ib:0,ab:null,Nd:0};this.A=new Map;this.C=new Map;this.G=new Map;this.u=new Map;this.F=new Map;this.oa=new Map;this.m=new fw;this.K=0;this.za=new qc(5);this.L=new H(()=>{if(this.J&&!this.g.continueLoadingWhenPaused&&(this.I.Ea(this.J,"timeupdate"),this.J.paused)){this.I.sa(this.J,"timeupdate",()=>Ow(this));return}Ow(this)});this.P=new pg;this.O=null;this.D=[];this.W=Infinity;
this.ea=!1;this.i=null;this.M=0;this.R=!1;this.I=new zc;this.J=null;this.T=!1;this.V="";this.$=()=>!1;this.na=[];this.X=new Set;this.ma=new av}configure(a,b){const c=this.j&&a.updatePeriod!=this.g.updatePeriod&&a.updatePeriod>=0;this.g=a;b&&(this.$=b);c&&this.h&&this.h.presentationTimeline.U()&&this.L.Ia();this.i&&this.i.configure(this.g);this.m&&this.m.Rh(this.g.dash.useStreamOnceInPeriodFlattening)}async start(a,b){this.ea=b.isLowLatencyMode();this.B=[a];this.j=b;a=await Pw(this);this.j&&Qw(this,
a);if(!this.j)throw new D(2,7,7001);return this.h}stop(){for(const a of this.u.values())a.segmentIndex&&a.segmentIndex.release();this.m&&this.m.release();this.g=this.j=null;this.B=[];this.h=null;this.u.clear();this.F.clear();this.A.clear();this.C.clear();this.G.clear();this.l={Ne:"",type:"",profiles:[],fc:null,ib:0,ab:null,Nd:0};this.m=null;this.L!=null&&(this.L.stop(),this.L=null);this.i&&this.i.destroy();this.I&&(this.I.release(),this.I=null);this.X.clear();this.ma.release();return this.P.destroy()}async update(){try{await Pw(this)}catch(a){if(this.j&&
a)this.j.onError(a)}}onExpirationUpdated(){}onInitialVariantChosen(a){if(this.h&&this.h.presentationTimeline.U()){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.K=b.endTime-a,Qw(this,0))}}}banLocation(a){this.i&&this.i.banLocation(a)}setMediaElement(a){this.J=a}};x("shaka.dash.DashParser",ax);Nc("application/dash+xml",()=>new ax);Nc("video/vnd.mpeg.dash.mpd",()=>new ax);var wx=class{};x("shaka.dependencies",wx);wx.has=function(a){return xx.has(a)};wx.add=function(a,b){if(!yx[a])throw Error(`${a} is not supported`);a==zx?Ic("mux.js","mux.js is no longer used in Shaka Player."):xx.set(a,()=>b)};var zx="muxjs",yx={Ll:zx,ISOBoxer:"ISOBoxer"};wx.Allowed=yx;var xx=new Map([["ISOBoxer",()=>window.ISOBoxer]]);function Qc(){const a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}function Rc(a){return gj().canPlayType(a)!=""}
var Ax=class{constructor(){this.Ha=new fb(()=>{var a=navigator.userAgent.toLowerCase(),b=[{type:"VR",xg:/oculus|quest/},{type:"TV",xg:/smart[ _]?tv|android ?tv/},{type:"MOBILE",xg:/iphone|ipad|ipod|android/}];for(const c of b)if(c.xg.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.Ta=new fb(()=>{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.Ha.value()}h(){return this.Ta.value()}G(){return!1}T(){return!1}K(){return!1}ma(){return!1}I(){return!1}C(){return!0}l(){const a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType}J(){return!0}na(){return 0}A(){return Promise.resolve({width:Infinity,height:Infinity})}oa(){return!1}V(){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}ea(){return[]}F(a){return window.matchMedia!==void 0&&(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(dynamic-range: high)").matches)?a?"HLG":"PQ":"SDR"}M(){return!1}X(){return!1}L(){return!1}P(){return!0}$(){return!1}za(){return!0}B(){return!1}R(a){return a==="com.apple.fps"}O(){return!0}toString(){return`Device: ${this.m()} v${this.g()}; Type: ${this.i()}`}};function Bx(a){a=a.D.value();return a[0]>=27?!0:a[0]===26&&a[1]>=4}
var Cx=class extends Ax{constructor(){super();this.D=new fb(()=>{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 fb(()=>/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP")}g(){return this.D.value()[0]}m(){return"Apple Browser"}i(){return this.H.value()}h(){return"WEBKIT"}u(){return!1}G(a,b){return!Bx(this)&&
b==="audio"}K(){return!Bx(this)}ma(a){return!Bx(this)&&a==="audio"}j(a){super.j(a);a.abr.minTimeToSwitch=.5;return a}M(){return!0}O(){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"))&&(vb=()=>new Cx);function Dx(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}
var Hx=class extends Ax{constructor(){if(!Dx())throw Error("Not a Chromecast device!");super();this.H=new fb(()=>{const a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null});this.D=new fb(()=>{let a=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;a=a.toLowerCase();return a.includes("android")?Ex:a.includes("fuchsia")?Fx:Gx})}g(){return this.H.value()}m(){return"Chromecast with "+this.D.value()}i(){return"CAST"}h(){return"CHROMIUM"}u(){return super.u()&&
this.D.value()!==Gx}l(){return super.l()&&this.D.value()!==Gx}na(){switch(this.D.value()){case Ex:return 0;case Fx:return 3;default:return 1}}async A(){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){ra("Failed to check canDisplayType:",c)}return b}j(a){super.j(a);a.streaming.stallSkip=0;return a}W(){return!1}B(){return!0}},Ex="Android",Fx="Fuchsia",Gx="Linux";Dx()&&(vb=()=>new Hx);var Ix=class extends Ax{constructor(){super();this.Aa=new fb(()=>{const a=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return a?parseInt(a[2],10):null});this.D=new fb(()=>navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown");this.H=new fb(()=>navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="windows":navigator.platform?navigator.platform.toLowerCase().includes("win32"):
!1);this.Wa=new fb(()=>super.l()?navigator.userAgent.match(/Edge?\//)?!this.H.value():!0:!1);this.Va=new fb(()=>navigator.userAgent.includes("sony.hbbtv.tv"));this.Oa=new fb(()=>navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="android":navigator.userAgent.includes("Android")?!0:!1)}g(){return this.Aa.value()}m(){return this.D.value()}G(a){return mb(a)?this.D.value()==="Edge"&&this.H.value():!1}T(){return this.D.value()==="Edge"&&this.H.value()}K(){return this.D.value()===
"Edge"&&this.H.value()}l(){return this.Wa.value()}j(a){super.j(a);if(this.H.value())switch(this.D.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.Oa.value()&&(a.drm.defaultAudioRobustnessForWidevine="",a.drm.defaultVideoRobustnessForWidevine=
"");return a}L(){return this.D.value()==="Edge"||this.Va.value()}B(){if(this.h()==="GECKO"){const a=this.g();return a!==null?a>=100:super.B()}return super.B()}R(a){return this.h()==="GECKO"?a.startsWith("com.microsoft.playready.recommendation"):super.R(a)}};wb=()=>new Ix;var Jx=class extends Ax{g(){return null}m(){return"Hisense"}i(){return"TV"}u(){return!1}l(){return!1}A(){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"))vb=()=>new Jx;var Kx=class extends Ax{constructor(){super();this.D=new fb(()=>{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.D.value()}u(){return!1}C(){return!1}l(){return!1}V(){return this.g()===4}async A(){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){sa("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}P(){return this.g()!==4}};navigator.userAgent.includes("PlayStation")&&(vb=()=>new Kx);var Lx=class extends Ax{constructor(){super();const a=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.D=a?parseInt(a[1],10):null;this.H=a?parseInt(a[2],10):null}g(){return this.D}m(){return"Tizen"}h(){return"CHROMIUM"}i(){return"TV"}G(){return!0}I(){return this.g()===3}u(){return!1}C(){const a=this.g();return a!==null?a>=4:super.C()}l(){return!1}J(){return this.D&&this.H?this.D===5?this.H>=5:this.D>5:super.J()}A(){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){sa("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}ea(){const a=[];this.D!==null&&this.D<5&&a.push("opus");return a}F(a){try{if(webapis.avinfo.isHdrTvSupport())return a?"HLG":"PQ"}catch(b){return super.F(a)}return"SDR"}X(){return!0}$(){return this.g()===3}};navigator.userAgent.includes("Tizen")&&(vb=()=>new Lx);var Mx=class extends Ax{g(){return null}m(){return"Vizio"}i(){return"TV"}u(){return!1}};navigator.userAgent.includes("VIZIO SmartCast")&&(vb=()=>new Mx);var Nx=class extends Ax{constructor(){super();this.Aa=new fb(()=>navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB"));this.H=new fb(()=>navigator.userAgent.includes("SOPOpenBrowser"));this.D=new fb(()=>{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.D.value()}m(){return"WebKit STB"}i(){return"TV"}h(){return"WEBKIT"}u(){return!1}C(){const a=
this.D.value();return a!==null?a>=15:!0}G(){return this.H.value()}A(){return Promise.resolve({width:window.screen.width*window.devicePixelRatio,height:window.screen.height*window.devicePixelRatio})}P(){return!this.Aa.value()}O(){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")))vb=()=>new Nx;function Ox(){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 Px=class extends Ax{constructor(){super();this.H=Ox();this.D=null;try{const a=new PalmServiceBridge;a.onservicecallback=b=>{b=JSON.parse(b);this.D=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){sa("WebOS: getConfigs call failed",a)}}g(){return this.H}m(){return"WebOS"}i(){return"TV"}h(){return"CHROMIUM"}u(){return!1}C(){const a=
this.g();return a!==null?a>3:super.C()}l(){return!1}J(){const a=this.g();return a!==null?a>3:super.J()}A(){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){sa("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}F(a){return this.D==null?(sa("WebOS: getConfigs call haven't finished"),super.F(a)):this.D?a?"HLG":"PQ":"SDR"}za(){return!1}B(){const a=this.g();return a!==null?a>=6:super.B()}};if(navigator.userAgent.includes("Web0S")){const a=new Px;vb=()=>a};function Qx(){let a=null;try{a=typeof Windows!=="undefined"?Windows:chrome.webview.hostObjects.sync.Windows}catch(b){}return a}
var Rx=class extends Ax{constructor(){super();this.D=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.D?"EDGE":"CHROMIUM"}G(){return!0}T(){return!0}K(){return!0}oa(){return this.D}A(){const a={width:1920,height:1080};var b=Qx();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){sa("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)}j(a){super.j(a);a.drm.parseInbandPsshEnabled=this.D;a.drm.preferredKeySystems.push("com.microsoft.playready");this.D&&(a.streaming.gapPadding=.01);return a}L(){return!0}W(){return!1}};if(navigator.userAgent.includes("Xbox One")||Qx()!==null)vb=()=>new Rx;var Sx=class{constructor(a,b,c){this.type=a;this.ia=b;this.segments=c||null}};function Tx(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 Ux(a,b){return a.attributes.find(c=>c.name===b)||null}function X(a,b,c){return(a=Ux(a,b))?a.value:c||null}function Vx(a,b){a=Ux(a,b);if(!a)throw new D(2,4,4023,b);return a.value}
var Wx=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}},Xx=class{constructor(a,b,c=[]){this.ia=b;this.g=a;this.kc=c}},Yx=class{constructor(a,b){this.name=a;this.value=b}};function Zx(a,b){return a.filter(c=>c.name==b)}function $x(a,b){return a.filter(c=>Vx(c,"TYPE")==b)}function ay(a,b){for(const c of a)if(c.name===b)return c;return null}function by(a,b,c=0){return(a=ay(a,b))?Number(a.value):c}function cy(a,b,c){return b?dy(a,[b],c):[]}function dy(a,b,c){if(!b.length)return[];let d=b;c&&c.size&&(d=b.map(e=>ey(e,c)));return Qb(a,d)}
function ey(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 D(2,4,4039,c);}return a}function fy(a){a=a.value;const b=a.indexOf(",");return Number(b===-1?a:a.substring(0,b))};function gy(a,b){var c=b.indexOf(":"),d=c===-1?b.substring(1):b.substring(1,c);if(!d.startsWith("EXT"))throw new D(2,4,4016,b);const {name:e,data:f}={name:d,data:c===-1?null:b.substring(c+1)};if(f===null)return new Wx(a,e,[]);if(f.indexOf("=")===-1)return new Wx(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 Yx(g,h))}return new Wx(a,e,b,c)}
function hy(a,b){var c=xb(b).trim().split(/[\r\n]+/);if(!c[0].startsWith("#EXTM3U"))throw new D(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=gy(a.g++,h);d||(iy.has(h.name)?(b=1,d=!0):h.name=="EXT-X-STREAM-INF"||h.name=="EXT-X-MEDIA"?d=!0:jy.has(h.name)&&(b=1,d=!0));if(jy.has(h.name)){if(b!=1)throw new D(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=gy(a.g++,m),iy.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"?X(m,"TYPE")=="PART"?h.push(m):X(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 Xx(m,k,h),d<g.length?g[d++]=k:(g.push(k),d++),k=[],h=[]}h.length&&(f&&k.push(f),a=new Xx("",k,h),d<g.length?g[d++]=a:(g.push(a),d++));return new Sx(b,e,d<g.length?
g.slice(0,d):g)}e.push(h);h.name=="EXT-X-STREAM-INF"&&(h.attributes.push(new Yx("URI",k)),f=!0)}return new Sx(b,e)}var ky=class{constructor(){this.g=0}},iy=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(" ")),jy=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 ly(a,b){try{const c=my(a);return kg({uri:a,originalUri:a,data:c.data,headers:{"content-type":c.contentType},originalRequest:b})}catch(c){return hg(c)}}
function my(a){if(!a.startsWith("data:"))throw new D(2,1,1004,a);var b=a.substring(5),c=b.indexOf(",");if(c<0)throw new D(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=Jb(b):e=Cb(b);return{data:e,contentType:a,Pg:c}}var ny=class{};x("shaka.net.DataUriPlugin",ny);ny.parse=ly;qg("data",ly);async function oy(a,b,c,d){if(c=="video/mp2t")throw new D(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new D(2,4,4041);var e=Vx(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(e))return null;c="cenc";e=="SAMPLE-AES"&&(c="cbcs");e=Vx(b,"URI");b=Rb("com.apple.fps",c,null,e);c=(new Ha(e)).ub.replace(/-/g,"").toLowerCase();c=c.length===32&&/^[0-9a-f]+$/.test(c)?c:null;!c&&d&&(c=await py(a,d));c&&b.keyIds.add(c);return b}
async function qy(a){if(a.h){try{const b=Date.now();await a.update();const c=Date.now();if(ry(a)){a.Ab.sample(1,(c-b)/1E3);const d=Math.max(0,(a.g.updatePeriod>0?a.g.updatePeriod:a.A)-pc(a.Ab));isFinite(d)?a.B.Z(d):a.B.Z(1)}}catch(b){if(!a.h)return;if(a.g.raiseFatalErrorOnManifestUpdateRequestFailure){a.h.onError(b);return}b.severity=1;a.h.onError(b);a.B.Z(.1)}if(a.h)a.h.onManifestUpdated()}}function sy(a,b,c){return ty(a,tg(b,a.g.retryParameters),0,{type:c?2:3})}
async function uy(a,b){b=hy(a.Ta,b);var c=Zx(b.ia,"EXT-X-DEFINE"),d=[],e=[],f=[];a.m=new Ok(null,0);a.m.Nc(!0);const g=()=>[a.G];var h=null,k=new Map;a.i={presentationTimeline:a.m,variants:d,textStreams:e,imageStreams:f,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.u};if(b.type==1){a.O=!1;k=Zx(b.ia,"EXT-X-DEFINE");
k=vy(a,k,a.G);h=new Map;var l=await wy(a,a.F++,k,b,g,"","video","",!0,"Media Playlist",null,h,null,!1,null,!1);a.j.set(a.G,l);if(l.stream){const r=xl(l.stream);l.stream.segmentIndex.mb(q=>{q.ha&&(q.ha.ed=r)})}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:$b("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:[]})}else{xy(a,c);e=Zx(b.ia,"EXT-X-MEDIA");d=Zx(b.ia,"EXT-X-STREAM-INF");f=Zx(b.ia,"EXT-X-IMAGE-STREAM-INF");c=Zx(b.ia,"EXT-X-I-FRAME-STREAM-INF");const r=Zx(b.ia,"EXT-X-SESSION-KEY");var m=Zx(b.ia,"EXT-X-SESSION-DATA"),n=Zx(b.ia,"EXT-X-CONTENT-STEERING");yy(a,m);await zy(a,n);if(!a.g.ignoreSupplementalCodecs){m=[];for(var p of d){n=X(p,"SUPPLEMENTAL-CODECS");if(!n)continue;const q=n.split(/\s*,\s*/).map(t=>t.split("/")[0]);n=p.attributes.map(t=>
{const u=t.name;let v=t.value;u=="CODECS"&&(v=q.join(","),t=t.value.split(","),t.length>1&&(t=Ub("audio",t))&&(v+=","+t));return new Yx(u,v)});m.push(new Wx(p.id,p.name,n,null))}d.push(...m);p=[];for(l of c){m=X(l,"SUPPLEMENTAL-CODECS");if(!m)continue;const q=m.split(/\s*,\s*/).map(t=>t.split("/")[0]);m=l.attributes.map(t=>{const u=t.name;t=t.value;u=="CODECS"&&(t=q.join(","));return new Yx(u,t)});p.push(new Wx(l.id,l.name,m,null))}c.push(...p)}Ay(a,d);By(a,e);l=Cy(a,c);d=await Dy(a,d,r,e,g,a.C,l);
e=Ey(a,e);f=await Fy(a,f,c)}if(!a.h)throw new D(2,7,7001);Gy(a,b);b.type==1&&(ry(a)&&(Hy(a,b),a.B.Z(a.A)),l=Array.from(a.j.values()),Iy(a,l),Jy(a),Ky(a,b.ia,h,k,g));a.i.variants=d;a.i.textStreams=e;a.i.imageStreams=f;a.i.startTime=a.u;if(!a.W&&a.g.hls.disableCodecGuessing){b=[];for(const r of a.i.variants)r.audio&&r.audio.codecs===""&&b.push(r.audio.createSegmentIndex()),r.video&&r.video.codecs===""&&b.push(r.video.createSegmentIndex());await Promise.all(b)}a.h.makeTextStreamsForClosedCaptions(a.i)}
function ry(a){return a.za!=Ly}
async function My(a,b){if(!b.stream.isAudioMuxedInVideo){var c=[];for(var d of b.S()){var e=new Ha(d),f=e.g;b.me&&(b.Ib>=0&&f.add("_HLS_msn",String(b.Ib)),b.Jb>=0&&f.add("_HLS_part",String(b.Jb)));b.oe&&f.add("_HLS_skip","YES");c.push(e.toString())}try{var g=await sy(a,c,!0).promise}catch(q){throw a.h&&a.h.disableStream(b.stream),q;}if(b.stream.segmentIndex){c=hy(a.Ta,g.data);if(c.type!=1)throw new D(2,4,4017);d=g.uri;d==g.originalUri||b.S().includes(d)||b.Ve.push(d);g=Zx(c.ia,"EXT-X-DEFINE");g=vy(a,
g,d);d=b.stream;e=Ny(a,b);var {keyIds:h,drmInfos:k,encrypted:l,Vg:m}=await Oy(a,c,d.mimeType,b.S,g);d.encrypted||!l||m||(d.encrypted=!0);((q,t)=>q.size===t.size&&[...q].every(u=>t.has(u)))(d.keyIds,h)||(d.keyIds=h,d.drmInfos=k,a.h.newDrmInfo(d));var {segments:n,bandwidth:p}=Py(a,c,e,g,b.S,b.type);p&&(d.bandwidth=p);f=xl(d);for(var r of n)r.ha&&(r.ha.ed=f);d.segmentIndex.Jd(n,a.m.yb());if(n.length){r=by(c.ia,"EXT-X-MEDIA-SEQUENCE",0);f=(f=ay(c.ia,"EXT-X-SKIP"))?Number(X(f,"SKIPPED-SEGMENTS")):0;const {Ib:q,
Jb:t}=Qy(r,n);b.Ib=q+f;b.Jb=t;r=e.get(r);d.segmentIndex.Ua(r)}if(r=d.segmentIndex.wb())b.Jc=r.startTime,b.Ac=n[n.length-1].endTime;ay(c.ia,"EXT-X-ENDLIST")&&(b.Ed=!0);Ry(a,c);Ky(a,c.ia,d.type,g,b.S)}}}function Sy(a,b){const c=[];for(const d of b)d.segmentIndex&&d.segmentIndex.mb(e=>{c.push(e)});a.m.Ld(c)}function Ty(a,b){a.za=b;a.m&&a.m.Nc(!ry(a));ry(a)||a.B.stop()}
function Jy(a){if(ry(a)){if(a.za==Uy){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.Ac),c=Math.min(c,d.Jc));b=b-c||0;isNaN(a.g.availabilityWindowOverride)||(b=a.g.availabilityWindowOverride);a.m.bf(b)}}else a.m.qb(Vy(a));if(!a.m.u)for(const c of a.j.values()){if(!c.stream.segmentIndex)continue;if(c.type!="audio"&&c.type!="video")continue;(b=c.stream.segmentIndex.wb())&&b.h!=null&&a.m.Ig(b.h)}a.m.Je()}
function Ny(a,b){return ry(a)?a.D.get(b.type):b.Ke}function vy(a,b,c){c=(new Ha(c)).g;const d=new Map;for(const g of b){var e=X(g,"NAME");const h=X(g,"VALUE");var f=X(g,"QUERYPARAM");b=X(g,"IMPORT");e&&h&&(d.has(e)||d.set(e,h));f&&(e=c.get(f)[0])&&!d.has(e)&&d.set(f,e);b&&(f=a.C.get(b))&&d.set(b,f)}return d}
async function Oy(a,b,c,d,e){var f=new Map;if(!a.g.ignoreDrmInfo&&b.segments)for(var g of b.segments){var h=Zx(g.ia,"EXT-X-KEY"),k=void 0;if(h.length){k=Wy(a,b,g.ia,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=Vx(f,"METHOD");if(m!="NONE"){b=!0;const r=X(f,"KEYFORMAT")||"identity";if(Xy(m))g=!0;else if(f=r=="identity"?await Yy(a,f,c,d,l,e):(m=a.Vb.get(r))?await m(f,c,l):null,f){if(f.keyIds)for(const q of f.keyIds)k.add(q);h.push(f)}}}return{drmInfos:h,keyIds:k,
encrypted:b,Vg:g}}
function Py(a,b,c,d,e,f){const g=b.segments;let h=null,k=null,l=null,m=null,n=void 0,p=by(b.ia,"EXT-X-DISCONTINUITY-SEQUENCE",-1);const r=by(b.ia,"EXT-X-MEDIA-SEQUENCE",0);var q=ay(b.ia,"EXT-X-SKIP");const t=q?Number(X(q,"SKIPPED-SEGMENTS")):0;var u=r+t;let v=0;ry(a)&&c.has(u)&&(v=c.get(u));v===0&&a.za==Uy&&c.size>0&&!c.has(u)&&a.m.i!=null&&(v=a.m.yb());const y=[];var w=null;q=[];const z=G=>{G=Zl(G);if(!G)return null;let ea=Zy.get(f).get(G);ea||=$y.get(G);return ea};for(let G=0;G<g.length;G++){var A=
g[G];(u=ay(A.ia,"EXT-X-MAP"))&&u.id!==k&&(h=Wy(a,b,A.ia,e,d),k=u.id);u=A.g;var B="";u&&(B=Zl(u));B!==m&&(l=z(u),m=B);B=G==0?v:w.endTime;u=r+t+G;ay(A.ia,"EXT-X-DISCONTINUITY")&&(p++,w&&w.ha&&(w.ha.g=B));for(const ea of A.ia)ea.name=="EXT-X-KEY"&&(Xy(Vx(ea,"METHOD"))?n=az(a,ea,b,e,d):n=void 0);c.set(u,B);if(B=bz(a,h,w,A,B,d,f,e,l,n)){if(w=by(A.ia,"EXT-X-BITRATE"))q.push({bitrate:w,duration:B.endTime-B.startTime}),B.bandwidth=w;else if(B.endByte){if(A=Qi(B))w=B.endTime-B.startTime,A=A*8/w/1E3,q.push({bitrate:A,
duration:w}),B.bandwidth=A}else q.length&&(w=q[q.length-1],w.duration+=B.endTime-B.startTime,B.bandwidth=w.bitrate);if(B.bandwidth)for(const ea of B.g)ea.bandwidth=B.bandwidth;w=B;B.i=p;cz(a,f)&&a.L!=null&&u<a.L||y.push(B)}}b=void 0;q.length&&(b=q.reduce((G,ea)=>G+ea.duration,0),b=Math.round(q.reduce((G,ea)=>G+ea.bitrate*ea.duration,0)/b*1E3));if(q=y.some(G=>G.h!=null))for(c=0;c<y.length;c++){const G=y[c];if(G.h!=null)continue;let ea=0,M=c;d=()=>{const L=y[M];if(L){if(L.h!=null)return L.h+ea;ea-=
L.endTime-L.startTime;M+=1}return null};let N=0,ia=c;for(e=()=>{const L=y[ia];if(L){L!=G&&(N+=L.endTime-L.startTime);if(L.h!=null)return L.h+N;--ia}return null};G.h==null;)G.h=e(),G.h==null&&(G.h=d())}if(q)for(var E of y){c=E.h;for(const G of E.g)G.h=c,c+=G.endTime-G.startTime}E=a.X;if(q&&E!=Infinity&&!cz(a,f))for(const G of y)G.Mg(E);return{segments:y,bandwidth:b}}
function Qy(a,b){a=a+b.length-1;let c=-1;if(!b.length)return a++,{Ib:a,Jb:c};b=b[b.length-1];const d=b.g;if(!b.g.length)return a++,b.u&&(c=0),{Ib:a,Jb:c};c=d.length-1;d[d.length-1].isPreload()||(a++,c=0);return{Ib:a,Jb:c}}
function Ry(a,b){var c=Infinity,d=b.segments;if(d.length)for(var e=d.length-1;e>=0;){const f=ay(d[e].ia,"EXTINF");if(f){c=fy(f);break}e--}d=ay(b.ia,"EXT-X-TARGETDURATION");if(!d)throw new D(2,4,4024,"EXT-X-TARGETDURATION");d=Number(d.value);if(e=ay(b.ia,"EXT-X-PART-INF"))a.P=Number(Vx(e,"PART-TARGET"));b=ay(b.ia,"EXT-X-SERVER-CONTROL");a.$&&a.P?(a.A=a.jc?a.P*5<=c?Math.min(a.P,a.A):Math.min(c,a.A):Math.min(a.P,a.A),a.Ha=b?Number(Vx(b,"PART-HOLD-BACK")):0):(a.A=Math.min(c,a.A),c=b?Ux(b,"HOLD-BACK"):
null,a.Aa=c?Number(c.value):0);a.Oa=Math.max(d,a.Oa)}
function Ky(a,b,c,d,e){if(c=="video"||c=="audio"){var f=a.m.m;if(f!=null&&!cz(a,c))for(b=Zx(b,"EXT-X-DATERANGE"),b=b.filter(h=>Ux(h,"START-DATE")!=null).sort((h,k)=>{h=Vx(h,"START-DATE");k=Vx(k,"START-DATE");return h<k?-1:h>k?1:0}),c=0;c<b.length;c++){const h=b[c];try{const k=Vx(h,"START-DATE"),l=Ld(k);if(isNaN(l))continue;const m=Math.max(0,l-f);let n=null;const p=X(h,"END-DATE");if(p){const u=Ld(p);if(!isNaN(u)&&(n=u-f,n<0))continue}if(n==null){const u=X(h,"DURATION")||X(h,"PLANNED-DURATION");if(u){const v=
parseFloat(u);isNaN(v)||(n=m+v);if(l-f+v<0)continue}}const r=X(h,"CLASS")||"com.apple.quicktime.HLS",q=X(h,"END-ON-NEXT")=="YES";if(n==null&&q){for(var g=c+1;g<b.length;g++){const u=X(b[g],"CLASS")||"com.apple.quicktime.HLS";if(r!=u)continue;const v=Vx(b[g],"START-DATE"),y=Ld(v);if(!isNaN(y)&&y&&y>l){n=Math.max(0,y-f);break}}if(n==null)continue}g=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];const t=[];for(const u of h.attributes){if(g.includes(u.name))continue;let v=ey(u.value,d);if(u.name==
"X-ASSET-URI"||u.name=="X-ASSET-LIST")v=cy(e(),u.value,d)[0];t.push({key:u.name,description:"",data:v,mimeType:null,pictureType:null})}if(t.length>1)a.h.onMetadata(r,m,n,t)}catch(k){}}}}function cz(a,b){return a.g.hls.ignoreManifestProgramDateTime?!0:a.g.hls.ignoreManifestProgramDateTimeForTypes.includes(b)}function dz(a,b,c){if(!(Math.abs(c)<.001)){b.Jc+=c;b.Ac+=c;a=Ny(a,b);for(const [d,e]of a)a.set(d,e+c);b.S()}}
function ez(a,b,c=!1){var d=a.L==-1;for(const f of b){var e=f.stream.segmentIndex;const g=Ny(a,f);if(e=e.wb())for(const [h,k]of g)if(k==e.startTime){d&&(a.L=Math.max(a.L,h));f.Ef=h;break}}if(!(a.L<0))for(const f of b){if(!cz(a,f.type)&&!c)continue;if(b=f.stream.segmentIndex)if(d=a.L-f.Ef,d>0&&(b.g.splice(0,d),b=b.wb()))b=-b.startTime,f.stream.segmentIndex.offset(b),dz(a,f,b)}}
function fz(a,b){if(a.X==Infinity)for(var c of b)b=c.stream.segmentIndex.wb(),b!=null&&b.h!=null&&(a.X=Math.min(a.X,b.h));c=a.X;if(c!=Infinity)for(const d of a.j.values()){if(cz(a,d.type))continue;b=d.stream.segmentIndex;if(b!=null){const e=b.wb();if(e)if(e.h==null)ra("Missing EXT-X-PROGRAM-DATE-TIME for stream",d.S(),"Expect AV sync issues!");else{dz(a,d,e.h-c-e.startTime);for(const f of b)f.Mg(c)}}}}
async function wy(a,b,c,d,e,f,g,h,k,l,m,n,p,r,q,t,u,v=!0,y=!0){b=d.segments||[];var w=b.every(ua=>ay(ua.ia,"EXT-X-GAP")?!0:!1);if(!b.length||w)throw new D(2,4,4053);gz(a,d);ry(a)&&Ry(a,d);b=ry(a)?a.D.get(g):new Map;const {segments:z,bandwidth:A}=Py(a,d,b,c,e,g);let B=w=null,E=null,G=null,ea=null;z.length>0&&v&&(v=await hz(a,z),g!=v.type&&ry(a)&&(a.D.set(v.type,a.D.get(g)),a.D.set(g,new Map)),g=v.type,h=v.language,m=v.channelCount,q=v.sampleRate,a.g.disableText||(n=v.closedCaptions),B=v.height,w=v.width,
E=v.Ud,G=v.colorGamut,ea=v.frameRate,y&&(u=v.mimeType,f=v.codecs));u||(u=await iz(a,g,f,z),g!=F||f||u!="application/mp4"||!z[0]||z[0].ha||(u="text/vtt"));const {drmInfos:M,keyIds:N,encrypted:ia,Vg:L}=await Oy(a,d,u,e,c);if(ia&&!M.length&&!L)throw new D(2,4,4026);c=jz(a,f,g,h,k,l,m,n,p,r,q,t);c.encrypted=ia&&!L;c.drmInfos=M;c.keyIds=N;c.mimeType=u;A&&(c.bandwidth=A);kz(c);g=="video"&&(w||B||E||G)&&lz(c,w,B,ea,E,null,G);ry(a)&&Ry(a,d);a=z[0].startTime;u=z[z.length-1].endTime;c.segmentIndex=new ol(z);
f=(h=ay(d.ia,"EXT-X-SERVER-CONTROL"))?Ux(h,"CAN-SKIP-UNTIL")!=null:!1;h=h?Ux(h,"CAN-BLOCK-RELOAD")!=null:!1;d=by(d.ia,"EXT-X-MEDIA-SEQUENCE",0);const {Ib:fa,Jb:Q}=Qy(d,z);return{stream:c,type:g,Ve:[],S:e,Jc:a,Ac:u,oe:f,me:h,Ed:!1,Ef:-1,Ib:fa,Jb:Q,Ke:b}}function xy(a,b){const c=(new Ha(a.G)).g;for(const e of b){var d=X(e,"NAME");const f=X(e,"VALUE");b=X(e,"QUERYPARAM");d&&f&&(a.C.has(d)||a.C.set(d,f));b&&(d=c.get(b)[0])&&!a.C.has(d)&&a.C.set(b,d)}}
function yy(a,b){for(const d of b){var c=X(d,"DATA-ID");b=X(d,"URI");const e=X(d,"LANGUAGE"),f=X(d,"VALUE");c=(new Map).set("id",c);b&&c.set("uri",cy([a.G],b,a.C)[0]);e&&c.set("language",e);f&&c.set("value",f);b=new C("sessiondata",c);if(a.h)a.h.onEvent(b)}}async function zy(a,b){if(a.h&&a.g){for(const d of b){b=X(d,"PATHWAY-ID");const e=X(d,"SERVER-URI");if(b&&e){a.l=new Xv(a.h);a.l.configure(a.g);a.l.i=[a.G];a.l.setManifestType("HLS");a.l.h=b;var c=Uv(a.l,e);break}}await c}}
function Ay(a,b){for(const e of b){var c=X(e,"AUDIO");b=X(e,"VIDEO");var d=X(e,"SUBTITLES");const f=mz(a,e);if(d){const g=Ub(F,f);a.J.set(d,g);tc(f,g)}c&&(d=Ub("audio",f),d||(d=a.g.hls.defaultAudioCodec),a.J.set(c,d));b&&(c=Ub("video",f),c||(c=a.g.hls.defaultVideoCodec),a.J.set(b,c))}}
function By(a,b){b=$x(b,"CLOSED-CAPTIONS");a.O=b.length==0;for(const d of b){var c=X(d,"LANGUAGE");b=$b(c||"und");c||(c=X(d,"NAME"))&&(b=c);c=Vx(d,"GROUP-ID");const e=Vx(d,"INSTREAM-ID").replace("SERVICE","svc");a.I.get(c)||a.I.set(c,new Map);a.I.get(c).set(e,b)}}function Cy(a,b){return b.map(c=>{c=nz(a,c);return c.stream.type!=="video"?null:c.stream}).filter(c=>c)}
async function Dy(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=Vx(l,"METHOD");var m=X(l,"KEYFORMAT")||"identity";let r=null;if(c!="NONE")if(Xy(c))m=cy(e(),Vx(l,"URI"),f),c=m.sort().join(""),a.M.has(c)||(m=ty(a,tg(m,a.g.retryParameters),6).promise,a.M.set(c,m));else if(r=m=="identity"?await Yy(a,l,"",e,null,f):(c=a.Vb.get(m))?await c(l,"",null):null,r){if(r.keyIds)for(var n of r.keyIds)k.add(n);h.push(r)}}e={};for(var p of b)b=Tx(p,!a.l),e[b]?e[b].push(p):
e[b]=[p];p=[];for(const r in e){l=e[r];c=l[0];b=X(c,"FRAME-RATE");f=Number(Vx(c,"BANDWIDTH"))||Number(X(c,"AVERAGE-BANDWIDTH"));n=X(c,"RESOLUTION");const [q,t]=n?n.split("x"):[null,null];n=X(c,"VIDEO-RANGE");(c=X(c,"REQ-VIDEO-LAYOUT"))&&c.includes(",")&&(c=c.split(",").filter(u=>u=="CH-STEREO"||u=="CH-MONO")[0]);c=c||"CH-MONO";l=oz(a,l,d);p.push(...pz(a,l.audio,l.video,f,q,t,b,n,c,h,k,g))}return p.filter(r=>r!=null)}
function Ey(a,b){b=$x(b,"SUBTITLES");const c={};for(var d of b){const f=Tx(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(qz(a,c[e],new Map).stream)}catch(f){if(!a.g.hls.ignoreTextStreamFailures)throw f;}for(const f of b)if(b=Vx(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=rz(F,e)||sz(F),kz(g.stream);return d.filter(f=>f)}
async function Fy(a,b,c){b=b.map(async d=>{if(a.g.disableThumbnails)return null;try{return(await tz(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=nz(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 Gy(a,b){a.u==null&&(b=ay(b.ia,"EXT-X-START"))&&(a.u=Number(Vx(b,"TIME-OFFSET")))}function Hy(a,b){let c=0;if(a.g.defaultPresentationDelay)c=a.g.defaultPresentationDelay;else if(a.Ha)c=a.Ha;else if(a.Aa)c=a.Aa;else{const e=b.segments.length;var d=Math.min(e,a.g.hls.liveSegmentsDelay);for(d=e-d;d<e;d++){const f=ay(b.segments[d].ia,"EXTINF");c=f?c+fy(f):c+a.Oa}}a.u&&a.u<0&&(c=Math.min(-a.u,c),a.u+=c);a.m.Ph(0);a.m.Gg(c);a.m.Nc(!1)}
function Iy(a,b){if(!ry(a)){var c=Vy(a);for(var d of b)d.stream.segmentIndex.Wc(0,c)}Sy(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=ry(a)&&!a.Va;c=!ry(a)&&a.Va&&!(c&&e);a.g.hls.ignoreManifestProgramDateTime||d||c?ez(a,b,d):(fz(a,b),a.g.hls.ignoreManifestProgramDateTimeForTypes.length>0&&ez(a,b))}
function uz(a,b){a=ry(a)?Math.trunc((b.length-1)/2):0;let c=b[a];for(;c.Sb()==2&&a+1<b.length;)a++,c=b[a];return{segment:c,segmentIndex:a}}async function vz(a,b,c){if(!b)return{mimeType:null,data:null};var d=$l(b.S(),b.wc(),b.uc(),a.g.retryParameters);d=await ty(a,d,zg,{type:b instanceof I?1:0}).promise;a=d.data;b.aesKey&&(a=await Wl(a,b.aesKey,c));b instanceof I?b.Qd(a,!0):b.Qd(a);(b=d.headers["content-type"])&&(b=b.split(";")[0].toLowerCase());return{mimeType:b,data:a}}
async function hz(a,b){const c=Rl(a.g.hls.mediaPlaylistFullMimeType);if(!b.length)return c;const {segment:d,segmentIndex:e}=uz(a,b);b=d.S();var f=Zl(b[0]);if(f&&(b=$y.get(f)))return Rl(b);var g=await Promise.all([vz(a,d.ha,0),vz(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.ha||l.includes(b);if(!l&&Fj($a(g))){{k=a.g.disableAudio;l=a.g.disableVideo;a=a.g.disableText;f=$a(g);
const n=(new Nj).parse(f),p=n.Bd();f=n.dg();h=[];let r=!1,q=!1;if(!k)switch(p.audio){case "aac":case "aac-loas":n.ob().length&&(h.push("mp4a.40.2"),r=!0);break;case "mp3":n.ob().length&&(h.push("mp4a.40.34"),r=!0);break;case "ac3":n.ob().length&&(h.push("ac-3"),r=!0);break;case "ec3":n.ob().length&&(h.push("ec-3"),r=!0);break;case "opus":n.ob().length&&(h.push("opus"),r=!0)}if(!l)switch(p.video){case "avc":f.codec?h.push(f.codec):h.push("avc1.42E01E");q=!0;break;case "hvc":f.codec?h.push(f.codec):
h.push("hvc1.1.6.L93.90");q=!0;break;case "av1":h.push("av01.0.01M.08"),q=!0}if(h.length){k=r&&!q;l=new Map;if(q&&!a){a=new ad("video/mp2t");Zc(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,Ud:null,colorGamut:null,frameRate:f.frameRate,timescale:null}}else m=null}if(m)return m}else if(l||k.includes(f))if(m=Sl(h,g,a.g.disableText))return m;
return b?Rl(b):c}function ty(a,b,c,d){if(!a.V)throw new D(2,7,7001);d||={};d.isPreload=a.Tb();b=a.h.networkingEngine.request(c,b,d);og(a.V,b);return b}function Vy(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.Ac));return b}
function mz(a,b){b=X(b,"CODECS")||"";a.W=b.length>0;a.W||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 Tl(b.split(/\s*,\s*/))}
function qz(a,b,c,d=!0){var e=[],f=[],g=new Map;for(var h of b){var k=++a.F,l=d?Vx(h,"URI"):X(h,"URI")||"shaka://hls-muxed"+k;k=Vx(h,"GROUP-ID");e.push(l);f.push(k);g.set(k,l);(l=X(h,"PATHWAY-ID"))&&c.set(k,l)}d=f.sort().join(",");k=b[0];b="";h=Vx(k,"TYPE").toLowerCase();h=="subtitles"&&(h=F);if(h==F)b=X(k,"CODECS")||"";else for(var m of f)if(a.J.has(m)){b=a.J.get(m);break}f=e.sort().join(",");h=="audio"&&d&&(f+=d);if(a.j.has(f))return a.j.get(f);m=a.F++;if(a.l)for(const [t,u]of g)(g=c.get(t))&&Vv(a.l,
m,g,u);c=X(k,"LANGUAGE");g=X(k,"NAME");l=X(k,"DEFAULT")=="YES";var n=h=="audio"?(n=X(k,"CHANNELS"))?parseInt(n.split("/")[0],10):null:null;var p;h=="audio"?(p=X(k,"CHANNELS"))?(p=p.split("/"),p=p.length!=2?!1:p[1]==="JOC"||p[1].includes("ATMOS")||p[1].includes("IMSA")):p=!1:p=!1;const r=X(k,"CHARACTERISTICS"),q=X(k,"FORCED")=="YES";h=="audio"?k=(k=X(k,"SAMPLE-RATE"))?parseInt(k,10):null:k=null;e=wz(a,m,e,b,h,c,l,g,n,null,r,q,k,p);e.stream&&a.g.enableAudioGroups&&(e.stream.groupId=d);a.K.has(d)?a.K.get(d).push(e):
a.K.set(d,[e]);a.j.set(f,e);return e}function rz(a,b){if(a==F){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 sz(a){return a==F?"text/vtt":Zy.get(a).get("mp4")}function kz(a){const b=new Set([Ie(a.mimeType,a.codecs)]);a.segmentIndex&&a.segmentIndex.mb(c=>{c.mimeType&&b.add(Ie(c.mimeType,a.codecs))});a.fullMimeTypes=b}
async function tz(a,b){const c=Vx(b,"URI");var d=X(b,"CODECS","jpeg")||"";if(a.j.has(c))return a.j.get(c);var e=X(b,"LANGUAGE"),f=X(b,"NAME");const g=X(b,"CHARACTERISTICS");d=wz(a,a.F++,[c],d,"image",e,!1,f,null,null,g,!1,null,!1);if(e=X(b,"RESOLUTION")){await d.stream.createSegmentIndex();if(f=d.stream.segmentIndex.wb().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=X(b,"BANDWIDTH"))d.stream.bandwidth=
Number(b);a.j.set(c,d);return d}function nz(a,b){var c="video";const d=Vx(b,"URI");var e=X(b,"CODECS")||"";e=="mjpg"&&(c="image");if(a.j.has(d))return a.j.get(d);const f=X(b,"LANGUAGE"),g=X(b,"NAME"),h=X(b,"CHARACTERISTICS");c=wz(a,a.F++,[d],e,c,f,!1,g,null,null,h,!1,null,!1);e=X(b,"RESOLUTION");const [k,l]=e?e.split("x"):[null,null];c.stream.width=Number(k)||void 0;c.stream.height=Number(l)||void 0;if(b=X(b,"BANDWIDTH"))c.stream.bandwidth=Number(b);a.j.set(d,c);return c}
function xz(a,b,c){b=b.filter(e=>{const f=X(e,"URI")||"";e=X(e,"TYPE");return e!="SUBTITLES"&&(f!=""||e=="AUDIO")});const d={};for(const e of b)b=Tx(e,!a.l),d[b]?d[b].push(e):d[b]=[e];for(const e in d)qz(a,d[e],c,!1)}function Xy(a){return a=="AES-128"||a=="AES-256"||a=="AES-256-CTR"}
async function Yy(a,b,c,d,e,f){if(c=="video/mp2t")throw new D(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new D(2,4,4041);c=Vx(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c))return null;d=cy(d(),Vx(b,"URI"),f);d[0].startsWith("data:text/plain;base64,")?b=Mb(Jb(d[0].split("data:text/plain;base64,").pop())):(b=d.sort().join(""),a.ma.has(b)||(d=ty(a,tg(d,a.g.retryParameters),6).promise,a.ma.set(b,d)),b=await a.ma.get(b),b=Mb(b.data));d="00000000000000000000000000000000";e&&
(a=await py(a,e))&&(d=a);a=new Map;a.set(d,b);e="cenc";c=="SAMPLE-AES"&&(e="cbcs");return Sb(a,e)}
function oz(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=X(k,"AUDIO");const n=X(k,"VIDEO"),p=l||n;if(!p)continue;f.includes(p)||f.push(p);const r=X(k,"PATHWAY-ID");r&&e.set(p,r);l?g=!0:n&&(h=!0)}f.length&&c.length&&(c=c.filter(n=>f.includes(Vx(n,"GROUP-ID"))),xz(a,c,e));c=(e=f.sort().join(","))&&a.K.has(e)?a.K.get(e):[];g?d.audio.push(...c):h&&d.video.push(...c);h=!1;const m=b.map(n=>Vx(n,"URI"));g=d.audio.find(n=>n&&n.S().find(p=>m.includes(p)));
c=mz(a,b[0]);k=Ub("video",c);(l=Ub("audio",c))&&!k?(g="audio",h=d.audio.length>0&&!d.audio.some(n=>n.stream.isAudioMuxedInVideo)):!d.audio.length&&!d.video.length&&l&&k?(g="video",c=[[k,l].join()]):d.audio.length&&g?(g="audio",h=!0):g=d.video.length&&!d.audio.length?"audio":"video";h||(b=yz(a,b,c,g),e&&a.g.enableAudioGroups&&(b.stream.groupId=e),b.stream.type=="audio"&&g==="audio"&&d.audio.some(n=>n.stream.isAudioMuxedInVideo)&&(a=d.audio[0].stream,b.stream.language=a.language,b.stream.channelsCount=
a.channelsCount,b.stream.label=a.label,b.stream.audioSamplingRate=a.audioSamplingRate,b.stream.originalId=a.originalId,b.stream.originalLanguage=a.originalLanguage),d[b.stream.type]=[b]);return d}
function pz(a,b,c,d,e,f,g,h,k,l,m,n){for(var p of c)lz(p.stream,e,f,g,h,k,null);e=a.g.disableVideo;if(!c.length||e)c=[null];e&&(b=b.filter(r=>!r.stream.isAudioMuxedInVideo));e=a.g.disableAudio;if(!b.length||e)b=[null];e=[];for(const r of b)for(const q of c){if(b=r?r.stream:null)b.drmInfos=l,b.keyIds=m;if(f=q?q.stream:null)f.drmInfos=l,f.keyIds=m,a.g.disableIFrames||Uf(f,n);f&&!b&&(f.bandwidth=d);!f&&b&&(b.bandwidth=d);g=r?r.stream.drmInfos:null;h=q?q.stream.drmInfos:null;k=q?q.S().sort().join(","):
"";p=r?r.S().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&&!hb(g,h))continue;if(a.Wa.has(k))continue;b={id:a.F++,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.Wa.add(k)}return e}
function yz(a,b,c,d){const e=a.F++,f=[];for(var g of b){var h=Vx(g,"URI");const l=X(g,"PATHWAY-ID");a.l&&l&&Vv(a.l,e,l,h);f.push(h)}g=f.sort().join(",")+c.sort().join(",");if(a.j.has(g))return a.j.get(g);h=f.join(",");a:{b=X(b[0],"CLOSED-CAPTIONS");if(d=="video"){if(a.g.disableText){a.O=!1;var k=null;break a}if(b){if(b!="NONE"){k=a.I.get(b);break a}a.O=!1}else if(!b&&a.I.size)for(k of a.I.keys()){k=a.I.get(k);break a}}k=null}c=Tb(d,c);d=wz(a,e,f,c,d,null,!1,h,null,k,null,!1,null,!1);a.j.set(g,d);
return d}function lz(a,b,c,d,e,f,g){a&&(a.width=Number(b)||void 0,a.height=Number(c)||void 0,a.frameRate=Number(d)||void 0,a.hdr=e||void 0,a.videoLayout=f||void 0,a.colorGamut=g||void 0)}
function wz(a,b,c,d,e,f,g,h,k,l,m,n,p,r){const q=jz(a,d,e,f,g,h,k,l,m,n,p,r);c.some(z=>z.startsWith("shaka://hls-muxed"))&&(q.isAudioMuxedInVideo=!0,q.mimeType="video/mp2t",kz(q));const t={stream:q,type:e,Ve:[],S:()=>{},Jc:0,Ac:0,Ke:new Map,oe:!1,me:!1,Ed:!1,Ef:-1,Ib:-1,Jb:-1},u=()=>a.l&&c.length>1?Wv(a.l,b):t.Ve.concat(dy([a.G],c,a.C));t.S=u;const v=async z=>{try{const L=await z.promise;if(!z.aborted){var A=L.uri;A!=L.originalUri&&(t.S().includes(A)||t.Ve.push(A));var B=hy(a.Ta,L.data);if(B.type!=
1)throw new D(2,4,4017);var E=Zx(B.ia,"EXT-X-DEFINE"),G=vy(a,E,A);A=!1;(!a.W&&a.g.hls.disableCodecGuessing||a.O&&e=="video"&&!a.g.hls.disableClosedCaptionsDetection)&&B.segments.length>0&&(a.O=!1,A=!0);var ea=ry(a),M=await wy(a,0,G,B,u,d,e,f,g,h,k,l,m,n,p,r,void 0,A,!a.W&&a.g.hls.disableCodecGuessing);if(!z.aborted){var N=M.stream;Gy(a,B);ry(a)&&!ea&&Hy(a,B);t.Jc=M.Jc;t.Ac=M.Ac;t.oe=M.oe;t.me=M.me;t.Ed=M.Ed;t.Ke=M.Ke;t.Ib=M.Ib;t.Jb=M.Jb;q.segmentIndex=N.segmentIndex;q.encrypted=N.encrypted;q.drmInfos=
N.drmInfos;q.keyIds=N.keyIds;q.mimeType=N.mimeType;q.bandwidth=q.bandwidth||N.bandwidth;q.codecs=q.codecs||N.codecs;q.closedCaptions=q.closedCaptions||N.closedCaptions;q.width=q.width||N.width;q.height=q.height||N.height;q.hdr=q.hdr||N.hdr;q.colorGamut=q.colorGamut||N.colorGamut;q.frameRate=q.frameRate||N.frameRate;q.language=="und"&&N.language!="und"&&(q.language=N.language);q.language=q.language||N.language;q.channelsCount=q.channelsCount||N.channelsCount;q.audioSamplingRate=q.audioSamplingRate||
N.audioSamplingRate;kz(q);q.drmInfos.length&&a.h.newDrmInfo(q);z=!1;if(!l&&q.closedCaptions||l&&q.closedCaptions&&l.size!=q.closedCaptions.size)z=!0;a.i&&z&&a.h.makeTextStreamsForClosedCaptions(a.i);if(e==F){const fa=N.segmentIndex.wb();fa&&fa.ha&&(q.mimeType="application/mp4",kz(q))}var ia=xl(q);q.segmentIndex.mb(fa=>{fa.ha&&(fa.ha.ed=ia)});if(zz(a))if(a.lc)Iy(a,[t]);else{a.lc=!0;const fa=Array.from(a.j.values()).filter(ua=>ua.stream.segmentIndex);Iy(a,fa);Jy(a);const Q=a.A;Q>0&&a.B.Z(Q)}Ky(a,B.ia,
q.type,G,u);a.i&&(a.i.startTime=a.u)}}}catch(L){if(q.closeSegmentIndex(),L.code!==7001&&!a.h.disableStream(q))throw L;}};let y=null,w;q.createSegmentIndex=()=>{if(y)return y;if(q.isAudioMuxedInVideo)return q.segmentIndex=new ol([]),Promise.resolve();w=sy(a,t.S(),!0);return y=new Promise(z=>{z(v(w))})};q.closeSegmentIndex=()=>{y&&!q.segmentIndex&&w.abort();q.segmentIndex&&(q.segmentIndex.release(),q.segmentIndex=null);y=null};return t}
function jz(a,b,c,d,e,f,g,h,k,l,m,n){const p=rz(c,b)||sz(c),r=[];if(k)for(var q of k.split(","))r.push(q);q=void 0;k=null;c==F?q=r.includes("public.accessibility.transcribes-spoken-dialog")&&r.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":r.includes("public.accessibility.describes-video")&&(k="visually impaired");r.length||q!=="subtitle"||r.push("subtitle");q=null;c!="video"&&(q=f);a={id:a.F++,originalId:f,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:null,
mimeType:p,codecs:b,kind:c==F?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:$b(d||"und"),originalLanguage:d,label:q,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:r,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};kz(a);return a}function zz(a){if(!a.i||!a.i.variants.length)return!1;const b=[],c=[];for(const d of a.i.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 gz(a,b){var c=ay(b.ia,"EXT-X-PLAYLIST-TYPE");b=ay(b.ia,"EXT-X-ENDLIST");b=c&&c.value=="VOD"||b;c=c&&c.value=="EVENT"&&!b;c=!b&&!c;b?Ty(a,Ly):c?Ty(a,Uy):Ty(a,Az)}
async function iz(a,b,c,d){({segment:d}=uz(a,d));if(d.status==2)return sz(b);d=d.S();const e=Zl(d[0]);if(e){let h=Zy.get(b).get(e);if(h||(h=$y.get(e)))return h}if(c=rz(b,c))return c;let f;d=tg(d,a.g.retryParameters);let g;try{d.method="HEAD",g=await ty(a,d,zg,{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 ty(a,d,zg,{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 ty(a,d,zg,{type:1}).promise),Fj($a(g.data))&&(c="video/mp2t")),c!="application/octet-stream")?c:sz(b)}
function Wy(a,b,c,d,e){const f=ay(c,"EXT-X-MAP");if(!f)return null;var g=Vx(f,"URI");const h=cy(d(),g,e);g=[h.toString(),X(f,"BYTERANGE","")].join("-");if(!a.oa.has(g)){let k=void 0,l=null,m=!1;for(const n of c)n.name=="EXT-X-KEY"?(c=Vx(n,"METHOD"),Xy(c)&&n.id<f.id?(m=!1,k=az(a,n,b,d,e)):m=c!="NONE"):n.name=="EXT-X-BYTERANGE"&&n.id<f.id&&(l=n);b=Bz(h,f,l,k,m);a.oa.set(g,b)}return a.oa.get(g)}
function az(a,b,c,d,e){if(!window.crypto||!window.crypto.subtle)throw sa("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new D(2,4,4042);let f=0,g;const h=X(b,"IV","");if(h){if(g=Kb(h.substr(2)),g.byteLength!=16)throw new D(2,4,4048);}else f=by(c.ia,"EXT-X-MEDIA-SEQUENCE",0);const k=cy(d(),Vx(b,"URI"),e),l=k.sort().join("");c=`${b.toString()}-${f}-${l}`;if(!a.ea.has(c)){const m={bitsKey:128,blockCipherMode:"CBC",iv:g,firstMediaSequenceNumber:f};
switch(Vx(b,"METHOD")){case "AES-256":m.bitsKey=256;break;case "AES-256-CTR":m.bitsKey=256,m.blockCipherMode="CTR"}m.fetchKey=async()=>{if(!a.M.has(l)){var n=ty(a,tg(k,a.g.retryParameters),6).promise;a.M.set(l,n)}n=await a.M.get(l);if(!n.data||n.data.byteLength!=m.bitsKey/8)throw new D(2,4,4049);m.cryptoKey=await window.crypto.subtle.importKey("raw",n.data,{name:m.blockCipherMode=="CTR"?"AES-CTR":"AES-CBC",length:m.bitsKey},!0,["decrypt"]);m.fetchKey=void 0};a.ea.set(c,m)}return a.ea.get(c)}
function Bz(a,b,c,d,e){var f=0,g=null;b=X(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 Pi(()=>a,f,g,null,null,null,d,e)}function Cz(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 bz(a,b,c,d,e,f,g,h,k,l){const m=d.ia;var n=ay(m,"EXTINF"),p=0;let r=0,q=null;d.kc.length&&(a.i.isLowLatency=!0);let t=null;if(!a.g.hls.ignoreManifestProgramDateTime){var u=ay(m,"EXT-X-PROGRAM-DATE-TIME");u&&u.value&&(t=Ld(u.value),a.Va=!0)}let v=Si;ay(m,"EXT-X-GAP")&&(a.i.gapCount++,v=2);if(!n){if(d.kc.length==0)throw new D(2,4,4024,"EXTINF");if(!a.$)return null}let y=[];u=!1;let w=null,z=!1,A=!1;if(a.$&&d.kc.length){p=b&&window.ReadableStream&&a.g.hls.allowLowLatencyByteRangeOptimization;
let ia=t;for(let L=0;L<d.kc.length;L++){var B=d.kc[L],E=L==0?c:y[y.length-1],G=L==0?e:E.endTime;const fa=Number(X(B,"DURATION"))||a.P;if(!fa)continue;const Q=G+fa;var ea=0,M=null;B.name=="EXT-X-PRELOAD-HINT"?(ea=(ea=X(B,"BYTERANGE-START"))?Number(ea):0,(E=X(B,"BYTERANGE-LENGTH"))?M=ea+Number(E)-1:ea&&(M=Number.MAX_SAFE_INTEGER)):(M=X(B,"BYTERANGE"),[ea,M]=Cz(E,M));const ua=X(B,"URI");if(!ua)continue;E=Si;X(B,"GAP")=="YES"&&(a.i.gapCount++,E=2,z=!0);let Ra=null;const Va=()=>{Ra==null&&(Ra=cy(h(),ua,
f));return Ra};p&&ea>=0&&M!=null&&(w=Va,u=!0);G=new I(G,Q,Va,ea,M,b,0,0,Infinity,[],"",null,ia,E,l);B.name=="EXT-X-PRELOAD-HINT"&&(G.ng(),A=!0);X(B,"INDEPENDENT")!="YES"&&L>0&&G.dd();B=k;B||(y.length&&y[0].mimeType?B=y[0].mimeType:ua&&(B=Zl(ua),B=Zy.get(g).get(B)||null));B&&(G.mimeType=B,Dz.has(B)&&(G.ha=null));y.push(G);ia&&(ia+=fa)}}if(n){n=fy(n);if(n==0)return null;p=e+n}else if(y.length)p=y[y.length-1].endTime;else return null;u&&(z||y[0].startByte!=0?(u=!1,w=null):y=[]);(n=ay(m,"EXT-X-BYTERANGE"))?
[r,q]=Cz(c,n.value):y.length&&(r=y[0].startByte,q=y[y.length-1].endByte);c="";n=null;g=="image"&&(c="1x1",g=ay(m,"EXT-X-TILES"))&&(c=Vx(g,"LAYOUT"),(g=X(g,"DURATION"))&&(n=Number(g)));let N=null;b=new I(e,p,()=>{if(w)return w();N==null&&(N=cy(h(),d.g,f));return N||[]},r,q,b,0,0,Infinity,y,c,n,t,v,l,y.length>0&&!!d.g);k&&(b.mimeType=k,Dz.has(k)&&(b.ha=null));u&&(a.jc=!0,b.xh(),A&&b.ng());return b}
async function py(a,b){if(a.na.has(b))var c=a.na.get(b);else c=$l(b.S(),b.wc(),b.uc(),a.g.retryParameters),c=await ty(a,c,zg,{type:0}).promise,b.Qd(c.data),c=Vl(c.data),a.na.set(b,c);return c}
var Ez=class{constructor(){this.g=this.h=null;this.F=1;this.C=new Map;this.K=new Map;this.D=new Map;this.D.set("video",new Map);this.D.set("audio",new Map);this.D.set(F,new Map);this.D.set("image",new Map);this.Vb=(new Map).set("com.apple.streamingkeydelivery",(a,b,c)=>oy(this,a,b,c)).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",a=>{var b=Vx(a,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b)){var c="cenc";b=="SAMPLE-AES"&&(c="cbcs");var d=Vx(a,"URI");b=my(d.split("?")[0]);d=d.split("?")[0];
if(!this.H.has(d)){const e=$a(b.data);this.H.set(d,e)}c=Rb("com.widevine.alpha",c,[{initDataType:"cenc",initData:this.H.get(d)}],void 0,b.Pg);(a=X(a,"KEYID"))&&c.keyIds.add(a.toLowerCase().substr(2));a=Promise.resolve(c)}else a=Promise.resolve(null);return a}).set("com.microsoft.playready",a=>{var b=Vx(a,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b)){var c="cenc";b=="SAMPLE-AES"&&(c="cbcs");a=Vx(a,"URI");b=my(a.split("?")[0]);a=$a(b.data);var d=new Uint8Array([154,4,240,121,152,64,66,134,
171,146,230,91,224,136,95,149]);d=Vg(a,d,new Set,0);c=Rb("com.microsoft.playready",c,[{initDataType:"cenc",initData:d}],void 0,b.Pg);if(a=sd(["<PLAYREADY>",Ib(a),"</PLAYREADY>"].join("\n")))c.licenseServerUri=Su(a);c=Promise.resolve(c)}else c=Promise.resolve(null);return c}).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",a=>{var b=Vx(a,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(b)){var c="cenc";b=="SAMPLE-AES"&&(c="cbcs");var d=Vx(a,"URI");b=my(d.split("?")[0]);d=d.split("?")[0];if(!this.H.has(d)){const e=
$a(b.data);this.H.set(d,e)}c=Rb("com.huawei.wiseplay",c,[{initDataType:"cenc",initData:this.H.get(d)}],void 0,b.Pg);(a=X(a,"KEYID"))&&c.keyIds.add(a.toLowerCase().substr(2));a=Promise.resolve(c)}else a=Promise.resolve(null);return a});this.Wa=new Set;this.j=new Map;this.m=null;this.G="";this.Ta=new ky;this.L=-1;this.X=Infinity;this.W=this.lc=this.Va=!1;this.B=new H(()=>{if(this.T&&!this.g.continueLoadingWhenPaused&&(this.R.Ea(this.T,"timeupdate"),this.T.paused)){this.R.sa(this.T,"timeupdate",()=>
qy(this));return}qy(this)});this.za=Ly;this.i=null;this.Oa=0;this.A=Infinity;this.Ha=this.Aa=this.P=0;this.V=new pg;this.I=new Map;this.J=new Map;this.oa=new Map;this.ea=new Map;this.M=new Map;this.ma=new Map;this.na=new Map;this.jc=this.$=!1;this.Ab=new qc(5);this.l=null;this.O=!0;this.R=new zc;this.u=this.T=null;this.Tb=()=>!1;this.H=new Map}configure(a,b){const c=this.h&&a.updatePeriod!=this.g.updatePeriod&&a.updatePeriod>=0;this.g=a;b&&(this.Tb=b);this.l&&this.l.configure(this.g);c&&this.i&&this.i.presentationTimeline.U()&&
this.B.Ia()}async start(a,b){this.h=b;this.$=b.isLowLatencyMode();a=await sy(this,[a]).promise;this.G=a.uri;await uy(this,a.data);return this.i}stop(){this.B&&(this.B.stop(),this.B=null);const a=[];this.V&&(a.push(this.V.destroy()),this.V=null);this.g=this.h=null;this.Wa.clear();this.i=null;this.j.clear();this.K.clear();this.J.clear();this.C.clear();this.oa.clear();this.ea.clear();this.M.clear();this.ma.clear();this.na.clear();this.H.clear();this.l&&this.l.destroy();this.R&&(this.R.release(),this.R=
null);return Promise.all(a)}async update(){if(ry(this)){var a=[],b=Array.from(this.j.values()).filter(c=>!c.stream.isAudioMuxedInVideo&&c.stream.segmentIndex);if(b.length!==0){this.A=Infinity;this.i.gapCount=0;for(const c of b)a.push(My(this,c));await Promise.all(a);Sy(this,b.map(c=>c.stream));a=b.some(c=>c.Ed==0);b.length&&!a&&(Ty(this,Ly),Jy(this));a&&Jy(this);for(const c of b)c.stream.isAudioMuxedInVideo||!c.stream.segmentIndex||c.stream.segmentIndex.wb()||this.h.disableStream(c.stream)}}}onExpirationUpdated(){}onInitialVariantChosen(){}banLocation(a){this.l&&
this.l.banLocation(a)}setMediaElement(a){this.T=a}};x("shaka.hls.HlsParser",Ez);
var $y=(new Map).set("aac","audio/aac").set("ac3","audio/ac3").set("ec3","audio/ec3").set("mp3","audio/mpeg"),Fz=(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"),Gz=(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"),Hz=(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"),Iz=(new Map).set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif"),Zy=(new Map).set("audio",Fz).set("video",Gz).set("text",Hz).set("image",Iz),Dz=new Set(["video/mp2t",
...Ke]),Ly="VOD",Az="EVENT",Uy="LIVE";Nc("application/x-mpegurl",()=>new Ez);Nc("application/vnd.apple.mpegurl",()=>new Ez);Nc("audio/x-mpegurl",()=>new Ez);function Jz(a){return Su(a)}var Kz=(new Map).set("com.microsoft.playready",Jz).set("com.microsoft.playready.recommendation",Jz).set("com.microsoft.playready.software",Jz).set("com.microsoft.playready.hardware",Jz);async function Lz(a){try{await Mz(a)}catch(b){a.h&&(b.severity=1,a.h.onError(b))}}
async function Mz(a){const b=Date.now();var c=a.h.networkingEngine.request(0,tg(a.l,a.g.retryParameters),{type:5,isPreload:a.B()});og(a.C,c);var d=await c.promise;if(a.h){d.uri&&!a.l.includes(d.uri)&&a.l.unshift(d.uri);c=d.uri;var e=d.data;d=a.g.mss.manifestPreprocessor;if(d!=qn){Ic("manifest.mss.manifestPreprocessor configuration","Please Use manifest.mss.manifestPreprocessorTXml instead.");e=Kw(e,"SmoothStreamingMedia");if(!e)throw new D(2,4,4046,c);d(e);e=Cb(e.outerHTML)}d=rd(e,"SmoothStreamingMedia");
if(!d)throw new D(2,4,4046,c);c=a.g.mss.manifestPreprocessorTXml;c!=rn&&c(d);a.i||(a.i=new Ok(null,0));if(c=Id(d,"IsLive",Sd,!1))throw new D(2,4,4047);a.i.Nc(!c);e=Id(d,"TimeScale",Qd,1E7);var f=Id(d,"DVRWindowLength",Qd);c&&(f===0||isNaN(f))&&(f=Infinity);var g=Id(d,"CanSeek",Sd,!1);f===0&&g&&(f=Infinity);g=null;f&&f>0&&(g=f/e);c&&!isNaN(a.g.availabilityWindowOverride)&&(g=a.g.availabilityWindowOverride);g==null&&(g=Infinity);a.i.bf(g);f=Id(d,"Duration",Qd,Infinity);c||a.i.qb(f/e);c={variants:[],
textStreams:[],timescale:e,duration:f/e};f=zd(d,"Protection");e=a.g.mss.keySystemsBySystemId;g=[];for(var h of f)g=g.concat(zd(h,"ProtectionHeader"));if(g.length){h=g;f=[];for(g=0;g<h.length;g++){var k=h[g],l=k.attributes.SystemID.toLowerCase(),m=e[l];if(m){var n;a:{if(n=Qu(k))for(r of Cd(n,"DATA"))if(n=Fd(r,"KID")){n=Jb(Ad(n));n=new Uint8Array([n[3],n[2],n[1],n[0],n[5],n[4],n[7],n[6],...n.slice(8)]);n=Mb(n);break a}n=null}var p=Jb(Ad(k));l=Kb(l.replace(/-/g,""));l=[{initData:Vg(p,l,new Set,0),initDataType:"cenc",
keyId:n}];l=Rb(m,"cenc",l);n&&l.keyIds.add(n);if(m=Kz.get(m))l.licenseServerUri=m(k);f.push(l)}}var r=f}else r=[];f=r;h=[];r=[];e=[];d=zd(d,"StreamIndex");for(var q of d){d=zd(q,"QualityLevel");g=c.timescale;k=c.duration;m=zd(q,"c");l=[];var t=0;for(n=0;n<m.length;++n){var u=m[n],v=m[n+1],y=Id(u,"t",Qd);p=Id(u,"d",Qd);u=Id(u,"r",Od);if(!p)break;y=y!=null?y:t;(u=u||0)&&u--;if(u<0)if(v){v=Id(v,"t",Qd);if(v==null)break;else if(y>=v)break;u=Math.ceil((v-y)/p)-1}else{if(k==Infinity)break;else if(y/g>=
k)break;u=Math.ceil((k*g-y)/p)-1}for(v=0;v<=u;++v)t=y+p,l.push({start:y/g,end:t/g,td:y}),y=t}g=l;for(var w of d)(d=Nz(a,q,w,g,f,c))&&(d.type!="audio"||a.g.disableAudio?d.type!="video"||a.g.disableVideo?d.type!=F||a.g.disableText||e.push(d):r.push(d):h.push(d))}q=[];for(const z of h.length>0?h:[null])for(const A of r.length>0?r:[null])w=q,d=w.push,h=0,z&&z.bandwidth&&z.bandwidth>0&&(h+=z.bandwidth),A&&A.bandwidth&&A.bandwidth>0&&(h+=A.bandwidth),h={id:a.A++,language:z?z.language:"und",disabledUntilTime:0,
primary:!!z&&z.primary||!!A&&A.primary,audio:z,video:A,bandwidth:h,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},d.call(w,h);c.variants=q;c.textStreams=e;a.j?(a.j.variants=c.variants,a.j.textStreams=c.textStreams,a.h.filter(a.j)):(a.j={presentationTimeline:a.i,variants:c.variants,textStreams:c.textStreams,imageStreams:[],offlineSessionIds:[],sequenceMode:a.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:"MSS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,
isLowLatency:!1,startTime:null},a.i.Je());Promise.resolve();a.D.sample(1,(Date.now()-b)/1E3)}}
function Nz(a,b,c,d,e,f){const g=b.attributes.Type;if(g!=="audio"&&g!=="video"&&g!=="text")return sa("Ignoring unrecognized type:",g),null;const h=b.attributes.Language,k=a.A++,l=Id(c,"Bitrate",Pd),m=Id(c,"MaxWidth",Pd),n=Id(c,"MaxHeight",Pd),p=Id(c,"Channels",Pd),r=Id(c,"SamplingRate",Pd);let q=f.duration;d.length&&(q=d[d.length-1].end-d[0].start);var t=a.i.getDuration();a.i.qb(Math.min(q,t));(t=b.attributes.Name)&&(t+=c.attributes.Index);t||=String(k);const u={id:k,originalId:t,groupId:null,createSegmentIndex:()=>
Promise.resolve(),closeSegmentIndex:()=>Promise.resolve(),segmentIndex:null,mimeType:"",codecs:"",frameRate:void 0,pixelAspectRatio:void 0,bandwidth:l||0,width:m||void 0,height:n||void 0,kind:"",encrypted:e.length>0,drmInfos:e,keyIds:new Set,language:$b(h||"und"),originalLanguage:h,label:"",type:"",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:[],roles:[],forced:!1,channelsCount:p,audioSamplingRate:r,spatialAudio:!1,closedCaptions:null,hdr:void 0,colorGamut:void 0,videoLayout:void 0,
tilesLayout:void 0,matchedStreams:[],mssPrivateData:{duration:q,timescale:f.timescale,codecPrivateData:null},accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null};if(e=b.attributes.Subtype)(e=Oz.get(e))&&u.roles.push(e),e==="main"&&(u.primary=!0);e=c.attributes.FourCC;if(e===null||e==="")e=b.attributes.FourCC;if(!e)if(g==="audio")e="AAC";else if(g==="video")return sa('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),
null;if(!Pz.includes(e.toUpperCase()))return sa("Codec not supported:",e),null;c=Qz(c,g,e,u);u.mssPrivateData.codecPrivateData=c;switch(g){case "audio":if(!c)return sa("Quality unsupported without CodecPrivateData",g),null;u.type="audio";u.mimeType="mss/audio/mp4";u.codecs=Rz(e,c);break;case "video":if(!c)return sa("Quality unsupported without CodecPrivateData",g),null;u.type="video";u.mimeType="mss/video/mp4";u.codecs=Sz(c);break;case "text":if(u.type=F,u.mimeType="application/mp4",e==="TTML"||e===
"DFXP")u.codecs="stpp"}u.fullMimeTypes.add(Ie(u.mimeType,u.codecs));u.createSegmentIndex=()=>{if(u.segmentIndex)return Promise.resolve();if(a.m.has(u.id))var v=a.m.get(u.id);else v=[],u.type=="video"&&(v=u.mssPrivateData.codecPrivateData.split("00000001").slice(1)),v={id:u.id,type:u.type,codecs:u.codecs,encrypted:u.encrypted,timescale:u.mssPrivateData.timescale,duration:u.mssPrivateData.duration,rb:v,Fa:new Uint8Array([]),Sa:new Uint8Array([]),Za:0,$a:0,data:null,stream:u},v=ii(new Fi([v])),a.m.set(u.id,
v);v=Tz(a,new Pi(()=>[],0,null,xl(u),u.mssPrivateData.timescale,v,null,u.encrypted),u,b,d);u.segmentIndex=new ol(v);return Promise.resolve()};u.closeSegmentIndex=()=>{u.segmentIndex&&(u.segmentIndex.release(),u.segmentIndex=null)};return u}
function Qz(a,b,c,d){if(a=a.attributes.CodecPrivateData)return a;if(b!=="audio")return null;b=d.channelsCount||2;a=d.audioSamplingRate||44100;const e={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=e[a];if(c==="AACH")return c=new Uint8Array(4),a=e[a*2],c[0]=40|d>>1,c[1]=d<<7|b<<3|a>>1,c[2]=a<<7|8,c[3]=0,b=new Uint16Array(2),b[0]=(c[0]<<8)+c[1],b[1]=(c[2]<<8)+c[3],b[0].toString(16)+b[1].toString(16);c=new Uint8Array(2);c[0]=16|d>>1;c[1]=d<<7|b<<
3;b=new Uint16Array(1);b[0]=(c[0]<<8)+c[1];return b[0].toString(16)}function Rz(a,b){let c=0;a==="AACH"&&(c=5);b?c===0&&(c=(parseInt(b.substr(0,2),16)&248)>>3):(c=2,a==="AACH"&&(c=5));return"mp4a.40."+c}function Sz(a){const b=/00000001[0-9]7/.exec(a);return b.length&&a?"avc1."+a.substr(a.indexOf(b[0])+10,6):""}
function Tz(a,b,c,d,e){const f=d.attributes.Url.replace("{bitrate}",String(c.bandwidth));d=[];for(const g of e)d.push(new I(g.start,g.end,()=>Qb(a.l,[f.replace("{start time}",String(g.td))]),0,null,b,0,0,c.mssPrivateData.duration));return d}
var Uz=class{constructor(){this.h=this.g=null;this.l=[];this.j=null;this.A=1;this.i=null;this.D=new qc(5);this.u=new H(()=>{Lz(this)});this.C=new pg;this.m=new Map;this.B=()=>!1}configure(a,b){this.g=a;b&&(this.B=b)}async start(a,b){this.l=[a];this.h=b;await Mz(this);if(!this.h)throw new D(2,7,7001);return this.j}stop(){this.g=this.h=null;this.l=[];this.j=null;this.u!=null&&(this.u.stop(),this.u=null);this.m.clear();return this.C.destroy()}async update(){try{await Mz(this)}catch(a){if(this.h&&a)this.h.onError(a)}}onExpirationUpdated(){}onInitialVariantChosen(){}banLocation(){}setMediaElement(){}};
x("shaka.mss.MssParser",Uz);var Pz="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),Oz=(new Map).set("CAPT","main").set("SUBT","alternate").set("DESC","main");Nc("application/vnd.ms-sstr+xml",()=>new Uz);function Vz(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=Bb(b)}catch(h){}throw new D(c==401||c==403?2:1,1,1001,d,c,f,a,g,e||d);};function Wz(a,b,c,d,e,f){const g=new Xz;try{Fg(b.headers).forEach((l,m)=>{g.append(m,l)})}catch(l){return hg(new D(1,1,1002,a,l,c))}const h=new Yz,k={$g:!1,Xh:!1};a=Zz(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 ig(a,()=>{k.$g=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){const l=new H(()=>{k.Xh=!0;h.abort()});l.Z(b/1E3);a.finally(()=>
{l.stop()})}return a}
async function Zz(a,b,c,d,e,f,g,h,k){let l,m=new ArrayBuffer(0),n=0,p=0,r={},q=Date.now();try{l=await $z(a,d);r=aA(l.headers);g(r);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 bA({start:y=>{const w=async()=>{let z;try{z=await v.read()}catch(E){return}z.done||(n+=z.value.byteLength,h&&await h(z.value));const A=Date.now(),B=n-p;if(A-q>100&&B>=k||z.done)f(A-q,B,z.done?0:u-n),p=n,q=A;z.done?y.close():(y.enqueue(z.value),
w())};w()}});m=await l.arrayBuffer()}else m=await l.arrayBuffer(),f(Date.now()-q,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&&sa("Payload length does not match range requested bytes",b,l)}}catch(t){if(e.$g)throw new D(1,1,7001,a,c);if(e.Xh)throw new D(1,1,1003,a,c);throw new D(1,1,1002,a,t,c);}return Vz(r,m,l.status,a,l.url,b,c)}
function aA(a){const b={};a.forEach((c,d)=>{b[d.trim()]=c});return b}function cA(){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 dA=class{};x("shaka.net.HttpFetchPlugin",dA);dA.isSupported=cA;dA.parse=Wz;var $z=window.fetch,Yz=window.AbortController,bA=window.ReadableStream,Xz=window.Headers;
cA()&&(qg("http",Wz,2,!0),qg("https",Wz,2,!0),qg("blob",Wz,2,!0));function eA(a,b,c,d,e,f){const g=new fA;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 D(1,1,7001,a,c))};g.onreadystatechange=()=>{if(g.readyState===XMLHttpRequest.HEADERS_RECEIVED){var r=g.getAllResponseHeaders().trim().split("\r\n");const q={};for(const t of r)r=t.indexOf(": "),r!==-1&&(q[t.slice(0,r).toLowerCase()]=t.slice(r+2));p=
q;e(p)}};g.onload=()=>{const r=g.response;try{const q=Vz(p,r,g.status,a,g.responseURL,b,c);m(q)}catch(q){n(q)}};g.onerror=r=>{n(new D(1,1,1002,a,r,c))};g.ontimeout=()=>{n(new D(1,1,1003,a,c))};g.onprogress=r=>{const q=Date.now(),t=f.minBytesForProgressEvents||0,u=r.loaded-k;if(q-h>100&&u>=t||r.lengthComputable&&r.loaded==r.total)d(q-h,u,g.readyState==4?0:r.total-r.loaded),k=r.loaded,h=q};for(const r in b.headers)try{g.setRequestHeader(r.toLowerCase(),b.headers[r])}catch(q){throw new D(1,1,1002,a,
q,c);}g.send(b.body)});return new ig(l,()=>{g.abort();return Promise.resolve()})}var gA=class{};x("shaka.net.HttpXHRPlugin",gA);gA.parse=eA;var fA=window.XMLHttpRequest;qg("http",eA,1,!0);qg("https",eA,1,!0);qg("blob",eA,1,!0);function hA(a){const b=a.Rb(!1);return b?Ib(b):a.S().map(c=>"{"+encodeURI(c.split("#xywh=")[0])+"}").join("")+":"+a.startByte+":"+a.endByte}function iA(a,b){return $l(a.g.S(),a.g.startByte,a.g.endByte,b.streaming.retryParameters)}var jA=class{constructor(a,b,c,d,e){this.g=a;this.h=b;this.groupId=c;this.i=d;this.j=e}};function kA(a,b){a.i+=b;const c=a.l;a.l++;a.h.set(c,b);return c}function lA(a){return a.i==0?0:a.j/a.i}var mA=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 nA(a){a.l=!0;const b=a.j.map(c=>c());a.j=[];return Promise.all(b)}function oA(a,b,c){a.u=b;a.m=c}async function pA(a,b){const c=a.A.request(zg,b);b=()=>c.abort();a.j.push(b);const d=await c.promise;tc(a.j,b);return d.data}
function qA(a,b,c,d,e,f){Dg(a.h);const g=(a.i.get(b)||Promise.resolve()).then(()=>{if(a.h.g)throw new D(2,9,7001);if(e){var h=$a(c);h=new Wg(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.u(lA(a.g),a.g.g);return f(c)});a.i.set(b,g)}async function rA(a){await Promise.all(a.i.values());return a.g.g}
var sA=class{constructor(a){this.A=a;this.i=new Map;this.h=new Eg(()=>nA(this).catch(()=>{}));this.j=[];this.u=()=>{};this.m=()=>{};this.g=new mA;this.l=!1}destroy(){return this.h.destroy()}queue(a,b,c,d,e){Dg(this.h);const f=(this.i.get(a)||Promise.resolve()).then(async()=>{const g=await pA(this,b);if(this.h.g)throw new D(2,9,7001);if(d){var h=$a(g);h=new Wg(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.u(lA(this.g),this.g.g);return e(g)});
this.i.set(a,f);return f}};function tA(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 uA=class{constructor(a,b){this.i=a;this.h=a.objectStore(b);this.g=new gg;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}catch(a){}}store(){return this.h}promise(){return this.g}};function vA(a,b,c){c=a.h.transaction([b],c);const d=new uA(c,b);a.g.push(d);d.promise().then(()=>{tc(a.g,d)},()=>{tc(a.g,d)});return d}function wA(a,b){return vA(a,b,"readwrite")}var xA=class{constructor(a){this.h=a;this.g=[]}destroy(){return Promise.all(this.g.map(a=>a.abort()))}};function yA(a){return Promise.reject(new D(2,9,9011,"Cannot add new value to "+a))}function zA(a,b,c,d){a=wA(a.h,b);b=a.store();for(const e of c)b.delete(e).onsuccess=()=>d(e);return a.promise()}async function AA(a,b,c){a=vA(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 D(2,9,9012,"Could not find values for "+e);return c.map(f=>d[f])}
function BA(a,b,c){a=wA(a.h,a.g);const d=a.store();d.get(b).onsuccess=()=>{d.put(c,b)};return a.promise()}
var CA=class{constructor(a,b,c){this.h=new xA(a);this.j=b;this.g=c}destroy(){return this.h.destroy()}hasFixedKeySpace(){return!0}addSegments(){return yA(this.j)}removeSegments(a,b){return zA(this,this.j,a,b)}async getSegments(a){return(await AA(this,this.j,a)).map(b=>this.l(b))}addManifests(){return yA(this.g)}updateManifest(){return Promise.reject(new D(2,9,9016,"Cannot modify values in "+this.g))}updateManifestExpiration(a,b){const c=wA(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 zA(this,this.g,a,b)}async getManifests(a){a=await AA(this,this.g,a);return Promise.all(a.map(b=>this.i(b)))}async getAllManifests(){const a=vA(this.h,this.g,"readonly"),b=new Map;await tA(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=wA(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 DA=class{constructor(a){this.g=new xA(a)}destroy(){return this.g.destroy()}async getAll(){const a=vA(this.g,"session-ids","readonly"),b=[];await tA(a,(c,d)=>{b.push(d)});await a.promise();return b}add(a){const b=wA(this.g,"session-ids"),c=b.store();for(const d of a)c.add(d);return b.promise()}async remove(a){const b=wA(this.g,"session-ids");await tA(b,(c,d,e)=>{a.includes(d.sessionId)&&e.delete()});await b.promise()}};function EA(a,b){FA.set(a,b)}function GA(a){let b=null;a.g.forEach((c,d)=>{c.getCells().forEach((e,f)=>{e.hasFixedKeySpace()||b||(b={path:{Hb:d,bb:f},bb:e})})});if(b)return b;throw new D(2,9,9013,"Could not find a cell that supports add-operations");}function HA(a,b){a.g.forEach((c,d)=>{c.getCells().forEach((e,f)=>{b({Hb:d,bb:f},e)})})}
function IA(a,b,c){a=a.g.get(b);if(!a)throw new D(2,9,9013,"Could not find mechanism with name "+b);b=a.getCells().get(c);if(!b)throw new D(2,9,9013,"Could not find cell with name "+c);return b}function JA(a,b){a.g.forEach(c=>{b(c.getEmeSessionCell())})}function KA(a){const b=Array.from(a.g.keys());if(!b.length)throw new D(2,9,9E3,"No supported storage mechanisms found");return a.g.get(b[0]).getEmeSessionCell()}
async function LA(a){const b=Array.from(a.g.values());(a=b.length>0)||FA.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 MA=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(){FA.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)}};
x("shaka.offline.StorageMuxer",MA);MA.unregister=function(a){FA.delete(a)};MA.register=EA;MA.prototype.destroy=MA.prototype.destroy;var FA=new Map;function NA(a,b){OA(a);for(const c of a.streams);return a.streams.map(c=>PA(c,a.startTime,b))}
function PA(a,b,c){const d=a.initSegmentUri?QA(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=QA(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}}),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}
function QA(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 D(2,9,9004,"Could not parse uri "+a);}
function OA(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 RA=class extends CA{async updateManifestExpiration(a,b){const c=wA(this.h,this.g),d=c.store(),e=new gg;d.get(a).onsuccess=f=>{(f=f.target.result)?(f.expiration=b,d.put(f),e.resolve()):e.reject(new D(2,9,9012,"Could not find values for "+a))};await Promise.all([c.promise(),e])}async i(a){var b=[];for(let c=0;c<a.periods.length;++c){const d=NA(a.periods[c],(c==a.periods.length-1?a.duration:a.periods[c+1].startTime)-a.periods[c].startTime);b.push(d)}b=await $v(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 SA(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})),variantIds:a.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}
var TA=class extends CA{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(SA(g,c.startTime,c.startTime+d));b.push(f)}b=await $v(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 UA=class extends CA{hasFixedKeySpace(){return!1}addSegments(a){return this.add(this.j,a)}addManifests(a){return this.add(this.g,a)}updateManifest(a,b){return BA(this,a,b)}i(a){a.expiration==null&&(a.expiration=Infinity);return Promise.resolve(a)}};function VA(){const a=new gg,b=window.indexedDB.deleteDatabase("shaka_offline_db");b.onblocked=()=>{};b.onsuccess=()=>{a.resolve()};b.onerror=c=>{a.reject(new D(2,9,9001,b.error));c.preventDefault()};return a}
var XA=class{constructor(){this.m=this.j=this.i=this.h=this.g=this.l=null}init(){const a=new gg;let b=!1;const c=new H(()=>{b=!0;a.reject(new D(2,9,9017))});typeof WA==="number"&&WA>0&&c.Z(WA);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 RA(e,"segment","manifest"):null;this.g=f;f=e.objectStoreNames;f=f.contains("manifest-v2")&&f.contains("segment-v2")?new TA(e,
"segment-v2","manifest-v2"):null;this.h=f;f=e.objectStoreNames;f=f.contains("manifest-v3")&&f.contains("segment-v3")?new TA(e,"segment-v3","manifest-v3"):null;this.i=f;f=e.objectStoreNames;f=f.contains("manifest-v5")&&f.contains("segment-v5")?new UA(e,"segment-v5","manifest-v5"):null;this.j=f;e=e.objectStoreNames.contains("session-ids")?new DA(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 D(2,9,9001,d.error)),e.preventDefault())};return a}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 VA();this.j=this.i=this.h=this.g=this.l=null;await this.init()}},WA=5;x("shaka.offline.indexeddb.StorageMechanismOpenTimeout",WA);EA("idb",()=>tb().W()?new XA:null);function YA(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 ZA(b,c,d,Number(a[4])):null}var ZA=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("")}Hb(){return this.i}bb(){return this.h}key(){return this.l}toString(){return this.j}};function $A(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=aB(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=aB(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 aB(a,b,c){const d=b.segments.map(e=>bB(a,e,b));c.Ld(d);return{id:b.id,originalId:b.originalId,groupId:b.groupId,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ol(d),mimeType:b.mimeType,codecs:b.codecs,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,mssPrivateData:b.mssPrivateData,accessibilityPurpose:null,external:b.external,fastSwitching:b.fastSwitching,fullMimeTypes:new Set([Ie(b.mimeType,b.codecs)]),isAudioMuxedInVideo:b.isAudioMuxedInVideo||!1,baseOriginalId:null}}
function cB(a,b){const c=new Ok(null,0);c.qb(b.duration);var d=b.streams.filter(h=>h.type=="audio"),e=b.streams.filter(h=>h.type=="video");d=$A(a,d,e,c);e=b.streams.filter(h=>h.type==F).map(h=>aB(a,h,c));const f=b.streams.filter(h=>h.type=="image").map(h=>aB(a,h,c)),g=b.drmInfo?[b.drmInfo]:[];if(b.drmInfo)for(const h of d.values())h.audio&&h.audio.encrypted&&(h.audio.drmInfos=g),h.video&&h.video.encrypted&&(h.video.drmInfos=g);return{presentationTimeline:c,offlineSessionIds:b.sessionIds,variants:Array.from(d.values()),
textStreams:e,imageStreams:f,sequenceMode:b.sequenceMode||!1,ignoreManifestTimestampsInSegmentsMode:!1,type:b.type||"UNKNOWN",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null}}
function bB(a,b,c){const d=new ZA("segment",a.h,a.g,b.dataKey);a=new I(b.startTime,b.endTime,()=>[d.toString()],0,null,b.initSegmentKey!=null?dB(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.df(b.thumbnailSprite);return a}function dB(a,b){const c=new ZA("segment",a.h,a.g,b);return new Pi(()=>[c.toString()],0,null)}
var eB=class{constructor(a,b){this.h=a;this.g=b}};var fB=class{constructor(){this.g=null}configure(){}async start(a,b){const c=YA(a);this.g=c;if(c==null||c.g!="manifest")throw new D(2,1,9004,a);a=new MA;try{await a.init();const d=(await (await IA(a,c.Hb(),c.bb())).getManifests([c.key()]))[0],e=cB(new eB(c.Hb(),c.bb()),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 MA;try{await d.init();const e=await IA(d,c.Hb(),c.bb()),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(){}};Nc("application/x-offline-manifest",()=>new fB);function gB(a,b){const c=YA(a);c&&c.g=="manifest"?(a={uri:a,originalUri:a,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"},originalRequest:b},a=kg(a)):a=c&&c.g=="segment"?hB(c.key(),c,b):hg(new D(2,1,9004,a));return a}function hB(a,b,c){const d=new MA;return kg(void 0).Ya(()=>d.init()).Ya(()=>IA(d,b.Hb(),b.bb())).Ya(e=>e.getSegments([b.key()])).Ya(e=>({uri:b,data:e[0].data,headers:{},originalRequest:c})).finally(()=>d.destroy())}var iB=class{};
x("shaka.offline.OfflineScheme",iB);iB.plugin=gB;qg("offline",gB);function jB(a){const b=[];for(const c of a){a=!1;for(const d of b)if(kB(d.info,c)){d.sessionIds.push(c.sessionId);a=!0;break}a||b.push({info:c,sessionIds:[c.sessionId]})}return b}function kB(a,b){const c=(d,e)=>d.robustness==e.robustness&&d.contentType==e.contentType;return a.keySystem==b.keySystem&&a.licenseUri==b.licenseUri&&uc(a.audioCapabilities,b.audioCapabilities,c)&&uc(a.videoCapabilities,b.videoCapabilities,c)}
async function lB(a,b,c){const d=new Ih({hc:b,onError:()=>{},Re:()=>{},onExpirationUpdated:()=>{},onEvent:()=>{}});try{d.configure(a),await nh(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 Bh(d,f),e.push(f)}catch(g){}}));await d.destroy();return e}
async function mB(a,b,c){let d=[];for(const e of jB(c))c=await lB(a,b,e),d=d.concat(c);return d};function nB(a,b,c){const d=b.presentationTimeline.getDuration();b=oB(b);return{offlineUri:null,originalManifestUri:a,duration:d,size:0,expiration:Infinity,tracks:b,appMetadata:c,isIncomplete:!1}}function oB(a){const b=[],c=Qf(a.variants);for(const d of c)b.push(If(d));a=a.textStreams;for(const d of a)b.push(Jf(d));return b}
function pB(a,b){var c=cB(new eB(a.Hb(),a.bb()),b);const d=b.appMetadata||{};c=oB(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 qB(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 rB(a,b){a=a.g.get(b);a==null&&(a=0);return a}var sB=class{constructor(){this.g=new Map}};function tB(){if(Qc(tb()))a:{var a=FA;for(b of a.values())if(a=b()){a.destroy();var b=!0;break a}b=!1}else b=!1;return b}async function uB(a){const b=new MA;await b.init();const c=await GA(b);a=new ZA("manifest",c.path.Hb,c.path.bb,a);await b.destroy();await (new vB).remove(a.toString())}
async function wB(a,b,c,d,e,f){let g=!1;try{let h=!0;for(const k of c.streams)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 uB(b),
g||(b=Object.values(d),await a.removeSegments(b,()=>{})),h;}}function xB(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 yB(a,b){const c=[];for(const d of a.streams)b&&d.type=="video"?c.push({contentType:Ie(d.mimeType,d.codecs),robustness:a.drmInfo.videoRobustness}):b||d.type!="audio"||c.push({contentType:Ie(d.mimeType,d.codecs),robustness:a.drmInfo.audioRobustness});return c}
async function zB(a,b,c,d){if(d.drmInfo){c=KA(c);var e=d.sessionIds.map(g=>({sessionId:g,keySystem:d.drmInfo.keySystem,licenseUri:d.drmInfo.licenseServerUri,serverCertificate:d.drmInfo.serverCertificate,audioCapabilities:yB(d,!1),videoCapabilities:yB(d,!0)})),f=await mB(b,a,e);await c.remove(f);await c.add(e.filter(g=>!f.includes(g.sessionId)))}}
function AB(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 BB(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);return b}function CB(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 DB(a,b,c,d,e,f,g,h){EB();let k=null,l=null;const m=new MA;let n=null,p=null,r=null;try{k=await f();const q=await FB(a,b,k,g);GB(a);if(q.presentationTimeline.U()||q.presentationTimeline.Ic())throw new D(2,9,9005,b);for(const z of d){const A=await HB(a,z,q);q.imageStreams.push(A);GB(a)}for(const z of e){const A=await IB(a,q,z.uri,z.language,z.kind,z.mime,z.codecs);q.textStreams.push(A);GB(a)}Xg(g.drm.clearKeys,q.variants);const t=q.variants.some(z=>{if(z.audio)for(const A of z.audio.drmInfos)if(A.licenseServerUri.startsWith("data:"))return!0;
if(z.video)for(const A of z.video.drmInfos)if(A.licenseServerUri.startsWith("data:"))return!0;return!1});let u=g.offline.usePersistentLicense;t&&(u=!1);l=await a.Vc(q,z=>{r=r||z},g,u);GB(a);if(r)throw r;await JB(q,l,g,u);await m.init();GB(a);n=await GA(m);GB(a);const {xj:v,Og:y}=KB(l,q,b,c,g,h,u),w=await n.bb.addManifests([v]);GB(a);p=w[0];GB(a);if(r)throw r;await LB(a,y,p,v,h,g,n.bb,q,l,u);GB(a);MB(q,v,l,u);await n.bb.updateManifest(p,v);GB(a);return pB(new ZA("manifest",n.path.Hb,n.path.bb,p),v)}catch(q){throw p!=
null&&await uB(p),r||q;}finally{await m.destroy(),k&&await k.stop(),l&&await l.destroy()}}function NB(a,b){const c=b.promise;a.i.push(c);return b.finally(()=>{tc(a.i,c)})}function EB(){if(!tB())throw new D(2,9,9E3);}
async function FB(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:()=>{},disableStream:()=>{},addFont:()=>{}};c.configure(d.manifest);GB(a);b=await c.start(b,f);GB(a);c=BB(b);await Promise.all(Ca(c,g=>g.createSegmentIndex()));
GB(a);if(e)throw e;return b}function GB(a){if(a.j.g)throw new D(2,9,7001);}
async function HB(a,b,c){var d=await OB(a,b);if(d!="text/vtt")throw new D(1,2,2017,b);var e=await PB(b,a.g,a.h.streaming.retryParameters),f=Xe(d);if(!f)throw new D(2,2,2014,d);f=f();c={periodStart:0,segmentStart:0,segmentEnd:c.presentationTimeline.getDuration(),vttOffset:0};e=$a(e);f=f.parseMedia(e,c,b,[]);e=[];for(const g of f){let h=null;f=new I(g.startTime,g.endTime,()=>{h==null&&(h=Qb([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.df({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 Xl(e[0].S()[0],a.g,a.h.manifest.retryParameters));return{id:a.m++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:new ol(e),mimeType:d||"",codecs:"",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([Ie(d||"","")]),isAudioMuxedInVideo:!1,baseOriginalId:null}}
async function IB(a,b,c,d,e,f,g){f||=await OB(a,c);a={id:a.m++,originalId:null,groupId:null,createSegmentIndex:()=>Promise.resolve(),segmentIndex:nl(0,b.presentationTimeline.getDuration(),[c]),mimeType:f||"",codecs:g||"",kind:e,encrypted:!1,drmInfos:[],keyIds:new Set,language:d,originalLanguage:d,label:null,type:F,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([Ie(f||"",g||"")]),isAudioMuxedInVideo:!1,baseOriginalId:null};b=Ie(a.mimeType,a.codecs);if(!Ye(b))throw new D(2,2,2014,f);return a}
async function JB(a,b,c,d){pf(a,c.restrictions);await sf(b,a,d,c.drm.preferredKeySystems,c.drm.keySystemsMapping);b=[];nf(a,c.preferredVideoCodecs,c.preferredAudioCodecs,c.preferredDecodingAttributes,c.preferredTextFormats);for(var e of a.variants)b.push(If(e));for(var f of a.textStreams)b.push(Jf(f));for(var g of a.imageStreams)b.push(Kf(g));e=await c.offline.trackSelectionCallback(b);f=a.presentationTimeline.getDuration();g=0;for(const m of e)g+=m.bandwidth*f/8;try{if(!await c.offline.downloadSizeCallback(g))throw new D(2,
9,9014);}catch(m){if(m instanceof D)throw m;throw new D(2,9,9015);}const h=new Set,k=new Set,l=new Set;for(const m of e)m.type=="variant"&&h.add(m.id),m.type=="text"&&k.add(m.id),m.type=="image"&&l.add(m.id);a.variants=a.variants.filter(m=>h.has(m.id));a.textStreams=a.textStreams.filter(m=>k.has(m.id));a.imageStreams=a.imageStreams.filter(m=>l.has(m.id));xB(a)}
function KB(a,b,c,d,e,f,g){const h=nB(c,b,d),k=e.offline.progressCallback;oA(f,(q,t)=>{h.size=t;k(h,q)},(q,t)=>{l&&g&&m==t&&ph(a,"cenc",q)});const l=QB(b)&&!RB(b);let m=null;l&&(m=SB.get(a.g.keySystem));const n=new sB;for(const q of b.textStreams)n.g.set(q.id,52);for(const q of b.imageStreams)n.g.set(q.id,q.bandwidth||2048);for(const q of b.variants)qB(n,q);const {streams:p,Og:r}=TB(f,n,b,e);(e=a.g)&&g&&(e.initData=[]);return{xj:{creationTime:Date.now(),originalManifestUri:c,duration:b.presentationTimeline.getDuration(),
size:0,expiration:a.Cd(),streams:p,sessionIds:g?Ch(a):[],drmInfo:e,appMetadata:d,isIncomplete:!0,sequenceMode:b.sequenceMode,type:b.type},Og:r}}
async function LB(a,b,c,d,e,f,g,h,k,l){let m={},n=0;const p=()=>{if(a.j.g||e.l)throw new D(2,9,7001);};var r=async(q,t)=>{for(const u of q){p();q=iA(u,f);const v=u.h,y=u.i,w=async A=>{var B=u.g,E=B.Rb(!1);B.aesKey&&!E&&(A=await Wl(A,B.aesKey,u.j));B=hA(B);E=await g.addSegments([{data:A}]);p();m[B]=E[0];n+=A.byteLength},z=u.g.Rb(!1);z?qA(e,u.groupId,z,v,y,w):e.queue(u.groupId,q,v,y,w)}await rA(e);p();t&&!e.l&&(MB(h,d,k,l),await g.updateManifest(c,d))};try{QB(h),await r(b,!1),p(),b=m,r=n,m={},n=0,await wB(g,
c,d,b,r,()=>p()),p()}catch(q){throw b=Object.values(m),await g.removeSegments(b,()=>{}),q;}}function MB(a,b,c,d){b.expiration=c.Cd();c=Ch(c);b.sessionIds=d?c:[];if(QB(a)&&d&&!c.length)throw new D(2,9,9007);}function QB(a){return a.variants.some(b=>{const c=b.audio&&b.audio.encrypted;return b.video&&b.video.encrypted||c})}function RB(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 TB(a,b,c,d){const e=new Map;var f=BB(c);const g=new Map;for(const h of f)f=UB(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 VB(a,b){a.i.push(b);try{return await b}finally{tc(a.i,b)}}
async function WB(a,b){EB();const c=YA(b);if(c==null||c.g!="manifest")throw new D(2,9,9004,b);b=new MA;try{await b.init();const d=await IA(b,c.Hb(),c.bb()),e=(await d.getManifests([c.key()]))[0];await Promise.all([XB(a,e,b),YB(d,c,e)])}finally{await b.destroy()}}async function XB(a,b,c){await zB(a.g,a.h.drm,c,b)}function YB(a,b,c){const d=AB(c);pB(b,c);c=()=>{};return Promise.all([a.removeSegments(d,c),a.removeManifests([b.key()],c)])}
async function ZB(a){EB();const b=a.g;a=a.h.drm;const c=new MA;let d=!1;try{await c.init();const e=[];JA(c,f=>e.push(f));for(const f of e){const g=await f.getAll(),h=await mB(a,b,g);await f.remove(h);h.length!=g.length&&(d=!0)}}finally{await c.destroy()}return!d}
async function $B(){EB();const a=[],b=new MA;try{await b.init();let c=Promise.resolve();HA(b,(d,e)=>{c=c.then(async()=>{(await e.getAllManifests()).forEach((f,g)=>{f=pB(new ZA("manifest",d.Hb,d.bb,g),f);a.push(f)})})});await c}finally{await b.destroy()}return a}async function OB(a,b){let c;try{c=await Xl(b,a.g,a.h.streaming.retryParameters)}catch(d){}if(c)return c;throw new D(1,2,2011,b);}async function PB(a,b,c){a=tg([a],c);a.method="GET";return(await b.request(zg,a).promise).data}
function UB(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,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,mssPrivateData:d.mssPrivateData,external:d.external,fastSwitching:d.fastSwitching,isAudioMuxedInVideo:d.isAudioMuxedInVideo},h=e.offline.numberOfParallelDownloads;let k=h===0?d.id:0;CB(d,c.presentationTimeline.yb(),(l,m)=>{const n=hA(l);let p=void 0;if(!f.has(n)){var r=l.endTime-l.startTime;r=rB(b,d.id)*r;r=kA(a.g,r);f.set(n,new jA(l,r,k,!1,m))}l.ha&&(p=hA(l.ha),f.has(p)||(r=
rB(b,d.id)*.5,r=kA(a.g,r),f.set(p,new jA(l.ha,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});h!==0&&(k=(k+1)%h)});return g}
var vB=class{constructor(a){if(a&&a.constructor!=P)throw new D(2,9,9008);this.g=this.h=null;a?(this.h=a.g,this.g=a.Eb()):(this.h=pn(),this.g=new Cg,this.g.configure(this.h.networking));this.i=[];this.l=[];const b=!a;this.j=new Eg(async()=>{await Promise.all(this.l.map(e=>nA(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=Sm(a,b));return un(this.h,a)}getConfiguration(){const a=pn();un(a,this.h,pn());return a}Eb(){return this.g}store(a,b,c,d,e){const f=this.getConfiguration(),g=new sA(this.g);this.l.push(g);b=DB(this,a,b||{},d||[],e||[],async()=>{c||=await Xl(a,this.g,f.manifest.retryParameters);return Sc(a,c||null)()},f,g);b=new ig(b,()=>nA(g));b.finally(()=>{tc(this.l,g)});return NB(this,b)}remove(a){return VB(this,WB(this,a))}Qj(){return VB(this,ZB(this))}list(){return VB(this,$B())}async Vc(a,b,c,d){b=
new Ih({hc:this.g,onError:b,Re:()=>{},onExpirationUpdated:()=>{},onEvent:()=>{}});b.configure(c.drm);await ih(b,a.variants,d);d&&await th(b);return b}};x("shaka.offline.Storage",vB);vB.deleteAll=async function(){const a=new MA;try{await LA(a)}finally{await a.destroy()}};vB.prototype.list=vB.prototype.list;vB.prototype.removeEmeSessions=vB.prototype.Qj;vB.prototype.remove=vB.prototype.remove;vB.prototype.store=vB.prototype.store;vB.prototype.getNetworkingEngine=vB.prototype.Eb;
vB.prototype.getConfiguration=vB.prototype.getConfiguration;vB.prototype.configure=vB.prototype.configure;vB.prototype.destroy=vB.prototype.destroy;vB.support=tB;
var SB=(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");
Xp("offline",tB);function aC(){for(const a of bC)try{a.callback()}catch(b){sa("Error installing polyfill!",b)}}function cC(a,b){a={priority:b||0,callback:a};for(b=0;b<bC.length;b++)if(bC[b].priority<a.priority){bC.splice(b,0,a);return}bC.push(a)}var dC=class{};x("shaka.polyfill",dC);dC.register=cC;dC.installAll=aC;var bC=[];function eC(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden")){var a=["ariaHidden","ariaLabel","ariaPressed","ariaSelected"];for(const b of a)fC(b)}}function fC(a){const b=`aria-${a.toLowerCase().replace(/^aria/,"")}`;Object.defineProperty(Element.prototype,a,{get(){return this.getAttribute(b)},set(c){c==null||c==void 0?this.removeAttribute(b):this.setAttribute(b,c)}})}var gC=class{};dC.Aria=gC;gC.install=eC;cC(eC);var hC=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 iC(a){if(nb(a))return"cbcs";if(lb(a)||mb(a)||kb(a)||a==="com.huawei.wiseplay")return"cenc";sa("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function jC(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 kC(a,b){return!a||a==b||(a=="cbcs"||a=="cbcs-1-9")&&tb().B()?!0:!1};function lC(){tb().P()&&!mC&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(mC=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=nC,navigator.emeEncryptionSchemePolyfilled=!0)}async function nC(a,b){const c=await mC.call(this,a,b);if(jC(c))return navigator.requestMediaKeySystemAccess=mC,c;navigator.requestMediaKeySystemAccess=oC;return oC.call(this,a,b)}
async function oC(a,b){var c=iC(a),d=[];for(var e of b){b=pC(e.videoCapabilities,c);const f=pC(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 mC.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 hC(a,c,e)}function pC(a,b){return a?a.filter(c=>kC(c.encryptionScheme,b)):a}var qC=class{},mC;dC.EmeEncryptionScheme=qC;qC.install=lC;cC(lC);function rC(){if(window.Document){var a=Element.prototype;a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.webkitRequestFullscreen;a=Document.prototype;a.exitFullscreen=a.exitFullscreen||a.mozCancelFullScreen||a.webkitCancelFullScreen;"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:()=>document.mozFullScreenElement||document.webkitCurrentFullScreenElement||document.webkitFullscreenElement}),Object.defineProperty(document,"fullscreenEnabled",
{get:()=>document.mozFullScreenEnabled||document.webkitFullscreenEnabled}));document.addEventListener("webkitfullscreenchange",sC);document.addEventListener("webkitfullscreenerror",sC);document.addEventListener("mozfullscreenchange",sC);document.addEventListener("mozfullscreenerror",sC)}}function sC(a){const b=a.type.replace(/^(webkit|moz)/,"").toLowerCase(),c=document.createEvent("Event");c.initEvent(b,a.bubbles,a.cancelable);a.target.dispatchEvent(c)}var tC=class{};dC.Fullscreen=tC;tC.install=rC;
cC(rC);function uC(){tb().P()&&!vC&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(vC=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=wC,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}
async function wC(a){const b=await vC.call(this,a);if(!b.supported||!a.keySystemConfiguration)return b;const c=b.keySystemAccess;if(jC(c))return navigator.mediaCapabilities.decodingInfo=vC,b;navigator.mediaCapabilities.decodingInfo=xC;return c?xC.call(this,a):(b.keySystemAccess=await yC(a),b)}
async function xC(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=iC(d);const e={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a};if(!kC(c,d)||!kC(b,d))return e}d=await vC.call(this,a);d.keySystemAccess?d.keySystemAccess=new hC(d.keySystemAccess,b,c):a.keySystemConfiguration&&(d.keySystemAccess=await yC(a));return d}
async function yC(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 zC=class{},vC;dC.MCapEncryptionScheme=zC;zC.install=uC;cC(uC,-2);function AC(){tb().u()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),BC.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=CC)}
async function CC(a){const b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};tb();const c=a.video,d=a.audio;if(a.type=="media-source"){if(!Qc()||c&&!await DC(c)||d&&!await EC(d))return b}else if(a.type=="file"){if(c&&!Rc(c.contentType)||d&&!Rc(d.contentType))return b}else return b;if(a.keySystemConfiguration){if(a=await FC(c,d,a.keySystemConfiguration))b.supported=!0,b.keySystemAccess=a}else b.supported=!0;return b}
async function DC(a){return tb().i()==="CAST"?await GC(a):Uh(a.contentType)}async function EC(a){const b=tb().i();let c=a.contentType;return b==="CAST"&&a.spatialRendering&&(c+="; spatialRendering=true",window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)?(HC.has(c)?a=HC.get(c):(a=await cast.__platform__.canDisplayType(c),HC.set(c,a)),a):Uh(c)}
async function FC(a,b,c){var d=[],e=[];const f=[];if(c.audio){var g={robustness:c.audio.robustness||"",contentType:b.contentType};tb().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=Re(a)+";"+Qe(a);a=Re(d)+";"+Qe(d);d=c.keySystem;e=null;try{const h=ob(b,a,d,f);if(qb.has(h)){const k=ob(b,a,d,f);e=qb.get(k)||null}else{c=e=await navigator.requestMediaKeySystemAccess(c.keySystem,[g]);const k=ob(b,a,d,f);qb.set(k,c)}}catch(h){}return e}
async function GC(a){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return Uh(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}HC.has(b)?a=HC.get(b):(a=
await cast.__platform__.canDisplayType(b),HC.set(b,a));return a}var BC=class{};dC.MediaCapabilities=BC;BC.install=AC;BC.originalMcap=null;var HC=new Map;cC(AC,-1);function IC(){const a=tb(),b=a.h()==="WEBKIT"?a.g():null;(window.MediaSource||window.ManagedMediaSource)&&b&&window.MediaSource&&(b<=12?(JC(),KC()):b<=15&&JC());for(const c of a.ea())LC(c);(window.MediaSource||window.ManagedMediaSource)&&MC();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&NC()}
function JC(){const a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(...b){b=a.apply(this,b);b.abort=function(){};return b}}function KC(){const a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
function LC(a){const b=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=c=>Qe(c)!=a&&b(c);if(window.ManagedMediaSource){const c=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=d=>Qe(d)!=a&&c(d)}}
function MC(){if(window.MediaSource){const a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=b=>Ne(b)!="mp2t"&&a(b)}if(window.ManagedMediaSource){const a=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=b=>Ne(b)!="mp2t"&&a(b)}}
function NC(){const a=MediaSource.isTypeSupported;tb().za()&&(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 OC=class{};dC.MediaSource=OC;OC.install=IC;cC(IC);function PC(){screen.orientation&&screen.orientation.unlock||(screen.orientation!=void 0?QC():window.orientation!=void 0&&RC())}function QC(){screen.orientation.lock===void 0&&(screen.orientation.lock=()=>Promise.resolve());screen.orientation.unlock===void 0&&(screen.orientation.unlock=()=>{})}
function RC(){const a=new SC;screen.orientation=a;const b=()=>{switch(window.orientation){case -90:a.type="landscape-secondary";a.angle=270;break;case 0:a.type="portrait-primary";a.angle=0;break;case 90:a.type="landscape-primary";a.angle=90;break;case 180:a.type="portrait-secondary",a.angle=180}};b();window.addEventListener("orientationchange",()=>{b();const c=new C("change");a.dispatchEvent(c)})}var TC=class{};dC.Orientation=TC;TC.install=PC;
var SC=class extends Ba{constructor(){super();this.type="";this.angle=0}lock(a){const b=d=>screen.lockOrientation?screen.lockOrientation(d):screen.mozLockOrientation?screen.mozLockOrientation(d):!1;let c=!1;switch(a){case "natural":c=b("default");break;case "any":c=!0;this.unlock();break;default:c=b(a)}if(c)return Promise.resolve();a=Error("screen.orientation.lock() is not available on this device");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;return Promise.reject(a)}unlock(){screen.unlockOrientation?
screen.unlockOrientation():screen.mozUnlockOrientation&&screen.mozUnlockOrientation()}};cC(PC);function UC(a=!1){window.HTMLVideoElement&&window.WebKitMediaKeys&&window.shakaMediaKeysPolyfill!=VC&&(a&&(WC=!0,XC=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),YC=HTMLMediaElement.prototype.setMediaKeys,ZC=window.MediaKeys,$C=window.MediaKeySystemAccess,aD=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=bD,window.MediaKeys=cD,window.MediaKeySystemAccess=
dD,navigator.requestMediaKeySystemAccess=eD,window.shakaMediaKeysPolyfill=VC,Ef.clear(),qb.clear())}function eD(a,b){try{const c=new dD(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}function bD(a){const b=this.mediaKeys;b&&b!=a&&fD(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?fD(a,this):Promise.resolve()}
function gD(a){a=$a(a.initData);if(db(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=yb(a.subarray(4),!0);a=Cb(a);const b=new Event("encrypted");b.initDataType="skd";b.initData=bb(a);this.dispatchEvent(b)}var hD=class{},WC,XC,YC,ZC,$C,aD;dC.PatchedMediaKeysApple=hD;
hD.uninstall=function(){window.shakaMediaKeysPolyfill==VC&&WC&&(WC=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",XC),HTMLMediaElement.prototype.setMediaKeys=YC,window.MediaKeys=ZC,window.MediaKeySystemAccess=$C,navigator.requestMediaKeySystemAccess=aD,XC=aD=YC=$C=ZC=null,window.shakaMediaKeysPolyfill="",Ef.clear(),qb.clear())};hD.install=UC;
var dD=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 cD(this.keySystem);return Promise.resolve(a)}getConfiguration(){return this.g}};
function fD(a,b){a.g.Na();if(!b)return Promise.resolve();a.g.o(b,"webkitneedkey",gD);try{return Xk(b,HTMLMediaElement.HAVE_METADATA,a.g,()=>{b.webkitSetMediaKeys(a.h)}),Promise.resolve()}catch(c){return Promise.reject(c)}}var cD=class{constructor(a){this.h=new WebKitMediaKeys(a);this.g=new zc}createSession(a){a=a||"temporary";if(a!="temporary")throw new TypeError("Session type "+a+" is unsupported on this platform.");return new iD(this.h)}setServerCertificate(){return Promise.resolve(!1)}getStatusForPolicy(){return Promise.resolve("usable")}};
function jD(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.g=b;b=new C("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}
var iD=class extends Ba{constructor(a){super();this.i=null;this.l=a;this.g=this.h=null;this.j=new zc;this.sessionId="";this.expiration=NaN;this.closed=new gg;this.keyStatuses=new kD;this.onkeystatuseschange=null}generateRequest(a,b){this.h=new gg;try{const c=this.l.createSession("video/mp4",$a(b));this.i=c;this.sessionId=c.sessionId||"";this.j.o(this.i,"webkitkeymessage",d=>{this.h&&(this.h.resolve(),this.h=null);d=(new Map).set("messageType",this.keyStatuses.Sb()==void 0?"license-request":"license-renewal").set("message",
bb(d.message));d=new C("message",d);this.dispatchEvent(d)});this.j.o(c,"webkitkeyadded",()=>{this.g&&(jD(this,"usable"),this.g.resolve(),this.g=null)});this.j.o(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:jD(this,"output-not-allowed");
break;default:jD(this,"internal-error")}});jD(this,"status-pending")}catch(c){this.h.reject(c)}return this.h}load(){return Promise.reject(Error("MediaKeySession.load not yet supported"))}update(a){this.g=new gg;try{this.i.update($a(a))}catch(b){this.g.reject(b)}return this.g}close(){try{this.i.close(),this.closed.resolve(),this.j.Na()}catch(a){this.closed.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"))}},
kD=class{constructor(){this.size=0;this.g=void 0}Sb(){return this.g}forEach(a){this.g&&a(this.g,pb.value())}get(a){if(this.has(a))return this.g}has(a){const b=pb.value();return this.g&&Za(a,b)?!0:!1}entries(){}keys(){}values(){}},VC="apple";cC(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||UC())});function lD(){if(window.MediaKeys){var a=tb();MediaKeys.prototype.setServerCertificate&&a.J()||(MediaKeys.prototype.setServerCertificate=mD)}}function mD(){return Promise.resolve(!1)}var nD=class{};dC.PatchedMediaKeysCert=nD;nD.install=lD;cC(lD);function oD(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)pD="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=qD;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=rD;window.MediaKeys=sD;window.MediaKeySystemAccess=tD;window.shakaMediaKeysPolyfill=
uD}}function vD(a){const b=pD;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function qD(a,b){try{const c=new tD(a,b);return Promise.resolve(c)}catch(c){return Promise.reject(c)}}function rD(a){const b=this.mediaKeys;b&&b!=a&&wD(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&wD(a,this);return Promise.resolve()}var xD=class{};dC.PatchedMediaKeysWebkit=xD;xD.install=oD;
var tD=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 sD(this.g);return Promise.resolve(a)}getConfiguration(){return this.h}};
function wD(a,b){a.h=b;a.g.Na();const c=pD;b&&(a.g.o(b,c+"needkey",d=>{const e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=bb(d.initData);a.h.dispatchEvent(e)}),a.g.o(b,c+"keymessage",d=>{const e=yD(a,d.sessionId);e&&(d=(new Map).set("messageType",e.keyStatuses.Sb()==void 0?"licenserequest":"licenserenewal").set("message",d.message),d=new C("message",d),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(d))}),a.g.o(b,c+"keyadded",d=>{(d=yD(a,d.sessionId))&&d.ready()}),a.g.o(b,c+"keyerror",
d=>{const e=yD(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?zD(e,"output-restricted"):f==1?zD(e,"expired"):zD(e,"internal-error"))}}))}
function yD(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 sD=class{constructor(a){this.l=a;this.h=null;this.g=new zc;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 AD(b,this.l,a);this.i.push(a);return a}setServerCertificate(){return Promise.resolve(!1)}getStatusForPolicy(){return Promise.resolve("usable")}};
function zD(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.g=b;b=new C("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}
function BD(a,b,c){if(a.m)return Promise.reject(Error("The session is already initialized."));a.m=!0;let d;try{if(a.l=="persistent-license")if(c)d=$a(Cb("LOAD_SESSION|"+c));else{const f=Cb("PERSISTENT|");d=Nb(f,b)}else d=$a(b)}catch(f){return Promise.reject(f)}a.h=new gg;const e=vD("generateKeyRequest");try{a.j[e](a.i,d)}catch(f){if(f.name!="InvalidStateError")return a.h=null,Promise.reject(f);(new H(()=>{try{a.j[e](a.i,d)}catch(g){a.h.reject(g),a.h=null}})).Z(.01)}return a.h}
function CD(a,b,c){if(a.g)a.g.then(()=>CD(a,b,c)).catch(()=>CD(a,b,c));else{a.g=b;if(a.i=="webkit-org.w3.clearkey"){var d=xb(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=Jb(e.keys[0].k);e=Jb(e.keys[0].kid)}else d=$a(c),e=null;var f=vD("addKey");try{a.j[f](a.i,d,e,a.sessionId)}catch(g){a.g.reject(g),a.g=null}}}
var AD=class extends Ba{constructor(a,b,c){super();this.j=a;this.m=!1;this.g=this.h=null;this.i=b;this.l=c;this.sessionId="";this.expiration=NaN;this.closed=new gg;this.keyStatuses=new DD;this.onkeystatuseschange=null}ready(){zD(this,"usable");this.g&&this.g.resolve();this.g=null}generateRequest(a,b){return BD(this,b,null)}load(a){return this.l=="persistent-license"?BD(this,null,a):Promise.reject(Error("Not a persistent session."))}update(a){const b=new gg;CD(this,b,a);return b}close(){if(this.l!=
"persistent-license"){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;const a=vD("cancelKeyRequest");try{this.j[a](this.i,this.sessionId)}catch(b){}}this.closed.resolve();return this.closed}remove(){return this.l!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()}},DD=class{constructor(){this.size=0;this.g=void 0}Sb(){return this.g}forEach(a){this.g&&a(this.g,pb.value())}get(a){if(this.has(a))return this.g}has(a){const b=
pb.value();return this.g&&Za(a,b)?!0:!1}entries(){}keys(){}values(){}},pD="",uD="webkit";cC(oD);function ED(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;a.requestPictureInPicture&&document.exitPictureInPicture||!a.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,a.requestPictureInPicture=FD,Object.defineProperty(a,"disablePictureInPicture",{get:GD,set:HD,enumerable:!0,configurable:!0}),document.exitPictureInPicture=ID,document.addEventListener("webkitpresentationmodechanged",JD,!0))}}
function JD(a){a=a.target;if(a.webkitPresentationMode=="picture-in-picture"){document.pictureInPictureElement=a;var b=new Event("enterpictureinpicture");a.dispatchEvent(b)}else document.pictureInPictureElement==a&&(document.pictureInPictureElement=null),b=new Event("leavepictureinpicture"),a.dispatchEvent(b)}
function FD(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function ID(){const a=document.pictureInPictureElement;return a?(a.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}
function GD(){return this.hasAttribute("disablePictureInPicture")?!0:!this.webkitSupportsPresentationMode("picture-in-picture")}function HD(a){a?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}var KD=class{};dC.PiPWebkit=KD;KD.install=ED;cC(ED);function LD(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=MD))}function MD(){const a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}var ND=class{};dC.RandomUUID=ND;ND.install=LD;cC(LD);function OD(){const a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:PD})}function PD(){const a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}var QD=class{};dC.Symbol=QD;QD.install=OD;cC(OD);function RD(){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 SD=class{};dC.TypedArray=SD;SD.install=RD;cC(RD);function TD(){if(window.HTMLMediaElement){const a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){const b=a.apply(this);b&&b.catch(()=>{});return b}}}var UD=class{};dC.VideoPlayPromise=UD;UD.install=TD;cC(TD);function VD(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||typeof gj().webkitDroppedFrameCount==="number")&&(a.getVideoPlaybackQuality=WD)}}function WD(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}var XD=class{};dC.VideoPlaybackQuality=XD;XD.install=VD;cC(VD);function YD(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(b==3)a=ZD;else if(b==6)a=$D;else{try{var c=!!ZD(1,2,"")}catch(d){c=!1}c&&(a=ZD)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function ZD(a,b,c){return new window.TextTrackCue(a,b,c)}function $D(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}var aE=class{};dC.VTTCue=aE;aE.install=YD;cC(YD);var bE=class extends Ba{constructor(a){super();this.g=a;this.m=null;this.h=[];this.j=-1;this.i=this.l=null;this.u=new zc}async destroy(){await this.removeAllItems();this.g=null;this.u&&(this.u.release(),this.u=null);super.release()}configure(a){this.m=a}getConfiguration(){return this.m}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 C("itemsinserted"))}async removeAllItems(){this.u.Na();
this.h.length&&this.j>=0&&await this.g.$b();const a=[];this.i&&(this.i.preloadManager.l||a.push(this.i.preloadManager.destroy()),this.i=null);this.l&&(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 C("itemsremoved"))}async playItem(a){this.u.Na();if(!this.h.length||a>=this.h.length)throw new D(2,7,7007);
const b=this.getCurrentItem(),c=this.h[a];this.j!=a&&(this.j=a,this.dispatchEvent(new C("currentitemchanged")));const d=this.g.ue(),e=this.m?this.m.preloadNextUrlWindow:0;if(e>0){let g=!1;this.u.o(d,"timeupdate",async()=>{if(!(this.l||this.h.length<=1||g||this.g.U())&&d.duration){var h=this.g.va().end-d.currentTime;if(!isNaN(h)&&h<=e){var k=this.m&&this.m.repeatMode;h=null;this.j+1<this.h.length?h=this.h[this.j+1]:k==1&&(h=this.h[0]);if(h&&(!h.preloadManager||h.preloadManager.l)){g=!0;k=null;try{k=
await this.g.preload(h.manifestUri,h.startTime,h.mimeType,h.config)}catch(l){k=null}this.l={item:h,preloadManager:k};g=!1}}}})}this.u.o(this.g,"complete",()=>{const g=this.m&&this.m.repeatMode;let h=!1;if(g==2)h=!0;else{const k=this.j+1;k<this.h.length?this.playItem(k):g==1&&(this.h.length==1?h=!0:this.playItem(0))}h&&(d.paused?(d.currentTime=this.g.va().start,d.play()):this.u.o(d,"paused",()=>{d.currentTime=this.g.va().start;d.play()}))});a=c.manifestUri;c.preloadManager&&!c.preloadManager.l&&(a=
c.preloadManager);var f=!1;this.l&&this.l.item==c&&this.l.preloadManager?a=this.l.preloadManager:this.i&&this.i.item==c&&this.i.preloadManager&&(a=this.i.preloadManager,f=!0);this.i&&(f||this.i.preloadManager.l||await this.i.preloadManager.destroy(),this.i=null);if(this.m&&this.m.preloadPrevItem&&b&&this.g.bc()===fq){f=null;try{f=await this.g.Zh()}catch(g){f=null}this.i={item:b,preloadManager:f}}c.config&&(this.g.Fh(),this.g.configure(c.config));await this.g.load(a,c.startTime,c.mimeType);this.l=
null;if(c.extraText)for(const g of c.extraText)g.mime?this.g.wd(g.uri,g.language,g.kind,g.mime,g.codecs):this.g.wd(g.uri,g.language,g.kind);if(c.extraThumbnail)for(const g of c.extraThumbnail)this.g.le(g);if(c.extraChapter)for(const g of c.extraChapter)this.g.ke(g.uri,g.language,g.mime)}};x("shaka.queue.QueueManager",bE);bE.prototype.playItem=bE.prototype.playItem;bE.prototype.removeAllItems=bE.prototype.removeAllItems;bE.prototype.insertItems=bE.prototype.insertItems;bE.prototype.getItems=bE.prototype.getItems;
bE.prototype.getCurrentItemIndex=bE.prototype.getCurrentItemIndex;bE.prototype.getCurrentItem=bE.prototype.getCurrentItem;bE.prototype.getConfiguration=bE.prototype.getConfiguration;bE.prototype.configure=bE.prototype.configure;bE.prototype.destroy=bE.prototype.destroy;Fr=a=>new bE(a);var eE=class{parseInit(){}setSequenceMode(){}setManifestType(){}parseMedia(a,b){let c=null;const d=[];a=xb(a).split(/\r?\n/);for(const f of a){if(!f||/^\s+$/.test(f))continue;if(a=cE.exec(f)){var e=dE.exec(a[1]);e=parseInt(e[1],10)*60+parseFloat(e[2].replace(",","."));a=new ae(e,b.segmentEnd?b.segmentEnd:e+2,a[2]);c&&(c.endTime=e,d.push(c));c=a}}c&&d.push(c);return d}};x("shaka.text.LrcTextParser",eE);eE.prototype.parseMedia=eE.prototype.parseMedia;eE.prototype.setManifestType=eE.prototype.setManifestType;
eE.prototype.setSequenceMode=eE.prototype.setSequenceMode;eE.prototype.parseInit=eE.prototype.parseInit;var cE=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,dE=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;Ve("application/x-subtitle-lrc",()=>new eE);function fE(a){return a?(a=/^(\d+) (\d+)$/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
function gE(a,b,c,d){const e=new fd;var f=b.attributes["xml:id"];if(!f)return null;e.id=f;f=null;d&&(f=hE.exec(d)||iE.exec(d));d=f?Number(f[1]):null;f=f?Number(f[2]):null;let g,h;const k=jE(a,b,c,"extent");k&&(g=(h=hE.exec(k))||iE.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?bd:0,e.heightUnits=h||f!=null?bd:0));if(a=jE(a,b,c,"origin"))if(g=(h=hE.exec(a))||iE.exec(a),g!=null)e.viewportAnchorX=
Number(g[1]),e.viewportAnchorY=Number(g[2]),h?k||(e.width=100-e.viewportAnchorX,e.widthUnits=bd,e.height=100-e.viewportAnchorY,e.heightUnits=bd):(f!=null&&(e.viewportAnchorY=e.viewportAnchorY*100/f),d!=null&&(e.viewportAnchorX=e.viewportAnchorX*100/d)),e.viewportAnchorUnits=h||d!=null?bd:0;return e}
function kE(a,b,c,d,e,f,g,h,k,l,m,n,p,r){let q,t=m;if(xd(b)){if(!n)return null;q={tagName:"span",children:[Ad(b)],attributes:{},parent:null}}else q=b;let u=null;for(var v of lE)if(u=mE(q,"backgroundImage",e,"#",v)[0])break;v=null;var y=Kd(q,lE,"backgroundImage"),w=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(y&&w.test(y)){v=parseInt(y.split(":").pop(),10)-1;if(v>=r.length)return null;v=r[v]}else p&&y&&!y.startsWith("#")&&(w=new Ha(p),y=new Ha(y),(y=w.resolve(y).toString())&&(v=y));
if(b.tagName=="p"||u||v)n=!0;b=n;y=(q.attributes["xml:space"]||(k?"default":"preserve"))=="default";w=q.children.every(xd);k=[];if(!w)for(const B of q.children){const E=kE(a,B,c,d,e,f,g,h,y,l,q,n,p,r);E&&k.push(E)}e=m!=null;p=Ad(q);p=q.children.length&&p&&/\S/.test(p);r=q.attributes.begin||q.attributes.end||q.attributes.dur;if(!(r||p||q.tagName=="br"||k.length!=0||e&&!y))return null;let {start:z,end:A}=nE(q,d);for(;t&&t.tagName&&t.tagName!="tt";)({start:z,end:A}=oE(t,d,z,A)),t=t.parent;z==null&&(z=
0);z+=c.periodStart;A=A==null?Infinity:A+c.periodStart;a.g!=="HLS"&&(z=Math.max(z,c.segmentStart),A=Math.min(A,c.segmentEnd));if(!r&&k.length>0){z=Infinity;A=0;for(const B of k)z=Math.min(z,B.startTime),A=Math.max(A,B.endTime)}if(q.tagName=="br")return a=new ae(z,A,""),a.lineBreak=!0,a;c="";w&&(c=Fb(Ad(q)||""),y&&(c=c.replace(/\s+/g," ")));c=new ae(z,A,c);c.nestedCues=k;n||(c.isContainer=!0);l&&(c.cellResolution=l);l=mE(q,"region",g,"")[0];if(q.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&&!q.attributes.region&&!q.attributes.style&&(h=mE(m,"region",g,"")[0]);pE(a,c,q,h,u,v,f,b,k.length==0);return c}function mE(a,b,c,d,e){const f=[];if(!a||c.length<1)return f;var g=a;for(a=null;!a&&!(a=e?Jd(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 nE(a,b){const c=qE(a.attributes.begin,b);let d=qE(a.attributes.end,b);a=qE(a.attributes.dur,b);d==null&&a!=null&&(d=c+a);return{start:c,end:d}}function oE(a,b,c,d){a=nE(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 pE(a,b,c,d,e,f,g,h,k){h=h||k;rE(a,c,d,g,"direction",h)=="rtl"&&(b.direction="rtl");k=rE(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=pe);(k=rE(a,c,d,g,"textAlign",!0))?(b.positionAlign=sE.get(k),b.lineAlign=tE.get(k),b.textAlign=we[k.toUpperCase()]):b.textAlign=je;if(k=rE(a,c,d,g,"displayAlign",!0))b.displayAlign=xe[k.toUpperCase()];if(k=rE(a,c,d,g,"color",h))b.color=uE(k);
if(k=rE(a,c,d,g,"backgroundColor",h))b.backgroundColor=uE(k);if(k=rE(a,c,d,g,"border",h))b.border=k;if(k=rE(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=rE(a,c,d,g,"fontWeight",h))&&k=="bold"&&(b.fontWeight=le);k=rE(a,c,d,g,"wrapOption",h);b.wrapLine=k&&k=="noWrap"?!1:!0;(k=rE(a,c,d,g,"lineHeight",h))&&k.match(vE)&&(b.lineHeight=k);(k=rE(a,c,d,g,"fontSize",h))&&(k.match(vE)||k.match(wE))&&(b.fontSize=k);if(k=rE(a,c,d,g,"fontStyle",h))b.fontStyle=ze[k.toUpperCase()];e?(f=e.attributes.imageType||e.attributes.imagetype,k=e.attributes.encoding,e=Ad(e).trim(),f=="PNG"&&k=="Base64"&&e&&(b.backgroundImage=
"data:image/png;base64,"+e)):f&&(b.backgroundImage=f);if(e=rE(a,c,d,g,"textOutline",h))e=e.split(" "),e[0].match(vE)?b.textStrokeColor=b.color:(b.textStrokeColor=uE(e[0]),e.shift()),e[0]&&e[0].match(vE)?b.textStrokeWidth=e[0]:b.textStrokeColor="";(e=rE(a,c,d,g,"letterSpacing",h))&&e.match(vE)&&(b.letterSpacing=e);(e=rE(a,c,d,g,"linePadding",h))&&e.match(vE)&&(b.linePadding=e);if(e=rE(a,c,d,g,"opacity",h))b.opacity=parseFloat(e);(e=jE(a,d,g,"textDecoration"))&&xE(b,e);(e=yE(a,c,g,"textDecoration"))&&
xE(b,e);if(e=rE(a,c,d,g,"textCombine",h))b.textCombineUpright=e;switch(rE(a,c,d,g,"ruby",h)){case "container":b.rubyTag="ruby";break;case "text":b.rubyTag="rt"}}function jE(a,b,c,d){if(!b)return null;const e=Kd(b,zE,d);return e?e:AE(a,b,c,d)}function uE(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 rE(a,b,c,d,e,f=!0){return(b=yE(a,b,d,e))?b:f?jE(a,c,d,e):null}
function xE(a,b){for(const c of b.split(" "))switch(c){case "underline":a.textDecoration.includes(ne)||a.textDecoration.push(ne);break;case "noUnderline":a.textDecoration.includes(ne)&&tc(a.textDecoration,ne);break;case "lineThrough":a.textDecoration.includes("lineThrough")||a.textDecoration.push("lineThrough");break;case "noLineThrough":a.textDecoration.includes("lineThrough")&&tc(a.textDecoration,"lineThrough");break;case "overline":a.textDecoration.includes("overline")||a.textDecoration.push("overline");
break;case "noOverline":a.textDecoration.includes("overline")&&tc(a.textDecoration,"overline")}}function yE(a,b,c,d){const e=Kd(b,zE,d);return e?e:AE(a,b,c,d)}function AE(a,b,c,d){b=mE(b,"style",c,"");let e=null;for(let f=0;f<b.length;f++){let g=Jd(b[f],"urn:ebu:tt:style",d);g||=Kd(b[f],zE,d);g||=yE(a,b[f],c,d);g&&(e=g)}return e}
function qE(a,b){var c=null;if(BE.test(a)){a=BE.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(CE.test(a))c=DE(CE,a);else if(EE.test(a))c=DE(EE,a);else if(FE.test(a))a=FE.exec(a),c=Number(a[1])/b.frameRate;else if(GE.test(a))a=GE.exec(a),c=Number(a[1])/b.g;else if(HE.test(a))c=DE(HE,a);else if(a)throw new D(2,2,2001,"Could not parse cue time range in TTML");return c}
function DE(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 KE=class{constructor(){this.g="UNKNOWN"}parseInit(){}setSequenceMode(){}setManifestType(a){this.g=a}parseMedia(a,b,c,d){var e=xb(a);a=[];if(e=="")return a;var f=sd(e,"tt",!0);if(!f)throw new D(2,2,2005,"Failed to parse TTML.");e=Cd(f,"body")[0];if(!e)return[];var g=Kd(f,IE,"frameRate"),h=Kd(f,IE,"subFrameRate"),k=Kd(f,IE,"frameRateMultiplier"),l=Kd(f,IE,"tickRate"),m=Kd(f,IE,"cellResolution"),n=f.attributes["xml:space"]||"default";const p=Kd(f,zE,"extent");if(n!="default"&&n!="preserve")throw new D(2,
2,2005,"Invalid xml:space value: "+n);n=n=="default";g=new JE(g,h,k,l);m=fE(m);h=Cd(f,"metadata")[0];h=(h?h.children:[]).filter(r=>r!="\n");k=Cd(f,"style");f=Cd(f,"region");l=[];for(const r of f){const q=gE(this,r,k,p);q&&l.push(q)}if(zd(e,"p").length)throw new D(2,2,2001,"<p> can only be inside <div> in TTML");for(const r of zd(e,"div"))if(zd(r,"span").length)throw new D(2,2,2001,"<span> can only be inside <p> in TTML");if(b=kE(this,e,b,g,h,k,f,l,n,m,null,!1,c,d))b.backgroundColor||(b.backgroundColor=
"transparent"),a.push(b);return a}};x("shaka.text.TtmlTextParser",KE);KE.prototype.parseMedia=KE.prototype.parseMedia;KE.prototype.setManifestType=KE.prototype.setManifestType;KE.prototype.setSequenceMode=KE.prototype.setSequenceMode;KE.prototype.parseInit=KE.prototype.parseInit;
var JE=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]))}},hE=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,wE=/^(\d{1,4}(?:\.\d+)?|100)%$/,vE=/^(\d+px|\d+em|\d*\.?\d+c)$/,iE=/^(\d+)px (\d+)px$/,BE=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,CE=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,EE=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,
FE=/^(\d*(?:\.\d*)?)f$/,GE=/^(\d*(?:\.\d*)?)t$/,HE=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),tE=(new Map).set("left",se).set("center","center").set("right","end").set("start",se).set("end","end"),sE=(new Map).set("left","line-left").set("center","center").set("right","line-right").set("start","line-left").set("end","line-right"),IE=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],zE=["http://www.w3.org/ns/ttml#styling",
"http://www.w3.org/2006/10/ttaf1#styling"],lE=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];Ve("application/ttml+xml",()=>new KE);var LE=class{constructor(){this.g=new KE}parseInit(a){let b=!1;(new Ug).boxes(["moov","trak","mdia","minf","stbl"],Mg).ra("stsd",Og).box("stpp",c=>{b=!0;c.parser.stop()}).parse(a);if(!b)throw new D(2,2,2007);}setSequenceMode(a){this.g.setSequenceMode(a)}setManifestType(a){this.g.setManifestType(a)}parseMedia(a,b,c){let d=[],e=null;const f=[],g=new Map,h=[];(new Ug).boxes(["moof","traf"],Mg).ra("tfhd",m=>{e=Xh(m.reader,m.flags).zd}).ra("trun",m=>{m=$h(m.reader,m.version,m.flags);for(const n of m.Cg)h.push(n.sampleSize||
e||0)}).ra("subs",m=>{const n=m.reader,p=n.Y();let r=-1;for(let t=0;t<p;t++){var q=n.Y();r+=q;q=n.Ga();const u=[];for(let v=0;v<q;v++)m.version==1?u.push(n.Y()):u.push(n.Ga()),n.ba(),n.ba(),n.Y();g.set(r,u)}}).box("mdat",Rg(m=>{f.push(m)},!1)).parse(a,!1);if(f.length==0)throw new D(2,2,2007);a=Nb(...f);let k=0;for(let m=0;m<h.length;m++){const n=$a(a,k,h[m]);k+=h[m];const p=g.get(m);if(p&&p.length){const r=$a(n,0,p[0]),q=[];let t=p[0];for(let u=1;u<p.length;u++){var l=$a(n,t,p[u]);l=Hb(l);q.push("data:image/png;base64,"+
l);t+=p[u]}d=d.concat(this.g.parseMedia(r,b,c,q))}else d=d.concat(this.g.parseMedia(n,b,c,[]))}return d}};x("shaka.text.Mp4TtmlParser",LE);LE.prototype.parseMedia=LE.prototype.parseMedia;LE.prototype.setManifestType=LE.prototype.setManifestType;LE.prototype.setSequenceMode=LE.prototype.setSequenceMode;LE.prototype.parseInit=LE.prototype.parseInit;Ve('application/mp4; codecs="stpp"',()=>new LE);Ve('application/mp4; codecs="stpp.ttml"',()=>new LE);Ve('application/mp4; codecs="stpp.ttml.im1i"',()=>new LE);
Ve('application/mp4; codecs="stpp.ttml.im1t"',()=>new LE);Ve('application/mp4; codecs="stpp.ttml.im2i"',()=>new LE);Ve('application/mp4; codecs="stpp.ttml.im2t"',()=>new LE);Ve('application/mp4; codecs="stpp.ttml.etd1"',()=>new LE);Ve('application/mp4; codecs="stpp.ttml.etd1|im1t"',()=>new LE);Ve('application/mp4; codecs="stpp.ttml.im1t|etd1"',()=>new LE);Ve('application/mp4; codecs="stpp.TTML.im1t"',()=>new LE);function ME(a,b,c){let d;if(d=NE.exec(b))b=d[1],b=="middle"?a.textAlign=je:a.textAlign=we[b.toUpperCase()];else if(d=OE.exec(b))a.writingMode=d[1]=="lr"?"vertical-lr":"vertical-rl";else if(d=PE.exec(b))a.size=Number(d[1]);else if(d=QE.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":oe);else if(d=RE.exec(b)){if(b=SE(c,d[1]))a.region=b}else if(c=TE.exec(b))a.lineInterpretation=
1,a.line=Number(c[1]),c[2]&&(a.lineAlign=ye[c[2].toUpperCase()]);else if(c=UE.exec(b))a.lineInterpretation=re,a.line=Number(c[1]),c[2]&&(a.lineAlign=ye[c[2].toUpperCase()])}function SE(a,b){a=a.filter(c=>c.id==b);return a.length?a[0]:null}
var WE=class{constructor(){this.g="UNKNOWN"}parseInit(){}setSequenceMode(){}setManifestType(a){this.g=a}parseMedia(a,b){a=xb(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 D(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 D(2,2,2E3);a=gd(a[1]);if(a==null)throw new D(2,2,2E3);d=Number(d[1]);
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 id(f);var g=new fd;ld(e);md(e);for(var h=ld(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");md(e);h=ld(e)}b.push(g)}f=new Map;de(f);d=[];for(const p of c.slice(1)){c=p.split("\n");if((c.length!=1||c[0])&&!VE.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 r of e){e="global";(g=r[0].match(/\((.*)\)/))&&
(e=g.pop());g=r.slice(1,-1);r[0].includes("}")&&(h=/\{(.*?)\}/.exec(r[0]))&&(g=h[1].split(";"));(h=f.get(e))||(h=new ae(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=le;break;case "font-style":switch(n){case "normal":k=!0;h.fontStyle=ve;break;case "italic":k=!0;h.fontStyle=me;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]||VE.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 id(k[l]);g=hd(e);n=jd(e,/[ \t]+--\x3e[ \t]+/g);h=hd(e);if(g==null||n==null||h==null){sa("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 ae(g,h,m);md(e);for(g=ld(e);g;)ME(k,g,b),md(e),g=ld(e);ce(k,f);c!=null&&(k.id=c);c=k}c&&d.push(c)}return d}};
x("shaka.text.VttTextParser",WE);WE.prototype.parseMedia=WE.prototype.parseMedia;WE.prototype.setManifestType=WE.prototype.setManifestType;WE.prototype.setSequenceMode=WE.prototype.setSequenceMode;WE.prototype.parseInit=WE.prototype.parseInit;
var VE=/^NOTE($|[ \t])/,NE=/^align:(start|middle|center|end|left|right)$/,OE=/^vertical:(lr|rl)$/,PE=/^size:([\d.]+)%$/,QE=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/,RE=/^region:(.*)$/,TE=/^line:([\d.]+)%(?:,(start|end|center))?$/,UE=/^line:(-?\d+)(?:,(start|end|center))?$/;Ve("text/vtt",()=>new WE);Ve('text/vtt; codecs="vtt"',()=>new WE);Ve('text/vtt; codecs="wvtt"',()=>new WE);function XE(a,b,c){let d,e,f;(new Ug).box("payl",Rg(g=>{d=xb(g)},!1)).box("iden",Rg(g=>{e=xb(g)},!1)).box("sttg",Rg(g=>{f=xb(g)},!1)).parse(a);return d?YE(d,e,f,b,c):null}function YE(a,b,c,d,e){a=new ae(d,e,a);ce(a);b&&(a.id=b);if(c)for(b=new id(c),c=ld(b);c;)ME(a,c,[]),md(b),c=ld(b);return a}
var ZE=class{constructor(){this.g=null}parseInit(a){let b=!1;(new Ug).boxes(["moov","trak","mdia","minf","stbl"],Mg).ra("mdhd",c=>{this.g=Zh(c.reader,c.version).timescale}).ra("stsd",Og).box("wvtt",()=>{b=!0}).parse(a);if(!this.g)throw new D(2,2,2008);if(!b)throw new D(2,2,2008);}setSequenceMode(){}setManifestType(){}parseMedia(a,b){if(!a.length)return[];if(!this.g)throw new D(2,2,2008);let c=0,d=[],e;const f=[];let g=!1,h=!1,k=!1,l=null;(new Ug).boxes(["moof","traf"],Mg).ra("tfdt",p=>{g=!0;c=Yh(p.reader,
p.version).baseMediaDecodeTime}).ra("tfhd",p=>{l=Xh(p.reader,p.flags).yd}).ra("trun",p=>{h=!0;d=$h(p.reader,p.version,p.flags).Cg}).box("mdat",Rg(p=>{k=!0;e=p},!1)).parse(a,!1);if(!k&&!g&&!h)throw new D(2,2,2008);a=c;const m=new Jg(e,0);for(const p of d){const r=p.Dg||l,q=p.Xe?c+p.Xe:a;a=q+(r||0);let t=0;do{var n=m.Y();t+=n;const u=m.Y();let v=null;Lg(u)=="vttc"?n>8&&(v=m.Kb(n-8,!1)):m.skip(n-8);r&&v&&(n=XE(v,b.periodStart+q/this.g,b.periodStart+a/this.g),f.push(n))}while(p.sampleSize&&t<p.sampleSize)}return f.filter(lf)}};
x("shaka.text.Mp4VttParser",ZE);ZE.prototype.parseMedia=ZE.prototype.parseMedia;ZE.prototype.setManifestType=ZE.prototype.setManifestType;ZE.prototype.setSequenceMode=ZE.prototype.setSequenceMode;ZE.prototype.parseInit=ZE.prototype.parseInit;Ve('application/mp4; codecs="wvtt"',()=>new ZE);var $E=class{parseInit(){}setSequenceMode(){}setManifestType(){}parseMedia(a){var b=xb(a).replace(/\r+/g,"");b=b.trim();a=[];if(b=="")return a;b=b.split("\n\n");for(const d of b){b=d.split("\n");var c=new id(b[0]);const e=hd(c),f=jd(c,/,/g);c=hd(c);if(e==null||f==null||c==null)throw new D(2,2,2001,"Could not parse cue time range in SubViewer");a.push(new ae(e,c,b.slice(1).join("\n").trim()))}return a}};x("shaka.text.SbvTextParser",$E);$E.prototype.parseMedia=$E.prototype.parseMedia;
$E.prototype.setManifestType=$E.prototype.setManifestType;$E.prototype.setSequenceMode=$E.prototype.setSequenceMode;$E.prototype.parseInit=$E.prototype.parseInit;Ve("text/x-subviewer",()=>new $E);var aF=class{constructor(){this.g=new WE}parseInit(){}setSequenceMode(){}setManifestType(){}parseMedia(a,b,c){var d=xb(a);a="WEBVTT\n\n";if(d!=""){d=d.replace(/\r+/g,"");d=d.trim();d=d.split("\n\n");for(e of d)d=e.split(/\n/),d[0].match(/\d+/)&&d.shift(),d[0]=d[0].replace(/,/g,"."),a+=d.join("\n").replace(/{b}/g,"<b>").replace(/{\/b}/g,"</b>").replace(/{i}/g,"<i>").replace(/{\/i}/g,"</i>").replace(/{u}/g,"<u>").replace(/{\/u}/g,"</u>")+"\n\n"}var e=a;e=$a(Cb(e));return this.g.parseMedia(e,b,c,[])}};
x("shaka.text.SrtTextParser",aF);aF.prototype.parseMedia=aF.prototype.parseMedia;aF.prototype.setManifestType=aF.prototype.setManifestType;aF.prototype.setSequenceMode=aF.prototype.setSequenceMode;aF.prototype.parseInit=aF.prototype.parseInit;Ve("text/srt",()=>new aF);function bF(a,b){var c=b.Fontname;c&&(a.fontFamily=c);if(c=b.Fontsize)a.fontSize=c+"px";if(c=b.PrimaryColour)if(c=cF(c))a.color=c;if(c=b.BackColour)if(c=cF(c))a.backgroundColor=c;b.Bold&&(a.fontWeight=le);b.Italic&&(a.fontStyle=me);b.Underline&&a.textDecoration.push(ne);if(c=b.Spacing)a.letterSpacing=c+"px";if(c=b.Alignment)switch(parseInt(c,10)){case 1:a.displayAlign=te;a.textAlign="start";break;case 2:a.displayAlign=te;a.textAlign=je;break;case 3:a.displayAlign=te;a.textAlign="end";break;case 5:a.displayAlign=
"before";a.textAlign="start";break;case 6:a.displayAlign="before";a.textAlign=je;break;case 7:a.displayAlign="before";a.textAlign="end";break;case 9:a.displayAlign="center";a.textAlign="start";break;case 10:a.displayAlign="center";a.textAlign=je;break;case 11:a.displayAlign="center",a.textAlign="end"}if(b=b.AlphaLevel)a.opacity=parseFloat(b)}function cF(a){a=parseInt(a.replace("&H",""),16);return a>=0?"rgba("+(a&255)+","+(a>>8&255)+","+(a>>16&255)+","+(a>>24&255^255)/255+")":null}
function dF(a){a=eF.exec(a);return(a[1]?parseInt(a[1].replace(":",""),10):0)*3600+parseInt(a[2],10)*60+parseFloat(a[3])}
var iF=class{parseInit(){}setSequenceMode(){}setManifestType(){}parseMedia(a){var b="",c="",d=null,e=null;e=xb(a).split(/\r?\n\s*\r?\n/);for(var f of e){e=f;if(a=fF.exec(f))d=a[1],e=a[2];d=="V4 Styles"||d=="V4+ Styles"?(b=e,b=c?b+("\n"+e):e):d=="Events"&&(c=c?c+("\n"+e):e)}d=[];f=null;b=b.split(/\r?\n/);for(var g of b){if(/^\s*;/.test(g))continue;if(e=gF.exec(g))if(b=e[1].trim(),e=e[2].trim(),b=="Format")f=e.split(hF);else if(b=="Style"){b=e.split(hF);e={};for(a=0;a<f.length&&a<b.length;a++)e[f[a]]=
b[a];d.push(e)}}g=[];f=null;c=c.split(/\r?\n/);for(const h of c){if(/^\s*;/.test(h))continue;if(b=gF.exec(h))if(c=b[1].trim(),b=b[2].trim(),c=="Format")f=b.split(hF);else if(c=="Dialogue"){b=b.split(hF);c={};for(e=0;e<f.length&&e<b.length;e++)c[f[e]]=b[e];e=dF(c.Start);a=dF(c.End);b=new ae(e,a,b.slice(f.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,""));const k=c.Style;(c=d.find(l=>l.Name==k))&&bF(b,c);g.push(b)}}return g}};x("shaka.text.SsaTextParser",iF);
iF.prototype.parseMedia=iF.prototype.parseMedia;iF.prototype.setManifestType=iF.prototype.setManifestType;iF.prototype.setSequenceMode=iF.prototype.setSequenceMode;iF.prototype.parseInit=iF.prototype.parseInit;var fF=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,gF=/^\s*([^:]+):\s*(.*)/,hF=/\s*,\s*/,eF=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;Ve("text/x-ssa",()=>new iF);function jF(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)?{Fd:c,qa:a}:null}function kF(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 lF(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 mF(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 nF=Object.freeze({jg:0,Ce:0,ye:0,pe:0,qe:2,lg:0}),oF=Object.freeze({jg:0,Ce:0,ye:0,pe:0,qe:2,lg:0}),pF=Object.freeze({jg:0,Ce:0,ye:0,pe:0,qe:1,lg:1});var qF=class{constructor(a){this.j=a;this.h=0;this.g=new Map;this.i=null}destroy(){this.g.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/aac"?Uh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/aac"?`audio/mp4; codecs="${Se(b)||"mp4a.40.2"}"`:b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){var e=$a(a),f=qj(e);let g=f.length;for(;g<e.length&&!lF(e,g);g++);a=c.endTime*1E3;f=pj(f);f.length&&c&&(f=f.find(k=>k.description===
"com.apple.streaming.transportStreamTimestamp"))&&(a=f.data);f=kF(e,g);if(!f)return Promise.reject(new D(2,3,3018,c?c.S()[0]:null));b.audioSamplingRate=f.sampleRate;b.channelsCount=f.channelCount;const h=[];for(;g<e.length;){const k=jF(e,g);if(!k)return Promise.reject(new D(2,3,3018,c?c.S()[0]:null));const l=k.Fd+k.qa;g+l<=e.length&&h.push({data:e.subarray(g+k.Fd,g+l),size:k.qa,duration:1024,jb:0,flags:nF});g+=l}e=f.sampleRate;a=Math.floor(a*e/1E3);d={id:b.id,type:"audio",codecs:f.codec,timescale:e,
duration:d,rb:[],Fa:new Uint8Array([]),Sa:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:a,pb:h},stream:b};d=new Fi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=ii(d),this.g.set(c,b));c=this.i!==b;d=Ei(d);this.i=b;this.h++;return Promise.resolve({data:d,init:c?b:null})}};x("shaka.transmuxer.AacTransmuxer",qF);qF.prototype.transmux=qF.prototype.transmux;qF.prototype.getOriginalMimeType=qF.prototype.getOriginalMimeType;qF.prototype.convertCodecs=qF.prototype.convertCodecs;
qF.prototype.isSupported=qF.prototype.isSupported;qF.prototype.destroy=qF.prototype.destroy;Ae("audio/aac",()=>new qF("audio/aac"),Ge);function rF(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.Fa=a;c.qa=f;return!0}
function sF(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 tF=class{constructor(a){this.j=a;this.h=0;this.g=new Map;this.i=null}destroy(){this.g.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/ac3"?Uh(this.convertCodecs("audio",a)):!1}convertCodecs(a,b){return b.toLowerCase().split(";")[0]=="audio/ac3"?tb().I()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':b}getOriginalMimeType(){return this.j}transmux(a,b,c,d){a=$a(a);var e=qj(a);let f=e.length;for(;f<a.length&&!sF(a,f);f++);let g=c.endTime*1E3;e=pj(e);e.length&&c&&(e=e.find(m=>
m.description==="com.apple.streaming.transportStreamTimestamp"))&&(g=e.data);e=0;let h=new Uint8Array([]);const k=[],l={sampleRate:0,channelCount:0,Fa:new Uint8Array(0),qa:0};for(;f<a.length;){if(!rF(a,f,l))return Promise.reject(new D(2,3,3018,c?c.S()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.Fa;k.push({data:a.subarray(f,f+l.qa),size:l.qa,duration:1536,jb:0,flags:nF});f+=l.qa}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ac-3",timescale:e,
duration:d,rb:[],Fa:h,Sa:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:a,pb:k},stream:b};d=new Fi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=ii(d),this.g.set(c,b));c=this.i!==b;d=Ei(d);this.i=b;this.h++;return Promise.resolve({data:d,init:c?b:null})}};x("shaka.transmuxer.Ac3Transmuxer",tF);tF.prototype.transmux=tF.prototype.transmux;tF.prototype.getOriginalMimeType=tF.prototype.getOriginalMimeType;tF.prototype.convertCodecs=tF.prototype.convertCodecs;
tF.prototype.isSupported=tF.prototype.isSupported;tF.prototype.destroy=tF.prototype.destroy;Ae("audio/ac3",()=>new tF("audio/ac3"),Ge);function uF(a,b,c){if(b+8>a.length||(a[b]<<8|a[b+1]<<0)!==2935)return!1;var d=new Dj(a.subarray(b+2));vj(d,2);vj(d,3);const e=wj(d,11)+1<<1;var f=wj(d,2);let g;f==3?(f=wj(d,2),f=[24E3,22060,16E3][f],g=3):(f=[48E3,44100,32E3][f],g=wj(d,2));const h=wj(d,3),k=wj(d,1);d=wj(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.Fa=a;c.qa=e;return!0};var vF=class{constructor(a){this.j=a;this.h=0;this.g=new Map;this.i=null}destroy(){this.g.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/ec3"?Uh(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=$a(a);var e=qj(a);let f=e.length;for(;f<a.length&&(a[f]<<8|a[f+1]<<0)!==2935;f++);let g=c.endTime*1E3;e=pj(e);e.length&&c&&(e=e.find(m=>m.description===
"com.apple.streaming.transportStreamTimestamp"))&&(g=e.data);e=0;let h=new Uint8Array([]);const k=[],l={sampleRate:0,channelCount:0,Fa:new Uint8Array(0),qa:0};for(;f<a.length;){if(!uF(a,f,l))return Promise.reject(new D(2,3,3018,c?c.S()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;e=l.sampleRate;h=l.Fa;k.push({data:a.subarray(f,f+l.qa),size:l.qa,duration:1536,jb:0,flags:nF});f+=l.qa}a=Math.floor(g*e/1E3);d={id:b.id,type:"audio",codecs:"ec-3",timescale:e,duration:d,rb:[],
Fa:h,Sa:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:a,pb:k},stream:b};d=new Fi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=ii(d),this.g.set(c,b));c=this.i!==b;d=Ei(d);this.i=b;this.h++;return Promise.resolve({data:d,init:c?b:null})}};x("shaka.transmuxer.Ec3Transmuxer",vF);vF.prototype.transmux=vF.prototype.transmux;vF.prototype.getOriginalMimeType=vF.prototype.getOriginalMimeType;vF.prototype.convertCodecs=vF.prototype.convertCodecs;
vF.prototype.isSupported=vF.prototype.isSupported;vF.prototype.destroy=vF.prototype.destroy;Ae("audio/ec3",()=>new vF("audio/ec3"),Ge);function wF(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 Dj(b.data),d=Aj(c);Aj(c);Aj(c);yj(c);if(xF.includes(d)&&(d=K(c),d===3&&vj(c,1),yj(c),yj(c),vj(c,1),O(c))){d=d!==3?8:12;for(var e=0;e<d;e++)O(c)&&(e<6?Bj(c,16):Bj(c,64))}yj(c);d=K(c);if(d===0)K(c);else if(d===1)for(vj(c,1),yj(c),yj(c),d=K(c),e=0;e<d;e++)yj(c);yj(c);vj(c,1);var f=K(c),g=K(c),h=wj(c,1);h===0&&vj(c,1);vj(c,1);var k=0,l=0;let m=0,n=0;O(c)&&(k=K(c),l=K(c),m=K(c),n=K(c));
e=d=1;if(O(c)&&O(c)){const p=Aj(c),r=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];p>0&&p<=16?(d=r[p-1],e=q[p-1]):p===255&&(d=wj(c,16),e=wj(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,Sa:h,Za:d,$a:e}}
function yF(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 r=!1;h=!0;var k=p.data;n&&k.length>4&&(k=Cj(new Dj(k)),k===2||k===4||k===7||k===9)&&(r=!0);r&&c&&c.frame&&!c.isKeyframe&&(e(),c=null);c||g(m);c.frame=!0;c.isKeyframe=r;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 xF=[100,110,122,244,44,83,86,118,128,138,139,134];function zF(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=AF(b.fullData);a=BF(c.fullData);const f=CF(d.fullData);b=DF(b.fullData,c.fullData,d.fullData,{pg:e.pg,Ng:e.Ng,Tf:a.Tf,Uf:a.Uf,Nf:a.Nf,Sf:a.Sf,Of:a.Of,Pf:a.Pf,Qf:a.Qf,Rf:a.Rf,Hf:a.Hf,If:a.If,Jf:a.Jf,Kf:a.Kf,Lf:a.Lf,Mf:a.Mf,Me:a.Me,xf:a.xf,uf:a.uf,tf:a.tf,rg:f.rg,Gf:a.Gf,Ff:a.Ff});return{height:a.height,width:a.width,Sa:b,Za:a.Vj,$a:a.Uj}}
function AF(a){var b=new Dj(a,!0);Aj(b);Aj(b);wj(b,4);wj(b,2);wj(b,6);a=wj(b,3);b=O(b);return{pg:a+1,Ng:b}}
function BF(a){a=new Dj(a,!0);Aj(a);Aj(a);let b=0,c=0,d=0,e=0;wj(a,4);const f=wj(a,3);O(a);const g=wj(a,2),h=wj(a,1),k=wj(a,5),l=Aj(a),m=Aj(a),n=Aj(a),p=Aj(a),r=Aj(a),q=Aj(a),t=Aj(a),u=Aj(a),v=Aj(a),y=Aj(a),w=Aj(a);var z=[],A=[];for(var B=0;B<f;B++)z.push(O(a)),A.push(O(a));if(f>0)for(B=f;B<8;B++)wj(a,2);for(B=0;B<f;B++)z[B]&&wj(a,88),A[B]&&Aj(a);K(a);z=K(a);z==3&&wj(a,1);A=K(a);B=K(a);O(a)&&(b+=K(a),c+=K(a),d+=K(a),e+=K(a));const E=K(a),G=K(a);var ea=K(a);if(O(a))for(var M=0;M<=f;M++)K(a),K(a),K(a);
else K(a),K(a),K(a);K(a);K(a);K(a);K(a);K(a);K(a);if(O(a)&&O(a))for(M=0;M<4;M++)for(var N=0;N<(M===3?2:6);N++)if(O(a)){var ia=Math.min(64,1<<4+(M<<1));M>1&&zj(a);for(var L=0;L<ia;L++)zj(a)}else K(a);O(a);O(a);O(a)&&(Aj(a),K(a),K(a),O(a));M=K(a);N=0;for(ia=0;ia<M;ia++)if(L=!1,ia!==0&&(L=O(a)),L){ia===M&&K(a);O(a);K(a);L=0;for(var fa=0;fa<=N;fa++){var Q=O(a),ua=!1;Q||(ua=O(a));(Q||ua)&&L++}N=L}else{fa=K(a);L=K(a);N=fa+L;for(Q=0;Q<fa;Q++)K(a),O(a);for(fa=0;fa<L;fa++)K(a),O(a)}if(O(a))for(M=K(a),N=0;N<
M;N++){for(ia=0;ia<ea+4;ia++)wj(a,1);wj(a,1)}M=ea=1;N=!0;ia=1;fa=L=0;O(a);O(a);if(O(a)){if(O(a)){Q=Aj(a);ua=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2];var Ra=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Q>0&&Q<=16?(ea=ua[Q-1],M=Ra[Q-1]):Q===255&&(ea=wj(a,16),M=wj(a,16))}O(a)&&O(a);O(a)&&(wj(a,3),O(a),O(a)&&(Aj(a),Aj(a),Aj(a)));O(a)&&(K(a),K(a));O(a);O(a);O(a);if(Q=O(a))yj(a),yj(a),yj(a),yj(a);if(O(a)&&(ia=wj(a,32),L=wj(a,32),O(a)&&K(a),O(a))){Ra=!1;Q=O(a);ua=O(a);if(Q||ua){if(Ra=O(a))Aj(a),wj(a,
5),O(a),wj(a,5);wj(a,4);wj(a,4);Ra&&wj(a,4);wj(a,5);wj(a,5);wj(a,5)}for(let Ab=0;Ab<=f;Ab++){N=O(a);var Va=!0;let rb=1;N||(Va=O(a));let dc=!1;Va?K(a):dc=O(a);dc||(rb=K(a)+1);if(Q){for(Va=0;Va<rb;Va++)K(a),K(a),Ra&&(K(a),K(a));O(a)}if(ua){for(Va=0;Va<rb;Va++)K(a),K(a),Ra&&(K(a),K(a));O(a)}}}O(a)&&(O(a),O(a),O(a),fa=K(a),K(a),K(a),K(a),K(a))}return{Nf:w,Tf:g,Uf:h,Sf:k,Of:l,Pf:m,Qf:n,Rf:p,Hf:r,If:q,Jf:t,Kf:u,Lf:v,Mf:y,Me:fa,xf:z,uf:E,tf:G,width:A-(b+c)*(z===1||z===2?2:1),height:B-(d+e)*(z===1?2:1),Vj:ea,
Uj:M,Gf:L/ia,Ff:N}}function CF(a){var b=new Dj(a,!0);Aj(b);Aj(b);K(b);K(b);O(b);O(b);wj(b,3);O(b);O(b);K(b);K(b);zj(b);O(b);O(b);O(b)&&K(b);zj(b);zj(b);O(b);O(b);O(b);O(b);a=O(b);b=O(b);let c=1;b&&a?c=0:b?c=3:a&&(c=2);return{rg:c}}
function DF(a,b,c,d){const e=new Uint8Array(23+(5+a.byteLength)+(5+b.byteLength)+(5+c.byteLength));e[0]=1;e[1]=(d.Tf&3)<<6|(d.Uf?1:0)<<5|d.Sf&31;e[2]=d.Of;e[3]=d.Pf;e[4]=d.Qf;e[5]=d.Rf;e[6]=d.Hf;e[7]=d.If;e[8]=d.Jf;e[9]=d.Kf;e[10]=d.Lf;e[11]=d.Mf;e[12]=d.Nf;e[13]=240|(d.Me&3840)>>8;e[14]=d.Me&255;e[15]=252|d.rg&3;e[16]=252|d.xf&3;e[17]=248|d.uf&7;e[18]=248|d.tf&7;e[19]=0;e[20]=parseInt(d.Gf,10);e[21]=((d.Ff?1:0)&3)<<6|(d.pg&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 EF(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=FF[(c===3?3-d:d===3?3:4)*14+e-1]*1E3;f=GF[(c===3?0:c===2?1:2)*3+f];c=HF[c][d];const k=IF[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,qa:l,Tj:c*8*k}}return null}
function JF(a,b){return a[b]===255&&(a[b+1]&224)===224&&(a[b+1]&6)!==0}function KF(a,b){if(b+1<a.length&&JF(a,b)){const c=EF(a,b);let d=4;c&&c.qa&&(d=c.qa);b+=d;return b===a.length||b+1<a.length&&JF(a,b)}return!1}
var FF=[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],GF=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],HF=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],IF=[0,1,1,4];var LF=class{constructor(a){this.j=a;this.h=0;this.g=new Map;this.i=null}destroy(){this.g.clear()}isSupported(a){return a.toLowerCase().split(";")[0]=="audio/mpeg"?Uh(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=$a(a);let f=qj(e).length;for(;f<e.length&&!KF(e,f);f++);let g;for(a=[];f<e.length;){const h=EF(e,f);if(!h)return Promise.reject(new D(2,3,3018,
c?c.S()[0]:null));g||=h;f+h.qa<=e.length&&a.push({data:e.subarray(f,f+h.qa),size:h.qa,duration:1152,jb:0,flags:nF});f+=h.qa}if(!g)return Promise.reject(new D(2,3,3018,c?c.S()[0]:null));e=g.Tj*9E4/g.sampleRate*this.h;d={id:b.id,type:"audio",codecs:"mp3",timescale:g.sampleRate,duration:d,rb:[],Fa:new Uint8Array([]),Sa:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:e,pb:a},stream:b};d=new Fi([d]);c=b.id+"_"+c.i;this.g.has(c)?b=this.g.get(c):(b=ii(d),this.g.set(c,b));c=this.i!==
b;d=Ei(d);this.i=b;this.h++;return Promise.resolve({data:d,init:c?b:null})}};x("shaka.transmuxer.Mp3Transmuxer",LF);LF.prototype.transmux=LF.prototype.transmux;LF.prototype.getOriginalMimeType=LF.prototype.getOriginalMimeType;LF.prototype.convertCodecs=LF.prototype.convertCodecs;LF.prototype.isSupported=LF.prototype.isSupported;LF.prototype.destroy=LF.prototype.destroy;Ae("audio/mpeg",()=>new LF("audio/mpeg"),Ge);var MF=class{constructor(a){this.h=a;this.g=null}destroy(){}isSupported(a){if(a.toLowerCase().split(";")[0]!="video/mp2t")return!1;var b=Se(a).split(",");const c=Ub("audio",b);b=Ub("video",b);return!c||b||Oe(c)!="mp3"?!1:Uh(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 Nj;this.g.$e(c.i);a=$a(a);a=this.g.parse(a);if(a.Bd().audio!="mp3"||
e!="audio")return Promise.reject(new D(2,3,3018,c?c.S()[0]:null));c=new Uint8Array([]);for(const f of a.ob()){e=f.data;if(!e)continue;for(a=0;a<e.length;)(b=EF(e,a))?(a+b.qa<=e.length&&(c=Nb(c,e.subarray(a,a+b.qa))),a+=b.qa):a++}return Promise.resolve(c)}};x("shaka.transmuxer.MpegTsTransmuxer",MF);MF.prototype.transmux=MF.prototype.transmux;MF.prototype.getOriginalMimeType=MF.prototype.getOriginalMimeType;MF.prototype.convertCodecs=MF.prototype.convertCodecs;MF.prototype.isSupported=MF.prototype.isSupported;
MF.prototype.destroy=MF.prototype.destroy;Ae("video/mp2t",()=>new MF("video/mp2t"),Fe);/*
 @license
 MSS Transmuxer
 Copyright 2015 Dash Industry Forum
 SPDX-License-Identifier: BSD-3-Clause
*/
function NF(a){function b(){this._procFullBox();this.flags&1&&(this._procField("AlgorithmID","uint",24),this._procField("IV_size","uint",8),this._procFieldArray("KID",16,"uint",8));this._procField("sample_count","uint",32);this._procEntries("entry",this.sample_count,function(c){this._procEntryField(c,"InitializationVector","data",8);this.flags&2&&(this._procEntryField(c,"NumberOfEntries","uint",16),this._procSubEntries(c,"clearAndCryptedData",c.NumberOfEntries,function(d){this._procEntryField(d,"BytesOfClearData",
"uint",16);this._procEntryField(d,"BytesOfEncryptedData","uint",32)}))})}a.g.addBoxProcessor("saio",function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32));this._procField("entry_count","uint",32);this._procFieldArray("offset",this.entry_count,"uint",this.version===1?64:32)});a.g.addBoxProcessor("saiz",function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter",
"uint",32));this._procField("default_sample_info_size","uint",8);this._procField("sample_count","uint",32);this.default_sample_info_size===0&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)});a.g.addBoxProcessor("senc",b);a.g.addBoxProcessor("uuid",function(){let c=!0;for(let d=0;d<16;d++)this.usertype[d]!==OF[d]&&(c=!1);c&&(this._parsing&&(this.type="sepiff"),b.call(this))})}
function PF(a,b){let c=8;for(let d=0;d<a.boxes.length&&a.boxes[d].type!==b;d++)c+=a.boxes[d].size;return c}
var QF=class{constructor(a){this.h=a;(this.g=xx.get("ISOBoxer")())&&NF(this)}destroy(){}isSupported(a,b){const c=a.startsWith("mss/");if(!this.g||!c)return!1;if(b)return Uh(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Uh(b)||Uh(a)}convertCodecs(a,b){return b.replace("mss/","")}getOriginalMimeType(){return this.h}transmux(a,b,c){if(!c)return Promise.resolve($a(a));if(!b.mssPrivateData)return Promise.reject(new D(2,3,3020,c?c.S()[0]:null));try{let e;
const f=this.g.parseBuffer(a),g=f.fetch("tfhd");g.track_ID=b.id+1;let h=f.fetch("tfdt");const k=f.fetch("traf");h===null&&(h=this.g.createFullBox("tfdt",k,g),h.version=1,h.flags=0,h.baseMediaDecodeTime=Math.floor(c.startTime*b.mssPrivateData.timescale));const l=f.fetch("trun");let m=f.fetch("tfxd");m&&m._parent.boxes.splice(m._parent.boxes.indexOf(m),1);let n=f.fetch("tfrf");n&&n._parent.boxes.splice(n._parent.boxes.indexOf(n),1);const p=f.fetch("sepiff");if(p!==null){p.type="senc";p.usertype=void 0;
let t=f.fetch("saio");if(t===null){t=this.g.createFullBox("saio",k);t.version=0;t.flags=0;t.entry_count=1;t.offset=[0];const u=this.g.createFullBox("saiz",k);u.version=0;u.flags=0;u.sample_count=p.sample_count;u.default_sample_info_size=0;u.sample_info_size=[];if(p.flags&2)for(e=0;e<p.sample_count;e+=1)u.sample_info_size[e]=10+6*p.entry[e].NumberOfEntries;else u.default_sample_info_size=8}}g.flags&=16777214;g.flags|=131072;l.flags|=1;const r=f.fetch("moof");l.data_offset=r.getLength()+8;const q=f.fetch("saio");
q!==null&&(q.offset[0]=PF(r,"traf")+PF(k,"senc")+16);var d=$a(f.write());return Promise.resolve(d)}catch(e){return e instanceof D?Promise.reject(e):Promise.reject(new D(2,3,3022,c?c.S()[0]:null))}}};x("shaka.transmuxer.MssTransmuxer",QF);QF.prototype.transmux=QF.prototype.transmux;QF.prototype.getOriginalMimeType=QF.prototype.getOriginalMimeType;QF.prototype.convertCodecs=QF.prototype.convertCodecs;QF.prototype.isSupported=QF.prototype.isSupported;QF.prototype.destroy=QF.prototype.destroy;
var OF=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);Ae("mss/audio/mp4",()=>new QF("mss/audio/mp4"),Ge);Ae("mss/video/mp4",()=>new QF("mss/video/mp4"),Ge);function RF(a){if(a.length<1)return 960;var b=a[0];const c=b&3;b=SF[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 SF=[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];var VF=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=Se(c).split(",");c=Ub("audio",d);d=Ub("video",d);if(c&&(c=Oe(c),!TF.includes(c))||d&&(c=Oe(d),!UF.includes(c)))return!1;if(b)return Uh(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Uh(b)||Uh(a)}convertCodecs(a,
b){return b.toLowerCase().split(";")[0]=="video/mp2t"?(b=Se(b).replace("mp4a.40.34","mp3").split(",").map(c=>Gf(c,"audio/mp4")).map(Hf).join(","),a=="audio"?`audio/mp4; codecs="${b}"`:`video/mp4; codecs="${b}"`):b}getOriginalMimeType(){return this.m}transmux(a,b,c,d,e){const f=$a(a);if(e=="audio"&&!Fj(f)){const y=qj(f);let w=y.length;for(;w<f.length;w++)if(KF(f,w))return Promise.reject(new D(2,3,3018,c?c.S()[0]:null));for(w=y.length;w<f.length;w++)if(lF(f,w))return this.i||(this.i=new qF("audio/aac")),
this.i.transmux(a,b,c,d,e);return Promise.reject(new D(2,3,3018,c?c.S()[0]:null))}this.h?this.h.clearData():this.h=new Nj;this.h.$e(c.i);const g=this.h.parse(f),h=[],k=g.Bd();try{let y=null;if(e=="video"){switch(k.video){case "avc":const w=[];let z=null;const A=g.Zc(),B=yF(A);if(!B.length)throw new D(2,3,3023,c?c.S()[0]:null);for(let fa=0;fa<B.length;fa++){const Q=B[fa];z==null&&(z=Q.dts);w.push({data:Q.data,size:Q.data.byteLength,duration:fa+1<B.length?(B[fa+1].dts||0)-(Q.dts||0):B.length>1?(Q.dts||
0)-(B[fa-1].dts||0):(c.endTime-c.startTime)*9E4,jb:Math.round((Q.pts||0)-(Q.dts||0)),flags:Q.isKeyframe?oF:pF})}const E=[];for(const fa of A)E.push(...fa.nalus);const G=wF(E);if(!G||z==null)throw new D(2,3,3018,c?c.S()[0]:null);b.height=b.height||G.height;b.width=b.width||G.width;y={id:b.id,type:"video",codecs:"avc1",timescale:9E4,duration:d,rb:[],Fa:new Uint8Array([]),Sa:G.Sa,Za:G.Za,$a:G.$a,data:{sequenceNumber:this.g,baseMediaDecodeTime:z,pb:w},stream:b};break;case "hvc":const ea=[];let M=null;
const N=[],ia=g.Zc();var l=new Uint8Array(0),m=!1;if(!ia.length)throw new D(2,3,3023,c?c.S()[0]:null);for(let fa=0;fa<ia.length;fa++){const Q=ia[fa],ua=Q.nalus;N.push(...ua);a:{let Ra=!1;const Va=[];let Ab=0,rb=!1;for(const cd of ua){let Db;switch(cd.type){case 1:case 0:Db=rb=!0;break;case 19:case 20:case 21:Ra=Db=rb=!0;break;case 32:case 33:case 34:Db=!0;break;case 35:rb=Db=!0;break;case 39:case 40:Db=!0;break;default:Db=!1}rb&&Db&&(Va.push(cd.fullData),Ab+=cd.fullData.byteLength)}if(!Va.length){var n=
!1;break a}Ab+=4*Va.length;const dc=new Uint8Array(Ab);let Dd=0;for(const cd of Va){const Db=cd.byteLength;dc[Dd]=Db>>24&255;dc[Dd+1]=Db>>16&255;dc[Dd+2]=Db>>8&255;dc[Dd+3]=Db&255;dc.set(cd,Dd+4);Dd+=Db+4}l=dc;m=Ra;n=!0}n&&(M==null&&Q.dts!=null&&(M=Q.dts),ea.push({data:l,size:l.byteLength,duration:fa+1<ia.length?(ia[fa+1].dts||0)-(Q.dts||0):ia.length>1?(Q.dts||0)-(ia[fa-1].dts||0):(c.endTime-c.startTime)*9E4,jb:Math.round((Q.pts||0)-(Q.dts||0)),flags:m?oF:pF}))}const L=zF(N);if(!L||M==null)throw new D(2,
3,3018,c?c.S()[0]:null);b.height=b.height||L.height;b.width=b.width||L.width;y={id:b.id,type:"video",codecs:"hvc1",timescale:9E4,duration:d,rb:[],Fa:new Uint8Array([]),Sa:L.Sa,Za:L.Za,$a:L.$a,data:{sequenceNumber:this.g,baseMediaDecodeTime:M,pb:ea},stream:b}}y&&(h.push(y),y=null)}if(e=="audio"){switch(k.audio){case "aac":const w=[];let z,A=null,B=null,E=null;for(const Xa of g.ob()){let ya=Xa.data;if(!ya)continue;let oa=0;if(B==-1&&E)ya=Nb(E,Xa.data),B=null;else if(B!=null&&E){oa=Math.max(0,B);const gb=
Nb(E,ya.subarray(0,oa));w.push({data:gb,size:gb.byteLength,duration:1024,jb:0,flags:nF});B=E=null}z=kF(ya,oa);if(!z)throw new D(2,3,3018,c?c.S()[0]:null);b.audioSamplingRate=z.sampleRate;b.channelsCount=z.channelCount;A==null&&Xa.pts!==null&&(A=Xa.pts);for(;oa<ya.length;){const gb=jF(ya,oa);if(!gb){E=ya.subarray(oa,ya.length);B=-1;break}const Je=gb.Fd+gb.qa;B=Math.max(0,oa+Je-ya.length);B!=0?E=ya.subarray(oa+gb.Fd,oa+Je):oa+Je<=ya.length&&w.push({data:ya.subarray(oa+gb.Fd,oa+Je),size:gb.qa,duration:1024,
jb:0,flags:nF});oa+=Je}}if(!z||A==null){A=c.startTime*9E4;const Xa=Ub("audio",b.codecs.split(","));if(!Xa||!b.channelsCount||!b.audioSamplingRate)throw new D(2,3,3018,c?c.S()[0]:null);z={sampleRate:b.audioSamplingRate,channelCount:b.channelsCount,codec:Xa};const ya=mF(Xa,b.channelsCount);if(!ya)throw new D(2,3,3018,c?c.S()[0]:null);const oa=A+(c.endTime-c.startTime)*9E4;let gb=A;for(;gb<oa;)w.push({data:ya,size:ya.byteLength,duration:1024,jb:0,flags:nF}),gb+=1024/z.sampleRate*9E4}const G=z.sampleRate,
ea=A/9E4*G;y={id:b.id,type:"audio",codecs:z.codec,timescale:G,duration:d,rb:[],Fa:new Uint8Array([]),Sa:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:ea,pb:w},stream:b};break;case "ac3":const M=[];let N=0,ia=new Uint8Array([]),L=null;const fa={sampleRate:0,channelCount:0,Fa:new Uint8Array(0),qa:0};for(const Xa of g.ob()){const ya=Xa.data;L==null&&Xa.pts!==null&&(L=Xa.pts);let oa=0;for(;oa<ya.length;)rF(ya,oa,fa)?(b.audioSamplingRate=fa.sampleRate,b.channelsCount=fa.channelCount,
N=fa.sampleRate,ia=fa.Fa,M.push({data:ya.subarray(oa,oa+fa.qa),size:fa.qa,duration:1536,jb:0,flags:nF}),oa+=fa.qa):oa++}if(N==0||ia.byteLength==0||L==null)throw new D(2,3,3018,c?c.S()[0]:null);const Q=L/9E4*N;y={id:b.id,type:"audio",codecs:"ac-3",timescale:N,duration:d,rb:[],Fa:ia,Sa:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:Q,pb:M},stream:b};break;case "ec3":const ua=[];let Ra=0,Va=new Uint8Array([]),Ab=null;const rb={sampleRate:0,channelCount:0,Fa:new Uint8Array(0),
qa:0};for(const Xa of g.ob()){const ya=Xa.data;Ab==null&&Xa.pts!==null&&(Ab=Xa.pts);let oa=0;for(;oa<ya.length;)uF(ya,oa,rb)?(b.audioSamplingRate=rb.sampleRate,b.channelsCount=rb.channelCount,Ra=rb.sampleRate,Va=rb.Fa,ua.push({data:ya.subarray(oa,oa+rb.qa),size:rb.qa,duration:1536,jb:0,flags:nF}),oa+=rb.qa):oa++}if(Ra==0||Va.byteLength==0||Ab==null)throw new D(2,3,3018,c?c.S()[0]:null);const dc=Ab/9E4*Ra;y={id:b.id,type:"audio",codecs:"ec-3",timescale:Ra,duration:d,rb:[],Fa:Va,Sa:new Uint8Array([]),
Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:dc,pb:ua},stream:b};break;case "mp3":const Dd=[];let cd,Db=null;for(const Xa of g.ob()){const ya=Xa.data;if(!ya)continue;Db==null&&Xa.pts!==null&&(Db=Xa.pts);let oa=0;for(;oa<ya.length;){const gb=EF(ya,oa);gb?(cd||=gb,oa+gb.qa<=ya.length&&Dd.push({data:ya.subarray(oa,oa+gb.qa),size:gb.qa,duration:1152,jb:0,flags:nF}),oa+=gb.qa):oa++}}if(!cd||Db==null)throw new D(2,3,3018,c?c.S()[0]:null);const tx=cd.sampleRate,zJ=Db/9E4*tx;y={id:b.id,type:"audio",
codecs:"mp3",timescale:tx,duration:d,rb:[],Fa:new Uint8Array([]),Sa:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:zJ,pb:Dd},stream:b};break;case "opus":const ux=[];let fk=null;const dd=g.J;if(!dd)throw new D(2,3,3018,c?c.S()[0]:null);let Lb=[];switch(dd.ki){case 1:case 2:Lb=[0];break;case 0:Lb=[255,1,1,0,1];break;case 128:Lb=[255,2,0,0,1];break;case 3:Lb=[1,2,1,0,2,1];break;case 4:Lb=[1,2,2,0,1,2,3];break;case 5:Lb=[1,3,2,0,4,1,2,3];break;case 6:Lb=[1,4,2,0,4,1,2,3,
5];break;case 7:Lb=[1,4,2,0,4,1,2,3,5,6];break;case 8:Lb=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:Lb=[1,1,2,0,1];break;case 131:Lb=[1,1,3,0,1,2];break;case 132:Lb=[1,1,4,0,1,2,3];break;case 133:Lb=[1,1,5,0,1,2,3,4];break;case 134:Lb=[1,1,6,0,1,2,3,4,5];break;case 135:Lb=[1,1,7,0,1,2,3,4,5,6];break;case 136:Lb=[1,1,8,0,1,2,3,4,5,6,7]}var p=new Uint8Array([0,dd.channelCount,0,0,dd.sampleRate>>>24&255,dd.sampleRate>>>17&255,dd.sampleRate>>>8&255,dd.sampleRate>>>0&255,0,0,...Lb]);const vx=dd.sampleRate;
for(const Xa of g.ob()){const ya=Xa.data;fk==null&&Xa.pts!==null&&(fk=Xa.pts);let oa=0;for(;oa<ya.length;){const gb=(ya[oa+1]&16)!==0,Je=(ya[oa+1]&8)!==0;let Ed=oa+2,gk=0;for(;ya[Ed]===255;)gk+=255,Ed+=1;gk+=ya[Ed];Ed+=1;Ed+=gb?2:0;Ed+=Je?2:0;const Zn=ya.slice(Ed,Ed+gk);ux.push({data:Zn,size:Zn.byteLength,duration:RF(Zn),jb:0,flags:nF});oa=Ed+gk}}if(p.byteLength==0||fk==null)throw new D(2,3,3018,c?c.S()[0]:null);b.audioSamplingRate=dd.sampleRate;b.channelsCount=dd.channelCount;const AJ=fk/9E4*vx;
y={id:b.id,type:"audio",codecs:"opus",timescale:vx,duration:d,rb:[],Fa:p,Sa:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:AJ,pb:ux},stream:b}}y&&h.push(y)}}catch(y){return y&&y.code==3023?Promise.resolve(new Uint8Array([])):Promise.reject(y)}if(!h.length)return Promise.reject(new D(2,3,3018,c?c.S()[0]:null));const r=new Fi(h);let q;const t=b.id+"_"+c.i;this.j.has(t)?q=this.j.get(t):(q=ii(r),this.j.set(t,q));const u=this.l!==q,v=Ei(r);this.l=q;this.g++;return Promise.resolve({data:v,
init:u?q:null})}};x("shaka.transmuxer.TsTransmuxer",VF);VF.prototype.transmux=VF.prototype.transmux;VF.prototype.getOriginalMimeType=VF.prototype.getOriginalMimeType;VF.prototype.convertCodecs=VF.prototype.convertCodecs;VF.prototype.isSupported=VF.prototype.isSupported;VF.prototype.destroy=VF.prototype.destroy;var TF=["aac","ac-3","ec-3","mp3","opus"],UF=["avc","hevc"];Ae("video/mp2t",()=>new VF("video/mp2t"),Ee);x("shaka.util.FairPlayUtils",class extends $m{});var WF=class{constructor(a,b){this.parent=a;this.controls=b;this.eventManager=new zc;this.localization=this.controls.oa;this.player=this.controls.Fb();this.video=this.controls.xc();this.adManager=this.player.re();this.ad=b.getAd();this.eventManager.o(this.adManager,"ad-started",c=>{this.ad=c.ad});this.eventManager.o(this.adManager,"ad-stopped",()=>{this.ad=null})}release(){this.eventManager.release();this.ad=this.adManager=this.video=this.player=this.localization=this.eventManager=this.controls=this.parent=
null}};x("shaka.ui.Element",WF);WF.prototype.release=WF.prototype.release;var XF=class{constructor(a,b){this.parent=a;this.g=aj("svg");this.h=aj("path");this.g.classList.add("material-svg-icon");this.g.setAttribute("viewBox","0 -960 960 960");b&&this.use(b);this.g.appendChild(this.h);this.parent&&a.appendChild(this.g)}use(a){a&&typeof a=="string"&&this.h.setAttribute("d",a)}aj(){return this.g}};x("shaka.ui.MaterialSVGIcon",XF);XF.prototype.getSvgElement=XF.prototype.aj;XF.prototype.use=XF.prototype.use;function YF(a){return ZF(a,"shaka-back-to-overflow-button")}function ZF(a,b){a=a.getElementsByClassName(b);return a.length?a[0]:null}function $F(a){a&&(a=ZF(a,"shaka-chosen-item"))&&a.parentElement.focus()}function aG(){const a=(new XF(null,"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z")).g;a.classList.add("shaka-chosen-item");a.ariaHidden="true";return a}
function Y(a,b){a&&(b?a.classList.remove("shaka-hidden"):a.classList.add("shaka-hidden"))}function bG(a,b){const c=Math.floor(a/86400),d=Math.floor(a%86400/3600),e=Math.floor(a/60%60);a=Math.floor(a%60);a<10&&(a="0"+a);a=e+":"+a;b&&(e<10&&(a="0"+a),a=d+":"+a,c>0&&(d<10&&(a="0"+a),a=c+":"+a));return a};var cG=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-ad-info");this.g.disabled=!0;this.parent.appendChild(this.g);this.h=new H(()=>{if(this.ad.isLinear()){var c="",d=this.ad.getSequenceLength();d>1&&(c=this.ad.getPositionInSequence(),c=this.localization.resolve("AD_PROGRESS").replace("[AD_ON]",String(c)).replace("[NUM_ADS]",String(d)));var e=Math.round(this.ad.getRemainingTime()),f=this.ad.getDuration();e!=-1&&f!=-1&&isFinite(e)&&isFinite(f)?e>0?(e=bG(f-e,!1)+
" / "+bG(f,!1),c=d>1?c+("\u00a0\u00a0"+e):this.localization.resolve("AD_TIME").replace("[AD_TIME]",e),this.g.textContent=c,Y(this.g,c!="")):(this.h.stop(),this.g.textContent=""):(this.g.textContent=c,Y(this.g,c!=""))}});this.eventManager.o(this.localization,"locale-updated",()=>{});this.eventManager.o(this.localization,"locale-changed",()=>{});this.eventManager.o(this.adManager,"ad-started",()=>{this.h.Ia();this.h.wa(.5)});this.eventManager.o(this.adManager,"ad-stopped",()=>{this.h.stop();this.g.textContent=
""});this.ad&&(this.h.Ia(),this.h.wa(.5))}release(){this.h.stop();this.h=null;super.release()}};x("shaka.ui.AdInfo",cG);function dG(a,b){eG.set(a,b)}function fG(a){for(const b of a.j.contextMenuElements){const c=eG.get(b);c?a.i.push(c.create(a.g,a.controls)):sa("Unrecognized context menu element:",b)}}
var gG=class extends WF{constructor(a,b){super(a,b);this.j=this.controls.g;this.h=this.controls.i;this.i=[];this.g=J("div");this.g.classList.add("shaka-no-propagation");this.g.classList.add("shaka-context-menu");this.g.classList.add("shaka-hidden");this.h.appendChild(this.g);this.eventManager.o(this.h,"contextmenu",c=>{if(this.g.classList.contains("shaka-hidden")){c.preventDefault();const d=this.h.getBoundingClientRect();this.g.style.left=`${c.clientX-d.left}px`;this.g.style.top=`${c.clientY-d.top}px`;
Y(this.g,!0)}else Y(this.g,!1)});this.eventManager.o(window,"click",()=>{Y(this.g,!1)});this.eventManager.o(this.g,"click",()=>{Y(this.g,!1)});this.eventManager.o(document,"click",c=>{!this.h||this.g.classList.contains("shaka-hidden")||this.h.contains(c.target)||this.yf()});fG(this)}release(){this.h=null;for(const a of this.i)a.release();this.i=[];super.release()}yf(){Y(this.g,!1)}};x("shaka.ui.ContextMenu",gG);gG.registerElement=dG;gG.prototype.closeMenu=gG.prototype.yf;var eG=new Map;function hG(a){if(a.isEnded()&&a.video.duration)a.button.ariaLabel=a.localization.resolve("REPLAY");else{const b=a.isPaused()?"PLAY":"PAUSE";a.button.ariaLabel=a.localization.resolve(b)}}
var jG=class extends WF{constructor(a,b){super(a,b);this.button=bj();this.parent.appendChild(this.button);this.h=new XF(this.button);this.eventManager.o(this.localization,"locale-updated",()=>{hG(this)});this.eventManager.o(this.localization,"locale-changed",()=>{hG(this)});this.eventManager.o(this.video,"play",()=>{hG(this);this.g()});this.eventManager.o(this.video,"pause",()=>{hG(this);this.g()});this.eventManager.o(this.video,"seeking",()=>{hG(this);this.g()});this.eventManager.o(this.player,"loaded",
()=>{hG(this);this.g()});this.eventManager.o(this.adManager,"ad-paused",()=>{hG(this);this.g()});this.eventManager.o(this.adManager,"ad-resumed",()=>{hG(this);this.g()});this.eventManager.o(this.adManager,"ad-started",()=>{hG(this);this.g()});this.eventManager.o(this.adManager,"ad-stopped",()=>{hG(this);this.g()});this.eventManager.o(this.button,"click",()=>{this.controls.Ba()&&iG(this.controls)});hG(this);this.g()}isPaused(){if(this.ad&&this.ad.isLinear())var a=this.ad.isPaused();else a=this.controls,
a=a.B.paused&&!a.T;return a}isEnded(){return this.ad&&this.ad.isLinear()?!1:this.player?this.player.isEnded():!0}g(){this.isEnded()&&this.video.duration?this.h.use("M480-80q-75 0-140.5-28.5t-114-77q-48.5-48.5-77-114T120-440q0-17 11.5-28.5T160-480q17 0 28.5 11.5T200-440q0 117 81.5 198.5T480-160q117 0 198.5-81.5T760-440q0-117-81.5-198.5T480-720h-6l34 34q12 12 11.5 28T508-630q-12 12-28.5 12.5T451-629L348-732q-12-12-12-28t12-28l103-103q12-12 28.5-11.5T508-890q11 12 11.5 28T508-834l-34 34h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-440q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-80Z"):
this.h.use(this.isPaused()?"M320-273v-414q0-17 12-28.5t28-11.5q5 0 10.5 1.5T381-721l326 207q9 6 13.5 15t4.5 19q0 10-4.5 19T707-446L381-239q-5 3-10.5 4.5T360-233q-16 0-28-11.5T320-273Z":"M640-200q-33 0-56.5-23.5T560-280v-400q0-33 23.5-56.5T640-760q33 0 56.5 23.5T720-680v400q0 33-23.5 56.5T640-200Zm-320 0q-33 0-56.5-23.5T240-280v-400q0-33 23.5-56.5T320-760q33 0 56.5 23.5T400-680v400q0 33-23.5 56.5T320-200Z")}};x("shaka.ui.PlayButton",jG);var kG=class extends jG{constructor(a,b){super(a,b);this.button.classList.add("shaka-play-button");this.button.classList.add("shaka-no-propagation")}g(){this.isEnded()&&this.video.duration?this.button.setAttribute("icon","replay"):this.isPaused()?this.button.setAttribute("icon","play"):this.button.setAttribute("icon","pause")}};x("shaka.ui.BigPlayButton",kG);var mG=class extends WF{constructor(a,b){super(a,b);this.m=null;this.i=this.C=!1;this.B=this.A=null;this.j=new H(()=>{parseInt(this.h.textContent,10)===0&&lG(this.controls,!0);const c=parseInt(this.h.textContent,10);c!==0&&(this.video.currentTime=this.controls.Xf()+c);this.g.style.opacity="0";this.C=!1;this.h.textContent="0s"});this.g=J("div");this.g.classList.add("shaka-no-propagation");this.parent.appendChild(this.g);this.h=J("span");this.h.textContent="0s";this.g.appendChild(this.h);this.u=new XF(this.g);
this.u.g.classList.add("shaka-forward-rewind-container-icon");this.l=!1;this.eventManager.o(this.g,"touchstart",c=>{c.touches.length>0&&(this.A=c.touches[0].clientX,this.B=c.touches[0].clientY);this.i=!1});this.eventManager.o(this.g,"touchmove",c=>{if(c.touches.length>0&&this.A!=null&&this.B!=null){const d=c.touches[0].clientX-this.A;c=c.touches[0].clientY-this.B;Math.sqrt(d*d+c*c)>10&&(this.i=!0)}});this.eventManager.o(this.g,"touchend",c=>{if(!this.i)if(this.controls.nc())c.preventDefault(),this.controls.yc();
else if(this.controls.g.tapSeekDistance>0&&(!this.ad||!this.ad.isLinear()))if(c.preventDefault(),c=this.controls.g.tapSeekDistance,!this.C)this.C=!0,this.m=Date.now(),this.j.Z(.5);else if(this.m+500>Date.now()){this.j.stop();this.m=Date.now();let d=parseInt(this.h.textContent,10);d=this.l?d-c:d+c;this.h.textContent=d.toString()+"s";this.g.style.opacity="1";this.j.Z(.5)}})}};x("shaka.ui.HiddenSeekButton",mG);var nG=class extends mG{constructor(a,b){super(a,b);this.g.classList.add("shaka-fast-forward-container");this.u.use("M100-315v-330q0-18 12-29t28-11q5 0 11 1t11 5l248 166q9 6 13.5 14.5T428-480q0 10-4.5 18.5T410-447L162-281q-5 4-11 5t-11 1q-16 0-28-11t-12-29Zm400 0v-330q0-18 12-29t28-11q5 0 11 1t11 5l248 166q9 6 13.5 14.5T828-480q0 10-4.5 18.5T810-447L562-281q-5 4-11 5t-11 1q-16 0-28-11t-12-29Z");this.l=!1}};x("shaka.ui.HiddenFastForwardButton",nG);var oG=class extends mG{constructor(a,b){super(a,b);this.g.classList.add("shaka-rewind-container");this.u.use("M798-281 550-447q-9-6-13.5-14.5T532-480q0-10 4.5-18.5T550-513l248-166q5-4 11-5t11-1q16 0 28 11t12 29v330q0 18-12 29t-28 11q-5 0-11-1t-11-5Zm-400 0L150-447q-9-6-13.5-14.5T132-480q0-10 4.5-18.5T150-513l248-166q5-4 11-5t11-1q16 0 28 11t12 29v330q0 18-12 29t-28 11q-5 0-11-1t-11-5Z");this.l=!0}};x("shaka.ui.HiddenRewindButton",oG);function pG(a,b){a.bar.value=qG(a,b.clientX)}function rG(a,b){b.preventDefault();a.bar.value=qG(a,b.changedTouches[0].clientX)}function qG(a,b){var c=a.bar.getBoundingClientRect();const d=parseFloat(a.bar.min),e=parseFloat(a.bar.max);a=parseFloat(a.bar.step)||1;const f=c.left+6;c=c.right-6;b=d+(Math.max(f,Math.min(c,b))-f)/(c-f)*(e-d);b=Math.round((b-d)/a)*a+d;return b=Math.min(e,Math.max(d,b))}
var sG=class extends WF{constructor(a,b,c,d){super(a,b);this.container=J("div");this.container.classList.add("shaka-range-container");this.container.classList.add(...c);this.u=this.h=!1;this.bar=document.createElement("input");this.G=new H(()=>{this.onChangeEnd();this.h=!1});this.bar.classList.add("shaka-range-element");this.bar.classList.add(...d);this.bar.type="range";this.bar.step="any";this.bar.min="0";this.bar.max="1";this.bar.value="0";this.bar.disabled=!this.controls.Ba();this.container.appendChild(this.bar);
this.parent.appendChild(this.container);this.L=new H(()=>{this.bar.disabled=!1});this.eventManager.o(this.controls,"showingui",()=>{this.L.Z(0)});this.eventManager.o(this.controls,"hidingui",()=>{this.L.stop();this.bar.disabled=!0});this.eventManager.o(this.bar,"mousedown",e=>{this.bar.disabled||(e.preventDefault(),this.bar.focus(),this.u=this.h=!0,pG(this,e),this.onChangeStart(),this.onChange(),e.stopPropagation())});this.eventManager.o(document,"mousemove",e=>{this.u&&(pG(this,e),this.onChange())});
this.eventManager.o(document,"mouseup",e=>{this.u&&(this.u=!1,this.h&&(this.h=!1,pG(this,e),this.onChangeEnd()))});this.eventManager.o(this.bar,"touchstart",e=>{this.bar.disabled||(this.h=!0,rG(this,e),this.onChangeStart(),e.stopPropagation())});this.eventManager.o(this.bar,"input",()=>{this.onChange()});this.eventManager.o(this.bar,"touchmove",e=>{this.h&&(rG(this,e),this.onChange(),e.stopPropagation())});this.eventManager.o(this.bar,"touchend",e=>{this.h&&(this.h=!1,rG(this,e),this.onChangeEnd(),
e.stopPropagation())});this.eventManager.o(this.bar,"touchcancel",e=>{this.h&&(this.h=!1,rG(this,e),this.onChangeEnd(),e.stopPropagation())});this.eventManager.o(this.bar,"mouseup",e=>{this.h&&(this.u=this.h=!1,pG(this,e),this.onChangeEnd(),e.stopPropagation())});this.eventManager.o(this.bar,"blur",()=>{this.h&&(this.u=this.h=!1,this.onChangeEnd())});this.eventManager.o(this.bar,"contextmenu",e=>{e.preventDefault();e.stopPropagation()})}release(){this.G&&(this.G.stop(),this.G=null);super.release()}setRange(a,
b){this.bar.min=a;this.bar.max=b}onChangeStart(){}onChange(){}onChangeEnd(){}changeTo(a){this.h||(this.h=!0,this.onChangeStart());const b=parseFloat(this.bar.min),c=parseFloat(this.bar.max);this.bar.value=a>c?c:a<b?b:a;this.onChange();this.G.Z(.5)}getValue(){return parseFloat(this.bar.value)}setValue(a){this.h||(this.bar.value=a)}};x("shaka.ui.RangeElement",sG);sG.prototype.setValue=sG.prototype.setValue;sG.prototype.getValue=sG.prototype.getValue;sG.prototype.changeTo=sG.prototype.changeTo;
sG.prototype.onChangeEnd=sG.prototype.onChangeEnd;sG.prototype.onChange=sG.prototype.onChange;sG.prototype.onChangeStart=sG.prototype.onChangeStart;sG.prototype.setRange=sG.prototype.setRange;function tG(a){if(a.m.length){var b=a.player.va(),c=b.end-b.start,d=["to right"],e=[],f=a.I.seekBarColors.adBreaks,g=!1;for(const h of a.m)if(h.start==-1&&!h.end)g=!0;else if(!h.end&&h.start>=b.start||typeof h.end=="number"&&h.end>b.start){const k=(Math.max(h.start,b.start)-b.start)/c||0;let l=k+.01;h.end&&(l=(h.end-b.start)/c||0);e.push({start:k,end:l})}e=e.sort((h,k)=>h.start-k.start);for(const h of e)d.push("transparent "+h.start*100+"%"),d.push(f+" "+h.start*100+"%"),d.push(f+" "+h.end*100+"%"),
d.push("transparent "+h.end*100+"%");g&&(d.push("transparent 99%"),d.push(f+" 99%"));a.F.style.background="linear-gradient("+d.join(",")+")"}else a.F.style.background="transparent",a.D.stop()}function uG(a){a.i.style.visibility="hidden"}function vG(a){a.bar.ariaLabel=a.localization.resolve("SEEK")}function wG(a){var b=a.player.va();b=b.end-b.start;return a.player.U()&&(b<5||!isFinite(b))?!1:a.ad==null||!a.ad.isLinear()}
function xG(a){const b=()=>{tG(a);var c=a.player.va();c=c.end-c.start;a.player.U()&&c>5&&a.D.wa(.25)};b();a.player.ig()||a.eventManager.sa(a.player,"loaded",b)}function yG(a){a.j.style.visibility="hidden"}
async function zG(a,b,c){c<0&&(c=0);var d=!1;a.m.length&&(d=a.m.some(h=>h.end?c>=h.start&&c<=h.end:!1));if(d)uG(a),AG(a,b,c);else{var e=a.player.va();d=Math.max(Math.ceil(e.start),Math.min(Math.floor(e.end),c));a.player.U()?(e=e.end-c,a.H.textContent=e<1?a.localization.resolve("LIVE"):"-"+bG(e,e>=3600)):a.H.textContent=bG(c,c>=3600);e=a.i.clientWidth;var f=Math.floor(e*9/16);a.i.style.height=f+"px";a.i.style.top=-(f- -10)+"px";a.i.style.left=Math.min(a.bar.offsetWidth-e,Math.max(0,b-e/2))+"px";if((d=
await a.player.ph(null,d))&&d.uris&&d.uris.length){d.width<d.height?a.i.classList.add("portrait-thumbnail"):a.i.classList.remove("portrait-thumbnail");a.i.style.visibility="visible";var g=d.uris[0].split("#xywh=")[0];if(!a.A||g!==a.A.uris[0].split("#xywh=")[0]||d.startByte!=a.A.startByte||d.endByte!=a.A.endByte){a.A=d;a.l&&(a.l.abort(),a.l=null);if(d.codecs=="mjpg"||g.startsWith("offline:")){a.g.src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"/>';try{const h=$l(d.uris,d.startByte,d.endByte,
a.player.getConfiguration().streaming.retryParameters);a.l=a.player.Eb().request(zg,h,{type:1});const k=await a.l.promise;a.l=null;d.codecs=="mjpg"?(new Ug).box("mdat",Rg(l=>{g=URL.createObjectURL(new Blob([l],{type:"image/jpeg"}))},!0)).parse(k.data,!1):g=URL.createObjectURL(new Blob([k.data],{type:d.mimeType||"image/jpeg"}))}catch(h){if(h.code==7001)return;throw h;}}try{a.i.removeChild(a.g)}catch(h){}a.g=J("img");a.g.id="shaka-player-ui-thumbnail-image";a.g.draggable=!1;a.g.src=g;a.g.onload=()=>
{g.startsWith("blob:")&&URL.revokeObjectURL(g)};a.i.insertBefore(a.g,a.i.firstChild)}b=e/d.width;d.imageHeight?a.g.height=d.imageHeight:d.sprite||(a.g.style.height="100%",a.g.style.objectFit="contain");d.imageWidth?a.g.width=d.imageWidth:d.sprite||(a.g.style.width="100%",a.g.style.objectFit="contain");a.g.style.left="-"+b*d.positionX+"px";a.g.style.top="-"+b*d.positionY+"px";a.g.style.transform="scale("+b+")";a.g.style.transformOrigin="left top";f=Math.floor(e*d.height/d.width);a.i.style.height=f+
"px";a.i.style.top=-(f- -10)+"px"}else uG(a),AG(a,b,c)}}function AG(a,b,c){const d=a.j.clientWidth;a.j.style.width="auto";a.j.style.height="20px";a.j.style.top="-30px";a.j.style.left=Math.min(a.bar.offsetWidth-d,Math.max(0,b-d/2))+"px";a.j.style.right="";a.j.style.visibility="visible";b=a.player.va();a.player.U()?(c=b.end-c,c<1?(a.j.textContent=a.localization.resolve("LIVE"),a.j.style.left="",a.j.style.right="0px"):a.j.textContent="-"+bG(c,c>=3600)):(c-=b.start,a.j.textContent=bG(c,c>=3600))}
var BG=class extends sG{constructor(a,b){super(a,b,["shaka-seek-bar-container"],["shaka-seek-bar","shaka-no-propagation","shaka-show-controls-on-mouse-over"]);this.F=J("div");this.F.classList.add("shaka-ad-markers");this.container.insertBefore(this.F,this.container.childNodes[0]);this.I=this.controls.g;this.C=new H(()=>{let c=this.getValue();this.player.U()||c==this.video.duration&&(c-=.001);this.video.currentTime=c});this.D=new H(()=>{tG(this)});this.M=!1;this.i=J("div");this.i.id="shaka-player-ui-thumbnail-container";
this.g=J("img");this.g.id="shaka-player-ui-thumbnail-image";this.g.draggable=!1;this.K=J("div");this.K.id="shaka-player-ui-thumbnail-time-container";this.H=J("div");this.H.id="shaka-player-ui-thumbnail-time";this.K.appendChild(this.H);this.i.appendChild(this.g);this.i.appendChild(this.K);this.container.appendChild(this.i);this.j=J("div");this.j.id="shaka-player-ui-time-container";this.container.appendChild(this.j);this.l=this.A=null;this.J=!1;this.B=new H(()=>{uG(this)});this.m=[];this.eventManager.o(this.bar,
"input",()=>{this.controls.yc()});this.eventManager.o(this.localization,"locale-updated",()=>vG(this));this.eventManager.o(this.localization,"locale-changed",()=>vG(this));this.eventManager.o(this.adManager,"ad-started",()=>{wG(this)||Y(this.container,!1)});this.eventManager.o(this.adManager,"ad-stopped",()=>{wG(this)&&Y(this.container,!0)});this.eventManager.o(this.adManager,"ad-cue-points-changed",c=>{this.m=c.cuepoints;xG(this)});this.eventManager.o(this.player,"unloading",()=>{this.m=[];xG(this);
this.l&&(this.l.abort(),this.l=null);this.A=null;uG(this);yG(this)});this.eventManager.o(this.bar,"mousemove",c=>{if(this.controls.nc())yG(this),uG(this);else{var d=qG(this,c.clientX),e=this.bar.getBoundingClientRect();c=Math.max(0,c.clientX-e.left);this.player.Yf().length?(yG(this),zG(this,c,d)):(uG(this),AG(this,c,d))}});this.eventManager.o(this.container,"mouseleave",()=>{yG(this);this.B.stop();this.B.Z(.25)});this.setValue(this.video.currentTime);this.update();vG(this);this.ad&&Y(this.container,
!1)}release(){this.C&&(this.C.stop(),this.C=null,this.D.stop(),this.D=null);super.release()}onChangeStart(){this.M=!this.video.paused;this.controls.Jg(!0);this.video.pause();this.B.stop();this.J=!0}onChange(){if(this.video.duration)if(this.update(),this.C.Z(.125),this.player.Yf().length&&!this.controls.nc()){const a=parseFloat(this.bar.min),b=parseFloat(this.bar.max),c=this.bar.getBoundingClientRect(),d=Math.round(this.getValue());zG(this,(d-a)/((b-a)/c.width),d)}else uG(this)}onChangeEnd(){this.C.Ia();
this.controls.Jg(!1);this.M&&this.video.play();this.J&&(this.J=!1,this.B.stop(),this.B.Z(.25))}isShowing(){return!this.container.classList.contains("shaka-hidden")}update(){const a=this.I.seekBarColors;var b=this.getValue(),c=this.video.buffered.length,d=c?this.video.buffered.start(0):0,e=c?this.video.buffered.end(c-1):0;c=this.player.va();const f=c.end-c.start;this.setRange(c.start,c.end);wG(this)?(Y(this.container,!0),d=(Math.max(d,c.start)-c.start)/f||0,e=(Math.min(e,c.end)-c.start)/f||0,b=(Math.min(Math.max(b,
c.start),c.end)-c.start)/f||0,this.container.style.background="linear-gradient("+["to right",(this.I.showUnbufferedStart?a.base:a.played)+" "+d*100+"%",a.played+" "+d*100+"%",a.played+" "+b*100+"%",a.buffered+" "+b*100+"%",a.buffered+" "+e*100+"%",a.base+" "+e*100+"%"].join()+")"):Y(this.container,!1)}};x("shaka.ui.SeekBar",BG);var CG=class{create(a,b){return new BG(a,b)}};BG.Factory=CG;function DG(a){a.g.textContent=a.localization.resolve("SKIP_AD")}function EG(a){a.ad.isSkippable()&&a.ad.needsSkipUI()&&(Y(a.g,!0),Y(a.h,!0),a.h.textContent="",a.i.Ia(),a.i.wa(.5))}function FG(a){a.i.stop();a.g.disabled=!0;Y(a.g,!1);Y(a.h,!1)}
var GG=class extends WF{constructor(a,b){super(a,b);this.j=J("div");this.j.classList.add("shaka-skip-ad-container");this.parent.appendChild(this.j);this.h=J("div");this.h.classList.add("shaka-skip-ad-counter");Y(this.h,!1);this.j.appendChild(this.h);this.g=bj();this.g.classList.add("shaka-skip-ad-button");this.g.disabled=!0;Y(this.g,!1);this.g.classList.add("shaka-no-propagation");this.j.appendChild(this.g);DG(this);this.i=new H(()=>{if(this.ad.isSkippable()){const c=Math.round(this.ad.getTimeUntilSkippable());
c>0?this.h.textContent=c:(this.i.stop(),Y(this.h,!1))}else FG(this)});this.eventManager.o(this.localization,"locale-updated",()=>{DG(this)});this.eventManager.o(this.localization,"locale-changed",()=>{DG(this)});this.eventManager.o(this.adManager,"ad-started",()=>{EG(this)});this.eventManager.o(this.adManager,"ad-skip-state-changed",()=>{this.ad.isSkippable()?this.ad.canSkipNow()&&(this.g.disabled=!1,this.i.stop(),Y(this.h,!1)):FG(this)});this.eventManager.o(this.adManager,"ad-stopped",()=>{FG(this)});
this.eventManager.o(this.g,"click",()=>{this.ad.skip()});this.ad&&EG(this)}release(){this.i.stop();this.i=null;super.release()}};x("shaka.ui.SkipAdButton",GG);/*
 @license
 glMatrix: https://github.com/toji/gl-matrix/
 Copyright 2015-2021, Brandon Jones, Colin MacKenzie IV
 SPDX-License-Identifier: MIT
*/
function HG(){const a=new Float32Array(16);a[0]=1;a[5]=1;a[10]=1;a[15]=1;return a}function IG(a,b,c){b=1/Math.tan(b/2);a[0]=b/c;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=b;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[11]=-1;a[12]=0;a[13]=0;a[15]=0;c=1/-99.9;a[10]=100.1*c;a[14]=20*c}
function JG(a,b,c){const d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],k=b[5],l=b[6],m=b[7],n=b[8],p=b[9],r=b[10],q=b[11],t=b[12],u=b[13],v=b[14];b=b[15];let y=c[0],w=c[1],z=c[2],A=c[3];a[0]=y*d+w*h+z*n+A*t;a[1]=y*e+w*k+z*p+A*u;a[2]=y*f+w*l+z*r+A*v;a[3]=y*g+w*m+z*q+A*b;y=c[4];w=c[5];z=c[6];A=c[7];a[4]=y*d+w*h+z*n+A*t;a[5]=y*e+w*k+z*p+A*u;a[6]=y*f+w*l+z*r+A*v;a[7]=y*g+w*m+z*q+A*b;y=c[8];w=c[9];z=c[10];A=c[11];a[8]=y*d+w*h+z*n+A*t;a[9]=y*e+w*k+z*p+A*u;a[10]=y*f+w*l+z*r+A*v;a[11]=y*g+w*m+z*q+A*b;y=c[12];w=c[13];
z=c[14];A=c[15];a[12]=y*d+w*h+z*n+A*t;a[13]=y*e+w*k+z*p+A*u;a[14]=y*f+w*l+z*r+A*v;a[15]=y*g+w*m+z*q+A*b}
function KG(a,b){var c=new Float32Array(3),d=b[0],e=b[1],f=b[2],g=b[4],h=b[5],k=b[6],l=b[8],m=b[9];const n=b[10];c[0]=Math.sqrt(d*d+e*e+f*f);c[1]=Math.sqrt(g*g+h*h+k*k);c[2]=Math.sqrt(l*l+m*m+n*n);k=1/c[0];l=1/c[1];m=1/c[2];g=b[0]*k;c=b[1]*l;d=b[2]*m;e=b[4]*k;h=b[5]*l;f=b[6]*m;k*=b[8];l*=b[9];b=b[10]*m;m=g+h+b;m>0?(b=Math.sqrt(m+1)*2,a[3]=.25*b,a[0]=(f-l)/b,a[1]=(k-d)/b,a[2]=(c-e)/b):g>h&&g>b?(b=Math.sqrt(1+g-h-b)*2,a[3]=(f-l)/b,a[0]=.25*b,a[1]=(c+e)/b,a[2]=(k+d)/b):h>b?(b=Math.sqrt(1+h-g-b)*2,a[3]=
(k-d)/b,a[0]=(c+e)/b,a[1]=.25*b,a[2]=(f+l)/b):(b=Math.sqrt(1+b-g-h)*2,a[3]=(c-e)/b,a[0]=(k+d)/b,a[1]=(f+l)/b,a[2]=.25*b)}function LG(a,b){var c=b[0],d=b[1],e=b[2];b=b[3];var f=c+c,g=d+d;const h=e+e;c*=f;const k=d*f;d*=g;const l=e*f,m=e*g;e*=h;f*=b;g*=b;b*=h;a[0]=1-d-e;a[1]=k+b;a[2]=l-g;a[3]=0;a[4]=k-b;a[5]=1-c-e;a[6]=m+f;a[7]=0;a[8]=l+g;a[9]=m-f;a[10]=1-c-d;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1};function MG(){const a=new Float32Array(4);a[3]=1;return a}function NG(a,b){const c=b[0],d=b[1],e=b[2];b=b[3];let f=c*c+d*d+e*e+b*b;f>0&&(f=1/Math.sqrt(f));a[0]=c*f;a[1]=d*f;a[2]=e*f;a[3]=b*f};function OG(a=!1){const b=[],c=[],d=[];var e=Math.PI;a=a?e/2:e;for(var f=0;f<=100;f++){var g=f*e/100,h=Math.sin(g);g=Math.cos(g);for(let k=0;k<=100;k++){const l=k*2*a/100;b.push(Math.sin(l)*h,g,Math.cos(l)*h);c.push(k/100,f/100)}}for(e=0;e<100;e++)for(a=0;a<100;a++)f=e*101+a,h=f+100+1,d.push(f,h,f+1),d.push(h,h+1,f+1);return{ai:b,Wh:c,indices:d}};function PG(a){QG(a);RG(a);SG(a);TG(a);UG(a);Xk(a.i,HTMLMediaElement.HAVE_CURRENT_DATA,a.A,()=>{a.i.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA&&VG(a);if("requestVideoFrameCallback"in a.i){const b=()=>{a.F!=-1&&(VG(a),a.F!=-1&&(a.F=a.i.requestVideoFrameCallback(b)))};a.F=a.i.requestVideoFrameCallback(b)}else{let b;a.A.o(a.i,"canplaythrough",()=>{VG(a)});a.A.o(a.i,"playing",()=>{a.B&&a.B.stop();if(!b){var c=a.ma.zb();for(const d of c)(c=d.frameRate)&&(!b||b<c)&&(b=c)}b||=60;VG(a);a.B=(new H(()=>
{VG(a)})).Ia().wa(1/b)});a.A.o(a.i,"pause",()=>{a.B&&a.B.stop();a.B=null;VG(a)});a.A.o(a.i,"seeked",()=>{VG(a)});a.A.o(document,"visibilitychange",()=>{VG(a)})}})}
function VG(a,b=!0){const c=a.ma.bc()==fq;if(!(!a.i||a.i.readyState<2||!c&&a.i.playbackRate==0)){IG(a.I,a.j*Math.PI/180,1.5625);a.m=="cubemap"?IG(a.I,a.j*Math.PI/180,2.5):IG(a.I,a.j*Math.PI/180,1.5625);a.g.useProgram(a.l);a.g.clear(a.g.COLOR_BUFFER_BIT);WG(a);b&&(a.g.activeTexture(a.g.TEXTURE0),a.g.bindTexture(a.g.TEXTURE_2D,a.W),a.g.pixelStorei(a.g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),a.g.texImage2D(a.g.TEXTURE_2D,0,a.g.RGBA,a.g.RGBA,a.g.UNSIGNED_BYTE,a.i));if(a.m=="equirectangular"||a.m=="halfequirectangular")JG(a.M,
a.D,a.V),JG(a.M,a.I,a.M);a.g.bindBuffer(a.g.ARRAY_BUFFER,a.X);a.g.vertexAttribPointer(a.R,3,a.g.FLOAT,!1,0,0);a.g.enableVertexAttribArray(a.R);a.g.bindBuffer(a.g.ARRAY_BUFFER,a.ea);a.g.vertexAttribPointer(a.P,2,a.g.FLOAT,!1,0,0);a.g.enableVertexAttribArray(a.P);a.g.bindBuffer(a.g.ELEMENT_ARRAY_BUFFER,a.$);a.m=="cubemap"?(a.g.uniformMatrix4fv(a.g.getUniformLocation(a.l,"uProjectionMatrix"),!1,a.I),a.g.uniformMatrix4fv(a.g.getUniformLocation(a.l,"uModelViewMatrix"),!1,a.M)):a.g.uniformMatrix4fv(a.g.getUniformLocation(a.l,
"u_VPMatrix"),!1,a.M);a.g.uniform1i(a.g.getUniformLocation(a.l,"uSampler"),0);a.O&&a.g.viewport(0,0,a.u.width/2,a.u.height);a.g.drawElements(a.g.TRIANGLES,a.K.indices.length,a.g.UNSIGNED_SHORT,0);a.O&&(a.g.viewport(a.u.width/2,0,a.u.width/2,a.u.height),a.g.drawElements(a.g.TRIANGLES,a.K.indices.length,a.g.UNSIGNED_SHORT,0))}}
function QG(a){{var b=a.D,c=[0,0,0],d=[1,0,0],e=[0,1,0];let p,r;let q;var f=c[0],g=c[1];c=c[2];var h=e[0];var k=e[1];var l=e[2];var m=d[0];e=d[1];var n=d[2];if(Math.abs(f-m)<1E-6&&Math.abs(g-e)<1E-6&&Math.abs(c-n)<1E-6)for(f=0;f<16;f++)b[f]=f%5==0?1:0;else d=f-m,e=g-e,m=c-n,q=1/Math.sqrt(d*d+e*e+m*m),d*=q,e*=q,m*=q,n=k*m-l*e,l=l*d-h*m,h=h*e-k*d,(q=Math.sqrt(n*n+l*l+h*h))?(q=1/q,n*=q,l*=q,h*=q):h=l=n=0,k=e*h-m*l,p=m*n-d*h,r=d*l-e*n,(q=Math.sqrt(k*k+p*p+r*r))?(q=1/q,k*=q,p*=q,r*=q):r=p=k=0,b[0]=n,b[1]=
k,b[2]=d,b[3]=0,b[4]=l,b[5]=p,b[6]=e,b[7]=0,b[8]=h,b[9]=r,b[10]=m,b[11]=0,b[12]=-(n*f+l*g+h*c),b[13]=-(k*f+p*g+r*c),b[14]=-(d*f+e*g+m*c),b[15]=1}KG(a.L,a.D);a=b=a.V;c=[4,4,4];f=c[0];g=c[1];c=c[2];b[0]=a[0]*f;b[1]=a[1]*f;b[2]=a[2]*f;b[3]=a[3]*f;b[4]=a[4]*g;b[5]=a[5]*g;b[6]=a[6]*g;b[7]=a[7]*g;b[8]=a[8]*c;b[9]=a[9]*c;b[10]=a[10]*c;b[11]=a[11]*c;b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15]}
function RG(a){WG(a);a.g.viewport(0,0,a.g.drawingBufferWidth,a.g.drawingBufferHeight);a.g.clearColor(0,0,0,1);a.g.enable(a.g.CULL_FACE);a.g.cullFace(a.g.FRONT);a.g.clear(a.g.COLOR_BUFFER_BIT)}
function SG(a){const b=XG(a,a.g.VERTEX_SHADER),c=XG(a,a.g.FRAGMENT_SHADER);a.l=a.g.createProgram();a.g.attachShader(a.l,b);a.g.attachShader(a.l,c);a.g.linkProgram(a.l);a.m=="cubemap"?(a.R=a.g.getAttribLocation(a.l,"aVertexPosition"),a.P=a.g.getAttribLocation(a.l,"aTextureCoord")):(a.R=a.g.getAttribLocation(a.l,"a_vPosition"),a.g.enableVertexAttribArray(a.R),a.P=a.g.getAttribLocation(a.l,"a_TexCoordinate"),a.g.enableVertexAttribArray(a.P))}
function TG(a){a.K=a.m=="cubemap"?{ai:[-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1],Wh:[2/3,.5,1/3,.5,1/3,0,2/3,0,2/3,.5,2/3,0,1,0,1,.5,1,1,2/3,1,2/3,.5,1,.5,0,.5,0,0,1/3,0,1/3,.5,0,.5,1/3,.5,1/3,1,0,1,1/3,1,1/3,.5,2/3,.5,2/3,1],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}:a.m=="halfequirectangular"?OG(!0):
OG();a.X=a.g.createBuffer();a.g.bindBuffer(a.g.ARRAY_BUFFER,a.X);a.g.bufferData(a.g.ARRAY_BUFFER,new Float32Array(a.K.ai),a.g.STATIC_DRAW);a.ea=a.g.createBuffer();a.g.bindBuffer(a.g.ARRAY_BUFFER,a.ea);a.g.bufferData(a.g.ARRAY_BUFFER,new Float32Array(a.K.Wh),a.g.STATIC_DRAW);a.$=a.g.createBuffer();a.g.bindBuffer(a.g.ELEMENT_ARRAY_BUFFER,a.$);a.g.bufferData(a.g.ELEMENT_ARRAY_BUFFER,new Uint16Array(a.K.indices),a.g.STATIC_DRAW)}
function UG(a){a.W=a.g.createTexture();a.g.bindTexture(a.g.TEXTURE_2D,a.W);a.g.texParameteri(a.g.TEXTURE_2D,a.g.TEXTURE_WRAP_S,a.g.CLAMP_TO_EDGE);a.g.texParameteri(a.g.TEXTURE_2D,a.g.TEXTURE_WRAP_T,a.g.CLAMP_TO_EDGE);a.g.texParameteri(a.g.TEXTURE_2D,a.g.TEXTURE_MIN_FILTER,a.g.NEAREST);a.g.texParameteri(a.g.TEXTURE_2D,a.g.TEXTURE_MAG_FILTER,a.g.NEAREST)}
function WG(a){let b=a.i.videoWidth;b||(b=a.u.scrollWidth);let c=a.i.videoHeight;c||(c=a.u.scrollHeight);if(a.oa!==b||a.na!==c){a.u.width=b;a.u.height=c;a.oa=b;a.na=c;const f=b/c;var d=a.I,e=-f;const g=1/(f-e);d[0]=0*g;d[1]=0;d[2]=0;d[3]=0;d[4]=0;d[5]=0;d[6]=0;d[7]=0;d[8]=(f+e)*g;d[9]=0;d[10]=-1;d[11]=-1;d[12]=0;d[13]=0;d[14]=-0;d[15]=0;a.I=d;a.g.viewport(0,0,b,c)}}
function XG(a,b){let c;switch(b){case a.g.VERTEX_SHADER:c=a.m=="cubemap"?"attribute vec4 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\nvarying highp vec2 vTextureCoord;\nvarying highp vec3 vLighting;\nvoid main(void) {\n  gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;\n  vTextureCoord = aTextureCoord;\n}":"attribute vec4 a_vPosition;\n// Per-vertex texture coordinate info\nattribute vec2 a_TexCoordinate;\nuniform mat4 u_VPMatrix;\n// Passed into the fragment shader.\nvarying vec2 v_TexCoordinate;\nvarying vec3 pass_position;\nvoid main()\n{\n gl_Position = u_VPMatrix * a_vPosition;\n // Pass through texture coord\n v_TexCoordinate = a_TexCoordinate;\n pass_position = a_vPosition.xyz;\n}";
break;case a.g.FRAGMENT_SHADER:c=a.m=="cubemap"?"varying highp vec2 vTextureCoord;\nuniform sampler2D uSampler;\nvoid main(void) {\n  highp vec4 texelColor = texture2D(uSampler, vTextureCoord);\n  gl_FragColor = vec4(texelColor.rgb , texelColor.a);\n}":"precision highp float;\n#define PI 3.141592653589793238462643383279\nvarying vec2 v_TexCoordinate;\nvarying vec3 pass_position;\nuniform sampler2D uSampler;\nvoid main(void) {\nhighp float xValue =\n      (PI + atan(pass_position.z, pass_position.x)) / (2.0 * PI);\n vec2 tc = vec2(xValue, v_TexCoordinate.t);\n tc = vec2(tc.x , tc.y);\nhighp vec4 texelColor =\n      texture2D(uSampler, tc);\n  gl_FragColor = vec4(texelColor.rgb, texelColor.a);\n}";
break;default:return null}b=a.g.createShader(b);a.g.shaderSource(b,c);a.g.compileShader(b);return b}
function YG(a,b,c,d){var e=Infinity,f=90*Math.PI/180;a.m=="halfequirectangular"&&(e=90*Math.PI/180,f/=2);let g;g=a.m=="cubemap"?a.M:a.D;a.G+=b;a.H+=c;if(a.G<e&&a.G>-e){e=Math.sin(b);b=Math.cos(b);var h=g[0],k=g[1],l=g[2],m=g[3],n=g[8],p=g[9],r=g[10],q=g[11];g!==g&&(g[4]=g[4],g[5]=g[5],g[6]=g[6],g[7]=g[7],g[12]=g[12],g[13]=g[13],g[14]=g[14],g[15]=g[15]);g[0]=h*b-n*e;g[1]=k*b-p*e;g[2]=l*b-r*e;g[3]=m*b-q*e;g[8]=h*e+n*b;g[9]=k*e+p*b;g[10]=l*e+r*b;g[11]=m*e+q*b}else a.G-=b;if(a.H<f&&a.H>-f){f=b=HG();e=
HG();h=-1*c;c=Math.sin(h);h=Math.cos(h);k=e[4];l=e[5];m=e[6];n=e[7];p=e[8];r=e[9];q=e[10];const t=e[11];e!==f&&(f[0]=e[0],f[1]=e[1],f[2]=e[2],f[3]=e[3],f[12]=e[12],f[13]=e[13],f[14]=e[14],f[15]=e[15]);f[4]=k*h+p*c;f[5]=l*h+r*c;f[6]=m*h+q*c;f[7]=n*h+t*c;f[8]=p*h-k*c;f[9]=r*h-l*c;f[10]=q*h-m*c;f[11]=t*h-n*c;JG(g,b,g)}else a.H-=c;c=HG();f=HG();e=Math.sin(d);d=Math.cos(d);b=f[0];h=f[1];k=f[2];l=f[3];m=f[4];n=f[5];p=f[6];r=f[7];f!==c&&(c[8]=f[8],c[9]=f[9],c[10]=f[10],c[11]=f[11],c[12]=f[12],c[13]=f[13],
c[14]=f[14],c[15]=f[15]);c[0]=b*d+m*e;c[1]=h*d+n*e;c[2]=k*d+p*e;c[3]=l*d+r*e;c[4]=m*d-b*e;c[5]=n*d-h*e;c[6]=p*d-k*e;c[7]=r*d-l*e;JG(g,c,g);VG(a,!1)}
function ZG(a,b=!0){b&&(KG(a.h,a.D),a.T=0,a.C=MG(),a.C[0]=(a.h[0]-a.L[0])/20,a.C[1]=(a.h[1]-a.L[1])/20,a.C[2]=(a.h[2]-a.L[2])/20,a.C[3]=(a.h[3]-a.L[3])/20);a.h[0]-=a.C[0];a.h[1]-=a.C[1];a.h[2]-=a.C[2];a.h[3]-=a.C[3];b=HG();NG(a.h,a.h);LG(b,a.h);a.D=b;a.J&&(a.J.stop(),a.J=null);a.T<20?a.J=(new H(()=>{ZG(a,!1);a.G=0;a.H=0;a.T++;VG(a,!1)})).Z(.025):(LG(b,a.L),a.D=b)}
var $G=class{constructor(a,b,c,d,e){this.i=a;this.ma=b;this.u=c;this.g=d;this.A=new zc;this.L=MG();this.h=MG();this.$=this.ea=this.X=this.l=null;this.D=HG();this.I=HG();this.M=HG();this.V=HG();this.C=null;this.O=!1;this.J=this.B=null;this.na=this.oa=0;this.W=this.P=this.R=this.K=null;this.H=this.G=0;this.j=75;this.T=0;this.m=e;this.F=-1;PG(this)}release(){this.F!=-1&&(this.i.cancelVideoFrameCallback(this.F),this.F=-1);this.A&&(this.A.release(),this.A=null);this.B&&(this.B.stop(),this.B=null);this.J&&
(this.J.stop(),this.J=null)}sd(){(this.O=!this.O)||this.g.viewport(0,0,this.u.width,this.u.height);VG(this,!1)}};function aH(a){if(!a||!window.WebGLRenderingContext)return null;var b=["webgl2","webgl"];for(const c of b)if(b=a.getContext(c))return b;return null}
function bH(a){var b=a.G.D.Ka();!a.D.displayInVrMode&&!a.l||b?a.j&&a.g&&(a.j.style.display="none",a.h.Na(),a.g.release(),a.g=null,a.dispatchEvent(new C("vrstatuschanged",(new Map).set("newStatus",a.Gb())))):(a.j||(a.j=document.createElement("canvas"),a.j.classList.add("shaka-vr-canvas-container"),a.F.parentElement.insertBefore(a.j,a.F.nextElementSibling),a.A=aH(a.j)),b=a.l||a.D.defaultVrProjectionMode,a.g)?a.g.m!=b&&(a.h.Na(),a.g.release(),cH(a,b)):(a.j.style.display="",cH(a,b),a.dispatchEvent(new C("vrstatuschanged",
(new Map).set("newStatus",a.Gb()))))}function cH(a,b){a.A&&a.j&&(a.g=new $G(a.F,a.K,a.j,a.A,b),dH(a))}
function dH(a){a.h.o(a.i,"mousedown",c=>{if(!a.m){var d=c.clientX;c=c.clientY;a.m=!0;a.B=d;a.C=c}});navigator.maxTouchPoints>0&&a.h.o(a.i,"touchstart",c=>{if(!a.m){var d=c.touches[0].clientX;c=c.touches[0].clientY;a.m=!0;a.B=d;a.C=c}});a.h.o(a.i,"wheel",c=>{if(!a.m){var d=a.g,e=c.deltaY;e/=50;d.j>=20&&d.j<=100&&(d.j+=e);d.j<20?d.j=20:d.j>100&&(d.j=100);VG(d,!1);c.preventDefault();c.stopPropagation()}});a.h.o(a.i,"mousemove",c=>{a.m&&eH(a,c.clientX,c.clientY)});navigator.maxTouchPoints>0&&a.h.o(a.i,
"touchmove",c=>{a.m&&eH(a,c.touches[0].clientX,c.touches[0].clientY);c.preventDefault()});a.h.o(a.i,"mouseleave",()=>{a.m=!1});a.h.o(a.i,"mouseup",()=>{a.m=!1});navigator.maxTouchPoints>0&&a.h.o(a.i,"touchend",()=>{a.m=!1});let b=!1;if(window.DeviceOrientationEvent)if(typeof DeviceMotionEvent.requestPermission=="function"){const c=()=>{DeviceMotionEvent.requestPermission().then(d=>{d!=="granted"||b||(b=!0,fH(a))})};DeviceMotionEvent.requestPermission().then(d=>{a.h.Ea(a.i,"click",c);a.h.Ea(a.i,"mouseup",
c);navigator.maxTouchPoints>0&&a.h.Ea(a.i,"touchend",c);d!=="granted"?(a.h.sa(a.i,"click",c),a.h.sa(a.i,"mouseup",c),navigator.maxTouchPoints>0&&a.h.sa(a.i,"touchend",c)):(b=!0,fH(a))}).catch(()=>{a.h.Ea(a.i,"click",c);a.h.Ea(a.i,"mouseup",c);navigator.maxTouchPoints>0&&a.h.Ea(a.i,"touchend",c);a.h.sa(a.i,"click",c);a.h.sa(a.i,"mouseup",c);navigator.maxTouchPoints>0&&a.h.sa(a.i,"touchend",c)})}else b=!0,fH(a)}
function eH(a,b,c){const d=-.6*Math.PI/180;YG(a.g,(b-a.B)*d,(c-a.C)*-1*d,0);a.B=b;a.C=c}function fH(a){a.h.o(window,"deviceorientation",b=>{if(a.g){var c=(b.alpha||0)-a.H,d=(b.beta||0)-a.I,e=(b.gamma||0)-a.J;if(Math.abs(c)>10||Math.abs(d)>10||Math.abs(e)>5)d=e=c=0;a.H=b.alpha||0;a.I=b.beta||0;a.J=b.gamma||0;b=screen.orientation.angle;b==90||b==-90?YG(a.g,c*gH*-1,e*gH*-1,0):YG(a.g,c*gH*-1,d*gH,0)}})}
var hH=class extends Ba{constructor(a,b,c,d,e,f){super();this.i=a;this.j=b;this.F=c;this.K=d;this.D=e;this.G=f;this.u=new zc;this.h=new zc;this.A=aH(this.j);this.g=null;this.m=!1;this.J=this.I=this.H=this.C=this.B=0;this.l=null;this.u.o(d,"loading",()=>{this.g&&ZG(this.g);bH(this)});this.u.o(d,"spatialvideoinfo",g=>{g=g.detail;switch(g.projection){case "rect":this.l=null;break;case "equi":this.l="equirectangular";break;case "hequ":switch(g.hfov){case 360:this.l="equirectangular";break;case 180:this.l=
"halfequirectangular";break;default:g.hfov==null?this.l="halfequirectangular":this.l=null}break;case "fish":this.l="halfequirectangular";break;default:this.l=null}bH(this)});this.u.o(d,"nospatialvideoinfo",()=>{this.l=null;bH(this)});this.u.o(d,"unloading",()=>{this.l=null;bH(this)});this.u.o(this.G,"caststatuschanged",()=>{bH(this)});bH(this)}release(){this.u&&(this.u.release(),this.u=null);this.h&&(this.h.release(),this.h=null);this.g&&(this.g.release(),this.g=null);super.release()}configure(a){this.D=
a;bH(this)}wf(){return this.j?!!this.A:!!aH(document.createElement("canvas"))}Gb(){return!!this.g}sd(){this.g?this.g.sd():sa("Not playing VR content")}gg(a){this.g?YG(this.g,a*gH,0,0):sa("Not playing VR content")}eg(a){this.g?YG(this.g,0,a*gH,0):sa("Not playing VR content")}fg(a){this.g?YG(this.g,0,0,a*gH):sa("Not playing VR content")}},gH=Math.PI/180;function iH(){const a=new oc("en");a.Ra("ar",new Map([["AD_DURATION","\u0645\u062f\u0629 \u0627\u0644\u0625\u0639\u0644\u0627\u0646"],["AD_PROGRESS","\u0627\u0644\u0625\u0639\u0644\u0627\u0646 [AD_ON] \u0645\u0646 [NUM_ADS]"],["AD_STATISTICS","\u0625\u062d\u0635\u0627\u0621\u0627\u062a \u0627\u0644\u0625\u0639\u0644\u0627\u0646\u0627\u062a"],["AD_TIME","\u0627\u0644\u0625\u0639\u0644\u0627\u0646: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","\u062a\u0644\u0642\u0627\u0626\u064a"],["BACK","\u0631\u062c\u0648\u0639"],
["CAPTIONS","\u0627\u0644\u062a\u0631\u062c\u0645\u0629 \u0648\u0627\u0644\u0634\u0631\u062d"],["CAST","\u0625\u0631\u0633\u0627\u0644..."],["CHAPTERS","\u0627\u0644\u0641\u0635\u0648\u0644"],["DOWNLOAD_VIDEO_FRAME","\u062d\u0641\u0638 \u0625\u0637\u0627\u0631 \u0627\u0644\u0641\u064a\u062f\u064a\u0648"],["ENTER_LOOP_MODE","\u062a\u0643\u0631\u0627\u0631 \u0627\u0644\u0641\u064a\u062f\u064a\u0648 \u0627\u0644\u062d\u0627\u0644\u064a"],["ENTER_PICTURE_IN_PICTURE",'\u0627\u0644\u062f\u062e\u0648\u0644 \u0641\u064a \u0648\u0636\u0639 "\u0646\u0627\u0641\u0630\u0629 \u0636\u0645\u0646 \u0646\u0627\u0641\u0630\u0629"'],
["EXIT_FULL_SCREEN","\u0625\u0646\u0647\u0627\u0621 \u0648\u0636\u0639 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629"],["EXIT_LOOP_MODE","\u0625\u064a\u0642\u0627\u0641 \u062a\u0643\u0631\u0627\u0631 \u0627\u0644\u0641\u064a\u062f\u064a\u0648 \u0627\u0644\u062d\u0627\u0644\u064a"],["EXIT_PICTURE_IN_PICTURE",'\u0627\u0644\u062e\u0631\u0648\u062c \u0645\u0646 \u0648\u0636\u0639 "\u0646\u0627\u0641\u0630\u0629 \u0636\u0645\u0646 \u0646\u0627\u0641\u0630\u0629"'],["FAST_FORWARD","\u062a\u0642\u062f\u064a\u0645 \u0633\u0631\u064a\u0639"],
["FULL_SCREEN","\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629"],["LANGUAGE","\u0627\u0644\u0644\u063a\u0629"],["LIVE","\u0645\u0628\u0627\u0634\u0631"],["LOOP","\u062a\u0643\u0631\u0627\u0631"],["MORE_SETTINGS","\u0645\u0632\u064a\u062f \u0645\u0646 \u0627\u0644\u0625\u0639\u062f\u0627\u062f\u0627\u062a"],["MULTIPLE_LANGUAGES","\u0644\u063a\u0627\u062a \u0645\u062a\u0639\u062f\u062f\u0629"],["MUTE","\u0643\u062a\u0645 \u0627\u0644\u0635\u0648\u062a"],["NOT_APPLICABLE","\u063a\u064a\u0631 \u0633\u0627\u0631\u064d"],
["OFF","\u0625\u064a\u0642\u0627\u0641"],["ON","\u062a\u0634\u063a\u064a\u0644"],["PAUSE","\u0625\u064a\u0642\u0627\u0641 \u0645\u0624\u0642\u062a"],["PICTURE_IN_PICTURE","\u0646\u0627\u0641\u0630\u0629 \u0636\u0645\u0646 \u0627\u0644\u0646\u0627\u0641\u0630\u0629"],["PLAY","\u0627\u0644\u062a\u0634\u063a\u064a\u0644"],["PLAYBACK_RATE","\u0633\u0631\u0639\u0629 \u0627\u0644\u062a\u0634\u063a\u064a\u0644"],["QUALITY","\u0627\u0644\u062c\u0648\u062f\u0629"],["RECENTER_VR","\u0625\u0639\u0627\u062f\u0629 \u0627\u0644\u062a\u0648\u0633\u064a\u0637"],
["REPLAY","\u0625\u0639\u0627\u062f\u0629 \u0627\u0644\u062a\u0634\u063a\u064a\u0644"],["RESOLUTION","\u062f\u0631\u062c\u0629 \u0627\u0644\u062f\u0642\u0629"],["REWIND","\u062a\u0631\u062c\u064a\u0639"],["SEEK","\u0627\u0644\u0628\u062d\u062b \u0628\u0627\u0644\u062a\u0645\u0631\u064a\u0631"],["SKIP_AD","\u062a\u062e\u0637\u0651\u064a \u0627\u0644\u0625\u0639\u0644\u0627\u0646"],["SKIP_TO_LIVE","\u0627\u0644\u0627\u0646\u062a\u0642\u0627\u0644 \u0625\u0644\u0649 \u0628\u062b \u0645\u0628\u0627\u0634\u0631"],
["STATISTICS","\u0627\u0644\u0625\u062d\u0635\u0627\u0621\u0627\u062a"],["SUBTITLE_FORCED","\u0639\u0631\u0636 \u0625\u062c\u0628\u0627\u0631\u064a"],["SURROUND","\u0635\u0648\u062a \u0645\u062d\u064a\u0637\u064a"],["TOGGLE_STEREOSCOPIC","\u0625\u064a\u0642\u0627\u0641 \u0627\u0644\u0639\u0631\u0636 \u0627\u0644\u0645\u062c\u0633\u0651\u0645 \u0623\u0648 \u062a\u0641\u0639\u064a\u0644\u0647"],["UNDETERMINED_LANGUAGE","\u063a\u064a\u0631 \u0645\u062d\u062f\u062f"],["UNMUTE","\u0625\u0639\u0627\u062f\u0629 \u0627\u0644\u0635\u0648\u062a"],
["UNRECOGNIZED_LANGUAGE","\u063a\u064a\u0631 \u0645\u0639\u0631\u0648\u0641"],["VOLUME","\u0645\u0633\u062a\u0648\u0649 \u0627\u0644\u0635\u0648\u062a"]]));a.Ra("de",new Map([["AD_DURATION","Dauer der Werbeanzeige"],["AD_PROGRESS","Werbung\u00a0[AD_ON] von\u00a0[NUM_ADS]"],["AD_STATISTICS","Anzeigenstatistiken"],["AD_TIME","Werbeanzeige: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Automatisch"],["BACK","Zur\u00fcck"],["CAPTIONS","Untertitel"],["CAST","Streamen..."],["CHAPTERS","Kapitel"],["DOWNLOAD_VIDEO_FRAME",
"Videoframe speichern"],["ENTER_LOOP_MODE","In Endlosschleife spielen"],["ENTER_PICTURE_IN_PICTURE","Bild im Bild aktivieren"],["EXIT_FULL_SCREEN","Vollbildmodus beenden"],["EXIT_LOOP_MODE","Endlosschleife stoppen"],["EXIT_PICTURE_IN_PICTURE","Bild im Bild beenden"],["FAST_FORWARD","Vorspulen"],["FULL_SCREEN","Vollbildmodus"],["LANGUAGE","Sprache"],["LIVE","Live"],["LOOP","Schleife"],["MORE_SETTINGS","Weitere Einstellungen"],["MULTIPLE_LANGUAGES","Mehrere Sprachen"],["MUTE","Stummschalten"],["NOT_APPLICABLE",
"Nicht zutreffend"],["OFF","Aus"],["ON","Ein"],["PAUSE","Pause"],["PICTURE_IN_PICTURE","Bild im Bild"],["PLAY","Wiedergabe"],["PLAYBACK_RATE","Geschwindigkeit"],["QUALITY","Qualit\u00e4t"],["RECENTER_VR","Zentrieren"],["REPLAY","Noch einmal wiedergeben"],["RESOLUTION","Aufl\u00f6sung"],["REWIND","Zur\u00fcckspulen"],["SEEK","Suche"],["SKIP_AD","\u00dcberspringen"],["SKIP_TO_LIVE","Zum Live-Videostream wechseln"],["STATISTICS","Statistiken"],["SUBTITLE_FORCED","Erzwungen"],["SURROUND","Surround"],
["TOGGLE_STEREOSCOPIC","Einstellung \u201estereoskopisch\u201c ein\u2011/ausschalten"],["UNDETERMINED_LANGUAGE","Unbestimmt"],["UNMUTE","Stummschaltung aufheben"],["UNRECOGNIZED_LANGUAGE","Unbekannt"],["VOLUME","Lautst\u00e4rke"]]));a.Ra("en",new Map([["AD_DURATION","Ad duration"],["AD_PROGRESS","Ad [AD_ON] of [NUM_ADS]"],["AD_STATISTICS","Ad statistics"],["AD_TIME","Ad: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Auto"],["BACK","Back"],["CAPTIONS","Captions"],["CAST","Cast..."],["CHAPTERS",
"Chapters"],["DOWNLOAD_VIDEO_FRAME","Save video frame"],["ENTER_LOOP_MODE","Loop the current video"],["ENTER_PICTURE_IN_PICTURE","Enter Picture-in-Picture"],["EXIT_FULL_SCREEN","Exit full screen"],["EXIT_LOOP_MODE","Stop looping the current video"],["EXIT_PICTURE_IN_PICTURE","Exit Picture-in-Picture"],["FAST_FORWARD","Fast-forward"],["FULL_SCREEN","Full screen"],["LANGUAGE","Language"],["LIVE","Live"],["LOOP","Loop"],["MORE_SETTINGS","More settings"],["MULTIPLE_LANGUAGES","Multiple languages"],["MUTE",
"Mute"],["NOT_APPLICABLE","Not applicable"],["OFF","Off"],["ON","On"],["PAUSE","Pause"],["PICTURE_IN_PICTURE","Picture-in-Picture"],["PLAY","Play"],["PLAYBACK_RATE","Playback speed"],["QUALITY","Quality"],["RECENTER_VR","Recenter"],["REPLAY","Replay"],["RESOLUTION","Resolution"],["REWIND","Rewind"],["SEEK","Seek"],["SKIP_AD","Skip Ad"],["SKIP_NEXT","Next"],["SKIP_PREVIOUS","Previous"],["SKIP_TO_LIVE","Skip ahead to live"],["STATISTICS","Statistics"],["SUBTITLE_FORCED","Forced"],["SURROUND","Surround"],
["TOGGLE_STEREOSCOPIC","Toggle stereoscopic"],["UNDETERMINED_LANGUAGE","Undetermined"],["UNMUTE","Unmute"],["UNRECOGNIZED_LANGUAGE","Unrecognized"],["VOLUME","Volume"]]));a.Ra("en-GB",new Map([["AD_DURATION","Ad duration"],["AD_PROGRESS","Ad [AD_ON] of [NUM_ADS]"],["AD_STATISTICS","Ad statistics"],["AD_TIME","Ad: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Auto"],["BACK","Back"],["CAPTIONS","Captions"],["CAST","Cast..."],["CHAPTERS","Chapters"],["DOWNLOAD_VIDEO_FRAME","Save video frame"],["ENTER_LOOP_MODE",
"Loop the current video"],["ENTER_PICTURE_IN_PICTURE","Enter picture-in-picture"],["EXIT_FULL_SCREEN","Exit full screen"],["EXIT_LOOP_MODE","Stop looping the current video"],["EXIT_PICTURE_IN_PICTURE","Exit picture-in-picture"],["FAST_FORWARD","Fast-forward"],["FULL_SCREEN","Full screen"],["LANGUAGE","Language"],["LIVE","Live"],["LOOP","Loop"],["MORE_SETTINGS","More settings"],["MULTIPLE_LANGUAGES","Multiple languages"],["MUTE","Mute"],["NOT_APPLICABLE","Not applicable"],["OFF","Off"],["ON","On"],
["PAUSE","Pause"],["PICTURE_IN_PICTURE","Picture-in-picture"],["PLAY","Play"],["PLAYBACK_RATE","Playback speed"],["QUALITY","Quality"],["RECENTER_VR","Recentre"],["REPLAY","Replay"],["RESOLUTION","Resolution"],["REWIND","Rewind"],["SEEK","Seek"],["SKIP_AD","Skip ad"],["SKIP_TO_LIVE","Skip ahead to live"],["STATISTICS","Statistics"],["SUBTITLE_FORCED","Forced"],["SURROUND","Surround"],["TOGGLE_STEREOSCOPIC","Toggle stereoscopic"],["UNDETERMINED_LANGUAGE","Undetermined"],["UNMUTE","Unmute"],["UNRECOGNIZED_LANGUAGE",
"Unrecognised"],["VOLUME","volume"]]));a.Ra("es",new Map([["AD_DURATION","Duraci\u00f3n del anuncio"],["AD_PROGRESS","Anuncio [AD_ON] de [NUM_ADS]"],["AD_STATISTICS","Estad\u00edsticas del anuncio"],["AD_TIME","Anuncio: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Autom\u00e1tico"],["BACK","Atr\u00e1s"],["CAPTIONS","Subt\u00edtulos"],["CAST","Enviar..."],["CHAPTERS","Cap\u00edtulos"],["DOWNLOAD_VIDEO_FRAME","Guardar fotograma"],["ENTER_LOOP_MODE","Reproducir en bucle el v\u00eddeo actual"],
["ENTER_PICTURE_IN_PICTURE","Activar el modo imagen en imagen"],["EXIT_FULL_SCREEN","Salir del modo de pantalla completa"],["EXIT_LOOP_MODE","Dejar de reproducir en bucle el v\u00eddeo actual"],["EXIT_PICTURE_IN_PICTURE","Salir del modo imagen en imagen"],["FAST_FORWARD","Avanzar r\u00e1pidamente"],["FULL_SCREEN","Pantalla completa"],["LANGUAGE","Idioma"],["LIVE","En directo"],["LOOP","Reproducir en bucle"],["MORE_SETTINGS","M\u00e1s ajustes"],["MULTIPLE_LANGUAGES","Varios idiomas"],["MUTE","Silenciar"],
["NOT_APPLICABLE","No aplicable"],["OFF","Desactivado"],["ON","Activado"],["PAUSE","Pausar"],["PICTURE_IN_PICTURE","Imagen en imagen"],["PLAY","Reproducir"],["PLAYBACK_RATE","Velocidad de reproducci\u00f3n"],["QUALITY","Calidad"],["RECENTER_VR","Volver a centrar"],["REPLAY","Volver a reproducir"],["RESOLUTION","Resoluci\u00f3n"],["REWIND","Rebobinar"],["SEEK","Buscar"],["SKIP_AD","Saltar anuncio"],["SKIP_NEXT","Siguiente"],["SKIP_PREVIOUS","Anterior"],["SKIP_TO_LIVE","Ir al v\u00eddeo en directo"],
["STATISTICS","Estad\u00edsticas"],["SUBTITLE_FORCED","Forzado"],["SURROUND","Envolvente"],["TOGGLE_STEREOSCOPIC","Activar/Desactivar estereosc\u00f3pica"],["UNDETERMINED_LANGUAGE","Sin especificar"],["UNMUTE","Activar sonido"],["UNRECOGNIZED_LANGUAGE","No reconocida"],["VOLUME","Volumen"]]));a.Ra("es-419",new Map([["AD_DURATION","Duraci\u00f3n del anuncio"],["AD_PROGRESS","Anuncio [AD_ON] de [NUM_ADS]"],["AD_STATISTICS","Estad\u00edsticas de anuncios"],["AD_TIME","Anuncio: [AD_TIME]"],["AIRPLAY",
"AirPlay"],["AUTO_QUALITY","Autom\u00e1tico"],["BACK","Atr\u00e1s"],["CAPTIONS","Subt\u00edtulos"],["CAST","Transmitir..."],["CHAPTERS","Cap\u00edtulos"],["DOWNLOAD_VIDEO_FRAME","Guardar fotograma"],["ENTER_LOOP_MODE","Repetir indefinidamente el video actual"],["ENTER_PICTURE_IN_PICTURE","Ingresar al modo de pantalla en pantalla"],["EXIT_FULL_SCREEN","Salir de pantalla completa"],["EXIT_LOOP_MODE","Detener la repetici\u00f3n indefinida del video actual"],["EXIT_PICTURE_IN_PICTURE","Salir del modo de pantalla en pantalla"],
["FAST_FORWARD","Avanzar"],["FULL_SCREEN","Pantalla completa"],["LANGUAGE","Idioma"],["LIVE","En directo"],["LOOP","Repetir indefinidamente"],["MORE_SETTINGS","M\u00e1s opciones de configuraci\u00f3n"],["MULTIPLE_LANGUAGES","Varios idiomas"],["MUTE","Silenciar"],["NOT_APPLICABLE","No aplicable"],["OFF","Desactivado"],["ON","Activado"],["PAUSE","Detener"],["PICTURE_IN_PICTURE","Pantalla en pantalla"],["PLAY","Reproducir"],["PLAYBACK_RATE","Velocidad de reproducci\u00f3n"],["QUALITY","Calidad"],["RECENTER_VR",
"Volver a centrar"],["REPLAY","Volver a reproducir"],["RESOLUTION","Resoluci\u00f3n"],["REWIND","Retroceder"],["SEEK","Buscar"],["SKIP_AD","Omitir anuncio"],["SKIP_TO_LIVE","Adelantar hasta la transmisi\u00f3n en vivo"],["STATISTICS","Estad\u00edsticas"],["SUBTITLE_FORCED","Forzado"],["SURROUND","Sonido envolvente"],["TOGGLE_STEREOSCOPIC","Activar o desactivar el modo estereosc\u00f3pico"],["UNDETERMINED_LANGUAGE","Sin especificar"],["UNMUTE","Dejar de silenciar"],["UNRECOGNIZED_LANGUAGE","No reconocida"],
["VOLUME","Volumen"]]));a.Ra("fr",new Map([["AD_DURATION","Dur\u00e9e de l'annonce"],["AD_PROGRESS","Annonce\u00a0[AD_ON] sur\u00a0[NUM_ADS]"],["AD_STATISTICS","Statistiques sur les annonces"],["AD_TIME","Annonce\u00a0: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Automatique"],["BACK","Retour"],["CAPTIONS","Sous-titres"],["CAST","Caster\u2026"],["CHAPTERS","Chapitres"],["DOWNLOAD_VIDEO_FRAME","T\u00e9l\u00e9charger l'image de la vid\u00e9o"],["ENTER_LOOP_MODE","Lire en boucle la vid\u00e9o en cours"],
["ENTER_PICTURE_IN_PICTURE","Utiliser le mode Picture-in-Picture"],["EXIT_FULL_SCREEN","Quitter le mode plein \u00e9cran"],["EXIT_LOOP_MODE","Arr\u00eater la lecture en boucle de la vid\u00e9o en cours"],["EXIT_PICTURE_IN_PICTURE","Quitter le mode\u00a0PIP (Picture-in-picture)"],["FAST_FORWARD","Avance rapide"],["FULL_SCREEN","Plein \u00e9cran"],["LANGUAGE","Langue"],["LIVE","En direct"],["LOOP","R\u00e9p\u00e9ter"],["MORE_SETTINGS","Plus de param\u00e8tres"],["MULTIPLE_LANGUAGES","Plusieurs langues"],
["MUTE","Couper le son"],["NOT_APPLICABLE","Non applicable"],["OFF","D\u00e9sactiv\u00e9e"],["ON","Activ\u00e9e"],["PAUSE","Pause"],["PICTURE_IN_PICTURE","Picture-in-Picture"],["PLAY","Visionner"],["PLAYBACK_RATE","Vitesse de lecture"],["QUALITY","Qualit\u00e9"],["RECENTER_VR","Recentrer"],["REPLAY","Revoir"],["RESOLUTION","R\u00e9solution"],["REWIND","Retour arri\u00e8re"],["SEEK","Chercher"],["SKIP_AD","Passer l'annonce"],["SKIP_NEXT","Suivante"],["SKIP_PREVIOUS","Pr\u00e9c\u00e9dente"],["SKIP_TO_LIVE",
"Acc\u00e9der \u00e0 la partie la plus r\u00e9cente du direct"],["STATISTICS","Statistiques"],["SUBTITLE_FORCED","Forc\u00e9"],["SURROUND","Surround"],["TOGGLE_STEREOSCOPIC","Activer/D\u00e9sactiver le mode st\u00e9r\u00e9oscopique"],["UNDETERMINED_LANGUAGE","Langue ind\u00e9termin\u00e9e"],["UNMUTE","R\u00e9activer le son"],["UNRECOGNIZED_LANGUAGE","Non reconnu"],["VOLUME","Volume"]]));a.Ra("it",new Map([["AD_DURATION","Durata dell'annuncio"],["AD_PROGRESS","Annuncio [AD_ON] di [NUM_ADS]"],["AD_STATISTICS",
"Statistiche sugli annunci"],["AD_TIME","Annuncio: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Automatica"],["BACK","Indietro"],["CAPTIONS","Sottotitoli"],["CAST","Trasmetti..."],["CHAPTERS","Capitoli"],["DOWNLOAD_VIDEO_FRAME","Salva fotogramma"],["ENTER_LOOP_MODE","Riproduci in loop il video corrente"],["ENTER_PICTURE_IN_PICTURE","Attiva Picture in picture"],["EXIT_FULL_SCREEN","Esci da schermo intero"],["EXIT_LOOP_MODE","Interrompi riproduzione in loop del video corrente"],["EXIT_PICTURE_IN_PICTURE",
"Esci da Picture in picture"],["FAST_FORWARD","Avanti veloce"],["FULL_SCREEN","Schermo intero"],["LANGUAGE","Lingua"],["LIVE","Dal vivo"],["LOOP","Riproduci in loop"],["MORE_SETTINGS","Altre impostazioni"],["MULTIPLE_LANGUAGES","Pi\u00f9 lingue"],["MUTE","Disattiva audio"],["NOT_APPLICABLE","Non applicabile"],["OFF","Disattivo"],["ON","Attivo"],["PAUSE","Metti in pausa"],["PICTURE_IN_PICTURE","Picture in picture"],["PLAY","Riproduci"],["PLAYBACK_RATE","Velocit\u00e0 di riproduzione"],["QUALITY","Qualit\u00e0"],
["RECENTER_VR","Ricentra"],["REPLAY","Riproduci di nuovo"],["RESOLUTION","Risoluzione"],["REWIND","Riavvolgi"],["SEEK","Cerca"],["SKIP_AD","Salta annuncio"],["SKIP_TO_LIVE","Passa alla trasmissione dal vivo"],["STATISTICS","Statistiche"],["SUBTITLE_FORCED","Forzata"],["SURROUND","Surround"],["TOGGLE_STEREOSCOPIC","Pulsante di attivazione/disattivazione stereoscopico"],["UNDETERMINED_LANGUAGE","Indeterminata"],["UNMUTE","Riattiva audio"],["UNRECOGNIZED_LANGUAGE","Non riconosciuto"],["VOLUME","Volume"]]));
a.Ra("ja",new Map([["AD_DURATION","\u5e83\u544a\u518d\u751f\u6642\u9593"],["AD_PROGRESS","[AD_ON] \u756a\u76ee\u306e\u5e83\u544a\uff08\u5168 [NUM_ADS] \u500b\uff09"],["AD_STATISTICS","\u5e83\u544a\u306e\u7d71\u8a08\u60c5\u5831"],["AD_TIME","\u5e83\u544a: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","\u81ea\u52d5"],["BACK","\u623b\u308b"],["CAPTIONS","\u5b57\u5e55"],["CAST","\u30ad\u30e3\u30b9\u30c8..."],["CHAPTERS","\u7ae0"],["DOWNLOAD_VIDEO_FRAME","\u52d5\u753b\u30d5\u30ec\u30fc\u30e0\u3092\u4fdd\u5b58"],
["ENTER_LOOP_MODE","\u73fe\u5728\u306e\u52d5\u753b\u3092\u30eb\u30fc\u30d7\u518d\u751f"],["ENTER_PICTURE_IN_PICTURE","\u30d4\u30af\u30c1\u30e3\u30fc \u30a4\u30f3 \u30d4\u30af\u30c1\u30e3\u30fc\u3092\u958b\u59cb"],["EXIT_FULL_SCREEN","\u5168\u753b\u9762\u8868\u793a\u3092\u7d42\u4e86"],["EXIT_LOOP_MODE","\u73fe\u5728\u306e\u52d5\u753b\u306e\u30eb\u30fc\u30d7\u518d\u751f\u3092\u505c\u6b62"],["EXIT_PICTURE_IN_PICTURE","\u30d4\u30af\u30c1\u30e3\u30fc \u30a4\u30f3 \u30d4\u30af\u30c1\u30e3\u30fc\u3092\u7d42\u4e86"],
["FAST_FORWARD","\u65e9\u9001\u308a"],["FULL_SCREEN","\u5168\u753b\u9762\u8868\u793a"],["LANGUAGE","\u8a00\u8a9e"],["LIVE","\u30e9\u30a4\u30d6"],["LOOP","\u30eb\u30fc\u30d7"],["MORE_SETTINGS","\u8a73\u7d30\u8a2d\u5b9a"],["MULTIPLE_LANGUAGES","\u591a\u8a00\u8a9e"],["MUTE","\u30df\u30e5\u30fc\u30c8"],["NOT_APPLICABLE","\u8a72\u5f53\u306a\u3057"],["OFF","\u30aa\u30d5"],["ON","\u30aa\u30f3"],["PAUSE","\u4e00\u6642\u505c\u6b62"],["PICTURE_IN_PICTURE","\u30d4\u30af\u30c1\u30e3\u30fc \u30a4\u30f3 \u30d4\u30af\u30c1\u30e3\u30fc"],
["PLAY","\u518d\u751f"],["PLAYBACK_RATE","\u518d\u751f\u901f\u5ea6"],["QUALITY","\u54c1\u8cea"],["RECENTER_VR","\u4e2d\u5fc3\u3092\u518d\u8a2d\u5b9a"],["REPLAY","\u3082\u3046\u4e00\u5ea6\u518d\u751f"],["RESOLUTION","\u89e3\u50cf\u5ea6"],["REWIND","\u5dfb\u304d\u623b\u3057"],["SEEK","\u30b7\u30fc\u30af\u518d\u751f"],["SKIP_AD","\u5e83\u544a\u3092\u30b9\u30ad\u30c3\u30d7"],["SKIP_TO_LIVE","\u30e9\u30a4\u30d6\u914d\u4fe1\u307e\u3067\u30b9\u30ad\u30c3\u30d7"],["STATISTICS","\u7d71\u8a08\u60c5\u5831"],
["SUBTITLE_FORCED","\u5f37\u5236"],["SURROUND","\u30b5\u30e9\u30a6\u30f3\u30c9"],["TOGGLE_STEREOSCOPIC","\u7acb\u4f53\u753b\u50cf\u3092\u5207\u308a\u66ff\u3048\u308b"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u30df\u30e5\u30fc\u30c8\u3092\u89e3\u9664"],["UNRECOGNIZED_LANGUAGE","\u4e0d\u660e"],["VOLUME","\u97f3\u91cf"]]));a.Ra("ko",new Map([["AD_DURATION","\uad11\uace0 \uae30\uac04"],["AD_PROGRESS","\uad11\uace0 [AD_ON]/[NUM_ADS]"],["AD_STATISTICS","\uad11\uace0 \ud1b5\uacc4"],["AD_TIME",
"\uad11\uace0: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","\uc790\ub3d9"],["BACK","\ub4a4\ub85c"],["CAPTIONS","\uc790\ub9c9"],["CAST","\uc804\uc1a1..."],["CHAPTERS","\uc7a5"],["DOWNLOAD_VIDEO_FRAME","\ub3d9\uc601\uc0c1 \ud504\ub808\uc784 \uc800\uc7a5"],["ENTER_LOOP_MODE","\ud604\uc7ac \ub3d9\uc601\uc0c1 \ubc18\ubcf5 \uc7ac\uc0dd"],["ENTER_PICTURE_IN_PICTURE","PIP \ubaa8\ub4dc \uc2dc\uc791"],["EXIT_FULL_SCREEN","\uc804\uccb4\ud654\uba74 \ub2eb\uae30"],["EXIT_LOOP_MODE","\ud604\uc7ac \ub3d9\uc601\uc0c1 \ubc18\ubcf5 \uc7ac\uc0dd \uc911\uc9c0"],
["EXIT_PICTURE_IN_PICTURE","PIP \ubaa8\ub4dc \uc885\ub8cc"],["FAST_FORWARD","\ube68\ub9ac \uac10\uae30"],["FULL_SCREEN","\uc804\uccb4\ud654\uba74"],["LANGUAGE","\uc5b8\uc5b4"],["LIVE","\uc2e4\uc2dc\uac04"],["LOOP","\ubc18\ubcf5 \uc7ac\uc0dd"],["MORE_SETTINGS","\uc124\uc815 \ub354\ubcf4\uae30"],["MULTIPLE_LANGUAGES","\uc5ec\ub7ec \uc5b8\uc5b4"],["MUTE","\uc74c\uc18c\uac70"],["NOT_APPLICABLE","\ud574\ub2f9 \uc0ac\ud56d \uc5c6\uc74c"],["OFF","\uc0ac\uc6a9 \uc548\ud568"],["ON","\uc0ac\uc6a9"],["PAUSE",
"\uc77c\uc2dc\uc911\uc9c0"],["PICTURE_IN_PICTURE","PIP \ubaa8\ub4dc"],["PLAY","\uc7ac\uc0dd"],["PLAYBACK_RATE","\uc7ac\uc0dd \uc18d\ub3c4"],["QUALITY","\ud488\uc9c8"],["RECENTER_VR","\uc911\uc2ec \uc7ac\uc124\uc815"],["REPLAY","\ub2e4\uc2dc\ubcf4\uae30"],["RESOLUTION","\ud574\uc0c1\ub3c4"],["REWIND","\ub418\uac10\uae30"],["SEEK","\ucc3e\uae30"],["SKIP_AD","\uad11\uace0 \uac74\ub108\ub6f0\uae30"],["SKIP_TO_LIVE","\ub77c\uc774\ube0c \ub3d9\uc601\uc0c1\uc73c\ub85c \uac74\ub108\ub6f0\uae30"],["STATISTICS",
"\ud1b5\uacc4"],["SUBTITLE_FORCED","\uac15\uc81c"],["SURROUND","\uc11c\ub77c\uc6b4\ub4dc"],["TOGGLE_STEREOSCOPIC","\uc785\uccb4 \ubcf4\uae30 \uc804\ud658"],["UNDETERMINED_LANGUAGE","\ubbf8\uc815"],["UNMUTE","\uc74c\uc18c\uac70 \ud574\uc81c"],["UNRECOGNIZED_LANGUAGE","\uc54c \uc218 \uc5c6\uc74c"],["VOLUME","\ubcfc\ub968"]]));a.Ra("nl",new Map([["AD_DURATION","Advertentieduur"],["AD_PROGRESS","Advertentie [AD_ON] van [NUM_ADS]"],["AD_STATISTICS","Advertentiestatistieken"],["AD_TIME","Advertentie: [AD_TIME]"],
["AIRPLAY","AirPlay"],["AUTO_QUALITY","Automatisch"],["BACK","Terug"],["CAPTIONS","Ondertiteling"],["CAST","Casten..."],["CHAPTERS","Hoofdstukken"],["DOWNLOAD_VIDEO_FRAME","Videoframe opslaan"],["ENTER_LOOP_MODE","De huidige video lussen"],["ENTER_PICTURE_IN_PICTURE","Scherm-in-scherm openen"],["EXIT_FULL_SCREEN","Volledig scherm sluiten"],["EXIT_LOOP_MODE","De huidige video niet meer lussen"],["EXIT_PICTURE_IN_PICTURE","Scherm-in-scherm afsluiten"],["FAST_FORWARD","Vooruitspoelen"],["FULL_SCREEN",
"Volledig scherm"],["LANGUAGE","Taal"],["LIVE","Live"],["LOOP","Lussen"],["MORE_SETTINGS","Meer instellingen"],["MULTIPLE_LANGUAGES","Meerdere talen"],["MUTE","Geluid uitzetten"],["NOT_APPLICABLE","Niet van toepassing"],["OFF","Uit"],["ON","Aan"],["PAUSE","Onderbreken"],["PICTURE_IN_PICTURE","Scherm-in-scherm"],["PLAY","Afspelen"],["PLAYBACK_RATE","Afspeelsnelheid"],["QUALITY","Kwaliteit"],["RECENTER_VR","Opnieuw centreren"],["REPLAY","Opnieuw afspelen"],["RESOLUTION","Resolutie"],["REWIND","Terugspoelen"],
["SEEK","Zoeken"],["SKIP_AD","Advertentie overslaan"],["SKIP_TO_LIVE","Doorgaan naar live"],["STATISTICS","Statistieken"],["SUBTITLE_FORCED","Afgedwongen"],["SURROUND","Surround"],["TOGGLE_STEREOSCOPIC","Stereoscopisch aan-/uitzetten"],["UNDETERMINED_LANGUAGE","Onbepaald"],["UNMUTE","Geluid aanzetten"],["UNRECOGNIZED_LANGUAGE","Onbekend"],["VOLUME","Volume"]]));a.Ra("pl",new Map([["AD_DURATION","Czas trwania reklamy"],["AD_PROGRESS","Reklama\u00a0[AD_ON] z\u00a0[NUM_ADS]"],["AD_STATISTICS","Statystyki reklam"],
["AD_TIME","Reklama: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Automatycznie"],["BACK","Wstecz"],["CAPTIONS","Napisy"],["CAST","Przesy\u0142aj..."],["CHAPTERS","Rozdzia\u0142y"],["DOWNLOAD_VIDEO_FRAME","Zapisz klatk\u0119 filmu"],["ENTER_LOOP_MODE","Odtwarzaj bie\u017c\u0105cy film w\u00a0p\u0119tli"],["ENTER_PICTURE_IN_PICTURE","W\u0142\u0105cz tryb obrazu w\u00a0obrazie"],["EXIT_FULL_SCREEN","Zamknij pe\u0142ny ekran"],["EXIT_LOOP_MODE","Wy\u0142\u0105cz odtwarzanie bie\u017c\u0105cego filmu w\u00a0p\u0119tli"],
["EXIT_PICTURE_IN_PICTURE","Wy\u0142\u0105cz tryb obrazu w\u00a0obrazie"],["FAST_FORWARD","Przewi\u0144 do przodu"],["FULL_SCREEN","Pe\u0142ny ekran"],["LANGUAGE","J\u0119zyk"],["LIVE","Na \u017cywo"],["LOOP","Odtwarzaj w\u00a0p\u0119tli"],["MORE_SETTINGS","Wi\u0119cej ustawie\u0144"],["MULTIPLE_LANGUAGES","Wiele j\u0119zyk\u00f3w"],["MUTE","Wycisz"],["NOT_APPLICABLE","Nie dotyczy"],["OFF","Wy\u0142\u0105czone"],["ON","W\u0142\u0105czone"],["PAUSE","Wstrzymaj"],["PICTURE_IN_PICTURE","Obraz w\u00a0obrazie"],
["PLAY","Odtw\u00f3rz"],["PLAYBACK_RATE","Szybko\u015b\u0107 odtwarzania"],["QUALITY","Jako\u015b\u0107"],["RECENTER_VR","Wy\u015brodkuj"],["REPLAY","Odtw\u00f3rz ponownie"],["RESOLUTION","Rozdzielczo\u015b\u0107"],["REWIND","Przewi\u0144 do ty\u0142u"],["SEEK","Szukaj"],["SKIP_AD","Pomi\u0144 reklam\u0119"],["SKIP_NEXT","Dalej"],["SKIP_PREVIOUS","Poprzedni"],["SKIP_TO_LIVE","Przejd\u017a do transmisji na \u017cywo"],["STATISTICS","Statystyki"],["SUBTITLE_FORCED","Wymuszone"],["SURROUND","Przestrzenny"],
["TOGGLE_STEREOSCOPIC","Prze\u0142\u0105cz tryb stereoskopowy"],["UNDETERMINED_LANGUAGE","Nie okre\u015blono"],["UNMUTE","Wy\u0142\u0105cz wyciszenie"],["UNRECOGNIZED_LANGUAGE","Nierozpoznany"],["VOLUME","G\u0142o\u015bno\u015b\u0107"]]));a.Ra("pt-BR",new Map([["AD_DURATION","Dura\u00e7\u00e3o do an\u00fancio"],["AD_PROGRESS","An\u00fancio [AD_ON] de [NUM_ADS]"],["AD_STATISTICS","Estat\u00edsticas de an\u00fancios"],["AD_TIME","An\u00fancio: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Autom\u00e1tica"],
["BACK","Voltar"],["CAPTIONS","Legendas"],["CAST","Transmitir..."],["CHAPTERS","Cap\u00edtulos"],["DOWNLOAD_VIDEO_FRAME","Salvar frame do v\u00eddeo"],["ENTER_LOOP_MODE","Repetir o v\u00eddeo atual"],["ENTER_PICTURE_IN_PICTURE","Entrar no modo picture-in-picture"],["EXIT_FULL_SCREEN","Sair do modo tela cheia"],["EXIT_LOOP_MODE","Parar repeti\u00e7\u00e3o do v\u00eddeo atual"],["EXIT_PICTURE_IN_PICTURE","Sair de picture-in-picture"],["FAST_FORWARD","Avan\u00e7ar"],["FULL_SCREEN","Tela cheia"],["LANGUAGE",
"Idioma"],["LIVE","Ao vivo"],["LOOP","Repetir"],["MORE_SETTINGS","Mais defini\u00e7\u00f5es"],["MULTIPLE_LANGUAGES","V\u00e1rios idiomas"],["MUTE","Desativar som"],["NOT_APPLICABLE","N\u00e3o relevante"],["OFF","Desativado"],["ON","Ativado"],["PAUSE","Pausar"],["PICTURE_IN_PICTURE","Picture-in-picture"],["PLAY","Reproduzir"],["PLAYBACK_RATE","Velocidade da reprodu\u00e7\u00e3o"],["QUALITY","Qualidade"],["RECENTER_VR","Centralizar"],["REPLAY","Repetir"],["RESOLUTION","Resolu\u00e7\u00e3o"],["REWIND",
"Voltar"],["SEEK","Procurar"],["SKIP_AD","Pular an\u00fancio"],["SKIP_TO_LIVE","Pular para transmiss\u00e3o ao vivo"],["STATISTICS","Estat\u00edsticas"],["SUBTITLE_FORCED","Exibi\u00e7\u00e3o for\u00e7ada"],["SURROUND","Surround"],["TOGGLE_STEREOSCOPIC","Alternar imagem estereosc\u00f3pica"],["UNDETERMINED_LANGUAGE","Indeterminado"],["UNMUTE","Ativar som"],["UNRECOGNIZED_LANGUAGE","N\u00e3o reconhecido"],["VOLUME","Volume"]]));a.Ra("ru",new Map([["AD_DURATION","\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u043a\u043b\u0430\u043c\u044b"],
["AD_PROGRESS","\u0420\u0435\u043a\u043b\u0430\u043c\u0430 [AD_ON] \u0438\u0437 [NUM_ADS]"],["AD_STATISTICS","\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0439"],["AD_TIME","\u0420\u0435\u043a\u043b\u0430\u043c\u0430: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","\u0410\u0432\u0442\u043e"],["BACK","\u041d\u0430\u0437\u0430\u0434"],["CAPTIONS","\u0421\u0443\u0431\u0442\u0438\u0442\u0440\u044b"],["CAST","\u0422\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c..."],
["CHAPTERS","\u042d\u043f\u0438\u0437\u043e\u0434\u044b"],["DOWNLOAD_VIDEO_FRAME","\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u0434\u0440 \u0432\u0438\u0434\u0435\u043e"],["ENTER_LOOP_MODE","\u0417\u0430\u0446\u0438\u043a\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0432\u0438\u0434\u0435\u043e"],["ENTER_PICTURE_IN_PICTURE",'\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c "\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435"'],
["EXIT_FULL_SCREEN","\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c"],["EXIT_LOOP_MODE","\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0435\u043e"],["EXIT_PICTURE_IN_PICTURE",'\u0412\u044b\u0439\u0442\u0438 \u0438\u0437 \u0440\u0435\u0436\u0438\u043c\u0430 "\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435"'],
["FAST_FORWARD","\u041f\u0435\u0440\u0435\u043c\u043e\u0442\u043a\u0430 \u0432\u043f\u0435\u0440\u0435\u0434"],["FULL_SCREEN","\u041f\u043e\u043b\u043d\u043e\u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c"],["LANGUAGE","\u042f\u0437\u044b\u043a"],["LIVE","\u041f\u0440\u044f\u043c\u043e\u0439 \u044d\u0444\u0438\u0440"],["LOOP","\u0417\u0430\u0446\u0438\u043a\u043b\u0438\u0442\u044c"],["MORE_SETTINGS","\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438"],
["MULTIPLE_LANGUAGES","\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432"],["MUTE","\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0432\u0443\u043a"],["NOT_APPLICABLE","\u041d\u0435\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e"],["OFF","\u0412\u044b\u043a\u043b."],["ON","\u0412\u043a\u043b."],["PAUSE","\u041f\u0430\u0443\u0437\u0430"],["PICTURE_IN_PICTURE","\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435"],
["PLAY","\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438"],["PLAYBACK_RATE","\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f"],["QUALITY","\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e"],["RECENTER_VR","\u0426\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e"],["REPLAY","\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"],
["RESOLUTION","\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435"],["REWIND","\u041f\u0435\u0440\u0435\u043c\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0437\u0430\u0434"],["SEEK","\u041f\u0435\u0440\u0435\u043c\u043e\u0442\u043a\u0430"],["SKIP_AD","\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c"],["SKIP_TO_LIVE","\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043f\u0440\u044f\u043c\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438"],
["STATISTICS","\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430"],["SUBTITLE_FORCED","\u0421\u0443\u0431\u0442\u0438\u0442\u0440\u044b \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e"],["SURROUND","\u041e\u0431\u044a\u0435\u043c\u043d\u044b\u0439 \u0437\u0432\u0443\u043a"],["TOGGLE_STEREOSCOPIC","\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0442\u0435\u0440\u0435\u043e\u0441\u043a\u043e\u043f\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0436\u0438\u043c"],
["UNDETERMINED_LANGUAGE","\u041d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e"],["UNMUTE","\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0432\u0443\u043a"],["UNRECOGNIZED_LANGUAGE","\u041d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043e"],["VOLUME","\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c"]]));a.Ra("th",new Map([["AD_DURATION","\u0e23\u0e30\u0e22\u0e30\u0e40\u0e27\u0e25\u0e32\u0e42\u0e06\u0e29\u0e13\u0e32"],["AD_PROGRESS","\u0e42\u0e06\u0e29\u0e13\u0e32 [AD_ON] \u0e08\u0e32\u0e01 [NUM_ADS] \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23"],
["AD_STATISTICS","\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e42\u0e06\u0e29\u0e13\u0e32"],["AD_TIME","\u0e42\u0e06\u0e29\u0e13\u0e32: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34"],["BACK","\u0e01\u0e25\u0e31\u0e1a"],["CAPTIONS","\u0e04\u0e33\u0e1a\u0e23\u0e23\u0e22\u0e32\u0e22\u0e41\u0e17\u0e19\u0e40\u0e2a\u0e35\u0e22\u0e07"],["CAST","\u0e41\u0e04\u0e2a\u0e15\u0e4c..."],["CHAPTERS","\u0e1a\u0e17"],["DOWNLOAD_VIDEO_FRAME","\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e40\u0e1f\u0e23\u0e21\u0e27\u0e34\u0e14\u0e35\u0e42\u0e2d"],
["ENTER_LOOP_MODE","\u0e27\u0e19\u0e0b\u0e49\u0e33\u0e27\u0e34\u0e14\u0e35\u0e42\u0e2d\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19"],["ENTER_PICTURE_IN_PICTURE","\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e20\u0e32\u0e1e\u0e0b\u0e49\u0e2d\u0e19\u0e20\u0e32\u0e1e"],["EXIT_FULL_SCREEN","\u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e41\u0e1a\u0e1a\u0e40\u0e15\u0e47\u0e21\u0e2b\u0e19\u0e49\u0e32\u0e08\u0e2d"],["EXIT_LOOP_MODE",
"\u0e2b\u0e22\u0e38\u0e14\u0e27\u0e19\u0e0b\u0e49\u0e33\u0e27\u0e34\u0e14\u0e35\u0e42\u0e2d\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19"],["EXIT_PICTURE_IN_PICTURE","\u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e20\u0e32\u0e1e\u0e0b\u0e49\u0e2d\u0e19\u0e20\u0e32\u0e1e"],["FAST_FORWARD","\u0e01\u0e23\u0e2d\u0e44\u0e1b\u0e02\u0e49\u0e32\u0e07\u0e2b\u0e19\u0e49\u0e32"],["FULL_SCREEN","\u0e40\u0e15\u0e47\u0e21\u0e2b\u0e19\u0e49\u0e32\u0e08\u0e2d"],["LANGUAGE","\u0e20\u0e32\u0e29\u0e32"],
["LIVE","\u0e2a\u0e14"],["LOOP","\u0e25\u0e39\u0e1b"],["MORE_SETTINGS","\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21"],["MULTIPLE_LANGUAGES","\u0e2b\u0e25\u0e32\u0e22\u0e20\u0e32\u0e29\u0e32"],["MUTE","\u0e1b\u0e34\u0e14\u0e40\u0e2a\u0e35\u0e22\u0e07"],["NOT_APPLICABLE","\u0e44\u0e21\u0e48\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e02\u0e49\u0e2d\u0e07"],["OFF","\u0e1b\u0e34\u0e14"],["ON","\u0e40\u0e1b\u0e34\u0e14"],["PAUSE","\u0e2b\u0e22\u0e38\u0e14\u0e0a\u0e31\u0e48\u0e27\u0e04\u0e23\u0e32\u0e27"],
["PICTURE_IN_PICTURE","\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e20\u0e32\u0e1e\u0e0b\u0e49\u0e2d\u0e19\u0e20\u0e32\u0e1e"],["PLAY","\u0e40\u0e25\u0e48\u0e19"],["PLAYBACK_RATE","\u0e04\u0e27\u0e32\u0e21\u0e40\u0e23\u0e47\u0e27\u0e43\u0e19\u0e01\u0e32\u0e23\u0e40\u0e25\u0e48\u0e19"],["QUALITY","\u0e04\u0e38\u0e13\u0e20\u0e32\u0e1e"],["RECENTER_VR","\u0e08\u0e31\u0e14\u0e01\u0e36\u0e48\u0e07\u0e01\u0e25\u0e32\u0e07\u0e43\u0e2b\u0e21\u0e48"],["REPLAY","\u0e40\u0e25\u0e48\u0e19\u0e0b\u0e49\u0e33"],
["RESOLUTION","\u0e04\u0e27\u0e32\u0e21\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14"],["REWIND","\u0e01\u0e23\u0e2d\u0e01\u0e25\u0e31\u0e1a"],["SEEK","\u0e04\u0e49\u0e19\u0e2b\u0e32"],["SKIP_AD","\u0e02\u0e49\u0e32\u0e21\u0e42\u0e06\u0e29\u0e13\u0e32"],["SKIP_TO_LIVE","\u0e02\u0e49\u0e32\u0e21\u0e44\u0e1b\u0e17\u0e35\u0e48\u0e01\u0e32\u0e23\u0e16\u0e48\u0e32\u0e22\u0e17\u0e2d\u0e14\u0e2a\u0e14"],["STATISTICS","\u0e2a\u0e16\u0e34\u0e15\u0e34"],["SUBTITLE_FORCED","\u0e1a\u0e31\u0e07\u0e04\u0e31\u0e1a"],
["SURROUND","\u0e40\u0e0b\u0e2d\u0e23\u0e4c\u0e23\u0e32\u0e27\u0e14\u0e4c"],["TOGGLE_STEREOSCOPIC","\u0e40\u0e1b\u0e34\u0e14/\u0e1b\u0e34\u0e14\u0e1f\u0e35\u0e40\u0e08\u0e2d\u0e23\u0e4c\u0e2a\u0e32\u0e21\u0e21\u0e34\u0e15\u0e34"],["UNDETERMINED_LANGUAGE","\u0e44\u0e21\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14"],["UNMUTE","\u0e40\u0e1b\u0e34\u0e14\u0e40\u0e2a\u0e35\u0e22\u0e07"],["UNRECOGNIZED_LANGUAGE","\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e23\u0e39\u0e49\u0e08\u0e31\u0e01"],["VOLUME","\u0e23\u0e30\u0e14\u0e31\u0e1a\u0e40\u0e2a\u0e35\u0e22\u0e07"]]));
a.Ra("tr",new Map([["AD_DURATION","Reklam s\u00fcresi"],["AD_PROGRESS","[AD_ON]/[NUM_ADS] reklam"],["AD_STATISTICS","Reklam istatistikleri"],["AD_TIME","Reklam: [AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","Otomatik"],["BACK","Geri"],["CAPTIONS","Altyaz\u0131lar"],["CAST","Yay\u0131nla..."],["CHAPTERS","B\u00f6l\u00fcmler"],["DOWNLOAD_VIDEO_FRAME","Video karesini kaydet"],["ENTER_LOOP_MODE","Mevcut videoyu d\u00f6ng\u00fcye al"],["ENTER_PICTURE_IN_PICTURE","Pencere i\u00e7inde Pencere moduna gir"],
["EXIT_FULL_SCREEN","Tam ekrandan \u00e7\u0131k"],["EXIT_LOOP_MODE","Mevcut videonun d\u00f6ng\u00fcs\u00fcn\u00fc durdur"],["EXIT_PICTURE_IN_PICTURE","Pencere \u0130\u00e7inde Pencereden \u00c7\u0131k"],["FAST_FORWARD","\u0130leri sar"],["FULL_SCREEN","Tam ekran"],["LANGUAGE","Dil"],["LIVE","Canl\u0131"],["LOOP","D\u00f6ng\u00fc"],["MORE_SETTINGS","Daha fazla ayar"],["MULTIPLE_LANGUAGES","Birden \u00e7ok dil"],["MUTE","Sesi kapat"],["NOT_APPLICABLE","Ge\u00e7erli de\u011fil"],["OFF","Kapal\u0131"],
["ON","A\u00e7\u0131k"],["PAUSE","Duraklat"],["PICTURE_IN_PICTURE","Pencere \u0130\u00e7inde Pencere"],["PLAY","Oynat"],["PLAYBACK_RATE","\u00c7alma h\u0131z\u0131"],["QUALITY","Kalite"],["RECENTER_VR","Ortala"],["REPLAY","Tekrar Oynat"],["RESOLUTION","\u00c7\u00f6z\u00fcn\u00fcrl\u00fck"],["REWIND","Geri sar"],["SEEK","Ara"],["SKIP_AD","Reklam\u0131 Atla"],["SKIP_TO_LIVE","Canl\u0131 yay\u0131na atla"],["STATISTICS","\u0130statistikler"],["SUBTITLE_FORCED","Zorunlu"],["SURROUND","Surround"],["TOGGLE_STEREOSCOPIC",
"Stereoskopik modu a\u00e7/kapat"],["UNDETERMINED_LANGUAGE","Belirsiz"],["UNMUTE","Sesi a\u00e7"],["UNRECOGNIZED_LANGUAGE","Tan\u0131nmayan"],["VOLUME","Ses"]]));a.Ra("zh",new Map([["AD_DURATION","\u5e7f\u544a\u6301\u7eed\u65f6\u95f4"],["AD_PROGRESS","\u5e7f\u544a [AD_ON]/[NUM_ADS]"],["AD_STATISTICS","\u5e7f\u544a\u7edf\u8ba1\u4fe1\u606f"],["AD_TIME","\u5e7f\u544a\uff1a[AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","\u81ea\u52a8"],["BACK","\u8fd4\u56de"],["CAPTIONS","\u5b57\u5e55"],["CAST","\u6295\u653e\u2026"],
["CHAPTERS","\u7ae0\u8282"],["DOWNLOAD_VIDEO_FRAME","\u4fdd\u5b58\u89c6\u9891\u5e27"],["ENTER_LOOP_MODE","\u5faa\u73af\u64ad\u653e\u5f53\u524d\u89c6\u9891"],["ENTER_PICTURE_IN_PICTURE","\u8fdb\u5165\u201c\u753b\u4e2d\u753b\u201d\u6a21\u5f0f"],["EXIT_FULL_SCREEN","\u9000\u51fa\u5168\u5c4f\u6a21\u5f0f"],["EXIT_LOOP_MODE","\u505c\u6b62\u5faa\u73af\u64ad\u653e\u5f53\u524d\u89c6\u9891"],["EXIT_PICTURE_IN_PICTURE","\u9000\u51fa\u201c\u753b\u4e2d\u753b\u201d\u6a21\u5f0f"],["FAST_FORWARD","\u5feb\u8fdb"],
["FULL_SCREEN","\u5168\u5c4f"],["LANGUAGE","\u8bed\u8a00"],["LIVE","\u76f4\u64ad"],["LOOP","\u5faa\u73af\u64ad\u653e"],["MORE_SETTINGS","\u66f4\u591a\u8bbe\u7f6e"],["MULTIPLE_LANGUAGES","\u591a\u79cd\u8bed\u8a00"],["MUTE","\u9759\u97f3"],["NOT_APPLICABLE","\u4e0d\u9002\u7528"],["OFF","\u5173\u95ed"],["ON","\u5f00\u542f"],["PAUSE","\u6682\u505c"],["PICTURE_IN_PICTURE","\u753b\u4e2d\u753b"],["PLAY","\u64ad\u653e"],["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["QUALITY","\u753b\u8d28"],["RECENTER_VR",
"\u91cd\u65b0\u7f6e\u4e2d"],["REPLAY","\u91cd\u653e"],["RESOLUTION","\u5206\u8fa8\u7387"],["REWIND","\u5feb\u9000"],["SEEK","\u8fdb\u5ea6"],["SKIP_AD","\u8df3\u8fc7\u5e7f\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["STATISTICS","\u7edf\u8ba1\u4fe1\u606f"],["SUBTITLE_FORCED","\u5df2\u5f3a\u5236\u663e\u793a"],["SURROUND","\u73af\u7ed5\u58f0"],["TOGGLE_STEREOSCOPIC","\u5207\u6362\u7acb\u4f53\u58f0"],["UNDETERMINED_LANGUAGE","\u672a\u786e\u5b9a"],["UNMUTE","\u53d6\u6d88\u9759\u97f3"],
["UNRECOGNIZED_LANGUAGE","\u65e0\u6cd5\u8bc6\u522b"],["VOLUME","\u97f3\u91cf"]]));a.Ra("zh-TW",new Map([["AD_DURATION","\u5ee3\u544a\u9577\u5ea6"],["AD_PROGRESS","\u5ee3\u544a [AD_ON]/[NUM_ADS]"],["AD_STATISTICS","\u5ee3\u544a\u7d71\u8a08\u8cc7\u6599"],["AD_TIME","\u5ee3\u544a\uff1a[AD_TIME]"],["AIRPLAY","AirPlay"],["AUTO_QUALITY","\u81ea\u52d5"],["BACK","\u8fd4\u56de"],["CAPTIONS","\u5b57\u5e55"],["CAST","\u6295\u653e..."],["CHAPTERS","\u7ae0\u7bc0"],["DOWNLOAD_VIDEO_FRAME","\u5132\u5b58\u5f71\u7247\u5f71\u683c"],
["ENTER_LOOP_MODE","\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["ENTER_PICTURE_IN_PICTURE","\u9032\u5165\u5b50\u6bcd\u756b\u9762"],["EXIT_FULL_SCREEN","\u9000\u51fa\u5168\u87a2\u5e55\u6a21\u5f0f"],["EXIT_LOOP_MODE","\u505c\u6b62\u5faa\u74b0\u64ad\u653e\u76ee\u524d\u7684\u5f71\u7247"],["EXIT_PICTURE_IN_PICTURE","\u96e2\u958b\u5b50\u6bcd\u756b\u9762"],["FAST_FORWARD","\u5feb\u8f49"],["FULL_SCREEN","\u5168\u87a2\u5e55"],["LANGUAGE","\u8a9e\u8a00"],["LIVE","\u76f4\u64ad"],["LOOP","\u5faa\u74b0\u64ad\u653e"],
["MORE_SETTINGS","\u986f\u793a\u66f4\u591a\u8a2d\u5b9a"],["MULTIPLE_LANGUAGES","\u591a\u7a2e\u8a9e\u8a00"],["MUTE","\u975c\u97f3"],["NOT_APPLICABLE","\u4e0d\u9069\u7528"],["OFF","\u95dc\u9589"],["ON","\u958b\u555f"],["PAUSE","\u66ab\u505c"],["PICTURE_IN_PICTURE","\u5b50\u6bcd\u756b\u9762"],["PLAY","\u64ad\u653e"],["PLAYBACK_RATE","\u64ad\u653e\u901f\u5ea6"],["QUALITY","\u97f3\u8cea"],["RECENTER_VR","\u91cd\u65b0\u7f6e\u4e2d"],["REPLAY","\u91cd\u64ad"],["RESOLUTION","\u89e3\u6790\u5ea6"],["REWIND",
"\u5012\u8f49"],["SEEK","\u641c\u5c0b"],["SKIP_AD","\u7565\u904e\u5ee3\u544a"],["SKIP_TO_LIVE","\u8df3\u81f3\u5f53\u524d\u76f4\u64ad"],["STATISTICS","\u7d71\u8a08\u8cc7\u6599"],["SUBTITLE_FORCED","\u5f37\u5236\u986f\u793a"],["SURROUND","\u74b0\u5834\u97f3\u6548"],["TOGGLE_STEREOSCOPIC","\u5207\u63db\u7acb\u9ad4\u5f71\u50cf"],["UNDETERMINED_LANGUAGE","\u4e0d\u660e"],["UNMUTE","\u53d6\u6d88\u975c\u97f3"],["UNRECOGNIZED_LANGUAGE","\u7121\u6cd5\u8fa8\u8b58"],["VOLUME","\u97f3\u91cf"]]));a.ah(navigator.languages||
[]);return a}function jH(a,b){kH.set(a,b)}function iG(a){if(a.X){if(a.j&&(a.j&&a.j.isPaused()?a.j.play():a.j&&a.j.pause(),a.j.isLinear()))return;a.B.duration&&(a.B.paused&&!a.T?(a.m.isEnded()&&(a.B.currentTime=a.m.va().start),a.B.play()):a.B.pause())}}function lG(a,b=!1){a.X&&!a.Gb()&&(a.nc()?a.M.Ia():a.g.singleClickForPlayAndPause?iG(a):b&&a.Ba()&&a.rh())}function lH(a){a.Ba()?a.dispatchEvent(new C("showingui")):a.dispatchEvent(new C("hidingui"))}
function mH(a){const b=a.l.getElementsByClassName("shaka-text-container")[0];b&&(a.Ba()?b.style.bottom=a.L.clientHeight+"px":b.style.bottom="0px")}
function nH(a){if(a.A)if(a.A.setValue(a.B.currentTime),a.A.update(),a.A.isShowing()){for(var b of a.P)b.classList.remove("shaka-low-position");b=a.G;b.classList.contains("shaka-tooltips-on")&&b.classList.remove("shaka-tooltips-low-position")}else{for(const c of a.P)c.classList.add("shaka-low-position");b=a.G;b.classList.contains("shaka-tooltips-on")&&b.classList.add("shaka-tooltips-low-position")}a.dispatchEvent(new C("timeandseekrangeupdated"))}
function oH(a){a.h.o(a.m,"buffering",()=>{pH(a)});pH(a);a.h.o(window,"keydown",b=>{qH(a,b)});a.h.o(window,"click",()=>a.yc());a.h.o(a,"submenuopen",()=>{a.yc()});a.h.o(a.B,"play",()=>{rH(a)});a.h.o(a.B,"pause",()=>{rH(a)});a.h.o(a.l,"mousemove",b=>{sH(a,b)});a.h.o(a.l,"touchmove",b=>{sH(a,b)},{passive:!0});a.h.o(a.l,"touchend",b=>{sH(a,b)},{passive:!0});a.h.o(a.l,"mouseleave",()=>{a.O||a.J.Ia()});a.h.o(a.l,"wheel",b=>{sH(a,b)},{passive:!0});a.h.o(a.D,"caststatuschanged",()=>{tH(a)});a.h.o(a.C,"vrstatuschanged",
()=>{a.dispatchEvent(new C("vrstatuschanged"))});a.h.o(a.l,"keydown",b=>{a.g.enableKeyboardPlaybackControlsInWindow||a.fb()||uH(a,b)});a.h.o(a.l,"keyup",b=>{a.g.enableKeyboardPlaybackControlsInWindow||a.fb()||a.V.delete(b.key)});a.h.o(window,"keydown",b=>{(a.g.enableKeyboardPlaybackControlsInWindow||a.fb())&&uH(a,b)});a.h.o(window,"keyup",b=>{(a.g.enableKeyboardPlaybackControlsInWindow||a.fb())&&a.V.delete(b.key)});a.h.o(a.ma,"ad-started",b=>{a.j=b.ad;a.Th();pH(a)});a.h.o(a.ma,"ad-stopped",()=>{a.j=
null;a.qh();pH(a)});screen.orientation&&a.h.o(screen.orientation,"change",async()=>{await vH(a)})}
function wH(a){if(a.g.setupMediaSession&&navigator.mediaSession){var b=(f,g)=>{try{navigator.mediaSession.setActionHandler(f,h=>{g(h)})}catch(h){}},c=()=>{if(a.j&&a.j.isLinear())d();else{var f=a.m.va(),g=f.end-f.start;f=parseFloat((a.B.currentTime-f.start).toFixed(2));a.m.U()&&Math.abs(g-f)<1&&(g=Infinity);try{navigator.mediaSession.setPositionState({duration:Math.max(0,g),playbackRate:a.B.playbackRate,position:Math.max(0,f)})}catch(h){}}},d=()=>{try{navigator.mediaSession.setPositionState()}catch(f){}},
e=f=>{const g=a.g.keyboardSeekDistance;switch(f.action){case "pause":iG(a);break;case "play":iG(a);break;case "seekbackward":if(f.seekOffset&&!isFinite(f.seekOffset))break;a.j&&a.j.isLinear()||xH(a,a.A.getValue()-(f.seekOffset||g));break;case "seekforward":if(f.seekOffset&&!isFinite(f.seekOffset))break;a.j&&a.j.isLinear()||xH(a,a.A.getValue()+(f.seekOffset||g));break;case "seekto":if(f.seekTime&&!isFinite(f.seekTime))break;a.j&&a.j.isLinear()||xH(a,a.m.va().start+f.seekTime);break;case "stop":a.m.$b();
break;case "enterpictureinpicture":a.j&&a.j.isLinear()||a.Dc()}};b("pause",e);b("play",e);b("seekbackward",e);b("seekforward",e);b("seekto",e);b("stop",e);("documentPictureInPicture"in window||document.pictureInPictureEnabled)&&b("enterpictureinpicture",e);b=()=>{a.m.U()||a.m.va().start!=0?(c(),a.h.o(a.B,"timeupdate",c)):d()};a.m.ig()&&b();a.h.o(a.m,"loaded",b);a.h.o(a.m,"unloading",()=>{a.h.Ea(a.B,"timeupdate",c)});a.h.o(a.m,"metadata",f=>{if(f=f.payload){var g;f.key=="TIT2"&&f.data&&(g=f.data);
var h;f.key=="APIC"&&f.mimeType=="--\x3e"&&(h=f.data);g&&(f={title:g,artwork:[]},navigator.mediaSession.metadata&&(f=navigator.mediaSession.metadata,f.title=g),navigator.mediaSession.metadata=new MediaMetadata(f));h&&(g=a.u,h!=g.poster&&(g.poster=h),g={title:"",artwork:[{src:h}]},navigator.mediaSession.metadata&&(g=navigator.mediaSession.metadata,g.artwork=[{src:h}]),navigator.mediaSession.metadata=new MediaMetadata(g))}})}}
function tH(a){const b=a.D.Ka();a.dispatchEvent(new C("caststatuschanged",(new Map).set("newStatus",b)));b?a.i.getAttribute("casting")==null&&(a.i.setAttribute("casting","true"),lH(a)):a.i.getAttribute("casting")!=null&&(a.i.removeAttribute("casting"),lH(a))}async function yH(a){zH(a)?(screen.orientation&&screen.orientation.unlock(),await document.exitFullscreen()):(a=a.u,a.webkitSupportsFullscreen&&a.webkitExitFullscreen())}function AH(a){for(const b of a.I)b.release();a.I=[]}
function BH(a){if(a.g.setupMediaSession&&navigator.mediaSession){try{navigator.mediaSession.setPositionState()}catch(b){}a=b=>{try{navigator.mediaSession.setActionHandler(b,null)}catch(c){}};a("pause");a("play");a("seekbackward");a("seekforward");a("seekto");a("stop");a("enterpictureinpicture")}}
function CH(a){a.i=J("div");a.i.classList.add("shaka-controls-container");a.l.appendChild(a.i);a.l.setAttribute("shaka-controls","true");a.h.o(a.i,"touchend",b=>{a.B.duration&&(a.Ba()?(a.O=Date.now(),lG(a,!0)):sH(a,b),b.cancelable&&b.preventDefault())});a.h.o(a.i,"click",()=>{lG(a)});a.h.o(a.i,"dblclick",()=>{a.g.doubleClickForFullscreen&&a.Hd()&&a.ef()})}
function DH(a){a.F=J("div");a.F.classList.add("shaka-client-side-ad-container");Y(a.F,!1);a.h.o(a.F,"click",()=>{lG(a)});a.l.appendChild(a.F);a.H=J("div");a.H.classList.add("shaka-server-side-ad-container");Y(a.H,!1);a.h.o(a.H,"click",()=>{lG(a)});a.l.appendChild(a.H)}function zH(a){return!document.fullscreenEnabled||a.u.webkitSupportsFullscreen&&a.g.preferVideoFullScreenInVisionOS&&tb().i()=="APPLE_VR"?!1:!0}
function EH(a){return"documentPictureInPicture"in window&&a.g.preferDocumentPictureInPicture}
async function FH(a){try{if(zH(a)){if(a.cd()&&(await a.Dc(),EH(a)&&await new Promise(b=>{(new H(b)).Z(.05)})),await a.g.fullScreenElement.requestFullscreen({navigationUI:"hide"}),a.g.forceLandscapeOnFullscreen&&screen.orientation)try{await screen.orientation.lock("landscape")}catch(b){}}else{const b=a.u;b.webkitSupportsFullscreen&&b.webkitEnterFullscreen()}}catch(b){a.dispatchEvent(new C("error",(new Map).set("detail",b)))}}
async function GH(a){if(window.documentPictureInPicture.window)window.documentPictureInPicture.window.close();else{var b=a.l,c=b.getBoundingClientRect();c=await window.documentPictureInPicture.requestWindow({width:c.width,height:c.height});HH(c);var d=b.parentNode||document.body,e=a.l.cloneNode(!0);e.style.visibility="hidden";e.style.height=getComputedStyle(b).height;d.appendChild(e);d=document.createElement("style");d.append("[data-shaka-player-container] {\n      width: 100% !important; max-height: 100%}");
c.document.head.append(d);c.document.body.append(b);a.h.sa(c,"pagehide",()=>{e.replaceWith(b)})}}function HH(a){const b=[...document.styleSheets].map(d=>{try{return[...d.cssRules].map(e=>e.cssText).join("")}catch(e){const f=document.createElement("link");f.rel="stylesheet";f.type=d.type;f.media=d.media;f.href=d.href;a.document.head.appendChild(f)}return""}).filter(Boolean).join("\n"),c=document.createElement("style");c.textContent=b;a.document.head.appendChild(c)}
function IH(a){const b=J("div");b.classList.add("shaka-scrim-container");a.i.appendChild(b)}function JH(a){const b=J("div");b.classList.add("shaka-play-button-container");a.i.appendChild(b);a.Aa=new kG(b,a);a.I.push(a.Aa)}
function KH(a){a.K=J("div");a.K.classList.add("shaka-spinner-container");a.l.appendChild(a.K);const b=J("div");b.classList.add("shaka-spinner");a.K.appendChild(b);b.insertAdjacentHTML("beforeend",'<svg focusable="false" stroke="currentColor"\n         viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg"\n         width="50px" height="50px" class="q-spinner text-grey-9">\n      <g transform="translate(1 1)" stroke-width="6" fill="none"\n        fill-rule="evenodd">\n        <circle stroke-opacity=".5" cx="18" cy="18" r="16"></circle>\n        <path d="M34 18c0-9.94-8.06-16-16-16">\n          <animateTransform attributeName="transform" type="rotate"\n            from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite">\n          </animateTransform>\n        </path>\n      </g>\n    </svg>')}
function LH(a){const b=J("div");b.classList.add("shaka-hidden-fast-forward-container");a.i.appendChild(b);a.Va=new nG(b,a);a.I.push(a.Va)}function MH(a){const b=J("div");b.classList.add("shaka-hidden-rewind-container");a.i.appendChild(b);a.Wa=new oG(b,a);a.I.push(a.Wa)}
function NH(a){a.L=J("div");a.L.classList.add("shaka-bottom-controls");a.L.classList.add("shaka-no-propagation");a.i.appendChild(a.L);a.h.o(a.L,"click",c=>{c.target.closest(".shaka-overflow-button")||a.yc()});OH(a);PH(a);a.G=J("div");a.G.classList.add("shaka-controls-button-panel");a.G.classList.add("shaka-show-controls-on-mouse-over");a.g.enableTooltips&&a.G.classList.add("shaka-tooltips-on");a.L.appendChild(a.G);for(const c of a.g.controlPanelElements)if(kH.get(c)){var b=kH.get(c).create(a.G,a);
a.I.push(b);c=="time_and_duration"&&(b=new cG(a.G,a),a.I.push(b))}else sa("Unrecognized control panel element requested:",c)}function OH(a){a.R=J("div");a.R.classList.add("shaka-ad-controls");var b=a.j!=null&&a.j.isLinear();Y(a.R,b);a.L.appendChild(a.R);b=new GG(a.R,a);a.I.push(b)}
function PH(a){if(a.g.addSeekBar)a.A=QH.create(a.L,a),a.I.push(a.A);else{for(const b of a.P)b.classList.add("shaka-low-position");a=a.G;a.classList.contains("shaka-tooltips-on")&&a.classList.add("shaka-tooltips-low-position")}}function pH(a){a.X&&(a.j&&a.j.isClientRendering()&&a.j.isLinear()?Y(a.K,!1):Y(a.K,a.m.Be()))}
function qH(a,b){a.V.add(b.key);const c=a.nc();b.key=="Tab"&&(a.i.classList.add("shaka-keyboard-navigation"),rH(a),a.h.o(window,"mousedown",()=>{a.h.Ea(window,"mousedown")}));b.key=="Escape"&&a.M.Ia();c&&a.V.has("Tab")&&RH(a,b)}
function sH(a,b){b.type=="mousemove"&&(a.i.classList.remove("shaka-keyboard-navigation"),rH(a));b.type=="touchstart"||b.type=="touchmove"||b.type=="touchend"||b.type=="keyup"?a.O=Date.now():a.O+1E3<Date.now()&&(a.O=null);a.O&&b.type=="mousemove"||(a.l.classList.remove("no-cursor"),a.Ha=!0,a.M.stop(),a.Ba()||(nH(a),rH(a)),a.J.stop(),b.type!="touchend"&&b.type!="wheel"&&b.type!="keyup"&&a.O||a.J.Z(3))}
function uH(a,b){var c=document.activeElement;const d=c&&c.classList?c.classList.contains("shaka-volume-bar"):!1,e=c&&c.classList&&c.classList.contains("shaka-seek-bar");var f=a.fb();c=a.i.contains(c);f=f||a.g.enableKeyboardPlaybackControlsInWindow;c&&sH(a,b);if(a.g.enableKeyboardPlaybackControls&&a.m.Gc()){var g=a.g.keyboardSeekDistance,h=a.g.keyboardLargeSeekDistance;switch(b.key){case "ArrowLeft":a.A&&g>0&&(e||f)&&!d&&(b.preventDefault(),xH(a,a.A.getValue()-g));break;case "ArrowRight":a.A&&g>0&&
(e||f)&&!d&&(b.preventDefault(),xH(a,a.A.getValue()+g));break;case "PageDown":a.A&&h>0&&(e||f)&&(b.preventDefault(),xH(a,a.A.getValue()-h));break;case "PageUp":a.A&&h>0&&(e||f)&&(b.preventDefault(),xH(a,a.A.getValue()+h));break;case "Home":a.A&&xH(a,a.m.va().start);break;case "End":a.A&&xH(a,a.m.va().end);break;case "c":a.m.rd(!a.m.zc());break;case "f":a.Hd()&&a.ef();break;case "m":a.j&&a.j.isLinear()?a.j.setMuted(!a.j.isMuted()):a.u.muted=!a.u.muted;break;case "p":a.Ee()&&a.Dc();break;case ">":b=
a.g.playbackRates.indexOf(a.m.Pa());b>-1&&b+1<a.g.playbackRates.length&&a.m.Zb(a.g.playbackRates[b+1],!1);break;case "<":b=a.g.playbackRates.indexOf(a.m.Pa());b>-1&&b-1>=0&&a.m.Zb(a.g.playbackRates[b-1],!1);break;case " ":(e||f&&!c)&&iG(a)}}}async function vH(a){a.B&&a.B.readyState!=0&&!a.D.Ka()&&a.g.enableFullscreenOnRotation&&a.Hd()&&(screen.orientation.type.includes("landscape")&&!a.fb()?await FH(a):screen.orientation.type.includes("portrait")&&a.fb()&&await yH(a))}
function xH(a,b){a.B.currentTime=b;nH(a)}function rH(a){const b=a.j?a.j.isPaused():!1,c=a.B.paused&&!a.T,d=a.i.classList.contains("shaka-keyboard-navigation");b||(!a.j||!a.j.isLinear())&&c||a.Ha||d||SH(a)?(nH(a),a.i.getAttribute("shown")==null&&(a.i.setAttribute("shown","true"),lH(a)),mH(a),a.ea.stop()):a.ea.Z(a.g.fadeDelay);a.nc()&&a.G.classList.remove("shaka-tooltips-on")}function SH(a){return window.matchMedia("hover: hover").matches?a.Oa.some(b=>b.matches(":hover")):!1}
function RH(a,b){var c=a.P.filter(e=>!e.classList.contains("shaka-hidden"));if(c.length){var d=c[0];if(d.childNodes.length){for(c=d.firstElementChild;c&&c.classList.contains("shaka-hidden");)c=c.nextElementSibling;for(d=d.lastElementChild;d&&d.classList.contains("shaka-hidden");)d=d.previousElementSibling;const e=document.activeElement;a.V.has("Shift")?e==c&&(b.preventDefault(),d.focus()):e==d&&(b.preventDefault(),c.focus())}}}
var Z=class extends Ba{constructor(a,b,c,d,e){super();this.X=!0;this.g=e;this.D=new st(c,a,this.g.castReceiverAppId,this.g.castAndroidReceiverCompatible);this.na=!0;this.B=this.D.xc();this.u=c;this.m=this.D.Fb();this.$=a;this.l=b;this.Ab=d;this.ma=this.m.re();this.A=this.j=null;this.T=!1;this.P=[];this.Oa=[];this.Ha=!1;this.J=new H(()=>{this.l.classList.add("no-cursor");this.Ha=!1;rH(this)});this.ea=new H(()=>{this.i.removeAttribute("shown");lH(this);mH(this);this.W&&this.W.yf();this.M.Z(this.g.closeMenusDelay)});
this.M=new H(()=>{for(const f of this.P)Y(f,!1);this.g.enableTooltips&&this.G.classList.add("shaka-tooltips-on")});this.za=new H(()=>{this.Ba()&&nH(this)});this.O=null;this.I=[];this.oa=iH();this.h=new zc;this.C=null;this.configure(this.g);oH(this);wH(this);this.V=new Set;tH(this);this.za.wa(this.g.refreshTickInSeconds);this.h.o(this.oa,"locale-changed",f=>{f=f.locales[0];this.ma.setLocale(f);this.l.setAttribute("lang",f)});this.ma.initInterstitial(this.F,this.$,this.u);this.h.o(this.m,"texttrackvisibility",
()=>{mH(this)});this.h.o(this.m,"unloading",()=>{this.j||(this.fb()&&yH(this),this.cd()&&this.Dc())})}async destroy(a=!1){document.pictureInPictureElement==this.u&&await document.exitPictureInPicture();this.h&&(this.h.release(),this.h=null);this.J&&(this.J.stop(),this.J=null);this.ea&&(this.ea.stop(),this.ea=null);this.M&&(this.M.stop(),this.M=null);this.za&&(this.za.stop(),this.za=null);this.C&&(this.C.release(),this.C=null);AH(this);this.i&&(this.l.removeChild(this.i),this.i=null);this.D&&(await this.D.destroy(a),
this.D=null);this.K&&(this.l.removeChild(this.K),this.K=null);this.F&&(this.l.removeChild(this.F),this.F=null);this.H&&(this.l.removeChild(this.H),this.H=null);this.$&&(await this.$.destroy(),this.$=null);this.oa=this.B=this.u=this.m=null;this.V.clear();BH(this);super.release()}gi(a){this.na=a;tH(this)}wj(){rH(this)}configure(a){this.g=a;this.D.bh(a.castReceiverAppId,a.castAndroidReceiverCompatible);this.A&&(this.A=null);this.Aa&&(this.Aa=null);this.W&&(this.W=null);this.C&&this.C.configure(a);this.i?
(fj(this.i),AH(this)):(CH(this),DH(this),this.C=new hH(this.i,this.Ab,this.u,this.m,this.g,this));this.l.classList.add("shaka-video-container");this.u.classList.add("shaka-video");IH(this);this.g.addBigPlayButton&&JH(this);this.g.customContextMenu&&(this.W=new gG(this.G,this),this.I.push(this.W));this.K||KH(this);this.g.seekOnTaps&&(LH(this),MH(this));NH(this);this.P=Array.from(this.l.getElementsByClassName("shaka-settings-menu"));this.P.push(...Array.from(this.l.getElementsByClassName("shaka-overflow-menu")));
this.Oa=Array.from(this.l.getElementsByClassName("shaka-show-controls-on-mouse-over"));rH(this);a=this.l.getElementsByClassName("shaka-no-propagation");for(const b of a)a=c=>c.stopPropagation(),this.h.o(b,"click",a),this.h.o(b,"dblclick",a),navigator.maxTouchPoints>0&&this.h.o(b,"touchend",c=>{this.Ba()&&c.stopPropagation()})}Hg(a){(this.X=a)?(this.l.setAttribute("shaka-controls","true"),this.u.tabIndex=-1,this.u.controls=!1):this.l.removeAttribute("shaka-controls");rH(this)}Nh(a){this.u.controls=
a;this.u.tabIndex=a?0:-1;a&&this.Hg(!1)}getAd(){return this.j}zi(){return this.D}Qi(){return this.oa}jj(){return this.l}xc(){return this.B}Pi(){return this.u}Fb(){return this.m}Oi(){return this.$}Gi(){return this.i}$i(){return this.H}Ci(){return this.F}Di(){return this.g}tj(){return this.T}Jg(a){(this.T=a)?this.J.stop():this.J.Z(3)}oj(){return this.na}Xf(){return this.A?this.A.getValue():this.B.currentTime}Oh(a){this.O=a}nc(){return this.P.some(a=>!a.classList.contains("shaka-hidden"))}yc(){this.M.Ia()}Hd(){return this.D.Ka()?
!1:zH(this)||(!this.j||!this.j.isUsingAnotherMediaElement())&&this.u.webkitSupportsFullscreen?!0:!1}fb(){if(zH(this))return!!document.fullscreenElement;const a=this.u;return a.webkitSupportsFullscreen?a.webkitDisplayingFullscreen:!1}async ef(){this.fb()?await yH(this):await FH(this)}Ee(){return this.D.Ka()?!1:document.pictureInPictureEnabled||EH(this)?!this.u.disablePictureInPicture:!1}cd(){return!!(window.documentPictureInPicture&&window.documentPictureInPicture.window||document.pictureInPictureElement)}async Dc(){try{EH(this)?
(this.fb()&&await yH(this),await GH(this)):document.pictureInPictureElement?await document.exitPictureInPicture():(this.fb()&&yH(this),await this.u.requestPictureInPicture())}catch(a){this.dispatchEvent(new C("error",(new Map).set("detail",a)))}}Th(){Y(this.R,!0);this.F&&this.F.hasChildNodes()&&Y(this.F,!0);this.H&&this.H.hasChildNodes()&&Y(this.H,!0);this.j.hasCustomClick()?this.i.setAttribute("ad-active","true"):this.i.removeAttribute("ad-active")}qh(){Y(this.R,!1);Y(this.F,!1);Y(this.H,!1);this.i.removeAttribute("ad-active")}Ba(){return this.X?
this.i.getAttribute("shown")!=null||this.i.getAttribute("casting")!=null:!1}gk(){const a=new Event("mousemove",{bubbles:!1,cancelable:!1});sH(this,a)}rh(){this.J.Ia()}wf(){return this.C.wf()}Gb(){return this.C.Gb()}hj(){var a=this.C;if(a.g){a=a.g;KG(a.h,a.D);var b=a.h;a={pitch:0,jf:0,Bg:0};const c=b[0],d=b[1],e=b[2];b=b[3];const f=d*d,g=e*e,h=b*b,k=c*c+f+g+h,l=c*b-d*e;l>.499995*k?(a.pitch=Math.PI/2,a.jf=2*Math.atan2(d,c),a.Bg=0):l<-.499995*k?(a.pitch=-Math.PI/2,a.jf=2*Math.atan2(d,c),a.Bg=0):(a.pitch=
Math.asin(2*(c*e-b*d)),a.jf=Math.atan2(2*(c*b+d*e),1-2*(g+h)),a.Bg=Math.atan2(2*(c*d+e*b),1-2*(f+g)));a=Math.acos(Math.cos(a.jf)*Math.cos(a.pitch))*180/Math.PI}else sa("Not playing VR content"),a=null;return a}gj(){var a=this.C;a.g?a=a.g.j:(sa("Not playing VR content"),a=null);return a}ek(a){var b=this.C;b.g?(a<0?(sa("Field of view should be greater than 0"),a=0):a>100&&(sa("Field of view should be less than 100"),a=100),b=b.g,b.j=a,VG(b,!1)):sa("Not playing VR content")}sd(){this.C.sd()}gg(a){this.C.gg(a)}eg(a){this.C.eg(a)}fg(a){this.C.fg(a)}};
x("shaka.ui.Controls",Z);Z.prototype.incrementRoll=Z.prototype.fg;Z.prototype.incrementPitch=Z.prototype.eg;Z.prototype.incrementYaw=Z.prototype.gg;Z.prototype.toggleStereoscopicMode=Z.prototype.sd;Z.prototype.setVRFieldOfView=Z.prototype.ek;Z.prototype.getVRFieldOfView=Z.prototype.gj;Z.prototype.getVRNorth=Z.prototype.hj;Z.prototype.isPlayingVR=Z.prototype.Gb;Z.prototype.canPlayVR=Z.prototype.wf;Z.prototype.hideUI=Z.prototype.rh;Z.prototype.showUI=Z.prototype.gk;Z.prototype.isOpaque=Z.prototype.Ba;
Z.prototype.hideAdUI=Z.prototype.qh;Z.prototype.showAdUI=Z.prototype.Th;Z.prototype.togglePiP=Z.prototype.Dc;Z.prototype.isPiPEnabled=Z.prototype.cd;Z.prototype.isPiPAllowed=Z.prototype.Ee;Z.prototype.toggleFullScreen=Z.prototype.ef;Z.prototype.isFullScreenEnabled=Z.prototype.fb;Z.prototype.isFullScreenSupported=Z.prototype.Hd;Z.prototype.hideSettingsMenus=Z.prototype.yc;Z.prototype.anySettingsMenusAreOpen=Z.prototype.nc;Z.prototype.setLastTouchEventTime=Z.prototype.Oh;
Z.prototype.getDisplayTime=Z.prototype.Xf;Z.prototype.isCastAllowed=Z.prototype.oj;Z.prototype.setSeeking=Z.prototype.Jg;Z.prototype.isSeeking=Z.prototype.tj;Z.prototype.getConfig=Z.prototype.Di;Z.prototype.getClientSideAdContainer=Z.prototype.Ci;Z.prototype.getServerSideAdContainer=Z.prototype.$i;Z.prototype.getControlsContainer=Z.prototype.Gi;Z.prototype.getLocalPlayer=Z.prototype.Oi;Z.prototype.getPlayer=Z.prototype.Fb;Z.prototype.getLocalVideo=Z.prototype.Pi;Z.prototype.getVideo=Z.prototype.xc;
Z.prototype.getVideoContainer=Z.prototype.jj;Z.prototype.getLocalization=Z.prototype.Qi;Z.prototype.getCastProxy=Z.prototype.zi;Z.prototype.getAd=Z.prototype.getAd;Z.prototype.setEnabledNativeControls=Z.prototype.Nh;Z.prototype.setEnabledShakaControls=Z.prototype.Hg;Z.prototype.configure=Z.prototype.configure;Z.prototype.loadComplete=Z.prototype.wj;Z.prototype.allowCast=Z.prototype.gi;Z.registerSeekBar=function(a){QH=a};Z.registerElement=jH;Z.prototype.destroy=Z.prototype.destroy;
var kH=new Map,QH=new CG;function TH(a,b){UH.set(a,b)}
function VH(a){a.h=bj();a.h.classList.add("shaka-overflow-menu-button");a.h.classList.add("shaka-no-propagation");a.h.classList.add("shaka-tooltip");(new XF(a.h)).use("M433-80q-27 0-46.5-18T363-142l-9-66q-13-5-24.5-12T307-235l-62 26q-25 11-50 2t-39-32l-47-82q-14-23-8-49t27-43l53-40q-1-7-1-13.5v-27q0-6.5 1-13.5l-53-40q-21-17-27-43t8-49l47-82q14-23 39-32t50 2l62 26q11-8 23-15t24-12l9-66q4-26 23.5-44t46.5-18h94q27 0 46.5 18t23.5 44l9 66q13 5 24.5 12t22.5 15l62-26q25-11 50-2t39 32l47 82q14 23 8 49t-27 43l-53 40q1 7 1 13.5v27q0 6.5-2 13.5l53 40q21 17 27 43t-8 49l-48 82q-14 23-39 32t-50-2l-60-26q-11 8-23 15t-24 12l-9 66q-4 26-23.5 44T527-80h-94Zm49-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z");const b=
J("span");b.classList.add("shaka-overflow-quality-mark");b.style.display="none";a.h.appendChild(b);a.parent.appendChild(a.h)}function WH(a){for(const b of a.m.overflowMenuButtons)if(UH.get(b)){const c=UH.get(b);a.j.push(c.create(a.g,a.controls))}else sa("Unrecognized overflow menu element requested:",b)}function XH(a){a.h.ariaLabel=a.localization.resolve("MORE_SETTINGS")}
function YH(a){if(a.controls.nc())a.controls.yc();else{Y(a.g,!0);rH(a.controls);const b=c=>c.classList.contains("shaka-hidden")==0;Ea(a.g.childNodes,b)&&Fa(a.g.childNodes,b)[0].focus();ZH(a)}}function ZH(a){const b=a.g.getBoundingClientRect();var c=window.getComputedStyle(a.g);const d=parseFloat(c.paddingTop);c=parseFloat(c.paddingBottom);const e=a.u.getBoundingClientRect();a.g.style.maxHeight=b.bottom-e.top-d-c-5+"px"}
var $H=class extends WF{constructor(a,b){super(a,b);this.m=this.controls.g;this.l=this.controls.i;this.u=this.controls.l;this.j=[];VH(this);this.g=J("div");this.g.classList.add("shaka-overflow-menu");this.g.classList.add("shaka-no-propagation");this.g.classList.add("shaka-show-controls-on-mouse-over");this.g.classList.add("shaka-hidden");this.l.appendChild(this.g);WH(this);this.eventManager.o(this.localization,"locale-updated",()=>{XH(this)});this.eventManager.o(this.localization,"locale-changed",
()=>{XH(this)});this.eventManager.o(this.adManager,"ad-started",()=>{this.ad&&this.ad.isLinear()&&Y(this.h,!1)});this.eventManager.o(this.adManager,"ad-stopped",()=>{Y(this.h,!0)});this.eventManager.o(this.controls,"submenuopen",()=>{Y(this.g,!1)});this.eventManager.o(this.g,"touchstart",c=>{this.controls.Oh(Date.now());c.stopPropagation()});this.eventManager.o(this.h,"click",()=>{this.controls.Ba()&&YH(this)});XH(this);this.ad&&this.ad.isLinear()&&Y(this.h,!1);this.i=null;a=()=>ZH(this);window.ResizeObserver?
(this.i=new ResizeObserver(a),this.i.observe(this.controls.l)):this.eventManager.o(window,"resize",a)}release(){this.l=null;for(const a of this.j)a.release();this.j=[];this.i&&(this.i.disconnect(),this.i=null);super.release()}};x("shaka.ui.OverflowMenu",$H);$H.registerElement=TH;jH("overflow_menu",new class{create(a,b){return new $H(a,b)}});var UH=new Map;function aI(a){a.A.textContent=a.localization.resolve("AD_STATISTICS");a.h.ariaLabel=a.localization.resolve("AD_STATISTICS");a.l.textContent=a.localization.resolve(a.g.classList.contains("shaka-hidden")?"OFF":"ON")}
function bI(a){const b=J("div");b.classList.add("shaka-no-propagation");b.classList.add("shaka-statistics-close");const c=(new XF(b,"M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z")).g;c.classList.add("material-icons","notranslate");a.g.appendChild(b);a.eventManager.o(c,"click",()=>{cI(a)});for(const d of a.controls.g.adStatisticsList)d in
a.i?(a.g.appendChild(dI(a,d)),a.C.push(d)):sa("Unrecognized ad statistic element:",d)}
function cI(a){a.g.classList.contains("shaka-hidden")?(a.u.use("M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-440q-17 0-28.5 11.5T280-520v200q0 17 11.5 28.5T320-280q17 0 28.5-11.5T360-320v-200q0-17-11.5-28.5T320-560Zm160-120q-17 0-28.5 11.5T440-640v320q0 17 11.5 28.5T480-280q17 0 28.5-11.5T520-320v-320q0-17-11.5-28.5T480-680Zm160 240q-17 0-28.5 11.5T600-400v80q0 17 11.5 28.5T640-280q17 0 28.5-11.5T680-320v-80q0-17-11.5-28.5T640-440Z"),a.j.wa(.1),
Y(a.g,!0)):(a.u.use("M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Zm120 200q-17 0-28.5 11.5T280-520v200q0 17 11.5 28.5T320-280q17 0 28.5-11.5T360-320v-200q0-17-11.5-28.5T320-560Zm160-120q-17 0-28.5 11.5T440-640v320q0 17 11.5 28.5T480-280q17 0 28.5-11.5T520-320v-320q0-17-11.5-28.5T480-680Zm160 240q-17 0-28.5 11.5T600-400v80q0 17 11.5 28.5T640-280q17 0 28.5-11.5T680-320v-80q0-17-11.5-28.5T640-440Z"),
a.j.stop(),Y(a.g,!1))}function dI(a,b){const c=J("div");var d=J("label");d.textContent=b+":";c.appendChild(d);d=J("span");d.textContent=a.B.get(b)(b);c.appendChild(d);a.m.set(b,d);return c}
var eI=class extends WF{constructor(a,b){super(a,b);this.h=bj();this.h.classList.add("shaka-ad-statistics-button");this.u=new XF(this.h,"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Zm120 200q-17 0-28.5 11.5T280-520v200q0 17 11.5 28.5T320-280q17 0 28.5-11.5T360-320v-200q0-17-11.5-28.5T320-560Zm160-120q-17 0-28.5 11.5T440-640v320q0 17 11.5 28.5T480-280q17 0 28.5-11.5T520-320v-320q0-17-11.5-28.5T480-680Zm160 240q-17 0-28.5 11.5T600-400v80q0 17 11.5 28.5T640-280q17 0 28.5-11.5T680-320v-80q0-17-11.5-28.5T640-440Z");a=
J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-simple-overflow-button-label-inline");this.A=J("span");a.appendChild(this.A);this.l=J("span");this.l.classList.add("shaka-current-selection-span");a.appendChild(this.l);this.h.appendChild(a);this.parent.appendChild(this.h);this.g=J("div");this.g.classList.add("shaka-no-propagation");this.g.classList.add("shaka-show-controls-on-mouse-over");this.g.classList.add("shaka-ad-statistics-container");this.g.classList.add("shaka-hidden");
this.controls.i.appendChild(this.g);this.C=[];this.i=this.adManager.getStats();Y(this.h,this.i.started>0);this.m=new Map;a=c=>this.i[c];this.B=(new Map).set("loadTimes",c=>{let d=0;c=this.i[c];for(const e of c)d+=parseFloat(e);return d}).set("averageLoadTime",a).set("started",a).set("overlayAds",a).set("playedCompletely",a).set("skipped",a).set("errors",a);this.j=new H(()=>{this.i=this.adManager.getStats();for(const c of this.C)this.m.get(c).textContent=this.B.get(c)(c)});aI(this);bI(this);this.eventManager.o(this.localization,
"locale-updated",()=>{aI(this)});this.eventManager.o(this.localization,"locale-changed",()=>{aI(this)});this.eventManager.o(this.h,"click",()=>{this.controls.Ba()&&(cI(this),aI(this))});this.eventManager.o(this.player,"loading",()=>{Y(this.h,!1)});this.eventManager.o(this.adManager,"ad-started",()=>{Y(this.h,!0)})}release(){this.j.stop();this.j=null;super.release()}};x("shaka.ui.AdStatisticsButton",eI);var fI=class{create(a,b){return new eI(a,b)}};TH("ad_statistics",new fI);dG("ad_statistics",new fI);function gI(a){a.g.ariaLabel=a.localization.resolve("AIRPLAY");a.i.textContent=a.localization.resolve("AIRPLAY")}function hI(a){const b=a.controls.xc();a.g.ariaPressed=b&&b.webkitCurrentPlaybackTargetIsWireless?"true":"false"}
var iI=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-airplay-button");this.g.classList.add("shaka-tooltip");this.g.ariaPressed="false";(new XF(this.g)).use("M80-280v-480q0-33 23.5-56.5T160-840h640q33 0 56.5 23.5T880-760v480q0 33-23.5 56.5T800-200h-80q-17 0-28.5-11.5T680-240q0-17 11.5-28.5T720-280h80v-480H160v480h80q17 0 28.5 11.5T280-240q0 17-11.5 28.5T240-200h-80q-33 0-56.5-23.5T80-280Zm232 160q-14 0-22-9.5t-8-20.5q0-5 2-10.5t7-10.5l161-161q6-6 13-9t15-3q8 0 15 3t13 9l161 161q5 5 7 10.5t2 10.5q0 11-8 20.5t-22 9.5H312Zm168-360Z");window.WebKitPlaybackTargetAvailabilityEvent||
this.g.classList.add("shaka-hidden");a=J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");this.i=J("span");a.appendChild(this.i);this.h=J("span");this.h.classList.add("shaka-current-selection-span");a.appendChild(this.h);this.g.appendChild(a);this.parent.appendChild(this.g);gI(this);hI(this);this.eventManager.o(this.localization,"locale-updated",()=>{gI(this)});this.eventManager.o(this.localization,"locale-changed",()=>{gI(this)});this.eventManager.o(this.g,
"click",()=>{this.controls.Ba()&&this.controls.xc().webkitShowPlaybackTargetPicker()});a=this.controls.xc();this.eventManager.o(a,"webkitplaybacktargetavailabilitychanged",c=>{const d=this.player.bc()==Fq;Y(this.g,c.availability=="available"&&d)});this.eventManager.o(a,"webkitcurrentplaybacktargetiswirelesschanged",()=>{hI(this)})}};x("shaka.ui.AirPlayButton",iI);var jI=class{create(a,b){return new iI(a,b)}};TH("airplay",new jI);jH("airplay",new jI);function kI(a){a.g.width=a.parent.offsetWidth;a.g.height=a.parent.offsetHeight}function lI(a){return(a=a.g.getContext("2d"))?a:null}
function mI(a,b){const c=a.g.getContext("2d");let d={left:0,top:0},e=0,f="fadeIn",g=Math.round(b.displayDuration*60);const h=1/(Math.round(b.transitionDuration*60)/2);let k=0;const l=()=>{c.font=`${b.size}px Arial`;var n=c.measureText(b.text).width,p=b.size;n=[{left:20,top:p+20},{left:a.g.width-n-20,top:p+20},{left:20,top:a.g.height-20},{left:a.g.width-n-20,top:a.g.height-20},{left:(a.g.width-n)/2,top:(a.g.height+p)/2}];p=n[k];k=(k+1)%n.length;return p};d=l();const m=()=>{if(a.h){c.clearRect(0,0,
a.g.width,a.g.height);switch(f){case "fadeIn":e=Math.min(b.alpha,e+h);e>=b.alpha&&(f="display");break;case "display":--g<=0&&(f="fadeOut");break;case "fadeOut":e=Math.max(0,e-h),e<=0&&(f="transition",d=l(),g=Math.round(b.displayDuration*60),f="fadeIn")}e>0&&(c.globalAlpha=e,c.fillStyle=b.color,c.font=`${b.size}px Arial`,c.fillText(b.text,d.left,d.top));a.h&&(a.h=requestAnimationFrame(m))}};a.h=requestAnimationFrame(m)}
var nI=class extends WF{constructor(a,b){super(a,b);this.g=document.createElement("canvas");this.g.style.position="absolute";this.g.style.top="0";this.g.style.left="0";this.g.style.pointerEvents="none";this.parent.appendChild(this.g);kI(this);this.i=this.h=null;window.ResizeObserver?(this.i=new ResizeObserver(()=>kI(this)),this.i.observe(this.parent)):window.addEventListener("resize",()=>kI(this))}cf(a,b){a={type:"static",text:a,position:"top-right",color:"rgba(255, 255, 255, 0.7)",size:20,alpha:.7,
interval:2E3,skip:500,displayDuration:2E3,transitionDuration:.5};b=Object.assign({},a,b||a);if(b.type==="static"){if(a=lI(this)){a.clearRect(0,0,this.g.width,this.g.height);a.globalAlpha=b.alpha;a.fillStyle=b.color;a.font=`${b.size}px Arial`;var c=a.measureText(b.text);switch(b.position){case "top-left":c=20;var d=b.size+20;break;case "top-right":c=this.g.width-c.width-20;d=b.size+20;break;case "bottom-left":c=20;d=this.g.height-20;break;case "bottom-right":c=this.g.width-c.width-20;d=this.g.height-
20;break;default:c=(this.g.width-c.width)/2,d=(this.g.height+b.size)/2}a.fillText(b.text,c,d)}}else b.type==="dynamic"&&mI(this,b)}We(){this.h&&(cancelAnimationFrame(this.h),this.h=null);const a=lI(this);a&&a.clearRect(0,0,this.g.width,this.g.height)}release(){this.g&&this.g.parentNode&&this.g.parentNode.removeChild(this.g);this.i?(this.i.disconnect(),this.i=null):window.removeEventListener("resize",()=>kI(this));super.release()}};x("shaka.ui.Watermark",nI);nI.prototype.removeWatermark=nI.prototype.We;
nI.prototype.setTextWatermark=nI.prototype.cf;async function oI(){aC();if(Zp()){var a=document.querySelectorAll("[data-shaka-player-container]"),b=document.querySelectorAll("[data-shaka-player]"),c=document.querySelectorAll("[data-shaka-player-canvas]"),d=document.querySelectorAll("[data-shaka-player-vr-canvas]");if(b.length||a.length)if(b.length&&!a.length)for(var e of b){if(e.ui)continue;b=document.createElement("div");e.parentElement.replaceChild(b,e);b.appendChild(e);const {uh:f,ci:g}=pI(b,c,d);try{await qI(b,e,f,g)}catch(h){rI("shaka-ui-load-failed",
sI);return}}else for(const f of a){if(f.ui)continue;e=null;for(const k of b)if(k.parentElement==f){e=k;break}e||(e=document.createElement("video"),e.setAttribute("playsinline",""),f.appendChild(e));const {uh:g,ci:h}=pI(f,c,d);try{await qI(f,e,g,h)}catch(k){rI("shaka-ui-load-failed",sI);return}}rI("shaka-ui-loaded")}else rI("shaka-ui-load-failed",tI)}function rI(a,b){let c=null;b!=void 0&&(c={reasonCode:b});a=new CustomEvent(a,{detail:c});document.dispatchEvent(a)}
function pI(a,b,c){let d=null;for(const e of b)if(e.parentElement==a){d=e;break}d||(d=document.createElement("canvas"),d.classList.add("shaka-canvas-container"),a.appendChild(d));b=null;for(const e of c)if(e.parentElement==a){b=e;break}return{uh:d,ci:b}}
async function qI(a,b,c,d){const e=new P,f=[],g=b.getAttribute("src");g&&(f.push(g),b.removeAttribute("src"));for(const h of b.getElementsByTagName("source"))f.push(h.src),b.removeChild(h);await e.Db(b);e.Wg(c);a=new uI(e,a,b,d?d:null);b.controls&&a.g.Nh(!0);for(const h of f)try{await a.g.Fb().load(h);break}catch(k){}}
function vI(a){var b="play_pause skip_previous skip_next mute volume time_and_duration spacer overflow_menu".split(" ");window.chrome&&b.push("cast");"remote"in HTMLMediaElement.prototype?b.push("remote"):window.WebKitPlaybackTargetAvailabilityEvent&&b.push("airplay");b.push("fullscreen");b={controlPanelElements:b,overflowMenuButtons:"captions quality language chapter picture_in_picture playback_rate recenter_vr toggle_stereoscopic".split(" "),statisticsList:"width height currentCodecs corruptedFrames decodedFrames droppedFrames drmTimeSeconds licenseTime liveLatency loadLatency bufferingTime manifestTimeSeconds estimatedBandwidth streamBandwidth maxSegmentDuration pauseTime playTime completionPercent manifestSizeBytes bytesDownloaded nonFatalErrorCount manifestPeriodCount manifestGapCount".split(" "),
adStatisticsList:"loadTimes averageLoadTime started overlayAds playedCompletely skipped errors".split(" "),contextMenuElements:["loop","picture_in_picture","save_video_frame","statistics","ad_statistics"],playbackRates:[.5,.75,1,1.25,1.5,1.75,2],fastForwardRates:[2,4,8,1],rewindRates:[-1,-2,-4,-8],addSeekBar:!0,addBigPlayButton:!1,customContextMenu:!1,castReceiverAppId:"",castAndroidReceiverCompatible:!1,clearBufferOnQualityChange:!0,showUnbufferedStart:!1,seekBarColors:{base:"rgba(255, 255, 255, 0.3)",
buffered:"rgba(255, 255, 255, 0.54)",played:"rgb(255, 255, 255)",adBreaks:"rgb(255, 204, 0)"},volumeBarColors:{base:"rgba(255, 255, 255, 0.54)",level:"rgb(255, 255, 255)"},qualityMarks:{720:"",1080:"HD",1440:"2K",2160:"4K",4320:"8K"},trackLabelFormat:wI,textTrackLabelFormat:wI,fadeDelay:0,closeMenusDelay:2,doubleClickForFullscreen:!0,singleClickForPlayAndPause:!0,enableKeyboardPlaybackControls:!0,enableFullscreenOnRotation:!1,forceLandscapeOnFullscreen:!1,enableTooltips:!0,keyboardSeekDistance:5,
keyboardLargeSeekDistance:60,fullScreenElement:a.l,preferDocumentPictureInPicture:!0,showAudioChannelCountVariants:!0,seekOnTaps:!1,tapSeekDistance:10,refreshTickInSeconds:.125,displayInVrMode:!1,defaultVrProjectionMode:"equirectangular",setupMediaSession:!0,preferVideoFullScreenInVisionOS:!0,showAudioCodec:!0,showVideoCodec:!0,castSenderUrl:"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js",enableKeyboardPlaybackControlsInWindow:!1,alwaysShowVolumeBar:!1};if(a.kg()){b.addBigPlayButton=!0;b.singleClickForPlayAndPause=
!1;b.seekOnTaps=!0;b.enableTooltips=!1;b.doubleClickForFullscreen=!1;a=tb();b.enableFullscreenOnRotation=a.h()!=="WEBKIT";b.forceLandscapeOnFullscreen=!0;const c=["play_pause","skip_previous","skip_next","volume"];b.controlPanelElements=b.controlPanelElements.filter(d=>!c.includes(d));b.overflowMenuButtons=b.overflowMenuButtons.filter(d=>!c.includes(d));b.contextMenuElements=b.contextMenuElements.filter(d=>!c.includes(d))}else if(a.mg()){b.addBigPlayButton=!0;b.singleClickForPlayAndPause=!1;b.enableTooltips=
!1;b.doubleClickForFullscreen=!1;const c="play_pause cast remote airplay volume save_video_frame".split(" ");b.controlPanelElements=b.controlPanelElements.filter(d=>!c.includes(d));b.overflowMenuButtons=b.overflowMenuButtons.filter(d=>!c.includes(d));b.contextMenuElements=b.contextMenuElements.filter(d=>!c.includes(d))}return b}
var uI=class{constructor(a,b,c,d=null){this.j=a;this.l=b;this.h=vI(this);let e="";var f=!1;b.dataset&&b.dataset.shakaPlayerCastReceiverId?(f=b.dataset,e=f.shakaPlayerCastReceiverId,f=f.shakaPlayerCastAndroidReceiverCompatible==="true"):c.dataset&&c.dataset.shakaPlayerCastReceiverId&&(f=c.dataset,e=f.shakaPlayerCastReceiverId,f=f.shakaPlayerCastAndroidReceiverCompatible==="true");e.length&&(this.h.castReceiverAppId=e,this.h.castAndroidReceiverCompatible=f);b.dataset.shakaPlayerContainer="";b.ui=this;
this.kg()&&b.classList.add("shaka-mobile");this.g=new Z(a,b,c,d,this.h);c.controls||a.Kg(b);b.ui=this;c.ui=this;this.i=null}async destroy(a=!1){this.g&&await this.g.destroy(a);this.g=null;this.j&&await this.j.destroy();this.i=this.j=null}kg(){return tb().i()=="MOBILE"}mg(){return tb().i()=="TV"}getConfiguration(){const a=vI(this);Rm(a,this.h,vI(this),{},"");return a}configure(a,b){arguments.length==2&&typeof a=="string"&&(a=Sm(a,b));var c=Object.assign({},this.h);Rm(c,a,vI(this),{},"");var d=Um(c,
this.h);if(Object.keys(d).length&&(this.h=c,this.g.configure(this.h),this.g.dispatchEvent(new C("uiupdated")),(c=this.h.castSenderUrl)&&this.h.castReceiverAppId&&window.chrome&&!chrome.cast&&!this.mg())){d=!1;for(var e of document.getElementsByTagName("script"))if(e.src===c){d=!0;break}d||(e=document.createElement("script"),e.src=c,e.defer=!0,document.head.appendChild(e))}}Fi(){return this.g}ck(a){this.g.Hg(a)}cf(a,b){a&&!this.i&&this.l&&this.g&&(this.i=new nI(this.l,this.g));this.i&&this.i.cf(a,
b)}We(){this.i&&this.i.We()}};x("shaka.ui.Overlay",uI);uI.prototype.removeWatermark=uI.prototype.We;uI.prototype.setTextWatermark=uI.prototype.cf;uI.prototype.setEnabled=uI.prototype.ck;uI.prototype.getControls=uI.prototype.Fi;uI.prototype.configure=uI.prototype.configure;uI.prototype.getConfiguration=uI.prototype.getConfiguration;uI.prototype.isSmartTV=uI.prototype.mg;uI.prototype.isMobile=uI.prototype.kg;uI.prototype.destroy=uI.prototype.destroy;var wI=0;
uI.TrackLabelFormat={LANGUAGE:wI,ROLE:1,LANGUAGE_ROLE:2,LABEL:3};var tI=0,sI=1;uI.FailReasonCode={NO_BROWSER_SUPPORT:tI,PLAYER_FAILED_TO_LOAD:sI};document.readyState=="complete"?(async()=>{await Promise.resolve();oI()})():window.addEventListener("load",oI);function xI(a){const b=d=>({codecs:d.codecs,channelCount:d.channelCount,language:d.language,roles:d.roles,spatialAudio:d.spatialAudio}),c=b(a[0]);return a.every(d=>JSON.stringify(b(d))===JSON.stringify(c))}
function yI(a,b,c,d,e,f,g,h){var k=a.find(q=>q.active==1);a.length>1&&a[0].label&&f!=3&&xI(a)&&(f=3);const l=new Map;for(var m of a)m.codecs&&(l.has(m.language)||l.set(m.language,new Set),l.get(m.language).add(Oe(m.codecs)));m=YF(b);fj(b);b.appendChild(m);m=(q,t,u,v,y,w)=>{t=[q,t,w];g&&v!=null&&t.push(v);if(v=h)v=l.has(q)&&l.get(q).size>1;v&&y&&t.push(y);u&&f==3&&t.push(u);return t.join(": ")};const n=q=>{let t="";q>=5&&(t=" "+e.resolve("SURROUND"));return t},p=q=>{let t="";q=="aac"?t="AAC":q==="ac-3"?
t="Dolby":q==="ec-3"?t="DD+":q==="ac-4"?t="Dolby AC-4":q==="opus"?t="Opus":q==="flac"&&(t="fLaC");return t?" "+t:t},r=new Set;k=k?m(k.language,k.roles.join(", "),k.label,k.channelsCount,k.codecs&&Oe(k.codecs),k.spatialAudio):"";for(const q of a){a=q.language;const t=q.roles.join(", "),u=q.label,v=q.channelsCount,y=q.codecs&&Oe(q.codecs),w=q.spatialAudio,z=m(a,t,u,v,y,w);if(r.has(z))continue;r.add(z);const A=bj();A.addEventListener("click",()=>{c(q)});const B=J("span");A.appendChild(B);B.textContent=
zI(a,e);let E="";h&&g&&w&&(y=="ec-3"||y=="ac-4")?E+=" Dolby Atmos":(h&&l.has(a)&&l.get(a).size>1&&(E+=p(y)),g&&(E+=n(v)));switch(f){case wI:B.textContent+=E;break;case 1:B.textContent+=E;t?B.textContent=t:(sa("Track #"+JSON.stringify(q)+" does not have a role, but the UI is configured to only show role."),B.textContent="?");break;case 2:B.textContent+=E;t&&(B.textContent+=": "+t);break;case 3:u?B.textContent=u:(sa("Track #"+JSON.stringify(q)+" does not have a label, but the UI is configured to only show labels."),
B.textContent="?")}z==k&&(A.appendChild(aG()),B.classList.add("shaka-chosen-item"),A.ariaSelected="true",d.textContent=B.textContent);b.appendChild(A)}}function zI(a,b){if(!a&&!b)return"";switch(a){case "mul":return b.resolve("MULTIPLE_LANGUAGES");case "und":return b.resolve("UNDETERMINED_LANGUAGE");case "zxx":return b.resolve("NOT_APPLICABLE")}const c=fc(a);return a in ko?ko[a]:c in ko?ko[c]+" ("+a+")":b.resolve("UNRECOGNIZED_LANGUAGE")+" ("+a+")"}
function AI(a,b,c,d,e,f,g){var h=a.find(m=>m.active==1),k=YF(b);fj(b);b.appendChild(k);k=(m,n,p,r)=>{m=[m,n,r];p&&g==3&&m.push(p);return m.join(": ")};const l=new Set;h=h?k(h.language,h.roles.join(", "),h.label,h.forced):"";for(const m of a){a=m.language;const n=m.forced,p=f.resolve("SUBTITLE_FORCED"),r=m.roles.join(", "),q=m.label,t=k(a,r,q,n);if(l.has(t))continue;l.add(t);const u=bj();u.addEventListener("click",()=>{c(m)});const v=J("span");u.appendChild(v);v.textContent=zI(a,f);switch(g){case wI:n&&
(v.textContent+=" ("+p+")");break;case 1:r?v.textContent=r:(sa("Track #"+m.id+" does not have a role, but the UI is configured to only show role."),v.textContent="?");n&&(v.textContent+=" ("+p+")");break;case 2:r&&(v.textContent+=": "+r);n&&(v.textContent+=" ("+p+")");break;case 3:q?v.textContent=q:(sa("Track #"+m.id+" does not have a label, but the UI is configured to only show labels."),v.textContent="?")}d&&t==h&&(u.appendChild(aG()),v.classList.add("shaka-chosen-item"),u.ariaSelected="true",e.textContent=
v.textContent);b.appendChild(u)}};function BI(a,b){a.button=bj();a.button.classList.add("shaka-overflow-button");a.icon=new XF(a.button,b);b=J("label");b.classList.add("shaka-overflow-button-label");b.classList.add("shaka-overflow-menu-only");b.classList.add("shaka-overflow-button-label-inline");a.nameSpan=J("span");b.appendChild(a.nameSpan);a.currentSelection=J("span");a.currentSelection.classList.add("shaka-current-selection-span");b.appendChild(a.currentSelection);a.button.appendChild(b);a.parent.appendChild(a.button)}
function CI(a){a.menu=J("div");a.menu.classList.add("shaka-no-propagation");a.menu.classList.add("shaka-show-controls-on-mouse-over");a.menu.classList.add("shaka-settings-menu");a.menu.classList.add("shaka-hidden");a.backButton=bj();a.backButton.classList.add("shaka-back-to-overflow-button");a.menu.appendChild(a.backButton);a.eventManager.o(a.backButton,"click",()=>{a.controls.yc()});a.u=new XF(a.backButton,"M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z");
a.backSpan=J("span");a.backButton.appendChild(a.backSpan);a.controls.i.appendChild(a.menu)}
function DI(a){a.parent.classList.contains("shaka-overflow-menu")&&(a.u.use("m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"),a.eventManager.o(a.menu,"click",()=>{Y(a.menu,!1);Y(a.parent,!0);const b=c=>c.classList.contains("shaka-hidden")==0;Ea(a.parent.childNodes,b)&&Fa(a.parent.childNodes,b)[0].focus();rH(a.controls);EI(a)}))}
function EI(a){const b=a.menu.getBoundingClientRect();var c=window.getComputedStyle(a.menu);const d=parseFloat(c.paddingTop);c=parseFloat(c.paddingBottom);const e=a.m.getBoundingClientRect();a.menu.style.maxHeight=b.bottom-e.top-d-c-5+"px"}
var FI=class extends WF{constructor(a,b,c){super(a,b);this.m=this.controls.l;BI(this,c);CI(this);DI(this);this.eventManager.o(this.button,"click",()=>{this.controls.Ba()&&(this.menu.classList.contains("shaka-hidden")?(this.controls.dispatchEvent(new C("submenuopen")),Y(this.menu,!0),$F(this.menu),EI(this)):Y(this.menu,!1))});this.j=null;a=()=>EI(this);window.ResizeObserver?(this.j=new ResizeObserver(a),this.j.observe(this.controls.l)):this.eventManager.o(window,"resize",a)}release(){this.j&&(this.j.disconnect(),
this.j=null);super.release()}};x("shaka.ui.SettingsMenu",FI);function GI(a){a.backButton.ariaLabel=a.localization.resolve("BACK");a.button.ariaLabel=a.localization.resolve("LANGUAGE");a.nameSpan.textContent=a.localization.resolve("LANGUAGE");a.backSpan.textContent=a.localization.resolve("LANGUAGE")}
function HI(a){const b=a.player.getAudioTracks()||[];yI(b,a.menu,c=>{a.player.Jh(c);const d={preferredAudioLanguage:c.language,preferSpatialAudio:c.spatialAudio};c.label&&(d.preferredAudioLabel=c.label);c.channelsCount&&(d.preferredAudioChannelCount=c.channelsCount);a.player.configure(d)},a.currentSelection,a.localization,a.controls.g.trackLabelFormat,a.controls.g.showAudioChannelCountVariants,a.controls.g.showAudioCodec);$F(a.menu);a.controls.dispatchEvent(new C("languageselectionupdated"));a.button.setAttribute("shaka-status",
a.currentSelection.innerText);Y(a.button,a.menu.getElementsByTagName("button").length>2)}
var II=class extends FI{constructor(a,b){super(a,b,"M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q83 0 155.5 31.5t127 86q54.5 54.5 86 127T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Zm0-82q26-36 45-75t31-83H404q12 44 31 83t45 75Zm-104-16q-18-33-31.5-68.5T322-320H204q29 50 72.5 87t99.5 55Zm208 0q56-18 99.5-55t72.5-87H638q-9 38-22.5 73.5T584-178ZM170-400h136q-3-20-4.5-39.5T300-480q0-21 1.5-40.5T306-560H170q-5 20-7.5 39.5T160-480q0 21 2.5 40.5T170-400Zm216 0h188q3-20 4.5-39.5T580-480q0-21-1.5-40.5T574-560H386q-3 20-4.5 39.5T380-480q0 21 1.5 40.5T386-400Zm268 0h136q5-20 7.5-39.5T800-480q0-21-2.5-40.5T790-560H654q3 20 4.5 39.5T660-480q0 21-1.5 40.5T654-400Zm-16-240h118q-29-50-72.5-87T584-782q18 33 31.5 68.5T638-640Zm-234 0h152q-12-44-31-83t-45-75q-26 36-45 75t-31 83Zm-200 0h118q9-38 22.5-73.5T376-782q-56 18-99.5 55T204-640Z");this.button.classList.add("shaka-language-button");
this.button.classList.add("shaka-tooltip-status");this.menu.classList.add("shaka-audio-languages");this.eventManager.o(this.localization,"locale-updated",()=>{GI(this)});this.eventManager.o(this.localization,"locale-changed",()=>{GI(this)});this.eventManager.o(this.player,"loading",()=>{HI(this)});this.eventManager.o(this.player,"loaded",()=>{HI(this)});this.eventManager.o(this.player,"unloading",()=>{HI(this)});this.eventManager.o(this.player,"audiotrackschanged",()=>{HI(this)});GI(this);HI(this)}};
x("shaka.ui.AudioLanguageSelection",II);var JI=class{create(a,b){return new II(a,b)}};TH("language",new JI);jH("language",new JI);function KI(a){a.g.ariaLabel=a.localization.resolve("CAST");a.j.textContent=a.localization.resolve("CAST");LI(a)}
function MI(a){const b=a.h.vf()&&a.controls.na,c=a.h.Ka();Y(a.g,b);a.l.use(c?"M720-600v240q0 17-11.5 28.5T680-320h-87q-8 0-14.5-4.5T569-337q-29-81-81.5-147T364-596q-16-10-11.5-27t21.5-17h306q17 0 28.5 11.5T720-600ZM320-160q-16 0-28-9.5T277-195q-11-63-56.5-107T112-357q-15-2-23.5-14.5T80-400q0-17 11-28.5t26-9.5q94 12 160.5 79T357-198q2 16-9 27t-28 11Zm160 0q-17 0-28.5-11T438-199q-14-128-104.5-217T115-518q-16-2-25.5-14T80-560q0-17 10.5-29t25.5-10q161 13 274 125.5T518-201q2 17-9.5 29T480-160Zm-340 0q-25 0-42.5-17.5T80-220q0-25 17.5-42.5T140-280q25 0 42.5 17.5T200-220q0 25-17.5 42.5T140-160Zm740-560v480q0 33-23.5 56.5T800-160H638q-17 0-28.5-11.5T598-200q0-17 11.5-28.5T638-240h162v-480H160v6q0 17-11.5 28.5T120-674q-17 0-28.5-11.5T80-714v-6q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720Z":"M480-480Zm320 320H600q0-20-1.5-40t-4.5-40h206v-480H160v46q-20-3-40-4.5T80-680v-40q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160Zm-720 0v-120q50 0 85 35t35 85H80Zm200 0q0-83-58.5-141.5T80-360v-80q117 0 198.5 81.5T360-160h-80Zm160 0q0-75-28.5-140.5t-77-114q-48.5-48.5-114-77T80-520v-80q91 0 171 34.5T391-471q60 60 94.5 140T520-160h-80Z");
b&&(a.g.ariaPressed=c?"true":"false");LI(a)}async function NI(a){if(a.h.Ka())a.h.Uh();else try{a.g.disabled=!0,await a.h.cast(),a.g.disabled=!1}catch(b){a.g.disabled=!1,b.code!=8004&&a.controls.dispatchEvent(new C("error",(new Map).set("detail",b)))}}function LI(a){a.i.textContent=a.h.Ka()?a.h.Ue():a.localization.resolve("OFF")}
var OI=class extends WF{constructor(a,b){super(a,b);this.h=this.controls.D;this.g=bj();this.g.classList.add("shaka-cast-button");this.g.classList.add("shaka-tooltip");this.g.ariaPressed="false";this.l=new XF(this.g,"M480-480Zm320 320H600q0-20-1.5-40t-4.5-40h206v-480H160v46q-20-3-40-4.5T80-680v-40q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160Zm-720 0v-120q50 0 85 35t35 85H80Zm200 0q0-83-58.5-141.5T80-360v-80q117 0 198.5 81.5T360-160h-80Zm160 0q0-75-28.5-140.5t-77-114q-48.5-48.5-114-77T80-520v-80q91 0 171 34.5T391-471q60 60 94.5 140T520-160h-80Z");
a=J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");a.classList.add("shaka-simple-overflow-button-label-inline");this.j=J("span");a.appendChild(this.j);this.i=J("span");this.i.classList.add("shaka-current-selection-span");a.appendChild(this.i);this.g.appendChild(a);this.parent.appendChild(this.g);KI(this);MI(this);this.eventManager.o(this.localization,"locale-updated",()=>{KI(this)});this.eventManager.o(this.localization,"locale-changed",()=>{KI(this)});
this.eventManager.o(this.g,"click",()=>{this.controls.Ba()&&NI(this)});this.eventManager.o(this.controls,"caststatuschanged",()=>{MI(this)})}};x("shaka.ui.CastButton",OI);var PI=class{create(a,b){return new OI(a,b)}};TH("cast",new PI);jH("cast",new PI);function QI(a){a.backButton.ariaLabel=a.localization.resolve("BACK");a.button.ariaLabel=a.localization.resolve("CHAPTERS");a.nameSpan.textContent=a.localization.resolve("CHAPTERS");a.backSpan.textContent=a.localization.resolve("CHAPTERS")}
async function RI(a){const b=(g,h)=>!g&&!h||g.id===h.id&&g.title===h.title&&g.startTime===h.startTime&&g.endTime===h.endTime;var c="und";let d=[];var e=a.localization.g;for(var f of Array.from(e))if(c=f,a.player&&(d=await a.player.Wf(c)||[]),d.length)break;d.length||(c="und",a.player&&(d=await a.player.Wf(c)||[]));e=c!==a.h;f=a.g.length!==d.length||!a.g.some((g,h)=>{h=d.at(h);return b(g,h)||d.some(k=>b(g,k))});a.h=c;a.g=d;if(!d.length)SI(a);else if(e||f){for(const g of a.g)c=bj(),e=J("span"),e.classList.add("shaka-chapter"),
e.textContent=g.title,c.appendChild(e),a.eventManager.o(c,"click",()=>{a.controls.Ba()&&(a.video.currentTime=g.startTime)}),a.menu.appendChild(c);Y(a.button,!0);$F(a.menu)}}function SI(a){const b=YF(a.menu);fj(a.menu);a.menu.appendChild(b);Y(a.button,!1)}
var TI=class extends FI{constructor(a,b){super(a,b,"m400-200-182 91q-20 10-39-1.5T160-145v-495q0-33 23.5-56.5T240-720h320q33 0 56.5 23.5T640-640v495q0 23-19 34.5t-39 1.5l-182-91Zm360-40q-17 0-28.5-11.5T720-280v-520H320q-17 0-28.5-11.5T280-840q0-17 11.5-28.5T320-880h400q33 0 56.5 23.5T800-800v520q0 17-11.5 28.5T760-240Z");this.button.classList.add("shaka-chapter-button");this.menu.classList.add("shaka-chapters");this.button.classList.add("shaka-tooltip-status");this.g=[];this.h="und";this.eventManager.o(this.localization,
"locale-updated",()=>{QI(this);RI(this)});this.eventManager.o(this.localization,"locale-changed",()=>{QI(this);RI(this)});this.eventManager.o(this.player,"unloading",()=>{SI(this);this.h="und";this.g=[]});this.eventManager.o(this.player,"trackschanged",()=>{RI(this)});QI(this);RI(this)}};x("shaka.ui.ChapterSelection",TI);var UI=class{create(a,b){return new TI(a,b)}};TH("chapter",new UI);jH("chapter",new UI);function VI(a){a.g.ariaLabel=a.localization.resolve("FAST_FORWARD")}
var WI=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-fast-forward-button");this.g.classList.add("shaka-tooltip-status");this.g.setAttribute("shaka-status","1x");(new XF(this.g)).use("M100-315v-330q0-18 12-29t28-11q5 0 11 1t11 5l248 166q9 6 13.5 14.5T428-480q0 10-4.5 18.5T410-447L162-281q-5 4-11 5t-11 1q-16 0-28-11t-12-29Zm400 0v-330q0-18 12-29t28-11q5 0 11 1t11 5l248 166q9 6 13.5 14.5T828-480q0 10-4.5 18.5T810-447L562-281q-5 4-11 5t-11 1q-16 0-28-11t-12-29Z");this.parent.appendChild(this.g);
VI(this);this.h=this.controls.g.fastForwardRates;this.eventManager.o(this.localization,"locale-updated",()=>{VI(this)});this.eventManager.o(this.localization,"locale-changed",()=>{VI(this)});this.eventManager.o(this.g,"click",()=>{if(this.controls.Ba()&&this.video.duration){var c=this.h.indexOf(this.player.Pa())+1;c=c!=this.h.length?this.h[c]:this.h[0];this.video.paused&&this.video.play();this.player.Zb(c);this.g.setAttribute("shaka-status",c+"x")}});this.eventManager.o(this.player,"ratechange",()=>
{this.g.setAttribute("shaka-status",this.player.Pa()+"x")})}};x("shaka.ui.FastForwardButton",WI);jH("fast_forward",new class{create(a,b){return new WI(a,b)}});function XI(a){a.controls.Hd()?a.g.classList.remove("shaka-hidden"):a.g.classList.add("shaka-hidden")}function YI(a){const b=a.controls.fb()?"EXIT_FULL_SCREEN":"FULL_SCREEN";a.g.ariaLabel=a.localization.resolve(b)}
var ZI=class extends WF{constructor(a,b){super(a,b);this.h=this.controls.u;this.g=bj();this.g.classList.add("shaka-fullscreen-button");this.g.classList.add("shaka-tooltip");this.i=new XF(this.g,"M200-200h80q17 0 28.5 11.5T320-160q0 17-11.5 28.5T280-120H160q-17 0-28.5-11.5T120-160v-120q0-17 11.5-28.5T160-320q17 0 28.5 11.5T200-280v80Zm560 0v-80q0-17 11.5-28.5T800-320q17 0 28.5 11.5T840-280v120q0 17-11.5 28.5T800-120H680q-17 0-28.5-11.5T640-160q0-17 11.5-28.5T680-200h80ZM200-760v80q0 17-11.5 28.5T160-640q-17 0-28.5-11.5T120-680v-120q0-17 11.5-28.5T160-840h120q17 0 28.5 11.5T320-800q0 17-11.5 28.5T280-760h-80Zm560 0h-80q-17 0-28.5-11.5T640-800q0-17 11.5-28.5T680-840h120q17 0 28.5 11.5T840-800v120q0 17-11.5 28.5T800-640q-17 0-28.5-11.5T760-680v-80Z");XI(this);
this.parent.appendChild(this.g);YI(this);this.eventManager.o(this.localization,"locale-updated",()=>{YI(this)});this.eventManager.o(this.localization,"locale-changed",()=>{YI(this)});this.eventManager.o(this.g,"click",async()=>{this.controls.Ba()&&await this.controls.ef()});this.eventManager.o(document,"fullscreenchange",()=>{this.i.use(this.controls.fb()?"M240-240h-80q-17 0-28.5-11.5T120-280q0-17 11.5-28.5T160-320h120q17 0 28.5 11.5T320-280v120q0 17-11.5 28.5T280-120q-17 0-28.5-11.5T240-160v-80Zm480 0v80q0 17-11.5 28.5T680-120q-17 0-28.5-11.5T640-160v-120q0-17 11.5-28.5T680-320h120q17 0 28.5 11.5T840-280q0 17-11.5 28.5T800-240h-80ZM240-720v-80q0-17 11.5-28.5T280-840q17 0 28.5 11.5T320-800v120q0 17-11.5 28.5T280-640H160q-17 0-28.5-11.5T120-680q0-17 11.5-28.5T160-720h80Zm480 0h80q17 0 28.5 11.5T840-680q0 17-11.5 28.5T800-640H680q-17 0-28.5-11.5T640-680v-120q0-17 11.5-28.5T680-840q17 0 28.5 11.5T720-800v80Z":
"M200-200h80q17 0 28.5 11.5T320-160q0 17-11.5 28.5T280-120H160q-17 0-28.5-11.5T120-160v-120q0-17 11.5-28.5T160-320q17 0 28.5 11.5T200-280v80Zm560 0v-80q0-17 11.5-28.5T800-320q17 0 28.5 11.5T840-280v120q0 17-11.5 28.5T800-120H680q-17 0-28.5-11.5T640-160q0-17 11.5-28.5T680-200h80ZM200-760v80q0 17-11.5 28.5T160-640q-17 0-28.5-11.5T120-680v-120q0-17 11.5-28.5T160-840h120q17 0 28.5 11.5T320-800q0 17-11.5 28.5T280-760h-80Zm560 0h-80q-17 0-28.5-11.5T640-800q0-17 11.5-28.5T680-840h120q17 0 28.5 11.5T840-800v120q0 17-11.5 28.5T800-640q-17 0-28.5-11.5T760-680v-80Z");
YI(this)});this.eventManager.o(this.h,"loadedmetadata",()=>{XI(this)});this.eventManager.o(this.h,"loadeddata",()=>{XI(this)});this.eventManager.o(this.adManager,"ad-started",()=>{XI(this)});this.eventManager.o(this.adManager,"ad-stopped",()=>{XI(this)})}};x("shaka.ui.FullscreenButton",ZI);jH("fullscreen",new class{create(a,b){return new ZI(a,b)}});function $I(a){a.j.textContent=a.localization.resolve("LOOP");a.i.textContent=a.localization.resolve(a.video.loop?"ON":"OFF");a.m.use(a.video.loop?"M120-40q-33 0-56.5-23.5T40-120v-720q0-33 23.5-56.5T120-920h720q33 0 56.5 23.5T920-840v720q0 33-23.5 56.5T840-40H120Zm154-160h406q33 0 56.5-23.5T760-280v-120q0-17-11.5-28.5T720-440q-17 0-28.5 11.5T680-400v120H274l34-34q12-12 11.5-28T308-370q-12-12-28.5-12.5T251-371L148-268q-6 6-8.5 13t-2.5 15q0 8 2.5 15t8.5 13l103 103q12 12 28.5 11.5T308-110q11-12 11.5-28T308-166l-34-34Zm412-480-34 34q-12 12-11.5 28t11.5 28q12 12 28.5 12.5T709-589l103-103q6-6 8.5-13t2.5-15q0-8-2.5-15t-8.5-13L709-851q-12-12-28.5-11.5T652-850q-11 12-11.5 28t11.5 28l34 34H280q-33 0-56.5 23.5T200-680v120q0 17 11.5 28.5T240-520q17 0 28.5-11.5T280-560v-120h406Z":
"m274-200 34 34q12 12 11.5 28T308-110q-12 12-28.5 12.5T251-109L148-212q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l103-103q12-12 28.5-11.5T308-370q11 12 11.5 28T308-314l-34 34h406v-120q0-17 11.5-28.5T720-440q17 0 28.5 11.5T760-400v120q0 33-23.5 56.5T680-200H274Zm412-480H280v120q0 17-11.5 28.5T240-520q-17 0-28.5-11.5T200-560v-120q0-33 23.5-56.5T280-760h406l-34-34q-12-12-11.5-28t11.5-28q12-12 28.5-12.5T709-851l103 103q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L709-589q-12 12-28.5 11.5T652-590q-11-12-11.5-28t11.5-28l34-34Z");
a.g.ariaLabel=a.localization.resolve(a.video.loop?"EXIT_LOOP_MODE":"ENTER_LOOP_MODE")}function aJ(a){Y(a.g,!a.player.U())}
var bJ=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-loop-button");this.g.classList.add("shaka-tooltip");this.m=new XF(this.g,"m274-200 34 34q12 12 11.5 28T308-110q-12 12-28.5 12.5T251-109L148-212q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l103-103q12-12 28.5-11.5T308-370q11 12 11.5 28T308-314l-34 34h406v-120q0-17 11.5-28.5T720-440q17 0 28.5 11.5T760-400v120q0 33-23.5 56.5T680-200H274Zm412-480H280v120q0 17-11.5 28.5T240-520q-17 0-28.5-11.5T200-560v-120q0-33 23.5-56.5T280-760h406l-34-34q-12-12-11.5-28t11.5-28q12-12 28.5-12.5T709-851l103 103q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L709-589q-12 12-28.5 11.5T652-590q-11-12-11.5-28t11.5-28l34-34Z");a=
J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");a.classList.add("shaka-simple-overflow-button-label-inline");this.j=J("span");this.j.textContent=this.localization.resolve("LOOP");a.appendChild(this.j);this.i=J("span");this.i.classList.add("shaka-current-selection-span");a.appendChild(this.i);this.g.appendChild(a);$I(this);this.parent.appendChild(this.g);this.eventManager.o(this.localization,"locale-updated",()=>{$I(this)});this.eventManager.o(this.localization,
"locale-changed",()=>{$I(this)});this.eventManager.o(this.g,"click",()=>{this.controls.Ba()&&(this.video.loop=!this.video.loop,this.h.Ia(),this.h.wa(1))});this.l=this.video.loop;this.h=new H(()=>{this.l!=this.video.loop&&($I(this),this.l=this.video.loop)});this.h.wa(1);this.eventManager.o(this.player,"unloading",()=>{aJ(this)});this.eventManager.o(this.player,"loaded",()=>{aJ(this)});this.eventManager.o(this.player,"manifestupdated",()=>{aJ(this)});this.eventManager.o(this.video,"durationchange",
()=>{aJ(this)})}release(){this.h.stop();this.h=null;super.release()}};x("shaka.ui.LoopButton",bJ);var cJ=class{create(a,b){return new bJ(a,b)}};TH("loop",new cJ);jH("loop",new cJ);dG("loop",new cJ);function dJ(a){let b;b=a.ad?a.ad.isMuted()?"UNMUTE":"MUTE":a.video.muted||a.video.volume==0?"UNMUTE":"MUTE";a.g.ariaLabel=a.localization.resolve(b);a.h.textContent=a.localization.resolve(b)}
function eJ(a){let b;b=a.ad?a.ad.isMuted()?"M671-177q-11 7-22 13t-23 11q-15 7-30.5 0T574-176q-6-15 1.5-29.5T598-227q4-2 7.5-4t7.5-4L480-368v111q0 27-24.5 37.5T412-228L280-360H160q-17 0-28.5-11.5T120-400v-160q0-17 11.5-28.5T160-600h88L84-764q-11-11-11-28t11-28q11-11 28-11t28 11l680 680q11 11 11 28t-11 28q-11 11-28 11t-28-11l-93-93Zm89-304q0-83-44-151.5T598-735q-15-7-22-21.5t-2-29.5q6-16 21.5-23t31.5 0q97 43 155 131t58 197q0 33-6 65.5T817-353q-8 22-24.5 27.5t-30.5.5q-14-5-22.5-18t-.5-30q11-26 16-52.5t5-55.5ZM591-623q33 21 51 63t18 80v10q0 5-1 10-2 13-14 17t-22-6l-51-51q-6-6-9-13.5t-3-15.5v-77q0-12 10.5-17.5t20.5.5Zm-201-59q-6-6-6-14t6-14l22-22q19-19 43.5-8.5T480-703v63q0 14-12 19t-22-5l-56-56Z":"M760-481q0-83-44-151.5T598-735q-15-7-22-21.5t-2-29.5q6-16 21.5-23t31.5 0q97 43 155 131.5T840-481q0 108-58 196.5T627-153q-16 7-31.5 0T574-176q-5-15 2-29.5t22-21.5q74-34 118-102.5T760-481ZM280-360H160q-17 0-28.5-11.5T120-400v-160q0-17 11.5-28.5T160-600h120l132-132q19-19 43.5-8.5T480-703v446q0 27-24.5 37.5T412-228L280-360Zm380-120q0 42-19 79.5T591-339q-10 6-20.5.5T560-356v-250q0-12 10.5-17.5t20.5.5q31 25 50 63t19 80Z":
a.video.muted||a.video.volume==0?"M671-177q-11 7-22 13t-23 11q-15 7-30.5 0T574-176q-6-15 1.5-29.5T598-227q4-2 7.5-4t7.5-4L480-368v111q0 27-24.5 37.5T412-228L280-360H160q-17 0-28.5-11.5T120-400v-160q0-17 11.5-28.5T160-600h88L84-764q-11-11-11-28t11-28q11-11 28-11t28 11l680 680q11 11 11 28t-11 28q-11 11-28 11t-28-11l-93-93Zm89-304q0-83-44-151.5T598-735q-15-7-22-21.5t-2-29.5q6-16 21.5-23t31.5 0q97 43 155 131t58 197q0 33-6 65.5T817-353q-8 22-24.5 27.5t-30.5.5q-14-5-22.5-18t-.5-30q11-26 16-52.5t5-55.5ZM591-623q33 21 51 63t18 80v10q0 5-1 10-2 13-14 17t-22-6l-51-51q-6-6-9-13.5t-3-15.5v-77q0-12 10.5-17.5t20.5.5Zm-201-59q-6-6-6-14t6-14l22-22q19-19 43.5-8.5T480-703v63q0 14-12 19t-22-5l-56-56Z":
"M760-481q0-83-44-151.5T598-735q-15-7-22-21.5t-2-29.5q6-16 21.5-23t31.5 0q97 43 155 131.5T840-481q0 108-58 196.5T627-153q-16 7-31.5 0T574-176q-5-15 2-29.5t22-21.5q74-34 118-102.5T760-481ZM280-360H160q-17 0-28.5-11.5T120-400v-160q0-17 11.5-28.5T160-600h120l132-132q19-19 43.5-8.5T480-703v446q0 27-24.5 37.5T412-228L280-360Zm380-120q0 42-19 79.5T591-339q-10 6-20.5.5T560-356v-250q0-12 10.5-17.5t20.5.5q31 25 50 63t19 80Z";a.j.use(b)}
function fJ(a){let b=!0;a.ad&&a.ad.isLinear()?b=!0:a.player.Fe()&&(b=!1);Y(a.g,b)}
var gJ=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-mute-button");this.g.classList.add("shaka-tooltip");this.j=new XF(this.g,"M760-481q0-83-44-151.5T598-735q-15-7-22-21.5t-2-29.5q6-16 21.5-23t31.5 0q97 43 155 131.5T840-481q0 108-58 196.5T627-153q-16 7-31.5 0T574-176q-5-15 2-29.5t22-21.5q74-34 118-102.5T760-481ZM280-360H160q-17 0-28.5-11.5T120-400v-160q0-17 11.5-28.5T160-600h120l132-132q19-19 43.5-8.5T480-703v446q0 27-24.5 37.5T412-228L280-360Zm380-120q0 42-19 79.5T591-339q-10 6-20.5.5T560-356v-250q0-12 10.5-17.5t20.5.5q31 25 50 63t19 80Z");a=
J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");this.h=J("span");this.h.textContent=this.localization.resolve("MUTE");a.appendChild(this.h);this.i=J("span");this.i.classList.add("shaka-current-selection-span");a.appendChild(this.i);this.g.appendChild(a);this.parent.appendChild(this.g);dJ(this);eJ(this);this.eventManager.o(this.localization,"locale-updated",()=>{dJ(this)});this.eventManager.o(this.localization,"locale-changed",()=>{dJ(this)});this.eventManager.o(this.g,
"click",()=>{this.controls.Ba()&&(this.ad&&this.ad.isLinear()?this.ad.setMuted(!this.ad.isMuted()):this.video.muted||this.video.volume!=0?this.video.muted=!this.video.muted:this.video.volume=1)});this.eventManager.o(this.video,"volumechange",()=>{dJ(this);eJ(this)});this.eventManager.o(this.player,"loading",()=>{dJ(this);eJ(this)});this.eventManager.o(this.player,"loaded",()=>{fJ(this)});this.eventManager.o(this.player,"unloading",()=>{fJ(this)});this.eventManager.o(this.player,"trackschanged",()=>
{fJ(this)});this.eventManager.o(this.controls,"caststatuschanged",()=>{dJ(this);eJ(this)});this.eventManager.o(this.adManager,"ad-volume-changed",()=>{dJ(this);eJ(this)});this.eventManager.o(this.adManager,"ad-muted",()=>{dJ(this);eJ(this)});this.eventManager.o(this.adManager,"ad-started",()=>{fJ(this)});this.eventManager.o(this.adManager,"ad-stopped",()=>{this.ad=null;dJ(this);eJ(this);fJ(this)});fJ(this)}};x("shaka.ui.MuteButton",gJ);var hJ=class{create(a,b){return new gJ(a,b)}};TH("mute",new hJ);
jH("mute",new hJ);dG("mute",new hJ);function iJ(a){a.i.textContent=a.localization.resolve("PICTURE_IN_PICTURE");const b=a.controls.cd();a.g.ariaLabel=a.localization.resolve(b?"EXIT_PICTURE_IN_PICTURE":"ENTER_PICTURE_IN_PICTURE");a.h.textContent=a.localization.resolve(b?"ON":"OFF")}
function jJ(a){a.l.use("M160-160q-33 0-56.5-23.5T80-240v-240q0-17 11.5-28.5T120-520q17 0 28.5 11.5T160-480v240h640v-480H480q-17 0-28.5-11.5T440-760q0-17 11.5-28.5T480-800h320q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm400-263 95 95q12 12 28 12t28-12q12-12 12-28.5T711-385l-95-95h64q17 0 28.5-11.5T720-520q0-17-11.5-28.5T680-560H520q-17 0-28.5 11.5T480-520v160q0 17 11.5 28.5T520-320q17 0 28.5-11.5T560-360v-63ZM120-600q-17 0-28.5-11.5T80-640v-120q0-17 11.5-28.5T120-800h200q17 0 28.5 11.5T360-760v120q0 17-11.5 28.5T320-600H120Zm360 120Z");a.g.ariaLabel=
a.localization.resolve("EXIT_PICTURE_IN_PICTURE");a.h.textContent=a.localization.resolve("ON")}
function kJ(a){a.l.use("M120-520q-17 0-28.5-11.5T80-560q0-17 11.5-28.5T120-600h104L80-743q-12-12-12-28.5T80-800q12-12 28.5-12t28.5 12l143 144v-104q0-17 11.5-28.5T320-800q17 0 28.5 11.5T360-760v200q0 17-11.5 28.5T320-520H120Zm40 360q-33 0-56.5-23.5T80-240v-160q0-17 11.5-28.5T120-440q17 0 28.5 11.5T160-400v160h280q17 0 28.5 11.5T480-200q0 17-11.5 28.5T440-160H160Zm680-280q-17 0-28.5-11.5T800-480v-240H480q-17 0-28.5-11.5T440-760q0-17 11.5-28.5T480-800h320q33 0 56.5 23.5T880-720v240q0 17-11.5 28.5T840-440ZM600-160q-17 0-28.5-11.5T560-200v-120q0-17 11.5-28.5T600-360h240q17 0 28.5 11.5T880-320v120q0 17-11.5 28.5T840-160H600Z");a.g.ariaLabel=
a.localization.resolve("ENTER_PICTURE_IN_PICTURE");a.h.textContent=a.localization.resolve("OFF")}async function lJ(a){a.controls.Ee()?a.player&&a.player.bd()?(Y(a.g,!1),a.controls.cd()&&await a.controls.Dc()):Y(a.g,!0):(Y(a.g,!1),a.controls.cd()&&await a.controls.Dc())}
var mJ=class extends WF{constructor(a,b){super(a,b);this.j=this.controls.u;this.g=bj();this.g.classList.add("shaka-pip-button");this.g.classList.add("shaka-tooltip");this.l=new XF(this.g,"M120-520q-17 0-28.5-11.5T80-560q0-17 11.5-28.5T120-600h104L80-743q-12-12-12-28.5T80-800q12-12 28.5-12t28.5 12l143 144v-104q0-17 11.5-28.5T320-800q17 0 28.5 11.5T360-760v200q0 17-11.5 28.5T320-520H120Zm40 360q-33 0-56.5-23.5T80-240v-160q0-17 11.5-28.5T120-440q17 0 28.5 11.5T160-400v160h280q17 0 28.5 11.5T480-200q0 17-11.5 28.5T440-160H160Zm680-280q-17 0-28.5-11.5T800-480v-240H480q-17 0-28.5-11.5T440-760q0-17 11.5-28.5T480-800h320q33 0 56.5 23.5T880-720v240q0 17-11.5 28.5T840-440ZM600-160q-17 0-28.5-11.5T560-200v-120q0-17 11.5-28.5T600-360h240q17 0 28.5 11.5T880-320v120q0 17-11.5 28.5T840-160H600Z");a=
J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");a.classList.add("shaka-simple-overflow-button-label-inline");this.i=J("span");this.i.textContent=this.localization.resolve("PICTURE_IN_PICTURE");a.appendChild(this.i);this.h=J("span");this.h.classList.add("shaka-current-selection-span");a.appendChild(this.h);this.g.appendChild(a);iJ(this);this.parent.appendChild(this.g);this.controls.Ee()||Y(this.g,!1);this.eventManager.o(this.localization,"locale-updated",
()=>{iJ(this)});this.eventManager.o(this.localization,"locale-changed",()=>{iJ(this)});this.eventManager.o(this.g,"click",()=>{this.controls.Ba()&&this.controls.Dc()});this.eventManager.o(this.j,"enterpictureinpicture",()=>{jJ(this)});this.eventManager.o(this.j,"leavepictureinpicture",()=>{kJ(this)});this.eventManager.o(this.controls,"caststatuschanged",()=>{lJ(this)});this.eventManager.o(this.player,"trackschanged",()=>{lJ(this)});"documentPictureInPicture"in window&&this.eventManager.o(window.documentPictureInPicture,
"enter",c=>{jJ(this);this.eventManager.sa(c.window,"pagehide",()=>{kJ(this)})})}};x("shaka.ui.PipButton",mJ);var nJ=class{create(a,b){return new mJ(a,b)}};TH("picture_in_picture",new nJ);jH("picture_in_picture",new nJ);dG("picture_in_picture",new nJ);function oJ(a){a.backButton.ariaLabel=a.localization.resolve("BACK");a.button.ariaLabel=a.localization.resolve("PLAYBACK_RATE");a.nameSpan.textContent=a.localization.resolve("PLAYBACK_RATE");a.backSpan.textContent=a.localization.resolve("PLAYBACK_RATE")}
function pJ(a){const b=a.player.Pa();var c=ZF(a.menu,"material-svg-icon shaka-chosen-item");if(c){var d=c.parentElement;d.removeAttribute("aria-selected");const e=d.getElementsByTagName("span")[0];e&&e.classList.remove("shaka-chosen-item");d.removeChild(c)}if(c=Array.from(a.menu.querySelectorAll("span")).find(e=>e.textContent==b+"x"))d=c.parentElement,d.appendChild(aG()),d.ariaSelected="true",c.classList.add("shaka-chosen-item");a.currentSelection.textContent=b+"x";a.button.setAttribute("shaka-status",
b+"x");a.g&&(a.g.textContent=b+"x")}function qJ(a){for(const b of a.controls.g.playbackRates){const c=bj(),d=J("span");d.textContent=b+"x";c.appendChild(d);a.eventManager.o(c,"click",()=>{b==a.video.defaultPlaybackRate?a.player.Tc():a.player.Zb(b,!1)});a.menu.appendChild(c)}$F(a.menu)}
var rJ=class extends FI{constructor(a,b){super(a,b,"m426-330 195-125q14-9 14-25t-14-25L426-630q-15-10-30.5-1.5T380-605v250q0 18 15.5 26.5T426-330ZM121-440q17 0 30.5 11t18.5 28q6 23 14.5 43.5T204-317q9 15 7.5 32T198-256q-11 11-27 10t-25-14q-22-31-37-66.5T86-400q-3-16 7.5-28t27.5-12Zm77-264q12 12 13 29t-7 31q-11 20-19.5 41T170-559q-5 17-18.5 28T121-520q-17 0-27.5-12.5T87-561q8-38 23-73.5t36-66.5q9-13 25-13.5t27 10.5Zm56 505q12-13 29.5-14t32.5 8q20 11 40.5 20t42.5 15q17 5 28 18t11 30q0 17-12.5 27T397-88q-38-8-71.5-23T260-146q-14-9-15.5-25t9.5-28Zm186-639q0 17-10.5 30T402-790q-23 6-44 14.5T317-755q-15 9-32.5 7.5T255-761q-12-12-10.5-28.5T260-815q32-20 66.5-34.5T399-872q16-3 28.5 7t12.5 27Zm360 358q0-113-69.5-199.5T553-792q-15-4-24-17t-9-29q0-16 11-26.5t25-7.5q140 28 232 137t92 255q0 146-92 255T556-88q-14 3-25-7.5T520-122q0-16 9-29t24-17q108-26 177.5-112.5T800-480Z");this.button.classList.add("shaka-playbackrate-button");
this.menu.classList.add("shaka-playback-rates");this.button.classList.add("shaka-tooltip-status");Array.from(a.classList).includes("shaka-overflow-menu")||(this.g=J("span"),this.g.classList.add("shaka-overflow-playback-rate-mark"),this.button.appendChild(this.g));this.eventManager.o(this.localization,"locale-updated",()=>{oJ(this)});this.eventManager.o(this.localization,"locale-changed",()=>{oJ(this)});this.eventManager.o(this.player,"loaded",()=>{pJ(this)});this.eventManager.o(this.player,"ratechange",
()=>{pJ(this)});oJ(this);qJ(this);pJ(this)}};x("shaka.ui.PlaybackRateSelection",rJ);var sJ=class{create(a,b){return new rJ(a,b)}};TH("playback_rate",new sJ);jH("playback_rate",new sJ);function tJ(a,b){b!=a.g.textContent&&(a.g.textContent=b)}
var uJ=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-current-time");tJ(this,"0:00");this.parent.appendChild(this.g);this.eventManager.o(this.g,"click",()=>{this.controls.Ba()&&this.player.U()&&(this.video.currentTime=this.player.va().end)});this.eventManager.o(this.player,"loading",()=>{Y(this.g,!0)});this.eventManager.o(this.controls,"timeandseekrangeupdated",()=>{var c=this.controls.T,d=this.controls.Xf();const e=this.player.va();var f=e.end-e.start;isFinite(f)?
this.player.U()?(d=Math.max(0,Math.floor(e.end-d)),f=f>=3600,d>=1||c?(tJ(this,"- "+bG(d,f)),this.g.disabled=!1):(tJ(this,this.localization.resolve("LIVE")),this.g.disabled=!0)):(c=f>=3600,d=Math.max(0,d-e.start),f&&(d=Math.min(d,f)),d=bG(d,c),f&&(d+=" / "+bG(f,c)),tJ(this,d),this.g.disabled=!0):(tJ(this,this.localization.resolve("LIVE")),this.g.disabled=!0)});this.eventManager.o(this.player,"trackschanged",()=>{this.player.U()&&(this.g.ariaLabel=this.localization.resolve("SKIP_TO_LIVE"))});this.eventManager.o(this.adManager,
"ad-started",()=>{Y(this.g,!this.ad.isLinear())});this.eventManager.o(this.adManager,"ad-stopped",()=>{Y(this.g,!0)})}};x("shaka.ui.PresentationTimeTracker",uJ);jH("time_and_duration",new class{create(a,b){return new uJ(a,b)}});function vJ(a){a.g.ariaLabel=a.localization.resolve("RECENTER_VR");a.i.textContent=a.localization.resolve("RECENTER_VR")}
var wJ=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-recenter-vr-button");this.g.classList.add("shaka-tooltip");this.g.ariaPressed="false";new XF(this.g,"M479-359q-50 0-85-35t-35-85q0-50 35-85t85-35q50 0 85 35t35 85q0 50-35 85t-85 35Zm-57 222-85-85q-12-12-11.5-28.5T338-279q12-12 28.5-12t28.5 12l85 86 85-85q11-11 28-11t28 11q11 11 11 28t-11 28l-85 85q-12 12-27 18t-30 6q-15 0-30-6t-27-18ZM221-337l-85-85q-12-12-18-27t-6-30q0-15 6-30t18-27l85-85q12-12 28.5-12t28.5 12q12 12 12 28.5T278-564l-86 86 85 85q11 11 11 28t-11 28q-11 11-28 11t-28-11Zm116-401 85-85q12-12 27-18t30-6q15 0 30 6t27 18l85 85q12 12 12 28t-12 28q-12 12-28.5 12T564-682l-86-85-85 85q-11 11-28 11t-28-11q-11-11-11-28t11-28Zm344 343 85-85-85-85q-11-11-11-28t11-28q11-11 28-11t28 11l85 85q12 12 18 27t6 30q0 15-6 30t-18 27l-85 85q-12 12-28 11.5T681-338q-12-12-12-28.5t12-28.5Z");a=
J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");this.i=J("span");a.appendChild(this.i);this.h=J("span");this.h.classList.add("shaka-current-selection-span");a.appendChild(this.h);this.g.appendChild(a);this.parent.appendChild(this.g);vJ(this);this.eventManager.o(this.localization,"locale-updated",()=>{vJ(this)});this.eventManager.o(this.localization,"locale-changed",()=>{vJ(this)});const c=this.controls.C;this.eventManager.o(this.g,"click",()=>
{this.controls.Ba()&&(c.g?ZG(c.g):sa("Not playing VR content"))});this.eventManager.o(c,"vrstatuschanged",()=>{Y(this.g,this.controls.Gb())});Y(this.g,this.controls.Gb())}};x("shaka.ui.RecenterVRButton",wJ);var xJ=class{create(a,b){return new wJ(a,b)}};TH("recenter_vr",new xJ);jH("recenter_vr",new xJ);function yJ(a){const b=a.i?a.localization.resolve("AIRPLAY"):a.localization.resolve("CAST");a.g.ariaLabel=b;a.m.textContent=b}
async function BJ(a,b=!1){if(a.controls.D.vf()&&a.controls.na||!a.video.remote)Y(a.g,!1),a.h!=-1&&(a.video.remote.cancelWatchAvailability(a.h),a.h=-1);else if(a.video.remote.state=="disconnected"||b){b=c=>{if(a.player){const d=a.video.disableRemotePlayback;let e=!0;tb().M()&&a.player.bc()==fq&&a.player.$f()!="HLS"&&(e=!1);Y(a.g,e&&c&&!d)}else Y(a.g,!1)};try{a.h!=-1&&(await a.video.remote.cancelWatchAvailability(a.h),a.h=-1)}catch(c){}try{a.h=await a.video.remote.watchAvailability(b)}catch(c){b(!0)}}else Y(a.g,
!0),a.h!=-1&&(await a.video.remote.cancelWatchAvailability(a.h),a.h=-1)}
function CJ(a){a.i||(a.video.remote.state=="disconnected"?a.l.use("M480-480Zm320 320H600q0-20-1.5-40t-4.5-40h206v-480H160v46q-20-3-40-4.5T80-680v-40q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160Zm-720 0v-120q50 0 85 35t35 85H80Zm200 0q0-83-58.5-141.5T80-360v-80q117 0 198.5 81.5T360-160h-80Zm160 0q0-75-28.5-140.5t-77-114q-48.5-48.5-114-77T80-520v-80q91 0 171 34.5T391-471q60 60 94.5 140T520-160h-80Z"):a.l.use("M720-600v240q0 17-11.5 28.5T680-320h-87q-8 0-14.5-4.5T569-337q-29-81-81.5-147T364-596q-16-10-11.5-27t21.5-17h306q17 0 28.5 11.5T720-600ZM320-160q-16 0-28-9.5T277-195q-11-63-56.5-107T112-357q-15-2-23.5-14.5T80-400q0-17 11-28.5t26-9.5q94 12 160.5 79T357-198q2 16-9 27t-28 11Zm160 0q-17 0-28.5-11T438-199q-14-128-104.5-217T115-518q-16-2-25.5-14T80-560q0-17 10.5-29t25.5-10q161 13 274 125.5T518-201q2 17-9.5 29T480-160Zm-340 0q-25 0-42.5-17.5T80-220q0-25 17.5-42.5T140-280q25 0 42.5 17.5T200-220q0 25-17.5 42.5T140-160Zm740-560v480q0 33-23.5 56.5T800-160H638q-17 0-28.5-11.5T598-200q0-17 11.5-28.5T638-240h162v-480H160v6q0 17-11.5 28.5T120-674q-17 0-28.5-11.5T80-714v-6q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720Z"))}
var DJ=class extends WF{constructor(a,b){super(a,b);this.i=tb().M();this.g=bj();this.g.classList.add("shaka-remote-button");this.g.classList.add("shaka-tooltip");this.g.ariaPressed="false";this.l=new XF(this.g,this.i?"M80-280v-480q0-33 23.5-56.5T160-840h640q33 0 56.5 23.5T880-760v480q0 33-23.5 56.5T800-200h-80q-17 0-28.5-11.5T680-240q0-17 11.5-28.5T720-280h80v-480H160v480h80q17 0 28.5 11.5T280-240q0 17-11.5 28.5T240-200h-80q-33 0-56.5-23.5T80-280Zm232 160q-14 0-22-9.5t-8-20.5q0-5 2-10.5t7-10.5l161-161q6-6 13-9t15-3q8 0 15 3t13 9l161 161q5 5 7 10.5t2 10.5q0 11-8 20.5t-22 9.5H312Zm168-360Z":
"M480-480Zm320 320H600q0-20-1.5-40t-4.5-40h206v-480H160v46q-20-3-40-4.5T80-680v-40q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160Zm-720 0v-120q50 0 85 35t35 85H80Zm200 0q0-83-58.5-141.5T80-360v-80q117 0 198.5 81.5T360-160h-80Zm160 0q0-75-28.5-140.5t-77-114q-48.5-48.5-114-77T80-520v-80q91 0 171 34.5T391-471q60 60 94.5 140T520-160h-80Z");a=J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");this.m=J("span");a.appendChild(this.m);
this.j=J("span");this.j.classList.add("shaka-current-selection-span");a.appendChild(this.j);this.g.appendChild(a);this.parent.appendChild(this.g);this.h=-1;yJ(this);Y(this.g,!1);this.video.remote?(this.eventManager.o(this.localization,"locale-updated",()=>{yJ(this)}),this.eventManager.o(this.localization,"locale-changed",()=>{yJ(this)}),this.eventManager.o(this.controls,"caststatuschanged",()=>{BJ(this)}),this.eventManager.o(this.g,"click",()=>{this.controls.Ba()&&this.video.remote.prompt().catch(()=>
{})}),this.eventManager.o(this.video.remote,"connect",()=>{BJ(this);CJ(this)}),this.eventManager.o(this.video.remote,"connecting",()=>{BJ(this);CJ(this)}),this.eventManager.o(this.video.remote,"disconnect",()=>{BJ(this);CJ(this)}),this.eventManager.o(this.player,"loaded",()=>{BJ(this)}),BJ(this,!0),CJ(this)):this.g.classList.add("shaka-hidden")}release(){this.video.remote&&this.h!=-1&&this.video.remote.cancelWatchAvailability(this.h).catch(()=>{});super.release()}};x("shaka.ui.RemoteButton",DJ);
var EJ=class{create(a,b){return new DJ(a,b)}};TH("remote",new EJ);jH("remote",new EJ);function FJ(a){const b=a.player.bd()?"QUALITY":"RESOLUTION";a.button.ariaLabel=a.localization.resolve(b);a.backButton.ariaLabel=a.localization.resolve(b);a.backSpan.textContent=a.localization.resolve(b);a.nameSpan.textContent=a.localization.resolve(b);a.l.textContent=a.localization.resolve("AUTO_QUALITY");a.player.getConfiguration().abr.enabled&&(a.currentSelection.textContent=a.localization.resolve("AUTO_QUALITY"))}
function GJ(a){var b=YF(a.menu);fj(a.menu);a.menu.appendChild(b);b=0;b=a.player.bd()?HJ(a):IJ(a);const c=bj();c.classList.add("shaka-enable-abr-button");a.eventManager.o(c,"click",()=>{a.player.configure({abr:{enabled:!0}});GJ(a)});a.l=J("span");a.l.textContent=a.localization.resolve("AUTO_QUALITY");c.appendChild(a.l);a.player.getConfiguration().abr.enabled&&(c.ariaSelected="true",c.appendChild(aG()),a.l.classList.add("shaka-chosen-item"),a.currentSelection.textContent=a.localization.resolve("AUTO_QUALITY"));
a.button.setAttribute("shaka-status",a.currentSelection.textContent);a.menu.appendChild(c);$F(a.menu);a.controls.dispatchEvent(new C("resolutionselectionupdated"));FJ(a);Y(a.button,b>0)}
function JJ(a){var b=a.player.getConfiguration().abr.enabled;if(a.player.bd()){a.i.textContent="";a.i.style.display="none";a.g&&(a.g.textContent="",a.g.style.display="none");var c=a.player.zb()||[],d=c.find(e=>e.active);d&&(b?(a.h.textContent=d.bandwidth?KJ(a,d,c):"Unknown",a.h.style.display=""):a.h.style.display="none")}else c=a.player.getVideoTracks()||[],(d=c.find(e=>e.active))?(b?(a.h.textContent=d.height&&d.width?LJ(a,d,c):d.bandwidth?MJ(d.bandwidth):"Unknown",a.h.style.display=""):a.h.style.display=
"none",b=NJ(a,d.width,d.height),a.i.textContent=b,a.i.style.display=b!==""?"":"none",a.g&&(a.g.textContent=b,a.g.style.display=b!==""?"":"none")):a.g&&(b=a.player.getStats(),b=NJ(a,b.width,b.height),a.g.textContent=b,a.g.style.display=b!==""?"":"none")}function KJ(a,b,c){let d=MJ(b.bandwidth);if(a.controls.g.showAudioCodec){const e=f=>{let g="";f&&(g=Oe(f).toUpperCase());return g?" "+g:g};c.some(f=>e(f.codecs)!=e(b.codecs))&&(d+=e(b.codecs))}return d}
function LJ(a,b,c){var d=b.height||0,e=b.width||0,f=!0;if(b.pixelAspectRatio){const k=b.pixelAspectRatio.split(":").map(l=>Number(l));k.length===2?f=k[0]===k[1]:k.length===1&&(f=k[0]===1)}d>e&&f&&([e,d]=[d,e]);f=d;e/d>16/9&&(f=Math.round(e*9/16));d=f+"p";e=new Set;for(var g of c)g.frameRate&&e.add(Math.round(g.frameRate));e.size>1&&(g=b.frameRate)&&(g>=50||g<=20)&&(d+=Math.round(b.frameRate));if(b.codecs&&Oe(b.codecs).startsWith("dovi-"))d+=" Dolby Vision";else if(b.hdr=="PQ"||b.hdr=="HLG")d+=" HDR";
b.codecs&&Oe(b.codecs).startsWith("lcevc")&&(d+=" LCEVC");(b.videoLayout||"").includes("CH-STEREO")&&(d+=" 3D");const h=(k,l)=>k!=l&&k.height==l.height&&k.hdr==l.hdr&&(k.codecs?Oe(k.codecs).startsWith("dovi-"):!1)==(l.codecs?Oe(l.codecs).startsWith("dovi-"):!1)&&(k.codecs?Oe(k.codecs).startsWith("lcevc"):!1)==(l.codecs?Oe(l.codecs).startsWith("lcevc"):!1)&&Math.round(k.frameRate||0)==Math.round(l.frameRate||0);if(c.some(k=>h(b,k))&&(c.some(k=>h(b,k)&&k.bandwidth==b.bandwidth)||(d+=" ("+MJ(b.bandwidth)+
")"),a.controls.g.showVideoCodec)){const k=l=>{let m="";l&&(m=Oe(l).toUpperCase());return m?" "+m:m};c.some(l=>h(b,l)&&k(l.codecs)!=k(b.codecs))&&(d+=k(b.codecs))}return d}function MJ(a){return a>=1E6?(a/1E6).toFixed(1).replace(".0","")+" Mbps":Math.floor(a/1E3)+" Kbps"}
function NJ(a,b,c){if(!b||!c)return"";c>b&&([b,c]=[c,b]);b/c>16/9&&(c=Math.round(b*9/16));a=a.controls.g.qualityMarks;return c>=8640?c+"p":c>=4320?a["4320"]:c>=2160?a["2160"]:c>=1440?a["1440"]:c>=1080?a["1080"]:c>=720?a["720"]:""}
function HJ(a){let b=[];a.player.bc()==Fq||a.player.Ca()||(b=a.player.zb()||[]);const c=b.find(e=>e.active);c&&(b=b.filter(e=>{if(e.language!=c.language||a.controls.g.showAudioChannelCountVariants&&e.channelsCount&&c.channelsCount&&e.channelsCount!=c.channelsCount)return!1;const f=a.controls.g.trackLabelFormat;return(f==1||f==2)&&JSON.stringify(e.audioRoles)!=JSON.stringify(c.audioRoles)||f==3&&e.label!=c.label||!e.bandwidth?!1:!0}));b=b.filter((e,f)=>b.findIndex(g=>g.bandwidth==e.bandwidth)==f);
b.sort((e,f)=>f.bandwidth-e.bandwidth);const d=a.player.getConfiguration().abr.enabled;for(const e of b){const f=bj();f.classList.add("explicit-resolution");a.eventManager.o(f,"click",()=>{a.player.configure({abr:{enabled:!1}});a.player.Pd(e,a.controls.g.clearBufferOnQualityChange)});const g=J("span");g.textContent=e.bandwidth?KJ(a,e,b):"Unknown";f.appendChild(g);d||e!=c||(f.ariaSelected="true",f.appendChild(aG()),g.classList.add("shaka-chosen-item"),a.currentSelection.textContent=g.textContent);
a.menu.appendChild(f)}return b.length}
function IJ(a){let b=a.player.getVideoTracks()||[];const c=b.find(e=>e.active);b=b.filter((e,f)=>b.findIndex(g=>{let h=g.height==e.height&&g.bandwidth==e.bandwidth&&g.frameRate==e.frameRate&&g.hdr==e.hdr&&g.videoLayout==e.videoLayout&&xc(g.roles,e.roles);h&&a.controls.g.showVideoCodec&&g.codecs&&e.codecs&&(h=Oe(g.codecs)==Oe(e.codecs));return h})==f);b.sort((e,f)=>f.height==e.height||e.height==null||f.height==null?f.bandwidth-e.bandwidth:f.height-e.height);const d=a.player.getConfiguration().abr.enabled;
for(const e of b){const f=bj();f.classList.add("explicit-resolution");a.eventManager.o(f,"click",()=>{a.player.configure({abr:{enabled:!1}});a.player.Kh(e,a.controls.g.clearBufferOnQualityChange)});const g=J("span");g.textContent=e.height&&e.width?LJ(a,e,b):e.bandwidth?MJ(e.bandwidth):"Unknown";f.appendChild(g);const h=NJ(a,e.width,e.height);if(h!==""){const k=J("sup");k.classList.add("shaka-quality-mark");k.textContent=h;f.appendChild(k)}d||e!=c||(f.ariaSelected="true",f.appendChild(aG()),g.classList.add("shaka-chosen-item"),
a.currentSelection.textContent=g.textContent);a.menu.appendChild(f)}return b.length}
var OJ=class extends FI{constructor(a,b){super(a,b,"M480-120q-17 0-28.5-11.5T440-160v-160q0-17 11.5-28.5T480-360q17 0 28.5 11.5T520-320v40h280q17 0 28.5 11.5T840-240q0 17-11.5 28.5T800-200H520v40q0 17-11.5 28.5T480-120Zm-320-80q-17 0-28.5-11.5T120-240q0-17 11.5-28.5T160-280h160q17 0 28.5 11.5T360-240q0 17-11.5 28.5T320-200H160Zm160-160q-17 0-28.5-11.5T280-400v-40H160q-17 0-28.5-11.5T120-480q0-17 11.5-28.5T160-520h120v-40q0-17 11.5-28.5T320-600q17 0 28.5 11.5T360-560v160q0 17-11.5 28.5T320-360Zm160-80q-17 0-28.5-11.5T440-480q0-17 11.5-28.5T480-520h320q17 0 28.5 11.5T840-480q0 17-11.5 28.5T800-440H480Zm160-160q-17 0-28.5-11.5T600-640v-160q0-17 11.5-28.5T640-840q17 0 28.5 11.5T680-800v40h120q17 0 28.5 11.5T840-720q0 17-11.5 28.5T800-680H680v40q0 17-11.5 28.5T640-600Zm-480-80q-17 0-28.5-11.5T120-720q0-17 11.5-28.5T160-760h320q17 0 28.5 11.5T520-720q0 17-11.5 28.5T480-680H160Z");this.button.classList.add("shaka-resolution-button");
this.button.classList.add("shaka-tooltip-status");this.menu.classList.add("shaka-resolutions");this.h=J("span");this.h.classList.add("shaka-current-auto-quality");this.h.style.display="none";this.i=J("sup");this.i.classList.add("shaka-current-quality-mark");this.i.style.display="none";Array.from(a.classList).includes("shaka-overflow-menu")?this.parent.parentElement&&(this.g=ej(this.parent.parentElement)):(this.g=J("span"),this.g.classList.add("shaka-overflow-playback-rate-mark"),this.button.appendChild(this.g));
a=J("span");this.button.childNodes[1].appendChild(a);a.appendChild(this.currentSelection);a.appendChild(this.h);a.appendChild(this.i);this.eventManager.o(this.localization,"locale-updated",()=>{FJ(this)});this.eventManager.o(this.localization,"locale-changed",()=>{FJ(this)});this.eventManager.o(this.player,"loading",()=>{GJ(this);JJ(this)});this.eventManager.o(this.player,"loaded",()=>{GJ(this);JJ(this)});this.eventManager.o(this.player,"unloading",()=>{GJ(this);JJ(this)});this.eventManager.o(this.player,
"variantchanged",()=>{GJ(this);JJ(this)});this.eventManager.o(this.player,"trackschanged",()=>{GJ(this);JJ(this)});this.eventManager.o(this.player,"abrstatuschanged",()=>{GJ(this);JJ(this)});this.eventManager.o(this.player,"adaptation",()=>{GJ(this);JJ(this)});GJ(this)}};x("shaka.ui.ResolutionSelection",OJ);var PJ=class{create(a,b){return new OJ(a,b)}};TH("quality",new PJ);jH("quality",new PJ);function QJ(a){a.g.ariaLabel=a.localization.resolve("REWIND")}
var RJ=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-rewind-button");this.g.classList.add("shaka-tooltip-status");this.g.setAttribute("shaka-status",this.localization.resolve("OFF"));(new XF(this.g)).use("M798-281 550-447q-9-6-13.5-14.5T532-480q0-10 4.5-18.5T550-513l248-166q5-4 11-5t11-1q16 0 28 11t12 29v330q0 18-12 29t-28 11q-5 0-11-1t-11-5Zm-400 0L150-447q-9-6-13.5-14.5T132-480q0-10 4.5-18.5T150-513l248-166q5-4 11-5t11-1q16 0 28 11t12 29v330q0 18-12 29t-28 11q-5 0-11-1t-11-5Z");this.parent.appendChild(this.g);
QJ(this);this.h=this.controls.g.rewindRates;this.eventManager.o(this.localization,"locale-updated",()=>{QJ(this)});this.eventManager.o(this.localization,"locale-changed",()=>{QJ(this)});this.eventManager.o(this.g,"click",()=>{if(this.controls.Ba()&&this.video.duration){var c=this.h.indexOf(this.player.Pa())+1;c=c!=this.h.length?this.h[c]:this.h[0];this.video.paused&&this.video.play();this.player.Zb(c);this.g.setAttribute("shaka-status",c+"x")}});this.eventManager.o(this.player,"ratechange",()=>{this.g.setAttribute("shaka-status",
this.player.Pa()+"x")})}};x("shaka.ui.RewindButton",RJ);jH("rewind",new class{create(a,b){return new RJ(a,b)}});function SJ(a){a.g.ariaLabel=a.localization.resolve("DOWNLOAD_VIDEO_FRAME");a.h.textContent=a.localization.resolve("DOWNLOAD_VIDEO_FRAME")}function TJ(a){let b=!0;a.controls.Gb()&&(b=!1);b&&a.j.Ka()&&(b=!1);b&&(a.player.drmInfo()||a.player.bd())&&(b=!1);b&&a.ad&&(b=!1);b&&a.video.remote&&a.video.remote.state!="disconnected"&&(b=!1);Y(a.g,b)}
var UJ=class extends WF{constructor(a,b){super(a,b);this.j=this.controls.D;this.g=bj();this.g.classList.add("shaka-save.video-frame-button");this.g.classList.add("shaka-tooltip");new XF(this.g,"M480-337q-8 0-15-2.5t-13-8.5L308-492q-12-12-11.5-28t11.5-28q12-12 28.5-12.5T365-549l75 75v-286q0-17 11.5-28.5T480-800q17 0 28.5 11.5T520-760v286l75-75q12-12 28.5-11.5T652-548q11 12 11.5 28T652-492L508-348q-6 6-13 8.5t-15 2.5ZM240-160q-33 0-56.5-23.5T160-240v-80q0-17 11.5-28.5T200-360q17 0 28.5 11.5T240-320v80h480v-80q0-17 11.5-28.5T760-360q17 0 28.5 11.5T800-320v80q0 33-23.5 56.5T720-160H240Z");
a=J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");this.h=J("span");this.h.textContent=this.localization.resolve("DOWNLOAD_VIDEO_FRAME");a.appendChild(this.h);this.i=J("span");this.i.classList.add("shaka-current-selection-span");a.appendChild(this.i);this.g.appendChild(a);SJ(this);this.parent.appendChild(this.g);this.eventManager.o(this.localization,"locale-updated",()=>{SJ(this)});this.eventManager.o(this.localization,"locale-changed",()=>{SJ(this)});
this.eventManager.o(this.g,"click",()=>{var c=document.createElement("canvas"),d=c.getContext("2d");const e=this.controls.u;c.width=e.videoWidth;c.height=e.videoHeight;d.drawImage(e,0,0,c.width,c.height);c=c.toDataURL("image/png");d=document.createElement("a");d.href=c;d.download="videoframe_"+e.currentTime.toFixed(3)+".png";d.click()});this.eventManager.o(this.controls.C,"vrstatuschanged",()=>{TJ(this)});this.eventManager.o(this.adManager,"ad-started",()=>{TJ(this)});this.eventManager.o(this.adManager,
"ad-stopped",()=>{TJ(this)});this.eventManager.o(this.player,"unloading",()=>{TJ(this)});this.eventManager.o(this.player,"loaded",()=>{TJ(this)});this.eventManager.o(this.video,"play",()=>{TJ(this)});this.eventManager.o(this.video,"pause",()=>{TJ(this)});this.eventManager.o(this.video,"seeking",()=>{TJ(this)});this.eventManager.o(this.controls,"caststatuschanged",()=>{TJ(this)});TJ(this)}};x("shaka.ui.SaveVideoFrameButton",UJ);var VJ=class{create(a,b){return new UJ(a,b)}};TH("save_video_frame",new VJ);
dG("save_video_frame",new VJ);function WJ(a){a.h.ariaLabel=a.localization.resolve("SKIP_NEXT")}function XJ(a){var b=a.g.getItems().length;b=b>1&&a.g.getCurrentItemIndex()+1<b;Y(a.h,b)}
var YJ=class extends WF{constructor(a,b){super(a,b);if(this.g=this.player.ve())this.h=bj(),this.h.classList.add("shaka-skip-next-button"),this.h.classList.add("shaka-tooltip"),(new XF(this.h)).use("M660-280v-400q0-17 11.5-28.5T700-720q17 0 28.5 11.5T740-680v400q0 17-11.5 28.5T700-240q-17 0-28.5-11.5T660-280Zm-440-35v-330q0-18 12-29t28-11q5 0 11 1t11 5l248 166q9 6 13.5 14.5T548-480q0 10-4.5 18.5T530-447L282-281q-5 4-11 5t-11 1q-16 0-28-11t-12-29Z"),this.parent.appendChild(this.h),WJ(this),XJ(this),
this.eventManager.o(this.localization,"locale-updated",()=>{WJ(this)}),this.eventManager.o(this.localization,"locale-changed",()=>{WJ(this)}),this.eventManager.o(this.h,"click",()=>{this.controls.Ba()&&this.g.playItem(this.g.getCurrentItemIndex()+1)}),this.eventManager.o(this.g,"currentitemchanged",()=>{XJ(this)}),this.eventManager.o(this.g,"itemsinserted",()=>{XJ(this)}),this.eventManager.o(this.g,"itemsremoved",()=>{XJ(this)}),this.eventManager.o(this.player,"loading",()=>{XJ(this)})}};
x("shaka.ui.SkipNextButton",YJ);jH("skip_next",new class{create(a,b){return new YJ(a,b)}});function ZJ(a){a.h.ariaLabel=a.localization.resolve("SKIP_PREVIOUS")}function $J(a){const b=a.g.getItems().length>1&&a.g.getCurrentItemIndex()>0;Y(a.h,b)}
var aK=class extends WF{constructor(a,b){super(a,b);if(this.g=this.player.ve())this.h=bj(),this.h.classList.add("shaka-skip-previous-button"),this.h.classList.add("shaka-tooltip"),(new XF(this.h)).use("M220-280v-400q0-17 11.5-28.5T260-720q17 0 28.5 11.5T300-680v400q0 17-11.5 28.5T260-240q-17 0-28.5-11.5T220-280Zm458-1L430-447q-9-6-13.5-14.5T412-480q0-10 4.5-18.5T430-513l248-166q5-4 11-5t11-1q16 0 28 11t12 29v330q0 18-12 29t-28 11q-5 0-11-1t-11-5Z"),this.parent.appendChild(this.h),ZJ(this),$J(this),
this.eventManager.o(this.localization,"locale-updated",()=>{ZJ(this)}),this.eventManager.o(this.localization,"locale-changed",()=>{ZJ(this)}),this.eventManager.o(this.h,"click",()=>{this.controls.Ba()&&this.g.playItem(this.g.getCurrentItemIndex()-1)}),this.eventManager.o(this.g,"currentitemchanged",()=>{$J(this)}),this.eventManager.o(this.g,"itemsinserted",()=>{$J(this)}),this.eventManager.o(this.g,"itemsremoved",()=>{$J(this)}),this.eventManager.o(this.player,"loading",()=>{$J(this)})}};
x("shaka.ui.SkipPreviousButton",aK);jH("skip_previous",new class{create(a,b){return new aK(a,b)}});var bK=class extends jG{constructor(a,b){super(a,b);this.button.classList.add("shaka-small-play-button");this.button.classList.add("shaka-tooltip")}};x("shaka.ui.SmallPlayButton",bK);jH("play_pause",new class{create(a,b){return new bK(a,b)}});var cK=class extends WF{constructor(a,b){super(a,b);a=J("div");a.classList.add("shaka-spacer");a.ariaHidden="true";this.parent.appendChild(a)}};x("shaka.ui.Spacer",cK);jH("spacer",new class{create(a,b){return new cK(a,b)}});function dK(a){a.A.textContent=a.localization.resolve("STATISTICS");a.i.ariaLabel=a.localization.resolve("STATISTICS");a.l.textContent=a.localization.resolve(a.h.classList.contains("shaka-hidden")?"OFF":"ON")}
function eK(a){var b=J("div");b.classList.add("shaka-no-propagation");b.classList.add("shaka-statistics-close");const c=(new XF(b,"M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z")).g;c.classList.add("material-icons","notranslate");a.h.appendChild(b);a.eventManager.o(c,"click",()=>{fK(a)});for(const d of a.controls.g.statisticsList)d in
a.g&&!a.D.includes(d)?(b=gK(a,d),a.h.appendChild(b),a.C.push(d)):sa("Unrecognized statistic element:",d)}
function fK(a){a.h.classList.contains("shaka-hidden")?(a.u.use("M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-440q-17 0-28.5 11.5T280-520v200q0 17 11.5 28.5T320-280q17 0 28.5-11.5T360-320v-200q0-17-11.5-28.5T320-560Zm160-120q-17 0-28.5 11.5T440-640v320q0 17 11.5 28.5T480-280q17 0 28.5-11.5T520-320v-320q0-17-11.5-28.5T480-680Zm160 240q-17 0-28.5 11.5T600-400v80q0 17 11.5 28.5T640-280q17 0 28.5-11.5T680-320v-80q0-17-11.5-28.5T640-440Z"),a.j.wa(.1),
Y(a.h,!0)):(a.u.use("M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Zm120 200q-17 0-28.5 11.5T280-520v200q0 17 11.5 28.5T320-280q17 0 28.5-11.5T360-320v-200q0-17-11.5-28.5T320-560Zm160-120q-17 0-28.5 11.5T440-640v320q0 17 11.5 28.5T480-280q17 0 28.5-11.5T520-320v-320q0-17-11.5-28.5T480-680Zm160 240q-17 0-28.5 11.5T600-400v80q0 17 11.5 28.5T640-280q17 0 28.5-11.5T680-320v-80q0-17-11.5-28.5T640-440Z"),
a.j.stop(),Y(a.h,!1))}function gK(a,b){const c=J("div");var d=J("label");d.textContent=b+":";c.appendChild(d);d=J("span");d.textContent=a.B.get(b)(b);c.appendChild(d);a.m.set(b,d);return c}
var hK=class extends WF{constructor(a,b){super(a,b);this.i=bj();this.i.classList.add("shaka-statistics-button");this.u=new XF(this.i,"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Zm120 200q-17 0-28.5 11.5T280-520v200q0 17 11.5 28.5T320-280q17 0 28.5-11.5T360-320v-200q0-17-11.5-28.5T320-560Zm160-120q-17 0-28.5 11.5T440-640v320q0 17 11.5 28.5T480-280q17 0 28.5-11.5T520-320v-320q0-17-11.5-28.5T480-680Zm160 240q-17 0-28.5 11.5T600-400v80q0 17 11.5 28.5T640-280q17 0 28.5-11.5T680-320v-80q0-17-11.5-28.5T640-440Z");a=
J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-simple-overflow-button-label-inline");this.A=J("span");a.appendChild(this.A);this.l=J("span");this.l.classList.add("shaka-current-selection-span");a.appendChild(this.l);this.i.appendChild(a);this.parent.appendChild(this.i);this.h=J("div");this.h.classList.add("shaka-no-propagation");this.h.classList.add("shaka-show-controls-on-mouse-over");this.h.classList.add("shaka-statistics-container");this.h.classList.add("shaka-hidden");
this.controls.i.appendChild(this.h);this.C=[];this.D=["stateHistory","switchHistory"];this.g=this.player.getStats();this.m=new Map;a=h=>this.g[h]+" (px)";b=h=>this.g[h]+" (frames)";const c=h=>this.g[h].toFixed(2)+" (s)",d=h=>Math.round(this.g[h]/1E3)+" (kbits/s)",e=h=>{h=this.g[h];return bG(h,h>3600)},f=h=>this.g[h]+" (gaps)",g=h=>{h=parseInt(this.g[h],10);return h>2E9?(h/1E9).toFixed(2)+"GB":h>1E6?(h/1E6).toFixed(2)+"MB":h>1E3?(h/1E3).toFixed(2)+"KB":h+"B"};this.B=(new Map).set("width",a).set("height",
a).set("currentCodecs",h=>this.g[h]).set("completionPercent",h=>this.g[h]+" (%)").set("bufferingTime",c).set("drmTimeSeconds",c).set("licenseTime",c).set("liveLatency",c).set("loadLatency",c).set("manifestTimeSeconds",c).set("estimatedBandwidth",d).set("streamBandwidth",d).set("maxSegmentDuration",c).set("pauseTime",e).set("playTime",e).set("corruptedFrames",b).set("decodedFrames",b).set("droppedFrames",b).set("stallsDetected",h=>this.g[h]+" (stalls)").set("gapsJumped",f).set("manifestSizeBytes",
g).set("bytesDownloaded",g).set("nonFatalErrorCount",h=>this.g[h]+" (errors)").set("manifestPeriodCount",h=>this.g[h]+" (periods)").set("manifestGapCount",f);this.j=new H(()=>{this.g=this.player.getStats();for(const h of this.C){const k=this.m.get(h);k.textContent=this.B.get(h)(h);if(k&&k.parentElement){const l=this.g[h];typeof l=="string"?Y(k.parentElement,l!=""):Y(k.parentElement,!isNaN(l))}}});dK(this);eK(this);this.eventManager.o(this.localization,"locale-updated",()=>{dK(this)});this.eventManager.o(this.localization,
"locale-changed",()=>{dK(this)});this.eventManager.o(this.i,"click",()=>{fK(this);dK(this)})}release(){this.j.stop();this.j=null;super.release()}};x("shaka.ui.StatisticsButton",hK);var iK=class{create(a,b){return new hK(a,b)}};TH("statistics",new iK);dG("statistics",new iK);function jK(a){const b=bj();b.ariaSelected="true";a.menu.appendChild(b);b.appendChild(aG());a.g=J("span");b.appendChild(a.g)}function kK(a){a.button.ariaLabel=a.localization.resolve("CAPTIONS");a.backButton.ariaLabel=a.localization.resolve("BACK");a.nameSpan.textContent=a.localization.resolve("CAPTIONS");a.backSpan.textContent=a.localization.resolve("CAPTIONS");a.g.textContent=a.localization.resolve("OFF")}
function lK(a){const b=a.player.cc()||[];AI(b,a.menu,d=>mK(a,d),a.player.zc(),a.currentSelection,a.localization,a.controls.g.textTrackLabelFormat);const c=bj();c.classList.add("shaka-turn-captions-off-button");a.eventManager.o(c,"click",()=>{a.player.rd(!1);lK(a)});c.appendChild(a.g);a.menu.appendChild(c);a.player.zc()?a.g.classList.remove("shaka-chosen-item"):(c.ariaSelected="true",c.appendChild(aG()),a.g.classList.add("shaka-chosen-item"),a.currentSelection.textContent=a.localization.resolve("OFF"));
a.button.setAttribute("shaka-status",a.currentSelection.textContent);$F(a.menu);a.controls.dispatchEvent(new C("captionselectionupdated"));Y(a.button,b.length>0)}
function nK(a){a.player.zc()?(a.icon.use("M200-160q-33 0-56.5-23.5T120-240v-480q0-33 23.5-56.5T200-800h560q33 0 56.5 23.5T840-720v480q0 33-23.5 56.5T760-160H200Zm80-200h120q17 0 28.5-11.5T440-400v-20q0-9-6-15t-15-6h-18q-9 0-15 6t-6 15h-80v-120h80q0 9 6 15t15 6h18q9 0 15-6t6-15v-20q0-17-11.5-28.5T400-600H280q-17 0-28.5 11.5T240-560v160q0 17 11.5 28.5T280-360Zm400-240H560q-17 0-28.5 11.5T520-560v160q0 17 11.5 28.5T560-360h120q17 0 28.5-11.5T720-400v-20q0-9-6-15t-15-6h-18q-9 0-15 6t-6 15h-80v-120h80q0 9 6 15t15 6h18q9 0 15-6t6-15v-20q0-17-11.5-28.5T680-600Z"),a.button.ariaPressed=
"true"):(a.icon.use("M791-57 687-160H200q-33 0-56.5-23.5T120-240v-487l-65-65q-12-12-12-28.5T55-849q12-12 28.5-12t28.5 12l736 736q12 12 12 28t-12 28q-12 12-28.5 12T791-57ZM280-360h120q17 0 28.5-11.5T440-400v-25q0-8-6-14t-14-6h-20q-8 0-14 6t-6 14v5h-80v-127l-45-45v1q-7 5-11 13t-4 18v160q0 17 11.5 28.5T280-360Zm560-360v388q0 27-24.5 37.5T772-303l-66-66q7-5 10.5-13.5T720-400v-20q0-8-6-14t-14-6h-20q-8 0-14 6t-6 14h-5l-75-75v-45h80v5q0 8 6 14t14 6h20q8 0 14-6t6-14v-25q0-17-11.5-28.5T680-600H560q-17 0-28.5 11.5T520-560v5L343-732q-19-19-8.5-43.5T372-800h388q33 0 56.5 23.5T840-720Z"),
a.button.ariaPressed="false");a.controls.dispatchEvent(new C("captionselectionupdated"))}async function mK(a,b){a.player.Ze(b);await a.player.rd(!0);a.player.configure({preferredTextLanguage:b.language,preferForcedSubs:b.forced})}
var oK=class extends FI{constructor(a,b){super(a,b,"M200-160q-33 0-56.5-23.5T120-240v-480q0-33 23.5-56.5T200-800h560q33 0 56.5 23.5T840-720v480q0 33-23.5 56.5T760-160H200Zm80-200h120q17 0 28.5-11.5T440-400v-20q0-9-6-15t-15-6h-18q-9 0-15 6t-6 15h-80v-120h80q0 9 6 15t15 6h18q9 0 15-6t6-15v-20q0-17-11.5-28.5T400-600H280q-17 0-28.5 11.5T240-560v160q0 17 11.5 28.5T280-360Zm400-240H560q-17 0-28.5 11.5T520-560v160q0 17 11.5 28.5T560-360h120q17 0 28.5-11.5T720-400v-20q0-9-6-15t-15-6h-18q-9 0-15 6t-6 15h-80v-120h80q0 9 6 15t15 6h18q9 0 15-6t6-15v-20q0-17-11.5-28.5T680-600Z");this.button.classList.add("shaka-caption-button");
this.button.classList.add("shaka-tooltip-status");this.menu.classList.add("shaka-text-languages");this.player&&this.player.zc()?this.button.ariaPressed="true":this.button.ariaPressed="false";jK(this);this.eventManager.o(this.localization,"locale-updated",()=>{kK(this);lK(this)});this.eventManager.o(this.localization,"locale-changed",()=>{kK(this);lK(this)});this.eventManager.o(this.player,"loading",()=>{nK(this);lK(this)});this.eventManager.o(this.player,"loaded",()=>{nK(this);lK(this)});this.eventManager.o(this.player,
"unloading",()=>{nK(this);lK(this)});this.eventManager.o(this.player,"texttrackvisibility",()=>{nK(this);lK(this)});this.eventManager.o(this.player,"textchanged",()=>{lK(this)});this.eventManager.o(this.player,"trackschanged",()=>{lK(this)});nK(this);kK(this);lK(this)}};x("shaka.ui.TextSelection",oK);var pK=class{create(a,b){return new oK(a,b)}};TH("captions",new pK);jH("captions",new pK);function qK(a){a.g.ariaLabel=a.localization.resolve("TOGGLE_STEREOSCOPIC");a.i.textContent=a.localization.resolve("TOGGLE_STEREOSCOPIC")}
var rK=class extends WF{constructor(a,b){super(a,b);this.g=bj();this.g.classList.add("shaka-toggle-stereoscopic-button");this.g.classList.add("shaka-tooltip");this.g.ariaPressed="false";new XF(this.g,"M620-360H520q-8 0-14-6t-6-14v-200q0-8 6-14t14-6h100q17 0 28.5 11.5T660-560v160q0 17-11.5 28.5T620-360Zm-200 0h-90q-13 0-21.5-8.5T300-390q0-13 8.5-21.5T330-420h70v-40h-40q-8 0-14-6t-6-14q0-8 6-14t14-6h40v-40h-70q-13 0-21.5-8.5T300-570q0-13 8.5-21.5T330-600h90q17 0 28.5 11.5T460-560v160q0 17-11.5 28.5T420-360Zm140-60h40v-120h-40v120Zm280-20q-17 0-28.5-11.5T800-480q0-115-72.5-203T542-794l30 30q11 11 11 28t-11 28q-11 11-28 11t-28-11L387-837q-8-8-4.5-20t14.5-15q20-5 41-6.5t42-1.5q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 17-11.5 28.5T840-440ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-17 11.5-28.5T120-520q17 0 28.5 11.5T160-480q0 115 72.5 203T418-166l-30-30q-11-11-11-28t11-28q11-11 28-11t28 11l129 129q8 8 4.5 20T563-88q-20 5-41 6.5T480-80Z");a=
J("label");a.classList.add("shaka-overflow-button-label");a.classList.add("shaka-overflow-menu-only");this.i=J("span");a.appendChild(this.i);this.h=J("span");this.h.classList.add("shaka-current-selection-span");a.appendChild(this.h);this.g.appendChild(a);this.parent.appendChild(this.g);qK(this);this.eventManager.o(this.localization,"locale-updated",()=>{qK(this)});this.eventManager.o(this.localization,"locale-changed",()=>{qK(this)});const c=this.controls.C;this.eventManager.o(this.g,"click",()=>
{this.controls.Ba()&&c.sd()});this.eventManager.o(c,"vrstatuschanged",()=>{Y(this.g,this.controls.Gb())});Y(this.g,this.controls.Gb())}};x("shaka.ui.ToggleStereoscopicButton",rK);var sK=class{create(a,b){return new rK(a,b)}};TH("toggle_stereoscopic",new sK);jH("toggle_stereoscopic",new sK);function tK(a){a.video.muted?a.setValue(0):a.setValue(a.video.volume*100);uK(a)}function vK(a){let b=!0;a.ad&&a.ad.isLinear()?b=!0:a.player.Fe()&&(b=!1);Y(a.container,b)}function wK(a){const b=a.ad.getVolume();a.setValue(b*100);uK(a)}function xK(a){a.bar.ariaLabel=a.localization.resolve("VOLUME")}
function uK(a){const b=a.g.volumeBarColors,c=["to right"];c.push(b.level+a.getValue()+"%");c.push(b.base+a.getValue()+"%");c.push(b.base+"100%");a.container.style.background="linear-gradient("+c.join(",")+")"}
var yK=class extends sG{constructor(a,b){super(a,b,["shaka-volume-bar-container"],["shaka-volume-bar"]);this.g=this.controls.g;this.g.alwaysShowVolumeBar||this.container.classList.add("shaka-volume-bar-container-allow-hiding");this.setRange(0,100);this.eventManager.o(this.video,"volumechange",()=>tK(this));this.eventManager.o(this.player,"loading",()=>tK(this));this.eventManager.o(this.player,"loaded",()=>vK(this));this.eventManager.o(this.player,"unloading",()=>vK(this));this.eventManager.o(this.player,
"trackschanged",()=>vK(this));this.eventManager.o(this.controls,"caststatuschanged",()=>tK(this));this.eventManager.o(this.adManager,"ad-volume-changed",()=>wK(this));this.eventManager.o(this.adManager,"ad-muted",()=>wK(this));this.eventManager.o(this.adManager,"ad-started",()=>vK(this));this.eventManager.o(this.adManager,"ad-stopped",()=>{vK(this);tK(this)});this.eventManager.o(this.localization,"locale-updated",()=>xK(this));this.eventManager.o(this.localization,"locale-changed",()=>xK(this));tK(this);
xK(this);if(this.ad)this.onChange();vK(this)}onChange(){this.ad&&this.ad.isLinear()?this.ad.setVolume(this.getValue()/100):(this.video.volume=this.getValue()/100,this.video.volume>0&&(this.video.muted=!1))}};x("shaka.ui.VolumeBar",yK);jH("volume",new class{create(a,b){return new yK(a,b)}});}).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.ui-es2021.map